Fixed space characters
This commit is contained in:
@@ -171,31 +171,31 @@ namespace _detail
|
|||||||
// Hackers Delight: http://www.hackersdelight.org/HDcode/nlz.c.txt
|
// Hackers Delight: http://www.hackersdelight.org/HDcode/nlz.c.txt
|
||||||
GLM_FUNC_QUALIFIER unsigned int nlz(unsigned int x)
|
GLM_FUNC_QUALIFIER unsigned int nlz(unsigned int x)
|
||||||
{
|
{
|
||||||
int y, m, n;
|
int y, m, n;
|
||||||
|
|
||||||
y = -int(x >> 16); // If left half of x is 0,
|
y = -int(x >> 16); // If left half of x is 0,
|
||||||
m = (y >> 16) & 16; // set n = 16. If left half
|
m = (y >> 16) & 16; // set n = 16. If left half
|
||||||
n = 16 - m; // is nonzero, set n = 0 and
|
n = 16 - m; // is nonzero, set n = 0 and
|
||||||
x = x >> m; // shift x right 16.
|
x = x >> m; // shift x right 16.
|
||||||
// Now x is of the form 0000xxxx.
|
// Now x is of the form 0000xxxx.
|
||||||
y = x - 0x100; // If positions 8-15 are 0,
|
y = x - 0x100; // If positions 8-15 are 0,
|
||||||
m = (y >> 16) & 8; // add 8 to n and shift x left 8.
|
m = (y >> 16) & 8; // add 8 to n and shift x left 8.
|
||||||
n = n + m;
|
n = n + m;
|
||||||
x = x << m;
|
x = x << m;
|
||||||
|
|
||||||
y = x - 0x1000; // If positions 12-15 are 0,
|
y = x - 0x1000; // If positions 12-15 are 0,
|
||||||
m = (y >> 16) & 4; // add 4 to n and shift x left 4.
|
m = (y >> 16) & 4; // add 4 to n and shift x left 4.
|
||||||
n = n + m;
|
n = n + m;
|
||||||
x = x << m;
|
x = x << m;
|
||||||
|
|
||||||
y = x - 0x4000; // If positions 14-15 are 0,
|
y = x - 0x4000; // If positions 14-15 are 0,
|
||||||
m = (y >> 16) & 2; // add 2 to n and shift x left 2.
|
m = (y >> 16) & 2; // add 2 to n and shift x left 2.
|
||||||
n = n + m;
|
n = n + m;
|
||||||
x = x << m;
|
x = x << m;
|
||||||
|
|
||||||
y = x >> 14; // Set y = 0, 1, 2, or 3.
|
y = x >> 14; // Set y = 0, 1, 2, or 3.
|
||||||
m = y & ~(y >> 1); // Set m = 0, 1, 2, or 2 resp.
|
m = y & ~(y >> 1); // Set m = 0, 1, 2, or 2 resp.
|
||||||
return unsigned(n + 2 - m);
|
return unsigned(n + 2 - m);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif//(GLM_COMPILER)
|
#endif//(GLM_COMPILER)
|
||||||
|
|||||||
Reference in New Issue
Block a user