Andrew Lenharth
a9214fec08
core changes for varargs
...
llvm-svn: 22254
2005-06-18 18:34:52 +00:00
Misha Brukman
b3e2f08638
Convert tabs to spaces
...
llvm-svn: 21457
2005-04-22 18:06:01 +00:00
Misha Brukman
1fef885677
Remove trailing whitespace
...
llvm-svn: 21425
2005-04-21 23:30:14 +00:00
Chris Lattner
4b688a1c70
This mega patch converts us from using Function::a{iterator|begin|end} to
...
using Function::arg_{iterator|begin|end}. Likewise Module::g* -> Module::global_*.
This patch is contributed by Gabor Greif, thanks!
llvm-svn: 20597
2005-03-15 04:54:21 +00:00
Chris Lattner
ccd0d44133
Substantially improve the code generated by non-folded setcc instructions.
...
In particular, instead of compiling this:
bool %test(int %A, int %B) {
%C = setlt int %A, %B
ret bool %C
}
to this:
test:
save %sp, -96, %sp
subcc %i0, %i1, %g0
bl .LBBtest_1 !
nop
ba .LBBtest_2 !
nop
.LBBtest_1: !
or %g0, 1, %i0
ba .LBBtest_3 !
nop
.LBBtest_2: !
or %g0, 0, %i0
ba .LBBtest_3 !
nop
.LBBtest_3: !
restore %g0, %g0, %g0
retl
nop
We now compile it to this:
test:
save %sp, -96, %sp
subcc %i0, %i1, %g0
or %g0, 1, %i0
bl .LBBtest_2 !
nop
.LBBtest_1: !
or %g0, %g0, %i0
.LBBtest_2: !
restore %g0, %g0, %g0
retl
nop
llvm-svn: 19213
2005-01-01 16:06:57 +00:00
Chris Lattner
5f28e9fafc
Remove unused #include
...
llvm-svn: 19021
2004-12-17 19:07:04 +00:00
Brian Gaeke
83dcf14697
Get rid of shifts by zero in most cases.
...
llvm-svn: 18931
2004-12-14 08:21:02 +00:00
Brian Gaeke
ee60e35a28
Finally enable the setcc-branch folding code.
...
Also, fix a bug where ubyte 255 would sometimes be output as -1. This
was afflicting hbd.
llvm-svn: 18823
2004-12-12 07:42:58 +00:00
Brian Gaeke
09c4a78ece
Add (currently disabled) code for canFoldSetCC
...
llvm-svn: 18820
2004-12-12 06:22:30 +00:00
Brian Gaeke
55c163e41e
Add stubs for setcc-branch folding support.
...
llvm-svn: 18818
2004-12-12 06:01:26 +00:00
Brian Gaeke
948a8145bf
Make GEPs not suck so much:
...
* Don't emit the Index * ElementSize multiply if Index is a constant.
* Use a shift, not a multiply, if ElementSize is 1/2/4/8.
* If ElementSize fits in the immediate field of SMUL, then put it there.
Fix a bug where struct offsets might be truncated (ConstantSInt::get is
now used instead of ConstantInt::get).
llvm-svn: 18792
2004-12-11 05:19:02 +00:00
Brian Gaeke
2a9ecc433f
Support binary operations with immediates for <= cInt.
...
llvm-svn: 18756
2004-12-10 08:39:28 +00:00
Brian Gaeke
3bb57935a7
Fix bug in emitGEPOperation with large struct-member offsets.
...
llvm-svn: 18201
2004-11-24 04:07:33 +00:00
Brian Gaeke
ce245ef743
Support shr long/ulong.
...
llvm-svn: 18173
2004-11-23 21:10:50 +00:00
Brian Gaeke
b63c34a9f9
pseudocode for 64-bit lshr.
...
llvm-svn: 18154
2004-11-23 08:14:09 +00:00
Brian Gaeke
c0c0b053e6
Add stub method for long shift codegen.
...
llvm-svn: 18100
2004-11-22 08:02:06 +00:00
Brian Gaeke
52bb1a0073
Implement setcc on longs.
...
llvm-svn: 18088
2004-11-21 08:11:28 +00:00
Brian Gaeke
cb0a971f8f
Support add, sub, mul, div, rem on longs/ulongs (latter 3 by emitting libcalls).
...
Add a big comment containing my notes on how to do setcc for longs/ulongs.
llvm-svn: 18086
2004-11-21 07:13:16 +00:00
Brian Gaeke
e07eb993d6
Fix extraStack calculation -- I think in fact it might be getting a bit *too*
...
much stack, but that's better than not enough, which leads to miscompilations.
Fix FP vaarg.
llvm-svn: 18079
2004-11-21 03:35:22 +00:00
Brian Gaeke
1805f32d5f
Support most cases of vaarg (except double).
...
llvm-svn: 18055
2004-11-20 22:50:42 +00:00
Brian Gaeke
c72d2a96dc
Implement vacopy and vanext.
...
llvm-svn: 18031
2004-11-20 03:32:12 +00:00
Misha Brukman
35c8db23b6
Revert the patch that adds Function* for each 64-bit libc div/mul/rem that we
...
want to do; instead, we can use MachineInstr::addExternalSymbol(char*, bool) and
thus we don't have to modify the Module as we are code generating for it
llvm-svn: 18025
2004-11-20 00:10:20 +00:00
Misha Brukman
87bfc8b09c
Add protoypes for 64-bit long/ulong div, mul, and rem functions
...
llvm-svn: 18019
2004-11-19 22:14:35 +00:00
Brian Gaeke
89f96e4c7c
Add VANext and VAArg stubs.
...
llvm-svn: 18012
2004-11-19 21:08:18 +00:00
Brian Gaeke
6224830c11
Implement va_start.
...
llvm-svn: 18011
2004-11-19 20:57:24 +00:00
Brian Gaeke
e88367016a
First part of varargs support: getting all varargs which could possibly
...
be in registers into memory.
llvm-svn: 18006
2004-11-19 20:31:08 +00:00
Brian Gaeke
9c9427b62b
va_end can safely be codegen'd to nothing on v8.
...
llvm-svn: 18004
2004-11-19 19:21:34 +00:00
Brian Gaeke
7027432624
A very sorry stub implementation of varargs intrinsics...
...
llvm-svn: 18003
2004-11-19 18:53:59 +00:00
Brian Gaeke
5de5da7603
Fix bug in casting to long/ulong.
...
llvm-svn: 18001
2004-11-19 18:48:10 +00:00
Brian Gaeke
23969d8817
Rewrite LoadArgumentsToVirtualRegs, making it match almost exactly how
...
visitCallInst works. Support cast of byte/short/int to long.
llvm-svn: 17949
2004-11-18 07:43:33 +00:00
Brian Gaeke
70a111317a
We were (somehow) getting the wrong branch opcode for setcc float instrs.
...
llvm-svn: 17925
2004-11-17 22:06:56 +00:00
Brian Gaeke
f9ec4c8ee2
Fix problem with insertion point for ADJCALLSTACKDOWN.
...
llvm-svn: 17733
2004-11-14 06:32:08 +00:00
Brian Gaeke
ab60855423
Fix NotTest - round up extraStack to the nearest doubleword, if it is
...
not zero.
llvm-svn: 17728
2004-11-14 05:19:00 +00:00
Brian Gaeke
1b3d701769
Rewrite outgoing arg handling to handle more weird corner cases.
...
llvm-svn: 17722
2004-11-14 03:22:07 +00:00
Brian Gaeke
85e7df8097
Handle "call" operands of type long/ulong passed in registers.
...
llvm-svn: 17464
2004-11-04 00:27:04 +00:00
Chris Lattner
bb5b3f0b2f
Add support for unreachable and undef
...
llvm-svn: 17074
2004-10-17 02:42:42 +00:00
Brian Gaeke
ba65401a4d
Rewrite emitCastOperation, refactoring parts of it into emitIntegerCast, and
...
adding emitFPToIntegerCast.
llvm-svn: 16995
2004-10-14 19:39:34 +00:00
Brian Gaeke
26b353ebd6
Fix assertion failure when calling or returning from a function which
...
returns 'bool' type.
llvm-svn: 16884
2004-10-10 20:34:17 +00:00
Brian Gaeke
245a073aa6
Fix whitespace and wrap some long lines.
...
Deal with allocating stack space for outgoing args and copying them into the
correct stack slots (at least, we can copy <=32-bit int args).
We now correctly generate ADJCALLSTACK* instructions.
llvm-svn: 16881
2004-10-10 19:57:18 +00:00
Brian Gaeke
c667e351ed
I think this will handle double args.
...
llvm-svn: 16618
2004-09-30 19:44:32 +00:00
Brian Gaeke
bad755c1d1
Simplify copyConstantToRegister() for longs, using a pair of recursive calls.
...
Copy constant-pool entries' addresses into registers before loading out of them,
to avoid errors from the assembler.
Handle loading call args past the 6th one off the stack.
Add IMPLICIT_DEF pseudo-instrs for double and long arguments passed in register
pairs.
Use FpMOVD to copy doubles around instead of the horrible store-load thing we
were doing before.
Handle 'ret double' and 'ret long'.
Fix a bug in handling 'and/or/xor long'.
llvm-svn: 16577
2004-09-29 03:34:41 +00:00
Misha Brukman
587a924177
Renamed file to SparcV8ISelSimple.cpp
...
llvm-svn: 16267
2004-09-10 18:51:12 +00:00