1// RUN: not llvm-mc -arch=amdgcn -show-encoding %s | FileCheck --check-prefix=GCN --check-prefix=SICI %s 2// RUN: not llvm-mc -arch=amdgcn -mcpu=fiji -show-encoding %s 2>&1 | FileCheck --check-prefix=GCN --check-prefix=VI --check-prefix=GFX89 %s 3// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx900 -show-encoding %s 2>&1 | FileCheck --check-prefix=GCN --check-prefix=GFX89 --check-prefix=GFX9 %s 4 5// RUN: not llvm-mc -arch=amdgcn -show-encoding %s 2>&1 | FileCheck --check-prefix=NOSICI --check-prefix=NOSICIVI %s 6// RUN: not llvm-mc -arch=amdgcn -mcpu=fiji -show-encoding %s 2>&1 | FileCheck --check-prefix=NOVI --check-prefix=NOSICIVI --check-prefix=NOGFX89 %s 7// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx900 -show-encoding %s 2>&1 | FileCheck --check-prefix=NOGFX89 %s 8 9s_mov_b32 s1, s2 10// SICI: s_mov_b32 s1, s2 ; encoding: [0x02,0x03,0x81,0xbe] 11// GFX89: s_mov_b32 s1, s2 ; encoding: [0x02,0x00,0x81,0xbe] 12 13s_mov_b32 s1, 1 14// SICI: s_mov_b32 s1, 1 ; encoding: [0x81,0x03,0x81,0xbe] 15// GFX89: s_mov_b32 s1, 1 ; encoding: [0x81,0x00,0x81,0xbe] 16 17s_mov_b32 s1, 100 18// SICI: s_mov_b32 s1, 0x64 ; encoding: [0xff,0x03,0x81,0xbe,0x64,0x00,0x00,0x00] 19// GFX89: s_mov_b32 s1, 0x64 ; encoding: [0xff,0x00,0x81,0xbe,0x64,0x00,0x00,0x00] 20 21// Literal constant sign bit 22s_mov_b32 s1, 0x80000000 23// SICI: s_mov_b32 s1, 0x80000000 ; encoding: [0xff,0x03,0x81,0xbe,0x00,0x00,0x00,0x80] 24// GFX89: s_mov_b32 s1, 0x80000000 ; encoding: [0xff,0x00,0x81,0xbe,0x00,0x00,0x00,0x80] 25 26// Negative 32-bit constant 27s_mov_b32 s0, 0xfe5163ab 28// SICI: s_mov_b32 s0, 0xfe5163ab ; encoding: [0xff,0x03,0x80,0xbe,0xab,0x63,0x51,0xfe] 29// GFX89: s_mov_b32 s0, 0xfe5163ab ; encoding: [0xff,0x00,0x80,0xbe,0xab,0x63,0x51,0xfe] 30 31s_mov_b64 s[2:3], s[4:5] 32// SICI: s_mov_b64 s[2:3], s[4:5] ; encoding: [0x04,0x04,0x82,0xbe] 33// GFX89: s_mov_b64 s[2:3], s[4:5] ; encoding: [0x04,0x01,0x82,0xbe] 34 35s_mov_b64 s[2:3], 0xffffffffffffffff 36// SICI: s_mov_b64 s[2:3], -1 ; encoding: [0xc1,0x04,0x82,0xbe] 37// GFX89: s_mov_b64 s[2:3], -1 ; encoding: [0xc1,0x01,0x82,0xbe] 38 39s_mov_b64 s[2:3], 0xffffffff 40// SICI: s_mov_b64 s[2:3], 0xffffffff ; encoding: [0xff,0x04,0x82,0xbe,0xff,0xff,0xff,0xff] 41// GFX89: s_mov_b64 s[2:3], 0xffffffff ; encoding: [0xff,0x01,0x82,0xbe,0xff,0xff,0xff,0xff] 42 43s_mov_b64 s[0:1], 0x80000000 44// SICI: s_mov_b64 s[0:1], 0x80000000 ; encoding: [0xff,0x04,0x80,0xbe,0x00,0x00,0x00,0x80] 45// GFX89: s_mov_b64 s[0:1], 0x80000000 ; encoding: [0xff,0x01,0x80,0xbe,0x00,0x00,0x00,0x80] 46 47s_mov_b64 s[102:103], -1 48// SICI: s_mov_b64 s[102:103], -1 ; encoding: [0xc1,0x04,0xe6,0xbe] 49// NOGFX89: error: not a valid operand 50 51s_cmov_b32 s1, 200 52// SICI: s_cmov_b32 s1, 0xc8 ; encoding: [0xff,0x05,0x81,0xbe,0xc8,0x00,0x00,0x00] 53// GFX89: s_cmov_b32 s1, 0xc8 ; encoding: [0xff,0x02,0x81,0xbe,0xc8,0x00,0x00,0x00] 54 55s_cmov_b32 s1, 1.0 56// SICI: s_cmov_b32 s1, 1.0 ; encoding: [0xf2,0x05,0x81,0xbe] 57// GFX89: s_cmov_b32 s1, 1.0 ; encoding: [0xf2,0x02,0x81,0xbe] 58 59s_cmov_b32 s1, s2 60// SICI: s_cmov_b32 s1, s2 ; encoding: [0x02,0x05,0x81,0xbe] 61// GFX89: s_cmov_b32 s1, s2 ; encoding: [0x02,0x02,0x81,0xbe] 62 63//s_cmov_b64 s[2:3], 1.0 64//GCN-FIXME: s_cmov_b64 s[2:3], 1.0 ; encoding: [0xf2,0x05,0x82,0xb3] 65 66s_cmov_b64 s[2:3], s[4:5] 67// SICI: s_cmov_b64 s[2:3], s[4:5] ; encoding: [0x04,0x06,0x82,0xbe] 68// GFX89: s_cmov_b64 s[2:3], s[4:5] ; encoding: [0x04,0x03,0x82,0xbe] 69 70s_not_b32 s1, s2 71// SICI: s_not_b32 s1, s2 ; encoding: [0x02,0x07,0x81,0xbe] 72// GFX89: s_not_b32 s1, s2 ; encoding: [0x02,0x04,0x81,0xbe] 73 74s_not_b64 s[2:3], s[4:5] 75// SICI: s_not_b64 s[2:3], s[4:5] ; encoding: [0x04,0x08,0x82,0xbe] 76// GFX89: s_not_b64 s[2:3], s[4:5] ; encoding: [0x04,0x05,0x82,0xbe] 77 78s_wqm_b32 s1, s2 79// SICI: s_wqm_b32 s1, s2 ; encoding: [0x02,0x09,0x81,0xbe] 80// GFX89: s_wqm_b32 s1, s2 ; encoding: [0x02,0x06,0x81,0xbe] 81 82s_wqm_b64 s[2:3], s[4:5] 83// SICI: s_wqm_b64 s[2:3], s[4:5] ; encoding: [0x04,0x0a,0x82,0xbe] 84// GFX89: s_wqm_b64 s[2:3], s[4:5] ; encoding: [0x04,0x07,0x82,0xbe] 85 86s_brev_b32 s1, s2 87// SICI: s_brev_b32 s1, s2 ; encoding: [0x02,0x0b,0x81,0xbe] 88// GFX89: s_brev_b32 s1, s2 ; encoding: [0x02,0x08,0x81,0xbe] 89 90s_brev_b64 s[2:3], s[4:5] 91// SICI: s_brev_b64 s[2:3], s[4:5] ; encoding: [0x04,0x0c,0x82,0xbe] 92// GFX89: s_brev_b64 s[2:3], s[4:5] ; encoding: [0x04,0x09,0x82,0xbe] 93 94s_bcnt0_i32_b32 s1, s2 95// SICI: s_bcnt0_i32_b32 s1, s2 ; encoding: [0x02,0x0d,0x81,0xbe] 96// GFX89: s_bcnt0_i32_b32 s1, s2 ; encoding: [0x02,0x0a,0x81,0xbe] 97 98s_bcnt0_i32_b64 s1, s[2:3] 99// SICI: s_bcnt0_i32_b64 s1, s[2:3] ; encoding: [0x02,0x0e,0x81,0xbe] 100// GFX89: s_bcnt0_i32_b64 s1, s[2:3] ; encoding: [0x02,0x0b,0x81,0xbe] 101 102s_bcnt1_i32_b32 s1, s2 103// SICI: s_bcnt1_i32_b32 s1, s2 ; encoding: [0x02,0x0f,0x81,0xbe] 104// GFX89: s_bcnt1_i32_b32 s1, s2 ; encoding: [0x02,0x0c,0x81,0xbe] 105 106s_bcnt1_i32_b64 s1, s[2:3] 107// SICI: s_bcnt1_i32_b64 s1, s[2:3] ; encoding: [0x02,0x10,0x81,0xbe] 108// GFX89: s_bcnt1_i32_b64 s1, s[2:3] ; encoding: [0x02,0x0d,0x81,0xbe] 109 110s_ff0_i32_b32 s1, s2 111// SICI: s_ff0_i32_b32 s1, s2 ; encoding: [0x02,0x11,0x81,0xbe] 112// GFX89: s_ff0_i32_b32 s1, s2 ; encoding: [0x02,0x0e,0x81,0xbe] 113 114s_ff0_i32_b64 s1, s[2:3] 115// SICI: s_ff0_i32_b64 s1, s[2:3] ; encoding: [0x02,0x12,0x81,0xbe] 116// GFX89: s_ff0_i32_b64 s1, s[2:3] ; encoding: [0x02,0x0f,0x81,0xbe] 117 118s_ff1_i32_b32 s1, s2 119// SICI: s_ff1_i32_b32 s1, s2 ; encoding: [0x02,0x13,0x81,0xbe] 120// GFX89: s_ff1_i32_b32 s1, s2 ; encoding: [0x02,0x10,0x81,0xbe] 121 122s_ff1_i32_b64 s1, s[2:3] 123// SICI: s_ff1_i32_b64 s1, s[2:3] ; encoding: [0x02,0x14,0x81,0xbe] 124// GFX89: s_ff1_i32_b64 s1, s[2:3] ; encoding: [0x02,0x11,0x81,0xbe] 125 126s_flbit_i32_b32 s1, s2 127// SICI: s_flbit_i32_b32 s1, s2 ; encoding: [0x02,0x15,0x81,0xbe] 128// GFX89: s_flbit_i32_b32 s1, s2 ; encoding: [0x02,0x12,0x81,0xbe] 129 130s_flbit_i32_b64 s1, s[2:3] 131// SICI: s_flbit_i32_b64 s1, s[2:3] ; encoding: [0x02,0x16,0x81,0xbe] 132// GFX89: s_flbit_i32_b64 s1, s[2:3] ; encoding: [0x02,0x13,0x81,0xbe] 133 134s_flbit_i32 s1, s2 135// SICI: s_flbit_i32 s1, s2 ; encoding: [0x02,0x17,0x81,0xbe] 136// GFX89: s_flbit_i32 s1, s2 ; encoding: [0x02,0x14,0x81,0xbe] 137 138s_flbit_i32_i64 s1, s[2:3] 139// SICI: s_flbit_i32_i64 s1, s[2:3] ; encoding: [0x02,0x18,0x81,0xbe] 140// GFX89: s_flbit_i32_i64 s1, s[2:3] ; encoding: [0x02,0x15,0x81,0xbe] 141 142s_sext_i32_i8 s1, s2 143// SICI: s_sext_i32_i8 s1, s2 ; encoding: [0x02,0x19,0x81,0xbe] 144// GFX89: s_sext_i32_i8 s1, s2 ; encoding: [0x02,0x16,0x81,0xbe] 145 146s_sext_i32_i16 s1, s2 147// SICI: s_sext_i32_i16 s1, s2 ; encoding: [0x02,0x1a,0x81,0xbe] 148// GFX89: s_sext_i32_i16 s1, s2 ; encoding: [0x02,0x17,0x81,0xbe] 149 150s_bitset0_b32 s1, s2 151// SICI: s_bitset0_b32 s1, s2 ; encoding: [0x02,0x1b,0x81,0xbe] 152// GFX89: s_bitset0_b32 s1, s2 ; encoding: [0x02,0x18,0x81,0xbe] 153 154s_bitset0_b64 s[2:3], s4 155// SICI: s_bitset0_b64 s[2:3], s4 ; encoding: [0x04,0x1c,0x82,0xbe] 156// GFX89: s_bitset0_b64 s[2:3], s4 ; encoding: [0x04,0x19,0x82,0xbe] 157 158s_bitset1_b32 s1, s2 159// SICI: s_bitset1_b32 s1, s2 ; encoding: [0x02,0x1d,0x81,0xbe] 160// GFX89: s_bitset1_b32 s1, s2 ; encoding: [0x02,0x1a,0x81,0xbe] 161 162s_bitset1_b64 s[2:3], s4 163// SICI: s_bitset1_b64 s[2:3], s4 ; encoding: [0x04,0x1e,0x82,0xbe] 164// GFX89: s_bitset1_b64 s[2:3], s4 ; encoding: [0x04,0x1b,0x82,0xbe] 165 166s_getpc_b64 s[2:3] 167// SICI: s_getpc_b64 s[2:3] ; encoding: [0x00,0x1f,0x82,0xbe] 168// GFX89: s_getpc_b64 s[2:3] ; encoding: [0x00,0x1c,0x82,0xbe] 169 170s_setpc_b64 s[4:5] 171// SICI: s_setpc_b64 s[4:5] ; encoding: [0x04,0x20,0x80,0xbe] 172// GFX89: s_setpc_b64 s[4:5] ; encoding: [0x04,0x1d,0x80,0xbe] 173 174s_swappc_b64 s[2:3], s[4:5] 175// SICI: s_swappc_b64 s[2:3], s[4:5] ; encoding: [0x04,0x21,0x82,0xbe] 176// GFX89: s_swappc_b64 s[2:3], s[4:5] ; encoding: [0x04,0x1e,0x82,0xbe] 177 178s_rfe_b64 s[4:5] 179// SICI: s_rfe_b64 s[4:5] ; encoding: [0x04,0x22,0x80,0xbe] 180// GFX89: s_rfe_b64 s[4:5] ; encoding: [0x04,0x1f,0x80,0xbe] 181 182s_and_saveexec_b64 s[2:3], s[4:5] 183// SICI: s_and_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x24,0x82,0xbe] 184// GFX89: s_and_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x20,0x82,0xbe] 185 186s_or_saveexec_b64 s[2:3], s[4:5] 187// SICI: s_or_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x25,0x82,0xbe] 188// GFX89: s_or_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x21,0x82,0xbe] 189 190s_xor_saveexec_b64 s[2:3], s[4:5] 191// SICI: s_xor_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x26,0x82,0xbe] 192// GFX89: s_xor_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x22,0x82,0xbe] 193 194s_andn2_saveexec_b64 s[2:3], s[4:5] 195// SICI: s_andn2_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x27,0x82,0xbe] 196// GFX89: s_andn2_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x23,0x82,0xbe] 197 198s_orn2_saveexec_b64 s[2:3], s[4:5] 199// SICI: s_orn2_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x28,0x82,0xbe] 200// GFX89: s_orn2_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x24,0x82,0xbe] 201 202s_nand_saveexec_b64 s[2:3], s[4:5] 203// SICI: s_nand_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x29,0x82,0xbe] 204// GFX89: s_nand_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x25,0x82,0xbe] 205 206s_nor_saveexec_b64 s[2:3], s[4:5] 207// SICI: s_nor_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x2a,0x82,0xbe] 208// GFX89: s_nor_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x26,0x82,0xbe] 209 210s_xnor_saveexec_b64 s[2:3], s[4:5] 211// SICI: s_xnor_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x2b,0x82,0xbe] 212// GFX89: s_xnor_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x27,0x82,0xbe] 213 214s_quadmask_b32 s1, s2 215// SICI: s_quadmask_b32 s1, s2 ; encoding: [0x02,0x2c,0x81,0xbe] 216// GFX89: s_quadmask_b32 s1, s2 ; encoding: [0x02,0x28,0x81,0xbe] 217 218s_quadmask_b64 s[2:3], s[4:5] 219// SICI: s_quadmask_b64 s[2:3], s[4:5] ; encoding: [0x04,0x2d,0x82,0xbe] 220// GFX89: s_quadmask_b64 s[2:3], s[4:5] ; encoding: [0x04,0x29,0x82,0xbe] 221 222s_movrels_b32 s1, s2 223// SICI: s_movrels_b32 s1, s2 ; encoding: [0x02,0x2e,0x81,0xbe] 224// GFX89: s_movrels_b32 s1, s2 ; encoding: [0x02,0x2a,0x81,0xbe] 225 226s_movrels_b64 s[2:3], s[4:5] 227// SICI: s_movrels_b64 s[2:3], s[4:5] ; encoding: [0x04,0x2f,0x82,0xbe] 228// GFX89: s_movrels_b64 s[2:3], s[4:5] ; encoding: [0x04,0x2b,0x82,0xbe] 229 230s_movreld_b32 s1, s2 231// SICI: s_movreld_b32 s1, s2 ; encoding: [0x02,0x30,0x81,0xbe] 232// GFX89: s_movreld_b32 s1, s2 ; encoding: [0x02,0x2c,0x81,0xbe] 233 234s_movreld_b64 s[2:3], s[4:5] 235// SICI: s_movreld_b64 s[2:3], s[4:5] ; encoding: [0x04,0x31,0x82,0xbe] 236// GFX89: s_movreld_b64 s[2:3], s[4:5] ; encoding: [0x04,0x2d,0x82,0xbe] 237 238s_cbranch_join s4 239// SICI: s_cbranch_join s4 ; encoding: [0x04,0x32,0x80,0xbe] 240// GFX89: s_cbranch_join s4 ; encoding: [0x04,0x2e,0x80,0xbe] 241 242s_cbranch_join 1 243// NOSICI: error: invalid operand for instruction 244// NOGFX89: error: invalid operand for instruction 245 246s_cbranch_join 100 247// NOSICI: error: invalid operand for instruction 248// NOGFX89: error: invalid operand for instruction 249 250s_abs_i32 s1, s2 251// SICI: s_abs_i32 s1, s2 ; encoding: [0x02,0x34,0x81,0xbe] 252// GFX89: s_abs_i32 s1, s2 ; encoding: [0x02,0x30,0x81,0xbe] 253 254s_mov_fed_b32 s1, s2 255// SICI: s_mov_fed_b32 s1, s2 ; encoding: [0x02,0x35,0x81,0xbe] 256 257s_set_gpr_idx_idx s0 258// GFX89: s_set_gpr_idx_idx s0 ; encoding: [0x00,0x32,0x80,0xbe] 259// NOSICI: error: instruction not supported on this GPU 260 261s_andn1_saveexec_b64 s[100:101], s[2:3] 262// GFX9: s_andn1_saveexec_b64 s[100:101], s[2:3] ; encoding: [0x02,0x33,0xe4,0xbe] 263// NOSICIVI: error: instruction not supported on this GPU 264 265s_andn1_saveexec_b64 s[10:11], s[4:5] 266// GFX9: s_andn1_saveexec_b64 s[10:11], s[4:5] ; encoding: [0x04,0x33,0x8a,0xbe] 267// NOSICIVI: error: instruction not supported on this GPU 268 269s_andn1_saveexec_b64 s[10:11], -1 270// GFX9: s_andn1_saveexec_b64 s[10:11], -1 ; encoding: [0xc1,0x33,0x8a,0xbe] 271// NOSICIVI: error: instruction not supported on this GPU 272 273s_andn1_saveexec_b64 s[10:11], 0xaf123456 274// GFX9: s_andn1_saveexec_b64 s[10:11], 0xaf123456 ; encoding: [0xff,0x33,0x8a,0xbe,0x56,0x34,0x12,0xaf] 275// NOSICIVI: error: instruction not supported on this GPU 276 277s_andn1_wrexec_b64 s[10:11], s[2:3] 278// GFX9: s_andn1_wrexec_b64 s[10:11], s[2:3] ; encoding: [0x02,0x35,0x8a,0xbe] 279// NOSICIVI: error: instruction not supported on this GPU 280 281s_andn2_wrexec_b64 s[12:13], s[2:3] 282// GFX9: s_andn2_wrexec_b64 s[12:13], s[2:3] ; encoding: [0x02,0x36,0x8c,0xbe] 283// NOSICIVI: error: instruction not supported on this GPU 284 285s_orn1_saveexec_b64 s[10:11], 0 286// GFX9: s_orn1_saveexec_b64 s[10:11], 0 ; encoding: [0x80,0x34,0x8a,0xbe] 287// NOSICIVI: error: instruction not supported on this GPU 288 289s_bitreplicate_b64_b32 s[10:11], s101 290// GFX9: s_bitreplicate_b64_b32 s[10:11], s101 ; encoding: [0x65,0x37,0x8a,0xbe] 291// NOSICIVI: error: instruction not supported on this GPU 292 293s_bitreplicate_b64_b32 s[10:11], -1 294// GFX9: s_bitreplicate_b64_b32 s[10:11], -1 ; encoding: [0xc1,0x37,0x8a,0xbe] 295// NOSICIVI: error: instruction not supported on this GPU 296 297s_bitreplicate_b64_b32 s[10:11], 0x3f717273 298// GFX9: s_bitreplicate_b64_b32 s[10:11], 0x3f717273 ; encoding: [0xff,0x37,0x8a,0xbe,0x73,0x72,0x71,0x3f] 299// NOSICIVI: error: instruction not supported on this GPU 300