Index: lib/Target/AArch64/AArch64InstrFormats.td =================================================================== --- lib/Target/AArch64/AArch64InstrFormats.td +++ lib/Target/AArch64/AArch64InstrFormats.td @@ -263,6 +263,14 @@ let PredicateMethod = "isSImm<" # width # ">"; } + +class AsmImmRange : AsmOperandClass { + let Name = "Imm" # Low # "_" # High; + let DiagnosticType = "InvalidImm" # Low # "_" # High; + let RenderMethod = "addImmOperands"; + let PredicateMethod = "isImmInRange<" # Low # "," # High # ">"; +} + // Authenticated loads for v8.3 can have scaled 10-bit immediate offsets. def SImm10s8Operand : SImmScaledMemoryIndexed<10, 8>; def simm10Scaled : Operand { @@ -287,6 +295,13 @@ let ParserMatchClass = UImm6Operand; } +def uimm16 : Operand, ImmLeaf{ + let ParserMatchClass = AsmImmRange<0, 65535>; + let PrintMethod = "printImm"; +} + def SImm9Operand : SImmOperand<9>; def simm9 : Operand, ImmLeaf= -256 && Imm < 256; }]> { let ParserMatchClass = SImm9Operand; @@ -447,13 +462,6 @@ let DecoderMethod = "DecodeSImm<4>"; } -class AsmImmRange : AsmOperandClass { - let Name = "Imm" # Low # "_" # High; - let DiagnosticType = "InvalidImm" # Low # "_" # High; - let RenderMethod = "addImmOperands"; - let PredicateMethod = "isImmInRange<" # Low # "," # High # ">"; -} - def Imm1_8Operand : AsmImmRange<1, 8>; def Imm1_16Operand : AsmImmRange<1, 16>; def Imm1_32Operand : AsmImmRange<1, 32>; @@ -708,11 +716,10 @@ } // imm0_65535 predicate - True if the immediate is in the range [0,65535]. -def Imm0_65535Operand : AsmImmRange<0, 65535>; def imm0_65535 : Operand, ImmLeaf { - let ParserMatchClass = Imm0_65535Operand; + let ParserMatchClass = AsmImmRange<0, 65535>; let PrintMethod = "printImmHex"; } @@ -1937,7 +1944,7 @@ //--- def movimm32_imm : Operand { - let ParserMatchClass = Imm0_65535Operand; + let ParserMatchClass = AsmImmRange<0, 65535>; let EncoderMethod = "getMoveWideImmOpValue"; let PrintMethod = "printImm"; } @@ -4082,6 +4089,19 @@ let Inst{1-0} = ll; } +//--- +// UDF : Permanently UNDEFINED instructions. Format: Opc = 0x0000, 16 bit imm. +//-- +let hasSideEffects = 1, isTrap = 1, mayLoad = 0, mayStore = 0 in { +class UDFType opc, string asm> + : I<(outs), (ins uimm16:$imm), + asm, "\t$imm", "", []>, + Sched<[]> { + bits<16> imm; + let Inst{31-16} = opc; + let Inst{15-0} = imm; +} +} let Predicates = [HasFPARMv8] in { //--- Index: lib/Target/AArch64/AArch64InstrInfo.td =================================================================== --- lib/Target/AArch64/AArch64InstrInfo.td +++ lib/Target/AArch64/AArch64InstrInfo.td @@ -1594,6 +1594,8 @@ def : InstAlias<"dcps2", (DCPS2 0)>; def : InstAlias<"dcps3", (DCPS3 0)>; +def UDF : UDFType<0, "udf">; + //===----------------------------------------------------------------------===// // Load instructions. //===----------------------------------------------------------------------===//