Skip to content

Commit 10d29be

Browse files
committed
fix rounding of nearbyint
Thanks @LebedevRI
1 parent 3132729 commit 10d29be

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

ir/instr.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1021,8 +1021,7 @@ StateValue FpUnaryOp::toSMT(State &s) const {
10211021
case NearbyInt:
10221022
// TODO: they differ in exception behavior
10231023
fn = [&](auto &v, auto &np, auto rm) -> StateValue {
1024-
return fm_poison(s, v, np,
1025-
[&](expr &v) { return v.round(get_fp_rounding(s)); },
1024+
return fm_poison(s, v, np, [&](expr &v) { return v.round(rm.toSMT()); },
10261025
fmath, true);
10271026
};
10281027
break;

0 commit comments

Comments
 (0)