From 46a4d98baa1d43b33717b4377aefeeaf46b9c2ff Mon Sep 17 00:00:00 2001 From: Yong He Date: Mon, 23 Jan 2023 06:59:25 -0800 Subject: Full address insts elimination for backward autodiff. (#2604) Co-authored-by: Yong He --- tests/cross-compile/precise-keyword.slang.glsl | 9 ++++++--- tests/cross-compile/precise-keyword.slang.hlsl | 8 +++++--- 2 files changed, 11 insertions(+), 6 deletions(-) (limited to 'tests/cross-compile') diff --git a/tests/cross-compile/precise-keyword.slang.glsl b/tests/cross-compile/precise-keyword.slang.glsl index 17fed739e..027a8eb3b 100644 --- a/tests/cross-compile/precise-keyword.slang.glsl +++ b/tests/cross-compile/precise-keyword.slang.glsl @@ -11,15 +11,18 @@ in vec2 _S2; void main() { + float _S3 = _S2.x; + precise float z_0; - if(_S2.x > float(0)) + if(_S3 > 0.00000000000000000000) { - z_0 = _S2.x * _S2.y + _S2.x; + z_0 = _S3 * _S2.y + _S3; } else { - z_0 = _S2.y * _S2.x + _S2.y; + float _S4 = _S2.y; + z_0 = _S4 * _S3 + _S4; } _S1 = vec4(z_0); return; diff --git a/tests/cross-compile/precise-keyword.slang.hlsl b/tests/cross-compile/precise-keyword.slang.hlsl index 54017868b..7a07fdc5e 100644 --- a/tests/cross-compile/precise-keyword.slang.hlsl +++ b/tests/cross-compile/precise-keyword.slang.hlsl @@ -3,15 +3,17 @@ float4 main(float2 v_0 : V) : SV_TARGET { + float _S1 = v_0.x; precise float z_0; - if(v_0.x > (float) 0) + if (_S1 > 0.00000000000000000000) { - z_0 = v_0.x * v_0.y + v_0.x; + z_0 = _S1 * v_0.y + _S1; } else { - z_0 = v_0.y * v_0.x + v_0.y; + float _S2 = v_0.y; + z_0 = _S2 * _S1 + _S2; } return (float4) z_0; -- cgit v1.2.3