Add VI encodings.
Reformat sopp.s to match style of other files.
Differential Revision: http://reviews.llvm.org/D18084
llvm-svn: 263540
-// RUN: llvm-mc -arch=amdgcn -show-encoding %s | FileCheck %s
-// RUN: llvm-mc -arch=amdgcn -mcpu=SI -show-encoding %s | FileCheck %s
+// RUN: llvm-mc -arch=amdgcn -show-encoding %s | FileCheck --check-prefix=GCN --check-prefix=SICI %s
+// RUN: llvm-mc -arch=amdgcn -mcpu=SI -show-encoding %s | FileCheck --check-prefix=GCN --check-prefix=SICI %s
+// RUN: not llvm-mc -arch=amdgcn -mcpu=fiji -show-encoding %s 2>&1 | FileCheck --check-prefix=GCN --check-prefix=VI %s
+// RUN: not llvm-mc -arch=amdgcn -mcpu=fiji -show-encoding %s 2>&1 | FileCheck --check-prefix=NOVI %s
s_mov_b32 s1, s2
-// CHECK: s_mov_b32 s1, s2 ; encoding: [0x02,0x03,0x81,0xbe]
+// SICI: s_mov_b32 s1, s2 ; encoding: [0x02,0x03,0x81,0xbe]
+// VI: s_mov_b32 s1, s2 ; encoding: [0x02,0x00,0x81,0xbe]
s_mov_b32 s1, 1
-// CHECK: s_mov_b32 s1, 1 ; encoding: [0x81,0x03,0x81,0xbe]
+// SICI: s_mov_b32 s1, 1 ; encoding: [0x81,0x03,0x81,0xbe]
+// VI: s_mov_b32 s1, 1 ; encoding: [0x81,0x00,0x81,0xbe]
s_mov_b32 s1, 100
-// CHECK: s_mov_b32 s1, 0x64 ; encoding: [0xff,0x03,0x81,0xbe,0x64,0x00,0x00,0x00]
+// SICI: s_mov_b32 s1, 0x64 ; encoding: [0xff,0x03,0x81,0xbe,0x64,0x00,0x00,0x00]
+// VI: s_mov_b32 s1, 0x64 ; encoding: [0xff,0x00,0x81,0xbe,0x64,0x00,0x00,0x00]
// Literal constant sign bit
s_mov_b32 s1, 0x80000000
-// CHECK: s_mov_b32 s1, 0x80000000 ; encoding: [0xff,0x03,0x81,0xbe,0x00,0x00,0x00,0x80]
+// SICI: s_mov_b32 s1, 0x80000000 ; encoding: [0xff,0x03,0x81,0xbe,0x00,0x00,0x00,0x80]
+// VI: s_mov_b32 s1, 0x80000000 ; encoding: [0xff,0x00,0x81,0xbe,0x00,0x00,0x00,0x80]
// Negative 32-bit constant
s_mov_b32 s0, 0xfe5163ab
-// CHECK: s_mov_b32 s0, 0xfe5163ab ; encoding: [0xff,0x03,0x80,0xbe,0xab,0x63,0x51,0xfe]
+// SICI: s_mov_b32 s0, 0xfe5163ab ; encoding: [0xff,0x03,0x80,0xbe,0xab,0x63,0x51,0xfe]
+// VI: s_mov_b32 s0, 0xfe5163ab ; encoding: [0xff,0x00,0x80,0xbe,0xab,0x63,0x51,0xfe]
s_mov_b64 s[2:3], s[4:5]
-// CHECK: s_mov_b64 s[2:3], s[4:5] ; encoding: [0x04,0x04,0x82,0xbe]
+// SICI: s_mov_b64 s[2:3], s[4:5] ; encoding: [0x04,0x04,0x82,0xbe]
+// VI: s_mov_b64 s[2:3], s[4:5] ; encoding: [0x04,0x01,0x82,0xbe]
s_mov_b64 s[2:3], 0xffffffffffffffff
-// CHECK: s_mov_b64 s[2:3], -1 ; encoding: [0xc1,0x04,0x82,0xbe]
+// SICI: s_mov_b64 s[2:3], -1 ; encoding: [0xc1,0x04,0x82,0xbe]
+// VI: s_mov_b64 s[2:3], -1 ; encoding: [0xc1,0x01,0x82,0xbe]
s_mov_b64 s[2:3], 0xffffffff
-// CHECK: s_mov_b64 s[2:3], 0xffffffff ; encoding: [0xff,0x04,0x82,0xbe,0xff,0xff,0xff,0xff]
+// SICI: s_mov_b64 s[2:3], 0xffffffff ; encoding: [0xff,0x04,0x82,0xbe,0xff,0xff,0xff,0xff]
+// VI: s_mov_b64 s[2:3], 0xffffffff ; encoding: [0xff,0x01,0x82,0xbe,0xff,0xff,0xff,0xff]
s_mov_b64 s[0:1], 0x80000000
-// CHECK: s_mov_b64 s[0:1], 0x80000000 ; encoding: [0xff,0x04,0x80,0xbe,0x00,0x00,0x00,0x80]
+// SICI: s_mov_b64 s[0:1], 0x80000000 ; encoding: [0xff,0x04,0x80,0xbe,0x00,0x00,0x00,0x80]
+// VI: s_mov_b64 s[0:1], 0x80000000 ; encoding: [0xff,0x01,0x80,0xbe,0x00,0x00,0x00,0x80]
s_mov_b64 s[102:103], -1
-// CHECK: s_mov_b64 s[102:103], -1 ; encoding: [0xc1,0x04,0xe6,0xbe]
+// SICI: s_mov_b64 s[102:103], -1 ; encoding: [0xc1,0x04,0xe6,0xbe]
+// NOVI: error: invalid operand for instruction
s_cmov_b32 s1, 200
-// CHECK: s_cmov_b32 s1, 0xc8 ; encoding: [0xff,0x05,0x81,0xbe,0xc8,0x00,0x00,0x00]
+// SICI: s_cmov_b32 s1, 0xc8 ; encoding: [0xff,0x05,0x81,0xbe,0xc8,0x00,0x00,0x00]
+// VI: s_cmov_b32 s1, 0xc8 ; encoding: [0xff,0x02,0x81,0xbe,0xc8,0x00,0x00,0x00]
s_cmov_b32 s1, 1.0
-// CHECK: s_cmov_b32 s1, 1.0 ; encoding: [0xf2,0x05,0x81,0xbe]
-
-//s_cmov_b64 s[2:3], 1.0
-//CHECK-FIXME: s_cmov_b64 s[2:3], 1.0 ; encoding: [0xf2,0x05,0x82,0xb3]
-
-//===----------------------------------------------------------------------===//
-// Instructions
-//===----------------------------------------------------------------------===//
-
-s_mov_b32 s1, s2
-// CHECK: s_mov_b32 s1, s2 ; encoding: [0x02,0x03,0x81,0xbe]
-
-s_mov_b64 s[2:3], s[4:5]
-// CHECK: s_mov_b64 s[2:3], s[4:5] ; encoding: [0x04,0x04,0x82,0xbe]
+// SICI: s_cmov_b32 s1, 1.0 ; encoding: [0xf2,0x05,0x81,0xbe]
+// VI: s_cmov_b32 s1, 1.0 ; encoding: [0xf2,0x02,0x81,0xbe]
s_cmov_b32 s1, s2
-// CHECK: s_cmov_b32 s1, s2 ; encoding: [0x02,0x05,0x81,0xbe]
+// SICI: s_cmov_b32 s1, s2 ; encoding: [0x02,0x05,0x81,0xbe]
+// VI: s_cmov_b32 s1, s2 ; encoding: [0x02,0x02,0x81,0xbe]
+
+//s_cmov_b64 s[2:3], 1.0
+//GCN-FIXME: s_cmov_b64 s[2:3], 1.0 ; encoding: [0xf2,0x05,0x82,0xb3]
s_cmov_b64 s[2:3], s[4:5]
-// CHECK: s_cmov_b64 s[2:3], s[4:5] ; encoding: [0x04,0x06,0x82,0xbe]
+// SICI: s_cmov_b64 s[2:3], s[4:5] ; encoding: [0x04,0x06,0x82,0xbe]
+// VI: s_cmov_b64 s[2:3], s[4:5] ; encoding: [0x04,0x03,0x82,0xbe]
s_not_b32 s1, s2
-// CHECK: s_not_b32 s1, s2 ; encoding: [0x02,0x07,0x81,0xbe]
+// SICI: s_not_b32 s1, s2 ; encoding: [0x02,0x07,0x81,0xbe]
+// VI: s_not_b32 s1, s2 ; encoding: [0x02,0x04,0x81,0xbe]
s_not_b64 s[2:3], s[4:5]
-// CHECK: s_not_b64 s[2:3], s[4:5] ; encoding: [0x04,0x08,0x82,0xbe]
+// SICI: s_not_b64 s[2:3], s[4:5] ; encoding: [0x04,0x08,0x82,0xbe]
+// VI: s_not_b64 s[2:3], s[4:5] ; encoding: [0x04,0x05,0x82,0xbe]
s_wqm_b32 s1, s2
-// CHECK: s_wqm_b32 s1, s2 ; encoding: [0x02,0x09,0x81,0xbe]
+// SICI: s_wqm_b32 s1, s2 ; encoding: [0x02,0x09,0x81,0xbe]
+// VI: s_wqm_b32 s1, s2 ; encoding: [0x02,0x06,0x81,0xbe]
s_wqm_b64 s[2:3], s[4:5]
-// CHECK: s_wqm_b64 s[2:3], s[4:5] ; encoding: [0x04,0x0a,0x82,0xbe]
+// SICI: s_wqm_b64 s[2:3], s[4:5] ; encoding: [0x04,0x0a,0x82,0xbe]
+// VI: s_wqm_b64 s[2:3], s[4:5] ; encoding: [0x04,0x07,0x82,0xbe]
s_brev_b32 s1, s2
-// CHECK: s_brev_b32 s1, s2 ; encoding: [0x02,0x0b,0x81,0xbe]
+// SICI: s_brev_b32 s1, s2 ; encoding: [0x02,0x0b,0x81,0xbe]
+// VI: s_brev_b32 s1, s2 ; encoding: [0x02,0x08,0x81,0xbe]
s_brev_b64 s[2:3], s[4:5]
-// CHECK: s_brev_b64 s[2:3], s[4:5] ; encoding: [0x04,0x0c,0x82,0xbe]
+// SICI: s_brev_b64 s[2:3], s[4:5] ; encoding: [0x04,0x0c,0x82,0xbe]
+// VI: s_brev_b64 s[2:3], s[4:5] ; encoding: [0x04,0x09,0x82,0xbe]
s_bcnt0_i32_b32 s1, s2
-// CHECK: s_bcnt0_i32_b32 s1, s2 ; encoding: [0x02,0x0d,0x81,0xbe]
+// SICI: s_bcnt0_i32_b32 s1, s2 ; encoding: [0x02,0x0d,0x81,0xbe]
+// VI: s_bcnt0_i32_b32 s1, s2 ; encoding: [0x02,0x0a,0x81,0xbe]
s_bcnt0_i32_b64 s1, s[2:3]
-// CHECK: s_bcnt0_i32_b64 s1, s[2:3] ; encoding: [0x02,0x0e,0x81,0xbe]
+// SICI: s_bcnt0_i32_b64 s1, s[2:3] ; encoding: [0x02,0x0e,0x81,0xbe]
+// VI: s_bcnt0_i32_b64 s1, s[2:3] ; encoding: [0x02,0x0b,0x81,0xbe]
s_bcnt1_i32_b32 s1, s2
-// CHECK: s_bcnt1_i32_b32 s1, s2 ; encoding: [0x02,0x0f,0x81,0xbe]
+// SICI: s_bcnt1_i32_b32 s1, s2 ; encoding: [0x02,0x0f,0x81,0xbe]
+// VI: s_bcnt1_i32_b32 s1, s2 ; encoding: [0x02,0x0c,0x81,0xbe]
s_bcnt1_i32_b64 s1, s[2:3]
-// CHECK: s_bcnt1_i32_b64 s1, s[2:3] ; encoding: [0x02,0x10,0x81,0xbe]
+// SICI: s_bcnt1_i32_b64 s1, s[2:3] ; encoding: [0x02,0x10,0x81,0xbe]
+// VI: s_bcnt1_i32_b64 s1, s[2:3] ; encoding: [0x02,0x0d,0x81,0xbe]
s_ff0_i32_b32 s1, s2
-// CHECK: s_ff0_i32_b32 s1, s2 ; encoding: [0x02,0x11,0x81,0xbe]
+// SICI: s_ff0_i32_b32 s1, s2 ; encoding: [0x02,0x11,0x81,0xbe]
+// VI: s_ff0_i32_b32 s1, s2 ; encoding: [0x02,0x0e,0x81,0xbe]
s_ff0_i32_b64 s1, s[2:3]
-// CHECK: s_ff0_i32_b64 s1, s[2:3] ; encoding: [0x02,0x12,0x81,0xbe]
+// SICI: s_ff0_i32_b64 s1, s[2:3] ; encoding: [0x02,0x12,0x81,0xbe]
+// VI: s_ff0_i32_b64 s1, s[2:3] ; encoding: [0x02,0x0f,0x81,0xbe]
s_ff1_i32_b32 s1, s2
-// CHECK: s_ff1_i32_b32 s1, s2 ; encoding: [0x02,0x13,0x81,0xbe]
+// SICI: s_ff1_i32_b32 s1, s2 ; encoding: [0x02,0x13,0x81,0xbe]
+// VI: s_ff1_i32_b32 s1, s2 ; encoding: [0x02,0x10,0x81,0xbe]
s_ff1_i32_b64 s1, s[2:3]
-// CHECK: s_ff1_i32_b64 s1, s[2:3] ; encoding: [0x02,0x14,0x81,0xbe]
+// SICI: s_ff1_i32_b64 s1, s[2:3] ; encoding: [0x02,0x14,0x81,0xbe]
+// VI: s_ff1_i32_b64 s1, s[2:3] ; encoding: [0x02,0x11,0x81,0xbe]
s_flbit_i32_b32 s1, s2
-// CHECK: s_flbit_i32_b32 s1, s2 ; encoding: [0x02,0x15,0x81,0xbe]
+// SICI: s_flbit_i32_b32 s1, s2 ; encoding: [0x02,0x15,0x81,0xbe]
+// VI: s_flbit_i32_b32 s1, s2 ; encoding: [0x02,0x12,0x81,0xbe]
s_flbit_i32_b64 s1, s[2:3]
-// CHECK: s_flbit_i32_b64 s1, s[2:3] ; encoding: [0x02,0x16,0x81,0xbe]
+// SICI: s_flbit_i32_b64 s1, s[2:3] ; encoding: [0x02,0x16,0x81,0xbe]
+// VI: s_flbit_i32_b64 s1, s[2:3] ; encoding: [0x02,0x13,0x81,0xbe]
s_flbit_i32 s1, s2
-// CHECK: s_flbit_i32 s1, s2 ; encoding: [0x02,0x17,0x81,0xbe]
+// SICI: s_flbit_i32 s1, s2 ; encoding: [0x02,0x17,0x81,0xbe]
+// VI: s_flbit_i32 s1, s2 ; encoding: [0x02,0x14,0x81,0xbe]
s_flbit_i32_i64 s1, s[2:3]
-// CHECK: s_flbit_i32_i64 s1, s[2:3] ; encoding: [0x02,0x18,0x81,0xbe]
+// SICI: s_flbit_i32_i64 s1, s[2:3] ; encoding: [0x02,0x18,0x81,0xbe]
+// VI: s_flbit_i32_i64 s1, s[2:3] ; encoding: [0x02,0x15,0x81,0xbe]
s_sext_i32_i8 s1, s2
-// CHECK: s_sext_i32_i8 s1, s2 ; encoding: [0x02,0x19,0x81,0xbe]
+// SICI: s_sext_i32_i8 s1, s2 ; encoding: [0x02,0x19,0x81,0xbe]
+// VI: s_sext_i32_i8 s1, s2 ; encoding: [0x02,0x16,0x81,0xbe]
s_sext_i32_i16 s1, s2
-// CHECK: s_sext_i32_i16 s1, s2 ; encoding: [0x02,0x1a,0x81,0xbe]
+// SICI: s_sext_i32_i16 s1, s2 ; encoding: [0x02,0x1a,0x81,0xbe]
+// VI: s_sext_i32_i16 s1, s2 ; encoding: [0x02,0x17,0x81,0xbe]
s_bitset0_b32 s1, s2
-// CHECK: s_bitset0_b32 s1, s2 ; encoding: [0x02,0x1b,0x81,0xbe]
+// SICI: s_bitset0_b32 s1, s2 ; encoding: [0x02,0x1b,0x81,0xbe]
+// VI: s_bitset0_b32 s1, s2 ; encoding: [0x02,0x18,0x81,0xbe]
s_bitset0_b64 s[2:3], s4
-// CHECK: s_bitset0_b64 s[2:3], s4 ; encoding: [0x04,0x1c,0x82,0xbe]
+// SICI: s_bitset0_b64 s[2:3], s4 ; encoding: [0x04,0x1c,0x82,0xbe]
+// VI: s_bitset0_b64 s[2:3], s4 ; encoding: [0x04,0x19,0x82,0xbe]
s_bitset1_b32 s1, s2
-// CHECK: s_bitset1_b32 s1, s2 ; encoding: [0x02,0x1d,0x81,0xbe]
+// SICI: s_bitset1_b32 s1, s2 ; encoding: [0x02,0x1d,0x81,0xbe]
+// VI: s_bitset1_b32 s1, s2 ; encoding: [0x02,0x1a,0x81,0xbe]
s_bitset1_b64 s[2:3], s4
-// CHECK: s_bitset1_b64 s[2:3], s4 ; encoding: [0x04,0x1e,0x82,0xbe]
+// SICI: s_bitset1_b64 s[2:3], s4 ; encoding: [0x04,0x1e,0x82,0xbe]
+// VI: s_bitset1_b64 s[2:3], s4 ; encoding: [0x04,0x1b,0x82,0xbe]
s_getpc_b64 s[2:3]
-// CHECK: s_getpc_b64 s[2:3] ; encoding: [0x00,0x1f,0x82,0xbe]
+// SICI: s_getpc_b64 s[2:3] ; encoding: [0x00,0x1f,0x82,0xbe]
+// VI: s_getpc_b64 s[2:3] ; encoding: [0x00,0x1c,0x82,0xbe]
s_setpc_b64 s[4:5]
-// CHECK: s_setpc_b64 s[4:5] ; encoding: [0x04,0x20,0x80,0xbe]
+// SICI: s_setpc_b64 s[4:5] ; encoding: [0x04,0x20,0x80,0xbe]
+// VI: s_setpc_b64 s[4:5] ; encoding: [0x04,0x1d,0x80,0xbe]
s_swappc_b64 s[2:3], s[4:5]
-// CHECK: s_swappc_b64 s[2:3], s[4:5] ; encoding: [0x04,0x21,0x82,0xbe]
+// SICI: s_swappc_b64 s[2:3], s[4:5] ; encoding: [0x04,0x21,0x82,0xbe]
+// VI: s_swappc_b64 s[2:3], s[4:5] ; encoding: [0x04,0x1e,0x82,0xbe]
s_rfe_b64 s[4:5]
-// CHECK: s_rfe_b64 s[4:5] ; encoding: [0x04,0x22,0x80,0xbe]
+// SICI: s_rfe_b64 s[4:5] ; encoding: [0x04,0x22,0x80,0xbe]
+// VI: s_rfe_b64 s[4:5] ; encoding: [0x04,0x1f,0x80,0xbe]
s_and_saveexec_b64 s[2:3], s[4:5]
-// CHECK: s_and_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x24,0x82,0xbe]
+// SICI: s_and_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x24,0x82,0xbe]
+// VI: s_and_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x20,0x82,0xbe]
s_or_saveexec_b64 s[2:3], s[4:5]
-// CHECK: s_or_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x25,0x82,0xbe]
+// SICI: s_or_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x25,0x82,0xbe]
+// VI: s_or_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x21,0x82,0xbe]
s_xor_saveexec_b64 s[2:3], s[4:5]
-// CHECK: s_xor_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x26,0x82,0xbe]
+// SICI: s_xor_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x26,0x82,0xbe]
+// VI: s_xor_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x22,0x82,0xbe]
s_andn2_saveexec_b64 s[2:3], s[4:5]
-// CHECK: s_andn2_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x27,0x82,0xbe]
+// SICI: s_andn2_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x27,0x82,0xbe]
+// VI: s_andn2_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x23,0x82,0xbe]
s_orn2_saveexec_b64 s[2:3], s[4:5]
-// CHECK: s_orn2_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x28,0x82,0xbe]
+// SICI: s_orn2_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x28,0x82,0xbe]
+// VI: s_orn2_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x24,0x82,0xbe]
s_nand_saveexec_b64 s[2:3], s[4:5]
-// CHECK: s_nand_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x29,0x82,0xbe]
+// SICI: s_nand_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x29,0x82,0xbe]
+// VI: s_nand_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x25,0x82,0xbe]
s_nor_saveexec_b64 s[2:3], s[4:5]
-// CHECK: s_nor_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x2a,0x82,0xbe]
+// SICI: s_nor_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x2a,0x82,0xbe]
+// VI: s_nor_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x26,0x82,0xbe]
s_xnor_saveexec_b64 s[2:3], s[4:5]
-// CHECK: s_xnor_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x2b,0x82,0xbe]
+// SICI: s_xnor_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x2b,0x82,0xbe]
+// VI: s_xnor_saveexec_b64 s[2:3], s[4:5] ; encoding: [0x04,0x27,0x82,0xbe]
s_quadmask_b32 s1, s2
-// CHECK: s_quadmask_b32 s1, s2 ; encoding: [0x02,0x2c,0x81,0xbe]
+// SICI: s_quadmask_b32 s1, s2 ; encoding: [0x02,0x2c,0x81,0xbe]
+// VI: s_quadmask_b32 s1, s2 ; encoding: [0x02,0x28,0x81,0xbe]
s_quadmask_b64 s[2:3], s[4:5]
-// CHECK: s_quadmask_b64 s[2:3], s[4:5] ; encoding: [0x04,0x2d,0x82,0xbe]
+// SICI: s_quadmask_b64 s[2:3], s[4:5] ; encoding: [0x04,0x2d,0x82,0xbe]
+// VI: s_quadmask_b64 s[2:3], s[4:5] ; encoding: [0x04,0x29,0x82,0xbe]
s_movrels_b32 s1, s2
-// CHECK: s_movrels_b32 s1, s2 ; encoding: [0x02,0x2e,0x81,0xbe]
+// SICI: s_movrels_b32 s1, s2 ; encoding: [0x02,0x2e,0x81,0xbe]
+// VI: s_movrels_b32 s1, s2 ; encoding: [0x02,0x2a,0x81,0xbe]
s_movrels_b64 s[2:3], s[4:5]
-// CHECK: s_movrels_b64 s[2:3], s[4:5] ; encoding: [0x04,0x2f,0x82,0xbe]
+// SICI: s_movrels_b64 s[2:3], s[4:5] ; encoding: [0x04,0x2f,0x82,0xbe]
+// VI: s_movrels_b64 s[2:3], s[4:5] ; encoding: [0x04,0x2b,0x82,0xbe]
s_movreld_b32 s1, s2
-// CHECK: s_movreld_b32 s1, s2 ; encoding: [0x02,0x30,0x81,0xbe]
+// SICI: s_movreld_b32 s1, s2 ; encoding: [0x02,0x30,0x81,0xbe]
+// VI: s_movreld_b32 s1, s2 ; encoding: [0x02,0x2c,0x81,0xbe]
s_movreld_b64 s[2:3], s[4:5]
-// CHECK: s_movreld_b64 s[2:3], s[4:5] ; encoding: [0x04,0x31,0x82,0xbe]
+// SICI: s_movreld_b64 s[2:3], s[4:5] ; encoding: [0x04,0x31,0x82,0xbe]
+// VI: s_movreld_b64 s[2:3], s[4:5] ; encoding: [0x04,0x2d,0x82,0xbe]
s_cbranch_join s[4:5]
-// CHECK: s_cbranch_join s[4:5] ; encoding: [0x04,0x32,0x80,0xbe]
+// SICI: s_cbranch_join s[4:5] ; encoding: [0x04,0x32,0x80,0xbe]
+// VI: s_cbranch_join s[4:5] ; encoding: [0x04,0x2e,0x80,0xbe]
s_abs_i32 s1, s2
-// CHECK: s_abs_i32 s1, s2 ; encoding: [0x02,0x34,0x81,0xbe]
+// SICI: s_abs_i32 s1, s2 ; encoding: [0x02,0x34,0x81,0xbe]
+// VI: s_abs_i32 s1, s2 ; encoding: [0x02,0x30,0x81,0xbe]
s_mov_fed_b32 s1, s2
-// CHECK: s_mov_fed_b32 s1, s2 ; encoding: [0x02,0x35,0x81,0xbe]
+// SICI: s_mov_fed_b32 s1, s2 ; encoding: [0x02,0x35,0x81,0xbe]
-// RUN: llvm-mc -arch=amdgcn -show-encoding %s | FileCheck %s
-// RUN: llvm-mc -arch=amdgcn -mcpu=SI -show-encoding %s | FileCheck %s
+// RUN: llvm-mc -arch=amdgcn -show-encoding %s | FileCheck --check-prefix=GCN --check-prefix=SICI %s
+// RUN: llvm-mc -arch=amdgcn -mcpu=SI -show-encoding %s | FileCheck --check-prefix=GCN --check-prefix=SICI %s
+// RUN: llvm-mc -arch=amdgcn -mcpu=bonaire -show-encoding %s | FileCheck --check-prefix=GCN --check-prefix=SICI %s
+// RUN: not llvm-mc -arch=amdgcn -mcpu=fiji -show-encoding %s | FileCheck --check-prefix=GCN --check-prefix=VI %s
+// RUN: not llvm-mc -arch=amdgcn -mcpu=fiji -show-encoding %s 2>&1 | FileCheck --check-prefix=NOVI %s
-// CHECK: s_add_u32 s1, s2, s3 ; encoding: [0x02,0x03,0x01,0x80]
s_add_u32 s1, s2, s3
+// GCN: s_add_u32 s1, s2, s3 ; encoding: [0x02,0x03,0x01,0x80]
-// CHECK: s_sub_u32 s1, s2, s3 ; encoding: [0x02,0x03,0x81,0x80]
s_sub_u32 s1, s2, s3
+// GCN: s_sub_u32 s1, s2, s3 ; encoding: [0x02,0x03,0x81,0x80]
-// CHECK: s_add_i32 s1, s2, s3 ; encoding: [0x02,0x03,0x01,0x81]
s_add_i32 s1, s2, s3
+// GCN: s_add_i32 s1, s2, s3 ; encoding: [0x02,0x03,0x01,0x81]
-// CHECK: s_sub_i32 s1, s2, s3 ; encoding: [0x02,0x03,0x81,0x81]
s_sub_i32 s1, s2, s3
+// GCN: s_sub_i32 s1, s2, s3 ; encoding: [0x02,0x03,0x81,0x81]
-// CHECK: s_addc_u32 s1, s2, s3 ; encoding: [0x02,0x03,0x01,0x82]
s_addc_u32 s1, s2, s3
+// GCN: s_addc_u32 s1, s2, s3 ; encoding: [0x02,0x03,0x01,0x82]
-// CHECK: s_subb_u32 s1, s2, s3 ; encoding: [0x02,0x03,0x81,0x82]
s_subb_u32 s1, s2, s3
+// GCN: s_subb_u32 s1, s2, s3 ; encoding: [0x02,0x03,0x81,0x82]
-// CHECK: s_min_i32 s1, s2, s3 ; encoding: [0x02,0x03,0x01,0x83]
s_min_i32 s1, s2, s3
+// GCN: s_min_i32 s1, s2, s3 ; encoding: [0x02,0x03,0x01,0x83]
-// CHECK: s_min_u32 s1, s2, s3 ; encoding: [0x02,0x03,0x81,0x83]
s_min_u32 s1, s2, s3
+// GCN: s_min_u32 s1, s2, s3 ; encoding: [0x02,0x03,0x81,0x83]
-// CHECK: s_max_i32 s1, s2, s3 ; encoding: [0x02,0x03,0x01,0x84]
s_max_i32 s1, s2, s3
+// GCN: s_max_i32 s1, s2, s3 ; encoding: [0x02,0x03,0x01,0x84]
-// CHECK: s_max_u32 s1, s2, s3 ; encoding: [0x02,0x03,0x81,0x84]
s_max_u32 s1, s2, s3
+// GCN: s_max_u32 s1, s2, s3 ; encoding: [0x02,0x03,0x81,0x84]
-// CHECK: s_cselect_b32 s1, s2, s3 ; encoding: [0x02,0x03,0x01,0x85]
s_cselect_b32 s1, s2, s3
+// GCN: s_cselect_b32 s1, s2, s3 ; encoding: [0x02,0x03,0x01,0x85]
-// CHECK: s_cselect_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x85]
s_cselect_b64 s[2:3], s[4:5], s[6:7]
+// GCN: s_cselect_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x85]
-// CHECK: s_and_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x87]
s_and_b32 s2, s4, s6
+// SICI: s_and_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x87]
+// VI: s_and_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x86]
-// CHECK: s_and_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x87]
s_and_b64 s[2:3], s[4:5], s[6:7]
+// SICI: s_and_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x87]
+// VI: s_and_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x86]
-// CHECK: s_or_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x88]
s_or_b32 s2, s4, s6
+// SICI: s_or_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x88]
+// VI: s_or_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x87]
-// CHECK: s_or_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x88]
s_or_b64 s[2:3], s[4:5], s[6:7]
+// SICI: s_or_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x88]
+// VI: s_or_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x87]
-// CHECK: s_xor_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x89]
s_xor_b32 s2, s4, s6
+// SICI: s_xor_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x89]
+// VI: s_xor_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x88]
-// CHECK: s_xor_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x89]
s_xor_b64 s[2:3], s[4:5], s[6:7]
+// SICI: s_xor_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x89]
+// VI: s_xor_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x88]
-// CHECK: s_andn2_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x8a]
s_andn2_b32 s2, s4, s6
+// SICI: s_andn2_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x8a]
+// VI: s_andn2_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x89]
-// CHECK: s_andn2_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x8a]
s_andn2_b64 s[2:3], s[4:5], s[6:7]
+// SICI: s_andn2_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x8a]
+// VI: s_andn2_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x89]
-// CHECK: s_orn2_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x8b]
s_orn2_b32 s2, s4, s6
+// SICI: s_orn2_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x8b]
+// VI: s_orn2_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x8a]
-// CHECK: s_orn2_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x8b]
s_orn2_b64 s[2:3], s[4:5], s[6:7]
+// SICI: s_orn2_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x8b]
+// VI: s_orn2_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x8a]
-// CHECK: s_nand_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x8c]
s_nand_b32 s2, s4, s6
+// SICI: s_nand_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x8c]
+// VI: s_nand_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x8b]
-// CHECK: s_nand_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x8c]
s_nand_b64 s[2:3], s[4:5], s[6:7]
+// SICI: s_nand_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x8c]
+// VI: s_nand_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x8b]
-// CHECK: s_nor_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x8d]
s_nor_b32 s2, s4, s6
+// SICI: s_nor_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x8d]
+// VI: s_nor_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x8c]
-// CHECK: s_nor_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x8d]
s_nor_b64 s[2:3], s[4:5], s[6:7]
+// SICI: s_nor_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x8d]
+// VI: s_nor_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x8c]
-// CHECK: s_xnor_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x8e]
s_xnor_b32 s2, s4, s6
+// SICI: s_xnor_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x8e]
+// VI: s_xnor_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x8d]
-// CHECK: s_xnor_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x8e]
s_xnor_b64 s[2:3], s[4:5], s[6:7]
+// SICI: s_xnor_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x8e]
+// VI: s_xnor_b64 s[2:3], s[4:5], s[6:7] ; encoding: [0x04,0x06,0x82,0x8d]
-// CHECK: s_lshl_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x8f]
s_lshl_b32 s2, s4, s6
+// SICI: s_lshl_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x8f]
+// VI: s_lshl_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x8e]
-// CHECK: s_lshl_b64 s[2:3], s[4:5], s6 ; encoding: [0x04,0x06,0x82,0x8f]
s_lshl_b64 s[2:3], s[4:5], s6
+// SICI: s_lshl_b64 s[2:3], s[4:5], s6 ; encoding: [0x04,0x06,0x82,0x8f]
+// VI: s_lshl_b64 s[2:3], s[4:5], s6 ; encoding: [0x04,0x06,0x82,0x8e]
-// CHECK: s_lshr_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x90]
s_lshr_b32 s2, s4, s6
+// SICI: s_lshr_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x90]
+// VI: s_lshr_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x8f]
-// CHECK: s_lshr_b64 s[2:3], s[4:5], s6 ; encoding: [0x04,0x06,0x82,0x90]
s_lshr_b64 s[2:3], s[4:5], s6
+// SICI: s_lshr_b64 s[2:3], s[4:5], s6 ; encoding: [0x04,0x06,0x82,0x90]
+// VI: s_lshr_b64 s[2:3], s[4:5], s6 ; encoding: [0x04,0x06,0x82,0x8f]
-// CHECK: s_ashr_i32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x91]
s_ashr_i32 s2, s4, s6
+// SICI: s_ashr_i32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x91]
+// VI: s_ashr_i32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x90]
-// CHECK: s_ashr_i64 s[2:3], s[4:5], s6 ; encoding: [0x04,0x06,0x82,0x91]
s_ashr_i64 s[2:3], s[4:5], s6
+// SICI: s_ashr_i64 s[2:3], s[4:5], s6 ; encoding: [0x04,0x06,0x82,0x91]
+// VI: s_ashr_i64 s[2:3], s[4:5], s6 ; encoding: [0x04,0x06,0x82,0x90]
-// CHECK: s_bfm_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x92]
s_bfm_b32 s2, s4, s6
+// SICI: s_bfm_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x92]
+// VI: s_bfm_b32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x91]
-// CHECK: s_bfm_b64 s[2:3], s4, s6 ; encoding: [0x04,0x06,0x82,0x92]
s_bfm_b64 s[2:3], s4, s6
+// SICI: s_bfm_b64 s[2:3], s4, s6 ; encoding: [0x04,0x06,0x82,0x92]
+// VI: s_bfm_b64 s[2:3], s4, s6 ; encoding: [0x04,0x06,0x82,0x91]
-// CHECK: s_mul_i32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x93]
s_mul_i32 s2, s4, s6
+// SICI: s_mul_i32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x93]
+// VI: s_mul_i32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x92]
-// CHECK: s_bfe_u32 s2, s4, s6 ; encoding: [0x04,0x06,0x82,0x93]
s_bfe_u32 s2, s4, s6
+// SICI: s_bfe_u32 s2, s4, s6 ; encoding: [0x04,0x06,0x82,0x93]
+// VI: s_bfe_u32 s2, s4, s6 ; encoding: [0x04,0x06,0x82,0x92]
-// CHECK: s_bfe_i32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x94]
s_bfe_i32 s2, s4, s6
+// SICI: s_bfe_i32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x94]
+// VI: s_bfe_i32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x93]
-// CHECK: s_bfe_u64 s[2:3], s[4:5], s6 ; encoding: [0x04,0x06,0x82,0x94]
s_bfe_u64 s[2:3], s[4:5], s6
+// SICI: s_bfe_u64 s[2:3], s[4:5], s6 ; encoding: [0x04,0x06,0x82,0x94]
+// VI: s_bfe_u64 s[2:3], s[4:5], s6 ; encoding: [0x04,0x06,0x82,0x93]
-// CHECK: s_bfe_i64 s[2:3], s[4:5], s6 ; encoding: [0x04,0x06,0x02,0x95]
s_bfe_i64 s[2:3], s[4:5], s6
+// SICI: s_bfe_i64 s[2:3], s[4:5], s6 ; encoding: [0x04,0x06,0x02,0x95]
+// VI: s_bfe_i64 s[2:3], s[4:5], s6 ; encoding: [0x04,0x06,0x02,0x94]
-// CHECK: s_cbranch_g_fork s[4:5], s[6:7] ; encoding: [0x04,0x06,0x80,0x95]
s_cbranch_g_fork s[4:5], s[6:7]
+// SICI: s_cbranch_g_fork s[4:5], s[6:7] ; encoding: [0x04,0x06,0x80,0x95]
+// VI: s_cbranch_g_fork s[4:5], s[6:7] ; encoding: [0x04,0x06,0x80,0x94]
-// CHECK: s_absdiff_i32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x96]
s_absdiff_i32 s2, s4, s6
+// SICI: s_absdiff_i32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x96]
+// VI: s_absdiff_i32 s2, s4, s6 ; encoding: [0x04,0x06,0x02,0x95]
-// CHECK: s_add_u32 s101, s102, s103 ; encoding: [0x66,0x67,0x65,0x80]
s_add_u32 s101, s102, s103
+// SICI: s_add_u32 s101, s102, s103 ; encoding: [0x66,0x67,0x65,0x80]
+// NOVI: error: invalid operand for instruction
-// RUN: llvm-mc -arch=amdgcn -show-encoding %s | FileCheck %s
-// RUN: llvm-mc -arch=amdgcn -mcpu=SI -show-encoding %s | FileCheck %s
-// RUN: llvm-mc -arch=amdgcn -mcpu=fiji -show-encoding %s | FileCheck %s
+// RUN: llvm-mc -arch=amdgcn -show-encoding %s | FileCheck --check-prefix=GCN %s
+// RUN: llvm-mc -arch=amdgcn -mcpu=SI -show-encoding %s | FileCheck --check-prefix=GCN %s
+// RUN: llvm-mc -arch=amdgcn -mcpu=fiji -show-encoding %s | FileCheck --check-prefix=GCN %s
//===----------------------------------------------------------------------===//
// SOPC Instructions
//===----------------------------------------------------------------------===//
s_cmp_eq_i32 s1, s2
-// CHECK: s_cmp_eq_i32 s1, s2 ; encoding: [0x01,0x02,0x00,0xbf]
+// GCN: s_cmp_eq_i32 s1, s2 ; encoding: [0x01,0x02,0x00,0xbf]
s_cmp_lg_i32 s1, s2
-// CHECK: s_cmp_lg_i32 s1, s2 ; encoding: [0x01,0x02,0x01,0xbf]
+// GCN: s_cmp_lg_i32 s1, s2 ; encoding: [0x01,0x02,0x01,0xbf]
s_cmp_gt_i32 s1, s2
-// CHECK: s_cmp_gt_i32 s1, s2 ; encoding: [0x01,0x02,0x02,0xbf]
+// GCN: s_cmp_gt_i32 s1, s2 ; encoding: [0x01,0x02,0x02,0xbf]
s_cmp_ge_i32 s1, s2
-// CHECK: s_cmp_ge_i32 s1, s2 ; encoding: [0x01,0x02,0x03,0xbf]
+// GCN: s_cmp_ge_i32 s1, s2 ; encoding: [0x01,0x02,0x03,0xbf]
s_cmp_lt_i32 s1, s2
-// CHECK: s_cmp_lt_i32 s1, s2 ; encoding: [0x01,0x02,0x04,0xbf]
+// GCN: s_cmp_lt_i32 s1, s2 ; encoding: [0x01,0x02,0x04,0xbf]
s_cmp_le_i32 s1, s2
-// CHECK: s_cmp_le_i32 s1, s2 ; encoding: [0x01,0x02,0x05,0xbf]
+// GCN: s_cmp_le_i32 s1, s2 ; encoding: [0x01,0x02,0x05,0xbf]
s_cmp_eq_u32 s1, s2
-// CHECK: s_cmp_eq_u32 s1, s2 ; encoding: [0x01,0x02,0x06,0xbf]
+// GCN: s_cmp_eq_u32 s1, s2 ; encoding: [0x01,0x02,0x06,0xbf]
s_cmp_lg_u32 s1, s2
-// CHECK: s_cmp_lg_u32 s1, s2 ; encoding: [0x01,0x02,0x07,0xbf]
+// GCN: s_cmp_lg_u32 s1, s2 ; encoding: [0x01,0x02,0x07,0xbf]
s_cmp_gt_u32 s1, s2
-// CHECK: s_cmp_gt_u32 s1, s2 ; encoding: [0x01,0x02,0x08,0xbf]
+// GCN: s_cmp_gt_u32 s1, s2 ; encoding: [0x01,0x02,0x08,0xbf]
s_cmp_ge_u32 s1, s2
-// CHECK: s_cmp_ge_u32 s1, s2 ; encoding: [0x01,0x02,0x09,0xbf]
+// GCN: s_cmp_ge_u32 s1, s2 ; encoding: [0x01,0x02,0x09,0xbf]
s_cmp_lt_u32 s1, s2
-// CHECK: s_cmp_lt_u32 s1, s2 ; encoding: [0x01,0x02,0x0a,0xbf]
+// GCN: s_cmp_lt_u32 s1, s2 ; encoding: [0x01,0x02,0x0a,0xbf]
s_cmp_le_u32 s1, s2
-// CHECK: s_cmp_le_u32 s1, s2 ; encoding: [0x01,0x02,0x0b,0xbf]
+// GCN: s_cmp_le_u32 s1, s2 ; encoding: [0x01,0x02,0x0b,0xbf]
s_bitcmp0_b32 s1, s2
-// CHECK: s_bitcmp0_b32 s1, s2 ; encoding: [0x01,0x02,0x0c,0xbf]
+// GCN: s_bitcmp0_b32 s1, s2 ; encoding: [0x01,0x02,0x0c,0xbf]
s_bitcmp1_b32 s1, s2
-// CHECK: s_bitcmp1_b32 s1, s2 ; encoding: [0x01,0x02,0x0d,0xbf]
+// GCN: s_bitcmp1_b32 s1, s2 ; encoding: [0x01,0x02,0x0d,0xbf]
s_bitcmp0_b64 s[2:3], s4
-// CHECK: s_bitcmp0_b64 s[2:3], s4 ; encoding: [0x02,0x04,0x0e,0xbf]
+// GCN: s_bitcmp0_b64 s[2:3], s4 ; encoding: [0x02,0x04,0x0e,0xbf]
s_bitcmp1_b64 s[2:3], s4
-// CHECK: s_bitcmp1_b64 s[2:3], s4 ; encoding: [0x02,0x04,0x0f,0xbf]
+// GCN: s_bitcmp1_b64 s[2:3], s4 ; encoding: [0x02,0x04,0x0f,0xbf]
s_setvskip s3, s5
-// CHECK: s_setvskip s3, s5 ; encoding: [0x03,0x05,0x10,0xbf]
+// GCN: s_setvskip s3, s5 ; encoding: [0x03,0x05,0x10,0xbf]
-// RUN: llvm-mc -arch=amdgcn -show-encoding %s | FileCheck %s
-// RUN: llvm-mc -arch=amdgcn -mcpu=SI -show-encoding %s | FileCheck %s
+// RUN: llvm-mc -arch=amdgcn -show-encoding %s | FileCheck --check-prefix=GCN --check-prefix=SICI %s
+// RUN: llvm-mc -arch=amdgcn -mcpu=SI -show-encoding %s | FileCheck --check-prefix=GCN --check-prefix=SICI %s
+// RUN: llvm-mc -arch=amdgcn -mcpu=fiji -show-encoding %s | FileCheck --check-prefix=GCN --check-prefix=VI %s
//===----------------------------------------------------------------------===//
// Instructions
//===----------------------------------------------------------------------===//
s_movk_i32 s2, 0x6
-// CHECK: s_movk_i32 s2, 0x6 ; encoding: [0x06,0x00,0x02,0xb0]
+// GCN: s_movk_i32 s2, 0x6 ; encoding: [0x06,0x00,0x02,0xb0]
s_cmovk_i32 s2, 0x6
-// CHECK: s_cmovk_i32 s2, 0x6 ; encoding: [0x06,0x00,0x02,0xb1]
+// SICI: s_cmovk_i32 s2, 0x6 ; encoding: [0x06,0x00,0x02,0xb1]
+// VI: s_cmovk_i32 s2, 0x6 ; encoding: [0x06,0x00,0x82,0xb0]
s_cmpk_eq_i32 s2, 0x6
-// CHECK: s_cmpk_eq_i32 s2, 0x6 ; encoding: [0x06,0x00,0x82,0xb1]
+// SICI: s_cmpk_eq_i32 s2, 0x6 ; encoding: [0x06,0x00,0x82,0xb1]
+// VI: s_cmpk_eq_i32 s2, 0x6 ; encoding: [0x06,0x00,0x02,0xb1]
s_cmpk_lg_i32 s2, 0x6
-// CHECK: s_cmpk_lg_i32 s2, 0x6 ; encoding: [0x06,0x00,0x02,0xb2]
+// SICI: s_cmpk_lg_i32 s2, 0x6 ; encoding: [0x06,0x00,0x02,0xb2]
+// VI: s_cmpk_lg_i32 s2, 0x6 ; encoding: [0x06,0x00,0x82,0xb1]
s_cmpk_gt_i32 s2, 0x6
-// CHECK: s_cmpk_gt_i32 s2, 0x6 ; encoding: [0x06,0x00,0x82,0xb2]
+// SICI: s_cmpk_gt_i32 s2, 0x6 ; encoding: [0x06,0x00,0x82,0xb2]
+// VI: s_cmpk_gt_i32 s2, 0x6 ; encoding: [0x06,0x00,0x02,0xb2]
s_cmpk_ge_i32 s2, 0x6
-// CHECK: s_cmpk_ge_i32 s2, 0x6 ; encoding: [0x06,0x00,0x02,0xb3]
+// SICI: s_cmpk_ge_i32 s2, 0x6 ; encoding: [0x06,0x00,0x02,0xb3]
+// VI: s_cmpk_ge_i32 s2, 0x6 ; encoding: [0x06,0x00,0x82,0xb2]
s_cmpk_lt_i32 s2, 0x6
-// CHECK: s_cmpk_lt_i32 s2, 0x6 ; encoding: [0x06,0x00,0x82,0xb3]
+// SICI: s_cmpk_lt_i32 s2, 0x6 ; encoding: [0x06,0x00,0x82,0xb3]
+// VI: s_cmpk_lt_i32 s2, 0x6 ; encoding: [0x06,0x00,0x02,0xb3]
s_cmpk_le_i32 s2, 0x6
-// CHECK: s_cmpk_le_i32 s2, 0x6 ; encoding: [0x06,0x00,0x02,0xb4]
+// SICI: s_cmpk_le_i32 s2, 0x6 ; encoding: [0x06,0x00,0x02,0xb4]
+// VI: s_cmpk_le_i32 s2, 0x6 ; encoding: [0x06,0x00,0x82,0xb3]
s_cmpk_eq_u32 s2, 0x6
-// CHECK: s_cmpk_eq_u32 s2, 0x6 ; encoding: [0x06,0x00,0x82,0xb4]
+// SICI: s_cmpk_eq_u32 s2, 0x6 ; encoding: [0x06,0x00,0x82,0xb4]
+// VI: s_cmpk_eq_u32 s2, 0x6 ; encoding: [0x06,0x00,0x02,0xb4]
s_cmpk_lg_u32 s2, 0x6
-// CHECK: s_cmpk_lg_u32 s2, 0x6 ; encoding: [0x06,0x00,0x02,0xb5]
+// SICI: s_cmpk_lg_u32 s2, 0x6 ; encoding: [0x06,0x00,0x02,0xb5]
+// VI: s_cmpk_lg_u32 s2, 0x6 ; encoding: [0x06,0x00,0x82,0xb4]
s_cmpk_gt_u32 s2, 0x6
-// CHECK: s_cmpk_gt_u32 s2, 0x6 ; encoding: [0x06,0x00,0x82,0xb5]
+// SICI: s_cmpk_gt_u32 s2, 0x6 ; encoding: [0x06,0x00,0x82,0xb5]
+// VI: s_cmpk_gt_u32 s2, 0x6 ; encoding: [0x06,0x00,0x02,0xb5]
s_cmpk_ge_u32 s2, 0x6
-// CHECK: s_cmpk_ge_u32 s2, 0x6 ; encoding: [0x06,0x00,0x02,0xb6]
+// SICI: s_cmpk_ge_u32 s2, 0x6 ; encoding: [0x06,0x00,0x02,0xb6]
+// VI: s_cmpk_ge_u32 s2, 0x6 ; encoding: [0x06,0x00,0x82,0xb5]
s_cmpk_lt_u32 s2, 0x6
-// CHECK: s_cmpk_lt_u32 s2, 0x6 ; encoding: [0x06,0x00,0x82,0xb6]
+// SICI: s_cmpk_lt_u32 s2, 0x6 ; encoding: [0x06,0x00,0x82,0xb6]
+// VI: s_cmpk_lt_u32 s2, 0x6 ; encoding: [0x06,0x00,0x02,0xb6]
s_cmpk_le_u32 s2, 0x6
-// CHECK: s_cmpk_le_u32 s2, 0x6 ; encoding: [0x06,0x00,0x02,0xb7]
+// SICI: s_cmpk_le_u32 s2, 0x6 ; encoding: [0x06,0x00,0x02,0xb7]
+// VI: s_cmpk_le_u32 s2, 0x6 ; encoding: [0x06,0x00,0x82,0xb6]
s_addk_i32 s2, 0x6
-// CHECK: s_addk_i32 s2, 0x6 ; encoding: [0x06,0x00,0x82,0xb7]
+// SICI: s_addk_i32 s2, 0x6 ; encoding: [0x06,0x00,0x82,0xb7]
+// VI: s_addk_i32 s2, 0x6 ; encoding: [0x06,0x00,0x02,0xb7]
s_mulk_i32 s2, 0x6
-// CHECK: s_mulk_i32 s2, 0x6 ; encoding: [0x06,0x00,0x02,0xb8]
+// SICI: s_mulk_i32 s2, 0x6 ; encoding: [0x06,0x00,0x02,0xb8]
+// VI: s_mulk_i32 s2, 0x6 ; encoding: [0x06,0x00,0x82,0xb7]
s_cbranch_i_fork s[2:3], 0x6
-// CHECK: s_cbranch_i_fork s[2:3], 0x6 ; encoding: [0x06,0x00,0x82,0xb8]
+// SICI: s_cbranch_i_fork s[2:3], 0x6 ; encoding: [0x06,0x00,0x82,0xb8]
+// VI: s_cbranch_i_fork s[2:3], 0x6 ; encoding: [0x06,0x00,0x02,0xb8]
s_getreg_b32 s2, 0x6
-// CHECK: s_getreg_b32 s2, 0x6 ; encoding: [0x06,0x00,0x02,0xb9]
+// SICI: s_getreg_b32 s2, 0x6 ; encoding: [0x06,0x00,0x02,0xb9]
+// VI: s_getreg_b32 s2, 0x6 ; encoding: [0x06,0x00,0x82,0xb8]
s_setreg_b32 s2, 0x6
-// CHECK: s_setreg_b32 s2, 0x6 ; encoding: [0x06,0x00,0x82,0xb9]
+// SICI: s_setreg_b32 s2, 0x6 ; encoding: [0x06,0x00,0x82,0xb9]
+// VI: s_setreg_b32 s2, 0x6 ; encoding: [0x06,0x00,0x02,0xb9]
s_setreg_imm32_b32 0xff, 0x6
-// CHECK: s_setreg_imm32_b32 0xff, 0x6 ; encoding: [0x06,0x00,0x80,0xba,0xff,0x00,0x00,0x00]
+// SICI: s_setreg_imm32_b32 0xff, 0x6 ; encoding: [0x06,0x00,0x80,0xba,0xff,0x00,0x00,0x00]
+// VI: s_setreg_imm32_b32 0xff, 0x6 ; encoding: [0x06,0x00,0x00,0xba,0xff,0x00,0x00,0x00]
-// RUN: llvm-mc -arch=amdgcn -show-encoding %s | FileCheck %s
-// RUN: llvm-mc -arch=amdgcn -mcpu=SI -show-encoding %s | FileCheck %s
+// RUN: llvm-mc -arch=amdgcn -show-encoding %s | FileCheck --check-prefix=GCN --check-prefix=SICI %s
+// RUN: llvm-mc -arch=amdgcn -mcpu=SI -show-encoding %s | FileCheck --check-prefix=GCN --check-prefix=SICI %s
+// RUN: llvm-mc -arch=amdgcn -mcpu=fiji -show-encoding %s | FileCheck --check-prefix=GCN --check-prefix=VI %s
//===----------------------------------------------------------------------===//
// Edge Cases
//===----------------------------------------------------------------------===//
-s_nop 0 // CHECK: s_nop 0 ; encoding: [0x00,0x00,0x80,0xbf]
-s_nop 0xffff // CHECK: s_nop 0xffff ; encoding: [0xff,0xff,0x80,0xbf]
+s_nop 0
+// GCN: s_nop 0 ; encoding: [0x00,0x00,0x80,0xbf]
+
+s_nop 0xffff
+// GCN: s_nop 0xffff ; encoding: [0xff,0xff,0x80,0xbf]
//===----------------------------------------------------------------------===//
// Instructions
//===----------------------------------------------------------------------===//
- s_nop 1 // CHECK: s_nop 1 ; encoding: [0x01,0x00,0x80,0xbf]
- s_endpgm // CHECK: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
- s_branch 2 // CHECK: s_branch 2 ; encoding: [0x02,0x00,0x82,0xbf]
- s_cbranch_scc0 3 // CHECK: s_cbranch_scc0 3 ; encoding: [0x03,0x00,0x84,0xbf]
- s_cbranch_scc1 4 // CHECK: s_cbranch_scc1 4 ; encoding: [0x04,0x00,0x85,0xbf]
- s_cbranch_vccz 5 // CHECK: s_cbranch_vccz 5 ; encoding: [0x05,0x00,0x86,0xbf]
- s_cbranch_vccnz 6 // CHECK: s_cbranch_vccnz 6 ; encoding: [0x06,0x00,0x87,0xbf]
- s_cbranch_execz 7 // CHECK: s_cbranch_execz 7 ; encoding: [0x07,0x00,0x88,0xbf]
- s_cbranch_execnz 8 // CHECK: s_cbranch_execnz 8 ; encoding: [0x08,0x00,0x89,0xbf]
- s_barrier // CHECK: s_barrier ; encoding: [0x00,0x00,0x8a,0xbf]
+s_nop 1
+// GCN: s_nop 1 ; encoding: [0x01,0x00,0x80,0xbf]
+
+s_endpgm
+// GCN: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
+
+s_branch 2
+// GCN: s_branch 2 ; encoding: [0x02,0x00,0x82,0xbf]
+
+s_cbranch_scc0 3
+// GCN: s_cbranch_scc0 3 ; encoding: [0x03,0x00,0x84,0xbf]
+
+s_cbranch_scc1 4
+// GCN: s_cbranch_scc1 4 ; encoding: [0x04,0x00,0x85,0xbf]
+
+s_cbranch_vccz 5
+// GCN: s_cbranch_vccz 5 ; encoding: [0x05,0x00,0x86,0xbf]
+
+s_cbranch_vccnz 6
+// GCN: s_cbranch_vccnz 6 ; encoding: [0x06,0x00,0x87,0xbf]
+
+s_cbranch_execz 7
+// GCN: s_cbranch_execz 7 ; encoding: [0x07,0x00,0x88,0xbf]
+
+s_cbranch_execnz 8
+// GCN: s_cbranch_execnz 8 ; encoding: [0x08,0x00,0x89,0xbf]
+
+s_barrier
+// GCN: s_barrier ; encoding: [0x00,0x00,0x8a,0xbf]
//===----------------------------------------------------------------------===//
// s_waitcnt
//===----------------------------------------------------------------------===//
- s_waitcnt 0
- // CHECK: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) ; encoding: [0x00,0x00,0x8c,0xbf]
+s_waitcnt 0
+// GCN: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) ; encoding: [0x00,0x00,0x8c,0xbf]
+
+s_waitcnt vmcnt(0) & expcnt(0) & lgkmcnt(0)
+// GCN: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) ; encoding: [0x00,0x00,0x8c,0xbf]
+
+s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
+// GCN: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) ; encoding: [0x00,0x00,0x8c,0xbf]
+
+s_waitcnt vmcnt(0), expcnt(0), lgkmcnt(0)
+// GCN: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) ; encoding: [0x00,0x00,0x8c,0xbf]
+
+s_waitcnt vmcnt(1)
+// GCN: s_waitcnt vmcnt(1) ; encoding: [0x71,0x0f,0x8c,0xbf]
+
+s_waitcnt vmcnt(9)
+// GCN: s_waitcnt vmcnt(9) ; encoding: [0x79,0x0f,0x8c,0xbf]
+
+s_waitcnt expcnt(2)
+// GCN: s_waitcnt expcnt(2) ; encoding: [0x2f,0x0f,0x8c,0xbf]
+
+s_waitcnt lgkmcnt(3)
+// GCN: s_waitcnt lgkmcnt(3) ; encoding: [0x7f,0x03,0x8c,0xbf]
+
+s_waitcnt lgkmcnt(9)
+// GCN: s_waitcnt lgkmcnt(9) ; encoding: [0x7f,0x09,0x8c,0xbf]
+
+s_waitcnt vmcnt(0), expcnt(0)
+// GCN: s_waitcnt vmcnt(0) expcnt(0) ; encoding: [0x00,0x0f,0x8c,0xbf]
- s_waitcnt vmcnt(0) & expcnt(0) & lgkmcnt(0)
- // CHECK: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) ; encoding: [0x00,0x00,0x8c,0xbf]
- s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
- // CHECK: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) ; encoding: [0x00,0x00,0x8c,0xbf]
+s_sethalt 9
+// GCN: s_sethalt 9 ; encoding: [0x09,0x00,0x8d,0xbf]
- s_waitcnt vmcnt(0), expcnt(0), lgkmcnt(0)
- // CHECK: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) ; encoding: [0x00,0x00,0x8c,0xbf]
+s_sleep 10
+// GCN: s_sleep 10 ; encoding: [0x0a,0x00,0x8e,0xbf]
- s_waitcnt vmcnt(1)
- // CHECK: s_waitcnt vmcnt(1) ; encoding: [0x71,0x0f,0x8c,0xbf]
+s_setprio 1
+// GCN: s_setprio 1 ; encoding: [0x01,0x00,0x8f,0xbf]
- s_waitcnt vmcnt(9)
- // CHECK: s_waitcnt vmcnt(9) ; encoding: [0x79,0x0f,0x8c,0xbf]
+s_sendmsg 2
+// GCN: s_sendmsg Gs(nop), [m0] ; encoding: [0x02,0x00,0x90,0xbf]
- s_waitcnt expcnt(2)
- // CHECK: s_waitcnt expcnt(2) ; encoding: [0x2f,0x0f,0x8c,0xbf]
+s_sendmsghalt 3
+// GCN: s_sendmsghalt 3 ; encoding: [0x03,0x00,0x91,0xbf]
- s_waitcnt lgkmcnt(3)
- // CHECK: s_waitcnt lgkmcnt(3) ; encoding: [0x7f,0x03,0x8c,0xbf]
+s_trap 4
+// GCN: s_trap 4 ; encoding: [0x04,0x00,0x92,0xbf]
- s_waitcnt lgkmcnt(9)
- // CHECK: s_waitcnt lgkmcnt(9) ; encoding: [0x7f,0x09,0x8c,0xbf]
+s_icache_inv
+// GCN: s_icache_inv ; encoding: [0x00,0x00,0x93,0xbf]
- s_waitcnt vmcnt(0), expcnt(0)
- // CHECK: s_waitcnt vmcnt(0) expcnt(0) ; encoding: [0x00,0x0f,0x8c,0xbf]
+s_incperflevel 5
+// GCN: s_incperflevel 5 ; encoding: [0x05,0x00,0x94,0xbf]
+s_decperflevel 6
+// GCN: s_decperflevel 6 ; encoding: [0x06,0x00,0x95,0xbf]
- s_sethalt 9 // CHECK: s_sethalt 9 ; encoding: [0x09,0x00,0x8d,0xbf]
- s_sleep 10 // CHECK: s_sleep 10 ; encoding: [0x0a,0x00,0x8e,0xbf]
- s_setprio 1 // CHECK: s_setprio 1 ; encoding: [0x01,0x00,0x8f,0xbf]
- s_sendmsg 2 // CHECK: s_sendmsg Gs(nop), [m0] ; encoding: [0x02,0x00,0x90,0xbf]
- s_sendmsghalt 3 // CHECK: s_sendmsghalt 3 ; encoding: [0x03,0x00,0x91,0xbf]
- s_trap 4 // CHECK: s_trap 4 ; encoding: [0x04,0x00,0x92,0xbf]
- s_icache_inv // CHECK: s_icache_inv ; encoding: [0x00,0x00,0x93,0xbf]
- s_incperflevel 5 // CHECK: s_incperflevel 5 ; encoding: [0x05,0x00,0x94,0xbf]
- s_decperflevel 6 // CHECK: s_decperflevel 6 ; encoding: [0x06,0x00,0x95,0xbf]
- s_ttracedata // CHECK: s_ttracedata ; encoding: [0x00,0x00,0x96,0xbf]
+s_ttracedata
+// GCN: s_ttracedata ; encoding: [0x00,0x00,0x96,0xbf]