Index: llvm/trunk/lib/Target/AArch64/AArch64InstrInfo.td =================================================================== --- llvm/trunk/lib/Target/AArch64/AArch64InstrInfo.td +++ llvm/trunk/lib/Target/AArch64/AArch64InstrInfo.td @@ -516,31 +516,34 @@ defm FCMLA : SIMDIndexedTiedComplexHSD<1, 0, 1, complexrotateop, "fcmla", null_frag>; -let Predicates = [HasV8_3a] in { - // v8.3a Pointer Authentication - let Uses = [LR], Defs = [LR] in { - def PACIAZ : SystemNoOperands<0b000, "paciaz">; - def PACIBZ : SystemNoOperands<0b010, "pacibz">; - def AUTIAZ : SystemNoOperands<0b100, "autiaz">; - def AUTIBZ : SystemNoOperands<0b110, "autibz">; - } - let Uses = [LR, SP], Defs = [LR] in { - def PACIASP : SystemNoOperands<0b001, "paciasp">; - def PACIBSP : SystemNoOperands<0b011, "pacibsp">; - def AUTIASP : SystemNoOperands<0b101, "autiasp">; - def AUTIBSP : SystemNoOperands<0b111, "autibsp">; - } - let Uses = [X16, X17], Defs = [X17], CRm = 0b0001 in { - def PACIA1716 : SystemNoOperands<0b000, "pacia1716">; - def PACIB1716 : SystemNoOperands<0b010, "pacib1716">; - def AUTIA1716 : SystemNoOperands<0b100, "autia1716">; - def AUTIB1716 : SystemNoOperands<0b110, "autib1716">; - } +// v8.3a Pointer Authentication +// These instructions inhabit part of the hint space and so can be used for +// armv8 targets +let Uses = [LR], Defs = [LR] in { + def PACIAZ : SystemNoOperands<0b000, "paciaz">; + def PACIBZ : SystemNoOperands<0b010, "pacibz">; + def AUTIAZ : SystemNoOperands<0b100, "autiaz">; + def AUTIBZ : SystemNoOperands<0b110, "autibz">; +} +let Uses = [LR, SP], Defs = [LR] in { + def PACIASP : SystemNoOperands<0b001, "paciasp">; + def PACIBSP : SystemNoOperands<0b011, "pacibsp">; + def AUTIASP : SystemNoOperands<0b101, "autiasp">; + def AUTIBSP : SystemNoOperands<0b111, "autibsp">; +} +let Uses = [X16, X17], Defs = [X17], CRm = 0b0001 in { + def PACIA1716 : SystemNoOperands<0b000, "pacia1716">; + def PACIB1716 : SystemNoOperands<0b010, "pacib1716">; + def AUTIA1716 : SystemNoOperands<0b100, "autia1716">; + def AUTIB1716 : SystemNoOperands<0b110, "autib1716">; +} - let Uses = [LR], Defs = [LR], CRm = 0b0000 in { - def XPACLRI : SystemNoOperands<0b111, "xpaclri">; - } +let Uses = [LR], Defs = [LR], CRm = 0b0000 in { + def XPACLRI : SystemNoOperands<0b111, "xpaclri">; +} +// These pointer authentication isntructions require armv8.3a +let Predicates = [HasV8_3a] in { multiclass SignAuth prefix, bits<3> prefix_z, string asm> { def IA : SignAuthOneData; def IB : SignAuthOneData; @@ -570,7 +573,7 @@ def BLRAAZ : AuthOneOperand<0b001, 0, "blraaz">; def BLRABZ : AuthOneOperand<0b001, 1, "blrabz">; - let isReturn = 1 in { + let isReturn = 1, isTerminator = 1, isBarrier = 1 in { def RETAA : AuthReturn<0b010, 0, "retaa">; def RETAB : AuthReturn<0b010, 1, "retab">; def ERETAA : AuthReturn<0b100, 0, "eretaa">; Index: llvm/trunk/test/MC/AArch64/armv8.3a-signed-pointer.s =================================================================== --- llvm/trunk/test/MC/AArch64/armv8.3a-signed-pointer.s +++ llvm/trunk/test/MC/AArch64/armv8.3a-signed-pointer.s @@ -70,43 +70,43 @@ paciasp // CHECK: paciasp // encoding: [0x3f,0x23,0x03,0xd5] -// CHECK-REQ: error: instruction requires: armv8.3a +// CHECK-REQ-NOT: error: instruction requires: armv8.3a autiasp // CHECK: autiasp // encoding: [0xbf,0x23,0x03,0xd5] -// CHECK-REQ: error: instruction requires: armv8.3a +// CHECK-REQ-NOT: error: instruction requires: armv8.3a paciaz // CHECK: paciaz // encoding: [0x1f,0x23,0x03,0xd5] -// CHECK-REQ: error: instruction requires: armv8.3a +// CHECK-REQ-NOT: error: instruction requires: armv8.3a autiaz // CHECK: autiaz // encoding: [0x9f,0x23,0x03,0xd5] -// CHECK-REQ: error: instruction requires: armv8.3a +// CHECK-REQ-NOT: error: instruction requires: armv8.3a pacia1716 // CHECK: pacia1716 // encoding: [0x1f,0x21,0x03,0xd5] -// CHECK-REQ: error: instruction requires: armv8.3a +// CHECK-REQ-NOT: error: instruction requires: armv8.3a autia1716 // CHECK: autia1716 // encoding: [0x9f,0x21,0x03,0xd5] -// CHECK-REQ: error: instruction requires: armv8.3a +// CHECK-REQ-NOT: error: instruction requires: armv8.3a pacibsp // CHECK: pacibsp // encoding: [0x7f,0x23,0x03,0xd5] -// CHECK-REQ: error: instruction requires: armv8.3a +// CHECK-REQ-NOT: error: instruction requires: armv8.3a autibsp // CHECK: autibsp // encoding: [0xff,0x23,0x03,0xd5] -// CHECK-REQ: error: instruction requires: armv8.3a +// CHECK-REQ-NOT: error: instruction requires: armv8.3a pacibz // CHECK: pacibz // encoding: [0x5f,0x23,0x03,0xd5] -// CHECK-REQ: error: instruction requires: armv8.3a +// CHECK-REQ-NOT: error: instruction requires: armv8.3a autibz // CHECK: autibz // encoding: [0xdf,0x23,0x03,0xd5] -// CHECK-REQ: error: instruction requires: armv8.3a +// CHECK-REQ-NOT: error: instruction requires: armv8.3a pacib1716 // CHECK: pacib1716 // encoding: [0x5f,0x21,0x03,0xd5] -// CHECK-REQ: error: instruction requires: armv8.3a +// CHECK-REQ-NOT: error: instruction requires: armv8.3a autib1716 // CHECK: autib1716 // encoding: [0xdf,0x21,0x03,0xd5] -// CHECK-REQ: error: instruction requires: armv8.3a +// CHECK-REQ-NOT: error: instruction requires: armv8.3a xpaclri // CHECK: xpaclri // encoding: [0xff,0x20,0x03,0xd5] -// CHECK-REQ: error: instruction requires: armv8.3a +// CHECK-REQ-NOT: error: instruction requires: armv8.3a pacia x0, x1 // CHECK: pacia x0, x1 // encoding: [0x20,0x00,0xc1,0xda]