Commit Graph

2012 Commits

Author SHA1 Message Date
Evan Cheng
b69d113201 Add argument registers to the end of call operand list (partial fix).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28783 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-14 18:17:40 +00:00
Jim Laskey
014f98c7e5 Place dwarf headers at earliest possible point. Well behaved when skipping
functions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28781 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-14 11:35:03 +00:00
Evan Cheng
004fb92615 Cygwin support: use _alloca to allocate stack if > 4k. Patch by Anton Korobeynikov.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28764 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-13 05:14:44 +00:00
Evan Cheng
e5e228df19 Comments to appease sabre.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28737 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-09 06:25:10 +00:00
Evan Cheng
b12223e284 Minor compilation speed improvement.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28736 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-09 06:24:42 +00:00
Chris Lattner
c0bad5706e Add support for "m" inline asm constraints.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28728 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-08 18:03:49 +00:00
Evan Cheng
e8bd0a332a Added X86FunctionInfo subclass of MachineFunction to record whether the
function that is being lowered is forced to use FP. Currently this is only
true for main() / Cygwin.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28703 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-06 23:30:24 +00:00
Evan Cheng
c21051ff96 A few new entries.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28683 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-04 09:08:00 +00:00
Evan Cheng
f8614db52e Be consistent with gcc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28682 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-04 07:24:07 +00:00
Evan Cheng
3649b0efa5 Cygwin support. Patch by Anton Korobeynikov!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28672 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-02 22:38:37 +00:00
Evan Cheng
aede9b9598 Use xor to clear a register.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28667 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-02 21:20:34 +00:00
Evan Cheng
94b1453278 Incorrect AT&T opcode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28666 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-02 21:09:10 +00:00
Chris Lattner
078d1826d2 Silence -pedantic warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28630 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-01 17:13:10 +00:00
Evan Cheng
2675534b7f Typos
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28617 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-01 05:53:27 +00:00
Evan Cheng
04b2562502 Remove a warning
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28607 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-01 00:30:39 +00:00
Evan Cheng
cbe70e1c4b Rename ASM modifier trunc8, trunc16 to subreg8, subreg16.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28606 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-31 22:34:26 +00:00
Evan Cheng
f91c10153c Sign extender
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28603 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-31 22:05:11 +00:00
Evan Cheng
190717d3cf Rename instructions for consistency sake.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28594 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-31 19:00:07 +00:00
Evan Cheng
9d09b89f39 Select vector_shuffle v1, undef <2, 3, ?, ?> to MOVHLPS.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28582 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-31 00:51:37 +00:00
Evan Cheng
8f692e2457 Remove dead code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28581 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-31 00:50:42 +00:00
Evan Cheng
5a47282149 A new entry
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28579 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-30 23:56:31 +00:00
Evan Cheng
b5e406afc3 MAXP{D|S} and MINP{D|S} are commutable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28578 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-30 23:47:30 +00:00
Evan Cheng
efeaed8fb4 Commute shufps / shufpd.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28577 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-30 23:34:30 +00:00
Evan Cheng
a0eaf2d0c5 Somehow I lost a condition when I was shuffling some code around. Anyway,
only transform a shufps to pshufd when the first two operands are the same.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28575 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-30 22:13:36 +00:00
Evan Cheng
aa3c1410b4 Fix a build breaker.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28574 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-30 21:45:53 +00:00
Evan Cheng
51da42c28f Oops. PSHUFD is only available with SSE2.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28573 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-30 21:30:59 +00:00
Evan Cheng
ccba76bb25 Allow shufps x, x, mask to be converted to pshufd x, mask to save a move.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28565 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-30 20:26:50 +00:00
Evan Cheng
eaf1e31775 Remove bogus comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28564 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-30 20:24:48 +00:00
Evan Cheng
5a622f2e06 Add a note about integer multiplication by constants.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28551 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-30 07:37:37 +00:00
Evan Cheng
e6ad27e917 A addressing mode folding enhancement:
Fold c2 in (x << c1) | c2 where (c2 < c1)
e.g.
int test(int x) {
  return (x << 3) + 7;
}

This can be codegen'd as:
leal 7(,%eax,8), %eax


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28550 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-30 06:59:36 +00:00
Evan Cheng
8c65fa564a Some new entries about truncate / anyext
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28548 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-30 06:23:50 +00:00
Evan Cheng
6848be1a27 Change RET node to include signness information of the return values. i.e.
RET chain, value1, sign1, value2, sign2, ...


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28510 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-26 23:10:12 +00:00
Evan Cheng
3fddf241d8 Vector argument must be passed in memory location aligned on 16-byte boundary.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28505 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-26 20:37:47 +00:00
Evan Cheng
1d6a9b3b6c Mac OS X ABI document lied. The first four XMM registers are used to pass
vector arguments, not three.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28504 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-26 19:22:06 +00:00
Evan Cheng
052fb5110f Minor update to make the code more clear
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28499 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-26 18:39:59 +00:00
Evan Cheng
f9d62dc6e5 Update more comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28498 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-26 18:37:16 +00:00
Evan Cheng
f9ff7c54be Fix some comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28497 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-26 18:25:43 +00:00
Evan Cheng
6f707999a1 No need to handle illegal types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28496 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-26 18:22:49 +00:00
Evan Cheng
138a24e4d4 Remove a couple of bogus casts.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28493 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-26 08:04:31 +00:00
Evan Cheng
57c0788e02 Minor bug caught by Ashwin Chandra
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28491 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-26 06:22:34 +00:00
Evan Cheng
cc1fc220a0 Consistency
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28488 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-25 23:31:23 +00:00
Evan Cheng
25e71d10a0 Some clean up.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28483 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-25 22:38:31 +00:00
Evan Cheng
a9bb445db0 Remove some dead code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28481 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-25 22:25:52 +00:00
Evan Cheng
932ad51fea X86 / Cygwin asm / alignment fixes.
Patch contributed by Anton Korobeynikov!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28480 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-25 21:59:08 +00:00
Evan Cheng
6b5783d0b1 Build breakage.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28475 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-25 18:56:34 +00:00
Evan Cheng
32fe1035a7 Switch X86 over to a call-selection model where the lowering code creates
the copyto/fromregs instead of making the X86ISD::CALL selection code create
them.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28463 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-25 00:59:30 +00:00
Evan Cheng
6a3d5a62f0 Assert if InflightSet is not cleared after instruction selecting a BB.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28459 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-25 00:24:28 +00:00
Evan Cheng
afe358e7d4 Clear HandleMap and ReplaceMap after instruction selection. Or it may cause
non-deterministic behavior.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28454 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-24 20:46:25 +00:00
Chris Lattner
d74ea2bbd8 Patches to make the LLVM sources more -pedantic clean. Patch provided
by Anton Korobeynikov!  This is a step towards closing PR786.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28447 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-24 17:04:05 +00:00
Chris Lattner
c6d0567324 Fix file header comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28441 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-23 23:20:42 +00:00
Evan Cheng
4db3af3511 Better way to check for vararg.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28440 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-23 21:08:24 +00:00
Evan Cheng
25caf63cd2 Remove PreprocessCCCArguments and PreprocessFastCCArguments now that
FORMAL_ARGUMENTS nodes include a token operand.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28439 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-23 21:06:34 +00:00
Chris Lattner
2d2970905c Implement an annoying part of the Darwin/X86 abi: the callee of a struct
return argument pops the hidden struct pointer if present, not the caller.

For example, in this testcase:

struct X { int D, E, F, G; };
struct X bar() {
  struct X a;
  a.D = 0;
  a.E = 1;
  a.F = 2;
  a.G = 3;
  return a;
}
void foo(struct X *P) {
  *P = bar();
}

We used to emit:

_foo:
        subl $28, %esp
        movl 32(%esp), %eax
        movl %eax, (%esp)
        call _bar
        addl $28, %esp
        ret
_bar:
        movl 4(%esp), %eax
        movl $0, (%eax)
        movl $1, 4(%eax)
        movl $2, 8(%eax)
        movl $3, 12(%eax)
        ret

This is correct on Linux/X86 but not Darwin/X86.  With this patch, we now
emit:

_foo:
        subl $28, %esp
        movl 32(%esp), %eax
        movl %eax, (%esp)
        call _bar
***     addl $24, %esp
        ret
_bar:
        movl 4(%esp), %eax
        movl $0, (%eax)
        movl $1, 4(%eax)
        movl $2, 8(%eax)
        movl $3, 12(%eax)
***     ret $4

For the record, GCC emits (which is functionally equivalent to our new code):

_bar:
        movl    4(%esp), %eax
        movl    $3, 12(%eax)
        movl    $2, 8(%eax)
        movl    $1, 4(%eax)
        movl    $0, (%eax)
        ret     $4
_foo:
        pushl   %esi
        subl    $40, %esp
        movl    48(%esp), %esi
        leal    16(%esp), %eax
        movl    %eax, (%esp)
        call    _bar
        subl    $4, %esp
        movl    16(%esp), %eax
        movl    %eax, (%esi)
        movl    20(%esp), %eax
        movl    %eax, 4(%esi)
        movl    24(%esp), %eax
        movl    %eax, 8(%esi)
        movl    28(%esp), %eax
        movl    %eax, 12(%esi)
        addl    $40, %esp
        popl    %esi
        ret

This fixes SingleSource/Benchmarks/CoyoteBench/fftbench with LLC and the
JIT, and fixes the X86-backend portion of PR729.  The CBE still needs to
be updated.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28438 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-23 18:50:38 +00:00
Evan Cheng
435bcd7f5f A isel deficiency.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28427 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-22 05:54:49 +00:00
Evan Cheng
3c380e71e1 Back out indirect branch load folding hack. It broke some tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28425 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-21 06:28:50 +00:00
Owen Anderson
bcd8a8264e Make TargetData strings less redundant.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28423 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-20 23:28:54 +00:00
Evan Cheng
4f7f71de43 - Use of load's chain result should be redirected to load's chain operand.
If it reads the chain result of the call, then the use, callseq_start,
  and call would form a cycle!
- Don't forget handle node replacement!
- There could also be a TokenFactor between the load and the callseq_start.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28420 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-20 09:21:39 +00:00
Evan Cheng
0d23bc4666 A new entry
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28419 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-20 07:44:53 +00:00
Evan Cheng
6b2e254437 Missing break statements.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28418 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-20 07:44:28 +00:00
Evan Cheng
fb914c43ba Remove unused patterns.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28417 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-20 01:40:16 +00:00
Evan Cheng
b245d92328 Handle indirect call which folds a load manually. This never matches by
the TableGen generated code since the load's chain result is read by
the callseq_start node.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28416 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-20 01:36:52 +00:00
Owen Anderson
d988b32aba Make all of the TargetMachine subclasses use the new string TargetData methods.
This is part of the on-going work on PR 761.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28414 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-20 00:24:56 +00:00
Chris Lattner
cdbaeb52ae CSRet allows varargs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28409 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-19 21:34:04 +00:00
Chris Lattner
778ae71f37 Add a note
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28401 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-19 20:55:31 +00:00
Chris Lattner
c11ab17a8e Split the SSE readme items out into their own README.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28400 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-19 20:51:43 +00:00
Chris Lattner
2420d81247 Split FP-stack notes out of the main readme. Next up: splitting out SSE.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28399 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-19 20:45:52 +00:00
Chris Lattner
de050a7509 Particularly ugly code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28397 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-19 19:41:33 +00:00
Evan Cheng
6de0163201 These can be transformed into lea as well. Not that we use this feature
currently...


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28393 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-19 18:43:41 +00:00
Evan Cheng
09e3c80984 - Use exact-width integer types, e.g. int32_t, to avoid confusion.
- Fix a couple of minor bugs in i16immSExt8 and i16immZExt8.
- Added loadiPTR fragment used for indirect jumps and calls.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28392 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-19 18:40:54 +00:00
Evan Cheng
fc8feb184e Explicitly specify MOV32mi can only be used store 32-bit GV, etc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28390 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-19 07:30:36 +00:00
Chris Lattner
3f705e660a add a note
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28383 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-18 17:38:16 +00:00
Evan Cheng
751458dac9 ImmMask should be 3 for a two-bit field; Compact X86II
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28381 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-18 06:27:15 +00:00
Evan Cheng
0f3ac8d8d4 getCalleeSaveRegs and getCalleeSaveRegClasses are no long TableGen'd.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28378 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-18 00:12:58 +00:00
Evan Cheng
af78ef526d Use generic iPTR instead i32 to represent pointer type.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28371 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-17 21:21:41 +00:00
Evan Cheng
c8999f2a0a Another entry
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28370 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-17 21:20:51 +00:00
Evan Cheng
c01d497255 Remove PointerType from class Target
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28368 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-17 21:20:27 +00:00
Evan Cheng
4ac8974d02 Should pass by reference.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28357 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-17 19:07:40 +00:00
Evan Cheng
4dfa85d1df Another entry
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28356 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-17 19:05:31 +00:00
Chris Lattner
aa9406b0c4 Implement the custom lowering hook right, returning values for all of the
arguments at once.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28327 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-16 17:14:26 +00:00
Chris Lattner
e7746c9084 Fix a bug I introduced yesterday, which broke functions with *no* arguments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28326 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-16 17:08:35 +00:00
Evan Cheng
069287d460 X86 integer register classes naming changes. Make them consistent with FP, vector classes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28324 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-16 07:21:53 +00:00
Chris Lattner
8c0c10c2b9 Add a chain to FORMAL_ARGUMENTS. This is a minimal port of the X86 backend,
it doesn't currently use/maintain the chain properly.  Also, make the
X86ISelLowering.cpp file 80-col clean.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28320 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-16 06:45:34 +00:00
Chris Lattner
98d0d7d6f0 More coverity fixes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28266 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-12 21:14:20 +00:00
Chris Lattner
03ea4c8326 Dead variable
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28265 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-12 21:12:22 +00:00
Evan Cheng
0bbac9ffd1 Remove dead code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28261 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-12 19:03:56 +00:00
Owen Anderson
07000c6f01 Refactor a bunch of includes so that TargetMachine.h doesn't have to include
TargetData.h.  This should make recompiles a bit faster with my current
TargetData tinkering.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28238 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-12 06:33:49 +00:00
Evan Cheng
f4df680ad4 Add MOV16_rm / MOV32_rm and MOV16_mr / MOV32_mr to isLoadFromStackSlot and isStoreToStackSlot
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28223 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-11 07:33:49 +00:00
Evan Cheng
8399c5cbe4 Remove a completed entry.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28199 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-09 06:54:05 +00:00
Chris Lattner
7faec9b93a Implement MASM sections correctly, without a "has masm sections flag" and a bunch of special case code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28194 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-09 05:33:48 +00:00
Chris Lattner
c9260a1556 MASM doesn't have one of these.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28190 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-09 05:21:47 +00:00
Chris Lattner
e7027d5339 Preserve prior behavior
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28187 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-09 05:15:24 +00:00
Chris Lattner
dad9c5a14f Fix the MASM asmprinter's lies. It does not want to emit code to .text/.data
it wants it emitted to _text/_data.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28185 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-09 05:12:53 +00:00
Chris Lattner
4632d7a570 Split SwitchSection into SwitchTo{Text|Data}Section methods.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28184 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-09 04:59:56 +00:00
Chris Lattner
9fd868ae0a Another bad case I noticed
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28177 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-08 21:39:45 +00:00
Chris Lattner
8ef67ac3c3 add a note
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28176 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-08 21:24:21 +00:00
Evan Cheng
403be7eafc Fixing truncate. Previously we were emitting truncate from r16 to r8 as
movw. That is we promote the destination operand to r16. So
        %CH = TRUNC_R16_R8 %BP
is emitted as
        movw %bp, %cx.

This is incorrect. If %cl is live, it would be clobbered.
Ideally we want to do the opposite, that is emitted it as
        movb ??, %ch
But this is not possible since %bp does not have a r8 sub-register.

We are now defining a new register class R16_ which is a subclass of R16
containing only those 16-bit registers that have r8 sub-registers (i.e.
AX - DX). We isel the truncate to two instructions, a MOV16to16_ to copy the
value to the R16_ class, followed by a TRUNC_R16_R8.

Due to bug 770, the register colaescer is not going to coalesce between R16 and
R16_. That will be fixed later so we can eliminate the MOV16to16_. Right now, it
can only be eliminated if we are lucky that source and destination registers are
the same.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28164 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-08 08:01:26 +00:00
Evan Cheng
74811450b2 Typo's
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28158 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-07 10:10:20 +00:00
Jeff Cohen
d43b18d9e4 Fix some loose ends in MASM support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28148 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-06 21:27:14 +00:00
Chris Lattner
80a7ecc923 Teach the X86 backend about non-i32 inline asm register classes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28139 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-06 00:29:37 +00:00
Chris Lattner
7660ebc90a Print *some* grouping around inline asm blocks so we know where they are.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28133 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-05 21:48:50 +00:00
Chris Lattner
bd04aa5796 Teach the code generator to use cvtss2sd as extload f32 -> f64
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28131 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-05 21:35:18 +00:00
Evan Cheng
4713724eda Need extload patterns after Chris' DAG combiner changes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28127 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-05 08:23:07 +00:00
Evan Cheng
8f7f7125e9 Better implementation of truncate. ISel matches it to a pseudo instruction
that gets emitted as movl (for r32 to i16, i8) or a movw (for r16 to i8). And
if the destination gets allocated a subregister of the source operand, then
the instruction will not be emitted at all.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28119 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-05 05:40:20 +00:00
Chris Lattner
8b915b4ed2 Remove and simplify some more machineinstr/machineoperand stuff.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28105 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-04 18:16:01 +00:00
Chris Lattner
2d90ac7ca6 Rename MO_VirtualRegister -> MO_Register. Clean up immediate handling.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28104 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-04 18:05:43 +00:00
Chris Lattner
e53f4a055f Move some methods out of MachineInstr into MachineOperand
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28102 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-04 17:52:23 +00:00
Chris Lattner
63b3d7113d There shalt be only one "immediate" operand type!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28099 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-04 17:21:20 +00:00
Jeff Cohen
10efcfabf1 Make external globals public; other minor cleanup.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28096 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-04 16:20:22 +00:00
Jeff Cohen
a6e24d8caf Make Intel syntax the default when LLVM is built with VC++.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28095 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-04 16:19:27 +00:00
Chris Lattner
4efeab208c Remove a bunch more dead V9 specific stuff
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28094 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-04 01:26:39 +00:00
Chris Lattner
ea50fabfd4 Remove a bunch more SparcV9 specific stuff
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28093 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-04 01:15:02 +00:00
Chris Lattner
34fb2cad46 Remove some more V9-specific stuff.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28092 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-04 00:49:59 +00:00
Chris Lattner
10f3597c4e Remove some more unused stuff from MachineInstr that was leftover from V9.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28091 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-04 00:44:25 +00:00
Chris Lattner
0e57629a93 Simplify handling of relocations
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28090 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-04 00:42:08 +00:00
Evan Cheng
9e062ed516 Use movsd to shuffle in the lowest two elements of a v4f32 / v4i32 vector when
movlps cannot be used (e.g. when load from m64 has multiple uses).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28089 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-03 20:32:03 +00:00
Chris Lattner
5a032de387 Change from using MachineRelocation ctors to using static methods
in MachineRelocation to create Relocations.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28088 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-03 20:30:20 +00:00
Chris Lattner
93e5c284d7 inline a simple method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28083 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-03 17:21:32 +00:00
Chris Lattner
b4432f3d47 Suck block address tracking out of targets into the JIT Emitter. This
simplifies the MachineCodeEmitter interface just a little bit and makes
BasicBlocks work like constant pools and jump tables.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28082 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-03 17:10:41 +00:00
Nate Begeman
67977ad19c Teach the x86 jit how to handle jump tables not directly used by a jump
instruction.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28080 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-03 04:52:47 +00:00
Owen Anderson
a69571c799 Refactor TargetMachine, pushing handling of TargetData into the target-specific subclasses. This has one caller-visible change: getTargetData() now returns a pointer instead of a reference.
This fixes PR 759.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28074 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-03 01:29:57 +00:00
Chris Lattner
af1563fb62 Change the BasicBlockAddrs map to be a vector, indexed by MBB number.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28069 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-03 00:32:55 +00:00
Chris Lattner
f75f9be3fb Several related changes:
1. Change several methods in the MachineCodeEmitter class to be pure virtual.
2. Suck emitConstantPool/initJumpTableInfo into startFunction, removing them
   from the MachineCodeEmitter interface, and reducing the amount of target-
   specific code.
3. Change the JITEmitter so that it allocates constantpools and jump tables
   *right* next to the functions that they belong to, instead of in a separate
   pool of memory.  This makes all memory for a function be contiguous, and
   means the JITEmitter only tracks one block of memory now.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28065 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-02 23:22:24 +00:00
Nate Begeman
a11a92976a Remove some stuff from the README
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28063 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-02 22:43:31 +00:00
Chris Lattner
d3f0aefc33 Fix a purely hypothetical problem (for now): emitWord emits in the host
byte format.  This doesn't work when using the code emitter in a cross target
environment.  Since the code emitter is only really used by the JIT, this
isn't a current problem, but if we ever start emitting .o files, it would be.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28060 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-02 19:14:47 +00:00
Chris Lattner
43b429b059 Refactor the machine code emitter interface to pull the pointers for the current
code emission location into the base class, instead of being in the derived classes.

This change means that low-level methods like emitByte/emitWord now are no longer
virtual (yaay for speed), and we now have a framework to support growable code
segments.  This implements feature request #1 of PR469.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28059 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-02 18:27:26 +00:00
Nate Begeman
6e0f386896 Hooray, everyone now uses the same printBasicBlockLabel implementation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28056 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-02 17:34:51 +00:00
Chris Lattner
608c189534 There is no reason to use a virtual method to store this word.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28053 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-02 17:16:20 +00:00
Nate Begeman
cdf38c4edb Extend printBasicBlockLabel a bit so that it can be used to print all
basic block labels, consolidating the code to do so in one place for each
target.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28050 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-02 05:37:32 +00:00
Jeff Cohen
51b776d259 De-virtualize SwitchSection.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28047 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-02 03:58:45 +00:00
Jeff Cohen
c6a057b04d De-virtualize EmitZeroes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28046 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-02 03:46:13 +00:00
Jeff Cohen
4f1ea1e9d9 Finish support for Microsoft ML/MASM. May still be a few rough edges.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28045 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-02 03:11:50 +00:00
Jeff Cohen
c884db47f1 Make Intel syntax mode friendlier to Microsoft ML assembler (still needs more work).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28044 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-02 01:16:28 +00:00
Chris Lattner
99f2632b4b Remove %'s from register names when in intel mode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28027 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-01 05:53:50 +00:00
Jeff Cohen
10a59ce701 Mingw32 patches supplied by Anton Korobeynikov.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28023 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-29 18:41:44 +00:00
Evan Cheng
55c25f2a2f I can't spell: Register, not Regsiter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28021 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-28 23:19:39 +00:00
Evan Cheng
62f2700bcf Implemented x86 inline asm b, h, w, k modifiers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28020 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-28 23:11:40 +00:00
Evan Cheng
347d5f789a Initial caller side support (for CCC only, not FastCC) of 128-bit vector
passing by value.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28015 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-28 21:29:37 +00:00
Evan Cheng
3d48a90fbd Bare-bone X86 inline asm printer support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28014 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-28 21:19:05 +00:00
Evan Cheng
43f3bd310b Implement four-wide shuffle with 2 shufps if no more than two elements come
from each vector. e.g.
        shuffle(G1, G2, 7, 1, 5, 2)
==>
        movaps _G2, %xmm0
        shufps $151, _G1, %xmm0
        shufps $216, %xmm0, %xmm0


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28011 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-28 07:03:38 +00:00
Evan Cheng
020c41f21e TargetLowering::LowerArguments should return a VBIT_CONVERT of
FORMAL_ARGUMENTS SDOperand in the return result vector.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28009 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-28 05:25:15 +00:00
Evan Cheng
ed1492eaf5 Use movaps instead of movapd for spill / restore.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28005 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-28 02:23:35 +00:00
Chris Lattner
217fde5255 Add a note
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27998 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-27 21:40:57 +00:00
Evan Cheng
fea89c14ec Make x86 isel lowering produce tailcall nodes. They are match to normal calls
for now.

Patch contributed by Alexander Friedman.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27994 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-27 08:40:39 +00:00
Evan Cheng
43824e8216 A couple of new entries.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27993 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-27 08:31:33 +00:00
Evan Cheng
2fdd95eee7 Support for passing 128-bit vector arguments via XMM registers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27992 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-27 08:31:10 +00:00
Evan Cheng
5fb03ce905 Oops
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27989 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-27 05:44:50 +00:00
Evan Cheng
85e3800e42 Bug fix: not updating NumIntRegs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27988 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-27 05:35:28 +00:00
Evan Cheng
eda65fa20b - Clean up formal argument lowering code. Prepare for vector pass by value work.
- Fixed vararg support.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27985 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-27 01:32:22 +00:00
Evan Cheng
9191dbba8e Fix fastcc failures.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27980 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-26 18:21:31 +00:00
Evan Cheng
1bc7804e4c Switching over FORMAL_ARGUMENTS mechanism to lower call arguments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27975 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-26 01:20:17 +00:00
Nate Begeman
add19dc20a Keep the stack from on darwin 16-byte aligned. This fixes many JIT
failres.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27973 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-25 20:54:26 +00:00
Evan Cheng
0db9fe6775 Separate LowerOperation() into multiple functions, one per opcode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27972 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-25 20:13:52 +00:00
Evan Cheng
3d1be07141 Fix a typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27968 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-25 17:48:41 +00:00
Evan Cheng
a2137b592e Explicitly specify result type for def : Pat<> patterns (if it produces a vector
result). Otherwise tblgen will pick the default (v16i8 for 128-bit vector).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27965 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-25 00:50:01 +00:00
Evan Cheng
a7fc64222a Added X86 SSE2 intrinsics which can be represented as vector_shuffles. This is
a temporary workaround for the 2-wide vector_shuffle problem (i.e. its mask
would have type v2i32 which is not legal).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27964 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-24 23:34:56 +00:00
Evan Cheng
d7ec518927 Add a new entry.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27963 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-24 23:30:10 +00:00
Evan Cheng
37d1d9bc66 Special case handling two wide build_vector(0, x).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27961 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-24 22:58:52 +00:00
Evan Cheng
64e9769339 Some missing movlps, movhps, movlpd, and movhpd patterns.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27960 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-24 21:58:20 +00:00
Evan Cheng
c78d3b43f5 A little bit more build_vector enhancement for v8i16 cases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27959 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-24 18:01:45 +00:00
Evan Cheng
86661f4879 Remove a completed entry.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27958 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-24 17:38:16 +00:00
Evan Cheng
49bca8536c MakeMIInst() should handle jump table index operands.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27955 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-24 05:37:35 +00:00
Chris Lattner
57a6c135f2 Add a note
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27954 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-23 19:47:09 +00:00
Evan Cheng
9293451e3f MOVL shuffle (i.e. movd or movss / movsd from memory) of undef, V2 == V2
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27953 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-23 06:35:19 +00:00
Nate Begeman
a766765358 Optimized stores to the constant pool, while cool, are unnecessary.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27948 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-22 22:31:45 +00:00
Nate Begeman
37efe67645 JumpTable support! What this represents is working asm and jit support for
x86 and ppc for 100% dense switch statements when relocations are non-PIC.
This support will be extended and enhanced in the coming days to support
PIC, and less dense forms of jump tables.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27947 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-22 18:53:45 +00:00
Evan Cheng
1900c012f5 Don't do all the lowering stuff for 2-wide build_vector's. Also, minor optimization for shuffle of undef.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27946 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-22 08:34:05 +00:00
Evan Cheng
a083af14c8 Fix a performance regression. Use {p}shuf* when there are only two distinct elements in a build_vector.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27945 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-22 06:21:46 +00:00
Evan Cheng
ba05f728b5 Revamp build_vector lowering to take advantage of movss and movd instructions.
movd always clear the top 96 bits and movss does so when it's loading the
value from memory.
The net result is codegen for 4-wide shuffles is much improved. It is near
optimal if one or more elements is a zero. e.g.

__m128i test(int a, int b) {
  return _mm_set_epi32(0, 0, b, a);
}

compiles to

_test:
	movd 8(%esp), %xmm1
	movd 4(%esp), %xmm0
	punpckldq %xmm1, %xmm0
	ret

compare to gcc:

_test:
	subl	$12, %esp
	movd	20(%esp), %xmm0
	movd	16(%esp), %xmm1
	punpckldq	%xmm0, %xmm1
	movq	%xmm1, %xmm0
	movhps	LC0, %xmm0
	addl	$12, %esp
	ret

or icc:

_test:
        movd      4(%esp), %xmm0                                #5.10
        movd      8(%esp), %xmm3                                #5.10
        xorl      %eax, %eax                                    #5.10
        movd      %eax, %xmm1                                   #5.10
        punpckldq %xmm1, %xmm0                                  #5.10
        movd      %eax, %xmm2                                   #5.10
        punpckldq %xmm2, %xmm3                                  #5.10
        punpckldq %xmm3, %xmm0                                  #5.10
        ret                                                     #5.10

There are still room for improvement, for example the FP variant of the above example:

__m128 test(float a, float b) {
  return _mm_set_ps(0.0, 0.0, b, a);
}

_test:
	movss 8(%esp), %xmm1
	movss 4(%esp), %xmm0
	unpcklps %xmm1, %xmm0
	xorps %xmm1, %xmm1
	movlhps %xmm1, %xmm0
	ret

The xorps and movlhps are unnecessary. This will require post legalizer optimization to handle.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27939 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-21 23:03:30 +00:00
Chris Lattner
6e68a7752b fix thinko
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27935 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-21 21:05:22 +00:00
Chris Lattner
3e663a6c16 add some low-prio notes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27934 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-21 21:03:21 +00:00
Evan Cheng
017dcc6e55 Now generating perfect (I think) code for "vector set" with a single non-zero
scalar value.

e.g.
        _mm_set_epi32(0, a, 0, 0);
==>
	movd 4(%esp), %xmm0
	pshufd $69, %xmm0, %xmm0

        _mm_set_epi8(0, 0, 0, 0, 0, a, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
==>
	movzbw 4(%esp), %ax
	movzwl %ax, %eax
	pxor %xmm0, %xmm0
	pinsrw $5, %eax, %xmm0


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27923 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-21 01:05:10 +00:00
Evan Cheng
39623daef6 - Added support to turn "vector clear elements", e.g. pand V, <-1, -1, 0, -1>
to a vector shuffle.
- VECTOR_SHUFFLE lowering change in preparation for more efficient codegen
of vector shuffle with zero (or any splat) vector.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27875 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-20 08:58:49 +00:00
Evan Cheng
72cd9a9439 Handle v2i64 BUILD_VECTOR custom lowering correctly. v2i64 is a legal type,
but i64 is not. If possible, change a i64 op to a f64 (e.g. load, constant)
and then cast it back.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27849 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-20 00:11:39 +00:00
Evan Cheng
94fe5eb14a isSplatMask() bug: first element can be an undef.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27847 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-19 23:28:59 +00:00
Evan Cheng
80d428c370 - Added support to do aribitrary 4 wide shuffle with no more than three
instructions.
- Fixed a commute vector_shuff bug.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27845 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-19 22:48:17 +00:00
Evan Cheng
fd111b5be5 Prefer {p}unpack* and mov*dup over {p}shuf* as well.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27844 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-19 21:15:24 +00:00
Evan Cheng
2dadaea5d2 - Renamed AddedCost to AddedComplexity.
- Added more movhlps and movlhps patterns.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27842 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-19 20:37:34 +00:00
Evan Cheng
533a0aa9ba Commute vector_shuffle to match more movlhps, movlp{s|d} cases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27840 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-19 20:35:22 +00:00
Evan Cheng
f66a094cac More mov{h|l}p{d|s} patterns.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27836 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-19 18:20:17 +00:00
Evan Cheng
cc0e98c8ed - More mov{h|l}ps patterns.
- Increase cost (complexity) of patterns which match mov{h|l}ps ops. These
  are preferred over shufps in most cases.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27835 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-19 18:11:52 +00:00
Chris Lattner
ff5cdc2ccd Add a note.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27827 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-19 05:53:27 +00:00
Evan Cheng
f0d4e3d7c0 - PEXTRW cannot take a memory location as its first source operand.
- PINSRWrmi encoding bug.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27818 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-18 21:59:43 +00:00
Evan Cheng
f463f51161 SHUFP{S|D}, PSHUF* encoding bugs. Left out the mask immediate operand.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27817 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-18 21:56:36 +00:00
Evan Cheng
b7a5c527ae Name change for clarity sake
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27816 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-18 21:55:35 +00:00
Evan Cheng
a52b214f56 Encoding bug: CMPPSrmi, CMPPDrmi dropped operand 2 (condtion immediate).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27815 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-18 21:31:08 +00:00
Evan Cheng
7b7bd57abd Name change for clarity sake
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27814 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-18 21:29:50 +00:00
Evan Cheng
fb2a3b2964 Left a pattern out
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27813 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-18 21:29:08 +00:00
Evan Cheng
df2a1908b2 Fixed an encoding bug: movd from XMM to R32.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27807 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-18 18:19:00 +00:00
Chris Lattner
993c897390 Teach the codegen about instructions used for SSE spill code, allowing it
to optimize cases where it has to spill a lot


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27801 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-18 16:44:51 +00:00
Evan Cheng
4980467476 Correct comments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27790 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-18 03:45:01 +00:00
Evan Cheng
74e955d931 Another entry
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27786 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-18 01:22:57 +00:00
Evan Cheng
7fa094a261 Another entry.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27784 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-18 00:21:01 +00:00
Evan Cheng
cdfc3c82a7 Use movss to insert_vector_elt(v, s, 0).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27782 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-17 22:45:49 +00:00
Evan Cheng
5edb8d270c Use two pinsrw to insert an element into v4i32 / v4f32 vector.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27779 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-17 22:04:06 +00:00
Evan Cheng
23b72005fa Encoding bug
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27773 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-17 21:33:57 +00:00
Evan Cheng
c575ca22ea Implement v8i16, v16i8 splat using unpckl + pshufd.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27768 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-17 20:43:08 +00:00
Chris Lattner
b2be4032c5 implement returns of a vector, testcase here: CodeGen/X86/vec_return.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27767 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-17 20:32:50 +00:00
Evan Cheng
51c9c43656 Incorrect foldMemoryOperand entries
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27763 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-17 18:06:12 +00:00
Evan Cheng
083248e143 Errors in patterns preventing load folding
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27762 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-17 18:05:01 +00:00
Evan Cheng
5001ea1078 FP SETOLT, SETOLT, SETUGE, SETUGT conditions were implemented incorrectly
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27755 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-17 07:24:10 +00:00