]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
backport: re PR testsuite/61415 (PowerPC test gcc.target/powerpc/tfmode_off.c fails...
authorPeter Bergner <bergner@vnet.ibm.com>
Fri, 13 Jun 2014 21:58:49 +0000 (16:58 -0500)
committerPeter Bergner <bergner@gcc.gnu.org>
Fri, 13 Jun 2014 21:58:49 +0000 (16:58 -0500)
gcc/
Backport from mainline

2014-06-13  Peter Bergner  <bergner@vnet.ibm.com>
PR target/61415
* config/rs6000/rs6000-builtin.def (BU_MISC_1): Delete.
(BU_MISC_2): Rename to ...
(BU_LDBL128_2): ... this.
* config/rs6000/rs6000.h (RS6000_BTM_LDBL128): New define.
(RS6000_BTM_COMMON): Add RS6000_BTM_LDBL128.
* config/rs6000/rs6000.c (rs6000_builtin_mask_calculate): Handle
RS6000_BTM_LDBL128.
(rs6000_invalid_builtin): Add long double 128-bit builtin support.
(rs6000_builtin_mask_names): Add RS6000_BTM_LDBL128.
* config/rs6000/rs6000.md (unpacktf_0): Remove define)expand.
(unpacktf_1): Likewise.
* doc/extend.texi (__builtin_longdouble_dw0): Remove documentation.
(__builtin_longdouble_dw1): Likewise.
* doc/sourcebuild.texi (longdouble128): Document.

gcc/testsuite/
Backport from mainline

2014-06-13  Peter Bergner  <bergner@vnet.ibm.com>
PR target/61415
* lib/target-supports.exp (check_effective_target_longdouble128): New.
* gcc.target/powerpc/pack02.c: Use it.
* gcc.target/powerpc/tfmode_off.c: Likewise.

From-SVN: r211657

gcc/ChangeLog
gcc/config/rs6000/rs6000-builtin.def
gcc/config/rs6000/rs6000.c
gcc/config/rs6000/rs6000.h
gcc/config/rs6000/rs6000.md
gcc/doc/extend.texi
gcc/doc/sourcebuild.texi
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/powerpc/pack02.c
gcc/testsuite/gcc.target/powerpc/tfmode_off.c
gcc/testsuite/lib/target-supports.exp

index c950ee7e6df4f2b4255349970a38fc3e341dcdb4..c9ab54f0a5a341c249bd4be926e416eeb6f3a4bf 100644 (file)
@@ -1,3 +1,24 @@
+2014-06-13  Peter Bergner  <bergner@vnet.ibm.com>
+
+       Backport from mainline
+
+       2014-06-13  Peter Bergner  <bergner@vnet.ibm.com>
+       PR target/61415
+       * config/rs6000/rs6000-builtin.def (BU_MISC_1): Delete.
+       (BU_MISC_2): Rename to ...
+       (BU_LDBL128_2): ... this.
+       * config/rs6000/rs6000.h (RS6000_BTM_LDBL128): New define.
+       (RS6000_BTM_COMMON): Add RS6000_BTM_LDBL128.
+       * config/rs6000/rs6000.c (rs6000_builtin_mask_calculate): Handle
+       RS6000_BTM_LDBL128.
+       (rs6000_invalid_builtin): Add long double 128-bit builtin support.
+       (rs6000_builtin_mask_names): Add RS6000_BTM_LDBL128.
+       * config/rs6000/rs6000.md (unpacktf_0): Remove define)expand.
+       (unpacktf_1): Likewise.
+       * doc/extend.texi (__builtin_longdouble_dw0): Remove documentation.
+       (__builtin_longdouble_dw1): Likewise.
+       * doc/sourcebuild.texi (longdouble128): Document.
+
 2014-06-13  Jason Merrill  <jason@redhat.com>
 
        PR c++/60731
index 92ba2757769db63d41e3164a620e33553af7d935..f7eb2714ff63cd32176c8d52153646aec1465f33 100644 (file)
                     | RS6000_BTC_TERNARY),                             \
                    CODE_FOR_ ## ICODE)                 /* ICODE */
 
-/* Miscellaneous builtins.  */
-#define BU_MISC_1(ENUM, NAME, ATTR, ICODE)                             \
-  RS6000_BUILTIN_2 (MISC_BUILTIN_ ## ENUM,             /* ENUM */      \
-                   "__builtin_" NAME,                  /* NAME */      \
-                   RS6000_BTM_HARD_FLOAT,              /* MASK */      \
-                   (RS6000_BTC_ ## ATTR                /* ATTR */      \
-                    | RS6000_BTC_UNARY),                               \
-                   CODE_FOR_ ## ICODE)                 /* ICODE */
-
-#define BU_MISC_2(ENUM, NAME, ATTR, ICODE)                             \
+/* 128-bit long double floating point builtins.  */
+#define BU_LDBL128_2(ENUM, NAME, ATTR, ICODE)                          \
   RS6000_BUILTIN_2 (MISC_BUILTIN_ ## ENUM,             /* ENUM */      \
                    "__builtin_" NAME,                  /* NAME */      \
-                   RS6000_BTM_HARD_FLOAT,              /* MASK */      \
+                   (RS6000_BTM_HARD_FLOAT              /* MASK */      \
+                    | RS6000_BTM_LDBL128),                             \
                    (RS6000_BTC_ ## ATTR                /* ATTR */      \
                     | RS6000_BTC_BINARY),                              \
                    CODE_FOR_ ## ICODE)                 /* ICODE */
@@ -1593,10 +1586,8 @@ BU_P8V_MISC_3 (BCDSUB_OV,        "bcdsub_ov",    CONST,  bcdsub_unordered)
 BU_DFP_MISC_2 (PACK_TD,                "pack_dec128",          CONST,  packtd)
 BU_DFP_MISC_2 (UNPACK_TD,      "unpack_dec128",        CONST,  unpacktd)
 
-BU_MISC_2 (PACK_TF,            "pack_longdouble",      CONST,  packtf)
-BU_MISC_2 (UNPACK_TF,          "unpack_longdouble",    CONST,  unpacktf)
-BU_MISC_1 (UNPACK_TF_0,                "longdouble_dw0",       CONST,  unpacktf_0)
-BU_MISC_1 (UNPACK_TF_1,                "longdouble_dw1",       CONST,  unpacktf_1)
+BU_LDBL128_2 (PACK_TF,         "pack_longdouble",      CONST,  packtf)
+BU_LDBL128_2 (UNPACK_TF,       "unpack_longdouble",    CONST,  unpacktf)
 
 BU_P7_MISC_2 (PACK_V1TI,       "pack_vector_int128",   CONST,  packv1ti)
 BU_P7_MISC_2 (UNPACK_V1TI,     "unpack_vector_int128", CONST,  unpackv1ti)
index 4cf2589db8b57c7f5e0156999d132967fa6b49dd..3c1ff4d2563fb171a71c33b5f81de9c869df259c 100644 (file)
@@ -3014,7 +3014,8 @@ rs6000_builtin_mask_calculate (void)
          | ((TARGET_CRYPTO)                ? RS6000_BTM_CRYPTO    : 0)
          | ((TARGET_HTM)                   ? RS6000_BTM_HTM       : 0)
          | ((TARGET_DFP)                   ? RS6000_BTM_DFP       : 0)
-         | ((TARGET_HARD_FLOAT)            ? RS6000_BTM_HARD_FLOAT : 0));
+         | ((TARGET_HARD_FLOAT)            ? RS6000_BTM_HARD_FLOAT : 0)
+         | ((TARGET_LONG_DOUBLE_128)       ? RS6000_BTM_LDBL128 : 0));
 }
 
 /* Override command line options.  Mostly we process the processor type and
@@ -13575,11 +13576,15 @@ rs6000_invalid_builtin (enum rs6000_builtins fncode)
   else if ((fnmask & (RS6000_BTM_DFP | RS6000_BTM_P8_VECTOR))
           == (RS6000_BTM_DFP | RS6000_BTM_P8_VECTOR))
     error ("Builtin function %s requires the -mhard-dfp and"
-          "-mpower8-vector options", name);
+          " -mpower8-vector options", name);
   else if ((fnmask & RS6000_BTM_DFP) != 0)
     error ("Builtin function %s requires the -mhard-dfp option", name);
   else if ((fnmask & RS6000_BTM_P8_VECTOR) != 0)
     error ("Builtin function %s requires the -mpower8-vector option", name);
+  else if ((fnmask & (RS6000_BTM_HARD_FLOAT | RS6000_BTM_LDBL128))
+          == (RS6000_BTM_HARD_FLOAT | RS6000_BTM_LDBL128))
+    error ("Builtin function %s requires the -mhard-float and"
+          " -mlong-double-128 options", name);
   else if ((fnmask & RS6000_BTM_HARD_FLOAT) != 0)
     error ("Builtin function %s requires the -mhard-float option", name);
   else
@@ -31444,6 +31449,7 @@ static struct rs6000_opt_mask const rs6000_builtin_mask_names[] =
   { "htm",              RS6000_BTM_HTM,        false, false },
   { "hard-dfp",                 RS6000_BTM_DFP,        false, false },
   { "hard-float",       RS6000_BTM_HARD_FLOAT, false, false },
+  { "long-double-128",  RS6000_BTM_LDBL128,    false, false },
 };
 
 /* Option variables that we want to support inside attribute((target)) and
index 2855ec5f4c43fe17d4bdbc3c28fbc0c7c42cda3a..90a93f71f4a12a29786f8a81dd4629c252d6a4e6 100644 (file)
@@ -2490,8 +2490,8 @@ extern int frame_pointer_needed;
 #define RS6000_BTC_SAT         RS6000_BTC_MISC /* saturate sets VSCR.  */
 
 /* Builtin targets.  For now, we reuse the masks for those options that are in
-   target flags, and pick two random bits for SPE and paired which aren't in
-   target_flags.  */
+   target flags, and pick three random bits for SPE, paired and ldbl128 which
+   aren't in target_flags.  */
 #define RS6000_BTM_ALWAYS      0               /* Always enabled.  */
 #define RS6000_BTM_ALTIVEC     MASK_ALTIVEC    /* VMX/altivec vectors.  */
 #define RS6000_BTM_VSX         MASK_VSX        /* VSX (vector/scalar).  */
@@ -2508,6 +2508,7 @@ extern int frame_pointer_needed;
 #define RS6000_BTM_CELL                MASK_FPRND      /* Target is cell powerpc.  */
 #define RS6000_BTM_DFP         MASK_DFP        /* Decimal floating point.  */
 #define RS6000_BTM_HARD_FLOAT  MASK_SOFT_FLOAT /* Hardware floating point.  */
+#define RS6000_BTM_LDBL128     MASK_MULTIPLE   /* 128-bit long double.  */
 
 #define RS6000_BTM_COMMON      (RS6000_BTM_ALTIVEC                     \
                                 | RS6000_BTM_VSX                       \
@@ -2521,7 +2522,8 @@ extern int frame_pointer_needed;
                                 | RS6000_BTM_POPCNTD                   \
                                 | RS6000_BTM_CELL                      \
                                 | RS6000_BTM_DFP                       \
-                                | RS6000_BTM_HARD_FLOAT)
+                                | RS6000_BTM_HARD_FLOAT                \
+                                | RS6000_BTM_LDBL128)
 
 /* Define builtin enum index.  */
 
index 78b8c828b8efdad04a1d99fa06bba3e676c5accd..bff4cef5fa033204b93ba38ada97613925bb281b 100644 (file)
   ""
   "")
 
-;; The Advance Toolchain 7.0-3 added private builtins: __builtin_longdouble_dw0
-;; and __builtin_longdouble_dw1 to optimize glibc.  Add support for these
-;; builtins here.
-
-(define_expand "unpacktf_0"
-  [(set (match_operand:DF 0 "nonimmediate_operand" "")
-       (unspec:DF [(match_operand:TF 1 "register_operand" "")
-                   (const_int 0)]
-        UNSPEC_UNPACK_128BIT))]
-  ""
-  "")
-
-(define_expand "unpacktf_1"
-  [(set (match_operand:DF 0 "nonimmediate_operand" "")
-       (unspec:DF [(match_operand:TF 1 "register_operand" "")
-                   (const_int 1)]
-        UNSPEC_UNPACK_128BIT))]
-  ""
-  "")
-
 (define_insn_and_split "unpack<mode>_dm"
   [(set (match_operand:<FP128_64> 0 "nonimmediate_operand" "=d,m,d,r,m")
        (unspec:<FP128_64>
index 29d66a1ab6a32e2aa0885b5e41d22dad70ddfb2e..610663b8c46fad491c49dfd7107d534f2f3dbfb4 100644 (file)
@@ -11857,8 +11857,6 @@ double __builtin_rsqrt (double);
 uint64_t __builtin_ppc_get_timebase ();
 unsigned long __builtin_ppc_mftb ();
 double __builtin_unpack_longdouble (long double, int);
-double __builtin_longdouble_dw0 (long double);
-double __builtin_longdouble_dw1 (long double);
 long double __builtin_pack_longdouble (double, double);
 @end smallexample
 
index 9330aae520245784ca62987fddbd865d8fcc95dc..ecbf3f4aa031a40765106a6e56523059b8f23c9b 100644 (file)
@@ -1299,6 +1299,9 @@ Target has 64-bit @code{double}.
 @item double64plus
 Target has @code{double} that is 64 bits or longer.
 
+@item longdouble128
+Target has 128-bit @code{long double}.
+
 @item int32plus
 Target has @code{int} that is at 32 bits or longer.
 
index 79b6682e170d424a54e6bf4fbda8be7887d7c967..b58c46f208a1829fbb65f99929b2594f63a17a8d 100644 (file)
@@ -1,3 +1,13 @@
+2014-06-13  Peter Bergner  <bergner@vnet.ibm.com>
+
+       Backport from mainline
+
+       2014-06-13  Peter Bergner  <bergner@vnet.ibm.com>
+       PR target/61415
+       * lib/target-supports.exp (check_effective_target_longdouble128): New.
+       * gcc.target/powerpc/pack02.c: Use it.
+       * gcc.target/powerpc/tfmode_off.c: Likewise.
+
 2014-06-12  Georg-Johann Lay  <avr@gjlay.de>
 
        Backport from 2014-06-12 trunk r211491
index 584d6c292055831221f76666221fd4e9745040ca..f85d3ff00b015c0b90a9391181436290051868d3 100644 (file)
@@ -2,6 +2,7 @@
 /* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
 /* { dg-skip-if "" { powerpc*-*-*spe* } { "*" } { "" } } */
 /* { dg-require-effective-target powerpc_fprs } */
+/* { dg-require-effective-target longdouble128 } */
 /* { dg-options "-O2 -mhard-float" } */
 
 #include <stddef.h>
index e6578ef31a814d38bd1abeff30bf47c104b3f7b8..ea703f0ee0a8da8fe8573e03a1b14d7b33b74c61 100644 (file)
@@ -1,6 +1,7 @@
 /* { dg-do assemble } */
 /* { dg-skip-if "" { powerpc-ibm-aix* } { "*" } { "" } } */
 /* { dg-skip-if "no TFmode" { powerpc-*-eabi* } { "*" } { "" } } */
+/* { dg-require-effective-target longdouble128 } */
 /* { dg-options "-O2 -fno-align-functions -mtraceback=no -save-temps" } */
 
 typedef float TFmode __attribute__ ((mode (TF)));
index f32cd04838dd36b89b8de9a72582f64448a42024..a76968202c84204e5e21af82342afc709af15135 100644 (file)
@@ -1790,6 +1790,15 @@ proc check_effective_target_large_double { } {
     }]
 }
 
+# Return 1 if the target supports long double of 128 bits,
+# 0 otherwise.
+
+proc check_effective_target_longdouble128 { } {
+    return [check_no_compiler_messages longdouble128 object {
+       int dummy[sizeof(long double) == 16 ? 1 : -1];
+    }]
+}
+
 # Return 1 if the target supports double of 64 bits,
 # 0 otherwise.