Switch DataValue to use Ieee32/Ieee64

As discussed in #2251, in order to be very confident that NaN signaling bits are correctly handled by the compiler, this switches `DataValue` to use Cranelift's `Ieee32` and `Ieee64` structures. This makes it a bit more inconvenient to interpreter Cranelift FP operations but this should change to something like `rustc_apfloat` in the future.
This commit is contained in:
Andrew Brown
2020-10-07 09:57:51 -07:00
parent ce44719e1f
commit 3778fa025c
5 changed files with 22 additions and 28 deletions

View File

@@ -450,6 +450,7 @@ impl FromStr for Offset32 {
///
/// All bit patterns are allowed.
#[derive(Copy, Clone, Debug, Eq, PartialEq, Hash)]
#[repr(C)]
pub struct Ieee32(u32);
/// An IEEE binary64 immediate floating point value, represented as a u64
@@ -457,6 +458,7 @@ pub struct Ieee32(u32);
///
/// All bit patterns are allowed.
#[derive(Copy, Clone, Debug, Eq, PartialEq, Hash)]
#[repr(C)]
pub struct Ieee64(u64);
/// Format a floating point number in a way that is reasonably human-readable, and that can be