From: Cullen Rhodes Date: Mon, 20 May 2019 10:29:48 +0000 (+0000) Subject: [AArch64][SVE2] Asm: add saturating multiply-add interleaved long instructions X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=72cc54d9de1af4dcdf90bee898bb013a1d5f81ab;p=llvm [AArch64][SVE2] Asm: add saturating multiply-add interleaved long instructions Summary: Patch adds support for SQDMLALBT and SQDMLSLBT instructions. The specification can be found here: https://developer.arm.com/docs/ddi0602/latest Reviewed By: rovka Differential Revision: https://reviews.llvm.org/D61998 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@361135 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/AArch64/AArch64SVEInstrInfo.td b/lib/Target/AArch64/AArch64SVEInstrInfo.td index 5c0845cf7fd..03f6419bff9 100644 --- a/lib/Target/AArch64/AArch64SVEInstrInfo.td +++ b/lib/Target/AArch64/AArch64SVEInstrInfo.td @@ -1109,6 +1109,10 @@ let Predicates = [HasSVE2] in { defm SQDMLSLB_ZZZ : sve2_int_mla_long<0b11010, "sqdmlslb">; defm SQDMLSLT_ZZZ : sve2_int_mla_long<0b11011, "sqdmlslt">; + // SVE2 saturating multiply-add interleaved long + defm SQDMLALBT_ZZZ : sve2_int_mla_long<0b00010, "sqdmlalbt">; + defm SQDMLSLBT_ZZZ : sve2_int_mla_long<0b00011, "sqdmlslbt">; + // SVE2 integer multiply long defm SQDMULLB_ZZZ : sve2_wide_int_arith_long<0b11000, "sqdmullb">; defm SQDMULLT_ZZZ : sve2_wide_int_arith_long<0b11001, "sqdmullt">; diff --git a/test/MC/AArch64/SVE2/sqdmlalbt-diagnostics.s b/test/MC/AArch64/SVE2/sqdmlalbt-diagnostics.s new file mode 100644 index 00000000000..d977de5d7e2 --- /dev/null +++ b/test/MC/AArch64/SVE2/sqdmlalbt-diagnostics.s @@ -0,0 +1,34 @@ +// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2 2>&1 < %s| FileCheck %s + + +// ------------------------------------------------------------------------- // +// Invalid element width + +sqdmlalbt z0.b, z1.b, z2.b +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: sqdmlalbt z0.b, z1.b, z2.b +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +sqdmlalbt z0.h, z1.h, z2.h +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: sqdmlalbt z0.h, z1.h, z2.h +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +sqdmlalbt z0.s, z1.s, z2.s +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: sqdmlalbt z0.s, z1.s, z2.s +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +sqdmlalbt z0.d, z1.d, z2.d +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: sqdmlalbt z0.d, z1.d, z2.d +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +// --------------------------------------------------------------------------// +// Negative tests for instructions that are incompatible with movprfx + +movprfx z0.d, p0/z, z7.d +sqdmlalbt z0.d, z1.s, z15.s +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a predicated movprfx, suggest using unpredicated movprfx +// CHECK-NEXT: sqdmlalbt z0.d, z1.s, z15.s +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: diff --git a/test/MC/AArch64/SVE2/sqdmlalbt.s b/test/MC/AArch64/SVE2/sqdmlalbt.s new file mode 100644 index 00000000000..014c6aa1392 --- /dev/null +++ b/test/MC/AArch64/SVE2/sqdmlalbt.s @@ -0,0 +1,42 @@ +// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2 < %s \ +// RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST +// RUN: not llvm-mc -triple=aarch64 -show-encoding < %s 2>&1 \ +// RUN: | FileCheck %s --check-prefix=CHECK-ERROR +// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve2 < %s \ +// RUN: | llvm-objdump -d -mattr=+sve2 - | FileCheck %s --check-prefix=CHECK-INST +// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve2 < %s \ +// RUN: | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-UNKNOWN + + +sqdmlalbt z0.h, z1.b, z31.b +// CHECK-INST: sqdmlalbt z0.h, z1.b, z31.b +// CHECK-ENCODING: [0x20,0x08,0x5f,0x44] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: 20 08 5f 44 + +sqdmlalbt z0.s, z1.h, z31.h +// CHECK-INST: sqdmlalbt z0.s, z1.h, z31.h +// CHECK-ENCODING: [0x20,0x08,0x9f,0x44] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: 20 08 9f 44 + +sqdmlalbt z0.d, z1.s, z31.s +// CHECK-INST: sqdmlalbt z0.d, z1.s, z31.s +// CHECK-ENCODING: [0x20,0x08,0xdf,0x44] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: 20 08 df 44 + +// --------------------------------------------------------------------------// +// Test compatibility with MOVPRFX instruction. + +movprfx z21, z28 +// CHECK-INST: movprfx z21, z28 +// CHECK-ENCODING: [0x95,0xbf,0x20,0x04] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: 95 bf 20 04 + +sqdmlalbt z21.d, z1.s, z31.s +// CHECK-INST: sqdmlalbt z21.d, z1.s, z31.s +// CHECK-ENCODING: [0x35,0x08,0xdf,0x44] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: 35 08 df 44 diff --git a/test/MC/AArch64/SVE2/sqdmlslbt-diagnostics.s b/test/MC/AArch64/SVE2/sqdmlslbt-diagnostics.s new file mode 100644 index 00000000000..e428b1b604f --- /dev/null +++ b/test/MC/AArch64/SVE2/sqdmlslbt-diagnostics.s @@ -0,0 +1,34 @@ +// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2 2>&1 < %s| FileCheck %s + + +// ------------------------------------------------------------------------- // +// Invalid element width + +sqdmlslbt z0.b, z1.b, z2.b +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: sqdmlslbt z0.b, z1.b, z2.b +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +sqdmlslbt z0.h, z1.h, z2.h +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: sqdmlslbt z0.h, z1.h, z2.h +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +sqdmlslbt z0.s, z1.s, z2.s +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: sqdmlslbt z0.s, z1.s, z2.s +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +sqdmlslbt z0.d, z1.d, z2.d +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width +// CHECK-NEXT: sqdmlslbt z0.d, z1.d, z2.d +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +// --------------------------------------------------------------------------// +// Negative tests for instructions that are incompatible with movprfx + +movprfx z0.d, p0/z, z7.d +sqdmlslbt z0.d, z1.s, z15.s +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a predicated movprfx, suggest using unpredicated movprfx +// CHECK-NEXT: sqdmlslbt z0.d, z1.s, z15.s +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: diff --git a/test/MC/AArch64/SVE2/sqdmlslbt.s b/test/MC/AArch64/SVE2/sqdmlslbt.s new file mode 100644 index 00000000000..fea1f868f1e --- /dev/null +++ b/test/MC/AArch64/SVE2/sqdmlslbt.s @@ -0,0 +1,42 @@ +// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2 < %s \ +// RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST +// RUN: not llvm-mc -triple=aarch64 -show-encoding < %s 2>&1 \ +// RUN: | FileCheck %s --check-prefix=CHECK-ERROR +// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve2 < %s \ +// RUN: | llvm-objdump -d -mattr=+sve2 - | FileCheck %s --check-prefix=CHECK-INST +// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve2 < %s \ +// RUN: | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-UNKNOWN + + +sqdmlslbt z0.h, z1.b, z31.b +// CHECK-INST: sqdmlslbt z0.h, z1.b, z31.b +// CHECK-ENCODING: [0x20,0x0c,0x5f,0x44] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: 20 0c 5f 44 + +sqdmlslbt z0.s, z1.h, z31.h +// CHECK-INST: sqdmlslbt z0.s, z1.h, z31.h +// CHECK-ENCODING: [0x20,0x0c,0x9f,0x44] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: 20 0c 9f 44 + +sqdmlslbt z0.d, z1.s, z31.s +// CHECK-INST: sqdmlslbt z0.d, z1.s, z31.s +// CHECK-ENCODING: [0x20,0x0c,0xdf,0x44] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: 20 0c df 44 + +// --------------------------------------------------------------------------// +// Test compatibility with MOVPRFX instruction. + +movprfx z21, z28 +// CHECK-INST: movprfx z21, z28 +// CHECK-ENCODING: [0x95,0xbf,0x20,0x04] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: 95 bf 20 04 + +sqdmlslbt z21.d, z1.s, z31.s +// CHECK-INST: sqdmlslbt z21.d, z1.s, z31.s +// CHECK-ENCODING: [0x35,0x0c,0xdf,0x44] +// CHECK-ERROR: instruction requires: sve2 +// CHECK-UNKNOWN: 35 0c df 44