1. Fixed ICE issue caused by passing invalid string to attribute target,
for example: "__attribute__ ((target ("arch")))"
2. Add the option of extended instructions of la64v1.1 to the attribute
support list.
3. Add FMV support for LoongArch.
a. The supported attributes for target_clones and target_version are as
follows:
strict-align,arch=,lsx,lasx,frecipe,div32,lam-bh,
lamcas,scq,ld-seq-sa
Note that the option values on the gcc command line are not considered when
calculating the priority.
b. The priority of the attributes is as follows, from lowest to highest:
arch=loongarch64
strict-align
frecipe=div32=lam-bh=lamcas=scq=ld-seq-sa
lsx
arch=la64v1.0
arch=la64v1.1
lasx
The priority setting order is:
256-bit vector > 128-bit vector > other
c. Operation is determined by the hardware environment.
Since glibc does not pass hwcap to the resolver function, and the flag
bits in the asm/hwcap.h header file in the Linux kernel are not fully
defined, to ensure compatibility, the hardware characteristics are
read through cpucfg at runtime for comparison.
d. Add test cases.
e. Add description to document.
Lulu Cheng (13):
LoongArch: Fix ICE for illegal strings in the target attribute.
LoongArch: Add options for LA64v1.1 extended instructions to target
attribute.
LoongArch: Implement TARGET_OPTION_VALID_VERSION_ATTRIBUTE_P.
LoongArch: Implement TARGET_GET_FUNCTION_VERSIONS_DISPATCHER.
LoongArch: Implement TARGET_MANGLE_DECL_ASSEMBLER_NAME.
LoongArch: Implement TARGET_GENERATE_VERSION_DISPATCHER_BODY.
LoongArch: Implement TARGET_COMPARE_VERSION_PRIORITY.
LoongArch: Implement __init_loongarch_features_resolver.
LoongArch: Add support for setting priority in fmv.
LoongArch: Implement TARGET_OPTION_SAME_FUNCTION_VERSIONS.
LoongArch: Do not inline when callee is versioned but caller is not.
LoongArch: Add testsuites for FMV.
LoongArch: doc: Add description of function attrubute.
gcc/common/config/loongarch/cpu-features.h | 41 ++
gcc/config/loongarch/loongarch-protos.h | 7 +
gcc/config/loongarch/loongarch-target-attr.cc | 380 +++++++++-
gcc/config/loongarch/loongarch.cc | 650 ++++++++++++++++++
gcc/config/loongarch/loongarch.h | 2 +
gcc/doc/extend.texi | 204 +++++-
.../g++.target/loongarch/mv-symbols1.C | 62 ++
.../g++.target/loongarch/mv-symbols2.C | 53 ++
.../g++.target/loongarch/mv-symbols3.C | 42 ++
.../g++.target/loongarch/mv-symbols4.C | 48 ++
.../g++.target/loongarch/mv-symbols5.C | 55 ++
.../g++.target/loongarch/mv-symbols6.C | 63 ++
.../g++.target/loongarch/mvc-symbols1.C | 42 ++
.../g++.target/loongarch/mvc-symbols2.C | 30 +
.../g++.target/loongarch/mvc-symbols3.C | 36 +
.../g++.target/loongarch/mvc-symbols4.C | 26 +
.../g++.target/loongarch/mvc-symbols5.C | 42 ++
.../loongarch/attr-check-error-message.c | 8 +
.../loongarch/attr-check-error-message1.c | 6 +
.../loongarch/attr-check-error-message2.c | 6 +
.../loongarch/attr-check-error-message3.c | 6 +
.../loongarch/attr-check-error-message4.c | 6 +
.../loongarch/attr-check-error-message5.c | 6 +
.../loongarch/attr-check-error-message6.c | 6 +
.../loongarch/attr-check-error-message7.c | 6 +
.../loongarch/attr-check-error-message8.c | 6 +
.../loongarch/attr-check-error-message9.c | 6 +
.../gcc.target/loongarch/pragma-la64V1_1.c | 87 +++
libgcc/config/loongarch/cpuinfo.c | 77 +++
libgcc/config/loongarch/t-loongarch64 | 2 +
30 files changed, 1992 insertions(+), 19 deletions(-)
create mode 100644 gcc/common/config/loongarch/cpu-features.h
create mode 100644 gcc/testsuite/g++.target/loongarch/mv-symbols1.C
create mode 100644 gcc/testsuite/g++.target/loongarch/mv-symbols2.C
create mode 100644 gcc/testsuite/g++.target/loongarch/mv-symbols3.C
create mode 100644 gcc/testsuite/g++.target/loongarch/mv-symbols4.C
create mode 100644 gcc/testsuite/g++.target/loongarch/mv-symbols5.C
create mode 100644 gcc/testsuite/g++.target/loongarch/mv-symbols6.C
create mode 100644 gcc/testsuite/g++.target/loongarch/mvc-symbols1.C
create mode 100644 gcc/testsuite/g++.target/loongarch/mvc-symbols2.C
create mode 100644 gcc/testsuite/g++.target/loongarch/mvc-symbols3.C
create mode 100644 gcc/testsuite/g++.target/loongarch/mvc-symbols4.C
create mode 100644 gcc/testsuite/g++.target/loongarch/mvc-symbols5.C
create mode 100644
gcc/testsuite/gcc.target/loongarch/attr-check-error-message1.c
create mode 100644
gcc/testsuite/gcc.target/loongarch/attr-check-error-message2.c
create mode 100644
gcc/testsuite/gcc.target/loongarch/attr-check-error-message3.c
create mode 100644
gcc/testsuite/gcc.target/loongarch/attr-check-error-message4.c
create mode 100644
gcc/testsuite/gcc.target/loongarch/attr-check-error-message5.c
create mode 100644
gcc/testsuite/gcc.target/loongarch/attr-check-error-message6.c
create mode 100644
gcc/testsuite/gcc.target/loongarch/attr-check-error-message7.c
create mode 100644
gcc/testsuite/gcc.target/loongarch/attr-check-error-message8.c
create mode 100644
gcc/testsuite/gcc.target/loongarch/attr-check-error-message9.c
create mode 100644 gcc/testsuite/gcc.target/loongarch/pragma-la64V1_1.c
create mode 100644 libgcc/config/loongarch/cpuinfo.c
--
2.34.1