diff options
| author | Sander de Smalen <sander.desmalen@arm.com> | 2018-07-05 07:54:10 +0000 |
|---|---|---|
| committer | Sander de Smalen <sander.desmalen@arm.com> | 2018-07-05 07:54:10 +0000 |
| commit | 592718f906d64b216d1f8627c6dce2a374f27a1d (patch) | |
| tree | 9082b87529c3feeb0581bb7219c4fe0f785c7a99 /llvm/test | |
| parent | 66e22c21c316cadb6023268273d29534d148a54d (diff) | |
| download | bcm5719-llvm-592718f906d64b216d1f8627c6dce2a374f27a1d.tar.gz bcm5719-llvm-592718f906d64b216d1f8627c6dce2a374f27a1d.zip | |
[AArch64][SVE] Asm: Support for signed/unsigned MIN/MAX/ABD
This patch implements the following varieties:
- Unpredicated signed max, e.g. smax z0.h, z1.h, #-128
- Unpredicated signed min, e.g. smin z0.h, z1.h, #-128
- Unpredicated unsigned max, e.g. umax z0.h, z1.h, #255
- Unpredicated unsigned min, e.g. umin z0.h, z1.h, #255
- Predicated signed max, e.g. smax z0.h, p0/m, z0.h, z1.h
- Predicated signed min, e.g. smin z0.h, p0/m, z0.h, z1.h
- Predicated signed abd, e.g. sabd z0.h, p0/m, z0.h, z1.h
- Predicated unsigned max, e.g. umax z0.h, p0/m, z0.h, z1.h
- Predicated unsigned min, e.g. umin z0.h, p0/m, z0.h, z1.h
- Predicated unsigned abd, e.g. uabd z0.h, p0/m, z0.h, z1.h
llvm-svn: 336317
Diffstat (limited to 'llvm/test')
| -rw-r--r-- | llvm/test/MC/AArch64/SVE/sabd-diagnostics.s | 6 | ||||
| -rw-r--r-- | llvm/test/MC/AArch64/SVE/sabd.s | 32 | ||||
| -rw-r--r-- | llvm/test/MC/AArch64/SVE/smax-diagnostics.s | 16 | ||||
| -rw-r--r-- | llvm/test/MC/AArch64/SVE/smax.s | 80 | ||||
| -rw-r--r-- | llvm/test/MC/AArch64/SVE/smin-diagnostics.s | 16 | ||||
| -rw-r--r-- | llvm/test/MC/AArch64/SVE/smin.s | 80 | ||||
| -rw-r--r-- | llvm/test/MC/AArch64/SVE/uabd-diagnostics.s | 6 | ||||
| -rw-r--r-- | llvm/test/MC/AArch64/SVE/uabd.s | 32 | ||||
| -rw-r--r-- | llvm/test/MC/AArch64/SVE/umax-diagnostics.s | 16 | ||||
| -rw-r--r-- | llvm/test/MC/AArch64/SVE/umax.s | 80 | ||||
| -rw-r--r-- | llvm/test/MC/AArch64/SVE/umin-diagnostics.s | 16 | ||||
| -rw-r--r-- | llvm/test/MC/AArch64/SVE/umin.s | 80 |
12 files changed, 460 insertions, 0 deletions
diff --git a/llvm/test/MC/AArch64/SVE/sabd-diagnostics.s b/llvm/test/MC/AArch64/SVE/sabd-diagnostics.s new file mode 100644 index 00000000000..4f8edaf4c31 --- /dev/null +++ b/llvm/test/MC/AArch64/SVE/sabd-diagnostics.s @@ -0,0 +1,6 @@ +// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sve 2>&1 < %s| FileCheck %s + +sabd z0.b, p8/m, z0.b, z0.b +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: restricted predicate has range [0, 7]. +// CHECK-NEXT: sabd z0.b, p8/m, z0.b, z0.b +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: diff --git a/llvm/test/MC/AArch64/SVE/sabd.s b/llvm/test/MC/AArch64/SVE/sabd.s new file mode 100644 index 00000000000..0636d3f7628 --- /dev/null +++ b/llvm/test/MC/AArch64/SVE/sabd.s @@ -0,0 +1,32 @@ +// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sve < %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=+sve < %s \ +// RUN: | llvm-objdump -d -mattr=+sve - | FileCheck %s --check-prefix=CHECK-INST +// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve < %s \ +// RUN: | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-UNKNOWN + +sabd z31.b, p7/m, z31.b, z31.b +// CHECK-INST: sabd z31.b, p7/m, z31.b, z31.b +// CHECK-ENCODING: [0xff,0x1f,0x0c,0x04] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: ff 1f 0c 04 <unknown> + +sabd z31.h, p7/m, z31.h, z31.h +// CHECK-INST: sabd z31.h, p7/m, z31.h, z31.h +// CHECK-ENCODING: [0xff,0x1f,0x4c,0x04] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: ff 1f 4c 04 <unknown> + +sabd z31.s, p7/m, z31.s, z31.s +// CHECK-INST: sabd z31.s, p7/m, z31.s, z31.s +// CHECK-ENCODING: [0xff,0x1f,0x8c,0x04] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: ff 1f 8c 04 <unknown> + +sabd z31.d, p7/m, z31.d, z31.d +// CHECK-INST: sabd z31.d, p7/m, z31.d, z31.d +// CHECK-ENCODING: [0xff,0x1f,0xcc,0x04] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: ff 1f cc 04 <unknown> diff --git a/llvm/test/MC/AArch64/SVE/smax-diagnostics.s b/llvm/test/MC/AArch64/SVE/smax-diagnostics.s new file mode 100644 index 00000000000..ac1c286f26e --- /dev/null +++ b/llvm/test/MC/AArch64/SVE/smax-diagnostics.s @@ -0,0 +1,16 @@ +// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sve 2>&1 < %s| FileCheck %s + +smax z0.b, z0.b, #-129 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: index must be an integer in range [-128, 127]. +// CHECK-NEXT: smax z0.b, z0.b, #-129 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +smax z31.b, z31.b, #128 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: index must be an integer in range [-128, 127]. +// CHECK-NEXT: smax z31.b, z31.b, #128 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +smax z0.b, p8/m, z0.b, z0.b +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: restricted predicate has range [0, 7]. +// CHECK-NEXT: smax z0.b, p8/m, z0.b, z0.b +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: diff --git a/llvm/test/MC/AArch64/SVE/smax.s b/llvm/test/MC/AArch64/SVE/smax.s new file mode 100644 index 00000000000..de0e9e2f524 --- /dev/null +++ b/llvm/test/MC/AArch64/SVE/smax.s @@ -0,0 +1,80 @@ +// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sve < %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=+sve < %s \ +// RUN: | llvm-objdump -d -mattr=+sve - | FileCheck %s --check-prefix=CHECK-INST +// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve < %s \ +// RUN: | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-UNKNOWN + +smax z0.b, z0.b, #-128 +// CHECK-INST: smax z0.b, z0.b, #-128 +// CHECK-ENCODING: [0x00,0xd0,0x28,0x25] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: 00 d0 28 25 <unknown> + +smax z31.b, z31.b, #127 +// CHECK-INST: smax z31.b, z31.b, #127 +// CHECK-ENCODING: [0xff,0xcf,0x28,0x25] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: ff cf 28 25 <unknown> + +smax z0.h, z0.h, #-128 +// CHECK-INST: smax z0.h, z0.h, #-128 +// CHECK-ENCODING: [0x00,0xd0,0x68,0x25] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: 00 d0 68 25 <unknown> + +smax z31.h, z31.h, #127 +// CHECK-INST: smax z31.h, z31.h, #127 +// CHECK-ENCODING: [0xff,0xcf,0x68,0x25] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: ff cf 68 25 <unknown> + +smax z0.s, z0.s, #-128 +// CHECK-INST: smax z0.s, z0.s, #-128 +// CHECK-ENCODING: [0x00,0xd0,0xa8,0x25] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: 00 d0 a8 25 <unknown> + +smax z31.s, z31.s, #127 +// CHECK-INST: smax z31.s, z31.s, #127 +// CHECK-ENCODING: [0xff,0xcf,0xa8,0x25] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: ff cf a8 25 <unknown> + +smax z0.d, z0.d, #-128 +// CHECK-INST: smax z0.d, z0.d, #-128 +// CHECK-ENCODING: [0x00,0xd0,0xe8,0x25] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: 00 d0 e8 25 <unknown> + +smax z31.d, z31.d, #127 +// CHECK-INST: smax z31.d, z31.d, #127 +// CHECK-ENCODING: [0xff,0xcf,0xe8,0x25] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: ff cf e8 25 <unknown> + +smax z31.b, p7/m, z31.b, z31.b +// CHECK-INST: smax z31.b, p7/m, z31.b, z31.b +// CHECK-ENCODING: [0xff,0x1f,0x08,0x04] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: ff 1f 08 04 <unknown> + +smax z31.h, p7/m, z31.h, z31.h +// CHECK-INST: smax z31.h, p7/m, z31.h, z31.h +// CHECK-ENCODING: [0xff,0x1f,0x48,0x04] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: ff 1f 48 04 <unknown> + +smax z31.s, p7/m, z31.s, z31.s +// CHECK-INST: smax z31.s, p7/m, z31.s, z31.s +// CHECK-ENCODING: [0xff,0x1f,0x88,0x04] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: ff 1f 88 04 <unknown> + +smax z31.d, p7/m, z31.d, z31.d +// CHECK-INST: smax z31.d, p7/m, z31.d, z31.d +// CHECK-ENCODING: [0xff,0x1f,0xc8,0x04] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: ff 1f c8 04 <unknown> diff --git a/llvm/test/MC/AArch64/SVE/smin-diagnostics.s b/llvm/test/MC/AArch64/SVE/smin-diagnostics.s new file mode 100644 index 00000000000..efe7855c831 --- /dev/null +++ b/llvm/test/MC/AArch64/SVE/smin-diagnostics.s @@ -0,0 +1,16 @@ +// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sve 2>&1 < %s| FileCheck %s + +smin z0.b, z0.b, #-129 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: index must be an integer in range [-128, 127]. +// CHECK-NEXT: smin z0.b, z0.b, #-129 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +smin z31.b, z31.b, #128 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: index must be an integer in range [-128, 127]. +// CHECK-NEXT: smin z31.b, z31.b, #128 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +smin z0.b, p8/m, z0.b, z0.b +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: restricted predicate has range [0, 7]. +// CHECK-NEXT: smin z0.b, p8/m, z0.b, z0.b +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: diff --git a/llvm/test/MC/AArch64/SVE/smin.s b/llvm/test/MC/AArch64/SVE/smin.s new file mode 100644 index 00000000000..dd1676bf582 --- /dev/null +++ b/llvm/test/MC/AArch64/SVE/smin.s @@ -0,0 +1,80 @@ +// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sve < %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=+sve < %s \ +// RUN: | llvm-objdump -d -mattr=+sve - | FileCheck %s --check-prefix=CHECK-INST +// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve < %s \ +// RUN: | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-UNKNOWN + +smin z0.b, z0.b, #-128 +// CHECK-INST: smin z0.b, z0.b, #-128 +// CHECK-ENCODING: [0x00,0xd0,0x2a,0x25] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: 00 d0 2a 25 <unknown> + +smin z31.b, z31.b, #127 +// CHECK-INST: smin z31.b, z31.b, #127 +// CHECK-ENCODING: [0xff,0xcf,0x2a,0x25] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: ff cf 2a 25 <unknown> + +smin z0.h, z0.h, #-128 +// CHECK-INST: smin z0.h, z0.h, #-128 +// CHECK-ENCODING: [0x00,0xd0,0x6a,0x25] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: 00 d0 6a 25 <unknown> + +smin z31.h, z31.h, #127 +// CHECK-INST: smin z31.h, z31.h, #127 +// CHECK-ENCODING: [0xff,0xcf,0x6a,0x25] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: ff cf 6a 25 <unknown> + +smin z0.s, z0.s, #-128 +// CHECK-INST: smin z0.s, z0.s, #-128 +// CHECK-ENCODING: [0x00,0xd0,0xaa,0x25] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: 00 d0 aa 25 <unknown> + +smin z31.s, z31.s, #127 +// CHECK-INST: smin z31.s, z31.s, #127 +// CHECK-ENCODING: [0xff,0xcf,0xaa,0x25] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: ff cf aa 25 <unknown> + +smin z0.d, z0.d, #-128 +// CHECK-INST: smin z0.d, z0.d, #-128 +// CHECK-ENCODING: [0x00,0xd0,0xea,0x25] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: 00 d0 ea 25 <unknown> + +smin z31.d, z31.d, #127 +// CHECK-INST: smin z31.d, z31.d, #127 +// CHECK-ENCODING: [0xff,0xcf,0xea,0x25] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: ff cf ea 25 <unknown> + +smin z31.b, p7/m, z31.b, z31.b +// CHECK-INST: smin z31.b, p7/m, z31.b, z31.b +// CHECK-ENCODING: [0xff,0x1f,0x0a,0x04] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: ff 1f 0a 04 <unknown> + +smin z31.h, p7/m, z31.h, z31.h +// CHECK-INST: smin z31.h, p7/m, z31.h, z31.h +// CHECK-ENCODING: [0xff,0x1f,0x4a,0x04] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: ff 1f 4a 04 <unknown> + +smin z31.s, p7/m, z31.s, z31.s +// CHECK-INST: smin z31.s, p7/m, z31.s, z31.s +// CHECK-ENCODING: [0xff,0x1f,0x8a,0x04] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: ff 1f 8a 04 <unknown> + +smin z31.d, p7/m, z31.d, z31.d +// CHECK-INST: smin z31.d, p7/m, z31.d, z31.d +// CHECK-ENCODING: [0xff,0x1f,0xca,0x04] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: ff 1f ca 04 <unknown> diff --git a/llvm/test/MC/AArch64/SVE/uabd-diagnostics.s b/llvm/test/MC/AArch64/SVE/uabd-diagnostics.s new file mode 100644 index 00000000000..a7dabc3483c --- /dev/null +++ b/llvm/test/MC/AArch64/SVE/uabd-diagnostics.s @@ -0,0 +1,6 @@ +// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sve 2>&1 < %s| FileCheck %s + +uabd z0.b, p8/m, z0.b, z0.b +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: restricted predicate has range [0, 7]. +// CHECK-NEXT: uabd z0.b, p8/m, z0.b, z0.b +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: diff --git a/llvm/test/MC/AArch64/SVE/uabd.s b/llvm/test/MC/AArch64/SVE/uabd.s new file mode 100644 index 00000000000..ae06eb8782f --- /dev/null +++ b/llvm/test/MC/AArch64/SVE/uabd.s @@ -0,0 +1,32 @@ +// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sve < %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=+sve < %s \ +// RUN: | llvm-objdump -d -mattr=+sve - | FileCheck %s --check-prefix=CHECK-INST +// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve < %s \ +// RUN: | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-UNKNOWN + +uabd z31.b, p7/m, z31.b, z31.b +// CHECK-INST: uabd z31.b, p7/m, z31.b, z31.b +// CHECK-ENCODING: [0xff,0x1f,0x0d,0x04] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: ff 1f 0d 04 <unknown> + +uabd z31.h, p7/m, z31.h, z31.h +// CHECK-INST: uabd z31.h, p7/m, z31.h, z31.h +// CHECK-ENCODING: [0xff,0x1f,0x4d,0x04] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: ff 1f 4d 04 <unknown> + +uabd z31.s, p7/m, z31.s, z31.s +// CHECK-INST: uabd z31.s, p7/m, z31.s, z31.s +// CHECK-ENCODING: [0xff,0x1f,0x8d,0x04] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: ff 1f 8d 04 <unknown> + +uabd z31.d, p7/m, z31.d, z31.d +// CHECK-INST: uabd z31.d, p7/m, z31.d, z31.d +// CHECK-ENCODING: [0xff,0x1f,0xcd,0x04] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: ff 1f cd 04 <unknown> diff --git a/llvm/test/MC/AArch64/SVE/umax-diagnostics.s b/llvm/test/MC/AArch64/SVE/umax-diagnostics.s new file mode 100644 index 00000000000..f1e9e3916fb --- /dev/null +++ b/llvm/test/MC/AArch64/SVE/umax-diagnostics.s @@ -0,0 +1,16 @@ +// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sve 2>&1 < %s| FileCheck %s + +umax z0.b, z0.b, #-1 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [0, 255]. +// CHECK-NEXT: umax z0.b, z0.b, #-1 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +umax z31.b, z31.b, #256 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [0, 255]. +// CHECK-NEXT: umax z31.b, z31.b, #256 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +umax z0.b, p8/m, z0.b, z0.b +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: restricted predicate has range [0, 7]. +// CHECK-NEXT: umax z0.b, p8/m, z0.b, z0.b +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: diff --git a/llvm/test/MC/AArch64/SVE/umax.s b/llvm/test/MC/AArch64/SVE/umax.s new file mode 100644 index 00000000000..ac774ec96b1 --- /dev/null +++ b/llvm/test/MC/AArch64/SVE/umax.s @@ -0,0 +1,80 @@ +// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sve < %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=+sve < %s \ +// RUN: | llvm-objdump -d -mattr=+sve - | FileCheck %s --check-prefix=CHECK-INST +// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve < %s \ +// RUN: | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-UNKNOWN + +umax z0.b, z0.b, #0 +// CHECK-INST: umax z0.b, z0.b, #0 +// CHECK-ENCODING: [0x00,0xc0,0x29,0x25] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: 00 c0 29 25 <unknown> + +umax z31.b, z31.b, #255 +// CHECK-INST: umax z31.b, z31.b, #255 +// CHECK-ENCODING: [0xff,0xdf,0x29,0x25] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: ff df 29 25 <unknown> + +umax z0.b, z0.b, #0 +// CHECK-INST: umax z0.b, z0.b, #0 +// CHECK-ENCODING: [0x00,0xc0,0x29,0x25] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: 00 c0 29 25 <unknown> + +umax z31.b, z31.b, #255 +// CHECK-INST: umax z31.b, z31.b, #255 +// CHECK-ENCODING: [0xff,0xdf,0x29,0x25] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: ff df 29 25 <unknown> + +umax z0.b, z0.b, #0 +// CHECK-INST: umax z0.b, z0.b, #0 +// CHECK-ENCODING: [0x00,0xc0,0x29,0x25] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: 00 c0 29 25 <unknown> + +umax z31.b, z31.b, #255 +// CHECK-INST: umax z31.b, z31.b, #255 +// CHECK-ENCODING: [0xff,0xdf,0x29,0x25] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: ff df 29 25 <unknown> + +umax z0.b, z0.b, #0 +// CHECK-INST: umax z0.b, z0.b, #0 +// CHECK-ENCODING: [0x00,0xc0,0x29,0x25] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: 00 c0 29 25 <unknown> + +umax z31.b, z31.b, #255 +// CHECK-INST: umax z31.b, z31.b, #255 +// CHECK-ENCODING: [0xff,0xdf,0x29,0x25] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: ff df 29 25 <unknown> + +umax z31.b, p7/m, z31.b, z31.b +// CHECK-INST: umax z31.b, p7/m, z31.b, z31.b +// CHECK-ENCODING: [0xff,0x1f,0x09,0x04] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: ff 1f 09 04 <unknown> + +umax z31.h, p7/m, z31.h, z31.h +// CHECK-INST: umax z31.h, p7/m, z31.h, z31.h +// CHECK-ENCODING: [0xff,0x1f,0x49,0x04] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: ff 1f 49 04 <unknown> + +umax z31.s, p7/m, z31.s, z31.s +// CHECK-INST: umax z31.s, p7/m, z31.s, z31.s +// CHECK-ENCODING: [0xff,0x1f,0x89,0x04] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: ff 1f 89 04 <unknown> + +umax z31.d, p7/m, z31.d, z31.d +// CHECK-INST: umax z31.d, p7/m, z31.d, z31.d +// CHECK-ENCODING: [0xff,0x1f,0xc9,0x04] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: ff 1f c9 04 <unknown> diff --git a/llvm/test/MC/AArch64/SVE/umin-diagnostics.s b/llvm/test/MC/AArch64/SVE/umin-diagnostics.s new file mode 100644 index 00000000000..03c708b1462 --- /dev/null +++ b/llvm/test/MC/AArch64/SVE/umin-diagnostics.s @@ -0,0 +1,16 @@ +// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sve 2>&1 < %s| FileCheck %s + +umin z0.b, z0.b, #-1 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [0, 255]. +// CHECK-NEXT: umin z0.b, z0.b, #-1 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +umin z31.b, z31.b, #256 +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [0, 255]. +// CHECK-NEXT: umin z31.b, z31.b, #256 +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: + +umin z0.b, p8/m, z0.b, z0.b +// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: restricted predicate has range [0, 7]. +// CHECK-NEXT: umin z0.b, p8/m, z0.b, z0.b +// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: diff --git a/llvm/test/MC/AArch64/SVE/umin.s b/llvm/test/MC/AArch64/SVE/umin.s new file mode 100644 index 00000000000..bd142c4e2c1 --- /dev/null +++ b/llvm/test/MC/AArch64/SVE/umin.s @@ -0,0 +1,80 @@ +// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sve < %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=+sve < %s \ +// RUN: | llvm-objdump -d -mattr=+sve - | FileCheck %s --check-prefix=CHECK-INST +// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve < %s \ +// RUN: | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-UNKNOWN + +umin z0.b, z0.b, #0 +// CHECK-INST: umin z0.b, z0.b, #0 +// CHECK-ENCODING: [0x00,0xc0,0x2b,0x25] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: 00 c0 2b 25 <unknown> + +umin z31.b, z31.b, #255 +// CHECK-INST: umin z31.b, z31.b, #255 +// CHECK-ENCODING: [0xff,0xdf,0x2b,0x25] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: ff df 2b 25 <unknown> + +umin z0.b, z0.b, #0 +// CHECK-INST: umin z0.b, z0.b, #0 +// CHECK-ENCODING: [0x00,0xc0,0x2b,0x25] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: 00 c0 2b 25 <unknown> + +umin z31.b, z31.b, #255 +// CHECK-INST: umin z31.b, z31.b, #255 +// CHECK-ENCODING: [0xff,0xdf,0x2b,0x25] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: ff df 2b 25 <unknown> + +umin z0.b, z0.b, #0 +// CHECK-INST: umin z0.b, z0.b, #0 +// CHECK-ENCODING: [0x00,0xc0,0x2b,0x25] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: 00 c0 2b 25 <unknown> + +umin z31.b, z31.b, #255 +// CHECK-INST: umin z31.b, z31.b, #255 +// CHECK-ENCODING: [0xff,0xdf,0x2b,0x25] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: ff df 2b 25 <unknown> + +umin z0.b, z0.b, #0 +// CHECK-INST: umin z0.b, z0.b, #0 +// CHECK-ENCODING: [0x00,0xc0,0x2b,0x25] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: 00 c0 2b 25 <unknown> + +umin z31.b, z31.b, #255 +// CHECK-INST: umin z31.b, z31.b, #255 +// CHECK-ENCODING: [0xff,0xdf,0x2b,0x25] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: ff df 2b 25 <unknown> + +umin z31.b, p7/m, z31.b, z31.b +// CHECK-INST: umin z31.b, p7/m, z31.b, z31.b +// CHECK-ENCODING: [0xff,0x1f,0x0b,0x04] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: ff 1f 0b 04 <unknown> + +umin z31.h, p7/m, z31.h, z31.h +// CHECK-INST: umin z31.h, p7/m, z31.h, z31.h +// CHECK-ENCODING: [0xff,0x1f,0x4b,0x04] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: ff 1f 4b 04 <unknown> + +umin z31.s, p7/m, z31.s, z31.s +// CHECK-INST: umin z31.s, p7/m, z31.s, z31.s +// CHECK-ENCODING: [0xff,0x1f,0x8b,0x04] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: ff 1f 8b 04 <unknown> + +umin z31.d, p7/m, z31.d, z31.d +// CHECK-INST: umin z31.d, p7/m, z31.d, z31.d +// CHECK-ENCODING: [0xff,0x1f,0xcb,0x04] +// CHECK-ERROR: instruction requires: sve +// CHECK-UNKNOWN: ff 1f cb 04 <unknown> |

