<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Feb 4, 2020 at 12:14 PM Keane, Erich via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">





<div lang="EN-US">
<div>
<p class="MsoNormal">Hi Chris, thanks for your feedback!<u></u><u></u></p>
<p class="MsoNormal">>> Could you provide a patch that updates the Clang extensions manual?  <u></u><u></u></p>
<p class="MsoNormal">I updated Language Extensions in the patch (D73967 being proposed).  Is that sufficient, or are you looking for more information there?<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">>> Make sure the promotion semantics follow that of the rest of C.<u></u><u></u></p>
<p class="MsoNormal">C usual promotions are quite harmful to these types, so they don’t participate unless otherwise forced to.  For example:<u></u><u></u></p>
<p class="MsoNormal"><br>
SomeI7 + SomeI8   // Operation done at I8 size<u></u><u></u></p>
<p class="MsoNormal">SomeI7 + SomeChar // SomeChar goes through usual promotions, so the operation happens as an int.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">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.<u></u><u></u></p>
<p class="MsoNormal"><u></u></p></div></div></blockquote><div><br></div><div>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.</div></div></div>