<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Hello,</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
I would like to revive this thread.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
We started thinking about supporting complex number support, for the same reason Florian stated in his first mail. The idea before I googled and stumbled on this thread, was the same as Florian proposed. So yes, I would like to support this approach.
<span id="🙂">🙂</span> I would like to add that GCC's approach is the same/similar: complex number patterns are recognised in the SLP vectoriser, and complex number builtins are emitted (and then matched later).
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Any objections if we go for this approach? Florian, any plans to pick this up?<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Cheers,</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Sjoerd.<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div id="appendonsend"></div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font style="font-size:11pt" face="Calibri, sans-serif" color="#000000"><b>From:</b> llvm-dev <llvm-dev-bounces@lists.llvm.org> on behalf of Steve (Numerics) Canon via llvm-dev <llvm-dev@lists.llvm.org><br>
<b>Sent:</b> 04 December 2020 19:23<br>
<b>To:</b> David Greene <greened@obbligato.org><br>
<b>Cc:</b> llvm-dev <llvm-dev@lists.llvm.org><br>
<b>Subject:</b> Re: [llvm-dev] Complex proposal v3 + roundtable agenda</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt">
<div class="PlainText">(Late to the party)<br>
<br>
I think there’s a lot of good questions in this thread, but I also want Florian to get started landing some patches and then everyone can iterate on that.<br>
<br>
Slight pushback on this one question:<br>
<br>
<br>
> On Nov 19, 2020, at 18:11, Cameron McInally via llvm-dev <llvm-dev@lists.llvm.org> wrote:<br>
<br>
>> On Wed, Nov 18, 2020 at 4:47 PM Krzysztof Parzyszek via llvm-dev<br>
>> <llvm-dev@lists.llvm.org> wrote:<br>
>> Complex type would pose another issue for vectorization: in general it's better to have a vector of the real parts and a vector of the imaginary parts for the purpose of arithmetic, than having vectors of complex elements (i.e. real and imaginary parts interleaved).<br>
> <br>
> Is that universally true? I think it depends on the target. Let's take<br>
> Florian's FCMLA example. The inputs and output are interleaved. And if<br>
> you need just the reals/imags from an interleaved vector for something<br>
> else, LD2/ST2 should be pretty fast on recent chips.<br>
<br>
FCMLA makes it so _if your data is already interleaved and you can’t change it_, you can still operate efficiently in that format. But if you have control, and you’re doing anything beyond basic arithmetic, it’s still advantageous to use a planar [SoA] layout
 instead of interleaved [AoS]. For a simple example, if you want to vectorize a complex exponential function, you’ll want to compute cos and sin of the imaginary parts, and exp of the real parts—FCMLA doesn’t help here.<br>
<br>
So Florian’s proposal:<br>
<br>
> In the short-term I think to get things rolling it would be good to focus on the layout as defined by frontends (e.g. Clang/C++).<br>
<br>
Sounds great to me.<br>
<br>
– Steve<br>
_______________________________________________<br>
LLVM Developers mailing list<br>
llvm-dev@lists.llvm.org<br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</div>
</span></font></div>
</body>
</html>