From: Jim Grosbach Date: Tue, 26 Jul 2011 21:44:37 +0000 (+0000) Subject: ARM rot_imm printing adjustment. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=45f3929ef0dcdf281a10f23e031ffaba7664e7c0;p=oota-llvm.git ARM rot_imm printing adjustment. Allow the rot_imm operand to be optional. This sets the stage for refactoring away the "rr" versions from the multiclasses and replacing them with Pat<>s. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136154 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/ARM/ARMInstrInfo.td b/lib/Target/ARM/ARMInstrInfo.td index 3b755933b3a..70c55e7d43f 100644 --- a/lib/Target/ARM/ARMInstrInfo.td +++ b/lib/Target/ARM/ARMInstrInfo.td @@ -999,7 +999,7 @@ multiclass AI_ext_rrot opcod, string opc, PatFrag opnode> { let Inst{3-0} = Rm; } def r_rot : AExtI, Requires<[IsARM, HasV6]> { bits<4> Rd; @@ -1021,7 +1021,7 @@ multiclass AI_ext_rrot_np opcod, string opc> { let Inst{11-10} = 0b00; } def r_rot : AExtI, Requires<[IsARM, HasV6]> { bits<2> rot; @@ -1048,7 +1048,7 @@ multiclass AI_exta_rrot opcod, string opc, PatFrag opnode> { } def rr_rot : AExtI, Requires<[IsARM, HasV6]> { @@ -1074,7 +1074,7 @@ multiclass AI_exta_rrot_np opcod, string opc> { } def rr_rot : AExtI, Requires<[IsARM, HasV6]> { bits<4> Rn; diff --git a/lib/Target/ARM/ARMInstrThumb2.td b/lib/Target/ARM/ARMInstrThumb2.td index bc9d878399f..eb0fd01abd5 100644 --- a/lib/Target/ARM/ARMInstrThumb2.td +++ b/lib/Target/ARM/ARMInstrThumb2.td @@ -990,7 +990,7 @@ multiclass T2I_ext_rrot opcod, string opc, PatFrag opnode> { let Inst{5-4} = 0b00; // rotate } def r_rot : T2TwoReg<(outs rGPR:$Rd), (ins rGPR:$Rm, rot_imm:$rot), IIC_iEXTr, - opc, ".w\t$Rd, $Rm, $rot", + opc, ".w\t$Rd, $Rm$rot", [(set rGPR:$Rd, (opnode (rotr rGPR:$Rm, rot_imm:$rot)))]> { let Inst{31-27} = 0b11111; let Inst{26-23} = 0b0100; @@ -1019,7 +1019,7 @@ multiclass T2I_ext_rrot_uxtb16 opcod, string opc, PatFrag opnode> { let Inst{5-4} = 0b00; // rotate } def r_rot : T2TwoReg<(outs rGPR:$dst), (ins rGPR:$Rm, rot_imm:$rot), - IIC_iEXTr, opc, "\t$dst, $Rm, $rot", + IIC_iEXTr, opc, "\t$dst, $Rm$rot", [(set rGPR:$dst, (opnode (rotr rGPR:$Rm, rot_imm:$rot)))]>, Requires<[HasT2ExtractPack, IsThumb2]> { let Inst{31-27} = 0b11111; @@ -1079,7 +1079,7 @@ multiclass T2I_exta_rrot opcod, string opc, PatFrag opnode> { } def rr_rot : T2ThreeReg<(outs rGPR:$Rd), (ins rGPR:$Rn, rGPR:$Rm, rot_imm:$rot), - IIC_iEXTAsr, opc, "\t$Rd, $Rn, $Rm, $rot", + IIC_iEXTAsr, opc, "\t$Rd, $Rn, $Rm$rot", [(set rGPR:$Rd, (opnode rGPR:$Rn, (rotr rGPR:$Rm, rot_imm:$rot)))]>, Requires<[HasT2ExtractPack, IsThumb2]> { @@ -1105,7 +1105,7 @@ multiclass T2I_exta_rrot_np opcod, string opc> { let Inst{5-4} = 0b00; // rotate } def rr_rot :T2ThreeReg<(outs rGPR:$Rd), (ins rGPR:$Rn, rGPR:$Rm,rot_imm:$rot), - IIC_iEXTAsr, opc, "\t$Rd, $Rn, $Rm, $rot", []> { + IIC_iEXTAsr, opc, "\t$Rd, $Rn, $Rm$rot", []> { let Inst{31-27} = 0b11111; let Inst{26-23} = 0b0100; let Inst{22-20} = opcod; diff --git a/lib/Target/ARM/InstPrinter/ARMInstPrinter.cpp b/lib/Target/ARM/InstPrinter/ARMInstPrinter.cpp index 30ec4981b74..fe8459e2a8b 100644 --- a/lib/Target/ARM/InstPrinter/ARMInstPrinter.cpp +++ b/lib/Target/ARM/InstPrinter/ARMInstPrinter.cpp @@ -841,7 +841,7 @@ void ARMInstPrinter::printRotImmOperand(const MCInst *MI, unsigned OpNum, unsigned Imm = MI->getOperand(OpNum).getImm(); if (Imm == 0) return; - O << "ror #"; + O << ", ror #"; switch (Imm) { default: assert (0 && "illegal ror immediate!"); case 1: O << "8\n"; break;