1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 11:42:57 +01:00
Commit Graph

19994 Commits

Author SHA1 Message Date
Chris Lattner
35a82f5f79 Nate noticed that Andrew never did this. This fixes PR600
llvm-svn: 23110
2005-08-26 22:50:40 +00:00
Chris Lattner
e9cc12f5c4 Don't copy regs that are only used in the entry block into a vreg. This
changes the code generated for:

short %test(short %A) {
  %B = xor short %A, -32768
  ret short %B
}

to:

_test:
        xori r2, r3, 32768
        xoris r2, r2, 65535
        extsh r3, r2
        blr

instead of:

_test:
        rlwinm r2, r3, 0, 16, 31
        xori r2, r3, 32768
        xoris r2, r2, 65535
        extsh r3, r2
        blr

llvm-svn: 23109
2005-08-26 22:49:59 +00:00
Chris Lattner
5f55dd72af Make this code safe for when loadRegFromStackSlot inserts multiple instructions.
llvm-svn: 23108
2005-08-26 22:18:32 +00:00
Chris Lattner
780ca10bcc allow code using mtcrf to assemble
llvm-svn: 23107
2005-08-26 22:05:54 +00:00
Nate Begeman
d7f60a5eb6 Remove operand type 'crbit', since it is no longer used
llvm-svn: 23106
2005-08-26 22:04:17 +00:00
Chris Lattner
46daaac4e0 teach getClass what a condition reg is
llvm-svn: 23105
2005-08-26 21:51:29 +00:00
Chris Lattner
2c7a9bde76 Minor cleanups:
* avoid calling getClass() multiple times (it is relatively expensive)
  * Allow -disable-fp-elim to turn of frame pointer elimination.

llvm-svn: 23104
2005-08-26 21:49:18 +00:00
Chris Lattner
7efca0c312 Checking types here is not safe, because multiple types can map to the same
register class.

llvm-svn: 23103
2005-08-26 21:39:15 +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
e91069c4de add some forward defs
llvm-svn: 23100
2005-08-26 21:06:40 +00:00
Chris Lattner
497c012e54 spell this right
llvm-svn: 23099
2005-08-26 20:55:40 +00:00
Chris Lattner
faa96209d8 Call the InsertAtEndOfBasicBlock hook if the usesCustomDAGSchedInserter
flag is set on an instruction.

llvm-svn: 23098
2005-08-26 20:54:47 +00:00
Chris Lattner
ac19224b29 spell this right!
llvm-svn: 23097
2005-08-26 20:53:44 +00:00
Chris Lattner
98bd9339ce Add a hook
llvm-svn: 23096
2005-08-26 20:53:09 +00:00
Chris Lattner
6c4ea26961 spell this variable right
llvm-svn: 23095
2005-08-26 20:42:52 +00:00
Chris Lattner
b474a0ab06 Expose a new flag to TargetInstrInfo
llvm-svn: 23094
2005-08-26 20:40:46 +00:00
Chris Lattner
fd72abe85b Add a new instruction flag
llvm-svn: 23093
2005-08-26 20:31:24 +00:00
Chris Lattner
405266a17c Add a flag
llvm-svn: 23092
2005-08-26 20:29:01 +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
17f0f9beae add a marker at the end of the instruction enum list
llvm-svn: 23090
2005-08-26 20:17:00 +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
3e0bfc0cc1 Revampt ReplaceAllUsesWith to be more efficient and easier to use.
llvm-svn: 23087
2005-08-26 18:36:28 +00:00
Chris Lattner
25b6e62a46 Add a new version of ReplaceAllUsesWith, make the comments more useful.
llvm-svn: 23086
2005-08-26 18:35:58 +00:00
Nate Begeman
1c59e5bdd5 Remove some code made dead by the fsel patch
llvm-svn: 23085
2005-08-26 17:45:06 +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
007e1e07e3 implement the other half of the select_cc -> fsel lowering, which handles
when the RHS of the comparison is 0.0.  Turn this on by default.

llvm-svn: 23083
2005-08-26 17:36:52 +00:00
Chris Lattner
439ef36320 Fix a bug in my previous checkin
llvm-svn: 23082
2005-08-26 17:18:44 +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
Jim Laskey
bf0a2d01be Changed unsigned long to unsigned.
llvm-svn: 23078
2005-08-26 09:25:54 +00:00
Jim Laskey
a841c4183a Change unsigned lng to unsigned.
llvm-svn: 23077
2005-08-26 09:24:46 +00:00
Nate Begeman
2d6f0e333a Fix JIT encoding of conditional branches
llvm-svn: 23076
2005-08-26 04:11:42 +00:00
Chris Lattner
dae9a4899f add initial support for converting select_cc -> fsel in the legalizer
instead of in the backend.  This currently handles fsel cases with registers,
but doesn't have the 0.0 and -0.0 optimization enabled yet.

Once this is finished, special hack for fp immediates can go away.

llvm-svn: 23075
2005-08-26 00:52:45 +00:00
Chris Lattner
6d22117d76 the 5th operand is the 4th number
llvm-svn: 23074
2005-08-26 00:43:46 +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
f25ec1b7b9 Add support for targets that want to custom expand select_cc in some cases.
llvm-svn: 23071
2005-08-26 00:23:59 +00:00
Chris Lattner
7e68d39877 Allow LowerOperation to return a null SDOperand in case it wants to lower
some things given to it, but not all.

llvm-svn: 23070
2005-08-26 00:14:16 +00:00
Chris Lattner
2c3fbbab05 Fix a nasty bug from a previous patch of mine
llvm-svn: 23069
2005-08-26 00:13:12 +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
Jim Laskey
236ef88c39 Added cl::bits option type (bit vectors). See "Collecting options as a set
of flags" in the Command Line doc.

llvm-svn: 23067
2005-08-25 23:31:45 +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
e4cf3ab5d4 simplify the add/sub_parts code
llvm-svn: 23065
2005-08-25 23:19:58 +00:00
Jim Laskey
05ed995816 Tweak of multiple occurance paragraph.
llvm-svn: 23064
2005-08-25 23:01:25 +00:00
Jim Laskey
524753c9f8 Documentation updated to include upcoming support for bit vector support
(flags.)

llvm-svn: 23063
2005-08-25 22:52:43 +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
dc8ebb9302 Simplify some code. It's not clear why the UDIV expanded sequence
doesn't work for large uint constants, but we'll keep the current behavior

llvm-svn: 23061
2005-08-25 22:03:50 +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