blob: c7ab06bf06bab5c6cd0f2742f50885fed7951336 [file] [log] [blame]
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 76
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %unused_entry_point "unused_entry_point"
OpExecutionMode %unused_entry_point LocalSize 1 1 1
OpName %a "a"
OpName %b "b"
OpName %unused_entry_point "unused_entry_point"
OpName %tint_div "tint_div"
OpName %lhs "lhs"
OpName %rhs "rhs"
OpName %tint_mod "tint_mod"
OpName %lhs_0 "lhs"
OpName %rhs_0 "rhs"
OpName %foo "foo"
OpName %maybe_zero "maybe_zero"
%int = OpTypeInt 32 1
%_ptr_Private_int = OpTypePointer Private %int
%4 = OpConstantNull %int
%a = OpVariable %_ptr_Private_int Private %4
%float = OpTypeFloat 32
%_ptr_Private_float = OpTypePointer Private %float
%8 = OpConstantNull %float
%b = OpVariable %_ptr_Private_float Private %8
%void = OpTypeVoid
%9 = OpTypeFunction %void
%13 = OpTypeFunction %int %int %int
%bool = OpTypeBool
%int_n2147483648 = OpConstant %int -2147483648
%int_n1 = OpConstant %int -1
%int_1 = OpConstant %int 1
%uint = OpTypeInt 32 0
%uint_2147483648 = OpConstant %uint 2147483648
%45 = OpConstantNull %uint
%54 = OpTypeFunction %void %int
%unused_entry_point = OpFunction %void None %9
%12 = OpLabel
OpReturn
OpFunctionEnd
%tint_div = OpFunction %int None %13
%lhs = OpFunctionParameter %int
%rhs = OpFunctionParameter %int
%17 = OpLabel
%19 = OpIEqual %bool %rhs %4
%22 = OpIEqual %bool %lhs %int_n2147483648
%24 = OpIEqual %bool %rhs %int_n1
%25 = OpLogicalAnd %bool %22 %24
%26 = OpLogicalOr %bool %19 %25
%18 = OpSelect %int %26 %int_1 %rhs
%28 = OpSDiv %int %lhs %18
OpReturnValue %28
OpFunctionEnd
%tint_mod = OpFunction %int None %13
%lhs_0 = OpFunctionParameter %int
%rhs_0 = OpFunctionParameter %int
%32 = OpLabel
%34 = OpIEqual %bool %rhs_0 %4
%35 = OpIEqual %bool %lhs_0 %int_n2147483648
%36 = OpIEqual %bool %rhs_0 %int_n1
%37 = OpLogicalAnd %bool %35 %36
%38 = OpLogicalOr %bool %34 %37
%33 = OpSelect %int %38 %int_1 %rhs_0
%42 = OpBitwiseOr %int %lhs_0 %33
%40 = OpBitcast %uint %42
%44 = OpBitwiseAnd %uint %40 %uint_2147483648
%46 = OpINotEqual %bool %44 %45
OpSelectionMerge %47 None
OpBranchConditional %46 %48 %49
%48 = OpLabel
%50 = OpSDiv %int %lhs_0 %33
%51 = OpIMul %int %50 %33
%52 = OpISub %int %lhs_0 %51
OpReturnValue %52
%49 = OpLabel
%53 = OpSRem %int %lhs_0 %33
OpReturnValue %53
%47 = OpLabel
OpReturnValue %4
OpFunctionEnd
%foo = OpFunction %void None %54
%maybe_zero = OpFunctionParameter %int
%57 = OpLabel
%59 = OpLoad %int %a
%58 = OpFunctionCall %int %tint_div %59 %4
OpStore %a %58
%61 = OpLoad %int %a
%60 = OpFunctionCall %int %tint_mod %61 %4
OpStore %a %60
%63 = OpLoad %int %a
%62 = OpFunctionCall %int %tint_div %63 %maybe_zero
OpStore %a %62
%65 = OpLoad %int %a
%64 = OpFunctionCall %int %tint_mod %65 %maybe_zero
OpStore %a %64
%66 = OpLoad %float %b
%67 = OpFDiv %float %66 %8
OpStore %b %67
%68 = OpLoad %float %b
%69 = OpFRem %float %68 %8
OpStore %b %69
%70 = OpLoad %float %b
%71 = OpConvertSToF %float %maybe_zero
%72 = OpFDiv %float %70 %71
OpStore %b %72
%73 = OpLoad %float %b
%74 = OpConvertSToF %float %maybe_zero
%75 = OpFRem %float %73 %74
OpStore %b %75
OpReturn
OpFunctionEnd