Index: llvm/trunk/lib/Target/AArch64/AArch64InstrFormats.td =================================================================== --- llvm/trunk/lib/Target/AArch64/AArch64InstrFormats.td +++ llvm/trunk/lib/Target/AArch64/AArch64InstrFormats.td @@ -1998,25 +1998,31 @@ //--- class BaseAddSubImm - : I<(outs dstRegtype:$Rd), (ins srcRegtype:$Rn, immtype:$imm), - asm, "\t$Rd, $Rn, $imm", "", - [(set dstRegtype:$Rd, (OpNode srcRegtype:$Rn, immtype:$imm))]>, - Sched<[WriteI, ReadI]> { + string asm_inst, string asm_ops, + dag inputs, dag pattern> + : I<(outs dstRegtype:$Rd), inputs, asm_inst, asm_ops, "", [pattern]>, + Sched<[WriteI, ReadI]> { bits<5> Rd; bits<5> Rn; - bits<14> imm; let Inst{30} = isSub; let Inst{29} = setFlags; let Inst{28-24} = 0b10001; - let Inst{23-22} = imm{13-12}; // '00' => lsl #0, '01' => lsl #12 - let Inst{21-10} = imm{11-0}; let Inst{9-5} = Rn; let Inst{4-0} = Rd; let DecoderMethod = "DecodeBaseAddSubImm"; } +class AddSubImmShift + : BaseAddSubImm { + bits<14> imm; + let Inst{23-22} = imm{13-12}; // '00' => lsl #0, '01' => lsl #12 + let Inst{21-10} = imm{11-0}; +} + class BaseAddSubRegPseudo : Pseudo<(outs regtype:$Rd), (ins regtype:$Rn, regtype:$Rm), @@ -2118,12 +2124,12 @@ // We used to match the register variant before the immediate when the // register argument could be implicitly zero-extended. let AddedComplexity = 6 in - def Wri : BaseAddSubImm { let Inst{31} = 0; } let AddedComplexity = 6 in - def Xri : BaseAddSubImm { let Inst{31} = 1; } @@ -2194,11 +2200,11 @@ string alias, string cmpAlias> { let isCompare = 1, Defs = [NZCV] in { // Add/Subtract immediate - def Wri : BaseAddSubImm { let Inst{31} = 0; } - def Xri : BaseAddSubImm { let Inst{31} = 1; }