dawn-cmake/test/tint/statements/compound_assign/divide_by_zero.wgsl.expected.spvasm
Ben Clayton 8e3485248e tint/writer/spirv: Inline constant expressions
This is required to handle materialized values, and for constant
expressions.

Bug: tint:1504
Change-Id: If0a49e9b03566c06aa6e4e4c284fc427e1541e91
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/92082
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ben Clayton <bclayton@chromium.org>
2022-06-01 15:57:22 +00:00

61 lines
2.1 KiB
Plaintext

; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 35
; 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 %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 %void %int
%unused_entry_point = OpFunction %void None %9
%12 = OpLabel
OpReturn
OpFunctionEnd
%foo = OpFunction %void None %13
%maybe_zero = OpFunctionParameter %int
%16 = OpLabel
%17 = OpLoad %int %a
%18 = OpSDiv %int %17 %4
OpStore %a %18
%19 = OpLoad %int %a
%20 = OpSMod %int %19 %4
OpStore %a %20
%21 = OpLoad %int %a
%22 = OpSDiv %int %21 %maybe_zero
OpStore %a %22
%23 = OpLoad %int %a
%24 = OpSMod %int %23 %maybe_zero
OpStore %a %24
%25 = OpLoad %float %b
%26 = OpFDiv %float %25 %8
OpStore %b %26
%27 = OpLoad %float %b
%28 = OpFRem %float %27 %8
OpStore %b %28
%29 = OpLoad %float %b
%30 = OpConvertSToF %float %maybe_zero
%31 = OpFDiv %float %29 %30
OpStore %b %31
%32 = OpLoad %float %b
%33 = OpConvertSToF %float %maybe_zero
%34 = OpFRem %float %32 %33
OpStore %b %34
OpReturn
OpFunctionEnd