Add support for RDRAND in IvyBridge.
The standard library now provides a variety of rdrand() functions that call out to RDRAND, when available. Issue #263.
This commit is contained in:
21
tests/rdrand-1.ispc
Normal file
21
tests/rdrand-1.ispc
Normal file
@@ -0,0 +1,21 @@
|
||||
|
||||
export uniform int width() { return programCount; }
|
||||
|
||||
export void f_f(uniform float RET[], uniform float aFOO[]) {
|
||||
#if !defined(ISPC_TARGET_AVX11) && !defined(ISPC_TARGET_AVX2)
|
||||
RET[programIndex] = 1;
|
||||
#else
|
||||
|
||||
uniform float r = -1;
|
||||
uniform int count = 0;
|
||||
while (!rdrand(&r)) {
|
||||
++count;
|
||||
}
|
||||
RET[programIndex] = (r >= 0 && r < 1);
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
export void result(uniform float RET[]) {
|
||||
RET[programIndex] = 1;
|
||||
}
|
||||
Reference in New Issue
Block a user