[libc-commits] [libc] [libc][stdfix] Implement divifx functions in LLVM libc (PR #206115)
via libc-commits
libc-commits at lists.llvm.org
Thu Jul 9 23:10:38 PDT 2026
sohail103 wrote:
@PiJoules Do we want to add the variants that aren't in the TR (divifx for unsigned/signed short fract/accum) to LLVM libc or stick to the TR document? Are there any targets with native 16 bit arithmetic that might use these routines?
I imagine for most targets that have 32 bit wide registers or anything wider than that, directly using the routines for fract/accum or long fract/accum would perform better because that would only require a typecast before the function call and another one after return rather than the compiler emitting extra emulation sequences (sign extensions and narrowing) to preserve 16 bit semantics while doing 32 or 64 bit arithmetic. Since this uses an integer division after widening instead of newton raphson or some other approximation method I think the result should be identical in both cases.
https://github.com/llvm/llvm-project/pull/206115
More information about the libc-commits
mailing list