[clang] [llvm] [clang][NVPTX] Add support for mixed-precision FP arithmetic (PR #168359)
Srinivasa Ravi via llvm-commits
llvm-commits at lists.llvm.org
Wed Dec 3 08:56:06 PST 2025
================
@@ -1443,15 +1445,31 @@ let TargetPrefix = "nvvm" in {
// Add
//
let IntrProperties = [IntrNoMem, IntrSpeculatable, Commutative] in {
- foreach rnd = ["rn", "rz", "rm", "rp"] in {
- foreach ftz = ["", "_ftz"] in
- def int_nvvm_add_ # rnd # ftz # _f : NVVMBuiltin,
- DefaultAttrsIntrinsic<[llvm_float_ty], [llvm_float_ty, llvm_float_ty]>;
-
- def int_nvvm_add_ # rnd # _d : NVVMBuiltin,
+ foreach rnd = ["_rn", "_rz", "_rm", "_rp"] in {
+ foreach ftz = ["", "_ftz"] in {
+ foreach sat = ["", "_sat"] in {
+ def int_nvvm_add # rnd # ftz # sat # _f : NVVMBuiltin,
+ DefaultAttrsIntrinsic<[llvm_float_ty], [llvm_float_ty, llvm_float_ty]>;
+ } // sat
+ } // ftz
+ def int_nvvm_add # rnd # _d : NVVMBuiltin,
DefaultAttrsIntrinsic<[llvm_double_ty], [llvm_double_ty, llvm_double_ty]>;
- }
+ } // rnd
}
+
+ //
+ // Sub
+ //
+ foreach rnd = ["_rn", "_rz", "_rm", "_rp"] in {
+ foreach ftz = ["", "_ftz"] in {
+ foreach sat = ["", "_sat"] in {
+ def int_nvvm_sub # rnd # ftz # sat # _f : NVVMBuiltin,
----------------
Wolfram70 wrote:
Added a DAG combine to fold `fneg` with the `add` intrinsics to `sub` similar to https://github.com/llvm/llvm-project/pull/170079. Please take a look, thanks!
https://github.com/llvm/llvm-project/pull/168359
More information about the llvm-commits
mailing list