Commit Graph

4905 Commits

Author SHA1 Message Date
Sean Callanan
38fee0edcf Added a new register class for segment registers
to the Intel register table.
Added 16- and 64-bit MOVs to and from the segment
registers to the Intel instruction tables.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81895 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-15 18:47:29 +00:00
Dale Johannesen
7d1a7c0417 Change the marker byte for stubs from 0xcd to 0xce (another form of
interrupt instruction, which shouldn't arise any other way).  0xcd is
also used by JITMemoryManager to initialize the buffer to garbage,
which means it could appear following a noreturn call even when
that is not a stub, confusing X86CompilationCallback2.  PR 4929.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81888 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-15 18:32:14 +00:00
Chris Lattner
dffb6e5aee fix PR4984 by ensuring that fastisel adds properly sign extended GEP displacement
values to machineinstrs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81886 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-15 18:27:02 +00:00
Dan Gohman
1e038a8494 Don't pull a load through a callseq_start if the load's chain
has multiple uses, as one of the other uses may be on a path
to a different node above the callseq_start, because that
leads to a cyclic graph. This problem is exposed when
-combiner-global-alias-analysis is used. This fixes PR4880.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81821 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-15 01:22:01 +00:00
Sean Callanan
76f14be685 Modified the Intel instruction tables to include
versions of CALL and JMP with segmented addresses
provided in-line, as pairs of immediates.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81818 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-15 00:35:17 +00:00
Dan Gohman
907355caf8 On x86-64, the 32-bit cmov doesn't actually clear the high 32-bit of
its result if the condition is false.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81814 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-15 00:14:11 +00:00
Chris Lattner
90edac0e8b Change MCAsmStreamer to take an MCInstPrinter instead of a
full AsmPrinter, and change TargetRegistry to keep track
of registered MCInstPrinters.

llvm-mc is still linking in the entire
target foo to get the code emitter stuff, but this is an
important step in the right direction.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81754 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-14 03:02:37 +00:00
Chris Lattner
c493fb2f4d Give MCInstPrinter a MCAsmInfo member, make X86ATTInstPrinter
be a MCInstPrinter.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81746 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-14 01:49:26 +00:00
Chris Lattner
f92c95f307 tidy up a bit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81744 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-14 01:34:40 +00:00
Chris Lattner
56d77c7022 add some special case handling for strangely named x86 registers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81726 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-13 22:41:48 +00:00
Chris Lattner
762ccea600 remove all but one reference to TargetRegisterDesc::AsmName.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81714 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-13 20:31:40 +00:00
Chris Lattner
d95148f073 the tblgen produced 'getRegisterName' method does not access
the object, make it static instead of const.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81711 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-13 20:19:22 +00:00
Chris Lattner
c510f4cb6e switch the x86 asmprinters to use getRegisterName instead
of getting it from TRI, inst printing now is codegen context
free!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81710 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-13 20:15:16 +00:00
Chris Lattner
05af2616d0 make tblgen produce a function that returns the name for a physreg.
Nothing is using this info yet.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81707 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-13 20:08:00 +00:00
Chris Lattner
a1cb09e4b9 make intel asmprinter use TRI::getAsmName instead of TRI::getName like
all the other targets.  Add support for weak/linkonce linkage so it doesn't
crash on basically all nontrivial testcases.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81704 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-13 19:44:38 +00:00
Chris Lattner
cae05cb324 split MCInst printing out of the X86ATTInstPrinter
class into its own X86ATTInstPrinter class.  The inst
printer now has just one dependence on the code generator
(TRI).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81703 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-13 19:30:11 +00:00
Chris Lattner
73d28f4aee reduce indentation with early exit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81699 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-13 19:10:08 +00:00
Chris Lattner
2055bb31a5 delete the fixme too! :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81689 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-13 18:50:22 +00:00
Chris Lattner
4c66f729c9 merge the linux cpool/jtbl pic tests into pic.ll and convert to filecheck.
Change the picbase symbol on non-darwin systems from ".Lllvm$4.$piclabel" to
".L4$pb".  The actual name doesn't matter and the darwin name is shorter.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81688 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-13 18:46:37 +00:00
Chris Lattner
09abd1ccfc make X86ATTAsmPrinter::PrintPICBaseSymbol forward to X86MCInstLower.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81685 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-13 18:33:59 +00:00
Chris Lattner
70a54c07a0 replace printBasicBlockLabel with EmitBasicBlockStart,
now that printBasicBlockLabel is only used for starting
a MBB.  This allows elimination of a bunch of arguments.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81684 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-13 18:25:37 +00:00
Chris Lattner
325d3dcfe4 convert some uses of printBasicBlockLabel to use GetMBBSymbol
instead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81677 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-13 17:14:04 +00:00
Chris Lattner
7cb384dcca devirtualize AsmPrinter::printBasicBlockLabel since it is never overridden.
Move GetMBBSymbol up to AsmPrinter and make printBasicBlockLabel use it so that
we only have one place that decides what to name bb labels.  Hopefully various
clients of printBasicBlockLabel can start using GetMBBSymbol instead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81652 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-12 23:02:08 +00:00
Chris Lattner
d8d2050637 factor MBB label lowering better
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81630 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-12 21:06:08 +00:00
Chris Lattner
e9434dbff4 X86MCInstLower::Lower should only not emit anything to OutStreamer,
this means that it can only lower one MachineInstr to one MCInst.  To
make this fly, we need to pull out handling of MO_GOT_ABSOLUTE_ADDRESS
(which generates an implicit label) out of X86MCInstLower.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81629 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-12 21:01:20 +00:00
Chris Lattner
b6a2fc080f eliminate the "MBBLabel" MCOperand type, and just use a MCSymbol for
MBB labels like everything else.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81628 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-12 20:45:03 +00:00
Chris Lattner
8fea32f9ff split MachineInstr -> MCInst lowering into its own class (not
being embedded into X86ATTAsmPrinter).  This still depends heavily
on X86ATTAsmPrinter, but this is a step in the right direction.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81627 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-12 20:34:57 +00:00
Chris Lattner
4e68a2a632 remove the "old" at&t style asmprinter. Unfortunately, most of the
operand printing crapola cannot be removed yet because it is used by
the inline asm print stuff.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81626 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-12 20:01:36 +00:00
Sean Callanan
2a46f3678e Added the WAIT instruction to the Intel tables,
for the purposes of the disassembler.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81603 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-12 02:52:41 +00:00
Sean Callanan
6f8f462ba5 Added CMPS (string comparison) instructions for all
operand widths to the Intel instruction tables, for
the purposes of the disassembler.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81601 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-12 02:25:20 +00:00
Chris Lattner
6b35bf187c fix another GCC bootstrap problem, which manifested as things
like:
foo.s:2412:non-relocatable subtraction expression, "_gomp_tls_key" minus "L1$pb"



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81596 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-12 01:11:50 +00:00
Chris Lattner
6f8e4dbfc4 fix an embarassing typo that resulted in llvm-gcc bootstrap miscompare
because the sorting wasn't sorting.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81592 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-12 00:49:00 +00:00
Sean Callanan
a82e4656b0 Added SCAS instructions in their 8, 16, 32, and
64-bit variants for the disassembler.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81591 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-12 00:37:19 +00:00
Ted Kremenek
4dbd074145 Update CMake files.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81577 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-11 21:49:45 +00:00
Sean Callanan
d00025a6c8 Added ADC, SUB, SBB, and OR instructions that operate
on rAX and an immediate.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81551 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-11 19:01:56 +00:00
Chris Lattner
24729e8e1b fix pasto
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81544 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-11 18:33:44 +00:00
Chris Lattner
f41116350a fix some fixmes: emit stubs in sorted order.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81541 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-11 18:20:26 +00:00
Chris Lattner
4f8fb4973d turn on -experimental-asm-printer for x86 / AT&T by default.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81532 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-11 17:07:27 +00:00
Chris Lattner
9e6ffba26b switch HiddenGVStubs to be a DenseMap instead of a string map, mirroring FnStubs and GVStubs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81514 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-11 07:03:20 +00:00
Chris Lattner
46091d70f5 Fix a bug I introduced in FnStubs generation, switch GVStubs to be a
densemap instead of StringMap to match FnStubs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81513 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-11 06:59:18 +00:00
Chris Lattner
2a3c20bf26 change FnStubs from being a StringMap<std::string> to being a much
more efficient SmallPtrSet<MCSymbol*>.  This eliminates string
craziness and fixes CodeGen/X86/darwin-quote.ll with the new asmprinter.

Codegen is producing stubs in a nondeterminstic order, but it was doing
this before anyway.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81511 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-11 06:36:33 +00:00
Chris Lattner
3e6bf2de16 printInstruction() no longer prints a \n after itself, do it
for the two instruction MOVPC32r sequence.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81509 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-11 05:59:55 +00:00
Chris Lattner
a49ea86ba2 reimplement X86ATTAsmPrinter::GetGlobalAddressSymbol in terms of
Mangler::getNameWithPrefix.  In addition to avoiding some over
quoting, this also is more efficient because it uses smallvector
instead of std::string thrashing.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81508 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-11 05:58:44 +00:00
Chris Lattner
a0602b4b14 convert X86ATTAsmPrinter::GetExternalSymbolSymbol to use SmallString
instead of std::string and Mangler.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81503 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-11 04:36:43 +00:00
Chris Lattner
cf1ed75f7f rearrange some code, export a SmallString version of DecorateCygMingName.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81502 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-11 04:28:13 +00:00
Evan Cheng
879caeadf3 Follow up to 81494. When the folded reload is narrowed to a 32-bit load then change the destination register to a 32-bit one or add a sub-register index.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81496 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-11 01:01:31 +00:00
Evan Cheng
9cef48eae9 It's not legal to fold a load from a narrower stack slot into a wider instruction. If done, the instruction does a 64-bit load and that's not
safe. This can happen we a subreg_to_reg 0 has been coalesced. One
exception is when the instruction that folds the load is a move, then we
can simply turn it into a 32-bit load from the stack slot.                                                                                                                    

rdar://7170444


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81494 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-11 00:39:26 +00:00
Kevin Enderby
9c656450d6 Added the ParseInstruction() hook for target specific assembler directives so
that things like .word can be parsed as target specific.  Moved parsing .word
out of AsmParser.cpp into X86AsmParser.cpp as it is 2 bytes on X86 and 4 bytes
for other targets that support the .word directive.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81461 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-10 20:51:44 +00:00
Sean Callanan
7893ec6494 Added XOR instructions for rAX and immediates of
various widths.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81458 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-10 19:52:26 +00:00
Sean Callanan
2f34a136b5 Added MOV instructions between rAX and memory offsets,
including segment offsets and (for 8-bit operands)
absolute offsets.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81457 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-10 18:33:42 +00:00