forked from KhronosGroup/SPIRV-LLVM-Translator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
OpISub.spvasm
37 lines (36 loc) · 1.29 KB
/
OpISub.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
26
27
28
29
30
31
32
33
34
35
36
37
; 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
OpExtension "SPV_KHR_no_integer_wrap_decoration"
OpMemoryModel Physical32 OpenCL
OpEntryPoint Kernel %1 "testISub"
OpName %a "a"
OpName %b "b"
OpName %r1 "r1"
OpName %r2 "r2"
OpName %r3 "r3"
OpName %r4 "r4"
OpDecorate %r2 NoSignedWrap
OpDecorate %r3 NoUnsignedWrap
OpDecorate %r4 NoSignedWrap
OpDecorate %r4 NoUnsignedWrap
%void = OpTypeVoid
%uint = OpTypeInt 32 0
%5 = OpTypeFunction %void %uint %uint
%1 = OpFunction %void None %5
%a = OpFunctionParameter %uint
%b = OpFunctionParameter %uint
%6 = OpLabel
%r1 = OpISub %uint %a %b
%r2 = OpISub %uint %a %b
%r3 = OpISub %uint %a %b
%r4 = OpISub %uint %a %b
OpReturn
OpFunctionEnd
; CHECK: %r1 = sub i32 %a, %b
; CHECK: %r2 = sub nsw i32 %a, %b
; CHECK: %r3 = sub nuw i32 %a, %b
; CHECK: %r4 = sub nuw nsw i32 %a, %b