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