Takayuki 'January June' Suwa 45f1fed76d xtensa: Implement "-mforce-l32" target-specific option
In the previous patches, both the named address space "__force_l32" and
the target-specific attribute "force_l32" were introduced for reading
sub-words from the instruction memory area.

This patch introduces a new target-specific option "-mforce-l32", which
allows sub-word reading from the instruction memory area even in the
generic address spaces (ie., the default memory references) or without
the "force_l32" attribute.

     /* example */
     int test(unsigned int i) {
       static const char string[] __attribute__((section(".irom.text")))
         = "The quick brown fox jumps over the lazy dog.";
       return i < __builtin_strlen(string) ? string[i] : -1;
     }

     ;; result (-O2 -mforce-l32)
     	.literal_position
     	.literal .LC0, string$0
     test:
     	entry	sp, 32
     	movi.n	a8, 0x2b
     	bltu	a8, a2, .L3
     	l32r	a9, .LC0	;; If -mno-force-l32,
     	movi.n	a8, -4		;;
     	add.n	a9, a9, a2	;;	l32r	a8, .LC0
     	and	a8, a9, a8	;;	add.n	a8, a8, a2
     	l32i.n	a8, a8, 0	;;	l8ui	a2, a8, 0
     	ssa8l	a9		;;
     	srl	a8, a8		;;
     	extui	a2, a8, 0, 8	;;
     	retw.n
     .L3:
     	movi.n	a2, -1
     	retw.n
     	.section .irom.text,"a"
     string$0:
     	.string	"The quick brown fox jumps over the lazy dog."

gcc/ChangeLog:

	* config/xtensa/xtensa.cc (xtensa_expand_load_force_l32_2):
	New sub-function for inspecting pseudos that clearly point to the
	function's stack frame.
	(xtensa_expand_load_force_l32):
	Add handling for loading from the generic address space when the
	"-mforce-l32" option is enabled, however, obvious references to
	function stack frames are excluded.
	* config/xtensa/xtensa.opt (mforce-l32):
	New target-specific option definition.
2026-05-04 00:28:39 -07:00
2026-04-15 08:16:45 +00:00
2026-05-01 00:16:27 +00:00
2026-04-22 00:16:28 +00:00
2026-04-24 00:16:27 +00:00
2026-04-18 00:16:31 +00:00
2026-04-22 00:16:28 +00:00
2026-04-29 00:16:40 +00:00
2026-04-22 00:16:28 +00:00
2026-04-30 00:16:31 +00:00
2026-05-03 00:16:23 +00:00
2026-04-23 00:16:32 +00:00
2026-05-02 00:16:28 +00:00

This directory contains the GNU Compiler Collection (GCC).

The GNU Compiler Collection is free software.  See the files whose
names start with COPYING for copying permission.  The manuals, and
some of the runtime libraries, are under different terms; see the
individual source files for details.

The directory INSTALL contains copies of the installation information
as HTML and plain text.  The source of this information is
gcc/doc/install.texi.  The installation information includes details
of what is included in the GCC sources and what files GCC installs.

See the file gcc/doc/gcc.texi (together with other files that it
includes) for usage and porting information.  An online readable
version of the manual is in the files gcc/doc/gcc.info*.

See http://gcc.gnu.org/bugs/ for how to report bugs usefully.

Copyright years on GCC source files may be listed using range
notation, e.g., 1987-2012, indicating that every year in the range,
inclusive, is a copyrightable year that could otherwise be listed
individually.
Description
No description provided
Readme 4.2 GiB
Languages
C++ 30.7%
C 30.2%
Ada 14.4%
D 6.1%
Go 5.7%
Other 12.4%