<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<p><br>
</p>
<div class="moz-cite-prefix">On 1/14/20 10:37 AM, Jon Chesterfield via Openmp-dev wrote:<br>
</div>
<blockquote type="cite" cite="mid:CAOUYtQB37cxyiPW--mhgYKQewh_Y3zzdpw-2pT-PYj3VQxphTA@mail.gmail.com">
<div dir="ltr">Hello OpenMP dev,
<div><br>
</div>
<div>A motivating example is atomicInc for amdgcn. There is ISA support for this so a good implementation folds to a single instruction. There is no corresponding clang intrinsic, though there is an llvm intrinsic.</div>
</div>
</blockquote>
<p><br>
</p>
<p>Do you mean a target-specific intrinsic, or a target-independent intrinsic?</p>
<p> -Hal<br>
</p>
<p><br>
</p>
<blockquote type="cite" cite="mid:CAOUYtQB37cxyiPW--mhgYKQewh_Y3zzdpw-2pT-PYj3VQxphTA@mail.gmail.com">
<div dir="ltr">
<div>
<div><br>
<div>I see the following options:</div>
<div>- Implement it in IR, linked into deviceRTL</div>
<div>- Inline assembly</div>
<div>- Delay implementation until the intrinsic can be added to clang</div>
<div>- Implement in terms of CAS</div>
<div>- Your suggestion here</div>
<div><br>
</div>
<div>Adding atomicInc.ll to the source tree is the easy short term fix. It has drawbacks in terms of future ABI change, build complexity and limited precedent - libclc does this, but nowhere else.</div>
<div><br>
</div>
<div>Inline assembly works (modulo getting the syntax right) and hits the right instruction.</div>
<div><br>
</div>
<div>Implementing in terms of CAS means one can stay in HIP or OpenCL, but performance suffers.</div>
<div><br>
</div>
<div>What would the you prefer out of these options?<br>
</div>
<div><br>
</div>
<div>Thanks,</div>
<div><br>
</div>
<div>Jon</div>
</div>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
Openmp-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Openmp-dev@lists.llvm.org">Openmp-dev@lists.llvm.org</a>
<a class="moz-txt-link-freetext" href="https://lists.llvm.org/cgi-bin/mailman/listinfo/openmp-dev">https://lists.llvm.org/cgi-bin/mailman/listinfo/openmp-dev</a>
</pre>
</blockquote>
<pre class="moz-signature" cols="72">-- 
Hal Finkel
Lead, Compiler Technology and Programming Languages
Leadership Computing Facility
Argonne National Laboratory</pre>
</body>
</html>