[DAGCombiner] Add target hook function to decide folding (mul (add x, c1), c2)
[llvm-project.git] / llvm / test / MC / AMDGPU / gfx1030_new.s
blob9fbf04053bea9f3efdf2f58a356876536bfc18c4
1 // RUN: llvm-mc -arch=amdgcn -mcpu=gfx1030 -show-encoding %s | FileCheck --check-prefix=GFX10 %s
2 // RUN: llvm-mc -arch=amdgcn -mcpu=gfx1031 -show-encoding %s | FileCheck --check-prefix=GFX10 %s
3 // RUN: llvm-mc -arch=amdgcn -mcpu=gfx1032 -show-encoding %s | FileCheck --check-prefix=GFX10 %s
4 // RUN: llvm-mc -arch=amdgcn -mcpu=gfx1033 -show-encoding %s | FileCheck --check-prefix=GFX10 %s
5 // RUN: llvm-mc -arch=amdgcn -mcpu=gfx1034 -show-encoding %s | FileCheck --check-prefix=GFX10 %s
6 // RUN: llvm-mc -arch=amdgcn -mcpu=gfx1035 -show-encoding %s | FileCheck --check-prefix=GFX10 %s
8 global_load_dword_addtid v1, s[2:3] offset:16
9 // GFX10: encoding: [0x10,0x80,0x58,0xdc,0x00,0x00,0x02,0x01]
11 global_load_dword_addtid v1, s[2:3] offset:16 glc slc dlc
12 // GFX10: encoding: [0x10,0x90,0x5b,0xdc,0x00,0x00,0x02,0x01]
14 global_store_dword_addtid v1, s[2:3] offset:16 glc slc dlc
15 // GFX10: encoding: [0x10,0x90,0x5f,0xdc,0x00,0x01,0x02,0x00]
17 global_load_dword_addtid v1, off offset:16
18 // GFX10: encoding: [0x10,0x80,0x58,0xdc,0x00,0x00,0x7d,0x01]
20 global_load_dword_addtid v1, off offset:16 glc slc dlc
21 // GFX10: encoding: [0x10,0x90,0x5b,0xdc,0x00,0x00,0x7d,0x01]
23 global_store_dword_addtid v1, off offset:16 glc slc dlc
24 // GFX10: encoding: [0x10,0x90,0x5f,0xdc,0x00,0x01,0x7d,0x00]
26 global_store_dword v254, v1, s[2:3] offset:16
27 // GFX10: encoding: [0x10,0x80,0x70,0xdc,0xfe,0x01,0x02,0x00]
29 global_atomic_csub v2, v[0:1], v2, off offset:100 glc slc
30 // GFX10: encoding: [0x64,0x80,0xd3,0xdc,0x00,0x02,0x7d,0x02]
32 global_atomic_csub v2, v[0:1], v2, off glc
33 // GFX10: encoding: [0x00,0x80,0xd1,0xdc,0x00,0x02,0x7d,0x02]
35 global_atomic_csub v2, v0, v2, s[2:3] glc
36 // GFX10: encoding: [0x00,0x80,0xd1,0xdc,0x00,0x02,0x02,0x02]
38 global_atomic_csub v2, v0, v2, s[2:3] offset:100 glc slc
39 // GFX10: encoding: [0x64,0x80,0xd3,0xdc,0x00,0x02,0x02,0x02]
41 buffer_atomic_csub v5, off, s[8:11], s3 glc
42 // GFX10: encoding: [0x00,0x40,0xd0,0xe0,0x00,0x05,0x02,0x03]
44 buffer_atomic_csub v5, off, s[8:11], s3 offset:4095 glc
45 // GFX10: encoding: [0xff,0x4f,0xd0,0xe0,0x00,0x05,0x02,0x03]
47 buffer_atomic_csub v5, off, s[8:11], -1 offset:4095 glc
48 // GFX10: encoding: [0xff,0x4f,0xd0,0xe0,0x00,0x05,0x02,0xc1]
50 buffer_atomic_csub v5, v0, s[8:11], s3 offen offset:4095 glc
51 // GFX10: encoding: [0xff,0x5f,0xd0,0xe0,0x00,0x05,0x02,0x03]
53 buffer_atomic_csub v5, v0, s[8:11], s3 idxen offset:4095 glc
54 // GFX10: encoding: [0xff,0x6f,0xd0,0xe0,0x00,0x05,0x02,0x03]
56 buffer_atomic_csub v5, off, s[8:11], s3 glc slc
57 // GFX10: encoding: [0x00,0x40,0xd0,0xe0,0x00,0x05,0x42,0x03]
59 s_getreg_b32 s2, hwreg(HW_REG_SHADER_CYCLES)
60 // GFX10: encoding: [0x1d,0xf8,0x02,0xb9]
62 s_getreg_b32 s2, 29
63 // GFX10: s_getreg_b32 s2, hwreg(HW_REG_SHADER_CYCLES, 0, 1) ; encoding: [0x1d,0x00,0x02,0xb9]
65 s_getreg_b32 s2, hwreg(22)
66 // GFX10: s_getreg_b32 s2, hwreg(22) ; encoding: [0x16,0xf8,0x02,0xb9]
68 v_fma_legacy_f32 v0, v1, v2, v3
69 // GFX10: encoding: [0x00,0x00,0x40,0xd5,0x01,0x05,0x0e,0x04]
71 v_fma_legacy_f32 v0, v1, |v2|, -v3
72 // GFX10: encoding: [0x00,0x02,0x40,0xd5,0x01,0x05,0x0e,0x84]
74 v_fma_legacy_f32 v0, s1, 2.0, -v3
75 // GFX10: encoding: [0x00,0x00,0x40,0xd5,0x01,0xe8,0x0d,0x84]
77 v_fmac_legacy_f32 v0, v1, v2
78 // GFX10: encoding: [0x01,0x05,0x00,0x0c]
80 v_fmac_legacy_f32 v0, |v1|, -v2
81 // GFX10: encoding: [0x00,0x01,0x06,0xd5,0x01,0x05,0x02,0x40]
83 v_fmac_legacy_f32 v0, s1, 2.0
84 // GFX10: encoding: [0x00,0x00,0x06,0xd5,0x01,0xe8,0x01,0x00]
86 image_bvh_intersect_ray v[4:7], v[9:24], s[4:7]
87 // GFX10: encoding: [0x01,0x9f,0x98,0xf1,0x09,0x04,0x01,0x00]
89 image_bvh_intersect_ray v[4:7], v[9:16], s[4:7] a16
90 // GFX10: encoding: [0x01,0x9f,0x98,0xf1,0x09,0x04,0x01,0x40]
92 image_bvh64_intersect_ray v[4:7], v[9:24], s[4:7]
93 // GFX10: encoding: [0x01,0x9f,0x9c,0xf1,0x09,0x04,0x01,0x00]
95 image_bvh64_intersect_ray v[4:7], v[9:24], s[4:7] a16
96 // GFX10: encoding: [0x01,0x9f,0x9c,0xf1,0x09,0x04,0x01,0x40]
98 image_bvh_intersect_ray v[39:42], [v50, v46, v23, v17, v16, v15, v21, v20, v19, v37, v40], s[12:15]
99 // GFX10: encoding: [0x07,0x9f,0x98,0xf1,0x32,0x27,0x03,0x00,0x2e,0x17,0x11,0x10,0x0f,0x15,0x14,0x13,0x25,0x28,0x00,0x00]
101 image_bvh_intersect_ray v[39:42], [v50, v46, v23, v17, v16, v15, v21, v20], s[12:15] a16
102 // GFX10: encoding: [0x05,0x9f,0x98,0xf1,0x32,0x27,0x03,0x40,0x2e,0x17,0x11,0x10,0x0f,0x15,0x14,0x00]
104 image_bvh64_intersect_ray v[39:42], [v50, v46, v23, v17, v16, v15, v21, v20, v19, v37, v40, v42], s[12:15]
105 // GFX10: encoding: [0x07,0x9f,0x9c,0xf1,0x32,0x27,0x03,0x00,0x2e,0x17,0x11,0x10,0x0f,0x15,0x14,0x13,0x25,0x28,0x2a,0x00]
107 image_bvh64_intersect_ray v[39:42], [v50, v46, v23, v17, v16, v15, v21, v20, v19], s[12:15] a16
108 // GFX10: encoding: [0x05,0x9f,0x9c,0xf1,0x32,0x27,0x03,0x40,0x2e,0x17,0x11,0x10,0x0f,0x15,0x14,0x13]
110 image_msaa_load v[1:4], v[5:7], s[8:15] dmask:0xf dim:SQ_RSRC_IMG_2D_MSAA
111 // GFX10: encoding: [0x31,0x0f,0x00,0xf0,0x05,0x01,0x02,0x00]
113 image_msaa_load v[1:4], v[5:7], s[8:15] dmask:0xf dim:SQ_RSRC_IMG_2D_MSAA glc
114 // GFX10: encoding: [0x31,0x2f,0x00,0xf0,0x05,0x01,0x02,0x00]
116 image_msaa_load v5, v[1:3], s[8:15] dmask:0x1 dim:SQ_RSRC_IMG_2D_MSAA d16
117 // GFX10: encoding: [0x31,0x01,0x00,0xf0,0x01,0x05,0x02,0x80]
119 image_msaa_load v[1:4], v[5:8], s[8:15] dmask:0xf dim:SQ_RSRC_IMG_2D_MSAA_ARRAY
120 // GFX10: encoding: [0x39,0x0f,0x00,0xf0,0x05,0x01,0x02,0x00]
122 image_msaa_load v14, [v204,v11,v14,v19], s[40:47] dmask:0x1 dim:SQ_RSRC_IMG_2D_MSAA_ARRAY
123 // GFX10: encoding: [0x3b,0x01,0x00,0xf0,0xcc,0x0e,0x0a,0x00,0x0b,0x0e,0x13,0x00]