John Criswell
a564e9e0ba
Modified switch generation so that only the phi values associated with the
...
destination basic block are copied.
llvm-svn: 17212
2004-10-25 18:30:09 +00:00
Nate Begeman
74b7c1f3e0
Implement more complete and correct codegen for bitfield inserts, as tested
...
by the recently committed rlwimi.ll test file. Also commit initial code
for bitfield extract, although it is turned off until fully debugged.
llvm-svn: 17207
2004-10-24 10:33:30 +00:00
Misha Brukman
9ce0da9e90
* Correctly handle the MovePCtoLR pseudo-instr with a bl to next instr
...
* Stop the confusion of using rv and Addr for global addresses: just use rv
llvm-svn: 17195
2004-10-23 23:47:34 +00:00
Misha Brukman
f1f6270708
Add BA, BL, and BLA opcodes
...
llvm-svn: 17193
2004-10-23 20:29:24 +00:00
Misha Brukman
421c3c1ec4
* Do not emit IMPLICIT_DEF pseudo-instructions
...
* Convert register numbers from their opcode value to the real value, e.g.
PPC::R1 => 1 and PPC::F1 => 1
* Add correct handling of loading of global values which are PC-relative --
implement ha16() and lo16()
llvm-svn: 17190
2004-10-23 18:28:01 +00:00
Misha Brukman
15b0fb5678
DForm_1, particularly used by store instructions, needs the immediate operand to
...
be listed second as that is how the instructions are usually created (and is the
correct asm syntax) so that it's assembled correctly from its constituents
llvm-svn: 17183
2004-10-23 06:08:38 +00:00
Misha Brukman
e882d30aa1
Fix the SPR field for MTLR, MFLR, MTCTR, and MFCTR instructions.
...
The decimal value given in the manual (8 or 9) really needs to be multiplied by
a factor of 32 because of the group of 5 zero bits after the register code.
llvm-svn: 17182
2004-10-23 06:05:49 +00:00
Misha Brukman
55a3ccd035
The value of the XO field for MFLR and MFCTR is 339, not 399
...
llvm-svn: 17181
2004-10-23 05:38:55 +00:00
Misha Brukman
101d5d62d5
Remove extraneous blank line
...
llvm-svn: 17180
2004-10-23 04:59:22 +00:00
Misha Brukman
cea2e46821
Align function arguments in function headers
...
llvm-svn: 17178
2004-10-23 04:58:32 +00:00
Nate Begeman
6cadac8f43
Kill casts from integer types to unsigned byte, when the cast was only used
...
as the shift amount operand to a shift instruction. This was causing us to
emit unnecessary clear operations for code such as:
int foo(int x) { return 1 << x; }
llvm-svn: 17175
2004-10-23 00:50:23 +00:00
Reid Spencer
4755617619
Clean up the output from this makefile so its not verbose.
...
llvm-svn: 17173
2004-10-22 23:24:39 +00:00
Misha Brukman
e60a3fb063
Adjust rules for building .inc files due to Reid's changes of Makefile.rules
...
llvm-svn: 17169
2004-10-22 22:16:24 +00:00
Reid Spencer
30d8baea8d
Adjust to changes in Makefile.rules
...
llvm-svn: 17167
2004-10-22 21:02:08 +00:00
Reid Spencer
c1c320c335
We won't use automake
...
llvm-svn: 17155
2004-10-22 03:35:04 +00:00
Misha Brukman
a6ecf271db
Remove debug code emitter from the JIT
...
llvm-svn: 17151
2004-10-21 03:07:38 +00:00
Alkis Evlogimenos
757cc0e84c
Make this compile.
...
llvm-svn: 17150
2004-10-21 02:44:16 +00:00
Misha Brukman
2beb63a65a
* Added basic support for JITing functions, basic blocks, instruction encoding,
...
including registers, constants, and partial support for global addresses
* The JIT is disabled by default to allow building llvm-gcc, which wants to test
running programs during configure
llvm-svn: 17149
2004-10-21 01:42:02 +00:00
Nate Begeman
86b5f8075c
Don't clear or sign extend bool->int. This fires a few dozen times on the test suite
...
llvm-svn: 17147
2004-10-20 21:55:41 +00:00
John Criswell
85b380582e
Small performance improvement in generated C code:
...
Instead of unconditionally copying all phi node values into temporaries for
all successor blocks, generate code that will determine what successor
block will be called and then copy only those phi node values needed by
the successor block.
This seems to cut down namd execution time from being 8% higher than GCC to
4% higher than GCC.
llvm-svn: 17144
2004-10-20 14:38:39 +00:00
Misha Brukman
e2ada0413e
* Add baseline structural JIT code, but disable the JIT to allow llvm-gcc builds
...
- Support added for functions, basic blocks, constant pool, constants,
registers, and some basic support for globals, all untested
* Turn assert()s into abort()s so that unimplemented functions fail in release
llvm-svn: 17143
2004-10-19 19:49:42 +00:00
Brian Gaeke
f3499acc16
Simplify mapping info generation. In particular, the LLVM-to-MachineInstr map
...
is no longer emitted, and we do not reference any MachineCodeForInstruction
information.
llvm-svn: 17138
2004-10-19 05:15:21 +00:00
Reid Spencer
6a11a75f31
Initial automake generated Makefile template
...
llvm-svn: 17136
2004-10-18 23:55:41 +00:00
Chris Lattner
fbc070bfdc
Improve compatibility with VC++, patch contributed by Morten Ofstad!
...
llvm-svn: 17126
2004-10-18 15:54:17 +00:00
Chris Lattner
53058663aa
Print a semicolon for the unreacahble instruction. This fixes problems
...
where C requires semicolons in some cases to indicate null statements.
llvm-svn: 17107
2004-10-17 23:49:11 +00:00
Nate Begeman
844186b8b4
Generate correct stubs for weak-linked symbols
...
llvm-svn: 17101
2004-10-17 23:01:34 +00:00
Chris Lattner
621c413a1b
The first hunk corrects a bug when printing undef null values. We would print
...
0->field, which is illegal. Now we print ((foo*)0)->field.
The second hunk is an optimization to not print undefined phi values.
llvm-svn: 17094
2004-10-17 17:48:59 +00:00
Chris Lattner
068555314b
Don't print stuff out from the code generator. This broke the JIT horribly
...
last night. :) bork!
llvm-svn: 17093
2004-10-17 17:40:50 +00:00
Reid Spencer
f476d84b69
Make the library name SparcV9 specific
...
llvm-svn: 17089
2004-10-17 15:01:12 +00:00
Reid Spencer
b7c9d5444b
Consolidate the definitions
...
llvm-svn: 17088
2004-10-17 15:00:26 +00:00
Reid Spencer
de028a4a69
PPC32GenCodeEmitter instead of PowerPCGenCodeEmitter
...
llvm-svn: 17087
2004-10-17 14:59:38 +00:00
Chris Lattner
839abf57a6
Rewrite support for cast uint -> FP. In particular, we used to compile this:
...
double %test(uint %X) {
%tmp.1 = cast uint %X to double ; <double> [#uses=1]
ret double %tmp.1
}
into:
test:
sub %ESP, 8
mov %EAX, DWORD PTR [%ESP + 12]
mov %ECX, 0
mov DWORD PTR [%ESP], %EAX
mov DWORD PTR [%ESP + 4], %ECX
fild QWORD PTR [%ESP]
add %ESP, 8
ret
... which basically zero extends to 8 bytes, then does an fild for an
8-byte signed int.
Now we generate this:
test:
sub %ESP, 4
mov %EAX, DWORD PTR [%ESP + 8]
mov DWORD PTR [%ESP], %EAX
fild DWORD PTR [%ESP]
shr %EAX, 31
fadd DWORD PTR [.CPItest_0 + 4*%EAX]
add %ESP, 4
ret
.section .rodata
.align 4
.CPItest_0:
.quad 5728578726015270912
This does a 32-bit signed integer load, then adds in an offset if the sign
bit of the integer was set.
It turns out that this is substantially faster than the preceeding sequence.
Consider this testcase:
unsigned a[2]={1,2};
volatile double G;
void main() {
int i;
for (i=0; i<100000000; ++i )
G += a[i&1];
}
On zion (a P4 Xeon, 3Ghz), this patch speeds up the testcase from 2.140s
to 0.94s.
On apoc, an athlon MP 2100+, this patch speeds up the testcase from 1.72s
to 1.34s.
Note that the program takes 2.5s/1.97s on zion/apoc with GCC 3.3 -O3
-fomit-frame-pointer.
llvm-svn: 17083
2004-10-17 08:01:28 +00:00
Chris Lattner
112fd88a05
Unify handling of constant pool indexes with the other code paths, allowing
...
us to use index registers for CPI's
llvm-svn: 17082
2004-10-17 07:49:45 +00:00
Chris Lattner
af19d396ac
Give the asmprinter the ability to print memrefs with a constant pool index,
...
index reg and scale
llvm-svn: 17081
2004-10-17 07:16:32 +00:00
Chris Lattner
653d8663fe
fold:
...
%X = and Y, constantint
%Z = setcc %X, 0
instead of emitting:
and %EAX, 3
test %EAX, %EAX
je .LBBfoo2_2 # UnifiedReturnBlock
We now emit:
test %EAX, 3
je .LBBfoo2_2 # UnifiedReturnBlock
This triggers 581 times on 176.gcc for example.
llvm-svn: 17080
2004-10-17 06:10:40 +00:00
Chris Lattner
e234a21488
All of these labels are off by one now that the unreachable instruction exists
...
llvm-svn: 17079
2004-10-17 05:37:47 +00:00
Nate Begeman
2c873ca365
Implement bitfield insert by recognizing the following pattern:
...
1. optional shift left
2. and x, immX
3. and y, immY
4. or z, x, y
==> rlwimi z, x, y, shift, mask begin, mask end
where immX == ~immY and immX is a run of set bits. This transformation
fires 32 times on voronoi, once on espresso, and probably several
dozen times on external benchmarks such as gcc.
To put this in terms of actual code generated for
struct B { unsigned a : 3; unsigned b : 2; };
void storeA (struct B *b, int v) { b->a = v;}
void storeB (struct B *b, int v) { b->b = v;}
Old:
_storeA:
rlwinm r2, r4, 0, 29, 31
lwz r4, 0(r3)
rlwinm r4, r4, 0, 0, 28
or r2, r4, r2
stw r2, 0(r3)
blr
_storeB:
rlwinm r2, r4, 3, 0, 28
rlwinm r2, r2, 0, 27, 28
lwz r4, 0(r3)
rlwinm r4, r4, 0, 29, 26
or r2, r2, r4
stw r2, 0(r3)
blr
New:
_storeA:
lwz r2, 0(r3)
rlwimi r2, r4, 0, 29, 31
stw r2, 0(r3)
blr
_storeB:
lwz r2, 0(r3)
rlwimi r2, r4, 3, 27, 28
stw r2, 0(r3)
blr
llvm-svn: 17078
2004-10-17 05:19:20 +00:00
Chris Lattner
f6666db032
I forgot that sparc no longer uses the shared asmwriter. Give it support
...
for undef.
llvm-svn: 17075
2004-10-17 02:44:45 +00:00
Chris Lattner
37b138a00b
Add support for unreachable and undef
...
llvm-svn: 17074
2004-10-17 02:42:42 +00:00
Nate Begeman
29dc5f2a3e
Finally fix one of the oldest FIXMEs in the PowerPC backend: correctly
...
flag rotate left word immediate then mask insert (rlwimi) as a two-address
instruction, and update the ISel usage of the instruction accordingly.
This will allow us to properly schedule rlwimi, and use it to efficiently
codegen bitfield operations.
llvm-svn: 17068
2004-10-16 20:43:38 +00:00
Chris Lattner
fcfe78eaf8
Fix fix fix
...
llvm-svn: 17057
2004-10-16 18:21:50 +00:00
Chris Lattner
ea9a85abe4
Add support for undef and unreachable
...
llvm-svn: 17051
2004-10-16 18:14:10 +00:00
Chris Lattner
a3f3c8a1ad
ADd support for undef and unreachable
...
llvm-svn: 17050
2004-10-16 18:13:47 +00:00
Chris Lattner
e4bea062c7
Teach the X86 backend about unreachable and undef. Among other things, we
...
now compile:
'foo() {}' into "ret" instead of "mov EAX, 0; ret"
llvm-svn: 17049
2004-10-16 18:13:05 +00:00
Chris Lattner
583dfdcf86
Add support for unreachable and undef
...
llvm-svn: 17048
2004-10-16 18:12:13 +00:00
Chris Lattner
1a709646e7
Add a missing dependency
...
llvm-svn: 17031
2004-10-16 17:12:55 +00:00
Chris Lattner
947ecace14
Fix file header
...
llvm-svn: 17030
2004-10-16 16:37:42 +00:00
Chris Lattner
15914416ec
Instruction select globals with offsets better. For example, on this test
...
case:
int C[100];
int foo() {
return C[4];
}
We now codegen:
foo:
mov %EAX, DWORD PTR [C + 16]
ret
instead of:
foo:
mov %EAX, OFFSET C
mov %EAX, DWORD PTR [%EAX + 16]
ret
Other impressive features may be coming later.
This patch is contributed by Jeff Cohen!
llvm-svn: 17011
2004-10-15 05:05:29 +00:00
Chris Lattner
3b78938b9e
Give the X86 JIT the ability to encode global+disp constants. Patch
...
contributed by Jeff Cohen!
llvm-svn: 17010
2004-10-15 04:53:13 +00:00
Chris Lattner
19025d5ad0
Give the X86 asm printer the ability to print out addressing modes that have
...
constant displacements from global variables. Patch by Jeff Cohen!
llvm-svn: 17009
2004-10-15 04:44:53 +00:00
Chris Lattner
df7b984f5a
Allow X86 addressing modes to represent globals with offsets. Patch contributed
...
by Jeff Cohen!
llvm-svn: 17008
2004-10-15 04:43:20 +00:00
Nate Begeman
a15c246af9
Better codegen of binary integer ops with 32 bit immediate operands.
...
This transformation fires a few dozen times across the testsuite.
For example, int test2(int X) { return X ^ 0x0FF00FF0; }
Old:
_test2:
lis r2, 4080
ori r2, r2, 4080
xor r3, r3, r2
blr
New:
_test2:
xoris r3, r3, 4080
xori r3, r3, 4080
blr
llvm-svn: 17004
2004-10-15 00:50:19 +00:00
Misha Brukman
aa8f87c83c
The field is called `imm22', not simply `imm'
...
llvm-svn: 17003
2004-10-14 22:33:32 +00:00
Misha Brukman
b03f27c96c
Synthetic instructions RET and RETL need to have all 3 parameters specified
...
llvm-svn: 17002
2004-10-14 22:32:49 +00:00
Misha Brukman
b34fcdaa46
Class F2_1 already inherits the imm22 field from class F2
...
llvm-svn: 17001
2004-10-14 22:32:24 +00:00
Misha Brukman
7183fc3a84
Generate the SparcV8 code emitter from .td files
...
llvm-svn: 17000
2004-10-14 21:57:19 +00:00
Misha Brukman
98ebcd88f2
* In the F3_1 class, default asi to 0 because it's not currently used
...
* In the F3_3 class, remove mention of asi because it's not part of the format
llvm-svn: 16999
2004-10-14 21:53:39 +00:00
Brian Gaeke
1f864b5583
Add FSTOI, FDTOI (fp to integer cast) instructions.
...
llvm-svn: 16996
2004-10-14 19:39:35 +00:00
Brian Gaeke
1519c24cff
Rewrite emitCastOperation, refactoring parts of it into emitIntegerCast, and
...
adding emitFPToIntegerCast.
llvm-svn: 16995
2004-10-14 19:39:34 +00:00
Brian Gaeke
38a4dd3d15
Add list of libc procedures we'll use, at some point.
...
Update list of currently failing tests.
ADJCALLSTACK* support is done.
llvm-svn: 16994
2004-10-14 19:39:33 +00:00
Misha Brukman
1f596c3358
* Claim to support machine code emission - return false from
...
addPassesToEmitMachineCode()
* Add support for registers and constants in getMachineOpValue()
This enables running "int main() { ret 0 }" via the PowerPC JIT.
llvm-svn: 16983
2004-10-14 06:39:56 +00:00
Misha Brukman
8b1bf4323f
* Include the real (generated) version of getBinaryCodeForInstr()
...
* Add implementation of getMachineOpValue() for generated code emitter
* Convert assert()s in unimplemented functions to abort()s so that non-debug
builds fail predictably
* Add file header comments
llvm-svn: 16981
2004-10-14 06:07:25 +00:00
Misha Brukman
c2d6aaeaa0
* Make a PPC32-specific code emitter because we have separate classes for 32-
...
and 64-bit code emitters that cannot share code unless we use virtual
functions
* Identify components being built by tablegen with more detail by assigning them
to PowerPC, PPC32, or PPC64 more specifically; also avoids seeing 'building
PowerPC XYZ' messages twice, where one is for PPC32 and one for PPC64
llvm-svn: 16980
2004-10-14 06:04:56 +00:00
Tanya Lattner
d38a7605d8
Checking in code that works on my simple test case. However, there is still a bug with branches that I need to fix.
...
llvm-svn: 16979
2004-10-14 06:04:28 +00:00
Misha Brukman
189f3dc8d2
There is only one field in an instruction, and that is `Inst', the final view of
...
the instruction binary format, all others are simply operands and should not
have the `field' label
llvm-svn: 16978
2004-10-14 05:55:37 +00:00
Misha Brukman
d6ac8f5e5a
PowerPC instruction definitions use LittleEndian-style encoding [0..31]
...
llvm-svn: 16977
2004-10-14 05:54:38 +00:00
Misha Brukman
dba1f62eb8
Add isLittleEndianEncoding to InstrInfo class, defaults to `off'
...
llvm-svn: 16976
2004-10-14 05:53:40 +00:00
Reid Spencer
ace94df71f
Update to reflect changes in Makefile rules.
...
llvm-svn: 16950
2004-10-13 11:46:52 +00:00
Chris Lattner
58043a1473
Fix a warning that is emitted on the suns
...
llvm-svn: 16917
2004-10-11 15:50:40 +00:00
Misha Brukman
b4cb9fc7c9
Add ModuloScheduling to the recursive build tree
...
llvm-svn: 16905
2004-10-10 23:36:09 +00:00
Misha Brukman
9da1134bfb
Adjust header file inclusion due to move
...
llvm-svn: 16904
2004-10-10 23:34:50 +00:00
Misha Brukman
c70014bea3
Adjust comment header and paths to refect move
...
llvm-svn: 16903
2004-10-10 23:34:36 +00:00
Misha Brukman
4a4af7e20c
ModuloScheduling moved to lib/Target/SparcV9 as it is SparcV9-specific
...
llvm-svn: 16902
2004-10-10 23:33:20 +00:00
Reid Spencer
823f302ff9
Initial version of automake Makefile.am file.
...
llvm-svn: 16898
2004-10-10 22:52:14 +00:00
Reid Spencer
ef6ba8db70
Add the new InstrSched directory.
...
llvm-svn: 16897
2004-10-10 22:51:03 +00:00
Reid Spencer
97327f05fc
Initial version of automake Makefile.am file.
...
llvm-svn: 16893
2004-10-10 22:20:40 +00:00
Brian Gaeke
4a69c9d667
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
7be91b34b8
Implement eliminateCallFramePseudoInstr().
...
Wrap a long comment line.
llvm-svn: 16883
2004-10-10 19:57:21 +00:00
Brian Gaeke
9770e416c5
Model calls as *both* using *and* killing O0..O5, because callees use the
...
argument values passed in (so they're not dead until *after* the call),
and callees are free to modify those registers.
llvm-svn: 16882
2004-10-10 19:57:20 +00:00
Brian Gaeke
8a4d5caa76
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
Chris Lattner
3acdb7fa1b
bling bling!
...
llvm-svn: 16873
2004-10-10 16:26:13 +00:00
Chris Lattner
f9ae6db749
Instead of silently breaking, print notification of why this doesn't work.
...
llvm-svn: 16870
2004-10-09 21:13:51 +00:00
Brian Gaeke
74584cd842
update according to tonight's info
...
llvm-svn: 16866
2004-10-09 05:58:27 +00:00
Brian Gaeke
9c0710781d
Implement getModuleMatchQuality and getJITMatchQuality so that v8 will be the
...
default 32/BE target on sparc hosts, and ppc will continue to be the default
on other hosts.
llvm-svn: 16865
2004-10-09 05:57:01 +00:00
Chris Lattner
23c8d0b65a
The person who was planning to add SSE support isn't anymore, so disable
...
the -sse* options (to avoid misleading people).
Also, the stack alignment of the target doesn't depend on whether SSE is
eventually implemented, so remove a comment.
llvm-svn: 16860
2004-10-08 22:41:46 +00:00
Chris Lattner
97ea4206f7
Fix a major regression from the bugfix for 2004-10-08-SelectSetCCFold.llx,
...
which prevented setcc's from being folded into branches. It appears that
conditional branchinst's CC operand is actually operand(2), not operand(0)
as we might expect. :(
llvm-svn: 16859
2004-10-08 22:24:31 +00:00
Misha Brukman
e4e1360eab
Adjust paths due to moving InstrSched to lib/Target/SparcV9
...
llvm-svn: 16852
2004-10-08 18:30:22 +00:00
Misha Brukman
24eb38af7c
InstrSched is SparcV9-specific and so has been moved to lib/Target/SparcV9/
...
llvm-svn: 16849
2004-10-08 18:12:14 +00:00
Misha Brukman
5a9976ac29
Single-space instead of double-spacing in the Makefile
...
llvm-svn: 16848
2004-10-08 18:11:14 +00:00
Misha Brukman
e75c26687c
Build InstrSched as well, and all three subdirs can be built independently
...
llvm-svn: 16847
2004-10-08 18:10:48 +00:00
Chris Lattner
0be2f50401
Fix bug: 2004-10-08-SelectSetCCFold.llx. Normally this is hidden by the
...
instcombine xform, which is why we didn't notice it before.
llvm-svn: 16840
2004-10-08 16:34:13 +00:00
Nate Begeman
b58dd6799f
Implement logical and with an immediate that consists of a contiguous block
...
of one or more 1 bits (may wrap from least significant bit to most
significant bit) as the rlwinm rather than andi., andis., or some longer
instructons sequence.
int andn4(int z) { return z & -4; }
int clearhi(int z) { return z & 0x0000FFFF; }
int clearlo(int z) { return z & 0xFFFF0000; }
int clearmid(int z) { return z & 0x00FFFF00; }
int clearwrap(int z) { return z & 0xFF0000FF; }
_andn4:
rlwinm r3, r3, 0, 0, 29
blr
_clearhi:
rlwinm r3, r3, 0, 16, 31
blr
_clearlo:
rlwinm r3, r3, 0, 0, 15
blr
_clearmid:
rlwinm r3, r3, 0, 8, 23
blr
_clearwrap:
rlwinm r3, r3, 0, 24, 7
blr
llvm-svn: 16832
2004-10-08 02:49:24 +00:00
Nate Begeman
6e6514c47e
Several fixes and enhancements to the PPC32 backend.
...
1. Fix an illegal argument to getClassB when deciding whether or not to
sign extend a byte load.
2. Initial addition of isLoad and isStore flags to the instruction .td file
for eventual use in a scheduler.
3. Rewrite of how constants are handled in emitSimpleBinaryOperation so
that we can emit the PowerPC shifted immediate instructions far more
often. This allows us to emit the following code:
int foo(int x) { return x | 0x00F0000; }
_foo:
.LBB_foo_0: ; entry
; IMPLICIT_DEF
oris r3, r3, 15
blr
llvm-svn: 16826
2004-10-07 22:30:03 +00:00
Nate Begeman
c6b63cd2ed
Add ori reg, reg, 0 as a move instruction. This can be generated from
...
loading a 32bit constant into a register whose low halfword is all zeroes.
We now omit the ori after the lis for the following C code:
int bar(int y) { return y * 0x00F0000; }
_bar:
.LBB_bar_0: ; entry
; IMPLICIT_DEF
lis r2, 15
mullw r3, r3, r2
blr
llvm-svn: 16825
2004-10-07 22:26:12 +00:00
Nate Begeman
70a9d9c0b1
Remove unnecessary header include
...
llvm-svn: 16824
2004-10-07 22:24:32 +00:00
Chris Lattner
f94f985bbd
Correct some typeos
...
llvm-svn: 16770
2004-10-06 16:28:24 +00:00
Chris Lattner
93867e516a
Remove debugging code, fix encoding problem. This fixes the problems
...
the JIT had last night.
llvm-svn: 16766
2004-10-06 14:31:50 +00:00
Nate Begeman
9a1fbaf1e9
Turning on fsel code gen now that we can do so would be good.
...
llvm-svn: 16765
2004-10-06 11:03:30 +00:00
Nate Begeman
fac8529df8
Implement floating point select for lt, gt, le, ge using the powerpc fsel
...
instruction.
Now, rather than emitting the following loop out of bisect:
.LBB_main_19: ; no_exit.0.i
rlwinm r3, r2, 3, 0, 28
lfdx f1, r3, r27
addis r3, r30, ha16(.CPI_main_1-"L00000$pb")
lfd f2, lo16(.CPI_main_1-"L00000$pb")(r3)
fsub f2, f2, f1
addis r3, r30, ha16(.CPI_main_1-"L00000$pb")
lfd f4, lo16(.CPI_main_1-"L00000$pb")(r3)
fcmpu cr0, f1, f4
bge .LBB_main_64 ; no_exit.0.i
.LBB_main_63: ; no_exit.0.i
b .LBB_main_65 ; no_exit.0.i
.LBB_main_64: ; no_exit.0.i
fmr f2, f1
.LBB_main_65: ; no_exit.0.i
addi r3, r2, 1
rlwinm r3, r3, 3, 0, 28
lfdx f1, r3, r27
addis r3, r30, ha16(.CPI_main_1-"L00000$pb")
lfd f4, lo16(.CPI_main_1-"L00000$pb")(r3)
fsub f4, f4, f1
addis r3, r30, ha16(.CPI_main_1-"L00000$pb")
lfd f5, lo16(.CPI_main_1-"L00000$pb")(r3)
fcmpu cr0, f1, f5
bge .LBB_main_67 ; no_exit.0.i
.LBB_main_66: ; no_exit.0.i
b .LBB_main_68 ; no_exit.0.i
.LBB_main_67: ; no_exit.0.i
fmr f4, f1
.LBB_main_68: ; no_exit.0.i
fadd f1, f2, f4
addis r3, r30, ha16(.CPI_main_2-"L00000$pb")
lfd f2, lo16(.CPI_main_2-"L00000$pb")(r3)
fmul f1, f1, f2
rlwinm r3, r2, 3, 0, 28
lfdx f2, r3, r28
fadd f4, f2, f1
fcmpu cr0, f4, f0
bgt .LBB_main_70 ; no_exit.0.i
.LBB_main_69: ; no_exit.0.i
b .LBB_main_71 ; no_exit.0.i
.LBB_main_70: ; no_exit.0.i
fmr f0, f4
.LBB_main_71: ; no_exit.0.i
fsub f1, f2, f1
addi r2, r2, -1
fcmpu cr0, f1, f3
blt .LBB_main_73 ; no_exit.0.i
.LBB_main_72: ; no_exit.0.i
b .LBB_main_74 ; no_exit.0.i
.LBB_main_73: ; no_exit.0.i
fmr f3, f1
.LBB_main_74: ; no_exit.0.i
cmpwi cr0, r2, -1
fmr f16, f0
fmr f17, f3
bgt .LBB_main_19 ; no_exit.0.i
We emit this instead:
.LBB_main_19: ; no_exit.0.i
rlwinm r3, r2, 3, 0, 28
lfdx f1, r3, r27
addis r3, r30, ha16(.CPI_main_1-"L00000$pb")
lfd f2, lo16(.CPI_main_1-"L00000$pb")(r3)
fsub f2, f2, f1
fsel f1, f1, f1, f2
addi r3, r2, 1
rlwinm r3, r3, 3, 0, 28
lfdx f2, r3, r27
addis r3, r30, ha16(.CPI_main_1-"L00000$pb")
lfd f4, lo16(.CPI_main_1-"L00000$pb")(r3)
fsub f4, f4, f2
fsel f2, f2, f2, f4
fadd f1, f1, f2
addis r3, r30, ha16(.CPI_main_2-"L00000$pb")
lfd f2, lo16(.CPI_main_2-"L00000$pb")(r3)
fmul f1, f1, f2
rlwinm r3, r2, 3, 0, 28
lfdx f2, r3, r28
fadd f4, f2, f1
fsub f5, f0, f4
fsel f0, f5, f0, f4
fsub f1, f2, f1
addi r2, r2, -1
fsub f2, f1, f3
fsel f3, f2, f3, f1
cmpwi cr0, r2, -1
fmr f16, f0
fmr f17, f3
bgt .LBB_main_19 ; no_exit.0.i
llvm-svn: 16764
2004-10-06 09:53:04 +00:00
Chris Lattner
6835dedb5b
Codegen signed mod by 2 or -2 more efficiently. Instead of generating:
...
t:
mov %EDX, DWORD PTR [%ESP + 4]
mov %ECX, 2
mov %EAX, %EDX
sar %EDX, 31
idiv %ECX
mov %EAX, %EDX
ret
Generate:
t:
mov %ECX, DWORD PTR [%ESP + 4]
*** mov %EAX, %ECX
cdq
and %ECX, 1
xor %ECX, %EDX
sub %ECX, %EDX
*** mov %EAX, %ECX
ret
Note that the two marked moves are redundant, and should be eliminated by the
register allocator, but aren't.
Compare this to GCC, which generates:
t:
mov %eax, DWORD PTR [%esp+4]
mov %edx, %eax
shr %edx, 31
lea %ecx, [%edx+%eax]
and %ecx, -2
sub %eax, %ecx
ret
or ICC 8.0, which generates:
t:
movl 4(%esp), %ecx #3.5
movl $-2147483647, %eax #3.25
imull %ecx #3.25
movl %ecx, %eax #3.25
sarl $31, %eax #3.25
addl %ecx, %edx #3.25
subl %edx, %eax #3.25
addl %eax, %eax #3.25
negl %eax #3.25
subl %eax, %ecx #3.25
movl %ecx, %eax #3.25
ret #3.25
We would be in great shape if not for the moves.
llvm-svn: 16763
2004-10-06 05:01:07 +00:00
Chris Lattner
e4c60eb704
Really fix FreeBSD, which apparently doesn't tolerate the extern.
...
Thanks to Jeff Cohen for pointing out my goof.
llvm-svn: 16762
2004-10-06 04:21:52 +00:00
Chris Lattner
7bd8f1332d
Fix a scary bug with signed division by a power of two. We used to generate:
...
s: ;; X / 4
mov %EAX, DWORD PTR [%ESP + 4]
mov %ECX, %EAX
sar %ECX, 1
shr %ECX, 30
mov %EDX, %EAX
add %EDX, %ECX
sar %EAX, 2
ret
When we really meant:
s:
mov %EAX, DWORD PTR [%ESP + 4]
mov %ECX, %EAX
sar %ECX, 1
shr %ECX, 30
add %EAX, %ECX
sar %EAX, 2
ret
Hey, this also reduces register pressure too :)
llvm-svn: 16761
2004-10-06 04:19:43 +00:00
Chris Lattner
147edd2f7e
Codegen signed divides by 2 and -2 more efficiently. In particular
...
instead of:
s: ;; X / 2
movl 4(%esp), %eax
movl %eax, %ecx
shrl $31, %ecx
movl %eax, %edx
addl %ecx, %edx
sarl $1, %eax
ret
t: ;; X / -2
movl 4(%esp), %eax
movl %eax, %ecx
shrl $31, %ecx
movl %eax, %edx
addl %ecx, %edx
sarl $1, %eax
negl %eax
ret
Emit:
s:
movl 4(%esp), %eax
cmpl $-2147483648, %eax
sbbl $-1, %eax
sarl $1, %eax
ret
t:
movl 4(%esp), %eax
cmpl $-2147483648, %eax
sbbl $-1, %eax
sarl $1, %eax
negl %eax
ret
llvm-svn: 16760
2004-10-06 04:02:39 +00:00
Chris Lattner
e9bfa5a2a4
Add some new instructions. Fix the asm string for sbb32rr
...
llvm-svn: 16759
2004-10-06 04:01:02 +00:00
Chris Lattner
32ed828f46
FreeBSD uses GCC. Patch contributed by Jeff Cohen!
...
llvm-svn: 16756
2004-10-06 03:15:44 +00:00
Chris Lattner
d1ab378be5
* Prune #includes
...
* Update comments
* Rearrange code a bit
* Finally ELIMINATE the GAS workaround emitter for Intel mode. woot!
llvm-svn: 16647
2004-10-04 07:31:08 +00:00
Chris Lattner
68ab0beb1b
Add support for emitting AT&T style .s files, and make it the default. Users
...
may now choose their output format with the -x86-asm-syntax={intel|att} flag.
llvm-svn: 16646
2004-10-04 07:24:48 +00:00
Chris Lattner
8bbde2fb33
Convert some missed patterns to support AT&T style
...
llvm-svn: 16645
2004-10-04 07:23:07 +00:00
Chris Lattner
2e99778aad
Apparently the GNU assembler has a HUGE hack to be compatible with really
...
old and broken AT&T syntax assemblers. The problem with this hack is that
*SOME* forms of the fdiv and fsub instructions have the 'r' bit inverted.
This was a real pain to figure out, but is trivially easy to support: thus
we are now bug compatible with gas and gcc.
llvm-svn: 16644
2004-10-04 07:08:46 +00:00
Chris Lattner
af69503332
Fix incorrect suffix
...
llvm-svn: 16642
2004-10-04 05:20:16 +00:00
Chris Lattner
e1a2826d51
Fix some more missed suffixes and swapped operands
...
llvm-svn: 16641
2004-10-04 01:38:10 +00:00
Chris Lattner
a488f04f3e
Add missing suffixes to FP instructions for AT&T mode
...
llvm-svn: 16640
2004-10-04 00:43:31 +00:00
Chris Lattner
5683260187
Add support for the -x86-asm-syntax flag, which can be used to choose between
...
Intel and AT&T style assembly language. The ultimate goal of this is to
eliminate the GasBugWorkaroundEmitter class, but for now AT&T style emission
is not fully operational.
llvm-svn: 16639
2004-10-03 20:36:57 +00:00
Chris Lattner
4e59a14909
Add support to the instruction patterns for AT&T style output, which will
...
hopefully lead to the death of the 'GasBugWorkaroundEmitter'. This also
includes changes to wrap the whole file to 80 columns! Woot! :)
Note that the AT&T style output has not been tested at all.
llvm-svn: 16638
2004-10-03 20:35:00 +00:00
Chris Lattner
42c43b2cb3
Add initial support for variants
...
llvm-svn: 16635
2004-10-03 19:34:18 +00:00
Brian Gaeke
dd9bb500ad
Make EmitMappingInfo into an "external location" option, so that it can be set
...
or cleared externally.
llvm-svn: 16623
2004-09-30 20:20:01 +00:00
Brian Gaeke
a1640d2427
I think this will handle double args.
...
llvm-svn: 16618
2004-09-30 19:44:32 +00:00
Brian Gaeke
7efd5fcb3a
Mark the instructions that have delay slots with the hasDelaySlot flag.
...
Add some comments.
llvm-svn: 16611
2004-09-30 04:04:48 +00:00
Brian Gaeke
1f48ef2a9a
Use TargetMachine::hasDelaySlot() instead of our old switch statement
...
to find instrs that have delay slots.
llvm-svn: 16610
2004-09-30 04:04:47 +00:00
Misha Brukman
4592f86ef1
Change the #ifdefs to allow compilation with a V8 compiler, but the JIT still
...
won't work if not compiled in V9 mode, currently by GCC only, because Sun's
system compiler does not tell us if it's a V8 or V9 system.
llvm-svn: 16602
2004-09-29 23:01:17 +00:00
Brian Gaeke
fb1fd0cb5f
Update list of shootout programs that should be working.
...
llvm-svn: 16595
2004-09-29 20:45:06 +00:00
Brian Gaeke
ede068a8d3
Tell the target description that calls clobber registers O0...O5.
...
llvm-svn: 16594
2004-09-29 20:45:05 +00:00
Brian Gaeke
3a340dd7cd
FITOD is spelled "fitod", not "fitos". Ouch.
...
llvm-svn: 16591
2004-09-29 19:59:07 +00:00
Brian Gaeke
47095da661
Don't use .quad to output double constants. The assembler must have a bug or
...
something, because the wrong bit patterns get output.
llvm-svn: 16590
2004-09-29 19:59:06 +00:00
Brian Gaeke
81f5e08573
Recognize FpMOVD as a move.
...
llvm-svn: 16586
2004-09-29 16:45:47 +00:00
Nate Begeman
2f1d0ae95e
Generate better code by being far less clever when it comes to the select instruction. Don't create overlapping register lifetimes
...
llvm-svn: 16580
2004-09-29 05:00:31 +00:00
Brian Gaeke
c44da15813
add results
...
llvm-svn: 16579
2004-09-29 03:48:55 +00:00
Nate Begeman
7b6df6def2
improve Type::BoolTy codegen by eliminating unnecessary clears and sign extends
...
llvm-svn: 16578
2004-09-29 03:45:33 +00:00
Brian Gaeke
4023d4e191
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
Brian Gaeke
eae5b17dba
Fix bug recognizing moves: isMoveInstr should only treat ORs with %g0 as
...
moves, not all ORs.
llvm-svn: 16576
2004-09-29 03:28:15 +00:00
Brian Gaeke
069bb989e4
Use FpMOVD pseudo-instruction to move doubles around.
...
llvm-svn: 16575
2004-09-29 03:27:30 +00:00
Brian Gaeke
da371d9cf3
Add new FpMOVD pseudo-instruction, used to move doubles around.
...
llvm-svn: 16574
2004-09-29 03:27:29 +00:00
Brian Gaeke
7f11dd4825
Fix double and long alignment.
...
Call the FPMover pass after register allocation.
llvm-svn: 16573
2004-09-29 03:26:27 +00:00
Brian Gaeke
ead8e39832
Put quotes around argument to .section directive.
...
llvm-svn: 16572
2004-09-29 03:25:40 +00:00
Brian Gaeke
457180c597
Add createSparcV8FPMoverPass().
...
llvm-svn: 16571
2004-09-29 03:25:39 +00:00
Brian Gaeke
ce0ba4857b
Pass which converts FpMOVD (double move pseudoinstructions) to pairs
...
of FMOVS instrs.
llvm-svn: 16570
2004-09-29 03:24:34 +00:00
Nate Begeman
26566f0b68
To go along with sabre's improved InstCombining, improve recognition of
...
integers that we can use as immediate values in instructions.
Example from yacr2:
- lis r10, -1
- ori r10, r10, 65535
- add r28, r28, r10
+ addi r28, r28, -1
addi r7, r7, 1
addi r9, r9, 1
b .LBB_main_9 ; loopentry.1.i214
llvm-svn: 16566
2004-09-29 02:35:05 +00:00
Nate Begeman
c762ab723b
Add support for the isLoad and isStore flags, needed by the instruction scheduler
...
llvm-svn: 16555
2004-09-28 21:29:00 +00:00
Chris Lattner
6652223bd6
Capture delay slot info
...
llvm-svn: 16551
2004-09-28 18:34:14 +00:00
Alkis Evlogimenos
6280a7b716
Since we use alloca now make sure we include the proper headers for it.
...
llvm-svn: 16536
2004-09-28 02:53:15 +00:00
Alkis Evlogimenos
edbb20cf7f
Use alloca instead of a C99 style array. This should fix the
...
compilation problem in windows.
llvm-svn: 16535
2004-09-28 02:47:38 +00:00
Alkis Evlogimenos
3ce42ec7ee
Pull assignment out of for loop conditional in order for this to
...
compile under windows. Patch contributed by Paolo Invernizzi!
llvm-svn: 16534
2004-09-28 02:40:37 +00:00
Misha Brukman
d409d38151
SparcV8 int regs are not only 32-bits in width, but they are 32-bit aligned!
...
llvm-svn: 16526
2004-09-27 18:22:18 +00:00
Nate Begeman
8656a156cf
Correct some BuildMI arguments for the upcoming simple scheduler
...
llvm-svn: 16519
2004-09-27 05:08:17 +00:00
Misha Brukman
a68d76ebfa
Fix the copy-pasto that Brian noticed: V8 int regs are 32-bits wide, not 64.
...
llvm-svn: 16518
2004-09-26 21:07:43 +00:00
Nate Begeman
49cf74b26c
Fix the last of the major PPC GEP folding deficiencies. This will allow
...
the ISel to use indexed and non-zero immediate offsets for GEPs that have
more than one use. This is common for instruction sequences such as a load
followed by a modify and store to the same address.
llvm-svn: 16493
2004-09-23 05:31:33 +00:00
Misha Brukman
379a05b52a
Use the V8/V9 shared register file description
...
llvm-svn: 16485
2004-09-22 21:48:50 +00:00
Misha Brukman
3c08658d56
Combine the F2 and F3 instruction classes into one file for simplicity
...
llvm-svn: 16484
2004-09-22 21:38:42 +00:00
Misha Brukman
efce1ef9c3
Fix file header path
...
llvm-svn: 16483
2004-09-22 21:29:12 +00:00
Misha Brukman
009aaf9968
Prettify formatting of the file, adjust paths to making V8 a subdir of Sparc
...
llvm-svn: 16482
2004-09-22 20:09:29 +00:00
Misha Brukman
d55f854a5d
V8 is now a subdirectory of Sparc; adjust paths accordingly
...
llvm-svn: 16481
2004-09-22 20:08:52 +00:00
Nate Begeman
033b816171
add optimized code sequences for setcc x, 0
...
llvm-svn: 16478
2004-09-22 04:40:25 +00:00
Alkis Evlogimenos
89dd63733a
The real x87 floating point registers should not be allocatable. They
...
are only used by the stackifier when transforming FPn register
allocations to the real stack file x87 registers.
llvm-svn: 16472
2004-09-21 21:22:11 +00:00
Misha Brukman
6b17bf7193
s/ISel/PPC64ISel/ to have unique class names for debugging via gdb because the
...
C++ front-end in gcc does not mangle classes in anonymous namespaces correctly.
llvm-svn: 16471
2004-09-21 18:22:33 +00:00
Misha Brukman
87201ce8f9
s/ISel/PPC32ISel/ to have unique class names for debugging via gdb because the
...
C++ front-end in gcc does not mangle classes in anonymous namespaces correctly.
llvm-svn: 16470
2004-09-21 18:22:19 +00:00
Misha Brukman
43bd39e04e
s/ISel/X86ISel/ to have unique class names for debugging via gdb because the C++
...
front-end in gcc does not mangle classes in anonymous namespaces correctly.
llvm-svn: 16469
2004-09-21 18:21:21 +00:00
Chris Lattner
0f28cce60c
Make sure to set the operand list
...
llvm-svn: 16466
2004-09-21 17:30:54 +00:00
Chris Lattner
4f2cf030e8
'Pass' should now not be derived from by clients. Instead, they should derive
...
from ModulePass. Instead of implementing Pass::run, then should implement
ModulePass::runOnModule.
llvm-svn: 16436
2004-09-20 04:48:05 +00:00
Reid Spencer
6614946443
Convert code to compile with vc7.1.
...
Patch contributed by Paolo Invernizzi. Thanks Paolo!
llvm-svn: 16368
2004-09-15 17:06:42 +00:00
Misha Brukman
4bf01357e1
Fit long lines into 80 cols via creative space elimination
...
llvm-svn: 16353
2004-09-15 01:40:18 +00:00
Misha Brukman
2d01db846b
Targets are independent of each other, so compile them in parallel
...
llvm-svn: 16351
2004-09-15 01:34:25 +00:00
Chris Lattner
e8e81a2941
Revamp the Register class, and allow the use of the RegisterGroup class to
...
specify aliases directly in register definitions.
Patch contributed by Jason Eckhardt!
llvm-svn: 16330
2004-09-14 04:17:02 +00:00
Chris Lattner
247c29e4b0
Changes to make this work with Jason's patch. I checked this by hand, but
...
would appreciate if others would also look at this to make sure I didn't
botch something obvious
llvm-svn: 16312
2004-09-13 21:32:03 +00:00
Misha Brukman
72be9ae024
Fix filename: Printer.cpp has become X86AsmPrinter.cpp
...
llvm-svn: 16299
2004-09-12 21:26:04 +00:00
Misha Brukman
04bbe6fa25
Renamed file to SparcV8ISelSimple.cpp
...
llvm-svn: 16267
2004-09-10 18:51:12 +00:00
Brian Gaeke
86584749b6
Roll back constant printing changes until the problems with larger
...
programs and C++ can be looked at in detail.
llvm-svn: 16266
2004-09-10 18:01:45 +00:00
Alkis Evlogimenos
371403193c
Use a shorter form to express implicit use/defs in FpGETRESULT and
...
FpSETRESULT.
llvm-svn: 16247
2004-09-08 18:29:31 +00:00
Alkis Evlogimenos
8b700215ed
A call instruction should implicitely define ST0 since the return
...
value is returned in that register. The pseudo instructions
FpGETRESULT and FpSETRESULT shold also have an implicity use and def
of ST0 repsecitvely.
llvm-svn: 16246
2004-09-08 16:54:54 +00:00
Brian Gaeke
acafb39cc3
This file does not need <iostream>, I think.
...
llvm-svn: 16245
2004-09-08 04:10:52 +00:00
Nate Begeman
54bcf2db01
Add 64 bit divide instructions, and use them
...
llvm-svn: 16198
2004-09-06 18:46:59 +00:00
Misha Brukman
175fdd4678
* Change PPC32AsmPrinter => PowerPCAsmPrinter since it is now shared between
...
Darwin and AIX and is not 32- or 64-bit specific
* Bring back PowerPC.td as a result, to make it use the `PowerPC' class name
* Adjust Makefile accordingly
llvm-svn: 16174
2004-09-05 02:42:44 +00:00
Misha Brukman
4acadb3af7
Renamed PPC32AsmPrinter.cpp => PowerPCAsmPrinter.cpp as the Darwin and AIX asm
...
printers are now unified into one file.
llvm-svn: 16173
2004-09-05 02:27:37 +00:00
Nate Begeman
4d847047a0
Include MathExtras.h to fix build breakage, thanks to Vladimir
...
llvm-svn: 16164
2004-09-04 14:51:26 +00:00
Nate Begeman
4bfceb1ed5
All PPC instructions are now auto-printed
...
32 and 64 bit AsmWriters unified
Darwin and AIX specific features of AsmWriter split out
llvm-svn: 16163
2004-09-04 05:00:00 +00:00
Reid Spencer
0ded30aec4
Clean up some "clean:" targets so they use $(VERB) and don't print anything
...
by default, like every other "clean" target in LLVM.
llvm-svn: 16161
2004-09-03 23:19:53 +00:00
Nate Begeman
6173878304
Convert remaining X-Form and Pseudo instructions over to asm writer
...
llvm-svn: 16142
2004-09-02 08:13:00 +00:00
Brian Gaeke
c6e81f0fde
Back to compiling land for v8
...
llvm-svn: 16138
2004-09-02 02:37:43 +00:00
Reid Spencer
7c16caa336
Changes For Bug 352
...
Move include/Config and include/Support into include/llvm/Config,
include/llvm/ADT and include/llvm/Support. From here on out, all LLVM
public header files must be under include/llvm/.
llvm-svn: 16137
2004-09-01 22:55:40 +00:00
Nate Begeman
a113d74e4c
convert M and MD form instructions to generated asm writer
...
llvm-svn: 16121
2004-08-31 02:28:08 +00:00
Nate Begeman
143cf94f92
Move yet more instructions over to being printed by the generated asm writer
...
llvm-svn: 16112
2004-08-30 02:28:06 +00:00
Reid Spencer
8aca0b494d
Reduce the number of arguments in the instruction builder and make some
...
improvements on instruction selection that account for register and frame
index bases.
Patch contributed by Jeff Cohen. Thanks Jeff!
llvm-svn: 16110
2004-08-30 00:13:26 +00:00
Nate Begeman
6cdbd22245
Convert A-Form instructions to auto-generated asm writer
...
llvm-svn: 16107
2004-08-29 22:45:13 +00:00
Nate Begeman
434234f6d1
Register sizes should be specified in bits
...
llvm-svn: 16106
2004-08-29 22:03:40 +00:00
Nate Begeman
8cb6bd5f3c
Improvements to int->float cast code for PPC-64
...
llvm-svn: 16105
2004-08-29 22:02:43 +00:00
Nate Begeman
4483df8b63
Implement the following missing functionality in the PPC backend:
...
cast fp->bool
cast ulong->fp
algebraic right shift long by non-constant value
These changes tested across most of the test suite. Fixes Regression/casts
llvm-svn: 16081
2004-08-29 08:19:32 +00:00
Nate Begeman
fa2bf42539
Register sizes are in bits, not bytes
...
llvm-svn: 16070
2004-08-27 04:28:10 +00:00
Alkis Evlogimenos
8b5b3fdb50
Add getAllocatableSet() function.
...
llvm-svn: 16059
2004-08-26 22:21:04 +00:00
Brian Gaeke
7f00753f70
Previous checkin broke printf(%a) support for fp constants-- re-fix it.
...
llvm-svn: 16051
2004-08-25 19:37:26 +00:00
Brian Gaeke
35eb7aeae3
New version of Bill Wendling's PR33 patch.
...
llvm-svn: 16050
2004-08-25 19:00:42 +00:00
Chris Lattner
dfa9dbceaa
Add -sse[,2,3] arguments to LLC
...
llvm-svn: 16018
2004-08-24 08:18:44 +00:00
Chris Lattner
61e6dbc761
Nuke commented out stuff
...
llvm-svn: 16017
2004-08-24 08:18:27 +00:00
Brian Gaeke
75dca84c7f
This code is dodgy, but the guaranteed assertion failure doesn't help anything.
...
llvm-svn: 16014
2004-08-24 06:41:40 +00:00
Brian Gaeke
98aa7797c3
Fix bug in PhyRegAlloc::setCallInterferences() handling call through a
...
null pointer.
llvm-svn: 16013
2004-08-24 06:41:39 +00:00
Brian Gaeke
d315f43587
Revise head-of-file comment.
...
Eliminate some excess whitespace.
Fix bug in CallArgsDescriptor::get() handling call through a null pointer.
llvm-svn: 16012
2004-08-24 06:41:38 +00:00
Nate Begeman
1c57b4fa32
Kill a majority of unnecessary sign extensions for byte loads
...
llvm-svn: 15991
2004-08-22 08:10:15 +00:00
Nate Begeman
64ef0262bd
Don't hard code the offset of the saved R31 in functions with frame pointers
...
llvm-svn: 15990
2004-08-22 08:09:17 +00:00
Nate Begeman
45b0b7cd7c
Back out branchless SetCC code. While it helped a lot in some cases, it
...
hurt a lot in others. Instead, improve branching version of SetCC and
Select instructions. The old code will be in CVS should we ever need to
dig it up again.
llvm-svn: 15979
2004-08-21 20:42:14 +00:00
Chris Lattner
70efc8f8e1
Switch from bytes to bits for alignment.
...
Also, change GPRC for PPC32 to align on 32-bit boundary instead of 64-bit
llvm-svn: 15975
2004-08-21 20:14:40 +00:00
Chris Lattner
5f6556da45
Switch from bytes to bits for alignment for consistency
...
llvm-svn: 15974
2004-08-21 20:14:13 +00:00
Chris Lattner
7c98308013
Reduce uses of getRegClass
...
llvm-svn: 15973
2004-08-21 20:13:52 +00:00
Chris Lattner
a440d5b081
Convert regclass alignment from bytes to bites
...
llvm-svn: 15972
2004-08-21 20:13:09 +00:00
Chris Lattner
b7ddc73b45
Convert bytes to bits in alignment
...
llvm-svn: 15971
2004-08-21 20:09:46 +00:00
Chris Lattner
c1ba9fb6e1
Reduce uses of getRegClass
...
llvm-svn: 15968
2004-08-21 19:51:17 +00:00
Chris Lattner
f7833ba375
Fix warning
...
llvm-svn: 15964
2004-08-21 19:11:03 +00:00
Nate Begeman
3ad3ad4f3f
Move XForm instructions over to the auto-generated asm writer
...
llvm-svn: 15962
2004-08-21 05:56:39 +00:00
Chris Lattner
6a92fdef72
Add two values
...
llvm-svn: 15959
2004-08-21 02:17:39 +00:00
Nate Begeman
abf3c4d787
remove some things from the todo list.
...
llvm-svn: 15956
2004-08-20 18:46:54 +00:00
Chris Lattner
f1cd650251
Do not register ppc64 yet, as it breaks the SparcV9 backend
...
llvm-svn: 15955
2004-08-20 18:09:18 +00:00
Nate Begeman
1b1a784afa
Implement code to convert SetCC into straight line code where appropriate. Add necessary instructions for this transformation to the .td file.
...
llvm-svn: 15952
2004-08-20 09:56:22 +00:00
Misha Brukman
8f12956327
Fix opcodes being printed in caps (the more general fix may be `AsmWriter')
...
llvm-svn: 15932
2004-08-19 21:56:12 +00:00
Misha Brukman
170943a795
Stack space for argument passing is 32 regardless of 32- vs. 64-bit arch.
...
Thanks to Nate Begeman for pointing this out.
llvm-svn: 15930
2004-08-19 21:51:19 +00:00
Misha Brukman
f73c87b36c
LR needs to be saved at 16-byte offset on a 64-bit arch
...
llvm-svn: 15929
2004-08-19 21:36:14 +00:00
Misha Brukman
f35b35a926
On 64-bit PowerPC, pointers are 8 bytes, so parameter area offset is 48, not 24
...
llvm-svn: 15928
2004-08-19 21:34:05 +00:00
Misha Brukman
75e987d0b8
This PHI has 4 additional operands, not 2.
...
llvm-svn: 15926
2004-08-19 21:00:12 +00:00
Misha Brukman
a26a61aa18
Use the appropriate 64-bit register description file.
...
llvm-svn: 15922
2004-08-19 19:36:57 +00:00
Misha Brukman
a5543ac5fb
Fix more remaining 32-bit vestiges of PowerPC
...
llvm-svn: 15919
2004-08-19 18:49:58 +00:00
Misha Brukman
2ff719f74f
Fix another vestige of the 32-bit PowerPC backend.
...
llvm-svn: 15918
2004-08-19 16:50:30 +00:00
Misha Brukman
714d166c22
Correct character prepended to global symbols ('.'), use Mangler consistently
...
llvm-svn: 15917
2004-08-19 16:33:56 +00:00
Misha Brukman
0010ea3042
* Eliminate global base register, r2 is used for that on AIX/PowerPC
...
* Fix bug from 32-bit PowerPC days of 2-register long split
llvm-svn: 15916
2004-08-19 16:29:25 +00:00
Misha Brukman
6c4a085286
Wrap long lines.
...
llvm-svn: 15915
2004-08-19 16:28:30 +00:00
Nate Begeman
d5c6380015
Convert casts that will have no effect into move instructions.
...
llvm-svn: 15914
2004-08-19 08:07:50 +00:00
Nate Begeman
e4e6d92d1d
Clean up floating point instruction selection.
...
Change int->float cast code to put conversion constants in constant pool.
Shorten code sequence for constant pool fp loads.
Remove LOADLoDirect/LOADLoIndirect psuedo instructions and tweak asmwriter
llvm-svn: 15913
2004-08-19 05:20:54 +00:00
Brian Gaeke
1936ce708d
M_DUMMY_PHI_FLAG is no longer used to distinguish V9::PHI. Get rid of it and
...
its TargetInstrInfo accessor.
llvm-svn: 15907
2004-08-18 20:04:28 +00:00
Brian Gaeke
7593525fcd
Instead of using isDummyPhiInstr, we just compare the opcode with V9::PHI.
...
llvm-svn: 15906
2004-08-18 20:04:24 +00:00
Chris Lattner
1ea6d207ce
Convert to the new MachineFunctionInfo interface
...
llvm-svn: 15904
2004-08-18 18:13:37 +00:00
Brian Gaeke
b8183ff647
The SparcV9 target no longer uses any pseudoinstructions (SETSW, SETUW,
...
SETX) or M_PSEUDO_FLAG.
llvm-svn: 15901
2004-08-18 17:44:16 +00:00
Brian Gaeke
2fbe85b1f3
The Create*Const methods don't need to pass around a TargetMachine reference.
...
Other minor cleanups.
llvm-svn: 15900
2004-08-18 17:44:15 +00:00
Brian Gaeke
c03556f67e
Doxygenify some comments.
...
Clean up cpReg2MemMI and cpMem2RegMI, and doxygenify comments.
Get rid of their uses of SETSW, which is a pseudoinstruction. We can't
JIT-compile pseudoinstructions at the moment. This was blowing up 252.eon/jit,
which has some HUGE stack frames.
Reduce the uses of constantFitsInImmedField().
Consolidate some assertions.
llvm-svn: 15899
2004-08-18 17:44:14 +00:00
Chris Lattner
12754fe6b3
Switch V9 over to using the AsmPrinter base class to do its constant printing
...
Massive thanks to the brg miester for doing the testing. :)
llvm-svn: 15898
2004-08-18 05:29:08 +00:00
Chris Lattner
10262ab3f1
Rename var
...
llvm-svn: 15897
2004-08-18 02:22:55 +00:00
Misha Brukman
faa6e51d6e
This file is no longer used.
...
llvm-svn: 15893
2004-08-17 20:23:33 +00:00
Chris Lattner
2501f5852a
Start using alignment output routines from AsmPrinter.
...
Changes to make this more similar to the X86 asmprinter
Fix overalignment of globals.
llvm-svn: 15891
2004-08-17 19:26:03 +00:00
Chris Lattner
866b58d2ef
Start using alignment output routines from AsmPrinter.
...
Changes to make this more similar to the ppc asmprinter
llvm-svn: 15890
2004-08-17 19:25:42 +00:00
Chris Lattner
0c2ab8a9d4
Add a new helper method to get log2(type alignment)
...
llvm-svn: 15887
2004-08-17 19:13:00 +00:00
Chris Lattner
cc21bfd809
Print comments with ;
...
llvm-svn: 15881
2004-08-17 16:27:26 +00:00
Nate Begeman
0818541631
Re-fix hiding the Frame Pointer from the register allocator in functions
...
that have a frame pointer. This change fixes Burg. In addition, make
the necessary changes to floating point code gen and constant loading after
Chris Lattner's fixes to the asm writer. These changes fix MallocBench/gs
llvm-svn: 15873
2004-08-17 07:17:44 +00:00
Chris Lattner
b3739ceb6e
Use the AsmPrinter emitGlobalConstant.
...
llvm-svn: 15872
2004-08-17 06:48:55 +00:00
Chris Lattner
f97bce7214
Use the emitGlobalConstant defined in AsmPrinter
...
llvm-svn: 15869
2004-08-17 06:37:12 +00:00
Chris Lattner
ac253447d3
New, more general, interface.
...
llvm-svn: 15866
2004-08-17 06:07:43 +00:00
Misha Brukman
9254441cdf
Rewrite targets/rules to generate files for just PowerPC or PPC{32,64}
...
llvm-svn: 15862
2004-08-17 05:11:54 +00:00
Misha Brukman
4eab7f3d5b
Register classes are target-dependent
...
llvm-svn: 15861
2004-08-17 05:10:31 +00:00
Misha Brukman
851a54656a
#include <map> is not necessary here
...
llvm-svn: 15860
2004-08-17 05:09:39 +00:00
Misha Brukman
fd2df5afab
`PowerPC' is no longer a real target
...
llvm-svn: 15859
2004-08-17 05:09:10 +00:00
Misha Brukman
38c61506a8
Move variables and methods which need PPC{32,64}* distinction to subclasses
...
llvm-svn: 15858
2004-08-17 05:08:44 +00:00
Misha Brukman
ba7fe16dbf
No need for an `is64bit' flag
...
llvm-svn: 15857
2004-08-17 05:06:47 +00:00
Misha Brukman
fe3e46a0b3
PowerPCInstrInfo and PowerPCRegisterInfo have gone away; they are replaced
...
by 32- and 64-bit customized files, named appropriately.
llvm-svn: 15856
2004-08-17 05:05:00 +00:00
Misha Brukman
de4fc10733
Consistently name passed with 32 or 64 in their name
...
llvm-svn: 15855
2004-08-17 05:02:58 +00:00
Misha Brukman
68ede7e9ba
PowerPCRegisterInfo no longer takes a bool to differentiate 32 vs 64 bits
...
llvm-svn: 15854
2004-08-17 05:02:18 +00:00
Misha Brukman
d61283f347
The PowerPCInstrInfo class has gone away.
...
llvm-svn: 15853
2004-08-17 05:00:46 +00:00
Misha Brukman
0674182457
PowerPCInstrInfo has gone away, PPC32 and PPC64 share opcodes.
...
llvm-svn: 15852
2004-08-17 04:58:50 +00:00
Misha Brukman
ac0ae7c215
PowerPC 32-/64-bit split: Part II, 64-bit customizations on PowerPC
...
llvm-svn: 15851
2004-08-17 04:57:37 +00:00
Misha Brukman
116f9277f6
PowerPC 32-/64-bit split: Part I, PPC32* bit files, adapted from former PowerPC*
...
llvm-svn: 15850
2004-08-17 04:55:41 +00:00
Chris Lattner
a8fbbc0ec3
Print float constants as 4 byte values.
...
Also, fix endianness problems when cross compiling from little-endian host.
llvm-svn: 15847
2004-08-17 02:48:44 +00:00
Chris Lattner
bc9372bf77
Make sure to put an _ prefix on all identifiers!
...
Also, add some (currently disabled) code to print float's as 32-bits.
llvm-svn: 15846
2004-08-17 02:29:00 +00:00
Chris Lattner
5491774934
More changes to make PPC32 and X86 more similar
...
llvm-svn: 15842
2004-08-16 23:38:36 +00:00
Chris Lattner
b4f1f71bf0
Minor changes to make the diff be nothing against the X86 version
...
llvm-svn: 15841
2004-08-16 23:30:16 +00:00
Chris Lattner
0ced90583d
Finegrainify namespacification
...
Start using the AsmPrinter base class to factor out a bunch of code
llvm-svn: 15840
2004-08-16 23:25:21 +00:00
Chris Lattner
9cf46456cb
Start using the AsmPrinter to emit our first class constants. This also
...
drops our half-assed support for cygwin, which noone uses and doesn't work
anyway.
llvm-svn: 15839
2004-08-16 23:16:06 +00:00
Chris Lattner
7e3f28fcdf
Moved this file out of lib/CodeGen
...
llvm-svn: 15837
2004-08-16 22:38:02 +00:00
Chris Lattner
2cb145ceb5
Hacks to make the MachineFunction class be able to delete the MFI object
...
without knowing anything about it.
llvm-svn: 15836
2004-08-16 22:37:18 +00:00
Chris Lattner
95de5ddbbd
Code moved out of lib/CodeGen/MachineFunction.cpp
...
llvm-svn: 15835
2004-08-16 22:36:54 +00:00
Chris Lattner
9fb30a4257
Move MachineCodeForInstruction.h and MachineFunctionInfo.h into lib/Target/SparcV9
...
llvm-svn: 15830
2004-08-16 21:55:02 +00:00
Brian Gaeke
a7ae92436f
Update and consolidate comments. Remove some excess whitespace.
...
llvm-svn: 15824
2004-08-16 18:27:25 +00:00
Chris Lattner
f2e9ea2106
There is no need for a cast here
...
llvm-svn: 15810
2004-08-16 05:09:58 +00:00
Nate Begeman
ab6b08d937
Update the current state of the world
...
llvm-svn: 15809
2004-08-16 05:06:43 +00:00
Nate Begeman
a6808b8efc
Fix typo of the word 'implicit' I made resolving a CVS conflict. Whoops!
...
llvm-svn: 15808
2004-08-16 02:12:49 +00:00
Nate Begeman
dabf0a52c0
Fix frame pointer handling:
...
Reserve R0 in store/load from stack slot for building >32k offsets from SP
or FP. This also requires we use R11 rather than R0 for holding the LR
value we want to save or restore. Also, tell the register allocator not
to use R31 (our FP) in functions that have a frame pointer. These changes
fix Burg.
llvm-svn: 15807
2004-08-16 01:52:12 +00:00
Nate Begeman
8b44a07246
Fix mismatched adjust down/up of SP in functions that contain variable
...
sized allocas.
llvm-svn: 15806
2004-08-16 01:50:22 +00:00
Chris Lattner
26971f4bc2
V8 never used the instrselectorgenerator
...
llvm-svn: 15791
2004-08-15 23:07:40 +00:00
Chris Lattner
291de48b59
isdummyclass goes away
...
llvm-svn: 15790
2004-08-15 23:04:35 +00:00
Chris Lattner
aa6a8abc02
disable all of the pattern isel stuff
...
llvm-svn: 15788
2004-08-15 23:02:34 +00:00
Chris Lattner
1d088db15e
Disable the pattern isel
...
llvm-svn: 15787
2004-08-15 23:02:17 +00:00
Chris Lattner
48a3b942ae
Insertion methods now return void instead of #instrs inserted. Also, use
...
more powerful forms of BuildMI to concisify the code
llvm-svn: 15782
2004-08-15 22:15:56 +00:00
Chris Lattner
772f0d4106
Code insertion methods now return void instead of #instrs inserted
...
llvm-svn: 15781
2004-08-15 22:15:30 +00:00
Chris Lattner
a0b38d3cb1
Code insertion methods now return void instead of an int.
...
llvm-svn: 15780
2004-08-15 22:15:11 +00:00
Chris Lattner
98de1d7795
These methods no longer take a TargetRegisterClass* operand.
...
llvm-svn: 15774
2004-08-15 21:56:44 +00:00
Alkis Evlogimenos
4922e2e8ef
Make this compile on gc 3.4.1 (static_cast to non-const type was not
...
allowed).
llvm-svn: 15766
2004-08-15 09:18:55 +00:00
Nate Begeman
78862c3717
Add future optimization opportunity
...
llvm-svn: 15760
2004-08-15 06:43:10 +00:00
Nate Begeman
373744c6dc
Fix float to int codepath by always allocating 8 bytes for the target of a double store; optimize cmplwi generation.
...
llvm-svn: 15759
2004-08-15 06:42:28 +00:00
Chris Lattner
7dfaac4300
Zimm16 is now dead. Its entry is not removed from the enum, to avoid having
...
to renumber everything. Similar elimination should be applied to other
operand enum values that are only used to format printing in the .s file.
llvm-svn: 15755
2004-08-15 05:48:47 +00:00
Chris Lattner
da2e56fb0c
Convert all of the DForm_6* operations, which makes all of the Zimm16 users
...
dead.
llvm-svn: 15754
2004-08-15 05:46:14 +00:00
Chris Lattner
ae0c2c7583
Add i1imm
...
llvm-svn: 15753
2004-08-15 05:37:00 +00:00
Chris Lattner
94ab6273b6
Reenable the CCRC
...
llvm-svn: 15752
2004-08-15 05:31:15 +00:00
Chris Lattner
8a796858da
Convert the DForm_4 over to the asmprintergen
...
llvm-svn: 15751
2004-08-15 05:20:16 +00:00
Nate Begeman
abc8173b18
Remove dead code
...
llvm-svn: 15750
2004-08-15 00:31:02 +00:00
Chris Lattner
ec1cc1b861
Print mflr using the asmwriter generator
...
llvm-svn: 15749
2004-08-14 23:27:29 +00:00
Chris Lattner
b08d2a2a11
Update to no longer take MF as an argument
...
llvm-svn: 15748
2004-08-14 22:57:22 +00:00
Chris Lattner
6ffa501d9f
Make the AsmWriter a first-class tblgen object. Allow targets to specify
...
name of the generated asmwriter class, and the name of the format string.
llvm-svn: 15747
2004-08-14 22:50:53 +00:00
Nate Begeman
412602d7d9
Replace PowerPCPEI.cpp with target independant PrologEpilogInserter
...
llvm-svn: 15746
2004-08-14 22:16:36 +00:00
Nate Begeman
0c8c0346f8
Add support for frame pointers, and large offsets from stack and frame pointers. Adopt elimination of MachineFunction& arg from eliminateFrameIndex.
...
llvm-svn: 15745
2004-08-14 22:13:58 +00:00
Nate Begeman
9c7ddc3e21
Add indexed forms of load doubleword and load word algebraic for 64 bit targets
...
llvm-svn: 15743
2004-08-14 22:12:20 +00:00
Nate Begeman
caeb78e720
Fix handling of FP constants with single precision, and loading of internal linkage function addresses
...
llvm-svn: 15742
2004-08-14 22:11:38 +00:00
Nate Begeman
0ad7f813d8
Add initial support for using the generated asm writer. Also, fix FP constant printing to always print 8 byte intializers. Move printing of LinkOnce stubs.
...
llvm-svn: 15741
2004-08-14 22:09:10 +00:00
Nate Begeman
8536df7dbe
Add generation of asm writer from tablegen files to Makefile
...
llvm-svn: 15740
2004-08-14 22:06:38 +00:00
Nate Begeman
a4da0d6294
Eliminate MachineFunction& argument from eliminateFrameIndex in x86 Target. Get MachineFunction from MachineInstruction's parent's parent
...
llvm-svn: 15739
2004-08-14 22:05:10 +00:00
Nate Begeman
1b0142d54e
Eliminate MachineFunction& argument from eliminateFrameIndex in SparcV9 target
...
llvm-svn: 15738
2004-08-14 22:03:29 +00:00
Nate Begeman
7f1f81511d
Eliminate MachineFunction& argument from eliminateFrameIndex in Skeleton target
...
llvm-svn: 15737
2004-08-14 22:01:38 +00:00
Nate Begeman
6e5010d935
Remove an unneeded header and forward declaration
...
llvm-svn: 15722
2004-08-13 09:33:17 +00:00
Nate Begeman
5bf9bfe398
Fix siod by switching BoolTy to byte rather than int until CFE changes for
...
Darwin. Also, change asm printer to output proper stubs for external
functions whose address is passed as an argument to aid in bugpointing.
llvm-svn: 15721
2004-08-13 09:32:01 +00:00
Nate Begeman
420213f3c5
Fix 177.mesa compilation, don't use floating point regs for base addresses!
...
llvm-svn: 15720
2004-08-13 04:45:14 +00:00