Add support for Loongson EXT2 instructions

Programming / Compilers / GCC - paulhua [138bc75d-0d04-0410-961f-82ee72b054a4] - 7 November 2018 08:42 EST

gcc/
- config/mips/mips-protos.h (mips_loongson_ext2_prefetch_cookie): New prototype.
- config/mips/mips.c (mips_loongson_ext2_prefetch_cookie): New. (mips_option_override): Enable TARGET_LOONGSON_EXT when TARGET_LOONGSON_EXT2 is true.
- config/mips/mips.h (TARGET_CPU_CPP_BUILTINS): Define __mips_loongson_ext2, __mips_loongson_ext_rev=2. (ISA_HAS_CTZ_CTO): New, true if TARGET_LOONGSON_EXT2. (ISA_HAS_PREFETCH): Include TARGET_LOONGSON_EXT and TARGET_LOONGSON_EXT2. (ASM_SPEC): Add mloongson-ext2 and mno-loongson-ext2. (define_insn "ctz2"): New insn pattern. (define_insn "prefetch"): Include TARGET_LOONGSON_EXT2. (define_insn "prefetch_indexed_"): Include TARGET_LOONGSON_EXT and TARGET_LOONGSON_EXT2.
- config/mips/mips.opt (-mloongson-ext2): Add option.
- gcc/doc/invoke.texi (-mloongson-ext2): Document.

gcc/testsuite/
- gcc.target/mips/loongson-ctz.c: New test.
- gcc.target/mips/loongson-dctz.c: Likewise.
- gcc.target/mips/mips.exp (mips_option_groups): Add
-mloongson-ext2 option.

14ae3f09b9b Add support for Loongson EXT2 instructions.
gcc/ChangeLog | 20 ++++++++++++
gcc/config/mips/mips-protos.h | 1 +
gcc/config/mips/mips.c | 28 ++++++++++++++++
gcc/config/mips/mips.h | 15 ++++++++-
gcc/config/mips/mips.md | 47 ++++++++++++++++++++++++---
gcc/config/mips/mips.opt | 4 +++
gcc/doc/invoke.texi | 7 ++++
gcc/testsuite/ChangeLog | 7 ++++
gcc/testsuite/gcc.target/mips/loongson-ctz.c | 11 +++++++
gcc/testsuite/gcc.target/mips/loongson-dctz.c | 11 +++++++
gcc/testsuite/gcc.target/mips/mips.exp | 1 +
11 files changed, 147 insertions(+), 5 deletions(-)

Upstream: gcc.gnu.org


  • Share