Performs a bitwise comparison over the contents of [DataValue]. Returns true if all bits are equal. This behaviour is different from PartialEq for NaN floats.
(&self, other: &DataValue)
| 264 | /// |
| 265 | /// This behaviour is different from PartialEq for NaN floats. |
| 266 | pub fn bitwise_eq(&self, other: &DataValue) -> bool { |
| 267 | match (self, other) { |
| 268 | // We need to bit compare the floats to ensure that we produce the correct values |
| 269 | // on NaN's. The test suite expects to assert the precise bit pattern on NaN's or |
| 270 | // works around it in the tests themselves. |
| 271 | (DataValue::F16(a), DataValue::F16(b)) => a.bits() == b.bits(), |
| 272 | (DataValue::F32(a), DataValue::F32(b)) => a.bits() == b.bits(), |
| 273 | (DataValue::F64(a), DataValue::F64(b)) => a.bits() == b.bits(), |
| 274 | (DataValue::F128(a), DataValue::F128(b)) => a.bits() == b.bits(), |
| 275 | |
| 276 | // We don't need to worry about F32x4 / F64x2 Since we compare V128 which is already the |
| 277 | // raw bytes anyway |
| 278 | (a, b) => a == b, |
| 279 | } |
| 280 | } |
| 281 | } |
| 282 | |
| 283 | /// Record failures to cast [DataValue]. |
no test coverage detected