<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Feb 5, 2020, at 7:23 AM, Keane, Erich <<a href="mailto:erich.keane@intel.com" class="">erich.keane@intel.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="WordSection1" style="page: WordSection1; caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><div style="margin: 0in 0in 0.0001pt 0.5in; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">>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.<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">We found that it wasn’t the case in many cases (particularly in compound cases where intermediate values get large), which is incredibly expensive on some platforms.  Additionally, it heavily discourages the use of ‘auto’, which is otherwise incredibly useful for these types.<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div></div></div></blockquote><br class=""></div><div>C’s promotion rules are unfortunate for almost everything :-).  </div><div><br class=""></div><div>I think there are two reasonable paths here:</div><div><br class=""></div><div>1) Go for consistency with C and do the promotions, relying on the optimizer to trim them out.  You’ll want a suite of narrowing optimizations in any case.</div><div><br class=""></div><div>2) Go for strict equivalent with no promotion rules, requiring everything to be explicit.</div><div><br class=""></div><div>I agree with you that promotions are extremely extensive for FPGAs and the entire point of using this extension is to control widths.  If so, I think that argues for approach #2, which means that “int7 + int8” should be a compile time error, and that “int8” should be semantically different (but explicitly convertible) to other types like char that happen to have the same width.</div><div><br class=""></div><div>WDYT?</div><div><br class=""></div><div>-Chris</div><div><br class=""></div></body></html>