1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 11:33:24 +02:00
Commit Graph

151 Commits

Author SHA1 Message Date
Dale Johannesen
e91a908971 Change LegalFPImmediates to use APFloat.
Add APFloat interfaces to ConstantFP, SelectionDAG.
Fix integer bit in double->APFloat conversion.
Convert LegalizeDAG to use APFloat interface in
ConstantFPSDNode uses.

llvm-svn: 41587
2007-08-30 00:23:21 +00:00
Dale Johannesen
a3ab055b9d Change internal representation of ConstantFP to use APFloat.
Interface to rest of the compiler unchanged, as yet.

llvm-svn: 41348
2007-08-24 00:56:33 +00:00
Reid Spencer
3e54e72ef1 Fix minor doxygen nits.
llvm-svn: 40854
2007-08-05 20:06:04 +00:00
Dan Gohman
0ba554c0c8 Fix comments about vectors to use the current wording.
llvm-svn: 39921
2007-07-16 14:29:03 +00:00
Dan Gohman
2c5d31ee81 Minor comment cleanups.
llvm-svn: 37321
2007-05-24 14:36:04 +00:00
Dan Gohman
2d4b1767ab Rename Value::getValueType to getValueID, to avoid confusion with
other things named getValueType.

llvm-svn: 35964
2007-04-13 18:12:09 +00:00
Chris Lattner
da0e61ca4c getLimitedValue now just forward to APInt's getLimitedValue. Mark it const.
llvm-svn: 35861
2007-04-10 06:44:12 +00:00
Chris Lattner
96c4c71f2c add a helper function to constantint.
llvm-svn: 35610
2007-04-03 01:41:34 +00:00
Zhou Sheng
68b7faad88 Make sure this method just return value equal or less than Limit.
llvm-svn: 35509
2007-03-30 16:50:28 +00:00
Zhou Sheng
3352181fc8 Rename and correct the method "greaterOrEqual".
llvm-svn: 35502
2007-03-30 05:10:59 +00:00
Zhou Sheng
489a1dbb92 Add two utility methods into ConstantInt.
llvm-svn: 35501
2007-03-30 03:22:55 +00:00
Dan Gohman
42a3f4e16e Add the 'explicit' keyword to several constructors that accept one
argument that don't appear intended as implicit-conversion operators.

llvm-svn: 35280
2007-03-23 18:44:11 +00:00
Reid Spencer
7d20e42a97 Allow ConstantInt::get(Ty, uint64_t) to interpret the 64-bit values as a
negative number. This is needed to fix test/Assembler/2007-03-19-NegValue.ll

llvm-svn: 35181
2007-03-19 20:39:08 +00:00
Reid Spencer
53a673b3ed Add a non-virtual test for zero, isZero, and rename isUnitValue isOne.
These will be used in upcoming patches to avoid virtual function call when
the client knows it is a ConstantInt.

llvm-svn: 34820
2007-03-02 00:27:06 +00:00
Reid Spencer
c5d33cef76 Remove virtual keyword from method that doesn't need to be virtual.
llvm-svn: 34817
2007-03-01 23:20:52 +00:00
Reid Spencer
2ce72a4bd8 Add an isUnitValue method for comparison against 1. This just follows a
common pattern with isNullValue, isAllOnesValue, etc. It also helps to
prevent things like getZExtValue() == 1, which could assert for large
bitwidths.

llvm-svn: 34813
2007-03-01 21:50:41 +00:00
Reid Spencer
b4e877c488 Drop the ConstantInt(const Type&, const APInt&) constructor. It is
redundant and more verbose than the ConstantInt(const APInt&) constructor.

llvm-svn: 34792
2007-03-01 19:30:34 +00:00
Reid Spencer
a9d0cc903b Implement a convenience method to construct a ConstantInt directly from an
APInt. The implied type is the integer type that corresponds to the bit
width of the APInt.

llvm-svn: 34757
2007-02-28 19:50:21 +00:00
Reid Spencer
c8cc0f997e For PR1205:
Implement the first step towards arbitrary precision integer support in
LLVM. The APInt class provides arbitrary precision arithmetic and value
representation. This patch changes ConstantInt to use APInt as its value
representation without supporting bit widths > 64 yet. That change will
come after ConstantFolding handles bit widths > 64 bits.

llvm-svn: 34647
2007-02-26 23:54:03 +00:00
Chris Lattner
b6ddd260ec eliminate some dead friends.
llvm-svn: 34447
2007-02-20 07:18:01 +00:00
Chris Lattner
37a49eb48d cleanup ConstantInt to use a single DenseMap for uniquing instead of the
heavy-weight ValueMap class.  This reduces mem usage bc reading kc++ by 29K,
even though it only creates 2955 constant ints!

llvm-svn: 34445
2007-02-20 06:39:57 +00:00
Chris Lattner
adb16a1a53 Make ConstantInt::getTrue/getFalse be llvm_shutdown safe.
llvm-svn: 34443
2007-02-20 06:11:36 +00:00
Chris Lattner
c8db23f8a7 Clean up the internals of the ConstantInt machinery
llvm-svn: 34441
2007-02-20 05:55:46 +00:00
Chris Lattner
f501d245c8 llvm-gcc issue fixed, revert reversal :)
llvm-svn: 34425
2007-02-19 20:01:23 +00:00
Evan Cheng
936deee790 Temporarily reverting the patch. It's breaking llvm-gcc build.
llvm-svn: 34423
2007-02-19 19:23:41 +00:00
Chris Lattner
865b2f741a remove dead methods
llvm-svn: 34419
2007-02-19 07:44:24 +00:00
Chris Lattner
35a14c07e4 add alternate version of constant ctors that don't take a vector. For now
this offers no performance advantage.

llvm-svn: 34415
2007-02-19 07:23:24 +00:00
Reid Spencer
55e4e98a2a For PR1195:
Rename PackedType -> VectorType, ConstantPacked -> ConstantVector, and
PackedTyID -> VectorTyID. No functional changes.

llvm-svn: 34293
2007-02-15 02:26:10 +00:00
Reid Spencer
591bfa1e0b Changes to support making the shift instructions be true BinaryOperators.
This feature is needed in order to support shifts of more than 255 bits
on large integer types.  This changes the syntax for llvm assembly to
make shl, ashr and lshr instructions look like a binary operator:
   shl i32 %X, 1
instead of
   shl i32 %X, i8 1
Additionally, this should help a few passes perform additional optimizations.

llvm-svn: 33776
2007-02-02 02:16:23 +00:00
Chris Lattner
677cab8ef3 Revise APIs for creating constantexpr GEPs to not require the use of
vectors.  This allows us to eliminate many temporary vectors, and their
associated malloc/free pairs.

llvm-svn: 33691
2007-01-31 04:39:29 +00:00
Reid Spencer
e33c18f4d2 For PR970:
Clean up handling of isFloatingPoint() and dealing with PackedType.
Patch by Gordon Henriksen!

llvm-svn: 33415
2007-01-21 00:29:26 +00:00
Reid Spencer
14b42c0040 For PR1043:
This is the final patch for this PR. It implements some minor cleanup
in the use of IntegerType, to wit:
1. Type::getIntegerTypeMask -> IntegerType::getBitMask
2. Type::Int*Ty changed to IntegerType* from Type*
3. ConstantInt::getType() returns IntegerType* now, not Type*

This also fixes PR1120.

Patch by Sheng Zhou.

llvm-svn: 33370
2007-01-19 21:13:56 +00:00
Jim Laskey
3410ca8bf4 virtual not needed.
llvm-svn: 33161
2007-01-12 23:39:50 +00:00
Jim Laskey
ee29cc6016 Allow isAllOnesValue testing on packed constants
llvm-svn: 33146
2007-01-12 22:39:14 +00:00
Reid Spencer
3d986f6487 Implement review feedback for the ConstantBool->ConstantInt merge. Chris
recommended that getBoolValue be replaced with getZExtValue and that
get(bool) be replaced by get(const Type*, uint64_t). This implements
those changes.

llvm-svn: 33110
2007-01-12 04:24:46 +00:00
Reid Spencer
f3265181e2 Rename BoolTy as Int1Ty. Patch by Sheng Zhou.
llvm-svn: 33076
2007-01-11 18:21:29 +00:00
Zhou Sheng
3c49580e44 Fixed a bug in ConstantInt::Inverted().
Modified comment of that method.

llvm-svn: 33074
2007-01-11 14:31:10 +00:00
Zhou Sheng
23d24526b2 For PR1043:
Merge ConstantIntegral and ConstantBool into ConstantInt.
Remove ConstantIntegral and ConstantBool from LLVM.

llvm-svn: 33073
2007-01-11 12:24:14 +00:00
Chris Lattner
d9342d1db3 Add a new ConstantPacked::getAllOnesValue method
llvm-svn: 32856
2007-01-04 01:49:26 +00:00
Reid Spencer
4428c3483b For PR950:
This patch removes the SetCC instructions and replaces them with the ICmp
and FCmp instructions. The SetCondInst instruction has been removed and
been replaced with ICmpInst and FCmpInst.

llvm-svn: 32751
2006-12-23 06:05:41 +00:00
Reid Spencer
2d69d6e962 Correct the description of ConstantInt::isValueValidForType.
llvm-svn: 32664
2006-12-19 01:34:39 +00:00
Reid Spencer
e9d6e54b36 Make ConstantInt not care about sign any more. To ensure the AsmParser can
still check the validity of signed values an overload to isValueValidForType
was added to allow passing in an int64_t to check.

llvm-svn: 32663
2006-12-19 01:28:19 +00:00
Reid Spencer
6769fa4ba2 Remove the two-argument (inferred cast) form of ConstantExpr::getCast now
that its last uses have been removed.

llvm-svn: 32653
2006-12-18 08:18:46 +00:00
Reid Spencer
be18cd1575 Fix problems in the CBE and InstructionCombining which use the isMaxValue
and isMinValue methods of ConstantInt. These have been broken since the
isSigned parameter was added. It is necessary to use the signed version
of the type in the call to isValueValidForType or else incorrect results
are returned.

llvm-svn: 32637
2006-12-17 06:07:30 +00:00
Reid Spencer
0e981c9088 Replace inferred getCast(V,Ty) calls with more strict variants.
Rename getZeroExtend and getSignExtend to getZExt and getSExt to match
the the casting mnemonics in the rest of LLVM.

llvm-svn: 32514
2006-12-12 23:36:14 +00:00
Reid Spencer
3fbfed6e2c Implement getIntegerCast and getFPCast for ConstantExpr. These are similar
to the createIntegerCast and createFPCast for CastInst instructions.

llvm-svn: 32457
2006-12-12 00:51:07 +00:00
Andrew Lenharth
d115fe7ce3 Packed Structures
llvm-svn: 32361
2006-12-08 18:06:16 +00:00
Reid Spencer
19cb81393d For PR950:
Remove the getMaxValue and getMinValue functions from ConstantIntegral.
They don't make sense for a signless type. Also, for isMaxValue and
isMinValue, have the caller provided the signedness rather than obtaining
it from the constant's type.

llvm-svn: 32287
2006-12-06 20:30:17 +00:00
Reid Spencer
c87c3e5a70 Bail on the getInferredCast idea. Remove the function and convert
remaining uses to more specific casts.

llvm-svn: 32231
2006-12-05 19:14:13 +00:00
Reid Spencer
671de8b576 Add cast creation functions for Pointer Casts, either BitCast or PtrToInt
llvm-svn: 32207
2006-12-04 23:14:27 +00:00