Added tests for saturation and some fixes for generic and avx target
This commit is contained in:
11
tests/padds_i16.ispc
Normal file
11
tests/padds_i16.ispc
Normal file
@@ -0,0 +1,11 @@
|
||||
|
||||
export uniform int width() { return programCount; }
|
||||
|
||||
export void f_f(uniform float RET[], uniform float aFOO[]) {
|
||||
uniform int16 a = 32767, b = 32767; // max signed int16
|
||||
RET[programIndex] = padds(a, b);
|
||||
}
|
||||
|
||||
export void result(uniform float RET[]) {
|
||||
RET[programIndex] = 32767;
|
||||
}
|
||||
11
tests/padds_i8.ispc
Normal file
11
tests/padds_i8.ispc
Normal file
@@ -0,0 +1,11 @@
|
||||
|
||||
export uniform int width() { return programCount; }
|
||||
|
||||
export void f_f(uniform float RET[], uniform float aFOO[]) {
|
||||
uniform int8 a = 127, b = 127; // max signed int8
|
||||
RET[programIndex] = padds(a1, b1);
|
||||
}
|
||||
|
||||
export void result(uniform float RET[]) {
|
||||
RET[programIndex] = 127;
|
||||
}
|
||||
11
tests/padds_vi16.ispc
Normal file
11
tests/padds_vi16.ispc
Normal file
@@ -0,0 +1,11 @@
|
||||
|
||||
export uniform int width() { return programCount; }
|
||||
|
||||
export void f_f(uniform float RET[], uniform float aFOO[]) {
|
||||
varying int16 a = 32767, b = 32767; // max signed int16
|
||||
RET[programIndex] = padds(a, b);
|
||||
}
|
||||
|
||||
export void result(uniform float RET[]) {
|
||||
RET[programIndex] = 32767;
|
||||
}
|
||||
11
tests/padds_vi8.ispc
Normal file
11
tests/padds_vi8.ispc
Normal file
@@ -0,0 +1,11 @@
|
||||
|
||||
export uniform int width() { return programCount; }
|
||||
|
||||
export void f_f(uniform float RET[], uniform float aFOO[]) {
|
||||
varying int8 a = 127, b = 127; // max signed int8
|
||||
RET[programIndex] = padds(a, b);
|
||||
}
|
||||
|
||||
export void result(uniform float RET[]) {
|
||||
RET[programIndex] = 127;
|
||||
}
|
||||
11
tests/paddus_i16.ispc
Normal file
11
tests/paddus_i16.ispc
Normal file
@@ -0,0 +1,11 @@
|
||||
|
||||
export uniform int width() { return programCount; }
|
||||
|
||||
export void f_f(uniform float RET[], uniform float aFOO[]) {
|
||||
uniform int16 a = 65535, b = 65535; // max unsigned int16
|
||||
RET[programIndex] = paddus(a, b);
|
||||
}
|
||||
|
||||
export void result(uniform float RET[]) {
|
||||
RET[programIndex] = 65535;
|
||||
}
|
||||
11
tests/paddus_i8.ispc
Normal file
11
tests/paddus_i8.ispc
Normal file
@@ -0,0 +1,11 @@
|
||||
|
||||
export uniform int width() { return programCount; }
|
||||
|
||||
export void f_f(uniform float RET[], uniform float aFOO[]) {
|
||||
uniform int8 a = 255, b = 255; // max unsigned int8
|
||||
RET[programIndex] = paddus(a, b);
|
||||
}
|
||||
|
||||
export void result(uniform float RET[]) {
|
||||
RET[programIndex] = 255;
|
||||
}
|
||||
11
tests/paddus_vi16.ispc
Normal file
11
tests/paddus_vi16.ispc
Normal file
@@ -0,0 +1,11 @@
|
||||
|
||||
export uniform int width() { return programCount; }
|
||||
|
||||
export void f_f(uniform float RET[], uniform float aFOO[]) {
|
||||
varying int16 a = 65535, b = 65535; // max unsigned int16
|
||||
RET[programIndex] = paddus(a, b);
|
||||
}
|
||||
|
||||
export void result(uniform float RET[]) {
|
||||
RET[programIndex] = 65535;
|
||||
}
|
||||
11
tests/paddus_vi8.ispc
Normal file
11
tests/paddus_vi8.ispc
Normal file
@@ -0,0 +1,11 @@
|
||||
|
||||
export uniform int width() { return programCount; }
|
||||
|
||||
export void f_f(uniform float RET[], uniform float aFOO[]) {
|
||||
varying int8 a = 255, b = 255; // max unsigned int8
|
||||
RET[programIndex] = paddus(a, b);
|
||||
}
|
||||
|
||||
export void result(uniform float RET[]) {
|
||||
RET[programIndex] = 255;
|
||||
}
|
||||
11
tests/psubs_i16.ispc
Normal file
11
tests/psubs_i16.ispc
Normal file
@@ -0,0 +1,11 @@
|
||||
|
||||
export uniform int width() { return programCount; }
|
||||
|
||||
export void f_f(uniform float RET[], uniform float aFOO[]) {
|
||||
uniform int8 a = -32768, b = 32767; // min and max signed int16
|
||||
RET[programIndex] = psubs(a, b);
|
||||
}
|
||||
|
||||
export void result(uniform float RET[]) {
|
||||
RET[programIndex] = -32768;
|
||||
}
|
||||
11
tests/psubs_i8.ispc
Normal file
11
tests/psubs_i8.ispc
Normal file
@@ -0,0 +1,11 @@
|
||||
|
||||
export uniform int width() { return programCount; }
|
||||
|
||||
export void f_f(uniform float RET[], uniform float aFOO[]) {
|
||||
uniform int8 a = -128, b = 127; // min and max signed int8
|
||||
RET[programIndex] = psubs(a, b);
|
||||
}
|
||||
|
||||
export void result(uniform float RET[]) {
|
||||
RET[programIndex] = -128;
|
||||
}
|
||||
11
tests/psubs_vi16.ispc
Normal file
11
tests/psubs_vi16.ispc
Normal file
@@ -0,0 +1,11 @@
|
||||
|
||||
export uniform int width() { return programCount; }
|
||||
|
||||
export void f_f(uniform float RET[], uniform float aFOO[]) {
|
||||
varying int16 a = -32768, b = 32767; // min and max unsigned int16
|
||||
RET[programIndex] = psubs(a, b);
|
||||
}
|
||||
|
||||
export void result(uniform float RET[]) {
|
||||
RET[programIndex] = -32768;
|
||||
}
|
||||
11
tests/psubs_vi8.ispc
Normal file
11
tests/psubs_vi8.ispc
Normal file
@@ -0,0 +1,11 @@
|
||||
|
||||
export uniform int width() { return programCount; }
|
||||
|
||||
export void f_f(uniform float RET[], uniform float aFOO[]) {
|
||||
varying int8 a = -128, b = 127; // min and max unsigned int8
|
||||
RET[programIndex] = psubs(a, b);
|
||||
}
|
||||
|
||||
export void result(uniform float RET[]) {
|
||||
RET[programIndex] = -128;
|
||||
}
|
||||
11
tests/psubus_i16.ispc
Normal file
11
tests/psubus_i16.ispc
Normal file
@@ -0,0 +1,11 @@
|
||||
|
||||
export uniform int width() { return programCount; }
|
||||
|
||||
export void f_f(uniform float RET[], uniform float aFOO[]) {
|
||||
uniform int8 a = 0, b = 32767; // min and max unsigned int16
|
||||
RET[programIndex] = psubus(a, b);
|
||||
}
|
||||
|
||||
export void result(uniform float RET[]) {
|
||||
RET[programIndex] = 0;
|
||||
}
|
||||
11
tests/psubus_i8.ispc
Normal file
11
tests/psubus_i8.ispc
Normal file
@@ -0,0 +1,11 @@
|
||||
|
||||
export uniform int width() { return programCount; }
|
||||
|
||||
export void f_f(uniform float RET[], uniform float aFOO[]) {
|
||||
uniform int8 a = 0, b = 255; // min and max unsigned int8
|
||||
RET[programIndex] = psubus(a, b);
|
||||
}
|
||||
|
||||
export void result(uniform float RET[]) {
|
||||
RET[programIndex] = 0;
|
||||
}
|
||||
11
tests/psubus_vi16.ispc
Normal file
11
tests/psubus_vi16.ispc
Normal file
@@ -0,0 +1,11 @@
|
||||
|
||||
export uniform int width() { return programCount; }
|
||||
|
||||
export void f_f(uniform float RET[], uniform float aFOO[]) {
|
||||
varying int16 a = 0, b = 32767; // min and max unsigned int16
|
||||
RET[programIndex] = psubus(a, b);
|
||||
}
|
||||
|
||||
export void result(uniform float RET[]) {
|
||||
RET[programIndex] = 0;
|
||||
}
|
||||
11
tests/psubus_vi8.ispc
Normal file
11
tests/psubus_vi8.ispc
Normal file
@@ -0,0 +1,11 @@
|
||||
|
||||
export uniform int width() { return programCount; }
|
||||
|
||||
export void f_f(uniform float RET[], uniform float aFOO[]) {
|
||||
varying int8 a = 0, b = 255; // min and max unsigned int8
|
||||
RET[programIndex] = psubus(a, b);
|
||||
}
|
||||
|
||||
export void result(uniform float RET[]) {
|
||||
RET[programIndex] = 0;
|
||||
}
|
||||
Reference in New Issue
Block a user