Commit Graph

3431 Commits

Author SHA1 Message Date
Andrew Lenharth
04c868ef50 stack frame fix and zero FP reg fix
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19857 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-27 08:31:19 +00:00
Andrew Lenharth
10b400705d Floating point instructions like Floating point registers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19856 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-27 07:58:15 +00:00
Andrew Lenharth
d2bb960d8c int to float conversion and another setcc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19855 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-27 07:50:35 +00:00
Andrew Lenharth
3d65d31e20 teach isel about comparison with constants and zero extending bits
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19853 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-27 03:49:45 +00:00
Andrew Lenharth
7e57bd518e perhaps this will let me have calls again
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19851 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-27 01:22:48 +00:00
Andrew Lenharth
c0d502e20f minor bug fix
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19850 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-27 00:52:26 +00:00
Andrew Lenharth
51d3ab4ad4 minor bug fix
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19849 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-27 00:51:05 +00:00
Andrew Lenharth
98a32d09f3 added instructions for fp to int to fp moves
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19848 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-26 23:56:48 +00:00
Andrew Lenharth
3e98fde96b initial fp support
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19847 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-26 21:54:09 +00:00
Andrew Lenharth
fc16691925 hum, writing on one machine, testing on another...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19844 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-26 02:53:56 +00:00
Andrew Lenharth
0298118cbb add some operations, fix others. should compile several more tests now
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19843 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-26 01:24:38 +00:00
Chris Lattner
3576c84baf We can fold promoted and non-promoted loads into divs also!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19835 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-25 20:35:10 +00:00
Chris Lattner
44129b5b68 Fold promoted loads into binary ops for FP, allowing us to generate m32 forms
of FP ops.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19834 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-25 20:03:11 +00:00
Andrew Lenharth
d279b4157a problems with bools, and their work arounds
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19833 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-25 19:58:40 +00:00
Andrew Lenharth
2f8fb77297 more load choices, better add with imm
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19821 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-25 00:35:34 +00:00
Andrew Lenharth
2d6f022a98 Clean ups, and taught the instruction selector about immediate forms
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19816 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-24 19:44:07 +00:00
Andrew Lenharth
a7246caf8f Alpha JIT prune
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19815 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-24 18:48:22 +00:00
Andrew Lenharth
886470efec include prune and JIT prune
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19814 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-24 18:45:41 +00:00
Andrew Lenharth
01269524ce Pruned includes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19813 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-24 18:37:48 +00:00
Chris Lattner
bb4dca3286 Fix a spurious warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19799 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-24 01:40:18 +00:00
Chris Lattner
0a07883694 Silence a warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19798 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-23 23:20:06 +00:00
Chris Lattner
42e25b387f Allow the FP stackifier to completely ignore functions that do not use FP at
all.  This should speed up the X86 backend fairly significantly on integer
codes.  Now if only we didn't have to compute livevar still... ;-)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19796 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-23 23:13:59 +00:00
Chris Lattner
1fefef1b27 Build Alpha by default.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19777 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-23 04:34:46 +00:00
Reid Spencer
a8411a698e Fix alloca support for Cygwin. On cygwin its __alloca not __builtin_alloca
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19776 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-23 04:32:47 +00:00
Reid Spencer
5dc81f63d1 Support Cygwin assembly generation. The cygwin version of Gnu ASsembler
doesn't support certain directives and symbols on cygwin are prefixed with
an underscore. This patch makes the necessary adjustments to the output.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19775 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-23 03:52:14 +00:00
Andrew Lenharth
304d0f3076 Let me introduce you to the early stages of the llvm backend for the alpha processor
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19764 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-22 23:41:55 +00:00
Chris Lattner
fb0f53f9c1 Speed up folding operations into loads.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19733 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-21 21:43:02 +00:00
Chris Lattner
67b1c3c404 The ever-important vanity pass name :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19731 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-21 21:35:14 +00:00
Chris Lattner
b62e1e296e Fix a FIXME: realize that argument stores are all independent (don't alias)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19728 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-21 19:46:38 +00:00
Chris Lattner
19ad0620bc Implement ADD_PARTS/SUB_PARTS so that 64-bit integer add/sub work. This
fixes most of the remaining llc-beta failures.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19716 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-20 18:53:00 +00:00
Chris Lattner
bf52d49f36 Fix a crash compiling 134.perl.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19711 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-20 16:50:16 +00:00
Chris Lattner
c3c021bcad Fix a problem where were were literally selecting for INCREASED register
pressure, not decreases register pressure.  Fix problem where we accidentally
swapped the operands of SHLD, which caused fourinarow to fail.  This fixes
fourinarow.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19697 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-19 17:24:34 +00:00
Chris Lattner
a76f04828a When commuting these instructions, make sure to actually swap the operands too.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19694 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-19 16:55:52 +00:00
Chris Lattner
4053b1e30b Implement Regression/CodeGen/X86/rotate.ll: emit rotate instructions (which
typically cost 1 cycle) instead of shld/shrd instruction (which are typically
6 or more cycles).  This also saves code space.

For example, instead of emitting:

rotr:
        mov %EAX, DWORD PTR [%ESP + 4]
        mov %CL, BYTE PTR [%ESP + 8]
        shrd %EAX, %EAX, %CL
        ret
rotli:
        mov %EAX, DWORD PTR [%ESP + 4]
        shrd %EAX, %EAX, 27
        ret

Emit:

rotr32:
        mov %CL, BYTE PTR [%ESP + 8]
        mov %EAX, DWORD PTR [%ESP + 4]
        ror %EAX, %CL
        ret
rotli32:
        mov %EAX, DWORD PTR [%ESP + 4]
        ror %EAX, 27
        ret

We also emit byte rotate instructions which do not have a sh[lr]d counterpart
at all.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19692 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-19 08:07:05 +00:00
Chris Lattner
40ff633b05 Add rotate instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19690 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-19 07:50:03 +00:00
Chris Lattner
30ea1e9411 Match 16-bit shld/shrd instructions as well, implementing shift-double.llx:test5
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19689 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-19 07:37:26 +00:00
Chris Lattner
0df53d22c3 Improve coverage of the X86 instruction set by adding 16-bit shift doubles.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19687 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-19 07:31:24 +00:00
Chris Lattner
41e431ba04 Teach the code generator that shrd/shld is commutable if it has an immediate.
This allows us to generate this:

foo:
        mov %EAX, DWORD PTR [%ESP + 4]
        mov %EDX, DWORD PTR [%ESP + 8]
        shld %EDX, %EDX, 2
        shl %EAX, 2
        ret

instead of this:

foo:
        mov %EAX, DWORD PTR [%ESP + 4]
        mov %ECX, DWORD PTR [%ESP + 8]
        mov %EDX, %EAX
        shrd %EDX, %ECX, 30
        shl %EAX, 2
        ret

Note the magically transmogrifying immediate.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19686 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-19 07:11:01 +00:00
Chris Lattner
167b10cba4 Finegrainify namespacification
Add default impl of commuteInstruction
Add notes about ugly V9 code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19684 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-19 06:53:34 +00:00
Chris Lattner
8571637ee9 Codegen long >> 2 to this:
foo:
        mov %EAX, DWORD PTR [%ESP + 4]
        mov %EDX, DWORD PTR [%ESP + 8]
        shrd %EAX, %EDX, 2
        sar %EDX, 2
        ret

instead of this:

test1:
        mov %ECX, DWORD PTR [%ESP + 4]
        shr %ECX, 2
        mov %EDX, DWORD PTR [%ESP + 8]
        mov %EAX, %EDX
        shl %EAX, 30
        or %EAX, %ECX
        sar %EDX, 2
        ret

and long << 2 to this:

foo:
        mov %EAX, DWORD PTR [%ESP + 4]
        mov %ECX, DWORD PTR [%ESP + 8]
***     mov %EDX, %EAX
        shrd %EDX, %ECX, 30
        shl %EAX, 2
        ret

instead of this:

foo:
        mov %EAX, DWORD PTR [%ESP + 4]
        mov %ECX, %EAX
        shr %ECX, 30
        mov %EDX, DWORD PTR [%ESP + 8]
        shl %EDX, 2
        or %EDX, %ECX
        shl %EAX, 2
        ret

The extra copy (marked ***) can be eliminated when I teach the code generator
that shrd32rri8 is really commutative.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19681 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-19 06:18:43 +00:00
Chris Lattner
009b55b6f6 X86 shifts mask the amount.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19678 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-19 03:36:30 +00:00
Chris Lattner
477c931852 Code to handle FP_EXTEND is dead now. X86 doesn't support any data types to
FP_EXTEND from!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19674 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-18 20:05:56 +00:00
Chris Lattner
3dd68151dc Remove more dead code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19673 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-18 19:50:08 +00:00
Chris Lattner
a7a4c0f7c4 The selection dag code handles the promotions from F32 to F64 for us, so we
don't need to even think about F32 in the X86 code anymore.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19672 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-18 19:46:54 +00:00
Chris Lattner
b422aeac9e Fix 124.m88ksim.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19667 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-18 17:35:28 +00:00
Chris Lattner
811482a82b Do not emit loads multiple times, potentially in the wrong places.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19661 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-18 04:18:32 +00:00
Tanya Lattner
0111474bde Minor changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19660 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-18 04:15:41 +00:00
Chris Lattner
b71f8fc99d Eliminate bad assertions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19659 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-18 04:00:54 +00:00
Chris Lattner
4a108668df * Eliminate the TokenSet and just use the ExprMap for both tokens and values.
* Insert some really pedantic assertions that will notice when we emit the
  same loads more than one time, exposing bugs.  This turns a miscompilation in
  bzip2 into a compile-fail.  yaay.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19658 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-18 03:51:59 +00:00
Chris Lattner
883c86f510 Rely on the code in MatchAddress to do this work. Otherwise we fail to
match (X+Y)+(Z << 1), because we match the X+Y first, consuming the index
register, then there is no place to put the Z.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19652 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-18 02:25:52 +00:00