1// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sve 2>&1 < %s| FileCheck %s 2 3// --------------------------------------------------------------------------// 4// Restricted predicate out of range. 5 6cmphs p0.b, p8/z, z0.b, z0.b 7// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: restricted predicate has range [0, 7]. 8// CHECK-NEXT: cmphs p0.b, p8/z, z0.b, z0.b 9// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: 10 11 12// --------------------------------------------------------------------------// 13// Invalid predicate operation 14 15cmphs p0.b, p0/m, z0.b, z0.b 16// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction 17// CHECK-NEXT: cmphs p0.b, p0/m, z0.b, z0.b 18// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: 19 20 21// --------------------------------------------------------------------------// 22// Invalid source registers 23 24cmphs p0.b, p0/z, z0.b, z0.h 25// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width 26// CHECK-NEXT: cmphs p0.b, p0/z, z0.b, z0.h 27// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: 28 29cmphs p0.h, p0/z, z0.h, z0.s 30// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width 31// CHECK-NEXT: cmphs p0.h, p0/z, z0.h, z0.s 32// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: 33 34cmphs p0.s, p0/z, z0.s, z0.h 35// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width 36// CHECK-NEXT: cmphs p0.s, p0/z, z0.s, z0.h 37// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: 38 39cmphs p0.d, p0/z, z0.d, z0.s 40// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width 41// CHECK-NEXT: cmphs p0.d, p0/z, z0.d, z0.s 42// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: 43 44cmphs p0.b, p0/z, z0.h, z0.h 45// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width 46// CHECK-NEXT: cmphs p0.b, p0/z, z0.h, z0.h 47// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: 48 49cmphs p0.h, p0/z, z0.s, z0.s 50// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width 51// CHECK-NEXT: cmphs p0.h, p0/z, z0.s, z0.s 52// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: 53 54cmphs p0.s, p0/z, z0.h, z0.h 55// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width 56// CHECK-NEXT: cmphs p0.s, p0/z, z0.h, z0.h 57// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: 58 59cmphs p0.d, p0/z, z0.s, z0.s 60// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width 61// CHECK-NEXT: cmphs p0.d, p0/z, z0.s, z0.s 62// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: 63 64 65// --------------------------------------------------------------------------// 66// Invalid immediate range 67 68cmphs p0.s, p0/z, z0.s, #-1 69// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [0, 127]. 70// CHECK-NEXT: cmphs p0.s, p0/z, z0.s, #-1 71// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: 72 73cmphs p0.s, p0/z, z0.s, #128 74// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [0, 127]. 75// CHECK-NEXT: cmphs p0.s, p0/z, z0.s, #128 76// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: 77 78 79// --------------------------------------------------------------------------// 80// Negative tests for instructions that are incompatible with movprfx 81 82movprfx z0.d, p0/z, z7.d 83cmphs p0.d, p0/z, z0.d, #127 84// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov 85// CHECK-NEXT: cmphs p0.d, p0/z, z0.d, #127 86// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: 87 88movprfx z0, z7 89cmphs p0.d, p0/z, z0.d, #127 90// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov 91// CHECK-NEXT: cmphs p0.d, p0/z, z0.d, #127 92// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: 93 94movprfx z0.s, p0/z, z7.s 95cmphs p0.s, p0/z, z0.s, z0.d 96// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov 97// CHECK-NEXT: cmphs p0.s, p0/z, z0.s, z0.d 98// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: 99 100movprfx z0, z7 101cmphs p0.s, p0/z, z0.s, z0.d 102// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov 103// CHECK-NEXT: cmphs p0.s, p0/z, z0.s, z0.d 104// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: 105