Re: [PATCH] i386: Emit 16b atomics inline with -m64 -mcx16 -mavx [PR104688]

2022-11-13 Thread Uros Bizjak via Gcc-patches
On Mon, Nov 14, 2022 at 8:52 AM Jakub Jelinek wrote: > > Hi! > > Working virtually out of Baker Island. > > Given > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104688#c10 > the following patch implements atomic load/store (and therefore also > enabling compare and exchange) for -m64 -mcx16

Re: [PATCH] libatomic: Handle AVX+CX16 AMD like Intel for 16b atomics [PR104688]

2022-11-13 Thread Uros Bizjak via Gcc-patches
On Mon, Nov 14, 2022 at 8:48 AM Jakub Jelinek wrote: > > Hi! > > Working virtually out of Baker Island. > > We got a response from AMD in > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104688#c10 > so the following patch starts treating AMD with AVX and CMPXCHG16B > ISAs like Intel by using

[PATCH] i386: Emit 16b atomics inline with -m64 -mcx16 -mavx [PR104688]

2022-11-13 Thread Jakub Jelinek via Gcc-patches
Hi! Working virtually out of Baker Island. Given https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104688#c10 the following patch implements atomic load/store (and therefore also enabling compare and exchange) for -m64 -mcx16 -mavx. Ok for trunk if it passes bootstrap/regtest? 2022-11-13 Jakub

[PATCH] libatomic: Handle AVX+CX16 AMD like Intel for 16b atomics [PR104688]

2022-11-13 Thread Jakub Jelinek via Gcc-patches
Hi! Working virtually out of Baker Island. We got a response from AMD in https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104688#c10 so the following patch starts treating AMD with AVX and CMPXCHG16B ISAs like Intel by using vmovdqa for atomic load/store in libatomic. Ok for trunk if it passes

Re: [PATCH] [range-ops] Implement sqrt.

2022-11-13 Thread Aldy Hernandez via Gcc-patches
On Sun, Nov 13, 2022 at 9:39 PM Jakub Jelinek wrote: > > On Sun, Nov 13, 2022 at 09:05:53PM +0100, Aldy Hernandez wrote: > > It seems SQRT is relatively straightforward, and it's something Jakub > > wanted for this release. > > > > Jakub, what do you think? > > > > p.s. Too tired to think about

Re: [RFC PATCH] ipa-cp: Speculatively call specialized functions

2022-11-13 Thread Richard Biener via Gcc-patches
On Sun, Nov 13, 2022 at 4:38 PM Christoph Muellner wrote: > > From: mtsamis > > The IPA CP pass offers a wide range of optimizations, where most of them > lead to specialized functions that are called from a call site. > This can lead to multiple specialized function clones, if more than > one

Re: [PATCH] doc: Ada: include Indices and Tables in manuals

2022-11-13 Thread Arnaud Charlet via Gcc-patches
> Sorry for the breakage. However, I contacted you (and your colleague) > and haven't received > any feedback for a couple of weeks. > >>> > >>> Right although I did give you feedback that what you sent wasn’t in a > >>> suitable form for review wrt Ada. > >> > >> Sure, but

Re: [RFC PATCH] ipa-guarded-deref: Add new pass to dereference function pointers

2022-11-13 Thread Richard Biener via Gcc-patches
On Sun, Nov 13, 2022 at 4:09 PM Christoph Muellner wrote: > > From: Christoph Müllner > > This patch adds a new pass that looks up function pointer assignments, > and adds guarded direct calls to the call sites of the function > pointers. > > E.g.: Lets assume an assignment to a function pointer

Re: [PATCH] Using sub-scalars mode to move struct block

2022-11-13 Thread Richard Biener via Gcc-patches
On Mon, 14 Nov 2022, Jiufu Guo wrote: > > Hi! > Thanks so much for your review! > > Richard Biener writes: > > > On Fri, 11 Nov 2022, Jiufu Guo wrote: > > > >> Hi, > >> > >> When assigning a struct parameter to another variable, or loading a > >> memory block to a struct var (especially for

[PATCH] restrict gcc.dg/pr107554.c to 64bit platforms

2022-11-13 Thread Richard Biener via Gcc-patches
The following avoids exceeding the maximum object size on 32bit platforms. Pushed. * gcc.dg/pr107554.c: Restrict to lp64. --- gcc/testsuite/gcc.dg/pr107554.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/testsuite/gcc.dg/pr107554.c

Re: [PATCH] i386: Add AMX-TILE dependency for AMX related ISAs

2022-11-13 Thread Hongtao Liu via Gcc-patches
On Fri, Nov 11, 2022 at 10:45 AM Haochen Jiang via Gcc-patches wrote: > > Hi all, > > For all AMX related ISAs, we have a potential dependency on AMX-TILE > or we even won't have the basic support on AMX. > > This patch added those dependency. Ok for trunk? Ok. > > BRs, > Haochen > >

Re: [PATCH V2] Enable small loop unrolling for O2

2022-11-13 Thread Hongyu Wang via Gcc-patches
> Ok, Note GCC documents have been ported to sphinx, so you need to > adjust changes in invoke.texi to new sphinx files. Yes, this is the patch I'm going to check-in. Thanks. Hongtao Liu 于2022年11月14日周一 09:35写道: > > On Wed, Nov 9, 2022 at 9:29 AM Hongyu Wang wrote: > > > > > Although

[PATCH 3/3] libstdc++: Implement ranges::find_last{, _if, _if_not} from P1223R5

2022-11-13 Thread Patrick Palka via Gcc-patches
Tested on x86_64-pc-linux-gnu, does this look OK for trunk? libstdc++-v3/ChangeLog: * include/bits/ranges_algo.h (__find_last_fn, find_last): Define. (__find_last_if_fn, find_last_if): Define. (__find_last_if_not_fn, find_last_if_not): Define. *

[PATCH 2/3] libstdc++: Implement ranges::iota from P2440R1

2022-11-13 Thread Patrick Palka via Gcc-patches
Tested on x86_64-pc-linux-gnu, does this look OK for trunk? libstdc++-v3/ChangeLog: * include/bits/ranges_algo.h (out_value_result): Define. (iota_result): Define. (__iota_fn, iota): Define. * testsuite/25_algorithms/iota/1.cc: New test. ---

[PATCH 1/3] libstdc++: Implement ranges::contains/contains_subrange from P2302R4

2022-11-13 Thread Patrick Palka via Gcc-patches
Tested on x86_64-pc-linux-gnu, does this look OK for trunk? libstdc++-v3/ChangeLog: * include/bits/ranges_algo.h (__contains_fn, contains): Define. (__contains_subrange_fn, contains_subrange): Define. * testsuite/25_algorithms/contains/1.cc: New test. *

Re: [PATCH] Using sub-scalars mode to move struct block

2022-11-13 Thread Jiufu Guo via Gcc-patches
Hi! Thanks so much for your review! Richard Biener writes: > On Fri, 11 Nov 2022, Jiufu Guo wrote: > >> Hi, >> >> When assigning a struct parameter to another variable, or loading a >> memory block to a struct var (especially for return value), >> Now, "block move" would be used during

Re: old install to a different folder

2022-11-13 Thread Martin Liška
On 11/14/22 02:21, Gerald Pfeifer wrote: > On Sun, 13 Nov 2022, Martin Liška wrote: >> So Gerald, I'm suggesting a new url base gcc.gnu.org/docs that will be >> filled with the new manuals and gcc.gnu.org/onlinedocs/$man and >> gcc.gnu.org/install locations should point to older (trunk) manuals

Re: [PATCH] doc: Ada: include Indices and Tables in manuals

2022-11-13 Thread Martin Liška
On 11/13/22 18:03, Arnaud Charlet wrote: Sorry for the breakage. However, I contacted you (and your colleague) and haven't received any feedback for a couple of weeks. >>> >>> Right although I did give you feedback that what you sent wasn’t in a >>> suitable form for review wrt

[PATCH (pushed)] gcc-changelog: temporarily disable check_line_start

2022-11-13 Thread Martin Liška
The following patch will be needed for ChangeLog entry emission of the reverted Sphinx commits. Pushed. Martin contrib/ChangeLog: * gcc-changelog/git_commit.py: Temporarily disable check_line.start. --- contrib/gcc-changelog/git_commit.py | 2 ++ 1 file changed, 2 insertions(+)

Revert Sphinx documentation [Was: Issues with Sphinx]

2022-11-13 Thread Martin Liška
Hi. The situation with the Sphinx migration went out of control. The TODO list overwhelmed me and there are road-blocks that can't be easily fixed with what Sphinx currently supports. That would require addition of an upstream support and a possible new Sphinx release. Let me summarize the

Re: [PATCH 3/7] riscv: Enable overlap-by-pieces via tune param

2022-11-13 Thread Vineet Gupta
On 11/13/22 15:05, Christoph Muellner wrote: +static bool +riscv_overlap_op_by_pieces (void) +{ + return tune_param->overlap_op_by_pieces; Does this not need to be gated on unaligned access enabled as well. -Vineet

Re: [PATCH v2 0/4] LoongArch: Add some floating-point operations

2022-11-13 Thread tangxiaolin
How about I do this work on Glibc? 在 2022/11/12 下午3:08, Xi Ruoyao 写道: On Wed, 2022-11-09 at 21:53 +0800, Xi Ruoyao wrote: These patches allow to expand the following builtins to floating point instructions for LoongArch: - __builtin_rint{,f} - __builtin_{l,ll}rint{,f} -

Re: [PATCH][i386]: Update ix86_can_change_mode_class target hook to accept QImode conversions

2022-11-13 Thread Hongtao Liu via Gcc-patches
On Fri, Nov 11, 2022 at 10:47 PM Tamar Christina via Gcc-patches wrote: > > Hi All, > > The current i386 implementation of the TARGET_CAN_CHANGE_MODE_CLASS is > currently > not useful before re-alloc. > > In particular before regalloc optimization passes query the hook using > ALL_REGS, > but

Re: [wwwdocs] gcc-13: Mention Intel new ISA and march support.

2022-11-13 Thread Hongtao Liu via Gcc-patches
On Thu, Nov 10, 2022 at 2:04 PM Haochen Jiang via Gcc-patches wrote: > > Hi all, > > This patch aims to mention newly added Intel ISA and march support. > > Ok for trunk? Ok. > > BRs, > Haochen > > --- > htdocs/gcc-13/changes.html | 50 ++ > 1 file changed, 50

Re: [PATCH V2] Enable small loop unrolling for O2

2022-11-13 Thread Hongtao Liu via Gcc-patches
On Wed, Nov 9, 2022 at 9:29 AM Hongyu Wang wrote: > > > Although ix86_small_unroll_insns is coming from issue_rate, it's tuned > > for codesize. > > Make it exact as issue_rate and using factor * issue_width / > > loop->ninsns may increase code size too much. > > So I prefer to add those 2

Re: old install to a different folder

2022-11-13 Thread Gerald Pfeifer
On Sun, 13 Nov 2022, Martin Liška wrote: > So Gerald, I'm suggesting a new url base gcc.gnu.org/docs that will be > filled with the new manuals and gcc.gnu.org/onlinedocs/$man and > gcc.gnu.org/install locations should point to older (trunk) manuals > (prev folder at server I guess). Having

[PATCH 7/7] riscv: Add support for str(n)cmp inline expansion

2022-11-13 Thread Christoph Muellner
From: Christoph Müllner This patch implements expansions for the cmpstrsi and the cmpstrnsi builtins using Zbb instructions (if available). This allows to inline calls to strcmp() and strncmp(). The expansion basically emits a peeled comparison sequence (i.e. a peeled comparison loop) which

[PATCH 6/7] riscv: Add support for strlen inline expansion

2022-11-13 Thread Christoph Muellner
From: Christoph Müllner This patch implements the expansion of the strlen builtin using Zbb instructions (if available) for aligned strings using the following sequence: li a3,-1 addia4,a0,8 .L2: ld a5,0(a0) addia0,a0,8 orc.b a5,a5 beq

[PATCH 4/7] riscv: Move riscv_block_move_loop to separate file

2022-11-13 Thread Christoph Muellner
From: Christoph Müllner Let's try to not accumulate too much functionality in one single file as this does not really help maintaining or extending the code. So in order to add more similar functionality like riscv_block_move_loop let's move this function to a separate file. This change does

[PATCH 2/7] riscv: bitmanip/zbb: Add prefix/postfix and enable visiblity

2022-11-13 Thread Christoph Muellner
From: Christoph Müllner INSNs are usually postfixed by a number representing the argument count. Given the instructions will be used in a later commit, let's make them visible, but add a "riscv_" prefix to avoid conflicts with standard INSNs. gcc/ChangeLog: * config/riscv/bitmanip.md

[PATCH 1/7] riscv: bitmanip: add orc.b as an unspec

2022-11-13 Thread Christoph Muellner
From: Philipp Tomsich As a basis for optimized string functions (e.g., the by-pieces implementations), we need orc.b available. This adds orc.b as an unspec, so we can expand to it. gcc/ChangeLog: * config/riscv/bitmanip.md (orcb2): Add orc.b as an unspec. *

[PATCH 0/7] riscv: Improve builtins expansion

2022-11-13 Thread Christoph Muellner
From: Christoph Müllner This patchset adds includes patches to improve the following builtin expansions: * cpymemsi: Allow by-pieces to generate overlapping memory accesses * cmpstrsi: Add expansion for strcmp and strncmp for aligned strings when zbb/orc.b is available * strlen: Add expansion

[PATCH 5/7] riscv: Use by-pieces to do overlapping accesses in block_move_straight

2022-11-13 Thread Christoph Muellner
From: Christoph Müllner The current implementation of riscv_block_move_straight() emits a couple of load-store pairs with maximum width (e.g. 8-byte for RV64). The remainder is handed over to move_by_pieces(), which emits code based target settings like slow_unaligned_access and

[PATCH 3/7] riscv: Enable overlap-by-pieces via tune param

2022-11-13 Thread Christoph Muellner
From: Christoph Müllner This patch adds the field overlap_op_by_pieces to the struct riscv_tune_param, which allows to enable the overlap_op_by_pieces infrastructure. gcc/ChangeLog: * config/riscv/riscv.c (struct riscv_tune_param): New field. (riscv_overlap_op_by_pieces): New

[committed] analyzer: new warning: -Wanalyzer-tainted-assertion [PR106235]

2022-11-13 Thread David Malcolm via Gcc-patches
This patch adds a new -Wanalyzer-tainted-assertion warning to -fanalyzer's "taint" mode (which also requires -fanalyzer-checker=taint). It complains about attacker-controlled values being used in assertions, or in any expression affecting control flow that guards a "noreturn" function. As noted

[RFC PATCH] riscv: thead: Add support for XTheadMemPair ISA extension

2022-11-13 Thread Christoph Muellner
From: "moiz.hussain" The XTheadMacXTheadMemPair ISA extension provides load/store pair instructions: * th.ldd * th.sdd * th.lwd * th.lwud * th.swd We added the following unnamed patterns to the peephole.md stage: * load/store pair patterns for 4 instructions * load/store pair patterns for 2

Re: [PATCH 3/5] Fortran: Narrow return types [PR78798]

2022-11-13 Thread Bernhard Reutner-Fischer via Gcc-patches
On 13 November 2022 21:29:50 CET, Harald Anlauf wrote: >Replacing "int" by "signed char" adds confusion and makes code >less understandable, so I would oppose it, as we don't solve a >real problem and rather add confusion. Ok so consider the non-bool hunks dropped, they just fell out of my

[PATCH 6/7] riscv: thead: Add support for XTheadMac ISA extension

2022-11-13 Thread Christoph Muellner
From: Christoph Müllner The XTheadMac ISA extension provides multiply-accumulate/subtract instructions: * mula/mulaw/mulah * muls/mulsw/mulsh To benefit from middle-end passes, we expand the following named patterns in riscv.md (as they are not T-Head-specific): * maddhisi4 * msubhisi4

[PATCH 7/7] riscv: Add basic extension support for XTheadFmv and XTheadInt

2022-11-13 Thread Christoph Muellner
From: Christoph Müllner This patch add basic support for the XTheadFmv and XTheadInt ISA extension. As both extensions only contain instruction, which are not supposed to be emitted by the compiler, the support only covers awareness of the extension name in the march string and the definition of

[PATCH 5/7] riscv: thead: Add support for XTheadBb ISA extension

2022-11-13 Thread Christoph Muellner
From: Christoph Müllner The XTheadBb ISA extension provides instructions similar to Zbb: * th.srri/th.srriw * th.ext/th.extu * th.ff1 (count-leading-zeros) * th.rev/th.revw Instructions that are not covered, because they don't fit into a pattern: * th.ff0 (count-leading-ones) * th.tstnbz For

[PATCH 3/7] riscv: thead: Add support for XTheadBa and XTheadBs ISA extensions

2022-11-13 Thread Christoph Muellner
From: Christoph Müllner This patch adds support for the following T-Head vendor extensions: * XTheadBa * XTheadBs Both extensions provide just one instruction, that has a counterpart in the similar named Bitmanip ISA extension. gcc/ChangeLog: * config/riscv/riscv.cc (riscv_rtx_costs):

[PATCH 4/7] riscv: thead: Add support for XTheadCondMov ISA extensions

2022-11-13 Thread Christoph Muellner
From: Christoph Müllner This patch adds support for XTheadCondMov ISA extension. The extension brings a one-sided conditional move (no else-assignment). Given that GCC has a great if-conversion pass, we don't need to do much, besides properly expanding movcc accordingly and adjust the cost

[PATCH 0/7] Add XThead* support

2022-11-13 Thread Christoph Muellner
From: Christoph Müllner This series adds support for the following vendor extensions from T-Head: * XTheadCmo, XTheadSync * XTheadBa, XTheadBb, XTheadBs * XTheadCondMov * XTheadMac * XTheadFmv, XTheadInt No regressions observed. Christoph Müllner (7): riscv: Add basic XThead* vendor

[PATCH 1/7] riscv: Add basic XThead* vendor extension support

2022-11-13 Thread Christoph Muellner
From: Christoph Müllner This patch add basic support for the following XThead* ISA extensions: * XTheadCmo, XTheadSync * XTheadBa, XTheadBb, XTheadBs, XTheadCondMov * XTheadMac * XTheadFMemIdx, XTheadMemIdx gcc/ChangeLog: * common/config/riscv/riscv-common.cc: Add xthead* extensions.

[PATCH 2/7] riscv: riscv-cores.def: Add T-Head XuanTie C906

2022-11-13 Thread Christoph Muellner
From: Christoph Müllner This adds T-Head's XuanTie C906 to the list of known cores as "thead-c906". The C906 is shipped for quite some time (it is the core of the Allwinner D1). Note, that the tuning struct for the C906 is already part of GCC (it is also name "thead-c906"). gcc/ChangeLog:

[PATCH v2 7/8] RISC-V: Ventana-VT1 supports XVentanaCondOps

2022-11-13 Thread Philipp Tomsich
gcc/ChangeLog: * config/riscv/riscv-cores.def (RISCV_CORE): Update the Ventana-VT1 definition to include the xventanacondops extension. Signed-off-by: Philipp Tomsich --- Changes in v2: - New in v2. gcc/config/riscv/riscv-cores.def | 2 +- 1 file changed, 1

[PATCH v2 8/8] ifcvt: add if-conversion to conditional-zero instructions

2022-11-13 Thread Philipp Tomsich
Some architectures, as it the case on RISC-V with the proposed ZiCondOps and the vendor-defined XVentanaCondOps, define a conditional-zero instruction that is equivalent to: - the positive form: rd = (rc != 0) ? rs : 0 - the negated form: rd = (rc == 0) ? rs : 0 While

[PATCH v2 3/8] RISC-V: Support noce_try_store_flag_mask as vt.maskc

2022-11-13 Thread Philipp Tomsich
When if-conversion in noce_try_store_flag_mask starts the sequence off with an order-operator, our patterns for vt.maskc will receive the result of the order-operator as a register argument; consequently, they can't know that the result will be either 1 or 0. To convey this information (and make

[PATCH v2 5/8] RISC-V: Recognize bexti in negated if-conversion

2022-11-13 Thread Philipp Tomsich
While the positive case "if ((bits >> SHAMT) & 1)" for SHAMT 0..10 can trigger conversion into efficient branchless sequences - with Zbs (bexti + neg + and) - with XVentanaCondOps (andi + vt.maskc) the inverted/negated case results in andi a5,a0,1024 seqz a5,a5 neg a5,a5 and a5,a5,a1

[PATCH v2 6/8] RISC-V: Support immediates in XVentanaCondOps

2022-11-13 Thread Philipp Tomsich
When if-conversion encounters sequences using immediates, the sequences can't trivially map back onto vt.maskc/vt.maskcn (even if benefitial) due to vt.maskc and vt.maskcn not having immediate forms. This adds a splitter to rewrite opportunities for XVentanaCondOps that operate on an immediate by

[PATCH v2 0/8] RISC-V: Backend support for XVentanaCondOps/ZiCondops

2022-11-13 Thread Philipp Tomsich
Both the XVentanaCondOps (a vendor-defined extension from Ventana Microsystems) and the proposed ZiCondOps extensions define a conditional-zero(-or-value) instruction, which is similar to the following C construct: rd = rc ? rs : 0 This functionality can be tied back into if-convertsion and

[PATCH v2 4/8] RISC-V: Recognize sign-extract + and cases for XVentanaCondOps

2022-11-13 Thread Philipp Tomsich
Users might use explicit arithmetic operations to create a mask and then and it, in a sequence like cond = (bits >> SHIFT) & 1; mask = ~(cond - 1); val &= mask; which will present as a single-bit sign-extract. Dependening on what combination of XVentanaCondOps and Zbs are available,

[PATCH v2 2/8] RISC-V: Generate vt.maskc on noce_try_store_flag_mask if-conversion

2022-11-13 Thread Philipp Tomsich
Adds a pattern to map the output of noce_try_store_flag_mask if-conversion in the combiner onto vt.maskc; the input patterns supported are similar to the following: (set (reg/v/f:DI 75 [ ]) (and:DI (neg:DI (ne:DI (reg:DI 82) (const_int 0 [0])))

[PATCH v2 1/8] RISC-V: Recognize xventanacondops extension

2022-11-13 Thread Philipp Tomsich
This adds the xventanacondops extension to the option parsing and as a default for the ventana-vt1 core: gcc/Changelog: * common/config/riscv/riscv-common.cc: Recognize "xventanacondops" as part of an architecture string. * config/riscv/riscv-opts.h

Re: [PATCH (pushed)] sphinx: fix building if sphinx-build is missing

2022-11-13 Thread Stephan Bergmann via Gcc-patches
On 11/13/22 20:26, Martin Liška wrote: The patch is fine, please send it to gcc-patches ML and install it. I sent a patch now, but don't have commit rights.

[PATCH] sphinx: more build fixing if sphinx-build is missing

2022-11-13 Thread Stephan Bergmann via Gcc-patches
...similar to 1f9c79367e136e0ca5b775562e6111e1a0d0046f "sphinx: fix building if sphinx-build is missing" gcc/ChangeLog: * fortran/Make-lang.in: Build info pages conditionally. --- gcc/fortran/Make-lang.in | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git

Re: [PATCH 02/12] ipa-cp: Do not consider useless aggregate constants

2022-11-13 Thread Martin Jambor
On Sat, Nov 12 2022, Martin Jambor wrote: > Hi, > > When building vectors of known aggregate values, there is no point in > including those for parameters which are not used in any way > whatsoever. > > Bootstrapped and tested on x86_64-linux. OK for master? > > Thanks, > > Martin When doing LTO

Re: [PATCH] Fortran: fix treatment of character, value, optional dummy arguments [PR107444]

2022-11-13 Thread Harald Anlauf via Gcc-patches
Am 13.11.22 um 09:51 schrieb Andreas Schwab: This breaks aarch64: $ /opt/gcc/gcc-20221113/Build/./gcc/xgcc -B/opt/gcc/gcc-20221113/Build/./gcc/ -B/usr/aarch64-suse-linux/bin/ -B/usr/aarch64-suse-linux/lib/ -isystem /usr/aarch64-suse-linux/include -isystem /usr/aarch64-suse-linux/sys-include

[PATCH] aarch64: Add bfloat16_t support for aarch64

2022-11-13 Thread Jakub Jelinek via Gcc-patches
Hi! x86_64/i686 has for a few weeks working std::bfloat16_t support, __bf16 there is no longer a storage only type, but can be used for arithmetics and is supported in libgcc and libstdc++. The following patch adds similar support for AArch64. Bootstrapped/regtested on aarch64-linux.

[PATCH] RISC-V: Split "(a & (1UL << bitno)) ? 0 : 1" to bext + xori

2022-11-13 Thread Philipp Tomsich
We avoid reassociating "(~(a >> BIT_NO)) & 1" into "((~a) >> BIT_NO) & 1" by splitting it into a zero-extraction (bext) and an xori. This both avoids burning a register on a temporary and generates a sequence that clearly captures 'extract bit, then invert bit'. This change improves the

[PATCH] RISC-V: Handle "(a & twobits) == singlebit" in branches using Zbs

2022-11-13 Thread Philipp Tomsich
Use Zbs when generating a sequence for "if ((a & twobits) == singlebit) ..." that can be expressed as bexti + bexti + andn. gcc/ChangeLog: * config/riscv/bitmanip.md (*branch_mask_twobits_equals_singlebit): Handle "if ((a & T) == C)" using Zbs, when T has 2 bits set and C has

[PATCH v2 2/2] RISC-V: Add instruction fusion (for ventana-vt1)

2022-11-13 Thread Philipp Tomsich
The Ventana VT1 core supports quad-issue and instruction fusion. This implemented TARGET_SCHED_MACRO_FUSION_P to keep fusible sequences together and adds idiom matcheing for the supported fusion cases. gcc/ChangeLog: * config/riscv/riscv.cc (enum riscv_fusion_pairs): Add symbolic

[PATCH] RISC-V: Split "(a & (1UL << bitno)) ? 0 : -1" to bext + addi

2022-11-13 Thread Philipp Tomsich
For a straightforward application of bext for the following function long bext64(long a, char bitno) { return (a & (1UL << bitno)) ? 0 : -1; } we generate srl a0,a0,a1# 7 [c=4 l=4] lshrdi3 andia0,a0,1 # 8 [c=4 l=4] anddi3/1 addi

[PATCH v2 1/2] RISC-V: Add basic support for the Ventana-VT1 core

2022-11-13 Thread Philipp Tomsich
The Ventana-VT1 core is compatible with rv64gc, Zb[abcs], Zifenci and XVentanaCondOps. This introduces a placeholder -mcpu=ventana-vt1, so tooling and scripts don't need to change once full support (pipeline, tuning, etc.) will become public later. gcc/ChangeLog: *

[PATCH v2 0/2] Basic support for the Ventana VT1 w/ instruction fusion

2022-11-13 Thread Philipp Tomsich
This series provides support for the Ventana VT1 (a 4-way superscalar rv64gc_zba_zbb_zbc_zbs_zifenci_xventanacondops core) including support for the supported instruction fusion patterns. This includes the addition of the fusion-aware scheduling infrastructure for RISC-V and implements idiom

[PATCH] RISC-V: Zihintpause: add __builtin_riscv_pause

2022-11-13 Thread Philipp Tomsich
The Zihintpause extension uses an opcode from the 'fence' opcode range to add a true hint instruction (i.e. if it is not supported on any given platform, the 'fence' that is encoded will not enforce any specific ordering on memory accesses) for entering a low-power state (e.g. in an idle thread).

[PATCH] RISC-V: Use .p2align for code-alignment

2022-11-13 Thread Philipp Tomsich
RISC-V's .p2align (currently) ignores the max-skip argument. As we have experimental patches underway to address this in a backwards-compatible manner, let's prepare GCC for the day when binutils gets updated. gcc/ChangeLog: * config/riscv/riscv.h (ASM_OUTPUT_MAX_SKIP_ALIGN): Implement.

Re: [PATCH] [range-ops] Implement sqrt.

2022-11-13 Thread Jakub Jelinek via Gcc-patches
On Sun, Nov 13, 2022 at 09:05:53PM +0100, Aldy Hernandez wrote: > It seems SQRT is relatively straightforward, and it's something Jakub > wanted for this release. > > Jakub, what do you think? > > p.s. Too tired to think about op1_range. That would be multiplication of the same value twice,

Re: [PATCH] libstdc++: Fix python/ not making install directories

2022-11-13 Thread Bernhard Reutner-Fischer via Gcc-patches
On Sun, 13 Nov 2022 19:42:52 + Jonathan Wakely via Gcc-patches wrote: > On Sun, 13 Nov 2022, 18:06 Arsen Arsenović via Libstdc++, < > libstd...@gcc.gnu.org> wrote: > > > I'm unsure why this issue only started manifesting now with how old this > > code is, but this should fix it. > > >

Re: [PATCH 3/5] Fortran: Narrow return types [PR78798]

2022-11-13 Thread Harald Anlauf via Gcc-patches
Am 13.11.22 um 11:39 schrieb Bernhard Reutner-Fischer via Gcc-patches: On Sun, 13 Nov 2022 12:13:26 +0200 Janne Blomqvist wrote: On Sun, Nov 13, 2022 at 1:47 AM Bernhard Reutner-Fischer via Fortran wrote: --- a/gcc/fortran/arith.cc +++ b/gcc/fortran/arith.cc @@ -1135,7 +1135,7 @@

[PATCH] [range-ops] Implement sqrt.

2022-11-13 Thread Aldy Hernandez via Gcc-patches
It seems SQRT is relatively straightforward, and it's something Jakub wanted for this release. Jakub, what do you think? p.s. Too tired to think about op1_range. gcc/ChangeLog: * gimple-range-op.cc (class cfn_sqrt): New. (gimple_range_op_handler::maybe_builtin_call): Add cases

Re: old install to a different folder

2022-11-13 Thread Martin Liška
On 11/12/22 01:06, Joseph Myers wrote: > On Fri, 11 Nov 2022, Tobias Burnus wrote: > >> For /onlinedocs/, I concur that we want to have the old doc there as there >> are >> many >> deep links. Still, we should consider adding a disclaimer box to all former >> mainline >> documentation stating

Re: [PATCH] libstdc++: Fix python/ not making install directories

2022-11-13 Thread Jonathan Wakely via Gcc-patches
On Sun, 13 Nov 2022, 18:06 Arsen Arsenović via Libstdc++, < libstd...@gcc.gnu.org> wrote: > I'm unsure why this issue only started manifesting now with how old this > code is, but this should fix it. > I just pushed a change to how the debug build makefiles are generated, which presumably

Re: [committed] libstdc++: Avoid redundant checks in std::use_facet [PR103755]

2022-11-13 Thread Jonathan Wakely via Gcc-patches
On Sun, 13 Nov 2022, 19:23 Stephan Bergmann via Libstdc++, < libstd...@gcc.gnu.org> wrote: > On 11/12/22 03:47, Jonathan Wakely wrote: > > On Fri, 11 Nov 2022 at 21:00, Stephan Bergmann > wrote: > >> > >> On 11/11/22 06:30, Jonathan Wakely via Gcc-patches wrote: > >>> As discussed in the PR,

Re: [PATCH (pushed)] sphinx: fix building if sphinx-build is missing

2022-11-13 Thread Martin Liška
On 11/13/22 20:18, Stephan Bergmann wrote: > On 11/9/22 10:09, Martin Liška wrote: >> I noticed I modified Makefile.in files in the Sphinx series. While I was >> supposed to modifiky Makefile.am and use automake. I'm going to fix that >> soon. > > A recent master build against (apparently too

Re: [committed] libstdc++: Avoid redundant checks in std::use_facet [PR103755]

2022-11-13 Thread Stephan Bergmann via Gcc-patches
On 11/12/22 03:47, Jonathan Wakely wrote: On Fri, 11 Nov 2022 at 21:00, Stephan Bergmann wrote: On 11/11/22 06:30, Jonathan Wakely via Gcc-patches wrote: As discussed in the PR, this makes it three times faster to construct iostreams objects. Tested x86_64-linux. Pushed to trunk. I

Re: [PATCH (pushed)] sphinx: fix building if sphinx-build is missing

2022-11-13 Thread Stephan Bergmann via Gcc-patches
On 11/9/22 10:09, Martin Liška wrote: I noticed I modified Makefile.in files in the Sphinx series. While I was supposed to modifiky Makefile.am and use automake. I'm going to fix that soon. A recent master build against (apparently too old) python3-sphinx-5.0.2-2.fc37.noarch failed for me

[PATCH] libstdc++: Fix python/ not making install directories

2022-11-13 Thread Arsen Arsenović via Gcc-patches
I'm unsure why this issue only started manifesting now with how old this code is, but this should fix it. libstdc++-v3/ChangeLog: * python/Makefile.am: Call mkinstalldirs before INSTALL_DATA when installing gdb scripts. * python/Makefile.in: Regenerate. --- Hi, Someone

[committed] hppa: Skip guality tests on hppa*-*-hpux*

2022-11-13 Thread John David Anglin
Committed to trunk. Dave --- Skip guality tests on hppa-hpux. The guality check command hangs. This causes TCL errors in other tests and slows testsuite execution. 2022-11-13 John David Anglin gcc/testsuite/ChangeLog: * g++.dg/guality/guality.exp: Skip on hppa*-*-hpux*. *

Re: [PATCH] doc: Ada: include Indices and Tables in manuals

2022-11-13 Thread Arnaud Charlet via Gcc-patches
> >> Sorry for the breakage. However, I contacted you (and your colleague) and > >> haven't received > >> any feedback for a couple of weeks. > > > > Right although I did give you feedback that what you sent wasn’t in a > > suitable form for review wrt Ada. > > Sure, but sending a patch set to

[PATCH] aarch64: Add support for Ampere-1A (-mcpu=ampere1a) CPU

2022-11-13 Thread Philipp Tomsich
This patch adds support for Ampere-1A CPU: - recognize the name of the core and provide detection for -mcpu=native, - updated extra_costs, - adds a new fusion pair for (A+B+1 and A-B-1). Ampere-1A and Ampere-1 have more timing difference than the extra costs indicate, but these don't propagate

Re: [PATCH] RISC-V: optimize '(a >= 0) ? b : 0' to srai + andn, if compiling for Zbb

2022-11-13 Thread Philipp Tomsich
Applied to master. Thanks! --Philipp. On Sun, 13 Nov 2022 at 01:24, Jeff Law wrote: > > > On 11/8/22 12:54, Philipp Tomsich wrote: > > If-conversion is turning '(a >= 0) ? b : 0' into a branchless sequence > > not a5,a0 > > sraia5,a5,63 > > and a0,a1,a5 > > missing

Re: Announcement: Porting the Docs to Sphinx - tomorrow

2022-11-13 Thread Martin Liška
On 11/11/22 22:10, Sandra Loosemore wrote: > On 11/11/22 13:52, Gerald Pfeifer wrote: >> On Tue, 8 Nov 2022, Martin Liška wrote: >>> After the migration, people should be able to build (and install) GCC >>> even if they miss Sphinx (similar happens now if you miss makeinfo). >> >> My nightly

[PATCH] doc: Update Jeff Law's email-address in contrib.rst

2022-11-13 Thread Philipp Tomsich
Applied to master as obvious. ChangeLog: * doc/contrib.rst: Update Jeff Law's email address. Signed-off-by: Philipp Tomsich --- doc/contrib.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/contrib.rst b/doc/contrib.rst index 96bf2a56af4..15e358b7903 100644

[PATCH (pushed)] sphinx: include todolist only if INCLUDE_TODO env. set

2022-11-13 Thread Martin Liška
It is confusing that 'Indexes and tables' contains TODO. One gets Index by clicking to the Index link. PR web/107643 ChangeLog: * doc/baseconf.py: Set include_todo tag if INCLUDE_TODO env is set. * doc/indices-and-tables.rst: Use include_todo tag. ---

Re: [PATCH v2] RISC-V: costs: support shift-and-add in strength-reduction

2022-11-13 Thread Philipp Tomsich
Applied to master. Thanks! Note that the multiply-by-200 (in the testcase) originates from Dhrystone. Philipp. On Sun, 13 Nov 2022 at 02:23, Jeff Law wrote: > > > On 11/10/22 14:34, Philipp Tomsich wrote: > > The strength-reduction implementation in expmed.cc will assess the > > profitability

[RFC PATCH] ipa-cp: Speculatively call specialized functions

2022-11-13 Thread Christoph Muellner
From: mtsamis The IPA CP pass offers a wide range of optimizations, where most of them lead to specialized functions that are called from a call site. This can lead to multiple specialized function clones, if more than one call-site allows such an optimization. If not all call-sites can be

[PATCH (pushed)] configure: always set SPHINX_BUILD

2022-11-13 Thread Martin Liška
During the Sphinx-migration development, I used SPHINX_BUILD='' in order to skip building info and manual pages in gcc folder. However, we've got HAS_SPHINX_BUILD which is the correct flag for that. With the patch, one will get a nicer error message when sphinx-build is missing and one builds

[RFC PATCH] ipa-guarded-deref: Add new pass to dereference function pointers

2022-11-13 Thread Christoph Muellner
From: Christoph Müllner This patch adds a new pass that looks up function pointer assignments, and adds guarded direct calls to the call sites of the function pointers. E.g.: Lets assume an assignment to a function pointer as follows: b->cb = Other part of the program can use the

Re: [PATCH] doc: Ada: include Indices and Tables in manuals

2022-11-13 Thread Martin Liška
On 11/13/22 13:26, Arnaud Charlet wrote: > >> Sorry for the breakage. However, I contacted you (and your colleague) and >> haven't received >> any feedback for a couple of weeks. > > Right although I did give you feedback that what you sent wasn’t in a > suitable form for review wrt Ada.

Re: [PATCH] doc: Ada: include Indices and Tables in manuals

2022-11-13 Thread Arnaud Charlet via Gcc-patches
> Sorry for the breakage. However, I contacted you (and your colleague) and > haven't received > any feedback for a couple of weeks. Right although I did give you feedback that what you sent wasn’t in a suitable form for review wrt Ada. Arno

Re: ginclude: C2x header version macros

2022-11-13 Thread Richard Biener via Gcc-patches
> Am 12.11.2022 um 19:18 schrieb Joseph Myers : > > C2x adds __STDC_VERSION_*_H__ macros to individual headers with > interface changes compared to C17. All the new header features in > headers provided by GCC have now been implemented, so define those > macros to the value given in the

[PATCH] c++, v2: Implement CWG2635 - Constrained structured bindings

2022-11-13 Thread Jakub Jelinek via Gcc-patches
On Sat, Nov 12, 2022 at 12:23:56PM +0100, Jakub Jelinek wrote: > The following patch implements CWG2635. > > So far tested on > GXX_TESTSUITE_STDS=98,11,14,17,20,2b make check-g++ > RUNTESTFLAGS="dg.exp=decomp*" > ok for trunk if it passes full bootstrap/regtest and it is voted in? Here is

[PATCH] c++, v2: Implement C++23 P2647R1 - Permitting static constexpr variables in constexpr functions

2022-11-13 Thread Jakub Jelinek via Gcc-patches
On Fri, Nov 11, 2022 at 06:07:04PM +0100, Jakub Jelinek wrote: > The following patch on top of Marek's P2448 PR106649 patch > (mainly because that patch implements the previous __cpp_constexpr > feature test macro bump so this can't go in earlier; OT, > P2280R4 doesn't have any feature test

[PATCH] c++, v2: Implement CWG 2654 - Un-deprecation of compound volatile assignments

2022-11-13 Thread Jakub Jelinek via Gcc-patches
On Fri, Nov 11, 2022 at 08:43:04AM +0100, Jakub Jelinek wrote: > Again, because stage1 close is near, posting the following patch > to implement CWG 2654. > > Ok for trunk if it passes bootstrap/regtest and is voted into C++23 > and C++20 as a DR? Here is an updated patch that passed

Re: [PATCH] doc: Ada: include Indices and Tables in manuals

2022-11-13 Thread Martin Liška
On 11/11/22 18:25, Arnaud Charlet wrote: > >> Similarly to other manuals, we should include the page >> in HTML builder. >> >> What Ada folks think about it? > > The latest changes have broken our build of the Ada doc at AdaCore so until > further notice, please do not make any additional

Re: [committed] libstdc++: Add C++20 clocks

2022-11-13 Thread Jonathan Wakely via Gcc-patches
On Sun, 13 Nov 2022 at 01:17, Jonathan Wakely via Libstdc++ wrote: > > Tested x86_64-linux and powerpc64le-linux. Pushed to trunk. > > -- >8 -- > > Also add the basic types for timezones, without the non-inline > definitions needed to actually use them. This is the patch for the rest of the time

Re: [PATCH 3/5] Fortran: Narrow return types [PR78798]

2022-11-13 Thread Bernhard Reutner-Fischer via Gcc-patches
On Sun, 13 Nov 2022 12:13:26 +0200 Janne Blomqvist wrote: > On Sun, Nov 13, 2022 at 1:47 AM Bernhard Reutner-Fischer via Fortran > wrote: > > --- a/gcc/fortran/arith.cc > > +++ b/gcc/fortran/arith.cc > > @@ -1135,7 +1135,7 @@ compare_complex (gfc_expr *op1, gfc_expr *op2) > > strings. We

Re: [PATCH 3/5] Fortran: Narrow return types [PR78798]

2022-11-13 Thread Janne Blomqvist via Gcc-patches
On Sun, Nov 13, 2022 at 1:47 AM Bernhard Reutner-Fischer via Fortran wrote: > --- a/gcc/fortran/arith.cc > +++ b/gcc/fortran/arith.cc > @@ -1135,7 +1135,7 @@ compare_complex (gfc_expr *op1, gfc_expr *op2) > strings. We return -1 for a < b, 0 for a == b and 1 for a > b. > We use the

Re: Proxy ping [PATCH] Fortran: diagnostics for actual arguments to pointer dummy arguments [PR94104]

2022-11-13 Thread Mikael Morin
Le 09/11/2022 à 21:50, Harald Anlauf via Fortran a écrit : Dear all, Jose posted a patch here that was never reviewed: https://gcc.gnu.org/pipermail/fortran/2021-June/056162.html I think the diagnostics improvement is helpful, as it adjusts to the changes from F2003 to F2008. The patch

  1   2   >