|
@@ -186,35 +186,10 @@ add!(__adddf3: f64);
|
|
#[cfg(test)]
|
|
#[cfg(test)]
|
|
mod tests {
|
|
mod tests {
|
|
use core::{f32, f64};
|
|
use core::{f32, f64};
|
|
- use core::fmt;
|
|
|
|
|
|
|
|
- use float::Float;
|
|
|
|
|
|
+ use float::{Float, FRepr};
|
|
use qc::{U32, U64};
|
|
use qc::{U32, U64};
|
|
|
|
|
|
- // TODO: Move this to F32/F64 in qc.rs
|
|
|
|
- #[derive(Copy, Clone)]
|
|
|
|
- struct FRepr<F>(F);
|
|
|
|
-
|
|
|
|
- impl<F: Float> PartialEq for FRepr<F> {
|
|
|
|
- fn eq(&self, other: &FRepr<F>) -> bool {
|
|
|
|
- // NOTE(cfg) for some reason, on hard float targets, our implementation doesn't
|
|
|
|
- // match the output of its gcc_s counterpart. Until we investigate further, we'll
|
|
|
|
- // just avoid testing against gcc_s on those targets. Do note that our
|
|
|
|
- // implementation matches the output of the FPU instruction on *hard* float targets
|
|
|
|
- // and matches its gcc_s counterpart on *soft* float targets.
|
|
|
|
- if cfg!(gnueabihf) {
|
|
|
|
- return true
|
|
|
|
- }
|
|
|
|
- self.0.eq_repr(other.0)
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- impl<F: fmt::Debug> fmt::Debug for FRepr<F> {
|
|
|
|
- fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
|
|
|
- self.0.fmt(f)
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
// TODO: Add F32/F64 to qc so that they print the right values (at the very least)
|
|
// TODO: Add F32/F64 to qc so that they print the right values (at the very least)
|
|
check! {
|
|
check! {
|
|
fn __addsf3(f: extern fn(f32, f32) -> f32,
|
|
fn __addsf3(f: extern fn(f32, f32) -> f32,
|