diff options
author | Matthew Fortune <matthew.fortune@imgtec.com> | 2017-01-20 01:05:25 +0000 |
---|---|---|
committer | Catherine Moore <clm@gcc.gnu.org> | 2017-01-19 20:05:25 -0500 |
commit | d821744c630acda55c7a5ff59e6cfd184132be74 (patch) | |
tree | 734146850a4cf5d319974acd8dbbc768bdf7d714 /gcc/config/mips/mips.h | |
parent | 5b4ca3060a9cd95cb837542049e37400dad22b3b (diff) | |
download | gcc-d821744c630acda55c7a5ff59e6cfd184132be74.zip gcc-d821744c630acda55c7a5ff59e6cfd184132be74.tar.gz gcc-d821744c630acda55c7a5ff59e6cfd184132be74.tar.bz2 |
config.gcc (supported_defaults): Add madd4.
gcc/
2017-01-19 Matthew Fortune <matthew.fortune@imgtec.com>
Yunqiang Su <yunqiang.su@imgtec.com>
* config.gcc (supported_defaults): Add madd4.
(with_madd4): Add validation.
(all_defaults): Add madd4.
* config/mips/mips.opt (mmadd4): New option.
* gcc/config/mips/mips.h (OPTION_DEFAULT_SPECS): Add a default for
mmadd4.
(TARGET_CPU_CPP_BUILTINS): Add builtin_define for
__mips_no_madd4.
(ISA_HAS_UNFUSED_MADD4): Gate with mips_madd4.
(ISA_HAS_FUSED_MADD4): Likewise.
* gcc/doc/invoke.texi (-mmadd4): Document the new option.
* gcc/doc/install.texi (--with-madd4): Document the new option.
gcc/testsuite/
2017-01-19 Matthew Fortune <matthew.fortune@imgtec.com>
* gcc.target/mips/madd4-1.c: New file.
* gcc.target/mips/madd4-2.c: Likewise.
* gcc.target/mips/mips.exp (mips_option_groups): Add ghost option
HAS_MADD4.
(mips_option_groups): Add -m[no-]madd4.
(mips-dg-init): Detect default -mno-madd4.
(mips-dg-options): Handle HAS_MADD4 arch upgrade/downgrade.
* gcc.target/mips/mips-ps-type.c: Add -mmadd4 test option.
* gcc.target/mips/mips-ps-type-2.c: Likewise.
* gcc.target/mips/nmadd-1.c: Likewise.
* gcc.target/mips/nmadd-2.c: Likewise.
* gcc.target/mips/nmadd-3.c: Likewise.
Co-Authored-By: Yunqiang Su <yunqiang.su@imgtec.com>
From-SVN: r244676
Diffstat (limited to 'gcc/config/mips/mips.h')
-rw-r--r-- | gcc/config/mips/mips.h | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/gcc/config/mips/mips.h b/gcc/config/mips/mips.h index 81032c9..23e1672 100644 --- a/gcc/config/mips/mips.h +++ b/gcc/config/mips/mips.h @@ -639,6 +639,8 @@ struct mips_cpu_info { builtin_define ("__GCC_HAVE_BUILTIN_MIPS_CACHE"); \ if (!ISA_HAS_LXC1_SXC1) \ builtin_define ("__mips_no_lxc1_sxc1"); \ + if (!ISA_HAS_UNFUSED_MADD4 && !ISA_HAS_FUSED_MADD4) \ + builtin_define ("__mips_no_madd4"); \ } \ while (0) @@ -869,7 +871,8 @@ struct mips_cpu_info { {"llsc", "%{!mllsc:%{!mno-llsc:-m%(VALUE)}}" }, \ {"mips-plt", "%{!mplt:%{!mno-plt:-m%(VALUE)}}" }, \ {"synci", "%{!msynci:%{!mno-synci:-m%(VALUE)}}" }, \ - {"lxc1-sxc1", "%{!mlxc1-sxc1:%{!mno-lxc1-sxc1:-m%(VALUE)}}" } \ + {"lxc1-sxc1", "%{!mlxc1-sxc1:%{!mno-lxc1-sxc1:-m%(VALUE)}}" }, \ + {"madd4", "%{!mmadd4:%{!mno-madd4:-m%(VALUE)}}" } \ /* A spec that infers the: -mnan=2008 setting from a -mips argument, @@ -1066,11 +1069,14 @@ struct mips_cpu_info { /* ISA has 4 operand fused madd instructions of the form 'd = [+-] (a * b [+-] c)'. */ -#define ISA_HAS_FUSED_MADD4 (TARGET_MIPS8000 || TARGET_LOONGSON_3A) +#define ISA_HAS_FUSED_MADD4 (mips_madd4 \ + && (TARGET_MIPS8000 \ + || TARGET_LOONGSON_3A)) /* ISA has 4 operand unfused madd instructions of the form 'd = [+-] (a * b [+-] c)'. */ -#define ISA_HAS_UNFUSED_MADD4 (ISA_HAS_FP4 \ +#define ISA_HAS_UNFUSED_MADD4 (mips_madd4 \ + && ISA_HAS_FP4 \ && !TARGET_MIPS8000 \ && !TARGET_LOONGSON_3A) |