mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-19 06:31:18 +00:00
Add support for the x86 instructions "pusha" and "popa".
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106671 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
81cd7ffe45
commit
50b9efc2a8
@ -820,6 +820,17 @@ def PUSHF32 : I<0x9C, RawFrm, (outs), (ins), "pushf{l|d}", []>,
|
|||||||
Requires<[In32BitMode]>;
|
Requires<[In32BitMode]>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let Defs = [EDI, ESI, EBP, EBX, EDX, ECX, EAX, ESP], Uses = [ESP],
|
||||||
|
mayLoad=1, neverHasSideEffects=1 in {
|
||||||
|
def POPA32 : I<0x61, RawFrm, (outs), (ins), "popa{l}", []>,
|
||||||
|
Requires<[In32BitMode]>;
|
||||||
|
}
|
||||||
|
let Defs = [ESP], Uses = [EDI, ESI, EBP, EBX, EDX, ECX, EAX, ESP],
|
||||||
|
mayStore=1, neverHasSideEffects=1 in {
|
||||||
|
def PUSHA32 : I<0x60, RawFrm, (outs), (ins), "pusha{l}", []>,
|
||||||
|
Requires<[In32BitMode]>;
|
||||||
|
}
|
||||||
|
|
||||||
let Uses = [EFLAGS], Constraints = "$src = $dst" in // GR32 = bswap GR32
|
let Uses = [EFLAGS], Constraints = "$src = $dst" in // GR32 = bswap GR32
|
||||||
def BSWAP32r : I<0xC8, AddRegFrm,
|
def BSWAP32r : I<0xC8, AddRegFrm,
|
||||||
(outs GR32:$dst), (ins GR32:$src),
|
(outs GR32:$dst), (ins GR32:$src),
|
||||||
|
@ -398,3 +398,20 @@ retl
|
|||||||
// CHECK: [0x65,0x8b,0x05,0x7c,0x00,0x00,0x00]
|
// CHECK: [0x65,0x8b,0x05,0x7c,0x00,0x00,0x00]
|
||||||
// FIXME: This is a correct bug poor encoding: Use 65 a1 7c 00 00 00
|
// FIXME: This is a correct bug poor encoding: Use 65 a1 7c 00 00 00
|
||||||
movl %gs:124, %eax
|
movl %gs:124, %eax
|
||||||
|
|
||||||
|
// CHECK: pusha
|
||||||
|
// CHECK: encoding: [0x60]
|
||||||
|
pusha
|
||||||
|
|
||||||
|
// CHECK: popa
|
||||||
|
// CHECK: encoding: [0x61]
|
||||||
|
popa
|
||||||
|
|
||||||
|
// CHECK: pushal
|
||||||
|
// CHECK: encoding: [0x60]
|
||||||
|
pushal
|
||||||
|
|
||||||
|
// CHECK: popal
|
||||||
|
// CHECK: encoding: [0x61]
|
||||||
|
popal
|
||||||
|
|
||||||
|
@ -500,6 +500,8 @@ static void X86ExtractSemantics(
|
|||||||
// TODO add support for fixed operands
|
// TODO add support for fixed operands
|
||||||
} else if (name.find("F") != name.npos) {
|
} else if (name.find("F") != name.npos) {
|
||||||
// ignore (this pushes onto the FP stack)
|
// ignore (this pushes onto the FP stack)
|
||||||
|
} else if (name.find("A") != name.npos) {
|
||||||
|
// ignore (pushes all GP registoers onto the stack)
|
||||||
} else if (name[name.length() - 1] == 'm') {
|
} else if (name[name.length() - 1] == 'm') {
|
||||||
PUSH("src");
|
PUSH("src");
|
||||||
} else if (name.find("i") != name.npos) {
|
} else if (name.find("i") != name.npos) {
|
||||||
@ -518,6 +520,8 @@ static void X86ExtractSemantics(
|
|||||||
// TODO add support for fixed operands
|
// TODO add support for fixed operands
|
||||||
} else if (name.find("F") != name.npos) {
|
} else if (name.find("F") != name.npos) {
|
||||||
// ignore (this pops from the FP stack)
|
// ignore (this pops from the FP stack)
|
||||||
|
} else if (name.find("A") != name.npos) {
|
||||||
|
// ignore (pushes all GP registoers onto the stack)
|
||||||
} else if (name[name.length() - 1] == 'm') {
|
} else if (name[name.length() - 1] == 'm') {
|
||||||
POP("dst");
|
POP("dst");
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user