Restore "MSL writer: make signed int overflow defined behaviour"

This reverts commit e33b0baa08.

Added tests/expressions/literals/intmin.wgsl test.

Bug: tint:124
Change-Id: I3d46f939ff20fa377ddb5fcb52f9afe728b8e430
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/60441
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Reviewed-by: David Neto <dneto@google.com>
This commit is contained in:
Antonio Maiorano
2021-07-30 18:59:06 +00:00
committed by Tint LUCI CQ
parent 9bdf2dcc6b
commit d388bc9b36
686 changed files with 4111 additions and 3079 deletions

View File

@@ -31,8 +31,8 @@ void main_1(constant buf0& x_9, constant buf1& x_6, thread float4* const tint_sy
}
{
float const x_48 = x_9.injectionSwitch.y;
data.arr[x_40] = (float((10 - x_40)) * x_48);
x_41 = (x_40 + 1);
data.arr[x_40] = (float(as_type<int>((as_type<uint>(10) - as_type<uint>(x_40)))) * x_48);
x_41 = as_type<int>((as_type<uint>(x_40) + as_type<uint>(1)));
x_40_phi = x_41;
}
}
@@ -56,9 +56,9 @@ void main_1(constant buf0& x_9, constant buf1& x_6, thread float4* const tint_sy
} else {
break;
}
if ((x_59 < (x_52 + 1))) {
if ((x_59 < as_type<int>((as_type<uint>(x_52) + as_type<uint>(1))))) {
{
x_60 = (x_59 + 1);
x_60 = as_type<int>((as_type<uint>(x_59) + as_type<uint>(1)));
x_59_phi = x_60;
}
continue;
@@ -84,12 +84,12 @@ void main_1(constant buf0& x_9, constant buf1& x_6, thread float4* const tint_sy
data.arr[x_71_save] = x_87;
}
{
x_60 = (x_59 + 1);
x_60 = as_type<int>((as_type<uint>(x_59) + as_type<uint>(1)));
x_59_phi = x_60;
}
}
{
x_53 = (x_52 + 1);
x_53 = as_type<int>((as_type<uint>(x_52) + as_type<uint>(1)));
x_52_phi = x_53;
}
}

View File

@@ -31,8 +31,8 @@ void main_1(constant buf0& x_9, constant buf1& x_6, thread float4* const tint_sy
}
{
float const x_48 = x_9.injectionSwitch.y;
data.arr[x_40] = (float((10 - x_40)) * x_48);
x_41 = (x_40 + 1);
data.arr[x_40] = (float(as_type<int>((as_type<uint>(10) - as_type<uint>(x_40)))) * x_48);
x_41 = as_type<int>((as_type<uint>(x_40) + as_type<uint>(1)));
x_40_phi = x_41;
}
}
@@ -56,9 +56,9 @@ void main_1(constant buf0& x_9, constant buf1& x_6, thread float4* const tint_sy
} else {
break;
}
if ((x_59 < (x_52 + 1))) {
if ((x_59 < as_type<int>((as_type<uint>(x_52) + as_type<uint>(1))))) {
{
x_60 = (x_59 + 1);
x_60 = as_type<int>((as_type<uint>(x_59) + as_type<uint>(1)));
x_59_phi = x_60;
}
continue;
@@ -84,12 +84,12 @@ void main_1(constant buf0& x_9, constant buf1& x_6, thread float4* const tint_sy
data.arr[x_71_save] = x_87;
}
{
x_60 = (x_59 + 1);
x_60 = as_type<int>((as_type<uint>(x_59) + as_type<uint>(1)));
x_59_phi = x_60;
}
}
{
x_53 = (x_52 + 1);
x_53 = as_type<int>((as_type<uint>(x_52) + as_type<uint>(1)));
x_52_phi = x_53;
}
}

View File

@@ -31,8 +31,8 @@ void main_1(constant buf0& x_9, constant buf1& x_6, thread float4* const tint_sy
}
{
float const x_49 = x_9.injectionSwitch.y;
data.arr[x_41] = (float((10 - x_41)) * x_49);
x_42 = (x_41 + 1);
data.arr[x_41] = (float(as_type<int>((as_type<uint>(10) - as_type<uint>(x_41)))) * x_49);
x_42 = as_type<int>((as_type<uint>(x_41) + as_type<uint>(1)));
x_41_phi = x_42;
}
}
@@ -56,9 +56,9 @@ void main_1(constant buf0& x_9, constant buf1& x_6, thread float4* const tint_sy
} else {
break;
}
if ((x_60 < (x_53 + 1))) {
if ((x_60 < as_type<int>((as_type<uint>(x_53) + as_type<uint>(1))))) {
{
x_61 = (x_60 + 1);
x_61 = as_type<int>((as_type<uint>(x_60) + as_type<uint>(1)));
x_60_phi = x_61;
}
continue;
@@ -84,12 +84,12 @@ void main_1(constant buf0& x_9, constant buf1& x_6, thread float4* const tint_sy
data.arr[x_72_save] = x_88;
}
{
x_61 = (x_60 + 1);
x_61 = as_type<int>((as_type<uint>(x_60) + as_type<uint>(1)));
x_60_phi = x_61;
}
}
{
x_54 = (x_53 + 1);
x_54 = as_type<int>((as_type<uint>(x_53) + as_type<uint>(1)));
x_53_phi = x_54;
}
}

View File

@@ -31,8 +31,8 @@ void main_1(constant buf0& x_9, constant buf1& x_6, thread float4* const tint_sy
}
{
float const x_49 = x_9.injectionSwitch.y;
data.arr[x_41] = (float((10 - x_41)) * x_49);
x_42 = (x_41 + 1);
data.arr[x_41] = (float(as_type<int>((as_type<uint>(10) - as_type<uint>(x_41)))) * x_49);
x_42 = as_type<int>((as_type<uint>(x_41) + as_type<uint>(1)));
x_41_phi = x_42;
}
}
@@ -56,9 +56,9 @@ void main_1(constant buf0& x_9, constant buf1& x_6, thread float4* const tint_sy
} else {
break;
}
if ((x_60 < (x_53 + 1))) {
if ((x_60 < as_type<int>((as_type<uint>(x_53) + as_type<uint>(1))))) {
{
x_61 = (x_60 + 1);
x_61 = as_type<int>((as_type<uint>(x_60) + as_type<uint>(1)));
x_60_phi = x_61;
}
continue;
@@ -84,12 +84,12 @@ void main_1(constant buf0& x_9, constant buf1& x_6, thread float4* const tint_sy
data.arr[x_72_save] = x_88;
}
{
x_61 = (x_60 + 1);
x_61 = as_type<int>((as_type<uint>(x_60) + as_type<uint>(1)));
x_60_phi = x_61;
}
}
{
x_54 = (x_53 + 1);
x_54 = as_type<int>((as_type<uint>(x_53) + as_type<uint>(1)));
x_53_phi = x_54;
}
}