1// RUN: llvm-mc -arch=amdgcn -mcpu=gfx904 -show-encoding %s | FileCheck -check-prefix=GFX9-FMAMIX %s
2// RUN: llvm-mc -arch=amdgcn -mcpu=gfx906 -show-encoding %s | FileCheck -check-prefix=GFX9-FMAMIX %s
3// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx900 %s 2>&1 | FileCheck -check-prefix=GFX9-MADMIX-ERR --implicit-check-not=error: %s
4
5v_fma_mix_f32 v0, v1, v2, v3
6// GFX9-FMAMIX: v_fma_mix_f32 v0, v1, v2, v3 ; encoding: [0x00,0x00,0xa0,0xd3,0x01,0x05,0x0e,0x04]
7// GFX9-MADMIX-ERR: error: instruction not supported on this GPU
8
9v_fma_mixlo_f16 v0, v1, v2, v3
10// GFX9-FMAMIX: v_fma_mixlo_f16 v0, v1, v2, v3 ; encoding: [0x00,0x00,0xa1,0xd3,0x01,0x05,0x0e,0x04]
11// GFX9-MADMIX-ERR: error: instruction not supported on this GPU
12
13v_fma_mixhi_f16 v0, v1, v2, v3
14// GFX9-FMAMIX: v_fma_mixhi_f16 v0, v1, v2, v3 ; encoding: [0x00,0x00,0xa2,0xd3,0x01,0x05,0x0e,0x04]
15// GFX9-MADMIX-ERR: error: instruction not supported on this GPU
16
17//
18// Regular source modifiers on non-packed instructions
19//
20
21v_fma_mix_f32 v0, abs(v1), v2, v3
22// GFX9-FMAMIX: v_fma_mix_f32 v0, |v1|, v2, v3 ; encoding: [0x00,0x01,0xa0,0xd3,0x01,0x05,0x0e,0x04]
23// GFX9-MADMIX-ERR: error: instruction not supported on this GPU
24
25v_fma_mix_f32 v0, v1, abs(v2), v3
26// GFX9-FMAMIX: v_fma_mix_f32 v0, v1, |v2|, v3 ; encoding: [0x00,0x02,0xa0,0xd3,0x01,0x05,0x0e,0x04]
27// GFX9-MADMIX-ERR: error: instruction not supported on this GPU
28
29v_fma_mix_f32 v0, v1, v2, abs(v3)
30// GFX9-FMAMIX: v_fma_mix_f32 v0, v1, v2, |v3| ; encoding: [0x00,0x04,0xa0,0xd3,0x01,0x05,0x0e,0x04]
31// GFX9-MADMIX-ERR: error: instruction not supported on this GPU
32
33v_fma_mix_f32 v0, -v1, v2, v3
34// GFX9-FMAMIX: v_fma_mix_f32 v0, -v1, v2, v3 ; encoding: [0x00,0x00,0xa0,0xd3,0x01,0x05,0x0e,0x24]
35// GFX9-MADMIX-ERR: error: instruction not supported on this GPU
36
37v_fma_mix_f32 v0, v1, -v2, v3
38// GFX9-FMAMIX: v_fma_mix_f32 v0, v1, -v2, v3 ; encoding: [0x00,0x00,0xa0,0xd3,0x01,0x05,0x0e,0x44]
39// GFX9-MADMIX-ERR: error: instruction not supported on this GPU
40
41v_fma_mix_f32 v0, v1, v2, -v3
42// GFX9-FMAMIX: v_fma_mix_f32 v0, v1, v2, -v3 ; encoding: [0x00,0x00,0xa0,0xd3,0x01,0x05,0x0e,0x84]
43// GFX9-MADMIX-ERR: error: instruction not supported on this GPU
44
45v_fma_mix_f32 v0, -abs(v1), v2, v3
46// GFX9-FMAMIX: v_fma_mix_f32 v0, -|v1|, v2, v3 ; encoding: [0x00,0x01,0xa0,0xd3,0x01,0x05,0x0e,0x24]
47// GFX9-MADMIX-ERR: error: instruction not supported on this GPU
48
49v_fma_mix_f32 v0, v1, -abs(v2), v3
50// GFX9-FMAMIX: v_fma_mix_f32 v0, v1, -|v2|, v3 ; encoding: [0x00,0x02,0xa0,0xd3,0x01,0x05,0x0e,0x44]
51// GFX9-MADMIX-ERR: error: instruction not supported on this GPU
52
53v_fma_mix_f32 v0, v1, v2, -abs(v3)
54// GFX9-FMAMIX: v_fma_mix_f32 v0, v1, v2, -|v3| ; encoding: [0x00,0x04,0xa0,0xd3,0x01,0x05,0x0e,0x84]
55// GFX9-MADMIX-ERR: error: instruction not supported on this GPU
56
57v_fma_mixlo_f16 v0, abs(v1), -v2, abs(v3)
58// GFX9-FMAMIX: v_fma_mixlo_f16 v0, |v1|, -v2, |v3| ; encoding: [0x00,0x05,0xa1,0xd3,0x01,0x05,0x0e,0x44]
59// GFX9-MADMIX-ERR: error: instruction not supported on this GPU
60
61v_fma_mixhi_f16 v0, -v1, abs(v2), -abs(v3)
62// GFX9-FMAMIX: v_fma_mixhi_f16 v0, -v1, |v2|, -|v3| ; encoding: [0x00,0x06,0xa2,0xd3,0x01,0x05,0x0e,0xa4]
63// GFX9-MADMIX-ERR: error: instruction not supported on this GPU
64
65v_fma_mixlo_f16 v0, v1, v2, v3 clamp
66// GFX9-FMAMIX: v_fma_mixlo_f16 v0, v1, v2, v3  clamp ; encoding: [0x00,0x80,0xa1,0xd3,0x01,0x05,0x0e,0x04]
67// GFX9-MADMIX-ERR: error: instruction not supported on this GPU
68
69v_fma_mixhi_f16 v0, v1, v2, v3 clamp
70// GFX9-FMAMIX: v_fma_mixhi_f16 v0, v1, v2, v3  clamp ; encoding: [0x00,0x80,0xa2,0xd3,0x01,0x05,0x0e,0x04]
71// GFX9-MADMIX-ERR: error: instruction not supported on this GPU
72
73//
74// op_sel with non-packed instructions
75//
76
77v_fma_mix_f32 v0, v1, v2, v3 op_sel:[0,0,0]
78// GFX9-FMAMIX: v_fma_mix_f32 v0, v1, v2, v3 ; encoding: [0x00,0x00,0xa0,0xd3,0x01,0x05,0x0e,0x04]
79// GFX9-MADMIX-ERR: error: instruction not supported on this GPU
80
81v_fma_mix_f32 v0, v1, v2, v3 op_sel:[1,0,0]
82// GFX9-FMAMIX: v_fma_mix_f32 v0, v1, v2, v3 op_sel:[1,0,0] ; encoding: [0x00,0x08,0xa0,0xd3,0x01,0x05,0x0e,0x04]
83// GFX9-MADMIX-ERR: error: instruction not supported on this GPU
84
85v_fma_mix_f32 v0, v1, v2, v3 op_sel:[0,1,0]
86// GFX9-FMAMIX: v_fma_mix_f32 v0, v1, v2, v3 op_sel:[0,1,0] ; encoding: [0x00,0x10,0xa0,0xd3,0x01,0x05,0x0e,0x04]
87// GFX9-MADMIX-ERR: error: instruction not supported on this GPU
88
89v_fma_mix_f32 v0, v1, v2, v3 op_sel:[0,0,1]
90// GFX9-FMAMIX: v_fma_mix_f32 v0, v1, v2, v3 op_sel:[0,0,1] ; encoding: [0x00,0x20,0xa0,0xd3,0x01,0x05,0x0e,0x04]
91// GFX9-MADMIX-ERR: error: instruction not supported on this GPU
92
93v_fma_mix_f32 v0, v1, v2, v3 op_sel:[1,1,1]
94// GFX9-FMAMIX: v_fma_mix_f32 v0, v1, v2, v3 op_sel:[1,1,1] ; encoding: [0x00,0x38,0xa0,0xd3,0x01,0x05,0x0e,0x04]
95// GFX9-MADMIX-ERR: error: instruction not supported on this GPU
96
97v_fma_mix_f32 v0, v1, v2, v3
98// GFX9-FMAMIX: v_fma_mix_f32 v0, v1, v2, v3 ; encoding: [0x00,0x00,0xa0,0xd3,0x01,0x05,0x0e,0x04]
99// GFX9-MADMIX-ERR: error: instruction not supported on this GPU
100
101v_fma_mix_f32 v0, v1, v2, v3 op_sel_hi:[1,0,0]
102// GFX9-FMAMIX: v_fma_mix_f32 v0, v1, v2, v3 op_sel_hi:[1,0,0] ; encoding: [0x00,0x00,0xa0,0xd3,0x01,0x05,0x0e,0x0c]
103// GFX9-MADMIX-ERR: error: instruction not supported on this GPU
104
105v_fma_mix_f32 v0, v1, v2, v3 op_sel_hi:[0,1,0]
106// GFX9-FMAMIX: v_fma_mix_f32 v0, v1, v2, v3 op_sel_hi:[0,1,0] ; encoding: [0x00,0x00,0xa0,0xd3,0x01,0x05,0x0e,0x14]
107// GFX9-MADMIX-ERR: error: instruction not supported on this GPU
108
109v_fma_mix_f32 v0, v1, v2, v3 op_sel_hi:[0,0,1]
110// GFX9-FMAMIX: v_fma_mix_f32 v0, v1, v2, v3 op_sel_hi:[0,0,1] ; encoding: [0x00,0x40,0xa0,0xd3,0x01,0x05,0x0e,0x04]
111// GFX9-MADMIX-ERR: error: instruction not supported on this GPU
112
113v_fma_mix_f32 v0, v1, v2, v3 op_sel_hi:[1,1,1]
114// GFX9-FMAMIX: v_fma_mix_f32 v0, v1, v2, v3 op_sel_hi:[1,1,1] ; encoding: [0x00,0x40,0xa0,0xd3,0x01,0x05,0x0e,0x1c]
115// GFX9-MADMIX-ERR: error: instruction not supported on this GPU
116
117v_fma_mixlo_f16 v0, v1, v2, v3 op_sel_hi:[1,0,1] clamp
118// GFX9-FMAMIX: v_fma_mixlo_f16 v0, v1, v2, v3 op_sel_hi:[1,0,1] clamp ; encoding: [0x00,0xc0,0xa1,0xd3,0x01,0x05,0x0e,0x0c]
119// GFX9-MADMIX-ERR: error: instruction not supported on this GPU
120
121v_fma_mixhi_f16 v0, v1, v2, v3 op_sel_hi:[1,0,1] clamp
122// GFX9-FMAMIX: v_fma_mixhi_f16 v0, v1, v2, v3 op_sel_hi:[1,0,1] clamp ; encoding: [0x00,0xc0,0xa2,0xd3,0x01,0x05,0x0e,0x0c]
123// GFX9-MADMIX-ERR: error: instruction not supported on this GPU
124