1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-28 06:22:51 +01:00
Commit Graph

262 Commits

Author SHA1 Message Date
Chris Lattner
0739f5a9da Fix type mismatches when passing f32 values to calls
llvm-svn: 23159
2005-08-30 21:28:19 +00:00
Chris Lattner
2f4de6af75 Fix some indentation (first hunks).
Remove code (last hunk) that miscompiled immediate and's, such as
  and uint %tmp.30, 4294958079

into

 andi. r8, r8, 56319
 andis. r8, r8, 65535

instead of:

 li r9, -9217
 and r8, r8, r9

The first always generates zero.

This fixes espresso.

llvm-svn: 23155
2005-08-30 18:37:48 +00:00
Chris Lattner
fd2708cce1 Fix a problem Nate found where we swapped the operands of SHL/SHR_PARTS. This
fixes fourinarow

llvm-svn: 23153
2005-08-30 17:42:59 +00:00
Chris Lattner
6a4bdd85ad codegen ADD_PARTS correctly: put the results in the right registers! This
fixes fhourstones

llvm-svn: 23152
2005-08-30 17:40:13 +00:00
Chris Lattner
025f964997 add operands in the right order, fixing McCat/18-imp with the dag isel
llvm-svn: 23150
2005-08-30 17:13:58 +00:00
Chris Lattner
0e6343b2e4 Make sure the selector emits register register copies with flag operands
linking them to calls when appropriate, this prevents the scheduler from
pulling these copies away from the call.

This fixes Ptrdist/yacr2

llvm-svn: 23143
2005-08-30 01:57:02 +00:00
Chris Lattner
66ff5ca72d The first operand to AND does not always have more than two operands. This
fixes MediaBench/toast with the dag selector

llvm-svn: 23141
2005-08-30 00:59:16 +00:00
Chris Lattner
874adc990b emit FMR instructions to convert f64<->f32 instructions, so things like
STOREs, know the right type to store.

llvm-svn: 23139
2005-08-30 00:30:43 +00:00
Chris Lattner
5c81e4b034 fix a crash in cfrac
llvm-svn: 23137
2005-08-29 23:49:25 +00:00
Chris Lattner
7a6dfa3f21 Implement DYNAMIC_STACKALLOC, wrap some long lines
llvm-svn: 23136
2005-08-29 23:30:11 +00:00
Chris Lattner
238fbfcf67 Fix a dumb bug of mine where we were mishandling the PPC ABI (undef handling).
This fixes voronoi and bh in Olden, allowing all of olden to pass!

llvm-svn: 23133
2005-08-29 22:22:57 +00:00
Chris Lattner
bc3fb85efd Fix a bug the last patch exposed in treeadd among others
llvm-svn: 23127
2005-08-29 01:07:02 +00:00
Chris Lattner
9821903d65 A hack to fix a problem folding immedaites. This fixes Olden/power.
llvm-svn: 23126
2005-08-29 01:01:01 +00:00
Chris Lattner
eda3f49562 Fix order of operands for copytoreg node when emitting calls. This fixes
Olden/msFix order of operands for copytoreg node when emitting calls.  This fixes
Olden/mstt.

llvm-svn: 23125
2005-08-29 00:26:57 +00:00
Chris Lattner
33297adfb6 add operands in the correct order
llvm-svn: 23123
2005-08-29 00:02:01 +00:00
Chris Lattner
bd8cf87228 Fix a bug in FP_EXTEND, implement FP_TO_SINT
llvm-svn: 23121
2005-08-28 23:59:09 +00:00
Chris Lattner
8a7276ca25 fix an assertion failure in treeadd
llvm-svn: 23120
2005-08-28 23:39:22 +00:00
Chris Lattner
f470259b50 implement SELECT_CC fully for the DAG->DAG isel!
llvm-svn: 23101
2005-08-26 21:23:58 +00:00
Chris Lattner
04b88ca768 Make fsel emission work with both the pattern and dag-dag selectors, by
giving it a non-instruction opcode.  The dag->dag selector used to not
select the operands of the fsel, because it thought that whole tree was
already selected.

llvm-svn: 23091
2005-08-26 20:25:03 +00:00
Chris Lattner
0d2ee60c48 implement the fold for:
bool %test(int %X, int %Y) {
        %C = setne int %X, 0
        ret bool %C
}

to:

_test:
        addic r2, r3, -1
        subfe r3, r2, r3
        blr

llvm-svn: 23089
2005-08-26 18:46:49 +00:00
Chris Lattner
2d90a50778 Changes to adjust to new ReplaceAllUsesWith syntax. Change FP_EXTEND to
just return its input, instead of emitting an explicit copy.

llvm-svn: 23088
2005-08-26 18:37:23 +00:00
Chris Lattner
a1c6bad722 now that fsel is formed during legalization, this code is dead
llvm-svn: 23084
2005-08-26 17:40:39 +00:00
Chris Lattner
a31708e6b3 Change ConstantPoolSDNode to actually hold the Constant itself instead of
putting it into the constant pool.  This allows the isel machinery to
create constants that it will end up deciding are not needed, without them
ending up in the resultant function constant pool.

llvm-svn: 23081
2005-08-26 17:15:30 +00:00
Chris Lattner
97a34c653d Fix some warnings in an optimized build
llvm-svn: 23080
2005-08-26 16:38:51 +00:00
Chris Lattner
929c00e9e9 Fix a huge annoyance: SelectNodeTo took types before the opcode unlike
every other SD API.  Fix it to take the opcode before the types.

llvm-svn: 23079
2005-08-26 16:36:26 +00:00
Nate Begeman
254ecb7886 SUBFIC produces two results, not one.
llvm-svn: 23073
2005-08-26 00:34:06 +00:00
Nate Begeman
0619930d74 Implement SHL_PARTS and SRL_PARTS
llvm-svn: 23072
2005-08-26 00:28:00 +00:00
Chris Lattner
578b7f212f Emit the lo/hi parts in the right order :)
llvm-svn: 23068
2005-08-25 23:36:49 +00:00
Chris Lattner
4433d74ea5 implement support for 64-bit add/sub, fix a broken assertion for 64-bit
return.  Allow the udiv breaker-upper to work with any non-zero constant
operand.

llvm-svn: 23066
2005-08-25 23:21:06 +00:00
Chris Lattner
e33ad38b02 Finish implementing SDIV/UDIV by copying over the majik constant code from
ISelPattern

llvm-svn: 23062
2005-08-25 22:04:30 +00:00
Chris Lattner
32600ecfeb Implement setcc correctly for G5 and non-G5 systems
llvm-svn: 23060
2005-08-25 21:39:42 +00:00
Chris Lattner
b9c2c40046 implement setcc on the G5. We're still missing the non-g5 specific bits, but
they will come later.

llvm-svn: 23059
2005-08-25 20:08:18 +00:00
Chris Lattner
a79c58d1e4 Add support for sdiv by 2^k and -2^k. Producing code like:
_test:
        srawi r2, r3, 2
        addze r3, r2
        blr

llvm-svn: 23052
2005-08-25 17:50:06 +00:00
Chris Lattner
77350a373e Implement support for taking the address of constant pool indices, which
is used by the int -> FP code among other things.  This gets
2005-05-12-Int64ToFP past that failure, to dying on lack of support for add_parts

llvm-svn: 23042
2005-08-25 05:04:11 +00:00
Chris Lattner
2296582d06 Add support for FP constants, fixing UnitTests/2004-02-02-NegativeZero
llvm-svn: 23038
2005-08-25 04:47:18 +00:00
Chris Lattner
f36622ea2e Fully implement frame index, so that we can pass the address of alloca's
around to functions and stuff

llvm-svn: 23036
2005-08-25 00:45:43 +00:00
Chris Lattner
c9cc2b0acd implement unconditional branches, fixing UnitTests/2003-05-02-DependentPHI.c
llvm-svn: 23034
2005-08-25 00:29:58 +00:00
Chris Lattner
286b85144c Fix a broken assertion
llvm-svn: 23032
2005-08-25 00:19:12 +00:00
Chris Lattner
8f595df1a6 Split IMPLICIT_DEF into IMPLICIT_DEF_GPR and IMPLICIT_DEF_FP, so that the
instructions take a consistent reg class.  Implement ISD::UNDEF in the dag->dag
selector to generate this, fixing UnitTests/2003-07-06-IntOverflow.

llvm-svn: 23028
2005-08-24 23:08:16 +00:00
Chris Lattner
5efe9406a6 implement support for calls
llvm-svn: 23026
2005-08-24 22:45:17 +00:00
Nate Begeman
8e1c08e083 Remove unused statistic
Prefer 'neg X' to 'subfic 0, X' since neg does not set XER[CA]

llvm-svn: 23001
2005-08-24 05:03:20 +00:00
Chris Lattner
f034da3bd4 Add callseq_begin/end support
Call stil not supported yet

llvm-svn: 22998
2005-08-24 00:47:15 +00:00
Chris Lattner
4c9d1715ff Implement stores.
llvm-svn: 22963
2005-08-22 01:27:59 +00:00
Chris Lattner
86aceaf749 Fix compilation of:
float %test2(float* %P) {
        %Q = load float* %P
        %R = add float %Q, %Q
        ret float %R
}

By returning the right result.

llvm-svn: 22961
2005-08-22 00:59:14 +00:00
Chris Lattner
a3f9415a81 Implement most of load support. There is still a bug though.
llvm-svn: 22959
2005-08-21 22:31:09 +00:00
Chris Lattner
0f148968ba Implement selection for branches.
llvm-svn: 22951
2005-08-21 18:50:37 +00:00
Chris Lattner
9fbbc41021 add support for global address, including PIC support.
This REALLY should be lowered by the legalizer!

llvm-svn: 22941
2005-08-19 22:38:53 +00:00
Chris Lattner
a8f147c1b4 Fix a typeo, no wonder all tokenfactor edges were the same!
llvm-svn: 22935
2005-08-19 21:33:02 +00:00
Nate Begeman
1182e06dcf ISD::OR, and it's accompanying SelectBitfieldInsert
llvm-svn: 22889
2005-08-19 00:38:14 +00:00
Nate Begeman
c1aeaed2b9 Add shifts.
llvm-svn: 22884
2005-08-18 23:38:00 +00:00
Chris Lattner
2147daa960 Move this to the emitter
llvm-svn: 22877
2005-08-18 20:08:53 +00:00
Chris Lattner
a094a1279a After selecting the instructions for a basic block, emit the instructions
llvm-svn: 22869
2005-08-18 18:46:06 +00:00
Chris Lattner
80a5ffb6c5 remove some unused stuff
llvm-svn: 22866
2005-08-18 18:34:00 +00:00
Nate Begeman
7726312fac Improve ISD::Constant codegen.
Now for int foo() { return -1; } we generate:
_foo:
        li r3, -1
        blr

instead of
_foo:
        lis r2, -1
        ori r3, r2, 65535
        blr

llvm-svn: 22864
2005-08-18 18:01:39 +00:00
Nate Begeman
67f3483a97 Add support for ISD::AND, and its various optimized forms.
llvm-svn: 22857
2005-08-18 07:30:46 +00:00
Nate Begeman
3681359c93 Maintain consistency in negating things
llvm-svn: 22855
2005-08-18 05:44:50 +00:00
Nate Begeman
b6e36decb6 Implement XOR, remove a broken sign_extend_inreg case
llvm-svn: 22854
2005-08-18 05:00:13 +00:00
Nate Begeman
feac5964d7 Add a bunch more simple nodes.
llvm-svn: 22851
2005-08-18 03:04:18 +00:00
Nate Begeman
4a875e784e Add a couple more nodes that are easy to handle
llvm-svn: 22850
2005-08-18 00:53:47 +00:00
Nate Begeman
276155cb07 Be fruitful and multiply!
llvm-svn: 22849
2005-08-18 00:21:41 +00:00
Nate Begeman
e7c038e591 Teach the DAG->DAG ISel about FNEG, and how it can be used to invert
several of the PowerPC opcodes that come in both negated and non-negated
forms.

llvm-svn: 22845
2005-08-17 23:46:35 +00:00
Chris Lattner
6ee7175048 initial hack at a dag->dag instruction selector. This is obviously woefully
incomplete, but it is a start.  It handles basic argument/retval stuff, immediates,
add and sub.

llvm-svn: 22836
2005-08-17 19:33:03 +00:00