Skip to content

Commit 12bfa7b

Browse files
committed
Auto merge of rust-lang#3688 - tgross35:float-cast-test-refactor, r=RalfJung
Refactor float casting tests, add `f16` and `f128` This is an attempt to remove the magic from a lot of the numbers tested, which makes things easier when adding `f16` and `f128`. A nice side effect is that these tests now cover all int <-> float conversions with the same amount of tests.
2 parents a3460e2 + 93c1749 commit 12bfa7b

File tree

2 files changed

+458
-188
lines changed

2 files changed

+458
-188
lines changed

src/tools/miri/src/intrinsics/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -392,10 +392,10 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
392392
bug!("float_finite: non-float input type {}", x.layout.ty)
393393
};
394394
Ok(match fty {
395-
FloatTy::F16 => unimplemented!("f16_f128"),
395+
FloatTy::F16 => x.to_scalar().to_f16()?.is_finite(),
396396
FloatTy::F32 => x.to_scalar().to_f32()?.is_finite(),
397397
FloatTy::F64 => x.to_scalar().to_f64()?.is_finite(),
398-
FloatTy::F128 => unimplemented!("f16_f128"),
398+
FloatTy::F128 => x.to_scalar().to_f128()?.is_finite(),
399399
})
400400
};
401401
match (float_finite(&a)?, float_finite(&b)?) {

0 commit comments

Comments
 (0)