summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/X86/X86Instr64bit.td
Commit message (Collapse)AuthorAgeFilesLines
...
* reapply r75408, which eliminates MOV64r0 in favor of usingChris Lattner2009-07-141-7/+5
| | | | | | | MOV32r0 + subregs to do the same thing. This should work now that PR4544 is fixed. Thanks Evan! llvm-svn: 75671
* Temporarily revert r75408. It appears to break the Apple-style builds:Bill Wendling2009-07-121-5/+7
| | | | | | | | | x86_64-apple-darwin10-gcc -c -g -O2 -DIN_GCC -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Wold-style-definition -Wmissing-format-attribute -mdynamic-no-pic -DHAVE_CONFIG_H -I. -I. -I/Volumes/Sandbox/Buildbot/llvm/build.llvm-gcc-x86_64-darwin10-selfhost/build/llvmgcc42.roots/llvmgcc42~obj/src/gcc -I/Volumes/Sandbox/Buildbot/llvm/build.llvm-gcc-x86_64-darwin10-selfhost/build/llvmgcc42.roots/llvmgcc42~obj/src/gcc/. -I/Volumes/Sandbox/Buildbot/llvm/build.llvm-gcc-x86_64-darwin10-selfhost/build/llvmgcc42.roots/llvmgcc42~obj/src/gcc/../include -I./../intl -I/Volumes/Sandbox/Buildbot/llvm/build.llvm-gcc-x86_64-darwin10-selfhost/build/llvmgcc42.roots/llvmgcc42~obj/src/gcc/../libcpp/include -I/Volumes/Sandbox/Buildbot/llvm/build.llvm-gcc-x86_64-darwin10-selfhost/build/llvmgcc42.roots/llvmgcc42~obj/src/gcc/../libdecnumber -I../libdecnumber -I/Volumes/Sandbox/Buildbot/llvm/build.llvm-gcc-x86_64-darwin10-selfhost/build/llvmCore.roots/llvmCore~dst/Developer/usr/local/include -I/Volumes/Sandbox/Buildbot/llvm/build.llvm-gcc-x86_64-darwin10-selfhost/build/llvmCore.roots/llvmCore~obj/src/include -DENABLE_LLVM -I/Volumes/Sandbox/Buildbot/llvm/build.llvm-gcc-x86_64-darwin10-selfhost/build/llvmCore.roots/llvmCore~dst/Developer/usr/local/include -D_DEBUG -D_GNU_SOURCE -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -DLLVM_VERSION_INFO='"9999"' -DBUILD_LLVM_APPLE_STYLE /Volumes/Sandbox/Buildbot/llvm/build.llvm-gcc-x86_64-darwin10-selfhost/build/llvmgcc42.roots/llvmgcc42~obj/src/gcc/tree-ssa-alias.c -o tree-ssa-alias.o /var/tmp//ccJQ2JBT.s:4134:Incorrect register `%rcx' used with `l' suffix make[2]: *** [tree-ssa-live.o] Error 1 make[2]: *** Waiting for unfinished jobs.... llvm-svn: 75412
* eliminate MOV64r0 in favor of a Pat<> pattern. This is only nontrivial becauseChris Lattner2009-07-121-7/+5
| | | | | | the div lowering code explicitly references it. llvm-svn: 75408
* fix x86-64 static codegen to materialize the address of a global with movl ↵Chris Lattner2009-07-111-3/+15
| | | | | | | | | | | | | | | | | | instead of lea. It is better for code size (and presumably efficiency) to use: movl $foo, %eax rather than: leal foo, eax Both give a nice zero extending "move immediate" instruction, the former is just smaller. Note that global addresses should be handled different by the x86 backend, but I chose to follow the style already in place and add more fixme's. llvm-svn: 75403
* comment cleanup, reduce nesting.Chris Lattner2009-07-111-2/+4
| | | | llvm-svn: 75398
* remove some dead patterns, WrapperRIP doesn't exist in -static modeChris Lattner2009-07-111-17/+0
| | | | | | anymore, so these aren't needed. llvm-svn: 75397
* Reimplement rip-relative addressing in the X86-64 backend. The newChris Lattner2009-06-271-1/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | implementation primarily differs from the former in that the asmprinter doesn't make a zillion decisions about whether or not something will be RIP relative or not. Instead, those decisions are made by isel lowering and propagated through to the asm printer. To achieve this, we: 1. Represent RIP relative addresses by setting the base of the X86 addr mode to X86::RIP. 2. When ISel Lowering decides that it is safe to use RIP, it lowers to X86ISD::WrapperRIP. When it is unsafe to use RIP, it lowers to X86ISD::Wrapper as before. 3. This removes isRIPRel from X86ISelAddressMode, representing it with a basereg of RIP instead. 4. The addressing mode matching logic in isel is greatly simplified. 5. The asmprinter is greatly simplified, notably the "NotRIPRel" predicate passed through various printoperand routines is gone now. 6. The various symbol printing routines in asmprinter now no longer infer when to emit (%rip), they just print the symbol. I think this is a big improvement over the previous situation. It does have two small caveats though: 1. I implemented a horrible "no-rip" modifier for the inline asm "P" constraint modifier. This is a short term hack, there is a much better, but more involved, solution. 2. I had to xfail an -aggressive-remat testcase because it isn't handling the use of RIP in the constant-pool reading instruction. This specific test is easy to fix without -aggressive-remat, which I intend to do next. llvm-svn: 74372
* change TLS_ADDR lowering to lower to a real mem operand, instead of matching asChris Lattner2009-06-201-3/+6
| | | | | | | | | | | | a global with that gets printed with the :mem modifier. All operands to lea's should be handled with the lea32mem operand kind, and this allows the TLS stuff to do this. There are several better ways to do this, but I went for the minimal change since I can't really test this (beyond make check). This also makes the use of EBX explicit in the operand list in the 32-bit, instead of implicit in the instruction. llvm-svn: 73834
* eliminate the "call" operand modifier from the asm descriptions, modelingChris Lattner2009-06-201-2/+10
| | | | | | | it as a pcrel immediate instead. This gets pc-rel weirdness out of the main printoperand codepath. llvm-svn: 73829
* implement support for lowering subregs when preparing to print Chris Lattner2009-06-201-0/+1
| | | | | | | | LEA64_32r, eliminating a bunch of modifier logic stuff on addr modes. Implement support for printing mbb labels as operands. llvm-svn: 73817
* CALL64pcrel32 immediate field is 32-bit. Patch by Abhinav Duggal.Evan Cheng2009-06-161-1/+1
| | | | llvm-svn: 73536
* The Ls and Qs were mixed up. Patch by Sean.Bill Wendling2009-06-151-3/+3
| | | | llvm-svn: 73417
* "The Intel instruction tables should include the 64-bit and 32-bit instructionsBill Wendling2009-06-151-0/+9
| | | | | | | | | | | that push immediate operands of 1, 2, and 4 bytes (extended to the native register size in each case). The assembly mnemonics are "pushl" and "pushq." One such instruction appears at the beginning of the "start" function , so this is essential for accurate disassembly when unwinding." Patch by Sean Callanan! llvm-svn: 73407
* Revert r72734. The Darwin assembler doesn't support the staticDan Gohman2009-06-031-4/+4
| | | | | | | relocation model on x86-64. Higher level logic should override the relocation model to PIC on x86_64-apple-darwin. llvm-svn: 72746
* On Darwin x86_64 small code model doesn't guarantee code address fits in 32-bit.Evan Cheng2009-06-021-4/+4
| | | | llvm-svn: 72734
* Revert 72707 and 72709, for the moment.Dale Johannesen2009-06-021-64/+22
| | | | llvm-svn: 72712
* Make the implicit inputs and outputs of target-independentDale Johannesen2009-06-011-22/+64
| | | | | | | | | | | | | | | | | | | | | | | | ADDC/ADDE use MVT::i1 (later, whatever it gets legalized to) instead of MVT::Flag. Remove CARRY_FALSE in favor of 0; adjust all target-independent code to use this format. Most targets will still produce a Flag-setting target-dependent version when selection is done. X86 is converted to use i32 instead, which means TableGen needs to produce different code in xxxGenDAGISel.inc. This keys off the new supportsHasI1 bit in xxxInstrInfo, currently set only for X86; in principle this is temporary and should go away when all other targets have been converted. All relevant X86 instruction patterns are modified to represent setting and using EFLAGS explicitly. The same can be done on other targets. The immediate behavior change is that an ADC/ADD pair are no longer tightly coupled in the X86 scheduler; they can be separated by instructions that don't clobber the flags (MOV). I will soon add some peephole optimizations based on using other instructions that set the flags to feed into ADC. llvm-svn: 72707
* Fix a grammaro and clarify a comment.Dan Gohman2009-05-311-5/+5
| | | | llvm-svn: 72668
* (i64 (zext (srl GR32 8))) -> movzbl AH is not safe since srl 8 only clear ↵Evan Cheng2009-05-301-7/+0
| | | | | | the top 8 bits. llvm-svn: 72618
* More h-registers tricks: folding zext nodes.Evan Cheng2009-05-291-0/+19
| | | | llvm-svn: 72558
* Add basic support for code generation of Chris Lattner2009-05-051-0/+5
| | | | | | addrspace(257) -> FS relative on x86. Patch by Zoltan Varga! llvm-svn: 70992
* Rename GR8_, GR16_, GR32_, and GR64_ to GR8_ABCD, GR16_ABCD,Dan Gohman2009-04-271-6/+6
| | | | | | GR32_ABCD, and GR64_ABCD, respectively, to help describe them. llvm-svn: 70210
* Break up long multi-mnemonic strings into separate lines for readability.Dan Gohman2009-04-271-3/+9
| | | | llvm-svn: 70209
* Fix PR 4004 by including the call to __tls_get_addr in X86tlsaddr. This is notRafael Espindola2009-04-241-2/+10
| | | | | | very elegant, but neither is the tls specification :-( llvm-svn: 69968
* TLS_addr64 and TLS_addr32 define RDI and EAX. They don't use them.Rafael Espindola2009-04-211-1/+1
| | | | | | This fixes PR4002. llvm-svn: 69672
* For general dynamic TLS access we must useRafael Espindola2009-04-171-3/+5
| | | | | | | | | leaq foo@TLSGD(%rip), %rdi as part of the instruction sequence. Using a register other than %rdi and then copying it to %rdi is not valid. llvm-svn: 69350
* Rename COPY_TO_SUBCLASS to COPY_TO_REGCLASS, and generalizeDan Gohman2009-04-131-6/+6
| | | | | | | it accordingly. Thanks to Jakob Stoklund Olesen for pointing out how this might be useful. llvm-svn: 68986
* Implement x86 h-register extract support.Dan Gohman2009-04-131-11/+58
| | | | | | | | | | | | | | | | | | | | | | | | - Add patterns for h-register extract, which avoids a shift and mask, and in some cases a temporary register. - Add address-mode matching for turning (X>>(8-n))&(255<<n), where n is a valid address-mode scale value, into an h-register extract and a scaled-offset address. - Replace X86's MOV32to32_ and related instructions with the new target-independent COPY_TO_SUBREG instruction. On x86-64 there are complicated constraints on h registers, and CodeGen doesn't currently provide a high-level way to express all of them, so they are handled with a bunch of special code. This code currently only supports extracts where the result is used by a zero-extend or a store, though these are fairly common. These transformations are not always beneficial; since there are only 4 h registers, they sometimes require extra move instructions, and this sometimes increases register pressure because it can force out values that would otherwise be in one of those registers. However, this appears to be relatively uncommon. llvm-svn: 68962
* Add a comment about MOVSX64rr8.Dan Gohman2009-04-131-0/+4
| | | | llvm-svn: 68950
* Re-apply 68552.Rafael Espindola2009-04-081-1/+1
| | | | | | Tested by bootstrapping llvm-gcc and using that to build llvm. llvm-svn: 68645
* Implement support for using modeling implicit-zero-extension on x86-64Dan Gohman2009-04-081-8/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | with SUBREG_TO_REG, teach SimpleRegisterCoalescing to coalesce SUBREG_TO_REG instructions (which are similar to INSERT_SUBREG instructions), and teach the DAGCombiner to take advantage of this on targets which support it. This eliminates many redundant zero-extension operations on x86-64. This adds a new TargetLowering hook, isZExtFree. It's similar to isTruncateFree, except it only applies to actual definitions, and not no-op truncates which may not zero the high bits. Also, this adds a new optimization to SimplifyDemandedBits: transform operations like x+y into (zext (add (trunc x), (trunc y))) on targets where all the casts are no-ops. In contexts where the high part of the add is explicitly masked off, this allows the mask operation to be eliminated. Fix the DAGCombiner to avoid undoing these transformations to eliminate casts on targets where the casts are no-ops. Also, this adds a new two-address lowering heuristic. Since two-address lowering runs before coalescing, it helps to be able to look through copies when deciding whether commuting and/or three-address conversion are profitable. Also, fix a bug in LiveInterval::MergeInClobberRanges. It didn't handle the case that a clobber range extended both before and beyond an existing live range. In that case, multiple live ranges need to be added. This was exposed by the new subreg coalescing code. Remove 2008-05-06-SpillerBug.ll. It was bugpoint-reduced, and the spiller behavior it was looking for no longer occurrs with the new instruction selection. llvm-svn: 68576
* Temporarily revert r68552. This was causing a failure in the self-hosting LLVMBill Wendling2009-04-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | builds. --- Reverse-merging (from foreign repository) r68552 into '.': U test/CodeGen/X86/tls8.ll U test/CodeGen/X86/tls10.ll U test/CodeGen/X86/tls2.ll U test/CodeGen/X86/tls6.ll U lib/Target/X86/X86Instr64bit.td U lib/Target/X86/X86InstrSSE.td U lib/Target/X86/X86InstrInfo.td U lib/Target/X86/X86RegisterInfo.cpp U lib/Target/X86/X86ISelLowering.cpp U lib/Target/X86/X86CodeEmitter.cpp U lib/Target/X86/X86FastISel.cpp U lib/Target/X86/X86InstrInfo.h U lib/Target/X86/X86ISelDAGToDAG.cpp U lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp U lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp U lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.h U lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.h U lib/Target/X86/X86ISelLowering.h U lib/Target/X86/X86InstrInfo.cpp U lib/Target/X86/X86InstrBuilder.h U lib/Target/X86/X86RegisterInfo.td llvm-svn: 68560
* Reduce code duplication on the TLS implementation.Rafael Espindola2009-04-071-1/+1
| | | | | | | | | | This introduces a small regression on the generated code quality in the case we are just computing addresses, not loading values. Will work on it and on X86-64 support. llvm-svn: 68552
* When optimzing a mul by immediate into two, the resulting mul's should get a ↵Evan Cheng2009-03-301-2/+2
| | | | | | x86 specific node to avoid dag combiner from hacking on them further. llvm-svn: 68066
* Disable the "call to immediate" optimization on x86-64. It isChris Lattner2009-03-181-1/+5
| | | | | | | | | | | not safe in general because the immediate could be an arbitrary value that does not fit in a 32-bit pcrel displacement. Conservatively fall back to loading the value into a register and calling through it. We still do the optzn on X86-32. llvm-svn: 67142
* Re-apply 66024 with fixes: 1. Fixed indirect call to immediate address ↵Evan Cheng2009-03-121-2/+4
| | | | | | assembly. 2. Fixed JIT encoding by making the address pc-relative. llvm-svn: 66803
* Revert r66024. The JIT encoding for CALLpcrel32 is wrong -- see PR3773, and theDan Gohman2009-03-111-4/+2
| | | | | | assembly text output uses an indirect call ("call *") instead of a direct call. llvm-svn: 66735
* Don't use plain INC32 and DEC32 on x86-64; it needsDan Gohman2009-03-051-0/+22
| | | | | | | | INC64_32r and INC64_16r, because these instructions are encoded differently on x86-64. This fixes JIT regressions on x86-64 in kimwitu++ and others. llvm-svn: 66207
* Re-apply 66008, now that the unfoldMemoryOperand bug is fixed.Dan Gohman2009-03-041-34/+46
| | | | llvm-svn: 66058
* Fix PR3666: isel calls to constant addresses.Evan Cheng2009-03-041-2/+4
| | | | llvm-svn: 66024
* Revert r66004 for now; it's causing a variety of test failures.Dan Gohman2009-03-041-46/+34
| | | | llvm-svn: 66008
* Teach the x86 backend to eliminate "test" instructions by using the EFLAGSDan Gohman2009-03-041-34/+46
| | | | | | result from add, sub, inc, and dec instructions in simple cases. llvm-svn: 66004
* Add '(implicit EFLAGS)' for AND, OR, XOR, NEG, INC, and DECDan Gohman2009-03-031-35/+70
| | | | | | instructions. These aren't used yet. llvm-svn: 65965
* 80 col violations.Evan Cheng2009-02-101-4/+7
| | | | llvm-svn: 64237
* A few more isAsCheapAsAMove.Evan Cheng2009-02-051-1/+1
| | | | llvm-svn: 63852
* Map address space 256 to gs; similar mappings could be supported for theNate Begeman2009-01-261-0/+5
| | | | | | | other x86 segments. address space 0 is stack/default, 1-255 are reserved for client use. llvm-svn: 62980
* Also favors NOT64r.Evan Cheng2009-01-211-1/+1
| | | | llvm-svn: 62710
* Disable the register+memory forms of the bt instructions for now. ThanksDan Gohman2009-01-131-4/+8
| | | | | | | | to Eli for pointing out that these forms don't ignore the high bits of their index operands, and as such are not immediately suitable for use by isel. llvm-svn: 62194
* Add bt instructions that take immediate operands.Dan Gohman2009-01-131-1/+12
| | | | llvm-svn: 62180
* Add patterns to match conditional moves with loads foldedDan Gohman2009-01-071-1/+34
| | | | | | | into their left operand, rather than their right. Do this by commuting the operands and inverting the condition. llvm-svn: 61842
OpenPOWER on IntegriCloud