Add count_{leading,trailing}_zeros() functions to stdlib.
(Documentation is still yet to be written.)
This commit is contained in:
12
tests/count-leading-trailing-zeros-4.ispc
Normal file
12
tests/count-leading-trailing-zeros-4.ispc
Normal file
@@ -0,0 +1,12 @@
|
||||
|
||||
export uniform int width() { return programCount; }
|
||||
|
||||
|
||||
export void f_f(uniform float RET[], uniform float aFOO[]) {
|
||||
int32 i = (1 << programIndex);
|
||||
RET[programIndex] = count_leading_zeros(i);
|
||||
}
|
||||
|
||||
export void result(uniform float RET[]) {
|
||||
RET[programIndex] = 31-programIndex;
|
||||
}
|
||||
Reference in New Issue
Block a user