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

6768 Commits

Author SHA1 Message Date
Bill Wendling
9c7b0a19eb Return an X86ELFWriterInfo object.
llvm-svn: 33574
2007-01-27 02:56:16 +00:00
Bill Wendling
f5cec978ec X86 implementation of the TargetELFWriterInfo class.
llvm-svn: 33571
2007-01-27 02:54:30 +00:00
Evan Cheng
e0dc07a83f New entry.
llvm-svn: 33569
2007-01-27 02:33:22 +00:00
Evan Cheng
4618d3131c Thumb jumptable support.
llvm-svn: 33568
2007-01-27 02:29:45 +00:00
Evan Cheng
9805b66063 Thumb add / sub with carry.
llvm-svn: 33562
2007-01-27 00:07:15 +00:00
Lauro Ramos Venancio
f1f9f05230 Some asm directives fixes for ELF.
Now we can compile llvm-gcc on arm-linux-gnueabi!

llvm-svn: 33558
2007-01-26 23:24:43 +00:00
Nate Begeman
80d913651d Fix a spelling error
llvm-svn: 33556
2007-01-26 22:40:50 +00:00
Nate Begeman
481b84a66b Handle multiple functions, properly mangle symbols, and fix support for
scattered relocations.

llvm-svn: 33555
2007-01-26 22:39:48 +00:00
Evan Cheng
55455f0532 Represent tADDspi and tSUBspi as two-address instructions.
llvm-svn: 33551
2007-01-26 21:33:19 +00:00
Jim Laskey
64f4242072 Change the MachineDebugInfo to MachineModuleInfo to better reflect usage
for debugging and exception handling.

llvm-svn: 33550
2007-01-26 21:22:28 +00:00
Lauro Ramos Venancio
762787bed7 Fix Data16bitsDirective for ELF.
llvm-svn: 33549
2007-01-26 21:20:45 +00:00
Evan Cheng
2b4f267d57 Conditional branch being fixed up is not the last MI in the BB, there is a
unconditional branch following it. Simply invert the condition and swap
destinations if the conditional branch can reach the destination of the
unconditional branch:
beq L1
b   L2
=>
bne L2
b   L1

llvm-svn: 33548
2007-01-26 20:38:26 +00:00
Lauro Ramos Venancio
ea815a6137 If the constant pool value is a extern weak symbol, emit the weak reference.
llvm-svn: 33543
2007-01-26 19:51:32 +00:00
Evan Cheng
d0c39ef1ca extload -> zextload
llvm-svn: 33542
2007-01-26 19:13:16 +00:00
Jim Laskey
23ed7d2625 Make LABEL a builtin opcode.
llvm-svn: 33537
2007-01-26 14:34:52 +00:00
Reid Spencer
cec82ab067 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
Reid Spencer
cca21cf060 For PR645:
Remove the Function::renameLocalSymbols function as it is no longer
needed.

llvm-svn: 33522
2007-01-26 08:01:30 +00:00
Evan Cheng
c81bceda82 SplitBlockBeforeInstr() insert a unconditional branch to the next BB. This
is unnecessary when we are fixing up a conditional branch since we will be
adding a unconditional branch to the destination of the original branch.

llvm-svn: 33517
2007-01-26 02:02:39 +00:00
Evan Cheng
c5a454b111 Need to scan the function for branches even if there aren't any constants.
llvm-svn: 33515
2007-01-26 01:04:44 +00:00
Evan Cheng
6a46a78547 Forgot to update this.
llvm-svn: 33512
2007-01-25 23:31:04 +00:00
Evan Cheng
a229bc12be Add comment, fix typo, reduce memory usage, etc.
llvm-svn: 33510
2007-01-25 23:18:59 +00:00
Evan Cheng
a47f2cc065 I am an idiot.
llvm-svn: 33509
2007-01-25 23:18:16 +00:00
Evan Cheng
970ed5d59f Fix comment.
llvm-svn: 33508
2007-01-25 22:48:25 +00:00
Evan Cheng
9009b02367 - Tell PEI that PPC will handle stack frame rounding itself.
- Do not round up to max. alignment of stack object if it is > stack alignment.
  It will have to be handled with dynamic aligning code.

llvm-svn: 33505
2007-01-25 22:25:04 +00:00
Lauro Ramos Venancio
a3788dc56b Fix elf object definition.
llvm-svn: 33502
2007-01-25 20:11:04 +00:00
Evan Cheng
7dccb7be86 Doh. Skip JT branches.
llvm-svn: 33501
2007-01-25 19:43:52 +00:00
Evan Cheng
d7c809c7be Added (preliminary) branch shortening capability to constantpool island pass.
llvm-svn: 33497
2007-01-25 03:12:46 +00:00
Evan Cheng
9d937d1065 Getting rid uses of evil std::set<>
llvm-svn: 33496
2007-01-25 03:07:27 +00:00
Chris Lattner
18aeb42a6f Fix test/CFrontend/2007-01-24-InlineAsmCModifier.c on X86. The %c modifier
says that no $ prefix should be emitted on X86.

llvm-svn: 33495
2007-01-25 02:53:24 +00:00
Chris Lattner
c3f461a03c Fix test/CFrontend/2007-01-24-InlineAsmCModifier.c on PPC
llvm-svn: 33494
2007-01-25 02:52:50 +00:00
Andrew Lenharth
42ced99f24 FTOIT and ITOFT are bit converts, and if we drop 21264s, are always available
llvm-svn: 33492
2007-01-24 21:09:16 +00:00
Jim Laskey
ba1dc7a8c7 Call frames for intel.
llvm-svn: 33490
2007-01-24 19:15:24 +00:00
Jim Laskey
ebaec45158 80 columns
llvm-svn: 33489
2007-01-24 18:50:57 +00:00
Jim Laskey
a67f14502d Repair debug frames as a prelude to eh_frames. Switched to using MachineMoves
by value so that clean up is less confusing (these vectors tend to be small.)

llvm-svn: 33488
2007-01-24 18:45:13 +00:00
Andrew Lenharth
fcb8af0f84 Fix unordered fp on alpha
llvm-svn: 33487
2007-01-24 18:43:14 +00:00
Chris Lattner
784201d1b9 Fix a misencoding of CBW and CWD. This fixes PR1030.
llvm-svn: 33486
2007-01-24 18:31:00 +00:00
Evan Cheng
c6db78ab84 Use PC relative ldr to load from a constantpool in Thumb mode.
llvm-svn: 33484
2007-01-24 08:53:17 +00:00
Bill Wendling
c0ecd3ff91 Make ivars private and use getters. Have the MachOWriter return "Mach-O
Writer" for the pass name.

llvm-svn: 33483
2007-01-24 07:13:56 +00:00
Evan Cheng
bfd7e70770 Renamed getTypeAlignmentShift() to getPreferredTypeAlignmentShift().
llvm-svn: 33482
2007-01-24 07:03:39 +00:00
Bill Wendling
68d62e3a4c Add a field for and construction of the PPCMachOWriterInfo object.
llvm-svn: 33480
2007-01-24 03:41:36 +00:00
Bill Wendling
a34cc9d823 Move the getJTRelocation method out of here.
llvm-svn: 33479
2007-01-24 03:40:33 +00:00
Bill Wendling
24e03bd501 New "TargetMachOWriterInfo" class. It holds target-specific information
that the MachOWriter needs in order to do its writing stuff 'n things.

llvm-svn: 33475
2007-01-24 03:36:05 +00:00
Evan Cheng
1630c86beb Allow [ fi#c, imm ] as ARM load / store addresses.
llvm-svn: 33474
2007-01-24 02:45:25 +00:00
Evan Cheng
fa613cdd06 Various Thumb mode load / store isel bug fixes.
llvm-svn: 33472
2007-01-24 02:21:22 +00:00
Evan Cheng
5f947e4e2f - Reorg Thumb load / store instructions. Combine each rr and ri pair of
instructions into one (e.g. tLDRrr, tLDRri -> tLDR).
- Thumb ldrsb and ldrsh only have the [reg, reg] address format. If the
  address is not an add, materialize a 0 immediate into a register and use
  it as the offset field.

llvm-svn: 33470
2007-01-23 22:59:13 +00:00
Evan Cheng
dc97533dd3 Darwin HiddenDirective is .private_extern.
llvm-svn: 33465
2007-01-23 19:06:03 +00:00
Evan Cheng
b6a4a7f72a PEI is now responsible for adding MaxCallFrameSize to frame size and align the stack. Each target can further adjust the frame size if necessary.
llvm-svn: 33460
2007-01-23 09:38:11 +00:00
Evan Cheng
d9d93832b0 hasFP() is now a virtual method of MRegisterInfo.
llvm-svn: 33455
2007-01-23 00:57:47 +00:00
Evan Cheng
25584afca7 ARM AAPCS abi (Linux, etc.) requires 8-byte double / long alignment; Mac
requires 4-bytes alignment.

llvm-svn: 33448
2007-01-22 23:13:01 +00:00
Evan Cheng
c76a2c6c18 Double and long preferred alignment set to 8 bytes.
llvm-svn: 33447
2007-01-22 23:11:06 +00:00
Evan Cheng
8de7964067 Double and long preferred alignment is 8 byte.
llvm-svn: 33446
2007-01-22 23:09:50 +00:00
Evan Cheng
ab307e2180 - getTypeAlignmentShift() should be returning preferred alignment, not ABI
alignment.
- getPreferredAlignmentLog(): remove Double special case.

llvm-svn: 33445
2007-01-22 23:08:19 +00:00
Evan Cheng
818c6bdfa2 Linux GOT indirect reference is only necessary in PIC mode.
llvm-svn: 33441
2007-01-22 21:34:25 +00:00
Evan Cheng
b55dabdc80 Double and Long preferred alignment is 4 for Darwin, 8 for Linux.
llvm-svn: 33440
2007-01-22 21:24:13 +00:00
Evan Cheng
30ef170ddf Use bl to call Thumb fuctions directly.
llvm-svn: 33433
2007-01-22 19:40:10 +00:00
Chris Lattner
601692407e add a note
llvm-svn: 33423
2007-01-21 07:03:37 +00:00
Reid Spencer
c5140714bc Implement a getTypeSizeInBits method. This helps in transforms that want
to ensure the bit size of a type is identical before proceeding.

llvm-svn: 33413
2007-01-20 23:32:04 +00:00
Owen Anderson
4de8fa6334 TargetData assumes (and some regression tests depend on it) that the size of
an unspecified datatype in the datalayout is capped by the size of a pointer.

llvm-svn: 33411
2007-01-20 23:07:13 +00:00
Chris Lattner
86af1504b4 trivial cleanup
llvm-svn: 33410
2007-01-20 22:39:15 +00:00
Chris Lattner
9df9e3e57b 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
Evan Cheng
6271410520 Round up stack to multiple of alignment only if it's a leaf function without alloca.
llvm-svn: 33401
2007-01-20 10:22:33 +00:00
Evan Cheng
174826c1b9 One more try...
llvm-svn: 33400
2007-01-20 10:17:53 +00:00
Evan Cheng
672910d722 Last check-in was bogus. There is no need to align the stack if the function is a leaf function (and without alloca).
llvm-svn: 33399
2007-01-20 10:11:56 +00:00
Evan Cheng
5ea6a8d9e4 Prologue and epilogue bugs for non-Darwin targets.
llvm-svn: 33390
2007-01-20 03:24:07 +00:00
Evan Cheng
a6803554ab Clean up ARM PEI code.
llvm-svn: 33389
2007-01-20 02:09:25 +00:00
Evan Cheng
5807fbc934 Backend is reponsible for aligning the stack.
llvm-svn: 33388
2007-01-20 02:08:16 +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
Evan Cheng
5d0be572b5 Code clean up. Use def : pat instead of defining new instructions.
llvm-svn: 33368
2007-01-19 20:27:35 +00:00
Evan Cheng
51292f4863 isDarwin -> isTargetDarwin
llvm-svn: 33366
2007-01-19 19:28:01 +00:00
Evan Cheng
99725bd310 Restructure code a bit to make use of continue (simplifying things). Generalize
the .zerofill directive emission to not be darwin-specific.

llvm-svn: 33365
2007-01-19 19:25:36 +00:00
Evan Cheng
025816f18c Darwin doesn't support .bss, but it does have .zerofill
llvm-svn: 33364
2007-01-19 19:23:47 +00:00
Evan Cheng
b1a4190523 Introduce TargetType's ELF and Darwin.
llvm-svn: 33363
2007-01-19 19:22:40 +00:00
Evan Cheng
9203bd4339 Modify emission of jump tables on darwin to emit an extra "l" label that
delimits the boundaries of jump tables.  This lets the linker's dead code
stripping optimization do a better job.

llvm-svn: 33362
2007-01-19 18:59:56 +00:00
Lauro Ramos Venancio
f53f62b91d Fix section definition.
llvm-svn: 33359
2007-01-19 17:33:22 +00:00
Evan Cheng
c6e1d453d3 ARM backend contribution from Apple.
llvm-svn: 33353
2007-01-19 07:51:42 +00:00
Nick Lewycky
b8c2b60bb5 Needed to build on PPC Linux.
llvm-svn: 33352
2007-01-19 04:36:02 +00:00
Evan Cheng
f6b1a88a1a - Target PIC style is no longer affected by relocation model.
- In x86-64 mode, symbols with external linkage (not just symbols which are
  defined externally) requires GOT indirect reference.
- Stylistic code clean up.

llvm-svn: 33345
2007-01-18 22:27:12 +00:00
Chris Lattner
54dac5f09e move contents of PR587 to here.
llvm-svn: 33333
2007-01-18 07:34:57 +00:00
Bill Wendling
62dff8125a The zerofill directive needs a newline after it.
llvm-svn: 33327
2007-01-18 02:30:19 +00:00
Evan Cheng
7ff918163b Minor code clean up.
llvm-svn: 33323
2007-01-18 01:49:58 +00:00
Bill Wendling
af4f1b8791 Have the OutputBuffer take the is64Bit and isLittleEndian booleans.
llvm-svn: 33316
2007-01-18 01:23:11 +00:00
Chris Lattner
770735e1ca Modify emission of jump tables on darwin to emit an extra "l" label that
delimits the boundaries of jump tables.  This lets the linker's dead code
stripping optimization do a better job.

llvm-svn: 33315
2007-01-18 01:15:58 +00:00
Chris Lattner
e0c1ba6269 add new JumpTableSpecialLabelPrefix hook to asmprinter for jumptable emission.
llvm-svn: 33314
2007-01-18 01:12:56 +00:00
Bill Wendling
9306626c66 Changed to use the OutputBuffer instead of the methods in MachO and ELF
writers.

llvm-svn: 33311
2007-01-17 22:22:31 +00:00
Chris Lattner
cea9f391af restructure code a bit to make use of continue (simplifying things). Generalize
the .zerofill directive emission to not be darwin-specific

llvm-svn: 33304
2007-01-17 17:44:25 +00:00
Chris Lattner
5f4435800e darwin doesn't support .bss, but it does have .zerofill
llvm-svn: 33303
2007-01-17 17:43:33 +00:00
Chris Lattner
1a2c170bc4 add new directive
llvm-svn: 33302
2007-01-17 17:42:42 +00:00
Anton Korobeynikov
2509765bef * Fix one more bug in PIC codegen: extra load is needed for *all*
non-statics.
* Introduce new option to output zero-initialized data to .bss section.
This can reduce size of binaries. Enable it by default for ELF &
Cygwin/Mingw targets. Probably, Darwin should be also added.

llvm-svn: 33299
2007-01-17 10:33:08 +00:00
Bill Wendling
6cf6bb2d24 Revert patch.
llvm-svn: 33298
2007-01-17 09:06:13 +00:00
Bill Wendling
60dcce11c7 Create the specified TargetObjInfo and use it.
llvm-svn: 33291
2007-01-17 03:51:37 +00:00
Bill Wendling
dafa644e4d Create/store/and delete the TargetObjInfo object.
llvm-svn: 33290
2007-01-17 03:50:41 +00:00
Bill Wendling
5789edd7f5 New "TargetObjInfo" class. This holds information that the object writers will
use to write things to the file. It's abstract so each target should implement
its own version for each writer type.

llvm-svn: 33286
2007-01-17 03:46:30 +00:00
Anton Korobeynikov
47f343edc3 Missed "<" :)
llvm-svn: 33265
2007-01-16 20:22:18 +00:00
Anton Korobeynikov
9b380c56f2 Cleanup. Comments added.
llvm-svn: 33260
2007-01-16 18:23:09 +00:00
Chris Lattner
c102e8919b Fix SMG2000 with the CBE: opaque types need names too.
llvm-svn: 33258
2007-01-16 18:02:45 +00:00
Chris Lattner
30cef1024d document some subtlety
llvm-svn: 33257
2007-01-16 17:51:40 +00:00
Anton Korobeynikov
8fbc09843e Emit symbol type information for ELF/COFF targets
llvm-svn: 33256
2007-01-16 16:41:57 +00:00
Bill Wendling
efde03bbf6 Instead of yet another enum indicating the "assembly language flavor",
just use the one that's in the subtarget.

llvm-svn: 33255
2007-01-16 09:29:17 +00:00
Chris Lattner
de9ba0fdb4 Fix PR918 by only using typedefs to name struct types. This makes the later
type ordering stuff work better.  This fixes PR918 and
CodeGen/CBackend/2007-01-15-NamedArrayType.ll

Patch by Gordon Henriksen.

llvm-svn: 33254
2007-01-16 07:22:23 +00:00
Chris Lattner
06f52d3e1e add a note: we need whole-function selectiondags :)
llvm-svn: 33252
2007-01-16 06:39:48 +00:00
Bill Wendling
08272a2fa6 Make inline ASM the INTEL one if it's in that emission mode.
llvm-svn: 33247
2007-01-16 04:13:03 +00:00
Bill Wendling
cfdd717db5 Fix for PR1095:
LLVM would miscompile ASM dialects when compiling for PPC. Added dialects for
the X86 and PPC backends. It defaults to "0", the first variant of a compound
inline asm expression.

llvm-svn: 33246
2007-01-16 03:42:04 +00:00
Chris Lattner
851b9e93a2 add some notes
llvm-svn: 33228
2007-01-15 06:25:39 +00:00
Chris Lattner
c5e1611848 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
bf132d8342 Make use of isInteger vs isIntegral more explicit
llvm-svn: 33216
2007-01-15 01:48:11 +00:00
Anton Korobeynikov
9398ef2167 No hidden visiblity on Mingw32/Cygwin
llvm-svn: 33202
2007-01-14 11:49:39 +00:00
Chris Lattner
69b1c31416 add support for hidden visibility to darwin/ppc and linux/ppc targets
llvm-svn: 33200
2007-01-14 06:37:54 +00:00
Chris Lattner
f43ad084b8 add support for hidden visibility to darwin/x86
llvm-svn: 33198
2007-01-14 06:29:53 +00:00
Chris Lattner
a8f6e90cac add a new HiddenDirective member for handling visibility.
llvm-svn: 33197
2007-01-14 06:27:21 +00:00
Chris Lattner
716c76605c add a missing else. This caused globals to be printed as:
movq ___dso_handle@GOTPCREL(%rip)(%rip), %rsi

instead of:
        movq ___dso_handle@GOTPCREL(%rip), %rsi

llvm-svn: 33196
2007-01-14 06:08:14 +00:00
Chris Lattner
3560a9f595 darwin doesn't use .hidden. Disable this until we fix it right.
llvm-svn: 33191
2007-01-14 00:50:56 +00:00
Chris Lattner
a4d48724af Fix PR1103 and Regression/CodeGen/X86/2007-01-13-StackPtrIndex.ll
llvm-svn: 33189
2007-01-14 00:13:07 +00:00
Chris Lattner
937b09c54a remove dead code, frameindices must be resolve before the asmprinter runs.
llvm-svn: 33187
2007-01-13 23:59:03 +00:00
Reid Spencer
5a42897aca Remove this file. It was inadvertently added because I could not find
TargetLowering.cpp in CodeGen/SelectionDAG (location makes no sense to me)

llvm-svn: 33160
2007-01-12 23:32:11 +00:00
Chris Lattner
657e08b994 remove over-general code.
llvm-svn: 33157
2007-01-12 23:28:32 +00:00
Reid Spencer
09efdecc2d Adjust #includes to compensate for lost of DerivedTypes.h in
TargetLowering.h

llvm-svn: 33154
2007-01-12 23:22:14 +00:00
Reid Spencer
baff834435 Add a new home for TargetLowering member functions.
llvm-svn: 33152
2007-01-12 23:18:18 +00:00
Chris Lattner
bc884d406d remove obsolete fixme
llvm-svn: 33151
2007-01-12 22:52:50 +00:00
Lauro Ramos Venancio
14cf9f2c03 Don't add or sub zero to sp.
llvm-svn: 33142
2007-01-12 20:52:27 +00:00
Lauro Ramos Venancio
97e120a71c Build constants using instructions mov/orr or mvn/eor.
llvm-svn: 33141
2007-01-12 20:35:49 +00:00
Anton Korobeynikov
548b9af9c2 * PIC codegen for X86/Linux has been implemented
* PIC-aware internal structures in X86 Codegen have been refactored
* Visibility (default/weak) has been added
* Docs fixes (external weak linkage, visibility, formatting)

llvm-svn: 33136
2007-01-12 19:20:47 +00:00
Evan Cheng
0241c4a0b5 Comment.
llvm-svn: 33114
2007-01-12 07:25:16 +00:00
Reid Spencer
373d2bccea 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
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
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
Reid Spencer
e6d962e729 Change the file header name as this file was renamed.
llvm-svn: 33051
2007-01-10 04:17:32 +00:00
Reid Spencer
b808cbe40b Rename Writer.cpp as CBackend.cpp so it doesn't conflict with Writer.cpp
in the bytecode writer library. This helps with debugging.

llvm-svn: 33050
2007-01-10 04:16:17 +00:00
Reid Spencer
b4f3c47095 For PR1099:
Invert the "isSigned" logic in calls to printType and printPrimitiveType.
We want variables to be declared unsigned by default so that signless
operators like + and - perform the unsigned operation that LLVM expects
by default. Parameters with the sext attribute will be declared signed and
signed instructions will case operand values to signed regardless of the
type of the variable. This passes all tests and fixes PR1099.

llvm-svn: 33039
2007-01-09 17:09:09 +00:00
Reid Spencer
76d79c7040 For PR1099:
Partial fix for this PR. Default function parameters to signed integer, just
like everything else in CBE. The bug was caused by incorrectly introducing
parameter attributes feature by choosing "signed" parameter if the
SExtAttribute was specified. Howeer, if no attribute is specified, this
causes it to become unsigned which is incorrect. Reversing the logic so
that signedness is detected by "not ZExtAttribute" set fixes the issue.

This fixes 197.parser but there is more to do. Any comparison and possibly
other operators involving arguments may need to correctly cast the parameter
before its use, depending on the sign of the operator.

llvm-svn: 33034
2007-01-09 06:38:06 +00:00
Reid Spencer
1f80d735e2 For PR1090:
Clean up the definitions of the helper functions per Chris' review
suggestions so they are easier to read.

For PR1091:
Print minimum signed integer values as unsigned so that we get no warnings
from the C compiler about constant ranges and value comparisons.

llvm-svn: 33010
2007-01-08 08:00:00 +00:00
Reid Spencer
1a8a0762a5 Fix PR1090:
Implemented some llvm_fcmp_{pred} functions at the start of the function bodies
and use them for fcmp instructions and constant expressions. These help
implement the ordered and unordered comparisons necessary for correct exectuion
of these comparisons.

llvm-svn: 33007
2007-01-08 06:58:32 +00:00
Chris Lattner
a62936ee6f relax type
llvm-svn: 32983
2007-01-07 07:24:32 +00:00
Reid Spencer
9fae72ee14 For PR1086:
Parameter attributes do have to be specially handled in the CBE. Implement
their handling.

llvm-svn: 32976
2007-01-07 03:24:48 +00:00
Anton Korobeynikov
874aaaa34a As PR1085 was fixed, back out workaround
llvm-svn: 32969
2007-01-07 00:41:20 +00:00
Chris Lattner
a346ea7b29 Disable the macho writer until it is 100% functional. Enabling it when
broken invites bug reports.

llvm-svn: 32961
2007-01-06 22:27:58 +00:00
Anton Korobeynikov
fdd778278f gcc often inserts it's own names for sections (e.g.
gnu.linkonce.t.FunctionName). Convert them to "normal" LLVM names,
otherwise linker won't be able to merge them.

llvm-svn: 32958
2007-01-06 18:24:26 +00:00
Reid Spencer
cdaf88ff9d For PR411:
Take an incremental step towards type plane elimination. This change
separates types from values in the symbol tables by finally making use
of the TypeSymbolTable class. This yields more natural interfaces for
dealing with types and unclutters the SymbolTable class.

llvm-svn: 32956
2007-01-06 07:24:44 +00:00
Chris Lattner
aed0e0292b new note
llvm-svn: 32945
2007-01-06 01:30:45 +00:00
Evan Cheng
5ba049eabf setSetCCIsExpensive is gone.
llvm-svn: 32941
2007-01-05 23:42:53 +00:00
Evan Cheng
df277336b8 - FCOPYSIGN custom lowering bug. Clear the sign bit of operand 0 first before
or'ing in the sign bit of operand 1.
- Tweaking: rather than left shift the sign bit, fp_extend operand 1 first
  before taking its sign bit if its type is smaller than that of operand 0.

llvm-svn: 32932
2007-01-05 21:37:56 +00:00
Evan Cheng
c273c9c830 Typo
llvm-svn: 32902
2007-01-05 08:32:24 +00:00
Evan Cheng
bcf3d2bd15 With SSE2, expand FCOPYSIGN to a series of SSE bitwise operations.
llvm-svn: 32900
2007-01-05 07:55:56 +00:00
Lauro Ramos Venancio
078b85bdaa Expand SELECT (f32/f64) and FCOPYSIGN (f32/f64).
llvm-svn: 32870
2007-01-04 14:01:38 +00:00
Chris Lattner
aaafc3d16b fix testcase. It's not safe to strictly evaluate a load that should be lazy.
llvm-svn: 32842
2007-01-03 19:12:31 +00:00
Chris Lattner
a3f7277e2e Private labels start with .L on linux, not just .
llvm-svn: 32841
2007-01-03 18:16:48 +00:00
Reid Spencer
c2da5d3d97 Fix a comment that referred to the now defunct ubyte type.
llvm-svn: 32840
2007-01-03 17:24:59 +00:00
Reid Spencer
741b64d1ca Remove two useless bit casts.
llvm-svn: 32839
2007-01-03 17:24:11 +00:00
Anton Korobeynikov
2b39939053 Really big cleanup.
- New target type "mingw" was introduced
- Same things for both mingw & cygwin are marked as "cygming" (as in
gcc)
- .lcomm is supported here, so allow LLVM to use it
- Correctly use underscored versions of setjmp & _longjmp for both mingw
& cygwin

llvm-svn: 32833
2007-01-03 11:43:14 +00:00
Evan Cheng
bd6a333b52 Fix naming inconsistency.
llvm-svn: 32823
2007-01-02 21:33:40 +00:00
Rafael Espindola
d1baea3471 implement missing compares
patch by Lauro
bug fixed by me

llvm-svn: 32795
2006-12-31 18:52:39 +00:00
Reid Spencer
dda168599d For PR950:
Three changes:
1. Convert signed integer types to signless versions.
2. Implement the @sext and @zext parameter attributes. Previously the
   type of an function parameter was used to determine whether it should
   be sign extended or zero extended before the call. This information is
   now communicated via the function type's parameter attributes.
3. The interface to LowerCallTo had to be changed in order to accommodate
   the parameter attribute information. Although it would have been
   convenient to pass in the FunctionType itself, there isn't always one
   present in the caller. Consequently, a signedness indication for the
   result type and for each parameter was provided for in the interface
   to this method. All implementations were changed to make the adjustment
   necessary.

llvm-svn: 32788
2006-12-31 05:55:36 +00:00
Rafael Espindola
16af307d42 fix comment
llvm-svn: 32767
2006-12-29 14:28:12 +00:00
Lauro Ramos Venancio
c87ce8ee4b Define StaticCtorsSection and StaticDtorsSection for ARM.
llvm-svn: 32763
2006-12-28 13:13:00 +00:00
Lauro Ramos Venancio
7bfe536783 Implement SELECT_CC (f32/f64) for ARM.
llvm-svn: 32762
2006-12-28 13:11:14 +00:00
Rafael Espindola
da5b9584ce remove duplicated line
bug noticed by Lauro

llvm-svn: 32761
2006-12-28 12:51:40 +00:00
Lauro Ramos Venancio
2cde823f98 This patch defines extloadi1 and fixes an internal compiler error on
arm.

llvm-svn: 32760
2006-12-26 19:30:42 +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
Anton Korobeynikov
3a6faf0b96 Refactored JIT codegen for mingw32. Now we're using standart relocation
type for distinguish JIT & non-JIT instead of "dirty" hacks :)

llvm-svn: 32745
2006-12-22 22:29:05 +00:00
Chris Lattner
f04c00f475 add a note
llvm-svn: 32741
2006-12-22 01:03:22 +00:00
Chris Lattner
fd16bf61d8 Fix for ARM weak symbols, patch by Lauro Ramos Venancio!
llvm-svn: 32740
2006-12-21 22:59:58 +00:00
Jim Laskey
80eeff2d0d Changes from Nick Lewycky with a simplified PPCTargetAsmInfo.
llvm-svn: 32735
2006-12-21 20:26:09 +00:00
Jim Laskey
7cbf5d885e Oops.
llvm-svn: 32724
2006-12-20 21:35:00 +00:00
Jim Laskey
74097d8025 Original patch was overly complicated.
llvm-svn: 32723
2006-12-20 21:33:34 +00:00
Jim Laskey
6f0a54bd18 Changes to target powerpc for non-Darwin assemblers.
1. Patches from Nick Lewycky.
2. Code to filter register names and print them as numeric values on
non-Darwin systems.

llvm-svn: 32721
2006-12-20 20:56:46 +00:00
Anton Korobeynikov
df6487d069 Fixed 80 cols & style violation
llvm-svn: 32720
2006-12-20 20:40:30 +00:00
Anton Korobeynikov
76dbbd6e24 Fixed dllimported symbols support during JIT'ing. JIT on mingw32
platform should be more or less workable. At least, sim is running fine
under lli :)

llvm-svn: 32711
2006-12-20 01:03:20 +00:00
Chris Lattner
8896b6cb46 eliminate static ctors for Statistic objects.
llvm-svn: 32703
2006-12-19 22:59:26 +00:00
Evan Cheng
f5c9f4c3c9 Fix for PR1062 by Dan Gohman.
llvm-svn: 32688
2006-12-19 21:31:42 +00:00
Anton Korobeynikov
391dc74af0 Fix for PR1059: http://llvm.org/PR1059
llvm-svn: 32685
2006-12-19 21:04:20 +00:00
Chris Lattner
5e52d6c0da The x86-64 target machine should be used for amd64-* target triples.
llvm-svn: 32678
2006-12-19 19:40:09 +00:00
Chris Lattner
26f8533c7f Fix PR1061 and CodeGen/X86/2006-12-19-IntelSyntax.ll
llvm-svn: 32676
2006-12-19 19:29:58 +00:00
Rafael Espindola
05b3447706 macros -> Inline functions
Lauros's patch

llvm-svn: 32656
2006-12-18 11:07:09 +00:00
Rafael Espindola
08c0825f18 move ExtWeakSymbols to AsmPrinter
llvm-svn: 32648
2006-12-18 03:37:18 +00:00
Reid Spencer
0cb59889d2 Use a predicate function to identify bitcast of fp and integer instead of
repeating the logic in two different parts of the code.

llvm-svn: 32643
2006-12-17 20:24:50 +00:00
Reid Spencer
85f67cbc7a Fix PR1058:
Generate the BITCAST_TEMPORARY regardless of the uses or inlinability of
the instruction. This temporary is needed to perform the instruction, not
provide storage for its results.

llvm-svn: 32642
2006-12-17 18:50:51 +00:00
Chris Lattner
e223919df1 Apply B. Scott Michel's patch for PR1054, thanks!
llvm-svn: 32630
2006-12-16 20:23:42 +00:00
Jim Laskey
1507a869b2 Patterns no longer needed due to fix in the DAG combiner.
llvm-svn: 32612
2006-12-15 21:39:31 +00:00
Evan Cheng
32c45fa21e Some AT&T syntax assembler (e.g. Mac OS X) does not recognize the movq alias for i64 <-> XMM moves.
llvm-svn: 32609
2006-12-15 19:58:58 +00:00
Jim Laskey
e1216497dc Not all test cases are created equal. This fix is needed.
llvm-svn: 32605
2006-12-15 18:51:01 +00:00
Jim Laskey
0641795154 Not needed. Misinterpreted error message from other bug (Missing load/store
relocations.)

llvm-svn: 32604
2006-12-15 18:45:32 +00:00
Jim Laskey
b07d89090c Missing load/store relocations.
llvm-svn: 32601
2006-12-15 16:44:10 +00:00
Jim Laskey
d00589fefd Provide 64-bit support for i64 sextload<i8>.
llvm-svn: 32600
2006-12-15 14:34:11 +00:00
Jim Laskey
721e7d2129 Provide support for FP_TO_UINT.
llvm-svn: 32599
2006-12-15 14:32:57 +00:00
Evan Cheng
c24bf8bd87 This is done.
llvm-svn: 32591
2006-12-15 05:50:39 +00:00
Evan Cheng
5effab79f3 f64 <-> i64 bit_convert using movq in 64-bit mode.
llvm-svn: 32587
2006-12-14 21:55:39 +00:00
Evan Cheng
4529b8cf2e Fix a couple of typo's.
llvm-svn: 32585
2006-12-14 19:46:06 +00:00
Evan Cheng
6100c83f79 This is done.
llvm-svn: 32584
2006-12-14 19:45:32 +00:00
Evan Cheng
9918e7780a Added MOVSS2DIrr and MOVDI2SSrr to foldMemeoryOperand().
llvm-svn: 32583
2006-12-14 19:44:45 +00:00
Evan Cheng
4dc2f8e9bb - Rename MOVDSS2DIrr to MOVSS2DIrr for consistency sake.
- Add MOVDI2SSrm and MOVSS2DImr to fold load / store for i32 <-> f32 bit_convert
  patterns.

llvm-svn: 32582
2006-12-14 19:43:11 +00:00
Rafael Espindola
d19ea53887 avoid using a constant table when a constant can be used inline
llvm-svn: 32580
2006-12-14 18:58:37 +00:00
Rafael Espindola
0d92ae76fb Avoid creating invalid sub/add instructions on the prolog/epilog
patch by Lauro

llvm-svn: 32577
2006-12-14 13:31:27 +00:00
Evan Cheng
504fec49b1 Add note.
llvm-svn: 32561
2006-12-13 20:59:43 +00:00
Jim Laskey
ac064e92da Honor cpu directive, take two.
llvm-svn: 32492
2006-12-12 20:57:08 +00:00
Jim Laskey
b039172d58 Rollback changes to take a different tack.
llvm-svn: 32488
2006-12-12 19:26:50 +00:00
Rafael Espindola
7c4245c4e3 more general matching of the MVN instruction
llvm-svn: 32484
2006-12-12 17:10:13 +00:00
Jim Laskey
8a5cea99ed Honor the command line specification for machine type.
llvm-svn: 32483
2006-12-12 16:07:33 +00:00
Rafael Espindola
a65fd68f23 don't use "ordinary" addressing mode 1 when mvn is appropriate
llvm-svn: 32482
2006-12-12 14:03:29 +00:00
Jim Laskey
18b1edb10d Reduce number of instructions to load 64-bit constants.
llvm-svn: 32481
2006-12-12 13:23:43 +00:00
Reid Spencer
562b83c7df Change inferred getCast into specific getCast. Passes all tests.
llvm-svn: 32469
2006-12-12 05:05:00 +00:00
Rafael Espindola
d29cb12dfc use MVN to handle small negative constants
llvm-svn: 32459
2006-12-12 01:03:11 +00:00
Rafael Espindola
b8163fd828 add mvn
llvm-svn: 32454
2006-12-12 00:37:38 +00:00
Reid Spencer
d2390e3b0a Fix the BitCastUnion type for 32-bit targets.
llvm-svn: 32453
2006-12-12 00:11:08 +00:00
Rafael Espindola
e3aafd29a9 add note
llvm-svn: 32452
2006-12-11 23:56:10 +00:00
Chris Lattner
fb4898fdd8 Another step forward in PPC64 JIT support: we now no-longer need stubs
emitted for external globals in PPC64-JIT-PIC mode (which is good because
we didn't handle them before!).

This also fixes a bug handling the picbase delta, which we would get wrong
in some cases.

llvm-svn: 32451
2006-12-11 23:22:45 +00:00
Chris Lattner
7f60301c69 getInstrItineraryData shouldn't copy the itineraries
llvm-svn: 32448
2006-12-11 21:42:55 +00:00
Reid Spencer
0549f720b2 Implement correct bitcast of int<->float and long<->double by using a
union to perform the bitcast.

llvm-svn: 32444
2006-12-11 20:39:15 +00:00
Jim Laskey
e2a261ad36 Missing opcode.
llvm-svn: 32439
2006-12-11 18:45:56 +00:00
Jim Laskey
911ae665d0 Layout proper frame for ppc64.
llvm-svn: 32436
2006-12-11 18:10:54 +00:00
Nate Begeman
b1b1aaa4e5 Properly mangles symbol table names
Supports constant pools
Supports relocations to jump tables
Supports relocations within the data segment (global = address of global)
Allocates memory in a non-hacky for all non-code objects.

llvm-svn: 32430
2006-12-11 02:20:45 +00:00
Chris Lattner
8f2a26ac12 Update note, with the SROA change, we now produce:
_pairtest:
        movl 8(%esp), %eax
        movl 4(%esp), %ecx
        movd %eax, %xmm0
        movd %ecx, %xmm1
        addss %xmm0, %xmm1
        movl 12(%esp), %eax
        movss %xmm1, (%eax)
        ret

instead of:

_pairtest:
        subl $12, %esp
        movl 20(%esp), %eax
        movl %eax, 4(%esp)
        movl 16(%esp), %eax
        movl %eax, (%esp)
        movss (%esp), %xmm0
        addss 4(%esp), %xmm0
        movl 24(%esp), %eax
        movss %xmm0, (%eax)
        addl $12, %esp
        ret

llvm-svn: 32427
2006-12-11 01:20:25 +00:00
Chris Lattner
a6428b2ce4 this is done
llvm-svn: 32424
2006-12-11 01:01:03 +00:00
Chris Lattner
48e3989461 Evan implemented the machineinstr improvements.
The rot example works if the type is cast to ubyte.

Move sroa examples together and upgrade them to HEAD syntax.

llvm-svn: 32423
2006-12-11 00:44:03 +00:00
Anton Korobeynikov
e76b69846d Cleaned setjmp/longjmp lowering interfaces. Now we're producing right
code (both asm & cbe) for Mingw32 target.
Removed autoconf checks for underscored versions of setjmp/longjmp.

llvm-svn: 32415
2006-12-10 23:12:42 +00:00
Jim Laskey
3fa703d088 Reverting until finding the cause of secondary bugs.
llvm-svn: 32413
2006-12-10 13:09:42 +00:00
Jim Laskey
a8f4c1d137 __PPC64CompilationCallback code was allowing registers to be clobbered by stub.
llvm-svn: 32412
2006-12-10 12:13:31 +00:00
Rafael Espindola
9fe91fc84f .align is in bits
.comm is in bytes
:-(

llvm-svn: 32408
2006-12-10 02:53:14 +00:00
Rafael Espindola
8251abb0e9 fix test/Regression/CodeGen/X86/weak.ll
if a variable has no initialization, I->getInitializer() will fail

llvm-svn: 32407
2006-12-09 23:14:08 +00:00
Evan Cheng
f1e9ec7225 Added option -soft-float to generate SW fp library calls instead of fp instructions.
llvm-svn: 32393
2006-12-09 02:41:30 +00:00
Rafael Espindola
620b3430c8 %progbits not @progbits
llvm-svn: 32376
2006-12-08 22:06:02 +00:00
Rafael Espindola
7e99603152 add \"aw\",@progbits" to ctors and dtors
llvm-svn: 32373
2006-12-08 21:24:58 +00:00
Evan Cheng
88a55bdd64 Move findTiedToSrcOperand to TargetInstrDescriptor.
llvm-svn: 32366
2006-12-08 18:45:48 +00:00
Rafael Espindola
514fcabb29 fix truncstorei1
llvm-svn: 32364
2006-12-08 18:41:21 +00:00
Andrew Lenharth
d115fe7ce3 Packed Structures
llvm-svn: 32361
2006-12-08 18:06:16 +00:00
Evan Cheng
dfec38a575 Use MI's TargetInstrDescriptor.
llvm-svn: 32352
2006-12-08 07:57:56 +00:00
Chris Lattner
51a6154ce5 Fix a bug introduced by the streams patch. DEBUG code was made unconditional.
llvm-svn: 32351
2006-12-08 05:41:26 +00:00
Chris Lattner
5d79e6ff6c this is an initial patch to switch the ppc64 jit over to working in PIC mode,
which allows the code to be above the 2G marker.  We still need to JIT emit
dyld stubs to support external, weak, common, etc globals, but that will
happen tomorrow.

llvm-svn: 32348
2006-12-08 04:54:03 +00:00
Chris Lattner
02a2f33279 add a note
llvm-svn: 32347
2006-12-08 02:01:32 +00:00
Andrew Lenharth
0b4830a079 Simplify a bit
llvm-svn: 32343
2006-12-07 23:55:55 +00:00
Chris Lattner
ce8d432068 fix incorrect encoding of rldicr, used by ppc64 function stubs, etc.
llvm-svn: 32341
2006-12-07 23:44:07 +00:00
Bill Wendling
fe0af72bc4 Don't use <sstream> in Streams.h but <iosfwd> instead.
llvm-svn: 32340
2006-12-07 23:41:45 +00:00
Rafael Espindola
bb753d7121 fix alignment
llvm-svn: 32337
2006-12-07 22:38:06 +00:00
Bill Wendling
f13d78d3b8 What should be the last unnecessary <iostream>s in the library.
llvm-svn: 32333
2006-12-07 22:21:48 +00:00
Chris Lattner
ebe31092ff fix CodeGen/PowerPC/2006-12-07-LargeAlloca.ll on ppc64
llvm-svn: 32331
2006-12-07 22:15:58 +00:00
Rafael Espindola
a908b2dfd9 make sure that we don't use a common symbol if a section was specified
llvm-svn: 32310
2006-12-07 18:33:58 +00:00
Andrew Lenharth
8261b94b09 Be sure to grab weak functions too, and make implicit defs comments
llvm-svn: 32308
2006-12-07 17:39:14 +00:00
Chris Lattner
f5fd4be9dd Fix i64 uint_to_fp on ppc64
llvm-svn: 32297
2006-12-07 01:24:16 +00:00
Evan Cheng
f4788fe306 MI keeps a ptr of TargetInstrDescriptor, use it.
llvm-svn: 32296
2006-12-07 01:21:59 +00:00
Chris Lattner
5adcc9ae58 implement sextinreg i8->i64 and i16->i64
llvm-svn: 32293
2006-12-06 21:46:13 +00:00
Chris Lattner
82157643ed fix another sradi encoding bug. This fixes Olden/health with the ppc64 jit.
llvm-svn: 32291
2006-12-06 21:35:10 +00:00
Reid Spencer
bb6793b8b5 Always pass "true" to isMaxValue(bool) because we know the type is LongTy.
llvm-svn: 32290
2006-12-06 21:27:07 +00:00
Reid Spencer
166f4dd036 Adjust to new ConstantIntegral interface for Max/Min tests.
llvm-svn: 32289
2006-12-06 20:45:15 +00:00
Chris Lattner
6d74c6ebec fix the jit encoding of sradi, simplify the MDForm1 description.
llvm-svn: 32285
2006-12-06 20:02:54 +00:00
Chris Lattner
d4e8f5d141 add relocation support for ppc64 branches.
llvm-svn: 32284
2006-12-06 19:40:04 +00:00
Chris Lattner
5e09d350aa add #include
llvm-svn: 32281
2006-12-06 18:19:53 +00:00
Chris Lattner
06ba0b8202 add missing #include
llvm-svn: 32280
2006-12-06 18:14:47 +00:00
Chris Lattner
a531ce882e Detemplatize the Statistic class. The only type it is instantiated with
is 'unsigned'.

llvm-svn: 32279
2006-12-06 17:46:33 +00:00
Jim Laskey
0ffc5bc871 Make it easier for gdb to find the return address.
llvm-svn: 32277
2006-12-06 17:42:06 +00:00
Rafael Espindola
7ad537568f print weak references
llvm-svn: 32276
2006-12-06 13:35:10 +00:00
Chris Lattner
fd152e4ed6 These asm printers shouldn't use assembly/writer.h
llvm-svn: 32262
2006-12-06 06:13:25 +00:00
Evan Cheng
40a5de9cd9 Revert an unintended change.
llvm-svn: 32239
2006-12-05 22:03:40 +00:00
Evan Cheng
adeea85f7d - Switch X86-64 JIT to large code size model.
- Re-enable some codegen niceties for X86-64 static relocation model codegen.
- Clean ups, etc.

llvm-svn: 32238
2006-12-05 19:50:18 +00:00
Chris Lattner
6a9de21df5 If we have ScalarSSE, we can select bitconvert into single instructions.
This compiles bitcast.ll:test3/test4 into:

_test3:
        movd %xmm0, %eax
        ret
_test4:
        movd %edi, %xmm0
        ret

llvm-svn: 32230
2006-12-05 18:45:06 +00:00
Chris Lattner
0edf53eb71 Add a perf optzn corresponding to PR1033.
llvm-svn: 32229
2006-12-05 18:25:10 +00:00
Chris Lattner
4ad68ab4d7 Fix PR1033 and CodeGen/X86/bitcast.ll, by expanding bitcast to a load/store pair.
This could be better, readme entry pending.

llvm-svn: 32228
2006-12-05 18:22:22 +00:00
Rafael Espindola
5e8a6ca4c0 expand memmove and memcpy
llvm-svn: 32226
2006-12-05 17:57:23 +00:00
Rafael Espindola
38062acebb add support for the "r" asm constraint
patch by Lauro Ramos Venancio

llvm-svn: 32224
2006-12-05 17:37:31 +00:00
Chris Lattner
7368984a3d Fix typo noticed by Lauro Ramos Venancio, thanks!
llvm-svn: 32223
2006-12-05 17:29:40 +00:00
Rafael Espindola
da1fffc4e1 add support for weak linkage
llvm-svn: 32222
2006-12-05 17:00:17 +00:00
Evan Cheng
32c16b7d3a JIT large code model support.
llvm-svn: 32220
2006-12-05 07:29:55 +00:00
Evan Cheng
2c48ef5aab Asm printing bug.
llvm-svn: 32218
2006-12-05 06:43:58 +00:00
Evan Cheng
2c35691a02 - Fix X86-64 JIT by temporarily disabling code that treats GV address as 32-bit
immediate in small code model. The JIT cannot ensure GV's are placed in the
lower 4G.
- Some preliminary support for large code model.

llvm-svn: 32215
2006-12-05 04:01:03 +00:00
Evan Cheng
b16bf52453 Update
llvm-svn: 32214
2006-12-05 03:58:23 +00:00
Chris Lattner
0be88afd90 Add support for 64-bit 'r' constraint. Patch by by Rafael ~Avila de Espíndol!
This fixes PR1029 and Regression/CodeGen/X86/x86-64-asm.ll

llvm-svn: 32206
2006-12-04 22:38:21 +00:00
Jim Laskey
1dcda902cd Restoration of the stack pointer after a deallocation of a alloca was not
updating the SP link.

llvm-svn: 32202
2006-12-04 22:04:42 +00:00
Evan Cheng
11e73ffe93 Non-darwin gcc should default to static relocation to match gcc.
llvm-svn: 32184
2006-12-04 18:07:10 +00:00
Evan Cheng
bf13611e84 Match TargetInstrInfo changes.
llvm-svn: 32098
2006-12-01 21:52:58 +00:00
Evan Cheng
5c7e78886c convertToThreeAddress() is now responsible for updating live info as well as inserting the new MI's.
llvm-svn: 32097
2006-12-01 21:52:41 +00:00
Evan Cheng
c5ad9caeff Add weak reference directive.
llvm-svn: 32091
2006-12-01 20:47:11 +00:00
Evan Cheng
1d611158eb Copy and paste error. An initialized global cannot be a weak reference.
llvm-svn: 32075
2006-12-01 17:39:22 +00:00
Jim Laskey
8f43fbf759 1. In ppc64 mode we need only use one GPR.
2. Float values need to be promoted to double when they are vararg.

llvm-svn: 32074
2006-12-01 16:30:47 +00:00
Jim Laskey
a8db40105b ExternalWeak case in wrong location.
llvm-svn: 32073
2006-12-01 14:37:39 +00:00
Evan Cheng
04e66b07dc Fix 2005-05-08-FPStackifierPHI.ll failure.
llvm-svn: 32071
2006-12-01 10:11:51 +00:00
Evan Cheng
3cc87db480 A initialized global variable cannot be extern weak. However, if a global value's initializer is itself a external weak symbol, emit the weak reference.
llvm-svn: 32069
2006-12-01 09:13:26 +00:00
Evan Cheng
6f5f81722b Darwin PPC external weak linkage support.
llvm-svn: 32068
2006-12-01 07:56:37 +00:00
Evan Cheng
d326e5b35e Minor code clean up.
llvm-svn: 32067
2006-12-01 07:38:23 +00:00
Evan Cheng
5b43e8613e Fix indentation.
llvm-svn: 32066
2006-12-01 07:17:00 +00:00
Evan Cheng
1dfe5221c1 Darwin X86 external weak linkage support.
llvm-svn: 32065
2006-12-01 07:15:24 +00:00
Chris Lattner
860908f98c Fix the CodeGen/PowerPC/vec_constants.ll regression.
llvm-svn: 32057
2006-12-01 01:45:39 +00:00
Anton Korobeynikov
f627d28d9c Introducing external weak linkage. Darwin codegen should be added later.
llvm-svn: 32052
2006-12-01 00:25:12 +00:00
Anton Korobeynikov
25535e6c64 Factor out GVRequiresExtraLoad() from .h to .cpp
llvm-svn: 32048
2006-11-30 22:42:55 +00:00
Evan Cheng
456101ebb9 - Use a different wrapper node for RIP-relative GV, etc.
- Proper support for both small static and PIC modes under X86-64
- Some (non-optimal) support for medium modes.

llvm-svn: 32046
2006-11-30 21:55:46 +00:00
Evan Cheng
d8be97599a MachineInstr::setOpcode -> MachineInstr::setInstrDescriptor
llvm-svn: 32034
2006-11-30 07:12:03 +00:00
Evan Cheng
08e6984667 Remove the ugly SPARCV9 TargetInstrDescriptors hack.
llvm-svn: 32033
2006-11-30 07:10:43 +00:00
Evan Cheng
f64e341522 In PIC mode, GV not requiring an extra load can be used as address immediate.
llvm-svn: 32028
2006-11-29 23:48:14 +00:00
Evan Cheng
1e3f41acde Clean up.
llvm-svn: 32027
2006-11-29 23:46:27 +00:00
Evan Cheng
7e20347607 Fix for PR1018 - Better support for X86-64 Linux in small code model.
llvm-svn: 32026
2006-11-29 23:19:46 +00:00
Chris Lattner
3219b522c8 Fix bug codegen'ing FP constant vectors with integer splats. Make sure the
created intrinsics have the right integer types.  This fixes
PowerPC/2006-11-29-AltivecFPSplat.ll

llvm-svn: 32024
2006-11-29 19:58:49 +00:00
Jim Laskey
00bcb51943 Offset for load of 32-bit arg in 64-bit world was incorrect.
llvm-svn: 32019
2006-11-29 13:37:09 +00:00
Evan Cheng
f968824cdb Custom lower READCYCLECOUNTER for x86-64.
llvm-svn: 32017
2006-11-29 08:28:13 +00:00
Chris Lattner
e72dff706e done
llvm-svn: 32013
2006-11-29 07:21:46 +00:00
Evan Cheng
52f30d0ff2 16-byte stack alignment for X86-64 ELF. Patch by Dan Gohman.
llvm-svn: 32004
2006-11-29 02:00:40 +00:00
Chris Lattner
4e07e4aa24 Upgrade the ugly darwin 64-bit bswap idiom (bswap %eax / bswap %edx /
xchgl %eax, %edx) to llvm.bswap.i64.  This compiles:

long long test2(long long A) {
  return _OSSwapInt64(A);
}

to:

_test2:
        movl 8(%esp), %eax
        movl 4(%esp), %edx
        bswapl %eax
        bswapl %edx
        ret

instead of:

_test2:
        movl 8(%esp), %edx
        movl 4(%esp), %eax
        bswap   %eax
        bswap   %edx
        xchgl   %eax, %edx
        ret

GCC manages (with -fomit-frame-pointer) the uglier:

_test2:
        subl    $4, %esp
        movl    8(%esp), %eax
        movl    12(%esp), %edx
        bswap   %eax
        bswap   %edx
        xchgl   %eax, %edx
        addl    $4, %esp
        ret

llvm-svn: 32001
2006-11-29 01:48:01 +00:00
Chris Lattner
50d2db3b77 Trivially lower 'bswap $0' into llvm.bswap. This fixes hexxagon with the
JIT on darwin/x86, which has htonl implemented as inline asm.

llvm-svn: 31999
2006-11-29 01:14:06 +00:00
Andrew Lenharth
e46a408fb9 gcc doesn't like an empty colbber list
llvm-svn: 31987
2006-11-28 23:07:32 +00:00
Andrew Lenharth
aee28a6544 Identities are default now
llvm-svn: 31980
2006-11-28 22:28:08 +00:00
Andrew Lenharth
a32f3e30b3 Make identity default, and fix PR1020
llvm-svn: 31979
2006-11-28 22:25:32 +00:00
Evan Cheng
27408161df New entries.
llvm-svn: 31976
2006-11-28 19:59:25 +00:00
Andrew Lenharth
7669b3acc5 update comments
llvm-svn: 31975
2006-11-28 19:56:02 +00:00
Andrew Lenharth
d93af28924 Get the asminfo for the target most closely matching the module and use that for inline asm
llvm-svn: 31974
2006-11-28 19:53:36 +00:00