Skip to content

Commit 181872f

Browse files
authored
[AMDGPU][True16][MC] update a few mc test for true16 (llvm#135816)
This is another NFC patch. Update mc test for a few true16 instructions by duplicating the file to fake16 versions and udpate `mattr` flag with +/-real-true16. Also added some fake16 file that are not properly created before
1 parent 1bfd444 commit 181872f

12 files changed

+792
-81
lines changed

llvm/test/MC/AMDGPU/bf16_imm-fake16.s

+114
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
// NOTE: Assertions have been autogenerated by utils/update_mc_test_checks.py UTC_ARGS: --unique --version 5
2+
// RUN: llvm-mc -triple=amdgcn -mcpu=gfx1100 -mattr=-real-true16 -show-encoding %s | FileCheck %s
3+
// RUN: llvm-mc -triple=amdgcn -mcpu=gfx1200 -mattr=-real-true16 -show-encoding %s | FileCheck %s
4+
5+
v_dot2_bf16_bf16 v5, v1, v2, 100.0
6+
// CHECK: v_dot2_bf16_bf16 v5, v1, v2, 0x42c8 ; encoding: [0x05,0x00,0x67,0xd6,0x01,0x05,0xfe,0x03,0xc8,0x42,0x00,0x00]
7+
8+
v_dot2_bf16_bf16 v2, v0, 1.0, v2
9+
// CHECK: v_dot2_bf16_bf16 v2, v0, 1.0, v2 ; encoding: [0x02,0x00,0x67,0xd6,0x00,0xe5,0x09,0x04]
10+
11+
v_dot2_bf16_bf16 v2, 1.0, v0, v2
12+
// CHECK: v_dot2_bf16_bf16 v2, 1.0, v0, v2 ; encoding: [0x02,0x00,0x67,0xd6,0xf2,0x00,0x0a,0x04]
13+
14+
v_dot2_bf16_bf16 v5, v1, v2, 1.0
15+
// CHECK: v_dot2_bf16_bf16 v5, v1, v2, 1.0 ; encoding: [0x05,0x00,0x67,0xd6,0x01,0x05,0xca,0x03]
16+
17+
v_dot2_bf16_bf16 v2, v0, -1.0, v2
18+
// CHECK: v_dot2_bf16_bf16 v2, v0, -1.0, v2 ; encoding: [0x02,0x00,0x67,0xd6,0x00,0xe7,0x09,0x04]
19+
20+
v_dot2_bf16_bf16 v2, v0, 0.5, v2
21+
// CHECK: v_dot2_bf16_bf16 v2, v0, 0.5, v2 ; encoding: [0x02,0x00,0x67,0xd6,0x00,0xe1,0x09,0x04]
22+
23+
v_dot2_bf16_bf16 v2, v0, -0.5, v2
24+
// CHECK: v_dot2_bf16_bf16 v2, v0, -0.5, v2 ; encoding: [0x02,0x00,0x67,0xd6,0x00,0xe3,0x09,0x04]
25+
26+
v_dot2_bf16_bf16 v2, v0, 2.0, v2
27+
// CHECK: v_dot2_bf16_bf16 v2, v0, 2.0, v2 ; encoding: [0x02,0x00,0x67,0xd6,0x00,0xe9,0x09,0x04]
28+
29+
v_dot2_bf16_bf16 v2, v0, -2.0, v2
30+
// CHECK: v_dot2_bf16_bf16 v2, v0, -2.0, v2 ; encoding: [0x02,0x00,0x67,0xd6,0x00,0xeb,0x09,0x04]
31+
32+
v_dot2_bf16_bf16 v2, v0, 4.0, v2
33+
// CHECK: v_dot2_bf16_bf16 v2, v0, 4.0, v2 ; encoding: [0x02,0x00,0x67,0xd6,0x00,0xed,0x09,0x04]
34+
35+
v_dot2_bf16_bf16 v2, v0, -4.0, v2
36+
// CHECK: v_dot2_bf16_bf16 v2, v0, -4.0, v2 ; encoding: [0x02,0x00,0x67,0xd6,0x00,0xef,0x09,0x04]
37+
38+
// Check 1/(2*pi) rounded value and ideomatic fp32 0.15915494 value
39+
// which cannot be accurately represented in bf16.
40+
41+
v_dot2_bf16_bf16 v2, v0, 0.158203125, v2
42+
// CHECK: v_dot2_bf16_bf16 v2, v0, 0.15915494, v2 ; encoding: [0x02,0x00,0x67,0xd6,0x00,0xf1,0x09,0x04]
43+
44+
v_dot2_bf16_bf16 v2, v0, 0.15915494, v2
45+
// CHECK: v_dot2_bf16_bf16 v2, v0, 0.15915494, v2 ; encoding: [0x02,0x00,0x67,0xd6,0x00,0xf1,0x09,0x04]
46+
47+
v_dot2_bf16_bf16 v2, v0, 0x3e22, v2
48+
// CHECK: v_dot2_bf16_bf16 v2, v0, 0.15915494, v2 ; encoding: [0x02,0x00,0x67,0xd6,0x00,0xf1,0x09,0x04]
49+
50+
v_dot2_bf16_bf16 v2, v0, v2, 0.15915494
51+
// CHECK: v_dot2_bf16_bf16 v2, v0, v2, 0.15915494 ; encoding: [0x02,0x00,0x67,0xd6,0x00,0x05,0xe2,0x03]
52+
53+
v_dot2_f32_bf16 v2, v1, 0, v2
54+
// CHECK: v_dot2_f32_bf16 v2, v1, 0, v2 ; encoding: [0x02,0x40,0x1a,0xcc,0x01,0x01,0x09,0x1c]
55+
56+
v_dot2_f32_bf16 v2, v1, 0.5, v2
57+
// CHECK: v_dot2_f32_bf16 v2, v1, 0.5, v2 ; encoding: [0x02,0x40,0x1a,0xcc,0x01,0xe1,0x09,0x1c]
58+
59+
v_dot2_f32_bf16 v2, v1, -0.5, v2
60+
// CHECK: v_dot2_f32_bf16 v2, v1, -0.5, v2 ; encoding: [0x02,0x40,0x1a,0xcc,0x01,0xe3,0x09,0x1c]
61+
62+
v_dot2_f32_bf16 v2, v1, 1.0, v2
63+
// CHECK: v_dot2_f32_bf16 v2, v1, 1.0, v2 ; encoding: [0x02,0x40,0x1a,0xcc,0x01,0xe5,0x09,0x1c]
64+
65+
v_dot2_f32_bf16 v2, v1, -1.0, v2
66+
// CHECK: v_dot2_f32_bf16 v2, v1, -1.0, v2 ; encoding: [0x02,0x40,0x1a,0xcc,0x01,0xe7,0x09,0x1c]
67+
68+
v_dot2_f32_bf16 v2, v1, 2.0, v2
69+
// CHECK: v_dot2_f32_bf16 v2, v1, 2.0, v2 ; encoding: [0x02,0x40,0x1a,0xcc,0x01,0xe9,0x09,0x1c]
70+
71+
v_dot2_f32_bf16 v2, v1, -2.0, v2
72+
// CHECK: v_dot2_f32_bf16 v2, v1, -2.0, v2 ; encoding: [0x02,0x40,0x1a,0xcc,0x01,0xeb,0x09,0x1c]
73+
74+
v_dot2_f32_bf16 v2, v1, 4.0, v2
75+
// CHECK: v_dot2_f32_bf16 v2, v1, 4.0, v2 ; encoding: [0x02,0x40,0x1a,0xcc,0x01,0xed,0x09,0x1c]
76+
77+
v_dot2_f32_bf16 v2, v1, -4.0, v2
78+
// CHECK: v_dot2_f32_bf16 v2, v1, -4.0, v2 ; encoding: [0x02,0x40,0x1a,0xcc,0x01,0xef,0x09,0x1c]
79+
80+
v_dot2_f32_bf16 v2, v1, 0.15915494, v2
81+
// CHECK: v_dot2_f32_bf16 v2, v1, 0.15915494, v2 ; encoding: [0x02,0x40,0x1a,0xcc,0x01,0xf1,0x09,0x1c]
82+
83+
v_dot2_f32_bf16 v2, v1, 0x3e22, v2
84+
// CHECK: v_dot2_f32_bf16 v2, v1, 0.15915494, v2 ; encoding: [0x02,0x40,0x1a,0xcc,0x01,0xf1,0x09,0x1c]
85+
86+
v_dot2_f32_bf16 v2, 0.5, v1, v2
87+
// CHECK: v_dot2_f32_bf16 v2, 0.5, v1, v2 ; encoding: [0x02,0x40,0x1a,0xcc,0xf0,0x02,0x0a,0x1c]
88+
89+
v_dot2_f32_bf16 v2, -0.5, v1, v2
90+
// CHECK: v_dot2_f32_bf16 v2, -0.5, v1, v2 ; encoding: [0x02,0x40,0x1a,0xcc,0xf1,0x02,0x0a,0x1c]
91+
92+
v_dot2_f32_bf16 v2, 1.0, v1, v2
93+
// CHECK: v_dot2_f32_bf16 v2, 1.0, v1, v2 ; encoding: [0x02,0x40,0x1a,0xcc,0xf2,0x02,0x0a,0x1c]
94+
95+
v_dot2_f32_bf16 v2, -1.0, v1, v2
96+
// CHECK: v_dot2_f32_bf16 v2, -1.0, v1, v2 ; encoding: [0x02,0x40,0x1a,0xcc,0xf3,0x02,0x0a,0x1c]
97+
98+
v_dot2_f32_bf16 v2, 2.0, v1, v2
99+
// CHECK: v_dot2_f32_bf16 v2, 2.0, v1, v2 ; encoding: [0x02,0x40,0x1a,0xcc,0xf4,0x02,0x0a,0x1c]
100+
101+
v_dot2_f32_bf16 v2, -2.0, v1, v2
102+
// CHECK: v_dot2_f32_bf16 v2, -2.0, v1, v2 ; encoding: [0x02,0x40,0x1a,0xcc,0xf5,0x02,0x0a,0x1c]
103+
104+
v_dot2_f32_bf16 v2, 4.0, v1, v2
105+
// CHECK: v_dot2_f32_bf16 v2, 4.0, v1, v2 ; encoding: [0x02,0x40,0x1a,0xcc,0xf6,0x02,0x0a,0x1c]
106+
107+
v_dot2_f32_bf16 v2, -4.0, v1, v2
108+
// CHECK: v_dot2_f32_bf16 v2, -4.0, v1, v2 ; encoding: [0x02,0x40,0x1a,0xcc,0xf7,0x02,0x0a,0x1c]
109+
110+
v_dot2_f32_bf16 v2, 100.0, v1, v2
111+
// CHECK: v_dot2_f32_bf16 v2, 0x42c8, v1, v2 ; encoding: [0x02,0x40,0x1a,0xcc,0xff,0x02,0x0a,0x1c,0xc8,0x42,0x00,0x00]
112+
113+
v_dot2_f32_bf16 v2, v1, 100.0, v2
114+
// CHECK: v_dot2_f32_bf16 v2, v1, 0x42c8, v2 ; encoding: [0x02,0x40,0x1a,0xcc,0x01,0xff,0x09,0x1c,0xc8,0x42,0x00,0x00]

llvm/test/MC/AMDGPU/bf16_imm.s

+32-32
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,54 @@
11
// NOTE: Assertions have been autogenerated by utils/update_mc_test_checks.py UTC_ARGS: --unique --version 5
2-
// RUN: llvm-mc -triple=amdgcn -mcpu=gfx1100 -show-encoding %s | FileCheck %s
3-
// RUN: llvm-mc -triple=amdgcn -mcpu=gfx1200 -show-encoding %s | FileCheck %s
2+
// RUN: llvm-mc -triple=amdgcn -mcpu=gfx1100 -mattr=+real-true16 -show-encoding %s | FileCheck %s
3+
// RUN: llvm-mc -triple=amdgcn -mcpu=gfx1200 -mattr=+real-true16 -show-encoding %s | FileCheck %s
44

5-
v_dot2_bf16_bf16 v5, v1, v2, 100.0
6-
// CHECK: v_dot2_bf16_bf16 v5, v1, v2, 0x42c8 ; encoding: [0x05,0x00,0x67,0xd6,0x01,0x05,0xfe,0x03,0xc8,0x42,0x00,0x00]
5+
v_dot2_bf16_bf16 v5.l, v1, v2, 100.0
6+
// CHECK: v_dot2_bf16_bf16 v5.l, v1, v2, 0x42c8 ; encoding: [0x05,0x00,0x67,0xd6,0x01,0x05,0xfe,0x03,0xc8,0x42,0x00,0x00]
77

8-
v_dot2_bf16_bf16 v2, v0, 1.0, v2
9-
// CHECK: v_dot2_bf16_bf16 v2, v0, 1.0, v2 ; encoding: [0x02,0x00,0x67,0xd6,0x00,0xe5,0x09,0x04]
8+
v_dot2_bf16_bf16 v2.l, v0, 1.0, v2.l
9+
// CHECK: v_dot2_bf16_bf16 v2.l, v0, 1.0, v2.l ; encoding: [0x02,0x00,0x67,0xd6,0x00,0xe5,0x09,0x04]
1010

11-
v_dot2_bf16_bf16 v2, 1.0, v0, v2
12-
// CHECK: v_dot2_bf16_bf16 v2, 1.0, v0, v2 ; encoding: [0x02,0x00,0x67,0xd6,0xf2,0x00,0x0a,0x04]
11+
v_dot2_bf16_bf16 v2.l, 1.0, v0, v2.l
12+
// CHECK: v_dot2_bf16_bf16 v2.l, 1.0, v0, v2.l ; encoding: [0x02,0x00,0x67,0xd6,0xf2,0x00,0x0a,0x04]
1313

14-
v_dot2_bf16_bf16 v5, v1, v2, 1.0
15-
// CHECK: v_dot2_bf16_bf16 v5, v1, v2, 1.0 ; encoding: [0x05,0x00,0x67,0xd6,0x01,0x05,0xca,0x03]
14+
v_dot2_bf16_bf16 v5.l, v1, v2, 1.0
15+
// CHECK: v_dot2_bf16_bf16 v5.l, v1, v2, 1.0 ; encoding: [0x05,0x00,0x67,0xd6,0x01,0x05,0xca,0x03]
1616

17-
v_dot2_bf16_bf16 v2, v0, -1.0, v2
18-
// CHECK: v_dot2_bf16_bf16 v2, v0, -1.0, v2 ; encoding: [0x02,0x00,0x67,0xd6,0x00,0xe7,0x09,0x04]
17+
v_dot2_bf16_bf16 v2.l, v0, -1.0, v2.l
18+
// CHECK: v_dot2_bf16_bf16 v2.l, v0, -1.0, v2.l ; encoding: [0x02,0x00,0x67,0xd6,0x00,0xe7,0x09,0x04]
1919

20-
v_dot2_bf16_bf16 v2, v0, 0.5, v2
21-
// CHECK: v_dot2_bf16_bf16 v2, v0, 0.5, v2 ; encoding: [0x02,0x00,0x67,0xd6,0x00,0xe1,0x09,0x04]
20+
v_dot2_bf16_bf16 v2.l, v0, 0.5, v2.l
21+
// CHECK: v_dot2_bf16_bf16 v2.l, v0, 0.5, v2.l ; encoding: [0x02,0x00,0x67,0xd6,0x00,0xe1,0x09,0x04]
2222

23-
v_dot2_bf16_bf16 v2, v0, -0.5, v2
24-
// CHECK: v_dot2_bf16_bf16 v2, v0, -0.5, v2 ; encoding: [0x02,0x00,0x67,0xd6,0x00,0xe3,0x09,0x04]
23+
v_dot2_bf16_bf16 v2.l, v0, -0.5, v2.l
24+
// CHECK: v_dot2_bf16_bf16 v2.l, v0, -0.5, v2.l ; encoding: [0x02,0x00,0x67,0xd6,0x00,0xe3,0x09,0x04]
2525

26-
v_dot2_bf16_bf16 v2, v0, 2.0, v2
27-
// CHECK: v_dot2_bf16_bf16 v2, v0, 2.0, v2 ; encoding: [0x02,0x00,0x67,0xd6,0x00,0xe9,0x09,0x04]
26+
v_dot2_bf16_bf16 v2.l, v0, 2.0, v2.l
27+
// CHECK: v_dot2_bf16_bf16 v2.l, v0, 2.0, v2.l ; encoding: [0x02,0x00,0x67,0xd6,0x00,0xe9,0x09,0x04]
2828

29-
v_dot2_bf16_bf16 v2, v0, -2.0, v2
30-
// CHECK: v_dot2_bf16_bf16 v2, v0, -2.0, v2 ; encoding: [0x02,0x00,0x67,0xd6,0x00,0xeb,0x09,0x04]
29+
v_dot2_bf16_bf16 v2.l, v0, -2.0, v2.l
30+
// CHECK: v_dot2_bf16_bf16 v2.l, v0, -2.0, v2.l ; encoding: [0x02,0x00,0x67,0xd6,0x00,0xeb,0x09,0x04]
3131

32-
v_dot2_bf16_bf16 v2, v0, 4.0, v2
33-
// CHECK: v_dot2_bf16_bf16 v2, v0, 4.0, v2 ; encoding: [0x02,0x00,0x67,0xd6,0x00,0xed,0x09,0x04]
32+
v_dot2_bf16_bf16 v2.l, v0, 4.0, v2.l
33+
// CHECK: v_dot2_bf16_bf16 v2.l, v0, 4.0, v2.l ; encoding: [0x02,0x00,0x67,0xd6,0x00,0xed,0x09,0x04]
3434

35-
v_dot2_bf16_bf16 v2, v0, -4.0, v2
36-
// CHECK: v_dot2_bf16_bf16 v2, v0, -4.0, v2 ; encoding: [0x02,0x00,0x67,0xd6,0x00,0xef,0x09,0x04]
35+
v_dot2_bf16_bf16 v2.l, v0, -4.0, v2.l
36+
// CHECK: v_dot2_bf16_bf16 v2.l, v0, -4.0, v2.l ; encoding: [0x02,0x00,0x67,0xd6,0x00,0xef,0x09,0x04]
3737

3838
// Check 1/(2*pi) rounded value and ideomatic fp32 0.15915494 value
3939
// which cannot be accurately represented in bf16.
4040

41-
v_dot2_bf16_bf16 v2, v0, 0.158203125, v2
42-
// CHECK: v_dot2_bf16_bf16 v2, v0, 0.15915494, v2 ; encoding: [0x02,0x00,0x67,0xd6,0x00,0xf1,0x09,0x04]
41+
v_dot2_bf16_bf16 v2.l, v0, 0.158203125, v2.l
42+
// CHECK: v_dot2_bf16_bf16 v2.l, v0, 0.15915494, v2.l ; encoding: [0x02,0x00,0x67,0xd6,0x00,0xf1,0x09,0x04]
4343

44-
v_dot2_bf16_bf16 v2, v0, 0.15915494, v2
45-
// CHECK: v_dot2_bf16_bf16 v2, v0, 0.15915494, v2 ; encoding: [0x02,0x00,0x67,0xd6,0x00,0xf1,0x09,0x04]
44+
v_dot2_bf16_bf16 v2.l, v0, 0.15915494, v2.l
45+
// CHECK: v_dot2_bf16_bf16 v2.l, v0, 0.15915494, v2.l ; encoding: [0x02,0x00,0x67,0xd6,0x00,0xf1,0x09,0x04]
4646

47-
v_dot2_bf16_bf16 v2, v0, 0x3e22, v2
48-
// CHECK: v_dot2_bf16_bf16 v2, v0, 0.15915494, v2 ; encoding: [0x02,0x00,0x67,0xd6,0x00,0xf1,0x09,0x04]
47+
v_dot2_bf16_bf16 v2.l, v0, 0x3e22, v2.l
48+
// CHECK: v_dot2_bf16_bf16 v2.l, v0, 0.15915494, v2.l ; encoding: [0x02,0x00,0x67,0xd6,0x00,0xf1,0x09,0x04]
4949

50-
v_dot2_bf16_bf16 v2, v0, v2, 0.15915494
51-
// CHECK: v_dot2_bf16_bf16 v2, v0, v2, 0.15915494 ; encoding: [0x02,0x00,0x67,0xd6,0x00,0x05,0xe2,0x03]
50+
v_dot2_bf16_bf16 v2.l, v0, v2, 0.15915494
51+
// CHECK: v_dot2_bf16_bf16 v2.l, v0, v2, 0.15915494 ; encoding: [0x02,0x00,0x67,0xd6,0x00,0x05,0xe2,0x03]
5252

5353
v_dot2_f32_bf16 v2, v1, 0, v2
5454
// CHECK: v_dot2_f32_bf16 v2, v1, 0, v2 ; encoding: [0x02,0x40,0x1a,0xcc,0x01,0x01,0x09,0x1c]

0 commit comments

Comments
 (0)