switch (fmt->exp_max_kind) {
case float_expmax_ieee:
flags |= float_flag_overflow;
- if (s->rebias_overflow) {
+ if (get_float_rebias_overflow(s)) {
exp -= fmt->exp_re_bias;
} else if (overflow_norm) {
flags |= float_flag_inexact;
}
}
fracN(shr)(p, frac_shift);
- } else if (unlikely(s->rebias_underflow)) {
+ } else if (unlikely(get_float_rebias_underflow(s))) {
flags |= float_flag_underflow;
exp += fmt->exp_re_bias;
if (p->frac_lo & round_mask) {
return status->default_nan_pattern;
}
+static inline bool get_float_rebias_overflow(const float_status *status)
+{
+ return status->rebias_overflow;
+}
+
+static inline bool get_float_rebias_underflow(const float_status *status)
+{
+ return status->rebias_underflow;
+}
+
/*----------------------------------------------------------------------------
| For the deconstructed floating-point with fraction FRAC, return true
| if the fraction represents a signalling NaN; otherwise false.
status->float_snan_rule = val;
}
+static inline void set_float_rebias_overflow(bool val, float_status *status)
+{
+ status->rebias_overflow = val;
+}
+
+static inline void set_float_rebias_underflow(bool val, float_status *status)
+{
+ status->rebias_underflow = val;
+}
+
static inline FloatRoundMode get_float_rounding_mode(const float_status *status)
{
return status->float_rounding_mode;
val |= FP_FEX;
}
env->fpscr = val;
- env->fp_status.rebias_overflow = (FP_OE & env->fpscr) ? true : false;
- env->fp_status.rebias_underflow = (FP_UE & env->fpscr) ? true : false;
+ set_float_rebias_overflow(FP_OE & env->fpscr, &env->fp_status);
+ set_float_rebias_underflow(FP_UE & env->fpscr, &env->fp_status);
if (tcg_enabled()) {
fpscr_set_rounding_mode(env);
}