This is an archive of the discontinued LLVM Phabricator instance.

[APInt] Add methods for saturated add and sub
ClosedPublic

Authored by nikic on Nov 9 2018, 9:59 AM.

Details

Summary

This adds the sadd_sat, uadd_sat, ssub_sat, usub_sat methods for performing saturating additions and subtractions to APInt.

Split out from D54237.

Diff Detail

Repository
rL LLVM

Event Timeline

nikic created this revision.Nov 9 2018, 9:59 AM
RKSimon accepted this revision.Nov 9 2018, 10:30 AM

LGTM

This revision is now accepted and ready to land.Nov 9 2018, 10:30 AM

@nikic Are you intending to commit this soon or are you waiting for the intrinsic code to be accepted first?

This revision was automatically updated to reflect the committed changes.