Choose type for integer literals to match the target mask size (if possible).
On a target with a 16-bit mask (for example), we would choose the type of an integer literal "1024" to be an int16. Previously, we used an int32, which is a worse fit and leads to less efficient code than an int16 on a 16-bit mask target. (However, we'd still give an integer literal 1000000 the type int32, even in a 16-bit target.) Updated the tests to still pass with 8 and 16-bit targets, given this change.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
// Illegal to assign to array type "varying float[5]"
|
||||
// Illegal to assign to array type "varying float\[5\]"
|
||||
|
||||
void foo(float *x) {
|
||||
float a[5] = { 1,2,3,4,5};
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Illegal to assign to array type "varying float[5]"
|
||||
// Illegal to assign to array type "varying float\[5\]"
|
||||
|
||||
void foo(float *x) {
|
||||
float a[5] = { 1,2,3,4,5};
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Illegal to use ^= operator with floating-point
|
||||
// Illegal to use \^= operator with floating-point
|
||||
|
||||
float foo(float a, float b) {
|
||||
return a ^= b;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Can't convert argument of type "void * uniform" to type "varying float" for function call argument.
|
||||
// Can't convert argument of type "void \* uniform" to type "varying float" for function call argument.
|
||||
|
||||
float bar(float a, float b);
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Too few parameter values provided in function call (1 provided, 2 expected).
|
||||
// Too few parameter values provided in function call \(1 provided, 2 expected\).
|
||||
|
||||
float bar(float a, float b);
|
||||
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
// Initializer list for array "varying int32[2][4]" must have no more than 2 elements (has 3)
|
||||
// Initializer list for array "varying int32\[2\]\[4\]" must have no more than 2 elements \(has 3\)
|
||||
|
||||
int a[2][4] = { { 1, 2, 3 }, { 1, 2, 3, 4 }, 1 };
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// Type conversion from "const uniform int32" to "uniform int32 * varying" for initializer is not possible
|
||||
// Type conversion from "const uniform int32" to "uniform int32 \* varying" for initializer is not possible
|
||||
|
||||
int voo() {
|
||||
int * varying foo = 1;
|
||||
int * varying foo = 1l;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Can't assign to type "const uniform int32" on left-hand side of expression
|
||||
// Can't assign to type "const uniform int[0-9]*" on left-hand side of expression
|
||||
|
||||
int bar(){
|
||||
4 = 0;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Can't assign to type "const uniform int32" on left-hand side of expression
|
||||
// Can't assign to type "const uniform int[0-9]*" on left-hand side of expression
|
||||
|
||||
int bar(){
|
||||
int x;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// syntax error, unexpected '('
|
||||
// syntax error, unexpected '\('
|
||||
|
||||
int * func(int a) {
|
||||
return new int[a](10);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Can't convert from type "uniform int32 * varying" to type "uniform int32 * uniform" for return
|
||||
// Can't convert from type "uniform int32 \* varying" to type "uniform int32 \* uniform" for return
|
||||
|
||||
int * uniform func(int x) {
|
||||
return new int[x];
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Can't convert from pointer type "void * varying" to incompatible pointer type "uniform int32 * varying" for return statement
|
||||
// Can't convert from pointer type "void \* varying" to incompatible pointer type "uniform int32 \* varying" for return statement
|
||||
|
||||
int *foo(void *p) {
|
||||
return p;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Can't assign to type "const uniform int32 * const varying"
|
||||
// Can't assign to type "const uniform int32 \* const varying"
|
||||
|
||||
void foo(const int * const p) {
|
||||
++p;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Pointer type cast of type "uniform int32 * uniform" to integer type "uniform int32" may lose information.
|
||||
// Pointer type cast of type "uniform int32 \* uniform" to integer type "uniform int32" may lose information.
|
||||
// rule: run on arch=x86-64
|
||||
|
||||
int32 foo(int * uniform x) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// syntax error, unexpected '*',
|
||||
// syntax error, unexpected '\*',
|
||||
|
||||
void foo(int & * x) {
|
||||
*x = NULL;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Type conversion from "const uniform int32" to "soa<4> struct Foo" for assignment operator is not possible
|
||||
// Type conversion from "const uniform int[0-9]*" to "soa<4> struct Foo" for assignment operator is not possible
|
||||
|
||||
struct Pt { float x, y, z; };
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Can't convert between types "const uniform int32" and "soa<4> float" with different SOA widths
|
||||
// Can't convert between types "const uniform int[0-9]*" and "soa<4> float" with different SOA widths
|
||||
|
||||
struct Pt { float x, y, z; };
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// syntax error, unexpected '-', expecting int32 constant
|
||||
// syntax error, unexpected '-', expecting int
|
||||
|
||||
struct F { float a, b, c; };
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// syntax error, unexpected '-', expecting int32 constant
|
||||
// syntax error, unexpected '-', expecting int
|
||||
|
||||
struct F { float a, b, c; };
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Can't convert from pointer to SOA type "soa<8> struct A * uniform" to pointer to non-SOA type "void * varying"
|
||||
// Can't convert from pointer to SOA type "soa<8> struct A \* uniform" to pointer to non-SOA type "void \* varying"
|
||||
|
||||
struct A { float a, b; };
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Assignment operator "+=" is illegal with struct type
|
||||
// Assignment operator "\+=" is illegal with struct type
|
||||
|
||||
struct Point { float x, y, z; };
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// syntax error, unexpected identifier, expecting int32 constant
|
||||
// syntax error, unexpected identifier, expecting int
|
||||
|
||||
void foo(uniform int i) {
|
||||
float<i> a;
|
||||
|
||||
Reference in New Issue
Block a user