[Bf-committers] arithb.c QuatToMat3 question

Tom M letterrip at gmail.com
Sun Sep 17 07:36:36 CEST 2006


In QuatToMat3 and QuatToMat4

we see q0= M_SQRT2 * q[0];
	q1= M_SQRT2 * q[1];
	q2= M_SQRT2 * q[2];
	q3= M_SQRT2 * q[3];

this appears to be done to later save multiplications by two in the following

	qda= q0*q1;
	qdb= q0*q2;
	qdc= q0*q3;
	qaa= q1*q1;
	qab= q1*q2;
	qac= q1*q3;
	qbb= q2*q2;
	qbc= q2*q3;
	qcc= q3*q3;

however I would think that if we leave it as multiply by 2, then the
compiler will recognize it as a bitshift, which I would think would
end up ultimately faster.

Thoughts?

LetterRip


More information about the Bf-committers mailing list