1# RUN: llvm-mc -triple=amdgcn -mcpu=gfx1030 -disassemble -show-encoding < %s | FileCheck -check-prefix=GFX10 %s 2# RUN: llvm-mc -triple=amdgcn -mcpu=gfx1031 -disassemble -show-encoding < %s | FileCheck -check-prefix=GFX10 %s 3# RUN: llvm-mc -triple=amdgcn -mcpu=gfx1032 -disassemble -show-encoding < %s | FileCheck -check-prefix=GFX10 %s 4# RUN: llvm-mc -triple=amdgcn -mcpu=gfx1033 -disassemble -show-encoding < %s | FileCheck -check-prefix=GFX10 %s 5# RUN: llvm-mc -triple=amdgcn -mcpu=gfx1034 -disassemble -show-encoding < %s | FileCheck -check-prefix=GFX10 %s 6# RUN: llvm-mc -triple=amdgcn -mcpu=gfx1035 -disassemble -show-encoding < %s | FileCheck -check-prefix=GFX10 %s 7# RUN: llvm-mc -triple=amdgcn -mcpu=gfx1036 -disassemble -show-encoding < %s | FileCheck -check-prefix=GFX10 %s 8 9# GFX10: global_load_dword_addtid v1, s[2:3] offset:16 100x10,0x80,0x58,0xdc,0x00,0x00,0x02,0x01 11 12# GFX10: global_load_dword_addtid v1, s[2:3] offset:16 glc slc dlc 130x10,0x90,0x5b,0xdc,0x00,0x00,0x02,0x01 14 15# GFX10: global_store_dword_addtid v1, s[2:3] offset:16 glc slc dlc 160x10,0x90,0x5f,0xdc,0x00,0x01,0x02,0x00 17 18# GFX10: global_load_dword_addtid v1, off offset:16 190x10,0x80,0x58,0xdc,0x00,0x00,0x7d,0x01 20 21# GFX10: global_load_dword_addtid v1, off offset:16 glc slc dlc 220x10,0x90,0x5b,0xdc,0x00,0x00,0x7d,0x01 23 24# GFX10: global_store_dword_addtid v1, off offset:16 glc slc dlc 250x10,0x90,0x5f,0xdc,0x00,0x01,0x7d,0x00 26 27# GFX10: global_store_dword v254, v1, s[2:3] offset:16 280x10,0x80,0x70,0xdc,0xfe,0x01,0x02,0x00 29 30# GFX10: global_atomic_csub v2, v[0:1], v2, off offset:100 glc slc 310x64,0x80,0xd3,0xdc,0x00,0x02,0x7d,0x02 32 33# GFX10: global_atomic_csub v[0:1], v2, off offset:100 slc 340x64,0x80,0xd2,0xdc,0x00,0x02,0x7d,0x00 35 36# GFX10: global_atomic_csub v2, v[0:1], v2, off glc 370x00,0x80,0xd1,0xdc,0x00,0x02,0x7d,0x02 38 39# GFX10: global_atomic_csub v[0:1], v2, off 400x00,0x80,0xd0,0xdc,0x00,0x02,0x7d,0x00 41 42# GFX10: global_atomic_csub v2, v0, v2, s[2:3] glc 430x00,0x80,0xd1,0xdc,0x00,0x02,0x02,0x02 44 45# GFX10: global_atomic_csub v2, v0, v2, s[2:3] offset:100 glc slc 460x64,0x80,0xd3,0xdc,0x00,0x02,0x02,0x02 47 48# GFX10: buffer_atomic_csub v5, off, s[8:11], s3 glc 490x00,0x40,0xd0,0xe0,0x00,0x05,0x02,0x03 50 51# GFX10: buffer_atomic_csub v5, off, s[8:11], s3 520x00,0x00,0xd0,0xe0,0x00,0x05,0x02,0x03 53 54# GFX10: buffer_atomic_csub v5, off, s[8:11], s3 offset:4095 glc 550xff,0x4f,0xd0,0xe0,0x00,0x05,0x02,0x03 56 57# GFX10: buffer_atomic_csub v5, off, s[8:11], -1 offset:4095 glc 580xff,0x4f,0xd0,0xe0,0x00,0x05,0x02,0xc1 59 60# GFX10: buffer_atomic_csub v5, v0, s[8:11], s3 offen offset:4095 glc 610xff,0x5f,0xd0,0xe0,0x00,0x05,0x02,0x03 62 63# GFX10: buffer_atomic_csub v5, v0, s[8:11], s3 idxen offset:4095 glc 640xff,0x6f,0xd0,0xe0,0x00,0x05,0x02,0x03 65 66# GFX10: buffer_atomic_csub v5, off, s[8:11], s3 glc slc 670x00,0x40,0xd0,0xe0,0x00,0x05,0x42,0x03 68 69# GFX10: buffer_atomic_csub v5, off, s[8:11], s3 slc 700x00,0x00,0xd0,0xe0,0x00,0x05,0x42,0x03 71 72# GFX10: v_fma_legacy_f32 v0, v1, v2, v3 730x00,0x00,0x40,0xd5,0x01,0x05,0x0e,0x04 74 75# GFX10: v_fma_legacy_f32 v0, v1, |v2|, -v3 760x00,0x02,0x40,0xd5,0x01,0x05,0x0e,0x84 77 78# GFX10: v_fma_legacy_f32 v0, s1, 2.0, -v3 790x00,0x00,0x40,0xd5,0x01,0xe8,0x0d,0x84 80 81# GFX10: v_fmac_legacy_f32_e32 v0, v1, v2 820x01,0x05,0x00,0x0c 83 84# GFX10: v_fmac_legacy_f32_e64 v0, |v1|, -v2 850x00,0x01,0x06,0xd5,0x01,0x05,0x02,0x40 86 87# GFX10: v_fmac_legacy_f32_e64 v0, s1, 2.0 880x00,0x00,0x06,0xd5,0x01,0xe8,0x01,0x00 89 90# GFX10: image_bvh_intersect_ray v[4:7], v[9:19], s[4:7] 910x01,0x9f,0x98,0xf1,0x09,0x04,0x01,0x00 92 93# GFX10: image_bvh_intersect_ray v[4:7], v[9:16], s[4:7] a16 940x01,0x9f,0x98,0xf1,0x09,0x04,0x01,0x40 95 96# GFX10: image_bvh64_intersect_ray v[4:7], v[9:20], s[4:7] 970x01,0x9f,0x9c,0xf1,0x09,0x04,0x01,0x00 98 99# GFX10: image_bvh64_intersect_ray v[4:7], v[9:17], s[4:7] a16 1000x01,0x9f,0x9c,0xf1,0x09,0x04,0x01,0x40 101 102# GFX10: image_bvh_intersect_ray v[39:42], [v50, v46, v23, v17, v16, v15, v21, v20, v19, v37, v40], s[12:15] 1030x07,0x9f,0x98,0xf1,0x32,0x27,0x03,0x00,0x2e,0x17,0x11,0x10,0x0f,0x15,0x14,0x13,0x25,0x28,0x00,0x00 104 105# GFX10: image_bvh_intersect_ray v[39:42], [v50, v46, v23, v17, v16, v15, v21, v20], s[12:15] a16 1060x05,0x9f,0x98,0xf1,0x32,0x27,0x03,0x40,0x2e,0x17,0x11,0x10,0x0f,0x15,0x14,0x00 107 108# GFX10: image_bvh64_intersect_ray v[39:42], [v50, v46, v23, v17, v16, v15, v21, v20, v19, v37, v40, v42], s[12:15] 1090x07,0x9f,0x9c,0xf1,0x32,0x27,0x03,0x00,0x2e,0x17,0x11,0x10,0x0f,0x15,0x14,0x13,0x25,0x28,0x2a,0x00 110 111# GFX10: image_bvh64_intersect_ray v[39:42], [v50, v46, v23, v17, v16, v15, v21, v20, v19], s[12:15] a16 1120x05,0x9f,0x9c,0xf1,0x32,0x27,0x03,0x40,0x2e,0x17,0x11,0x10,0x0f,0x15,0x14,0x13 113 114# GFX10: image_msaa_load v[1:4], v5, s[8:15] dmask:0xf dim:SQ_RSRC_IMG_1D 1150x01,0x0f,0x00,0xf0,0x05,0x01,0x02,0x00 116 117# GFX10: image_msaa_load v[1:4], v5, s[8:15] dmask:0xf dim:SQ_RSRC_IMG_1D glc 1180x01,0x2f,0x00,0xf0,0x05,0x01,0x02,0x00 119 120# GFX10: image_msaa_load v5, v[1:2], s[8:15] dmask:0x1 dim:SQ_RSRC_IMG_2D d16 1210x09,0x01,0x00,0xf0,0x01,0x05,0x02,0x80 122 123# GFX10: image_msaa_load v[1:4], v5, s[8:15] dmask:0xf dim:SQ_RSRC_IMG_1D 1240x01,0x0f,0x00,0xf0,0x05,0x01,0x02,0x00 125 126# GFX10: image_msaa_load v14, [v204, v11, v14, v19], s[40:47] dmask:0x1 dim:SQ_RSRC_IMG_2D_MSAA_ARRAY 1270x3b,0x01,0x00,0xf0,0xcc,0x0e,0x0a,0x00,0x0b,0x0e,0x13,0x00 128 129# GFX10: scratch_load_ubyte v1, off, off ; encoding: [0x00,0x40,0x20,0xdc,0x00,0x00,0x7f,0x01] 1300x00,0x40,0x20,0xdc,0x00,0x00,0x7f,0x01 131 132# GFX10: scratch_load_sbyte v1, off, off ; encoding: [0x00,0x40,0x24,0xdc,0x00,0x00,0x7f,0x01] 1330x00,0x40,0x24,0xdc,0x00,0x00,0x7f,0x01 134 135# GFX10: scratch_load_ushort v1, off, off ; encoding: [0x00,0x40,0x28,0xdc,0x00,0x00,0x7f,0x01] 1360x00,0x40,0x28,0xdc,0x00,0x00,0x7f,0x01 137 138# GFX10: scratch_load_sshort v1, off, off ; encoding: [0x00,0x40,0x2c,0xdc,0x00,0x00,0x7f,0x01] 1390x00,0x40,0x2c,0xdc,0x00,0x00,0x7f,0x01 140 141# GFX10: scratch_load_dword v1, off, off ; encoding: [0x00,0x40,0x30,0xdc,0x00,0x00,0x7f,0x01] 1420x00,0x40,0x30,0xdc,0x00,0x00,0x7f,0x01 143 144# GFX10: scratch_load_dwordx2 v[1:2], off, off ; encoding: [0x00,0x40,0x34,0xdc,0x00,0x00,0x7f,0x01] 1450x00,0x40,0x34,0xdc,0x00,0x00,0x7f,0x01 146 147# GFX10: scratch_load_dwordx3 v[1:3], off, off ; encoding: [0x00,0x40,0x3c,0xdc,0x00,0x00,0x7f,0x01] 1480x00,0x40,0x3c,0xdc,0x00,0x00,0x7f,0x01 149 150# GFX10: scratch_load_dwordx4 v[1:4], off, off ; encoding: [0x00,0x40,0x38,0xdc,0x00,0x00,0x7f,0x01] 1510x00,0x40,0x38,0xdc,0x00,0x00,0x7f,0x01 152 153# GFX10: scratch_load_dword v1, off, off offset:2047 ; encoding: [0xff,0x47,0x30,0xdc,0x00,0x00,0x7f,0x01] 1540xff,0x47,0x30,0xdc,0x00,0x00,0x7f,0x01 155 156# GFX10: scratch_store_byte off, v2, off ; encoding: [0x00,0x40,0x60,0xdc,0x00,0x02,0x7f,0x00] 1570x00,0x40,0x60,0xdc,0x00,0x02,0x7f,0x00 158 159# GFX10: scratch_store_short off, v2, off ; encoding: [0x00,0x40,0x68,0xdc,0x00,0x02,0x7f,0x00] 1600x00,0x40,0x68,0xdc,0x00,0x02,0x7f,0x00 161 162# GFX10: scratch_store_dword off, v2, off ; encoding: [0x00,0x40,0x70,0xdc,0x00,0x02,0x7f,0x00] 1630x00,0x40,0x70,0xdc,0x00,0x02,0x7f,0x00 164 165# GFX10: scratch_store_dwordx2 off, v[2:3], off ; encoding: [0x00,0x40,0x74,0xdc,0x00,0x02,0x7f,0x00] 1660x00,0x40,0x74,0xdc,0x00,0x02,0x7f,0x00 167 168# GFX10: scratch_store_dwordx3 off, v[2:4], off ; encoding: [0x00,0x40,0x7c,0xdc,0x00,0x02,0x7f,0x00] 1690x00,0x40,0x7c,0xdc,0x00,0x02,0x7f,0x00 170 171# GFX10: scratch_store_dwordx4 off, v[2:5], off ; encoding: [0x00,0x40,0x78,0xdc,0x00,0x02,0x7f,0x00] 1720x00,0x40,0x78,0xdc,0x00,0x02,0x7f,0x00 173 174# GFX10: scratch_store_dword off, v2, off offset:2047 ; encoding: [0xff,0x47,0x70,0xdc,0x00,0x02,0x7f,0x00] 1750xff,0x47,0x70,0xdc,0x00,0x02,0x7f,0x00 176 177# GFX10: scratch_load_ubyte_d16 v1, off, off ; encoding: [0x00,0x40,0x80,0xdc,0x00,0x00,0x7f,0x01] 1780x00,0x40,0x80,0xdc,0x00,0x00,0x7f,0x01 179 180# GFX10: scratch_load_ubyte_d16_hi v1, off, off ; encoding: [0x00,0x40,0x84,0xdc,0x00,0x00,0x7f,0x01] 1810x00,0x40,0x84,0xdc,0x00,0x00,0x7f,0x01 182 183# GFX10: scratch_load_sbyte_d16 v1, off, off ; encoding: [0x00,0x40,0x88,0xdc,0x00,0x00,0x7f,0x01] 1840x00,0x40,0x88,0xdc,0x00,0x00,0x7f,0x01 185 186# GFX10: scratch_load_sbyte_d16_hi v1, off, off ; encoding: [0x00,0x40,0x8c,0xdc,0x00,0x00,0x7f,0x01] 1870x00,0x40,0x8c,0xdc,0x00,0x00,0x7f,0x01 188 189# GFX10: scratch_load_short_d16 v1, off, off ; encoding: [0x00,0x40,0x90,0xdc,0x00,0x00,0x7f,0x01] 1900x00,0x40,0x90,0xdc,0x00,0x00,0x7f,0x01 191 192# GFX10: scratch_load_short_d16_hi v1, off, off ; encoding: [0x00,0x40,0x94,0xdc,0x00,0x00,0x7f,0x01] 1930x00,0x40,0x94,0xdc,0x00,0x00,0x7f,0x01 194 195# GFX10: scratch_store_byte_d16_hi off, v2, off ; encoding: [0x00,0x40,0x64,0xdc,0x00,0x02,0x7f,0x00] 1960x00,0x40,0x64,0xdc,0x00,0x02,0x7f,0x00 197 198# GFX10: scratch_store_short_d16_hi off, v2, off ; encoding: [0x00,0x40,0x6c,0xdc,0x00,0x02,0x7f,0x00] 1990x00,0x40,0x6c,0xdc,0x00,0x02,0x7f,0x00 200 201#===------------------------------------------------------------------------===# 202# s_waitcnt_depctr. 203#===------------------------------------------------------------------------===# 204 205# GFX10: s_waitcnt_depctr 0x20 ; encoding: [0x20,0x00,0xa3,0xbf] 2060x20,0x00,0xa3,0xbf 207 208# GFX10: s_waitcnt_depctr 0x40 ; encoding: [0x40,0x00,0xa3,0xbf] 2090x40,0x00,0xa3,0xbf 210 211# GFX10: s_waitcnt_depctr 0x60 ; encoding: [0x60,0x00,0xa3,0xbf] 2120x60,0x00,0xa3,0xbf 213 214# GFX10: s_waitcnt_depctr 0xffff ; encoding: [0xff,0xff,0xa3,0xbf] 2150xff,0xff,0xa3,0xbf 216 217# GFX10: s_waitcnt_depctr depctr_hold_cnt(0) ; encoding: [0x1f,0xff,0xa3,0xbf] 2180x1f,0xff,0xa3,0xbf 219 220# GFX10: s_waitcnt_depctr depctr_sa_sdst(0) ; encoding: [0x9e,0xff,0xa3,0xbf] 2210x9e,0xff,0xa3,0xbf 222 223# GFX10: s_waitcnt_depctr depctr_va_vdst(0) ; encoding: [0x9f,0x0f,0xa3,0xbf] 2240x9f,0x0f,0xa3,0xbf 225 226# GFX10: s_waitcnt_depctr depctr_va_vdst(1) ; encoding: [0x9f,0x1f,0xa3,0xbf] 2270x9f,0x1f,0xa3,0xbf 228 229# GFX10: s_waitcnt_depctr depctr_va_vdst(14) ; encoding: [0x9f,0xef,0xa3,0xbf] 2300x9f,0xef,0xa3,0xbf 231 232# GFX10: s_waitcnt_depctr depctr_va_sdst(0) ; encoding: [0x9f,0xf1,0xa3,0xbf] 2330x9f,0xf1,0xa3,0xbf 234 235# GFX10: s_waitcnt_depctr depctr_va_sdst(6) ; encoding: [0x9f,0xfd,0xa3,0xbf] 2360x9f,0xfd,0xa3,0xbf 237 238# GFX10: s_waitcnt_depctr depctr_va_ssrc(0) ; encoding: [0x9f,0xfe,0xa3,0xbf] 2390x9f,0xfe,0xa3,0xbf 240 241# GFX10: s_waitcnt_depctr depctr_va_vcc(0) ; encoding: [0x9d,0xff,0xa3,0xbf] 2420x9d,0xff,0xa3,0xbf 243 244# GFX10: s_waitcnt_depctr depctr_vm_vsrc(0) ; encoding: [0x83,0xff,0xa3,0xbf] 2450x83,0xff,0xa3,0xbf 246 247# GFX10: s_waitcnt_depctr depctr_vm_vsrc(1) ; encoding: [0x87,0xff,0xa3,0xbf] 2480x87,0xff,0xa3,0xbf 249 250# GFX10: s_waitcnt_depctr depctr_vm_vsrc(6) ; encoding: [0x9b,0xff,0xa3,0xbf] 2510x9b,0xff,0xa3,0xbf 252 253# GFX10: s_waitcnt_depctr depctr_hold_cnt(0) depctr_sa_sdst(0) depctr_va_vdst(0) depctr_va_sdst(0) depctr_va_ssrc(0) depctr_va_vcc(0) depctr_vm_vsrc(0) ; encoding: [0x00,0x00,0xa3,0xbf] 2540x00,0x00,0xa3,0xbf 255 256# GFX10: s_waitcnt_depctr depctr_hold_cnt(1) depctr_sa_sdst(1) depctr_va_vdst(15) depctr_va_sdst(7) depctr_va_ssrc(1) depctr_va_vcc(1) depctr_vm_vsrc(7) ; encoding: [0x9f,0xff,0xa3,0xbf] 2570x9f,0xff,0xa3,0xbf 258 259# GFX10: s_waitcnt_depctr depctr_va_vdst(1) depctr_va_sdst(1) depctr_vm_vsrc(1) ; encoding: [0x87,0x13,0xa3,0xbf] 2600x87,0x13,0xa3,0xbf 261 262# GFX10: scratch_load_dword off, off offset:1024 lds ; encoding: [0x00,0x64,0x30,0xdc,0x00,0x00,0x7f,0x00] 2630x00,0x64,0x30,0xdc,0x00,0x00,0x7f,0x00 264 265# GFX10: scratch_load_ubyte off, off offset:1024 lds ; encoding: [0x00,0x64,0x20,0xdc,0x00,0x00,0x7f,0x00] 2660x00,0x64,0x20,0xdc,0x00,0x00,0x7f,0x00 267 268# GFX10: scratch_load_sbyte off, off offset:1024 lds ; encoding: [0x00,0x64,0x24,0xdc,0x00,0x00,0x7f,0x00] 2690x00,0x64,0x24,0xdc,0x00,0x00,0x7f,0x00 270 271# GFX10: scratch_load_ushort off, off offset:1024 lds ; encoding: [0x00,0x64,0x28,0xdc,0x00,0x00,0x7f,0x00] 2720x00,0x64,0x28,0xdc,0x00,0x00,0x7f,0x00 273 274# GFX10: scratch_load_sshort off, off offset:1024 lds ; encoding: [0x00,0x64,0x2c,0xdc,0x00,0x00,0x7f,0x00] 2750x00,0x64,0x2c,0xdc,0x00,0x00,0x7f,0x00 276