[DAGCombiner] Add target hook function to decide folding (mul (add x, c1), c2)
[llvm-project.git] / llvm / test / MC / AMDGPU / fma-mix.s
blobf062664bf8c1b3ced929bcbc6acad4c89080f8b7
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
5 v_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
9 v_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
13 v_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
18 // Regular source modifiers on non-packed instructions
21 v_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
25 v_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
29 v_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
33 v_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
37 v_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
41 v_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
45 v_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
49 v_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
53 v_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
57 v_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
61 v_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
65 v_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
69 v_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
74 // op_sel with non-packed instructions
77 v_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
81 v_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
85 v_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
89 v_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
93 v_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
97 v_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
101 v_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
105 v_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
109 v_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
113 v_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
117 v_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
121 v_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