blob: 60b6622560f0401587950b23476f23d118b24953 [file] [log] [blame]
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 1
; Bound: 70
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %main "main"
OpExecutionMode %main LocalSize 1 1 1
OpName %a "a"
OpName %b "b"
OpName %foo "foo"
OpName %maybe_zero "maybe_zero"
OpName %main "main"
OpName %tint_div_i32 "tint_div_i32"
OpName %lhs "lhs"
OpName %rhs "rhs"
OpName %tint_mod_i32 "tint_mod_i32"
OpName %lhs_0 "lhs"
OpName %rhs_0 "rhs"
%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
%12 = OpTypeFunction %void %int
%float_0 = OpConstant %float 0
%32 = OpTypeFunction %void
%int_0 = OpConstant %int 0
%38 = 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
%foo = OpFunction %void None %12
%maybe_zero = OpFunctionParameter %int
%13 = OpLabel
%14 = OpLoad %int %a None
%15 = OpFunctionCall %int %tint_div_i32 %14 %maybe_zero
OpStore %a %15 None
%17 = OpLoad %int %a None
%18 = OpFunctionCall %int %tint_mod_i32 %17 %maybe_zero
OpStore %a %18 None
%20 = OpLoad %float %b None
%21 = OpFDiv %float %20 %float_0
OpStore %b %21 None
%23 = OpLoad %float %b None
%24 = OpFRem %float %23 %float_0
OpStore %b %24 None
%25 = OpConvertSToF %float %maybe_zero
%26 = OpLoad %float %b None
%27 = OpFDiv %float %26 %25
OpStore %b %27 None
%28 = OpConvertSToF %float %maybe_zero
%29 = OpLoad %float %b None
%30 = OpFRem %float %29 %28
OpStore %b %30 None
OpReturn
OpFunctionEnd
%main = OpFunction %void None %32
%33 = OpLabel
%34 = OpFunctionCall %void %foo %int_0
OpReturn
OpFunctionEnd
%tint_div_i32 = OpFunction %int None %38
%lhs = OpFunctionParameter %int
%rhs = OpFunctionParameter %int
%39 = OpLabel
%40 = OpIEqual %bool %rhs %int_0
%42 = OpIEqual %bool %lhs %int_n2147483648
%44 = OpIEqual %bool %rhs %int_n1
%46 = OpLogicalAnd %bool %42 %44
%47 = OpLogicalOr %bool %40 %46
%48 = OpSelect %int %47 %int_1 %rhs
%50 = OpSDiv %int %lhs %48
OpReturnValue %50
OpFunctionEnd
%tint_mod_i32 = OpFunction %int None %38
%lhs_0 = OpFunctionParameter %int
%rhs_0 = OpFunctionParameter %int
%53 = OpLabel
%54 = OpIEqual %bool %rhs_0 %int_0
%55 = OpIEqual %bool %lhs_0 %int_n2147483648
%56 = OpIEqual %bool %rhs_0 %int_n1
%57 = OpLogicalAnd %bool %55 %56
%58 = OpLogicalOr %bool %54 %57
%59 = OpSelect %int %58 %int_1 %rhs_0
%60 = OpSDiv %int %lhs_0 %59
%62 = OpBitcast %uint %60
%63 = OpBitcast %uint %59
%64 = OpIMul %uint %62 %63
%65 = OpBitcast %int %64
%66 = OpBitcast %uint %lhs_0
%67 = OpBitcast %uint %65
%68 = OpISub %uint %66 %67
%69 = OpBitcast %int %68
OpReturnValue %69
OpFunctionEnd