blob: 6764152fa7df518ad94cf4e62e38156b2a2fdcf3 [file] [log] [blame]
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 83
; 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 %tint_return_flag "tint_return_flag"
OpName %tint_return_value "tint_return_value"
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
%_ptr_Function_bool = OpTypePointer Function %bool
%35 = OpConstantNull %bool
%_ptr_Function_int = OpTypePointer Function %int
%uint = OpTypeInt 32 0
%uint_2147483648 = OpConstant %uint 2147483648
%50 = OpConstantNull %uint
%true = OpConstantTrue %bool
%61 = 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
%tint_return_flag = OpVariable %_ptr_Function_bool Function %35
%tint_return_value = OpVariable %_ptr_Function_int Function %4
%39 = OpIEqual %bool %rhs_0 %4
%40 = OpIEqual %bool %lhs_0 %int_n2147483648
%41 = OpIEqual %bool %rhs_0 %int_n1
%42 = OpLogicalAnd %bool %40 %41
%43 = OpLogicalOr %bool %39 %42
%38 = OpSelect %int %43 %int_1 %rhs_0
%47 = OpBitwiseOr %int %lhs_0 %38
%45 = OpBitcast %uint %47
%49 = OpBitwiseAnd %uint %45 %uint_2147483648
%51 = OpINotEqual %bool %49 %50
OpSelectionMerge %52 None
OpBranchConditional %51 %53 %54
%53 = OpLabel
OpStore %tint_return_flag %true
%56 = OpSDiv %int %lhs_0 %38
%57 = OpIMul %int %56 %38
%58 = OpISub %int %lhs_0 %57
OpStore %tint_return_value %58
OpBranch %52
%54 = OpLabel
OpStore %tint_return_flag %true
%59 = OpSRem %int %lhs_0 %38
OpStore %tint_return_value %59
OpBranch %52
%52 = OpLabel
%60 = OpLoad %int %tint_return_value
OpReturnValue %60
OpFunctionEnd
%foo = OpFunction %void None %61
%maybe_zero = OpFunctionParameter %int
%64 = OpLabel
%66 = OpLoad %int %a
%65 = OpFunctionCall %int %tint_div %66 %4
OpStore %a %65
%68 = OpLoad %int %a
%67 = OpFunctionCall %int %tint_mod %68 %4
OpStore %a %67
%70 = OpLoad %int %a
%69 = OpFunctionCall %int %tint_div %70 %maybe_zero
OpStore %a %69
%72 = OpLoad %int %a
%71 = OpFunctionCall %int %tint_mod %72 %maybe_zero
OpStore %a %71
%73 = OpLoad %float %b
%74 = OpFDiv %float %73 %8
OpStore %b %74
%75 = OpLoad %float %b
%76 = OpFRem %float %75 %8
OpStore %b %76
%77 = OpLoad %float %b
%78 = OpConvertSToF %float %maybe_zero
%79 = OpFDiv %float %77 %78
OpStore %b %79
%80 = OpLoad %float %b
%81 = OpConvertSToF %float %maybe_zero
%82 = OpFRem %float %80 %81
OpStore %b %82
OpReturn
OpFunctionEnd