This patch is the rs6000.h changes. It makes the IEEE 128-bit floating point
type that can go in vector registers a 'vector' type, so that the address code
in rs6000.c that determines whether to use VSX addressing works. In addition, I
made IEEE 128-bit floating point tie with vectors and not with other scalar
floats.

I have built the compiler with this patch applied, and run bootstrap and
regression tests with all of the patches installed.  Is it ok to install on the
trunk?

2015-10-22  Michael Meissner  <meiss...@linux.vnet.ibm.com>

        * config/rs6000/rs6000.h (ALTIVEC_VECTOR_MODE): Add IEEE 128-bit
        floating point modes that can go in vector registers.
        (MODES_TIEABLE_P): Move tests for vector modes before tests for
        scalar floating point, so that IEEE 128-bit floating point that
        can go in vector registers bind with vectors and not FP.
        (struct rs6000_args): Add libcall field.


-- 
Michael Meissner, IBM
IBM, M/S 2506R, 550 King Street, Littleton, MA 01460-6245, USA
email: meiss...@linux.vnet.ibm.com, phone: +1 (978) 899-4797
Index: gcc/config/rs6000/rs6000.h
===================================================================
--- gcc/config/rs6000/rs6000.h  (revision 229182)
+++ gcc/config/rs6000/rs6000.h  (working copy)
@@ -1217,11 +1217,16 @@ enum data_align { align_abi, align_opt, 
         ((MODE) == V4SFmode            \
          || (MODE) == V2DFmode)        \
 
-#define ALTIVEC_VECTOR_MODE(MODE)      \
-        ((MODE) == V16QImode           \
-         || (MODE) == V8HImode         \
-         || (MODE) == V4SFmode         \
-         || (MODE) == V4SImode)
+/* Note KFmode and possibly TFmode (i.e. IEEE 128-bit floating point) are not
+   really a vector, but we want to treat it as a vector for moves, and
+   such.  */
+
+#define ALTIVEC_VECTOR_MODE(MODE)                                      \
+  ((MODE) == V16QImode                                                 \
+   || (MODE) == V8HImode                                               \
+   || (MODE) == V4SFmode                                               \
+   || (MODE) == V4SImode                                               \
+   || FLOAT128_VECTOR_P (MODE))
 
 #define ALTIVEC_OR_VSX_VECTOR_MODE(MODE)                               \
   (ALTIVEC_VECTOR_MODE (MODE) || VSX_VECTOR_MODE (MODE)                        
\
@@ -1248,12 +1253,19 @@ enum data_align { align_abi, align_opt, 
 
    PTImode cannot tie with other modes because PTImode is restricted to even
    GPR registers, and TImode can go in any GPR as well as VSX registers (PR
-   57744).  */
+   57744).
+
+   Altivec/VSX vector tests were moved ahead of scalar float mode, so that IEEE
+   128-bit floating point on VSX systems ties with other vectors.  */
 #define MODES_TIEABLE_P(MODE1, MODE2)          \
   ((MODE1) == PTImode                          \
    ? (MODE2) == PTImode                                \
    : (MODE2) == PTImode                                \
    ? 0                                         \
+   : ALTIVEC_OR_VSX_VECTOR_MODE (MODE1)                \
+   ? ALTIVEC_OR_VSX_VECTOR_MODE (MODE2)                \
+   : ALTIVEC_OR_VSX_VECTOR_MODE (MODE2)                \
+   ? 0                                         \
    : SCALAR_FLOAT_MODE_P (MODE1)               \
    ? SCALAR_FLOAT_MODE_P (MODE2)               \
    : SCALAR_FLOAT_MODE_P (MODE2)               \
@@ -1266,10 +1278,6 @@ enum data_align { align_abi, align_opt, 
    ? SPE_VECTOR_MODE (MODE2)                   \
    : SPE_VECTOR_MODE (MODE2)                   \
    ? 0                                         \
-   : ALTIVEC_OR_VSX_VECTOR_MODE (MODE1)                \
-   ? ALTIVEC_OR_VSX_VECTOR_MODE (MODE2)                \
-   : ALTIVEC_OR_VSX_VECTOR_MODE (MODE2)                \
-   ? 0                                         \
    : 1)
 
 /* Post-reload, we can't use any new AltiVec registers, as we already
@@ -1801,6 +1809,7 @@ typedef struct rs6000_args
                                   GPR space (darwin64) */
   int named;                   /* false for varargs params */
   int escapes;                 /* if function visible outside tu */
+  int libcall;                 /* If this is a compiler generated call.  */
 } CUMULATIVE_ARGS;
 
 /* Initialize a variable CUM of type CUMULATIVE_ARGS

Reply via email to