[llvm] r290349 - AMDGPU: Fix missing 16-bit cmpx instructions

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 22 08:27:14 PST 2016


Author: arsenm
Date: Thu Dec 22 10:27:14 2016
New Revision: 290349

URL: http://llvm.org/viewvc/llvm-project?rev=290349&view=rev
Log:
AMDGPU: Fix missing 16-bit cmpx instructions

Added:
    llvm/trunk/test/MC/AMDGPU/vopc-vi.s
Modified:
    llvm/trunk/lib/Target/AMDGPU/VOPCInstructions.td

Modified: llvm/trunk/lib/Target/AMDGPU/VOPCInstructions.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AMDGPU/VOPCInstructions.td?rev=290349&r1=290348&r2=290349&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AMDGPU/VOPCInstructions.td (original)
+++ llvm/trunk/lib/Target/AMDGPU/VOPCInstructions.td Thu Dec 22 10:27:14 2016
@@ -209,6 +209,9 @@ multiclass VOPCX_F32 <string opName, str
 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_
 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 <0x
 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>;

Added: llvm/trunk/test/MC/AMDGPU/vopc-vi.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AMDGPU/vopc-vi.s?rev=290349&view=auto
==============================================================================
--- llvm/trunk/test/MC/AMDGPU/vopc-vi.s (added)
+++ llvm/trunk/test/MC/AMDGPU/vopc-vi.s Thu Dec 22 10:27:14 2016
@@ -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




More information about the llvm-commits mailing list