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.
This requires glibc version 2.38 or higher to compile and run.
a. The supported attributes for target_clones and target_version are as
follows:
strict-align,arch={loongarch64/la64v1.0/la64v1.1},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.
Get the support status of LSX and LASX through HWCAP. Get the support
status of other features through CPUCFG.
d. Add test cases.
e. Add description to document.
---
v1 -> v2:
Modify patch 0008 to obtain LSX and LASX support through HWCAP.
v2 -> v3:
Modify patch 0002, generate information about evolution features
by parsing genopts/isa-evolution.in and output it to
loongarch-evol-attr.def. Reference loongarch-evol-attr.def
in loongarch_attributes.
Lulu Cheng (13):
LoongArch: Fix ICE for illegal strings in the target attribute.
LoongArch: Support la64v1.1 evolution features in the target pragma
and 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 ++
.../loongarch/genopts/gen-evolution.awk | 37 +-
gcc/config/loongarch/genopts/genstr.sh | 3 +
gcc/config/loongarch/loongarch-evol-attr.def | 32 +
gcc/config/loongarch/loongarch-protos.h | 7 +
gcc/config/loongarch/loongarch-target-attr.cc | 400 ++++++++++-
gcc/config/loongarch/loongarch.cc | 650 ++++++++++++++++++
gcc/config/loongarch/loongarch.h | 2 +
gcc/config/loongarch/t-loongarch | 3 +
gcc/doc/extend.texi | 207 +++++-
.../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-2.c | 68 ++
.../gcc.target/loongarch/pragma-la64V1_1.c | 87 +++
libgcc/config/loongarch/cpuinfo.c | 90 +++
libgcc/config/loongarch/t-loongarch64 | 2 +
35 files changed, 2150 insertions(+), 40 deletions(-)
create mode 100644 gcc/common/config/loongarch/cpu-features.h
create mode 100644 gcc/config/loongarch/loongarch-evol-attr.def
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-2.c
create mode 100644 gcc/testsuite/gcc.target/loongarch/pragma-la64V1_1.c
create mode 100644 libgcc/config/loongarch/cpuinfo.c
--
2.34.1