mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-20 18:29:23 +00:00
tint: polyfill remainder to handle negative operands
Bug: tint:1802 Change-Id: Ie9baa045feda08523e5ca4f5ce94b6db7d4477e5 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/119100 Commit-Queue: Antonio Maiorano <amaiorano@google.com> Kokoro: Kokoro <noreply+kokoro@google.com> Reviewed-by: Ben Clayton <bclayton@google.com>
This commit is contained in:
committed by
Dawn LUCI CQ
parent
78583a14e6
commit
ec20758675
@@ -1,7 +1,7 @@
|
||||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 43
|
||||
; Bound: 65
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
@@ -16,6 +16,8 @@
|
||||
OpName %tint_mod "tint_mod"
|
||||
OpName %lhs "lhs"
|
||||
OpName %rhs "rhs"
|
||||
OpName %tint_return_flag "tint_return_flag"
|
||||
OpName %tint_return_value "tint_return_value"
|
||||
OpName %foo "foo"
|
||||
OpDecorate %v_block Block
|
||||
OpMemberDecorate %v_block 0 Offset 0
|
||||
@@ -31,16 +33,24 @@
|
||||
%void = OpTypeVoid
|
||||
%7 = OpTypeFunction %void
|
||||
%11 = OpTypeFunction %v4int %v4int %int
|
||||
%18 = OpConstantNull %v4int
|
||||
%bool = OpTypeBool
|
||||
%_ptr_Function_bool = OpTypePointer Function %bool
|
||||
%19 = OpConstantNull %bool
|
||||
%_ptr_Function_v4int = OpTypePointer Function %v4int
|
||||
%22 = OpConstantNull %v4int
|
||||
%v4bool = OpTypeVector %bool 4
|
||||
%int_n2147483648 = OpConstant %int -2147483648
|
||||
%23 = OpConstantComposite %v4int %int_n2147483648 %int_n2147483648 %int_n2147483648 %int_n2147483648
|
||||
%28 = OpConstantComposite %v4int %int_n2147483648 %int_n2147483648 %int_n2147483648 %int_n2147483648
|
||||
%int_n1 = OpConstant %int -1
|
||||
%26 = OpConstantComposite %v4int %int_n1 %int_n1 %int_n1 %int_n1
|
||||
%31 = OpConstantComposite %v4int %int_n1 %int_n1 %int_n1 %int_n1
|
||||
%int_1 = OpConstant %int 1
|
||||
%31 = OpConstantComposite %v4int %int_1 %int_1 %int_1 %int_1
|
||||
%36 = OpConstantComposite %v4int %int_1 %int_1 %int_1 %int_1
|
||||
%uint = OpTypeInt 32 0
|
||||
%v4uint = OpTypeVector %uint 4
|
||||
%uint_2147483648 = OpConstant %uint 2147483648
|
||||
%43 = OpConstantComposite %v4uint %uint_2147483648 %uint_2147483648 %uint_2147483648 %uint_2147483648
|
||||
%45 = OpConstantNull %v4uint
|
||||
%true = OpConstantTrue %bool
|
||||
%uint_0 = OpConstant %uint 0
|
||||
%_ptr_StorageBuffer_v4int = OpTypePointer StorageBuffer %v4int
|
||||
%int_2 = OpConstant %int 2
|
||||
@@ -52,22 +62,44 @@
|
||||
%lhs = OpFunctionParameter %v4int
|
||||
%rhs = OpFunctionParameter %int
|
||||
%15 = OpLabel
|
||||
%16 = OpCompositeConstruct %v4int %rhs %rhs %rhs %rhs
|
||||
%19 = OpIEqual %v4bool %16 %18
|
||||
%24 = OpIEqual %v4bool %lhs %23
|
||||
%27 = OpIEqual %v4bool %16 %26
|
||||
%28 = OpLogicalAnd %v4bool %24 %27
|
||||
%29 = OpLogicalOr %v4bool %19 %28
|
||||
%17 = OpSelect %v4int %29 %31 %16
|
||||
%32 = OpSRem %v4int %lhs %17
|
||||
OpReturnValue %32
|
||||
%tint_return_flag = OpVariable %_ptr_Function_bool Function %19
|
||||
%tint_return_value = OpVariable %_ptr_Function_v4int Function %22
|
||||
%23 = OpCompositeConstruct %v4int %rhs %rhs %rhs %rhs
|
||||
%25 = OpIEqual %v4bool %23 %22
|
||||
%29 = OpIEqual %v4bool %lhs %28
|
||||
%32 = OpIEqual %v4bool %23 %31
|
||||
%33 = OpLogicalAnd %v4bool %29 %32
|
||||
%34 = OpLogicalOr %v4bool %25 %33
|
||||
%24 = OpSelect %v4int %34 %36 %23
|
||||
%41 = OpBitwiseOr %v4int %lhs %24
|
||||
%38 = OpBitcast %v4uint %41
|
||||
%44 = OpBitwiseAnd %v4uint %38 %43
|
||||
%46 = OpINotEqual %v4bool %44 %45
|
||||
%37 = OpAny %bool %46
|
||||
OpSelectionMerge %47 None
|
||||
OpBranchConditional %37 %48 %49
|
||||
%48 = OpLabel
|
||||
OpStore %tint_return_flag %true
|
||||
%51 = OpSDiv %v4int %lhs %24
|
||||
%52 = OpIMul %v4int %51 %24
|
||||
%53 = OpISub %v4int %lhs %52
|
||||
OpStore %tint_return_value %53
|
||||
OpBranch %47
|
||||
%49 = OpLabel
|
||||
OpStore %tint_return_flag %true
|
||||
%54 = OpSRem %v4int %lhs %24
|
||||
OpStore %tint_return_value %54
|
||||
OpBranch %47
|
||||
%47 = OpLabel
|
||||
%55 = OpLoad %v4int %tint_return_value
|
||||
OpReturnValue %55
|
||||
OpFunctionEnd
|
||||
%foo = OpFunction %void None %7
|
||||
%34 = OpLabel
|
||||
%39 = OpAccessChain %_ptr_StorageBuffer_v4int %v %uint_0 %uint_0
|
||||
%40 = OpLoad %v4int %39
|
||||
%35 = OpFunctionCall %v4int %tint_mod %40 %int_2
|
||||
%42 = OpAccessChain %_ptr_StorageBuffer_v4int %v %uint_0 %uint_0
|
||||
OpStore %42 %35
|
||||
%57 = OpLabel
|
||||
%61 = OpAccessChain %_ptr_StorageBuffer_v4int %v %uint_0 %uint_0
|
||||
%62 = OpLoad %v4int %61
|
||||
%58 = OpFunctionCall %v4int %tint_mod %62 %int_2
|
||||
%64 = OpAccessChain %_ptr_StorageBuffer_v4int %v %uint_0 %uint_0
|
||||
OpStore %64 %58
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
|
||||
Reference in New Issue
Block a user