<html><body><p><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><font size="2"><br>-- 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<br></font><br><br><img width="16" height="16" src="cid:1__=8FBB09B9DFE7AE928f9e8a93df938690918c8FB@" border="0" 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"><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><br><hr width="100%" size="2" align="left" noshade style="color:#8091A5; "><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 width="16" height="16" src="cid:1__=8FBB09B9DFE7AE928f9e8a93df938690918c8FB@" border="0" 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"><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><br><hr width="100%" size="2" align="left" noshade style="color:#8091A5; "><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><font size="2"><br>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 width="16" height="16" src="cid:1__=8FBB09B9DFE7AE928f9e8a93df938690918c8FB@" border="0" alt="Inactive hide details for Hubert Tong---10/18/2018 10:03:40 AM---The OpenPOWER ABI for Linux Supplement for the Power Architect"><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><br><hr width="100%" size="2" align="left" noshade style="color:#8091A5; "><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 ¨C, 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 width="16" height="16" src="cid:1__=8FBB09B9DFE7AE928f9e8a93df938690918c8FB@" border="0" 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 '<"><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><br><hr width="100%" size="2" align="left" noshade style="color:#8091A5; "><br><br><br><font 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><ul><font 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 face="Arial">int</font></u></b><u><font face="Arial"> c = a</font></u><b><u><font face="Arial"><=</font></u></b><u><font face="Arial">b;<br></font></u><font face="Arial">  </font><b><u><font face="Arial">v4</font></u></b><u><font face="Arial"> vc = va</font></u><b><u><font face="Arial"><=</font></u></b><u><font face="Arial">vb;</font></u><font face="Arial"><br><br>}<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;<br></font></ul></ul><font face="Arial"> </font><br><font 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 color="#0000FF" face="Arial">https://gcc.gnu.org/onlinedocs/gcc/Vector-Extensions.html</font></u></a><br><font face="Arial"><br>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><ul><font face="Arial"> </font></ul></ul><font face="Arial"> </font><br><font face="Arial">Regards,</font><br><font face="Arial"> </font><br><font face="Arial"><br>Zixuan Wu (Zeson)</font><br><font face="Arial"><br>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 face="Arial"> </font><br><i><font size="4" face="Arial">Compiler : The Art of Lowering</font></i><br><font face="Arial"> </font><br><br><br><br><br><BR>
</body></html>