mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-07-01 14:30:17 +00:00
lcall and ljmp always default to lcalll and ljmpl. This finally
wraps up r8418316 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113949 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
cbb442640f
commit
d0bcc9a015
|
@ -979,16 +979,6 @@ ParseInstruction(StringRef Name, SMLoc NameLoc,
|
||||||
NameLoc, NameLoc));
|
NameLoc, NameLoc));
|
||||||
}
|
}
|
||||||
|
|
||||||
// lcall *x and ljmp *x -> lcalll and ljmpl
|
|
||||||
if ((Name == "lcall" || Name == "ljmp") &&
|
|
||||||
Operands.size() == 3 &&
|
|
||||||
static_cast<X86Operand*>(Operands[1])->isToken() &&
|
|
||||||
static_cast<X86Operand*>(Operands[1])->getToken() == "*") {
|
|
||||||
delete Operands[0];
|
|
||||||
Operands[0] = X86Operand::CreateToken(Name == "lcall" ? "lcalll" : "ljmpl",
|
|
||||||
NameLoc);
|
|
||||||
}
|
|
||||||
|
|
||||||
// jmp $42,$5 -> ljmp, similarly for call.
|
// jmp $42,$5 -> ljmp, similarly for call.
|
||||||
if ((Name.startswith("call") || Name.startswith("jmp")) &&
|
if ((Name.startswith("call") || Name.startswith("jmp")) &&
|
||||||
Operands.size() == 3 &&
|
Operands.size() == 3 &&
|
||||||
|
@ -1007,9 +997,17 @@ ParseInstruction(StringRef Name, SMLoc NameLoc,
|
||||||
if (NewOpName) {
|
if (NewOpName) {
|
||||||
delete Operands[0];
|
delete Operands[0];
|
||||||
Operands[0] = X86Operand::CreateToken(NewOpName, NameLoc);
|
Operands[0] = X86Operand::CreateToken(NewOpName, NameLoc);
|
||||||
|
Name = NewOpName;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// lcall and ljmp -> lcalll and ljmpl
|
||||||
|
if ((Name == "lcall" || Name == "ljmp") && Operands.size() == 3) {
|
||||||
|
delete Operands[0];
|
||||||
|
Operands[0] = X86Operand::CreateToken(Name == "lcall" ? "lcalll" : "ljmpl",
|
||||||
|
NameLoc);
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -551,4 +551,14 @@ lcalll $0x7ace,$0x7ace
|
||||||
jmpl $0x7ace,$0x7ace
|
jmpl $0x7ace,$0x7ace
|
||||||
ljmpl $0x7ace,$0x7ace
|
ljmpl $0x7ace,$0x7ace
|
||||||
|
|
||||||
|
// CHECK: lcalll $31438, $31438
|
||||||
|
// CHECK: lcalll $31438, $31438
|
||||||
|
// CHECK: ljmpl $31438, $31438
|
||||||
|
// CHECK: ljmpl $31438, $31438
|
||||||
|
|
||||||
|
call $0x7ace,$0x7ace
|
||||||
|
lcall $0x7ace,$0x7ace
|
||||||
|
jmp $0x7ace,$0x7ace
|
||||||
|
ljmp $0x7ace,$0x7ace
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user