-
Notifications
You must be signed in to change notification settings - Fork 844
[SPIR-V] fma emits GLSL.std.450 Fma instead of OpFmaKHR #8330
Copy link
Copy link
Open
Labels
bugBug, regression, crashBug, regression, crashneeds-triageAwaiting triageAwaiting triagespirvWork related to SPIR-VWork related to SPIR-V
Description
Description
When compiling the HLSL fma intrinsic to SPIR-V, DXC emits the GLSL.std.450 Fma instruction. According to the Vulkan spec, this instruction is not guaranteed to be implemented in hardware as a fused operation. HLSL's fma intrinsic specifically requires fused semantics, so emitting this GLSL instruction does not seem correct. This also appears to be the root cause of this issue in the offload-test-suite. On Intel Vulkan, the driver gives the wrong output for one of the precision sensitive constant-folding cases (though the buffer equivalent case produces the correct result).
The fix for this would be to emit OpFmaKHR from SPV_KHR_fma instead, which guarantees a fused operation. This is also what Clang currently does.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugBug, regression, crashBug, regression, crashneeds-triageAwaiting triageAwaiting triagespirvWork related to SPIR-VWork related to SPIR-V
Type
Projects
Status
No status