Code documentation & information ?

Code documentation & information ?

Polar01的头像

Hi,

I'm currently discovering the Embree code and have a few questions, because there is no documentation on some functions:

1) signmsk
2) xorf
3)  rcp

BTW, if I understand, in the file "triangle1v_intersector_pluecker".h there is the following code :

const float sgnDet = signmsk(det);
const float U = xorf(dot(cross(v2+v0,e0),D),sgnDet); 

Is it equivalent to : const float U = copysign(dot(cross(v2+v0,e0),D), det);

Thanks

http://spectralbattle.wordpress.com/
4 帖子 / 0 new
最新文章
如需更全面地了解编译器优化,请参阅优化注意事项
Sven Woop (Intel)的头像

1) signmask takes a floating point number and and sets every bit to zero, except for the sign bit (topmost bit).

2) xorf simply calculates a bitwise xor of the bit representation of two floating point numbers

The mask returned by signmask can be used to efficiently flip the sign bit of another floating point number by using the xorf instruction.For instance xorf(signmask(-6),10) = -10. The intersection algorithm uses a sequence like this to flip some signs if the triangle is hit from the back.

3) rcp calculates the reciprocal of a floating point number, rcp(x) = 1/x

Sven Woop (Intel)的头像

The sequence does not copy the sign, but flip the sign of dot(cross(v2+v0,e0),D) if det < 0

Polar01的头像

Thanks,

Yes, I see... ingenious :-)

http://spectralbattle.wordpress.com/

登陆并发表评论。