<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div>On Jul 10, 2013, at 12:30 PM, Eli Bendersky <<a href="mailto:eliben@google.com">eliben@google.com</a>> wrote:</div><blockquote type="cite"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, Jul 10, 2013 at 11:53 AM, John McCall <span dir="ltr"><<a href="mailto:rjmccall@apple.com" target="_blank">rjmccall@apple.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word"><div><div class="h5">
<div>On Jul 10, 2013, at 11:39 AM, Eli Bendersky <<a href="mailto:eliben@google.com" target="_blank">eliben@google.com</a>> wrote:</div><blockquote type="cite"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">
On Wed, Jul 10, 2013 at 11:26 AM, John McCall <span dir="ltr"><<a href="mailto:rjmccall@apple.com" target="_blank">rjmccall@apple.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word"><div><div>On Jul 10, 2013, at 11:18 AM, Eli Bendersky <<a href="mailto:eliben@google.com" target="_blank">eliben@google.com</a>> wrote:</div>

<blockquote type="cite"><div dir="ltr">On Wed, Jul 10, 2013 at 3:03 AM, John McCall <span dir="ltr"><<a href="mailto:rjmccall@apple.com" target="_blank">rjmccall@apple.com</a>></span> wrote:<br><div class="gmail_extra">

<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div>On Jun 27, 2013, at 3:57 PM, Eli Bendersky <<a href="mailto:eliben@google.com" target="_blank">eliben@google.com</a>> wrote:<br>



</div><div>> Without fmath-errno, Clang currently generates calls to @llvm.pow.* intrinsics when it sees pow*(). This may not be suitable for all targets (for example PNaCl), so the attached patch adds a target hook that CodeGen queries. The target can state its preference for having or not having the intrinsic generated. Non-PNaCl behavior remains unchanged; PNaCl-specific test added.<br>



<br>
</div>Isn't a more straightforward and less invasive approach to just invoke the compiler with -fno-builtin=pow or something along those lines?<br></blockquote><div><br></div><div>We don't control the flags users supply to Clang though. </div>

</div></div></div></blockquote><div><br></div></div>Then handle it in the driver.</div></blockquote><div><br></div><div>Would that not be more intrusive, then? Or perhaps I'm misunderstanding what you're proposing.</div>

</div></div></div></blockquote><br></div></div><div>It would be isolated to target-specific logic in target-specific parts of the toolchain instead of inventing a new option that's basically "do what PNaCl wants" and then propagating it through the entire compiler.</div>
</div></blockquote><div><br></div><div>Clang currently supports le32 as a target. So it's not an issue of a single "driver wrapper". We purposefully keep PNaCl as open as possible, and other developers and toolchain writers may use this target to generate PNaCl bitcode or something similar with Clang.</div></div></div></div></blockquote><div><br></div>I'm not asking you to wrap the driver.  I'm asking you to change clang's driver logic when targeting *-*-nacl to use the existing logic to suppress builtin treatment of functions.</div><div><br><blockquote type="cite"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">
<div>There's no new option added and no additional plumbing done in this change. Target hooks are used in a number of places in Clang codegen already to customize parts of the process. A new hook was added for this specific purpose, and the only PNaCl-specific part of the code is in PNaClTargetCodeGenInfo. This is not unlike already existing target hooks for architectures, OSes, etc.</div></div></div></div></blockquote><div><br></div></div>Those hooks are used for mandatory ABI things, though, not to adjust our interpretation of builtin functions.  The builtin model is already complicated enough.<div><br></div><div>John.</div></body></html>