FCHS

Change Sign

stableVMJITAOTinstruction

Encodings

OpcodeInstructionOp/En64-bitCompat/LegacyDescription
D9 E0FCHSValidValidComplements sign of ST(0).

Measured cost

Loading measurements from arch-data...

Description

Complements the sign bit of ST(0). This operation changes a positive value into a negative value of equal magnitude or vice versa. The following table shows the results obtained when changing the sign of various classes of numbers.

FCHS Results

ST(0) SRCST(0) DEST
+
+F
+0
-0
-F
-
NaN

Operation

SignBit(ST(0)) := NOT (SignBit(ST(0)));

FPU Flags Affected

C1                  Set to 0.

C0, C2, C3          Undefined.

Floating-Point Exceptions

#IS                 Stack underflow occurred.

Exceptions

Protected mode
#NMCR0.EM[bit 2] or CR0.TS[bit 3] = 1.
#UDIf the LOCK prefix is used.
Real address mode
Same exceptions as in protected mode.
Virtual-8086 mode
Same exceptions as in protected mode.
Compatibility mode
Same exceptions as in protected mode.
64-bit mode
Same exceptions as in protected mode.

Sources