+2018-04-02 Peter Bergner <bergner@vnet.ibm.com>
+
+ Backport from mainline
+ 2018-03-28 Peter Bergner <bergner@vnet.ibm.com>
+
+ PR target/84912
+ * config/rs6000/rs6000.h: Update copyright date.
+ (RS6000_BTM_POWERPC64): New define.
+ (RS6000_BTM_COMMON): Add RS6000_BTM_POWERPC64.
+ * config/rs6000/rs6000.c: Update copyright date.
+ (rs6000_builtin_mask_calculate): Add support for RS6000_BTM_POWERPC64.
+ (rs6000_invalid_builtin): Add handling for RS6000_BTM_POWERPC64
+ (rs6000_builtin_mask_names): Add RS6000_BTM_POWERPC64.
+ * config/rs6000/rs6000-builtin.def: Update copyright date.
+ (BU_P7_POWERPC64_MISC_2): New macro definition.
+ (DIVDE): Use it.
+ (DIVDEU): Likewise.
+
+ Backport from mainline
+ 2018-03-28 Peter Bergner <bergner@vnet.ibm.com>
+
+ PR target/84912
+ * config/rs6000/rs6000-builtin.def (DIVWEO): Delete macro expansion.
+ (DIVWEUO): Likewise.
+ (DIVDEO): Likewise.
+ (DIVDEUO): Likewise.
+ * config/rs6000/rs6000.c (builtin_function_type): Remove support for
+ DIVWEUO and DIVDEUO.
+ * config/rs6000/rs6000.md: Update copyright date.
+ (UNSPEC_DIVEO, UNSPEC_DIVEUO): Delete unspecs.
+ (UNSPEC_DIV_EXTEND): Remove deleted unspecs.
+ (div_extend): Likewise.
+ * doc/extend.texi: Update copyright date.
+ (__builtin_divweo): Remove documentation for deleted builtin function.
+ (__builtin_divweuo): Likewise.
+ (__builtin_divdeo): Likewise.
+ (__builtin_divdeuo): Likewise.
+
2018-03-30 Cesar Philippidis <cesar@codesourcery.com>
Backport from mainline
/* Builtin functions for rs6000/powerpc.
- Copyright (C) 2009-2016 Free Software Foundation, Inc.
+ Copyright (C) 2009-2018 Free Software Foundation, Inc.
Contributed by Michael Meissner (meissner@linux.vnet.ibm.com)
This file is part of GCC.
| RS6000_BTC_BINARY), \
CODE_FOR_ ## ICODE) /* ICODE */
+#define BU_P7_POWERPC64_MISC_2(ENUM, NAME, ATTR, ICODE) \
+ RS6000_BUILTIN_2 (MISC_BUILTIN_ ## ENUM, /* ENUM */ \
+ "__builtin_" NAME, /* NAME */ \
+ RS6000_BTM_POPCNTD /* MASK */ \
+ | RS6000_BTM_POWERPC64, \
+ (RS6000_BTC_ ## ATTR /* ATTR */ \
+ | RS6000_BTC_BINARY), \
+ CODE_FOR_ ## ICODE) /* ICODE */
/* Miscellaneous builtins for instructions added in ISA 2.07. These
instructions do require the ISA 2.07 vector support, but they aren't vector
\f
/* 2 argument extended divide functions added in ISA 2.06. */
BU_P7_MISC_2 (DIVWE, "divwe", CONST, dive_si)
-BU_P7_MISC_2 (DIVWEO, "divweo", CONST, diveo_si)
BU_P7_MISC_2 (DIVWEU, "divweu", CONST, diveu_si)
-BU_P7_MISC_2 (DIVWEUO, "divweuo", CONST, diveuo_si)
-BU_P7_MISC_2 (DIVDE, "divde", CONST, dive_di)
-BU_P7_MISC_2 (DIVDEO, "divdeo", CONST, diveo_di)
-BU_P7_MISC_2 (DIVDEU, "divdeu", CONST, diveu_di)
-BU_P7_MISC_2 (DIVDEUO, "divdeuo", CONST, diveuo_di)
+BU_P7_POWERPC64_MISC_2 (DIVDE, "divde", CONST, dive_di)
+BU_P7_POWERPC64_MISC_2 (DIVDEU, "divdeu", CONST, diveu_di)
/* 1 argument DFP (decimal floating point) functions added in ISA 2.05. */
BU_DFP_MISC_1 (DXEX, "dxex", CONST, dfp_dxex_dd)
/* Subroutines used for code generation on IBM RS/6000.
- Copyright (C) 1991-2016 Free Software Foundation, Inc.
+ Copyright (C) 1991-2018 Free Software Foundation, Inc.
Contributed by Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
This file is part of GCC.
| ((TARGET_P9_MISC) ? RS6000_BTM_P9_MISC : 0)
| ((TARGET_MODULO) ? RS6000_BTM_MODULO : 0)
| ((TARGET_64BIT) ? RS6000_BTM_64BIT : 0)
+ | ((TARGET_POWERPC64) ? RS6000_BTM_POWERPC64 : 0)
| ((TARGET_CRYPTO) ? RS6000_BTM_CRYPTO : 0)
| ((TARGET_HTM) ? RS6000_BTM_HTM : 0)
| ((TARGET_DFP) ? RS6000_BTM_DFP : 0)
error ("Builtin function %s requires the -mhard-float option", name);
else if ((fnmask & RS6000_BTM_FLOAT128) != 0)
error ("Builtin function %s requires the -mfloat128 option", name);
+ else if ((fnmask & (RS6000_BTM_POPCNTD | RS6000_BTM_POWERPC64))
+ == (RS6000_BTM_POPCNTD | RS6000_BTM_POWERPC64))
+ error ("builtin function %qs requires the %qs (or newer), and "
+ "%qs or %qs options",
+ name, "-mcpu=power7", "-m64", "-mpowerpc64");
else
error ("Builtin function %s is not supported with the current options",
name);
case CRYPTO_BUILTIN_VPMSUM:
case MISC_BUILTIN_ADDG6S:
case MISC_BUILTIN_DIVWEU:
- case MISC_BUILTIN_DIVWEUO:
case MISC_BUILTIN_DIVDEU:
- case MISC_BUILTIN_DIVDEUO:
h.uns_p[0] = 1;
h.uns_p[1] = 1;
h.uns_p[2] = 1;
{ "hard-dfp", RS6000_BTM_DFP, false, false },
{ "hard-float", RS6000_BTM_HARD_FLOAT, false, false },
{ "long-double-128", RS6000_BTM_LDBL128, false, false },
+ { "powerpc64", RS6000_BTM_POWERPC64, false, false },
{ "float128", RS6000_BTM_FLOAT128, false, false },
};
/* Definitions of target machine for GNU compiler, for IBM RS/6000.
- Copyright (C) 1992-2016 Free Software Foundation, Inc.
+ Copyright (C) 1992-2018 Free Software Foundation, Inc.
Contributed by Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
This file is part of GCC.
#define RS6000_BTM_HARD_FLOAT MASK_SOFT_FLOAT /* Hardware floating point. */
#define RS6000_BTM_LDBL128 MASK_MULTIPLE /* 128-bit long double. */
#define RS6000_BTM_64BIT MASK_64BIT /* 64-bit addressing. */
+#define RS6000_BTM_POWERPC64 MASK_POWERPC64 /* 64-bit registers. */
#define RS6000_BTM_FLOAT128 MASK_FLOAT128 /* IEEE 128-bit float. */
#define RS6000_BTM_COMMON (RS6000_BTM_ALTIVEC \
| RS6000_BTM_DFP \
| RS6000_BTM_HARD_FLOAT \
| RS6000_BTM_LDBL128 \
+ | RS6000_BTM_POWERPC64 \
| RS6000_BTM_FLOAT128)
/* Define builtin enum index. */
;; Machine description for IBM RISC System 6000 (POWER) for GNU C compiler
-;; Copyright (C) 1990-2017 Free Software Foundation, Inc.
+;; Copyright (C) 1990-2018 Free Software Foundation, Inc.
;; Contributed by Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
;; This file is part of GCC.
UNSPEC_CDTBCD
UNSPEC_CBCDTD
UNSPEC_DIVE
- UNSPEC_DIVEO
UNSPEC_DIVEU
- UNSPEC_DIVEUO
UNSPEC_UNPACK_128BIT
UNSPEC_PACK_128BIT
UNSPEC_LSQ
(set_attr "length" "4")])
(define_int_iterator UNSPEC_DIV_EXTEND [UNSPEC_DIVE
- UNSPEC_DIVEO
- UNSPEC_DIVEU
- UNSPEC_DIVEUO])
+ UNSPEC_DIVEU])
(define_int_attr div_extend [(UNSPEC_DIVE "e")
- (UNSPEC_DIVEO "eo")
- (UNSPEC_DIVEU "eu")
- (UNSPEC_DIVEUO "euo")])
+ (UNSPEC_DIVEU "eu")])
(define_insn "div<div_extend>_<mode>"
[(set (match_operand:GPR 0 "register_operand" "=r")
-@c Copyright (C) 1988-2016 Free Software Foundation, Inc.
+@c Copyright (C) 1988-2018 Free Software Foundation, Inc.
@c This is part of the GCC manual.
@c For copying conditions, see the file gcc.texi.
@smallexample
long __builtin_bpermd (long, long);
int __builtin_divwe (int, int);
-int __builtin_divweo (int, int);
unsigned int __builtin_divweu (unsigned int, unsigned int);
-unsigned int __builtin_divweuo (unsigned int, unsigned int);
long __builtin_divde (long, long);
-long __builtin_divdeo (long, long);
unsigned long __builtin_divdeu (unsigned long, unsigned long);
-unsigned long __builtin_divdeuo (unsigned long, unsigned long);
unsigned int cdtbcd (unsigned int);
unsigned int cbcdtd (unsigned int);
unsigned int addg6s (unsigned int, unsigned int);
@end smallexample
-The @code{__builtin_divde}, @code{__builtin_divdeo},
-@code{__builtin_divdeu}, @code{__builtin_divdeou} functions require a
-64-bit environment support ISA 2.06 or later.
+The @code{__builtin_divde} and @code{__builtin_divdeu} functions
+require a 64-bit environment supporting ISA 2.06 or later.
The following built-in functions are available for the PowerPC family
of processors, starting with ISA 3.0 or later (@option{-mcpu=power9}):
+2018-04-02 Peter Bergner <bergner@vnet.ibm.com>
+
+ Backport from mainline
+ 2018-03-28 Peter Bergner <bergner@vnet.ibm.com>
+
+ PR target/84912
+ * gcc.target/powerpc/extend-divide-1.c (div_weo): Remove test for
+ deleted builtin function.
+ (div_weuo): Likewise.
+ * gcc.target/powerpc/extend-divide-2.c (div_deo): Likewise.
+ (div_deuo): Likewise.
+
2018-03-30 Cesar Philippidis <cesar@codesourcery.com>
Backport from mainline
/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power7" } } */
/* { dg-options "-mcpu=power7 -O2" } */
/* { dg-final { scan-assembler-times "divwe " 1 } } */
-/* { dg-final { scan-assembler-times "divweo " 1 } } */
/* { dg-final { scan-assembler-times "divweu " 1 } } */
-/* { dg-final { scan-assembler-times "divweuo " 1 } } */
/* { dg-final { scan-assembler-not "bl __builtin" } } */
int
return __builtin_divwe (a, b);
}
-int
-div_weo (int a, int b)
-{
- return __builtin_divweo (a, b);
-}
-
unsigned int
div_weu (unsigned int a, unsigned int b)
{
return __builtin_divweu (a, b);
}
-
-unsigned int
-div_weuo (unsigned int a, unsigned int b)
-{
- return __builtin_divweuo (a, b);
-}
/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power7" } } */
/* { dg-options "-mcpu=power7 -O2" } */
/* { dg-final { scan-assembler-times "divde " 1 } } */
-/* { dg-final { scan-assembler-times "divdeo " 1 } } */
/* { dg-final { scan-assembler-times "divdeu " 1 } } */
-/* { dg-final { scan-assembler-times "divdeuo " 1 } } */
/* { dg-final { scan-assembler-not "bl __builtin" } } */
long
return __builtin_divde (a, b);
}
-long
-div_deo (long a, long b)
-{
- return __builtin_divdeo (a, b);
-}
-
unsigned long
div_deu (unsigned long a, unsigned long b)
{
return __builtin_divdeu (a, b);
}
-
-unsigned long
-div_deuo (unsigned long a, unsigned long b)
-{
- return __builtin_divdeuo (a, b);
-}