forked from KhronosGroup/SPIRV-LLVM-Translator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
OpFMod_f32.spvasm
25 lines (24 loc) · 1.04 KB
/
OpFMod_f32.spvasm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
; REQUIRES: spirv-as
; RUN: spirv-as --target-env spv1.0 -o %t.spv %s
; RUN: llvm-spirv -r -o - %t.spv | llvm-dis | FileCheck %s
OpCapability Addresses
OpCapability Kernel
OpMemoryModel Physical32 OpenCL
OpEntryPoint Kernel %1 "testFMod_f32"
OpName %a "a"
OpName %b "b"
%void = OpTypeVoid
%float = OpTypeFloat 32
%5 = OpTypeFunction %void %float %float
%1 = OpFunction %void None %5
%a = OpFunctionParameter %float
%b = OpFunctionParameter %float
%6 = OpLabel
%7 = OpFMod %float %a %b
OpReturn
OpFunctionEnd
; CHECK-DAG: %frem.res = frem float %a, %b
; CHECK-DAG: %copysign.res = call float @llvm.copysign.f32(float %frem.res, float %b)
; CHECK-DAG: %fadd.res = fadd float {{%frem\.res, %b|%b, %frem\.res}}
; CHECK-DAG: %cmp.res = fcmp one float {{%frem\.res, %copysign\.res|%copysign\.res, %frem\.res}}
; CHECK: select i1 %cmp.res, float %fadd.res, float %copysign.res