Saturation arithmetic mul and div for int8/int16/int32 and div for int64 was added

This commit is contained in:
Vsevolod Livinskij
2014-02-18 02:07:13 +04:00
parent f5508db24f
commit 735e6a8ab3
29 changed files with 931 additions and 0 deletions

21
tests/pdivus_vi32.ispc Normal file
View File

@@ -0,0 +1,21 @@
export uniform int width() { return programCount; }
export void f_fu(uniform float RET[], uniform float aFOO[], uniform float b) {
varying unsigned int32 a_max = 4294967295, a_min = 0; // max and min unsigned int32
if (programIndex % 2 == 0) {
RET[programIndex] = saturating_div(a_min, (varying unsigned int32) b);
}
else {
RET[programIndex] = saturating_div(a_max, (varying unsigned int32) b);
}
}
export void result(uniform float RET[]) {
if (programIndex % 2 == 0) {
RET[programIndex] = (varying unsigned int32) 0;
}
else {
RET[programIndex] = (varying unsigned int32) 858993459;
}
}