Skip to content

Commit

Permalink
update comp
Browse files Browse the repository at this point in the history
  • Loading branch information
tgross35 committed Jun 13, 2024
1 parent 7b632bc commit c9b7806
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions compiler/rustc_const_eval/src/interpret/operator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -435,8 +435,10 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
let val = val.to_scalar();
// No NaN adjustment here, `-` is a bitwise operation!
let res = match (un_op, fty) {
(Neg, FloatTy::F16) => Scalar::from_f16(-val.to_f16()?),
(Neg, FloatTy::F32) => Scalar::from_f32(-val.to_f32()?),
(Neg, FloatTy::F64) => Scalar::from_f64(-val.to_f64()?),
(Neg, FloatTy::F128) => Scalar::from_f128(-val.to_f128()?),
_ => span_bug!(self.cur_span(), "Invalid float op {:?}", un_op),
};
Ok(ImmTy::from_scalar(res, layout))
Expand Down

0 comments on commit c9b7806

Please sign in to comment.