Re: Question about constructing vector types in GIMPLE pass

2024-04-08 Thread Marc Glisse via Gcc
On Mon, 8 Apr 2024, Hanke Zhang via Gcc wrote: Hi, I've been working on strengthening auto-vectorization on intel CPUs recently. I tried to do it in the GIMPLE pass. And I noticed that some vector types in the GIMPLE code are confusing to me. The example code is here: _1 = MEM[(const __m256i_u

Re: Building gcc with "-O -g"?

2024-02-10 Thread Marc Glisse via Gcc
On Sat, 10 Feb 2024, Steve Kargl via Gcc wrote: So, how does one biulding all parts of gcc with "-O -g"? In my shell script, I have CFLAGS="-O -g" export CFLAGS CXXFLAGS="-O -g" export CXXFLAGS BOOT_CFLAGS="-O -g" export BOOT_CFLAGS ../gcc/configure --prefix=$HOME/work

Re: Expected warning maybe-uninitialized does not appear using g++13.2.0?

2023-12-21 Thread Marc Glisse via Gcc
On Thu, 21 Dec 2023, David Malcolm via Gcc wrote: On Wed, 2023-12-20 at 11:16 -0800, Eric Batchelor wrote: Hello, I unintentionally stumbled upon some strange behaviour that occurred due to a typo. I reproduced the behaviour where an object (std::string in my case) can be passed to a function

Re: Question about merging if-else blocks

2023-09-26 Thread Marc Glisse via Gcc
On Wed, 27 Sep 2023, Hanke Zhang via Gcc wrote: Hi, I have recently been working on merging if-else statement blocks, and I found a rather bizarre phenomenon that I would like to ask about. A rough explanation is that for two consecutive if-else blocks, if their if statements are exactly the

Re: Different ASM for ReLU function between GCC11 and GCC12

2023-06-19 Thread Marc Glisse via Gcc
On Mon, 19 Jun 2023, André Günther via Gcc wrote: I noticed that a simple function like auto relu( float x ) { return x > 0.f ? x : 0.f; } compiles to different ASM using GCC11 (or lower) and GCC12 (or higher). On -O3 -mavx2 the former compiles above function to relu(float): vmaxss xmm0,

Re: [PATCH] libstdc++: Add missing constexpr to simd

2023-05-22 Thread Marc Glisse via Gcc-patches
On Mon, 22 May 2023, Jonathan Wakely via Libstdc++ wrote: * subscripting vector builtins is not allowed in constant expressions Is that just because nobody made it work (yet)? Yes. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101651 and others. * if the implementation would otherwise

Re: [GSoC] Conflicted Built-in Trait Name

2023-03-25 Thread Marc Glisse via Gcc
On Sat, 25 Mar 2023, Ken Matsui via Gcc wrote: Built-in trait naming simply adds two underscores (__) to the original trait name. However, the same names are already in use for some built-in traits, such as is_void, is_pointer, and is_signed. For example, __is_void is used in the following

Re: [PATCH 2/2] libstdc++: use new built-in trait __add_const

2023-03-21 Thread Marc Glisse via Gcc-patches
On Tue, 21 Mar 2023, Ken Matsui via Libstdc++ wrote: /// add_const +#if __has_builtin(__add_const) + template +struct add_const +{ using type = __add_const(_Tp); }; +#else template struct add_const { using type = _Tp const; }; +#endif Is that really better? You asked

Re: Triggering -save-temps from the front-end code

2022-11-28 Thread Marc Glisse via Gcc
On Mon, 28 Nov 2022, Florian Weimer via Gcc wrote: * Arsen Arsenović: Hi, Florian Weimer via Gcc writes: Unfortunately, some build systems immediately delete the input source files. Is there some easy way I can dump the pre-processed and non-preprocessed sources to my log file? I tried

Re: Please, really, make `-masm=intel` the default for x86

2022-11-25 Thread Marc Glisse via Gcc
On Fri, 25 Nov 2022, LIU Hao via Gcc wrote: I am a Windows developer and I have been writing x86 and amd64 assembly for more than ten years. One annoying thing about GCC is that, for x86 if I need to write I piece of inline assembly then I have to do it twice: one in AT syntax and one in

Re: [PATCH] Optimize VEC_PERM_EXPR with same permutation index and operation [PR98167]

2022-11-16 Thread Marc Glisse via Gcc-patches
On Fri, 4 Nov 2022, Hongyu Wang via Gcc-patches wrote: This is a follow-up patch for PR98167 The sequence c1 = VEC_PERM_EXPR (a, a, mask) c2 = VEC_PERM_EXPR (b, b, mask) c3 = c1 op c2 can be optimized to c = a op b c3 = VEC_PERM_EXPR (c, c, mask) for all integer vector

Re: Different outputs in Gimple pass dump generated by two different architectures

2022-11-11 Thread Marc Glisse via Gcc
On Thu, 10 Nov 2022, Kevin Lee wrote: While looking at the failure for gcc.dg/uninit-pred-9_b.c, I observed that x86-64 and risc-v has a different output for the gimple pass since r12-4790-g4b3a325f07acebf4 . Probably since

Re: clarification question

2022-10-22 Thread Marc Glisse via Gcc
On Sat, 22 Oct 2022, Péntek Imre via Gcc wrote: https://gcc.gnu.org/backends.html by "Architecture does not have a single condition code register" do you mean it has none or do you mean it has multiple? Either. If you look at the examples below, there is a C for riscv, which has 0, and

Re: [PATCH] Optimize (X<

2022-09-14 Thread Marc Glisse via Gcc-patches
On Tue, 13 Sep 2022, Roger Sayle wrote: This patch tweaks the match.pd transformation previously added to fold (X< In https://gcc.gnu.org/onlinedocs/gcc/Integers-implementation.html , I read: "Bitwise operators act on the representation of the value including both the sign and value bits,

Re: Floating-point comparisons in the middle-end

2022-09-01 Thread Marc Glisse via Gcc
On Thu, 1 Sep 2022, Joseph Myers wrote: On Thu, 1 Sep 2022, FX via Gcc wrote: A tentative patch is attached, it seems to work well on simple examples, but for test coverage the hard part is going to be that the comparisons seem to be optimised away very easily into their non-signaling

Re: GCC 12.1 Release Candidate available from gcc.gnu.org

2022-05-02 Thread Marc Glisse via Gcc
On Mon, 2 May 2022, Boris Kolpackov wrote: Jakub Jelinek writes: The first release candidate for GCC 12.1 is available [...] There is an unfixed bogus warning that is a regression in 12 and that I think will have a pretty wide effect (any code that assigns/appends a 1-char string literal

Re: [PATCH] libstdc++: Implement std::unreachable() for C++23 (P0627R6)

2022-03-31 Thread Marc Glisse via Gcc-patches
On Thu, 31 Mar 2022, Jonathan Wakely wrote: On Thu, 31 Mar 2022 at 17:03, Marc Glisse via Libstdc++ wrote: On Thu, 31 Mar 2022, Matthias Kretz via Gcc-patches wrote: I like it. But I'd like it even more if we could have #elif defined _UBSAN __ubsan_invoke_ub("reached

Re: [PATCH] libstdc++: Implement std::unreachable() for C++23 (P0627R6)

2022-03-31 Thread Marc Glisse via Gcc-patches
On Thu, 31 Mar 2022, Matthias Kretz via Gcc-patches wrote: I like it. But I'd like it even more if we could have #elif defined _UBSAN __ubsan_invoke_ub("reached std::unreachable()"); But to my knowledge UBSAN has no hooks for the library like this (yet). -fsanitize=undefined already

Re: [PATCH] PR tree-optimization/101895: Fold VEC_PERM to help recognize FMA.

2022-03-12 Thread Marc Glisse via Gcc-patches
On Fri, 11 Mar 2022, Roger Sayle wrote: +(match vec_same_elem_p + CONSTRUCTOR@0 + (if (uniform_vector_p (TREE_CODE (@0) == SSA_NAME +? gimple_assign_rhs1 (SSA_NAME_DEF_STMT (@0)) : @0 Ah, I didn't remember we needed that, we don't seem to be very consistent about