overflow <- 1 # signals SO only when OE = 1
vxcvi_flag <- 1
xx_flag <- 0
- else if ¬bfp_COMPARE_EQ(src, result_bfp) then
- xx_flag <- 1
+ inc_flag <- 0
+ else
+ xx_flag <- ¬bfp_COMPARE_EQ(src, result_bfp)
+ inc_flag <- bfp_COMPARE_GT(bfp_ABSOLUTE(result_bfp), bfp_ABSOLUTE(src))
if vxsnan_flag = 1 then SetFX(FPSCR.VXSNAN)
if vxcvi_flag = 1 then SetFX(FPSCR.VXCVI)
if xx_flag = 1 then SetFX(FPSCR.XX)
overflow <- 1 # signals SO only when OE = 1
vxcvi_flag <- 1
xx_flag <- 0
- else if ¬bfp_COMPARE_EQ(src, result_bfp) then
- xx_flag <- 1
+ inc_flag <- 0
+ else
+ xx_flag <- ¬bfp_COMPARE_EQ(src, result_bfp)
+ inc_flag <- bfp_COMPARE_GT(bfp_ABSOLUTE(result_bfp), bfp_ABSOLUTE(src))
if vxsnan_flag = 1 then SetFX(FPSCR.VXSNAN)
if vxcvi_flag = 1 then SetFX(FPSCR.VXCVI)
if xx_flag = 1 then SetFX(FPSCR.XX)
fpscr.FX = 1
fpscr.FI = 1
fpscr.FPRF = 0 # undefined value we happen to pick
- fpscr.FR = 0 # trunc never increments
+ if not overflow:
+ fpscr.FR = abs(do_round(inp, round_mode)) > abs(inp)
lt = bool(expected & (1 << 63))
gt = not lt and expected != 0
eq = expected == 0