aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/loongarch/loongarch.h
diff options
context:
space:
mode:
authorLulu Cheng <chenglulu@loongson.cn>2022-07-21 10:32:51 +0800
committerLulu Cheng <chenglulu@loongson.cn>2022-07-26 14:30:14 +0800
commitd5e401fb1452d6a9504e23d76d072a89fd2ba379 (patch)
tree38a5898f2a934a5e4f814e4b3e2af3b607bbaa4a /gcc/config/loongarch/loongarch.h
parentf4286601933406142b46693660f7f4b682cb50a5 (diff)
downloadgcc-d5e401fb1452d6a9504e23d76d072a89fd2ba379.zip
gcc-d5e401fb1452d6a9504e23d76d072a89fd2ba379.tar.gz
gcc-d5e401fb1452d6a9504e23d76d072a89fd2ba379.tar.bz2
LoongArch: Subdivision symbol type, add SYMBOL_PCREL support.
1. Remove cModel type support other than normal. 2. The method for calling global functions changed from 'la.global + jirl' to 'bl' when complied add '-fplt'. gcc/ChangeLog: * config/loongarch/constraints.md (a): Delete the constraint. (b): A constant call not local address. (h): Delete the constraint. (t): Delete the constraint. * config/loongarch/loongarch-opts.cc (loongarch_config_target): Remove cModel type support other than normal. * config/loongarch/loongarch-protos.h (enum loongarch_symbol_type): Add new symbol type 'SYMBOL_PCREL', 'SYMBOL_TLS_IE' and 'SYMBOL_TLS_LE'. (loongarch_split_symbol): Delete useless function declarations. (loongarch_split_symbol_type): Delete useless function declarations. * config/loongarch/loongarch.cc (enum loongarch_address_type): Delete unnecessary comment information. (loongarch_symbol_binds_local_p): Modified the judgment order of label and symbol. (loongarch_classify_symbol): Return symbol type. If symbol is a label, or symbol is a local symbol return SYMBOL_PCREL. If is a tls symbol, return SYMBOL_TLS. If is a not local symbol return SYMBOL_GOT_DISP. (loongarch_symbolic_constant_p): Add handling of 'SYMBOL_TLS_IE' 'SYMBOL_TLS_LE' and 'SYMBOL_PCREL'. (loongarch_symbol_insns): Add handling of 'SYMBOL_TLS_IE' 'SYMBOL_TLS_LE' and 'SYMBOL_PCREL'. (loongarch_address_insns): Sort code. (loongarch_12bit_offset_address_p): Sort code. (loongarch_14bit_shifted_offset_address_p): Sort code. (loongarch_call_tls_get_addr): Sort code. (loongarch_legitimize_tls_address): Sort code. (loongarch_output_move): Remove schema support for cmodel other than normal. (loongarch_memmodel_needs_release_fence): Sort code. (loongarch_print_operand): Sort code. * config/loongarch/loongarch.h (LARCH_U12BIT_OFFSET_P): Rename to LARCH_12BIT_OFFSET_P. (LARCH_12BIT_OFFSET_P): New macro. * config/loongarch/loongarch.md: Reimplement the function call. Remove schema support for cmodel other than normal. * config/loongarch/predicates.md (is_const_call_weak_symbol): Delete this predicate. (is_const_call_plt_symbol): Delete this predicate. (is_const_call_global_noplt_symbol): Delete this predicate. (is_const_call_no_local_symbol): New predicate, determines whether it is a local symbol or label. gcc/testsuite/ChangeLog: * gcc.target/loongarch/func-call-1.c: New test. * gcc.target/loongarch/func-call-2.c: New test. * gcc.target/loongarch/func-call-3.c: New test. * gcc.target/loongarch/func-call-4.c: New test.
Diffstat (limited to 'gcc/config/loongarch/loongarch.h')
-rw-r--r--gcc/config/loongarch/loongarch.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/config/loongarch/loongarch.h b/gcc/config/loongarch/loongarch.h
index f9de9a6..89a5bd7 100644
--- a/gcc/config/loongarch/loongarch.h
+++ b/gcc/config/loongarch/loongarch.h
@@ -614,7 +614,7 @@ enum reg_class
#define LU12I_INT(X) LU12I_OPERAND (INTVAL (X))
#define LU32I_INT(X) LU32I_OPERAND (INTVAL (X))
#define LU52I_INT(X) LU52I_OPERAND (INTVAL (X))
-#define LARCH_U12BIT_OFFSET_P(OFFSET) (IN_RANGE (OFFSET, -2048, 2047))
+#define LARCH_12BIT_OFFSET_P(OFFSET) (IN_RANGE (OFFSET, -2048, 2047))
#define LARCH_9BIT_OFFSET_P(OFFSET) (IN_RANGE (OFFSET, -256, 255))
#define LARCH_16BIT_OFFSET_P(OFFSET) (IN_RANGE (OFFSET, -32768, 32767))
#define LARCH_SHIFT_2_OFFSET_P(OFFSET) (((OFFSET) & 0x3) == 0)