diff --git a/tests/gather-double-1.ispc b/tests/gather-double-1.ispc new file mode 100644 index 00000000..64575545 --- /dev/null +++ b/tests/gather-double-1.ispc @@ -0,0 +1,17 @@ + +export uniform int width() { return programCount; } + +int zero = 0; + +export void f_f(uniform float RET[], uniform float aFOO[]) { + uniform double a[programCount]; + for (uniform int i = 0; i < programCount; ++i) + a[i] = aFOO[i]; + + int g = a[programIndex+zero]; + RET[programIndex] = g; +} + +export void result(uniform float RET[]) { + RET[programIndex] = 1 + programIndex; +} diff --git a/tests/gather-double-2.ispc b/tests/gather-double-2.ispc new file mode 100644 index 00000000..78b9423a --- /dev/null +++ b/tests/gather-double-2.ispc @@ -0,0 +1,17 @@ + +export uniform int width() { return programCount; } + +int64 zero = 0; + +export void f_f(uniform float RET[], uniform float aFOO[]) { + uniform double a[programCount]; + for (uniform int i = 0; i < programCount; ++i) + a[i] = aFOO[i]; + + int g = a[programIndex+zero]; + RET[programIndex] = g; +} + +export void result(uniform float RET[]) { + RET[programIndex] = 1 + programIndex; +} diff --git a/tests/gather-double-3.ispc b/tests/gather-double-3.ispc new file mode 100644 index 00000000..cfa32f21 --- /dev/null +++ b/tests/gather-double-3.ispc @@ -0,0 +1,21 @@ + +export uniform int width() { return programCount; } + +int zero = 0; + +export void f_f(uniform float RET[], uniform float aFOO[]) { + uniform double a[programCount]; + for (uniform int i = 0; i < programCount; ++i) + a[i] = aFOO[i]; + + int g = 0; + if (programIndex < 2) + g = a[programIndex+zero]; + RET[programIndex] = g; +} + +export void result(uniform float RET[]) { + RET[programIndex] = 0; + RET[0] = 1; + RET[1] = 2; +} diff --git a/tests/gather-double-4.ispc b/tests/gather-double-4.ispc new file mode 100644 index 00000000..d7ad2f5e --- /dev/null +++ b/tests/gather-double-4.ispc @@ -0,0 +1,21 @@ + +export uniform int width() { return programCount; } + +int64 zero = 0; + +export void f_f(uniform float RET[], uniform float aFOO[]) { + uniform double a[programCount]; + for (uniform int i = 0; i < programCount; ++i) + a[i] = aFOO[i]; + + int g = 0; + if (programIndex < 2) + g = a[programIndex+zero]; + RET[programIndex] = g; +} + +export void result(uniform float RET[]) { + RET[programIndex] = 0; + RET[0] = 1; + RET[1] = 2; +} diff --git a/tests/gather-double-5.ispc b/tests/gather-double-5.ispc new file mode 100644 index 00000000..3b97816a --- /dev/null +++ b/tests/gather-double-5.ispc @@ -0,0 +1,19 @@ + +export uniform int width() { return programCount; } + +int zero = 0; +void *gptr; + +export void f_f(uniform float RET[], uniform float aFOO[]) { + uniform double a[programCount]; + for (uniform int i = 0; i < programCount; ++i) + a[i] = aFOO[i]; + + double *ptr = (aFOO[0] == 1234) ? (double * varying)gptr : (a + programIndex); + int g = *ptr; + RET[programIndex] = g; +} + +export void result(uniform float RET[]) { + RET[programIndex] = 1 + programIndex; +} diff --git a/tests/gather-double-6.ispc b/tests/gather-double-6.ispc new file mode 100644 index 00000000..1c464bd5 --- /dev/null +++ b/tests/gather-double-6.ispc @@ -0,0 +1,19 @@ + +export uniform int width() { return programCount; } + +int64 zero = 0; +void *gptr; + +export void f_f(uniform float RET[], uniform float aFOO[]) { + uniform double a[programCount]; + for (uniform int i = 0; i < programCount; ++i) + a[i] = aFOO[i]; + + double *ptr = (aFOO[0] == 1234) ? (double * varying)gptr : (a + programIndex); + int g = *ptr; + RET[programIndex] = g; +} + +export void result(uniform float RET[]) { + RET[programIndex] = 1 + programIndex; +} diff --git a/tests/gather-double-7.ispc b/tests/gather-double-7.ispc new file mode 100644 index 00000000..c73f3b4e --- /dev/null +++ b/tests/gather-double-7.ispc @@ -0,0 +1,23 @@ + +export uniform int width() { return programCount; } + +int zero = 0; +void *gptr; + +export void f_f(uniform float RET[], uniform float aFOO[]) { + uniform double a[programCount]; + for (uniform int i = 0; i < programCount; ++i) + a[i] = aFOO[i]; + + int g = 0; + double *ptr = (aFOO[0] == 1234) ? (double * varying)gptr : (a + programIndex); + if (programIndex < 2) + g = *ptr; + RET[programIndex] = g; +} + +export void result(uniform float RET[]) { + RET[programIndex] = 0; + RET[0] = 1; + RET[1] = 2; +} diff --git a/tests/gather-double-8.ispc b/tests/gather-double-8.ispc new file mode 100644 index 00000000..52da874d --- /dev/null +++ b/tests/gather-double-8.ispc @@ -0,0 +1,23 @@ + +export uniform int width() { return programCount; } + +int64 zero = 0; +void *gptr; + +export void f_f(uniform float RET[], uniform float aFOO[]) { + uniform double a[programCount]; + for (uniform int i = 0; i < programCount; ++i) + a[i] = aFOO[i]; + + int g = 0; + double *ptr = (aFOO[0] == 1234) ? (double * varying)gptr : (a + programIndex); + if (programIndex < 2) + g = *ptr; + RET[programIndex] = g; +} + +export void result(uniform float RET[]) { + RET[programIndex] = 0; + RET[0] = 1; + RET[1] = 2; +} diff --git a/tests/gather-float-1.ispc b/tests/gather-float-1.ispc new file mode 100644 index 00000000..18b3fd98 --- /dev/null +++ b/tests/gather-float-1.ispc @@ -0,0 +1,17 @@ + +export uniform int width() { return programCount; } + +int zero = 0; + +export void f_f(uniform float RET[], uniform float aFOO[]) { + uniform float a[programCount]; + for (uniform int i = 0; i < programCount; ++i) + a[i] = aFOO[i]; + + int g = a[programIndex+zero]; + RET[programIndex] = g; +} + +export void result(uniform float RET[]) { + RET[programIndex] = 1 + programIndex; +} diff --git a/tests/gather-float-2.ispc b/tests/gather-float-2.ispc new file mode 100644 index 00000000..4f680814 --- /dev/null +++ b/tests/gather-float-2.ispc @@ -0,0 +1,17 @@ + +export uniform int width() { return programCount; } + +int64 zero = 0; + +export void f_f(uniform float RET[], uniform float aFOO[]) { + uniform float a[programCount]; + for (uniform int i = 0; i < programCount; ++i) + a[i] = aFOO[i]; + + int g = a[programIndex+zero]; + RET[programIndex] = g; +} + +export void result(uniform float RET[]) { + RET[programIndex] = 1 + programIndex; +} diff --git a/tests/gather-float-3.ispc b/tests/gather-float-3.ispc new file mode 100644 index 00000000..9e81cd06 --- /dev/null +++ b/tests/gather-float-3.ispc @@ -0,0 +1,21 @@ + +export uniform int width() { return programCount; } + +int zero = 0; + +export void f_f(uniform float RET[], uniform float aFOO[]) { + uniform float a[programCount]; + for (uniform int i = 0; i < programCount; ++i) + a[i] = aFOO[i]; + + int g = 0; + if (programIndex < 2) + g = a[programIndex+zero]; + RET[programIndex] = g; +} + +export void result(uniform float RET[]) { + RET[programIndex] = 0; + RET[0] = 1; + RET[1] = 2; +} diff --git a/tests/gather-float-4.ispc b/tests/gather-float-4.ispc new file mode 100644 index 00000000..4f114fee --- /dev/null +++ b/tests/gather-float-4.ispc @@ -0,0 +1,21 @@ + +export uniform int width() { return programCount; } + +int64 zero = 0; + +export void f_f(uniform float RET[], uniform float aFOO[]) { + uniform float a[programCount]; + for (uniform int i = 0; i < programCount; ++i) + a[i] = aFOO[i]; + + int g = 0; + if (programIndex < 2) + g = a[programIndex+zero]; + RET[programIndex] = g; +} + +export void result(uniform float RET[]) { + RET[programIndex] = 0; + RET[0] = 1; + RET[1] = 2; +} diff --git a/tests/gather-float-5.ispc b/tests/gather-float-5.ispc new file mode 100644 index 00000000..16f0e81e --- /dev/null +++ b/tests/gather-float-5.ispc @@ -0,0 +1,19 @@ + +export uniform int width() { return programCount; } + +int zero = 0; +void *gptr; + +export void f_f(uniform float RET[], uniform float aFOO[]) { + uniform float a[programCount]; + for (uniform int i = 0; i < programCount; ++i) + a[i] = aFOO[i]; + + float *ptr = (aFOO[0] == 1234) ? (float * varying)gptr : (a + programIndex); + int g = *ptr; + RET[programIndex] = g; +} + +export void result(uniform float RET[]) { + RET[programIndex] = 1 + programIndex; +} diff --git a/tests/gather-float-6.ispc b/tests/gather-float-6.ispc new file mode 100644 index 00000000..d1136f9a --- /dev/null +++ b/tests/gather-float-6.ispc @@ -0,0 +1,19 @@ + +export uniform int width() { return programCount; } + +int64 zero = 0; +void *gptr; + +export void f_f(uniform float RET[], uniform float aFOO[]) { + uniform float a[programCount]; + for (uniform int i = 0; i < programCount; ++i) + a[i] = aFOO[i]; + + float *ptr = (aFOO[0] == 1234) ? (float * varying)gptr : (a + programIndex); + int g = *ptr; + RET[programIndex] = g; +} + +export void result(uniform float RET[]) { + RET[programIndex] = 1 + programIndex; +} diff --git a/tests/gather-float-7.ispc b/tests/gather-float-7.ispc new file mode 100644 index 00000000..f5b09dc4 --- /dev/null +++ b/tests/gather-float-7.ispc @@ -0,0 +1,23 @@ + +export uniform int width() { return programCount; } + +int zero = 0; +void *gptr; + +export void f_f(uniform float RET[], uniform float aFOO[]) { + uniform float a[programCount]; + for (uniform int i = 0; i < programCount; ++i) + a[i] = aFOO[i]; + + int g = 0; + float *ptr = (aFOO[0] == 1234) ? (float * varying)gptr : (a + programIndex); + if (programIndex < 2) + g = *ptr; + RET[programIndex] = g; +} + +export void result(uniform float RET[]) { + RET[programIndex] = 0; + RET[0] = 1; + RET[1] = 2; +} diff --git a/tests/gather-float-8.ispc b/tests/gather-float-8.ispc new file mode 100644 index 00000000..3708f063 --- /dev/null +++ b/tests/gather-float-8.ispc @@ -0,0 +1,23 @@ + +export uniform int width() { return programCount; } + +int64 zero = 0; +void *gptr; + +export void f_f(uniform float RET[], uniform float aFOO[]) { + uniform float a[programCount]; + for (uniform int i = 0; i < programCount; ++i) + a[i] = aFOO[i]; + + int g = 0; + float *ptr = (aFOO[0] == 1234) ? (float * varying)gptr : (a + programIndex); + if (programIndex < 2) + g = *ptr; + RET[programIndex] = g; +} + +export void result(uniform float RET[]) { + RET[programIndex] = 0; + RET[0] = 1; + RET[1] = 2; +} diff --git a/tests/gather-int16-1.ispc b/tests/gather-int16-1.ispc index e6bedd7f..89675185 100644 --- a/tests/gather-int16-1.ispc +++ b/tests/gather-int16-1.ispc @@ -1,19 +1,17 @@ + export uniform int width() { return programCount; } -export void f_fu(uniform float RET[], uniform float aFOO[], uniform float b) { - uniform int16 x[programCount]; - x[programIndex] = programIndex; - int a = aFOO[programIndex]-1; - unsigned int16 v; - if (programIndex < 2) - v = x[a]; - else - v = 2; - RET[programIndex] = v; +int zero = 0; + +export void f_f(uniform float RET[], uniform float aFOO[]) { + uniform int16 a[programCount]; + for (uniform int i = 0; i < programCount; ++i) + a[i] = aFOO[i]; + + int g = a[programIndex+zero]; + RET[programIndex] = g; } export void result(uniform float RET[]) { - RET[programIndex] = 2; - RET[0] = 0; - RET[1] = 1; + RET[programIndex] = 1 + programIndex; } diff --git a/tests/gather-int16-2.ispc b/tests/gather-int16-2.ispc new file mode 100644 index 00000000..74fdab8c --- /dev/null +++ b/tests/gather-int16-2.ispc @@ -0,0 +1,17 @@ + +export uniform int width() { return programCount; } + +int64 zero = 0; + +export void f_f(uniform float RET[], uniform float aFOO[]) { + uniform int16 a[programCount]; + for (uniform int i = 0; i < programCount; ++i) + a[i] = aFOO[i]; + + int g = a[programIndex+zero]; + RET[programIndex] = g; +} + +export void result(uniform float RET[]) { + RET[programIndex] = 1 + programIndex; +} diff --git a/tests/gather-int16-3.ispc b/tests/gather-int16-3.ispc new file mode 100644 index 00000000..a197f754 --- /dev/null +++ b/tests/gather-int16-3.ispc @@ -0,0 +1,21 @@ + +export uniform int width() { return programCount; } + +int zero = 0; + +export void f_f(uniform float RET[], uniform float aFOO[]) { + uniform int16 a[programCount]; + for (uniform int i = 0; i < programCount; ++i) + a[i] = aFOO[i]; + + int g = 0; + if (programIndex < 2) + g = a[programIndex+zero]; + RET[programIndex] = g; +} + +export void result(uniform float RET[]) { + RET[programIndex] = 0; + RET[0] = 1; + RET[1] = 2; +} diff --git a/tests/gather-int16-4.ispc b/tests/gather-int16-4.ispc new file mode 100644 index 00000000..db9a7217 --- /dev/null +++ b/tests/gather-int16-4.ispc @@ -0,0 +1,21 @@ + +export uniform int width() { return programCount; } + +int64 zero = 0; + +export void f_f(uniform float RET[], uniform float aFOO[]) { + uniform int16 a[programCount]; + for (uniform int i = 0; i < programCount; ++i) + a[i] = aFOO[i]; + + int g = 0; + if (programIndex < 2) + g = a[programIndex+zero]; + RET[programIndex] = g; +} + +export void result(uniform float RET[]) { + RET[programIndex] = 0; + RET[0] = 1; + RET[1] = 2; +} diff --git a/tests/gather-int16-5.ispc b/tests/gather-int16-5.ispc new file mode 100644 index 00000000..8d6ced77 --- /dev/null +++ b/tests/gather-int16-5.ispc @@ -0,0 +1,19 @@ + +export uniform int width() { return programCount; } + +int zero = 0; +void *gptr; + +export void f_f(uniform float RET[], uniform float aFOO[]) { + uniform int16 a[programCount]; + for (uniform int i = 0; i < programCount; ++i) + a[i] = aFOO[i]; + + int16 *ptr = (aFOO[0] == 1234) ? (int16 * varying)gptr : (a + programIndex); + int g = *ptr; + RET[programIndex] = g; +} + +export void result(uniform float RET[]) { + RET[programIndex] = 1 + programIndex; +} diff --git a/tests/gather-int16-6.ispc b/tests/gather-int16-6.ispc new file mode 100644 index 00000000..8d740856 --- /dev/null +++ b/tests/gather-int16-6.ispc @@ -0,0 +1,19 @@ + +export uniform int width() { return programCount; } + +int64 zero = 0; +void *gptr; + +export void f_f(uniform float RET[], uniform float aFOO[]) { + uniform int16 a[programCount]; + for (uniform int i = 0; i < programCount; ++i) + a[i] = aFOO[i]; + + int16 *ptr = (aFOO[0] == 1234) ? (int16 * varying)gptr : (a + programIndex); + int g = *ptr; + RET[programIndex] = g; +} + +export void result(uniform float RET[]) { + RET[programIndex] = 1 + programIndex; +} diff --git a/tests/gather-int16-7.ispc b/tests/gather-int16-7.ispc new file mode 100644 index 00000000..a6236af5 --- /dev/null +++ b/tests/gather-int16-7.ispc @@ -0,0 +1,23 @@ + +export uniform int width() { return programCount; } + +int zero = 0; +void *gptr; + +export void f_f(uniform float RET[], uniform float aFOO[]) { + uniform int16 a[programCount]; + for (uniform int i = 0; i < programCount; ++i) + a[i] = aFOO[i]; + + int g = 0; + int16 *ptr = (aFOO[0] == 1234) ? (int16 * varying)gptr : (a + programIndex); + if (programIndex < 2) + g = *ptr; + RET[programIndex] = g; +} + +export void result(uniform float RET[]) { + RET[programIndex] = 0; + RET[0] = 1; + RET[1] = 2; +} diff --git a/tests/gather-int16-8.ispc b/tests/gather-int16-8.ispc new file mode 100644 index 00000000..66bc8e89 --- /dev/null +++ b/tests/gather-int16-8.ispc @@ -0,0 +1,23 @@ + +export uniform int width() { return programCount; } + +int64 zero = 0; +void *gptr; + +export void f_f(uniform float RET[], uniform float aFOO[]) { + uniform int16 a[programCount]; + for (uniform int i = 0; i < programCount; ++i) + a[i] = aFOO[i]; + + int g = 0; + int16 *ptr = (aFOO[0] == 1234) ? (int16 * varying)gptr : (a + programIndex); + if (programIndex < 2) + g = *ptr; + RET[programIndex] = g; +} + +export void result(uniform float RET[]) { + RET[programIndex] = 0; + RET[0] = 1; + RET[1] = 2; +} diff --git a/tests/gather-int32-1.ispc b/tests/gather-int32-1.ispc new file mode 100644 index 00000000..2df1dd7e --- /dev/null +++ b/tests/gather-int32-1.ispc @@ -0,0 +1,17 @@ + +export uniform int width() { return programCount; } + +int zero = 0; + +export void f_f(uniform float RET[], uniform float aFOO[]) { + uniform int a[programCount]; + for (uniform int i = 0; i < programCount; ++i) + a[i] = aFOO[i]; + + int g = a[programIndex+zero]; + RET[programIndex] = g; +} + +export void result(uniform float RET[]) { + RET[programIndex] = 1 + programIndex; +} diff --git a/tests/gather-int32-2.ispc b/tests/gather-int32-2.ispc new file mode 100644 index 00000000..61f5a024 --- /dev/null +++ b/tests/gather-int32-2.ispc @@ -0,0 +1,17 @@ + +export uniform int width() { return programCount; } + +int64 zero = 0; + +export void f_f(uniform float RET[], uniform float aFOO[]) { + uniform int a[programCount]; + for (uniform int i = 0; i < programCount; ++i) + a[i] = aFOO[i]; + + int g = a[programIndex+zero]; + RET[programIndex] = g; +} + +export void result(uniform float RET[]) { + RET[programIndex] = 1 + programIndex; +} diff --git a/tests/gather-int32-3.ispc b/tests/gather-int32-3.ispc new file mode 100644 index 00000000..e87eab33 --- /dev/null +++ b/tests/gather-int32-3.ispc @@ -0,0 +1,21 @@ + +export uniform int width() { return programCount; } + +int zero = 0; + +export void f_f(uniform float RET[], uniform float aFOO[]) { + uniform int a[programCount]; + for (uniform int i = 0; i < programCount; ++i) + a[i] = aFOO[i]; + + int g = 0; + if (programIndex < 2) + g = a[programIndex+zero]; + RET[programIndex] = g; +} + +export void result(uniform float RET[]) { + RET[programIndex] = 0; + RET[0] = 1; + RET[1] = 2; +} diff --git a/tests/gather-int32-4.ispc b/tests/gather-int32-4.ispc new file mode 100644 index 00000000..8a6d7bb6 --- /dev/null +++ b/tests/gather-int32-4.ispc @@ -0,0 +1,21 @@ + +export uniform int width() { return programCount; } + +int64 zero = 0; + +export void f_f(uniform float RET[], uniform float aFOO[]) { + uniform int a[programCount]; + for (uniform int i = 0; i < programCount; ++i) + a[i] = aFOO[i]; + + int g = 0; + if (programIndex < 2) + g = a[programIndex+zero]; + RET[programIndex] = g; +} + +export void result(uniform float RET[]) { + RET[programIndex] = 0; + RET[0] = 1; + RET[1] = 2; +} diff --git a/tests/gather-int32-5.ispc b/tests/gather-int32-5.ispc new file mode 100644 index 00000000..573666c7 --- /dev/null +++ b/tests/gather-int32-5.ispc @@ -0,0 +1,19 @@ + +export uniform int width() { return programCount; } + +int zero = 0; +void *gptr; + +export void f_f(uniform float RET[], uniform float aFOO[]) { + uniform int a[programCount]; + for (uniform int i = 0; i < programCount; ++i) + a[i] = aFOO[i]; + + int *ptr = (aFOO[0] == 1234) ? (int * varying)gptr : (a + programIndex); + int g = *ptr; + RET[programIndex] = g; +} + +export void result(uniform float RET[]) { + RET[programIndex] = 1 + programIndex; +} diff --git a/tests/gather-int32-6.ispc b/tests/gather-int32-6.ispc new file mode 100644 index 00000000..0d59a8fc --- /dev/null +++ b/tests/gather-int32-6.ispc @@ -0,0 +1,19 @@ + +export uniform int width() { return programCount; } + +int64 zero = 0; +void *gptr; + +export void f_f(uniform float RET[], uniform float aFOO[]) { + uniform int a[programCount]; + for (uniform int i = 0; i < programCount; ++i) + a[i] = aFOO[i]; + + int *ptr = (aFOO[0] == 1234) ? (int * varying)gptr : (a + programIndex); + int g = *ptr; + RET[programIndex] = g; +} + +export void result(uniform float RET[]) { + RET[programIndex] = 1 + programIndex; +} diff --git a/tests/gather-int32-7.ispc b/tests/gather-int32-7.ispc new file mode 100644 index 00000000..ebc724e5 --- /dev/null +++ b/tests/gather-int32-7.ispc @@ -0,0 +1,23 @@ + +export uniform int width() { return programCount; } + +int zero = 0; +void *gptr; + +export void f_f(uniform float RET[], uniform float aFOO[]) { + uniform int a[programCount]; + for (uniform int i = 0; i < programCount; ++i) + a[i] = aFOO[i]; + + int g = 0; + int *ptr = (aFOO[0] == 1234) ? (int * varying)gptr : (a + programIndex); + if (programIndex < 2) + g = *ptr; + RET[programIndex] = g; +} + +export void result(uniform float RET[]) { + RET[programIndex] = 0; + RET[0] = 1; + RET[1] = 2; +} diff --git a/tests/gather-int32-8.ispc b/tests/gather-int32-8.ispc new file mode 100644 index 00000000..03cd7c8b --- /dev/null +++ b/tests/gather-int32-8.ispc @@ -0,0 +1,23 @@ + +export uniform int width() { return programCount; } + +int64 zero = 0; +void *gptr; + +export void f_f(uniform float RET[], uniform float aFOO[]) { + uniform int a[programCount]; + for (uniform int i = 0; i < programCount; ++i) + a[i] = aFOO[i]; + + int g = 0; + int *ptr = (aFOO[0] == 1234) ? (int * varying)gptr : (a + programIndex); + if (programIndex < 2) + g = *ptr; + RET[programIndex] = g; +} + +export void result(uniform float RET[]) { + RET[programIndex] = 0; + RET[0] = 1; + RET[1] = 2; +} diff --git a/tests/gather-int64-1.ispc b/tests/gather-int64-1.ispc new file mode 100644 index 00000000..fe3d171b --- /dev/null +++ b/tests/gather-int64-1.ispc @@ -0,0 +1,17 @@ + +export uniform int width() { return programCount; } + +int zero = 0; + +export void f_f(uniform float RET[], uniform float aFOO[]) { + uniform int64 a[programCount]; + for (uniform int i = 0; i < programCount; ++i) + a[i] = aFOO[i]; + + int g = a[programIndex+zero]; + RET[programIndex] = g; +} + +export void result(uniform float RET[]) { + RET[programIndex] = 1 + programIndex; +} diff --git a/tests/gather-int64-2.ispc b/tests/gather-int64-2.ispc new file mode 100644 index 00000000..7a00439b --- /dev/null +++ b/tests/gather-int64-2.ispc @@ -0,0 +1,17 @@ + +export uniform int width() { return programCount; } + +int64 zero = 0; + +export void f_f(uniform float RET[], uniform float aFOO[]) { + uniform int64 a[programCount]; + for (uniform int i = 0; i < programCount; ++i) + a[i] = aFOO[i]; + + int g = a[programIndex+zero]; + RET[programIndex] = g; +} + +export void result(uniform float RET[]) { + RET[programIndex] = 1 + programIndex; +} diff --git a/tests/gather-int64-3.ispc b/tests/gather-int64-3.ispc new file mode 100644 index 00000000..7ddd559c --- /dev/null +++ b/tests/gather-int64-3.ispc @@ -0,0 +1,21 @@ + +export uniform int width() { return programCount; } + +int zero = 0; + +export void f_f(uniform float RET[], uniform float aFOO[]) { + uniform int64 a[programCount]; + for (uniform int i = 0; i < programCount; ++i) + a[i] = aFOO[i]; + + int g = 0; + if (programIndex < 2) + g = a[programIndex+zero]; + RET[programIndex] = g; +} + +export void result(uniform float RET[]) { + RET[programIndex] = 0; + RET[0] = 1; + RET[1] = 2; +} diff --git a/tests/gather-int64-4.ispc b/tests/gather-int64-4.ispc new file mode 100644 index 00000000..92e004e3 --- /dev/null +++ b/tests/gather-int64-4.ispc @@ -0,0 +1,21 @@ + +export uniform int width() { return programCount; } + +int64 zero = 0; + +export void f_f(uniform float RET[], uniform float aFOO[]) { + uniform int64 a[programCount]; + for (uniform int i = 0; i < programCount; ++i) + a[i] = aFOO[i]; + + int g = 0; + if (programIndex < 2) + g = a[programIndex+zero]; + RET[programIndex] = g; +} + +export void result(uniform float RET[]) { + RET[programIndex] = 0; + RET[0] = 1; + RET[1] = 2; +} diff --git a/tests/gather-int64-5.ispc b/tests/gather-int64-5.ispc new file mode 100644 index 00000000..76d95f2d --- /dev/null +++ b/tests/gather-int64-5.ispc @@ -0,0 +1,19 @@ + +export uniform int width() { return programCount; } + +int zero = 0; +void *gptr; + +export void f_f(uniform float RET[], uniform float aFOO[]) { + uniform int64 a[programCount]; + for (uniform int i = 0; i < programCount; ++i) + a[i] = aFOO[i]; + + int64 *ptr = (aFOO[0] == 1234) ? (int64 * varying)gptr : (a + programIndex); + int g = *ptr; + RET[programIndex] = g; +} + +export void result(uniform float RET[]) { + RET[programIndex] = 1 + programIndex; +} diff --git a/tests/gather-int64-6.ispc b/tests/gather-int64-6.ispc new file mode 100644 index 00000000..9deaaa80 --- /dev/null +++ b/tests/gather-int64-6.ispc @@ -0,0 +1,19 @@ + +export uniform int width() { return programCount; } + +int64 zero = 0; +void *gptr; + +export void f_f(uniform float RET[], uniform float aFOO[]) { + uniform int64 a[programCount]; + for (uniform int i = 0; i < programCount; ++i) + a[i] = aFOO[i]; + + int64 *ptr = (aFOO[0] == 1234) ? (int64 * varying)gptr : (a + programIndex); + int g = *ptr; + RET[programIndex] = g; +} + +export void result(uniform float RET[]) { + RET[programIndex] = 1 + programIndex; +} diff --git a/tests/gather-int64-7.ispc b/tests/gather-int64-7.ispc new file mode 100644 index 00000000..52df9d19 --- /dev/null +++ b/tests/gather-int64-7.ispc @@ -0,0 +1,23 @@ + +export uniform int width() { return programCount; } + +int zero = 0; +void *gptr; + +export void f_f(uniform float RET[], uniform float aFOO[]) { + uniform int64 a[programCount]; + for (uniform int i = 0; i < programCount; ++i) + a[i] = aFOO[i]; + + int g = 0; + int64 *ptr = (aFOO[0] == 1234) ? (int64 * varying)gptr : (a + programIndex); + if (programIndex < 2) + g = *ptr; + RET[programIndex] = g; +} + +export void result(uniform float RET[]) { + RET[programIndex] = 0; + RET[0] = 1; + RET[1] = 2; +} diff --git a/tests/gather-int64-8.ispc b/tests/gather-int64-8.ispc new file mode 100644 index 00000000..5cfa621b --- /dev/null +++ b/tests/gather-int64-8.ispc @@ -0,0 +1,23 @@ + +export uniform int width() { return programCount; } + +int64 zero = 0; +void *gptr; + +export void f_f(uniform float RET[], uniform float aFOO[]) { + uniform int64 a[programCount]; + for (uniform int i = 0; i < programCount; ++i) + a[i] = aFOO[i]; + + int g = 0; + int64 *ptr = (aFOO[0] == 1234) ? (int64 * varying)gptr : (a + programIndex); + if (programIndex < 2) + g = *ptr; + RET[programIndex] = g; +} + +export void result(uniform float RET[]) { + RET[programIndex] = 0; + RET[0] = 1; + RET[1] = 2; +} diff --git a/tests/gather-int8-1.ispc b/tests/gather-int8-1.ispc index 305b12ca..43961ff2 100644 --- a/tests/gather-int8-1.ispc +++ b/tests/gather-int8-1.ispc @@ -1,19 +1,17 @@ + export uniform int width() { return programCount; } -export void f_fu(uniform float RET[], uniform float aFOO[], uniform float b) { - uniform int8 x[programCount]; - x[programIndex] = programIndex; - int a = aFOO[programIndex]-1; - unsigned int8 v; - if (programIndex < 2) - v = x[a]; - else - v = 2; - RET[programIndex] = v; +int zero = 0; + +export void f_f(uniform float RET[], uniform float aFOO[]) { + uniform int8 a[programCount]; + for (uniform int i = 0; i < programCount; ++i) + a[i] = aFOO[i]; + + int g = a[programIndex+zero]; + RET[programIndex] = g; } export void result(uniform float RET[]) { - RET[programIndex] = 2; - RET[0] = 0; - RET[1] = 1; + RET[programIndex] = 1 + programIndex; } diff --git a/tests/gather-int8-2.ispc b/tests/gather-int8-2.ispc new file mode 100644 index 00000000..8e853d0e --- /dev/null +++ b/tests/gather-int8-2.ispc @@ -0,0 +1,17 @@ + +export uniform int width() { return programCount; } + +int64 zero = 0; + +export void f_f(uniform float RET[], uniform float aFOO[]) { + uniform int8 a[programCount]; + for (uniform int i = 0; i < programCount; ++i) + a[i] = aFOO[i]; + + int g = a[programIndex+zero]; + RET[programIndex] = g; +} + +export void result(uniform float RET[]) { + RET[programIndex] = 1 + programIndex; +} diff --git a/tests/gather-int8-3.ispc b/tests/gather-int8-3.ispc new file mode 100644 index 00000000..5650ab7f --- /dev/null +++ b/tests/gather-int8-3.ispc @@ -0,0 +1,21 @@ + +export uniform int width() { return programCount; } + +int zero = 0; + +export void f_f(uniform float RET[], uniform float aFOO[]) { + uniform int8 a[programCount]; + for (uniform int i = 0; i < programCount; ++i) + a[i] = aFOO[i]; + + int g = 0; + if (programIndex < 2) + g = a[programIndex+zero]; + RET[programIndex] = g; +} + +export void result(uniform float RET[]) { + RET[programIndex] = 0; + RET[0] = 1; + RET[1] = 2; +} diff --git a/tests/gather-int8-4.ispc b/tests/gather-int8-4.ispc new file mode 100644 index 00000000..92386d5a --- /dev/null +++ b/tests/gather-int8-4.ispc @@ -0,0 +1,21 @@ + +export uniform int width() { return programCount; } + +int64 zero = 0; + +export void f_f(uniform float RET[], uniform float aFOO[]) { + uniform int8 a[programCount]; + for (uniform int i = 0; i < programCount; ++i) + a[i] = aFOO[i]; + + int g = 0; + if (programIndex < 2) + g = a[programIndex+zero]; + RET[programIndex] = g; +} + +export void result(uniform float RET[]) { + RET[programIndex] = 0; + RET[0] = 1; + RET[1] = 2; +} diff --git a/tests/gather-int8-5.ispc b/tests/gather-int8-5.ispc new file mode 100644 index 00000000..d0440d77 --- /dev/null +++ b/tests/gather-int8-5.ispc @@ -0,0 +1,19 @@ + +export uniform int width() { return programCount; } + +int zero = 0; +void *gptr; + +export void f_f(uniform float RET[], uniform float aFOO[]) { + uniform int8 a[programCount]; + for (uniform int i = 0; i < programCount; ++i) + a[i] = aFOO[i]; + + int8 *ptr = (aFOO[0] == 1234) ? (int8 * varying)gptr : (a + programIndex); + int g = *ptr; + RET[programIndex] = g; +} + +export void result(uniform float RET[]) { + RET[programIndex] = 1 + programIndex; +} diff --git a/tests/gather-int8-6.ispc b/tests/gather-int8-6.ispc new file mode 100644 index 00000000..840b309c --- /dev/null +++ b/tests/gather-int8-6.ispc @@ -0,0 +1,19 @@ + +export uniform int width() { return programCount; } + +int64 zero = 0; +void *gptr; + +export void f_f(uniform float RET[], uniform float aFOO[]) { + uniform int8 a[programCount]; + for (uniform int i = 0; i < programCount; ++i) + a[i] = aFOO[i]; + + int8 *ptr = (aFOO[0] == 1234) ? (int8 * varying)gptr : (a + programIndex); + int g = *ptr; + RET[programIndex] = g; +} + +export void result(uniform float RET[]) { + RET[programIndex] = 1 + programIndex; +} diff --git a/tests/gather-int8-7.ispc b/tests/gather-int8-7.ispc new file mode 100644 index 00000000..c0190db0 --- /dev/null +++ b/tests/gather-int8-7.ispc @@ -0,0 +1,23 @@ + +export uniform int width() { return programCount; } + +int zero = 0; +void *gptr; + +export void f_f(uniform float RET[], uniform float aFOO[]) { + uniform int8 a[programCount]; + for (uniform int i = 0; i < programCount; ++i) + a[i] = aFOO[i]; + + int g = 0; + int8 *ptr = (aFOO[0] == 1234) ? (int8 * varying)gptr : (a + programIndex); + if (programIndex < 2) + g = *ptr; + RET[programIndex] = g; +} + +export void result(uniform float RET[]) { + RET[programIndex] = 0; + RET[0] = 1; + RET[1] = 2; +} diff --git a/tests/gather-int8-8.ispc b/tests/gather-int8-8.ispc new file mode 100644 index 00000000..3c5cd41e --- /dev/null +++ b/tests/gather-int8-8.ispc @@ -0,0 +1,23 @@ + +export uniform int width() { return programCount; } + +int64 zero = 0; +void *gptr; + +export void f_f(uniform float RET[], uniform float aFOO[]) { + uniform int8 a[programCount]; + for (uniform int i = 0; i < programCount; ++i) + a[i] = aFOO[i]; + + int g = 0; + int8 *ptr = (aFOO[0] == 1234) ? (int8 * varying)gptr : (a + programIndex); + if (programIndex < 2) + g = *ptr; + RET[programIndex] = g; +} + +export void result(uniform float RET[]) { + RET[programIndex] = 0; + RET[0] = 1; + RET[1] = 2; +}