xref: /llvm-project/llvm/test/MC/AArch64/armv8.6a-bf16.s (revision 45f3a5aae7320a847bbcb24eca0a33e933ec8561)
1// RUN:     llvm-mc -triple aarch64 -show-encoding  -mattr=+bf16 < %s       | FileCheck %s
2// RUN:     llvm-mc -triple aarch64 -show-encoding  -mattr=+v8.6a < %s      | FileCheck %s
3// RUN:     llvm-mc -triple aarch64 -show-encoding  -mattr=+all %s          | FileCheck %s
4// RUN: not llvm-mc -triple aarch64 -show-encoding  -mattr=-bf16  < %s 2>&1 | FileCheck %s --check-prefix=NOBF16
5// RUN: not llvm-mc -triple aarch64 -show-encoding  < %s 2>&1 | FileCheck %s --check-prefix=NOBF16
6
7
8bfdot v2.2s, v3.4h, v4.4h
9bfdot v2.4s, v3.8h, v4.8h
10// CHECK: bfdot v2.2s, v3.4h, v4.4h      // encoding: [0x62,0xfc,0x44,0x2e]
11// CHECK: bfdot v2.4s, v3.8h, v4.8h      // encoding: [0x62,0xfc,0x44,0x6e]
12// NOBF16: instruction requires: bf16
13// NOBF16-NEXT: bfdot v2.2s, v3.4h, v4.4h
14// NOBF16: instruction requires: bf16
15// NOBF16-NEXT: bfdot v2.4s, v3.8h, v4.8h
16
17bfdot  v2.2s, v3.4h, v4.2h[0]
18bfdot  v2.2s, v3.4h, v4.2h[1]
19bfdot  v2.2s, v3.4h, v4.2h[2]
20bfdot  v2.2s, v3.4h, v4.2h[3]
21// CHECK: bfdot   v2.2s, v3.4h, v4.2h[0]  // encoding: [0x62,0xf0,0x44,0x0f]
22// CHECK: bfdot   v2.2s, v3.4h, v4.2h[1]  // encoding: [0x62,0xf0,0x64,0x0f]
23// CHECK: bfdot   v2.2s, v3.4h, v4.2h[2]  // encoding: [0x62,0xf8,0x44,0x0f]
24// CHECK: bfdot   v2.2s, v3.4h, v4.2h[3]  // encoding: [0x62,0xf8,0x64,0x0f]
25// NOBF16: instruction requires: bf16
26// NOBF16-NEXT: bfdot   v2.2s, v3.4h, v4.2h[0]
27// NOBF16: instruction requires: bf16
28// NOBF16-NEXT: bfdot   v2.2s, v3.4h, v4.2h[1]
29// NOBF16: instruction requires: bf16
30// NOBF16-NEXT: bfdot   v2.2s, v3.4h, v4.2h[2]
31// NOBF16: instruction requires: bf16
32// NOBF16-NEXT: bfdot   v2.2s, v3.4h, v4.2h[3]
33
34
35bfdot v2.4s, v3.8h, v4.2h[0]
36bfdot v2.4s, v3.8h, v4.2h[1]
37bfdot v2.4s, v3.8h, v4.2h[2]
38bfdot v2.4s, v3.8h, v4.2h[3]
39// CHECK: bfdot  v2.4s, v3.8h, v4.2h[0]  // encoding: [0x62,0xf0,0x44,0x4f]
40// CHECK: bfdot  v2.4s, v3.8h, v4.2h[1]  // encoding: [0x62,0xf0,0x64,0x4f]
41// CHECK: bfdot  v2.4s, v3.8h, v4.2h[2]  // encoding: [0x62,0xf8,0x44,0x4f]
42// CHECK: bfdot  v2.4s, v3.8h, v4.2h[3]  // encoding: [0x62,0xf8,0x64,0x4f]
43// NOBF16: instruction requires: bf16
44// NOBF16-NEXT: bfdot v2.4s, v3.8h, v4.2h[0]
45// NOBF16: instruction requires: bf16
46// NOBF16-NEXT: bfdot v2.4s, v3.8h, v4.2h[1]
47// NOBF16: instruction requires: bf16
48// NOBF16-NEXT: bfdot v2.4s, v3.8h, v4.2h[2]
49// NOBF16: instruction requires: bf16
50// NOBF16-NEXT: bfdot v2.4s, v3.8h, v4.2h[3]
51
52
53bfmmla v2.4s, v3.8h, v4.8h
54bfmmla v3.4s, v4.8h, v5.8h
55// CHECK: bfmmla v2.4s, v3.8h, v4.8h   // encoding: [0x62,0xec,0x44,0x6e]
56// CHECK: bfmmla v3.4s, v4.8h, v5.8h   // encoding: [0x83,0xec,0x45,0x6e]
57// NOBF16: instruction requires: bf16
58// NOBF16-NEXT: bfmmla v2.4s, v3.8h, v4.8h
59// NOBF16: instruction requires: bf16
60// NOBF16-NEXT: bfmmla v3.4s, v4.8h, v5.8h
61
62bfcvtn  v5.4h, v5.4s
63bfcvtn2 v5.8h, v5.4s
64// CHECK: bfcvtn  v5.4h, v5.4s           // encoding: [0xa5,0x68,0xa1,0x0e]
65// CHECK: bfcvtn2 v5.8h, v5.4s           // encoding: [0xa5,0x68,0xa1,0x4e]
66// NOBF16: instruction requires: bf16
67// NOBF16-NEXT: bfcvtn  v5.4h, v5.4s
68// NOBF16: instruction requires: bf16
69// NOBF16-NEXT: bfcvtn2 v5.8h, v5.4s
70
71bfcvt  h5, s3
72// CHECK: bfcvt   h5, s3               // encoding: [0x65,0x40,0x63,0x1e]
73// NOBF16: instruction requires: bf16
74// NOBF16-NEXT: bfcvt  h5, s3
75
76bfmlalb V10.4S, V21.8h, V14.8H
77bfmlalt V21.4S, V14.8h, V10.8H
78// CHECK:       bfmlalb	v10.4s, v21.8h, v14.8h  // encoding: [0xaa,0xfe,0xce,0x2e]
79// CHECK-NEXT:  bfmlalt	v21.4s, v14.8h, v10.8h  // encoding: [0xd5,0xfd,0xca,0x6e]
80// NOBF16:      error: instruction requires: bf16
81// NOBF16-NEXT: bfmlalb V10.4S, V21.8h, V14.8H
82// NOBF16-NEXT: ^
83// NOBF16:      instruction requires: bf16
84// NOBF16-NEXT: bfmlalt V21.4S, V14.8h, V10.8H
85// NOBF16-NEXT: ^
86
87bfmlalb V14.4S, V21.8H, V10.H[1]
88bfmlalb V14.4S, V21.8H, V10.H[2]
89bfmlalb V14.4S, V21.8H, V10.H[7]
90bfmlalt V21.4S, V10.8H, V14.H[1]
91bfmlalt V21.4S, V10.8H, V14.H[2]
92bfmlalt V21.4S, V10.8H, V14.H[7]
93// CHECK:      bfmlalb v14.4s, v21.8h, v10.h[1] // encoding: [0xae,0xf2,0xda,0x0f]
94// CHECK-NEXT: bfmlalb v14.4s, v21.8h, v10.h[2] // encoding: [0xae,0xf2,0xea,0x0f]
95// CHECK-NEXT: bfmlalb v14.4s, v21.8h, v10.h[7] // encoding: [0xae,0xfa,0xfa,0x0f]
96// CHECK-NEXT: bfmlalt v21.4s, v10.8h, v14.h[1] // encoding: [0x55,0xf1,0xde,0x4f]
97// CHECK-NEXT: bfmlalt v21.4s, v10.8h, v14.h[2] // encoding: [0x55,0xf1,0xee,0x4f]
98// CHECK-NEXT: bfmlalt v21.4s, v10.8h, v14.h[7] // encoding: [0x55,0xf9,0xfe,0x4f]
99// NOBF16:      error: instruction requires: bf16
100// NOBF16-NEXT: bfmlalb V14.4S, V21.8H, V10.H[1]
101// NOBF16-NEXT: ^
102// NOBF16:      error: instruction requires: bf16
103// NOBF16-NEXT: bfmlalb V14.4S, V21.8H, V10.H[2]
104// NOBF16-NEXT: ^
105// NOBF16:      error: instruction requires: bf16
106// NOBF16-NEXT: bfmlalb V14.4S, V21.8H, V10.H[7]
107// NOBF16-NEXT: ^
108// NOBF16:      instruction requires: bf16
109// NOBF16-NEXT: bfmlalt V21.4S, V10.8H, V14.H[1]
110// NOBF16-NEXT: ^
111// NOBF16:      instruction requires: bf16
112// NOBF16-NEXT: bfmlalt V21.4S, V10.8H, V14.H[2]
113// NOBF16-NEXT: ^
114// NOBF16:      instruction requires: bf16
115// NOBF16-NEXT: bfmlalt V21.4S, V10.8H, V14.H[7]
116// NOBF16-NEXT: ^
117