-
Notifications
You must be signed in to change notification settings - Fork 229
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add translation of fast math flags for binary arithmetic ops
This replaces SPIR-V assembly tests for translation of FPFastMathMode decorations with transcoding tests, adding a single SPIR-V assembly test for the translation of the combination of the Fast and NotNaN flags.
- Loading branch information
1 parent
cb3be86
commit 4a4e0ae
Showing
14 changed files
with
398 additions
and
275 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
; REQUIRES: spirv-as | ||
; RUN: spirv-as --target-env spv1.0 -o %t.spv %s | ||
; RUN: spirv-val %t.spv | ||
; RUN: llvm-spirv -r -o - %t.spv | llvm-dis | FileCheck %s | ||
OpCapability Addresses | ||
OpCapability Kernel | ||
OpMemoryModel Physical32 OpenCL | ||
OpEntryPoint Kernel %1 "testFPFastMathModeNotNaNFast" | ||
OpName %a "a" | ||
OpName %b "b" | ||
OpName %r1 "r1" | ||
OpName %r2 "r2" | ||
OpName %r3 "r3" | ||
OpName %r4 "r4" | ||
OpName %r5 "r5" | ||
OpDecorate %dec FPFastMathMode NotNaN|Fast | ||
%dec = OpDecorationGroup | ||
OpGroupDecorate %dec %r1 %r2 %r3 %r4 %r5 | ||
%void = OpTypeVoid | ||
%float = OpTypeFloat 32 | ||
%5 = OpTypeFunction %void %float %float | ||
%1 = OpFunction %void None %5 | ||
%a = OpFunctionParameter %float | ||
%b = OpFunctionParameter %float | ||
%6 = OpLabel | ||
%r1 = OpFAdd %float %a %b | ||
%r2 = OpFSub %float %a %b | ||
%r3 = OpFMul %float %a %b | ||
%r4 = OpFDiv %float %a %b | ||
%r5 = OpFRem %float %a %b | ||
OpReturn | ||
OpFunctionEnd | ||
|
||
; CHECK: %r1 = fadd fast float %a, %b | ||
; CHECK: %r2 = fsub fast float %a, %b | ||
; CHECK: %r3 = fmul fast float %a, %b | ||
; CHECK: %r4 = fdiv fast float %a, %b | ||
; CHECK: %r5 = frem fast float %a, %b |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.