aboutsummaryrefslogtreecommitdiff
path: root/gas/doc
diff options
context:
space:
mode:
authorMax Filippov <jcmvbkbc@gmail.com>2015-07-29 17:42:54 +0300
committerMax Filippov <jcmvbkbc@gmail.com>2015-08-12 20:19:58 +0300
commitb46824bd49648c575372e6d9bc6a6defeabd6ed5 (patch)
tree0992495632a0c6ce3ad3a65f8e8780874da33fe6 /gas/doc
parentGuarantee save-and-restore of GDBFLAGS on gdb.base/checkpoint-ns.exp (diff)
downloadbinutils-gdb-b46824bd49648c575372e6d9bc6a6defeabd6ed5.tar.gz
binutils-gdb-b46824bd49648c575372e6d9bc6a6defeabd6ed5.tar.bz2
binutils-gdb-b46824bd49648c575372e6d9bc6a6defeabd6ed5.zip
xtensa: add --auto-litpools option
Auto-litpools is the automated version of text-section-literals: literal pool candidate frags are planted every N frags and during relaxation they are turned into actual literal pools where literals are moved to become reachable for their first reference by L32R instruction. 2015-08-12 David Weatherford <weath@cadence.com> gas/ * config/tc-xtensa.c (struct litpool_frag, struct litpool_seg): New structures. (xtensa_maybe_create_literal_pool_frag): New function. (litpool_seg_list, auto_litpools, auto_litpool_limit) (litpool_buf, litpool_slotbuf): New static variables. (option_auto_litpools, option_no_auto_litpools) (option_auto_litpool_limit): New enum identifiers. (md_longopts): Add entries for auto-litpools, no-auto-litpools and auto-litpool-limit. (md_parse_option): Handle option_auto_litpools, option_no_auto_litpools and option_auto_litpool_limit. (md_show_usage): Add help for --[no-]auto-litpools and --auto-litpool-limit. (xtensa_mark_literal_pool_location): Record a place for literal pool with a call to xtensa_maybe_create_literal_pool_frag. (get_literal_pool_location): Find highest priority literal pool or convert candidate to literal pool when auto-litpools are used. (xg_assemble_vliw_tokens): Create literal pool after jump instruction. (xtensa_check_frag_count): Create candidate literal pool every auto_litpool_limit frags. (xtensa_relax_frag): Add jump around literals to non-empty literal pool. (xtensa_move_literals): Estimate literal pool addresses and move unreachable literals closer to their users, converting candidate to literal pool if needed. (xtensa_switch_to_non_abs_literal_fragment): Only emit error about missing .literal_position in case auto-litpools are not used. * config/tc-xtensa.h (xtensa_relax_statesE): New relaxation state: RELAX_LITERAL_POOL_CANDIDATE_BEGIN. * doc/as.texinfo (Xtensa options): Document --auto-litpools and --no-auto-litpools options. * doc/c-xtensa.texi (Xtensa options): Likewise. 2015-08-12 Max Filippov <jcmvbkbc@gmail.com> gas/testsuite/ * gas/xtensa/all.exp: Add auto-litpools to the list of xtensa tests. * gas/xtensa/auto-litpools.s: New file: auto-litpools test. * gas/xtensa/auto-litpools.s: New file: auto-litpools test result pattern.
Diffstat (limited to 'gas/doc')
-rw-r--r--gas/doc/as.texinfo3
-rw-r--r--gas/doc/c-xtensa.texi23
2 files changed, 24 insertions, 2 deletions
diff --git a/gas/doc/as.texinfo b/gas/doc/as.texinfo
index e3b965c8cf7..dae7424e6d0 100644
--- a/gas/doc/as.texinfo
+++ b/gas/doc/as.texinfo
@@ -555,7 +555,8 @@ gcc(1), ld(1), and the Info entries for @file{binutils} and @file{ld}.
@ifset XTENSA
@emph{Target Xtensa options:}
- [@b{--[no-]text-section-literals}] [@b{--[no-]absolute-literals}]
+ [@b{--[no-]text-section-literals}] [@b{--[no-]auto-litpools}]
+ [@b{--[no-]absolute-literals}]
[@b{--[no-]target-align}] [@b{--[no-]longcalls}]
[@b{--[no-]transform}]
[@b{--rename-section} @var{oldname}=@var{newname}]
diff --git a/gas/doc/c-xtensa.texi b/gas/doc/c-xtensa.texi
index 7019f8478ad..26155c4eb0d 100644
--- a/gas/doc/c-xtensa.texi
+++ b/gas/doc/c-xtensa.texi
@@ -43,9 +43,30 @@ placed in a data RAM/ROM. With @samp{--text-@-section-@-literals}, the
literals are interspersed in the text section in order to keep them as
close as possible to their references. This may be necessary for large
assembly files, where the literals would otherwise be out of range of the
-@code{L32R} instructions in the text section. These options only affect
+@code{L32R} instructions in the text section. Literals are grouped into
+pools following @code{.literal_position} directives or preceding
+@code{ENTRY} instructions. These options only affect literals referenced
+via PC-relative @code{L32R} instructions; literals for absolute mode
+@code{L32R} instructions are handled separately.
+@xref{Literal Directive, ,literal}.
+
+@item --auto-litpools | --no-auto-litpools
+@kindex --auto-litpools
+@kindex --no-auto-litpools
+Control the treatment of literal pools. The default is
+@samp{--no-@-auto-@-litpools}, which in the absence of
+@samp{--text-@-section-@-literals} places literals in separate sections
+in the output file. This allows the literal pool to be placed in a data
+RAM/ROM. With @samp{--auto-@-litpools}, the literals are interspersed
+in the text section in order to keep them as close as possible to their
+references, explicit @code{.literal_position} directives are not
+required. This may be necessary for very large functions, where single
+literal pool at the beginning of the function may not be reachable by
+@code{L32R} instructions at the end. These options only affect
literals referenced via PC-relative @code{L32R} instructions; literals
for absolute mode @code{L32R} instructions are handled separately.
+When used together with @samp{--text-@-section-@-literals},
+@samp{--auto-@-litpools} takes precedence.
@xref{Literal Directive, ,literal}.
@item --absolute-literals | --no-absolute-literals