Intel® ISA Extensions
Use hardware-based isolation and memory encryption to provide more code protection in your solutions.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
1135 Discussions

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

SergeyKostrov
Valued Contributor II
737 Views

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.

0 Kudos
1 Reply
Bernard
Valued Contributor I
737 Views
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.
0 Kudos
Reply