Fix JIT code emission of X86::MovePCtoStack.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45307 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Evan Cheng 2007-12-22 02:26:46 +00:00
parent 01666bf74b
commit f02ca69951
2 changed files with 7 additions and 5 deletions

View File

@ -994,7 +994,9 @@ SDNode *X86DAGToDAGISel::getGlobalBaseReg() {
unsigned PC = RegMap->createVirtualRegister(X86::GR32RegisterClass);
const TargetInstrInfo *TII = TM.getInstrInfo();
BuildMI(FirstMBB, MBBI, TII->get(X86::MovePCtoStack));
// Operand of MovePCtoStack is completely ignored by asm printer. It's
// only used in JIT code emission as displacement to pc.
BuildMI(FirstMBB, MBBI, TII->get(X86::MovePCtoStack)).addImm(0);
BuildMI(FirstMBB, MBBI, TII->get(X86::POP32r), PC);
// If we're using vanilla 'GOT' PIC style, we should use relative addressing

View File

@ -356,8 +356,8 @@ let isCall = 1 in
let Defs = [EAX, ECX, EDX, FP0, FP1, FP2, FP3, FP4, FP5, FP6, ST0,
MM0, MM1, MM2, MM3, MM4, MM5, MM6, MM7,
XMM0, XMM1, XMM2, XMM3, XMM4, XMM5, XMM6, XMM7, EFLAGS] in {
def CALLpcrel32 : I<0xE8, RawFrm, (outs), (ins i32imm:$dst, variable_ops),
"call\t${dst:call}", []>;
def CALLpcrel32 : Ii32<0xE8, RawFrm, (outs), (ins i32imm:$dst,variable_ops),
"call\t${dst:call}", []>;
def CALL32r : I<0xFF, MRM2r, (outs), (ins GR32:$dst, variable_ops),
"call\t{*}$dst", [(X86call GR32:$dst)]>;
def CALL32m : I<0xFF, MRM2m, (outs), (ins i32mem:$dst, variable_ops),
@ -408,8 +408,8 @@ def POPFD : I<0x9D, RawFrm, (outs), (ins), "popf", []>;
let Defs = [ESP], Uses = [ESP, EFLAGS] in
def PUSHFD : I<0x9C, RawFrm, (outs), (ins), "pushf", []>;
def MovePCtoStack : I<0, Pseudo, (outs), (ins piclabel:$label),
"call\t$label", []>;
def MovePCtoStack : Ii32<0xE8, RawFrm, (outs), (ins piclabel:$label),
"call\t$label", []>;
let isTwoAddress = 1 in // GR32 = bswap GR32
def BSWAP32r : I<0xC8, AddRegFrm,