forked from KhronosGroup/SPIRV-LLVM-Translator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
OpIAdd.spvasm
37 lines (36 loc) · 1.29 KB
/
OpIAdd.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 "testIAdd"
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 = OpIAdd %uint %a %b
%r2 = OpIAdd %uint %a %b
%r3 = OpIAdd %uint %a %b
%r4 = OpIAdd %uint %a %b
OpReturn
OpFunctionEnd
; CHECK: %r1 = add i32 %a, %b
; CHECK: %r2 = add nsw i32 %a, %b
; CHECK: %r3 = add nuw i32 %a, %b
; CHECK: %r4 = add nuw nsw i32 %a, %b