1// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+streaming-sve < %s \
2// RUN:        | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
3// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=-neon < %s 2>&1 \
4// RUN:        | FileCheck %s --check-prefix=CHECK-ERROR
5// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+streaming-sve < %s \
6// RUN:        | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-INST
7// Disassemble encoding and check the re-encoding (-show-encoding) matches.
8// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+streaming-sve < %s \
9// RUN:        | sed '/.text/d' | sed 's/.*encoding: //g' \
10// RUN:        | llvm-mc -triple=aarch64 -mattr=+streaming-sve -disassemble -show-encoding \
11// RUN:        | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
12
13// Scalar FP instructions
14
15fmulx s0, s1, s2
16// CHECK-INST: fmulx s0, s1, s2
17// CHECK-ENCODING: [0x20,0xdc,0x22,0x5e]
18// CHECK-ERROR: instruction requires: streaming-sve or neon
19
20fmulx d0, d1, d2
21// CHECK-INST: fmulx d0, d1, d2
22// CHECK-ENCODING: [0x20,0xdc,0x62,0x5e]
23// CHECK-ERROR: instruction requires: streaming-sve or neon
24
25frecps s0, s1, s2
26// CHECK-INST: frecps s0, s1, s2
27// CHECK-ENCODING: [0x20,0xfc,0x22,0x5e]
28// CHECK-ERROR: instruction requires: streaming-sve or neon
29
30frecps d0, d1, d2
31// CHECK-INST: frecps d0, d1, d2
32// CHECK-ENCODING: [0x20,0xfc,0x62,0x5e]
33// CHECK-ERROR: instruction requires: streaming-sve or neon
34
35frsqrts s0, s1, s2
36// CHECK-INST: frsqrts s0, s1, s2
37// CHECK-ENCODING: [0x20,0xfc,0xa2,0x5e]
38// CHECK-ERROR: instruction requires: streaming-sve or neon
39
40frsqrts d0, d1, d2
41// CHECK-INST: frsqrts d0, d1, d2
42// CHECK-ENCODING: [0x20,0xfc,0xe2,0x5e]
43// CHECK-ERROR: instruction requires: streaming-sve or neon
44
45frecpe s0, s1
46// CHECK-INST: frecpe s0, s1
47// CHECK-ENCODING: [0x20,0xd8,0xa1,0x5e]
48// CHECK-ERROR: instruction requires: streaming-sve or neon
49
50frecpe d0, d1
51// CHECK-INST: frecpe d0, d1
52// CHECK-ENCODING: [0x20,0xd8,0xe1,0x5e]
53// CHECK-ERROR: instruction requires: streaming-sve or neon
54
55frecpx s0, s1
56// CHECK-INST: frecpx s0, s1
57// CHECK-ENCODING: [0x20,0xf8,0xa1,0x5e]
58// CHECK-ERROR: instruction requires: streaming-sve or neon
59
60frecpx d0, d1
61// CHECK-INST: frecpx d0, d1
62// CHECK-ENCODING: [0x20,0xf8,0xe1,0x5e]
63// CHECK-ERROR: instruction requires: streaming-sve or neon
64
65frsqrte s0, s1
66// CHECK-INST: frsqrte s0, s1
67// CHECK-ENCODING: [0x20,0xd8,0xa1,0x7e]
68// CHECK-ERROR: instruction requires: streaming-sve or neon
69
70frsqrte d0, d1
71// CHECK-INST: frsqrte d0, d1
72// CHECK-ENCODING: [0x20,0xd8,0xe1,0x7e]
73// CHECK-ERROR: instruction requires: streaming-sve or neon
74
75// Vector to GPR integer move instructions
76
77smov w0, v0.b[0]
78// CHECK-INST: smov w0, v0.b[0]
79// CHECK-ENCODING: [0x00,0x2c,0x01,0x0e]
80// CHECK-ERROR: instruction requires: neon
81
82smov x0, v0.b[0]
83// CHECK-INST: smov x0, v0.b[0]
84// CHECK-ENCODING: [0x00,0x2c,0x01,0x4e]
85// CHECK-ERROR: instruction requires: neon
86
87smov w0, v0.h[0]
88// CHECK-INST: smov w0, v0.h[0]
89// CHECK-ENCODING: [0x00,0x2c,0x02,0x0e]
90// CHECK-ERROR: instruction requires: neon
91
92smov x0, v0.h[0]
93// CHECK-INST: smov x0, v0.h[0]
94// CHECK-ENCODING: [0x00,0x2c,0x02,0x4e]
95// CHECK-ERROR: instruction requires: neon
96
97smov x0, v0.s[0]
98// CHECK-INST: smov x0, v0.s[0]
99// CHECK-ENCODING: [0x00,0x2c,0x04,0x4e]
100// CHECK-ERROR: instruction requires: neon
101
102umov w0, v0.b[0]
103// CHECK-INST: umov w0, v0.b[0]
104// CHECK-ENCODING: [0x00,0x3c,0x01,0x0e]
105// CHECK-ERROR: instruction requires: neon
106
107umov w0, v0.h[0]
108// CHECK-INST: umov w0, v0.h[0]
109// CHECK-ENCODING: [0x00,0x3c,0x02,0x0e]
110// CHECK-ERROR: instruction requires: neon
111
112umov w0, v0.s[0]
113// CHECK-INST: mov w0, v0.s[0]
114// CHECK-ENCODING: [0x00,0x3c,0x04,0x0e]
115// CHECK-ERROR: instruction requires: neon
116
117umov x0, v0.d[0]
118// CHECK-INST: mov x0, v0.d[0]
119// CHECK-ENCODING: [0x00,0x3c,0x08,0x4e]
120// CHECK-ERROR: instruction requires: neon
121
122// Aliases
123
124mov w0, v0.s[0]
125// CHECK-INST: mov w0, v0.s[0]
126// CHECK-ENCODING: [0x00,0x3c,0x04,0x0e]
127// CHECK-ERROR: instruction requires: neon
128
129mov x0, v0.d[0]
130// CHECK-INST: mov x0, v0.d[0]
131// CHECK-ENCODING: [0x00,0x3c,0x08,0x4e]
132// CHECK-ERROR: instruction requires: neon
133