Index: llvm/trunk/lib/Target/AMDGPU/MIMGInstructions.td =================================================================== --- llvm/trunk/lib/Target/AMDGPU/MIMGInstructions.td +++ llvm/trunk/lib/Target/AMDGPU/MIMGInstructions.td @@ -58,6 +58,8 @@ MIMG_Mask; def NAME # _V2 # suffix : MIMG_NoSampler_Helper , MIMG_Mask; + def NAME # _V3 # suffix : MIMG_NoSampler_Helper , + MIMG_Mask; def NAME # _V4 # suffix : MIMG_NoSampler_Helper , MIMG_Mask; } @@ -120,6 +122,8 @@ MIMG_Mask; def NAME # _V2 # suffix : MIMG_Store_Helper , MIMG_Mask; + def NAME # _V3 # suffix : MIMG_Store_Helper , + MIMG_Mask; def NAME # _V4 # suffix : MIMG_Store_Helper , MIMG_Mask; } @@ -224,7 +228,8 @@ // So only one variant can be disassembled. V1 looks the safest to decode. defm _V1 : MIMG_Atomic_Helper_m ; defm _V2 : MIMG_Atomic_Helper_m ; - defm _V4 : MIMG_Atomic_Helper_m ; + defm _V3 : MIMG_Atomic_Helper_m ; + defm _V4 : MIMG_Atomic_Helper_m ; } multiclass MIMG_Atomic ; def _V2 # suffix : MIMG_Sampler_Helper , MIMG_Mask; + def _V3 # suffix : MIMG_Sampler_Helper , + MIMG_Mask; def _V4 # suffix : MIMG_Sampler_Helper , MIMG_Mask; def _V8 # suffix : MIMG_Sampler_Helper , @@ -334,6 +341,7 @@ string suffix> { def prefix # _V1 # suffix : MIMG_Gather_Helper ; def prefix # _V2 # suffix : MIMG_Gather_Helper ; + def prefix # _V3 # suffix : MIMG_Gather_Helper ; def prefix # _V4 # suffix : MIMG_Gather_Helper ; def prefix # _V8 # suffix : MIMG_Gather_Helper ; def prefix # _V16 # suffix : MIMG_Gather_Helper ; Index: llvm/trunk/test/MC/AMDGPU/mimg.s =================================================================== --- llvm/trunk/test/MC/AMDGPU/mimg.s +++ llvm/trunk/test/MC/AMDGPU/mimg.s @@ -19,6 +19,15 @@ image_load v[4:6], v[237:240], s[28:35] dmask:0x7 unorm // GCN: image_load v[4:6], v[237:240], s[28:35] dmask:0x7 unorm ; encoding: [0x00,0x17,0x00,0xf0,0xed,0x04,0x07,0x00] +image_load v4, v237, s[28:35] +// GCN: image_load v4, v237, s[28:35] ; encoding: [0x00,0x00,0x00,0xf0,0xed,0x04,0x07,0x00] + +image_load v4, v[237:238], s[28:35] +// GCN: image_load v4, v[237:238], s[28:35] ; encoding: [0x00,0x00,0x00,0xf0,0xed,0x04,0x07,0x00] + +image_load v4, v[237:239], s[28:35] +// GCN: image_load v4, v[237:239], s[28:35] ; encoding: [0x00,0x00,0x00,0xf0,0xed,0x04,0x07,0x00] + image_load v4, v[237:240], s[28:35] // GCN: image_load v4, v[237:240], s[28:35] ; encoding: [0x00,0x00,0x00,0xf0,0xed,0x04,0x07,0x00] @@ -43,6 +52,15 @@ image_store v[193:195], v[237:240], s[28:35] dmask:0x7 unorm // GCN: image_store v[193:195], v[237:240], s[28:35] dmask:0x7 unorm ; encoding: [0x00,0x17,0x20,0xf0,0xed,0xc1,0x07,0x00] +image_store v193, v237, s[28:35] +// GCN: image_store v193, v237, s[28:35] ; encoding: [0x00,0x00,0x20,0xf0,0xed,0xc1,0x07,0x00] + +image_store v193, v[237:238], s[28:35] +// GCN: image_store v193, v[237:238], s[28:35] ; encoding: [0x00,0x00,0x20,0xf0,0xed,0xc1,0x07,0x00] + +image_store v193, v[237:239], s[28:35] +// GCN: image_store v193, v[237:239], s[28:35] ; encoding: [0x00,0x00,0x20,0xf0,0xed,0xc1,0x07,0x00] + image_store v193, v[237:240], s[28:35] // GCN: image_store v193, v[237:240], s[28:35] ; encoding: [0x00,0x00,0x20,0xf0,0xed,0xc1,0x07,0x00] @@ -143,6 +161,15 @@ // Image Load/Store: PCK variants //===----------------------------------------------------------------------===// +image_load_mip_pck v5, v1, s[8:15] dmask:0x1 +// GCN: image_load_mip_pck v5, v1, s[8:15] dmask:0x1 ; encoding: [0x00,0x01,0x10,0xf0,0x01,0x05,0x02,0x00] + +image_load_mip_pck v5, v[1:2], s[8:15] dmask:0x1 +// GCN: image_load_mip_pck v5, v[1:2], s[8:15] dmask:0x1 ; encoding: [0x00,0x01,0x10,0xf0,0x01,0x05,0x02,0x00] + +image_load_mip_pck v5, v[1:3], s[8:15] dmask:0x1 +// GCN: image_load_mip_pck v5, v[1:3], s[8:15] dmask:0x1 ; encoding: [0x00,0x01,0x10,0xf0,0x01,0x05,0x02,0x00] + image_load_mip_pck v5, v[1:4], s[8:15] dmask:0x1 // GCN: image_load_mip_pck v5, v[1:4], s[8:15] dmask:0x1 ; encoding: [0x00,0x01,0x10,0xf0,0x01,0x05,0x02,0x00] @@ -166,6 +193,15 @@ // NOVI: error: invalid operand for instruction // NOGFX9: error: invalid operand for instruction +image_store_mip_pck v252, v2, s[12:19] dmask:0x1 unorm +// GCN: image_store_mip_pck v252, v2, s[12:19] dmask:0x1 unorm ; encoding: [0x00,0x11,0x2c,0xf0,0x02,0xfc,0x03,0x00] + +image_store_mip_pck v252, v[2:3], s[12:19] dmask:0x1 unorm +// GCN: image_store_mip_pck v252, v[2:3], s[12:19] dmask:0x1 unorm ; encoding: [0x00,0x11,0x2c,0xf0,0x02,0xfc,0x03,0x00] + +image_store_mip_pck v252, v[2:4], s[12:19] dmask:0x1 unorm +// GCN: image_store_mip_pck v252, v[2:4], s[12:19] dmask:0x1 unorm ; encoding: [0x00,0x11,0x2c,0xf0,0x02,0xfc,0x03,0x00] + image_store_mip_pck v252, v[2:5], s[12:19] dmask:0x1 unorm // GCN: image_store_mip_pck v252, v[2:5], s[12:19] dmask:0x1 unorm ; encoding: [0x00,0x11,0x2c,0xf0,0x02,0xfc,0x03,0x00] @@ -187,6 +223,15 @@ image_sample v[193:195], v[237:240], s[28:35], s[4:7] dmask:0x7 unorm // GCN: image_sample v[193:195], v[237:240], s[28:35], s[4:7] dmask:0x7 unorm ; encoding: [0x00,0x17,0x80,0xf0,0xed,0xc1,0x27,0x00] +image_sample v193, v237, s[28:35], s[4:7] +// GCN: image_sample v193, v237, s[28:35], s[4:7] ; encoding: [0x00,0x00,0x80,0xf0,0xed,0xc1,0x27,0x00] + +image_sample v193, v[237:238], s[28:35], s[4:7] +// GCN: image_sample v193, v[237:238], s[28:35], s[4:7] ; encoding: [0x00,0x00,0x80,0xf0,0xed,0xc1,0x27,0x00] + +image_sample v193, v[237:239], s[28:35], s[4:7] +// GCN: image_sample v193, v[237:239], s[28:35], s[4:7] ; encoding: [0x00,0x00,0x80,0xf0,0xed,0xc1,0x27,0x00] + image_sample v193, v[237:240], s[28:35], s[4:7] // GCN: image_sample v193, v[237:240], s[28:35], s[4:7] ; encoding: [0x00,0x00,0x80,0xf0,0xed,0xc1,0x27,0x00] @@ -226,6 +271,18 @@ // Image Atomics //===----------------------------------------------------------------------===// +image_atomic_add v4, v192, s[28:35] dmask:0x1 unorm glc +// SICI: image_atomic_add v4, v192, s[28:35] dmask:0x1 unorm glc ; encoding: [0x00,0x31,0x44,0xf0,0xc0,0x04,0x07,0x00] +// GFX89: image_atomic_add v4, v192, s[28:35] dmask:0x1 unorm glc ; encoding: [0x00,0x31,0x48,0xf0,0xc0,0x04,0x07,0x00] + +image_atomic_add v4, v[192:193], s[28:35] dmask:0x1 unorm glc +// SICI: image_atomic_add v4, v[192:193], s[28:35] dmask:0x1 unorm glc ; encoding: [0x00,0x31,0x44,0xf0,0xc0,0x04,0x07,0x00] +// GFX89: image_atomic_add v4, v[192:193], s[28:35] dmask:0x1 unorm glc ; encoding: [0x00,0x31,0x48,0xf0,0xc0,0x04,0x07,0x00] + +image_atomic_add v4, v[192:194], s[28:35] dmask:0x1 unorm glc +// SICI: image_atomic_add v4, v[192:194], s[28:35] dmask:0x1 unorm glc ; encoding: [0x00,0x31,0x44,0xf0,0xc0,0x04,0x07,0x00] +// GFX89: image_atomic_add v4, v[192:194], s[28:35] dmask:0x1 unorm glc ; encoding: [0x00,0x31,0x48,0xf0,0xc0,0x04,0x07,0x00] + image_atomic_add v4, v[192:195], s[28:35] dmask:0x1 unorm glc // SICI: image_atomic_add v4, v[192:195], s[28:35] dmask:0x1 unorm glc ; encoding: [0x00,0x31,0x44,0xf0,0xc0,0x04,0x07,0x00] // GFX89: image_atomic_add v4, v[192:195], s[28:35] dmask:0x1 unorm glc ; encoding: [0x00,0x31,0x48,0xf0,0xc0,0x04,0x07,0x00] @@ -283,6 +340,12 @@ image_gather4 v[5:8], v1, s[8:15], s[12:15] dmask:0x1 // GCN: image_gather4 v[5:8], v1, s[8:15], s[12:15] dmask:0x1 ; encoding: [0x00,0x01,0x00,0xf1,0x01,0x05,0x62,0x00] +image_gather4 v[5:8], v[1:2], s[8:15], s[12:15] dmask:0x1 +// GCN: image_gather4 v[5:8], v[1:2], s[8:15], s[12:15] dmask:0x1 ; encoding: [0x00,0x01,0x00,0xf1,0x01,0x05,0x62,0x00] + +image_gather4 v[5:8], v[1:3], s[8:15], s[12:15] dmask:0x1 +// GCN: image_gather4 v[5:8], v[1:3], s[8:15], s[12:15] dmask:0x1 ; encoding: [0x00,0x01,0x00,0xf1,0x01,0x05,0x62,0x00] + image_gather4 v[5:8], v[1:4], s[8:15], s[12:15] dmask:0x2 // GCN: image_gather4 v[5:8], v[1:4], s[8:15], s[12:15] dmask:0x2 ; encoding: [0x00,0x02,0x00,0xf1,0x01,0x05,0x62,0x00]