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

This reverts commit e5dbe24e94.

Reason for revert: Makes the Tint-Dawn roll fails because of
MSL compilation errors on as_type<uint>(-2147483648):
as_type cast from 'long' to 'uint' (aka 'unsigned int') is not allowed
   
as_type<uint>(-2147483647) compiles fine, so this is most
likely because the MSL compiler types the literal as a long
(since without the - it is larger than the max int32).

Original change's description:
> 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>

TBR=dneto@google.com,bclayton@google.com,jrprice@google.com,amaiorano@google.com,noreply+kokoro@google.com,tint-scoped@luci-project-accounts.iam.gserviceaccount.com

Change-Id: I3e3384a9185013bb141a1b7b9b22bad8571bbc50
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: tint:124
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/60345
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
This commit is contained in:
Corentin Wallez
2021-07-30 08:22:58 +00:00
committed by Tint LUCI CQ
parent 13969024c9
commit e33b0baa08
651 changed files with 3048 additions and 3963 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 = as_type<int>((as_type<uint>(i) + as_type<uint>(1)))) {
for(int i = 0; (i < 2); i = (i + 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 = as_type<int>((as_type<uint>(i) + as_type<uint>(1)))) {
for(int i = 0; (i < 2); i = (i + 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 = as_type<int>((as_type<uint>(i) + as_type<uint>(1)))) {
for(int i = 0; (i < 2); i = (i + 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 = as_type<int>((as_type<uint>(i) + as_type<uint>(1)))) {
for(int i = 0; (i < 2); i = (i + 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 = as_type<int>((as_type<uint>(i) + as_type<uint>(1)))) {
for(int i = 0; (i < 2); i = (i + 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 = as_type<int>((as_type<uint>(i) + as_type<uint>(1)))) {
for(int i = 0; (i < 2); i = (i + 1)) {
v2f[i] = 1.0f;
v2i[i] = 1;
v2u[i] = 1u;