<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=""><div><blockquote type="cite" class=""><div class="">On Mar 3, 2020, at 12:59 PM, Serge Pavlov via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><blockquote class="gmail_quote" style="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; margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;">One concern with replacing llvm.rint and llvm.nearbyint with llvm.roundeven makes it difficult to turn back into a libcall if the backend doesn't have an instruction for it. You can't just call the roundeven library function since that wouldn't exist in older libm implementations. So ideally you would know which function was originally used in the user code and call that.</blockquote></div></blockquote><br class=""></div><div>You can turn it into a libcall to nearbyint (or lower to an instruction that does the operation), since you’re in a context where you’re allowed to assume the rounding mode is default.</div><div><br class=""></div><div>– Steve</div></body></html>