Commit f93bc5b3 by Peter Bergner Committed by Peter Bergner

rs6000.h (RS6000_BTM_HARD_FLOAT): New define.

gcc/
	* config/rs6000/rs6000.h (RS6000_BTM_HARD_FLOAT): New define.
	(RS6000_BTM_COMMON): Add RS6000_BTM_HARD_FLOAT.
	(TARGET_EXTRA_BUILTINS): Add TARGET_HARD_FLOAT.
	* config/rs6000/rs6000-builtin.def (BU_MISC_1):
	Use RS6000_BTM_HARD_FLOAT.
	(BU_MISC_2): Likewise.
	* config/rs6000/rs6000.c (rs6000_builtin_mask_calculate): Handle
	RS6000_BTM_HARD_FLOAT.
	(rs6000_option_override_internal): Enforce -mhard-float if -mhard-dfp
	is explicitly used.
	(rs6000_invalid_builtin): Add hard floating builtin support.
	(rs6000_expand_builtin): Relax the gcc_assert to allow the new
	hard float builtins.
	(rs6000_builtin_mask_names): Add RS6000_BTM_HARD_FLOAT.

gcc/testsuite/
	* gcc.target/powerpc/pack02.c (dg-options): Add -mhard-float.
	(dg-require-effective-target): Change target to powerpc_fprs.
	* gcc.target/powerpc/pack03.c (dg-options): Add -mhard-dfp.
	(dg-require-effective-target): Change target to dfprt.

From-SVN: r210054
parent b8918402
2014-05-04 Peter Bergner <bergner@vnet.ibm.com>
* config/rs6000/rs6000.h (RS6000_BTM_HARD_FLOAT): New define.
(RS6000_BTM_COMMON): Add RS6000_BTM_HARD_FLOAT.
(TARGET_EXTRA_BUILTINS): Add TARGET_HARD_FLOAT.
* config/rs6000/rs6000-builtin.def (BU_MISC_1):
Use RS6000_BTM_HARD_FLOAT.
(BU_MISC_2): Likewise.
* config/rs6000/rs6000.c (rs6000_builtin_mask_calculate): Handle
RS6000_BTM_HARD_FLOAT.
(rs6000_option_override_internal): Enforce -mhard-float if -mhard-dfp
is explicitly used.
(rs6000_invalid_builtin): Add hard floating builtin support.
(rs6000_expand_builtin): Relax the gcc_assert to allow the new
hard float builtins.
(rs6000_builtin_mask_names): Add RS6000_BTM_HARD_FLOAT.
2014-05-03 Oleg Endo <olegendo@gcc.gnu.org>
* config/sh/sh_optimize_sett_clrt.cc (sh_optimize_sett_clrt::execute):
......
......@@ -626,7 +626,7 @@
#define BU_MISC_1(ENUM, NAME, ATTR, ICODE) \
RS6000_BUILTIN_2 (MISC_BUILTIN_ ## ENUM, /* ENUM */ \
"__builtin_" NAME, /* NAME */ \
RS6000_BTM_ALWAYS, /* MASK */ \
RS6000_BTM_HARD_FLOAT, /* MASK */ \
(RS6000_BTC_ ## ATTR /* ATTR */ \
| RS6000_BTC_UNARY), \
CODE_FOR_ ## ICODE) /* ICODE */
......@@ -634,7 +634,7 @@
#define BU_MISC_2(ENUM, NAME, ATTR, ICODE) \
RS6000_BUILTIN_2 (MISC_BUILTIN_ ## ENUM, /* ENUM */ \
"__builtin_" NAME, /* NAME */ \
RS6000_BTM_ALWAYS, /* MASK */ \
RS6000_BTM_HARD_FLOAT, /* MASK */ \
(RS6000_BTC_ ## ATTR /* ATTR */ \
| RS6000_BTC_BINARY), \
CODE_FOR_ ## ICODE) /* ICODE */
......
......@@ -3039,7 +3039,8 @@ rs6000_builtin_mask_calculate (void)
| ((TARGET_P8_VECTOR) ? RS6000_BTM_P8_VECTOR : 0)
| ((TARGET_CRYPTO) ? RS6000_BTM_CRYPTO : 0)
| ((TARGET_HTM) ? RS6000_BTM_HTM : 0)
| ((TARGET_DFP) ? RS6000_BTM_DFP : 0));
| ((TARGET_DFP) ? RS6000_BTM_DFP : 0)
| ((TARGET_HARD_FLOAT) ? RS6000_BTM_HARD_FLOAT : 0));
}
/* Override command line options. Mostly we process the processor type and
......@@ -3396,6 +3397,13 @@ rs6000_option_override_internal (bool global_init_p)
rs6000_isa_flags &= ~OPTION_MASK_VSX_TIMODE;
}
if (TARGET_DFP && !TARGET_HARD_FLOAT)
{
if (rs6000_isa_flags_explicit & OPTION_MASK_DFP)
error ("-mhard-dfp requires -mhard-float");
rs6000_isa_flags &= ~OPTION_MASK_DFP;
}
/* The quad memory instructions only works in 64-bit mode. In 32-bit mode,
silently turn off quad memory mode. */
if ((TARGET_QUAD_MEMORY || TARGET_QUAD_MEMORY_ATOMIC) && !TARGET_POWERPC64)
......@@ -13559,6 +13567,8 @@ rs6000_invalid_builtin (enum rs6000_builtins fncode)
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) != 0)
error ("Builtin function %s requires the -mhard-float option", name);
else
error ("Builtin function %s is not supported with the current options",
name);
......@@ -13747,7 +13757,10 @@ rs6000_expand_builtin (tree exp, rtx target, rtx subtarget ATTRIBUTE_UNUSED,
return ret;
}
gcc_assert (TARGET_ALTIVEC || TARGET_VSX || TARGET_SPE || TARGET_PAIRED_FLOAT);
unsigned attr = rs6000_builtin_info[uns_fcode].attr & RS6000_BTC_TYPE_MASK;
gcc_assert (attr == RS6000_BTC_UNARY
|| attr == RS6000_BTC_BINARY
|| attr == RS6000_BTC_TERNARY);
/* Handle simple unary operations. */
d = bdesc_1arg;
......@@ -31302,6 +31315,7 @@ static struct rs6000_opt_mask const rs6000_builtin_mask_names[] =
{ "crypto", RS6000_BTM_CRYPTO, false, false },
{ "htm", RS6000_BTM_HTM, false, false },
{ "hard-dfp", RS6000_BTM_DFP, false, false },
{ "hard-float", RS6000_BTM_HARD_FLOAT, false, false },
};
/* Option variables that we want to support inside attribute((target)) and
......
......@@ -624,7 +624,8 @@ extern int rs6000_vector_align[];
|| TARGET_CMPB /* ISA 2.05 */ \
|| TARGET_POPCNTD /* ISA 2.06 */ \
|| TARGET_ALTIVEC \
|| TARGET_VSX)))
|| TARGET_VSX \
|| TARGET_HARD_FLOAT)))
/* E500 cores only support plain "sync", not lwsync. */
#define TARGET_NO_LWSYNC (rs6000_cpu == PROCESSOR_PPC8540 \
......@@ -2517,6 +2518,7 @@ extern int frame_pointer_needed;
#define RS6000_BTM_POPCNTD MASK_POPCNTD /* Target supports ISA 2.06. */
#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_COMMON (RS6000_BTM_ALTIVEC \
| RS6000_BTM_VSX \
......@@ -2529,7 +2531,8 @@ extern int frame_pointer_needed;
| RS6000_BTM_HTM \
| RS6000_BTM_POPCNTD \
| RS6000_BTM_CELL \
| RS6000_BTM_DFP)
| RS6000_BTM_DFP \
| RS6000_BTM_HARD_FLOAT)
/* Define builtin enum index. */
......
2014-05-04 Peter Bergner <bergner@vnet.ibm.com>
* gcc.target/powerpc/pack02.c (dg-options): Add -mhard-float.
(dg-require-effective-target): Change target to powerpc_fprs.
* gcc.target/powerpc/pack03.c (dg-options): Add -mhard-dfp.
(dg-require-effective-target): Change target to dfprt.
2014-05-03 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/58582
......
/* { dg-do run { target { powerpc*-*-linux* } } } */
/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
/* { dg-skip-if "" { powerpc*-*-*spe* } { "*" } { "" } } */
/* { dg-require-effective-target vsx_hw } */
/* { dg-options "-O2" } */
/* { dg-require-effective-target powerpc_fprs } */
/* { dg-options "-O2 -mhard-float" } */
#include <stddef.h>
#include <stdlib.h>
......
/* { dg-do run { target { powerpc*-*-linux* } } } */
/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
/* { dg-skip-if "" { powerpc*-*-*spe* } { "*" } { "" } } */
/* { dg-require-effective-target vsx_hw } */
/* { dg-options "-O2" } */
/* { dg-require-effective-target dfprt } */
/* { dg-options "-O2 -mhard-dfp" } */
#include <stddef.h>
#include <stdlib.h>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment