xtensa: add -mauto-litpools option
commita2acdfa1f5bb80ca8f7e11a2b9302ab0eafd4eb8
authorjcmvbkbc <jcmvbkbc@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 12 Aug 2015 17:36:45 +0000 (12 17:36 +0000)
committerjcmvbkbc <jcmvbkbc@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 12 Aug 2015 17:36:45 +0000 (12 17:36 +0000)
tree07a3b7e9657deeab0b91ba1446c600d5ffbcfcf5
parent2933b8049a5a0edd48e1d3110e3f83b655d62555
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
necessary.

2015-08-12  Max Filippov  <jcmvbkbc@gmail.com>
gcc/
* config/xtensa/constraints.md (define_constraint "Y"): New
constraint.
* 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
of TARGET_AUTO_LITPOOLS.
(movdf_internal): Add 'Y' constraint.
* config/xtensa/xtensa.opt (mauto-litpools): New option.
* doc/invoke.text (Xtensa options): Document -mauto-litpools.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@226828 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/config/xtensa/constraints.md
gcc/config/xtensa/elf.h
gcc/config/xtensa/linux.h
gcc/config/xtensa/predicates.md
gcc/config/xtensa/xtensa.c
gcc/config/xtensa/xtensa.md
gcc/config/xtensa/xtensa.opt
gcc/doc/invoke.texi