Mon P Wang
a501640ffa
Added support for vector widening.
...
llvm-svn: 61209
2008-12-18 20:03:17 +00:00
Mon P Wang
015a7f57b2
Fix expansion of vsetcc to set the high bit for true instead of 1.
...
llvm-svn: 61129
2008-12-17 08:49:47 +00:00
Duncan Sands
f312dc7729
Reapply r60997, this time without forgetting that
...
target constants are allowed to have an illegal
type.
llvm-svn: 61006
2008-12-14 09:43:15 +00:00
Bill Wendling
e5af6f1990
Temporarily revert r60997. It was causing this failure:
...
Running /Users/void/llvm/llvm.src/test/CodeGen/Generic/dg.exp ...
FAIL: /Users/void/llvm/llvm.src/test/CodeGen/Generic/asm-large-immediate.ll
Failed with exit(1) at line 1
while running: llvm-as < /Users/void/llvm/llvm.src/test/CodeGen/Generic/asm-large-immediate.ll | llc | /usr/bin/grep 68719476738
Assertion failed: ((TypesNeedLegalizing || getTypeAction(VT) == Legal) && "Illegal type introduced after type legalization?"), function HandleOp, file /Users/void/llvm/llvm.src/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp, line 493.
0 llc 0x0085392e char const* std::find<char const*, char>(char const*, char const*, char const&) + 98
1 llc 0x00853e63 llvm::sys::PrintStackTraceOnErrorSignal() + 593
2 libSystem.B.dylib 0x96cac09b _sigtramp + 43
3 libSystem.B.dylib 0xffffffff _sigtramp + 1765097359
4 libSystem.B.dylib 0x96d24ec2 raise + 26
5 libSystem.B.dylib 0x96d3447f abort + 73
6 libSystem.B.dylib 0x96d26063 __assert_rtn + 101
7 llc 0x004f9018 llvm::cast_retty<llvm::SubprogramDesc, llvm::DebugInfoDesc*>::ret_type llvm::cast<llvm::Sub
...
llvm-svn: 61001
2008-12-13 23:53:00 +00:00
Duncan Sands
24092271cc
LegalizeDAG is not supposed to introduce illegal
...
types into the DAG if they were not already there.
Check this with an assertion.
llvm-svn: 60997
2008-12-13 22:33:38 +00:00
Mon P Wang
f95bd2078d
Added basic support for expanding VSETCC
...
llvm-svn: 60974
2008-12-13 08:15:14 +00:00
Duncan Sands
b6f09933c0
On big-endian machines it is wrong to do a full
...
width register load followed by a truncating
store for the copy, since the load will not place
the value in the lower bits. Probably partial
loads/stores can never happen here, but fix it
anyway.
llvm-svn: 60972
2008-12-13 07:18:38 +00:00
Duncan Sands
8f352fe100
When expanding unaligned loads and stores do not make
...
use of illegal integer types: instead, use a stack slot
and copying via integer registers. The existing code
is still used if the bitconvert is to a legal integer
type.
This fires on the PPC testcases 2007-09-08-unaligned.ll
and vec_misaligned.ll. It looks like equivalent code
is generated with these changes, just permuted, but
it's hard to tell.
With these changes, nothing in LegalizeDAG produces
illegal integer types anymore. This is a prerequisite
for removing the LegalizeDAG type legalization code.
While there I noticed that the existing code doesn't
handle trunc store of f64 to f32: it turns this into
an i64 store, which represents a 4 byte stack smash.
I added a FIXME about this. Hopefully someone more
motivated than I am will take care of it.
llvm-svn: 60964
2008-12-12 21:47:02 +00:00
Evan Cheng
3270a1dec3
Fix add/sub expansion: don't create ADD / SUB with two results (seems like everyone is doing this these days :-). Patch by Daniel M Gessel!
...
llvm-svn: 60958
2008-12-12 18:49:09 +00:00
Duncan Sands
e4bcb8e2dd
When using a 4 byte jump table on a 64 bit machine,
...
do an extending load of the 4 bytes rather than a
potentially illegal (type) i32 load followed by a
sign extend.
llvm-svn: 60945
2008-12-12 08:13:38 +00:00
Mon P Wang
9c2d26d208
Added support for SELECT v8i8 v4i16 for X86 (MMX)
...
Added support for TRUNC v8i16 to v8i8 for X86 (MMX)
llvm-svn: 60916
2008-12-12 01:25:51 +00:00
Mon P Wang
c68b3c4fc1
Whitespace clean up (tabs with spaces)
...
llvm-svn: 60866
2008-12-11 00:44:22 +00:00
Bill Wendling
f482f379ef
Whitespace changes.
...
llvm-svn: 60826
2008-12-10 02:01:32 +00:00
Bill Wendling
db8ec2d75a
Add sub/mul overflow intrinsics. This currently doesn't have a
...
target-independent way of determining overflow on multiplication. It's very
tricky. Patch by Zoltan Varga!
llvm-svn: 60800
2008-12-09 22:08:41 +00:00
Mon P Wang
8a5366332f
In LegalizeOp, don't change the result type of CONVERT_RNDSAT when promoting
...
one of its operand.
llvm-svn: 60749
2008-12-09 07:27:39 +00:00
Mon P Wang
4dd832d241
Fix getNode to allow a vector for the shift amount for shifts of vectors.
...
Fix the shift amount when unrolling a vector shift into scalar shifts.
Fix problem in getShuffleScalarElt where it assumes that the input of
a bit convert must be a vector.
llvm-svn: 60740
2008-12-09 05:46:39 +00:00
Scott Michel
9b0b28e021
Non-functional change: make custom lowering for truncate stylistically
...
consistent with the way it's generally done in other places.
llvm-svn: 60439
2008-12-02 19:55:08 +00:00
Tilmann Scheller
318ccb0e62
make it possible to custom lower TRUNCATE (needed for the CellSPU target)
...
llvm-svn: 60409
2008-12-02 12:12:25 +00:00
Mon P Wang
6e1c6ad127
Removed some unnecessary code in widening.
...
llvm-svn: 60406
2008-12-02 07:35:08 +00:00
Duncan Sands
3d960941b1
There are no longer any places that require a
...
MERGE_VALUES node with only one operand, so get
rid of special code that only existed to handle
that possibility.
llvm-svn: 60349
2008-12-01 11:41:29 +00:00
Duncan Sands
6ed40141f7
Change the interface to the type legalization method
...
ReplaceNodeResults: rather than returning a node which
must have the same number of results as the original
node (which means mucking around with MERGE_VALUES,
and which is also easy to get wrong since SelectionDAG
folding may mean you don't get the node you expect),
return the results in a vector.
llvm-svn: 60348
2008-12-01 11:39:25 +00:00
Sanjiv Gupta
7ae1a84465
Removing redundant semicolons. No functionality change.
...
llvm-svn: 60149
2008-11-27 05:58:04 +00:00
Sanjiv Gupta
80810f8c6b
Allow custom lowering of ADDE/ADDC/SUBE/SUBC operations.
...
llvm-svn: 60102
2008-11-26 11:19:00 +00:00
Bill Wendling
b4ff5322c1
A simplification for checking whether the signs of the operands and sum differ. Thanks, Duncan.
...
llvm-svn: 60043
2008-11-25 19:40:17 +00:00
Bill Wendling
bf592fccd4
Now with the correct type for the 0.
...
llvm-svn: 60016
2008-11-25 08:19:22 +00:00
Bill Wendling
d06c625b95
Get rid of unused variable.
...
llvm-svn: 60015
2008-11-25 08:13:20 +00:00
Bill Wendling
4498b47677
Hacker's Delight says, "Signed integer overflow of addition occurs if and only
...
if the operands have the same sign and the sum has sign opposite to that of the
operands."
llvm-svn: 60014
2008-11-25 08:12:19 +00:00
Bill Wendling
66835479d7
- Make lowering of "add with overflow" customizable by back-ends.
...
- Mark "add with overflow" as having a custom lowering for X86. Give it a null
lowering representation for now.
llvm-svn: 59971
2008-11-24 19:21:46 +00:00
Evan Cheng
a8fd1f2c8e
Eliminate some unused variable compile time warnings.
...
llvm-svn: 59952
2008-11-24 07:09:49 +00:00
Bill Wendling
2278f8f5e1
Add support for llvm.uadd.with.overflow.
...
llvm-svn: 59926
2008-11-24 01:38:29 +00:00
Bill Wendling
be8e7f851c
- Move conversion of [SU]ADDO from DAG combiner into legalizer.
...
- Add "promote integer type" stuff to the legalizer for these nodes.
llvm-svn: 59847
2008-11-22 00:22:52 +00:00
Mon P Wang
f414cbc1fd
Add missing widen operations, fixed widening for extracting a subvector,
...
and when loading/storing a widen vector, make sure that they are loaded
and stored in consecutive order.
llvm-svn: 59357
2008-11-15 06:05:52 +00:00
Mon P Wang
58fb9135e2
Added CONVERT_RNDSAT (conversion with rounding and saturation) SDNode to
...
support targets that support these conversions. Users should avoid using
this node as the current targets don't generating code for it.
llvm-svn: 59001
2008-11-10 20:54:11 +00:00
Mon P Wang
25f0106fd9
Added support for the following definition of shufflevector
...
<result> = shufflevector <n x <ty>> <v1>, <n x <ty>> <v2>, <m x i32> <mask>
llvm-svn: 58964
2008-11-10 04:46:22 +00:00
Dale Johannesen
160be0ffda
Make FP tests requiring two compares work on PPC (PR 642).
...
This is Chris' patch from the PR, modified to realize that
SETUGT/SETULT occur legitimately with integers, plus
two fixes in LegalizeDAG to pass a valid result type into
LegalizeSetCC. The argument of TLI.getSetCCResultType is
ignored on PPC, but I think I'm following usage elsewhere.
llvm-svn: 58871
2008-11-07 22:54:33 +00:00
Mon P Wang
5ca2ec65bd
Fixed scalarizing an extract subvector and prevent an infinite loop
...
when simplify a vector.
llvm-svn: 58820
2008-11-06 22:52:21 +00:00
Mon P Wang
9a8d60a7c0
Widening cleanup
...
llvm-svn: 58796
2008-11-06 05:31:54 +00:00
Dale Johannesen
db6b956585
80 columns
...
llvm-svn: 58717
2008-11-04 20:52:49 +00:00
Duncan Sands
0207a3f897
Make VAARG work with x86 long double (which is
...
10 bytes long, but is passed in 12/16 bytes).
llvm-svn: 58608
2008-11-03 11:51:11 +00:00
Mon P Wang
01b8a5a967
Add missing vsetcc expansion for widening
...
llvm-svn: 58443
2008-10-30 18:21:52 +00:00
Mon P Wang
58c3794c27
Add initial support for vector widening. Logic is set to widen for X86.
...
One will only see an effect if legalizetype is not active. Will move
support to LegalizeType soon.
llvm-svn: 58426
2008-10-30 08:01:45 +00:00
Dale Johannesen
28929589e7
Add an SSE2 algorithm for uint64->f64 conversion.
...
The same one Apple gcc uses, faster. Also gets the
extreme case in gcc.c-torture/execute/ieee/rbug.c
correct which we weren't before; this is not
sufficient to get the test to pass though, there
is another bug.
llvm-svn: 57926
2008-10-21 20:50:01 +00:00
Dan Gohman
97d3f6cfe3
Make the NaN test come second, heuristically assuming
...
that NaNs are less common.
llvm-svn: 57871
2008-10-21 03:12:54 +00:00
Evan Cheng
3b0f5e4d61
- Add target lowering hooks that specify which setcc conditions are illegal,
...
i.e. conditions that cannot be checked with a single instruction. For example,
SETONE and SETUEQ on x86.
- Teach legalizer to implement *illegal* setcc as a and / or of a number of
legal setcc nodes. For now, only implement FP conditions. e.g. SETONE is
implemented as SETO & SETNE, SETUEQ is SETUO | SETEQ.
- Move x86 target over.
llvm-svn: 57542
2008-10-15 02:05:31 +00:00
Evan Cheng
07d53b1d33
Rename LoadX to LoadExt.
...
llvm-svn: 57526
2008-10-14 21:26:46 +00:00
Evan Cheng
da9b752883
FIX PR2794. Make sure SIGN_EXTEND_INREG nodes introduced by LegalizeSetCCOperands are leglized. Patch by Richard Pennington.
...
llvm-svn: 57460
2008-10-13 18:46:18 +00:00
Chris Lattner
2753955fc0
Change CALLSEQ_BEGIN and CALLSEQ_END to take TargetConstant's as
...
parameters instead of raw Constants. This prevents the constants from
being selected by the isel pass, fixing PR2735.
llvm-svn: 57385
2008-10-11 22:08:30 +00:00
Dale Johannesen
54306fe499
Rename APFloat::convertToAPInt to bitcastToAPInt to
...
make it clearer what the function does. No functional
change.
llvm-svn: 57325
2008-10-09 18:53:47 +00:00
Andrew Lenharth
21dca9cbb1
Use Dan's supperior check
...
llvm-svn: 57255
2008-10-07 18:27:23 +00:00
Andrew Lenharth
d69bdaef64
No need for |=
...
llvm-svn: 57249
2008-10-07 17:11:29 +00:00