[PATCH] D62088: [compiler-rt][builtins] Scaled Integer log10()

John McCall via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 5 11:10:10 PDT 2019


rjmccall added a comment.

In D62088#1531309 <https://reviews.llvm.org/D62088#1531309>, @leonardchan wrote:

> In D62088#1522446 <https://reviews.llvm.org/D62088#1522446>, @rjmccall wrote:
>
> > I don't review compiler-rt patches generally.  Can you explain what would actually use this function?  Is there supposed to be a new Clang builtin for it?
>
>
> We will be using this as part of our WLAN library which represents energy units (decibels and watts) as scaled integers that we have custom classes for. Converting between these units and adding decibels mathematically involves using log10(). Currently, we just use float log10 and casting, but would like to use this for scaled integers and eventually fixed point types. The idea is that this would be a new clang builtin that we could use instead of a floating point log10().


Okay.  Will you need a signed variant of this?  Is using a 64-bit argument reasonable for all targets, or should there be 32-bit and 64-bit (and maybe eventually 128-bit) variants?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D62088/new/

https://reviews.llvm.org/D62088





More information about the llvm-commits mailing list