MSL writer: make signed int overflow defined behaviour

Bug: tint:124
Change-Id: Icf545b633d6390ceb7f639e80111390005e311a1
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/60100
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
Reviewed-by: David Neto <dneto@google.com>
This commit is contained in:
Antonio Maiorano
2021-07-29 13:51:47 +00:00
committed by Tint LUCI CQ
parent 1f0200a3ff
commit e5dbe24e94
651 changed files with 3963 additions and 3048 deletions

View File

@@ -2,7 +2,7 @@
using namespace metal;
void foo(thread float2* const tint_symbol_1, thread int3* const tint_symbol_2, thread uint4* const tint_symbol_3, thread bool2* const tint_symbol_4) {
for(int i = 0; (i < 2); i = (i + 1)) {
for(int i = 0; (i < 2); i = as_type<int>((as_type<uint>(i) + as_type<uint>(1)))) {
(*(tint_symbol_1))[i] = 1.0f;
(*(tint_symbol_2))[i] = 1;
(*(tint_symbol_3))[i] = 1u;
@@ -15,7 +15,7 @@ kernel void tint_symbol() {
thread int3 tint_symbol_6 = 0;
thread uint4 tint_symbol_7 = 0u;
thread bool2 tint_symbol_8 = false;
for(int i = 0; (i < 2); i = (i + 1)) {
for(int i = 0; (i < 2); i = as_type<int>((as_type<uint>(i) + as_type<uint>(1)))) {
foo(&(tint_symbol_5), &(tint_symbol_6), &(tint_symbol_7), &(tint_symbol_8));
}
return;

View File

@@ -14,7 +14,7 @@ kernel void tint_symbol() {
thread int3 tint_symbol_6 = 0;
thread uint4 tint_symbol_7 = 0u;
thread bool2 tint_symbol_8 = false;
for(int i = 0; (i < 2); i = (i + 1)) {
for(int i = 0; (i < 2); i = as_type<int>((as_type<uint>(i) + as_type<uint>(1)))) {
foo(&(tint_symbol_5), &(tint_symbol_6), &(tint_symbol_7), &(tint_symbol_8));
}
return;

View File

@@ -14,7 +14,7 @@ kernel void tint_symbol() {
bool2 v2b = false;
bool3 v3b = false;
bool4 v4b = false;
for(int i = 0; (i < 2); i = (i + 1)) {
for(int i = 0; (i < 2); i = as_type<int>((as_type<uint>(i) + as_type<uint>(1)))) {
v2f[i] = 1.0f;
v3f[i] = 1.0f;
v4f[i] = 1.0f;

View File

@@ -10,7 +10,7 @@ kernel void tint_symbol() {
uint4 v4u_2 = 0u;
bool2 v2b = false;
bool2 v2b_2 = false;
for(int i = 0; (i < 2); i = (i + 1)) {
for(int i = 0; (i < 2); i = as_type<int>((as_type<uint>(i) + as_type<uint>(1)))) {
v2f[i] = 1.0f;
v3i[i] = 1;
v4u[i] = 1u;

View File

@@ -14,7 +14,7 @@ kernel void tint_symbol() {
bool2 v2b = false;
bool3 v3b = false;
bool4 v4b = false;
for(int i = 0; (i < 2); i = (i + 1)) {
for(int i = 0; (i < 2); i = as_type<int>((as_type<uint>(i) + as_type<uint>(1)))) {
v2f[i] = 1.0f;
v2i[i] = 1;
v2u[i] = 1u;