Index: lib/Target/AArch64/AArch64SVEInstrInfo.td =================================================================== --- lib/Target/AArch64/AArch64SVEInstrInfo.td +++ lib/Target/AArch64/AArch64SVEInstrInfo.td @@ -25,10 +25,10 @@ defm SQSUB_ZZZ : sve_int_bin_cons_arit_0<0b110, "sqsub">; defm UQSUB_ZZZ : sve_int_bin_cons_arit_0<0b111, "uqsub">; - def AND_ZZZ : sve_int_bin_cons_log<0b00, "and">; - def ORR_ZZZ : sve_int_bin_cons_log<0b01, "orr">; - def EOR_ZZZ : sve_int_bin_cons_log<0b10, "eor">; - def BIC_ZZZ : sve_int_bin_cons_log<0b11, "bic">; + defm AND_ZZZ : sve_int_bin_cons_log<0b00, "and">; + defm ORR_ZZZ : sve_int_bin_cons_log<0b01, "orr">; + defm EOR_ZZZ : sve_int_bin_cons_log<0b10, "eor">; + defm BIC_ZZZ : sve_int_bin_cons_log<0b11, "bic">; defm ADD_ZPmZ : sve_int_bin_pred_arit_0<0b000, "add">; defm SUB_ZPmZ : sve_int_bin_pred_arit_0<0b001, "sub">; Index: lib/Target/AArch64/SVEInstrFormats.td =================================================================== --- lib/Target/AArch64/SVEInstrFormats.td +++ lib/Target/AArch64/SVEInstrFormats.td @@ -1982,6 +1982,16 @@ let Inst{4-0} = Zd; } +multiclass sve_int_bin_cons_log opc, string asm> { + def NAME : sve_int_bin_cons_log; + + def : InstAlias(NAME) ZPR8:$Zd, ZPR8:$Zn, ZPR8:$Zm), 1>; + def : InstAlias(NAME) ZPR16:$Zd, ZPR16:$Zn, ZPR16:$Zm), 1>; + def : InstAlias(NAME) ZPR32:$Zd, ZPR32:$Zn, ZPR32:$Zm), 1>; +} //===----------------------------------------------------------------------===// // SVE Integer Wide Immediate - Predicated Group Index: test/MC/AArch64/SVE/and.s =================================================================== --- test/MC/AArch64/SVE/and.s +++ test/MC/AArch64/SVE/and.s @@ -111,6 +111,28 @@ // --------------------------------------------------------------------------// +// Test aliases. + +and z0.s, z0.s, z0.s +// CHECK-INST: and z0.d, z0.d, z0.d +// CHECK-ENCODING: [0x00,0x30,0x20,0x04] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: 00 30 20 04 + +and z0.h, z0.h, z0.h +// CHECK-INST: and z0.d, z0.d, z0.d +// CHECK-ENCODING: [0x00,0x30,0x20,0x04] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: 00 30 20 04 + +and z0.b, z0.b, z0.b +// CHECK-INST: and z0.d, z0.d, z0.d +// CHECK-ENCODING: [0x00,0x30,0x20,0x04] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: 00 30 20 04 + + +// --------------------------------------------------------------------------// // Test compatibility with MOVPRFX instruction. movprfx z4.d, p7/z, z6.d Index: test/MC/AArch64/SVE/bic.s =================================================================== --- test/MC/AArch64/SVE/bic.s +++ test/MC/AArch64/SVE/bic.s @@ -105,6 +105,28 @@ // --------------------------------------------------------------------------// +// Test aliases. + +bic z0.s, z0.s, z0.s +// CHECK-INST: bic z0.d, z0.d, z0.d +// CHECK-ENCODING: [0x00,0x30,0xe0,0x04] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: 00 30 e0 04 + +bic z0.h, z0.h, z0.h +// CHECK-INST: bic z0.d, z0.d, z0.d +// CHECK-ENCODING: [0x00,0x30,0xe0,0x04] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: 00 30 e0 04 + +bic z0.b, z0.b, z0.b +// CHECK-INST: bic z0.d, z0.d, z0.d +// CHECK-ENCODING: [0x00,0x30,0xe0,0x04] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: 00 30 e0 04 + + +// --------------------------------------------------------------------------// // Test compatibility with MOVPRFX instruction. movprfx z4.d, p7/z, z6.d Index: test/MC/AArch64/SVE/eor.s =================================================================== --- test/MC/AArch64/SVE/eor.s +++ test/MC/AArch64/SVE/eor.s @@ -111,6 +111,28 @@ // --------------------------------------------------------------------------// +// Test aliases. + +eor z0.s, z0.s, z0.s +// CHECK-INST: eor z0.d, z0.d, z0.d +// CHECK-ENCODING: [0x00,0x30,0xa0,0x04] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: 00 30 a0 04 + +eor z0.h, z0.h, z0.h +// CHECK-INST: eor z0.d, z0.d, z0.d +// CHECK-ENCODING: [0x00,0x30,0xa0,0x04] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: 00 30 a0 04 + +eor z0.b, z0.b, z0.b +// CHECK-INST: eor z0.d, z0.d, z0.d +// CHECK-ENCODING: [0x00,0x30,0xa0,0x04] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: 00 30 a0 04 + + +// --------------------------------------------------------------------------// // Test compatibility with MOVPRFX instruction. movprfx z4.b, p7/z, z6.b Index: test/MC/AArch64/SVE/orr.s =================================================================== --- test/MC/AArch64/SVE/orr.s +++ test/MC/AArch64/SVE/orr.s @@ -113,6 +113,46 @@ // --------------------------------------------------------------------------// +// Test aliases. + +orr z0.s, z0.s, z0.s +// CHECK-INST: mov z0.d, z0.d +// CHECK-ENCODING: [0x00,0x30,0x60,0x04] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: 00 30 60 04 + +orr z0.h, z0.h, z0.h +// CHECK-INST: mov z0.d, z0.d +// CHECK-ENCODING: [0x00,0x30,0x60,0x04] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: 00 30 60 04 + +orr z0.b, z0.b, z0.b +// CHECK-INST: mov z0.d, z0.d +// CHECK-ENCODING: [0x00,0x30,0x60,0x04] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: 00 30 60 04 + +orr z23.s, z13.s, z8.s // should not use mov-alias +// CHECK-INST: orr z23.d, z13.d, z8.d +// CHECK-ENCODING: [0xb7,0x31,0x68,0x04] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: b7 31 68 04 + +orr z23.h, z13.h, z8.h // should not use mov-alias +// CHECK-INST: orr z23.d, z13.d, z8.d +// CHECK-ENCODING: [0xb7,0x31,0x68,0x04] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: b7 31 68 04 + +orr z23.b, z13.b, z8.b // should not use mov-alias +// CHECK-INST: orr z23.d, z13.d, z8.d +// CHECK-ENCODING: [0xb7,0x31,0x68,0x04] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: b7 31 68 04 + + +// --------------------------------------------------------------------------// // Test compatibility with MOVPRFX instruction. movprfx z4.d, p7/z, z6.d