Commit Graph

1051 Commits

Author SHA1 Message Date
Nate Begeman
6dae3308f5 Fix lli linking on Mac OS X 10.4.1 for Intel.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22200 91177308-0d34-0410-b5e6-96231b3b80d8
2005-06-08 01:02:38 +00:00
Reid Spencer
628214eb74 Make sure that Cygwin assembly includes _ as part of function names.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22190 91177308-0d34-0410-b5e6-96231b3b80d8
2005-06-02 21:33:19 +00:00
Nate Begeman
be13634907 C'mon everybody, let's modify X86JITInfo.cpp. This time, we add <iostream>
so that the shiny new use of std::cerr is defined.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22156 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-20 21:29:24 +00:00
Misha Brukman
57ebf3d6a8 Since everyone else has "fixed" this file, might as well join in the fun.
* Change assert() to std::cerr printout, as it will not appear in opt builds
* Add comments to clarify what #ifdef/#else/#endif match what condition(s)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22154 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-20 19:46:50 +00:00
Chris Lattner
170fbcbc63 Fix this a 3rd time :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22151 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-20 17:00:21 +00:00
Andrew Lenharth
75a51277d2 fix compilation error due to no abort being defined. There is probably a better way to do this
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22150 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-20 16:34:44 +00:00
Duraid Madina
732c843f0e this seems dead (and broke the ia64 build, so..)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22147 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-20 06:21:59 +00:00
Jeff Cohen
8bc6f934e8 Fix tail call support in VC++ builds
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22143 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-20 01:35:39 +00:00
Chris Lattner
1030f72f8a Fastcc passes arguments in EAX and EDX, make sure the JIT doesn't clobber them
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22137 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-19 06:49:17 +00:00
Chris Lattner
16cb6f82eb Tailcalls require stubs to be emitted. Otherwise, the compilation callback
doesn't know who 'called' it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22136 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-19 05:54:33 +00:00
Chris Lattner
ea0354346f don't reserve space for tailcall arg areas. It explicitly managed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22050 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-15 06:07:10 +00:00
Chris Lattner
5fae9ccd39 Teach reginfo how to deal with ADJSTACKPTRri, allowing us to generate:
add %ESP, 20
        jmp %EDX  # TAIL CALL

instead of:
        add %ESP, -8
        add %ESP, 28
        jmp %EDX  # TAIL CALL


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22047 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-15 05:49:58 +00:00
Chris Lattner
381e88799e Implement proper tail calls in the X86 backend for all fastcc->fastcc
tail calls.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22046 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-15 05:46:45 +00:00
Chris Lattner
1e9448bce8 Add markers in the asm file for tail calls, add a new ADJSTACKPTRri
sorta-pseudo-instruction


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22042 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-15 03:10:37 +00:00
Chris Lattner
0dede079e7 Yes, calltarget is the operand of the day.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22040 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-15 01:10:30 +00:00
Chris Lattner
6972177bd4 When emitting the function epilog, check to see if there already a stack
adjustment.  If so, we merge the adjustment into the existing one.  This
allows us to generate:

caller2:
        sub %ESP, 12
        mov DWORD PTR [%ESP], 0
        mov %EAX, 1234567890
        mov %EDX, 0
        call func2
        add %ESP, 8
        ret 4

intead of:

caller2:
        sub %ESP, 12
        mov DWORD PTR [%ESP], 0
        mov %EAX, 1234567890
        mov %EDX, 0
        call func2
        sub %ESP, 4
        add %ESP, 12
        ret 4

for X86/fast-cc-merge-stack-adj.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22038 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-14 23:53:43 +00:00
Chris Lattner
2b3d56ee72 Add some new instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22036 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-14 23:35:21 +00:00
Chris Lattner
920c0aa9c2 Pass i64 values correctly split in reg/mem to fastcc calls.
This fixes fourinarow with -enable-x86-fastcc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22022 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-14 12:03:10 +00:00
Chris Lattner
239738a162 Use target-specific nodes for calls. This allows the fastcc code to not have
to do ugly hackery to avoid emitting code like this:

   call foo
   mov vreg, EAX
   adjcallstackup ...

If foo is a fastcc call and if vreg gets spilled, we might end up with this:

   call foo
   mov [ESP+offset], EAX     ;; Offset doesn't consider the 12!
   sub ESP, 12

Which is bad.  The previous hacky code to deal with this was A) gross B) not
good enough.  In particular, it could miss cases and emit the bad code above.
Now we always emit this:

   call foo
   adjcallstackup ...
   mov vreg, EAX

directly.

This makes fastcc with callees poping the stack work much better.  Next
stop (finally!) really is tail calls.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22021 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-14 08:48:15 +00:00
Chris Lattner
67649dfc32 use a target-specific node and custom expander to lower long->FP to FILD64m.
This should fix some missing symbols problems on BSD and improve performance
of programs that use that operation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22012 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-14 06:52:07 +00:00
Chris Lattner
10d2645710 Make sure the start of the arg area and the end (after the RA is pushed)
is always 8-byte aligned for fastcc


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21995 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-13 23:49:10 +00:00
Chris Lattner
653f7230ad fix typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21991 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-13 22:46:57 +00:00
Chris Lattner
06cebb456a Fix the problems with callee popped argument lists
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21988 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-13 22:13:49 +00:00
Chris Lattner
ca96c8217d Don't emit SAR X, 0 in the case of sdiv Y, 2
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21986 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-13 21:50:27 +00:00
Chris Lattner
a96e577f53 Fix UnitTests/2005-05-13-SDivTwo.c
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21985 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-13 21:48:20 +00:00
Chris Lattner
3648c67eb2 switch to having the callee pop stack operands for fastcc. This is currently buggy
do not use


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21984 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-13 21:44:04 +00:00
Chris Lattner
24ddc6d067 allow RETI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21980 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-13 20:46:35 +00:00
Chris Lattner
2e7714ad2b Build TAILCALL nodes in LowerCallTo, treat them like normal calls everywhere.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21976 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-13 20:29:13 +00:00
Chris Lattner
adf6a965a3 Add an isTailCall flag to LowerCallTo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21958 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-13 18:50:42 +00:00
Chris Lattner
1be4811d34 add 'ret imm' instruction
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21945 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-13 17:56:48 +00:00
Chris Lattner
63602fb868 Do not CopyFromReg physregs for live-in values. Instead, create a vreg for
each live in, and copy the regs from the vregs.  As the very first thing we
do in the function, insert copies from the pregs to the vregs.  This fixes
problems where the token chain of CopyFromReg was not enough to allow reordering
of the copyfromreg nodes and other unchained nodes (e.g. div, which clobbers
eax on intel).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21932 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-13 07:38:09 +00:00
Chris Lattner
16cd04d26c rename the ADJCALLSTACKDOWN/ADJCALLSTACKUP nodes to be CALLSEQ_START/BEGIN.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21915 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-12 23:24:06 +00:00
Chris Lattner
c6f4181923 Add a new -enable-x86-fastcc option that enables passing the first
two integer values in registers for the fastcc calling conv.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21912 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-12 23:06:28 +00:00
Chris Lattner
c57f682113 Pass in Calling Convention to use into LowerCallTo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21899 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-12 19:56:45 +00:00
Chris Lattner
6649418598 Enable pattern isel by default
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21898 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-12 19:56:09 +00:00
Chris Lattner
c610d4267f X86 has more than just 32-bit registers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21857 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-11 05:00:34 +00:00
Chris Lattner
6415bb4c29 Convert feature of the simple isel over for the pattern isel to use.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21840 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-10 03:53:18 +00:00
Jeff Cohen
19bb2283e6 Silence some VC++ warnings
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21838 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-10 02:22:38 +00:00
Chris Lattner
966cdfb600 Implement READPORT/WRITEPORT, implementing the last X86 regression tests
that were failing with the pattern selector.  Note that the support that
existed in the simple selector was clearly broken in several ways though
(which has also been fixed).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21831 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-09 21:17:38 +00:00
Chris Lattner
cecd67b432 do not emit illegal instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21830 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-09 21:06:04 +00:00
Chris Lattner
82c7897f49 Fix the syntax of the i/o instructions, these are obviously unused.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21829 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-09 20:49:20 +00:00
Chris Lattner
4e6ce5f9c7 legalize readio/writeio into load/stores, fixing CodeGen/X86/io.llx with
the pattern isel.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21828 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-09 20:37:29 +00:00
Chris Lattner
a0dbf181e0 restore some non-dead code I removed last night breaking double casts to
uint


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21821 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-09 18:37:02 +00:00
Chris Lattner
a80d2bd89c Wrap long lines, remove dead code that is now handled by legalize
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21811 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-09 05:40:26 +00:00
Chris Lattner
2afa1910d4 Fix FP -> bool casts
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21810 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-09 05:33:18 +00:00
Chris Lattner
e3e0f2765a Fix X86/2005-05-08-FPStackifierPHI.ll: ugly gross hack.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21801 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-09 03:36:39 +00:00
Andrew Lenharth
b5884d3116 fix typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21693 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-04 19:25:37 +00:00
Andrew Lenharth
691ef2ba06 Implement count leading zeros (ctlz), count trailing zeros (cttz), and count
population (ctpop).  Generic lowering is implemented, however only promotion
is implemented for SelectionDAG at the moment.

More coming soon.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21676 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-03 17:19:30 +00:00
Chris Lattner
c5dcb53bea Add support for FSIN/FCOS when unsafe math ops are enabled. Patch contributed by
Morten Ofstad!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21632 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-30 04:25:35 +00:00
Chris Lattner
5434b429c8 Add support for llvm.sqrt and sin/cos if unsafe math optimizations are enabled.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21631 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-30 04:12:40 +00:00