[PATCH] Improve handling of unknown sign bit in CCP.

2021-08-08 Thread Roger Sayle
This middle-end patch implements several related improvements to tree-ssa's conditional (bit) constant propagation pass. The current code handling ordered comparisons contains the comment "If the most significant bits are not known we know nothing" which is not entirely true [this test even preve

[PATCH] Recognize highpart multiplication during RTL expansion

2021-08-08 Thread Roger Sayle
This middle-end patch teaches RTL expansion to recognize widening multiplications followed by right shifts as highpart multiplications, and attempt to emit them using the backends [su]mul_highpart optab if possible. My first attempt at supporting this, from August 2020, is at: https://gcc.gnu.or

[PATCH] Recognize highpart multiplication during RTL expansion

2021-08-08 Thread Roger Sayle
Doh! ENOPATCH. This time with attachments... https://gcc.gnu.org/pipermail/gcc-patches/2021-August/576922.html Roger -- diff --git a/gcc/config/nvptx/nvptx.md b/gcc/config/nvptx/nvptx.md index 108de1c..2b18f6a 100644 --- a/gcc/config/nvptx/nvptx.md +++ b/gcc/config/nvptx/nvptx.md @@ -614,6 +614

[PATCH 0/3] jit: Add support for weak linkage

2021-08-08 Thread Petter Tomner via Gcc-patches
Hi, To implement generics/C++ template-ish with libgccjit it would be very useful to have the possibility to declare functions and variables with weak linkage, to be able to have independent AOT compilation of object files without needing to keep track of what is "instantiated" where to prevent

[PATCH 1/3] jit: Add support for weak linkage

2021-08-08 Thread Petter Tomner via Gcc-patches
This patch adds support for weak linkage variables and functions in libgccjit. 'gcc_jit_context_new_function()' and 'gcc_jit_context_new_global()' gets one new enum value each which specifies weak linkage. The macro 'LIBGCCJIT_HAVE_WEAK_SYMBOLS' indicates weak linkage support. Analogous to de

[PATCH 2/3] jit: Add support for weak linkage

2021-08-08 Thread Petter Tomner via Gcc-patches
This patch has a test case for weak linkage as well as modification of helper functions. Essentially it produces two object files, one with weak and one with normal symbols, and a main which prints the values of those two symbols and a cehck to ensure that the normal symbols' values are printed.

[PATCH 3/3] jit: Add support for weak linkage

2021-08-08 Thread Petter Tomner via Gcc-patches
This patch updates the documentation concerning the addition of weak linkage for 'gcc_jit_context_new_function()' and 'gcc_jit_context_new_global()'. The documentation needs regeneration. gcc/jit/docs/topics/ * compilation.rst * expressions.rst * functions.rst --- gcc/j

[committed] Fix c6x test compromised by recent improvements to bswap & rotates

2021-08-08 Thread Jeff Law via Gcc-patches
The recent improvements to bswap & rotates from Roger compromised a test on the c6x port. Essentially it optimized away a rotate by adjusting the subsequent test of the result.  This is good ;-) Fixing the test is trivial.  We just need to extract the rotate idiom into its own function and ins

Re: [PATCH] Fix typo in fold-vec-load-builtin_vec_xl-* tests.

2021-08-08 Thread Bill Schmidt via Gcc-patches
Hi Mike, FWIW, looks fine to me, if tests are all passing now. Bill On 8/5/21 9:44 PM, Michael Meissner wrote: [PATCH] Fix typo in fold-vec-load-builtin_vec_xl-* tests. When I checked in the fix for running tests on power10 systems with power10 code generation, I had a typo in the fold-vec-lo

Re: [PATCH 03/34] rs6000: Add the rest of the [altivec] stanza to the builtins file

2021-08-08 Thread Bill Schmidt via Gcc-patches
Hi Segher, On 8/6/21 7:01 PM, Segher Boessenkool wrote: Hi! On Thu, Jul 29, 2021 at 08:30:50AM -0500, Bill Schmidt wrote: + const vsc __builtin_altivec_abss_v16qi (vsc); +ABSS_V16QI altivec_abss_v16qi {} + + const vsi __builtin_altivec_abss_v4si (vsi); +ABSS_V4SI altivec_abss_v4si {}

[committed] Fix dg-prune-output

2021-08-08 Thread François Dumont via Gcc-patches
This is a trivial fix following a recent change on __glibcxx_assert.     libstdc++: Fix dg-prune-output assertion message     Since __glibcxx_assert changes in r6b42b5a the generated assertion message     has changed.     libstdc++-v3/ChangeLog:     * testsuite/25_algorithms/copy/deb

Re: [PATCH] Use _GLIBCXX_ASSERTIONS as _GLIBCXX_DEBUG light

2021-08-08 Thread François Dumont via Gcc-patches
After further testing here a fixed version which imply less changes. Moreover I already commit the fixes unrelated with this patch.     libstdc++: [_GLIBCXX_ASSERTIONS] Activate basic debug checks     libstdc++-v3/ChangeLog:     * include/bits/stl_algobase.h (equal): Use runtime-only

Re: [PATCH] Fix typo in fold-vec-load-builtin_vec_xl-* tests.

2021-08-08 Thread Segher Boessenkool
On Thu, Aug 05, 2021 at 10:44:36PM -0400, Michael Meissner wrote: > * gcc.target/powerpc/fold-vec-load-builtin_vec_xl-char.c: Fix > typo in regular expression. > * gcc.target/powerpc/fold-vec-load-builtin_vec_xl-double.c: > Likewise. > * gcc.target/powerpc/fold-vec-loa

Re: [PATCH] x86: Optimize load of const all 1s float vectors

2021-08-08 Thread Uros Bizjak via Gcc-patches
On Sat, Aug 7, 2021 at 4:41 PM H.J. Lu wrote: > > Update vector_all_ones_operand to return true for const all 1s float > vectors. > > gcc/ > > PR target/101804 > * config/i386/predicates.md (vector_all_ones_operand): Return > true for const all 1s float vectors. > > gcc/tes

Re: [PATCH 03/34] rs6000: Add the rest of the [altivec] stanza to the builtins file

2021-08-08 Thread Segher Boessenkool
Hi! On Sun, Aug 08, 2021 at 11:53:38AM -0500, Bill Schmidt wrote: > On 8/6/21 7:01 PM, Segher Boessenkool wrote: > >On Thu, Jul 29, 2021 at 08:30:50AM -0500, Bill Schmidt wrote: > >>+ const vsc __builtin_altivec_abss_v16qi (vsc); > >>+ABSS_V16QI altivec_abss_v16qi {} > >>+ > >>+ const vsi __

Re: [PATCH 03/34] rs6000: Add the rest of the [altivec] stanza to the builtins file

2021-08-08 Thread Bill Schmidt via Gcc-patches
Hi... On 8/8/21 3:27 PM, Segher Boessenkool wrote: Hi! On Sun, Aug 08, 2021 at 11:53:38AM -0500, Bill Schmidt wrote: On 8/6/21 7:01 PM, Segher Boessenkool wrote: On Thu, Jul 29, 2021 at 08:30:50AM -0500, Bill Schmidt wrote: + const vsc __builtin_altivec_abss_v16qi (vsc); +ABSS_V16QI alt

Re: [committed] Fix dg-prune-output

2021-08-08 Thread Jonathan Wakely via Gcc-patches
On Sun, 8 Aug 2021, 20:26 François Dumont via Libstdc++, < libstd...@gcc.gnu.org> wrote: > This is a trivial fix following a recent change on __glibcxx_assert. > > libstdc++: Fix dg-prune-output assertion message > > Since __glibcxx_assert changes in r6b42b5a the generated assertion > me

Re: [PATCH] Fix loop split incorrect count and probability

2021-08-08 Thread Xionghu Luo via Gcc-patches
Thanks, On 2021/8/6 19:46, Richard Biener wrote: > On Tue, 3 Aug 2021, Xionghu Luo wrote: > >> loop split condition is moved between loop1 and loop2, the split bb's >> count and probability should also be duplicated instead of (100% vs INV), >> secondly, the original loop1 and loop2 count need be

Re: [PATCH] Add the member integer_to_sse to processor_cost as a cost simulation for movd/pinsrd. It will be used to calculate the cost of vec_construct.

2021-08-08 Thread Hongtao Liu via Gcc-patches
On Tue, Aug 3, 2021 at 7:12 PM Hongtao Liu wrote: > > On Tue, Aug 3, 2021 at 6:20 PM Richard Biener > wrote: > > > > On Tue, Aug 3, 2021 at 11:20 AM Richard Biener > > wrote: > > > > > > On Wed, Jul 28, 2021 at 4:51 AM Hongtao Liu via Gcc-patches > > > wrote: > > > > > > > > On Tue, Jul 27, 202

[PATCH v2] rs6000: Add vec_unpacku_{hi,lo}_v4si

2021-08-08 Thread Kewen.Lin via Gcc-patches
Hi Bill, Thanks for the comments! on 2021/8/6 下午9:10, Bill Schmidt wrote: > Hi Kewen, > > On 8/4/21 9:06 PM, Kewen.Lin wrote: >> Hi, >> >> The existing vec_unpacku_{hi,lo} supports emulated unsigned >> unpacking for short and char but misses the support for int. >> This patch adds the support fo

Re: [PATCH 0/4] drop version checks for in-tree gas [PR91602]

2021-08-08 Thread Jeff Law via Gcc-patches
On 7/20/2021 9:44 AM, Serge Belyshev wrote: Special-casing checks for in-tree gas features is unnecessary since r17 which made configure-gcc depend on all-gas, and thus making alternate code path in gcc_GAS_CHECK_FEATURE for in-tree gas redundant. Along the way this fixes PR 91602, which

Re: [PATCH] Fix loop split incorrect count and probability

2021-08-08 Thread Feng Xue OS via Gcc-patches
Yes. Condition to to switch two versioned loops is "true", the first two arguments should be 100% and 0%. It is different from normal loop split, we could not deduce exactly precise probability for condition-based loop split, since cfg inside loop2 would be changed. (invar-branch is replaced to

Re: [ARM] PR98435: Missed optimization in expanding vector constructor

2021-08-08 Thread Prathamesh Kulkarni via Gcc-patches
On Fri, 6 Aug 2021 at 17:31, Christophe Lyon wrote: > > > > On Fri, Aug 6, 2021 at 11:51 AM Prathamesh Kulkarni > wrote: >> >> On Fri, 6 Aug 2021 at 14:49, Christophe Lyon >> wrote: >> > >> > >> > >> > On Fri, Aug 6, 2021 at 11:00 AM Prathamesh Kulkarni >> > wrote: >> >> >> >> On Thu, 5 Aug 2

Re: [PATCH 0/4] drop version checks for in-tree gas [PR91602]

2021-08-08 Thread Serge Belyshev via Gcc-patches
Jeff Law writes: > On 7/20/2021 9:44 AM, Serge Belyshev wrote: >> Special-casing checks for in-tree gas features is unnecessary since >> r17 which made configure-gcc depend on all-gas, and thus making >> alternate code path in gcc_GAS_CHECK_FEATURE for in-tree gas >> redundant. >> >> Along th

[PATCH AArch64]Fix expanding of %w for *extend... pattern

2021-08-08 Thread bin.cheng via Gcc-patches
Hi, When playing with std::experimental::simd, I found a bug newly introduced in AArch64 backend. As commit message describes: 7 Pattern "*extend2_aarch64" is duplicated 8 from the corresponding zero_extend pattern, however % needs 9 to be expanded according to its mode iterator