[COMMITTED] gcc: xtensa: fix salt/saltu version check

2023-10-28 Thread Max Filippov
gcc/ * config/xtensa/xtensa.h (TARGET_SALT): Change HW version from 26 (which corresponds to RF-2014.0) to 27 (which corresponds to RG-2015.0, the release where salt/saltu opcodes were introduced). --- gcc/config/xtensa/xtensa.h | 2 +- 1 file changed, 1 ins

[PATCH] gcc: xtensa: reorder movsi_internal patterns for better code generation during LRA

2024-03-14 Thread Max Filippov
After switching to LRA xtensa backend generates the following code for saving/loading registers: movi a9, 0x190 add a9, a9, sp s32i.n a3, a9, 0 instead of the shorter and more efficient s32i a3, a9, 0x190 E.g. the following code can be used to reproduce it: i

[PATCH] libgcc: arm: fix build for FDPIC target

2024-03-22 Thread Max Filippov
libgcc/ * unwind-arm-common.inc (__gnu_personality_sigframe_fdpic): Cast last argument of _Unwind_VRS_Set to void *. --- libgcc/unwind-arm-common.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libgcc/unwind-arm-common.inc b/libgcc/unwind-arm-common.inc inde

Re: [PATCH] xtensa: Add supplementary split pattern for "*addsubx"

2024-03-22 Thread Max Filippov
On Thu, Mar 21, 2024 at 4:36 PM Takayuki 'January June' Suwa wrote: > > int test(int a) { >return a * 4 + 3; > } > > In the example above, since Xtensa has instructions to add register value > scaled by 2, 4 or 8 (and corresponding define_insns), we would expect them > to be used but not,

Re: [PATCH] libgcc: arm: fix build for FDPIC target

2024-03-25 Thread Max Filippov
On Fri, Mar 22, 2024 at 1:15 PM Max Filippov wrote: > > libgcc/ > * unwind-arm-common.inc (__gnu_personality_sigframe_fdpic): Cast > last argument of _Unwind_VRS_Set to void *. > --- > libgcc/unwind-arm-common.inc | 2 +- > 1 file changed, 1 insertion(+),

Re: [PATCH 1/2] xtensa: Recover constant synthesis for HImode after LRA transition

2024-02-03 Thread Max Filippov
Hi Suwa-san, On Sat, Feb 3, 2024 at 6:20 AM Takayuki 'January June' Suwa wrote: > After LRA transition, HImode constants that don't fit into signed 12 bits > are no longer subject to constant synthesis: with this change I get multiple ICEs during libgomp, libgfortran and libstdc++ builds, e.g.:

Re: [PATCH 1/2 v2] xtensa: Recover constant synthesis for HImode after LRA transition

2024-02-04 Thread Max Filippov
On Sun, Feb 4, 2024 at 2:20 AM Takayuki 'January June' Suwa wrote: > > After LRA transition, HImode constants that don't fit into signed 12 bits > are no longer subject to constant synthesis: > > /* example */ > void test(void) { > short foo = 32767; > __asm__ ("" :: "r"(foo));

Re: [PATCH 2/2] xtensa: Fix missing mode warning in "*eqne_zero_masked_bits"

2024-02-04 Thread Max Filippov
On Sat, Feb 3, 2024 at 6:19 AM Takayuki 'January June' Suwa wrote: > > gcc/ChangeLog: > > * config/xtensa/xtensa.md (*eqne_zero_masked_bits): > Add missing ":SI" to the match_operator. > --- > gcc/config/xtensa/xtensa.md | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Reg

Re: [PATCH] xtensa: Make full transition to LRA

2024-01-23 Thread Max Filippov
Hi Suwa-san, I've finally processed the new issues introduced by this change. On Wed, May 10, 2023 at 2:10 AM Max Filippov wrote: > On Mon, May 8, 2023 at 6:38 AM Takayuki 'January June' Suwa > wrote: > > > > gcc/ChangeLog: > > > >

[PATCH v2] xtensa: Make full transition to LRA

2024-01-23 Thread Max Filippov
From: Takayuki 'January June' Suwa gcc/ChangeLog: * config/xtensa/constraints.md (R, T, U): Change define_constraint to define_memory_constraint. * config/xtensa/predicates.md (move_operand): Don't check that a constant pool operand size is a multiple of UNITS_PER

[COMMITTED] xtensa: Make full transition to LRA

2024-01-30 Thread Max Filippov
From: Takayuki 'January June' Suwa gcc/ChangeLog: * config/xtensa/constraints.md (R, T, U): Change define_constraint to define_memory_constraint. * config/xtensa/predicates.md (move_operand): Don't check that a constant pool operand size is a multiple of UNITS_PER

Re: [RFC 1/2] libbacktrace: add FDPIC support

2024-07-13 Thread Max Filippov
On Wed, Jul 10, 2024 at 12:49 PM Ian Lance Taylor wrote: > On Sun, May 26, 2024 at 11:51 PM Max Filippov wrote: > > diff --git a/libbacktrace/internal.h b/libbacktrace/internal.h > > index 4fa0af8cb6c9..456911166026 100644 > > --- a/libbacktrace/internal.h > > ++

Re: [RFC 1/2] libbacktrace: add FDPIC support

2024-07-15 Thread Max Filippov
On Mon, Jul 15, 2024 at 10:21:18AM -0700, Ian Lance Taylor wrote: > Can you see whether this patch works for FDPIC support? This is based > on your patch but has various changes. Thanks. Yes, it is working. -- Thanks. -- Max

[RFC 2/2] libstdc++-v3/src/libbacktrace: add -funwind-tables

2024-05-26 Thread Max Filippov
libstdc++-v3/ * src/libbacktrace/Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add -funwind-tables * src/libbacktrace/Makefile.in: Regenerate. --- libstdc++-v3/src/libbacktrace/Makefile.am | 4 ++-- libstdc++-v3/src/libbacktrace/Makefile.in | 4 ++-- 2 files changed, 4 insertions(

[RFC 0/2] libbacktrace: add FDPIC support

2024-05-26 Thread Max Filippov
bc. Adding -funwind-tables to the libstdc++ version of libbacktrace fixed that. Which makes me wonder how it works for other architectures? Max Filippov (2): libbacktrace: add FDPIC support libstdc++-v3/src/libbacktrace: add -funwind-tables libbacktrace/dwarf.c

[RFC 1/2] libbacktrace: add FDPIC support

2024-05-26 Thread Max Filippov
Instead of a single base address FDPIC ELF files use load map: a structure with an array of mappings for individual segments. Change libbacktrace functions and structures to support that. libbacktrace/ PR libbacktrace/114941 * dwarf.c: Include or if available. (struct d

Re: [RFC 0/2] libbacktrace: add FDPIC support

2024-05-27 Thread Max Filippov
On Mon, May 27, 2024 at 12:01 AM Rainer Orth wrote: > > This is an RFC series that adds FDPIC ELF target support to > > libbacktrace. > > > > While debugging this I've noticed that there's no unwinding info for the > > libstdc++ version of libbacktrace, which made backtraces empty for me, > > both

Re: [PATCH 1/2] xtensa: Use REG_P(), MEM_P(), etc. instead of comparing GET_CODE()

2024-05-30 Thread Max Filippov
On Thu, May 30, 2024 at 6:33 AM Takayuki 'January June' Suwa wrote: > > Instead of comparing directly, this patch replaces as much as possible with > macros that determine RTX code such as REG_P(), SUBREG_P() or MEM_P(), etc. > > gcc/ChangeLog: > > * config/xtensa/xtensa.cc (xtensa_valid_m

Re: [PATCH 2/2] xtensa: Use epilogue_completed rather than cfun->machine->epilogue_done

2024-05-30 Thread Max Filippov
On Thu, May 30, 2024 at 6:33 AM Takayuki 'January June' Suwa wrote: > > In commit ad89d820bf, an "epilogue_done" member was added to the > machine_function structure, but it is sufficient to use the existing > "epilogue_completed" global variable. > > gcc/ChangeLog: > > * config/xtensa/xte

Re: [PATCH 1/2] xtensa: Simplify several MD templates

2024-05-31 Thread Max Filippov
On Fri, May 31, 2024 at 07:23:13PM +0900, Takayuki 'January June' Suwa wrote: > No functional changes. > > gcc/ChangeLog: > > * config/xtensa/predicates.md > (subreg_HQI_lowpart_operator, xtensa_sminmax_operator): > New operator predicates. > * config/xtensa/xtensa-protos.

Re: [PATCH 2/2] xtensa: Prepend "(use A0_REG)" to sibling call CALL_INSN_FUNCTION_USAGE instead of emitting it as insn at the end of epilogue

2024-05-31 Thread Max Filippov
On Fri, May 31, 2024 at 07:24:48PM +0900, Takayuki 'January June' Suwa wrote: > No functional changes. > > gcc/ChangeLog: > > * config/xtensa/xtensa-protos.h (xtensa_expand_call): > Add the third argument as boolean. > (xtensa_expand_epilogue): Remove the first argument. >

Re: [RFC 1/2] libbacktrace: add FDPIC support

2024-06-11 Thread Max Filippov
On Sun, May 26, 2024 at 11:50 PM Max Filippov wrote: > > Instead of a single base address FDPIC ELF files use load map: a > structure with an array of mappings for individual segments. Change > libbacktrace functions and structures to support that. Ping? > libbacktrace/

Re: [PATCH] xtensa: constantsynth: Reforge to fix some non-fatal issues

2024-06-17 Thread Max Filippov
Hi Suwa-san, On Mon, Jun 17, 2024 at 04:17:15PM +0900, Takayuki 'January June' Suwa wrote: > The previous constant synthesis logic had some issues that were non-fatal > but worth considering: > > - It didn't work with DFmode literals, because those were cast to SImode > rather SFmode when split

Re: [PATCH v2] xtensa: constantsynth: Reforge to fix some non-fatal issues

2024-06-19 Thread Max Filippov
On Tue, Jun 18, 2024 at 7:56 PM Takayuki 'January June' Suwa wrote: > > The previous constant synthesis logic had some issues that were non-fatal > but worth considering: > > - It didn't work with DFmode literals, because those were cast to SImode >rather SFmode when splitting into two natural

Re: [PATCH] xtensa: Eliminate double MEMW insertions for volatile memory

2024-06-19 Thread Max Filippov
On Tue, Jun 18, 2024 at 10:00 PM Takayuki 'January June' Suwa wrote: > > This patch makes avoid inserting a MEMW instruction before a load/store > nstruction with volatile memory reference if there is already a MEMW > immediately before it. > > gcc/ChangeLog: > > * config/xtensa/xtensa.cc

[COMMITTED] gcc: xtensa: disable late-combine by default

2024-07-29 Thread Max Filippov
gcc/ * config/xtensa/xtensa.cc (xtensa_option_override_after_change): New function. (TARGET_OVERRIDE_OPTIONS_AFTER_CHANGE): Define as xtensa_option_override_after_change. (xtensa_option_override): Call xtensa_option_override_after_change. --- gcc/con

Re: [PATCH v2 2/3] xtensa: Make use of std::swap where appropriate

2024-07-29 Thread Max Filippov
On Sun, Jul 14, 2024 at 4:05 AM Takayuki 'January June' Suwa wrote: > > No functional changes. > > gcc/ChangeLog: > > * config/xtensa/xtensa.cc > (gen_int_relational, gen_float_relational): Replace tempvar-based > value-swapping codes with std::swap. > * config/xten

Re: [PATCH 3/3] xtensa: Make use of scaled [U]FLOAT/TRUNC.S instructions

2024-07-29 Thread Max Filippov
On Sun, Jul 14, 2024 at 4:05 AM Takayuki 'January June' Suwa wrote: > > [U]FLOAT.S machine instruction in Xtensa ISA, which converts an integer to > a hardware single-precision FP register, has the ability to divide the > result by power of two (0 to 15th). > > Similarly, [U]TRUNC.S instruction, w

Re: [PATCH v2 1/3] xtensa: Resurrect LEAF_REGISTERS and LEAF_REG_REMAP

2024-07-29 Thread Max Filippov
On Sun, Jul 14, 2024 at 4:05 AM Takayuki 'January June' Suwa wrote: > > They were once mistakenly removed with > "xtensa: Remove old broken tweak for leaf function", but caused unwanted > register spills. > > gcc/ChangeLog: > > * config/xtensa/xtensa.h (LEAF_REGISTERS, LEAF_REG_REMAP): >

Re: [PATCH] xtensa: Fix the regression introduce by abe81aa19f250516fd57f76cad9c0920cce221bc

2024-07-29 Thread Max Filippov
On Fri, Jul 19, 2024 at 1:35 PM Takayuki 'January June' Suwa wrote: > > It is not wrong but also not optimal to specify that sibcalls require > register A0 in RTX generation pass, by misleading DFA into thinking it > is being used in function body. > It would be better to specify it in pro_and_epi

Re: [PATCH 1/2] xtensa: Fix suboptimal loading of pooled constant value into hardware single-precision FP register

2024-07-29 Thread Max Filippov
On Tue, Jul 23, 2024 at 5:52 PM Takayuki 'January June' Suwa wrote: > > We would like to implement the following to store a single-precision FP > constant in a hardware FP register: > > - Load the bit-exact integer image of the pooled single-precision FP >constant into an address (integer) reg

Re: [PATCH 2/2] xtensa: Add missing speed cost for TYPE_FARITH in TARGET_INSN_COST

2024-07-29 Thread Max Filippov
On Tue, Jul 23, 2024 at 5:52 PM Takayuki 'January June' Suwa wrote: > > According to the implemented pipeline model, this cost can be assumed to be > 1 clock cycle. > > gcc/ChangeLog: > > * config/xtensa/xtensa.cc (xtensa_insn_cost): > Add a case statement for TYPE_FARITH. Regtest

[PATCH] xtensa: fix libgcc build with --text-section-literals

2016-02-16 Thread Max Filippov
Functions __muldf3_aux, __divdf3_aux, __mulsf3_aux and __divsf3_aux don't start with leaf_entry, so they need explicit .literal_position, otherwise libgcc build fails in the presence of --text-section-literals. 2016-02-17 Max Filippov libgcc/ * config/xtensa/ieee754-df.S (__muldf

Re: [PATCH] xtensa: fix libgcc build with --text-section-literals

2016-02-17 Thread Max Filippov
On Wed, Feb 17, 2016 at 10:59 PM, augustine.sterl...@gmail.com wrote: > On Tue, Feb 16, 2016 at 4:35 PM, Max Filippov wrote: >> Functions __muldf3_aux, __divdf3_aux, __mulsf3_aux and __divsf3_aux >> don't start with leaf_entry, so they need explicit .literal_position, >&

Re: [PATCH 1/2] xtensa: fix TLS calls for call0 ABI

2015-09-15 Thread Max Filippov
On Tue, Sep 15, 2015 at 9:21 PM, augustine.sterl...@gmail.com wrote: > On Tue, Sep 15, 2015 at 3:00 AM, Max Filippov wrote: >> 2015-09-15 Max Filippov >> gcc/ >> * config/xtensa/xtensa.c (xtensa_call_tls_desc): Use a10 or a2 >> to pass TLS call arg

[PATCH] xtensa: add uclinux support

2015-09-30 Thread Max Filippov
2015-09-30 Max Filippov gcc/ * config.gcc (xtensa*-*-uclinux*): New configuration. * config/xtensa/uclinux.h: New file. * config/xtensa/uclinux.opt: New file. libgcc/ * config.host (xtensa*-*-uclinux*): New configuration. --- gcc/config.gcc| 5

Re: [PATCH] xtensa: add uclinux support

2015-10-03 Thread Max Filippov
On Sat, Oct 3, 2015 at 6:19 PM, augustine.sterl...@gmail.com wrote: > On Wed, Sep 30, 2015 at 8:23 AM, Max Filippov wrote: >> 2015-09-30 Max Filippov >> gcc/ >> * config.gcc (xtensa*-*-uclinux*): New configuration. >> * config/xtensa/uclinux.h: Ne

[PATCH] xtensa: fix PR target/91880

2019-09-24 Thread Max Filippov
Xtensa hwloop_optimize segfaults when zero overhead loop is about to be inserted as the first instruction of the function. Insert zero overhead loop instruction into new basic block before the loop when basic block that precedes the loop is empty. 2019-09-24 Max Filippov gcc/ * config

Re: [PATCH] xtensa: fix PR target/91880

2019-09-26 Thread Max Filippov
On Thu, Sep 26, 2019 at 1:42 PM augustine.sterl...@gmail.com wrote: > > On Tue, Sep 24, 2019 at 5:41 PM Max Filippov wrote: > > > > Xtensa hwloop_optimize segfaults when zero overhead loop is about to be > > inserted as the first instruction of the function. >

[PATCH] gcc: xtensa: fix NAND code in xtensa_expand_atomic

2018-09-04 Thread Max Filippov
NAND is ~(a1 & a2), but xtensa_expand_atomic does ~a1 & a2. That fixes libatomic tests atomic-op-{1,2}. gcc/ 2018-09-04 Max Filippov * config/xtensa/xtensa.c (xtensa_expand_atomic): Reorder AND and XOR operations in NAND case. --- gcc/config/xtensa/xtensa.c | 6 +++---

[PATCH v2] gcc: xtensa: fix NAND code in xtensa_expand_atomic

2018-09-04 Thread Max Filippov
NAND is ~(a1 & a2), but xtensa_expand_atomic does ~a1 & a2. That fixes libatomic tests atomic-op-{1,2}. gcc/ 2018-09-04 Max Filippov * config/xtensa/xtensa.c (xtensa_expand_atomic): Reorder AND and XOR operations in NAND case. --- Changes v1->v2: - put final inver

Re: [PATCH v2] gcc: xtensa: fix NAND code in xtensa_expand_atomic

2018-09-04 Thread Max Filippov
On Tue, Sep 4, 2018 at 10:35 AM, augustine.sterl...@gmail.com wrote: > On Tue, Sep 4, 2018 at 9:42 AM Max Filippov wrote: >> >> NAND is ~(a1 & a2), but xtensa_expand_atomic does ~a1 & a2. >> That fixes libatomic tests atomic-op-{1,2}. >>

Re: [RFC 1/5] gcc: xtensa: allow XCHAL_* macros to be non-constant

2017-06-14 Thread Max Filippov
On Thu, May 25, 2017 at 11:15 AM, augustine.sterl...@gmail.com wrote: > On Mon, May 22, 2017 at 2:09 PM, Max Filippov wrote: >> XCHAL_* macros from the xtensa-config.h are used in a number of places >> that require them to be preprocessor constants. Rewrite these places so >&

[PATCH] gcc: xtensa: enable address sanitizer

2017-12-04 Thread Max Filippov
gcc/ 2017-12-04 Max Filippov * config/xtensa/xtensa.c (xtensa_asan_shadow_offset): New function. (TARGET_ASAN_SHADOW_OFFSET): New macro definition. * config/xtensa/xtensa.h (FRAME_GROWS_DOWNWARD): Set to 1 if ASAN is enabled. --- gcc/config/xtensa

Re: [PATCH] gcc: xtensa: enable address sanitizer

2017-12-04 Thread Max Filippov
On Mon, Dec 4, 2017 at 1:31 PM, Jakub Jelinek wrote: > On Mon, Dec 04, 2017 at 01:28:53PM -0800, Max Filippov wrote: >> gcc/ >> 2017-12-04 Max Filippov >> >> * config/xtensa/xtensa.c (xtensa_asan_shadow_offset): New >> function. >>

Re: [PATCH] gcc: xtensa: enable address sanitizer

2017-12-05 Thread Max Filippov
On Mon, Dec 4, 2017 at 9:37 PM, augustine.sterl...@gmail.com wrote: > On Mon, Dec 4, 2017 at 1:28 PM, Max Filippov wrote: >> gcc/ >> 2017-12-04 Max Filippov >> >> * config/xtensa/xtensa.c (xtensa_asan_shadow_offset): New >> function. >>

[PATCH] xtensa: fix PR target/65416

2018-06-18 Thread Max Filippov
on movsp. Implement allocate_stack pattern for windowed ABI configuration and insert an instruction that prevents reordering of frame memory access and stack pointer update. gcc/ 2018-06-17 Max Filippov * config/xtensa/xtensa.md (UNSPEC_FRAME_BLOCKAGE): New unspec constant

Re: [PATCH] xtensa: fix PR target/65416

2018-06-19 Thread Max Filippov
On Tue, Jun 19, 2018 at 10:11 AM, augustine.sterl...@gmail.com wrote: > On Mon, Jun 18, 2018 at 3:10 PM, Max Filippov wrote: >> >> gcc/ >> 2018-06-17 Max Filippov >> >> * config/xtensa/xtensa.md (UNSPEC_FRAME_BLOCKAGE): New unspec >>

[PATCH] libgcc: xtensa: fix NaN return from add/sub/mul/div helpers

2018-01-23 Thread Max Filippov
libgcc/ 2018-01-22 Max Filippov * config/xtensa/ieee754-df.S (__addsf3, __subsf3, __mulsf3) (__divsf3): Make NaN return value quiet. * config/xtensa/ieee754-sf.S (__adddf3, __subdf3, __muldf3) (__divdf3): Make NaN return value quiet. --- libgcc/config/xtensa

Re: [PATCH] libgcc: xtensa: fix NaN return from add/sub/mul/div helpers

2018-01-23 Thread Max Filippov
On Tue, Jan 23, 2018 at 1:07 PM, augustine.sterl...@gmail.com wrote: > On Tue, Jan 23, 2018 at 9:55 AM, Max Filippov wrote: >> libgcc/ >> 2018-01-22 Max Filippov >> >> * config/xtensa/ieee754-df.S (__addsf3, __subsf3, __mulsf3) >> (__div

[PATCH] libgcc: xtensa: fix build with -mtext-section-literals

2018-01-30 Thread Max Filippov
libgcc/ 2018-01-31 Max Filippov * config/xtensa/ieee754-df.S (__adddf3_aux): Add .literal_position directive. * config/xtensa/ieee754-sf.S (__addsf3_aux): Likewise. --- libgcc/config/xtensa/ieee754-df.S | 1 + libgcc/config/xtensa/ieee754-sf.S | 1 + 2 files changed, 2

Re: [PATCH] libgcc: xtensa: fix build with -mtext-section-literals

2018-01-31 Thread Max Filippov
On Wed, Jan 31, 2018 at 11:11 AM, augustine.sterl...@gmail.com wrote: > On Tue, Jan 30, 2018 at 8:02 PM, Max Filippov wrote: >> >> libgcc/ >> 2018-01-31 Max Filippov >> >> * config/xtensa/ieee754-df.S (__adddf3_aux): Add >> .literal_

Re: [PATCH] libgcc: xtensa: fix build with -mtext-section-literals

2018-02-01 Thread Max Filippov
Hi Sterling, On Wed, Jan 31, 2018 at 11:17 AM, Max Filippov wrote: > On Wed, Jan 31, 2018 at 11:11 AM, augustine.sterl...@gmail.com > wrote: >> On Tue, Jan 30, 2018 at 8:02 PM, Max Filippov wrote: >>> >>> libgcc/ >>> 2018-01-31 Max Filippov >&

Re: [PATCH] libgcc: xtensa: fix build with -mtext-section-literals

2018-02-07 Thread Max Filippov
On Thu, Feb 1, 2018 at 9:12 AM, Max Filippov wrote: > On Wed, Jan 31, 2018 at 11:17 AM, Max Filippov wrote: >> On Wed, Jan 31, 2018 at 11:11 AM, augustine.sterl...@gmail.com >> wrote: >>> On Tue, Jan 30, 2018 at 8:02 PM, Max Filippov wrote: >>>> >&g

Re: [PATCH] libgcc: xtensa: fix build with -mtext-section-literals

2018-02-20 Thread Max Filippov
On Wed, Feb 7, 2018 at 2:10 PM, Max Filippov wrote: > On Thu, Feb 1, 2018 at 9:12 AM, Max Filippov wrote: >> On Wed, Jan 31, 2018 at 11:17 AM, Max Filippov wrote: >>> On Wed, Jan 31, 2018 at 11:11 AM, augustine.sterl...@gmail.com >>> wrote: >>>> On Tue

[PATCH 2/2] xtensa: use pre- and postincrement FP load/store when available

2014-10-12 Thread Max Filippov
Earlier versions of xtensa FPU used to support preincrement FP load and store instructions (lsiu/ssiu). Recent FPU supports postincrement FP load and store instructions only (lsip/ssip). Use configuration macro to decide which version is available. 2014-10-10 Max Filippov gcc/ * config

[PATCH 0/2] xtensa: fix floating-point parts of machine description

2014-10-12 Thread Max Filippov
modern xtensa cores with FPU. Tested on xtensa-linux-uclibc. Max Filippov (2): xtensa: drop unimplemented floating point operations xtensa: use pre- and postincrement FP load/store when available gcc/config/xtensa/xtensa.h | 4 +++ gcc/config/xtensa/xtensa.md | 80

[PATCH 1/2] xtensa: drop unimplemented floating point operations

2014-10-12 Thread Max Filippov
xtensa ISA never implemented FP division, reciprocal, square root and inverse square root as single opcode. Remove patterns that can emit them. 2014-10-09 Max Filippov gcc/ * config/xtensa/xtensa.md (divsf3, *recipsf2, sqrtsf2, *rsqrtsf2): remove. --- gcc/config/xtensa/xtensa.md | 44

Re: [PATCH 0/2] xtensa: fix floating-point parts of machine description

2014-10-13 Thread Max Filippov
On Mon, Oct 13, 2014 at 8:03 PM, augustine.sterl...@gmail.com wrote: > On Sun, Oct 12, 2014 at 3:46 PM, Max Filippov wrote: >> Hi Sterling, >> >> this series fixes two bugs in xtensa.md: > > HI Max, thanks for this. I don't see a patch though. It's a c

Re: [PATCH 2/2] xtensa: use pre- and postincrement FP load/store when available

2014-10-13 Thread Max Filippov
On Mon, Oct 13, 2014 at 8:04 PM, augustine.sterl...@gmail.com wrote: > On Sun, Oct 12, 2014 at 3:46 PM, Max Filippov wrote: >> 2014-10-10 Max Filippov >> >> gcc/ >> * config/xtensa/xtensa.h (TARGET_HARD_FLOAT_POSTINC): new macro. >> * config/xte

Re: [PATCH 1/2] xtensa: drop unimplemented floating point operations

2014-10-14 Thread Max Filippov
On Mon, Oct 13, 2014 at 8:05 PM, augustine.sterl...@gmail.com wrote: > On Sun, Oct 12, 2014 at 3:46 PM, Max Filippov wrote: >> xtensa ISA never implemented FP division, reciprocal, square root and >> inverse square root as single opcode. Remove patterns that can emit >> t

Re: [PATCH 2/2] xtensa: use pre- and postincrement FP load/store when available

2014-10-14 Thread Max Filippov
On Mon, Oct 13, 2014 at 8:04 PM, augustine.sterl...@gmail.com wrote: > On Sun, Oct 12, 2014 at 3:46 PM, Max Filippov wrote: >> 2014-10-10 Max Filippov >> >> gcc/ >> * config/xtensa/xtensa.h (TARGET_HARD_FLOAT_POSTINC): new macro. >> * config/xte

[committed] MAINTAINERS: add myself to write-after-approval list.

2014-10-14 Thread Max Filippov
2014-10-15 Max Filippov * MAINTAINERS (write-after-approval): Add myself. Index: MAINTAINERS === --- MAINTAINERS (revision 216231) +++ MAINTAINERS (revision 216232) @@ -380,6 +380,7 @@ Chris Fairles

[PATCH] Fix PR target/65730

2015-05-19 Thread Max Filippov
2015-05-20 Max Filippov gcc/ * config/xtensa/xtensa.c (init_alignment_context): Replace MULT by BITS_PER_UNIT with ASHIFT by exact_log2 (BITS_PER_UNIT). --- gcc/config/xtensa/xtensa.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gcc/config/xtensa

Re: [PATCH] Fix PR target/65730

2015-05-20 Thread Max Filippov
On Wed, May 20, 2015 at 7:36 PM, augustine.sterl...@gmail.com wrote: > On Tue, May 19, 2015 at 8:31 PM, Max Filippov wrote: >> 2015-05-20 Max Filippov >> gcc/ >> * config/xtensa/xtensa.c (init_alignment_context): Replace MULT >> by BITS_PER_UNI

Re: [PATCH] xtensa: align data naturally when optimizing for size

2015-02-23 Thread Max Filippov
On Tue, Feb 24, 2015 at 2:30 AM, augustine.sterl...@gmail.com wrote: > On Sat, Feb 21, 2015 at 4:19 PM, Max Filippov wrote: >> >> gcc for xtensa always aligns data at least to a word boundary, even when >> it has smaller natural alignment. This results in unexpectedly high

Re: [PATCH] gcc/reload.c: Initialize several arrays before use them in find_reloads()

2015-02-24 Thread Max Filippov
Hi, On Tue, Feb 24, 2015 at 6:54 PM, Jeff Law wrote: > > You can tackle them in any order you wish. However, I suspect fixing the > xtensa backend may be easier. I don't have any good way to test xtensa, but > something like the attached patch for the xtensa port should be sufficient. I can co

Re: [PATCH] gcc/reload.c: Initialize several arrays before use them in find_reloads()

2015-02-24 Thread Max Filippov
Sterling, On Wed, Feb 25, 2015 at 2:36 AM, augustine.sterl...@gmail.com wrote: > On Tue, Feb 24, 2015 at 2:05 PM, Max Filippov wrote: >> On Tue, Feb 24, 2015 at 6:54 PM, Jeff Law wrote: >>> You can tackle them in any order you wish. However, I suspect fixing the >>

[RFC 0/2] xtensa: add call0 ABI support

2015-02-28 Thread Max Filippov
Hello, this series adds call0 ABI support for xtensa. Code generation part is well tested, but I'm not 100% sure about the exception handling part. Please review. Max Filippov (2): Turn RETURN_ADDR_IN_PREVIOUS_FRAME into C expression Implement call0 ABI for xtensa gcc/built

[RFC 1/2] Turn RETURN_ADDR_IN_PREVIOUS_FRAME into C expression

2015-02-28 Thread Max Filippov
This allows a target to support both windowed and non-windowed ABI. 2015-02-28 Max Filippov gcc/ * builtins.c (expand_builtin_return_addr): Add RETURN_ADDR_IN_PREVIOUS_FRAME to 'if' condition. * config/sparc/sparc.h (RETURN_ADDR_IN_PREVIOUS_FRAM

[RFC 2/2] Implement call0 ABI for xtensa

2015-02-28 Thread Max Filippov
call0 is an ABI that doesn't use register windows. 2015-02-28 Max Filippov gcc/ * config/xtensa/constraints.md ("a" constraint): Include stack pointer in case of call0 ABI. ("q" constraint): Make empty in case of call0 ABI. ("

Re: [RFC 1/2] Turn RETURN_ADDR_IN_PREVIOUS_FRAME into C expression

2015-02-28 Thread Max Filippov
On Sun, Mar 1, 2015 at 8:34 AM, augustine.sterl...@gmail.com wrote: > On Sat, Feb 28, 2015 at 10:14 AM, Max Filippov wrote: >> This allows a target to support both windowed and non-windowed ABI. >> >> 2015-02-28 Max Filippov >> >> gcc/ >> * built

Re: [RFC 1/2] Turn RETURN_ADDR_IN_PREVIOUS_FRAME into C expression

2015-02-28 Thread Max Filippov
Richard, David, Eric, could you please take a look and possibly approve the below changes for sparc? On Sat, Feb 28, 2015 at 9:14 PM, Max Filippov wrote: > This allows a target to support both windowed and non-windowed ABI. > > 2015-02-28 Max Filippov > > gcc/ >

Re: [RFC 1/2] Turn RETURN_ADDR_IN_PREVIOUS_FRAME into C expression

2015-03-01 Thread Max Filippov
On Mon, Mar 2, 2015 at 1:07 AM, Joseph Myers wrote: > > On Sat, 28 Feb 2015, Max Filippov wrote: > > > This allows a target to support both windowed and non-windowed ABI. > > > > 2015-02-28 Max Filippov > > > > gcc/ > > *

[PATCH] Turn RETURN_ADDR_IN_PREVIOUS_FRAME into C expression

2015-03-02 Thread Max Filippov
This allows a target to support both windowed and non-windowed ABI. 2015-03-03 Max Filippov gcc/ * builtins.c (expand_builtin_return_addr): Add RETURN_ADDR_IN_PREVIOUS_FRAME to 'if' condition, remove surrounding #ifdef. * config/spa

Re: [PATCH] Turn RETURN_ADDR_IN_PREVIOUS_FRAME into C expression

2015-03-03 Thread Max Filippov
On Tue, Mar 3, 2015 at 5:51 PM, Richard Henderson wrote: > On 03/02/2015 10:42 PM, Max Filippov wrote: >> gcc/ >> * builtins.c (expand_builtin_return_addr): Add >> RETURN_ADDR_IN_PREVIOUS_FRAME to 'if' condition, remove >> surrounding #i

Re: [PATCH] Turn RETURN_ADDR_IN_PREVIOUS_FRAME into C expression

2015-03-03 Thread Max Filippov
On Tue, Mar 3, 2015 at 6:52 PM, H.J. Lu wrote: > On Tue, Mar 3, 2015 at 7:05 AM, Max Filippov wrote: >> On Tue, Mar 3, 2015 at 5:51 PM, Richard Henderson wrote: >>> On 03/02/2015 10:42 PM, Max Filippov wrote: >>>> gcc/ >>>> * bu

Re: [RFC 2/2] Implement call0 ABI for xtensa

2015-03-03 Thread Max Filippov
On Tue, Mar 3, 2015 at 7:13 PM, augustine.sterl...@gmail.com wrote: > On Sat, Feb 28, 2015 at 10:14 AM, Max Filippov wrote: >> call0 is an ABI that doesn't use register windows. > > This is OK for xtensa. Applied to trunk. Thanks! -- Max

[PATCH] xtensa: implement trap pattern

2015-06-09 Thread Max Filippov
gcc/ * config/xtensa/xtensa.h (TARGET_DEBUG): New definition. * config/xtensa/xtensa.md (define_attr "type"): New type "trap". (define_insn "trap"): New definition. --- gcc/config/xtensa/xtensa.h | 1 + gcc/config/xtensa/xtensa.md | 15 ++- 2 files changed, 15

[PATCH v2] xtensa: implement trap pattern

2015-06-09 Thread Max Filippov
gcc/ * config/xtensa/xtensa.h (TARGET_DEBUG): New definition. * config/xtensa/xtensa.md (define_attr "type"): New type "trap". (define_insn "trap"): New definition. --- Changes v1->v2: - drop break.n, replace break 0, 0 with break 1, 15, coded breakpoint that transfers con

Re: [PATCH v2] xtensa: implement trap pattern

2015-06-10 Thread Max Filippov
On Wed, Jun 10, 2015 at 5:37 PM, augustine.sterl...@gmail.com wrote: > On Tue, Jun 9, 2015 at 3:14 PM, Max Filippov wrote: >> gcc/ >> * config/xtensa/xtensa.h (TARGET_DEBUG): New definition. >> * config/xtensa/xtensa.md (define_attr &q

[PATCH] xtensa: align data naturally when optimizing for size

2015-02-21 Thread Max Filippov
for size is enabled. 2015-02-22 Max Filippov gcc/ * config/xtensa/xtensa.h (CONSTANT_ALIGNMENT, DATA_ALIGNMENT): use natural alignment when optimizing for size. --- gcc/config/xtensa/xtensa.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gcc/config

Re: [PATCH] Fix PR84521

2019-06-18 Thread Max Filippov
Hello, On Mon, Jun 17, 2019 at 6:10 PM Jeff Law wrote: > On 6/17/19 6:58 PM, Wilco Dijkstra wrote: > >> You mention that arm, mips and xtensa are still broken. Are they worse > >> after this patch? The testcase from the patch passes with the trunk xtensa-linux-gcc with windowed ABI. But with th

[PATCH] xtensa: fix PR target/90922

2019-06-18 Thread Max Filippov
-18 Max Filippov gcc/ * config/xtensa/xtensa.c (xtensa_expand_prologue): Add stack pointer adjustment for the case of no callee-saved registers and stack frame bigger than 128 bytes. --- gcc/config/xtensa/xtensa.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion

Re: [PATCH] xtensa: fix PR target/90922

2019-06-18 Thread Max Filippov
On Tue, Jun 18, 2019 at 3:09 PM augustine.sterl...@gmail.com wrote: > > On Tue, Jun 18, 2019 at 2:27 PM Max Filippov wrote: > > > > Stack pointer adjustment code in prologue missed a case of no > > callee-saved registers and a stack frame size bigger than 128 byt

Re: [PATCH] Fix PR84521

2019-06-18 Thread Max Filippov
On Tue, Jun 18, 2019 at 10:07 AM Wilco Dijkstra wrote: > > The testcase from the patch passes with the trunk xtensa-linux-gcc > > with windowed ABI. But with the changes in this patch a lot of tests > > that use longjmp are failing on xtensa-linux. > > Interesting. I looked at the _xtensa_nonlocal

Re: [PATCH] Fix PR84521

2019-06-18 Thread Max Filippov
On Tue, Jun 18, 2019 at 4:53 PM Wilco Dijkstra wrote: > > It would work if a frame pointer was initialized in the function test, but > > it wasn't: > > Right, because it unwinds, it needs a valid frame pointer since we no > longer store the stack pointer. So xtensa_frame_pointer_required > should

[PATCH] PR target/86814

2018-12-30 Thread Max Filippov
Xtensa architecture is not affected by speculation. gcc/ 2018-12-30 Max Filippov * config/xtensa/xtensa.c (TARGET_HAVE_SPECULATION_SAFE_VALUE): Define to speculation_safe_value_not_needed. --- gcc/config/xtensa/xtensa.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a

Re: [PATCH] PR target/86814

2018-12-31 Thread Max Filippov
On Sun, Dec 30, 2018 at 8:06 PM augustine.sterl...@gmail.com wrote: > On Sun, Dec 30, 2018 at 1:06 AM Max Filippov wrote: > > Xtensa architecture is not affected by speculation. > > > > gcc/ > > 2018-12-30 Max Filippov > > >

Re: [PATCH] xtensa: fix PR target/90922

2019-09-23 Thread Max Filippov
On Tue, Jun 18, 2019 at 3:23 PM Max Filippov wrote: > > On Tue, Jun 18, 2019 at 3:09 PM augustine.sterl...@gmail.com > wrote: > > > > On Tue, Jun 18, 2019 at 2:27 PM Max Filippov wrote: > > > > > > Stack pointer adjustment code in prologue missed a case o

[PATCH] gcc: xtensa: don't force PIC for uclinux target

2018-11-05 Thread Max Filippov
sa-uclinux. gcc/ 2018-11-04 Max Filippov * config/xtensa/uclinux.h (XTENSA_ALWAYS_PIC): Change to 0. --- gcc/config/xtensa/uclinux.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/config/xtensa/uclinux.h b/gcc/config/xtensa/uclinux.h index ba26187c8f7a..1c

[PATCH v2] gcc: xtensa: don't force PIC for uclinux target

2018-11-05 Thread Max Filippov
sa-uclinux. gcc/ 2018-11-04 Max Filippov * config/xtensa/uclinux.h (XTENSA_ALWAYS_PIC): Change to 0. --- Changes v1->v2: - fix up comment for the XTENSA_ALWAYS_PIC macro gcc/config/xtensa/uclinux.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gcc/

Re: [PATCH v2] gcc: xtensa: don't force PIC for uclinux target

2018-11-05 Thread Max Filippov
On Mon, Nov 5, 2018 at 3:18 PM augustine.sterl...@gmail.com wrote: > > On Mon, Nov 5, 2018 at 11:07 AM Max Filippov wrote: >> >> xtensa-uclinux uses bFLT executable file format that cannot relocate >> fields representing offsets from data to code. C++ objects built

[PATCH] gcc: move assemble_start_function / assemble_end_function to output_mi_thunk

2019-05-14 Thread Max Filippov
-08 Max Filippov * cgraphunit.c (cgraph_node::expand_thunk): Remove assemble_start_function and assemble_end_function calls. * config/alpha/alpha.c (alpha_output_mi_thunk_osf): Call assemble_start_function and assemble_end_function. * config/arc/arc.c

Re: [PATCH] gcc: move assemble_start_function / assemble_end_function to output_mi_thunk

2019-05-16 Thread Max Filippov
On Wed, May 15, 2019 at 2:46 PM Richard Sandiford wrote: > > Max Filippov writes: > > Let backends call assemble_start_function after they have generated > > thunk function body so that a constant pool could be output if it is > > required. This may help backends to a

[PATCH] gcc: aarch64: move assemble_start_function / assemble_end_function

2019-05-17 Thread Max Filippov
Change that moved assemble_start_function/assemble_end_function to backends missed aarch64. Fix that. Committed as obvious. gcc/ 2019-05-17 Max Filippov * config/aarch64/aarch64.c (aarch64_output_mi_thunk): Call assemble_start_function and assemble_end_function. --- gcc

[RFC] moving assemble_start_function / assemble_end_function to output_mi_thunk

2019-01-08 Thread Max Filippov
to fix it differently? ---8<--- >From bad901880a3f9fc69726aa082e2b2c674bacca94 Mon Sep 17 00:00:00 2001 From: Max Filippov Date: Mon, 7 Jan 2019 18:22:12 -0800 Subject: [PATCH] gcc: move assemble_start_function / assemble_end_function to output_mi_thunk Let backends call assemble_start_fun

Re: [RFC] moving assemble_start_function / assemble_end_function to output_mi_thunk

2019-01-08 Thread Max Filippov
Sorry, wrong list, meant to send to g...@gcc.gnu.org -- Thanks. -- Max

Re: [RFC] moving assemble_start_function / assemble_end_function to output_mi_thunk

2019-01-11 Thread Max Filippov
On Fri, Jan 11, 2019 at 10:50 AM Jeff Law wrote: > I think this needs to defer to gcc-10 Ok, will resend when in stage1. -- Thanks. -- Max

[PATCH] xtensa: report stack usage

2016-08-26 Thread Max Filippov
This enables options -fstack-usage and -Wstack-usage. 2016-08-21 Max Filippov gcc/ * config/xtensa/xtensa.c (xtensa_expand_prologue): Update current_function_static_stack_size variable with the static stack frame size of the current function when

  1   2   3   4   >