05.02.2013 Views

ARM Architecture Reference Manual ARMv7-A and ARMv7-R edition

ARM Architecture Reference Manual ARMv7-A and ARMv7-R edition

ARM Architecture Reference Manual ARMv7-A and ARMv7-R edition

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Reciprocal square root<br />

Application Level Programmers’ Model<br />

The Advanced SIMD extension includes instructions that support Newton-Raphson calculation of the<br />

reciprocal of the square root of a number.<br />

The VRSQRTE instruction produces the initial estimate of the reciprocal of the square root. It uses the following<br />

pseudocode functions:<br />

// FPRSqrtEstimate()<br />

// =================<br />

bits(32) FPRSqrtEstimate(bits(32) oper<strong>and</strong>)<br />

(type,sign,value) = FPUnpack(oper<strong>and</strong>, St<strong>and</strong>ardFPSCRValue());<br />

if type == FPType_SNaN || type == FPType_QNaN then<br />

result = FPProcessNaN(type, oper<strong>and</strong>, St<strong>and</strong>ardFPSCRValue());<br />

elsif type = FPType_Zero then<br />

result = FPInfinity(sign, 32);<br />

FPProcessException(FPExc_DivideByZero, St<strong>and</strong>ardFPSCRValue());<br />

elsif sign == ‘1’ then<br />

result = FPDefaultNaN(32);<br />

FPProcessException(FPExc_InvalidOp, St<strong>and</strong>ardFPSCRValue());<br />

elsif type = FPType_Infinity then<br />

result = FPZero(‘0’, 32);<br />

else<br />

// Oper<strong>and</strong> must be normalized, since denormalized numbers are flushed to zero. Scale to a<br />

// double-precision value in the range 0.25

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!