Added tests for saturation and some fixes for generic and avx target

This commit is contained in:
Vsevolod Livinskij
2013-12-05 00:34:14 +04:00
parent d46a54348a
commit 65768c20ae
27 changed files with 288 additions and 11 deletions

11
tests/padds_i16.ispc Normal file
View 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
View 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
View 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
View 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
View 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
View 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
View 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
View 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
View 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
View 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
View 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
View 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
View 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
View 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
View 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
View 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;
}