OSDN Git Service

AMDGPU: Fix missing 16-bit cmpx instructions
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Thu, 22 Dec 2016 16:27:14 +0000 (16:27 +0000)
committerMatt Arsenault <Matthew.Arsenault@amd.com>
Thu, 22 Dec 2016 16:27:14 +0000 (16:27 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290349 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/AMDGPU/VOPCInstructions.td
test/MC/AMDGPU/vopc-vi.s [new file with mode: 0644]

index 3345216..c431d9d 100644 (file)
@@ -209,6 +209,9 @@ multiclass VOPCX_F32 <string opName, string revOp = opName> :
 multiclass VOPCX_F64 <string opName, string revOp = opName> :
   VOPC_Pseudos <opName, VOPC_I1_F64_F64, COND_NULL, revOp, 1>;
 
+multiclass VOPCX_I16 <string opName, string revOp = opName> :
+  VOPC_Pseudos <opName, VOPC_I1_I16_I16, COND_NULL, revOp, 1>;
+
 multiclass VOPCX_I32 <string opName, string revOp = opName> :
   VOPC_Pseudos <opName, VOPC_I1_I32_I32, COND_NULL, revOp, 1>;
 
@@ -414,6 +417,24 @@ defm V_CMP_NE_U16 : VOPC_I16 <"v_cmp_ne_u16", COND_NE>;
 defm V_CMP_GE_U16 : VOPC_I16 <"v_cmp_ge_u16", COND_UGE>;
 defm V_CMP_T_U16 : VOPC_I16 <"v_cmp_t_u16">;
 
+defm V_CMPX_F_I16 : VOPCX_I16 <"v_cmpx_f_i16">;
+defm V_CMPX_LT_I16 : VOPCX_I16 <"v_cmpx_lt_i16", "v_cmpx_gt_i16">;
+defm V_CMPX_EQ_I16 : VOPCX_I16 <"v_cmpx_eq_i16">;
+defm V_CMPX_LE_I16 : VOPCX_I16 <"v_cmpx_le_i16", "v_cmpx_ge_i16">;
+defm V_CMPX_GT_I16 : VOPCX_I16 <"v_cmpx_gt_i16">;
+defm V_CMPX_NE_I16 : VOPCX_I16 <"v_cmpx_ne_i16">;
+defm V_CMPX_GE_I16 : VOPCX_I16 <"v_cmpx_ge_i16">;
+defm V_CMPX_T_I16 : VOPCX_I16 <"v_cmpx_t_i16">;
+defm V_CMPX_F_U16 : VOPCX_I16 <"v_cmpx_f_u16">;
+
+defm V_CMPX_LT_U16 : VOPCX_I16 <"v_cmpx_lt_u16", "v_cmpx_gt_u16">;
+defm V_CMPX_EQ_U16 : VOPCX_I16 <"v_cmpx_eq_u16">;
+defm V_CMPX_LE_U16 : VOPCX_I16 <"v_cmpx_le_u16", "v_cmpx_ge_u16">;
+defm V_CMPX_GT_U16 : VOPCX_I16 <"v_cmpx_gt_u16">;
+defm V_CMPX_NE_U16 : VOPCX_I16 <"v_cmpx_ne_u16">;
+defm V_CMPX_GE_U16 : VOPCX_I16 <"v_cmpx_ge_u16">;
+defm V_CMPX_T_U16 : VOPCX_I16 <"v_cmpx_t_u16">;
+
 } // End SubtargetPredicate = Has16BitInsts
 
 defm V_CMP_F_I32 : VOPC_I32 <"v_cmp_f_i32">;
@@ -1032,6 +1053,24 @@ defm V_CMP_NE_U16     : VOPC_Real_vi <0xad>;
 defm V_CMP_GE_U16     : VOPC_Real_vi <0xae>;
 defm V_CMP_T_U16      : VOPC_Real_vi <0xaf>;
 
+defm V_CMPX_F_I16 : VOPC_Real_vi <0xb0>;
+defm V_CMPX_LT_I16 : VOPC_Real_vi <0xb1>;
+defm V_CMPX_EQ_I16 : VOPC_Real_vi <0xb2>;
+defm V_CMPX_LE_I16 : VOPC_Real_vi <0xb3>;
+defm V_CMPX_GT_I16 : VOPC_Real_vi <0xb4>;
+defm V_CMPX_NE_I16 : VOPC_Real_vi <0xb5>;
+defm V_CMPX_GE_I16 : VOPC_Real_vi <0xb6>;
+defm V_CMPX_T_I16 : VOPC_Real_vi <0xb7>;
+
+defm V_CMPX_F_U16 : VOPC_Real_vi <0xb8>;
+defm V_CMPX_LT_U16 : VOPC_Real_vi <0xb9>;
+defm V_CMPX_EQ_U16 : VOPC_Real_vi <0xba>;
+defm V_CMPX_LE_U16 : VOPC_Real_vi <0xbb>;
+defm V_CMPX_GT_U16 : VOPC_Real_vi <0xbc>;
+defm V_CMPX_NE_U16 : VOPC_Real_vi <0xbd>;
+defm V_CMPX_GE_U16 : VOPC_Real_vi <0xbe>;
+defm V_CMPX_T_U16 : VOPC_Real_vi <0xbf>;
+
 defm V_CMP_F_I32      : VOPC_Real_vi <0xc0>;
 defm V_CMP_LT_I32     : VOPC_Real_vi <0xc1>;
 defm V_CMP_EQ_I32     : VOPC_Real_vi <0xc2>;
diff --git a/test/MC/AMDGPU/vopc-vi.s b/test/MC/AMDGPU/vopc-vi.s
new file mode 100644 (file)
index 0000000..f79923d
--- /dev/null
@@ -0,0 +1,267 @@
+// RUN: llvm-mc -arch=amdgcn -mcpu=fiji -show-encoding %s | FileCheck -check-prefix=VI %s
+// RUN: not llvm-mc -arch=amdgcn -mcpu=tahiti -show-encoding %s 2>&1 | FileCheck -check-prefix=NOSICI %s
+    // RUN: not llvm-mc -arch=amdgcn -mcpu=hawaii -show-encoding %s 2>&1 | FileCheck -check-prefix=NOSICI %s
+
+v_cmp_class_f16 vcc, v2, v4
+// VI: v_cmp_class_f16_e32 vcc, v2, v4 ; encoding: [0x02,0x09,0x28,0x7c]
+// NOSICI: error: instruction not supported on this GPU
+
+v_cmpx_class_f16 vcc, v2, v4
+// VI: v_cmpx_class_f16_e32 vcc, v2, v4 ; encoding: [0x02,0x09,0x2a,0x7c]
+// NOSICI: error: instruction not supported on this GPU
+
+v_cmp_f_f16 vcc, v2, v4
+// VI: v_cmp_f_f16_e32 vcc, v2, v4 ; encoding: [0x02,0x09,0x40,0x7c]
+// NOSICI: error: instruction not supported on this GPU
+
+v_cmp_lt_f16 vcc, v2, v4
+// VI: v_cmp_lt_f16_e32 vcc, v2, v4 ; encoding: [0x02,0x09,0x42,0x7c]
+// NOSICI: error: instruction not supported on this GPU
+
+v_cmp_eq_f16 vcc, v2, v4
+// VI: v_cmp_eq_f16_e32 vcc, v2, v4 ; encoding: [0x02,0x09,0x44,0x7c]
+// NOSICI: error: instruction not supported on this GPU
+
+v_cmp_le_f16 vcc, v2, v4
+// VI: v_cmp_le_f16_e32 vcc, v2, v4 ; encoding: [0x02,0x09,0x46,0x7c]
+// NOSICI: error: instruction not supported on this GPU
+
+v_cmp_gt_f16 vcc, v2, v4
+// VI: v_cmp_gt_f16_e32 vcc, v2, v4 ; encoding: [0x02,0x09,0x48,0x7c]
+// NOSICI: error: instruction not supported on this GPU
+
+v_cmp_lg_f16 vcc, v2, v4
+// VI: v_cmp_lg_f16_e32 vcc, v2, v4 ; encoding: [0x02,0x09,0x4a,0x7c]
+// NOSICI: error: instruction not supported on this GPU
+
+v_cmp_ge_f16 vcc, v2, v4
+// VI: v_cmp_ge_f16_e32 vcc, v2, v4 ; encoding: [0x02,0x09,0x4c,0x7c]
+// NOSICI: error: instruction not supported on this GPU
+
+v_cmp_o_f16 vcc, v2, v4
+// VI: v_cmp_o_f16_e32 vcc, v2, v4 ; encoding: [0x02,0x09,0x4e,0x7c]
+// NOSICI: error: instruction not supported on this GPU
+
+v_cmp_u_f16 vcc, v2, v4
+// VI: v_cmp_u_f16_e32 vcc, v2, v4 ; encoding: [0x02,0x09,0x50,0x7c]
+// NOSICI: error: instruction not supported on this GPU
+
+v_cmp_nge_f16 vcc, v2, v4
+// VI: v_cmp_nge_f16_e32 vcc, v2, v4 ; encoding: [0x02,0x09,0x52,0x7c]
+// NOSICI: error: instruction not supported on this GPU
+
+v_cmp_nlg_f16 vcc, v2, v4
+// VI: v_cmp_nlg_f16_e32 vcc, v2, v4 ; encoding: [0x02,0x09,0x54,0x7c]
+// NOSICI: error: instruction not supported on this GPU
+
+v_cmp_ngt_f16 vcc, v2, v4
+// VI: v_cmp_ngt_f16_e32 vcc, v2, v4 ; encoding: [0x02,0x09,0x56,0x7c]
+// NOSICI: error: instruction not supported on this GPU
+
+v_cmp_nle_f16 vcc, v2, v4
+// VI: v_cmp_nle_f16_e32 vcc, v2, v4 ; encoding: [0x02,0x09,0x58,0x7c]
+// NOSICI: error: instruction not supported on this GPU
+
+v_cmp_neq_f16 vcc, v2, v4
+// VI: v_cmp_neq_f16_e32 vcc, v2, v4 ; encoding: [0x02,0x09,0x5a,0x7c]
+// NOSICI: error: instruction not supported on this GPU
+
+v_cmp_nlt_f16 vcc, v2, v4
+// VI: v_cmp_nlt_f16_e32 vcc, v2, v4 ; encoding: [0x02,0x09,0x5c,0x7c]
+// NOSICI: error: instruction not supported on this GPU
+
+v_cmp_tru_f16 vcc, v2, v4
+// VI: v_cmp_tru_f16_e32 vcc, v2, v4 ; encoding: [0x02,0x09,0x5e,0x7c]
+// NOSICI: error: instruction not supported on this GPU
+
+v_cmpx_f_f16 vcc, v2, v4
+// VI: v_cmpx_f_f16_e32 vcc, v2, v4 ; encoding: [0x02,0x09,0x60,0x7c]
+// NOSICI: error: instruction not supported on this GPU
+
+v_cmpx_lt_f16 vcc, v2, v4
+// VI: v_cmpx_lt_f16_e32 vcc, v2, v4 ; encoding: [0x02,0x09,0x62,0x7c]
+// NOSICI: error: instruction not supported on this GPU
+
+v_cmpx_eq_f16 vcc, v2, v4
+// VI: v_cmpx_eq_f16_e32 vcc, v2, v4 ; encoding: [0x02,0x09,0x64,0x7c]
+// NOSICI: error: instruction not supported on this GPU
+
+v_cmpx_le_f16 vcc, v2, v4
+// VI: v_cmpx_le_f16_e32 vcc, v2, v4 ; encoding: [0x02,0x09,0x66,0x7c]
+// NOSICI: error: instruction not supported on this GPU
+
+v_cmpx_gt_f16 vcc, v2, v4
+// VI: v_cmpx_gt_f16_e32 vcc, v2, v4 ; encoding: [0x02,0x09,0x68,0x7c]
+// NOSICI: error: instruction not supported on this GPU
+
+v_cmpx_lg_f16 vcc, v2, v4
+// VI: v_cmpx_lg_f16_e32 vcc, v2, v4 ; encoding: [0x02,0x09,0x6a,0x7c]
+// NOSICI: error: instruction not supported on this GPU
+
+v_cmpx_ge_f16 vcc, v2, v4
+// VI: v_cmpx_ge_f16_e32 vcc, v2, v4 ; encoding: [0x02,0x09,0x6c,0x7c]
+// NOSICI: error: instruction not supported on this GPU
+
+v_cmpx_o_f16 vcc, v2, v4
+// VI: v_cmpx_o_f16_e32 vcc, v2, v4 ; encoding: [0x02,0x09,0x6e,0x7c]
+// NOSICI: error: instruction not supported on this GPU
+
+v_cmpx_u_f16 vcc, v2, v4
+// VI: v_cmpx_u_f16_e32 vcc, v2, v4 ; encoding: [0x02,0x09,0x70,0x7c]
+// NOSICI: error: instruction not supported on this GPU
+
+v_cmpx_nge_f16 vcc, v2, v4
+// VI: v_cmpx_nge_f16_e32 vcc, v2, v4 ; encoding: [0x02,0x09,0x72,0x7c]
+// NOSICI: error: instruction not supported on this GPU
+
+v_cmpx_nlg_f16 vcc, v2, v4
+// VI: v_cmpx_nlg_f16_e32 vcc, v2, v4 ; encoding: [0x02,0x09,0x74,0x7c]
+// NOSICI: error: instruction not supported on this GPU
+
+v_cmpx_ngt_f16 vcc, v2, v4
+// VI: v_cmpx_ngt_f16_e32 vcc, v2, v4 ; encoding: [0x02,0x09,0x76,0x7c]
+// NOSICI: error: instruction not supported on this GPU
+
+v_cmpx_nle_f16 vcc, v2, v4
+// VI: v_cmpx_nle_f16_e32 vcc, v2, v4 ; encoding: [0x02,0x09,0x78,0x7c]
+// NOSICI: error: instruction not supported on this GPU
+
+v_cmpx_neq_f16 vcc, v2, v4
+// VI: v_cmpx_neq_f16_e32 vcc, v2, v4 ; encoding: [0x02,0x09,0x7a,0x7c]
+// NOSICI: error: instruction not supported on this GPU
+
+v_cmpx_nlt_f16 vcc, v2, v4
+// VI: v_cmpx_nlt_f16_e32 vcc, v2, v4 ; encoding: [0x02,0x09,0x7c,0x7c]
+// NOSICI: error: instruction not supported on this GPU
+
+v_cmpx_tru_f16 vcc, v2, v4
+// VI: v_cmpx_tru_f16_e32 vcc, v2, v4 ; encoding: [0x02,0x09,0x7e,0x7c]
+// NOSICI: error: instruction not supported on this GPU
+
+v_cmp_f_i16 vcc, v2, v4
+// VI: v_cmp_f_i16_e32 vcc, v2, v4 ; encoding: [0x02,0x09,0x40,0x7d]
+// NOSICI: error: instruction not supported on this GPU
+
+v_cmp_lt_i16 vcc, v2, v4
+// VI: v_cmp_lt_i16_e32 vcc, v2, v4 ; encoding: [0x02,0x09,0x42,0x7d]
+// NOSICI: error: instruction not supported on this GPU
+
+v_cmp_eq_i16 vcc, v2, v4
+// VI: v_cmp_eq_i16_e32 vcc, v2, v4 ; encoding: [0x02,0x09,0x44,0x7d]
+// NOSICI: error: instruction not supported on this GPU
+
+v_cmp_le_i16 vcc, v2, v4
+// VI: v_cmp_le_i16_e32 vcc, v2, v4 ; encoding: [0x02,0x09,0x46,0x7d]
+// NOSICI: error: instruction not supported on this GPU
+
+v_cmp_gt_i16 vcc, v2, v4
+// VI: v_cmp_gt_i16_e32 vcc, v2, v4 ; encoding: [0x02,0x09,0x48,0x7d]
+// NOSICI: error: instruction not supported on this GPU
+
+v_cmp_ne_i16 vcc, v2, v4
+// VI: v_cmp_ne_i16_e32 vcc, v2, v4 ; encoding: [0x02,0x09,0x4a,0x7d]
+// NOSICI: error: instruction not supported on this GPU
+
+v_cmp_ge_i16 vcc, v2, v4
+// VI: v_cmp_ge_i16_e32 vcc, v2, v4 ; encoding: [0x02,0x09,0x4c,0x7d]
+// NOSICI: error: instruction not supported on this GPU
+
+v_cmp_t_i16 vcc, v2, v4
+// VI: v_cmp_t_i16_e32 vcc, v2, v4 ; encoding: [0x02,0x09,0x4e,0x7d]
+// NOSICI: error: instruction not supported on this GPU
+
+v_cmp_f_u16 vcc, v2, v4
+// VI: v_cmp_f_u16_e32 vcc, v2, v4 ; encoding: [0x02,0x09,0x50,0x7d]
+// NOSICI: error: instruction not supported on this GPU
+
+v_cmp_lt_u16 vcc, v2, v4
+// VI: v_cmp_lt_u16_e32 vcc, v2, v4 ; encoding: [0x02,0x09,0x52,0x7d]
+// NOSICI: error: instruction not supported on this GPU
+
+v_cmp_eq_u16 vcc, v2, v4
+// VI: v_cmp_eq_u16_e32 vcc, v2, v4 ; encoding: [0x02,0x09,0x54,0x7d]
+// NOSICI: error: instruction not supported on this GPU
+
+v_cmp_le_u16 vcc, v2, v4
+// VI: v_cmp_le_u16_e32 vcc, v2, v4 ; encoding: [0x02,0x09,0x56,0x7d]
+// NOSICI: error: instruction not supported on this GPU
+
+v_cmp_gt_u16 vcc, v2, v4
+// VI: v_cmp_gt_u16_e32 vcc, v2, v4 ; encoding: [0x02,0x09,0x58,0x7d]
+// NOSICI: error: instruction not supported on this GPU
+
+v_cmp_ne_u16 vcc, v2, v4
+// VI: v_cmp_ne_u16_e32 vcc, v2, v4 ; encoding: [0x02,0x09,0x5a,0x7d]
+// NOSICI: error: instruction not supported on this GPU
+
+v_cmp_ge_u16 vcc, v2, v4
+// VI: v_cmp_ge_u16_e32 vcc, v2, v4 ; encoding: [0x02,0x09,0x5c,0x7d]
+// NOSICI: error: instruction not supported on this GPU
+
+v_cmp_t_u16 vcc, v2, v4
+// VI: v_cmp_t_u16_e32 vcc, v2, v4 ; encoding: [0x02,0x09,0x5e,0x7d]
+// NOSICI: error: instruction not supported on this GPU
+
+v_cmpx_f_i16 vcc, v2, v4
+// VI: v_cmpx_f_i16_e32 vcc, v2, v4 ; encoding: [0x02,0x09,0x60,0x7d]
+// NOSICI: error: instruction not supported on this GPU
+
+v_cmpx_lt_i16 vcc, v2, v4
+// VI: v_cmpx_lt_i16_e32 vcc, v2, v4 ; encoding: [0x02,0x09,0x62,0x7d]
+// NOSICI: error: instruction not supported on this GPU
+
+v_cmpx_eq_i16 vcc, v2, v4
+// VI: v_cmpx_eq_i16_e32 vcc, v2, v4 ; encoding: [0x02,0x09,0x64,0x7d]
+// NOSICI: error: instruction not supported on this GPU
+
+v_cmpx_le_i16 vcc, v2, v4
+// VI: v_cmpx_le_i16_e32 vcc, v2, v4 ; encoding: [0x02,0x09,0x66,0x7d]
+// NOSICI: error: instruction not supported on this GPU
+
+v_cmpx_gt_i16 vcc, v2, v4
+// VI: v_cmpx_gt_i16_e32 vcc, v2, v4 ; encoding: [0x02,0x09,0x68,0x7d]
+// NOSICI: error: instruction not supported on this GPU
+
+v_cmpx_ne_i16 vcc, v2, v4
+// VI: v_cmpx_ne_i16_e32 vcc, v2, v4 ; encoding: [0x02,0x09,0x6a,0x7d]
+// NOSICI: error: instruction not supported on this GPU
+
+v_cmpx_ge_i16 vcc, v2, v4
+// VI: v_cmpx_ge_i16_e32 vcc, v2, v4 ; encoding: [0x02,0x09,0x6c,0x7d]
+// NOSICI: error: instruction not supported on this GPU
+
+v_cmpx_t_i16 vcc, v2, v4
+// VI: v_cmpx_t_i16_e32 vcc, v2, v4 ; encoding: [0x02,0x09,0x6e,0x7d]
+// NOSICI: error: instruction not supported on this GPU
+
+v_cmpx_f_u16 vcc, v2, v4
+// VI: v_cmpx_f_u16_e32 vcc, v2, v4 ; encoding: [0x02,0x09,0x70,0x7d]
+// NOSICI: error: instruction not supported on this GPU
+
+v_cmpx_lt_u16 vcc, v2, v4
+// VI: v_cmpx_lt_u16_e32 vcc, v2, v4 ; encoding: [0x02,0x09,0x72,0x7d]
+// NOSICI: error: instruction not supported on this GPU
+
+v_cmpx_eq_u16 vcc, v2, v4
+// VI: v_cmpx_eq_u16_e32 vcc, v2, v4 ; encoding: [0x02,0x09,0x74,0x7d]
+// NOSICI: error: instruction not supported on this GPU
+
+v_cmpx_le_u16 vcc, v2, v4
+// VI: v_cmpx_le_u16_e32 vcc, v2, v4 ; encoding: [0x02,0x09,0x76,0x7d]
+// NOSICI: error: instruction not supported on this GPU
+
+v_cmpx_gt_u16 vcc, v2, v4
+// VI: v_cmpx_gt_u16_e32 vcc, v2, v4 ; encoding: [0x02,0x09,0x78,0x7d]
+// NOSICI: error: instruction not supported on this GPU
+
+v_cmpx_ne_u16 vcc, v2, v4
+// VI: v_cmpx_ne_u16_e32 vcc, v2, v4 ; encoding: [0x02,0x09,0x7a,0x7d]
+// NOSICI: error: instruction not supported on this GPU
+
+v_cmpx_ge_u16 vcc, v2, v4
+// VI: v_cmpx_ge_u16_e32 vcc, v2, v4 ; encoding: [0x02,0x09,0x7c,0x7d]
+// NOSICI: error: instruction not supported on this GPU
+
+v_cmpx_t_u16 vcc, v2, v4
+// VI: v_cmpx_t_u16_e32 vcc, v2, v4 ; encoding: [0x02,0x09,0x7e,0x7d]
+// NOSICI: error: instruction not supported on this GPU