diff options
author | Chenghua Xu <paul.hua.gm@gmail.com> | 2018-11-07 08:25:17 +0000 |
---|---|---|
committer | Chenghua Xu <paulhua@gcc.gnu.org> | 2018-11-07 08:25:17 +0000 |
commit | 8ae8bad7e558ce916c52e91a4e1879557f287bbc (patch) | |
tree | 523ee57f754d7e641cf932c9910c5346b6481a1d /gcc/config/mips/mips.h | |
parent | 50258c4dcb13c1f3342e153d409416987e4ca100 (diff) | |
download | gcc-8ae8bad7e558ce916c52e91a4e1879557f287bbc.zip gcc-8ae8bad7e558ce916c52e91a4e1879557f287bbc.tar.gz gcc-8ae8bad7e558ce916c52e91a4e1879557f287bbc.tar.bz2 |
Add support for Loongson MMI instructions.
gcc/
* config.gcc (extra_headers): Add loongson-mmiintrin.h.
* config/mips/loongson.md: Move to ...
* config/mips/loongson-mmi.md: here; Adjustment.
* config/mips/loongson.h: Move to ...
State as deprecated. Include loongson-mmiintrin.h for back
compatibility and warning.
* config/mips/loongson-mmiintrin.h: ... here.
* config/mips/mips.c (mips_hard_regno_mode_ok_uncached,
mips_vector_mode_supported_p, AVAIL_NON_MIPS16): Use
TARGET_LOONGSON_MMI instead of TARGET_LOONGSON_VECTORS.
(mips_option_override): Make sure MMI use hard float;
(mips_shift_truncation_mask, mips_expand_vpc_loongson_even_odd,
mips_expand_vpc_loongson_pshufh, mips_expand_vpc_loongson_bcast,
mips_expand_vector_init): Use TARGET_LOONGSON_MMI instead of
TARGET_LOONGSON_VECTORS.
* gcc/config/mips/mips.h (TARGET_LOONGSON_VECTORS): Delete.
(TARGET_CPU_CPP_BUILTINS): Add __mips_loongson_mmi.
(MIPS_ASE_DSP_SPEC, MIPS_ASE_LOONGSON_MMI_SPEC): New.
(BASE_DRIVER_SELF_SPECS): march=loongson2e/2f/3a implies
-mloongson-mmi.
(SHIFT_COUNT_TRUNCATED): Use TARGET_LOONGSON_MMI instead of
TARGET_LOONGSON_VECTORS.
* gcc/config/mips/mips.md (MOVE64, MOVE128): Use
TARGET_LOONGSON_MMI instead of TARGET_LOONGSON_VECTORS.
(Loongson MMI patterns): Include loongson-mmi.md instead of
loongson.md.
* gcc/config/mips/mips.opt (-mloongson-mmi): New option.
* gcc/doc/invoke.texi (-mloongson-mmi): Document.
gcc/testsuite/
* gcc.target/mips/loongson-shift-count-truncated-1.c
(dg-options): Run under -mloongson-mmi option.
Include loongson-mmiintrin.h instead of loongson.h.
* gcc.target/mips/loongson-simd.c: Likewise.
* gcc.target/mips/mips.exp (mips_option_groups): Add
-mloongson-mmi option.
(mips-dg-options): Add mips_option_dependency options "-mips16" vs
"-mno-loongson-mmi", "-mmicromips" vs "-mno-loongson-mmi",
"-msoft-float" vs "-mno-loongson-mmi".
(mips-dg-init): Add -mloongson-mmi option.
* lib/target-supports.exp: Rename check_mips_loongson_hw_available
to check_mips_loongson_mmi_hw_available.
Rename check_effective_target_mips_loongson_runtime to
check_effective_target_mips_loongson_mmi_runtime.
(check_effective_target_vect_int): Use mips_loongson_mmi instead
of mips_loongson when check et-is-effective-target.
(add_options_for_mips_loongson_mmi): New proc.
Rename check_effective_target_mips_loongson to
check_effective_target_mips_loongson_mmi.
(check_effective_target_vect_shift,
check_effective_target_whole_vector_shift,
check_effective_target_vect_no_int_min_max,
check_effective_target_vect_no_align,
check_effective_target_vect_short_mult,
check_vect_support_and_set_flags):Use mips_loongson_mmi instead
of mips_loongson when check et-is-effective-target.
From-SVN: r265862
Diffstat (limited to 'gcc/config/mips/mips.h')
-rw-r--r-- | gcc/config/mips/mips.h | 36 |
1 files changed, 21 insertions, 15 deletions
diff --git a/gcc/config/mips/mips.h b/gcc/config/mips/mips.h index 32a88ed..27c0222 100644 --- a/gcc/config/mips/mips.h +++ b/gcc/config/mips/mips.h @@ -319,13 +319,6 @@ struct mips_cpu_info { #define TUNE_I6400 (mips_tune == PROCESSOR_I6400) #define TUNE_P6600 (mips_tune == PROCESSOR_P6600) -/* Whether vector modes and intrinsics for ST Microelectronics - Loongson-2E/2F processors should be enabled. In o32 pairs of - floating-point registers provide 64-bit values. */ -#define TARGET_LOONGSON_VECTORS (TARGET_HARD_FLOAT_ABI \ - && (TARGET_LOONGSON_2EF \ - || TARGET_LOONGSON_3A)) - /* True if the pre-reload scheduler should try to create chains of multiply-add or multiply-subtract instructions. For example, suppose we have: @@ -596,9 +589,12 @@ struct mips_cpu_info { if (TARGET_ABICALLS) \ builtin_define ("__mips_abicalls"); \ \ - /* Whether Loongson vector modes are enabled. */ \ - if (TARGET_LOONGSON_VECTORS) \ - builtin_define ("__mips_loongson_vector_rev"); \ + /* Whether Loongson vector modes are enabled. */ \ + if (TARGET_LOONGSON_MMI) \ + { \ + builtin_define ("__mips_loongson_vector_rev"); \ + builtin_define ("__mips_loongson_mmi"); \ + } \ \ /* Historical Octeon macro. */ \ if (TARGET_OCTEON) \ @@ -880,14 +876,23 @@ struct mips_cpu_info { /* A spec that infers the: -mnan=2008 setting from a -mips argument, - -mdsp setting from a -march argument. */ -#define BASE_DRIVER_SELF_SPECS \ - MIPS_ISA_NAN2008_SPEC, \ + -mdsp setting from a -march argument. + -mloongson-mmi setting from a -march argument. */ +#define BASE_DRIVER_SELF_SPECS \ + MIPS_ISA_NAN2008_SPEC, \ + MIPS_ASE_DSP_SPEC, \ + MIPS_ASE_LOONGSON_MMI_SPEC + +#define MIPS_ASE_DSP_SPEC \ "%{!mno-dsp: \ %{march=24ke*|march=34kc*|march=34kf*|march=34kx*|march=1004k* \ |march=interaptiv: -mdsp} \ %{march=74k*|march=m14ke*: %{!mno-dspr2: -mdspr2 -mdsp}}}" +#define MIPS_ASE_LOONGSON_MMI_SPEC \ + "%{!mno-loongson-mmi: \ + %{march=loongson2e|march=loongson2f|march=loongson3a: -mloongson-mmi}}" + #define DRIVER_SELF_SPECS \ MIPS_ISA_LEVEL_SPEC, \ BASE_DRIVER_SELF_SPECS @@ -1361,6 +1366,7 @@ struct mips_cpu_info { %{mcrc} %{mno-crc} \ %{mginv} %{mno-ginv} \ %{mmsa} %{mno-msa} \ +%{mloongson-mmi} %{mno-loongson-mmi} \ %{msmartmips} %{mno-smartmips} \ %{mmt} %{mno-mt} \ %{mfix-rm7000} %{mno-fix-rm7000} \ @@ -2638,9 +2644,9 @@ typedef struct mips_args { #define SLOW_BYTE_ACCESS (!TARGET_MIPS16) /* Standard MIPS integer shifts truncate the shift amount to the - width of the shifted operand. However, Loongson vector shifts + width of the shifted operand. However, Loongson MMI shifts do not truncate the shift amount at all. */ -#define SHIFT_COUNT_TRUNCATED (!TARGET_LOONGSON_VECTORS) +#define SHIFT_COUNT_TRUNCATED (!TARGET_LOONGSON_MMI) /* Specify the machine mode that pointers have. |