Skip to content

Commit c9b7806

Browse files
committed
update comp
1 parent 7b632bc commit c9b7806

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

compiler/rustc_const_eval/src/interpret/operator.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,8 +435,10 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
435435
let val = val.to_scalar();
436436
// No NaN adjustment here, `-` is a bitwise operation!
437437
let res = match (un_op, fty) {
438+
(Neg, FloatTy::F16) => Scalar::from_f16(-val.to_f16()?),
438439
(Neg, FloatTy::F32) => Scalar::from_f32(-val.to_f32()?),
439440
(Neg, FloatTy::F64) => Scalar::from_f64(-val.to_f64()?),
441+
(Neg, FloatTy::F128) => Scalar::from_f128(-val.to_f128()?),
440442
_ => span_bug!(self.cur_span(), "Invalid float op {:?}", un_op),
441443
};
442444
Ok(ImmTy::from_scalar(res, layout))

0 commit comments

Comments
 (0)