Commit Graph

30927 Commits

Author SHA1 Message Date
Chris Lattner 3d7efa2586 implement initial support for the silly X constraint. Testcase here: CodeGen/X86/2007-03-24-InlineAsmXConstraint.ll
llvm-svn: 35327
2007-03-25 04:35:41 +00:00
Chris Lattner 6089146aa3 new testcase
llvm-svn: 35326
2007-03-25 04:35:23 +00:00
Reid Spencer cd99fbdf3b Make more uses of getHighBitsSet and get rid of some pointless & of an
APInt with its type mask.

llvm-svn: 35325
2007-03-25 04:26:16 +00:00
Chris Lattner 843e44503c Implement CodeGen/X86/2007-03-24-InlineAsmMultiRegConstraint.ll
llvm-svn: 35324
2007-03-25 02:18:14 +00:00
Chris Lattner f4579c7872 new testcase
llvm-svn: 35323
2007-03-25 02:17:58 +00:00
Chris Lattner d685514e2e switch TargetLowering::getConstraintType to take the entire constraint,
not just the first letter.  No functionality change.

llvm-svn: 35322
2007-03-25 02:14:49 +00:00
Reid Spencer d8aad61d4d More APIntification:
* Convert the last use of a uint64_t that should have been an APInt.
* Change ComputeMaskedBits to have a const reference argument for the Mask
  so that recursions don't cause unneeded temporaries. This causes temps
  to be needed in other places (where the mask has to change) but this
  change optimizes for the recursion which is more frequent.
* Remove two instances of &ing a Mask with getAllOnesValue. Its not
  needed any more because APInt is accurate in its bit computations.
* Start using the getLowBitsSet and getHighBits set methods on APInt
  instead of shifting. This makes it more clear in the code what is
  going on.

llvm-svn: 35321
2007-03-25 02:03:12 +00:00
Chris Lattner 927f30da08 Allow the b/h/w/k constraints to be applied to values that have multiple alternatives, and end up not being registers.
llvm-svn: 35320
2007-03-25 02:01:03 +00:00
Chris Lattner 03a643aa69 enforce the proper range for the i386 N constraint.
llvm-svn: 35319
2007-03-25 01:57:35 +00:00
Chris Lattner c8ddca703d Fix test/CodeGen/X86/2007-03-24-InlineAsmPModifier.ll
llvm-svn: 35318
2007-03-25 01:44:57 +00:00
Chris Lattner 421ac38bd6 new testcase
llvm-svn: 35317
2007-03-25 01:44:40 +00:00
Reid Spencer 9bb967ec5c Fix a typo in a comment.
llvm-svn: 35316
2007-03-25 01:13:46 +00:00
Reid Spencer d4e07f200a Actually, for getHighBitsSet and getLowBitsSet, don't make a 0 bit size
illegal. Instead do the 0 valued construction for the user. This is because
the caller may not know (or care to check) that the number of bits set is
zero.

llvm-svn: 35315
2007-03-25 00:01:47 +00:00
Chris Lattner 3a8248f79d fix a regression on vector or instructions.
llvm-svn: 35314
2007-03-24 23:56:43 +00:00
Reid Spencer 42fbb4fbe3 Make it illegal to set 0 bits in getHighBitsSet and getLowBitsSet. For that
they should have used the uint64_t constructor. This avoids causing
undefined results via shifts by the word size when the bit width is an
exact multiple of the word size.

llvm-svn: 35313
2007-03-24 23:47:58 +00:00
Reid Spencer 790631ff2d In the getBitsSet function, don't optimize for a common case that is
already covered by getLowBitsSet (i.e. when loBits==0). Consequently, remove
the default value for loBits and reorder the arguments to the more natural
loBits, hiBits order. This makes it more clear that this function is for bit
groups in the middle of the bit width and not towards one end or the other.

llvm-svn: 35312
2007-03-24 23:42:47 +00:00
Reid Spencer cf3a678d40 Don't invoke undefined behavior in shifts in the functions getHighBitsSet
and getLowBitsSet.

llvm-svn: 35311
2007-03-24 23:35:54 +00:00
Reid Spencer b334e8ac57 Implement the getBitsSet function.
llvm-svn: 35310
2007-03-24 23:27:48 +00:00
Reid Spencer e3d00119e6 Remove the last vestiges of this directory.
llvm-svn: 35309
2007-03-24 23:07:49 +00:00
Reid Spencer 30e83dfc4b Implement the getHighBitsSet and getLowBitsSet functions.
llvm-svn: 35308
2007-03-24 23:05:35 +00:00
Reid Spencer 41eadeb49d Get the signs in the right place!
llvm-svn: 35307
2007-03-24 22:50:43 +00:00
Reid Spencer db3b93bbb2 Fix a link.
llvm-svn: 35306
2007-03-24 22:40:44 +00:00
Reid Spencer 709a820a53 Undo the last change and make this really implement remainder and not
modulus. The previous change was a result of incorrect documentation in
the LangRef.html.

llvm-svn: 35305
2007-03-24 22:37:23 +00:00
Reid Spencer c10869bb57 Flip the srem tests around. Previous commit was to correct an apparent
bug in the srem implementation. Turns out it was a documentation bug
instead.

llvm-svn: 35304
2007-03-24 22:34:10 +00:00
Reid Spencer 806ad6afb8 Correct the description of srem. remainder follows the dividend not the
divisor!

llvm-svn: 35303
2007-03-24 22:23:39 +00:00
Reid Spencer 3e51cacd4f Correct the implementation of srem to be remainder, not modulus. The sign of
the result must follow the sign of the divisor.

llvm-svn: 35302
2007-03-24 21:56:22 +00:00
Reid Spencer 71a6ef7f0e Fix incorrect test cases for srem. The definition of srem is a remainder so
that the sign of the result follows the sign of the divisor.

llvm-svn: 35301
2007-03-24 21:55:26 +00:00
Reid Spencer 77859c2d49 Clean up this interface:
1. Group similar methods into doxygen groups
2. Reorganize the groups into a consist flow.
3. Significantly improve the quality of the documentation on several methods
4. Rewrite srem and sdiv to eliminate a copy and improve readability.
5. Eliminate unneeded forward references.

llvm-svn: 35300
2007-03-24 18:09:18 +00:00
Chris Lattner 2a991268f7 don't rely on ADL
llvm-svn: 35299
2007-03-24 17:37:03 +00:00
Chris Lattner 7750e344d3 add a valuetype for v1i64, which is needed by mmx.
llvm-svn: 35298
2007-03-24 17:36:26 +00:00
Zhou Sheng e9ebd3f6ba Make some codes more efficient.
llvm-svn: 35297
2007-03-24 15:34:37 +00:00
Chris Lattner 43cab75914 add a bad case evan though of.
llvm-svn: 35296
2007-03-24 06:01:32 +00:00
Reid Spencer a962d18774 For PR1205:
Convert some calls to ConstantInt::getZExtValue() into getValue() and
use APInt facilities in the subsequent computations.

llvm-svn: 35294
2007-03-24 00:42:08 +00:00
Evan Cheng b7051f596a Adjust offset to compensate for big endian machines.
llvm-svn: 35293
2007-03-24 00:02:43 +00:00
Anton Korobeynikov 8aae2d7e1c Autodetect MMX & SSE stuff for AMD processors
llvm-svn: 35292
2007-03-23 23:46:48 +00:00
Bill Wendling 3ab6e72143 This is dead. DEAD I tells you!!
llvm-svn: 35291
2007-03-23 22:42:04 +00:00
Bill Wendling 871c77cda1 PR1260:
Add final support to get the QT example to compile.

llvm-svn: 35290
2007-03-23 22:35:46 +00:00
Evan Cheng a883b58caf Make sure SEXTLOAD of the specific type is supported on the target.
llvm-svn: 35289
2007-03-23 22:13:36 +00:00
Reid Spencer 562b715dd1 Add more test cases for APIntified InstCombine.
llvm-svn: 35288
2007-03-23 21:57:47 +00:00
Reid Spencer 959a21d3dc For PR1205:
* APIntify visitAdd and visitSelectInst
* Remove unused uint64_t versions of utility functions that have been
  replaced with APInt versions.
This completes most of the changes for APIntification of InstCombine. This
passes llvm-test and llvm/test/Transforms/InstCombine/APInt.

Patch by Zhou Sheng.

llvm-svn: 35287
2007-03-23 21:24:59 +00:00
Evan Cheng e2f5f24e8e Also replace uses of SRL if that's also folded during ReduceLoadWidth().
llvm-svn: 35286
2007-03-23 20:55:21 +00:00
Reid Spencer ea8b07ee6b Add test case for testing InstCombine with arbitrary precision integer
types. These tests mimic the integer test cases in the normal InstCombine
test suite but use "strange" integer bit widths.

Most tests written by Zhou Sheng, a few by me.

llvm-svn: 35284
2007-03-23 20:48:34 +00:00
Reid Spencer 6d39206bc2 For PR1205:
APIntify visitDiv, visitMul and visitRem.

Patch by Zhou Sheng.

llvm-svn: 35283
2007-03-23 20:05:17 +00:00
Chris Lattner 12b89cc148 switch AddReachableCodeToWorklist from being recursive to being iterative.
llvm-svn: 35282
2007-03-23 19:17:18 +00:00
Reid Spencer 6274c72ee1 For PR1205:
APIntify several utility functions supporting logical operators and shift
operators.

Patch by Zhou Sheng.

llvm-svn: 35281
2007-03-23 18:46:34 +00:00
Dan Gohman ac8fe43024 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
Duncan Sands 96719d1667 Test handling of switches with wide case ranges.
llvm-svn: 35279
2007-03-23 07:17:52 +00:00
Reid Spencer d96dc9020a Fix constant fold of div by zero and rem by zero to match IEEE 754
requirements. We must return NaN in some cases and correctly signed
infinity in other cases. Passes CFP2006 (not that that says much).

llvm-svn: 35277
2007-03-23 05:33:23 +00:00
Zhou Sheng 0900993ebc Make the "KnownZero ^ TypeMask" computation just once.
llvm-svn: 35276
2007-03-23 03:13:21 +00:00
Zhou Sheng 755f04b5d7 Simplify the code.
llvm-svn: 35275
2007-03-23 02:39:25 +00:00