llvm
19e5dd34 - Implement extension SPV_KHR_float_controls2 (#3475)

Commit
16 days ago
Implement extension SPV_KHR_float_controls2 (#3475) First attempt at implementing [SPV_KHR_float_controls2](https://github.khronos.org/SPIRV-Registry/extensions/KHR/SPV_KHR_float_controls2.html). - When doing SPIRV->LLVM-IR, we first read the `ExecutionModeFPFastMathDefault` for every kernel, and if instructions in that kernel do not specify a particular `FPFastMathMode`, we use the kernel one. - `ExecutionModeFPFastMathDefault` is **not** propagated down to the callees. - According to [SPV_KHR_float_controls2#issues](https://github.khronos.org/SPIRV-Registry/extensions/KHR/SPV_KHR_float_controls2.html#_issues); we do not have an equivalent of LLVM's `afn` flag. If we map `fadd fast float %a, %b` to SPIRV and back, it becomes `fadd reassoc nnan ninf nsz arcp contract float %a, %b` losing the `afn` flag. - `ContractionOff` and `SignedZeroInfNanPreserve` are translated to a `ExecutionModeFPFastMathDefault` with all flags set to 0. Original commit: https://github.com/KhronosGroup/SPIRV-LLVM-Translator/commit/8dfdbae11aaf8ba
Author
Committer
Parents
Loading