[clang] [llvm] [HLSL] Implementation of the fmod intrinsic (PR #108849)

Farzon Lotfi via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 16 09:47:22 PDT 2024


================
@@ -90,4 +90,5 @@ def int_dx_rsqrt  : DefaultAttrsIntrinsic<[llvm_anyfloat_ty], [LLVMMatchType<0>]
 def int_dx_wave_is_first_lane : DefaultAttrsIntrinsic<[llvm_i1_ty], [], [IntrConvergent]>;
 def int_dx_sign : DefaultAttrsIntrinsic<[LLVMScalarOrSameVectorWidth<0, llvm_i32_ty>], [llvm_any_ty]>;
 def int_dx_step : DefaultAttrsIntrinsic<[LLVMMatchType<0>], [llvm_anyfloat_ty, LLVMMatchType<0>]>;
+def int_dx_fmod : DefaultAttrsIntrinsic<[LLVMMatchType<0>], [llvm_anyfloat_ty, LLVMMatchType<0>]>;
----------------
farzonl wrote:

This isn't how i invisioned this see this: https://github.com/llvm/llvm-project/issues/99118#issuecomment-2294511442

We should use FREM
https://github.com/llvm/llvm-project/blob/f564a48f0ea4d2100c0cadfa6e6f20f97244025e/llvm/include/llvm/IR/IRBuilder.h#L1667-L1676

https://github.com/llvm/llvm-project/pull/108849


More information about the cfe-commits mailing list