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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
//! x86 floating-point arithmetic and exception reporting.
//!
//! [`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 [`Exceptions::IE`], 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 IE alone.
//!
//! # Exceptions and range responses
//!
//! [`Exceptions`] uses bits 0 through 5 for IE, DE, ZE, OE, UE and PE. The
//! facade maps the five core flags to the corresponding bits. The instruction
//! caller supplies DE when its operand rules require it.
//!
//! 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_exceptions`] reports the exceptions for an
//! unmasked range response. The instruction suppresses the destination write.
pub use crate::;
pub use Exceptions;
pub use X86;
pub use Real;
pub use ;
/// A core operation result with architectural exception bits.
pub type Computed<T> = crateComputed;
/// A rounded result with architectural exception bits.
pub type Rounded<T> = crateRounded;
/// Decodes the rounding-control field that the x87 control word and MXCSR
/// share. The values are 0 for nearest, 1 for down, 2 for up and 3 for toward
/// zero. Only the low two bits of `bits` are read.
// 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 IE alone.