aboutsummaryrefslogtreecommitdiff
path: root/gcc/doc
diff options
context:
space:
mode:
authorGeorg-Johann Lay <avr@gjlay.de>2024-02-15 13:53:34 +0100
committerGeorg-Johann Lay <avr@gjlay.de>2024-02-15 14:07:53 +0100
commit5cff288c2dae4ea709df067cf398f23e214b2e80 (patch)
tree51bf4e11f2807d10e6376614b29f861f4582a0a4 /gcc/doc
parent84da9bca72558119974db307208eb2fa2b8ad5dd (diff)
downloadgcc-5cff288c2dae4ea709df067cf398f23e214b2e80.zip
gcc-5cff288c2dae4ea709df067cf398f23e214b2e80.tar.gz
gcc-5cff288c2dae4ea709df067cf398f23e214b2e80.tar.bz2
AVR: target 113927 - Simple code triggers stack frame for Reduced Tiny.
The -mmcu=avrtiny cores have no ADIW and SBIW instructions. This was implemented by clearing all regs out of regclass ADDW_REGS so that constraint "w" never matched. This corrupted the subset relations of the register classes as they appear in enum reg_class. This patch keeps ADDW_REGS like for all other cores, i.e. it contains R24...R31. Instead of tests like test_hard_reg_class (ADDW_REGS, *) the code now uses avr_adiw_reg_p (*). And all insns with constraint "w" get "isa" insn attribute value of "adiw". Plus, a new built-in macro __AVR_HAVE_ADIW__ is provided, which is more specific than __AVR_TINY__. gcc/ PR target/113927 * config/avr/avr.h (AVR_HAVE_ADIW): New macro. * config/avr/avr-protos.h (avr_adiw_reg_p): New proto. * config/avr/avr.cc (avr_adiw_reg_p): New function. (avr_conditional_register_usage) [AVR_TINY]: Don't clear ADDW_REGS. Replace test_hard_reg_class (ADDW_REGS, ...) with calls to * config/avr/avr.md: Same. (attr "isa") <tiny, no_tiny>: Remove. <adiw, no_adiw>: Add. (define_insn, define_insn_and_split): When an alternative has constraint "w", then set attribute "isa" to "adiw". * config/avr/avr-c.cc (avr_cpu_cpp_builtins) [AVR_HAVE_ADIW]: Built-in define __AVR_HAVE_ADIW__. * doc/invoke.texi (AVR Options): Document it.
Diffstat (limited to 'gcc/doc')
-rw-r--r--gcc/doc/invoke.texi11
1 files changed, 7 insertions, 4 deletions
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 0de184f..511114c 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -24146,6 +24146,9 @@ If @var{device} is not a device but only a core architecture like
@item __AVR_XMEGA__
The device / architecture belongs to the XMEGA family of devices.
+@item __AVR_HAVE_ADIW__
+The device has the @code{ADIW} and @code{SBIW} instructions.
+
@item __AVR_HAVE_ELPM__
The device has the @code{ELPM} instruction.
@@ -24153,14 +24156,14 @@ The device has the @code{ELPM} instruction.
The device has the @code{ELPM R@var{n},Z} and @code{ELPM
R@var{n},Z+} instructions.
-@item __AVR_HAVE_MOVW__
-The device has the @code{MOVW} instruction to perform 16-bit
-register-register moves.
-
@item __AVR_HAVE_LPMX__
The device has the @code{LPM R@var{n},Z} and
@code{LPM R@var{n},Z+} instructions.
+@item __AVR_HAVE_MOVW__
+The device has the @code{MOVW} instruction to perform 16-bit
+register-register moves.
+
@item __AVR_HAVE_MUL__
The device has a hardware multiplier.