Commit Graph

587 Commits

Author SHA1 Message Date
Reid Spencer 3ac38e99b9 For PR761:
The Module::setEndianness and Module::setPointerSize methods have been
removed. Instead you can get/set the DataLayout. Adjust thise accordingly.

llvm-svn: 33530
2007-01-26 08:11:39 +00:00
Anton Korobeynikov a41d9eca96 Moved disassembler to libSystem
llvm-svn: 33461
2007-01-23 10:26:08 +00:00
Reid Spencer 2eadb5310d 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
Chris Lattner 50ee0e40e5 Teach TargetData to handle 'preferred' alignment for each target, and use
these alignment amounts to align scalars when we can.  Patch by Scott Michel!

llvm-svn: 33409
2007-01-20 22:35:55 +00:00
Chris Lattner 7476fa4456 DOUT still evaluates side effects, even though it doesn't print. This means
that disassembleBuffer will be called even if NDEBUG, but the result will
be ignored.

llvm-svn: 33408
2007-01-20 20:51:43 +00:00
Reid Spencer fff2797349 Implement the signed icmp instructions properly. To do this we introduce
a small inline function to sign extend a uint64_t value based on its
type's bitwidth. This function is then used in both executeSExtInst and
the various executeICMP_S** functions.

llvm-svn: 33403
2007-01-20 20:12:29 +00:00
Reid Spencer 3615cdf957 Implement bit-accurate sext instruction.
This patch fixes test/Integer/2007-01-17-TruncSext.ll

llvm-svn: 33394
2007-01-20 08:32:52 +00:00
Reid Spencer a94d394ad2 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
Andrew Lenharth e082e2ac7f fix build on amd64
llvm-svn: 33367
2007-01-19 20:17:59 +00:00
Anton Korobeynikov 3e956974b3 Adding disassembler interface and external hook to udis86 library.
llvm-svn: 33358
2007-01-19 17:25:17 +00:00
Reid Spencer 726b68bc6e Fix a regression in the last patch. When constructing a BitMask, be careful
not to overflow 64-bits and end up with a 0 mask. This caused i64 values to
always be stored as 0 with lots of consequential damage to nightly test.

llvm-svn: 33335
2007-01-18 18:01:32 +00:00
Reid Spencer f854f95a17 Use the new maskToBitWidth function to ensure that the results of
computations do not overflow the intended bit width.

llvm-svn: 33326
2007-01-18 02:12:51 +00:00
Reid Spencer 10fe0e0d48 Add an inline helper function that masks a GenericValue to a specified
bit width.

llvm-svn: 33325
2007-01-18 02:12:10 +00:00
Reid Spencer 300e7fcb55 Make shl instruction mask its result to the correct bitsize. This is
sufficient to get llvm-test/SingleSource/UnitTests/Integer/general-test.ll
working with lli in interpreter mode.

llvm-svn: 33321
2007-01-18 01:32:46 +00:00
Reid Spencer fab44b682e Two changes:
1. Fix logic for executeGEP. Only 32-bit and 64-bit integer types are
   acceptable as indices.
2. Ensure that all integer cast operations truncate their result to the
   integer size of the operand.

llvm-svn: 33318
2007-01-18 01:25:42 +00:00
Reid Spencer 01f7e06d8f Make sure we truncate stored values to their bit width.
llvm-svn: 33317
2007-01-18 01:24:02 +00:00
Chris Lattner 03c4953cdd rename Type::isIntegral to Type::isInteger, eliminating the old Type::isInteger.
rename Type::getIntegralTypeMask to Type::getIntegerTypeMask.

This makes naming much more consistent.  For example, there are now no longer any
instances of IntegerType that are not considered isInteger! :)

llvm-svn: 33225
2007-01-15 02:27:26 +00:00
Chris Lattner c69c6c4db2 eliminate calls to Type::isInteger, preferring isIntegral instead.
llvm-svn: 33222
2007-01-15 02:03:16 +00:00
Reid Spencer 7a9c62baa6 For PR1064:
Implement the arbitrary bit-width integer feature. The feature allows
integers of any bitwidth (up to 64) to be defined instead of just 1, 8,
16, 32, and 64 bit integers.

This change does several things:
1. Introduces a new Derived Type, IntegerType, to represent the number of
   bits in an integer. The Type classes SubclassData field is used to
   store the number of bits. This allows 2^23 bits in an integer type.
2. Removes the five integer Type::TypeID values for the 1, 8, 16, 32 and
   64-bit integers. These are replaced with just IntegerType which is not
   a primitive any more.
3. Adjust the rest of LLVM to account for this change.

Note that while this incremental change lays the foundation for arbitrary
bit-width integers, LLVM has not yet been converted to actually deal with
them in any significant way. Most optimization passes, for example, will
still only deal with the byte-width integer types.  Future increments
will rectify this situation.

llvm-svn: 33113
2007-01-12 07:05:14 +00:00
Reid Spencer cddc9dfe97 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 542964f55b Rename BoolTy as Int1Ty. Patch by Sheng Zhou.
llvm-svn: 33076
2007-01-11 18:21:29 +00:00
Zhou Sheng 75b871fb1e 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
Reid Spencer 0d54e78a39 For PR950:
Convert signed integer types to signless ones.

llvm-svn: 32787
2006-12-31 05:51:36 +00:00
Reid Spencer 266e42b312 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
Chris Lattner e712a5a1d2 elimiante Statistic static ctors
llvm-svn: 32702
2006-12-19 22:56:53 +00:00
Chris Lattner c346ecd780 remove static ctors from Statistic objects
llvm-svn: 32700
2006-12-19 22:43:32 +00:00
Chris Lattner 811d75f71a Fix PR1057 (compilation on macos 10.3), patch by Scott Michel!
llvm-svn: 32644
2006-12-17 21:04:02 +00:00
Jim Laskey 3958955f47 Simplify the fetching of relocation mode.
llvm-svn: 32588
2006-12-14 22:53:42 +00:00
Jim Laskey 70323a8146 1. Tidy up jump table info.
2. Allow the jit to handle PIC relocable jump tables.

llvm-svn: 32581
2006-12-14 19:17:33 +00:00
Reid Spencer 3c49edcaa1 Change inferred cast creation calls to more specific cast creations.
llvm-svn: 32460
2006-12-12 01:17:41 +00:00
Bill Wendling 22e978a736 Removing even more <iostream> includes.
llvm-svn: 32320
2006-12-07 20:04:42 +00:00
Bill Wendling f3baad3ee1 Changed llvm_ostream et all to OStream. llvm_cerr, llvm_cout, llvm_null, are
now cerr, cout, and NullStream resp.

llvm-svn: 32298
2006-12-07 01:30:32 +00:00
Chris Lattner 700b873130 Detemplatize the Statistic class. The only type it is instantiated with
is 'unsigned'.

llvm-svn: 32279
2006-12-06 17:46:33 +00:00
Jeff Cohen cc08c83186 Unbreak VC++ build.
llvm-svn: 32113
2006-12-02 02:22:01 +00:00
Anton Korobeynikov 12c94949e0 Introducing external weak linkage. Darwin codegen should be added later.
llvm-svn: 32052
2006-12-01 00:25:12 +00:00
Bill Wendling 5834fdb371 Removed #include <iostream> and replaced streams with llvm streams.
llvm-svn: 31949
2006-11-27 23:54:50 +00:00
Reid Spencer 6c38f0bb07 For PR950:
The long awaited CAST patch. This introduces 12 new instructions into LLVM
to replace the cast instruction. Corresponding changes throughout LLVM are
provided. This passes llvm-test, llvm/test, and SPEC CPUINT2000 with the
exception of 175.vpr which fails only on a slight floating point output
difference.

llvm-svn: 31931
2006-11-27 01:05:10 +00:00
Evan Cheng e03ca9b0b4 Allow target to specify alignment for function stub.
llvm-svn: 31788
2006-11-16 20:04:54 +00:00
Chris Lattner 2775aba51d Simplify IntrinsicLowering and clarify that it is only for use by the
CBE and interpreter.

llvm-svn: 31755
2006-11-15 18:00:10 +00:00
Chris Lattner 5fdbe55979 if lazy compilation is disabled, print an error message and abort if
lazy compilation is ever attempted

llvm-svn: 31602
2006-11-09 19:32:13 +00:00
Chris Lattner 87aee74ccb init ivar
llvm-svn: 31601
2006-11-09 19:31:15 +00:00
Jim Laskey 61feeb90f9 Remove redundant <cmath>.
llvm-svn: 31561
2006-11-08 19:16:44 +00:00
Reid Spencer fdff938a7e For PR950:
This patch converts the old SHR instruction into two instructions,
AShr (Arithmetic) and LShr (Logical). The Shr instructions now are not
dependent on the sign of their operands.

llvm-svn: 31542
2006-11-08 06:47:33 +00:00
Reid Spencer de46e48420 For PR786:
Turn on -Wunused and -Wno-unused-parameter. Clean up most of the resulting
fall out by removing unused variables. Remaining warnings have to do with
unused functions (I didn't want to delete code without review) and unused
variables in generated code. Maintainers should clean up the remaining
issues when they see them. All changes pass DejaGnu tests and Olden.

llvm-svn: 31380
2006-11-02 20:25:50 +00:00
Reid Spencer b20b6857f3 Remove a function prototype that is no longer needed (REM patch missed it)
llvm-svn: 31374
2006-11-02 08:12:02 +00:00
Reid Spencer 7eb55b395f For PR950:
Replace the REM instruction with UREM, SREM and FREM.

llvm-svn: 31369
2006-11-02 01:53:59 +00:00
Reid Spencer 5e2e0cb9aa Remove unnecessary sign conversions made possible by last patch.
llvm-svn: 31339
2006-11-01 03:45:43 +00:00
Reid Spencer f84930746e Fix a bug in the interpreter where divides of unmatched signed operands
would fail. E.g. udiv sint X, Y  or sdiv uint X, Y would fail to find a
type match in the switch statement and fail the operation.

llvm-svn: 31338
2006-11-01 03:41:05 +00:00
Reid Spencer 7e80b0b31e For PR950:
Make necessary changes to support DIV -> [SUF]Div. This changes llvm to
have three division instructions: signed, unsigned, floating point. The
bytecode and assembler are bacwards compatible, however.

llvm-svn: 31195
2006-10-26 06:15:43 +00:00
Reid Spencer e0fc4dfc22 For PR950:
This patch implements the first increment for the Signless Types feature.
All changes pertain to removing the ConstantSInt and ConstantUInt classes
in favor of just using ConstantInt.

llvm-svn: 31063
2006-10-20 07:07:24 +00:00