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

@@ -44,13 +44,13 @@ int performPartition_i1_i1_(thread int* const l, thread int* const h, thread Qui
int const x_239 = (*(tint_symbol_6)).numbers.arr[x_237];
pivot = x_239;
int const x_240 = *(l);
i_1 = (x_240 - 1);
i_1 = as_type<int>((as_type<uint>(x_240) - as_type<uint>(1)));
int const x_242 = *(l);
j_1 = x_242;
while (true) {
int const x_247 = j_1;
int const x_248 = *(h);
if ((x_247 <= (x_248 - 1))) {
if ((x_247 <= as_type<int>((as_type<uint>(x_248) - as_type<uint>(1))))) {
} else {
break;
}
@@ -59,7 +59,7 @@ int performPartition_i1_i1_(thread int* const l, thread int* const h, thread Qui
int const x_255 = pivot;
if ((x_254 <= x_255)) {
int const x_259 = i_1;
i_1 = (x_259 + 1);
i_1 = as_type<int>((as_type<uint>(x_259) + as_type<uint>(1)));
int const x_261 = i_1;
param = x_261;
int const x_262 = j_1;
@@ -68,11 +68,11 @@ int performPartition_i1_i1_(thread int* const l, thread int* const h, thread Qui
}
{
int const x_264 = j_1;
j_1 = (x_264 + 1);
j_1 = as_type<int>((as_type<uint>(x_264) + as_type<uint>(1)));
}
}
int const x_266 = i_1;
i_1 = (x_266 + 1);
i_1 = as_type<int>((as_type<uint>(x_266) + as_type<uint>(1)));
int const x_268 = i_1;
param_2 = x_268;
int const x_269 = *(h);
@@ -94,12 +94,12 @@ void quicksort_(thread QuicksortObject* const tint_symbol_7) {
h_1 = 9;
top = -1;
int const x_273 = top;
int const x_274 = (x_273 + 1);
int const x_274 = as_type<int>((as_type<uint>(x_273) + as_type<uint>(1)));
top = x_274;
int const x_275 = l_1;
stack.arr[x_274] = x_275;
int const x_277 = top;
int const x_278 = (x_277 + 1);
int const x_278 = as_type<int>((as_type<uint>(x_277) + as_type<uint>(1)));
top = x_278;
int const x_279 = h_1;
stack.arr[x_278] = x_279;
@@ -110,11 +110,11 @@ void quicksort_(thread QuicksortObject* const tint_symbol_7) {
break;
}
int const x_288 = top;
top = (x_288 - 1);
top = as_type<int>((as_type<uint>(x_288) - as_type<uint>(1)));
int const x_291 = stack.arr[x_288];
h_1 = x_291;
int const x_292 = top;
top = (x_292 - 1);
top = as_type<int>((as_type<uint>(x_292) - as_type<uint>(1)));
int const x_295 = stack.arr[x_292];
l_1 = x_295;
int const x_296 = l_1;
@@ -125,28 +125,28 @@ void quicksort_(thread QuicksortObject* const tint_symbol_7) {
p = x_298;
int const x_299 = p;
int const x_301 = l_1;
if (((x_299 - 1) > x_301)) {
if ((as_type<int>((as_type<uint>(x_299) - as_type<uint>(1))) > x_301)) {
int const x_305 = top;
int const x_306 = (x_305 + 1);
int const x_306 = as_type<int>((as_type<uint>(x_305) + as_type<uint>(1)));
top = x_306;
int const x_307 = l_1;
stack.arr[x_306] = x_307;
int const x_309 = top;
int const x_310 = (x_309 + 1);
int const x_310 = as_type<int>((as_type<uint>(x_309) + as_type<uint>(1)));
top = x_310;
int const x_311 = p;
stack.arr[x_310] = (x_311 - 1);
stack.arr[x_310] = as_type<int>((as_type<uint>(x_311) - as_type<uint>(1)));
}
int const x_314 = p;
int const x_316 = h_1;
if (((x_314 + 1) < x_316)) {
if ((as_type<int>((as_type<uint>(x_314) + as_type<uint>(1))) < x_316)) {
int const x_320 = top;
int const x_321 = (x_320 + 1);
int const x_321 = as_type<int>((as_type<uint>(x_320) + as_type<uint>(1)));
top = x_321;
int const x_322 = p;
stack.arr[x_321] = (x_322 + 1);
stack.arr[x_321] = as_type<int>((as_type<uint>(x_322) + as_type<uint>(1)));
int const x_325 = top;
int const x_326 = (x_325 + 1);
int const x_326 = as_type<int>((as_type<uint>(x_325) + as_type<uint>(1)));
top = x_326;
int const x_327 = h_1;
stack.arr[x_326] = x_327;
@@ -168,16 +168,16 @@ void main_1(constant buf0& x_32, thread QuicksortObject* const tint_symbol_8, th
}
int const x_88 = i_2;
int const x_89 = i_2;
(*(tint_symbol_8)).numbers.arr[x_88] = (10 - x_89);
(*(tint_symbol_8)).numbers.arr[x_88] = as_type<int>((as_type<uint>(10) - as_type<uint>(x_89)));
int const x_92 = i_2;
int const x_93 = i_2;
int const x_95 = (*(tint_symbol_8)).numbers.arr[x_93];
int const x_96 = i_2;
int const x_98 = (*(tint_symbol_8)).numbers.arr[x_96];
(*(tint_symbol_8)).numbers.arr[x_92] = (x_95 * x_98);
(*(tint_symbol_8)).numbers.arr[x_92] = as_type<int>((as_type<uint>(x_95) * as_type<uint>(x_98)));
{
int const x_101 = i_2;
i_2 = (x_101 + 1);
i_2 = as_type<int>((as_type<uint>(x_101) + as_type<uint>(1)));
}
}
quicksort_(tint_symbol_8);

View File

@@ -44,13 +44,13 @@ int performPartition_i1_i1_(thread int* const l, thread int* const h, thread Qui
int const x_239 = (*(tint_symbol_6)).numbers.arr[x_237];
pivot = x_239;
int const x_240 = *(l);
i_1 = (x_240 - 1);
i_1 = as_type<int>((as_type<uint>(x_240) - as_type<uint>(1)));
int const x_242 = *(l);
j_1 = x_242;
while (true) {
int const x_247 = j_1;
int const x_248 = *(h);
if ((x_247 <= (x_248 - 1))) {
if ((x_247 <= as_type<int>((as_type<uint>(x_248) - as_type<uint>(1))))) {
} else {
break;
}
@@ -59,7 +59,7 @@ int performPartition_i1_i1_(thread int* const l, thread int* const h, thread Qui
int const x_255 = pivot;
if ((x_254 <= x_255)) {
int const x_259 = i_1;
i_1 = (x_259 + 1);
i_1 = as_type<int>((as_type<uint>(x_259) + as_type<uint>(1)));
int const x_261 = i_1;
param = x_261;
int const x_262 = j_1;
@@ -68,11 +68,11 @@ int performPartition_i1_i1_(thread int* const l, thread int* const h, thread Qui
}
{
int const x_264 = j_1;
j_1 = (x_264 + 1);
j_1 = as_type<int>((as_type<uint>(x_264) + as_type<uint>(1)));
}
}
int const x_266 = i_1;
i_1 = (x_266 + 1);
i_1 = as_type<int>((as_type<uint>(x_266) + as_type<uint>(1)));
int const x_268 = i_1;
param_2 = x_268;
int const x_269 = *(h);
@@ -94,12 +94,12 @@ void quicksort_(thread QuicksortObject* const tint_symbol_7) {
h_1 = 9;
top = -1;
int const x_273 = top;
int const x_274 = (x_273 + 1);
int const x_274 = as_type<int>((as_type<uint>(x_273) + as_type<uint>(1)));
top = x_274;
int const x_275 = l_1;
stack.arr[x_274] = x_275;
int const x_277 = top;
int const x_278 = (x_277 + 1);
int const x_278 = as_type<int>((as_type<uint>(x_277) + as_type<uint>(1)));
top = x_278;
int const x_279 = h_1;
stack.arr[x_278] = x_279;
@@ -110,11 +110,11 @@ void quicksort_(thread QuicksortObject* const tint_symbol_7) {
break;
}
int const x_288 = top;
top = (x_288 - 1);
top = as_type<int>((as_type<uint>(x_288) - as_type<uint>(1)));
int const x_291 = stack.arr[x_288];
h_1 = x_291;
int const x_292 = top;
top = (x_292 - 1);
top = as_type<int>((as_type<uint>(x_292) - as_type<uint>(1)));
int const x_295 = stack.arr[x_292];
l_1 = x_295;
int const x_296 = l_1;
@@ -125,28 +125,28 @@ void quicksort_(thread QuicksortObject* const tint_symbol_7) {
p = x_298;
int const x_299 = p;
int const x_301 = l_1;
if (((x_299 - 1) > x_301)) {
if ((as_type<int>((as_type<uint>(x_299) - as_type<uint>(1))) > x_301)) {
int const x_305 = top;
int const x_306 = (x_305 + 1);
int const x_306 = as_type<int>((as_type<uint>(x_305) + as_type<uint>(1)));
top = x_306;
int const x_307 = l_1;
stack.arr[x_306] = x_307;
int const x_309 = top;
int const x_310 = (x_309 + 1);
int const x_310 = as_type<int>((as_type<uint>(x_309) + as_type<uint>(1)));
top = x_310;
int const x_311 = p;
stack.arr[x_310] = (x_311 - 1);
stack.arr[x_310] = as_type<int>((as_type<uint>(x_311) - as_type<uint>(1)));
}
int const x_314 = p;
int const x_316 = h_1;
if (((x_314 + 1) < x_316)) {
if ((as_type<int>((as_type<uint>(x_314) + as_type<uint>(1))) < x_316)) {
int const x_320 = top;
int const x_321 = (x_320 + 1);
int const x_321 = as_type<int>((as_type<uint>(x_320) + as_type<uint>(1)));
top = x_321;
int const x_322 = p;
stack.arr[x_321] = (x_322 + 1);
stack.arr[x_321] = as_type<int>((as_type<uint>(x_322) + as_type<uint>(1)));
int const x_325 = top;
int const x_326 = (x_325 + 1);
int const x_326 = as_type<int>((as_type<uint>(x_325) + as_type<uint>(1)));
top = x_326;
int const x_327 = h_1;
stack.arr[x_326] = x_327;
@@ -168,16 +168,16 @@ void main_1(constant buf0& x_32, thread QuicksortObject* const tint_symbol_8, th
}
int const x_88 = i_2;
int const x_89 = i_2;
(*(tint_symbol_8)).numbers.arr[x_88] = (10 - x_89);
(*(tint_symbol_8)).numbers.arr[x_88] = as_type<int>((as_type<uint>(10) - as_type<uint>(x_89)));
int const x_92 = i_2;
int const x_93 = i_2;
int const x_95 = (*(tint_symbol_8)).numbers.arr[x_93];
int const x_96 = i_2;
int const x_98 = (*(tint_symbol_8)).numbers.arr[x_96];
(*(tint_symbol_8)).numbers.arr[x_92] = (x_95 * x_98);
(*(tint_symbol_8)).numbers.arr[x_92] = as_type<int>((as_type<uint>(x_95) * as_type<uint>(x_98)));
{
int const x_101 = i_2;
i_2 = (x_101 + 1);
i_2 = as_type<int>((as_type<uint>(x_101) + as_type<uint>(1)));
}
}
quicksort_(tint_symbol_8);