Is there an error in Operation pseudo-code for FSIN instruction?

Is there an error in Operation pseudo-code for FSIN instruction?

Is there an error in Operation pseudo-code for FSIN instruction? Please take a look:

Intel Instruction Set Reference, A-M, volume 2-A, page 3-412

...
FSIN - Sine
...
The source operand must be given in radians and must be within the range -2^63 to +2^63.
...
If the source operand is outside the acceptable range, the C2 flag in the FPU status
word is set, and the value in register ST(0) remains unchanged. The instruction does
not raise an exception when the source operand is out of range.
...
Operation

IF ST(0) < 2^63 <- Instead of: IF ST(0) IN RANGE ( -2^63, +2^63 )
THEN
C2 <- 0;
ST(0) <- sin(ST(0));
ELSE (* Source operand out of range *)
C2 <- 1;
Fl;
...

and it means that a value -2^65 also could be accepted according to thepseudo-code. It looks like the same
error in the documentation applies to all the rest trigonometric instructions.

2 posts / novo 0
Último post
Para obter mais informações sobre otimizações de compiladores, consulte Aviso sobre otimizações.

Probably an error in the documentation.The real behaviour of fsin when an argument is out of range is known and it is very different from the documentation pseudocode.

Faça login para deixar um comentário.