README_ALTIVEC.txt revision b86bd2cee25c15862247b4641700d448fbd0fa24
1//===- README_ALTIVEC.txt - Notes for improving Altivec code gen ----------===//
2
3Implement TargetConstantVec, and set up PPC to custom lower ConstantVec into
4TargetConstantVec's if it's one of the many forms that are algorithmically
5computable using the spiffy altivec instructions.
6
7//===----------------------------------------------------------------------===//
8
9Implement PPCInstrInfo::isLoadFromStackSlot/isStoreToStackSlot for vector
10registers, to generate better spill code.
11
12//===----------------------------------------------------------------------===//
13
14Altivec support.  The first should be a single lvx from the constant pool, the
15second should be a xor/stvx:
16
17void foo(void) {
18  int x[8] __attribute__((aligned(128))) = { 1, 1, 1, 1, 1, 1, 1, 1 };
19  bar (x);
20}
21
22#include <string.h>
23void foo(void) {
24  int x[8] __attribute__((aligned(128)));
25  memset (x, 0, sizeof (x));
26  bar (x);
27}
28
29//===----------------------------------------------------------------------===//
30
31Altivec: Codegen'ing MUL with vector FMADD should add -0.0, not 0.0:
32http://gcc.gnu.org/bugzilla/show_bug.cgi?id=8763
33
34We need to codegen -0.0 vector efficiently (no constant pool load).
35
36When -ffast-math is on, we can use 0.0.
37
38//===----------------------------------------------------------------------===//
39
40  Consider this:
41  v4f32 Vector;
42  v4f32 Vector2 = { Vector.X, Vector.X, Vector.X, Vector.X };
43
44Since we know that "Vector" is 16-byte aligned and we know the element offset 
45of ".X", we should change the load into a lve*x instruction, instead of doing
46a load/store/lve*x sequence.
47
48//===----------------------------------------------------------------------===//
49
50There are a wide range of vector constants we can generate with combinations of
51altivec instructions.  For example, GCC does: t=vsplti*, r = t+t.
52
53//===----------------------------------------------------------------------===//
54
55