[PATCH] D47569: [Power9]Legalize and emit code for quad-precision convert from single-precision

Lei Huang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 31 14:56:13 PDT 2018


lei marked 2 inline comments as done.
lei added inline comments.


================
Comment at: lib/Target/PowerPC/PPCInstrVSX.td:3388
+                                       (COPY_TO_REGCLASS $src, VSFRC))))>;
+  def : Pat<(f128 (fpextend (f32 (load ixaddr:$src)))),
+            (f128 (XSCVDPQP (LXSSP ixaddr:$src)))>;
----------------
nemanjai wrote:
> These two patterns seem:
> 1. Redundant since we can handle loading and extending separately already anyway
> 2. Wrong if the weird sign copying sequence is actually necessary
> 
> We will produce a different sequence for these two equivalent snippets of code and that seems wrong:
> ```
> __float128 test1(float *Ptr) {
>   return *Ptr;
> }
> ```
> vs.
> ```
> float __attribute__((noinline)) getFromPtr(float *Ptr) { return *Ptr; }
> __float128 test2(float *Ptr) {
>   return getFromPtr(Ptr);
> }
> ```
Is this equivalent? `test1` returns `*Ptr` which is pass in via GPR as it's a pointer to a float, whereas `test2` is returning the return value from `getFromPtr` which is in a FPR.


https://reviews.llvm.org/D47569





More information about the llvm-commits mailing list