29 lines
1.1 KiB
Plaintext
29 lines
1.1 KiB
Plaintext
; 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 "testSMod_i32"
|
|
OpName %a "a"
|
|
OpName %b "b"
|
|
%void = OpTypeVoid
|
|
%uint = OpTypeInt 32 0
|
|
%5 = OpTypeFunction %void %uint %uint
|
|
%1 = OpFunction %void None %5
|
|
%a = OpFunctionParameter %uint
|
|
%b = OpFunctionParameter %uint
|
|
%6 = OpLabel
|
|
%7 = OpSMod %uint %a %b
|
|
OpReturn
|
|
OpFunctionEnd
|
|
|
|
; CHECK-DAG: %srem.res = srem i32 %a, %b
|
|
; CHECK-DAG: %xor.res = xor i32 {{%a, %b|%b, %a}}
|
|
; CHECK-DAG: %cmpsign.res = icmp slt i32 %xor.res, 0
|
|
; CHECK-DAG: %cmpsrem.res = icmp ne i32 {{%srem\.res, 0|0, %srem\.res}}
|
|
; CHECK-DAG: %add.res = add nsw i32 {{%srem\.res, %b|%b, %srem\.res}}
|
|
; CHECK-DAG: %cmp.res = and i1 {{%cmpsign\.res, %cmpsrem\.res|%cmpsrem\.res, %cmpsign\.res}}
|
|
; CHECK: select i1 %cmp.res, i32 %add.res, i32 %srem.res
|