[cfe-dev] [RFC] Proposing an Extended Integer Type
James Y Knight via cfe-dev
cfe-dev at lists.llvm.org
Wed Feb 5 07:18:35 PST 2020
On Tue, Feb 4, 2020 at 12:14 PM Keane, Erich via cfe-dev <
cfe-dev at lists.llvm.org> wrote:
> Hi Chris, thanks for your feedback!
> >> Could you provide a patch that updates the Clang extensions manual?
> I updated Language Extensions in the patch (D73967 being proposed). Is
> that sufficient, or are you looking for more information there?
> >> Make sure the promotion semantics follow that of the rest of C.
> C usual promotions are quite harmful to these types, so they don’t
> participate unless otherwise forced to. For example:
> SomeI7 + SomeI8 // Operation done at I8 size
> SomeI7 + SomeChar // SomeChar goes through usual promotions, so the
> operation happens as an int.
> The second case is necessary for consistency with the C language, the
> first because otherwise these types don’t end up being particularly
> useful. On things like an FPGA (or otherwise limited hardware), rounding
> up is absurdly expensive.
The first case seems unfortunate/inconsistent -- are you sure it's
necessary to do that? When dealing with temporary values in an expression,
LLVM should be able to determine that most of the bits aren't useful, and
optimize based upon that. I'd expect that to be generally sufficient for
handling the usual-int-promotion temporary values inside of an expression.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the cfe-dev