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=tahiti -show-encoding %s | FileCheck --check-prefix=GCN --check-prefix=SICI %s 3// RUN: not llvm-mc -arch=amdgcn -mcpu=bonaire -show-encoding %s | FileCheck --check-prefix=GCN --check-prefix=SICI %s 4// RUN: not llvm-mc -arch=amdgcn -mcpu=fiji -show-encoding %s | FileCheck --check-prefix=GCN --check-prefix=GFX89 %s 5// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx900 -show-encoding %s | FileCheck --check-prefix=GCN --check-prefix=GFX89 --check-prefix=GFX9 %s 6 7// RUN: not llvm-mc -arch=amdgcn -show-encoding %s 2>&1 | FileCheck --check-prefix=NOSICIVI %s 8// RUN: not llvm-mc -arch=amdgcn -mcpu=tahiti -show-encoding %s 2>&1 | FileCheck --check-prefix=NOSICIVI %s 9// RUN: not llvm-mc -arch=amdgcn -mcpu=bonaire -show-encoding %s 2>&1 | FileCheck --check-prefix=NOSICIVI %s 10// RUN: not llvm-mc -arch=amdgcn -mcpu=fiji -show-encoding %s 2>&1 | FileCheck --check-prefix=NOSICIVI --check-prefix=NOVI --check-prefix=NOGFX89 %s 11// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx900 -show-encoding %s 2>&1 | FileCheck --check-prefix=NOGFX89 %s 12 13s_add_u32 s1, s2, s3 14// GCN: s_add_u32 s1, s2, s3 ; encoding: [0x02,0x03,0x01,0x80] 15 16s_sub_u32 s1, s2, s3 17// GCN: s_sub_u32 s1, s2, s3 ; encoding: [0x02,0x03,0x81,0x80] 18 19s_add_i32 s1, s2, s3 20// GCN: s_add_i32 s1, s2, s3 ; encoding: [0x02,0x03,0x01,0x81] 21 22s_sub_i32 s1, s2, s3 23// GCN: s_sub_i32 s1, s2, s3 ; encoding: [0x02,0x03,0x81,0x81] 24 25s_addc_u32 s1, s2, s3 26// GCN: s_addc_u32 s1, s2, s3 ; encoding: [0x02,0x03,0x01,0x82] 27 28s_subb_u32 s1, s2, s3 29// GCN: s_subb_u32 s1, s2, s3 ; encoding: [0x02,0x03,0x81,0x82] 30 31s_min_i32 s1, s2, s3 32// GCN: s_min_i32 s1, s2, s3 ; encoding: [0x02,0x03,0x01,0x83] 33 34s_min_u32 s1, s2, s3 35// GCN: s_min_u32 s1, s2, s3 ; encoding: [0x02,0x03,0x81,0x83] 36 37s_max_i32 s1, s2, s3 38// GCN: s_max_i32 s1, s2, s3 ; encoding: [0x02,0x03,0x01,0x84] 39 40s_max_u32 s1, s2, s3 41// GCN: s_max_u32 s1, s2, s3 ; encoding: [0x02,0x03,0x81,0x84] 42 43s_cselect_b32 s1, s2, s3 44// GCN: s_cselect_b32 s1, s2, s3 ; encoding: [0x02,0x03,0x01,0x85] 45 46s_cselect_b64 s[2:3], s[4:5], s[6:7] 47// GCN: s_cselect_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x85] 48 49s_and_b32 s2, s4, s6 50// SICI: s_and_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x87] 51// GFX89: s_and_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x86] 52 53s_and_b64 s[2:3], s[4:5], s[6:7] 54// SICI: s_and_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x87] 55// GFX89: s_and_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x86] 56 57s_or_b32 s2, s4, s6 58// SICI: s_or_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x88] 59// GFX89: s_or_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x87] 60 61s_or_b64 s[2:3], s[4:5], s[6:7] 62// SICI: s_or_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x88] 63// GFX89: s_or_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x87] 64 65s_xor_b32 s2, s4, s6 66// SICI: s_xor_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x89] 67// GFX89: s_xor_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x88] 68 69s_xor_b64 s[2:3], s[4:5], s[6:7] 70// SICI: s_xor_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x89] 71// GFX89: s_xor_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x88] 72 73s_andn2_b32 s2, s4, s6 74// SICI: s_andn2_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x8a] 75// GFX89: s_andn2_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x89] 76 77s_andn2_b64 s[2:3], s[4:5], s[6:7] 78// SICI: s_andn2_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x8a] 79// GFX89: s_andn2_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x89] 80 81s_orn2_b32 s2, s4, s6 82// SICI: s_orn2_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x8b] 83// GFX89: s_orn2_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x8a] 84 85s_orn2_b64 s[2:3], s[4:5], s[6:7] 86// SICI: s_orn2_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x8b] 87// GFX89: s_orn2_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x8a] 88 89s_nand_b32 s2, s4, s6 90// SICI: s_nand_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x8c] 91// GFX89: s_nand_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x8b] 92 93s_nand_b64 s[2:3], s[4:5], s[6:7] 94// SICI: s_nand_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x8c] 95// GFX89: s_nand_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x8b] 96 97s_nor_b32 s2, s4, s6 98// SICI: s_nor_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x8d] 99// GFX89: s_nor_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x8c] 100 101s_nor_b64 s[2:3], s[4:5], s[6:7] 102// SICI: s_nor_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x8d] 103// GFX89: s_nor_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x8c] 104 105s_xnor_b32 s2, s4, s6 106// SICI: s_xnor_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x8e] 107// GFX89: s_xnor_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x8d] 108 109s_xnor_b64 s[2:3], s[4:5], s[6:7] 110// SICI: s_xnor_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x8e] 111// GFX89: s_xnor_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x8d] 112 113s_lshl_b32 s2, s4, s6 114// SICI: s_lshl_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x8f] 115// GFX89: s_lshl_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x8e] 116 117s_lshl_b64 s[2:3], s[4:5], s6 118// SICI: s_lshl_b64 s[2:3], s[4:5], s6 ; encoding: [0x04,0x06,0x82,0x8f] 119// GFX89: s_lshl_b64 s[2:3], s[4:5], s6 ; encoding: [0x04,0x06,0x82,0x8e] 120 121s_lshr_b32 s2, s4, s6 122// SICI: s_lshr_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x90] 123// GFX89: s_lshr_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x8f] 124 125s_lshr_b64 s[2:3], s[4:5], s6 126// SICI: s_lshr_b64 s[2:3], s[4:5], s6 ; encoding: [0x04,0x06,0x82,0x90] 127// GFX89: s_lshr_b64 s[2:3], s[4:5], s6 ; encoding: [0x04,0x06,0x82,0x8f] 128 129s_ashr_i32 s2, s4, s6 130// SICI: s_ashr_i32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x91] 131// GFX89: s_ashr_i32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x90] 132 133s_ashr_i64 s[2:3], s[4:5], s6 134// SICI: s_ashr_i64 s[2:3], s[4:5], s6 ; encoding: [0x04,0x06,0x82,0x91] 135// GFX89: s_ashr_i64 s[2:3], s[4:5], s6 ; encoding: [0x04,0x06,0x82,0x90] 136 137s_bfm_b32 s2, s4, s6 138// SICI: s_bfm_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x92] 139// GFX89: s_bfm_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x91] 140 141s_bfm_b64 s[2:3], s4, s6 142// SICI: s_bfm_b64 s[2:3], s4, s6 ; encoding: [0x04,0x06,0x82,0x92] 143// GFX89: s_bfm_b64 s[2:3], s4, s6 ; encoding: [0x04,0x06,0x82,0x91] 144 145s_mul_i32 s2, s4, s6 146// SICI: s_mul_i32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x93] 147// GFX89: s_mul_i32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x92] 148 149s_bfe_u32 s2, s4, s6 150// SICI: s_bfe_u32 s2, s4, s6 ; encoding: [0x04,0x06,0x82,0x93] 151// GFX89: s_bfe_u32 s2, s4, s6 ; encoding: [0x04,0x06,0x82,0x92] 152 153s_bfe_i32 s2, s4, s6 154// SICI: s_bfe_i32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x94] 155// GFX89: s_bfe_i32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x93] 156 157s_bfe_u64 s[2:3], s[4:5], s6 158// SICI: s_bfe_u64 s[2:3], s[4:5], s6 ; encoding: [0x04,0x06,0x82,0x94] 159// GFX89: s_bfe_u64 s[2:3], s[4:5], s6 ; encoding: [0x04,0x06,0x82,0x93] 160 161s_bfe_i64 s[2:3], s[4:5], s6 162// SICI: s_bfe_i64 s[2:3], s[4:5], s6 ; encoding: [0x04,0x06,0x02,0x95] 163// GFX89: s_bfe_i64 s[2:3], s[4:5], s6 ; encoding: [0x04,0x06,0x02,0x94] 164 165s_cbranch_g_fork s[4:5], s[6:7] 166// SICI: s_cbranch_g_fork s[4:5], s[6:7] ; encoding: [0x04,0x06,0x80,0x95] 167// GFX89: s_cbranch_g_fork s[4:5], s[6:7] ; encoding: [0x04,0x06,0x80,0x94] 168 169s_cbranch_g_fork 1, s[6:7] 170// SICI: s_cbranch_g_fork 1, s[6:7] ; encoding: [0x81,0x06,0x80,0x95] 171// GFX89: s_cbranch_g_fork 1, s[6:7] ; encoding: [0x81,0x06,0x80,0x94] 172 173s_cbranch_g_fork s[6:7], 2 174// SICI: s_cbranch_g_fork s[6:7], 2 ; encoding: [0x06,0x82,0x80,0x95] 175// GFX89: s_cbranch_g_fork s[6:7], 2 ; encoding: [0x06,0x82,0x80,0x94] 176 177s_absdiff_i32 s2, s4, s6 178// SICI: s_absdiff_i32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x96] 179// GFX89: s_absdiff_i32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x95] 180 181s_add_u32 s101, s102, s103 182// SICI: s_add_u32 s101, s102, s103 ; encoding: [0x66,0x67,0x65,0x80] 183// NOGFX89: error: not a valid operand 184 185s_lshl1_add_u32 s5, s1, s2 186// GFX9: s_lshl1_add_u32 s5, s1, s2 ; encoding: [0x01,0x02,0x05,0x97] 187// NOSICIVI: error 188 189s_lshl1_add_u32 s5, -1, s2 190// GFX9: s_lshl1_add_u32 s5, -1, s2 ; encoding: [0xc1,0x02,0x05,0x97] 191// NOSICIVI: error 192 193s_lshl1_add_u32 s5, s1, 0 194// GFX9: s_lshl1_add_u32 s5, s1, 0 ; encoding: [0x01,0x80,0x05,0x97] 195// NOSICIVI: error 196 197s_lshl1_add_u32 s5, s1, 0x3f717273 198// GFX9: s_lshl1_add_u32 s5, s1, 0x3f717273 ; encoding: [0x01,0xff,0x05,0x97,0x73,0x72,0x71,0x3f] 199// NOSICIVI: error 200 201s_lshl2_add_u32 s101, s1, s2 202// GFX9: s_lshl2_add_u32 s101, s1, s2 ; encoding: [0x01,0x02,0xe5,0x97] 203// NOSICIVI: error 204 205s_lshl2_add_u32 s5, 0xaf123456, s2 206// GFX9: s_lshl2_add_u32 s5, 0xaf123456, s2 ; encoding: [0xff,0x02,0x85,0x97,0x56,0x34,0x12,0xaf] 207// NOSICIVI: error 208 209s_lshl3_add_u32 s5, 0x3f717273, s2 210// GFX9: s_lshl3_add_u32 s5, 0x3f717273, s2 ; encoding: [0xff,0x02,0x05,0x98,0x73,0x72,0x71,0x3f] 211// NOSICIVI: error 212 213s_lshl3_add_u32 s5, s1, s101 214// GFX9: s_lshl3_add_u32 s5, s1, s101 ; encoding: [0x01,0x65,0x05,0x98] 215// NOSICIVI: error 216 217s_lshl4_add_u32 s5, s1, 0xaf123456 218// GFX9: s_lshl4_add_u32 s5, s1, 0xaf123456 ; encoding: [0x01,0xff,0x85,0x98,0x56,0x34,0x12,0xaf] 219// NOSICIVI: error 220 221s_lshl4_add_u32 s5, -1, s2 222// GFX9: s_lshl4_add_u32 s5, -1, s2 ; encoding: [0xc1,0x02,0x85,0x98] 223// NOSICIVI: error 224 225s_mul_hi_i32 s5, s101, s2 226// GFX9: s_mul_hi_i32 s5, s101, s2 ; encoding: [0x65,0x02,0x85,0x96] 227// NOSICIVI: error 228 229s_mul_hi_i32 s5, 0, s2 230// GFX9: s_mul_hi_i32 s5, 0, s2 ; encoding: [0x80,0x02,0x85,0x96] 231// NOSICIVI: error 232 233s_mul_hi_i32 s5, 0x3f717273, s2 234// GFX9: s_mul_hi_i32 s5, 0x3f717273, s2 ; encoding: [0xff,0x02,0x85,0x96,0x73,0x72,0x71,0x3f] 235// NOSICIVI: error 236 237s_mul_hi_i32 s5, s1, s101 238// GFX9: s_mul_hi_i32 s5, s1, s101 ; encoding: [0x01,0x65,0x85,0x96] 239// NOSICIVI: error 240 241s_mul_hi_i32 s5, s1, 0 242// GFX9: s_mul_hi_i32 s5, s1, 0 ; encoding: [0x01,0x80,0x85,0x96] 243// NOSICIVI: error 244 245s_mul_hi_u32 s5, s1, 0x3f717273 246// GFX9: s_mul_hi_u32 s5, s1, 0x3f717273 ; encoding: [0x01,0xff,0x05,0x96,0x73,0x72,0x71,0x3f] 247// NOSICIVI: error 248 249s_mul_hi_u32 s5, s1, s101 250// GFX9: s_mul_hi_u32 s5, s1, s101 ; encoding: [0x01,0x65,0x05,0x96] 251// NOSICIVI: error 252 253s_mul_hi_u32 s5, s1, 0 254// GFX9: s_mul_hi_u32 s5, s1, 0 ; encoding: [0x01,0x80,0x05,0x96] 255// NOSICIVI: error 256