cranelift: Document Ieee{32,64} implementation (#4854)

This commit is contained in:
Afonso Bordado
2022-09-02 20:02:22 +01:00
committed by GitHub
parent b8a68ff86d
commit 3afb711a51

View File

@@ -472,6 +472,9 @@ impl FromStr for Offset32 {
/// An IEEE binary32 immediate floating point value, represented as a u32 /// An IEEE binary32 immediate floating point value, represented as a u32
/// containing the bit pattern. /// containing the bit pattern.
/// ///
/// We specifically avoid using a f32 here since some architectures may silently alter floats.
/// See: https://github.com/bytecodealliance/wasmtime/pull/2251#discussion_r498508646
///
/// All bit patterns are allowed. /// All bit patterns are allowed.
#[derive(Copy, Clone, Debug, Eq, Hash)] #[derive(Copy, Clone, Debug, Eq, Hash)]
#[cfg_attr(feature = "enable-serde", derive(Serialize, Deserialize))] #[cfg_attr(feature = "enable-serde", derive(Serialize, Deserialize))]
@@ -481,6 +484,9 @@ pub struct Ieee32(u32);
/// An IEEE binary64 immediate floating point value, represented as a u64 /// An IEEE binary64 immediate floating point value, represented as a u64
/// containing the bit pattern. /// containing the bit pattern.
/// ///
/// We specifically avoid using a f64 here since some architectures may silently alter floats.
/// See: https://github.com/bytecodealliance/wasmtime/pull/2251#discussion_r498508646
///
/// All bit patterns are allowed. /// All bit patterns are allowed.
#[derive(Copy, Clone, Debug, Eq, Hash)] #[derive(Copy, Clone, Debug, Eq, Hash)]
#[cfg_attr(feature = "enable-serde", derive(Serialize, Deserialize))] #[cfg_attr(feature = "enable-serde", derive(Serialize, Deserialize))]