diff options
Diffstat (limited to 'llvm/lib/Target/ARM64')
-rw-r--r-- | llvm/lib/Target/ARM64/ARM64InstrFormats.td | 16 | ||||
-rw-r--r-- | llvm/lib/Target/ARM64/ARM64InstrInfo.td | 5 | ||||
-rw-r--r-- | llvm/lib/Target/ARM64/InstPrinter/ARM64InstPrinter.cpp | 11 |
3 files changed, 10 insertions, 22 deletions
diff --git a/llvm/lib/Target/ARM64/ARM64InstrFormats.td b/llvm/lib/Target/ARM64/ARM64InstrFormats.td index 378b698909e..ee824193716 100644 --- a/llvm/lib/Target/ARM64/ARM64InstrFormats.td +++ b/llvm/lib/Target/ARM64/ARM64InstrFormats.td @@ -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), diff --git a/llvm/lib/Target/ARM64/ARM64InstrInfo.td b/llvm/lib/Target/ARM64/ARM64InstrInfo.td index b3baf94d410..7d319dd61eb 100644 --- a/llvm/lib/Target/ARM64/ARM64InstrInfo.td +++ b/llvm/lib/Target/ARM64/ARM64InstrInfo.td @@ -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. //===----------------------------------------------------------------------===// diff --git a/llvm/lib/Target/ARM64/InstPrinter/ARM64InstPrinter.cpp b/llvm/lib/Target/ARM64/InstPrinter/ARM64InstPrinter.cpp index 82beb6bbebd..8c0e6fa9179 100644 --- a/llvm/lib/Target/ARM64/InstPrinter/ARM64InstPrinter.cpp +++ b/llvm/lib/Target/ARM64/InstPrinter/ARM64InstPrinter.cpp @@ -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; |