[llvm] [ADT] Add implementations for avgFloor and avgCeil to APInt (PR #84431)

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 8 08:59:03 PST 2024


RKSimon wrote:

> Incidentally Hacker's Delight has a section "Average of Two Integers" which has some neat tricks for implementing these operations without extending to N+1-bit integers.

Thanks, we use min/max/sat/cmpsel instructions on TargetLowering::expandABD - using those as fallbacks might be a nice followup good-first-issue for someone :)

https://github.com/llvm/llvm-project/pull/84431


More information about the llvm-commits mailing list