1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
//! x86 floating-point arithmetic.
//!
//! [`Real`] implements SSE lane arithmetic on binary32 and binary64.
//! [`extended`] implements x87 arithmetic on canonical 80-bit operands.
//! The caller handles the x87 stack, exception masks, denormal-operand
//! detection, SSE denormals-are-zero on inputs, SSE flush to zero on results
//! and destination writes.
//!
//! # NaNs and invalid conversions
//!
//! [`X86`] quiets a NaN by setting fraction bit 22 for binary32, fraction
//! bit 51 for binary64, or significand bit 62 for extended. A signalling
//! operand raises [`Flags::INVALID`], except in [`reciprocal()`] and
//! [`reciprocal_sqrt`], which quiet the NaN and raise nothing. Binary32 and binary64 choose the first
//! NaN in operand order. When both extended operands are NaNs, a quiet NaN
//! wins over a signalling NaN. Otherwise the larger significand wins, with
//! positive preferred on a tie. The selected NaN keeps its sign.
//!
//! An invalid operation without a NaN operand gives the negative quiet NaN
//! with a zero payload. Across formats a NaN keeps its sign and its leading
//! payload bits. Widening fills the low payload bits with zeros. A failed
//! signed-integer conversion returns the destination's most negative value
//! with invalid alone.
//!
//! # Flags and range responses
//!
//! Operations report [`Flags`]. The denormal-operand exception belongs to the
//! instruction caller, which applies its operand rules.
//!
//! Masked rounding uses tininess after rounding. For an unmasked x87 register
//! overflow or underflow, [`extended::round_unmasked`] rounds the original
//! intermediate with an unbounded exponent, then adjusts that exponent.
//! For SSE, [`Real::unmasked_flags`] reports the flags for an unmasked
//! range response. The instruction suppresses the destination write.
pub use crate::;
pub use X86;
pub use Real;
pub use ;
// Returns the x86 result of a conversion to an integer. A failed conversion
// gives the integer indefinite, which is the destination's most negative
// value, with invalid alone.