llvm-project
ebcf025e - [SPIR-V] Implement SPV_KHR_float_controls2 (#146941)

Commit
1 day ago
[SPIR-V] Implement SPV_KHR_float_controls2 (#146941) Implementation of [SPV_KHR_float_controls2](https://github.khronos.org/SPIRV-Registry/extensions/KHR/SPV_KHR_float_controls2.html) extension, and corresponding tests. Some of the tests make use of `!spirv.ExecutionMode` LLVM named metadata. This is because some SPIR-V instructions don't have a direct equivalent in LLVM IR, so the SPIR-V Target uses different LLVM named metadata to convey the necessary information. Below, you will find an example from one of the newly added tests: ``` !spirv.ExecutionMode = !{!19, !20, !21, !22, !23, !24, !25, !26, !27} !19 = !{ptr @k_float_controls_float, i32 6028, float poison, i32 131079} !20 = !{ptr @k_float_controls_all, i32 6028, float poison, i32 131079} !21 = !{ptr @k_float_controls_float, i32 31} !22 = !{ptr @k_float_controls_all, i32 31} !23 = !{ptr @k_float_controls_float, i32 4461, i32 32} !24 = !{ptr @k_float_controls_all, i32 4461, i32 16} !25 = !{ptr @k_float_controls_all, i32 4461, i32 32} !26 = !{ptr @k_float_controls_all, i32 4461, i32 64} !27 = !{ptr @k_float_controls_all, i32 4461, i32 128} ``` `!spirv.ExecutionMode` contains a list of metadata nodes, and each of them specifies the required operands for expressing a particular `OpExecutionMode` instruction in SPIR-V. For example, `!19 = !{ptr @k_float_controls_float, i32 6028, float poison, i32 131079}` will be lowered to `OpExecutionMode [[k_float_controls_float_ID]] FPFastMathDefault [[float_type_ID]] 131079`. --------- Co-authored-by: Dmitry Sidorov <dmitry.sidorov@intel.com>
Author
Parents
Loading