[ARM64] Change SYS without a register to an alias to make disassembling more consistant.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205898 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Bradley Smith 2014-04-09 14:44:58 +00:00
parent 62293d1147
commit 35fb92dadd
4 changed files with 12 additions and 22 deletions

View File

@ -774,22 +774,6 @@ def sys_cr_op : Operand<i32> {
let ParserMatchClass = SysCRAsmOperand;
}
class SystemI<bit L, string asm>
: SimpleSystemI<L,
(ins imm0_7:$op1, sys_cr_op:$Cn, sys_cr_op:$Cm, imm0_7:$op2),
asm, "\t$op1, $Cn, $Cm, $op2">,
Sched<[WriteSys]> {
bits<3> op1;
bits<4> Cn;
bits<4> Cm;
bits<3> op2;
let Inst{20-19} = 0b01;
let Inst{18-16} = op1;
let Inst{15-12} = Cn;
let Inst{11-8} = Cm;
let Inst{7-5} = op2;
}
class SystemXtI<bit L, string asm>
: RtSystemI<L, (outs),
(ins imm0_7:$op1, sys_cr_op:$Cn, sys_cr_op:$Cm, imm0_7:$op2, GPR64:$Rt),

View File

@ -332,10 +332,13 @@ def MSRcpsr: MSRcpsrI;
def : Pat<(ARM64threadpointer), (MRS 0xde82)>;
// Generic system instructions
def SYS : SystemI<0, "sys">;
def SYSxt : SystemXtI<0, "sys">;
def SYSLxt : SystemLXtI<1, "sysl">;
def : InstAlias<"sys $op1, $Cn, $Cm, $op2",
(SYSxt imm0_7:$op1, sys_cr_op:$Cn,
sys_cr_op:$Cm, imm0_7:$op2, XZR)>;
//===----------------------------------------------------------------------===//
// Move immediate instructions.
//===----------------------------------------------------------------------===//

View File

@ -56,7 +56,7 @@ void ARM64InstPrinter::printInst(const MCInst *MI, raw_ostream &O,
unsigned Opcode = MI->getOpcode();
if (Opcode == ARM64::SYS || Opcode == ARM64::SYSxt)
if (Opcode == ARM64::SYSxt)
if (printSysAlias(MI, O)) {
printAnnotation(O, Annot);
return;
@ -750,8 +750,7 @@ void ARM64AppleInstPrinter::printInst(const MCInst *MI, raw_ostream &O,
bool ARM64InstPrinter::printSysAlias(const MCInst *MI, raw_ostream &O) {
#ifndef NDEBUG
unsigned Opcode = MI->getOpcode();
assert((Opcode == ARM64::SYS || Opcode == ARM64::SYSxt) &&
"Invalid opcode for SYS alias!");
assert(Opcode == ARM64::SYSxt && "Invalid opcode for SYS alias!");
#endif
const char *Asm = 0;
@ -961,9 +960,11 @@ bool ARM64InstPrinter::printSysAlias(const MCInst *MI, raw_ostream &O) {
}
if (Asm) {
unsigned Reg = MI->getOperand(4).getReg();
O << '\t' << Asm;
if (MI->getNumOperands() == 5)
O << ", " << getRegisterName(MI->getOperand(4).getReg());
if (StringRef(Asm).lower().find("all") == StringRef::npos)
O << ", " << getRegisterName(Reg);
}
return Asm != 0;

View File

@ -32,6 +32,8 @@
# CHECK: dmb osh
0x9f 0x37 0x03 0xd5
# CHECK: dsb nsh
0x3f 0x76 0x08 0xd5
# CHECK: dc ivac
#-----------------------------------------------------------------------------
# Generic system instructions