The signed one is needed for implementation of ConstantRange::smul_sat(),
unsigned is for completeness only.
Details
Details
- Reviewers
nikic RKSimon spatel - Commits
- rG9ca363d89c10: [APInt] Add saturating truncation methods
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
LGTM
I feel like the names are a bit inconsistent with existing uadd_sat etc, but utrunc_sat seems worse than truncUSat, so let's just go with it...
Comment Actions
Yes, i'm on the fence regarding names here.
I initially used trunc{Unsigned,Sign/Signed}Sat(), but that didn't seem much better..