xref: /llvm-project/llvm/test/MC/AArch64/FP8_SVE2/fdot.s (revision f16b7c62acebc6731d80565b3994452333443ffa)
1// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+ssve-fp8dot2,+ssve-fp8dot4 < %s \
2// RUN:        | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
3
4// RUN: not llvm-mc -triple=aarch64 -show-encoding < %s 2>&1 \
5// RUN:        | FileCheck %s --check-prefix=CHECK-ERROR
6
7// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve2,+fp8dot2,+fp8dot4 < %s \
8// RUN:        | llvm-objdump -d --mattr=+sve2,+fp8dot2,+fp8dot4 --no-print-imm-hex - | FileCheck %s --check-prefix=CHECK-INST
9
10// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve2,+fp8dot2,+fp8dot4 < %s \
11// RUN:        | llvm-objdump -d --mattr=-sme2 --no-print-imm-hex - | FileCheck %s --check-prefix=CHECK-UNKNOWN
12
13// Disassemble encoding and check the re-encoding (-show-encoding) matches.
14// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2,+fp8dot2,fp8dot4 < %s \
15// RUN:        | sed '/.text/d' | sed 's/.*encoding: //g' \
16// RUN:        | llvm-mc -triple=aarch64 -mattr=+sve2,+fp8dot2,fp8dot4 -disassemble -show-encoding \
17// RUN:        | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
18
19//
20// FDOT2 instructions
21//
22// fdot2 - indexed
23
24fdot    z0.h, z0.b, z0.b[0]  // 01100100-00100000-01000100-00000000
25// CHECK-INST: fdot    z0.h, z0.b, z0.b[0]
26// CHECK-ENCODING: [0x00,0x44,0x20,0x64]
27// CHECK-ERROR: instruction requires: ssve-fp8dot2 or (sve2 and fp8dot2)
28// CHECK-UNKNOWN: 64204400 <unknown>
29
30movprfx z23, z31
31fdot    z23.h, z13.b, z0.b[3]  // 01100100-00101000-01001101-10110111
32// CHECK-INST:  movprfx z23, z31
33// CHECK-INST: fdot    z23.h, z13.b, z0.b[3]
34// CHECK-ENCODING: [0xb7,0x4d,0x28,0x64]
35// CHECK-ERROR: instruction requires: ssve-fp8dot2 or (sve2 and fp8dot2)
36// CHECK-UNKNOWN: 64284db7 <unknown>
37
38fdot    z31.h, z31.b, z7.b[7]  // 01100100-00111111-01001111-11111111
39// CHECK-INST: fdot    z31.h, z31.b, z7.b[7]
40// CHECK-ENCODING: [0xff,0x4f,0x3f,0x64]
41// CHECK-ERROR: instruction requires: ssve-fp8dot2 or (sve2 and fp8dot2)
42// CHECK-UNKNOWN: 643f4fff <unknown>
43
44
45// fdot2 - group
46
47fdot    z0.h, z0.b, z0.b  // 01100100-00100000-10000100-00000000
48// CHECK-INST: fdot    z0.h, z0.b, z0.b
49// CHECK-ENCODING: [0x00,0x84,0x20,0x64]
50// CHECK-ERROR: instruction requires: ssve-fp8dot2 or (sve2 and fp8dot2)
51// CHECK-UNKNOWN: 64208400 <unknown>
52
53movprfx z23, z31
54fdot    z23.h, z13.b, z8.b  // 01100100-00101000-10000101-10110111
55// CHECK-INST:  movprfx z23, z31
56// CHECK-INST: fdot    z23.h, z13.b, z8.b
57// CHECK-ENCODING: [0xb7,0x85,0x28,0x64]
58// CHECK-ERROR: instruction requires: ssve-fp8dot2 or (sve2 and fp8dot2)
59// CHECK-UNKNOWN: 642885b7 <unknown>
60
61fdot    z31.h, z31.b, z31.b  // 01100100-00111111-10000111-11111111
62// CHECK-INST: fdot    z31.h, z31.b, z31.b
63// CHECK-ENCODING: [0xff,0x87,0x3f,0x64]
64// CHECK-ERROR: instruction requires: ssve-fp8dot2 or (sve2 and fp8dot2)
65// CHECK-UNKNOWN: 643f87ff <unknown>
66
67
68//
69// FDOT4 instructions
70//
71// fdot4 - indexed
72
73fdot    z0.s, z0.b, z0.b[0]  // 01100100-01100000-01000100-00000000
74// CHECK-INST: fdot    z0.s, z0.b, z0.b[0]
75// CHECK-ENCODING: [0x00,0x44,0x60,0x64]
76// CHECK-ERROR: instruction requires: ssve-fp8dot4 or (sve2 and fp8dot4)
77// CHECK-UNKNOWN: 64604400 <unknown>
78
79movprfx z23, z31
80fdot    z23.s, z13.b, z0.b[1]  // 01100100-01101000-01000101-10110111
81// CHECK-INST:  movprfx z23, z31
82// CHECK-INST: fdot    z23.s, z13.b, z0.b[1]
83// CHECK-ENCODING: [0xb7,0x45,0x68,0x64]
84// CHECK-ERROR: instruction requires: ssve-fp8dot4 or (sve2 and fp8dot4)
85// CHECK-UNKNOWN: 646845b7 <unknown>
86
87fdot    z31.s, z31.b, z7.b[3]  // 01100100-01111111-01000111-11111111
88// CHECK-INST: fdot    z31.s, z31.b, z7.b[3]
89// CHECK-ENCODING: [0xff,0x47,0x7f,0x64]
90// CHECK-ERROR: instruction requires: ssve-fp8dot4 or (sve2 and fp8dot4)
91// CHECK-UNKNOWN: 647f47ff <unknown>
92
93// fdot4 - group
94
95fdot    z0.s, z0.b, z0.b  // 01100100-01100000-10000100-00000000
96// CHECK-INST: fdot    z0.s, z0.b, z0.b
97// CHECK-ENCODING: [0x00,0x84,0x60,0x64]
98// CHECK-ERROR: instruction requires: ssve-fp8dot4 or (sve2 and fp8dot4)
99// CHECK-UNKNOWN: 64608400 <unknown>
100
101movprfx z23, z31
102fdot    z23.s, z13.b, z8.b  // 01100100-01101000-10000101-10110111
103// CHECK-INST:  movprfx z23, z31
104// CHECK-INST: fdot    z23.s, z13.b, z8.b
105// CHECK-ENCODING: [0xb7,0x85,0x68,0x64]
106// CHECK-ERROR: instruction requires: ssve-fp8dot4 or (sve2 and fp8dot4)
107// CHECK-UNKNOWN: 646885b7 <unknown>
108
109fdot    z31.s, z31.b, z31.b  // 01100100-01111111-10000111-11111111
110// CHECK-INST: fdot    z31.s, z31.b, z31.b
111// CHECK-ENCODING: [0xff,0x87,0x7f,0x64]
112// CHECK-ERROR: instruction requires: ssve-fp8dot4 or (sve2 and fp8dot4)
113// CHECK-UNKNOWN: 647f87ff <unknown>
114