aboutsummaryrefslogtreecommitdiff
path: root/gcc/config.gcc
diff options
context:
space:
mode:
authorLulu Cheng <chenglulu@loongson.cn>2025-01-07 12:00:12 +0800
committerLulu Cheng <chenglulu@loongson.cn>2025-01-21 17:36:41 +0800
commit4d2a1c292611514dfa5de4cbdb8a426eb437c964 (patch)
tree45e6c7efbd5055920da87126c6aaee5923faefeb /gcc/config.gcc
parentc01ad91886527f685e67037ab4d36a6b0cd07c08 (diff)
downloadgcc-4d2a1c292611514dfa5de4cbdb8a426eb437c964.zip
gcc-4d2a1c292611514dfa5de4cbdb8a426eb437c964.tar.gz
gcc-4d2a1c292611514dfa5de4cbdb8a426eb437c964.tar.bz2
LoongArch: Implement target pragma.
The target pragmas defined correspond to the target function attributes. This implementation is derived from AArch64. gcc/ChangeLog: * config/loongarch/loongarch-protos.h (loongarch_reset_previous_fndecl): Add function declaration. (loongarch_save_restore_target_globals): Likewise. (loongarch_register_pragmas): Likewise. * config/loongarch/loongarch-target-attr.cc (loongarch_option_valid_attribute_p): Optimize the processing of attributes. (loongarch_pragma_target_parse): New functions. (loongarch_register_pragmas): Likewise. * config/loongarch/loongarch.cc (loongarch_reset_previous_fndecl): New functions. (loongarch_set_current_function): When the old_tree is the same as the new_tree, the rules for using registers, etc., are set according to the option values to ensure that the pragma can be processed correctly. * config/loongarch/loongarch.h (REGISTER_TARGET_PRAGMAS): Define macro. * doc/extend.texi: Supplemental Documentation. gcc/testsuite/ChangeLog: * gcc.target/loongarch/arch-func-attr-1.c: Add '#pragma'. * gcc.target/loongarch/cmodel-func-attr-1.c: Likewise. * gcc.target/loongarch/lasx-func-attr-1.c: Likewise. * gcc.target/loongarch/lsx-func-attr-1.c: Likewise. * gcc.target/loongarch/strict_align-func-attr-1.c: Likewise. * gcc.target/loongarch/strict_align-func-attr-2.c: Likewise. * gcc.target/loongarch/vector-func-attr-1.c: Likewise. * gcc.target/loongarch/arch-pragma-attr-1.c: Likewise. * gcc.target/loongarch/cmodel-pragma-attr-1.c: New test. * gcc.target/loongarch/lasx-pragma-attr-1.c: New test. * gcc.target/loongarch/lasx-pragma-attr-2.c: New test. * gcc.target/loongarch/lsx-pragma-attr-1.c: New test. * gcc.target/loongarch/lsx-pragma-attr-2.c: New test. * gcc.target/loongarch/strict_align-pragma-attr-1.c: New test. * gcc.target/loongarch/strict_align-pragma-attr-2.c: New test. * gcc.target/loongarch/vector-pragma-attr-1.c: New test. * gcc.target/loongarch/pragma-push-pop.c: New test.
Diffstat (limited to 'gcc/config.gcc')
0 files changed, 0 insertions, 0 deletions