2
0
mirror of git://gcc.gnu.org/git/gcc.git synced 2025-03-29 07:30:24 +08:00
Christophe Lyon 011f5e92f8 arm: Improve thumb1_gen_const_int
Enable thumb1_gen_const_int to generate RTL or asm depending on the
context, so that we avoid duplicating code to handle constants in
Thumb-1 with -mpure-code.

Use a template so that the algorithm is effectively shared, and
rely on two classes to handle the actual emission as RTL or asm.

The generated sequence is improved to handle right-shiftable and small
values with less instructions. We now generate:

128:
        movs    r0, r0, 
264:
        movs    r3, 
        lsls    r3, 
510:
        movs    r3, 
        lsls    r3, 
512:
        movs    r3, 
        lsls    r3, 
764:
        movs    r3, 
        lsls    r3, 
65536:
        movs    r3, 
        lsls    r3, 
0x123456:
        movs    r3,  ;0x12
        lsls    r3, 
        adds    r3,  ;0x34
        lsls    r3, 
        adds    r3,  ;0x56
0x1123456:
        movs    r3,  ;0x89
        lsls    r3, 
        adds    r3,  ;0x1a
        lsls    r3, 
        adds    r3,  ;0x2b
        lsls    r3, 
0x1000010:
        movs    r3, 
        lsls    r3, 
        adds    r3, 
        lsls    r3, 
0x1000011:
        movs    r3, 
        lsls    r3, 
        adds    r3, 
-8192:
	movs	r3, 
	lsls	r3, 
	rsbs	r3, 

The patch adds a testcase which does not fully exercise
thumb1_gen_const_int, as other existing patterns already catch small
constants.  These parts of thumb1_gen_const_int are used by
arm_thumb1_mi_thunk.

2020-11-02  Christophe Lyon  <christophe.lyon@linaro.org>

	gcc/
	* config/arm/arm.c (thumb1_const_rtl, thumb1_const_print): New
	classes.
	(thumb1_gen_const_int): Rename to ...
	(thumb1_gen_const_int_1): ... New helper function. Add capability
	to emit either RTL or asm, improve generated code.
	(thumb1_gen_const_int_rtl): New function.
	* config/arm/arm-protos.h (thumb1_gen_const_int): Rename to
	thumb1_gen_const_int_rtl.
	* config/arm/thumb1.md: Call thumb1_gen_const_int_rtl instead
	of thumb1_gen_const_int.

	gcc/testsuite/
	* gcc.target/arm/pure-code/no-literal-pool-m0.c: New.
2020-11-02 14:39:24 +00:00
2020-09-10 10:17:51 +02:00
2020-10-04 00:16:21 +00:00
2020-11-02 14:39:24 +00:00
2020-10-30 00:16:29 +00:00
2020-09-25 00:16:27 +00:00
2020-10-12 00:16:25 +00:00
2020-10-21 00:16:36 +00:00
2020-10-15 00:16:34 +00:00
2020-10-21 00:16:36 +00:00
2020-07-31 00:16:26 +00:00
2020-09-25 00:16:27 +00:00
2020-10-07 00:16:35 +00:00
2020-10-02 00:16:27 +00:00
2020-10-12 00:16:25 +00:00
2020-10-28 00:16:38 +00:00
2020-05-30 00:16:27 +00:00
2020-05-30 00:16:27 +00:00
2020-05-30 00:16:27 +00:00
2020-09-11 00:16:28 +00:00
2020-05-30 00:16:27 +00:00
2020-05-30 00:16:27 +00:00
2020-01-15 14:29:53 +01:00
2020-06-12 16:03:02 +02:00
2020-10-07 00:16:35 +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 2.1 GiB
Languages
C++ 31.9%
C 31.3%
Ada 12%
D 6.5%
Go 6.4%
Other 11.5%