Re: [PING][PATCH] libstdc++: atomic: Add missing clear_padding in __atomic_float constructor

2024-03-25 Thread xndcn
Wow, thank you all, you guys! 在 2024年3月14日星期四,Jonathan Wakely 写道: > On Fri, 16 Feb 2024 at 15:15, Jonathan Wakely wrote: > > > > On Fri, 16 Feb 2024 at 14:10, Jakub Jelinek wrote: > > > > > > On Fri, Feb 16, 2024 at 01:51:54PM +, Jonathan Wakely wrote: > > > > Ah, although

Re: [PATCH] libstdc++: atomic: Add missing clear_padding in __atomic_float constructor

2024-02-02 Thread xndcn
ltin_clear_padding in __atomic_float constructor. * testsuite/29_atomics/atomic_float/compare_exchange_padding.cc: New test. Signed-off-by: xndcn --- libstdc++-v3/include/bits/atomic_base.h | 2 +- .../atomic_float/compare_exchange_padding.cc | 53 +++ 2 files changed,

Re: [PATCH] libstdc++: atomic: Add missing clear_padding in __atomic_float constructor

2024-01-31 Thread xndcn
c_base.h: add __builtin_clear_padding in __atomic_float constructor. * testsuite/lib/dg-options.exp: add new add-options for libatomic_16b. * testsuite/29_atomics/atomic_float/compare_exchange_padding.cc: New test. Signed-off-by: xndcn --- libstdc++-v3/include/bits/atomic_base.h | 7

[PING][PATCH] libstdc++: atomic: Add missing clear_padding in __atomic_float constructor

2024-01-30 Thread xndcn
Ping, thanks. I do not have access to the repo, anyone can please help me submit the patch? Thanks. xndcn 于2024年1月17日周三 00:16写道: > > Sorry about the mangled content... > So I add a new add-options for libatomic_16b: > > --- > libstdc++-v3/ChangeLog: > > * include

Re: [PATCH] libstdc++: atomic: Add missing clear_padding in __atomic_float constructor

2024-01-24 Thread xndcn
Hi, is it OK for trunk? I do not have access to the repo, can you please help me submit the patch? Thanks. xndcn 于2024年1月17日周三 00:16写道: > > Sorry about the mangled content... > So I add a new add-options for libatomic_16b: > > --- > libstdc++-v3/ChangeLog: > > * include

Re: [PATCH] libstdc++: atomic: Add missing clear_padding in __atomic_float constructor

2024-01-16 Thread xndcn
features. proc add_options_for_using-deprecated { flags } { return "$flags -U_GLIBCXX_USE_DEPRECATED -D_GLIBCXX_USE_DEPRECATED=1" -- 2.25.1 Xi Ruoyao 于2024年1月16日周二 18:12写道: > > On Tue, 2024-01-16 at 17:53 +0800, xndcn wrote: > > Thanks, so I add a test: atomic_float/co

Re: [PATCH] libstdc++: atomic: Add missing clear_padding in __atomic_float constructor

2024-01-16 Thread xndcn
|| [istarget riscv*-*-*] || ([istarget sparc*-*-linux-gnu] && [check_effective_target_ilp32]) + || ([istarget i?86-*-*] || [istarget x86_64-*-*]) } { global TOOL_OPTIONS -- 2.25.1 H.J. Lu 于2024年1月15日周一 11:46写道: > On Sun, Jan 7, 2024, 5:02 PM xndcn wrote: > >> Hi, I found __atomic_float

[PING][PATCH] libstdc++: atomic: Add missing clear_padding in __atomic_float constructor

2024-01-14 Thread xndcn
Ping. Thanks. xndcn 于2024年1月8日周一 09:01写道: > Hi, I found __atomic_float constructor does not clear padding, > while __compare_exchange assumes it as zeroed padding. So it is easy to > reproducing a infinite loop in X86-64 with long double type like: > --- > -O0 -std=c++23 -

[PATCH] libstdc++: atomic: Add missing clear_padding in __atomic_float constructor

2024-01-07 Thread xndcn
Hi, I found __atomic_float constructor does not clear padding, while __compare_exchange assumes it as zeroed padding. So it is easy to reproducing a infinite loop in X86-64 with long double type like: --- -O0 -std=c++23 -mlong-double-80 #include #include #define T long double int main() {

Re: Ping: [PATCH] enable ATOMIC_COMPARE_EXCHANGE opt for floating type or types contains padding

2024-01-04 Thread xndcn
, is it enough to generate the mask by simple bit operations? Thanks!, xndcn --- static bool gimple_fold_builtin_clear_padding (gimple_stmt_iterator *gsi) { ... /* This should be folded during the lower pass. */ gcc_assert (!gimple_in_ssa_p (cfun) && cfun->cfg == NULL); Jakub Jeli

Ping: [PATCH] enable ATOMIC_COMPARE_EXCHANGE opt for floating type or types contains padding

2024-01-03 Thread xndcn
for float/double types, while there is no regression for long double type. Thanks, xndcn gcc/ChangeLog: * gimple-fold.cc (optimize_atomic_compare_exchange_p): enable for SCALAR_FLOAT_TYPE_P type of expected var, or if TYPE_PRECISION is different from mode's bitsize

[PING][PATCH] enable ATOMIC_COMPARE_EXCHANGE opt for floating type or types contains padding

2023-12-26 Thread xndcn
Ping, thanks. I did some benchmarks, and there is some significant time optimization for float/double types, while there is no regression for long double type.

[PATCH] gimple-fold.cc: enable ATOMIC_COMPARE_EXCHANGE opt for floating type or types contain padding

2023-12-18 Thread xndcn
mode's bitsize, try to keep track all the bits and mix it with VIEW_CONVERT_EXPR(expected). Signed-off-by: xndcn --- gcc/gimple-fold.cc | 77 ++ 1 file changed, 71 insertions(+), 6 deletions(-) diff --git a/gcc/gimple-fold.cc b/gcc/gimple-fold.cc

[PATCH] enable ATOMIC_COMPARE_EXCHANGE opt for floating type or types contains padding

2023-12-18 Thread xndcn
Hi, I noticed PR71716 and I want to enable ATOMIC_COMPARE_EXCHANGE internal-fn optimization for floating type or types contains padding (e.g., long double). Please tell me if I happen to make any mistakes, Thanks! Firstly, about the concerns of sNaNs float/double value, it seems work well and

Re: [PATCH] tree-cfg: Fix misleading error message in verify_gimple_assign_single

2023-12-11 Thread xndcn
Thanks, now I have totally understand! I think it deserves a clearer prompt, but I do not have a better idea currently. So forget it, thanks! 在 2023年12月11日星期一,Richard Biener 写道: > On Mon, Dec 11, 2023 at 12:39 PM xndcn wrote: > > > > Got it, thanks! It is really confusing >

Re: [PATCH] tree-cfg: Fix misleading error message in verify_gimple_assign_single

2023-12-11 Thread xndcn
Got it, thanks! It is really confusing >,< What about the first one? For case MEM_REF. 在 2023年12月11日星期一,Richard Biener 写道: > On Sun, Dec 10, 2023 at 4:00 PM xndcn wrote: > > > > Hi, I am a newbie in GCC, and I do not have access to git repo. > > > > I fou

[PATCH] tree-cfg: Fix misleading error message in verify_gimple_assign_single.

2023-12-10 Thread xndcn
gcc/ChangeLog: * tree-cfg.cc (verify_gimple_assign_single): Fix misleading error, from "invalid LHS ..." to "invalid RHS ..." Signed-off-by: xndcn --- gcc/tree-cfg.cc | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/gcc/tree-cfg.cc b/g

[PATCH] tree-cfg: Fix misleading error message in verify_gimple_assign_single

2023-12-10 Thread xndcn
Sorry about the attachment, re-paste here

[PATCH] tree-cfg: Fix misleading error message in verify_gimple_assign_single

2023-12-10 Thread xndcn
fe Mon Sep 17 00:00:00 2001 From: xndcn Date: Sun, 10 Dec 2023 22:38:16 +0800 Subject: [PATCH] tree-cfg: Fix misleading error message in verify_gimple_assign_single. gcc/ChangeLog: * tree-cfg.cc (verify_gimple_assign_single): Fix misleading error, from "invalid LHS ..." to "inv