FCOS

余弦

stableVMJITAOTinstruction

编码

操作码指令Op/En64 位兼容/传统说明
D9 FFFCOS有效有效将ST( 0) 改为约余弦。

实测开销

正在从 arch-data 加载实测数据...

说明

计算寄存器ST( 0) 中 源操作数 的大约余弦,并将结果存储于ST( 0) 。 源操作数必须用弧度给出,并且必须在-263到+263之间. 下表显示

在使用各种数字的余弦时获得的结果。

FCOS 结果

ST(0) SRCST(0) DEST
-*
-F-1 to +1
-0+1
+0+1
+F- 1 to + 1
+*
纳恩纳恩

行动

IF |ST(0)| < 263
THEN

    C2 := 0;
    ST(0) := FCOS(ST(0)); // approximation of cosine
ELSE (* Source operand is out-of-range *)
    C2 := 1;
FI;


FPU Flags Affected

C1                  Set to 0 if stack underflow occurred.

                    Set if result was rounded up; cleared otherwise.

                    Undefined if C2 is 1.

C2                  Set to 1 if outside range (-263 < source operand < +263); otherwise, set to 0.

C0, C3              Undefined.

浮点 例外

#IS                 Stack underflow occurred.
#IA                 Source operand is an SNaN value, , or unsupported format.
#D                  Source is a denormal value.
#P                  Value cannot be represented exactly in destination format.

异常

保护模式
#NMCR0.EM[bit 2] 或 CR0.TS[bit 3] = 1.
#MF如果存在待决的x87 FPU例外.
#UD如果使用 LOCK 前缀 。
实地址模式
与保护模式中的例外相同.
虚拟 8086 模式
与保护模式中的例外相同.
兼容模式
与保护模式中的例外相同.
64 位模式
与保护模式中的例外相同.

来源