added tests for rcp/rsqrt double
This commit is contained in:
16
tests/test-147.ispc
Normal file
16
tests/test-147.ispc
Normal file
@@ -0,0 +1,16 @@
|
||||
|
||||
export uniform int width() { return programCount; }
|
||||
|
||||
|
||||
export void f_f(uniform float RET[], uniform float aFOO[]) {
|
||||
double x = aFOO[programIndex&0x3];
|
||||
double d, ix;
|
||||
ix = rcp(x);
|
||||
d = (ix - 1.0d0 / x);
|
||||
d = (d < 0.0d0) ? -d : d;
|
||||
RET[programIndex] = (d < 1d-7) ? 1.0d0 : 0.0d0;
|
||||
}
|
||||
|
||||
export void result(uniform float RET[]) {
|
||||
RET[programIndex] = 1.0d0;
|
||||
}
|
||||
16
tests/test-148.ispc
Normal file
16
tests/test-148.ispc
Normal file
@@ -0,0 +1,16 @@
|
||||
|
||||
export uniform int width() { return programCount; }
|
||||
|
||||
|
||||
export void f_f(uniform float RET[], uniform float aFOO[]) {
|
||||
double x = aFOO[programIndex];
|
||||
double d, invsqrt = rsqrt(x);
|
||||
d = (x * (invsqrt * invsqrt)) - 1.0d0;
|
||||
if (d < 0.0d0) d = -d;
|
||||
RET[programIndex] = d > 1d-5;
|
||||
}
|
||||
|
||||
|
||||
export void result(uniform float RET[]) {
|
||||
RET[programIndex] = 0;
|
||||
}
|
||||
Reference in New Issue
Block a user