diff --git a/clang/include/clang/Basic/riscv_vector_xtheadv.td b/clang/include/clang/Basic/riscv_vector_xtheadv.td index 8063388b8e3820..120aebcea67b18 100644 --- a/clang/include/clang/Basic/riscv_vector_xtheadv.td +++ b/clang/include/clang/Basic/riscv_vector_xtheadv.td @@ -1071,6 +1071,41 @@ multiclass RVVPseudoUnaryBuiltin { } } +multiclass RVVPseudoVFUnaryBuiltin { + let Name = NAME, + IRName = IR, + MaskedIRName = IR # "_mask", + UnMaskedPolicyScheme = HasPassthruOperand, + MaskedPolicyScheme = HasPassthruOperand, + ManualCodegen = [{ + { + if (IsMasked) { + std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); + if ((PolicyAttrs & RVV_VTA) && (PolicyAttrs & RVV_VMA)) + Ops.insert(Ops.begin(), llvm::PoisonValue::get(ResultType)); + Ops.insert(Ops.begin() + 2, Ops[1]); + // TODO: no policy in LLVM side for masked intrinsics. + // Ops.push_back(ConstantInt::get(Ops.back()->getType(), PolicyAttrs)); + // maskedoff, op1, op2, mask, vl + IntrinsicTypes = {ResultType, + Ops[2]->getType(), + Ops.back()->getType()}; + } else { + if (PolicyAttrs & RVV_VTA) + Ops.insert(Ops.begin(), llvm::PoisonValue::get(ResultType)); + // op1, po2, vl + IntrinsicTypes = {ResultType, + Ops[1]->getType(), Ops[2]->getType()}; + Ops.insert(Ops.begin() + 2, Ops[1]); + break; + } + break; + } + }] in { + def : RVVBuiltin<"v", "vv", type_range>; + } +} + multiclass RVVPseudoVNotBuiltin { let Name = NAME, IRName = ir, @@ -1624,6 +1659,71 @@ let UnMaskedPolicyScheme = HasPassthruOperand, } } +let UnMaskedPolicyScheme = HasPassthruOperand, + MaskedPolicyScheme = HasPassthruOperand in { + let ManualCodegen = [{ + { + // LLVM intrinsic + // Unmasked: (passthru, op0, round_mode, vl) + // Masked: (passthru, op0, mask, frm, vl) + + SmallVector Operands; + bool HasMaskedOff = !( + (IsMasked && (PolicyAttrs & RVV_VTA) && (PolicyAttrs & RVV_VMA)) || + (!IsMasked && PolicyAttrs & RVV_VTA)); + bool HasRoundModeOp = IsMasked ? + (HasMaskedOff ? Ops.size() == 5 : Ops.size() == 4) : + (HasMaskedOff ? Ops.size() == 4 : Ops.size() == 3); + + unsigned Offset = IsMasked ? + (HasMaskedOff ? 2 : 1) : (HasMaskedOff ? 1 : 0); + + if (!HasMaskedOff) + Operands.push_back(llvm::PoisonValue::get(ResultType)); + else + Operands.push_back(Ops[IsMasked ? 1 : 0]); + + Operands.push_back(Ops[Offset]); // op0 + + if (IsMasked) + Operands.push_back(Ops[0]); // mask + + if (HasRoundModeOp) { + Operands.push_back(Ops[Offset + 1]); // frm + Operands.push_back(Ops[Offset + 2]); // vl + } else { + Operands.push_back(ConstantInt::get(Ops[Offset + 1]->getType(), 7)); // frm + Operands.push_back(Ops[Offset + 1]); // vl + } + + // TODO: no policy in LLVM side for masked intrinsics. + // if (IsMasked) + // Operands.push_back(ConstantInt::get(Ops.back()->getType(), PolicyAttrs)); + + IntrinsicTypes = {ResultType, Operands.back()->getType()}; + llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); + return Builder.CreateCall(F, Operands, ""); + } + }] in { + // 14.7. Vector Floating-Point Square-Root Operations + defm th_vfsqrt : RVVOutBuiltinSet<"th_vfsqrt", "xfd", [["v", "v", "vv"]]>; + } + + // NOTE: there's no `th_vfrsqrt7` and `th_vfrec7` in XTHeadVector. + // though they are listed in `riscv-v-intrinsic-0.7.1.pdf`. + + // 14.10. Vector Floating-Point MIN/MAX Operations + defm th_vfmin : RVVFloatingBinBuiltinSet; + defm th_vfmax : RVVFloatingBinBuiltinSet; + + // 14.11. Vector Floating-Point Sign-Injection Operations + defm th_vfsgnj : RVVFloatingBinBuiltinSet; + defm th_vfsgnjn : RVVFloatingBinBuiltinSet; + defm th_vfsgnjx : RVVFloatingBinBuiltinSet; +} +defm th_vfneg_v : RVVPseudoVFUnaryBuiltin<"th_vfsgnjn", "xfd">; +defm th_vfabs_v : RVVPseudoVFUnaryBuiltin<"th_vfsgnjx", "xfd">; + // 15. Vector Reduction Operations // 15.1. Vector Single-Width Integer Reduction Instructions let UnMaskedPolicyScheme = HasPassthruOperand, diff --git a/clang/include/clang/Basic/riscv_vector_xtheadv_wrappers.td b/clang/include/clang/Basic/riscv_vector_xtheadv_wrappers.td index 274f8ecae7aa72..69b27b4aeddd7f 100644 --- a/clang/include/clang/Basic/riscv_vector_xtheadv_wrappers.td +++ b/clang/include/clang/Basic/riscv_vector_xtheadv_wrappers.td @@ -3813,6 +3813,319 @@ let HeaderCode = #define __riscv_vfwnmsac_vv_f64m8_m(mask, vd, vs1, vs2, vl) __riscv_th_vfwnmsac_vv_f64m8_m(mask, vd, vs1, vs2, vl) #define __riscv_vfwnmsac_vf_f64m8_m(mask, vd, vs1, vs2, vl) __riscv_th_vfwnmsac_vf_f64m8_m(mask, vd, vs1, vs2, vl) +#define __riscv_vfabs_v_f16m1(op1, vl) __riscv_th_vfabs_v_f16m1(op1, vl) +#define __riscv_vfabs_v_f16m2(op1, vl) __riscv_th_vfabs_v_f16m2(op1, vl) +#define __riscv_vfabs_v_f16m4(op1, vl) __riscv_th_vfabs_v_f16m4(op1, vl) +#define __riscv_vfabs_v_f16m8(op1, vl) __riscv_th_vfabs_v_f16m8(op1, vl) +#define __riscv_vfabs_v_f32m1(op1, vl) __riscv_th_vfabs_v_f32m1(op1, vl) +#define __riscv_vfabs_v_f32m2(op1, vl) __riscv_th_vfabs_v_f32m2(op1, vl) +#define __riscv_vfabs_v_f32m4(op1, vl) __riscv_th_vfabs_v_f32m4(op1, vl) +#define __riscv_vfabs_v_f32m8(op1, vl) __riscv_th_vfabs_v_f32m8(op1, vl) +#define __riscv_vfabs_v_f64m1(op1, vl) __riscv_th_vfabs_v_f64m1(op1, vl) +#define __riscv_vfabs_v_f64m2(op1, vl) __riscv_th_vfabs_v_f64m2(op1, vl) +#define __riscv_vfabs_v_f64m4(op1, vl) __riscv_th_vfabs_v_f64m4(op1, vl) +#define __riscv_vfabs_v_f64m8(op1, vl) __riscv_th_vfabs_v_f64m8(op1, vl) +#define __riscv_vfabs_v_f16m1_m(mask, op1, vl) __riscv_th_vfabs_v_f16m1_m(mask, op1, vl) +#define __riscv_vfabs_v_f16m2_m(mask, op1, vl) __riscv_th_vfabs_v_f16m2_m(mask, op1, vl) +#define __riscv_vfabs_v_f16m4_m(mask, op1, vl) __riscv_th_vfabs_v_f16m4_m(mask, op1, vl) +#define __riscv_vfabs_v_f16m8_m(mask, op1, vl) __riscv_th_vfabs_v_f16m8_m(mask, op1, vl) +#define __riscv_vfabs_v_f32m1_m(mask, op1, vl) __riscv_th_vfabs_v_f32m1_m(mask, op1, vl) +#define __riscv_vfabs_v_f32m2_m(mask, op1, vl) __riscv_th_vfabs_v_f32m2_m(mask, op1, vl) +#define __riscv_vfabs_v_f32m4_m(mask, op1, vl) __riscv_th_vfabs_v_f32m4_m(mask, op1, vl) +#define __riscv_vfabs_v_f32m8_m(mask, op1, vl) __riscv_th_vfabs_v_f32m8_m(mask, op1, vl) +#define __riscv_vfabs_v_f64m1_m(mask, op1, vl) __riscv_th_vfabs_v_f64m1_m(mask, op1, vl) +#define __riscv_vfabs_v_f64m2_m(mask, op1, vl) __riscv_th_vfabs_v_f64m2_m(mask, op1, vl) +#define __riscv_vfabs_v_f64m4_m(mask, op1, vl) __riscv_th_vfabs_v_f64m4_m(mask, op1, vl) +#define __riscv_vfabs_v_f64m8_m(mask, op1, vl) __riscv_th_vfabs_v_f64m8_m(mask, op1, vl) +#define __riscv_vfmax_vv_f16m1(op1, op2, vl) __riscv_th_vfmax_vv_f16m1(op1, op2, vl) +#define __riscv_vfmax_vf_f16m1(op1, op2, vl) __riscv_th_vfmax_vf_f16m1(op1, op2, vl) +#define __riscv_vfmax_vv_f16m2(op1, op2, vl) __riscv_th_vfmax_vv_f16m2(op1, op2, vl) +#define __riscv_vfmax_vf_f16m2(op1, op2, vl) __riscv_th_vfmax_vf_f16m2(op1, op2, vl) +#define __riscv_vfmax_vv_f16m4(op1, op2, vl) __riscv_th_vfmax_vv_f16m4(op1, op2, vl) +#define __riscv_vfmax_vf_f16m4(op1, op2, vl) __riscv_th_vfmax_vf_f16m4(op1, op2, vl) +#define __riscv_vfmax_vv_f16m8(op1, op2, vl) __riscv_th_vfmax_vv_f16m8(op1, op2, vl) +#define __riscv_vfmax_vf_f16m8(op1, op2, vl) __riscv_th_vfmax_vf_f16m8(op1, op2, vl) +#define __riscv_vfmax_vv_f32m1(op1, op2, vl) __riscv_th_vfmax_vv_f32m1(op1, op2, vl) +#define __riscv_vfmax_vf_f32m1(op1, op2, vl) __riscv_th_vfmax_vf_f32m1(op1, op2, vl) +#define __riscv_vfmax_vv_f32m2(op1, op2, vl) __riscv_th_vfmax_vv_f32m2(op1, op2, vl) +#define __riscv_vfmax_vf_f32m2(op1, op2, vl) __riscv_th_vfmax_vf_f32m2(op1, op2, vl) +#define __riscv_vfmax_vv_f32m4(op1, op2, vl) __riscv_th_vfmax_vv_f32m4(op1, op2, vl) +#define __riscv_vfmax_vf_f32m4(op1, op2, vl) __riscv_th_vfmax_vf_f32m4(op1, op2, vl) +#define __riscv_vfmax_vv_f32m8(op1, op2, vl) __riscv_th_vfmax_vv_f32m8(op1, op2, vl) +#define __riscv_vfmax_vf_f32m8(op1, op2, vl) __riscv_th_vfmax_vf_f32m8(op1, op2, vl) +#define __riscv_vfmax_vv_f64m1(op1, op2, vl) __riscv_th_vfmax_vv_f64m1(op1, op2, vl) +#define __riscv_vfmax_vf_f64m1(op1, op2, vl) __riscv_th_vfmax_vf_f64m1(op1, op2, vl) +#define __riscv_vfmax_vv_f64m2(op1, op2, vl) __riscv_th_vfmax_vv_f64m2(op1, op2, vl) +#define __riscv_vfmax_vf_f64m2(op1, op2, vl) __riscv_th_vfmax_vf_f64m2(op1, op2, vl) +#define __riscv_vfmax_vv_f64m4(op1, op2, vl) __riscv_th_vfmax_vv_f64m4(op1, op2, vl) +#define __riscv_vfmax_vf_f64m4(op1, op2, vl) __riscv_th_vfmax_vf_f64m4(op1, op2, vl) +#define __riscv_vfmax_vv_f64m8(op1, op2, vl) __riscv_th_vfmax_vv_f64m8(op1, op2, vl) +#define __riscv_vfmax_vf_f64m8(op1, op2, vl) __riscv_th_vfmax_vf_f64m8(op1, op2, vl) +#define __riscv_vfmax_vv_f16m1_m(mask, op1, op2, vl) __riscv_th_vfmax_vv_f16m1_m(mask, op1, op2, vl) +#define __riscv_vfmax_vf_f16m1_m(mask, op1, op2, vl) __riscv_th_vfmax_vf_f16m1_m(mask, op1, op2, vl) +#define __riscv_vfmax_vv_f16m2_m(mask, op1, op2, vl) __riscv_th_vfmax_vv_f16m2_m(mask, op1, op2, vl) +#define __riscv_vfmax_vf_f16m2_m(mask, op1, op2, vl) __riscv_th_vfmax_vf_f16m2_m(mask, op1, op2, vl) +#define __riscv_vfmax_vv_f16m4_m(mask, op1, op2, vl) __riscv_th_vfmax_vv_f16m4_m(mask, op1, op2, vl) +#define __riscv_vfmax_vf_f16m4_m(mask, op1, op2, vl) __riscv_th_vfmax_vf_f16m4_m(mask, op1, op2, vl) +#define __riscv_vfmax_vv_f16m8_m(mask, op1, op2, vl) __riscv_th_vfmax_vv_f16m8_m(mask, op1, op2, vl) +#define __riscv_vfmax_vf_f16m8_m(mask, op1, op2, vl) __riscv_th_vfmax_vf_f16m8_m(mask, op1, op2, vl) +#define __riscv_vfmax_vv_f32m1_m(mask, op1, op2, vl) __riscv_th_vfmax_vv_f32m1_m(mask, op1, op2, vl) +#define __riscv_vfmax_vf_f32m1_m(mask, op1, op2, vl) __riscv_th_vfmax_vf_f32m1_m(mask, op1, op2, vl) +#define __riscv_vfmax_vv_f32m2_m(mask, op1, op2, vl) __riscv_th_vfmax_vv_f32m2_m(mask, op1, op2, vl) +#define __riscv_vfmax_vf_f32m2_m(mask, op1, op2, vl) __riscv_th_vfmax_vf_f32m2_m(mask, op1, op2, vl) +#define __riscv_vfmax_vv_f32m4_m(mask, op1, op2, vl) __riscv_th_vfmax_vv_f32m4_m(mask, op1, op2, vl) +#define __riscv_vfmax_vf_f32m4_m(mask, op1, op2, vl) __riscv_th_vfmax_vf_f32m4_m(mask, op1, op2, vl) +#define __riscv_vfmax_vv_f32m8_m(mask, op1, op2, vl) __riscv_th_vfmax_vv_f32m8_m(mask, op1, op2, vl) +#define __riscv_vfmax_vf_f32m8_m(mask, op1, op2, vl) __riscv_th_vfmax_vf_f32m8_m(mask, op1, op2, vl) +#define __riscv_vfmax_vv_f64m1_m(mask, op1, op2, vl) __riscv_th_vfmax_vv_f64m1_m(mask, op1, op2, vl) +#define __riscv_vfmax_vf_f64m1_m(mask, op1, op2, vl) __riscv_th_vfmax_vf_f64m1_m(mask, op1, op2, vl) +#define __riscv_vfmax_vv_f64m2_m(mask, op1, op2, vl) __riscv_th_vfmax_vv_f64m2_m(mask, op1, op2, vl) +#define __riscv_vfmax_vf_f64m2_m(mask, op1, op2, vl) __riscv_th_vfmax_vf_f64m2_m(mask, op1, op2, vl) +#define __riscv_vfmax_vv_f64m4_m(mask, op1, op2, vl) __riscv_th_vfmax_vv_f64m4_m(mask, op1, op2, vl) +#define __riscv_vfmax_vf_f64m4_m(mask, op1, op2, vl) __riscv_th_vfmax_vf_f64m4_m(mask, op1, op2, vl) +#define __riscv_vfmax_vv_f64m8_m(mask, op1, op2, vl) __riscv_th_vfmax_vv_f64m8_m(mask, op1, op2, vl) +#define __riscv_vfmax_vf_f64m8_m(mask, op1, op2, vl) __riscv_th_vfmax_vf_f64m8_m(mask, op1, op2, vl) +#define __riscv_vfmin_vv_f16m1(op1, op2, vl) __riscv_th_vfmin_vv_f16m1(op1, op2, vl) +#define __riscv_vfmin_vf_f16m1(op1, op2, vl) __riscv_th_vfmin_vf_f16m1(op1, op2, vl) +#define __riscv_vfmin_vv_f16m2(op1, op2, vl) __riscv_th_vfmin_vv_f16m2(op1, op2, vl) +#define __riscv_vfmin_vf_f16m2(op1, op2, vl) __riscv_th_vfmin_vf_f16m2(op1, op2, vl) +#define __riscv_vfmin_vv_f16m4(op1, op2, vl) __riscv_th_vfmin_vv_f16m4(op1, op2, vl) +#define __riscv_vfmin_vf_f16m4(op1, op2, vl) __riscv_th_vfmin_vf_f16m4(op1, op2, vl) +#define __riscv_vfmin_vv_f16m8(op1, op2, vl) __riscv_th_vfmin_vv_f16m8(op1, op2, vl) +#define __riscv_vfmin_vf_f16m8(op1, op2, vl) __riscv_th_vfmin_vf_f16m8(op1, op2, vl) +#define __riscv_vfmin_vv_f32m1(op1, op2, vl) __riscv_th_vfmin_vv_f32m1(op1, op2, vl) +#define __riscv_vfmin_vf_f32m1(op1, op2, vl) __riscv_th_vfmin_vf_f32m1(op1, op2, vl) +#define __riscv_vfmin_vv_f32m2(op1, op2, vl) __riscv_th_vfmin_vv_f32m2(op1, op2, vl) +#define __riscv_vfmin_vf_f32m2(op1, op2, vl) __riscv_th_vfmin_vf_f32m2(op1, op2, vl) +#define __riscv_vfmin_vv_f32m4(op1, op2, vl) __riscv_th_vfmin_vv_f32m4(op1, op2, vl) +#define __riscv_vfmin_vf_f32m4(op1, op2, vl) __riscv_th_vfmin_vf_f32m4(op1, op2, vl) +#define __riscv_vfmin_vv_f32m8(op1, op2, vl) __riscv_th_vfmin_vv_f32m8(op1, op2, vl) +#define __riscv_vfmin_vf_f32m8(op1, op2, vl) __riscv_th_vfmin_vf_f32m8(op1, op2, vl) +#define __riscv_vfmin_vv_f64m1(op1, op2, vl) __riscv_th_vfmin_vv_f64m1(op1, op2, vl) +#define __riscv_vfmin_vf_f64m1(op1, op2, vl) __riscv_th_vfmin_vf_f64m1(op1, op2, vl) +#define __riscv_vfmin_vv_f64m2(op1, op2, vl) __riscv_th_vfmin_vv_f64m2(op1, op2, vl) +#define __riscv_vfmin_vf_f64m2(op1, op2, vl) __riscv_th_vfmin_vf_f64m2(op1, op2, vl) +#define __riscv_vfmin_vv_f64m4(op1, op2, vl) __riscv_th_vfmin_vv_f64m4(op1, op2, vl) +#define __riscv_vfmin_vf_f64m4(op1, op2, vl) __riscv_th_vfmin_vf_f64m4(op1, op2, vl) +#define __riscv_vfmin_vv_f64m8(op1, op2, vl) __riscv_th_vfmin_vv_f64m8(op1, op2, vl) +#define __riscv_vfmin_vf_f64m8(op1, op2, vl) __riscv_th_vfmin_vf_f64m8(op1, op2, vl) +#define __riscv_vfmin_vv_f16m1_m(mask, op1, op2, vl) __riscv_th_vfmin_vv_f16m1_m(mask, op1, op2, vl) +#define __riscv_vfmin_vf_f16m1_m(mask, op1, op2, vl) __riscv_th_vfmin_vf_f16m1_m(mask, op1, op2, vl) +#define __riscv_vfmin_vv_f16m2_m(mask, op1, op2, vl) __riscv_th_vfmin_vv_f16m2_m(mask, op1, op2, vl) +#define __riscv_vfmin_vf_f16m2_m(mask, op1, op2, vl) __riscv_th_vfmin_vf_f16m2_m(mask, op1, op2, vl) +#define __riscv_vfmin_vv_f16m4_m(mask, op1, op2, vl) __riscv_th_vfmin_vv_f16m4_m(mask, op1, op2, vl) +#define __riscv_vfmin_vf_f16m4_m(mask, op1, op2, vl) __riscv_th_vfmin_vf_f16m4_m(mask, op1, op2, vl) +#define __riscv_vfmin_vv_f16m8_m(mask, op1, op2, vl) __riscv_th_vfmin_vv_f16m8_m(mask, op1, op2, vl) +#define __riscv_vfmin_vf_f16m8_m(mask, op1, op2, vl) __riscv_th_vfmin_vf_f16m8_m(mask, op1, op2, vl) +#define __riscv_vfmin_vv_f32m1_m(mask, op1, op2, vl) __riscv_th_vfmin_vv_f32m1_m(mask, op1, op2, vl) +#define __riscv_vfmin_vf_f32m1_m(mask, op1, op2, vl) __riscv_th_vfmin_vf_f32m1_m(mask, op1, op2, vl) +#define __riscv_vfmin_vv_f32m2_m(mask, op1, op2, vl) __riscv_th_vfmin_vv_f32m2_m(mask, op1, op2, vl) +#define __riscv_vfmin_vf_f32m2_m(mask, op1, op2, vl) __riscv_th_vfmin_vf_f32m2_m(mask, op1, op2, vl) +#define __riscv_vfmin_vv_f32m4_m(mask, op1, op2, vl) __riscv_th_vfmin_vv_f32m4_m(mask, op1, op2, vl) +#define __riscv_vfmin_vf_f32m4_m(mask, op1, op2, vl) __riscv_th_vfmin_vf_f32m4_m(mask, op1, op2, vl) +#define __riscv_vfmin_vv_f32m8_m(mask, op1, op2, vl) __riscv_th_vfmin_vv_f32m8_m(mask, op1, op2, vl) +#define __riscv_vfmin_vf_f32m8_m(mask, op1, op2, vl) __riscv_th_vfmin_vf_f32m8_m(mask, op1, op2, vl) +#define __riscv_vfmin_vv_f64m1_m(mask, op1, op2, vl) __riscv_th_vfmin_vv_f64m1_m(mask, op1, op2, vl) +#define __riscv_vfmin_vf_f64m1_m(mask, op1, op2, vl) __riscv_th_vfmin_vf_f64m1_m(mask, op1, op2, vl) +#define __riscv_vfmin_vv_f64m2_m(mask, op1, op2, vl) __riscv_th_vfmin_vv_f64m2_m(mask, op1, op2, vl) +#define __riscv_vfmin_vf_f64m2_m(mask, op1, op2, vl) __riscv_th_vfmin_vf_f64m2_m(mask, op1, op2, vl) +#define __riscv_vfmin_vv_f64m4_m(mask, op1, op2, vl) __riscv_th_vfmin_vv_f64m4_m(mask, op1, op2, vl) +#define __riscv_vfmin_vf_f64m4_m(mask, op1, op2, vl) __riscv_th_vfmin_vf_f64m4_m(mask, op1, op2, vl) +#define __riscv_vfmin_vv_f64m8_m(mask, op1, op2, vl) __riscv_th_vfmin_vv_f64m8_m(mask, op1, op2, vl) +#define __riscv_vfmin_vf_f64m8_m(mask, op1, op2, vl) __riscv_th_vfmin_vf_f64m8_m(mask, op1, op2, vl) +#define __riscv_vfsgnj_vv_f16m1(op1, op2, vl) __riscv_th_vfsgnj_vv_f16m1(op1, op2, vl) +#define __riscv_vfsgnj_vf_f16m1(op1, op2, vl) __riscv_th_vfsgnj_vf_f16m1(op1, op2, vl) +#define __riscv_vfsgnj_vv_f16m2(op1, op2, vl) __riscv_th_vfsgnj_vv_f16m2(op1, op2, vl) +#define __riscv_vfsgnj_vf_f16m2(op1, op2, vl) __riscv_th_vfsgnj_vf_f16m2(op1, op2, vl) +#define __riscv_vfsgnj_vv_f16m4(op1, op2, vl) __riscv_th_vfsgnj_vv_f16m4(op1, op2, vl) +#define __riscv_vfsgnj_vf_f16m4(op1, op2, vl) __riscv_th_vfsgnj_vf_f16m4(op1, op2, vl) +#define __riscv_vfsgnj_vv_f16m8(op1, op2, vl) __riscv_th_vfsgnj_vv_f16m8(op1, op2, vl) +#define __riscv_vfsgnj_vf_f16m8(op1, op2, vl) __riscv_th_vfsgnj_vf_f16m8(op1, op2, vl) +#define __riscv_vfsgnj_vv_f32m1(op1, op2, vl) __riscv_th_vfsgnj_vv_f32m1(op1, op2, vl) +#define __riscv_vfsgnj_vf_f32m1(op1, op2, vl) __riscv_th_vfsgnj_vf_f32m1(op1, op2, vl) +#define __riscv_vfsgnj_vv_f32m2(op1, op2, vl) __riscv_th_vfsgnj_vv_f32m2(op1, op2, vl) +#define __riscv_vfsgnj_vf_f32m2(op1, op2, vl) __riscv_th_vfsgnj_vf_f32m2(op1, op2, vl) +#define __riscv_vfsgnj_vv_f32m4(op1, op2, vl) __riscv_th_vfsgnj_vv_f32m4(op1, op2, vl) +#define __riscv_vfsgnj_vf_f32m4(op1, op2, vl) __riscv_th_vfsgnj_vf_f32m4(op1, op2, vl) +#define __riscv_vfsgnj_vv_f32m8(op1, op2, vl) __riscv_th_vfsgnj_vv_f32m8(op1, op2, vl) +#define __riscv_vfsgnj_vf_f32m8(op1, op2, vl) __riscv_th_vfsgnj_vf_f32m8(op1, op2, vl) +#define __riscv_vfsgnj_vv_f64m1(op1, op2, vl) __riscv_th_vfsgnj_vv_f64m1(op1, op2, vl) +#define __riscv_vfsgnj_vf_f64m1(op1, op2, vl) __riscv_th_vfsgnj_vf_f64m1(op1, op2, vl) +#define __riscv_vfsgnj_vv_f64m2(op1, op2, vl) __riscv_th_vfsgnj_vv_f64m2(op1, op2, vl) +#define __riscv_vfsgnj_vf_f64m2(op1, op2, vl) __riscv_th_vfsgnj_vf_f64m2(op1, op2, vl) +#define __riscv_vfsgnj_vv_f64m4(op1, op2, vl) __riscv_th_vfsgnj_vv_f64m4(op1, op2, vl) +#define __riscv_vfsgnj_vf_f64m4(op1, op2, vl) __riscv_th_vfsgnj_vf_f64m4(op1, op2, vl) +#define __riscv_vfsgnj_vv_f64m8(op1, op2, vl) __riscv_th_vfsgnj_vv_f64m8(op1, op2, vl) +#define __riscv_vfsgnj_vf_f64m8(op1, op2, vl) __riscv_th_vfsgnj_vf_f64m8(op1, op2, vl) +#define __riscv_vfsgnj_vv_f16m1_m(mask, op1, op2, vl) __riscv_th_vfsgnj_vv_f16m1_m(mask, op1, op2, vl) +#define __riscv_vfsgnj_vf_f16m1_m(mask, op1, op2, vl) __riscv_th_vfsgnj_vf_f16m1_m(mask, op1, op2, vl) +#define __riscv_vfsgnj_vv_f16m2_m(mask, op1, op2, vl) __riscv_th_vfsgnj_vv_f16m2_m(mask, op1, op2, vl) +#define __riscv_vfsgnj_vf_f16m2_m(mask, op1, op2, vl) __riscv_th_vfsgnj_vf_f16m2_m(mask, op1, op2, vl) +#define __riscv_vfsgnj_vv_f16m4_m(mask, op1, op2, vl) __riscv_th_vfsgnj_vv_f16m4_m(mask, op1, op2, vl) +#define __riscv_vfsgnj_vf_f16m4_m(mask, op1, op2, vl) __riscv_th_vfsgnj_vf_f16m4_m(mask, op1, op2, vl) +#define __riscv_vfsgnj_vv_f16m8_m(mask, op1, op2, vl) __riscv_th_vfsgnj_vv_f16m8_m(mask, op1, op2, vl) +#define __riscv_vfsgnj_vf_f16m8_m(mask, op1, op2, vl) __riscv_th_vfsgnj_vf_f16m8_m(mask, op1, op2, vl) +#define __riscv_vfsgnj_vv_f32m1_m(mask, op1, op2, vl) __riscv_th_vfsgnj_vv_f32m1_m(mask, op1, op2, vl) +#define __riscv_vfsgnj_vf_f32m1_m(mask, op1, op2, vl) __riscv_th_vfsgnj_vf_f32m1_m(mask, op1, op2, vl) +#define __riscv_vfsgnj_vv_f32m2_m(mask, op1, op2, vl) __riscv_th_vfsgnj_vv_f32m2_m(mask, op1, op2, vl) +#define __riscv_vfsgnj_vf_f32m2_m(mask, op1, op2, vl) __riscv_th_vfsgnj_vf_f32m2_m(mask, op1, op2, vl) +#define __riscv_vfsgnj_vv_f32m4_m(mask, op1, op2, vl) __riscv_th_vfsgnj_vv_f32m4_m(mask, op1, op2, vl) +#define __riscv_vfsgnj_vf_f32m4_m(mask, op1, op2, vl) __riscv_th_vfsgnj_vf_f32m4_m(mask, op1, op2, vl) +#define __riscv_vfsgnj_vv_f32m8_m(mask, op1, op2, vl) __riscv_th_vfsgnj_vv_f32m8_m(mask, op1, op2, vl) +#define __riscv_vfsgnj_vf_f32m8_m(mask, op1, op2, vl) __riscv_th_vfsgnj_vf_f32m8_m(mask, op1, op2, vl) +#define __riscv_vfsgnj_vv_f64m1_m(mask, op1, op2, vl) __riscv_th_vfsgnj_vv_f64m1_m(mask, op1, op2, vl) +#define __riscv_vfsgnj_vf_f64m1_m(mask, op1, op2, vl) __riscv_th_vfsgnj_vf_f64m1_m(mask, op1, op2, vl) +#define __riscv_vfsgnj_vv_f64m2_m(mask, op1, op2, vl) __riscv_th_vfsgnj_vv_f64m2_m(mask, op1, op2, vl) +#define __riscv_vfsgnj_vf_f64m2_m(mask, op1, op2, vl) __riscv_th_vfsgnj_vf_f64m2_m(mask, op1, op2, vl) +#define __riscv_vfsgnj_vv_f64m4_m(mask, op1, op2, vl) __riscv_th_vfsgnj_vv_f64m4_m(mask, op1, op2, vl) +#define __riscv_vfsgnj_vf_f64m4_m(mask, op1, op2, vl) __riscv_th_vfsgnj_vf_f64m4_m(mask, op1, op2, vl) +#define __riscv_vfsgnj_vv_f64m8_m(mask, op1, op2, vl) __riscv_th_vfsgnj_vv_f64m8_m(mask, op1, op2, vl) +#define __riscv_vfsgnj_vf_f64m8_m(mask, op1, op2, vl) __riscv_th_vfsgnj_vf_f64m8_m(mask, op1, op2, vl) +#define __riscv_vfsgnjn_vv_f16m1(op1, op2, vl) __riscv_th_vfsgnjn_vv_f16m1(op1, op2, vl) +#define __riscv_vfsgnjn_vf_f16m1(op1, op2, vl) __riscv_th_vfsgnjn_vf_f16m1(op1, op2, vl) +#define __riscv_vfsgnjn_vv_f16m2(op1, op2, vl) __riscv_th_vfsgnjn_vv_f16m2(op1, op2, vl) +#define __riscv_vfsgnjn_vf_f16m2(op1, op2, vl) __riscv_th_vfsgnjn_vf_f16m2(op1, op2, vl) +#define __riscv_vfsgnjn_vv_f16m4(op1, op2, vl) __riscv_th_vfsgnjn_vv_f16m4(op1, op2, vl) +#define __riscv_vfsgnjn_vf_f16m4(op1, op2, vl) __riscv_th_vfsgnjn_vf_f16m4(op1, op2, vl) +#define __riscv_vfsgnjn_vv_f16m8(op1, op2, vl) __riscv_th_vfsgnjn_vv_f16m8(op1, op2, vl) +#define __riscv_vfsgnjn_vf_f16m8(op1, op2, vl) __riscv_th_vfsgnjn_vf_f16m8(op1, op2, vl) +#define __riscv_vfsgnjn_vv_f32m1(op1, op2, vl) __riscv_th_vfsgnjn_vv_f32m1(op1, op2, vl) +#define __riscv_vfsgnjn_vf_f32m1(op1, op2, vl) __riscv_th_vfsgnjn_vf_f32m1(op1, op2, vl) +#define __riscv_vfsgnjn_vv_f32m2(op1, op2, vl) __riscv_th_vfsgnjn_vv_f32m2(op1, op2, vl) +#define __riscv_vfsgnjn_vf_f32m2(op1, op2, vl) __riscv_th_vfsgnjn_vf_f32m2(op1, op2, vl) +#define __riscv_vfsgnjn_vv_f32m4(op1, op2, vl) __riscv_th_vfsgnjn_vv_f32m4(op1, op2, vl) +#define __riscv_vfsgnjn_vf_f32m4(op1, op2, vl) __riscv_th_vfsgnjn_vf_f32m4(op1, op2, vl) +#define __riscv_vfsgnjn_vv_f32m8(op1, op2, vl) __riscv_th_vfsgnjn_vv_f32m8(op1, op2, vl) +#define __riscv_vfsgnjn_vf_f32m8(op1, op2, vl) __riscv_th_vfsgnjn_vf_f32m8(op1, op2, vl) +#define __riscv_vfsgnjn_vv_f64m1(op1, op2, vl) __riscv_th_vfsgnjn_vv_f64m1(op1, op2, vl) +#define __riscv_vfsgnjn_vf_f64m1(op1, op2, vl) __riscv_th_vfsgnjn_vf_f64m1(op1, op2, vl) +#define __riscv_vfsgnjn_vv_f64m2(op1, op2, vl) __riscv_th_vfsgnjn_vv_f64m2(op1, op2, vl) +#define __riscv_vfsgnjn_vf_f64m2(op1, op2, vl) __riscv_th_vfsgnjn_vf_f64m2(op1, op2, vl) +#define __riscv_vfsgnjn_vv_f64m4(op1, op2, vl) __riscv_th_vfsgnjn_vv_f64m4(op1, op2, vl) +#define __riscv_vfsgnjn_vf_f64m4(op1, op2, vl) __riscv_th_vfsgnjn_vf_f64m4(op1, op2, vl) +#define __riscv_vfsgnjn_vv_f64m8(op1, op2, vl) __riscv_th_vfsgnjn_vv_f64m8(op1, op2, vl) +#define __riscv_vfsgnjn_vf_f64m8(op1, op2, vl) __riscv_th_vfsgnjn_vf_f64m8(op1, op2, vl) +#define __riscv_vfsgnjn_vv_f16m1_m(mask, op1, op2, vl) __riscv_th_vfsgnjn_vv_f16m1_m(mask, op1, op2, vl) +#define __riscv_vfsgnjn_vf_f16m1_m(mask, op1, op2, vl) __riscv_th_vfsgnjn_vf_f16m1_m(mask, op1, op2, vl) +#define __riscv_vfsgnjn_vv_f16m2_m(mask, op1, op2, vl) __riscv_th_vfsgnjn_vv_f16m2_m(mask, op1, op2, vl) +#define __riscv_vfsgnjn_vf_f16m2_m(mask, op1, op2, vl) __riscv_th_vfsgnjn_vf_f16m2_m(mask, op1, op2, vl) +#define __riscv_vfsgnjn_vv_f16m4_m(mask, op1, op2, vl) __riscv_th_vfsgnjn_vv_f16m4_m(mask, op1, op2, vl) +#define __riscv_vfsgnjn_vf_f16m4_m(mask, op1, op2, vl) __riscv_th_vfsgnjn_vf_f16m4_m(mask, op1, op2, vl) +#define __riscv_vfsgnjn_vv_f16m8_m(mask, op1, op2, vl) __riscv_th_vfsgnjn_vv_f16m8_m(mask, op1, op2, vl) +#define __riscv_vfsgnjn_vf_f16m8_m(mask, op1, op2, vl) __riscv_th_vfsgnjn_vf_f16m8_m(mask, op1, op2, vl) +#define __riscv_vfsgnjn_vv_f32m1_m(mask, op1, op2, vl) __riscv_th_vfsgnjn_vv_f32m1_m(mask, op1, op2, vl) +#define __riscv_vfsgnjn_vf_f32m1_m(mask, op1, op2, vl) __riscv_th_vfsgnjn_vf_f32m1_m(mask, op1, op2, vl) +#define __riscv_vfsgnjn_vv_f32m2_m(mask, op1, op2, vl) __riscv_th_vfsgnjn_vv_f32m2_m(mask, op1, op2, vl) +#define __riscv_vfsgnjn_vf_f32m2_m(mask, op1, op2, vl) __riscv_th_vfsgnjn_vf_f32m2_m(mask, op1, op2, vl) +#define __riscv_vfsgnjn_vv_f32m4_m(mask, op1, op2, vl) __riscv_th_vfsgnjn_vv_f32m4_m(mask, op1, op2, vl) +#define __riscv_vfsgnjn_vf_f32m4_m(mask, op1, op2, vl) __riscv_th_vfsgnjn_vf_f32m4_m(mask, op1, op2, vl) +#define __riscv_vfsgnjn_vv_f32m8_m(mask, op1, op2, vl) __riscv_th_vfsgnjn_vv_f32m8_m(mask, op1, op2, vl) +#define __riscv_vfsgnjn_vf_f32m8_m(mask, op1, op2, vl) __riscv_th_vfsgnjn_vf_f32m8_m(mask, op1, op2, vl) +#define __riscv_vfsgnjn_vv_f64m1_m(mask, op1, op2, vl) __riscv_th_vfsgnjn_vv_f64m1_m(mask, op1, op2, vl) +#define __riscv_vfsgnjn_vf_f64m1_m(mask, op1, op2, vl) __riscv_th_vfsgnjn_vf_f64m1_m(mask, op1, op2, vl) +#define __riscv_vfsgnjn_vv_f64m2_m(mask, op1, op2, vl) __riscv_th_vfsgnjn_vv_f64m2_m(mask, op1, op2, vl) +#define __riscv_vfsgnjn_vf_f64m2_m(mask, op1, op2, vl) __riscv_th_vfsgnjn_vf_f64m2_m(mask, op1, op2, vl) +#define __riscv_vfsgnjn_vv_f64m4_m(mask, op1, op2, vl) __riscv_th_vfsgnjn_vv_f64m4_m(mask, op1, op2, vl) +#define __riscv_vfsgnjn_vf_f64m4_m(mask, op1, op2, vl) __riscv_th_vfsgnjn_vf_f64m4_m(mask, op1, op2, vl) +#define __riscv_vfsgnjn_vv_f64m8_m(mask, op1, op2, vl) __riscv_th_vfsgnjn_vv_f64m8_m(mask, op1, op2, vl) +#define __riscv_vfsgnjn_vf_f64m8_m(mask, op1, op2, vl) __riscv_th_vfsgnjn_vf_f64m8_m(mask, op1, op2, vl) +#define __riscv_vfsgnjx_vv_f16m1(op1, op2, vl) __riscv_th_vfsgnjx_vv_f16m1(op1, op2, vl) +#define __riscv_vfsgnjx_vf_f16m1(op1, op2, vl) __riscv_th_vfsgnjx_vf_f16m1(op1, op2, vl) +#define __riscv_vfsgnjx_vv_f16m2(op1, op2, vl) __riscv_th_vfsgnjx_vv_f16m2(op1, op2, vl) +#define __riscv_vfsgnjx_vf_f16m2(op1, op2, vl) __riscv_th_vfsgnjx_vf_f16m2(op1, op2, vl) +#define __riscv_vfsgnjx_vv_f16m4(op1, op2, vl) __riscv_th_vfsgnjx_vv_f16m4(op1, op2, vl) +#define __riscv_vfsgnjx_vf_f16m4(op1, op2, vl) __riscv_th_vfsgnjx_vf_f16m4(op1, op2, vl) +#define __riscv_vfsgnjx_vv_f16m8(op1, op2, vl) __riscv_th_vfsgnjx_vv_f16m8(op1, op2, vl) +#define __riscv_vfsgnjx_vf_f16m8(op1, op2, vl) __riscv_th_vfsgnjx_vf_f16m8(op1, op2, vl) +#define __riscv_vfsgnjx_vv_f32m1(op1, op2, vl) __riscv_th_vfsgnjx_vv_f32m1(op1, op2, vl) +#define __riscv_vfsgnjx_vf_f32m1(op1, op2, vl) __riscv_th_vfsgnjx_vf_f32m1(op1, op2, vl) +#define __riscv_vfsgnjx_vv_f32m2(op1, op2, vl) __riscv_th_vfsgnjx_vv_f32m2(op1, op2, vl) +#define __riscv_vfsgnjx_vf_f32m2(op1, op2, vl) __riscv_th_vfsgnjx_vf_f32m2(op1, op2, vl) +#define __riscv_vfsgnjx_vv_f32m4(op1, op2, vl) __riscv_th_vfsgnjx_vv_f32m4(op1, op2, vl) +#define __riscv_vfsgnjx_vf_f32m4(op1, op2, vl) __riscv_th_vfsgnjx_vf_f32m4(op1, op2, vl) +#define __riscv_vfsgnjx_vv_f32m8(op1, op2, vl) __riscv_th_vfsgnjx_vv_f32m8(op1, op2, vl) +#define __riscv_vfsgnjx_vf_f32m8(op1, op2, vl) __riscv_th_vfsgnjx_vf_f32m8(op1, op2, vl) +#define __riscv_vfsgnjx_vv_f64m1(op1, op2, vl) __riscv_th_vfsgnjx_vv_f64m1(op1, op2, vl) +#define __riscv_vfsgnjx_vf_f64m1(op1, op2, vl) __riscv_th_vfsgnjx_vf_f64m1(op1, op2, vl) +#define __riscv_vfsgnjx_vv_f64m2(op1, op2, vl) __riscv_th_vfsgnjx_vv_f64m2(op1, op2, vl) +#define __riscv_vfsgnjx_vf_f64m2(op1, op2, vl) __riscv_th_vfsgnjx_vf_f64m2(op1, op2, vl) +#define __riscv_vfsgnjx_vv_f64m4(op1, op2, vl) __riscv_th_vfsgnjx_vv_f64m4(op1, op2, vl) +#define __riscv_vfsgnjx_vf_f64m4(op1, op2, vl) __riscv_th_vfsgnjx_vf_f64m4(op1, op2, vl) +#define __riscv_vfsgnjx_vv_f64m8(op1, op2, vl) __riscv_th_vfsgnjx_vv_f64m8(op1, op2, vl) +#define __riscv_vfsgnjx_vf_f64m8(op1, op2, vl) __riscv_th_vfsgnjx_vf_f64m8(op1, op2, vl) +#define __riscv_vfsgnjx_vv_f16m1_m(mask, op1, op2, vl) __riscv_th_vfsgnjx_vv_f16m1_m(mask, op1, op2, vl) +#define __riscv_vfsgnjx_vf_f16m1_m(mask, op1, op2, vl) __riscv_th_vfsgnjx_vf_f16m1_m(mask, op1, op2, vl) +#define __riscv_vfsgnjx_vv_f16m2_m(mask, op1, op2, vl) __riscv_th_vfsgnjx_vv_f16m2_m(mask, op1, op2, vl) +#define __riscv_vfsgnjx_vf_f16m2_m(mask, op1, op2, vl) __riscv_th_vfsgnjx_vf_f16m2_m(mask, op1, op2, vl) +#define __riscv_vfsgnjx_vv_f16m4_m(mask, op1, op2, vl) __riscv_th_vfsgnjx_vv_f16m4_m(mask, op1, op2, vl) +#define __riscv_vfsgnjx_vf_f16m4_m(mask, op1, op2, vl) __riscv_th_vfsgnjx_vf_f16m4_m(mask, op1, op2, vl) +#define __riscv_vfsgnjx_vv_f16m8_m(mask, op1, op2, vl) __riscv_th_vfsgnjx_vv_f16m8_m(mask, op1, op2, vl) +#define __riscv_vfsgnjx_vf_f16m8_m(mask, op1, op2, vl) __riscv_th_vfsgnjx_vf_f16m8_m(mask, op1, op2, vl) +#define __riscv_vfsgnjx_vv_f32m1_m(mask, op1, op2, vl) __riscv_th_vfsgnjx_vv_f32m1_m(mask, op1, op2, vl) +#define __riscv_vfsgnjx_vf_f32m1_m(mask, op1, op2, vl) __riscv_th_vfsgnjx_vf_f32m1_m(mask, op1, op2, vl) +#define __riscv_vfsgnjx_vv_f32m2_m(mask, op1, op2, vl) __riscv_th_vfsgnjx_vv_f32m2_m(mask, op1, op2, vl) +#define __riscv_vfsgnjx_vf_f32m2_m(mask, op1, op2, vl) __riscv_th_vfsgnjx_vf_f32m2_m(mask, op1, op2, vl) +#define __riscv_vfsgnjx_vv_f32m4_m(mask, op1, op2, vl) __riscv_th_vfsgnjx_vv_f32m4_m(mask, op1, op2, vl) +#define __riscv_vfsgnjx_vf_f32m4_m(mask, op1, op2, vl) __riscv_th_vfsgnjx_vf_f32m4_m(mask, op1, op2, vl) +#define __riscv_vfsgnjx_vv_f32m8_m(mask, op1, op2, vl) __riscv_th_vfsgnjx_vv_f32m8_m(mask, op1, op2, vl) +#define __riscv_vfsgnjx_vf_f32m8_m(mask, op1, op2, vl) __riscv_th_vfsgnjx_vf_f32m8_m(mask, op1, op2, vl) +#define __riscv_vfsgnjx_vv_f64m1_m(mask, op1, op2, vl) __riscv_th_vfsgnjx_vv_f64m1_m(mask, op1, op2, vl) +#define __riscv_vfsgnjx_vf_f64m1_m(mask, op1, op2, vl) __riscv_th_vfsgnjx_vf_f64m1_m(mask, op1, op2, vl) +#define __riscv_vfsgnjx_vv_f64m2_m(mask, op1, op2, vl) __riscv_th_vfsgnjx_vv_f64m2_m(mask, op1, op2, vl) +#define __riscv_vfsgnjx_vf_f64m2_m(mask, op1, op2, vl) __riscv_th_vfsgnjx_vf_f64m2_m(mask, op1, op2, vl) +#define __riscv_vfsgnjx_vv_f64m4_m(mask, op1, op2, vl) __riscv_th_vfsgnjx_vv_f64m4_m(mask, op1, op2, vl) +#define __riscv_vfsgnjx_vf_f64m4_m(mask, op1, op2, vl) __riscv_th_vfsgnjx_vf_f64m4_m(mask, op1, op2, vl) +#define __riscv_vfsgnjx_vv_f64m8_m(mask, op1, op2, vl) __riscv_th_vfsgnjx_vv_f64m8_m(mask, op1, op2, vl) +#define __riscv_vfsgnjx_vf_f64m8_m(mask, op1, op2, vl) __riscv_th_vfsgnjx_vf_f64m8_m(mask, op1, op2, vl) +#define __riscv_vfneg_v_f16m1(op1, vl) __riscv_th_vfneg_v_f16m1(op1, vl) +#define __riscv_vfneg_v_f16m2(op1, vl) __riscv_th_vfneg_v_f16m2(op1, vl) +#define __riscv_vfneg_v_f16m4(op1, vl) __riscv_th_vfneg_v_f16m4(op1, vl) +#define __riscv_vfneg_v_f16m8(op1, vl) __riscv_th_vfneg_v_f16m8(op1, vl) +#define __riscv_vfneg_v_f32m1(op1, vl) __riscv_th_vfneg_v_f32m1(op1, vl) +#define __riscv_vfneg_v_f32m2(op1, vl) __riscv_th_vfneg_v_f32m2(op1, vl) +#define __riscv_vfneg_v_f32m4(op1, vl) __riscv_th_vfneg_v_f32m4(op1, vl) +#define __riscv_vfneg_v_f32m8(op1, vl) __riscv_th_vfneg_v_f32m8(op1, vl) +#define __riscv_vfneg_v_f64m1(op1, vl) __riscv_th_vfneg_v_f64m1(op1, vl) +#define __riscv_vfneg_v_f64m2(op1, vl) __riscv_th_vfneg_v_f64m2(op1, vl) +#define __riscv_vfneg_v_f64m4(op1, vl) __riscv_th_vfneg_v_f64m4(op1, vl) +#define __riscv_vfneg_v_f64m8(op1, vl) __riscv_th_vfneg_v_f64m8(op1, vl) +#define __riscv_vfneg_v_f16m1_m(mask, op1, vl) __riscv_th_vfneg_v_f16m1_m(mask, op1, vl) +#define __riscv_vfneg_v_f16m2_m(mask, op1, vl) __riscv_th_vfneg_v_f16m2_m(mask, op1, vl) +#define __riscv_vfneg_v_f16m4_m(mask, op1, vl) __riscv_th_vfneg_v_f16m4_m(mask, op1, vl) +#define __riscv_vfneg_v_f16m8_m(mask, op1, vl) __riscv_th_vfneg_v_f16m8_m(mask, op1, vl) +#define __riscv_vfneg_v_f32m1_m(mask, op1, vl) __riscv_th_vfneg_v_f32m1_m(mask, op1, vl) +#define __riscv_vfneg_v_f32m2_m(mask, op1, vl) __riscv_th_vfneg_v_f32m2_m(mask, op1, vl) +#define __riscv_vfneg_v_f32m4_m(mask, op1, vl) __riscv_th_vfneg_v_f32m4_m(mask, op1, vl) +#define __riscv_vfneg_v_f32m8_m(mask, op1, vl) __riscv_th_vfneg_v_f32m8_m(mask, op1, vl) +#define __riscv_vfneg_v_f64m1_m(mask, op1, vl) __riscv_th_vfneg_v_f64m1_m(mask, op1, vl) +#define __riscv_vfneg_v_f64m2_m(mask, op1, vl) __riscv_th_vfneg_v_f64m2_m(mask, op1, vl) +#define __riscv_vfneg_v_f64m4_m(mask, op1, vl) __riscv_th_vfneg_v_f64m4_m(mask, op1, vl) +#define __riscv_vfneg_v_f64m8_m(mask, op1, vl) __riscv_th_vfneg_v_f64m8_m(mask, op1, vl) +#define __riscv_vfsqrt_v_f16m1(op1, vl) __riscv_th_vfsqrt_v_f16m1(op1, vl) +#define __riscv_vfsqrt_v_f16m2(op1, vl) __riscv_th_vfsqrt_v_f16m2(op1, vl) +#define __riscv_vfsqrt_v_f16m4(op1, vl) __riscv_th_vfsqrt_v_f16m4(op1, vl) +#define __riscv_vfsqrt_v_f16m8(op1, vl) __riscv_th_vfsqrt_v_f16m8(op1, vl) +#define __riscv_vfsqrt_v_f32m1(op1, vl) __riscv_th_vfsqrt_v_f32m1(op1, vl) +#define __riscv_vfsqrt_v_f32m2(op1, vl) __riscv_th_vfsqrt_v_f32m2(op1, vl) +#define __riscv_vfsqrt_v_f32m4(op1, vl) __riscv_th_vfsqrt_v_f32m4(op1, vl) +#define __riscv_vfsqrt_v_f32m8(op1, vl) __riscv_th_vfsqrt_v_f32m8(op1, vl) +#define __riscv_vfsqrt_v_f64m1(op1, vl) __riscv_th_vfsqrt_v_f64m1(op1, vl) +#define __riscv_vfsqrt_v_f64m2(op1, vl) __riscv_th_vfsqrt_v_f64m2(op1, vl) +#define __riscv_vfsqrt_v_f64m4(op1, vl) __riscv_th_vfsqrt_v_f64m4(op1, vl) +#define __riscv_vfsqrt_v_f64m8(op1, vl) __riscv_th_vfsqrt_v_f64m8(op1, vl) +#define __riscv_vfsqrt_v_f16m1_m(mask, op1, vl) __riscv_th_vfsqrt_v_f16m1_m(mask, op1, vl) +#define __riscv_vfsqrt_v_f16m2_m(mask, op1, vl) __riscv_th_vfsqrt_v_f16m2_m(mask, op1, vl) +#define __riscv_vfsqrt_v_f16m4_m(mask, op1, vl) __riscv_th_vfsqrt_v_f16m4_m(mask, op1, vl) +#define __riscv_vfsqrt_v_f16m8_m(mask, op1, vl) __riscv_th_vfsqrt_v_f16m8_m(mask, op1, vl) +#define __riscv_vfsqrt_v_f32m1_m(mask, op1, vl) __riscv_th_vfsqrt_v_f32m1_m(mask, op1, vl) +#define __riscv_vfsqrt_v_f32m2_m(mask, op1, vl) __riscv_th_vfsqrt_v_f32m2_m(mask, op1, vl) +#define __riscv_vfsqrt_v_f32m4_m(mask, op1, vl) __riscv_th_vfsqrt_v_f32m4_m(mask, op1, vl) +#define __riscv_vfsqrt_v_f32m8_m(mask, op1, vl) __riscv_th_vfsqrt_v_f32m8_m(mask, op1, vl) +#define __riscv_vfsqrt_v_f64m1_m(mask, op1, vl) __riscv_th_vfsqrt_v_f64m1_m(mask, op1, vl) +#define __riscv_vfsqrt_v_f64m2_m(mask, op1, vl) __riscv_th_vfsqrt_v_f64m2_m(mask, op1, vl) +#define __riscv_vfsqrt_v_f64m4_m(mask, op1, vl) __riscv_th_vfsqrt_v_f64m4_m(mask, op1, vl) +#define __riscv_vfsqrt_v_f64m8_m(mask, op1, vl) __riscv_th_vfsqrt_v_f64m8_m(mask, op1, vl) + }] in def th_vector_floating_point_operations_wrapper_macros: RVVHeader; diff --git a/clang/test/CodeGen/RISCV/rvv0p71-intrinsics-handcrafted/vector-floating/thead/vfabs.c b/clang/test/CodeGen/RISCV/rvv0p71-intrinsics-handcrafted/vector-floating/thead/vfabs.c new file mode 100644 index 00000000000000..5fb77fad606aef --- /dev/null +++ b/clang/test/CodeGen/RISCV/rvv0p71-intrinsics-handcrafted/vector-floating/thead/vfabs.c @@ -0,0 +1,249 @@ +// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 2 +// REQUIRES: riscv-registered-target +// RUN: %clang_cc1 -triple riscv64 -target-feature +xtheadvector \ +// RUN: -target-feature +d -disable-O0-optnone \ +// RUN: -emit-llvm %s -o - | opt -S -passes=mem2reg | \ +// RUN: FileCheck --check-prefix=CHECK-RV64 %s + +#include + +// CHECK-RV64-LABEL: define dso_local @test_vfabs_v_f16m1 +// CHECK-RV64-SAME: ( [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0:[0-9]+]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.nxv4f16.nxv4f16.i64( poison, [[OP1]], [[OP1]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m1_t test_vfabs_v_f16m1(vfloat16m1_t op1, size_t vl) { + return __riscv_th_vfabs_v_f16m1(op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfabs_v_f16m2 +// CHECK-RV64-SAME: ( [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.nxv8f16.nxv8f16.i64( poison, [[OP1]], [[OP1]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m2_t test_vfabs_v_f16m2(vfloat16m2_t op1, size_t vl) { + return __riscv_th_vfabs_v_f16m2(op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfabs_v_f16m4 +// CHECK-RV64-SAME: ( [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.nxv16f16.nxv16f16.i64( poison, [[OP1]], [[OP1]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m4_t test_vfabs_v_f16m4(vfloat16m4_t op1, size_t vl) { + return __riscv_th_vfabs_v_f16m4(op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfabs_v_f16m8 +// CHECK-RV64-SAME: ( [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.nxv32f16.nxv32f16.i64( poison, [[OP1]], [[OP1]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m8_t test_vfabs_v_f16m8(vfloat16m8_t op1, size_t vl) { + return __riscv_th_vfabs_v_f16m8(op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfabs_v_f32m1 +// CHECK-RV64-SAME: ( [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.nxv2f32.nxv2f32.i64( poison, [[OP1]], [[OP1]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m1_t test_vfabs_v_f32m1(vfloat32m1_t op1, size_t vl) { + return __riscv_th_vfabs_v_f32m1(op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfabs_v_f32m2 +// CHECK-RV64-SAME: ( [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.nxv4f32.nxv4f32.i64( poison, [[OP1]], [[OP1]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m2_t test_vfabs_v_f32m2(vfloat32m2_t op1, size_t vl) { + return __riscv_th_vfabs_v_f32m2(op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfabs_v_f32m4 +// CHECK-RV64-SAME: ( [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.nxv8f32.nxv8f32.i64( poison, [[OP1]], [[OP1]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m4_t test_vfabs_v_f32m4(vfloat32m4_t op1, size_t vl) { + return __riscv_th_vfabs_v_f32m4(op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfabs_v_f32m8 +// CHECK-RV64-SAME: ( [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.nxv16f32.nxv16f32.i64( poison, [[OP1]], [[OP1]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m8_t test_vfabs_v_f32m8(vfloat32m8_t op1, size_t vl) { + return __riscv_th_vfabs_v_f32m8(op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfabs_v_f64m1 +// CHECK-RV64-SAME: ( [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.nxv1f64.nxv1f64.i64( poison, [[OP1]], [[OP1]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m1_t test_vfabs_v_f64m1(vfloat64m1_t op1, size_t vl) { + return __riscv_th_vfabs_v_f64m1(op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfabs_v_f64m2 +// CHECK-RV64-SAME: ( [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.nxv2f64.nxv2f64.i64( poison, [[OP1]], [[OP1]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m2_t test_vfabs_v_f64m2(vfloat64m2_t op1, size_t vl) { + return __riscv_th_vfabs_v_f64m2(op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfabs_v_f64m4 +// CHECK-RV64-SAME: ( [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.nxv4f64.nxv4f64.i64( poison, [[OP1]], [[OP1]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m4_t test_vfabs_v_f64m4(vfloat64m4_t op1, size_t vl) { + return __riscv_th_vfabs_v_f64m4(op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfabs_v_f64m8 +// CHECK-RV64-SAME: ( [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.nxv8f64.nxv8f64.i64( poison, [[OP1]], [[OP1]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m8_t test_vfabs_v_f64m8(vfloat64m8_t op1, size_t vl) { + return __riscv_th_vfabs_v_f64m8(op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfabs_v_f16m1_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.mask.nxv4f16.nxv4f16.i64( poison, [[OP1]], [[OP1]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m1_t test_vfabs_v_f16m1_m(vbool16_t mask, vfloat16m1_t op1, size_t vl) { + return __riscv_th_vfabs_v_f16m1_m(mask, op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfabs_v_f16m2_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.mask.nxv8f16.nxv8f16.i64( poison, [[OP1]], [[OP1]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m2_t test_vfabs_v_f16m2_m(vbool8_t mask, vfloat16m2_t op1, size_t vl) { + return __riscv_th_vfabs_v_f16m2_m(mask, op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfabs_v_f16m4_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.mask.nxv16f16.nxv16f16.i64( poison, [[OP1]], [[OP1]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m4_t test_vfabs_v_f16m4_m(vbool4_t mask, vfloat16m4_t op1, size_t vl) { + return __riscv_th_vfabs_v_f16m4_m(mask, op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfabs_v_f16m8_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.mask.nxv32f16.nxv32f16.i64( poison, [[OP1]], [[OP1]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m8_t test_vfabs_v_f16m8_m(vbool2_t mask, vfloat16m8_t op1, size_t vl) { + return __riscv_th_vfabs_v_f16m8_m(mask, op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfabs_v_f32m1_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.mask.nxv2f32.nxv2f32.i64( poison, [[OP1]], [[OP1]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m1_t test_vfabs_v_f32m1_m(vbool32_t mask, vfloat32m1_t op1, size_t vl) { + return __riscv_th_vfabs_v_f32m1_m(mask, op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfabs_v_f32m2_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.mask.nxv4f32.nxv4f32.i64( poison, [[OP1]], [[OP1]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m2_t test_vfabs_v_f32m2_m(vbool16_t mask, vfloat32m2_t op1, size_t vl) { + return __riscv_th_vfabs_v_f32m2_m(mask, op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfabs_v_f32m4_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.mask.nxv8f32.nxv8f32.i64( poison, [[OP1]], [[OP1]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m4_t test_vfabs_v_f32m4_m(vbool8_t mask, vfloat32m4_t op1, size_t vl) { + return __riscv_th_vfabs_v_f32m4_m(mask, op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfabs_v_f32m8_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.mask.nxv16f32.nxv16f32.i64( poison, [[OP1]], [[OP1]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m8_t test_vfabs_v_f32m8_m(vbool4_t mask, vfloat32m8_t op1, size_t vl) { + return __riscv_th_vfabs_v_f32m8_m(mask, op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfabs_v_f64m1_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.mask.nxv1f64.nxv1f64.i64( poison, [[OP1]], [[OP1]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m1_t test_vfabs_v_f64m1_m(vbool64_t mask, vfloat64m1_t op1, size_t vl) { + return __riscv_th_vfabs_v_f64m1_m(mask, op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfabs_v_f64m2_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.mask.nxv2f64.nxv2f64.i64( poison, [[OP1]], [[OP1]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m2_t test_vfabs_v_f64m2_m(vbool32_t mask, vfloat64m2_t op1, size_t vl) { + return __riscv_th_vfabs_v_f64m2_m(mask, op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfabs_v_f64m4_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.mask.nxv4f64.nxv4f64.i64( poison, [[OP1]], [[OP1]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m4_t test_vfabs_v_f64m4_m(vbool16_t mask, vfloat64m4_t op1, size_t vl) { + return __riscv_th_vfabs_v_f64m4_m(mask, op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfabs_v_f64m8_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.mask.nxv8f64.nxv8f64.i64( poison, [[OP1]], [[OP1]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m8_t test_vfabs_v_f64m8_m(vbool8_t mask, vfloat64m8_t op1, size_t vl) { + return __riscv_th_vfabs_v_f64m8_m(mask, op1, vl); +} + diff --git a/clang/test/CodeGen/RISCV/rvv0p71-intrinsics-handcrafted/vector-floating/thead/vfmax.c b/clang/test/CodeGen/RISCV/rvv0p71-intrinsics-handcrafted/vector-floating/thead/vfmax.c new file mode 100644 index 00000000000000..96968c1065419a --- /dev/null +++ b/clang/test/CodeGen/RISCV/rvv0p71-intrinsics-handcrafted/vector-floating/thead/vfmax.c @@ -0,0 +1,489 @@ +// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 2 +// REQUIRES: riscv-registered-target +// RUN: %clang_cc1 -triple riscv64 -target-feature +xtheadvector \ +// RUN: -target-feature +d -disable-O0-optnone \ +// RUN: -emit-llvm %s -o - | opt -S -passes=mem2reg | \ +// RUN: FileCheck --check-prefix=CHECK-RV64 %s + +#include + +// CHECK-RV64-LABEL: define dso_local @test_vfmax_vv_f16m1 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0:[0-9]+]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmax.nxv4f16.nxv4f16.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m1_t test_vfmax_vv_f16m1(vfloat16m1_t op1, vfloat16m1_t op2, size_t vl) { + return __riscv_th_vfmax_vv_f16m1(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmax_vf_f16m1 +// CHECK-RV64-SAME: ( [[OP1:%.*]], half noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmax.nxv4f16.f16.i64( poison, [[OP1]], half [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m1_t test_vfmax_vf_f16m1(vfloat16m1_t op1, _Float16 op2, size_t vl) { + return __riscv_th_vfmax_vf_f16m1(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmax_vv_f16m2 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmax.nxv8f16.nxv8f16.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m2_t test_vfmax_vv_f16m2(vfloat16m2_t op1, vfloat16m2_t op2, size_t vl) { + return __riscv_th_vfmax_vv_f16m2(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmax_vf_f16m2 +// CHECK-RV64-SAME: ( [[OP1:%.*]], half noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmax.nxv8f16.f16.i64( poison, [[OP1]], half [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m2_t test_vfmax_vf_f16m2(vfloat16m2_t op1, _Float16 op2, size_t vl) { + return __riscv_th_vfmax_vf_f16m2(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmax_vv_f16m4 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmax.nxv16f16.nxv16f16.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m4_t test_vfmax_vv_f16m4(vfloat16m4_t op1, vfloat16m4_t op2, size_t vl) { + return __riscv_th_vfmax_vv_f16m4(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmax_vf_f16m4 +// CHECK-RV64-SAME: ( [[OP1:%.*]], half noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmax.nxv16f16.f16.i64( poison, [[OP1]], half [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m4_t test_vfmax_vf_f16m4(vfloat16m4_t op1, _Float16 op2, size_t vl) { + return __riscv_th_vfmax_vf_f16m4(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmax_vv_f16m8 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmax.nxv32f16.nxv32f16.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m8_t test_vfmax_vv_f16m8(vfloat16m8_t op1, vfloat16m8_t op2, size_t vl) { + return __riscv_th_vfmax_vv_f16m8(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmax_vf_f16m8 +// CHECK-RV64-SAME: ( [[OP1:%.*]], half noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmax.nxv32f16.f16.i64( poison, [[OP1]], half [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m8_t test_vfmax_vf_f16m8(vfloat16m8_t op1, _Float16 op2, size_t vl) { + return __riscv_th_vfmax_vf_f16m8(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmax_vv_f32m1 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmax.nxv2f32.nxv2f32.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m1_t test_vfmax_vv_f32m1(vfloat32m1_t op1, vfloat32m1_t op2, size_t vl) { + return __riscv_th_vfmax_vv_f32m1(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmax_vf_f32m1 +// CHECK-RV64-SAME: ( [[OP1:%.*]], float noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmax.nxv2f32.f32.i64( poison, [[OP1]], float [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m1_t test_vfmax_vf_f32m1(vfloat32m1_t op1, float op2, size_t vl) { + return __riscv_th_vfmax_vf_f32m1(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmax_vv_f32m2 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmax.nxv4f32.nxv4f32.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m2_t test_vfmax_vv_f32m2(vfloat32m2_t op1, vfloat32m2_t op2, size_t vl) { + return __riscv_th_vfmax_vv_f32m2(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmax_vf_f32m2 +// CHECK-RV64-SAME: ( [[OP1:%.*]], float noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmax.nxv4f32.f32.i64( poison, [[OP1]], float [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m2_t test_vfmax_vf_f32m2(vfloat32m2_t op1, float op2, size_t vl) { + return __riscv_th_vfmax_vf_f32m2(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmax_vv_f32m4 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmax.nxv8f32.nxv8f32.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m4_t test_vfmax_vv_f32m4(vfloat32m4_t op1, vfloat32m4_t op2, size_t vl) { + return __riscv_th_vfmax_vv_f32m4(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmax_vf_f32m4 +// CHECK-RV64-SAME: ( [[OP1:%.*]], float noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmax.nxv8f32.f32.i64( poison, [[OP1]], float [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m4_t test_vfmax_vf_f32m4(vfloat32m4_t op1, float op2, size_t vl) { + return __riscv_th_vfmax_vf_f32m4(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmax_vv_f32m8 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmax.nxv16f32.nxv16f32.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m8_t test_vfmax_vv_f32m8(vfloat32m8_t op1, vfloat32m8_t op2, size_t vl) { + return __riscv_th_vfmax_vv_f32m8(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmax_vf_f32m8 +// CHECK-RV64-SAME: ( [[OP1:%.*]], float noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmax.nxv16f32.f32.i64( poison, [[OP1]], float [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m8_t test_vfmax_vf_f32m8(vfloat32m8_t op1, float op2, size_t vl) { + return __riscv_th_vfmax_vf_f32m8(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmax_vv_f64m1 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmax.nxv1f64.nxv1f64.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m1_t test_vfmax_vv_f64m1(vfloat64m1_t op1, vfloat64m1_t op2, size_t vl) { + return __riscv_th_vfmax_vv_f64m1(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmax_vf_f64m1 +// CHECK-RV64-SAME: ( [[OP1:%.*]], double noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmax.nxv1f64.f64.i64( poison, [[OP1]], double [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m1_t test_vfmax_vf_f64m1(vfloat64m1_t op1, double op2, size_t vl) { + return __riscv_th_vfmax_vf_f64m1(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmax_vv_f64m2 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmax.nxv2f64.nxv2f64.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m2_t test_vfmax_vv_f64m2(vfloat64m2_t op1, vfloat64m2_t op2, size_t vl) { + return __riscv_th_vfmax_vv_f64m2(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmax_vf_f64m2 +// CHECK-RV64-SAME: ( [[OP1:%.*]], double noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmax.nxv2f64.f64.i64( poison, [[OP1]], double [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m2_t test_vfmax_vf_f64m2(vfloat64m2_t op1, double op2, size_t vl) { + return __riscv_th_vfmax_vf_f64m2(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmax_vv_f64m4 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmax.nxv4f64.nxv4f64.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m4_t test_vfmax_vv_f64m4(vfloat64m4_t op1, vfloat64m4_t op2, size_t vl) { + return __riscv_th_vfmax_vv_f64m4(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmax_vf_f64m4 +// CHECK-RV64-SAME: ( [[OP1:%.*]], double noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmax.nxv4f64.f64.i64( poison, [[OP1]], double [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m4_t test_vfmax_vf_f64m4(vfloat64m4_t op1, double op2, size_t vl) { + return __riscv_th_vfmax_vf_f64m4(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmax_vv_f64m8 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmax.nxv8f64.nxv8f64.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m8_t test_vfmax_vv_f64m8(vfloat64m8_t op1, vfloat64m8_t op2, size_t vl) { + return __riscv_th_vfmax_vv_f64m8(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmax_vf_f64m8 +// CHECK-RV64-SAME: ( [[OP1:%.*]], double noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmax.nxv8f64.f64.i64( poison, [[OP1]], double [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m8_t test_vfmax_vf_f64m8(vfloat64m8_t op1, double op2, size_t vl) { + return __riscv_th_vfmax_vf_f64m8(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmax_vv_f16m1_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmax.mask.nxv4f16.nxv4f16.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m1_t test_vfmax_vv_f16m1_m(vbool16_t mask, vfloat16m1_t op1, vfloat16m1_t op2, size_t vl) { + return __riscv_th_vfmax_vv_f16m1_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmax_vf_f16m1_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], half noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmax.mask.nxv4f16.f16.i64( poison, [[OP1]], half [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m1_t test_vfmax_vf_f16m1_m(vbool16_t mask, vfloat16m1_t op1, _Float16 op2, size_t vl) { + return __riscv_th_vfmax_vf_f16m1_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmax_vv_f16m2_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmax.mask.nxv8f16.nxv8f16.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m2_t test_vfmax_vv_f16m2_m(vbool8_t mask, vfloat16m2_t op1, vfloat16m2_t op2, size_t vl) { + return __riscv_th_vfmax_vv_f16m2_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmax_vf_f16m2_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], half noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmax.mask.nxv8f16.f16.i64( poison, [[OP1]], half [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m2_t test_vfmax_vf_f16m2_m(vbool8_t mask, vfloat16m2_t op1, _Float16 op2, size_t vl) { + return __riscv_th_vfmax_vf_f16m2_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmax_vv_f16m4_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmax.mask.nxv16f16.nxv16f16.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m4_t test_vfmax_vv_f16m4_m(vbool4_t mask, vfloat16m4_t op1, vfloat16m4_t op2, size_t vl) { + return __riscv_th_vfmax_vv_f16m4_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmax_vf_f16m4_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], half noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmax.mask.nxv16f16.f16.i64( poison, [[OP1]], half [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m4_t test_vfmax_vf_f16m4_m(vbool4_t mask, vfloat16m4_t op1, _Float16 op2, size_t vl) { + return __riscv_th_vfmax_vf_f16m4_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmax_vv_f16m8_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmax.mask.nxv32f16.nxv32f16.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m8_t test_vfmax_vv_f16m8_m(vbool2_t mask, vfloat16m8_t op1, vfloat16m8_t op2, size_t vl) { + return __riscv_th_vfmax_vv_f16m8_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmax_vf_f16m8_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], half noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmax.mask.nxv32f16.f16.i64( poison, [[OP1]], half [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m8_t test_vfmax_vf_f16m8_m(vbool2_t mask, vfloat16m8_t op1, _Float16 op2, size_t vl) { + return __riscv_th_vfmax_vf_f16m8_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmax_vv_f32m1_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmax.mask.nxv2f32.nxv2f32.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m1_t test_vfmax_vv_f32m1_m(vbool32_t mask, vfloat32m1_t op1, vfloat32m1_t op2, size_t vl) { + return __riscv_th_vfmax_vv_f32m1_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmax_vf_f32m1_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], float noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmax.mask.nxv2f32.f32.i64( poison, [[OP1]], float [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m1_t test_vfmax_vf_f32m1_m(vbool32_t mask, vfloat32m1_t op1, float op2, size_t vl) { + return __riscv_th_vfmax_vf_f32m1_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmax_vv_f32m2_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmax.mask.nxv4f32.nxv4f32.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m2_t test_vfmax_vv_f32m2_m(vbool16_t mask, vfloat32m2_t op1, vfloat32m2_t op2, size_t vl) { + return __riscv_th_vfmax_vv_f32m2_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmax_vf_f32m2_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], float noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmax.mask.nxv4f32.f32.i64( poison, [[OP1]], float [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m2_t test_vfmax_vf_f32m2_m(vbool16_t mask, vfloat32m2_t op1, float op2, size_t vl) { + return __riscv_th_vfmax_vf_f32m2_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmax_vv_f32m4_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmax.mask.nxv8f32.nxv8f32.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m4_t test_vfmax_vv_f32m4_m(vbool8_t mask, vfloat32m4_t op1, vfloat32m4_t op2, size_t vl) { + return __riscv_th_vfmax_vv_f32m4_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmax_vf_f32m4_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], float noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmax.mask.nxv8f32.f32.i64( poison, [[OP1]], float [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m4_t test_vfmax_vf_f32m4_m(vbool8_t mask, vfloat32m4_t op1, float op2, size_t vl) { + return __riscv_th_vfmax_vf_f32m4_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmax_vv_f32m8_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmax.mask.nxv16f32.nxv16f32.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m8_t test_vfmax_vv_f32m8_m(vbool4_t mask, vfloat32m8_t op1, vfloat32m8_t op2, size_t vl) { + return __riscv_th_vfmax_vv_f32m8_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmax_vf_f32m8_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], float noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmax.mask.nxv16f32.f32.i64( poison, [[OP1]], float [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m8_t test_vfmax_vf_f32m8_m(vbool4_t mask, vfloat32m8_t op1, float op2, size_t vl) { + return __riscv_th_vfmax_vf_f32m8_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmax_vv_f64m1_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmax.mask.nxv1f64.nxv1f64.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m1_t test_vfmax_vv_f64m1_m(vbool64_t mask, vfloat64m1_t op1, vfloat64m1_t op2, size_t vl) { + return __riscv_th_vfmax_vv_f64m1_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmax_vf_f64m1_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], double noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmax.mask.nxv1f64.f64.i64( poison, [[OP1]], double [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m1_t test_vfmax_vf_f64m1_m(vbool64_t mask, vfloat64m1_t op1, double op2, size_t vl) { + return __riscv_th_vfmax_vf_f64m1_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmax_vv_f64m2_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmax.mask.nxv2f64.nxv2f64.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m2_t test_vfmax_vv_f64m2_m(vbool32_t mask, vfloat64m2_t op1, vfloat64m2_t op2, size_t vl) { + return __riscv_th_vfmax_vv_f64m2_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmax_vf_f64m2_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], double noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmax.mask.nxv2f64.f64.i64( poison, [[OP1]], double [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m2_t test_vfmax_vf_f64m2_m(vbool32_t mask, vfloat64m2_t op1, double op2, size_t vl) { + return __riscv_th_vfmax_vf_f64m2_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmax_vv_f64m4_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmax.mask.nxv4f64.nxv4f64.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m4_t test_vfmax_vv_f64m4_m(vbool16_t mask, vfloat64m4_t op1, vfloat64m4_t op2, size_t vl) { + return __riscv_th_vfmax_vv_f64m4_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmax_vf_f64m4_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], double noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmax.mask.nxv4f64.f64.i64( poison, [[OP1]], double [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m4_t test_vfmax_vf_f64m4_m(vbool16_t mask, vfloat64m4_t op1, double op2, size_t vl) { + return __riscv_th_vfmax_vf_f64m4_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmax_vv_f64m8_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmax.mask.nxv8f64.nxv8f64.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m8_t test_vfmax_vv_f64m8_m(vbool8_t mask, vfloat64m8_t op1, vfloat64m8_t op2, size_t vl) { + return __riscv_th_vfmax_vv_f64m8_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmax_vf_f64m8_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], double noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmax.mask.nxv8f64.f64.i64( poison, [[OP1]], double [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m8_t test_vfmax_vf_f64m8_m(vbool8_t mask, vfloat64m8_t op1, double op2, size_t vl) { + return __riscv_th_vfmax_vf_f64m8_m(mask, op1, op2, vl); +} + diff --git a/clang/test/CodeGen/RISCV/rvv0p71-intrinsics-handcrafted/vector-floating/thead/vfmin.c b/clang/test/CodeGen/RISCV/rvv0p71-intrinsics-handcrafted/vector-floating/thead/vfmin.c new file mode 100644 index 00000000000000..ee832f47b8e0aa --- /dev/null +++ b/clang/test/CodeGen/RISCV/rvv0p71-intrinsics-handcrafted/vector-floating/thead/vfmin.c @@ -0,0 +1,489 @@ +// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 2 +// REQUIRES: riscv-registered-target +// RUN: %clang_cc1 -triple riscv64 -target-feature +xtheadvector \ +// RUN: -target-feature +d -disable-O0-optnone \ +// RUN: -emit-llvm %s -o - | opt -S -passes=mem2reg | \ +// RUN: FileCheck --check-prefix=CHECK-RV64 %s + +#include + +// CHECK-RV64-LABEL: define dso_local @test_vfmin_vv_f16m1 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0:[0-9]+]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmin.nxv4f16.nxv4f16.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m1_t test_vfmin_vv_f16m1(vfloat16m1_t op1, vfloat16m1_t op2, size_t vl) { + return __riscv_th_vfmin_vv_f16m1(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmin_vf_f16m1 +// CHECK-RV64-SAME: ( [[OP1:%.*]], half noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmin.nxv4f16.f16.i64( poison, [[OP1]], half [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m1_t test_vfmin_vf_f16m1(vfloat16m1_t op1, _Float16 op2, size_t vl) { + return __riscv_th_vfmin_vf_f16m1(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmin_vv_f16m2 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmin.nxv8f16.nxv8f16.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m2_t test_vfmin_vv_f16m2(vfloat16m2_t op1, vfloat16m2_t op2, size_t vl) { + return __riscv_th_vfmin_vv_f16m2(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmin_vf_f16m2 +// CHECK-RV64-SAME: ( [[OP1:%.*]], half noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmin.nxv8f16.f16.i64( poison, [[OP1]], half [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m2_t test_vfmin_vf_f16m2(vfloat16m2_t op1, _Float16 op2, size_t vl) { + return __riscv_th_vfmin_vf_f16m2(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmin_vv_f16m4 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmin.nxv16f16.nxv16f16.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m4_t test_vfmin_vv_f16m4(vfloat16m4_t op1, vfloat16m4_t op2, size_t vl) { + return __riscv_th_vfmin_vv_f16m4(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmin_vf_f16m4 +// CHECK-RV64-SAME: ( [[OP1:%.*]], half noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmin.nxv16f16.f16.i64( poison, [[OP1]], half [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m4_t test_vfmin_vf_f16m4(vfloat16m4_t op1, _Float16 op2, size_t vl) { + return __riscv_th_vfmin_vf_f16m4(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmin_vv_f16m8 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmin.nxv32f16.nxv32f16.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m8_t test_vfmin_vv_f16m8(vfloat16m8_t op1, vfloat16m8_t op2, size_t vl) { + return __riscv_th_vfmin_vv_f16m8(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmin_vf_f16m8 +// CHECK-RV64-SAME: ( [[OP1:%.*]], half noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmin.nxv32f16.f16.i64( poison, [[OP1]], half [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m8_t test_vfmin_vf_f16m8(vfloat16m8_t op1, _Float16 op2, size_t vl) { + return __riscv_th_vfmin_vf_f16m8(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmin_vv_f32m1 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmin.nxv2f32.nxv2f32.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m1_t test_vfmin_vv_f32m1(vfloat32m1_t op1, vfloat32m1_t op2, size_t vl) { + return __riscv_th_vfmin_vv_f32m1(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmin_vf_f32m1 +// CHECK-RV64-SAME: ( [[OP1:%.*]], float noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmin.nxv2f32.f32.i64( poison, [[OP1]], float [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m1_t test_vfmin_vf_f32m1(vfloat32m1_t op1, float op2, size_t vl) { + return __riscv_th_vfmin_vf_f32m1(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmin_vv_f32m2 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmin.nxv4f32.nxv4f32.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m2_t test_vfmin_vv_f32m2(vfloat32m2_t op1, vfloat32m2_t op2, size_t vl) { + return __riscv_th_vfmin_vv_f32m2(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmin_vf_f32m2 +// CHECK-RV64-SAME: ( [[OP1:%.*]], float noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmin.nxv4f32.f32.i64( poison, [[OP1]], float [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m2_t test_vfmin_vf_f32m2(vfloat32m2_t op1, float op2, size_t vl) { + return __riscv_th_vfmin_vf_f32m2(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmin_vv_f32m4 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmin.nxv8f32.nxv8f32.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m4_t test_vfmin_vv_f32m4(vfloat32m4_t op1, vfloat32m4_t op2, size_t vl) { + return __riscv_th_vfmin_vv_f32m4(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmin_vf_f32m4 +// CHECK-RV64-SAME: ( [[OP1:%.*]], float noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmin.nxv8f32.f32.i64( poison, [[OP1]], float [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m4_t test_vfmin_vf_f32m4(vfloat32m4_t op1, float op2, size_t vl) { + return __riscv_th_vfmin_vf_f32m4(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmin_vv_f32m8 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmin.nxv16f32.nxv16f32.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m8_t test_vfmin_vv_f32m8(vfloat32m8_t op1, vfloat32m8_t op2, size_t vl) { + return __riscv_th_vfmin_vv_f32m8(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmin_vf_f32m8 +// CHECK-RV64-SAME: ( [[OP1:%.*]], float noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmin.nxv16f32.f32.i64( poison, [[OP1]], float [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m8_t test_vfmin_vf_f32m8(vfloat32m8_t op1, float op2, size_t vl) { + return __riscv_th_vfmin_vf_f32m8(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmin_vv_f64m1 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmin.nxv1f64.nxv1f64.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m1_t test_vfmin_vv_f64m1(vfloat64m1_t op1, vfloat64m1_t op2, size_t vl) { + return __riscv_th_vfmin_vv_f64m1(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmin_vf_f64m1 +// CHECK-RV64-SAME: ( [[OP1:%.*]], double noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmin.nxv1f64.f64.i64( poison, [[OP1]], double [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m1_t test_vfmin_vf_f64m1(vfloat64m1_t op1, double op2, size_t vl) { + return __riscv_th_vfmin_vf_f64m1(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmin_vv_f64m2 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmin.nxv2f64.nxv2f64.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m2_t test_vfmin_vv_f64m2(vfloat64m2_t op1, vfloat64m2_t op2, size_t vl) { + return __riscv_th_vfmin_vv_f64m2(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmin_vf_f64m2 +// CHECK-RV64-SAME: ( [[OP1:%.*]], double noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmin.nxv2f64.f64.i64( poison, [[OP1]], double [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m2_t test_vfmin_vf_f64m2(vfloat64m2_t op1, double op2, size_t vl) { + return __riscv_th_vfmin_vf_f64m2(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmin_vv_f64m4 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmin.nxv4f64.nxv4f64.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m4_t test_vfmin_vv_f64m4(vfloat64m4_t op1, vfloat64m4_t op2, size_t vl) { + return __riscv_th_vfmin_vv_f64m4(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmin_vf_f64m4 +// CHECK-RV64-SAME: ( [[OP1:%.*]], double noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmin.nxv4f64.f64.i64( poison, [[OP1]], double [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m4_t test_vfmin_vf_f64m4(vfloat64m4_t op1, double op2, size_t vl) { + return __riscv_th_vfmin_vf_f64m4(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmin_vv_f64m8 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmin.nxv8f64.nxv8f64.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m8_t test_vfmin_vv_f64m8(vfloat64m8_t op1, vfloat64m8_t op2, size_t vl) { + return __riscv_th_vfmin_vv_f64m8(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmin_vf_f64m8 +// CHECK-RV64-SAME: ( [[OP1:%.*]], double noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmin.nxv8f64.f64.i64( poison, [[OP1]], double [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m8_t test_vfmin_vf_f64m8(vfloat64m8_t op1, double op2, size_t vl) { + return __riscv_th_vfmin_vf_f64m8(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmin_vv_f16m1_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmin.mask.nxv4f16.nxv4f16.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m1_t test_vfmin_vv_f16m1_m(vbool16_t mask, vfloat16m1_t op1, vfloat16m1_t op2, size_t vl) { + return __riscv_th_vfmin_vv_f16m1_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmin_vf_f16m1_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], half noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmin.mask.nxv4f16.f16.i64( poison, [[OP1]], half [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m1_t test_vfmin_vf_f16m1_m(vbool16_t mask, vfloat16m1_t op1, _Float16 op2, size_t vl) { + return __riscv_th_vfmin_vf_f16m1_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmin_vv_f16m2_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmin.mask.nxv8f16.nxv8f16.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m2_t test_vfmin_vv_f16m2_m(vbool8_t mask, vfloat16m2_t op1, vfloat16m2_t op2, size_t vl) { + return __riscv_th_vfmin_vv_f16m2_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmin_vf_f16m2_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], half noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmin.mask.nxv8f16.f16.i64( poison, [[OP1]], half [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m2_t test_vfmin_vf_f16m2_m(vbool8_t mask, vfloat16m2_t op1, _Float16 op2, size_t vl) { + return __riscv_th_vfmin_vf_f16m2_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmin_vv_f16m4_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmin.mask.nxv16f16.nxv16f16.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m4_t test_vfmin_vv_f16m4_m(vbool4_t mask, vfloat16m4_t op1, vfloat16m4_t op2, size_t vl) { + return __riscv_th_vfmin_vv_f16m4_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmin_vf_f16m4_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], half noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmin.mask.nxv16f16.f16.i64( poison, [[OP1]], half [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m4_t test_vfmin_vf_f16m4_m(vbool4_t mask, vfloat16m4_t op1, _Float16 op2, size_t vl) { + return __riscv_th_vfmin_vf_f16m4_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmin_vv_f16m8_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmin.mask.nxv32f16.nxv32f16.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m8_t test_vfmin_vv_f16m8_m(vbool2_t mask, vfloat16m8_t op1, vfloat16m8_t op2, size_t vl) { + return __riscv_th_vfmin_vv_f16m8_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmin_vf_f16m8_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], half noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmin.mask.nxv32f16.f16.i64( poison, [[OP1]], half [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m8_t test_vfmin_vf_f16m8_m(vbool2_t mask, vfloat16m8_t op1, _Float16 op2, size_t vl) { + return __riscv_th_vfmin_vf_f16m8_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmin_vv_f32m1_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmin.mask.nxv2f32.nxv2f32.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m1_t test_vfmin_vv_f32m1_m(vbool32_t mask, vfloat32m1_t op1, vfloat32m1_t op2, size_t vl) { + return __riscv_th_vfmin_vv_f32m1_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmin_vf_f32m1_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], float noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmin.mask.nxv2f32.f32.i64( poison, [[OP1]], float [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m1_t test_vfmin_vf_f32m1_m(vbool32_t mask, vfloat32m1_t op1, float op2, size_t vl) { + return __riscv_th_vfmin_vf_f32m1_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmin_vv_f32m2_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmin.mask.nxv4f32.nxv4f32.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m2_t test_vfmin_vv_f32m2_m(vbool16_t mask, vfloat32m2_t op1, vfloat32m2_t op2, size_t vl) { + return __riscv_th_vfmin_vv_f32m2_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmin_vf_f32m2_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], float noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmin.mask.nxv4f32.f32.i64( poison, [[OP1]], float [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m2_t test_vfmin_vf_f32m2_m(vbool16_t mask, vfloat32m2_t op1, float op2, size_t vl) { + return __riscv_th_vfmin_vf_f32m2_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmin_vv_f32m4_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmin.mask.nxv8f32.nxv8f32.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m4_t test_vfmin_vv_f32m4_m(vbool8_t mask, vfloat32m4_t op1, vfloat32m4_t op2, size_t vl) { + return __riscv_th_vfmin_vv_f32m4_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmin_vf_f32m4_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], float noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmin.mask.nxv8f32.f32.i64( poison, [[OP1]], float [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m4_t test_vfmin_vf_f32m4_m(vbool8_t mask, vfloat32m4_t op1, float op2, size_t vl) { + return __riscv_th_vfmin_vf_f32m4_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmin_vv_f32m8_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmin.mask.nxv16f32.nxv16f32.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m8_t test_vfmin_vv_f32m8_m(vbool4_t mask, vfloat32m8_t op1, vfloat32m8_t op2, size_t vl) { + return __riscv_th_vfmin_vv_f32m8_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmin_vf_f32m8_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], float noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmin.mask.nxv16f32.f32.i64( poison, [[OP1]], float [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m8_t test_vfmin_vf_f32m8_m(vbool4_t mask, vfloat32m8_t op1, float op2, size_t vl) { + return __riscv_th_vfmin_vf_f32m8_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmin_vv_f64m1_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmin.mask.nxv1f64.nxv1f64.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m1_t test_vfmin_vv_f64m1_m(vbool64_t mask, vfloat64m1_t op1, vfloat64m1_t op2, size_t vl) { + return __riscv_th_vfmin_vv_f64m1_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmin_vf_f64m1_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], double noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmin.mask.nxv1f64.f64.i64( poison, [[OP1]], double [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m1_t test_vfmin_vf_f64m1_m(vbool64_t mask, vfloat64m1_t op1, double op2, size_t vl) { + return __riscv_th_vfmin_vf_f64m1_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmin_vv_f64m2_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmin.mask.nxv2f64.nxv2f64.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m2_t test_vfmin_vv_f64m2_m(vbool32_t mask, vfloat64m2_t op1, vfloat64m2_t op2, size_t vl) { + return __riscv_th_vfmin_vv_f64m2_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmin_vf_f64m2_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], double noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmin.mask.nxv2f64.f64.i64( poison, [[OP1]], double [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m2_t test_vfmin_vf_f64m2_m(vbool32_t mask, vfloat64m2_t op1, double op2, size_t vl) { + return __riscv_th_vfmin_vf_f64m2_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmin_vv_f64m4_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmin.mask.nxv4f64.nxv4f64.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m4_t test_vfmin_vv_f64m4_m(vbool16_t mask, vfloat64m4_t op1, vfloat64m4_t op2, size_t vl) { + return __riscv_th_vfmin_vv_f64m4_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmin_vf_f64m4_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], double noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmin.mask.nxv4f64.f64.i64( poison, [[OP1]], double [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m4_t test_vfmin_vf_f64m4_m(vbool16_t mask, vfloat64m4_t op1, double op2, size_t vl) { + return __riscv_th_vfmin_vf_f64m4_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmin_vv_f64m8_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmin.mask.nxv8f64.nxv8f64.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m8_t test_vfmin_vv_f64m8_m(vbool8_t mask, vfloat64m8_t op1, vfloat64m8_t op2, size_t vl) { + return __riscv_th_vfmin_vv_f64m8_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmin_vf_f64m8_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], double noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmin.mask.nxv8f64.f64.i64( poison, [[OP1]], double [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m8_t test_vfmin_vf_f64m8_m(vbool8_t mask, vfloat64m8_t op1, double op2, size_t vl) { + return __riscv_th_vfmin_vf_f64m8_m(mask, op1, op2, vl); +} + diff --git a/clang/test/CodeGen/RISCV/rvv0p71-intrinsics-handcrafted/vector-floating/thead/vfneg.c b/clang/test/CodeGen/RISCV/rvv0p71-intrinsics-handcrafted/vector-floating/thead/vfneg.c new file mode 100644 index 00000000000000..4d9e95e62406fb --- /dev/null +++ b/clang/test/CodeGen/RISCV/rvv0p71-intrinsics-handcrafted/vector-floating/thead/vfneg.c @@ -0,0 +1,249 @@ +// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 2 +// REQUIRES: riscv-registered-target +// RUN: %clang_cc1 -triple riscv64 -target-feature +xtheadvector \ +// RUN: -target-feature +d -disable-O0-optnone \ +// RUN: -emit-llvm %s -o - | opt -S -passes=mem2reg | \ +// RUN: FileCheck --check-prefix=CHECK-RV64 %s + +#include + +// CHECK-RV64-LABEL: define dso_local @test_vfneg_v_f16m1 +// CHECK-RV64-SAME: ( [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0:[0-9]+]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.nxv4f16.nxv4f16.i64( poison, [[OP1]], [[OP1]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m1_t test_vfneg_v_f16m1(vfloat16m1_t op1, size_t vl) { + return __riscv_th_vfneg_v_f16m1(op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfneg_v_f16m2 +// CHECK-RV64-SAME: ( [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.nxv8f16.nxv8f16.i64( poison, [[OP1]], [[OP1]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m2_t test_vfneg_v_f16m2(vfloat16m2_t op1, size_t vl) { + return __riscv_th_vfneg_v_f16m2(op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfneg_v_f16m4 +// CHECK-RV64-SAME: ( [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.nxv16f16.nxv16f16.i64( poison, [[OP1]], [[OP1]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m4_t test_vfneg_v_f16m4(vfloat16m4_t op1, size_t vl) { + return __riscv_th_vfneg_v_f16m4(op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfneg_v_f16m8 +// CHECK-RV64-SAME: ( [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.nxv32f16.nxv32f16.i64( poison, [[OP1]], [[OP1]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m8_t test_vfneg_v_f16m8(vfloat16m8_t op1, size_t vl) { + return __riscv_th_vfneg_v_f16m8(op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfneg_v_f32m1 +// CHECK-RV64-SAME: ( [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.nxv2f32.nxv2f32.i64( poison, [[OP1]], [[OP1]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m1_t test_vfneg_v_f32m1(vfloat32m1_t op1, size_t vl) { + return __riscv_th_vfneg_v_f32m1(op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfneg_v_f32m2 +// CHECK-RV64-SAME: ( [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.nxv4f32.nxv4f32.i64( poison, [[OP1]], [[OP1]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m2_t test_vfneg_v_f32m2(vfloat32m2_t op1, size_t vl) { + return __riscv_th_vfneg_v_f32m2(op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfneg_v_f32m4 +// CHECK-RV64-SAME: ( [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.nxv8f32.nxv8f32.i64( poison, [[OP1]], [[OP1]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m4_t test_vfneg_v_f32m4(vfloat32m4_t op1, size_t vl) { + return __riscv_th_vfneg_v_f32m4(op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfneg_v_f32m8 +// CHECK-RV64-SAME: ( [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.nxv16f32.nxv16f32.i64( poison, [[OP1]], [[OP1]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m8_t test_vfneg_v_f32m8(vfloat32m8_t op1, size_t vl) { + return __riscv_th_vfneg_v_f32m8(op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfneg_v_f64m1 +// CHECK-RV64-SAME: ( [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.nxv1f64.nxv1f64.i64( poison, [[OP1]], [[OP1]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m1_t test_vfneg_v_f64m1(vfloat64m1_t op1, size_t vl) { + return __riscv_th_vfneg_v_f64m1(op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfneg_v_f64m2 +// CHECK-RV64-SAME: ( [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.nxv2f64.nxv2f64.i64( poison, [[OP1]], [[OP1]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m2_t test_vfneg_v_f64m2(vfloat64m2_t op1, size_t vl) { + return __riscv_th_vfneg_v_f64m2(op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfneg_v_f64m4 +// CHECK-RV64-SAME: ( [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.nxv4f64.nxv4f64.i64( poison, [[OP1]], [[OP1]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m4_t test_vfneg_v_f64m4(vfloat64m4_t op1, size_t vl) { + return __riscv_th_vfneg_v_f64m4(op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfneg_v_f64m8 +// CHECK-RV64-SAME: ( [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.nxv8f64.nxv8f64.i64( poison, [[OP1]], [[OP1]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m8_t test_vfneg_v_f64m8(vfloat64m8_t op1, size_t vl) { + return __riscv_th_vfneg_v_f64m8(op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfneg_v_f16m1_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.mask.nxv4f16.nxv4f16.i64( poison, [[OP1]], [[OP1]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m1_t test_vfneg_v_f16m1_m(vbool16_t mask, vfloat16m1_t op1, size_t vl) { + return __riscv_th_vfneg_v_f16m1_m(mask, op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfneg_v_f16m2_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.mask.nxv8f16.nxv8f16.i64( poison, [[OP1]], [[OP1]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m2_t test_vfneg_v_f16m2_m(vbool8_t mask, vfloat16m2_t op1, size_t vl) { + return __riscv_th_vfneg_v_f16m2_m(mask, op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfneg_v_f16m4_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.mask.nxv16f16.nxv16f16.i64( poison, [[OP1]], [[OP1]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m4_t test_vfneg_v_f16m4_m(vbool4_t mask, vfloat16m4_t op1, size_t vl) { + return __riscv_th_vfneg_v_f16m4_m(mask, op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfneg_v_f16m8_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.mask.nxv32f16.nxv32f16.i64( poison, [[OP1]], [[OP1]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m8_t test_vfneg_v_f16m8_m(vbool2_t mask, vfloat16m8_t op1, size_t vl) { + return __riscv_th_vfneg_v_f16m8_m(mask, op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfneg_v_f32m1_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.mask.nxv2f32.nxv2f32.i64( poison, [[OP1]], [[OP1]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m1_t test_vfneg_v_f32m1_m(vbool32_t mask, vfloat32m1_t op1, size_t vl) { + return __riscv_th_vfneg_v_f32m1_m(mask, op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfneg_v_f32m2_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.mask.nxv4f32.nxv4f32.i64( poison, [[OP1]], [[OP1]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m2_t test_vfneg_v_f32m2_m(vbool16_t mask, vfloat32m2_t op1, size_t vl) { + return __riscv_th_vfneg_v_f32m2_m(mask, op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfneg_v_f32m4_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.mask.nxv8f32.nxv8f32.i64( poison, [[OP1]], [[OP1]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m4_t test_vfneg_v_f32m4_m(vbool8_t mask, vfloat32m4_t op1, size_t vl) { + return __riscv_th_vfneg_v_f32m4_m(mask, op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfneg_v_f32m8_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.mask.nxv16f32.nxv16f32.i64( poison, [[OP1]], [[OP1]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m8_t test_vfneg_v_f32m8_m(vbool4_t mask, vfloat32m8_t op1, size_t vl) { + return __riscv_th_vfneg_v_f32m8_m(mask, op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfneg_v_f64m1_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.mask.nxv1f64.nxv1f64.i64( poison, [[OP1]], [[OP1]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m1_t test_vfneg_v_f64m1_m(vbool64_t mask, vfloat64m1_t op1, size_t vl) { + return __riscv_th_vfneg_v_f64m1_m(mask, op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfneg_v_f64m2_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.mask.nxv2f64.nxv2f64.i64( poison, [[OP1]], [[OP1]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m2_t test_vfneg_v_f64m2_m(vbool32_t mask, vfloat64m2_t op1, size_t vl) { + return __riscv_th_vfneg_v_f64m2_m(mask, op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfneg_v_f64m4_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.mask.nxv4f64.nxv4f64.i64( poison, [[OP1]], [[OP1]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m4_t test_vfneg_v_f64m4_m(vbool16_t mask, vfloat64m4_t op1, size_t vl) { + return __riscv_th_vfneg_v_f64m4_m(mask, op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfneg_v_f64m8_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.mask.nxv8f64.nxv8f64.i64( poison, [[OP1]], [[OP1]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m8_t test_vfneg_v_f64m8_m(vbool8_t mask, vfloat64m8_t op1, size_t vl) { + return __riscv_th_vfneg_v_f64m8_m(mask, op1, vl); +} + diff --git a/clang/test/CodeGen/RISCV/rvv0p71-intrinsics-handcrafted/vector-floating/thead/vfsgnj.c b/clang/test/CodeGen/RISCV/rvv0p71-intrinsics-handcrafted/vector-floating/thead/vfsgnj.c new file mode 100644 index 00000000000000..0a36b283b24632 --- /dev/null +++ b/clang/test/CodeGen/RISCV/rvv0p71-intrinsics-handcrafted/vector-floating/thead/vfsgnj.c @@ -0,0 +1,489 @@ +// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 2 +// REQUIRES: riscv-registered-target +// RUN: %clang_cc1 -triple riscv64 -target-feature +xtheadvector \ +// RUN: -target-feature +d -disable-O0-optnone \ +// RUN: -emit-llvm %s -o - | opt -S -passes=mem2reg | \ +// RUN: FileCheck --check-prefix=CHECK-RV64 %s + +#include + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnj_vv_f16m1 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0:[0-9]+]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnj.nxv4f16.nxv4f16.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m1_t test_vfsgnj_vv_f16m1(vfloat16m1_t op1, vfloat16m1_t op2, size_t vl) { + return __riscv_th_vfsgnj_vv_f16m1(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnj_vf_f16m1 +// CHECK-RV64-SAME: ( [[OP1:%.*]], half noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnj.nxv4f16.f16.i64( poison, [[OP1]], half [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m1_t test_vfsgnj_vf_f16m1(vfloat16m1_t op1, _Float16 op2, size_t vl) { + return __riscv_th_vfsgnj_vf_f16m1(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnj_vv_f16m2 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnj.nxv8f16.nxv8f16.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m2_t test_vfsgnj_vv_f16m2(vfloat16m2_t op1, vfloat16m2_t op2, size_t vl) { + return __riscv_th_vfsgnj_vv_f16m2(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnj_vf_f16m2 +// CHECK-RV64-SAME: ( [[OP1:%.*]], half noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnj.nxv8f16.f16.i64( poison, [[OP1]], half [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m2_t test_vfsgnj_vf_f16m2(vfloat16m2_t op1, _Float16 op2, size_t vl) { + return __riscv_th_vfsgnj_vf_f16m2(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnj_vv_f16m4 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnj.nxv16f16.nxv16f16.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m4_t test_vfsgnj_vv_f16m4(vfloat16m4_t op1, vfloat16m4_t op2, size_t vl) { + return __riscv_th_vfsgnj_vv_f16m4(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnj_vf_f16m4 +// CHECK-RV64-SAME: ( [[OP1:%.*]], half noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnj.nxv16f16.f16.i64( poison, [[OP1]], half [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m4_t test_vfsgnj_vf_f16m4(vfloat16m4_t op1, _Float16 op2, size_t vl) { + return __riscv_th_vfsgnj_vf_f16m4(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnj_vv_f16m8 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnj.nxv32f16.nxv32f16.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m8_t test_vfsgnj_vv_f16m8(vfloat16m8_t op1, vfloat16m8_t op2, size_t vl) { + return __riscv_th_vfsgnj_vv_f16m8(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnj_vf_f16m8 +// CHECK-RV64-SAME: ( [[OP1:%.*]], half noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnj.nxv32f16.f16.i64( poison, [[OP1]], half [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m8_t test_vfsgnj_vf_f16m8(vfloat16m8_t op1, _Float16 op2, size_t vl) { + return __riscv_th_vfsgnj_vf_f16m8(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnj_vv_f32m1 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnj.nxv2f32.nxv2f32.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m1_t test_vfsgnj_vv_f32m1(vfloat32m1_t op1, vfloat32m1_t op2, size_t vl) { + return __riscv_th_vfsgnj_vv_f32m1(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnj_vf_f32m1 +// CHECK-RV64-SAME: ( [[OP1:%.*]], float noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnj.nxv2f32.f32.i64( poison, [[OP1]], float [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m1_t test_vfsgnj_vf_f32m1(vfloat32m1_t op1, float op2, size_t vl) { + return __riscv_th_vfsgnj_vf_f32m1(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnj_vv_f32m2 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnj.nxv4f32.nxv4f32.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m2_t test_vfsgnj_vv_f32m2(vfloat32m2_t op1, vfloat32m2_t op2, size_t vl) { + return __riscv_th_vfsgnj_vv_f32m2(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnj_vf_f32m2 +// CHECK-RV64-SAME: ( [[OP1:%.*]], float noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnj.nxv4f32.f32.i64( poison, [[OP1]], float [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m2_t test_vfsgnj_vf_f32m2(vfloat32m2_t op1, float op2, size_t vl) { + return __riscv_th_vfsgnj_vf_f32m2(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnj_vv_f32m4 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnj.nxv8f32.nxv8f32.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m4_t test_vfsgnj_vv_f32m4(vfloat32m4_t op1, vfloat32m4_t op2, size_t vl) { + return __riscv_th_vfsgnj_vv_f32m4(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnj_vf_f32m4 +// CHECK-RV64-SAME: ( [[OP1:%.*]], float noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnj.nxv8f32.f32.i64( poison, [[OP1]], float [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m4_t test_vfsgnj_vf_f32m4(vfloat32m4_t op1, float op2, size_t vl) { + return __riscv_th_vfsgnj_vf_f32m4(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnj_vv_f32m8 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnj.nxv16f32.nxv16f32.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m8_t test_vfsgnj_vv_f32m8(vfloat32m8_t op1, vfloat32m8_t op2, size_t vl) { + return __riscv_th_vfsgnj_vv_f32m8(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnj_vf_f32m8 +// CHECK-RV64-SAME: ( [[OP1:%.*]], float noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnj.nxv16f32.f32.i64( poison, [[OP1]], float [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m8_t test_vfsgnj_vf_f32m8(vfloat32m8_t op1, float op2, size_t vl) { + return __riscv_th_vfsgnj_vf_f32m8(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnj_vv_f64m1 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnj.nxv1f64.nxv1f64.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m1_t test_vfsgnj_vv_f64m1(vfloat64m1_t op1, vfloat64m1_t op2, size_t vl) { + return __riscv_th_vfsgnj_vv_f64m1(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnj_vf_f64m1 +// CHECK-RV64-SAME: ( [[OP1:%.*]], double noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnj.nxv1f64.f64.i64( poison, [[OP1]], double [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m1_t test_vfsgnj_vf_f64m1(vfloat64m1_t op1, double op2, size_t vl) { + return __riscv_th_vfsgnj_vf_f64m1(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnj_vv_f64m2 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnj.nxv2f64.nxv2f64.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m2_t test_vfsgnj_vv_f64m2(vfloat64m2_t op1, vfloat64m2_t op2, size_t vl) { + return __riscv_th_vfsgnj_vv_f64m2(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnj_vf_f64m2 +// CHECK-RV64-SAME: ( [[OP1:%.*]], double noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnj.nxv2f64.f64.i64( poison, [[OP1]], double [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m2_t test_vfsgnj_vf_f64m2(vfloat64m2_t op1, double op2, size_t vl) { + return __riscv_th_vfsgnj_vf_f64m2(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnj_vv_f64m4 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnj.nxv4f64.nxv4f64.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m4_t test_vfsgnj_vv_f64m4(vfloat64m4_t op1, vfloat64m4_t op2, size_t vl) { + return __riscv_th_vfsgnj_vv_f64m4(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnj_vf_f64m4 +// CHECK-RV64-SAME: ( [[OP1:%.*]], double noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnj.nxv4f64.f64.i64( poison, [[OP1]], double [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m4_t test_vfsgnj_vf_f64m4(vfloat64m4_t op1, double op2, size_t vl) { + return __riscv_th_vfsgnj_vf_f64m4(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnj_vv_f64m8 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnj.nxv8f64.nxv8f64.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m8_t test_vfsgnj_vv_f64m8(vfloat64m8_t op1, vfloat64m8_t op2, size_t vl) { + return __riscv_th_vfsgnj_vv_f64m8(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnj_vf_f64m8 +// CHECK-RV64-SAME: ( [[OP1:%.*]], double noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnj.nxv8f64.f64.i64( poison, [[OP1]], double [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m8_t test_vfsgnj_vf_f64m8(vfloat64m8_t op1, double op2, size_t vl) { + return __riscv_th_vfsgnj_vf_f64m8(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnj_vv_f16m1_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnj.mask.nxv4f16.nxv4f16.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m1_t test_vfsgnj_vv_f16m1_m(vbool16_t mask, vfloat16m1_t op1, vfloat16m1_t op2, size_t vl) { + return __riscv_th_vfsgnj_vv_f16m1_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnj_vf_f16m1_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], half noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnj.mask.nxv4f16.f16.i64( poison, [[OP1]], half [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m1_t test_vfsgnj_vf_f16m1_m(vbool16_t mask, vfloat16m1_t op1, _Float16 op2, size_t vl) { + return __riscv_th_vfsgnj_vf_f16m1_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnj_vv_f16m2_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnj.mask.nxv8f16.nxv8f16.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m2_t test_vfsgnj_vv_f16m2_m(vbool8_t mask, vfloat16m2_t op1, vfloat16m2_t op2, size_t vl) { + return __riscv_th_vfsgnj_vv_f16m2_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnj_vf_f16m2_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], half noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnj.mask.nxv8f16.f16.i64( poison, [[OP1]], half [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m2_t test_vfsgnj_vf_f16m2_m(vbool8_t mask, vfloat16m2_t op1, _Float16 op2, size_t vl) { + return __riscv_th_vfsgnj_vf_f16m2_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnj_vv_f16m4_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnj.mask.nxv16f16.nxv16f16.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m4_t test_vfsgnj_vv_f16m4_m(vbool4_t mask, vfloat16m4_t op1, vfloat16m4_t op2, size_t vl) { + return __riscv_th_vfsgnj_vv_f16m4_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnj_vf_f16m4_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], half noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnj.mask.nxv16f16.f16.i64( poison, [[OP1]], half [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m4_t test_vfsgnj_vf_f16m4_m(vbool4_t mask, vfloat16m4_t op1, _Float16 op2, size_t vl) { + return __riscv_th_vfsgnj_vf_f16m4_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnj_vv_f16m8_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnj.mask.nxv32f16.nxv32f16.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m8_t test_vfsgnj_vv_f16m8_m(vbool2_t mask, vfloat16m8_t op1, vfloat16m8_t op2, size_t vl) { + return __riscv_th_vfsgnj_vv_f16m8_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnj_vf_f16m8_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], half noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnj.mask.nxv32f16.f16.i64( poison, [[OP1]], half [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m8_t test_vfsgnj_vf_f16m8_m(vbool2_t mask, vfloat16m8_t op1, _Float16 op2, size_t vl) { + return __riscv_th_vfsgnj_vf_f16m8_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnj_vv_f32m1_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnj.mask.nxv2f32.nxv2f32.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m1_t test_vfsgnj_vv_f32m1_m(vbool32_t mask, vfloat32m1_t op1, vfloat32m1_t op2, size_t vl) { + return __riscv_th_vfsgnj_vv_f32m1_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnj_vf_f32m1_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], float noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnj.mask.nxv2f32.f32.i64( poison, [[OP1]], float [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m1_t test_vfsgnj_vf_f32m1_m(vbool32_t mask, vfloat32m1_t op1, float op2, size_t vl) { + return __riscv_th_vfsgnj_vf_f32m1_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnj_vv_f32m2_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnj.mask.nxv4f32.nxv4f32.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m2_t test_vfsgnj_vv_f32m2_m(vbool16_t mask, vfloat32m2_t op1, vfloat32m2_t op2, size_t vl) { + return __riscv_th_vfsgnj_vv_f32m2_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnj_vf_f32m2_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], float noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnj.mask.nxv4f32.f32.i64( poison, [[OP1]], float [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m2_t test_vfsgnj_vf_f32m2_m(vbool16_t mask, vfloat32m2_t op1, float op2, size_t vl) { + return __riscv_th_vfsgnj_vf_f32m2_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnj_vv_f32m4_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnj.mask.nxv8f32.nxv8f32.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m4_t test_vfsgnj_vv_f32m4_m(vbool8_t mask, vfloat32m4_t op1, vfloat32m4_t op2, size_t vl) { + return __riscv_th_vfsgnj_vv_f32m4_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnj_vf_f32m4_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], float noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnj.mask.nxv8f32.f32.i64( poison, [[OP1]], float [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m4_t test_vfsgnj_vf_f32m4_m(vbool8_t mask, vfloat32m4_t op1, float op2, size_t vl) { + return __riscv_th_vfsgnj_vf_f32m4_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnj_vv_f32m8_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnj.mask.nxv16f32.nxv16f32.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m8_t test_vfsgnj_vv_f32m8_m(vbool4_t mask, vfloat32m8_t op1, vfloat32m8_t op2, size_t vl) { + return __riscv_th_vfsgnj_vv_f32m8_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnj_vf_f32m8_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], float noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnj.mask.nxv16f32.f32.i64( poison, [[OP1]], float [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m8_t test_vfsgnj_vf_f32m8_m(vbool4_t mask, vfloat32m8_t op1, float op2, size_t vl) { + return __riscv_th_vfsgnj_vf_f32m8_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnj_vv_f64m1_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnj.mask.nxv1f64.nxv1f64.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m1_t test_vfsgnj_vv_f64m1_m(vbool64_t mask, vfloat64m1_t op1, vfloat64m1_t op2, size_t vl) { + return __riscv_th_vfsgnj_vv_f64m1_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnj_vf_f64m1_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], double noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnj.mask.nxv1f64.f64.i64( poison, [[OP1]], double [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m1_t test_vfsgnj_vf_f64m1_m(vbool64_t mask, vfloat64m1_t op1, double op2, size_t vl) { + return __riscv_th_vfsgnj_vf_f64m1_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnj_vv_f64m2_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnj.mask.nxv2f64.nxv2f64.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m2_t test_vfsgnj_vv_f64m2_m(vbool32_t mask, vfloat64m2_t op1, vfloat64m2_t op2, size_t vl) { + return __riscv_th_vfsgnj_vv_f64m2_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnj_vf_f64m2_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], double noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnj.mask.nxv2f64.f64.i64( poison, [[OP1]], double [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m2_t test_vfsgnj_vf_f64m2_m(vbool32_t mask, vfloat64m2_t op1, double op2, size_t vl) { + return __riscv_th_vfsgnj_vf_f64m2_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnj_vv_f64m4_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnj.mask.nxv4f64.nxv4f64.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m4_t test_vfsgnj_vv_f64m4_m(vbool16_t mask, vfloat64m4_t op1, vfloat64m4_t op2, size_t vl) { + return __riscv_th_vfsgnj_vv_f64m4_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnj_vf_f64m4_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], double noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnj.mask.nxv4f64.f64.i64( poison, [[OP1]], double [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m4_t test_vfsgnj_vf_f64m4_m(vbool16_t mask, vfloat64m4_t op1, double op2, size_t vl) { + return __riscv_th_vfsgnj_vf_f64m4_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnj_vv_f64m8_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnj.mask.nxv8f64.nxv8f64.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m8_t test_vfsgnj_vv_f64m8_m(vbool8_t mask, vfloat64m8_t op1, vfloat64m8_t op2, size_t vl) { + return __riscv_th_vfsgnj_vv_f64m8_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnj_vf_f64m8_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], double noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnj.mask.nxv8f64.f64.i64( poison, [[OP1]], double [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m8_t test_vfsgnj_vf_f64m8_m(vbool8_t mask, vfloat64m8_t op1, double op2, size_t vl) { + return __riscv_th_vfsgnj_vf_f64m8_m(mask, op1, op2, vl); +} + diff --git a/clang/test/CodeGen/RISCV/rvv0p71-intrinsics-handcrafted/vector-floating/thead/vfsgnjn.c b/clang/test/CodeGen/RISCV/rvv0p71-intrinsics-handcrafted/vector-floating/thead/vfsgnjn.c new file mode 100644 index 00000000000000..9530c0fbc41e89 --- /dev/null +++ b/clang/test/CodeGen/RISCV/rvv0p71-intrinsics-handcrafted/vector-floating/thead/vfsgnjn.c @@ -0,0 +1,489 @@ +// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 2 +// REQUIRES: riscv-registered-target +// RUN: %clang_cc1 -triple riscv64 -target-feature +xtheadvector \ +// RUN: -target-feature +d -disable-O0-optnone \ +// RUN: -emit-llvm %s -o - | opt -S -passes=mem2reg | \ +// RUN: FileCheck --check-prefix=CHECK-RV64 %s + +#include + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjn_vv_f16m1 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0:[0-9]+]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.nxv4f16.nxv4f16.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m1_t test_vfsgnjn_vv_f16m1(vfloat16m1_t op1, vfloat16m1_t op2, size_t vl) { + return __riscv_th_vfsgnjn_vv_f16m1(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjn_vf_f16m1 +// CHECK-RV64-SAME: ( [[OP1:%.*]], half noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.nxv4f16.f16.i64( poison, [[OP1]], half [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m1_t test_vfsgnjn_vf_f16m1(vfloat16m1_t op1, _Float16 op2, size_t vl) { + return __riscv_th_vfsgnjn_vf_f16m1(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjn_vv_f16m2 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.nxv8f16.nxv8f16.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m2_t test_vfsgnjn_vv_f16m2(vfloat16m2_t op1, vfloat16m2_t op2, size_t vl) { + return __riscv_th_vfsgnjn_vv_f16m2(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjn_vf_f16m2 +// CHECK-RV64-SAME: ( [[OP1:%.*]], half noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.nxv8f16.f16.i64( poison, [[OP1]], half [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m2_t test_vfsgnjn_vf_f16m2(vfloat16m2_t op1, _Float16 op2, size_t vl) { + return __riscv_th_vfsgnjn_vf_f16m2(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjn_vv_f16m4 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.nxv16f16.nxv16f16.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m4_t test_vfsgnjn_vv_f16m4(vfloat16m4_t op1, vfloat16m4_t op2, size_t vl) { + return __riscv_th_vfsgnjn_vv_f16m4(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjn_vf_f16m4 +// CHECK-RV64-SAME: ( [[OP1:%.*]], half noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.nxv16f16.f16.i64( poison, [[OP1]], half [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m4_t test_vfsgnjn_vf_f16m4(vfloat16m4_t op1, _Float16 op2, size_t vl) { + return __riscv_th_vfsgnjn_vf_f16m4(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjn_vv_f16m8 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.nxv32f16.nxv32f16.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m8_t test_vfsgnjn_vv_f16m8(vfloat16m8_t op1, vfloat16m8_t op2, size_t vl) { + return __riscv_th_vfsgnjn_vv_f16m8(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjn_vf_f16m8 +// CHECK-RV64-SAME: ( [[OP1:%.*]], half noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.nxv32f16.f16.i64( poison, [[OP1]], half [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m8_t test_vfsgnjn_vf_f16m8(vfloat16m8_t op1, _Float16 op2, size_t vl) { + return __riscv_th_vfsgnjn_vf_f16m8(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjn_vv_f32m1 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.nxv2f32.nxv2f32.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m1_t test_vfsgnjn_vv_f32m1(vfloat32m1_t op1, vfloat32m1_t op2, size_t vl) { + return __riscv_th_vfsgnjn_vv_f32m1(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjn_vf_f32m1 +// CHECK-RV64-SAME: ( [[OP1:%.*]], float noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.nxv2f32.f32.i64( poison, [[OP1]], float [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m1_t test_vfsgnjn_vf_f32m1(vfloat32m1_t op1, float op2, size_t vl) { + return __riscv_th_vfsgnjn_vf_f32m1(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjn_vv_f32m2 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.nxv4f32.nxv4f32.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m2_t test_vfsgnjn_vv_f32m2(vfloat32m2_t op1, vfloat32m2_t op2, size_t vl) { + return __riscv_th_vfsgnjn_vv_f32m2(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjn_vf_f32m2 +// CHECK-RV64-SAME: ( [[OP1:%.*]], float noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.nxv4f32.f32.i64( poison, [[OP1]], float [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m2_t test_vfsgnjn_vf_f32m2(vfloat32m2_t op1, float op2, size_t vl) { + return __riscv_th_vfsgnjn_vf_f32m2(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjn_vv_f32m4 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.nxv8f32.nxv8f32.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m4_t test_vfsgnjn_vv_f32m4(vfloat32m4_t op1, vfloat32m4_t op2, size_t vl) { + return __riscv_th_vfsgnjn_vv_f32m4(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjn_vf_f32m4 +// CHECK-RV64-SAME: ( [[OP1:%.*]], float noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.nxv8f32.f32.i64( poison, [[OP1]], float [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m4_t test_vfsgnjn_vf_f32m4(vfloat32m4_t op1, float op2, size_t vl) { + return __riscv_th_vfsgnjn_vf_f32m4(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjn_vv_f32m8 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.nxv16f32.nxv16f32.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m8_t test_vfsgnjn_vv_f32m8(vfloat32m8_t op1, vfloat32m8_t op2, size_t vl) { + return __riscv_th_vfsgnjn_vv_f32m8(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjn_vf_f32m8 +// CHECK-RV64-SAME: ( [[OP1:%.*]], float noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.nxv16f32.f32.i64( poison, [[OP1]], float [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m8_t test_vfsgnjn_vf_f32m8(vfloat32m8_t op1, float op2, size_t vl) { + return __riscv_th_vfsgnjn_vf_f32m8(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjn_vv_f64m1 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.nxv1f64.nxv1f64.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m1_t test_vfsgnjn_vv_f64m1(vfloat64m1_t op1, vfloat64m1_t op2, size_t vl) { + return __riscv_th_vfsgnjn_vv_f64m1(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjn_vf_f64m1 +// CHECK-RV64-SAME: ( [[OP1:%.*]], double noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.nxv1f64.f64.i64( poison, [[OP1]], double [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m1_t test_vfsgnjn_vf_f64m1(vfloat64m1_t op1, double op2, size_t vl) { + return __riscv_th_vfsgnjn_vf_f64m1(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjn_vv_f64m2 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.nxv2f64.nxv2f64.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m2_t test_vfsgnjn_vv_f64m2(vfloat64m2_t op1, vfloat64m2_t op2, size_t vl) { + return __riscv_th_vfsgnjn_vv_f64m2(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjn_vf_f64m2 +// CHECK-RV64-SAME: ( [[OP1:%.*]], double noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.nxv2f64.f64.i64( poison, [[OP1]], double [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m2_t test_vfsgnjn_vf_f64m2(vfloat64m2_t op1, double op2, size_t vl) { + return __riscv_th_vfsgnjn_vf_f64m2(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjn_vv_f64m4 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.nxv4f64.nxv4f64.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m4_t test_vfsgnjn_vv_f64m4(vfloat64m4_t op1, vfloat64m4_t op2, size_t vl) { + return __riscv_th_vfsgnjn_vv_f64m4(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjn_vf_f64m4 +// CHECK-RV64-SAME: ( [[OP1:%.*]], double noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.nxv4f64.f64.i64( poison, [[OP1]], double [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m4_t test_vfsgnjn_vf_f64m4(vfloat64m4_t op1, double op2, size_t vl) { + return __riscv_th_vfsgnjn_vf_f64m4(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjn_vv_f64m8 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.nxv8f64.nxv8f64.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m8_t test_vfsgnjn_vv_f64m8(vfloat64m8_t op1, vfloat64m8_t op2, size_t vl) { + return __riscv_th_vfsgnjn_vv_f64m8(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjn_vf_f64m8 +// CHECK-RV64-SAME: ( [[OP1:%.*]], double noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.nxv8f64.f64.i64( poison, [[OP1]], double [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m8_t test_vfsgnjn_vf_f64m8(vfloat64m8_t op1, double op2, size_t vl) { + return __riscv_th_vfsgnjn_vf_f64m8(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjn_vv_f16m1_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.mask.nxv4f16.nxv4f16.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m1_t test_vfsgnjn_vv_f16m1_m(vbool16_t mask, vfloat16m1_t op1, vfloat16m1_t op2, size_t vl) { + return __riscv_th_vfsgnjn_vv_f16m1_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjn_vf_f16m1_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], half noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.mask.nxv4f16.f16.i64( poison, [[OP1]], half [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m1_t test_vfsgnjn_vf_f16m1_m(vbool16_t mask, vfloat16m1_t op1, _Float16 op2, size_t vl) { + return __riscv_th_vfsgnjn_vf_f16m1_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjn_vv_f16m2_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.mask.nxv8f16.nxv8f16.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m2_t test_vfsgnjn_vv_f16m2_m(vbool8_t mask, vfloat16m2_t op1, vfloat16m2_t op2, size_t vl) { + return __riscv_th_vfsgnjn_vv_f16m2_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjn_vf_f16m2_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], half noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.mask.nxv8f16.f16.i64( poison, [[OP1]], half [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m2_t test_vfsgnjn_vf_f16m2_m(vbool8_t mask, vfloat16m2_t op1, _Float16 op2, size_t vl) { + return __riscv_th_vfsgnjn_vf_f16m2_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjn_vv_f16m4_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.mask.nxv16f16.nxv16f16.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m4_t test_vfsgnjn_vv_f16m4_m(vbool4_t mask, vfloat16m4_t op1, vfloat16m4_t op2, size_t vl) { + return __riscv_th_vfsgnjn_vv_f16m4_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjn_vf_f16m4_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], half noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.mask.nxv16f16.f16.i64( poison, [[OP1]], half [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m4_t test_vfsgnjn_vf_f16m4_m(vbool4_t mask, vfloat16m4_t op1, _Float16 op2, size_t vl) { + return __riscv_th_vfsgnjn_vf_f16m4_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjn_vv_f16m8_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.mask.nxv32f16.nxv32f16.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m8_t test_vfsgnjn_vv_f16m8_m(vbool2_t mask, vfloat16m8_t op1, vfloat16m8_t op2, size_t vl) { + return __riscv_th_vfsgnjn_vv_f16m8_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjn_vf_f16m8_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], half noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.mask.nxv32f16.f16.i64( poison, [[OP1]], half [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m8_t test_vfsgnjn_vf_f16m8_m(vbool2_t mask, vfloat16m8_t op1, _Float16 op2, size_t vl) { + return __riscv_th_vfsgnjn_vf_f16m8_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjn_vv_f32m1_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.mask.nxv2f32.nxv2f32.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m1_t test_vfsgnjn_vv_f32m1_m(vbool32_t mask, vfloat32m1_t op1, vfloat32m1_t op2, size_t vl) { + return __riscv_th_vfsgnjn_vv_f32m1_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjn_vf_f32m1_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], float noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.mask.nxv2f32.f32.i64( poison, [[OP1]], float [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m1_t test_vfsgnjn_vf_f32m1_m(vbool32_t mask, vfloat32m1_t op1, float op2, size_t vl) { + return __riscv_th_vfsgnjn_vf_f32m1_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjn_vv_f32m2_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.mask.nxv4f32.nxv4f32.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m2_t test_vfsgnjn_vv_f32m2_m(vbool16_t mask, vfloat32m2_t op1, vfloat32m2_t op2, size_t vl) { + return __riscv_th_vfsgnjn_vv_f32m2_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjn_vf_f32m2_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], float noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.mask.nxv4f32.f32.i64( poison, [[OP1]], float [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m2_t test_vfsgnjn_vf_f32m2_m(vbool16_t mask, vfloat32m2_t op1, float op2, size_t vl) { + return __riscv_th_vfsgnjn_vf_f32m2_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjn_vv_f32m4_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.mask.nxv8f32.nxv8f32.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m4_t test_vfsgnjn_vv_f32m4_m(vbool8_t mask, vfloat32m4_t op1, vfloat32m4_t op2, size_t vl) { + return __riscv_th_vfsgnjn_vv_f32m4_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjn_vf_f32m4_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], float noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.mask.nxv8f32.f32.i64( poison, [[OP1]], float [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m4_t test_vfsgnjn_vf_f32m4_m(vbool8_t mask, vfloat32m4_t op1, float op2, size_t vl) { + return __riscv_th_vfsgnjn_vf_f32m4_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjn_vv_f32m8_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.mask.nxv16f32.nxv16f32.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m8_t test_vfsgnjn_vv_f32m8_m(vbool4_t mask, vfloat32m8_t op1, vfloat32m8_t op2, size_t vl) { + return __riscv_th_vfsgnjn_vv_f32m8_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjn_vf_f32m8_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], float noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.mask.nxv16f32.f32.i64( poison, [[OP1]], float [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m8_t test_vfsgnjn_vf_f32m8_m(vbool4_t mask, vfloat32m8_t op1, float op2, size_t vl) { + return __riscv_th_vfsgnjn_vf_f32m8_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjn_vv_f64m1_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.mask.nxv1f64.nxv1f64.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m1_t test_vfsgnjn_vv_f64m1_m(vbool64_t mask, vfloat64m1_t op1, vfloat64m1_t op2, size_t vl) { + return __riscv_th_vfsgnjn_vv_f64m1_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjn_vf_f64m1_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], double noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.mask.nxv1f64.f64.i64( poison, [[OP1]], double [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m1_t test_vfsgnjn_vf_f64m1_m(vbool64_t mask, vfloat64m1_t op1, double op2, size_t vl) { + return __riscv_th_vfsgnjn_vf_f64m1_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjn_vv_f64m2_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.mask.nxv2f64.nxv2f64.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m2_t test_vfsgnjn_vv_f64m2_m(vbool32_t mask, vfloat64m2_t op1, vfloat64m2_t op2, size_t vl) { + return __riscv_th_vfsgnjn_vv_f64m2_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjn_vf_f64m2_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], double noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.mask.nxv2f64.f64.i64( poison, [[OP1]], double [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m2_t test_vfsgnjn_vf_f64m2_m(vbool32_t mask, vfloat64m2_t op1, double op2, size_t vl) { + return __riscv_th_vfsgnjn_vf_f64m2_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjn_vv_f64m4_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.mask.nxv4f64.nxv4f64.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m4_t test_vfsgnjn_vv_f64m4_m(vbool16_t mask, vfloat64m4_t op1, vfloat64m4_t op2, size_t vl) { + return __riscv_th_vfsgnjn_vv_f64m4_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjn_vf_f64m4_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], double noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.mask.nxv4f64.f64.i64( poison, [[OP1]], double [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m4_t test_vfsgnjn_vf_f64m4_m(vbool16_t mask, vfloat64m4_t op1, double op2, size_t vl) { + return __riscv_th_vfsgnjn_vf_f64m4_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjn_vv_f64m8_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.mask.nxv8f64.nxv8f64.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m8_t test_vfsgnjn_vv_f64m8_m(vbool8_t mask, vfloat64m8_t op1, vfloat64m8_t op2, size_t vl) { + return __riscv_th_vfsgnjn_vv_f64m8_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjn_vf_f64m8_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], double noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.mask.nxv8f64.f64.i64( poison, [[OP1]], double [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m8_t test_vfsgnjn_vf_f64m8_m(vbool8_t mask, vfloat64m8_t op1, double op2, size_t vl) { + return __riscv_th_vfsgnjn_vf_f64m8_m(mask, op1, op2, vl); +} + diff --git a/clang/test/CodeGen/RISCV/rvv0p71-intrinsics-handcrafted/vector-floating/thead/vfsgnjx.c b/clang/test/CodeGen/RISCV/rvv0p71-intrinsics-handcrafted/vector-floating/thead/vfsgnjx.c new file mode 100644 index 00000000000000..5f8d897fcb0698 --- /dev/null +++ b/clang/test/CodeGen/RISCV/rvv0p71-intrinsics-handcrafted/vector-floating/thead/vfsgnjx.c @@ -0,0 +1,489 @@ +// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 2 +// REQUIRES: riscv-registered-target +// RUN: %clang_cc1 -triple riscv64 -target-feature +xtheadvector \ +// RUN: -target-feature +d -disable-O0-optnone \ +// RUN: -emit-llvm %s -o - | opt -S -passes=mem2reg | \ +// RUN: FileCheck --check-prefix=CHECK-RV64 %s + +#include + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjx_vv_f16m1 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0:[0-9]+]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.nxv4f16.nxv4f16.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m1_t test_vfsgnjx_vv_f16m1(vfloat16m1_t op1, vfloat16m1_t op2, size_t vl) { + return __riscv_th_vfsgnjx_vv_f16m1(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjx_vf_f16m1 +// CHECK-RV64-SAME: ( [[OP1:%.*]], half noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.nxv4f16.f16.i64( poison, [[OP1]], half [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m1_t test_vfsgnjx_vf_f16m1(vfloat16m1_t op1, _Float16 op2, size_t vl) { + return __riscv_th_vfsgnjx_vf_f16m1(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjx_vv_f16m2 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.nxv8f16.nxv8f16.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m2_t test_vfsgnjx_vv_f16m2(vfloat16m2_t op1, vfloat16m2_t op2, size_t vl) { + return __riscv_th_vfsgnjx_vv_f16m2(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjx_vf_f16m2 +// CHECK-RV64-SAME: ( [[OP1:%.*]], half noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.nxv8f16.f16.i64( poison, [[OP1]], half [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m2_t test_vfsgnjx_vf_f16m2(vfloat16m2_t op1, _Float16 op2, size_t vl) { + return __riscv_th_vfsgnjx_vf_f16m2(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjx_vv_f16m4 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.nxv16f16.nxv16f16.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m4_t test_vfsgnjx_vv_f16m4(vfloat16m4_t op1, vfloat16m4_t op2, size_t vl) { + return __riscv_th_vfsgnjx_vv_f16m4(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjx_vf_f16m4 +// CHECK-RV64-SAME: ( [[OP1:%.*]], half noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.nxv16f16.f16.i64( poison, [[OP1]], half [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m4_t test_vfsgnjx_vf_f16m4(vfloat16m4_t op1, _Float16 op2, size_t vl) { + return __riscv_th_vfsgnjx_vf_f16m4(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjx_vv_f16m8 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.nxv32f16.nxv32f16.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m8_t test_vfsgnjx_vv_f16m8(vfloat16m8_t op1, vfloat16m8_t op2, size_t vl) { + return __riscv_th_vfsgnjx_vv_f16m8(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjx_vf_f16m8 +// CHECK-RV64-SAME: ( [[OP1:%.*]], half noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.nxv32f16.f16.i64( poison, [[OP1]], half [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m8_t test_vfsgnjx_vf_f16m8(vfloat16m8_t op1, _Float16 op2, size_t vl) { + return __riscv_th_vfsgnjx_vf_f16m8(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjx_vv_f32m1 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.nxv2f32.nxv2f32.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m1_t test_vfsgnjx_vv_f32m1(vfloat32m1_t op1, vfloat32m1_t op2, size_t vl) { + return __riscv_th_vfsgnjx_vv_f32m1(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjx_vf_f32m1 +// CHECK-RV64-SAME: ( [[OP1:%.*]], float noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.nxv2f32.f32.i64( poison, [[OP1]], float [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m1_t test_vfsgnjx_vf_f32m1(vfloat32m1_t op1, float op2, size_t vl) { + return __riscv_th_vfsgnjx_vf_f32m1(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjx_vv_f32m2 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.nxv4f32.nxv4f32.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m2_t test_vfsgnjx_vv_f32m2(vfloat32m2_t op1, vfloat32m2_t op2, size_t vl) { + return __riscv_th_vfsgnjx_vv_f32m2(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjx_vf_f32m2 +// CHECK-RV64-SAME: ( [[OP1:%.*]], float noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.nxv4f32.f32.i64( poison, [[OP1]], float [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m2_t test_vfsgnjx_vf_f32m2(vfloat32m2_t op1, float op2, size_t vl) { + return __riscv_th_vfsgnjx_vf_f32m2(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjx_vv_f32m4 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.nxv8f32.nxv8f32.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m4_t test_vfsgnjx_vv_f32m4(vfloat32m4_t op1, vfloat32m4_t op2, size_t vl) { + return __riscv_th_vfsgnjx_vv_f32m4(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjx_vf_f32m4 +// CHECK-RV64-SAME: ( [[OP1:%.*]], float noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.nxv8f32.f32.i64( poison, [[OP1]], float [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m4_t test_vfsgnjx_vf_f32m4(vfloat32m4_t op1, float op2, size_t vl) { + return __riscv_th_vfsgnjx_vf_f32m4(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjx_vv_f32m8 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.nxv16f32.nxv16f32.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m8_t test_vfsgnjx_vv_f32m8(vfloat32m8_t op1, vfloat32m8_t op2, size_t vl) { + return __riscv_th_vfsgnjx_vv_f32m8(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjx_vf_f32m8 +// CHECK-RV64-SAME: ( [[OP1:%.*]], float noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.nxv16f32.f32.i64( poison, [[OP1]], float [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m8_t test_vfsgnjx_vf_f32m8(vfloat32m8_t op1, float op2, size_t vl) { + return __riscv_th_vfsgnjx_vf_f32m8(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjx_vv_f64m1 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.nxv1f64.nxv1f64.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m1_t test_vfsgnjx_vv_f64m1(vfloat64m1_t op1, vfloat64m1_t op2, size_t vl) { + return __riscv_th_vfsgnjx_vv_f64m1(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjx_vf_f64m1 +// CHECK-RV64-SAME: ( [[OP1:%.*]], double noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.nxv1f64.f64.i64( poison, [[OP1]], double [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m1_t test_vfsgnjx_vf_f64m1(vfloat64m1_t op1, double op2, size_t vl) { + return __riscv_th_vfsgnjx_vf_f64m1(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjx_vv_f64m2 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.nxv2f64.nxv2f64.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m2_t test_vfsgnjx_vv_f64m2(vfloat64m2_t op1, vfloat64m2_t op2, size_t vl) { + return __riscv_th_vfsgnjx_vv_f64m2(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjx_vf_f64m2 +// CHECK-RV64-SAME: ( [[OP1:%.*]], double noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.nxv2f64.f64.i64( poison, [[OP1]], double [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m2_t test_vfsgnjx_vf_f64m2(vfloat64m2_t op1, double op2, size_t vl) { + return __riscv_th_vfsgnjx_vf_f64m2(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjx_vv_f64m4 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.nxv4f64.nxv4f64.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m4_t test_vfsgnjx_vv_f64m4(vfloat64m4_t op1, vfloat64m4_t op2, size_t vl) { + return __riscv_th_vfsgnjx_vv_f64m4(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjx_vf_f64m4 +// CHECK-RV64-SAME: ( [[OP1:%.*]], double noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.nxv4f64.f64.i64( poison, [[OP1]], double [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m4_t test_vfsgnjx_vf_f64m4(vfloat64m4_t op1, double op2, size_t vl) { + return __riscv_th_vfsgnjx_vf_f64m4(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjx_vv_f64m8 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.nxv8f64.nxv8f64.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m8_t test_vfsgnjx_vv_f64m8(vfloat64m8_t op1, vfloat64m8_t op2, size_t vl) { + return __riscv_th_vfsgnjx_vv_f64m8(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjx_vf_f64m8 +// CHECK-RV64-SAME: ( [[OP1:%.*]], double noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.nxv8f64.f64.i64( poison, [[OP1]], double [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m8_t test_vfsgnjx_vf_f64m8(vfloat64m8_t op1, double op2, size_t vl) { + return __riscv_th_vfsgnjx_vf_f64m8(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjx_vv_f16m1_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.mask.nxv4f16.nxv4f16.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m1_t test_vfsgnjx_vv_f16m1_m(vbool16_t mask, vfloat16m1_t op1, vfloat16m1_t op2, size_t vl) { + return __riscv_th_vfsgnjx_vv_f16m1_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjx_vf_f16m1_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], half noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.mask.nxv4f16.f16.i64( poison, [[OP1]], half [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m1_t test_vfsgnjx_vf_f16m1_m(vbool16_t mask, vfloat16m1_t op1, _Float16 op2, size_t vl) { + return __riscv_th_vfsgnjx_vf_f16m1_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjx_vv_f16m2_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.mask.nxv8f16.nxv8f16.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m2_t test_vfsgnjx_vv_f16m2_m(vbool8_t mask, vfloat16m2_t op1, vfloat16m2_t op2, size_t vl) { + return __riscv_th_vfsgnjx_vv_f16m2_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjx_vf_f16m2_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], half noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.mask.nxv8f16.f16.i64( poison, [[OP1]], half [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m2_t test_vfsgnjx_vf_f16m2_m(vbool8_t mask, vfloat16m2_t op1, _Float16 op2, size_t vl) { + return __riscv_th_vfsgnjx_vf_f16m2_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjx_vv_f16m4_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.mask.nxv16f16.nxv16f16.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m4_t test_vfsgnjx_vv_f16m4_m(vbool4_t mask, vfloat16m4_t op1, vfloat16m4_t op2, size_t vl) { + return __riscv_th_vfsgnjx_vv_f16m4_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjx_vf_f16m4_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], half noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.mask.nxv16f16.f16.i64( poison, [[OP1]], half [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m4_t test_vfsgnjx_vf_f16m4_m(vbool4_t mask, vfloat16m4_t op1, _Float16 op2, size_t vl) { + return __riscv_th_vfsgnjx_vf_f16m4_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjx_vv_f16m8_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.mask.nxv32f16.nxv32f16.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m8_t test_vfsgnjx_vv_f16m8_m(vbool2_t mask, vfloat16m8_t op1, vfloat16m8_t op2, size_t vl) { + return __riscv_th_vfsgnjx_vv_f16m8_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjx_vf_f16m8_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], half noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.mask.nxv32f16.f16.i64( poison, [[OP1]], half [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m8_t test_vfsgnjx_vf_f16m8_m(vbool2_t mask, vfloat16m8_t op1, _Float16 op2, size_t vl) { + return __riscv_th_vfsgnjx_vf_f16m8_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjx_vv_f32m1_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.mask.nxv2f32.nxv2f32.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m1_t test_vfsgnjx_vv_f32m1_m(vbool32_t mask, vfloat32m1_t op1, vfloat32m1_t op2, size_t vl) { + return __riscv_th_vfsgnjx_vv_f32m1_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjx_vf_f32m1_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], float noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.mask.nxv2f32.f32.i64( poison, [[OP1]], float [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m1_t test_vfsgnjx_vf_f32m1_m(vbool32_t mask, vfloat32m1_t op1, float op2, size_t vl) { + return __riscv_th_vfsgnjx_vf_f32m1_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjx_vv_f32m2_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.mask.nxv4f32.nxv4f32.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m2_t test_vfsgnjx_vv_f32m2_m(vbool16_t mask, vfloat32m2_t op1, vfloat32m2_t op2, size_t vl) { + return __riscv_th_vfsgnjx_vv_f32m2_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjx_vf_f32m2_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], float noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.mask.nxv4f32.f32.i64( poison, [[OP1]], float [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m2_t test_vfsgnjx_vf_f32m2_m(vbool16_t mask, vfloat32m2_t op1, float op2, size_t vl) { + return __riscv_th_vfsgnjx_vf_f32m2_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjx_vv_f32m4_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.mask.nxv8f32.nxv8f32.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m4_t test_vfsgnjx_vv_f32m4_m(vbool8_t mask, vfloat32m4_t op1, vfloat32m4_t op2, size_t vl) { + return __riscv_th_vfsgnjx_vv_f32m4_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjx_vf_f32m4_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], float noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.mask.nxv8f32.f32.i64( poison, [[OP1]], float [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m4_t test_vfsgnjx_vf_f32m4_m(vbool8_t mask, vfloat32m4_t op1, float op2, size_t vl) { + return __riscv_th_vfsgnjx_vf_f32m4_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjx_vv_f32m8_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.mask.nxv16f32.nxv16f32.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m8_t test_vfsgnjx_vv_f32m8_m(vbool4_t mask, vfloat32m8_t op1, vfloat32m8_t op2, size_t vl) { + return __riscv_th_vfsgnjx_vv_f32m8_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjx_vf_f32m8_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], float noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.mask.nxv16f32.f32.i64( poison, [[OP1]], float [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m8_t test_vfsgnjx_vf_f32m8_m(vbool4_t mask, vfloat32m8_t op1, float op2, size_t vl) { + return __riscv_th_vfsgnjx_vf_f32m8_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjx_vv_f64m1_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.mask.nxv1f64.nxv1f64.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m1_t test_vfsgnjx_vv_f64m1_m(vbool64_t mask, vfloat64m1_t op1, vfloat64m1_t op2, size_t vl) { + return __riscv_th_vfsgnjx_vv_f64m1_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjx_vf_f64m1_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], double noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.mask.nxv1f64.f64.i64( poison, [[OP1]], double [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m1_t test_vfsgnjx_vf_f64m1_m(vbool64_t mask, vfloat64m1_t op1, double op2, size_t vl) { + return __riscv_th_vfsgnjx_vf_f64m1_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjx_vv_f64m2_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.mask.nxv2f64.nxv2f64.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m2_t test_vfsgnjx_vv_f64m2_m(vbool32_t mask, vfloat64m2_t op1, vfloat64m2_t op2, size_t vl) { + return __riscv_th_vfsgnjx_vv_f64m2_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjx_vf_f64m2_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], double noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.mask.nxv2f64.f64.i64( poison, [[OP1]], double [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m2_t test_vfsgnjx_vf_f64m2_m(vbool32_t mask, vfloat64m2_t op1, double op2, size_t vl) { + return __riscv_th_vfsgnjx_vf_f64m2_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjx_vv_f64m4_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.mask.nxv4f64.nxv4f64.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m4_t test_vfsgnjx_vv_f64m4_m(vbool16_t mask, vfloat64m4_t op1, vfloat64m4_t op2, size_t vl) { + return __riscv_th_vfsgnjx_vv_f64m4_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjx_vf_f64m4_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], double noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.mask.nxv4f64.f64.i64( poison, [[OP1]], double [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m4_t test_vfsgnjx_vf_f64m4_m(vbool16_t mask, vfloat64m4_t op1, double op2, size_t vl) { + return __riscv_th_vfsgnjx_vf_f64m4_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjx_vv_f64m8_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.mask.nxv8f64.nxv8f64.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m8_t test_vfsgnjx_vv_f64m8_m(vbool8_t mask, vfloat64m8_t op1, vfloat64m8_t op2, size_t vl) { + return __riscv_th_vfsgnjx_vv_f64m8_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjx_vf_f64m8_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], double noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.mask.nxv8f64.f64.i64( poison, [[OP1]], double [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m8_t test_vfsgnjx_vf_f64m8_m(vbool8_t mask, vfloat64m8_t op1, double op2, size_t vl) { + return __riscv_th_vfsgnjx_vf_f64m8_m(mask, op1, op2, vl); +} + diff --git a/clang/test/CodeGen/RISCV/rvv0p71-intrinsics-handcrafted/vector-floating/thead/vfsqrt.c b/clang/test/CodeGen/RISCV/rvv0p71-intrinsics-handcrafted/vector-floating/thead/vfsqrt.c new file mode 100644 index 00000000000000..8e72e6c84f32a6 --- /dev/null +++ b/clang/test/CodeGen/RISCV/rvv0p71-intrinsics-handcrafted/vector-floating/thead/vfsqrt.c @@ -0,0 +1,248 @@ +// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 2 +// REQUIRES: riscv-registered-target +// RUN: %clang_cc1 -triple riscv64 -target-feature +xtheadvector \ +// RUN: -target-feature +d -disable-O0-optnone \ +// RUN: -emit-llvm %s -o - | opt -S -passes=mem2reg | \ +// RUN: FileCheck --check-prefix=CHECK-RV64 %s + +#include + +// CHECK-RV64-LABEL: define dso_local @test_vfsqrt_v_f16m1 +// CHECK-RV64-SAME: ( [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0:[0-9]+]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsqrt.nxv4f16.i64( poison, [[OP1]], i64 7, i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m1_t test_vfsqrt_v_f16m1(vfloat16m1_t op1, size_t vl) { + return __riscv_th_vfsqrt_v_f16m1(op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsqrt_v_f16m2 +// CHECK-RV64-SAME: ( [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsqrt.nxv8f16.i64( poison, [[OP1]], i64 7, i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m2_t test_vfsqrt_v_f16m2(vfloat16m2_t op1, size_t vl) { + return __riscv_th_vfsqrt_v_f16m2(op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsqrt_v_f16m4 +// CHECK-RV64-SAME: ( [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsqrt.nxv16f16.i64( poison, [[OP1]], i64 7, i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m4_t test_vfsqrt_v_f16m4(vfloat16m4_t op1, size_t vl) { + return __riscv_th_vfsqrt_v_f16m4(op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsqrt_v_f16m8 +// CHECK-RV64-SAME: ( [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsqrt.nxv32f16.i64( poison, [[OP1]], i64 7, i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m8_t test_vfsqrt_v_f16m8(vfloat16m8_t op1, size_t vl) { + return __riscv_th_vfsqrt_v_f16m8(op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsqrt_v_f32m1 +// CHECK-RV64-SAME: ( [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsqrt.nxv2f32.i64( poison, [[OP1]], i64 7, i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m1_t test_vfsqrt_v_f32m1(vfloat32m1_t op1, size_t vl) { + return __riscv_th_vfsqrt_v_f32m1(op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsqrt_v_f32m2 +// CHECK-RV64-SAME: ( [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsqrt.nxv4f32.i64( poison, [[OP1]], i64 7, i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m2_t test_vfsqrt_v_f32m2(vfloat32m2_t op1, size_t vl) { + return __riscv_th_vfsqrt_v_f32m2(op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsqrt_v_f32m4 +// CHECK-RV64-SAME: ( [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsqrt.nxv8f32.i64( poison, [[OP1]], i64 7, i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m4_t test_vfsqrt_v_f32m4(vfloat32m4_t op1, size_t vl) { + return __riscv_th_vfsqrt_v_f32m4(op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsqrt_v_f32m8 +// CHECK-RV64-SAME: ( [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsqrt.nxv16f32.i64( poison, [[OP1]], i64 7, i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m8_t test_vfsqrt_v_f32m8(vfloat32m8_t op1, size_t vl) { + return __riscv_th_vfsqrt_v_f32m8(op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsqrt_v_f64m1 +// CHECK-RV64-SAME: ( [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsqrt.nxv1f64.i64( poison, [[OP1]], i64 7, i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m1_t test_vfsqrt_v_f64m1(vfloat64m1_t op1, size_t vl) { + return __riscv_th_vfsqrt_v_f64m1(op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsqrt_v_f64m2 +// CHECK-RV64-SAME: ( [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsqrt.nxv2f64.i64( poison, [[OP1]], i64 7, i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m2_t test_vfsqrt_v_f64m2(vfloat64m2_t op1, size_t vl) { + return __riscv_th_vfsqrt_v_f64m2(op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsqrt_v_f64m4 +// CHECK-RV64-SAME: ( [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsqrt.nxv4f64.i64( poison, [[OP1]], i64 7, i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m4_t test_vfsqrt_v_f64m4(vfloat64m4_t op1, size_t vl) { + return __riscv_th_vfsqrt_v_f64m4(op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsqrt_v_f64m8 +// CHECK-RV64-SAME: ( [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsqrt.nxv8f64.i64( poison, [[OP1]], i64 7, i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m8_t test_vfsqrt_v_f64m8(vfloat64m8_t op1, size_t vl) { + return __riscv_th_vfsqrt_v_f64m8(op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsqrt_v_f16m1_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsqrt.mask.nxv4f16.i64( poison, [[OP1]], [[MASK]], i64 7, i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m1_t test_vfsqrt_v_f16m1_m(vbool16_t mask, vfloat16m1_t op1, size_t vl) { + return __riscv_th_vfsqrt_v_f16m1_m(mask, op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsqrt_v_f16m2_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsqrt.mask.nxv8f16.i64( poison, [[OP1]], [[MASK]], i64 7, i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m2_t test_vfsqrt_v_f16m2_m(vbool8_t mask, vfloat16m2_t op1, size_t vl) { + return __riscv_th_vfsqrt_v_f16m2_m(mask, op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsqrt_v_f16m4_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsqrt.mask.nxv16f16.i64( poison, [[OP1]], [[MASK]], i64 7, i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m4_t test_vfsqrt_v_f16m4_m(vbool4_t mask, vfloat16m4_t op1, size_t vl) { + return __riscv_th_vfsqrt_v_f16m4_m(mask, op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsqrt_v_f16m8_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsqrt.mask.nxv32f16.i64( poison, [[OP1]], [[MASK]], i64 7, i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m8_t test_vfsqrt_v_f16m8_m(vbool2_t mask, vfloat16m8_t op1, size_t vl) { + return __riscv_th_vfsqrt_v_f16m8_m(mask, op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsqrt_v_f32m1_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsqrt.mask.nxv2f32.i64( poison, [[OP1]], [[MASK]], i64 7, i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m1_t test_vfsqrt_v_f32m1_m(vbool32_t mask, vfloat32m1_t op1, size_t vl) { + return __riscv_th_vfsqrt_v_f32m1_m(mask, op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsqrt_v_f32m2_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsqrt.mask.nxv4f32.i64( poison, [[OP1]], [[MASK]], i64 7, i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m2_t test_vfsqrt_v_f32m2_m(vbool16_t mask, vfloat32m2_t op1, size_t vl) { + return __riscv_th_vfsqrt_v_f32m2_m(mask, op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsqrt_v_f32m4_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsqrt.mask.nxv8f32.i64( poison, [[OP1]], [[MASK]], i64 7, i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m4_t test_vfsqrt_v_f32m4_m(vbool8_t mask, vfloat32m4_t op1, size_t vl) { + return __riscv_th_vfsqrt_v_f32m4_m(mask, op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsqrt_v_f32m8_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsqrt.mask.nxv16f32.i64( poison, [[OP1]], [[MASK]], i64 7, i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m8_t test_vfsqrt_v_f32m8_m(vbool4_t mask, vfloat32m8_t op1, size_t vl) { + return __riscv_th_vfsqrt_v_f32m8_m(mask, op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsqrt_v_f64m1_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsqrt.mask.nxv1f64.i64( poison, [[OP1]], [[MASK]], i64 7, i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m1_t test_vfsqrt_v_f64m1_m(vbool64_t mask, vfloat64m1_t op1, size_t vl) { + return __riscv_th_vfsqrt_v_f64m1_m(mask, op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsqrt_v_f64m2_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsqrt.mask.nxv2f64.i64( poison, [[OP1]], [[MASK]], i64 7, i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m2_t test_vfsqrt_v_f64m2_m(vbool32_t mask, vfloat64m2_t op1, size_t vl) { + return __riscv_th_vfsqrt_v_f64m2_m(mask, op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsqrt_v_f64m4_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsqrt.mask.nxv4f64.i64( poison, [[OP1]], [[MASK]], i64 7, i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m4_t test_vfsqrt_v_f64m4_m(vbool16_t mask, vfloat64m4_t op1, size_t vl) { + return __riscv_th_vfsqrt_v_f64m4_m(mask, op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsqrt_v_f64m8_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsqrt.mask.nxv8f64.i64( poison, [[OP1]], [[MASK]], i64 7, i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m8_t test_vfsqrt_v_f64m8_m(vbool8_t mask, vfloat64m8_t op1, size_t vl) { + return __riscv_th_vfsqrt_v_f64m8_m(mask, op1, vl); +} diff --git a/clang/test/CodeGen/RISCV/rvv0p71-intrinsics-handcrafted/vector-floating/wrappers/vfabs.c b/clang/test/CodeGen/RISCV/rvv0p71-intrinsics-handcrafted/vector-floating/wrappers/vfabs.c new file mode 100644 index 00000000000000..a4dda64f742d04 --- /dev/null +++ b/clang/test/CodeGen/RISCV/rvv0p71-intrinsics-handcrafted/vector-floating/wrappers/vfabs.c @@ -0,0 +1,249 @@ +// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 2 +// REQUIRES: riscv-registered-target +// RUN: %clang_cc1 -triple riscv64 -target-feature +xtheadvector \ +// RUN: -target-feature +d -disable-O0-optnone \ +// RUN: -emit-llvm %s -o - | opt -S -passes=mem2reg | \ +// RUN: FileCheck --check-prefix=CHECK-RV64 %s + +#include + +// CHECK-RV64-LABEL: define dso_local @test_vfabs_v_f16m1 +// CHECK-RV64-SAME: ( [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0:[0-9]+]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.nxv4f16.nxv4f16.i64( poison, [[OP1]], [[OP1]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m1_t test_vfabs_v_f16m1(vfloat16m1_t op1, size_t vl) { + return __riscv_vfabs_v_f16m1(op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfabs_v_f16m2 +// CHECK-RV64-SAME: ( [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.nxv8f16.nxv8f16.i64( poison, [[OP1]], [[OP1]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m2_t test_vfabs_v_f16m2(vfloat16m2_t op1, size_t vl) { + return __riscv_vfabs_v_f16m2(op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfabs_v_f16m4 +// CHECK-RV64-SAME: ( [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.nxv16f16.nxv16f16.i64( poison, [[OP1]], [[OP1]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m4_t test_vfabs_v_f16m4(vfloat16m4_t op1, size_t vl) { + return __riscv_vfabs_v_f16m4(op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfabs_v_f16m8 +// CHECK-RV64-SAME: ( [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.nxv32f16.nxv32f16.i64( poison, [[OP1]], [[OP1]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m8_t test_vfabs_v_f16m8(vfloat16m8_t op1, size_t vl) { + return __riscv_vfabs_v_f16m8(op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfabs_v_f32m1 +// CHECK-RV64-SAME: ( [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.nxv2f32.nxv2f32.i64( poison, [[OP1]], [[OP1]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m1_t test_vfabs_v_f32m1(vfloat32m1_t op1, size_t vl) { + return __riscv_vfabs_v_f32m1(op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfabs_v_f32m2 +// CHECK-RV64-SAME: ( [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.nxv4f32.nxv4f32.i64( poison, [[OP1]], [[OP1]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m2_t test_vfabs_v_f32m2(vfloat32m2_t op1, size_t vl) { + return __riscv_vfabs_v_f32m2(op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfabs_v_f32m4 +// CHECK-RV64-SAME: ( [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.nxv8f32.nxv8f32.i64( poison, [[OP1]], [[OP1]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m4_t test_vfabs_v_f32m4(vfloat32m4_t op1, size_t vl) { + return __riscv_vfabs_v_f32m4(op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfabs_v_f32m8 +// CHECK-RV64-SAME: ( [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.nxv16f32.nxv16f32.i64( poison, [[OP1]], [[OP1]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m8_t test_vfabs_v_f32m8(vfloat32m8_t op1, size_t vl) { + return __riscv_vfabs_v_f32m8(op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfabs_v_f64m1 +// CHECK-RV64-SAME: ( [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.nxv1f64.nxv1f64.i64( poison, [[OP1]], [[OP1]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m1_t test_vfabs_v_f64m1(vfloat64m1_t op1, size_t vl) { + return __riscv_vfabs_v_f64m1(op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfabs_v_f64m2 +// CHECK-RV64-SAME: ( [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.nxv2f64.nxv2f64.i64( poison, [[OP1]], [[OP1]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m2_t test_vfabs_v_f64m2(vfloat64m2_t op1, size_t vl) { + return __riscv_vfabs_v_f64m2(op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfabs_v_f64m4 +// CHECK-RV64-SAME: ( [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.nxv4f64.nxv4f64.i64( poison, [[OP1]], [[OP1]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m4_t test_vfabs_v_f64m4(vfloat64m4_t op1, size_t vl) { + return __riscv_vfabs_v_f64m4(op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfabs_v_f64m8 +// CHECK-RV64-SAME: ( [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.nxv8f64.nxv8f64.i64( poison, [[OP1]], [[OP1]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m8_t test_vfabs_v_f64m8(vfloat64m8_t op1, size_t vl) { + return __riscv_vfabs_v_f64m8(op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfabs_v_f16m1_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.mask.nxv4f16.nxv4f16.i64( poison, [[OP1]], [[OP1]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m1_t test_vfabs_v_f16m1_m(vbool16_t mask, vfloat16m1_t op1, size_t vl) { + return __riscv_vfabs_v_f16m1_m(mask, op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfabs_v_f16m2_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.mask.nxv8f16.nxv8f16.i64( poison, [[OP1]], [[OP1]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m2_t test_vfabs_v_f16m2_m(vbool8_t mask, vfloat16m2_t op1, size_t vl) { + return __riscv_vfabs_v_f16m2_m(mask, op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfabs_v_f16m4_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.mask.nxv16f16.nxv16f16.i64( poison, [[OP1]], [[OP1]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m4_t test_vfabs_v_f16m4_m(vbool4_t mask, vfloat16m4_t op1, size_t vl) { + return __riscv_vfabs_v_f16m4_m(mask, op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfabs_v_f16m8_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.mask.nxv32f16.nxv32f16.i64( poison, [[OP1]], [[OP1]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m8_t test_vfabs_v_f16m8_m(vbool2_t mask, vfloat16m8_t op1, size_t vl) { + return __riscv_vfabs_v_f16m8_m(mask, op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfabs_v_f32m1_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.mask.nxv2f32.nxv2f32.i64( poison, [[OP1]], [[OP1]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m1_t test_vfabs_v_f32m1_m(vbool32_t mask, vfloat32m1_t op1, size_t vl) { + return __riscv_vfabs_v_f32m1_m(mask, op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfabs_v_f32m2_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.mask.nxv4f32.nxv4f32.i64( poison, [[OP1]], [[OP1]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m2_t test_vfabs_v_f32m2_m(vbool16_t mask, vfloat32m2_t op1, size_t vl) { + return __riscv_vfabs_v_f32m2_m(mask, op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfabs_v_f32m4_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.mask.nxv8f32.nxv8f32.i64( poison, [[OP1]], [[OP1]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m4_t test_vfabs_v_f32m4_m(vbool8_t mask, vfloat32m4_t op1, size_t vl) { + return __riscv_vfabs_v_f32m4_m(mask, op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfabs_v_f32m8_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.mask.nxv16f32.nxv16f32.i64( poison, [[OP1]], [[OP1]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m8_t test_vfabs_v_f32m8_m(vbool4_t mask, vfloat32m8_t op1, size_t vl) { + return __riscv_vfabs_v_f32m8_m(mask, op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfabs_v_f64m1_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.mask.nxv1f64.nxv1f64.i64( poison, [[OP1]], [[OP1]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m1_t test_vfabs_v_f64m1_m(vbool64_t mask, vfloat64m1_t op1, size_t vl) { + return __riscv_vfabs_v_f64m1_m(mask, op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfabs_v_f64m2_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.mask.nxv2f64.nxv2f64.i64( poison, [[OP1]], [[OP1]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m2_t test_vfabs_v_f64m2_m(vbool32_t mask, vfloat64m2_t op1, size_t vl) { + return __riscv_vfabs_v_f64m2_m(mask, op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfabs_v_f64m4_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.mask.nxv4f64.nxv4f64.i64( poison, [[OP1]], [[OP1]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m4_t test_vfabs_v_f64m4_m(vbool16_t mask, vfloat64m4_t op1, size_t vl) { + return __riscv_vfabs_v_f64m4_m(mask, op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfabs_v_f64m8_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.mask.nxv8f64.nxv8f64.i64( poison, [[OP1]], [[OP1]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m8_t test_vfabs_v_f64m8_m(vbool8_t mask, vfloat64m8_t op1, size_t vl) { + return __riscv_vfabs_v_f64m8_m(mask, op1, vl); +} + diff --git a/clang/test/CodeGen/RISCV/rvv0p71-intrinsics-handcrafted/vector-floating/wrappers/vfmax.c b/clang/test/CodeGen/RISCV/rvv0p71-intrinsics-handcrafted/vector-floating/wrappers/vfmax.c new file mode 100644 index 00000000000000..52ec1cd6498c98 --- /dev/null +++ b/clang/test/CodeGen/RISCV/rvv0p71-intrinsics-handcrafted/vector-floating/wrappers/vfmax.c @@ -0,0 +1,489 @@ +// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 2 +// REQUIRES: riscv-registered-target +// RUN: %clang_cc1 -triple riscv64 -target-feature +xtheadvector \ +// RUN: -target-feature +d -disable-O0-optnone \ +// RUN: -emit-llvm %s -o - | opt -S -passes=mem2reg | \ +// RUN: FileCheck --check-prefix=CHECK-RV64 %s + +#include + +// CHECK-RV64-LABEL: define dso_local @test_vfmax_vv_f16m1 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0:[0-9]+]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmax.nxv4f16.nxv4f16.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m1_t test_vfmax_vv_f16m1(vfloat16m1_t op1, vfloat16m1_t op2, size_t vl) { + return __riscv_vfmax_vv_f16m1(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmax_vf_f16m1 +// CHECK-RV64-SAME: ( [[OP1:%.*]], half noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmax.nxv4f16.f16.i64( poison, [[OP1]], half [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m1_t test_vfmax_vf_f16m1(vfloat16m1_t op1, _Float16 op2, size_t vl) { + return __riscv_vfmax_vf_f16m1(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmax_vv_f16m2 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmax.nxv8f16.nxv8f16.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m2_t test_vfmax_vv_f16m2(vfloat16m2_t op1, vfloat16m2_t op2, size_t vl) { + return __riscv_vfmax_vv_f16m2(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmax_vf_f16m2 +// CHECK-RV64-SAME: ( [[OP1:%.*]], half noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmax.nxv8f16.f16.i64( poison, [[OP1]], half [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m2_t test_vfmax_vf_f16m2(vfloat16m2_t op1, _Float16 op2, size_t vl) { + return __riscv_vfmax_vf_f16m2(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmax_vv_f16m4 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmax.nxv16f16.nxv16f16.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m4_t test_vfmax_vv_f16m4(vfloat16m4_t op1, vfloat16m4_t op2, size_t vl) { + return __riscv_vfmax_vv_f16m4(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmax_vf_f16m4 +// CHECK-RV64-SAME: ( [[OP1:%.*]], half noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmax.nxv16f16.f16.i64( poison, [[OP1]], half [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m4_t test_vfmax_vf_f16m4(vfloat16m4_t op1, _Float16 op2, size_t vl) { + return __riscv_vfmax_vf_f16m4(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmax_vv_f16m8 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmax.nxv32f16.nxv32f16.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m8_t test_vfmax_vv_f16m8(vfloat16m8_t op1, vfloat16m8_t op2, size_t vl) { + return __riscv_vfmax_vv_f16m8(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmax_vf_f16m8 +// CHECK-RV64-SAME: ( [[OP1:%.*]], half noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmax.nxv32f16.f16.i64( poison, [[OP1]], half [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m8_t test_vfmax_vf_f16m8(vfloat16m8_t op1, _Float16 op2, size_t vl) { + return __riscv_vfmax_vf_f16m8(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmax_vv_f32m1 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmax.nxv2f32.nxv2f32.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m1_t test_vfmax_vv_f32m1(vfloat32m1_t op1, vfloat32m1_t op2, size_t vl) { + return __riscv_vfmax_vv_f32m1(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmax_vf_f32m1 +// CHECK-RV64-SAME: ( [[OP1:%.*]], float noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmax.nxv2f32.f32.i64( poison, [[OP1]], float [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m1_t test_vfmax_vf_f32m1(vfloat32m1_t op1, float op2, size_t vl) { + return __riscv_vfmax_vf_f32m1(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmax_vv_f32m2 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmax.nxv4f32.nxv4f32.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m2_t test_vfmax_vv_f32m2(vfloat32m2_t op1, vfloat32m2_t op2, size_t vl) { + return __riscv_vfmax_vv_f32m2(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmax_vf_f32m2 +// CHECK-RV64-SAME: ( [[OP1:%.*]], float noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmax.nxv4f32.f32.i64( poison, [[OP1]], float [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m2_t test_vfmax_vf_f32m2(vfloat32m2_t op1, float op2, size_t vl) { + return __riscv_vfmax_vf_f32m2(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmax_vv_f32m4 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmax.nxv8f32.nxv8f32.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m4_t test_vfmax_vv_f32m4(vfloat32m4_t op1, vfloat32m4_t op2, size_t vl) { + return __riscv_vfmax_vv_f32m4(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmax_vf_f32m4 +// CHECK-RV64-SAME: ( [[OP1:%.*]], float noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmax.nxv8f32.f32.i64( poison, [[OP1]], float [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m4_t test_vfmax_vf_f32m4(vfloat32m4_t op1, float op2, size_t vl) { + return __riscv_vfmax_vf_f32m4(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmax_vv_f32m8 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmax.nxv16f32.nxv16f32.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m8_t test_vfmax_vv_f32m8(vfloat32m8_t op1, vfloat32m8_t op2, size_t vl) { + return __riscv_vfmax_vv_f32m8(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmax_vf_f32m8 +// CHECK-RV64-SAME: ( [[OP1:%.*]], float noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmax.nxv16f32.f32.i64( poison, [[OP1]], float [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m8_t test_vfmax_vf_f32m8(vfloat32m8_t op1, float op2, size_t vl) { + return __riscv_vfmax_vf_f32m8(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmax_vv_f64m1 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmax.nxv1f64.nxv1f64.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m1_t test_vfmax_vv_f64m1(vfloat64m1_t op1, vfloat64m1_t op2, size_t vl) { + return __riscv_vfmax_vv_f64m1(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmax_vf_f64m1 +// CHECK-RV64-SAME: ( [[OP1:%.*]], double noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmax.nxv1f64.f64.i64( poison, [[OP1]], double [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m1_t test_vfmax_vf_f64m1(vfloat64m1_t op1, double op2, size_t vl) { + return __riscv_vfmax_vf_f64m1(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmax_vv_f64m2 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmax.nxv2f64.nxv2f64.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m2_t test_vfmax_vv_f64m2(vfloat64m2_t op1, vfloat64m2_t op2, size_t vl) { + return __riscv_vfmax_vv_f64m2(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmax_vf_f64m2 +// CHECK-RV64-SAME: ( [[OP1:%.*]], double noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmax.nxv2f64.f64.i64( poison, [[OP1]], double [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m2_t test_vfmax_vf_f64m2(vfloat64m2_t op1, double op2, size_t vl) { + return __riscv_vfmax_vf_f64m2(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmax_vv_f64m4 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmax.nxv4f64.nxv4f64.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m4_t test_vfmax_vv_f64m4(vfloat64m4_t op1, vfloat64m4_t op2, size_t vl) { + return __riscv_vfmax_vv_f64m4(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmax_vf_f64m4 +// CHECK-RV64-SAME: ( [[OP1:%.*]], double noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmax.nxv4f64.f64.i64( poison, [[OP1]], double [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m4_t test_vfmax_vf_f64m4(vfloat64m4_t op1, double op2, size_t vl) { + return __riscv_vfmax_vf_f64m4(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmax_vv_f64m8 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmax.nxv8f64.nxv8f64.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m8_t test_vfmax_vv_f64m8(vfloat64m8_t op1, vfloat64m8_t op2, size_t vl) { + return __riscv_vfmax_vv_f64m8(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmax_vf_f64m8 +// CHECK-RV64-SAME: ( [[OP1:%.*]], double noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmax.nxv8f64.f64.i64( poison, [[OP1]], double [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m8_t test_vfmax_vf_f64m8(vfloat64m8_t op1, double op2, size_t vl) { + return __riscv_vfmax_vf_f64m8(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmax_vv_f16m1_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmax.mask.nxv4f16.nxv4f16.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m1_t test_vfmax_vv_f16m1_m(vbool16_t mask, vfloat16m1_t op1, vfloat16m1_t op2, size_t vl) { + return __riscv_vfmax_vv_f16m1_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmax_vf_f16m1_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], half noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmax.mask.nxv4f16.f16.i64( poison, [[OP1]], half [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m1_t test_vfmax_vf_f16m1_m(vbool16_t mask, vfloat16m1_t op1, _Float16 op2, size_t vl) { + return __riscv_vfmax_vf_f16m1_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmax_vv_f16m2_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmax.mask.nxv8f16.nxv8f16.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m2_t test_vfmax_vv_f16m2_m(vbool8_t mask, vfloat16m2_t op1, vfloat16m2_t op2, size_t vl) { + return __riscv_vfmax_vv_f16m2_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmax_vf_f16m2_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], half noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmax.mask.nxv8f16.f16.i64( poison, [[OP1]], half [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m2_t test_vfmax_vf_f16m2_m(vbool8_t mask, vfloat16m2_t op1, _Float16 op2, size_t vl) { + return __riscv_vfmax_vf_f16m2_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmax_vv_f16m4_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmax.mask.nxv16f16.nxv16f16.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m4_t test_vfmax_vv_f16m4_m(vbool4_t mask, vfloat16m4_t op1, vfloat16m4_t op2, size_t vl) { + return __riscv_vfmax_vv_f16m4_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmax_vf_f16m4_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], half noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmax.mask.nxv16f16.f16.i64( poison, [[OP1]], half [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m4_t test_vfmax_vf_f16m4_m(vbool4_t mask, vfloat16m4_t op1, _Float16 op2, size_t vl) { + return __riscv_vfmax_vf_f16m4_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmax_vv_f16m8_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmax.mask.nxv32f16.nxv32f16.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m8_t test_vfmax_vv_f16m8_m(vbool2_t mask, vfloat16m8_t op1, vfloat16m8_t op2, size_t vl) { + return __riscv_vfmax_vv_f16m8_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmax_vf_f16m8_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], half noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmax.mask.nxv32f16.f16.i64( poison, [[OP1]], half [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m8_t test_vfmax_vf_f16m8_m(vbool2_t mask, vfloat16m8_t op1, _Float16 op2, size_t vl) { + return __riscv_vfmax_vf_f16m8_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmax_vv_f32m1_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmax.mask.nxv2f32.nxv2f32.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m1_t test_vfmax_vv_f32m1_m(vbool32_t mask, vfloat32m1_t op1, vfloat32m1_t op2, size_t vl) { + return __riscv_vfmax_vv_f32m1_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmax_vf_f32m1_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], float noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmax.mask.nxv2f32.f32.i64( poison, [[OP1]], float [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m1_t test_vfmax_vf_f32m1_m(vbool32_t mask, vfloat32m1_t op1, float op2, size_t vl) { + return __riscv_vfmax_vf_f32m1_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmax_vv_f32m2_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmax.mask.nxv4f32.nxv4f32.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m2_t test_vfmax_vv_f32m2_m(vbool16_t mask, vfloat32m2_t op1, vfloat32m2_t op2, size_t vl) { + return __riscv_vfmax_vv_f32m2_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmax_vf_f32m2_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], float noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmax.mask.nxv4f32.f32.i64( poison, [[OP1]], float [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m2_t test_vfmax_vf_f32m2_m(vbool16_t mask, vfloat32m2_t op1, float op2, size_t vl) { + return __riscv_vfmax_vf_f32m2_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmax_vv_f32m4_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmax.mask.nxv8f32.nxv8f32.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m4_t test_vfmax_vv_f32m4_m(vbool8_t mask, vfloat32m4_t op1, vfloat32m4_t op2, size_t vl) { + return __riscv_vfmax_vv_f32m4_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmax_vf_f32m4_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], float noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmax.mask.nxv8f32.f32.i64( poison, [[OP1]], float [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m4_t test_vfmax_vf_f32m4_m(vbool8_t mask, vfloat32m4_t op1, float op2, size_t vl) { + return __riscv_vfmax_vf_f32m4_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmax_vv_f32m8_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmax.mask.nxv16f32.nxv16f32.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m8_t test_vfmax_vv_f32m8_m(vbool4_t mask, vfloat32m8_t op1, vfloat32m8_t op2, size_t vl) { + return __riscv_vfmax_vv_f32m8_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmax_vf_f32m8_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], float noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmax.mask.nxv16f32.f32.i64( poison, [[OP1]], float [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m8_t test_vfmax_vf_f32m8_m(vbool4_t mask, vfloat32m8_t op1, float op2, size_t vl) { + return __riscv_vfmax_vf_f32m8_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmax_vv_f64m1_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmax.mask.nxv1f64.nxv1f64.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m1_t test_vfmax_vv_f64m1_m(vbool64_t mask, vfloat64m1_t op1, vfloat64m1_t op2, size_t vl) { + return __riscv_vfmax_vv_f64m1_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmax_vf_f64m1_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], double noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmax.mask.nxv1f64.f64.i64( poison, [[OP1]], double [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m1_t test_vfmax_vf_f64m1_m(vbool64_t mask, vfloat64m1_t op1, double op2, size_t vl) { + return __riscv_vfmax_vf_f64m1_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmax_vv_f64m2_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmax.mask.nxv2f64.nxv2f64.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m2_t test_vfmax_vv_f64m2_m(vbool32_t mask, vfloat64m2_t op1, vfloat64m2_t op2, size_t vl) { + return __riscv_vfmax_vv_f64m2_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmax_vf_f64m2_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], double noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmax.mask.nxv2f64.f64.i64( poison, [[OP1]], double [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m2_t test_vfmax_vf_f64m2_m(vbool32_t mask, vfloat64m2_t op1, double op2, size_t vl) { + return __riscv_vfmax_vf_f64m2_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmax_vv_f64m4_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmax.mask.nxv4f64.nxv4f64.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m4_t test_vfmax_vv_f64m4_m(vbool16_t mask, vfloat64m4_t op1, vfloat64m4_t op2, size_t vl) { + return __riscv_vfmax_vv_f64m4_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmax_vf_f64m4_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], double noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmax.mask.nxv4f64.f64.i64( poison, [[OP1]], double [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m4_t test_vfmax_vf_f64m4_m(vbool16_t mask, vfloat64m4_t op1, double op2, size_t vl) { + return __riscv_vfmax_vf_f64m4_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmax_vv_f64m8_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmax.mask.nxv8f64.nxv8f64.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m8_t test_vfmax_vv_f64m8_m(vbool8_t mask, vfloat64m8_t op1, vfloat64m8_t op2, size_t vl) { + return __riscv_vfmax_vv_f64m8_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmax_vf_f64m8_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], double noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmax.mask.nxv8f64.f64.i64( poison, [[OP1]], double [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m8_t test_vfmax_vf_f64m8_m(vbool8_t mask, vfloat64m8_t op1, double op2, size_t vl) { + return __riscv_vfmax_vf_f64m8_m(mask, op1, op2, vl); +} + diff --git a/clang/test/CodeGen/RISCV/rvv0p71-intrinsics-handcrafted/vector-floating/wrappers/vfmin.c b/clang/test/CodeGen/RISCV/rvv0p71-intrinsics-handcrafted/vector-floating/wrappers/vfmin.c new file mode 100644 index 00000000000000..6480296e5ff075 --- /dev/null +++ b/clang/test/CodeGen/RISCV/rvv0p71-intrinsics-handcrafted/vector-floating/wrappers/vfmin.c @@ -0,0 +1,489 @@ +// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 2 +// REQUIRES: riscv-registered-target +// RUN: %clang_cc1 -triple riscv64 -target-feature +xtheadvector \ +// RUN: -target-feature +d -disable-O0-optnone \ +// RUN: -emit-llvm %s -o - | opt -S -passes=mem2reg | \ +// RUN: FileCheck --check-prefix=CHECK-RV64 %s + +#include + +// CHECK-RV64-LABEL: define dso_local @test_vfmin_vv_f16m1 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0:[0-9]+]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmin.nxv4f16.nxv4f16.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m1_t test_vfmin_vv_f16m1(vfloat16m1_t op1, vfloat16m1_t op2, size_t vl) { + return __riscv_vfmin_vv_f16m1(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmin_vf_f16m1 +// CHECK-RV64-SAME: ( [[OP1:%.*]], half noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmin.nxv4f16.f16.i64( poison, [[OP1]], half [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m1_t test_vfmin_vf_f16m1(vfloat16m1_t op1, _Float16 op2, size_t vl) { + return __riscv_vfmin_vf_f16m1(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmin_vv_f16m2 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmin.nxv8f16.nxv8f16.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m2_t test_vfmin_vv_f16m2(vfloat16m2_t op1, vfloat16m2_t op2, size_t vl) { + return __riscv_vfmin_vv_f16m2(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmin_vf_f16m2 +// CHECK-RV64-SAME: ( [[OP1:%.*]], half noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmin.nxv8f16.f16.i64( poison, [[OP1]], half [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m2_t test_vfmin_vf_f16m2(vfloat16m2_t op1, _Float16 op2, size_t vl) { + return __riscv_vfmin_vf_f16m2(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmin_vv_f16m4 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmin.nxv16f16.nxv16f16.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m4_t test_vfmin_vv_f16m4(vfloat16m4_t op1, vfloat16m4_t op2, size_t vl) { + return __riscv_vfmin_vv_f16m4(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmin_vf_f16m4 +// CHECK-RV64-SAME: ( [[OP1:%.*]], half noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmin.nxv16f16.f16.i64( poison, [[OP1]], half [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m4_t test_vfmin_vf_f16m4(vfloat16m4_t op1, _Float16 op2, size_t vl) { + return __riscv_vfmin_vf_f16m4(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmin_vv_f16m8 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmin.nxv32f16.nxv32f16.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m8_t test_vfmin_vv_f16m8(vfloat16m8_t op1, vfloat16m8_t op2, size_t vl) { + return __riscv_vfmin_vv_f16m8(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmin_vf_f16m8 +// CHECK-RV64-SAME: ( [[OP1:%.*]], half noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmin.nxv32f16.f16.i64( poison, [[OP1]], half [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m8_t test_vfmin_vf_f16m8(vfloat16m8_t op1, _Float16 op2, size_t vl) { + return __riscv_vfmin_vf_f16m8(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmin_vv_f32m1 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmin.nxv2f32.nxv2f32.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m1_t test_vfmin_vv_f32m1(vfloat32m1_t op1, vfloat32m1_t op2, size_t vl) { + return __riscv_vfmin_vv_f32m1(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmin_vf_f32m1 +// CHECK-RV64-SAME: ( [[OP1:%.*]], float noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmin.nxv2f32.f32.i64( poison, [[OP1]], float [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m1_t test_vfmin_vf_f32m1(vfloat32m1_t op1, float op2, size_t vl) { + return __riscv_vfmin_vf_f32m1(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmin_vv_f32m2 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmin.nxv4f32.nxv4f32.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m2_t test_vfmin_vv_f32m2(vfloat32m2_t op1, vfloat32m2_t op2, size_t vl) { + return __riscv_vfmin_vv_f32m2(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmin_vf_f32m2 +// CHECK-RV64-SAME: ( [[OP1:%.*]], float noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmin.nxv4f32.f32.i64( poison, [[OP1]], float [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m2_t test_vfmin_vf_f32m2(vfloat32m2_t op1, float op2, size_t vl) { + return __riscv_vfmin_vf_f32m2(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmin_vv_f32m4 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmin.nxv8f32.nxv8f32.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m4_t test_vfmin_vv_f32m4(vfloat32m4_t op1, vfloat32m4_t op2, size_t vl) { + return __riscv_vfmin_vv_f32m4(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmin_vf_f32m4 +// CHECK-RV64-SAME: ( [[OP1:%.*]], float noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmin.nxv8f32.f32.i64( poison, [[OP1]], float [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m4_t test_vfmin_vf_f32m4(vfloat32m4_t op1, float op2, size_t vl) { + return __riscv_vfmin_vf_f32m4(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmin_vv_f32m8 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmin.nxv16f32.nxv16f32.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m8_t test_vfmin_vv_f32m8(vfloat32m8_t op1, vfloat32m8_t op2, size_t vl) { + return __riscv_vfmin_vv_f32m8(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmin_vf_f32m8 +// CHECK-RV64-SAME: ( [[OP1:%.*]], float noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmin.nxv16f32.f32.i64( poison, [[OP1]], float [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m8_t test_vfmin_vf_f32m8(vfloat32m8_t op1, float op2, size_t vl) { + return __riscv_vfmin_vf_f32m8(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmin_vv_f64m1 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmin.nxv1f64.nxv1f64.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m1_t test_vfmin_vv_f64m1(vfloat64m1_t op1, vfloat64m1_t op2, size_t vl) { + return __riscv_vfmin_vv_f64m1(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmin_vf_f64m1 +// CHECK-RV64-SAME: ( [[OP1:%.*]], double noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmin.nxv1f64.f64.i64( poison, [[OP1]], double [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m1_t test_vfmin_vf_f64m1(vfloat64m1_t op1, double op2, size_t vl) { + return __riscv_vfmin_vf_f64m1(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmin_vv_f64m2 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmin.nxv2f64.nxv2f64.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m2_t test_vfmin_vv_f64m2(vfloat64m2_t op1, vfloat64m2_t op2, size_t vl) { + return __riscv_vfmin_vv_f64m2(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmin_vf_f64m2 +// CHECK-RV64-SAME: ( [[OP1:%.*]], double noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmin.nxv2f64.f64.i64( poison, [[OP1]], double [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m2_t test_vfmin_vf_f64m2(vfloat64m2_t op1, double op2, size_t vl) { + return __riscv_vfmin_vf_f64m2(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmin_vv_f64m4 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmin.nxv4f64.nxv4f64.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m4_t test_vfmin_vv_f64m4(vfloat64m4_t op1, vfloat64m4_t op2, size_t vl) { + return __riscv_vfmin_vv_f64m4(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmin_vf_f64m4 +// CHECK-RV64-SAME: ( [[OP1:%.*]], double noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmin.nxv4f64.f64.i64( poison, [[OP1]], double [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m4_t test_vfmin_vf_f64m4(vfloat64m4_t op1, double op2, size_t vl) { + return __riscv_vfmin_vf_f64m4(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmin_vv_f64m8 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmin.nxv8f64.nxv8f64.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m8_t test_vfmin_vv_f64m8(vfloat64m8_t op1, vfloat64m8_t op2, size_t vl) { + return __riscv_vfmin_vv_f64m8(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmin_vf_f64m8 +// CHECK-RV64-SAME: ( [[OP1:%.*]], double noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmin.nxv8f64.f64.i64( poison, [[OP1]], double [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m8_t test_vfmin_vf_f64m8(vfloat64m8_t op1, double op2, size_t vl) { + return __riscv_vfmin_vf_f64m8(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmin_vv_f16m1_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmin.mask.nxv4f16.nxv4f16.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m1_t test_vfmin_vv_f16m1_m(vbool16_t mask, vfloat16m1_t op1, vfloat16m1_t op2, size_t vl) { + return __riscv_vfmin_vv_f16m1_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmin_vf_f16m1_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], half noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmin.mask.nxv4f16.f16.i64( poison, [[OP1]], half [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m1_t test_vfmin_vf_f16m1_m(vbool16_t mask, vfloat16m1_t op1, _Float16 op2, size_t vl) { + return __riscv_vfmin_vf_f16m1_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmin_vv_f16m2_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmin.mask.nxv8f16.nxv8f16.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m2_t test_vfmin_vv_f16m2_m(vbool8_t mask, vfloat16m2_t op1, vfloat16m2_t op2, size_t vl) { + return __riscv_vfmin_vv_f16m2_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmin_vf_f16m2_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], half noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmin.mask.nxv8f16.f16.i64( poison, [[OP1]], half [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m2_t test_vfmin_vf_f16m2_m(vbool8_t mask, vfloat16m2_t op1, _Float16 op2, size_t vl) { + return __riscv_vfmin_vf_f16m2_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmin_vv_f16m4_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmin.mask.nxv16f16.nxv16f16.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m4_t test_vfmin_vv_f16m4_m(vbool4_t mask, vfloat16m4_t op1, vfloat16m4_t op2, size_t vl) { + return __riscv_vfmin_vv_f16m4_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmin_vf_f16m4_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], half noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmin.mask.nxv16f16.f16.i64( poison, [[OP1]], half [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m4_t test_vfmin_vf_f16m4_m(vbool4_t mask, vfloat16m4_t op1, _Float16 op2, size_t vl) { + return __riscv_vfmin_vf_f16m4_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmin_vv_f16m8_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmin.mask.nxv32f16.nxv32f16.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m8_t test_vfmin_vv_f16m8_m(vbool2_t mask, vfloat16m8_t op1, vfloat16m8_t op2, size_t vl) { + return __riscv_vfmin_vv_f16m8_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmin_vf_f16m8_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], half noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmin.mask.nxv32f16.f16.i64( poison, [[OP1]], half [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m8_t test_vfmin_vf_f16m8_m(vbool2_t mask, vfloat16m8_t op1, _Float16 op2, size_t vl) { + return __riscv_vfmin_vf_f16m8_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmin_vv_f32m1_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmin.mask.nxv2f32.nxv2f32.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m1_t test_vfmin_vv_f32m1_m(vbool32_t mask, vfloat32m1_t op1, vfloat32m1_t op2, size_t vl) { + return __riscv_vfmin_vv_f32m1_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmin_vf_f32m1_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], float noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmin.mask.nxv2f32.f32.i64( poison, [[OP1]], float [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m1_t test_vfmin_vf_f32m1_m(vbool32_t mask, vfloat32m1_t op1, float op2, size_t vl) { + return __riscv_vfmin_vf_f32m1_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmin_vv_f32m2_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmin.mask.nxv4f32.nxv4f32.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m2_t test_vfmin_vv_f32m2_m(vbool16_t mask, vfloat32m2_t op1, vfloat32m2_t op2, size_t vl) { + return __riscv_vfmin_vv_f32m2_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmin_vf_f32m2_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], float noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmin.mask.nxv4f32.f32.i64( poison, [[OP1]], float [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m2_t test_vfmin_vf_f32m2_m(vbool16_t mask, vfloat32m2_t op1, float op2, size_t vl) { + return __riscv_vfmin_vf_f32m2_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmin_vv_f32m4_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmin.mask.nxv8f32.nxv8f32.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m4_t test_vfmin_vv_f32m4_m(vbool8_t mask, vfloat32m4_t op1, vfloat32m4_t op2, size_t vl) { + return __riscv_vfmin_vv_f32m4_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmin_vf_f32m4_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], float noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmin.mask.nxv8f32.f32.i64( poison, [[OP1]], float [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m4_t test_vfmin_vf_f32m4_m(vbool8_t mask, vfloat32m4_t op1, float op2, size_t vl) { + return __riscv_vfmin_vf_f32m4_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmin_vv_f32m8_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmin.mask.nxv16f32.nxv16f32.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m8_t test_vfmin_vv_f32m8_m(vbool4_t mask, vfloat32m8_t op1, vfloat32m8_t op2, size_t vl) { + return __riscv_vfmin_vv_f32m8_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmin_vf_f32m8_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], float noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmin.mask.nxv16f32.f32.i64( poison, [[OP1]], float [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m8_t test_vfmin_vf_f32m8_m(vbool4_t mask, vfloat32m8_t op1, float op2, size_t vl) { + return __riscv_vfmin_vf_f32m8_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmin_vv_f64m1_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmin.mask.nxv1f64.nxv1f64.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m1_t test_vfmin_vv_f64m1_m(vbool64_t mask, vfloat64m1_t op1, vfloat64m1_t op2, size_t vl) { + return __riscv_vfmin_vv_f64m1_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmin_vf_f64m1_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], double noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmin.mask.nxv1f64.f64.i64( poison, [[OP1]], double [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m1_t test_vfmin_vf_f64m1_m(vbool64_t mask, vfloat64m1_t op1, double op2, size_t vl) { + return __riscv_vfmin_vf_f64m1_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmin_vv_f64m2_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmin.mask.nxv2f64.nxv2f64.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m2_t test_vfmin_vv_f64m2_m(vbool32_t mask, vfloat64m2_t op1, vfloat64m2_t op2, size_t vl) { + return __riscv_vfmin_vv_f64m2_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmin_vf_f64m2_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], double noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmin.mask.nxv2f64.f64.i64( poison, [[OP1]], double [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m2_t test_vfmin_vf_f64m2_m(vbool32_t mask, vfloat64m2_t op1, double op2, size_t vl) { + return __riscv_vfmin_vf_f64m2_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmin_vv_f64m4_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmin.mask.nxv4f64.nxv4f64.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m4_t test_vfmin_vv_f64m4_m(vbool16_t mask, vfloat64m4_t op1, vfloat64m4_t op2, size_t vl) { + return __riscv_vfmin_vv_f64m4_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmin_vf_f64m4_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], double noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmin.mask.nxv4f64.f64.i64( poison, [[OP1]], double [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m4_t test_vfmin_vf_f64m4_m(vbool16_t mask, vfloat64m4_t op1, double op2, size_t vl) { + return __riscv_vfmin_vf_f64m4_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmin_vv_f64m8_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmin.mask.nxv8f64.nxv8f64.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m8_t test_vfmin_vv_f64m8_m(vbool8_t mask, vfloat64m8_t op1, vfloat64m8_t op2, size_t vl) { + return __riscv_vfmin_vv_f64m8_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfmin_vf_f64m8_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], double noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfmin.mask.nxv8f64.f64.i64( poison, [[OP1]], double [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m8_t test_vfmin_vf_f64m8_m(vbool8_t mask, vfloat64m8_t op1, double op2, size_t vl) { + return __riscv_vfmin_vf_f64m8_m(mask, op1, op2, vl); +} + diff --git a/clang/test/CodeGen/RISCV/rvv0p71-intrinsics-handcrafted/vector-floating/wrappers/vfneg.c b/clang/test/CodeGen/RISCV/rvv0p71-intrinsics-handcrafted/vector-floating/wrappers/vfneg.c new file mode 100644 index 00000000000000..d335724fef9d62 --- /dev/null +++ b/clang/test/CodeGen/RISCV/rvv0p71-intrinsics-handcrafted/vector-floating/wrappers/vfneg.c @@ -0,0 +1,249 @@ +// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 2 +// REQUIRES: riscv-registered-target +// RUN: %clang_cc1 -triple riscv64 -target-feature +xtheadvector \ +// RUN: -target-feature +d -disable-O0-optnone \ +// RUN: -emit-llvm %s -o - | opt -S -passes=mem2reg | \ +// RUN: FileCheck --check-prefix=CHECK-RV64 %s + +#include + +// CHECK-RV64-LABEL: define dso_local @test_vfneg_v_f16m1 +// CHECK-RV64-SAME: ( [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0:[0-9]+]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.nxv4f16.nxv4f16.i64( poison, [[OP1]], [[OP1]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m1_t test_vfneg_v_f16m1(vfloat16m1_t op1, size_t vl) { + return __riscv_vfneg_v_f16m1(op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfneg_v_f16m2 +// CHECK-RV64-SAME: ( [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.nxv8f16.nxv8f16.i64( poison, [[OP1]], [[OP1]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m2_t test_vfneg_v_f16m2(vfloat16m2_t op1, size_t vl) { + return __riscv_vfneg_v_f16m2(op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfneg_v_f16m4 +// CHECK-RV64-SAME: ( [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.nxv16f16.nxv16f16.i64( poison, [[OP1]], [[OP1]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m4_t test_vfneg_v_f16m4(vfloat16m4_t op1, size_t vl) { + return __riscv_vfneg_v_f16m4(op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfneg_v_f16m8 +// CHECK-RV64-SAME: ( [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.nxv32f16.nxv32f16.i64( poison, [[OP1]], [[OP1]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m8_t test_vfneg_v_f16m8(vfloat16m8_t op1, size_t vl) { + return __riscv_vfneg_v_f16m8(op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfneg_v_f32m1 +// CHECK-RV64-SAME: ( [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.nxv2f32.nxv2f32.i64( poison, [[OP1]], [[OP1]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m1_t test_vfneg_v_f32m1(vfloat32m1_t op1, size_t vl) { + return __riscv_vfneg_v_f32m1(op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfneg_v_f32m2 +// CHECK-RV64-SAME: ( [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.nxv4f32.nxv4f32.i64( poison, [[OP1]], [[OP1]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m2_t test_vfneg_v_f32m2(vfloat32m2_t op1, size_t vl) { + return __riscv_vfneg_v_f32m2(op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfneg_v_f32m4 +// CHECK-RV64-SAME: ( [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.nxv8f32.nxv8f32.i64( poison, [[OP1]], [[OP1]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m4_t test_vfneg_v_f32m4(vfloat32m4_t op1, size_t vl) { + return __riscv_vfneg_v_f32m4(op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfneg_v_f32m8 +// CHECK-RV64-SAME: ( [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.nxv16f32.nxv16f32.i64( poison, [[OP1]], [[OP1]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m8_t test_vfneg_v_f32m8(vfloat32m8_t op1, size_t vl) { + return __riscv_vfneg_v_f32m8(op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfneg_v_f64m1 +// CHECK-RV64-SAME: ( [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.nxv1f64.nxv1f64.i64( poison, [[OP1]], [[OP1]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m1_t test_vfneg_v_f64m1(vfloat64m1_t op1, size_t vl) { + return __riscv_vfneg_v_f64m1(op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfneg_v_f64m2 +// CHECK-RV64-SAME: ( [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.nxv2f64.nxv2f64.i64( poison, [[OP1]], [[OP1]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m2_t test_vfneg_v_f64m2(vfloat64m2_t op1, size_t vl) { + return __riscv_vfneg_v_f64m2(op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfneg_v_f64m4 +// CHECK-RV64-SAME: ( [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.nxv4f64.nxv4f64.i64( poison, [[OP1]], [[OP1]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m4_t test_vfneg_v_f64m4(vfloat64m4_t op1, size_t vl) { + return __riscv_vfneg_v_f64m4(op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfneg_v_f64m8 +// CHECK-RV64-SAME: ( [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.nxv8f64.nxv8f64.i64( poison, [[OP1]], [[OP1]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m8_t test_vfneg_v_f64m8(vfloat64m8_t op1, size_t vl) { + return __riscv_vfneg_v_f64m8(op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfneg_v_f16m1_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.mask.nxv4f16.nxv4f16.i64( poison, [[OP1]], [[OP1]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m1_t test_vfneg_v_f16m1_m(vbool16_t mask, vfloat16m1_t op1, size_t vl) { + return __riscv_vfneg_v_f16m1_m(mask, op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfneg_v_f16m2_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.mask.nxv8f16.nxv8f16.i64( poison, [[OP1]], [[OP1]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m2_t test_vfneg_v_f16m2_m(vbool8_t mask, vfloat16m2_t op1, size_t vl) { + return __riscv_vfneg_v_f16m2_m(mask, op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfneg_v_f16m4_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.mask.nxv16f16.nxv16f16.i64( poison, [[OP1]], [[OP1]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m4_t test_vfneg_v_f16m4_m(vbool4_t mask, vfloat16m4_t op1, size_t vl) { + return __riscv_vfneg_v_f16m4_m(mask, op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfneg_v_f16m8_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.mask.nxv32f16.nxv32f16.i64( poison, [[OP1]], [[OP1]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m8_t test_vfneg_v_f16m8_m(vbool2_t mask, vfloat16m8_t op1, size_t vl) { + return __riscv_vfneg_v_f16m8_m(mask, op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfneg_v_f32m1_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.mask.nxv2f32.nxv2f32.i64( poison, [[OP1]], [[OP1]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m1_t test_vfneg_v_f32m1_m(vbool32_t mask, vfloat32m1_t op1, size_t vl) { + return __riscv_vfneg_v_f32m1_m(mask, op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfneg_v_f32m2_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.mask.nxv4f32.nxv4f32.i64( poison, [[OP1]], [[OP1]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m2_t test_vfneg_v_f32m2_m(vbool16_t mask, vfloat32m2_t op1, size_t vl) { + return __riscv_vfneg_v_f32m2_m(mask, op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfneg_v_f32m4_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.mask.nxv8f32.nxv8f32.i64( poison, [[OP1]], [[OP1]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m4_t test_vfneg_v_f32m4_m(vbool8_t mask, vfloat32m4_t op1, size_t vl) { + return __riscv_vfneg_v_f32m4_m(mask, op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfneg_v_f32m8_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.mask.nxv16f32.nxv16f32.i64( poison, [[OP1]], [[OP1]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m8_t test_vfneg_v_f32m8_m(vbool4_t mask, vfloat32m8_t op1, size_t vl) { + return __riscv_vfneg_v_f32m8_m(mask, op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfneg_v_f64m1_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.mask.nxv1f64.nxv1f64.i64( poison, [[OP1]], [[OP1]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m1_t test_vfneg_v_f64m1_m(vbool64_t mask, vfloat64m1_t op1, size_t vl) { + return __riscv_vfneg_v_f64m1_m(mask, op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfneg_v_f64m2_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.mask.nxv2f64.nxv2f64.i64( poison, [[OP1]], [[OP1]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m2_t test_vfneg_v_f64m2_m(vbool32_t mask, vfloat64m2_t op1, size_t vl) { + return __riscv_vfneg_v_f64m2_m(mask, op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfneg_v_f64m4_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.mask.nxv4f64.nxv4f64.i64( poison, [[OP1]], [[OP1]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m4_t test_vfneg_v_f64m4_m(vbool16_t mask, vfloat64m4_t op1, size_t vl) { + return __riscv_vfneg_v_f64m4_m(mask, op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfneg_v_f64m8_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.mask.nxv8f64.nxv8f64.i64( poison, [[OP1]], [[OP1]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m8_t test_vfneg_v_f64m8_m(vbool8_t mask, vfloat64m8_t op1, size_t vl) { + return __riscv_vfneg_v_f64m8_m(mask, op1, vl); +} + diff --git a/clang/test/CodeGen/RISCV/rvv0p71-intrinsics-handcrafted/vector-floating/wrappers/vfsgnj.c b/clang/test/CodeGen/RISCV/rvv0p71-intrinsics-handcrafted/vector-floating/wrappers/vfsgnj.c new file mode 100644 index 00000000000000..b97f6372cdf46b --- /dev/null +++ b/clang/test/CodeGen/RISCV/rvv0p71-intrinsics-handcrafted/vector-floating/wrappers/vfsgnj.c @@ -0,0 +1,489 @@ +// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 2 +// REQUIRES: riscv-registered-target +// RUN: %clang_cc1 -triple riscv64 -target-feature +xtheadvector \ +// RUN: -target-feature +d -disable-O0-optnone \ +// RUN: -emit-llvm %s -o - | opt -S -passes=mem2reg | \ +// RUN: FileCheck --check-prefix=CHECK-RV64 %s + +#include + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnj_vv_f16m1 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0:[0-9]+]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnj.nxv4f16.nxv4f16.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m1_t test_vfsgnj_vv_f16m1(vfloat16m1_t op1, vfloat16m1_t op2, size_t vl) { + return __riscv_vfsgnj_vv_f16m1(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnj_vf_f16m1 +// CHECK-RV64-SAME: ( [[OP1:%.*]], half noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnj.nxv4f16.f16.i64( poison, [[OP1]], half [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m1_t test_vfsgnj_vf_f16m1(vfloat16m1_t op1, _Float16 op2, size_t vl) { + return __riscv_vfsgnj_vf_f16m1(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnj_vv_f16m2 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnj.nxv8f16.nxv8f16.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m2_t test_vfsgnj_vv_f16m2(vfloat16m2_t op1, vfloat16m2_t op2, size_t vl) { + return __riscv_vfsgnj_vv_f16m2(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnj_vf_f16m2 +// CHECK-RV64-SAME: ( [[OP1:%.*]], half noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnj.nxv8f16.f16.i64( poison, [[OP1]], half [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m2_t test_vfsgnj_vf_f16m2(vfloat16m2_t op1, _Float16 op2, size_t vl) { + return __riscv_vfsgnj_vf_f16m2(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnj_vv_f16m4 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnj.nxv16f16.nxv16f16.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m4_t test_vfsgnj_vv_f16m4(vfloat16m4_t op1, vfloat16m4_t op2, size_t vl) { + return __riscv_vfsgnj_vv_f16m4(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnj_vf_f16m4 +// CHECK-RV64-SAME: ( [[OP1:%.*]], half noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnj.nxv16f16.f16.i64( poison, [[OP1]], half [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m4_t test_vfsgnj_vf_f16m4(vfloat16m4_t op1, _Float16 op2, size_t vl) { + return __riscv_vfsgnj_vf_f16m4(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnj_vv_f16m8 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnj.nxv32f16.nxv32f16.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m8_t test_vfsgnj_vv_f16m8(vfloat16m8_t op1, vfloat16m8_t op2, size_t vl) { + return __riscv_vfsgnj_vv_f16m8(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnj_vf_f16m8 +// CHECK-RV64-SAME: ( [[OP1:%.*]], half noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnj.nxv32f16.f16.i64( poison, [[OP1]], half [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m8_t test_vfsgnj_vf_f16m8(vfloat16m8_t op1, _Float16 op2, size_t vl) { + return __riscv_vfsgnj_vf_f16m8(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnj_vv_f32m1 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnj.nxv2f32.nxv2f32.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m1_t test_vfsgnj_vv_f32m1(vfloat32m1_t op1, vfloat32m1_t op2, size_t vl) { + return __riscv_vfsgnj_vv_f32m1(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnj_vf_f32m1 +// CHECK-RV64-SAME: ( [[OP1:%.*]], float noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnj.nxv2f32.f32.i64( poison, [[OP1]], float [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m1_t test_vfsgnj_vf_f32m1(vfloat32m1_t op1, float op2, size_t vl) { + return __riscv_vfsgnj_vf_f32m1(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnj_vv_f32m2 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnj.nxv4f32.nxv4f32.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m2_t test_vfsgnj_vv_f32m2(vfloat32m2_t op1, vfloat32m2_t op2, size_t vl) { + return __riscv_vfsgnj_vv_f32m2(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnj_vf_f32m2 +// CHECK-RV64-SAME: ( [[OP1:%.*]], float noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnj.nxv4f32.f32.i64( poison, [[OP1]], float [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m2_t test_vfsgnj_vf_f32m2(vfloat32m2_t op1, float op2, size_t vl) { + return __riscv_vfsgnj_vf_f32m2(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnj_vv_f32m4 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnj.nxv8f32.nxv8f32.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m4_t test_vfsgnj_vv_f32m4(vfloat32m4_t op1, vfloat32m4_t op2, size_t vl) { + return __riscv_vfsgnj_vv_f32m4(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnj_vf_f32m4 +// CHECK-RV64-SAME: ( [[OP1:%.*]], float noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnj.nxv8f32.f32.i64( poison, [[OP1]], float [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m4_t test_vfsgnj_vf_f32m4(vfloat32m4_t op1, float op2, size_t vl) { + return __riscv_vfsgnj_vf_f32m4(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnj_vv_f32m8 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnj.nxv16f32.nxv16f32.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m8_t test_vfsgnj_vv_f32m8(vfloat32m8_t op1, vfloat32m8_t op2, size_t vl) { + return __riscv_vfsgnj_vv_f32m8(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnj_vf_f32m8 +// CHECK-RV64-SAME: ( [[OP1:%.*]], float noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnj.nxv16f32.f32.i64( poison, [[OP1]], float [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m8_t test_vfsgnj_vf_f32m8(vfloat32m8_t op1, float op2, size_t vl) { + return __riscv_vfsgnj_vf_f32m8(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnj_vv_f64m1 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnj.nxv1f64.nxv1f64.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m1_t test_vfsgnj_vv_f64m1(vfloat64m1_t op1, vfloat64m1_t op2, size_t vl) { + return __riscv_vfsgnj_vv_f64m1(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnj_vf_f64m1 +// CHECK-RV64-SAME: ( [[OP1:%.*]], double noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnj.nxv1f64.f64.i64( poison, [[OP1]], double [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m1_t test_vfsgnj_vf_f64m1(vfloat64m1_t op1, double op2, size_t vl) { + return __riscv_vfsgnj_vf_f64m1(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnj_vv_f64m2 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnj.nxv2f64.nxv2f64.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m2_t test_vfsgnj_vv_f64m2(vfloat64m2_t op1, vfloat64m2_t op2, size_t vl) { + return __riscv_vfsgnj_vv_f64m2(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnj_vf_f64m2 +// CHECK-RV64-SAME: ( [[OP1:%.*]], double noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnj.nxv2f64.f64.i64( poison, [[OP1]], double [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m2_t test_vfsgnj_vf_f64m2(vfloat64m2_t op1, double op2, size_t vl) { + return __riscv_vfsgnj_vf_f64m2(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnj_vv_f64m4 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnj.nxv4f64.nxv4f64.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m4_t test_vfsgnj_vv_f64m4(vfloat64m4_t op1, vfloat64m4_t op2, size_t vl) { + return __riscv_vfsgnj_vv_f64m4(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnj_vf_f64m4 +// CHECK-RV64-SAME: ( [[OP1:%.*]], double noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnj.nxv4f64.f64.i64( poison, [[OP1]], double [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m4_t test_vfsgnj_vf_f64m4(vfloat64m4_t op1, double op2, size_t vl) { + return __riscv_vfsgnj_vf_f64m4(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnj_vv_f64m8 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnj.nxv8f64.nxv8f64.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m8_t test_vfsgnj_vv_f64m8(vfloat64m8_t op1, vfloat64m8_t op2, size_t vl) { + return __riscv_vfsgnj_vv_f64m8(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnj_vf_f64m8 +// CHECK-RV64-SAME: ( [[OP1:%.*]], double noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnj.nxv8f64.f64.i64( poison, [[OP1]], double [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m8_t test_vfsgnj_vf_f64m8(vfloat64m8_t op1, double op2, size_t vl) { + return __riscv_vfsgnj_vf_f64m8(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnj_vv_f16m1_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnj.mask.nxv4f16.nxv4f16.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m1_t test_vfsgnj_vv_f16m1_m(vbool16_t mask, vfloat16m1_t op1, vfloat16m1_t op2, size_t vl) { + return __riscv_vfsgnj_vv_f16m1_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnj_vf_f16m1_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], half noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnj.mask.nxv4f16.f16.i64( poison, [[OP1]], half [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m1_t test_vfsgnj_vf_f16m1_m(vbool16_t mask, vfloat16m1_t op1, _Float16 op2, size_t vl) { + return __riscv_vfsgnj_vf_f16m1_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnj_vv_f16m2_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnj.mask.nxv8f16.nxv8f16.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m2_t test_vfsgnj_vv_f16m2_m(vbool8_t mask, vfloat16m2_t op1, vfloat16m2_t op2, size_t vl) { + return __riscv_vfsgnj_vv_f16m2_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnj_vf_f16m2_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], half noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnj.mask.nxv8f16.f16.i64( poison, [[OP1]], half [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m2_t test_vfsgnj_vf_f16m2_m(vbool8_t mask, vfloat16m2_t op1, _Float16 op2, size_t vl) { + return __riscv_vfsgnj_vf_f16m2_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnj_vv_f16m4_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnj.mask.nxv16f16.nxv16f16.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m4_t test_vfsgnj_vv_f16m4_m(vbool4_t mask, vfloat16m4_t op1, vfloat16m4_t op2, size_t vl) { + return __riscv_vfsgnj_vv_f16m4_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnj_vf_f16m4_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], half noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnj.mask.nxv16f16.f16.i64( poison, [[OP1]], half [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m4_t test_vfsgnj_vf_f16m4_m(vbool4_t mask, vfloat16m4_t op1, _Float16 op2, size_t vl) { + return __riscv_vfsgnj_vf_f16m4_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnj_vv_f16m8_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnj.mask.nxv32f16.nxv32f16.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m8_t test_vfsgnj_vv_f16m8_m(vbool2_t mask, vfloat16m8_t op1, vfloat16m8_t op2, size_t vl) { + return __riscv_vfsgnj_vv_f16m8_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnj_vf_f16m8_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], half noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnj.mask.nxv32f16.f16.i64( poison, [[OP1]], half [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m8_t test_vfsgnj_vf_f16m8_m(vbool2_t mask, vfloat16m8_t op1, _Float16 op2, size_t vl) { + return __riscv_vfsgnj_vf_f16m8_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnj_vv_f32m1_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnj.mask.nxv2f32.nxv2f32.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m1_t test_vfsgnj_vv_f32m1_m(vbool32_t mask, vfloat32m1_t op1, vfloat32m1_t op2, size_t vl) { + return __riscv_vfsgnj_vv_f32m1_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnj_vf_f32m1_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], float noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnj.mask.nxv2f32.f32.i64( poison, [[OP1]], float [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m1_t test_vfsgnj_vf_f32m1_m(vbool32_t mask, vfloat32m1_t op1, float op2, size_t vl) { + return __riscv_vfsgnj_vf_f32m1_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnj_vv_f32m2_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnj.mask.nxv4f32.nxv4f32.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m2_t test_vfsgnj_vv_f32m2_m(vbool16_t mask, vfloat32m2_t op1, vfloat32m2_t op2, size_t vl) { + return __riscv_vfsgnj_vv_f32m2_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnj_vf_f32m2_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], float noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnj.mask.nxv4f32.f32.i64( poison, [[OP1]], float [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m2_t test_vfsgnj_vf_f32m2_m(vbool16_t mask, vfloat32m2_t op1, float op2, size_t vl) { + return __riscv_vfsgnj_vf_f32m2_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnj_vv_f32m4_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnj.mask.nxv8f32.nxv8f32.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m4_t test_vfsgnj_vv_f32m4_m(vbool8_t mask, vfloat32m4_t op1, vfloat32m4_t op2, size_t vl) { + return __riscv_vfsgnj_vv_f32m4_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnj_vf_f32m4_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], float noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnj.mask.nxv8f32.f32.i64( poison, [[OP1]], float [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m4_t test_vfsgnj_vf_f32m4_m(vbool8_t mask, vfloat32m4_t op1, float op2, size_t vl) { + return __riscv_vfsgnj_vf_f32m4_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnj_vv_f32m8_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnj.mask.nxv16f32.nxv16f32.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m8_t test_vfsgnj_vv_f32m8_m(vbool4_t mask, vfloat32m8_t op1, vfloat32m8_t op2, size_t vl) { + return __riscv_vfsgnj_vv_f32m8_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnj_vf_f32m8_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], float noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnj.mask.nxv16f32.f32.i64( poison, [[OP1]], float [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m8_t test_vfsgnj_vf_f32m8_m(vbool4_t mask, vfloat32m8_t op1, float op2, size_t vl) { + return __riscv_vfsgnj_vf_f32m8_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnj_vv_f64m1_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnj.mask.nxv1f64.nxv1f64.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m1_t test_vfsgnj_vv_f64m1_m(vbool64_t mask, vfloat64m1_t op1, vfloat64m1_t op2, size_t vl) { + return __riscv_vfsgnj_vv_f64m1_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnj_vf_f64m1_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], double noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnj.mask.nxv1f64.f64.i64( poison, [[OP1]], double [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m1_t test_vfsgnj_vf_f64m1_m(vbool64_t mask, vfloat64m1_t op1, double op2, size_t vl) { + return __riscv_vfsgnj_vf_f64m1_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnj_vv_f64m2_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnj.mask.nxv2f64.nxv2f64.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m2_t test_vfsgnj_vv_f64m2_m(vbool32_t mask, vfloat64m2_t op1, vfloat64m2_t op2, size_t vl) { + return __riscv_vfsgnj_vv_f64m2_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnj_vf_f64m2_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], double noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnj.mask.nxv2f64.f64.i64( poison, [[OP1]], double [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m2_t test_vfsgnj_vf_f64m2_m(vbool32_t mask, vfloat64m2_t op1, double op2, size_t vl) { + return __riscv_vfsgnj_vf_f64m2_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnj_vv_f64m4_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnj.mask.nxv4f64.nxv4f64.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m4_t test_vfsgnj_vv_f64m4_m(vbool16_t mask, vfloat64m4_t op1, vfloat64m4_t op2, size_t vl) { + return __riscv_vfsgnj_vv_f64m4_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnj_vf_f64m4_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], double noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnj.mask.nxv4f64.f64.i64( poison, [[OP1]], double [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m4_t test_vfsgnj_vf_f64m4_m(vbool16_t mask, vfloat64m4_t op1, double op2, size_t vl) { + return __riscv_vfsgnj_vf_f64m4_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnj_vv_f64m8_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnj.mask.nxv8f64.nxv8f64.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m8_t test_vfsgnj_vv_f64m8_m(vbool8_t mask, vfloat64m8_t op1, vfloat64m8_t op2, size_t vl) { + return __riscv_vfsgnj_vv_f64m8_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnj_vf_f64m8_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], double noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnj.mask.nxv8f64.f64.i64( poison, [[OP1]], double [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m8_t test_vfsgnj_vf_f64m8_m(vbool8_t mask, vfloat64m8_t op1, double op2, size_t vl) { + return __riscv_vfsgnj_vf_f64m8_m(mask, op1, op2, vl); +} + diff --git a/clang/test/CodeGen/RISCV/rvv0p71-intrinsics-handcrafted/vector-floating/wrappers/vfsgnjn.c b/clang/test/CodeGen/RISCV/rvv0p71-intrinsics-handcrafted/vector-floating/wrappers/vfsgnjn.c new file mode 100644 index 00000000000000..3cf366024df9db --- /dev/null +++ b/clang/test/CodeGen/RISCV/rvv0p71-intrinsics-handcrafted/vector-floating/wrappers/vfsgnjn.c @@ -0,0 +1,489 @@ +// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 2 +// REQUIRES: riscv-registered-target +// RUN: %clang_cc1 -triple riscv64 -target-feature +xtheadvector \ +// RUN: -target-feature +d -disable-O0-optnone \ +// RUN: -emit-llvm %s -o - | opt -S -passes=mem2reg | \ +// RUN: FileCheck --check-prefix=CHECK-RV64 %s + +#include + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjn_vv_f16m1 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0:[0-9]+]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.nxv4f16.nxv4f16.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m1_t test_vfsgnjn_vv_f16m1(vfloat16m1_t op1, vfloat16m1_t op2, size_t vl) { + return __riscv_vfsgnjn_vv_f16m1(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjn_vf_f16m1 +// CHECK-RV64-SAME: ( [[OP1:%.*]], half noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.nxv4f16.f16.i64( poison, [[OP1]], half [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m1_t test_vfsgnjn_vf_f16m1(vfloat16m1_t op1, _Float16 op2, size_t vl) { + return __riscv_vfsgnjn_vf_f16m1(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjn_vv_f16m2 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.nxv8f16.nxv8f16.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m2_t test_vfsgnjn_vv_f16m2(vfloat16m2_t op1, vfloat16m2_t op2, size_t vl) { + return __riscv_vfsgnjn_vv_f16m2(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjn_vf_f16m2 +// CHECK-RV64-SAME: ( [[OP1:%.*]], half noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.nxv8f16.f16.i64( poison, [[OP1]], half [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m2_t test_vfsgnjn_vf_f16m2(vfloat16m2_t op1, _Float16 op2, size_t vl) { + return __riscv_vfsgnjn_vf_f16m2(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjn_vv_f16m4 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.nxv16f16.nxv16f16.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m4_t test_vfsgnjn_vv_f16m4(vfloat16m4_t op1, vfloat16m4_t op2, size_t vl) { + return __riscv_vfsgnjn_vv_f16m4(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjn_vf_f16m4 +// CHECK-RV64-SAME: ( [[OP1:%.*]], half noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.nxv16f16.f16.i64( poison, [[OP1]], half [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m4_t test_vfsgnjn_vf_f16m4(vfloat16m4_t op1, _Float16 op2, size_t vl) { + return __riscv_vfsgnjn_vf_f16m4(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjn_vv_f16m8 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.nxv32f16.nxv32f16.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m8_t test_vfsgnjn_vv_f16m8(vfloat16m8_t op1, vfloat16m8_t op2, size_t vl) { + return __riscv_vfsgnjn_vv_f16m8(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjn_vf_f16m8 +// CHECK-RV64-SAME: ( [[OP1:%.*]], half noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.nxv32f16.f16.i64( poison, [[OP1]], half [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m8_t test_vfsgnjn_vf_f16m8(vfloat16m8_t op1, _Float16 op2, size_t vl) { + return __riscv_vfsgnjn_vf_f16m8(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjn_vv_f32m1 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.nxv2f32.nxv2f32.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m1_t test_vfsgnjn_vv_f32m1(vfloat32m1_t op1, vfloat32m1_t op2, size_t vl) { + return __riscv_vfsgnjn_vv_f32m1(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjn_vf_f32m1 +// CHECK-RV64-SAME: ( [[OP1:%.*]], float noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.nxv2f32.f32.i64( poison, [[OP1]], float [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m1_t test_vfsgnjn_vf_f32m1(vfloat32m1_t op1, float op2, size_t vl) { + return __riscv_vfsgnjn_vf_f32m1(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjn_vv_f32m2 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.nxv4f32.nxv4f32.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m2_t test_vfsgnjn_vv_f32m2(vfloat32m2_t op1, vfloat32m2_t op2, size_t vl) { + return __riscv_vfsgnjn_vv_f32m2(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjn_vf_f32m2 +// CHECK-RV64-SAME: ( [[OP1:%.*]], float noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.nxv4f32.f32.i64( poison, [[OP1]], float [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m2_t test_vfsgnjn_vf_f32m2(vfloat32m2_t op1, float op2, size_t vl) { + return __riscv_vfsgnjn_vf_f32m2(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjn_vv_f32m4 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.nxv8f32.nxv8f32.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m4_t test_vfsgnjn_vv_f32m4(vfloat32m4_t op1, vfloat32m4_t op2, size_t vl) { + return __riscv_vfsgnjn_vv_f32m4(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjn_vf_f32m4 +// CHECK-RV64-SAME: ( [[OP1:%.*]], float noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.nxv8f32.f32.i64( poison, [[OP1]], float [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m4_t test_vfsgnjn_vf_f32m4(vfloat32m4_t op1, float op2, size_t vl) { + return __riscv_vfsgnjn_vf_f32m4(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjn_vv_f32m8 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.nxv16f32.nxv16f32.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m8_t test_vfsgnjn_vv_f32m8(vfloat32m8_t op1, vfloat32m8_t op2, size_t vl) { + return __riscv_vfsgnjn_vv_f32m8(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjn_vf_f32m8 +// CHECK-RV64-SAME: ( [[OP1:%.*]], float noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.nxv16f32.f32.i64( poison, [[OP1]], float [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m8_t test_vfsgnjn_vf_f32m8(vfloat32m8_t op1, float op2, size_t vl) { + return __riscv_vfsgnjn_vf_f32m8(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjn_vv_f64m1 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.nxv1f64.nxv1f64.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m1_t test_vfsgnjn_vv_f64m1(vfloat64m1_t op1, vfloat64m1_t op2, size_t vl) { + return __riscv_vfsgnjn_vv_f64m1(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjn_vf_f64m1 +// CHECK-RV64-SAME: ( [[OP1:%.*]], double noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.nxv1f64.f64.i64( poison, [[OP1]], double [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m1_t test_vfsgnjn_vf_f64m1(vfloat64m1_t op1, double op2, size_t vl) { + return __riscv_vfsgnjn_vf_f64m1(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjn_vv_f64m2 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.nxv2f64.nxv2f64.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m2_t test_vfsgnjn_vv_f64m2(vfloat64m2_t op1, vfloat64m2_t op2, size_t vl) { + return __riscv_vfsgnjn_vv_f64m2(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjn_vf_f64m2 +// CHECK-RV64-SAME: ( [[OP1:%.*]], double noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.nxv2f64.f64.i64( poison, [[OP1]], double [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m2_t test_vfsgnjn_vf_f64m2(vfloat64m2_t op1, double op2, size_t vl) { + return __riscv_vfsgnjn_vf_f64m2(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjn_vv_f64m4 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.nxv4f64.nxv4f64.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m4_t test_vfsgnjn_vv_f64m4(vfloat64m4_t op1, vfloat64m4_t op2, size_t vl) { + return __riscv_vfsgnjn_vv_f64m4(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjn_vf_f64m4 +// CHECK-RV64-SAME: ( [[OP1:%.*]], double noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.nxv4f64.f64.i64( poison, [[OP1]], double [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m4_t test_vfsgnjn_vf_f64m4(vfloat64m4_t op1, double op2, size_t vl) { + return __riscv_vfsgnjn_vf_f64m4(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjn_vv_f64m8 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.nxv8f64.nxv8f64.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m8_t test_vfsgnjn_vv_f64m8(vfloat64m8_t op1, vfloat64m8_t op2, size_t vl) { + return __riscv_vfsgnjn_vv_f64m8(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjn_vf_f64m8 +// CHECK-RV64-SAME: ( [[OP1:%.*]], double noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.nxv8f64.f64.i64( poison, [[OP1]], double [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m8_t test_vfsgnjn_vf_f64m8(vfloat64m8_t op1, double op2, size_t vl) { + return __riscv_vfsgnjn_vf_f64m8(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjn_vv_f16m1_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.mask.nxv4f16.nxv4f16.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m1_t test_vfsgnjn_vv_f16m1_m(vbool16_t mask, vfloat16m1_t op1, vfloat16m1_t op2, size_t vl) { + return __riscv_vfsgnjn_vv_f16m1_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjn_vf_f16m1_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], half noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.mask.nxv4f16.f16.i64( poison, [[OP1]], half [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m1_t test_vfsgnjn_vf_f16m1_m(vbool16_t mask, vfloat16m1_t op1, _Float16 op2, size_t vl) { + return __riscv_vfsgnjn_vf_f16m1_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjn_vv_f16m2_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.mask.nxv8f16.nxv8f16.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m2_t test_vfsgnjn_vv_f16m2_m(vbool8_t mask, vfloat16m2_t op1, vfloat16m2_t op2, size_t vl) { + return __riscv_vfsgnjn_vv_f16m2_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjn_vf_f16m2_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], half noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.mask.nxv8f16.f16.i64( poison, [[OP1]], half [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m2_t test_vfsgnjn_vf_f16m2_m(vbool8_t mask, vfloat16m2_t op1, _Float16 op2, size_t vl) { + return __riscv_vfsgnjn_vf_f16m2_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjn_vv_f16m4_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.mask.nxv16f16.nxv16f16.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m4_t test_vfsgnjn_vv_f16m4_m(vbool4_t mask, vfloat16m4_t op1, vfloat16m4_t op2, size_t vl) { + return __riscv_vfsgnjn_vv_f16m4_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjn_vf_f16m4_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], half noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.mask.nxv16f16.f16.i64( poison, [[OP1]], half [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m4_t test_vfsgnjn_vf_f16m4_m(vbool4_t mask, vfloat16m4_t op1, _Float16 op2, size_t vl) { + return __riscv_vfsgnjn_vf_f16m4_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjn_vv_f16m8_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.mask.nxv32f16.nxv32f16.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m8_t test_vfsgnjn_vv_f16m8_m(vbool2_t mask, vfloat16m8_t op1, vfloat16m8_t op2, size_t vl) { + return __riscv_vfsgnjn_vv_f16m8_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjn_vf_f16m8_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], half noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.mask.nxv32f16.f16.i64( poison, [[OP1]], half [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m8_t test_vfsgnjn_vf_f16m8_m(vbool2_t mask, vfloat16m8_t op1, _Float16 op2, size_t vl) { + return __riscv_vfsgnjn_vf_f16m8_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjn_vv_f32m1_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.mask.nxv2f32.nxv2f32.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m1_t test_vfsgnjn_vv_f32m1_m(vbool32_t mask, vfloat32m1_t op1, vfloat32m1_t op2, size_t vl) { + return __riscv_vfsgnjn_vv_f32m1_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjn_vf_f32m1_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], float noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.mask.nxv2f32.f32.i64( poison, [[OP1]], float [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m1_t test_vfsgnjn_vf_f32m1_m(vbool32_t mask, vfloat32m1_t op1, float op2, size_t vl) { + return __riscv_vfsgnjn_vf_f32m1_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjn_vv_f32m2_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.mask.nxv4f32.nxv4f32.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m2_t test_vfsgnjn_vv_f32m2_m(vbool16_t mask, vfloat32m2_t op1, vfloat32m2_t op2, size_t vl) { + return __riscv_vfsgnjn_vv_f32m2_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjn_vf_f32m2_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], float noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.mask.nxv4f32.f32.i64( poison, [[OP1]], float [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m2_t test_vfsgnjn_vf_f32m2_m(vbool16_t mask, vfloat32m2_t op1, float op2, size_t vl) { + return __riscv_vfsgnjn_vf_f32m2_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjn_vv_f32m4_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.mask.nxv8f32.nxv8f32.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m4_t test_vfsgnjn_vv_f32m4_m(vbool8_t mask, vfloat32m4_t op1, vfloat32m4_t op2, size_t vl) { + return __riscv_vfsgnjn_vv_f32m4_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjn_vf_f32m4_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], float noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.mask.nxv8f32.f32.i64( poison, [[OP1]], float [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m4_t test_vfsgnjn_vf_f32m4_m(vbool8_t mask, vfloat32m4_t op1, float op2, size_t vl) { + return __riscv_vfsgnjn_vf_f32m4_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjn_vv_f32m8_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.mask.nxv16f32.nxv16f32.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m8_t test_vfsgnjn_vv_f32m8_m(vbool4_t mask, vfloat32m8_t op1, vfloat32m8_t op2, size_t vl) { + return __riscv_vfsgnjn_vv_f32m8_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjn_vf_f32m8_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], float noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.mask.nxv16f32.f32.i64( poison, [[OP1]], float [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m8_t test_vfsgnjn_vf_f32m8_m(vbool4_t mask, vfloat32m8_t op1, float op2, size_t vl) { + return __riscv_vfsgnjn_vf_f32m8_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjn_vv_f64m1_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.mask.nxv1f64.nxv1f64.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m1_t test_vfsgnjn_vv_f64m1_m(vbool64_t mask, vfloat64m1_t op1, vfloat64m1_t op2, size_t vl) { + return __riscv_vfsgnjn_vv_f64m1_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjn_vf_f64m1_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], double noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.mask.nxv1f64.f64.i64( poison, [[OP1]], double [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m1_t test_vfsgnjn_vf_f64m1_m(vbool64_t mask, vfloat64m1_t op1, double op2, size_t vl) { + return __riscv_vfsgnjn_vf_f64m1_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjn_vv_f64m2_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.mask.nxv2f64.nxv2f64.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m2_t test_vfsgnjn_vv_f64m2_m(vbool32_t mask, vfloat64m2_t op1, vfloat64m2_t op2, size_t vl) { + return __riscv_vfsgnjn_vv_f64m2_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjn_vf_f64m2_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], double noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.mask.nxv2f64.f64.i64( poison, [[OP1]], double [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m2_t test_vfsgnjn_vf_f64m2_m(vbool32_t mask, vfloat64m2_t op1, double op2, size_t vl) { + return __riscv_vfsgnjn_vf_f64m2_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjn_vv_f64m4_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.mask.nxv4f64.nxv4f64.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m4_t test_vfsgnjn_vv_f64m4_m(vbool16_t mask, vfloat64m4_t op1, vfloat64m4_t op2, size_t vl) { + return __riscv_vfsgnjn_vv_f64m4_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjn_vf_f64m4_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], double noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.mask.nxv4f64.f64.i64( poison, [[OP1]], double [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m4_t test_vfsgnjn_vf_f64m4_m(vbool16_t mask, vfloat64m4_t op1, double op2, size_t vl) { + return __riscv_vfsgnjn_vf_f64m4_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjn_vv_f64m8_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.mask.nxv8f64.nxv8f64.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m8_t test_vfsgnjn_vv_f64m8_m(vbool8_t mask, vfloat64m8_t op1, vfloat64m8_t op2, size_t vl) { + return __riscv_vfsgnjn_vv_f64m8_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjn_vf_f64m8_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], double noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjn.mask.nxv8f64.f64.i64( poison, [[OP1]], double [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m8_t test_vfsgnjn_vf_f64m8_m(vbool8_t mask, vfloat64m8_t op1, double op2, size_t vl) { + return __riscv_vfsgnjn_vf_f64m8_m(mask, op1, op2, vl); +} + diff --git a/clang/test/CodeGen/RISCV/rvv0p71-intrinsics-handcrafted/vector-floating/wrappers/vfsgnjx.c b/clang/test/CodeGen/RISCV/rvv0p71-intrinsics-handcrafted/vector-floating/wrappers/vfsgnjx.c new file mode 100644 index 00000000000000..adb3fc5fba7e34 --- /dev/null +++ b/clang/test/CodeGen/RISCV/rvv0p71-intrinsics-handcrafted/vector-floating/wrappers/vfsgnjx.c @@ -0,0 +1,489 @@ +// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 2 +// REQUIRES: riscv-registered-target +// RUN: %clang_cc1 -triple riscv64 -target-feature +xtheadvector \ +// RUN: -target-feature +d -disable-O0-optnone \ +// RUN: -emit-llvm %s -o - | opt -S -passes=mem2reg | \ +// RUN: FileCheck --check-prefix=CHECK-RV64 %s + +#include + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjx_vv_f16m1 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0:[0-9]+]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.nxv4f16.nxv4f16.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m1_t test_vfsgnjx_vv_f16m1(vfloat16m1_t op1, vfloat16m1_t op2, size_t vl) { + return __riscv_vfsgnjx_vv_f16m1(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjx_vf_f16m1 +// CHECK-RV64-SAME: ( [[OP1:%.*]], half noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.nxv4f16.f16.i64( poison, [[OP1]], half [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m1_t test_vfsgnjx_vf_f16m1(vfloat16m1_t op1, _Float16 op2, size_t vl) { + return __riscv_vfsgnjx_vf_f16m1(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjx_vv_f16m2 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.nxv8f16.nxv8f16.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m2_t test_vfsgnjx_vv_f16m2(vfloat16m2_t op1, vfloat16m2_t op2, size_t vl) { + return __riscv_vfsgnjx_vv_f16m2(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjx_vf_f16m2 +// CHECK-RV64-SAME: ( [[OP1:%.*]], half noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.nxv8f16.f16.i64( poison, [[OP1]], half [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m2_t test_vfsgnjx_vf_f16m2(vfloat16m2_t op1, _Float16 op2, size_t vl) { + return __riscv_vfsgnjx_vf_f16m2(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjx_vv_f16m4 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.nxv16f16.nxv16f16.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m4_t test_vfsgnjx_vv_f16m4(vfloat16m4_t op1, vfloat16m4_t op2, size_t vl) { + return __riscv_vfsgnjx_vv_f16m4(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjx_vf_f16m4 +// CHECK-RV64-SAME: ( [[OP1:%.*]], half noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.nxv16f16.f16.i64( poison, [[OP1]], half [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m4_t test_vfsgnjx_vf_f16m4(vfloat16m4_t op1, _Float16 op2, size_t vl) { + return __riscv_vfsgnjx_vf_f16m4(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjx_vv_f16m8 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.nxv32f16.nxv32f16.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m8_t test_vfsgnjx_vv_f16m8(vfloat16m8_t op1, vfloat16m8_t op2, size_t vl) { + return __riscv_vfsgnjx_vv_f16m8(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjx_vf_f16m8 +// CHECK-RV64-SAME: ( [[OP1:%.*]], half noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.nxv32f16.f16.i64( poison, [[OP1]], half [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m8_t test_vfsgnjx_vf_f16m8(vfloat16m8_t op1, _Float16 op2, size_t vl) { + return __riscv_vfsgnjx_vf_f16m8(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjx_vv_f32m1 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.nxv2f32.nxv2f32.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m1_t test_vfsgnjx_vv_f32m1(vfloat32m1_t op1, vfloat32m1_t op2, size_t vl) { + return __riscv_vfsgnjx_vv_f32m1(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjx_vf_f32m1 +// CHECK-RV64-SAME: ( [[OP1:%.*]], float noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.nxv2f32.f32.i64( poison, [[OP1]], float [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m1_t test_vfsgnjx_vf_f32m1(vfloat32m1_t op1, float op2, size_t vl) { + return __riscv_vfsgnjx_vf_f32m1(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjx_vv_f32m2 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.nxv4f32.nxv4f32.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m2_t test_vfsgnjx_vv_f32m2(vfloat32m2_t op1, vfloat32m2_t op2, size_t vl) { + return __riscv_vfsgnjx_vv_f32m2(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjx_vf_f32m2 +// CHECK-RV64-SAME: ( [[OP1:%.*]], float noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.nxv4f32.f32.i64( poison, [[OP1]], float [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m2_t test_vfsgnjx_vf_f32m2(vfloat32m2_t op1, float op2, size_t vl) { + return __riscv_vfsgnjx_vf_f32m2(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjx_vv_f32m4 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.nxv8f32.nxv8f32.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m4_t test_vfsgnjx_vv_f32m4(vfloat32m4_t op1, vfloat32m4_t op2, size_t vl) { + return __riscv_vfsgnjx_vv_f32m4(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjx_vf_f32m4 +// CHECK-RV64-SAME: ( [[OP1:%.*]], float noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.nxv8f32.f32.i64( poison, [[OP1]], float [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m4_t test_vfsgnjx_vf_f32m4(vfloat32m4_t op1, float op2, size_t vl) { + return __riscv_vfsgnjx_vf_f32m4(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjx_vv_f32m8 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.nxv16f32.nxv16f32.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m8_t test_vfsgnjx_vv_f32m8(vfloat32m8_t op1, vfloat32m8_t op2, size_t vl) { + return __riscv_vfsgnjx_vv_f32m8(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjx_vf_f32m8 +// CHECK-RV64-SAME: ( [[OP1:%.*]], float noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.nxv16f32.f32.i64( poison, [[OP1]], float [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m8_t test_vfsgnjx_vf_f32m8(vfloat32m8_t op1, float op2, size_t vl) { + return __riscv_vfsgnjx_vf_f32m8(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjx_vv_f64m1 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.nxv1f64.nxv1f64.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m1_t test_vfsgnjx_vv_f64m1(vfloat64m1_t op1, vfloat64m1_t op2, size_t vl) { + return __riscv_vfsgnjx_vv_f64m1(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjx_vf_f64m1 +// CHECK-RV64-SAME: ( [[OP1:%.*]], double noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.nxv1f64.f64.i64( poison, [[OP1]], double [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m1_t test_vfsgnjx_vf_f64m1(vfloat64m1_t op1, double op2, size_t vl) { + return __riscv_vfsgnjx_vf_f64m1(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjx_vv_f64m2 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.nxv2f64.nxv2f64.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m2_t test_vfsgnjx_vv_f64m2(vfloat64m2_t op1, vfloat64m2_t op2, size_t vl) { + return __riscv_vfsgnjx_vv_f64m2(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjx_vf_f64m2 +// CHECK-RV64-SAME: ( [[OP1:%.*]], double noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.nxv2f64.f64.i64( poison, [[OP1]], double [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m2_t test_vfsgnjx_vf_f64m2(vfloat64m2_t op1, double op2, size_t vl) { + return __riscv_vfsgnjx_vf_f64m2(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjx_vv_f64m4 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.nxv4f64.nxv4f64.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m4_t test_vfsgnjx_vv_f64m4(vfloat64m4_t op1, vfloat64m4_t op2, size_t vl) { + return __riscv_vfsgnjx_vv_f64m4(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjx_vf_f64m4 +// CHECK-RV64-SAME: ( [[OP1:%.*]], double noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.nxv4f64.f64.i64( poison, [[OP1]], double [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m4_t test_vfsgnjx_vf_f64m4(vfloat64m4_t op1, double op2, size_t vl) { + return __riscv_vfsgnjx_vf_f64m4(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjx_vv_f64m8 +// CHECK-RV64-SAME: ( [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.nxv8f64.nxv8f64.i64( poison, [[OP1]], [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m8_t test_vfsgnjx_vv_f64m8(vfloat64m8_t op1, vfloat64m8_t op2, size_t vl) { + return __riscv_vfsgnjx_vv_f64m8(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjx_vf_f64m8 +// CHECK-RV64-SAME: ( [[OP1:%.*]], double noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.nxv8f64.f64.i64( poison, [[OP1]], double [[OP2]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m8_t test_vfsgnjx_vf_f64m8(vfloat64m8_t op1, double op2, size_t vl) { + return __riscv_vfsgnjx_vf_f64m8(op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjx_vv_f16m1_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.mask.nxv4f16.nxv4f16.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m1_t test_vfsgnjx_vv_f16m1_m(vbool16_t mask, vfloat16m1_t op1, vfloat16m1_t op2, size_t vl) { + return __riscv_vfsgnjx_vv_f16m1_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjx_vf_f16m1_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], half noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.mask.nxv4f16.f16.i64( poison, [[OP1]], half [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m1_t test_vfsgnjx_vf_f16m1_m(vbool16_t mask, vfloat16m1_t op1, _Float16 op2, size_t vl) { + return __riscv_vfsgnjx_vf_f16m1_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjx_vv_f16m2_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.mask.nxv8f16.nxv8f16.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m2_t test_vfsgnjx_vv_f16m2_m(vbool8_t mask, vfloat16m2_t op1, vfloat16m2_t op2, size_t vl) { + return __riscv_vfsgnjx_vv_f16m2_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjx_vf_f16m2_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], half noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.mask.nxv8f16.f16.i64( poison, [[OP1]], half [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m2_t test_vfsgnjx_vf_f16m2_m(vbool8_t mask, vfloat16m2_t op1, _Float16 op2, size_t vl) { + return __riscv_vfsgnjx_vf_f16m2_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjx_vv_f16m4_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.mask.nxv16f16.nxv16f16.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m4_t test_vfsgnjx_vv_f16m4_m(vbool4_t mask, vfloat16m4_t op1, vfloat16m4_t op2, size_t vl) { + return __riscv_vfsgnjx_vv_f16m4_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjx_vf_f16m4_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], half noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.mask.nxv16f16.f16.i64( poison, [[OP1]], half [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m4_t test_vfsgnjx_vf_f16m4_m(vbool4_t mask, vfloat16m4_t op1, _Float16 op2, size_t vl) { + return __riscv_vfsgnjx_vf_f16m4_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjx_vv_f16m8_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.mask.nxv32f16.nxv32f16.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m8_t test_vfsgnjx_vv_f16m8_m(vbool2_t mask, vfloat16m8_t op1, vfloat16m8_t op2, size_t vl) { + return __riscv_vfsgnjx_vv_f16m8_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjx_vf_f16m8_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], half noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.mask.nxv32f16.f16.i64( poison, [[OP1]], half [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m8_t test_vfsgnjx_vf_f16m8_m(vbool2_t mask, vfloat16m8_t op1, _Float16 op2, size_t vl) { + return __riscv_vfsgnjx_vf_f16m8_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjx_vv_f32m1_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.mask.nxv2f32.nxv2f32.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m1_t test_vfsgnjx_vv_f32m1_m(vbool32_t mask, vfloat32m1_t op1, vfloat32m1_t op2, size_t vl) { + return __riscv_vfsgnjx_vv_f32m1_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjx_vf_f32m1_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], float noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.mask.nxv2f32.f32.i64( poison, [[OP1]], float [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m1_t test_vfsgnjx_vf_f32m1_m(vbool32_t mask, vfloat32m1_t op1, float op2, size_t vl) { + return __riscv_vfsgnjx_vf_f32m1_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjx_vv_f32m2_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.mask.nxv4f32.nxv4f32.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m2_t test_vfsgnjx_vv_f32m2_m(vbool16_t mask, vfloat32m2_t op1, vfloat32m2_t op2, size_t vl) { + return __riscv_vfsgnjx_vv_f32m2_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjx_vf_f32m2_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], float noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.mask.nxv4f32.f32.i64( poison, [[OP1]], float [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m2_t test_vfsgnjx_vf_f32m2_m(vbool16_t mask, vfloat32m2_t op1, float op2, size_t vl) { + return __riscv_vfsgnjx_vf_f32m2_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjx_vv_f32m4_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.mask.nxv8f32.nxv8f32.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m4_t test_vfsgnjx_vv_f32m4_m(vbool8_t mask, vfloat32m4_t op1, vfloat32m4_t op2, size_t vl) { + return __riscv_vfsgnjx_vv_f32m4_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjx_vf_f32m4_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], float noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.mask.nxv8f32.f32.i64( poison, [[OP1]], float [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m4_t test_vfsgnjx_vf_f32m4_m(vbool8_t mask, vfloat32m4_t op1, float op2, size_t vl) { + return __riscv_vfsgnjx_vf_f32m4_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjx_vv_f32m8_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.mask.nxv16f32.nxv16f32.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m8_t test_vfsgnjx_vv_f32m8_m(vbool4_t mask, vfloat32m8_t op1, vfloat32m8_t op2, size_t vl) { + return __riscv_vfsgnjx_vv_f32m8_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjx_vf_f32m8_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], float noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.mask.nxv16f32.f32.i64( poison, [[OP1]], float [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m8_t test_vfsgnjx_vf_f32m8_m(vbool4_t mask, vfloat32m8_t op1, float op2, size_t vl) { + return __riscv_vfsgnjx_vf_f32m8_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjx_vv_f64m1_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.mask.nxv1f64.nxv1f64.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m1_t test_vfsgnjx_vv_f64m1_m(vbool64_t mask, vfloat64m1_t op1, vfloat64m1_t op2, size_t vl) { + return __riscv_vfsgnjx_vv_f64m1_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjx_vf_f64m1_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], double noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.mask.nxv1f64.f64.i64( poison, [[OP1]], double [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m1_t test_vfsgnjx_vf_f64m1_m(vbool64_t mask, vfloat64m1_t op1, double op2, size_t vl) { + return __riscv_vfsgnjx_vf_f64m1_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjx_vv_f64m2_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.mask.nxv2f64.nxv2f64.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m2_t test_vfsgnjx_vv_f64m2_m(vbool32_t mask, vfloat64m2_t op1, vfloat64m2_t op2, size_t vl) { + return __riscv_vfsgnjx_vv_f64m2_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjx_vf_f64m2_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], double noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.mask.nxv2f64.f64.i64( poison, [[OP1]], double [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m2_t test_vfsgnjx_vf_f64m2_m(vbool32_t mask, vfloat64m2_t op1, double op2, size_t vl) { + return __riscv_vfsgnjx_vf_f64m2_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjx_vv_f64m4_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.mask.nxv4f64.nxv4f64.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m4_t test_vfsgnjx_vv_f64m4_m(vbool16_t mask, vfloat64m4_t op1, vfloat64m4_t op2, size_t vl) { + return __riscv_vfsgnjx_vv_f64m4_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjx_vf_f64m4_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], double noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.mask.nxv4f64.f64.i64( poison, [[OP1]], double [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m4_t test_vfsgnjx_vf_f64m4_m(vbool16_t mask, vfloat64m4_t op1, double op2, size_t vl) { + return __riscv_vfsgnjx_vf_f64m4_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjx_vv_f64m8_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.mask.nxv8f64.nxv8f64.i64( poison, [[OP1]], [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m8_t test_vfsgnjx_vv_f64m8_m(vbool8_t mask, vfloat64m8_t op1, vfloat64m8_t op2, size_t vl) { + return __riscv_vfsgnjx_vv_f64m8_m(mask, op1, op2, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsgnjx_vf_f64m8_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], double noundef [[OP2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsgnjx.mask.nxv8f64.f64.i64( poison, [[OP1]], double [[OP2]], [[MASK]], i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m8_t test_vfsgnjx_vf_f64m8_m(vbool8_t mask, vfloat64m8_t op1, double op2, size_t vl) { + return __riscv_vfsgnjx_vf_f64m8_m(mask, op1, op2, vl); +} + diff --git a/clang/test/CodeGen/RISCV/rvv0p71-intrinsics-handcrafted/vector-floating/wrappers/vfsqrt.c b/clang/test/CodeGen/RISCV/rvv0p71-intrinsics-handcrafted/vector-floating/wrappers/vfsqrt.c new file mode 100644 index 00000000000000..a24db296850b8e --- /dev/null +++ b/clang/test/CodeGen/RISCV/rvv0p71-intrinsics-handcrafted/vector-floating/wrappers/vfsqrt.c @@ -0,0 +1,248 @@ +// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 2 +// REQUIRES: riscv-registered-target +// RUN: %clang_cc1 -triple riscv64 -target-feature +xtheadvector \ +// RUN: -target-feature +d -disable-O0-optnone \ +// RUN: -emit-llvm %s -o - | opt -S -passes=mem2reg | \ +// RUN: FileCheck --check-prefix=CHECK-RV64 %s + +#include + +// CHECK-RV64-LABEL: define dso_local @test_vfsqrt_v_f16m1 +// CHECK-RV64-SAME: ( [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0:[0-9]+]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsqrt.nxv4f16.i64( poison, [[OP1]], i64 7, i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m1_t test_vfsqrt_v_f16m1(vfloat16m1_t op1, size_t vl) { + return __riscv_vfsqrt_v_f16m1(op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsqrt_v_f16m2 +// CHECK-RV64-SAME: ( [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsqrt.nxv8f16.i64( poison, [[OP1]], i64 7, i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m2_t test_vfsqrt_v_f16m2(vfloat16m2_t op1, size_t vl) { + return __riscv_vfsqrt_v_f16m2(op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsqrt_v_f16m4 +// CHECK-RV64-SAME: ( [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsqrt.nxv16f16.i64( poison, [[OP1]], i64 7, i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m4_t test_vfsqrt_v_f16m4(vfloat16m4_t op1, size_t vl) { + return __riscv_vfsqrt_v_f16m4(op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsqrt_v_f16m8 +// CHECK-RV64-SAME: ( [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsqrt.nxv32f16.i64( poison, [[OP1]], i64 7, i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m8_t test_vfsqrt_v_f16m8(vfloat16m8_t op1, size_t vl) { + return __riscv_vfsqrt_v_f16m8(op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsqrt_v_f32m1 +// CHECK-RV64-SAME: ( [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsqrt.nxv2f32.i64( poison, [[OP1]], i64 7, i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m1_t test_vfsqrt_v_f32m1(vfloat32m1_t op1, size_t vl) { + return __riscv_vfsqrt_v_f32m1(op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsqrt_v_f32m2 +// CHECK-RV64-SAME: ( [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsqrt.nxv4f32.i64( poison, [[OP1]], i64 7, i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m2_t test_vfsqrt_v_f32m2(vfloat32m2_t op1, size_t vl) { + return __riscv_vfsqrt_v_f32m2(op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsqrt_v_f32m4 +// CHECK-RV64-SAME: ( [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsqrt.nxv8f32.i64( poison, [[OP1]], i64 7, i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m4_t test_vfsqrt_v_f32m4(vfloat32m4_t op1, size_t vl) { + return __riscv_vfsqrt_v_f32m4(op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsqrt_v_f32m8 +// CHECK-RV64-SAME: ( [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsqrt.nxv16f32.i64( poison, [[OP1]], i64 7, i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m8_t test_vfsqrt_v_f32m8(vfloat32m8_t op1, size_t vl) { + return __riscv_vfsqrt_v_f32m8(op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsqrt_v_f64m1 +// CHECK-RV64-SAME: ( [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsqrt.nxv1f64.i64( poison, [[OP1]], i64 7, i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m1_t test_vfsqrt_v_f64m1(vfloat64m1_t op1, size_t vl) { + return __riscv_vfsqrt_v_f64m1(op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsqrt_v_f64m2 +// CHECK-RV64-SAME: ( [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsqrt.nxv2f64.i64( poison, [[OP1]], i64 7, i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m2_t test_vfsqrt_v_f64m2(vfloat64m2_t op1, size_t vl) { + return __riscv_vfsqrt_v_f64m2(op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsqrt_v_f64m4 +// CHECK-RV64-SAME: ( [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsqrt.nxv4f64.i64( poison, [[OP1]], i64 7, i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m4_t test_vfsqrt_v_f64m4(vfloat64m4_t op1, size_t vl) { + return __riscv_vfsqrt_v_f64m4(op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsqrt_v_f64m8 +// CHECK-RV64-SAME: ( [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsqrt.nxv8f64.i64( poison, [[OP1]], i64 7, i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m8_t test_vfsqrt_v_f64m8(vfloat64m8_t op1, size_t vl) { + return __riscv_vfsqrt_v_f64m8(op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsqrt_v_f16m1_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsqrt.mask.nxv4f16.i64( poison, [[OP1]], [[MASK]], i64 7, i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m1_t test_vfsqrt_v_f16m1_m(vbool16_t mask, vfloat16m1_t op1, size_t vl) { + return __riscv_vfsqrt_v_f16m1_m(mask, op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsqrt_v_f16m2_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsqrt.mask.nxv8f16.i64( poison, [[OP1]], [[MASK]], i64 7, i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m2_t test_vfsqrt_v_f16m2_m(vbool8_t mask, vfloat16m2_t op1, size_t vl) { + return __riscv_vfsqrt_v_f16m2_m(mask, op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsqrt_v_f16m4_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsqrt.mask.nxv16f16.i64( poison, [[OP1]], [[MASK]], i64 7, i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m4_t test_vfsqrt_v_f16m4_m(vbool4_t mask, vfloat16m4_t op1, size_t vl) { + return __riscv_vfsqrt_v_f16m4_m(mask, op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsqrt_v_f16m8_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsqrt.mask.nxv32f16.i64( poison, [[OP1]], [[MASK]], i64 7, i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat16m8_t test_vfsqrt_v_f16m8_m(vbool2_t mask, vfloat16m8_t op1, size_t vl) { + return __riscv_vfsqrt_v_f16m8_m(mask, op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsqrt_v_f32m1_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsqrt.mask.nxv2f32.i64( poison, [[OP1]], [[MASK]], i64 7, i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m1_t test_vfsqrt_v_f32m1_m(vbool32_t mask, vfloat32m1_t op1, size_t vl) { + return __riscv_vfsqrt_v_f32m1_m(mask, op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsqrt_v_f32m2_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsqrt.mask.nxv4f32.i64( poison, [[OP1]], [[MASK]], i64 7, i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m2_t test_vfsqrt_v_f32m2_m(vbool16_t mask, vfloat32m2_t op1, size_t vl) { + return __riscv_vfsqrt_v_f32m2_m(mask, op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsqrt_v_f32m4_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsqrt.mask.nxv8f32.i64( poison, [[OP1]], [[MASK]], i64 7, i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m4_t test_vfsqrt_v_f32m4_m(vbool8_t mask, vfloat32m4_t op1, size_t vl) { + return __riscv_vfsqrt_v_f32m4_m(mask, op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsqrt_v_f32m8_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsqrt.mask.nxv16f32.i64( poison, [[OP1]], [[MASK]], i64 7, i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat32m8_t test_vfsqrt_v_f32m8_m(vbool4_t mask, vfloat32m8_t op1, size_t vl) { + return __riscv_vfsqrt_v_f32m8_m(mask, op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsqrt_v_f64m1_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsqrt.mask.nxv1f64.i64( poison, [[OP1]], [[MASK]], i64 7, i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m1_t test_vfsqrt_v_f64m1_m(vbool64_t mask, vfloat64m1_t op1, size_t vl) { + return __riscv_vfsqrt_v_f64m1_m(mask, op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsqrt_v_f64m2_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsqrt.mask.nxv2f64.i64( poison, [[OP1]], [[MASK]], i64 7, i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m2_t test_vfsqrt_v_f64m2_m(vbool32_t mask, vfloat64m2_t op1, size_t vl) { + return __riscv_vfsqrt_v_f64m2_m(mask, op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsqrt_v_f64m4_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsqrt.mask.nxv4f64.i64( poison, [[OP1]], [[MASK]], i64 7, i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m4_t test_vfsqrt_v_f64m4_m(vbool16_t mask, vfloat64m4_t op1, size_t vl) { + return __riscv_vfsqrt_v_f64m4_m(mask, op1, vl); +} + +// CHECK-RV64-LABEL: define dso_local @test_vfsqrt_v_f64m8_m +// CHECK-RV64-SAME: ( [[MASK:%.*]], [[OP1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] { +// CHECK-RV64-NEXT: entry: +// CHECK-RV64-NEXT: [[TMP0:%.*]] = call @llvm.riscv.th.vfsqrt.mask.nxv8f64.i64( poison, [[OP1]], [[MASK]], i64 7, i64 [[VL]]) +// CHECK-RV64-NEXT: ret [[TMP0]] +// +vfloat64m8_t test_vfsqrt_v_f64m8_m(vbool8_t mask, vfloat64m8_t op1, size_t vl) { + return __riscv_vfsqrt_v_f64m8_m(mask, op1, vl); +}