<div class="socmaildefaultfont" dir="ltr" style="font-family:Arial, Helvetica, sans-serif;font-size:10.5pt" ><div dir="ltr" ><div>I find the related code developed by Anton Yartsev as following git commit. FYI, I reported a bug related to this issue before, <a href="https://bugs.llvm.org/show_bug.cgi?id=31161" >https://bugs.llvm.org/show_bug.cgi?id=31161</a></div>
<div> </div>
<div>commit 6bd14099c18d34a7dc894ab25654d0b253a3d527<br>Author: Anton Yartsev <anton.yartsev@gmail.com><br>Date:   Thu Nov 18 03:19:30 2010 +0000</div>
<div>    comparison of AltiVec vectors now gives bool result (fix for 7533)</div>
<div> </div>
<div> </div>
<div><span style="color:#ff0000;" >Hi, Anton, it sees that we should return vector type instead of bool result for vector comparison.<br>Could you please have a look at this mail thread? And I also see that this commit is fix for 7533. But I can not find the issue, could you please give some info about the `7533` issue?</span></div></div>
<div dir="ltr" ><span style="color:#ff0000;" >Thank you very much.</span><br><br><br> </div>
<div dir="ltr" ><div class="socmaildefaultfont" dir="ltr" style="font-family:Arial, Helvetica, sans-serif;font-size:10.5pt" ><div class="socmaildefaultfont" dir="ltr" style="font-family:Arial, Helvetica, sans-serif;font-size:10.5pt" ><div class="socmaildefaultfont" dir="ltr" style="font-family:Arial;font-size:10.5pt" ><div dir="ltr" >Regards,</div>
<div dir="ltr" > </div>
<div dir="ltr" ><br>Zixuan Wu (Zeson)</div>
<div dir="ltr" ><br>XL C/C++ Compiler Developer<br>IBM Systems, z System<br>E-mail: wuzish@cn.ibm.com<br>Tel: 86-21-60928420</div>
<div dir="ltr" > </div>
<div dir="ltr" ><span style="font-size:1.286em;" ><em>Compiler : The Art of Lowering</em></span></div>
<div dir="ltr" > </div></div></div></div></div>
<div dir="ltr" > </div>
<div dir="ltr" > </div>
<blockquote data-history-content-modified="1" dir="ltr" style="border-left:solid #aaaaaa 2px; margin-left:5px; padding-left:5px; direction:ltr; margin-right:0px" >----- Original message -----<br>From: Bill Schmidt/Rochester/IBM<br>To: Hubert Tong/Toronto/IBM@IBMCA<br>Cc: Jinsong Ji/Jacksonville/IBM@IBMUS, Zi Xuan CW Wu/China/IBM@IBMCN, cfe-dev@lists.llvm.org, Nemanja Ivanovic/Toronto/IBM@IBMCA<br>Subject: Re: C/C++ operator meaning is different between gcc generic vector type and altivec type<br>Date: Fri, Oct 19, 2018 5:09 AM<br> <br><font size="2" >Hi Hubert,</font><br><br><font size="2" >Yeah, that is some very badly written text.  We'll have to try to rewrite that for clarity.</font><br><br><font size="2" >Thanks!</font><br><br><font size="2" >-- Bill<br><br>Bill Schmidt, Ph.D.<br>STSM, Toolchain Architect for Linux on POWER<br>IBM Linux Technology Center<br>wschmidt@us.ibm.com   (507) 319-6873</font><br><br><br><img alt="Inactive hide details for Hubert Tong---10/18/2018 03:51:42 PM---Sorry, yes. I got confused over the very loose term of "do all" src="/icons/graycol.gif" width="16" height="16" border="0" ><font size="2" color="#424282" >Hubert Tong---10/18/2018 03:51:42 PM---Sorry, yes. I got confused over the very loose term of "do all" and the intrinsic of vec_all_le bein</font><br><br><font size="2" color="#5F5F5F" >From: </font><font size="2" >Hubert Tong/Toronto/IBM</font><br><font size="2" color="#5F5F5F" >To: </font><font size="2" >Jinsong Ji/Jacksonville/IBM@IBMUS</font><br><font size="2" color="#5F5F5F" >Cc: </font><font size="2" >Zi Xuan CW Wu/China/IBM@IBMCN, cfe-dev@lists.llvm.org, Nemanja Ivanovic/Toronto/IBM@IBMCA, Bill Schmidt/Rochester/IBM@IBMUS</font><br><font size="2" color="#5F5F5F" >Date: </font><font size="2" >10/18/2018 03:51 PM</font><br><font size="2" color="#5F5F5F" >Subject: </font><font size="2" >Re: C/C++ operator meaning is different between gcc generic vector type and altivec type </font>
<hr style="color:#8091A5; " size="2" align="left" width="100%" ><br><br><font size="2" >Sorry, yes. I got confused over the very loose term of "do all" and the intrinsic of vec_all_le being named with "all".</font><br><font size="2" >The ABI does clearly say:</font><br><font size="2" >The result of binary operators is the same type as the type of the input operands.</font><br><br><font size="2" >-- HT</font><br><br><br><img alt="Inactive hide details for Jinsong Ji---18-10-2018 03:53:36 p.m.---Hi Hubert: Looks like the interpretation of ABI should be the" src="/icons/graycol.gif" width="16" height="16" border="0" ><font size="2" color="#424282" >Jinsong Ji---18-10-2018 03:53:36 p.m.---Hi Hubert: Looks like the interpretation of ABI should be the opposite of your understanding.</font><br><br><font size="2" color="#5F5F5F" >From: </font><font size="2" >Jinsong Ji/Jacksonville/IBM</font><br><font size="2" color="#5F5F5F" >To: </font><font size="2" >Hubert Tong/Toronto/IBM@IBMCA</font><br><font size="2" color="#5F5F5F" >Cc: </font><font size="2" >Zi Xuan CW Wu/China/IBM@IBMCN, cfe-dev@lists.llvm.org, Nemanja Ivanovic/Toronto/IBM@IBMCA, Bill Schmidt/Rochester/IBM@IBMUS</font><br><font size="2" color="#5F5F5F" >Date: </font><font size="2" >18-10-2018 03:53 p.m.</font><br><font size="2" color="#5F5F5F" >Subject: </font><font size="2" >Re: C/C++ operator meaning is different between gcc generic vector type and altivec type </font>
<hr style="color:#8091A5; " size="2" align="left" width="100%" ><br><br><font size="2" >Hi Hubert:</font><br><br><font size="2" >Looks like the interpretation of ABI should be the opposite of your understanding.</font><br><br><font size="2" >"The ABI (as cited by Hubert) clearly means that all of the operators described there</font><b><font size="2" > are to operate independently on each lane</font></b><font size="2" >.  Vector binary addition is not "sum across", so why should vector <= mean vec_all_le (or vec_any_le, for that matter)?  </font><b><font size="2" >The result of <= should be a vector of booleans.</font></b><font size="2" >"</font><br><br><br><br><font size="2" >Best,<br><br>Jinsong Ji (纪金松), PhD.<br><br>XL C/C++, XL Fortran Compiler Development<br>E-mail: jji@us.ibm.com</font><br><br><br><img alt="Inactive hide details for Hubert Tong---10/18/2018 10:03:40 AM---The OpenPOWER ABI for Linux Supplement for the Power Architect" src="/icons/graycol.gif" width="16" height="16" border="0" ><font size="2" color="#424282" >Hubert Tong---10/18/2018 10:03:40 AM---The OpenPOWER ABI for Linux Supplement for the Power Architecture 64-bit ELF V2 ABI documents the fo</font><br><br><font size="2" color="#5F5F5F" >From: </font><font size="2" >Hubert Tong/Toronto/IBM</font><br><font size="2" color="#5F5F5F" >To: </font><font size="2" >Zi Xuan CW Wu/China/IBM@IBMCN</font><br><font size="2" color="#5F5F5F" >Cc: </font><font size="2" >cfe-dev@lists.llvm.org, Jinsong Ji/Jacksonville/IBM@IBMUS, Nemanja Ivanovic/Toronto/IBM@IBMCA</font><br><font size="2" color="#5F5F5F" >Date: </font><font size="2" >10/18/2018 10:03 AM</font><br><font size="2" color="#5F5F5F" >Subject: </font><font size="2" >Re: C/C++ operator meaning is different between gcc generic vector type and altivec type </font>
<hr style="color:#8091A5; " size="2" align="left" width="100%" ><br><br><font size="2" >The OpenPOWER ABI for Linux Supplement for the Power Architecture 64-bit ELF V2 ABI documents the following under Section 6.2. "Vector Operators":</font><br><br><font size="2" >The traditional C/C++ operators are defined on vector types with “do all” semantics for unary and binary +, unary and binary –, binary *, binary %, and binary / as well as the unary and binary shift, logical and comparison operators, and the ternary ?: operator.</font><br><br><font size="2" >So the answer is the the two kinds of vectors have separate semantics and Clang is right.</font><br><br><font size="2" >-- HT</font><br><br><br><img alt="Inactive hide details for Zi Xuan CW Wu---18-10-2018 02:18:23 a.m.---Hi, all.  I find the meaning of C/C++ language operator '<" src="/icons/graycol.gif" width="16" height="16" border="0" ><font size="2" color="#424282" >Zi Xuan CW Wu---18-10-2018 02:18:23 a.m.---Hi, all.  I find the meaning of C/C++ language operator '<=' is different between different vector k</font><br><br><font size="2" color="#5F5F5F" >From: </font><font size="2" >Zi Xuan CW Wu/China/IBM</font><br><font size="2" color="#5F5F5F" >To: </font><font size="2" >cfe-dev@lists.llvm.org</font><br><font size="2" color="#5F5F5F" >Cc: </font><font size="2" >Jinsong Ji/Jacksonville/IBM@IBMUS, Nemanja Ivanovic/Toronto/IBM@IBMCA, Hubert Tong/Toronto/IBM@IBMCA</font><br><font size="2" color="#5F5F5F" >Date: </font><font size="2" >18-10-2018 02:18 a.m.</font><br><font size="2" color="#5F5F5F" >Subject: </font><font size="2" >C/C++ operator meaning is different between gcc generic vector type and altivec type </font>
<hr style="color:#8091A5; " size="2" align="left" width="100%" ><br><br><br><font size="3" face="Arial" >Hi, all.<br><br>I find the meaning of C/C++ language operator '<=' is different between different vector kind type. For example, a legal clang code as following. But it's ill-formed in GCC. </font>
<ul style="padding-left: 30pt; margin-left: 0px; list-style-type: none;" >        <li><font size="3" face="Arial" >typedef int v4 __attribute((vector_size(16)));<br>        <br>        int main(){<br>         v4 va;<br>         v4 vb;<br>         vector int a;<br>         vector int b;<br>        <br>         </font><b><u><font size="3" face="Arial" >int</font></u></b><u><font size="3" face="Arial" > c = a</font></u><b><u><font size="3" face="Arial" ><=</font></u></b><u><font size="3" face="Arial" >b;</font></u><br>        <font size="3" face="Arial" >  </font><b><u><font size="3" face="Arial" >v4</font></u></b><u><font size="3" face="Arial" > vc = va</font></u><b><u><font size="3" face="Arial" ><=</font></u></b><u><font size="3" face="Arial" >vb;</font></u><br>        <br>        <font size="3" face="Arial" >}<br>        <br>        g++ a.C<br>        a.C: In function 'int main()':<br>        a.C:9:14: error: cannot convert '__vector(4) int' to 'int' in initialization<br>          int c = a<=b;</font></li></ul><font size="3" face="Arial" > </font><br><font size="3" face="Arial" >The return type of '<=' operator of Altivec kind vector is not same as generic gcc kind vector. One is int, the other one is vector. But in GCC, it's same return type and meaning, which is described at </font><a href="https://gcc.gnu.org/onlinedocs/gcc/Vector-Extensions.html" target="_blank" ><u><font size="3" face="Arial" color="#0000FF" >https://gcc.gnu.org/onlinedocs/gcc/Vector-Extensions.html</font></u></a><br><br><font size="3" face="Arial" >So my question is what it is we would like relational and equality operators to do with vectors? We make the meaning of two kind vectors consistent or separate? Or which document is standard rule to implement the semantic meaning?</font>
<ul style="padding-left: 30pt; margin-left: 0px; list-style-type: none;" >        <li><font size="3" face="Arial" > </font></li></ul><font size="3" face="Arial" > </font><br><font size="3" face="Arial" >Regards,</font><br><font size="3" face="Arial" > </font><br><br><font size="3" face="Arial" >Zixuan Wu (Zeson)</font><br><br><font size="3" face="Arial" >XL C/C++ Compiler Developer<br>IBM Systems, z System<br>E-mail: wuzish@cn.ibm.com<br>Tel: 86-21-60928420</font><br><font size="3" face="Arial" > </font><br><i><font size="4" face="Arial" >Compiler : The Art of Lowering</font></i><br><font size="3" face="Arial" > </font><br><br><br> </blockquote>
<div dir="ltr" > </div></div><BR>