aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2007-09-26 01:29:06 +0000
committerEvan Cheng <evan.cheng@apple.com>2007-09-26 01:29:06 +0000
commit2f245ba57290140b5b9689495b1583a76d62c24e (patch)
tree2902af2d7d947e8534af6ec8499340ed98e8ef03
parent1a35edba13f35ef251e047e5654f35310239bf76 (diff)
downloadexternal_llvm-2f245ba57290140b5b9689495b1583a76d62c24e.zip
external_llvm-2f245ba57290140b5b9689495b1583a76d62c24e.tar.gz
external_llvm-2f245ba57290140b5b9689495b1583a76d62c24e.tar.bz2
Add pushf{d|q}, popf{d|q} to push and pop EFLAGS register.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42335 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Target/X86/X86InstrInfo.td11
-rw-r--r--lib/Target/X86/X86InstrX86-64.td5
2 files changed, 12 insertions, 4 deletions
diff --git a/lib/Target/X86/X86InstrInfo.td b/lib/Target/X86/X86InstrInfo.td
index bdce50a7..7bd997f 100644
--- a/lib/Target/X86/X86InstrInfo.td
+++ b/lib/Target/X86/X86InstrInfo.td
@@ -424,13 +424,16 @@ def LEAVE : I<0xC9, RawFrm,
(outs), (ins), "leave", []>;
let Defs = [ESP], Uses = [ESP] in {
-def POP32r : I<0x58, AddRegFrm,
- (outs GR32:$reg), (ins), "pop{l}\t$reg", []>;
+def POP32r : I<0x58, AddRegFrm, (outs GR32:$reg), (ins), "pop{l}\t$reg", []>;
-def PUSH32r : I<0x50, AddRegFrm,
- (outs), (ins GR32:$reg), "push{l}\t$reg", []>;
+def PUSH32r : I<0x50, AddRegFrm, (outs), (ins GR32:$reg), "push{l}\t$reg",[]>;
}
+let Defs = [ESP, EFLAGS], Uses = [ESP] in
+def POPD : I<0x9D, RawFrm, (outs), (ins), "popfd", []>;
+let Defs = [ESP], Uses = [ESP, EFLAGS] in
+def PUSHFD : I<0x9C, RawFrm, (outs), (ins), "pushfd", []>;
+
def MovePCtoStack : I<0, Pseudo, (outs), (ins piclabel:$label),
"call\t$label", []>;
diff --git a/lib/Target/X86/X86InstrX86-64.td b/lib/Target/X86/X86InstrX86-64.td
index bba75f5..92965d3 100644
--- a/lib/Target/X86/X86InstrX86-64.td
+++ b/lib/Target/X86/X86InstrX86-64.td
@@ -123,6 +123,11 @@ def PUSH64r : I<0x50, AddRegFrm,
(outs), (ins GR64:$reg), "push{q}\t$reg", []>;
}
+let Defs = [RSP, EFLAGS], Uses = [RSP] in
+def POPQ : I<0x9D, RawFrm, (outs), (ins), "popfq", []>, REX_W;
+let Defs = [RSP], Uses = [RSP, EFLAGS] in
+def PUSHFQ : I<0x9C, RawFrm, (outs), (ins), "pushfq", []>;
+
def LEA64_32r : I<0x8D, MRMSrcMem,
(outs GR32:$dst), (ins lea64_32mem:$src),
"lea{l}\t{$src|$dst}, {$dst|$src}",