llvm.org GIT mirror llvm / 29ae5b8
R600/SI: Use unordered equal instructions git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224067 91177308-0d34-0410-b5e6-96231b3b80d8 Matt Arsenault 5 years ago
5 changed file(s) with 7 addition(s) and 16 deletion(s). Raw diff Collapse all Expand all
5959 addRegisterClass(MVT::v16f32, &AMDGPU::VReg_512RegClass);
6060
6161 computeRegisterProperties();
62
63 // Condition Codes
64 setCondCodeAction(ISD::SETUEQ, MVT::f32, Expand);
65 setCondCodeAction(ISD::SETUEQ, MVT::f64, Expand);
6662
6763 setOperationAction(ISD::VECTOR_SHUFFLE, MVT::v8i32, Expand);
6864 setOperationAction(ISD::VECTOR_SHUFFLE, MVT::v8f32, Expand);
510510 defm V_CMP_O_F32 : VOPC_F32 , "v_cmp_o_f32", COND_O>;
511511 defm V_CMP_U_F32 : VOPC_F32 , "v_cmp_u_f32", COND_UO>;
512512 defm V_CMP_NGE_F32 : VOPC_F32 , "v_cmp_nge_f32", COND_ULT>;
513 defm V_CMP_NLG_F32 : VOPC_F32 , "v_cmp_nlg_f32">;
513 defm V_CMP_NLG_F32 : VOPC_F32 , "v_cmp_nlg_f32", COND_UEQ>;
514514 defm V_CMP_NGT_F32 : VOPC_F32 , "v_cmp_ngt_f32", COND_ULE>;
515515 defm V_CMP_NLE_F32 : VOPC_F32 , "v_cmp_nle_f32", COND_UGT>;
516516 defm V_CMP_NEQ_F32 : VOPC_F32 , "v_cmp_neq_f32", COND_UNE>;
548548 defm V_CMP_O_F64 : VOPC_F64 , "v_cmp_o_f64", COND_O>;
549549 defm V_CMP_U_F64 : VOPC_F64 , "v_cmp_u_f64", COND_UO>;
550550 defm V_CMP_NGE_F64 : VOPC_F64 , "v_cmp_nge_f64", COND_ULT>;
551 defm V_CMP_NLG_F64 : VOPC_F64 , "v_cmp_nlg_f64">;
551 defm V_CMP_NLG_F64 : VOPC_F64 , "v_cmp_nlg_f64", COND_UEQ>;
552552 defm V_CMP_NGT_F64 : VOPC_F64 , "v_cmp_ngt_f64", COND_ULE>;
553553 defm V_CMP_NLE_F64 : VOPC_F64 , "v_cmp_nle_f64", COND_UGT>;
554554 defm V_CMP_NEQ_F64 : VOPC_F64 , "v_cmp_neq_f64", COND_UNE>;
6060 }
6161
6262 ; CHECK-LABEL: {{^}}feq_f64:
63 ; CHECK: v_cmp_eq_f64_e64 {{s[[0-9]+:[0-9]+], v[[0-9]+:[0-9]+], v[[0-9]+:[0-9]+]}}
63 ; CHECK: v_cmp_nlg_f64_e32 vcc, {{v[[0-9]+:[0-9]+], v[[0-9]+:[0-9]+]}}
6464 define void @feq_f64(double addrspace(1)* %out, double addrspace(1)* %in1,
6565 double addrspace(1)* %in2) {
6666 %r0 = load double addrspace(1)* %in1
128128 ; R600-DAG: OR_INT
129129 ; R600-DAG: SETNE_INT
130130
131 ; SI-DAG: v_cmp_u_f32_e32 vcc
132 ; SI-DAG: v_cmp_eq_f32_e64 [[CMP1:s\[[0-9]+:[0-9]+\]]]
133 ; SI: s_or_b64 [[OR:s\[[0-9]+:[0-9]+\]]], [[CMP1]], vcc
134 ; SI: v_cndmask_b32_e64 [[VRESULT:v[0-9]+]], 0, -1, [[OR]]
135 ; SI: buffer_store_dword [[VRESULT]]
131 ; SI: v_cmp_nlg_f32_e32 vcc
132 ; SI-NEXT: v_cndmask_b32_e64 {{v[0-9]+}}, 0, -1, vcc
136133 define void @f32_ueq(i32 addrspace(1)* %out, float %a, float %b) {
137134 entry:
138135 %0 = fcmp ueq float %a, %b
7777 }
7878
7979 ; FUNC-LABEL: {{^}}f64_ueq:
80 ; SI: v_cmp_u_f64
81 ; SI: v_cmp_eq_f64
82 ; SI: s_or_b64
83 ; SI: v_cndmask_b32
80 ; SI: v_cmp_nlg_f64_e32 vcc
81 ; SI-NEXT: v_cndmask_b32_e64 {{v[0-9]+}}, 0, -1, vcc
8482 define void @f64_ueq(i32 addrspace(1)* %out, double %a, double %b) {
8583 entry:
8684 %0 = fcmp ueq double %a, %b