[llvm] [NVPTX] Add intrinsics for new narrow FP conversions (PR #173954)

Srinivasa Ravi via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 19 03:18:00 PST 2026


Wolfram70 wrote:

> Why add these instead of just using [the new arbitrary fp conversion intrinsics](https://llvm.org/docs/LangRef.html#llvm-convert-to-arbitrary-fp-intrinsic)?

Thanks for taking a look at this, Matt!

Most of the conversions introduced in this PR require an additional `scale-factor` argument, which doesn’t fit into `llvm.convert.to.arbitrary.fp`. Because of that, it seemed appropriate to add NVPTX-specific intrinsics for this change. 

However, we’re also considering migrating some of our existing conversion intrinsics to the new arbitrary fp ones, wherever they fit cleanly. For NVPTX, many of these intrinsics also have `ftz` and `relu` variants. Moreover, not all combinations of {src/dst type, rounding mode, saturation, `relu`, `ftz`} are valid, so we’re trying to determine the best way to extend the new intrinsics while still providing the necessary error checking.

One option is to add `i1 relu` and `i1 ftz` directly as arguments to these new intrinsics. Another would be to introduce a small set of additional arbitrary-fp intrinsics with `_relu` and/or `_ftz` suffixes. Please let us know your thoughts.

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


More information about the llvm-commits mailing list