[PATCH] D63636: [PowerPC][Altivec] Fix offsets for vec_xl and vec_xst

Jinsong Ji via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 21 15:06:02 PDT 2019


jsji added a comment.

A few questions.



================
Comment at: lib/Headers/altivec.h:16364
                                                       signed short *__ptr) {
-  return *(unaligned_vec_sshort *)(__ptr + __offset);
+  signed char *Adjusted = (signed char *)__ptr + __offset;
+  return *(unaligned_vec_sshort *)((signed short *)Adjusted);
----------------
Why we name it `Adjusted`?  Why not just `__addr`? 


================
Comment at: lib/Headers/altivec.h:16365
+  signed char *Adjusted = (signed char *)__ptr + __offset;
+  return *(unaligned_vec_sshort *)((signed short *)Adjusted);
 }
----------------
Why we want to cast it to `(signed short *)` again? Looks like unnecessary casting to me?


================
Comment at: test/CodeGen/builtins-ppc-xl-xst.c:4
+// RUN: %clang_cc1 -target-feature +altivec -target-feature +vsx -triple powerpc64-unknown-unknown -emit-llvm %s -o - | FileCheck %s
+// RUN: %clang_cc1 -target-feature +altivec -target-feature +vsx -target-feature +power8-vector -triple powerpc64le-unknown-unknown -emit-llvm %s -o - | FileCheck %s -check-prefix=CHECK-P8
+#include <altivec.h>
----------------
Any difference for results without `power8-vector `, except for `test9` and `test10`?

Why not split `test9` and `test10` to another file for simplicity?


Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D63636/new/

https://reviews.llvm.org/D63636





More information about the cfe-commits mailing list