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

Atousa Duprat via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 8 10:28:28 PST 2024


Atousa 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 :)

Can I open a new discussion regarding a better implementation of AvgFloor and AvgCeil in TargetLowering::expandABD?

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


More information about the llvm-commits mailing list