# Difference between revisions of "Overflow"

From Mill Computing Wiki

(Created page with "When integer operations produce values that can't be contained within the bit width of the result, there are different strategies of how to deal with it. In all cases the C...") | |||

Line 3: | Line 3: | ||

In all cases the [[Condition_Code|condition codes]] are generated and can be queried with the dedicated ganged operations. What the overflow behavior does determine is the primary result that is produced. | In all cases the [[Condition_Code|condition codes]] are generated and can be queried with the dedicated ganged operations. What the overflow behavior does determine is the primary result that is produced. | ||

− | + | # modulo - normal silent overflow or underflow, also called wraparound | |

− | + | # saturating - the highest of lowest representable value in the given with is the returned result | |

− | + | # excepting - the appropriate [[NaR]] is created as the result | |

− | + | # widening - here the scalar byte width is doubled and the full and exact result is the return value |

## Revision as of 09:59, 11 December 2014

When integer operations produce values that can't be contained within the bit width of the result, there are different strategies of how to deal with it.

In all cases the condition codes are generated and can be queried with the dedicated ganged operations. What the overflow behavior does determine is the primary result that is produced.

- modulo - normal silent overflow or underflow, also called wraparound
- saturating - the highest of lowest representable value in the given with is the returned result
- excepting - the appropriate NaR is created as the result
- widening - here the scalar byte width is doubled and the full and exact result is the return value