Commit Graph

8289 Commits

Author SHA1 Message Date
Chris Lattner
d7610e16fc Fix the JIT encoding of cmp*ss, which aborts with this assertion currently:
X86CodeEmitter.cpp:378: failed assertion `0 && "Immediate size not set!"'

I *think* this is right, but Evan, please verify.  It also looks like
CMPSDrr and maybe others are missing this info.  Evan, plz investigate.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45074 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-16 20:12:41 +00:00
Evan Cheng
7a831ce85f Make better use of instructions that clear high bits; fix various 2-wide shuffle bugs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45058 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-15 03:00:47 +00:00
Scott Michel
ec2a08ff06 Start committing working test cases for CellSPU.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45050 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-15 00:38:50 +00:00
Evan Cheng
0c5a507fcb Actually, MOVPQIto64mr is a dup of MOVPQI2QImr, MOV64toPQIrm is a dup of MOVQI2PQIrm.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45041 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-14 20:08:14 +00:00
Evan Cheng
2023ed720e Fix (mem) <-> low 64-bits of xmm bugs pointed out by David Greene. Mac OS X Leopard assembler recognizes movq.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45040 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-14 19:54:07 +00:00
Dale Johannesen
6e959b9afe x86-32 long doubles are 4-byte aligned on the stack
for parameter passing (only for that, on Darwin).



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45038 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-14 19:25:34 +00:00
Evan Cheng
fd9e473a82 Fix bsf / bsr jit encoding.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45037 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-14 18:49:43 +00:00
Evan Cheng
8ec861183b Oops. Forgot these.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45036 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-14 18:25:34 +00:00
Dan Gohman
1a8001e665 Fix Intel asm syntax for the bsr and bsf instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45030 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-14 15:10:00 +00:00
Evan Cheng
152804e9c1 Fix ctlz and cttz. llvm definition requires them to return number of bits in of the src type when value is zero.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45029 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-14 08:30:15 +00:00
Evan Cheng
18efe269b1 Implement ctlz and cttz with bsr and bsf.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45024 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-14 02:13:44 +00:00
Bill Wendling
6b1da9c39f Add flags to indicate that there are "never" side effects or that there "may be"
side effects for machine instructions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45022 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-14 01:48:59 +00:00
Evan Cheng
1314b00cf2 Fold some and + shift in x86 addressing mode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44970 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-13 00:43:27 +00:00
Evan Cheng
6e141fd048 Implicit def instructions, e.g. X86::IMPLICIT_DEF_GR32, are always re-materializable and they should not be spilled.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44960 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-12 23:12:09 +00:00
Duncan Sands
67f1c493d1 Remove host endianness info from TargetData and
put it in a new header System/Host.h instead.
Instead of getting the endianness from configure,
calculate it directly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44959 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-12 23:03:45 +00:00
Dan Gohman
890813243f Allow vector integer constants to be created with
SelectionDAG::getConstant, in the same way as vector floating-point
constants. This allows the legalize expansion code for @llvm.ctpop and
friends to be usable with vector types.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44954 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-12 22:21:26 +00:00
Evan Cheng
794405e6aa Use shuffles to implement insert_vector_elt for i32, i64, f32, and f64.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44929 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-12 07:55:34 +00:00
Evan Cheng
db2d524d5f Lower a build_vector with all constants into a constpool load unless it can be done with a move to low part.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44921 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-12 06:45:40 +00:00
Scott Michel
a28c6bfef3 Correct typo for Linux: s/esp/%rsp/
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44904 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-12 02:38:28 +00:00
Nate Begeman
6e041c2015 Allow the JIT to encode MMX instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44869 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-11 18:06:14 +00:00
Evan Cheng
14b32e1941 - Improved v8i16 shuffle lowering. It now uses pshuflw and pshufhw as much as
possible before resorting to pextrw and pinsrw.
- Better codegen for v4i32 shuffles masquerading as v8i16 or v16i8 shuffles.
- Improves (i16 extract_vector_element 0) codegen by recognizing
  (i32 extract_vector_element 0) does not require a pextrw.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44836 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-11 01:46:18 +00:00
Nate Begeman
844e0f9def x86 doesn't actually want to custom lower v3i32
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44835 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-11 01:41:33 +00:00
Chris Lattner
57d7d3f2d7 Move TargetData::hostIsLittleEndian out of line, which means we
don't have to #include config.h in it.  #including config.h breaks
other projects that have their own autoconf stuff and try to #include
the llvm headers.  One obscure example is llvm-gcc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44825 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-11 00:28:59 +00:00
Anton Korobeynikov
7eb587779e Hey, English is not my native language :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44820 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-10 23:10:20 +00:00
Anton Korobeynikov
2fb9deef10 Clarify the need of CFI() stuff
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44819 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-10 23:08:35 +00:00
Anton Korobeynikov
5f68287605 Provide convenient way to disable CFI stuff for old/broken assemblers.
Use it for Darwin.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44818 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-10 23:04:38 +00:00
Chris Lattner
ec90cd1bf8 Disable cfi directives for now, darwin does't support them.
These should probably be something like:

  CFI(".cfi_def_cfa_offset 16\n")

where CFI is defined to a noop on darwin and other platforms
that don't support those directives.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44803 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-10 19:10:18 +00:00
Anton Korobeynikov
3a7bcc4d1b And finally annotate X86-64 version of callback.
All bad stuff from SSE version is implicitely inherited :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44794 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-10 15:27:07 +00:00
Anton Korobeynikov
df7814ce92 Provide annotation for SSE version of callback. It's even more
broken, because doesn't mark xmm regs properly


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44793 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-10 15:13:55 +00:00
Anton Korobeynikov
a14b6696c0 Annotate JIT callback function with call frame infromation.
This will allow us (theoretically) to unwind through JITer.
The code wasn't verified, so I'm pretty sure offsets are wrong :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44792 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-10 14:54:42 +00:00
Bill Wendling
041b3f8356 Reverting 44702. It wasn't correct to rename them.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44727 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-08 23:58:46 +00:00
Chris Lattner
5aaddaa7b8 aesthetic changes, no functionality change. Evan, it's not clear
what 'Available' is, please add a comment near it and rename it
if appropriate.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44703 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-08 07:22:58 +00:00
Bill Wendling
320c630c1b Renaming:
isTriviallyReMaterializable -> hasNoSideEffects
  isReallyTriviallyReMaterializable -> isTriviallyReMaterializable


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44702 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-08 07:17:56 +00:00
Chris Lattner
d96428597b Fix a significant code quality regression I introduced on PPC64 quite
a while ago.  We now produce:

_foo:
	mflr r0
	std r0, 16(r1)
	ld r2, 16(r1)
	std r2, 0(r3)
	ld r0, 16(r1)
	mtlr r0
	blr 

instead of:

_foo:
	mflr r0
	std r0, 16(r1)
	lis r0, 0
	ori r0, r0, 16
	ldx r2, r1, r0
	std r2, 0(r3)
	ld r0, 16(r1)
	mtlr r0
	blr 

for:

void foo(void **X) {
  *X = __builtin_return_address(0);
}

on ppc64.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44701 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-08 07:04:58 +00:00
Chris Lattner
3fc027df4f implement __builtin_return_addr(0) on ppc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44700 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-08 06:59:59 +00:00
Chris Lattner
73944fb222 refactor some code to avoid overloading the name 'usesLR' in
different places to mean different things.  Document what the
one in PPCFunctionInfo means and when it is valid.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44699 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-08 06:39:11 +00:00
Evan Cheng
1713d8bcff Doh
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44694 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-08 01:01:07 +00:00
Evan Cheng
7658445fa6 Fix a compilation warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44692 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-08 01:00:31 +00:00
Evan Cheng
5a759616b6 Fix a compilation warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44691 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-08 01:00:21 +00:00
Bill Wendling
0f940c95d4 Initial commit of the machine code LICM pass. It successfully hoists this:
_foo:
        li r2, 0
LBB1_1: ; bb
        li r5, 0
        stw r5, 0(r3)
        addi r2, r2, 1
        addi r3, r3, 4
        cmplw cr0, r2, r4
        bne cr0, LBB1_1 ; bb
LBB1_2: ; return
        blr 

to:

_foo:
        li r2, 0
        li r5, 0
LBB1_1: ; bb
        stw r5, 0(r3)
        addi r2, r2, 1
        addi r3, r3, 4
        cmplw cr0, r2, r4
        bne cr0, LBB1_1 ; bb
LBB1_2: ; return
        blr

ZOMG!! :-)

Moar to come...


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44687 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-07 21:42:31 +00:00
Evan Cheng
779ccea5b6 Add comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44686 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-07 21:30:01 +00:00
Evan Cheng
8a86c3f3ae Much improved v8i16 shuffles. (Step 1).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44676 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-07 08:07:39 +00:00
Evan Cheng
1076210ee3 Remove a bogus optimization. It's not possible to do a move to low element to a <8 x i16> or <16 x i8> vector.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44669 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-06 22:14:22 +00:00
Chris Lattner
e70da20f9a implement a readme entry, compiling the code into:
_foo:
	movl	$12, %eax
	andl	4(%esp), %eax
	movl	_array(%eax), %eax
	ret

instead of:

_foo:
	movl	4(%esp), %eax
	shrl	$2, %eax
	andl	$3, %eax
	movl	_array(,%eax,4), %eax
	ret

As it turns out, this triggers all the time, in a wide variety of
situations, for example, I see diffs like this in various programs:

-       movl    8(%eax), %eax
-       shll    $2, %eax
-       andl    $1020, %eax
-       movl    (%esi,%eax), %eax
+       movzbl  8(%eax), %eax
+       movl    (%esi,%eax,4), %eax


-       shll    $2, %edx
-       andl    $1020, %edx
-       movl    (%edi,%edx), %edx
+       andl    $255, %edx
+       movl    (%edi,%edx,4), %edx

Unfortunately, I also see stuff like this, which can be fixed in the
X86 backend:

-       andl    $85, %ebx
-       addl    _bit_count(,%ebx,4), %ebp
+       shll    $2, %ebx
+       andl    $340, %ebx
+       addl    _bit_count(%ebx), %ebp



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44656 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-06 07:33:36 +00:00
Chris Lattner
81f2d71d52 add a note
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44638 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-05 23:05:06 +00:00
Chris Lattner
7d13015e32 add a note
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44637 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-05 22:58:19 +00:00
Scott Michel
42aa501491 Minor updates:
- Fix typo in SPUCallingConv.td
- Credit myself for CellSPU work
- Add CellSPU to 'all' host target list


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44627 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-05 21:23:16 +00:00
Evan Cheng
8c24e74b02 Added canFoldMemoryOperand for PPC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44623 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-05 18:41:29 +00:00
Evan Cheng
7db2811f6e Update foldMemoryOperand.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44621 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-05 18:36:37 +00:00
Chris Lattner
4d321c55c4 fix warnings
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44620 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-05 18:32:18 +00:00