+ [(set_attr "type" "move,move,move,load,store,store,move,move,move,move,move,load,load,store,rsr,wsr")
From 6d852ffb43b111a39162135c95249e749c4e285b Mon Sep 17 00:00:00 2001
From: Max Filippov <jcmvbkbc@gmail.com>
Date: Thu, 6 Aug 2015 01:16:02 +0300
Subject: [PATCH] xtensa: add -mauto-litpools option
With support from assembler this option allows compiling huge functions,
where single literal pool at the beginning of a function may not be
reachable by L32R instructions at its end.
Currently assembler --auto-litpools option cannot deal with literals
used from multiple locations separated by more than 256 KBytes of code.
Don't turn constants into literals, instead use MOVI instruction to load
them into registers and let the assembler turn them into literals as
2015-08-12 Max Filippov <jcmvbkbc@gmail.com>
* config/xtensa/constraints.md (define_constraint "Y"): New
* config/xtensa/elf.h (ASM_SPEC): Add m(no-)auto-litpools.
* config/xtensa/linux.h (ASM_SPEC): Likewise.
* config/xtensa/predicates.md (move_operand): Match constants
and symbols in the presence of TARGET_AUTO_LITPOOLS.
* config/xtensa/xtensa.c (xtensa_valid_move): Don't allow
immediate references to TLS data.
(xtensa_emit_move_sequence): Don't force constants to memory in
the presence of TARGET_AUTO_LITPOOLS.
(print_operand): Add 'y' format, same as default, but capable of
printing SF mode constants as well.
* config/xtensa/xtensa.md (movsi_internal, movhi_internal)
(movsf_internal): Add movi pattern that loads literal.
(movsf, movdf): Don't force constants to memory in the presence
(movdf_internal): Add 'Y' constraint.
* config/xtensa/xtensa.opt (mauto-litpools): New option.
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Changes to ChangeLogs and documentation are dropped.
gcc/config/xtensa/constraints.md | 5 +++++
gcc/config/xtensa/elf.h | 4 +++-
gcc/config/xtensa/linux.h | 4 +++-
gcc/config/xtensa/predicates.md | 3 ++-
gcc/config/xtensa/xtensa.c | 19 ++++++++++++++++++-
gcc/config/xtensa/xtensa.md | 35 +++++++++++++++++++----------------
gcc/config/xtensa/xtensa.opt | 4 ++++
7 files changed, 54 insertions(+), 20 deletions(-)
diff --git a/gcc/config/xtensa/constraints.md b/gcc/config/xtensa/constraints.md
index 30f4c1f..773d4f9 100644
--- a/gcc/config/xtensa/constraints.md
+++ b/gcc/config/xtensa/constraints.md
(and (match_code "const_int")
(match_test "xtensa_mask_immediate (ival)")))
+ "A constant that can be used in relaxed MOVI instructions."
+ (and (match_code "const_int,const_double,const,symbol_ref,label_ref")
+ (match_test "TARGET_AUTO_LITPOOLS")))