[llvm] [SelectionDAG] Add expansion for llvm.convert.from.arbitrary.fp (PR #179318)

Dmitry Sidorov via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 19 01:44:41 PST 2026


================
@@ -3495,6 +3495,249 @@ bool SelectionDAGLegalize::ExpandNode(SDNode *Node) {
     Results.push_back(Op);
     break;
   }
+  case ISD::CONVERT_FROM_ARBITRARY_FP: {
----------------
MrSidims wrote:

I will add target specific lowering as well for AMDGPU and SPIR-V backends in follow up patches. In SPIR-V there is a public multi-vendor extension [SPV_EXT_float8](https://github.com/KhronosGroup/SPIRV-Registry/blob/main/extensions/EXT/SPV_EXT_float8.asciidoc) that introduces fp8 <-> ieee float conversions. For AMDGPU I see quite a few entries in [VOP3Instructions.td](https://github.com/llvm/llvm-project/blob/ae402a32c0f8d31b348b54c6e99b621328a1d71a/llvm/lib/Target/AMDGPU/VOP3Instructions.td), but it requires me to do some research to see what intructions from there can be mapped to `llvm.convert.from.arbitrary.fp` and `llvm.convert.to.arbitrary.fp` (will be added in one of follow-up PRs) intrinsics.

Also I believe there are NVPTX capabilities for this and there is [SPV_INTEL_float4](https://github.com/intel/llvm/pull/20467) extension, but those will be covered by appropriate folks I guess.

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


More information about the llvm-commits mailing list