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

@@ -19,7 +19,7 @@ struct tint_symbol_1 {
int func_struct_S_i1_2_1_i1_(constant buf0& x_9, thread S* const s, thread int* const x) {
int const x_16 = *(x);
(*(s)).arr.arr[1] = (x_16 + 1);
(*(s)).arr.arr[1] = as_type<int>((as_type<uint>(x_16) + as_type<uint>(1)));
int const x_18 = x_9.one;
int const x_19 = (*(s)).arr.arr[x_18];
int const x_20 = *(x);
@@ -42,7 +42,7 @@ void main_1(constant buf0& x_9, thread float4* const tint_symbol_4) {
while (true) {
int const x_22 = i;
int const x_23 = x_9.one;
if ((x_22 < (2 + x_23))) {
if ((x_22 < as_type<int>((as_type<uint>(2) + as_type<uint>(x_23))))) {
} else {
break;
}
@@ -50,7 +50,7 @@ void main_1(constant buf0& x_9, thread float4* const tint_symbol_4) {
while (true) {
int const x_25 = j;
int const x_26 = x_9.one;
if ((x_25 < (3 + x_26))) {
if ((x_25 < as_type<int>((as_type<uint>(3) + as_type<uint>(x_26))))) {
} else {
break;
}
@@ -58,18 +58,18 @@ void main_1(constant buf0& x_9, thread float4* const tint_symbol_4) {
int const x_29 = j;
S const x_79 = s_1;
param = x_79;
param_1 = (x_28 + x_29);
param_1 = as_type<int>((as_type<uint>(x_28) + as_type<uint>(x_29)));
int const x_31 = func_struct_S_i1_2_1_i1_(x_9, &(param), &(param_1));
int const x_32 = a;
a = (x_32 + x_31);
a = as_type<int>((as_type<uint>(x_32) + as_type<uint>(x_31)));
{
int const x_34 = j;
j = (x_34 + 1);
j = as_type<int>((as_type<uint>(x_34) + as_type<uint>(1)));
}
}
{
int const x_36 = i;
i = (x_36 + 1);
i = as_type<int>((as_type<uint>(x_36) + as_type<uint>(1)));
}
}
int const x_38 = a;

View File

@@ -19,7 +19,7 @@ struct tint_symbol_1 {
int func_struct_S_i1_2_1_i1_(constant buf0& x_9, thread S* const s, thread int* const x) {
int const x_16 = *(x);
(*(s)).arr.arr[1] = (x_16 + 1);
(*(s)).arr.arr[1] = as_type<int>((as_type<uint>(x_16) + as_type<uint>(1)));
int const x_18 = x_9.one;
int const x_19 = (*(s)).arr.arr[x_18];
int const x_20 = *(x);
@@ -42,7 +42,7 @@ void main_1(constant buf0& x_9, thread float4* const tint_symbol_4) {
while (true) {
int const x_22 = i;
int const x_23 = x_9.one;
if ((x_22 < (2 + x_23))) {
if ((x_22 < as_type<int>((as_type<uint>(2) + as_type<uint>(x_23))))) {
} else {
break;
}
@@ -50,7 +50,7 @@ void main_1(constant buf0& x_9, thread float4* const tint_symbol_4) {
while (true) {
int const x_25 = j;
int const x_26 = x_9.one;
if ((x_25 < (3 + x_26))) {
if ((x_25 < as_type<int>((as_type<uint>(3) + as_type<uint>(x_26))))) {
} else {
break;
}
@@ -58,18 +58,18 @@ void main_1(constant buf0& x_9, thread float4* const tint_symbol_4) {
int const x_29 = j;
S const x_79 = s_1;
param = x_79;
param_1 = (x_28 + x_29);
param_1 = as_type<int>((as_type<uint>(x_28) + as_type<uint>(x_29)));
int const x_31 = func_struct_S_i1_2_1_i1_(x_9, &(param), &(param_1));
int const x_32 = a;
a = (x_32 + x_31);
a = as_type<int>((as_type<uint>(x_32) + as_type<uint>(x_31)));
{
int const x_34 = j;
j = (x_34 + 1);
j = as_type<int>((as_type<uint>(x_34) + as_type<uint>(1)));
}
}
{
int const x_36 = i;
i = (x_36 + 1);
i = as_type<int>((as_type<uint>(x_36) + as_type<uint>(1)));
}
}
int const x_38 = a;