[patch,avr,applied] Fuse get_insns with end_sequence

2025-07-19 Thread Georg-Johann Lay
There were two cases where get_insns() can be fused with end_sequence(). Applied as obvious. Johann -- AVR: Fuse get_insns with end_sequence. gcc/ * config/avr/avr-passes.cc (avr_optimize_casesi): Fuse get_insns() with end_sequence(). diff --git a/gcc/config/avr/avr-passes.cc

[patch,avr,applied] Add AVRxxDAyyS devices

2025-07-06 Thread Georg-Johann Lay
Applied as obvious. Johann -- AVR: Add support for AVR32DAxxS, AVR64DAxxS, AVR128DAxxS devices. gcc/ * config/avr/avr-mcus.def (avr32da28S, avr32da32S, avr32da48S) (avr64da28S, avr64da32S, avr64da48S avr64da64S) (avr128da28S, avr128da32S, avr128da48S, avr128da64S): Add

[patch,avr,applied] Fix ICE PR120856 in split2 with -mno-lra

2025-06-28 Thread Georg-Johann Lay
This is an obvious fix for PR120856. The ICE is relatively recent, and I don't see it in v15. As it occurs when building libgcc with -mno-lra I went ahead and installed a fix. Johann -- AVR: target/120856 - Deny R24:DI in avr_hard_regno_mode_ok with Reload. This fixes an ICE with -mno-lra whe

Re: [patch,avr] Turn on LRA per default

2025-06-27 Thread Jeff Law
On 6/27/25 7:08 AM, Georg-Johann Lay wrote: This turns on -mlra per default on avr. Ok for trunk? Yes, definitely. The more soak time it gets the better IMHO. jeff

[patch,avr] Turn on LRA per default

2025-06-27 Thread Georg-Johann Lay
This turns on -mlra per default on avr. Ok for trunk? Johann -- AVR: target/113934 - Use LRA per default. Now that the patches for PR120424 are upstream, the last known bug associated with avr+lra has been fixed: PR118591. So we can pull the switch that turns on LRA per default. This patch

Re: [patch,avr,v15] PR120423, PR116389

2025-06-14 Thread Denis Chertykov
Georg-Johann Lay writes: > This patch is to avoid PR120423 and PR116389 on avr. > > The PRs are about paradoxical subregs, that ICE after old reload > as follows: > > For rtxes like (subreg:HI (QI) 0), the inner rtx may be reloaded to > (reg:QI 31) which is fine, but the paradoxical subreg will b

[patch,avr,v15] PR120423, PR116389

2025-06-12 Thread Georg-Johann Lay
This patch is to avoid PR120423 and PR116389 on avr. The PRs are about paradoxical subregs, that ICE after old reload as follows: For rtxes like (subreg:HI (QI) 0), the inner rtx may be reloaded to (reg:QI 31) which is fine, but the paradoxical subreg will be changed to (reg:HI 31) which is inva

[patch, avr, applied] PR119989: Missing clobbers in xload__libgcc

2025-04-30 Thread Georg-Johann Lay
libgcc's __xload_1...4 is clobbering Z (and also R21 is some cases), but avr.md had clobbers of respective GPRs only up to reload. Outcome was that code reading from the same __memx address twice could be wrong. This patch adds respective clobbers. Applied as obvious. Johann -- AVR: target/11

[patch,avr,applied]: Improve __[u]mulhisi3 on AVRrc

2025-04-07 Thread Georg-Johann Lay
When MUL is not available, then the __umulhisi3 and __mulhisi3 functions can use __mulhisi3_helper. This improves code size, stack footprint and runtime on AVRrc. Applied as obvious. Johann -- AVRrc: Tweak __[u]mulhisi3. When MUL is not available, then the __umulhisi3 and __mulhisi3 functio

[patch,avr] Support 8-bit and 16-bit fixed-point ops on avrtiny

2025-04-06 Thread Georg-Johann Lay
With a few changes, 8-bit and 16-bit fixed-point operations can be made work on the reduced core. Added as obvious. Johann -- AVRrc: Support 8-bit and 16-bit fixed-point arith in libgcc. With some minor changes, 8-bit and 16-bit fixed-point operations can be supported on the reduced core. lib

[patch,avr,applied] Decrease call depth of __umulhisi3

2025-04-05 Thread Georg-Johann Lay
__umulhisi3 had a code size optimization of 6 bytes that costs a call. This patch uses linear code on all devices with MUL irrespective of program memory size. Johann -- AVR: Speed up __umulhisi3 for small devices with MUL. __umulhisi3 had an "rcall 1f" to save 6 bytes, which is an un

[patch,avr,applied] Clarify some optimization options.

2025-03-26 Thread Georg-Johann Lay
Applied the patch below. Johann -- AVR: Clarify some optimization options. gcc/ * doc/invoke.texi (AVR Optimization Options) <-maccumulate-args>: Refer to -fdefer-pop. <-muse-nonzero-bits>: Re-formulate what the option does. diff --git a/gcc/doc/invoke.texi b/gcc/doc/i

[patch,avr,applied] Add AVR-SD devices

2025-03-23 Thread Georg-Johann Lay
Added the following 6 AVR-SD devices. Johann -- AVR: Add AVR-SD devices. gcc/ * config/avr/avr-mcus.def: Add AVR32SD20, AVR32SD28, AVR32SD32, AVR64SD28, AVR64SD32, AVR64SD48. * doc/avr-mmcu.texi: Rebuild.diff --git a/gcc/config/avr/avr-mcus.def b/gcc/config/avr/avr-mcus

[patch,avr,applied] Use "avr-peep2-after-fuse-move" for the 2nd run of peephole2.

2025-03-22 Thread Georg-Johann Lay
AVR: Use "avr-peep2-after-fuse-move" for the 2nd run of peephole2. This patch uses a name for the dump file that makes it clear where in the pass chain the 2nd run of peephole2 is located. gcc/ * config/avr/avr.c (avr_option_override): Use "avr-peep2-after-fuse-move" as dump name

Re: [patch, avr] PR119421: Optimize more bit operations

2025-03-22 Thread Denis Chertykov
Georg-Johann Lay writes: > There are occasions where knowledge about nonzero bits makes some > optimizations possible. For example, > >Rd |= Rn << Off > > can be implemented as > >SBRC Rn, 0 >ORI Rd, 1 << Off > > when Rn in { 0, 1 }, i.e. nonzero_bits (Rn) == 1. This patch adds som

Re: [patch, avr] Add "used" attribute to code in .initN and .finiN

2025-03-22 Thread Denis Chertykov
Georg-Johann Lay writes: > For code in .initN and .finiN there are no calls, hence let the > compiler add "used" attribute. > > Ok for trunk? Ok. Denis > > Johann > > -- > > AVR: Add attribute "used" for code in .initN and .initN sections. > > Code in .initN and .initN sections is never called

[patch, avr] PR119421: Optimize more bit operations

2025-03-21 Thread Georg-Johann Lay
There are occasions where knowledge about nonzero bits makes some optimizations possible. For example, Rd |= Rn << Off can be implemented as SBRC Rn, 0 ORI Rd, 1 << Off when Rn in { 0, 1 }, i.e. nonzero_bits (Rn) == 1. This patch adds some patterns that exploit nonzero_bits() in so

Re: [patch, avr] PR119421: Optimize more bit operations

2025-03-21 Thread Jeff Law
On 3/21/25 2:59 PM, Georg-Johann Lay wrote: There are occasions where knowledge about nonzero bits makes some optimizations possible.  For example,    Rd |= Rn << Off can be implemented as    SBRC Rn, 0    ORI  Rd, 1 << Off when Rn in { 0, 1 }, i.e. nonzero_bits (Rn) == 1.  This patch a

[patch, avr] Add "used" attribute to code in .initN and .finiN

2025-03-21 Thread Georg-Johann Lay
For code in .initN and .finiN there are no calls, hence let the compiler add "used" attribute. Ok for trunk? Johann -- AVR: Add attribute "used" for code in .initN and .initN sections. Code in .initN and .initN sections is never called since these sections are special and part of the startup

[patch,avr,applied] Fix PR119533 ICE in avr-fuse-move.

2025-03-18 Thread Georg-Johann Lay
Applied this patch as obvious. Johann -- AVR: target/119355 - Fix ICE in pass avr-fuse-move / -mfuse-move. This ICE only occurred when the compiler is built with, say CXXFLAGS='-Wp,-D_GLIBCXX_ASSERTIONS'. The problem was that a value from an illegal REGNO was read. The value was not used in

[patch,avr] texi: Add new subsubsection "AVR Optimization Options"

2025-03-02 Thread Georg-Johann Lay
This patch adds a new section "AVR Optimization Options" in the texi documentation. Ok for trunk? Johann -- AVR: Add texi @subsubsection "AVR Optimization Options". gcc/ * doc/invoke.texi (AVR Optimization Options): New @subsubsection for pure optimization options. diff --git

Re: [PATCH] avr: Fix up avr_print_operand diagnostics [PR118991]

2025-03-01 Thread Denis Chertykov
вт, 25 февр. 2025 г. в 20:23, Jakub Jelinek : > > Hi! > > As can be seen in gcc/po/gcc.pot: > #: config/avr/avr.cc:2754 > #, c-format > msgid "bad I/O address 0x" > msgstr "" > > exgettext couldn't retrieve the whole format string in this case, > because it uses a macro in the middle. output_opera

[PATCH] avr: Fix up avr_print_operand diagnostics [PR118991]

2025-02-25 Thread Jakub Jelinek
Hi! As can be seen in gcc/po/gcc.pot: #: config/avr/avr.cc:2754 #, c-format msgid "bad I/O address 0x" msgstr "" exgettext couldn't retrieve the whole format string in this case, because it uses a macro in the middle. output_operand_lossage is c-format function though, so we can't use %wx to pri

[patch,avr,applied] Add an ISR test to avr/torture

2025-02-19 Thread Georg-Johann Lay
This adds one more ISR test to the ave testsuite. Johann -- AVR: Add new ISR test gcc.target/avr/torture/isr-04-regs.c. gcc/testsuite/ * gcc.target/avr/torture/isr-04-regs.c: New test. * gcc.target/avr/isr-test.h: Don't set GPRs to values that are 0 mod 0x11.AVR: Ad

[patch,avr,applied] ad PR118764: Define __AVR_CVT__ when -mcvt is on

2025-02-16 Thread Georg-Johann Lay
Added this addendum to PR118764 / "compact vector table". Johann -- AVR: ad target/118764 - Let -mcvt set built-in macro __AVR_CVT__ gcc/ PR target/118764 * config/avr/avr-c.cc (avr_cpu_cpp_builtins) [TARGET_CVT]: Define __AVR_CVT__. * doc/invoke.texi (AVR Built

Re: [patch,avr] Run avr_builtin_supported_p in avr_resolve_overloaded_builtin

2025-02-16 Thread Denis Chertykov
Georg-Johann Lay writes: > This patch executes avr_builtin_supported_p at a later time and in > avr_resolve_overloaded_builtin. This allows for better diagnostics > and avoids lto1 hiccups when a built-in decl is NULL_TREE. > > Ok for trunk? > Ok. Denis

Re: [patch,avr] Don't output operations for unused result regs

2025-02-16 Thread Denis Chertykov
Georg-Johann Lay writes: > When REG_UNUSED notes indicate that some result bytes are not > used by the following code, then there's no need to asm out them. > The patch uses such notes for the asm out of AND, IOR, XOR, PLUS, MINUS. > > Passes without regressions. Ok for trunk? Ok. Please apply.

[patch,avr] Run avr_builtin_supported_p in avr_resolve_overloaded_builtin

2025-02-15 Thread Georg-Johann Lay
This patch executes avr_builtin_supported_p at a later time and in avr_resolve_overloaded_builtin. This allows for better diagnostics and avoids lto1 hiccups when a built-in decl is NULL_TREE. Ok for trunk? Johann -- AVR: Diagnose unsupported built-ins in avr_resolve_overloaded_builtin. This

[patch,avr] Don't output operations for unused result regs

2025-02-15 Thread Georg-Johann Lay
When REG_UNUSED notes indicate that some result bytes are not used by the following code, then there's no need to asm out them. The patch uses such notes for the asm out of AND, IOR, XOR, PLUS, MINUS. Passes without regressions. Ok for trunk? Johann -- AVR: Don't asm output operations for un

Re: [patch,avr] PR118878: Don't ICE on result from paradoxical reg's alloc.

2025-02-14 Thread Denis Chertykov
Georg-Johann Lay writes: > This patch fixes an ICE on trunk, so I don't plan to backport. > > Ok for trunk? Ok. Denis

[patch,avr] PR118878: Don't ICE on result from paradoxical reg's alloc.

2025-02-14 Thread Georg-Johann Lay
This patch fixes an ICE on trunk, so I don't plan to backport. Ok for trunk? Johann -- AVR: target/118878 - Don't ICE on result from paradoxical reg's alloc. After register allocation, paradoxical subregs may become something like r20:SI += r22:SI which doesn't make much sense as assembly c

Re: [patch,avr] Add -mno-call-main to tweak running main()

2025-02-12 Thread Georg-Johann Lay
...plus, I updated the documentation: -mno-call-main asserts that main() does not return. Johann index 0aef2abf05b..af41d7b9ad3 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -24457,6 +24457,24 @@ Do not save registers in @code{main}. The effect is the same like attaching attr

[patch,avr] Add -mno-call-main to tweak running main()

2025-02-09 Thread Georg-Johann Lay
On devices with very limited resources, it may be desirable to run main in a more efficient way than provided by the startup code XCALL main XJMP exit from section .init9. In AVR-LibC v2.3, that code has been moved to libmcu.a, hence symbol __call_main can be satisfied so that the respec

[patch,avr,applied] Fix typos in extend.texi

2025-02-08 Thread Georg-Johann Lay
Fixed typos in extend.texi. Applied as as obvious. Johann -- ad target/118764: Fix a typo in doc/extend.texi. gcc/ PR target/118764 * doc/invoke.texi (AVR Options): Fix typos. diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index c33eb4425de..0aef2abf05b

Re: [patch,avr] Add support for a Compact Vector Table

2025-02-06 Thread Denis Chertykov
Georg-Johann Lay writes: > Some AVR devices support a Compact Vector Table. > > The support is provided by means of a startup code file > crt-cvt.o from AVR-LibC that can be linked instead > of the traditional crt.o. > > This patch adds a new command line option -mcvt that links > that CVT startu

[patch,avr] Add support for a Compact Vector Table

2025-02-06 Thread Georg-Johann Lay
Some AVR devices support a Compact Vector Table. The support is provided by means of a startup code file crt-cvt.o from AVR-LibC that can be linked instead of the traditional crt.o. This patch adds a new command line option -mcvt that links that CVT startup code (or issues an error when the devi

Re: [patch,avr] Use more robust parsing of spaces in genmultilib.awk

2025-02-05 Thread Denis Chertykov
Georg-Johann Lay writes: > This patch implements a more robust parsing of the > AVR_MCU lines in genmultlib.awk. > > The generated t-multilib-avr is the same. > > Ok for trunk? Ok. Please apply. Denis.

[patch,avr] Use more robust parsing of spaces in genmultilib.awk

2025-02-05 Thread Georg-Johann Lay
This patch implements a more robust parsing of the AVR_MCU lines in genmultlib.awk. The generated t-multilib-avr is the same. Ok for trunk? Johann AVR: genmultilib.awk - Use more robust parsing of spaces. gcc/ * config/avr/genmultilib.awk: Parse the AVR_MCU lines in a more rob

Re: [patch,avr] Add built-ins for strlen of a string in some address-space

2025-01-30 Thread Georg-Johann Lay
For easier review, I broke that patch into two parts: One for the strlen built-ins, and one to handle built-ins that are only available in C. Delta is the same. Johann Am 30.01.25 um 11:42 schrieb Georg-Johann Lay: AVR: Provide built-ins for strlen where the string lives in some AS. This pa

[patch,avr] Add built-ins for strlen of a string in some address-space

2025-01-30 Thread Georg-Johann Lay
AVR: Provide built-ins for strlen where the string lives in some AS. This patch adds built-in functions __builtin_avr_strlen_flash, __builtin_avr_strlen_flashx and __builtin_avr_strlen_memx. Purpose is that higher-level functions can use __builtin_constant_p on strlen without raising a diagnostic

Re: [ping,patch,avr] Try to work around PR118012 / PR118360

2025-01-23 Thread Denis Chertykov
Georg-Johann Lay writes: > Ping for https://gcc.gnu.org/pipermail/gcc-patches/2025-January/673336.html > > Am 11.01.25 um 14:09 schrieb Georg-Johann Lay: >> The patch below is for trunk. >> Andrew Pinski says he has a patch to fix it, bit that won't >> materialize >> before v16. >> AVR: PR118012

[ping,patch,avr] Try to work around PR118012 / PR118360

2025-01-23 Thread Georg-Johann Lay
Ping for https://gcc.gnu.org/pipermail/gcc-patches/2025-January/673336.html Am 11.01.25 um 14:09 schrieb Georg-Johann Lay: The patch below is for trunk. Andrew Pinski says he has a patch to fix it, bit that won't materialize before v16. AVR: PR118012 - Try to work around sick code from match.p

Re: [patch,avr] ad PR117726: Tweak 32-bit logical shifts of 25...30 for -Oz

2025-01-22 Thread Denis Chertykov
ср, 22 янв. 2025 г. в 23:53, Georg-Johann Lay : > > As it turns out, logical 32-bit shifts with an offset of 25..30 can > be performed in 7 instructions or less. This beats the 7 instruc- > tions required for the default code of a shift loop. > Plus, with zero overhead, these cases can be 3-operan

[patch,avr] ad PR117726: Tweak 32-bit logical shifts of 25...30 for -Oz

2025-01-22 Thread Georg-Johann Lay
As it turns out, logical 32-bit shifts with an offset of 25..30 can be performed in 7 instructions or less. This beats the 7 instruc- tions required for the default code of a shift loop. Plus, with zero overhead, these cases can be 3-operand. This is only relevant for -Oz because with -Os, 3op s

[patch,avr,applied] Add tests for LRA's PR118591

2025-01-22 Thread Georg-Johann Lay
Added 2 tests for PR118591. Johann -- AVR: Add test cases for PR118591. gcc/testsuite/ PR rtl-optimization/118591 * gcc.target/avr/torture/pr118591-1.c: New test. * gcc.target/avr/torture/pr118591-2.c: New test. diff --git a/gcc/testsuite/gcc.target/avr/torture/pr11859

Re: [patch,avr] Tweak some 16-bit shifts using MUL.

2025-01-21 Thread Denis Chertykov
Georg-Johann Lay writes: > u16 << 5 and u16 << 6 can be tweaked by using MUL instructions. > Benefit is a better speed ratio with -Os and smaller size with -O2. > > No new regressions. > > Ok for trunk? Ok. Please apply. Denis.

[patch,avr] Tweak some 16-bit shifts using MUL.

2025-01-20 Thread Georg-Johann Lay
u16 << 5 and u16 << 6 can be tweaked by using MUL instructions. Benefit is a better speed ratio with -Os and smaller size with -O2. No new regressions. Ok for trunk? Johann .. AVR: Tweak some 16-bit shifts by using MUL. u16 << 5 and u16 << 6 can be tweaked by using MUL instructions. Benefit

Re: [patch, avr] Add const attribute to built-in functions if possible.

2025-01-17 Thread Denis Chertykov
Georg-Johann Lay writes: > Most of the avr built-in functions can be attributed "const". > > Ok for trunk? > Ok. Denis. > Johann > > -- > > AVR: Add "const" attribute to avr built-in functions if possible. > > gcc/ > * config/avr/avr-c.cc (DEF_BUILTIN): Add ATTRS argument to macro >

[patch,avr] Add const attribute to built-in functions if possible.

2025-01-17 Thread Georg-Johann Lay
Most of the avr built-in functions can be attributed "const". Ok for trunk? Johann -- AVR: Add "const" attribute to avr built-in functions if possible. gcc/ * config/avr/avr-c.cc (DEF_BUILTIN): Add ATTRS argument to macro definition. * config/avr/avr.cc: Same.

Re: [patch,avr] Use INT_N to built-in define __int24.

2025-01-17 Thread Denis Chertykov
чт, 16 янв. 2025 г. в 21:19, Georg-Johann Lay : > > This patch uses the INT_N interface to define __int24. > > Ok for trunk? Ok. Please apply. Denis.

[patch,avr] Use INT_N to built-in define __int24.

2025-01-16 Thread Georg-Johann Lay
This patch uses the INT_N interface to define __int24. Ok for trunk? Johann -- AVR: Use INT_N to built-in define __int24. This patch uses the INT_N interface to define __int24 in avr-modes.def. Since the testsuite uses -Wpedantic and __int24 is a C/C++ extension, uses of __int24 and __uint24

[patch,avr] Try to work around PR118012 / PR118360

2025-01-11 Thread Georg-Johann Lay
The patch below is for trunk. Andrew Pinski says he has a patch to fix it, bit that won't materialize before v16. AVR: PR118012 - Try to work around sick code from match.pd. This patch tries to work around PR118012 which may use a full fledged multiplication instead of a simple bit test. This i

Re: [patch,avr] Skip some tests that don't work on avr

2024-12-14 Thread Jeff Law
On 12/3/24 7:45 AM, Georg-Johann Lay wrote: Am 03.12.24 um 15:36 schrieb Jeff Law: On 12/3/24 3:57 AM, Georg-Johann Lay wrote: This patch skips some tests that don't work on avr. Ok for trunk? Johann -- AVR: Skip some test cases that don't work for it. gcc/testsuite/  * gcc.c-tortu

Re: [patch,avr] Add new 24-bit address space __flashx

2024-12-12 Thread Denis Chertykov
ср, 11 дек. 2024 г. в 16:56, Georg-Johann Lay : > > This patch adds __flashx as a new named address space that allocates > objects in .progmemx.data. The handling is mostly the same or similar > to that of 24-bit space __memx, except that the output routines are > simpler and more efficient. Load

[patch,avr] Add new 24-bit address space __flashx

2024-12-11 Thread Georg-Johann Lay
This patch adds __flashx as a new named address space that allocates objects in .progmemx.data. The handling is mostly the same or similar to that of 24-bit space __memx, except that the output routines are simpler and more efficient. Loads are emit inline when ELPMX or LPMX is available. The a

Re: [patch, avr] Assert minimal required bit width of section_common::flags.

2024-12-08 Thread Denis Chertykov
сб, 7 дек. 2024 г. в 17:39, Georg-Johann Lay : > > ...the patch > > Am 07.12.24 um 14:36 schrieb Georg-Johann Lay: > > This patch implements an alarm should we ever run out of > > section flags bits. > > > > Ok for trunk? Ok. Denis

Re: [patch,avr] Disable CRC lookup tables

2024-12-07 Thread Georg-Johann Lay
Am 07.12.24 um 02:03 schrieb Oleg Endo: On Fri, 2024-12-06 at 16:51 +0100, Georg-Johann Lay wrote: The CRC tables ARE put into .rodata, not into .data. The correct question is: Why is avr putting .rodata into RAM? Suppose the following C code: char read_c (const char *p) { return p[1]

Re: [patch,avr] Assert minimal required bit width of section_common::flags.

2024-12-07 Thread Georg-Johann Lay
...the patch Am 07.12.24 um 14:36 schrieb Georg-Johann Lay: This patch implements an alarm should we ever run out of section flags bits. Ok for trunk? Johann -- AVR: Assert minimal required bit width of section_common::flags. gcc/ * config/avr/avr.cc (avr_ctz): New constexpr function.

[patch,avr] Assert minimal required bit width of section_common::flags.

2024-12-07 Thread Georg-Johann Lay
This patch implements an alarm should we ever run out of section flags bits. Ok for trunk? Johann -- AVR: Assert minimal required bit width of section_common::flags. gcc/ * config/avr/avr.cc (avr_ctz): New constexpr function. (section_common::flags): Assert minimal bit width.

Re: [patch,avr] Disable CRC lookup tables

2024-12-06 Thread Oleg Endo
On Fri, 2024-12-06 at 16:51 +0100, Georg-Johann Lay wrote: > > The CRC tables ARE put into .rodata, not into .data. > > The correct question is: Why is avr putting .rodata into RAM? > > Suppose the following C code: > > char read_c (const char *p) > { > return p[1]; > } > > Where p may

Re: [patch,avr] Disable CRC lookup tables

2024-12-06 Thread Georg-Johann Lay
Am 06.12.24 um 15:50 schrieb Oleg Endo: On Fri, 2024-12-06 at 06:32 -0700, Jeff Law wrote: On 12/6/24 5:23 AM, Sam James wrote: Georg-Johann Lay writes: This patch disables CRC lookup tables which consume quite some RAM. Given that -foptimize-crc is new, it may be useful to CC the pass au

Re: [patch,avr] Disable CRC lookup tables

2024-12-06 Thread Oleg Endo
On Fri, 2024-12-06 at 06:32 -0700, Jeff Law wrote: > > On 12/6/24 5:23 AM, Sam James wrote: > > Georg-Johann Lay writes: > > > > > This patch disables CRC lookup tables which consume quite some RAM. > > > > Given that -foptimize-crc is new, it may be useful to CC the pass > > authors in case th

Re: [patch,avr] Disable CRC lookup tables

2024-12-06 Thread Georg-Johann Lay
Am 06.12.24 um 14:53 schrieb Richard Biener: On Fri, Dec 6, 2024 at 2:17 PM Georg-Johann Lay wrote: Am 06.12.24 um 13:23 schrieb Sam James: Georg-Johann Lay writes: This patch disables CRC lookup tables which consume quite some RAM. Given that -foptimize-crc is new, it may be useful to C

Re: [patch,avr] Disable CRC lookup tables

2024-12-06 Thread Sam James
Georg-Johann Lay writes: > Am 06.12.24 um 13:23 schrieb Sam James: >> Georg-Johann Lay writes: >> >>> This patch disables CRC lookup tables which consume quite some RAM. >> Given that -foptimize-crc is new, it may be useful to CC the pass >> authors in case they have input. > > CCing Mariam Aru

Re: [patch,avr] Disable CRC lookup tables

2024-12-06 Thread Richard Biener
On Fri, Dec 6, 2024 at 2:17 PM Georg-Johann Lay wrote: > > Am 06.12.24 um 13:23 schrieb Sam James: > > Georg-Johann Lay writes: > > > >> This patch disables CRC lookup tables which consume quite some RAM. > > > > Given that -foptimize-crc is new, it may be useful to CC the pass > > authors in cas

Re: [patch,avr] Disable CRC lookup tables

2024-12-06 Thread Jeff Law
On 12/6/24 5:23 AM, Sam James wrote: Georg-Johann Lay writes: This patch disables CRC lookup tables which consume quite some RAM. Given that -foptimize-crc is new, it may be useful to CC the pass authors in case they have input. I think this is trivially OK for the AVR. The bigger questi

Re: [patch,avr] Disable CRC lookup tables

2024-12-06 Thread Georg-Johann Lay
Am 06.12.24 um 13:23 schrieb Sam James: Georg-Johann Lay writes: This patch disables CRC lookup tables which consume quite some RAM. Given that -foptimize-crc is new, it may be useful to CC the pass authors in case they have input. CCing Mariam Arutunian Ok for trunk? Johann The probl

Re: [patch,avr] Disable CRC lookup tables

2024-12-06 Thread Sam James
Georg-Johann Lay writes: > This patch disables CRC lookup tables which consume quite some RAM. Given that -foptimize-crc is new, it may be useful to CC the pass authors in case they have input. > > Ok for trunk? > > Johann

[patch,avr] Disable CRC lookup tables

2024-12-06 Thread Georg-Johann Lay
This patch disables CRC lookup tables which consume quite some RAM. Ok for trunk? Johann -- AVR: Disable generation of CRC lookup tables. With -foptimize-crc, large lookup tables may be generated which are places in .rodata (RAM). This patch disables such tables. gcc/ * common/confi

Re: [patch,avr] PR107957 - Propagate zero_reg to store sources.

2024-12-05 Thread Denis Chertykov
чт, 5 дек. 2024 г. в 14:23, Georg-Johann Lay : > > This is an addendum to the -msplit-ldst patch. > > When -msplit-ldst is on, it may be possible to propagate __zero_reg__ > to the sources of the new stores. For example, without this patch, > > unsigned long lx; > > void store_lsr17 (void) > { >

[patch,avr] PR107957 - Propagate zero_reg to store sources.

2024-12-05 Thread Georg-Johann Lay
This is an addendum to the -msplit-ldst patch. When -msplit-ldst is on, it may be possible to propagate __zero_reg__ to the sources of the new stores. For example, without this patch, unsigned long lx; void store_lsr17 (void) { lx >>= 17; } compiles to: store_lsr17: lds r26,lx+2

Re: [patch, avr] Rework patterns that add / subtract an (inverted) MSB.

2024-12-05 Thread Denis Chertykov
ср, 4 дек. 2024 г. в 13:39, Georg-Johann Lay : > > This patch reworks patterns that add / subtract an (inverted) MSB. > It handles more cases by using mode iterators. > > Ok for trunk? > Please apply. Denis

Re: [patch,avr] PR64242: Fix failing nonlocal goto

2024-12-05 Thread Denis Chertykov
чт, 5 дек. 2024 г. в 00:07, Georg-Johann Lay : > > In nonlocal_goto sets, change hard_frame_pointer_rtx only after > emit_stack_restore() restored SP. This is needed because SP > my be stored in some frame location. > > The only change to test results is that gcc.c-torture/execute/pr64242.c > is p

Re: [patch,avr] PR107957 - Split multi-byte loads and stores.

2024-12-05 Thread Denis Chertykov
ср, 4 дек. 2024 г. в 20:16, Georg-Johann Lay : > > This patch splits multi-byte loads and stores into single-byte > ones provided: > > - New option -msplit-ldst is on (e.g. -O2 and higher), and > - The memory is non-volatile, and > - The address space is generic, and > - The split addresses are

[patch,avr,applied] ad PR84211: fix dump with undefined m_insn

2024-12-04 Thread Georg-Johann Lay
Applied the following patch that fixed an ICE when -fdump-rtl-avr-fuse-move is on, because when 2 insn have been combined into a single one, then m_insn is undefined. To date, m_insn is only used in dumps. Applied as obvious. Johann -- AVR: ad target/84211 - Fix dumping INSN_UID for null insn.

[patch,avr] PR64242: Fix failing nonlocal goto

2024-12-04 Thread Georg-Johann Lay
In nonlocal_goto sets, change hard_frame_pointer_rtx only after emit_stack_restore() restored SP. This is needed because SP my be stored in some frame location. The only change to test results is that gcc.c-torture/execute/pr64242.c is passing now. Ok to apply? Johann -- AVR: target/64242 -

[patch,avr] PR107957 - Split multi-byte loads and stores.

2024-12-04 Thread Georg-Johann Lay
This patch splits multi-byte loads and stores into single-byte ones provided: - New option -msplit-ldst is on (e.g. -O2 and higher), and - The memory is non-volatile, and - The address space is generic, and - The split addresses are natively supported by the hardware. Passes without regressi

[patch,avr] Rework patterns that add / subtract an (inverted) MSB.

2024-12-04 Thread Georg-Johann Lay
This patch reworks patterns that add / subtract an (inverted) MSB. It handles more cases by using mode iterators. Ok for trunk? Johann -- AVR: Rework patterns that add / subtract an (inverted) MSB. gcc/ * config/avr/avr-protos.h (avr_out_add_msb): New proto. * config/avr/avr.c

Re: [patch,avr] Improve location of late diagnostics

2024-12-03 Thread Denis Chertykov
вт, 3 дек. 2024 г. в 17:32, Georg-Johann Lay : > > Some diagnostics are issues late, e.g. in avr_print_operand(). > This patch uses the insn's location as a proxy for the operand > location. Without the patch, the location is usually input_location, > which points to the closing } of the function

[patch, avr, applied] ad PR117726: Also split logic shifts of bitsize - 1

2024-12-03 Thread Georg-Johann Lay
Applied the patch below which also splits logic shifts with an offset of bitsize - 1 into byte operations. Johann -- AVR: ad target/117726 - Also split logic shifts of bitsize - 1. When -msplit-bit-shift is on, also split logic shifts of bitsize(mode) - 1. gcc/ PR target/117726

Re: [patch,avr] Skip some tests that don't work on avr

2024-12-03 Thread Georg-Johann Lay
Am 03.12.24 um 15:36 schrieb Jeff Law: On 12/3/24 3:57 AM, Georg-Johann Lay wrote: This patch skips some tests that don't work on avr. Ok for trunk? Johann -- AVR: Skip some test cases that don't work for it. gcc/testsuite/  * gcc.c-torture/execute/ieee/cdivchkd.x: New file.  * gcc

Re: [patch,avr] Skip some tests that don't work on avr

2024-12-03 Thread Jeff Law
On 12/3/24 3:57 AM, Georg-Johann Lay wrote: This patch skips some tests that don't work on avr. Ok for trunk? Johann -- AVR: Skip some test cases that don't work for it. gcc/testsuite/ * gcc.c-torture/execute/ieee/cdivchkd.x: New file. * gcc.c-torture/execute/ieee/cdivchkf.x: Ne

[patch,avr] Improve location of late diagnostics

2024-12-03 Thread Georg-Johann Lay
Some diagnostics are issues late, e.g. in avr_print_operand(). This patch uses the insn's location as a proxy for the operand location. Without the patch, the location is usually input_location, which points to the closing } of the function body. Ok for trunk? Johan -- AVR: Improve location o

[patch,avr] Skip some tests that don't work on avr

2024-12-03 Thread Georg-Johann Lay
This patch skips some tests that don't work on avr. Ok for trunk? Johann -- AVR: Skip some test cases that don't work for it. gcc/testsuite/ * gcc.c-torture/execute/ieee/cdivchkd.x: New file. * gcc.c-torture/execute/ieee/cdivchkf.x: New file. * gcc.dg/flex-array-counte

Re: [patch,avr] ad PR117726: Improve logic 8-bit shifts with an offset of 6

2024-12-02 Thread Denis Chertykov
пн, 2 дек. 2024 г. в 15:29, Georg-Johann Lay : > > Logic 8-bit shifts with an offset of 6 can be improved by > supporting them as 3-operand operations. > > Ok for trunk? > Ok. Please apply. Denis.

Re: [patch,avr,testsuite,applied] gcc.c-torture/execute/memcpy-a*.c

2024-12-02 Thread Maciej W. Rozycki
On Sun, 1 Dec 2024, Georg-Johann Lay wrote: > > > > As a matter of interest, is the timeout/memory exhaustion observed with > > > > host compilation or target execution? > > > It happens during link, when the linker observes that the memory regions > > > won't fit: > > > > > > .../avr/bin/ld: mem

[patch, avr] ad PR117726: Improve logic 8-bit shifts with an offset of 6

2024-12-02 Thread Georg-Johann Lay
Logic 8-bit shifts with an offset of 6 can be improved by supporting them as 3-operand operations. Ok for trunk? Johann -- AVR: Tweak uin8_t << 6 and uint8_t >> 6 shifts. Logic 8-bit shifts with an offset of 6 can be improved by supporting them as 3-operand operations. PR target/1177

Re: [patch,avr,testsuite,applied] gcc.c-torture/execute/memcpy-a*.c

2024-12-01 Thread Georg-Johann Lay
Am 01.12.24 um 19:15 schrieb Dimitar Dimitrov: On Sun, Dec 01, 2024 at 12:32:55PM +0100, Georg-Johann Lay wrote: Am 01.12.24 um 05:45 schrieb Maciej W. Rozycki: On Sat, 30 Nov 2024, Georg-Johann Lay wrote: The gcc.c-torture/execute/memcpy-a[1248].c tests consumed more time than the whole rest

Re: [patch,avr,testsuite,applied] gcc.c-torture/execute/memcpy-a*.c

2024-12-01 Thread Dimitar Dimitrov
On Sun, Dec 01, 2024 at 12:32:55PM +0100, Georg-Johann Lay wrote: > Am 01.12.24 um 05:45 schrieb Maciej W. Rozycki: > > On Sat, 30 Nov 2024, Georg-Johann Lay wrote: > > > > > The gcc.c-torture/execute/memcpy-a[1248].c tests consumed more time > > > than the whole rest of the test suite, just to co

Re: [patch,avr,testsuite,applied] gcc.c-torture/execute/memcpy-a*.c

2024-12-01 Thread Georg-Johann Lay
Am 01.12.24 um 05:45 schrieb Maciej W. Rozycki: On Sat, 30 Nov 2024, Georg-Johann Lay wrote: The gcc.c-torture/execute/memcpy-a[1248].c tests consumed more time than the whole rest of the test suite, just to come up with a "memory full" even at -Os. Skipped thusly. As a matter of interest, i

Re: [patch,avr,testsuite,applied] gcc.c-torture/execute/memcpy-a*.c

2024-11-30 Thread Maciej W. Rozycki
On Sat, 30 Nov 2024, Georg-Johann Lay wrote: > The gcc.c-torture/execute/memcpy-a[1248].c tests consumed more time > than the whole rest of the test suite, just to come up with > a "memory full" even at -Os. Skipped thusly. As a matter of interest, is the timeout/memory exhaustion observed with

[patch, avr] ad PR84211: Prefer split into reg-reg move over reg-const move

2024-11-30 Thread Georg-Johann Lay
When splitting multi-byte REG-REG moves in try_split_any(), it's not clear whether propagating constants will turn out as profitable. When MOVW is available, split into REG-REG moves instead of a possible REG-CONST. Johann -- AVR: ad target/84211 - Split MOVW into MOVs in try_split_any.

[patch,avr,applied] Fix some coding rule nits

2024-11-30 Thread Georg-Johann Lay
This patch fixed some unrelated coding rule nits. Johann -- AVR: Fix some coding rule nits and typos. gcc/ * config/avr/avr-c.cc: Fix some coding rule nits and typos. * config/avr/avr-passes.cc: Same * config/avr/avr.h: Same. * config/avr/avr.cc: Same. (

Re: [patch,avr] PR117726: Post-reload split 2-byte and 3-byte shifts

2024-11-29 Thread Denis Chertykov
пт, 29 нояб. 2024 г. в 21:07, Georg-Johann Lay : > > This patch splits 2-byte and 3-byte shifts after reload into > a 3-operand byte shift and a residual 2-operand shift. > > The "2op" shift insn alternatives are not needed and removed because > all shift insn already have a "r,0,n" alternative tha

Re: [patch,avr] Fix PR11768 build warning for libgcc/unwind-sjlj.c

2024-11-29 Thread Denis Chertykov
пт, 29 нояб. 2024 г. в 21:33, Georg-Johann Lay : > > This patch fixes a build warning for libgcc/unwind-sjlj.c > which used word_mode for _Unwind_Word but should use Pmode. > > Ok for trunk? Ok. Please apply. Denis. > > Johann > > -- > > AVR: target/117681 - Set UNWIND_WORD_MODE to Pmode. > > Th

[patch,avr] Fix PR117681 build warning for libgcc/unwind-sjlj.c

2024-11-29 Thread Georg-Johann Lay
This patch fixes a build warning for libgcc/unwind-sjlj.c which used word_mode for _Unwind_Word but should use Pmode. Ok for trunk? Johann -- AVR: target/117681 - Set UNWIND_WORD_MODE to Pmode. This patch fixes a build warning for libgcc/unwind-sjlj.c which used word_mode for _Unwind_Word but

[patch,avr] PR117726: Post-reload split 2-byte and 3-byte shifts

2024-11-29 Thread Georg-Johann Lay
This patch splits 2-byte and 3-byte shifts after reload into a 3-operand byte shift and a residual 2-operand shift. The "2op" shift insn alternatives are not needed and removed because all shift insn already have a "r,0,n" alternative that does the job. Ok for trunk? Johann -- AVR: target/11

Re: [patch,avr] Adjust comment headers

2024-11-25 Thread Gerald Pfeifer
On Mon, 18 Nov 2024, Georg-Johann Lay wrote: >> We also have >> >>AVR >>Manufacturer: Atmel >>> >> href="https://www.microchip.com/en-us/products/microcontrollers-and-microprocessors/8-bit-mcus/avr-mcus";>AVR >>documentation >> >> >> in https://gcc.gnu.org/readings.html .

[patch, avr, applied] Fix PR117744: Load partially clobbers address reg

2024-11-23 Thread Georg-Johann Lay
Applied as obvious. Johann -- AVR: target/117744 - Fix asm for partial clobber of address reg, gcc/ PR target/117744 * config/avr/avr.cc (out_movqi_r_mr): Fix code when a load only partially clobbers an address register due to changing the address register tempo

[patch,avr,applied]: Tabify avr-common.cc

2024-11-22 Thread Georg-Johann Lay
avr-common.cc used spaces for indentation instead of TABs. Applied as obvious. Johann -- AVR: Tabify avr-common.cc according to coding rules. gcc/ * common/config/avr/avr-common.cc: Tabify.AVR: Tabify avr-common.cc according to coding rules. gcc/ * common/config/avr/avr-common

  1   2   3   4   5   6   7   8   9   10   >