<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from rtf -->
<style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<font face="Calibri" size="2"><span style="font-size:11pt;">
<div style="text-indent:-17.85pt;padding-left:46.2pt;"><font color="#44546A">Hi all,</font></div>
<div style="text-indent:-17.85pt;padding-left:46.2pt;"><font color="#44546A"> </font></div>
<div style="text-indent:-17.85pt;padding-left:46.2pt;"><font color="#44546A">AVX-512 ISA introduces new vector instructions VCOMPRESS and VEXPAND in order to allow vectorization of the following loops with two specific types of cross-iteration dependencies:</font></div>
<div style="text-indent:-17.85pt;padding-left:46.2pt;"><font color="#44546A"> </font></div>
<div style="text-indent:-17.85pt;padding-left:46.2pt;"><font color="#44546A">Compress:</font></div>
<div style="text-indent:-17.85pt;padding-left:46.2pt;"><font color="#44546A">for (int i=0; i<N; ++i)  </font></div>
<div style="text-indent:-17.85pt;padding-left:46.2pt;"><font color="#44546A">  If (t[i]) </font></div>
<div style="text-indent:-17.85pt;padding-left:46.2pt;"><font color="#44546A">    *A++ = expr;</font></div>
<div style="text-indent:-17.85pt;padding-left:46.2pt;"><font color="#44546A"> </font></div>
<div style="text-indent:-17.85pt;padding-left:46.2pt;"><font color="#44546A">Expand:</font></div>
<div style="text-indent:-17.85pt;padding-left:46.2pt;"><font color="#44546A">for (i=0; i<N; ++i)</font></div>
<div style="text-indent:-17.85pt;padding-left:46.2pt;"><font color="#44546A">  If (t[i]) </font></div>
<div style="text-indent:-17.85pt;padding-left:46.2pt;"><font color="#44546A">     X[i] = *A++;</font></div>
<div style="text-indent:-17.85pt;padding-left:46.2pt;"><font color="#44546A">  else</font></div>
<div style="text-indent:-17.85pt;padding-left:46.2pt;"><font color="#44546A">     X[i] = PassThruV[i];</font></div>
<div style="text-indent:-17.85pt;padding-left:46.2pt;"><font color="#44546A"> </font></div>
<div style="text-indent:-17.85pt;padding-left:46.2pt;"><font color="#44546A">On this poster ( <a href="http://llvm.org/devmtg/2013-11/slides/Demikhovsky-Poster.pdf"><font color="#0563C1"><u>http://llvm.org/devmtg/2013-11/slides/Demikhovsky-Poster.pdf</u></font></a>
) you’ll find depicted “compress” and “expand” patterns.</font></div>
<div style="text-indent:-17.85pt;padding-left:46.2pt;"><font color="#44546A"> </font></div>
<div style="text-indent:-17.85pt;padding-left:46.2pt;"><font color="#44546A">The RFC proposes to support this functionality by introducing two intrinsics to LLVM IR:</font></div>
<div style="text-indent:-17.85pt;padding-left:46.2pt;"><font color="#44546A">llvm.masked.expandload.*</font></div>
<div style="text-indent:-17.85pt;padding-left:46.2pt;"><font color="#44546A">llvm.masked.compressstore.*</font></div>
<div style="text-indent:-17.85pt;padding-left:46.2pt;"><font color="#44546A"> </font></div>
<div style="text-indent:-17.85pt;padding-left:46.2pt;"><font color="#44546A">The syntax of these two intrinsics is similar to the syntax of llvm.masked.load.* and masked.store.*, respectively, but the semantics are different, matching the above patterns.</font></div>
<div style="text-indent:-17.85pt;padding-left:46.2pt;"><font color="#44546A"> </font></div>
<div style="text-indent:-17.85pt;padding-left:46.2pt;"><font color="#44546A">%res = call <16 x float> @llvm.masked.expandload.v16f32.p0f32 (float* %ptr, <16 x i1>%mask, <16 x float> %passthru)</font></div>
<div style="text-indent:-17.85pt;padding-left:46.2pt;"><font color="#44546A">void @llvm.masked.compressstore.v16f32.p0f32 (<16 x float> <value>, float* <ptr>, <16 x i1> <mask>)</font></div>
<div style="text-indent:-17.85pt;padding-left:46.2pt;"><font color="#44546A"> </font></div>
<div style="text-indent:-17.85pt;padding-left:46.2pt;"><font color="#44546A">The arguments - %mask, %value and %passthru all have the same vector length.</font></div>
<div style="text-indent:-17.85pt;padding-left:46.2pt;"><font color="#44546A">The underlying type of %ptr corresponds to the scalar type of the vector value.</font></div>
<div style="text-indent:-17.85pt;padding-left:46.2pt;"><font color="#44546A">(In brief; the full syntax description will be provided in subsequent full documentation.)</font></div>
<div style="text-indent:-17.85pt;padding-left:46.2pt;"><font color="#44546A"> </font></div>
<div style="text-indent:-17.85pt;padding-left:46.2pt;"><font color="#44546A">The intrinsics are planned to be target independent, similar to masked.load/store/gather/scatter. They will be lowered effectively on AVX-512 and scalarized on other targets, also
akin to masked.* intrinsics.</font></div>
<div style="text-indent:-17.85pt;padding-left:46.2pt;"><font color="#44546A">Loop vectorizer will query TTI about existence of effective support for these intrinsics, and if provided will be able to handle loops with such cross-iteration dependences.</font></div>
<div style="text-indent:-17.85pt;padding-left:46.2pt;"><font color="#44546A"> </font></div>
<div style="text-indent:-17.85pt;padding-left:46.2pt;"><font color="#44546A">The first step will include the full documentation and implementation of CodeGen part.</font></div>
<div style="text-indent:-17.85pt;padding-left:46.2pt;"> </div>
<div style="text-indent:-17.85pt;padding-left:46.2pt;"><font color="#44546A">An additional information about<font color="black"> </font>expand load ( <a href="https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=expandload&techs=AVX_512"><font color="#0563C1"><u>https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=expandload&techs=AVX_512</u></font></a><font color="black">
)</font>  and compress store <font color="black">(</font><a href="https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=compressstore&techs=AVX_512"><font color="#0563C1"><u>https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=compressstore&techs=AVX_512</u></font></a><font color="black">
) </font>you also can find in the Intel Intrinsic Guide.</font></div>
<div style="text-indent:-17.85pt;padding-left:46.2pt;"><font color="#44546A"> </font></div>
<ul style="margin:0;padding-left:36pt;">
<font face="Times New Roman" size="3" color="#2F5496"><span style="font-size:12pt;">
<li><b><i>Elena</i></b></li></span></font>
</ul>
<div> </div>
<div style="text-indent:-17.85pt;padding-left:46.2pt;"> </div>
<div style="text-indent:-17.85pt;padding-left:46.2pt;"> </div>
</span></font>
<p>---------------------------------------------------------------------<br>
Intel Israel (74) Limited</p>

<p>This e-mail and any attachments may contain confidential material for<br>
the sole use of the intended recipient(s). Any review or distribution<br>
by others is strictly prohibited. If you are not the intended<br>
recipient, please contact the sender and delete all copies.</p></body>
</html>