4 ms·
> It doesn't natively support sine and cosine, but these can be computed from the tangent. I'd not ever looked into it, but that neatly explains the existence
by cmroanirgo 8y ago
> It doesn't natively support sine and cosine, but these can be computed from the tangent.
I'd not ever looked into it, but that neatly explains the existence of the sincos instruction.
- bonzini 8y agosincos is useful in general. Rotations for example often need sine and cosine of the same angle. Because transcendental functions are implemented as a microcode loop, a sincos instruction lets you cut in half the loop overhead. If the overhead were 50% (e.g. 100 cycles arithmetic and 50 cycles overhead) you could cut sincos to 250 cycles, for an overhead of only 25%.