[PATCH 1/5] Move char_type_p prototype into c-common.h

2017-02-22 Thread Xi Ruoyao
This patch moves prototype of char_type_p into c-common.h, so we can use it in c-family/*. gcc/ChangeLog: 2017-02-22 Xi Ruoyao <r...@stu.xidian.edu.cn> * c-family/c-common.h (char_type_p): New prototype * c/c-typeck.c (char_type_p): Make the function extern *

[PATCH 0/5] New warning: -Wstring-plus-int (PR c++/62181)

2017-02-22 Thread Xi Ruoyao
Hi, I've implemented -Wstring-plus-int (like the one in CLANG) for GCC. I've bootstrapped GCC with my patches and runned dejaGNU tests. My patches are for both C and C++ (like CLANG). Unlike CLANG, this option is not enabled by default (or GCC won't bootstrap with -Werror). Xi Ruoyao (5

[PATCH 3/5] c: New warning option -Wstring-plus-int

2017-02-22 Thread Xi Ruoyao
This patch adds warning option -Wstring-plus-int for C. gcc/ChangeLog: 2017-02-22  Xi Ruoyao  <r...@stu.xidian.edu.cn> * c/c-typeck.c (parser_build_binary_op, build_modify_expr): checking for -Wstring-plus-int ---  gcc/c/c-typeck.c | 28  1 file chang

[PATCH 4/5] Document warning option -Wstring-plus-int

2017-02-22 Thread Xi Ruoyao
This patch adds document of -Wstring-plus-int. gcc/ChangeLog: 2017-02-22  Xi Ruoyao  <r...@stu.xidian.edu.cn> * doc/invoke.texi (Warning Options): Document -Wstring-plus-int ---  gcc/doc/invoke.texi | 8 +++-  1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/g

[PATCH 5/5] New tests for -Wstring-plus-int

2017-02-22 Thread Xi Ruoyao
This patch adds tests for -Wstring-plus-int. gcc/ChangeLog: 2017-02-22  Xi Ruoyao  <r...@stu.xidian.edu.cn> * testsuite/c-c++-common/Wstring-plus-int.c: New test * testsuite/g++.dg/Wstring-plus-int-1.C: New test * testsuite/g++.dg/Wstring-plus-int-2.C: Ne

[PATCH 2/5] c++: New warning option -Wstring-plus-int

2017-02-22 Thread Xi Ruoyao
This patch adds warning option -Wstring-plus-int for C++. gcc/ChangeLog: 2017-02-22  Xi Ruoyao  <r...@stu.xidian.edu.cn> * c-family/c-common.h (maybe_warn_string_plus_int): new prototype * c-family/c-warn.h (maybe_warn_string_plus_int): new function * c-family/c-op

Re: [PATCH 4/5] Document warning option -Wstring-plus-int

2017-02-27 Thread Xi Ruoyao
lly > the description is correct, since character constants are integers. > > Perhaps add something like > >   "A typical example this warns about is @samp{"abc" + 'd'}." > > ? Thanks for the advise. I'll make it clear and resubmit the patches in early s

[PATCH][PR c++/80038][6/7 Regression] Destroy temps for _Cilk_spawn calling in the child

2017-03-23 Thread Xi Ruoyao
and copying with function call).  The pedigree operations are merged into built-in __cilkrts_detach (just like libcilkrts cilk_fake.h). Bootstrapped and regtested on x86_64-linux-gnu. The patch has 500+ lines so I attach it.  ChangeLog is pasted here: 2017-03-24  Xi Ruoyao  <r...@stu.xidian.edu.cn

Re: [PATCH][PR c++/80038][6/7 Regression] Destroy temps for _Cilk_spawn calling in the child

2017-03-23 Thread Xi Ruoyao
On 2017-03-24 05:26 +0800, Xi Ruoyao wrote: > The patch has 500+ lines so I attach it.  ChangeLog is pasted here: Damn it... I attached the draft of patch where some useless functions had not been removed. This time the attachment is correct. > 2017-03-24  Xi Ruoyao  <r...@stu.xidi

Re: [PATCH] Destroy arguments for _Cilk_spawn calling in the child (PR 80038)

2017-04-14 Thread Xi Ruoyao
On 2017-04-14 15:00 +0800, Xi Ruoyao wrote: > On 2017-04-13 09:05 +0200, Richard Biener wrote: > > > Did you verify LTO bootstrap still works with the patch? > > I've just done a LTO bootstrapp (boarding a train :) ).  > It works with my patch. I've done dejagnu tests

Re: [PATCH] Destroy arguments for _Cilk_spawn calling in the child (PR 80038)

2017-04-14 Thread Xi Ruoyao
On 2017-04-13 09:05 +0200, Richard Biener wrote: > Did you verify LTO bootstrap still works with the patch? I've just done a LTO bootstrapp (boarding a train :) ).  It works with my patch. -- Xi Ruoyao <r...@stu.xidian.edu.cn> School of Aerospace Science and Technology, Xidian University

[PATCH] Remove __gnu_pbds::detail::binary_heap::is_heap (PR libstdc++/62045)

2017-03-10 Thread Xi Ruoyao
Hi, The ill-formed checking in binary_heap::push_heap has made it O(n). Remove this checking. Since assert_valid also checks if (*this) is a legal heap, we can remove is_heap and the assertions using it completely. Bootstrapped and tested on x86_64-linux-gnu. 2017-03-09  Xi Ruoyao  &l

[PATCH] Remove __gnu_pbds::detail::binary_heap::is_heap (PR libstdc++/62045) [resend]

2017-03-10 Thread Xi Ruoyao
and tested on x86_64-linux-gnu. 2017-03-09  Xi Ruoyao  <r...@stu.xidian.edu.cn> PR libstdc++/62045: * include/ext/pb_ds/qdetail/binary_heap_/binary_heap_.hpp   (is_heap): Remove.   (push_heap): Remove the wrong checking using is_heap.   (make_heap):

[PATCH] Use fixed_nonglobal_reg_set to deduce ok_regs (PR rtl-optimization/79728)

2017-03-06 Thread Xi Ruoyao
. Bootstrapped/regtested on x86_64-linux-gnu. Is this ok for trunk? 2017-03-06  Xi Ruoyao  <r...@stu.xidian.edu.cn> PR rtl-optimization/79728 * reginfo.c (init_reg_sets_1): Use fixed_nonglobal_reg_set (instead of fixed_regs) to deduce ok_regs. * gcc.targe

[PATCH] Destroy arguments for _Cilk_spawn calling in the child (PR 80038)

2017-03-31 Thread Xi Ruoyao
ot;middle-end". Maybe we should reclassify PR 80038 and modify the ChangeLog as well. This patch has been bootstrapped and regtested in x86_64-linux-gnu.  Is it OK for trunk? -- Xi Ruoyao <r...@stu.xidian.edu.cn> School of Aerospace Science and Technology, Xidian University From dfbce2c4

Re: [PATCH] Destroy arguments for _Cilk_spawn calling in the child (PR 80038)

2017-04-07 Thread Xi Ruoyao
my patch ICEed with _Cilk_spawn and -flto -O3 -fcilkplus since __cilkrts_stack_frame.ctx's type (array of void *) was not TYPE_STRUCTURAL_EQUALITY_P in lto stage. If this change is not proper, I'll work on modifying my patch to work without touching in_lto_p. -- Xi Ruoyao <r...@stu.xidian.ed

Re: [PATCH 2/5] c++: New warning option -Wstring-plus-int

2017-04-28 Thread Xi Ruoyao
tch.  I'm not keen on  > the way we stash away the arguments into orig_argX.  Perhaps he's got a  > better suggestion. In the recent version of Clang, this warning options has been seperated into two options -Wstring-plus-int and -Wstring-plus-char.  Maybe I should do the same. -

[PATCH v2] Destroy arguments for _Cilk_spawn calling in the child (PR 80038)

2017-04-28 Thread Xi Ruoyao
On 2017-04-28 08:42 -0600, Jeff Law wrote: > On 04/28/2017 08:31 AM, Xi Ruoyao wrote: > > Should I prepare (re-diff) a patch for current trunk? > If you want for the trunk, yes. Rediff for current GCC trunk. -- Xi Ruoyao <r...@stu.xidian.edu.cn> School of Aerospace Science and

Re: [PATCH] Destroy arguments for _Cilk_spawn calling in the child (PR 80038)

2017-04-28 Thread Xi Ruoyao
er it's been on the trunk for at least a week. > I just noticed GCC 7.0 has been frozen. -- Xi Ruoyao <r...@stu.xidian.edu.cn> School of Aerospace Science and Technology, Xidian University

[PATCH] Implement non-trivial std::random_device::entropy (PR libstdc++/67578)

2017-05-18 Thread Xi Ruoyao
This patch use ioctl to get entropy of std::random_device using /dev/random and /dev/urandom. Regenerated files are mentioned in ChangeLog but not included in the patch. 2017-03-12  Xi Ruoyao  <r...@stu.xidian.edu.cn> PR libstdc++/67578 * config.h.in: Rege

[PATCH] Avoid signed overflow in num_get::_M_extract_int (PR libstdc++/67214)

2017-05-18 Thread Xi Ruoyao
This UB has been hiding so long... 2017-03-11  Xi Ruoyao  <r...@stu.xidian.edu.cn> PR libstdc++/67214 * include/bits/locale_facets.tcc (_M_extract_int):   Add explicit conversion to avoid signed overflow. ---  libstdc++-v3/include/bits/locale_facets.tcc | 3 ++-  

Re: [PATCH 2/6] New warnings -Wstring-plus-{char, int} (PR c++/62181)

2017-06-22 Thread Xi Ruoyao
On 2017-06-19 12:44 -0600, Martin Sebor wrote: > On 06/19/2017 11:28 AM, Xi Ruoyao wrote: > > On 2017-06-19 10:51 -0600, Martin Sebor wrote: > > > On 06/11/2017 07:32 PM, Xi Ruoyao wrote: > > > > This patch adds warning option -Wstring-plus-int for C/C++.

Re: [PATCH 2/6] New warnings -Wstring-plus-{char, int} (PR c++/62181)

2017-06-19 Thread Xi Ruoyao
On 2017-06-19 10:51 -0600, Martin Sebor wrote: > On 06/11/2017 07:32 PM, Xi Ruoyao wrote: > > This patch adds warning option -Wstring-plus-int for C/C++. > > > > gcc/ChangeLog: > > > > 2017-06-12  Xi Ruoyao  <r...@stu.xidian.edu.cn> > > > >

Re: [PATCH 2/6] New warnings -Wstring-plus-{char, int} (PR c++/62181)

2017-06-19 Thread Xi Ruoyao
On 2017-06-19 12:44 -0600, Martin Sebor wrote: > On 06/19/2017 11:28 AM, Xi Ruoyao wrote: > > On 2017-06-19 10:51 -0600, Martin Sebor wrote: > > > On 06/11/2017 07:32 PM, Xi Ruoyao wrote: > > > > This patch adds warning option -Wstring-plus-int for C/C++.

Re: [PATCH 3/6] New warnings -Wstring-plus-{char, int} (PR c++/62181)

2017-06-19 Thread Xi Ruoyao
On 2017-06-19 10:30 -0600, Martin Sebor wrote: > On 06/11/2017 07:34 PM, Xi Ruoyao wrote: > > This patch adds warning option -Wstring-plus-char for C/C++. > > > > +void > +warn_if_string_plus_char (location_t loc, tree ptrtype, tree inttype) > +{ >

Re: [PATCH] Avoid signed overflow in num_get::_M_extract_int (PR libstdc++/67214)

2017-05-20 Thread Xi Ruoyao
On 2017-05-19 15:38 +0100, Jonathan Wakely wrote: > On 18/05/17 19:10 +0800, Xi Ruoyao wrote: > > This UB has been hiding so long... > > Indeed! Thanks for the patch. > > > 2017-03-11  Xi Ruoyao  <r...@stu.xidian.edu.cn> > > > > PR libstdc++/6721

Re: [PATCH] Implement non-trivial std::random_device::entropy (PR libstdc++/67578)

2017-05-22 Thread Xi Ruoyao
On 2017-05-22 14:00 +0100, Jonathan Wakely wrote: > On 18/05/17 19:27 +0800, Xi Ruoyao wrote: > > This patch use ioctl to get entropy of std::random_device using > > /dev/random and /dev/urandom. > > This is a nice addition, thanks. > > N.B. I couldn't apply your patc

Re: [PATCH] Implement non-trivial std::random_device::entropy (PR libstdc++/67578)

2017-05-22 Thread Xi Ruoyao
On 2017-05-22 14:50 +0100, Jonathan Wakely wrote: > On 22/05/17 21:41 +0800, Xi Ruoyao wrote: > > On 2017-05-22 14:00 +0100, Jonathan Wakely wrote: > > > On 18/05/17 19:27 +0800, Xi Ruoyao wrote: > > > > This patch use ioctl to get entropy of std::random_device usin

[PATCH v2] Implement non-trivial std::random_device::entropy (PR libstdc++/67578)

2017-05-22 Thread Xi Ruoyao
On 2017-05-22Mon的 14:50 +0100, Jonathan Wakely wrote: > On 22/05/17 21:41 +0800, Xi Ruoyao wrote: > > On 2017-05-22 14:00 +0100, Jonathan Wakely wrote: > > > On 18/05/17 19:27 +0800, Xi Ruoyao wrote: > > > > This patch use ioctl to get entropy of std::random_de

[PATCH 0/6] New warnings -Wstring-plus-{char, int} (PR c++/62181)

2017-06-11 Thread Xi Ruoyao
or by -Wall/-Wextra later. Xi Ruoyao (6):   Move char_type_p prototype into c-common.h   New warning option -Wstring-plus-int   New warning option -Wstring-plus-char   New tests for -Wstring-plus-int   New tests for -Wstring-plus-char   Document new warning options  gcc/c-family/c-common.c

[PATCH 4/6] New warnings -Wstring-plus-{char, int} (PR c++/62181)

2017-06-11 Thread Xi Ruoyao
This patch adds tests for -Wstring-plus-int. gcc/ChangeLog: 2017-06-12  Xi Ruoyao  <r...@stu.xidian.edu.cn> * testsuite/c-c++-common/Wstring-plus-int.c: New test. * testsuite/g++.dg/Wstring-plus-int-1.C: Ditto. * testsuite/g++.dg/Wstring-plus-int-2.C: Ditto. --

[PATCH 5/6] New warnings -Wstring-plus-{char, int} (PR c++/62181)

2017-06-11 Thread Xi Ruoyao
This patch adds tests for -Wstring-plus-char. gcc/ChangeLog: 2017-06-12  Xi Ruoyao  <r...@stu.xidian.edu.cn> * testsuite/c-c++-common/Wstring-plus-char.c: New test. * testsuite/g++.dg/Wstring-plus-char-1.C: Ditto. * testsuite/g++.dg/Wstring-plus-char-2.C:

[PATCH 6/6] New warnings -Wstring-plus-{char, int} (PR c++/62181)

2017-06-11 Thread Xi Ruoyao
This patch adds document of -Wstring-plus-int and -Wstring-plus-char. gcc/ChangeLog: 2017-06-12  Xi Ruoyao  <r...@stu.xidian.edu.cn> * doc/invoke.texi (Warning Options): Document -Wstring-plus-int and -Wstring-plus-char. ---  gcc/doc/invoke.texi | 22 +++

[PATCH 1/6] New warnings -Wstring-plus-{char, int} (PR c++/62181)

2017-06-11 Thread Xi Ruoyao
This patch moves prototype of char_type_p into c-common.h, so we can use it in c-family/*. gcc/ChangeLog: 2017-06-12  Xi Ruoyao  <r...@stu.xidian.edu.cn> * c-family/c-common.h (char_type_p): New prototype. * c/c-typeck.c (char_type_p): Make the function extern. *

[PATCH 3/6] New warnings -Wstring-plus-{char, int} (PR c++/62181)

2017-06-11 Thread Xi Ruoyao
This patch adds warning option -Wstring-plus-char for C/C++. gcc/ChangeLog: 2017-06-12  Xi Ruoyao  <r...@stu.xidian.edu.cn> * c-family/c-common.h (warn_if_string_plus_char): New prototype. * c-family/c-warn.c (warn_if_string_plus_char): New function. * c-family

[PATCH 2/6] New warnings -Wstring-plus-{char, int} (PR c++/62181)

2017-06-11 Thread Xi Ruoyao
This patch adds warning option -Wstring-plus-int for C/C++. gcc/ChangeLog: 2017-06-12  Xi Ruoyao  <r...@stu.xidian.edu.cn> * c-family/c.opt: New option -Wstring-plus-int. * c-family/c-common.c (pointer_int_sum): Checking for -Wstring-plus-int. ---  gcc/c-fa

[PING PATCH 0/6] New warnings -Wstring-plus-{char, int} (PR c++/62181)

2017-06-19 Thread Xi Ruoyao
On 2017-06-12 09:26 +0800, Xi Ruoyao wrote: > Hi, > > I've implemented -Wstring-plus-int and -Wstring-plus-char (like their > counterpart in Clang) for GCC. > > This series of patch has been bootstrapped and regtested.  OK for trunk? > > Currently these options are not

Re: [PATCH v2] Destroy arguments for _Cilk_spawn calling in the child (PR 80038)

2017-05-02 Thread Xi Ruoyao
t; ../../gcc/c-family/cilk.c:115:9: note: in expansion of macro 'EXPR_CILK_SPAWN' >  EXPR_CILK_SPAWN (TREE_OPERAND (fcall, 1)) = 1; >  ^ > > Andreas. > Sorry T_T.  I've made a stupid mistake in tree.h. Let's apply following patch, and alert the RM wh

Re: [PATCH, gcc-7-branch] Backport PR80038

2017-09-05 Thread Xi Ruoyao
On 2017-08-24 20:17 +0800, Xi Ruoyao wrote: > On 2017-08-22 10:17 +0200, Richard Biener wrote: > > > > Ok for the gcc 7 branch. > > > > Well, I think I should say I don't have SVN write access... Still not installed. Make a rediff. We don't have a Cilk mainta

Re: [PATCH, gcc-7-branch] Backport PR80038

2017-08-24 Thread Xi Ruoyao
On 2017-08-22 10:17 +0200, Richard Biener wrote: > > Ok for the gcc 7 branch. > Well, I think I should say I don't have SVN write access... -- Xi Ruoyao <r...@stu.xidian.edu.cn> School of Aerospace Science and Technology, Xidian University

Re: [PATCH, gcc-7-branch] Backport PR80038

2017-08-21 Thread Xi Ruoyao
On 2017-08-21 23:37 +0800, Xi Ruoyao wrote: > On 2017-04-25 09:30 -0600, Jeff Law wrote: > > On 04/14/2017 06:44 PM, Xi Ruoyao wrote: > > > On 2017-04-14 15:00 +0800, Xi Ruoyao wrote: > > > > On 2017-04-13 09:05 +0200, Richard Biener wrote: > > > > &g

[PATCH, gcc-7-branch] Backport PR80038

2017-08-21 Thread Xi Ruoyao
On 2017-04-25 09:30 -0600, Jeff Law wrote: > On 04/14/2017 06:44 PM, Xi Ruoyao wrote: > > On 2017-04-14 15:00 +0800, Xi Ruoyao wrote: > > > On 2017-04-13 09:05 +0200, Richard Biener wrote: > > > > > > > Did you verify LTO bootstrap still works with the p

Re: [PATCH] Fix symver attribute with LTO

2019-12-17 Thread Xi Ruoyao
sion script). And foo (VERS_2) would be missing. With this patch foo (VERS_2) would show up. We can't mark "foo_v2" to be "global" because it should not be a part of DSO ABI. The other 1% chance would be a regression in Binutils. -- Xi Ruoyao School of Aerospace Science and Technology, Xidian University pr48200.tar.gz Description: application/compressed-tar

[PATCH] Fix symver attribute with LTO

2019-12-16 Thread Xi Ruoyao
an be built with LTO enabled and no problem. I'll test symver patch and this patch with more packages. Bootstrapped/regtested x86_64-linux. I'm not a maintainer. gcc/ChangeLog: 2019-12-17 Xi Ruoyao * cgraph.h (symtab_node::used_from_object_file_p): Symver nodes are part of DS

Re: [PATCH] Fix symver attribute with LTO

2019-12-18 Thread Xi Ruoyao
believe we should consider symver targets to be externally visible in cgraph_externally_visible_p. There is a comment saying "if linker counts on us, we must preserve the function". That's true in our case. And, I think .globl .LSYMVER0 .set.LSYMVER0, foo_v2 .symver .LSYMVER0, foo@@VERS_2 is

Re: [PATCH] Fix symver attribute with LTO

2019-12-18 Thread Xi Ruoyao
2. Add some mangled symbol name in GCC (like ".LSYMVERx" or "foo_v2.symver_export"). -- Xi Ruoyao School of Aerospace Science and Technology, Xidian University

Re: [PATCH] Fix symver attribute with LTO

2019-12-18 Thread Xi Ruoyao
ymbol, it will inline > calls to it and do other things), while in the second case we need to > treat foo_v2 specially. > > So if it's safe we can force a ".globl foo_v2" before ".symver foo_v2, > > foo@@VERS_2". But I can't prove it's safe so I think it's better to > > consider > > this case in cgraph_externally_visible_p. > > It sort of makes things work, but for example it will prevent gcc from > inlining calls to foo_v2. I think we will still need to do something > about -fvisibility=hidden. > > It is sad that we do not have way to produce symbol version without a > corresponding symbol of global visiblity. If we had we could support > multiple symver aliases from one symbol and avoid the need to explicitly > hide the unnecesary symbols in the map files... Explicitly hiding the unnecessary symbols in map files is now how we handle this [with __asm__(".symver foo_v2, foo@@VERS_2")]. We can continue to do in this way and leave it as an enhancement. -- Xi Ruoyao School of Aerospace Science and Technology, Xidian University

Re: [PATCH] Fix symver attribute with LTO

2019-12-18 Thread Xi Ruoyao
erminated. /usr/bin/ld: error: lto-wrapper failed collect2: error: ld returned 1 exit status make: *** [Makefile:4: obj/test.so] Error 1 The change to lto/lto-common.c makes sense. I tried it instead of my change to cgraph.h and everything is OK. I'll investigate the change to varasm.c a little. -- Xi Ruoyao School of Aerospace Science and Technology, Xidian University

Re: [PATCH] Fix symver attribute with LTO

2019-12-19 Thread Xi Ruoyao
r clams the symbol is unused, never bring internal > - symbols that are declared by user as used or externally visible. > - This is needed for i.e. references from asm statements. */ > - if (used_from_object_file_p ()) > -return true; Are these two lines removed intentionally? >if (reso

Re: [PATCH] Fix symver attribute with LTO

2019-12-19 Thread Xi Ruoyao
On 2019-12-19 19:12 +0800, Xi Ruoyao wrote: > On 2019-12-19 11:06 +0100, Jan Hubicka wrote: > > - /* See if we have linker information about symbol not being used or > > - if we need to make guess based on the declaration. > > + /* Limitation of gas requires us to out

Re: [PATCH] MIPS: Fix PR target/98491 (ChangeLog)

2021-02-12 Thread Xi Ruoyao
Well, it just dislike my mail server :(. Switch to the mail server of my university. On 2021-02-12 22:54 +0800, Xi Ruoyao wrote: > Resend the mail.  I had to fill in a form to send mail to Robert. > > On 2021-02-12 22:17 +0800, Xi Ruoyao wrote: > > On 2021-01-11 01:01 +0800,

[PATCH] LoongArch: Use fcmp.caf.s instead of movgr2cf for zeroing a fcc

2023-10-17 Thread Xi Ruoyao
During the review of a LLVM change [1], on LA464 we found that zeroing a fcc with fcmp.caf.s is much faster than a movgr2cf from $r0. [1]: https://github.com/llvm/llvm-project/pull/69300 gcc/ChangeLog: * config/loongarch/loongarch.md (movfcc): Use fcmp.caf.s for zeroing a fcc.

Re: [PATCH v1] LoongArch: Add modifiers for lsx and lasx.

2023-11-07 Thread Xi Ruoyao
On Tue, 2023-11-07 at 19:10 +0800, Xi Ruoyao wrote: > On Tue, 2023-11-07 at 12:06 +0800, chenxiaolong wrote: > > +__m128i  a,b,c; > > + > > +__asm__ ("vadd.d %w0,%w1,%w2\n\t" > > +   :"=f" (c) > > +   :"f" (a),"f" (b) &g

Re: [PATCH v1] LoongArch: Add modifiers for lsx and lasx.

2023-11-07 Thread Xi Ruoyao
1.c:6:1: error: inconsistent operand constraints in an ‘asm’ 6 | __asm__ ("vadd.d %w0,%w1,%w2\n\t" Please recheck. -- Xi Ruoyao School of Aerospace Science and Technology, Xidian University

Pushed: [PATCH v2] LoongArch: Define HAVE_AS_TLS to 0 if it's undefined [PR112299]

2023-10-31 Thread Xi Ruoyao
Pushed r14-5030. The subject and ChangeLog are updated to include the PR number. The code change is same as v1. On Mon, 2023-10-30 at 20:44 +0800, chenglulu wrote: > > 在 2023/10/30 下午8:26, Xi Ruoyao 写道: > > On Mon, 2023-10-30 at 19:50 +0800, chenglulu wrote: > > > 在

Re: [PATCH] LoongArch: Define HAVE_AS_TLS to 0 if it's undefined

2023-10-30 Thread Xi Ruoyao
On Mon, 2023-10-30 at 19:50 +0800, chenglulu wrote: > 在 2023/10/30 下午7:42, Xi Ruoyao 写道: > > Now loongarch.md uses HAVE_AS_TLS, we need this to fix the failure > > building a cross compiler if the cross assembler is not installed yet. > > > > gcc/ChangeLog: >

[PATCH] LoongArch: Define HAVE_AS_TLS to 0 if it's undefined

2023-10-30 Thread Xi Ruoyao
Now loongarch.md uses HAVE_AS_TLS, we need this to fix the failure building a cross compiler if the cross assembler is not installed yet. gcc/ChangeLog: * config/loongarch/loongarch-opts.h (HAVE_AS_TLS): Define to 0 if not defined yet. --- Ok for trunk?

[PATCH] LoongArch: Optimize single-used address with -mexplicit-relocs=auto for fld/fst

2023-11-05 Thread Xi Ruoyao
fld and fst have same address mode as ld.w and st.w, so the same optimization as r14-4851 should be applied for them too. gcc/ChangeLog: * config/loongarch/loongarch.md (LD_AT_LEAST_32_BIT): New mode iterator. (ST_ANY): New mode iterator. (define_peephole2): Use

[PATCH] LoongArch: Disable relaxation if the assembler don't support conditional branch relaxation [PR112330]

2023-11-05 Thread Xi Ruoyao
As the commit message of r14-4674 has indicated, if the assembler does not support conditional branch relaxation, a relocation overflow may happen on conditional branches when relaxation is enabled because the number of NOP instructions inserted by the assembler will be more than the number

[PATCH] LoongArch: Remove redundant barrier instructions before LL-SC loops

2023-11-06 Thread Xi Ruoyao
This is isomorphic to the LLVM changes [1-2]. On LoongArch, the LL and SC instructions has memory barrier semantics: - LL: + - SC: + But the compare and swap operation is allowed to fail, and if it fails the SC instruction is not executed, thus the guarantee of acquiring semantics cannot be

Re: [PATCH v7 4/4] ree: Improve ree pass for rs6000 target using defined ABI interfaces

2023-09-19 Thread Xi Ruoyao
_push (state.defs_list[0]); >       } >     reinsn_del_list.safe_push (curr_cand->insn); >     state.modified[INSN_UID (curr_cand->insn)].deleted = 1; > @@ -1345,6 +1483,10 @@ find_and_remove_re (void) >    for (unsigned int i = 0; i < reinsn_copy_list.length (); i +=

Re: [PATCH v1] Update check_effective_target_vect_int_mod according to LoongArch SX/ASX capabilities.

2023-09-24 Thread Xi Ruoyao
sx { } { > +    return [check_no_compiler_messages loongarch_asx assembly { > +   #if !defined(__loongarch_asx) > +   #error "LASX not defined" > +   #endif > +    }] > +} > + >  # Appends necessary Python flags to extra-tool-flags if Python.h is > supported. >  # Otherwise, modifies dg-do-what. >  proc dg-require-python-h { args } { -- Xi Ruoyao School of Aerospace Science and Technology, Xidian University

Re: [PATCH 0/2] Replace intl/ with out-of-tree GNU gettext

2023-09-25 Thread Xi Ruoyao
mscratch.org/lfs/view/development/chapter08/gcc.html -- Xi Ruoyao School of Aerospace Science and Technology, Xidian University

[PATCH] LoongArch: Replace UNSPEC_FCOPYSIGN with copysign RTL

2023-10-02 Thread Xi Ruoyao
When I added copysign support for LoongArch (r13-3702), we did not have a copysign RTL insn, so I had to use UNSPEC to represent the copysign instruction. Now the copysign RTX code has been added in r14-1586, so this patch removes those UNSPECs, and it uses the native RTL copysign insn. Inspired

[PATCH] LoongArch: doc: Update -m[no-]explicit-relocs for r14-4160

2023-09-25 Thread Xi Ruoyao
gcc/ChangeLog: * doc/invoke.texi: Update -m[no-]explicit-relocs for r14-4160. --- I've not regtested this as it's only a doc change. Ok for trunk? gcc/doc/invoke.texi | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/gcc/doc/invoke.texi

Re: [PATCH] LoongArch: doc: Update -m[no-]explicit-relocs for r14-4160

2023-09-25 Thread Xi Ruoyao
On Mon, 2023-09-25 at 16:26 +0800, chenglulu wrote: > LGTM! > > Thank you for your modification! Pushed r14-4250. > 在 2023/9/25 下午4:13, Xi Ruoyao 写道: > > gcc/ChangeLog: > > > > * doc/invoke.texi: Update -m[no-]explicit-relocs for r14-4160. > > --- >

Re: [PATCH v1] Update check_effective_target_vect_int_mod according to LoongArch SX/ASX capabilities.

2023-09-25 Thread Xi Ruoyao
or isa options, but pr104992.c failed because > it expected result with "vect_int_mod returns 1" but it was compiled > without -mlsx/-mlasx. Seems pr104992.c is invoked by gcc.dg/dg.exp, > pr104992.c is not affected by DEFAULT_CFLAGS, so we still need to check > if LSX/LASX is available in vect_int_mod. > > Other parts of new patch is still WIP. -- Xi Ruoyao School of Aerospace Science and Technology, Xidian University

Re: [PATCH] Support g++ 4.8 as a host compiler.

2023-10-04 Thread Xi Ruoyao
using g++ 4.8 as a host compiler. AFAIK G++ 5.1 also has a bug (https://gcc.gnu.org/PR65801) breaking building recent GCC. I don't think it's really "maintainable" to ensure current GCC able to be built with a buggy host compiler. -- Xi Ruoyao School of Aerospace Science and Technology, Xidian University

Re: [PATCH] LoongArch: Reimplement multilib build option handling.

2023-10-07 Thread Xi Ruoyao
o. > > P.S. Currently support for "f32" is not active, and it should probably be > avoided if you want to build a working rootfs. -- Xi Ruoyao School of Aerospace Science and Technology, Xidian University

Pushed: [PATCH] LoongArch: Use fcmp.caf.s instead of movgr2cf for zeroing a fcc

2023-10-18 Thread Xi Ruoyao
On Wed, 2023-10-18 at 09:34 +0800, chenglulu wrote: > > 在 2023/10/17 下午10:24, WANG Xuerui 写道: > > > > On 10/17/23 22:06, Xi Ruoyao wrote: > > > During the review of a LLVM change [1], on LA464 we found that zeroing > > "an" LLVM change (because t

[PATCH 3/5] LoongArch: Use explicit relocs for TLS access with -mexplicit-relocs=auto

2023-10-19 Thread Xi Ruoyao
The linker does not know how to relax TLS access for LoongArch, so let's emit machine instructions with explicit relocs for TLS. gcc/ChangeLog: * config/loongarch/loongarch.cc (loongarch_explicit_relocs_p): Return true for TLS symbol types if -mexplicit-relocs=auto.

[PATCH 5/5] LoongArch: Document -mexplicit-relocs={auto,none,always}

2023-10-19 Thread Xi Ruoyao
gcc/ChangeLog: * doc/invoke.texi (-mexplicit-relocs=style): Document. (-mexplicit-relocs): Document as an alias of -mexplicit-relocs=always. (-mno-explicit-relocs): Document as an alias of -mexplicit-relocs=none. (-mcmodel=extreme): Mention

[PATCH 0/5] LoongArch: Better balance between relaxation and scheduling

2023-10-19 Thread Xi Ruoyao
the compiler to use explicit relocs for these cases, but assembler macros for other cases. Use it as the default if the assembler supports both explicit relocs and relaxation. LTO-bootstrapped and regtested on loongarch64-linux-gnu. Ok for trunk? Xi Ruoyao (5): LoongArch: Add enum-style

[PATCH 1/5] LoongArch: Add enum-style -mexplicit-relocs= option

2023-10-19 Thread Xi Ruoyao
To take a better balance between scheduling and relaxation when -flto is enabled, add three-way -mexplicit-relocs={auto,none,always} options. The old -mexplicit-relocs and -mno-explicit-relocs options are still supported, they are mapped to -mexplicit-relocs=always and -mexplicit-relocs=none. The

[PATCH 2/5] LoongArch: Use explicit relocs for GOT access when -mexplicit-relocs=auto and LTO during a final link with linker plugin

2023-10-19 Thread Xi Ruoyao
If we are performing LTO for a final link and linker plugin is enabled, then we are sure any GOT access may resolve to a symbol out of the link unit (otherwise the linker plugin will tell us the symbol should be resolved locally and we'll use PC-relative access instead). Produce machine

[PATCH 4/5] LoongArch: Use explicit relocs for addresses only used for one load or store with -mexplicit-relocs=auto and -mcmodel={normal, medium}

2023-10-19 Thread Xi Ruoyao
In these cases, if we use explicit relocs, we end up with 2 instructions: pcalau12it0, %pc_hi20(x) ld.d t0, t0, %pc_lo12(x) If we use la.local pseudo-op, in the best scenario (x is in +/- 2MiB range) we still have 2 instructions: pcaddi t0, %pcrel_20(x) ld.d

Re: [PATCH 2/5] LoongArch: Use explicit relocs for GOT access when -mexplicit-relocs=auto and LTO during a final link with linker plugin

2023-10-21 Thread Xi Ruoyao
external symbol c, the linker may relax "la.global c" to "la.local c" (if ab.o is linked together with another file c.o which contains the definition of c) or not. As we cannot exclude the possibility of a relaxation on la.global for incremental linking, just emit la.global and let the

Pushed: [PATCH 0/5] LoongArch: Better balance between relaxation and scheduling

2023-10-23 Thread Xi Ruoyao
Pushed r14-{4848..4852}. On Thu, 2023-10-19 at 22:02 +0800, Xi Ruoyao wrote: > For relaxation we are now generating assembler macros for symbolic > addresses everywhere, but this is limiting scheduling and there are > known situations where the relaxation cannot improve the code. >

Re: [PATCH v2 2/2] LoongArch: When the code model is extreme, the symbol address is obtained through macro instructions regardless of the value of -mexplicit-relocs.

2024-01-18 Thread Xi Ruoyao
quot;) (unspec:DI [(match_dup 2) (pc)] UNSPEC_LA_PCREL_64_PART2))] With this the buggy REG_UNUSED notes were gone. But it then prevented the CSE when loading the address of __tls_get_addr (i.e. if we address 10 TLE_LD symbols in a function it would emit 10 instances of "la.global __tls_get

[PATCH] LoongArch: Disable explicit reloc for TLS LD/GD with -mexplicit-relocs=auto

2024-01-22 Thread Xi Ruoyao
Binutils 2.42 supports TLS LD/GD relaxation which requires the assembler macro. gcc/ChangeLog: * config/loongarch/loongarch.cc (loongarch_explicit_relocs_p): If la_opt_explicit_relocs is EXPLICIT_RELOCS_AUTO, return false for SYMBOL_TLS_LDM and SYMBOL_TLS_GD.

Re: [PATCH] testsuite: Make pr104992.c irrelated to target vector feature [PR113418]

2024-01-24 Thread Xi Ruoyao
On Wed, 2024-01-24 at 19:08 +0800, chenxiaolong wrote: > At 19:00 +0800 on Wednesday, 2024-01-24, Xi Ruoyao wrote: > > On Wed, 2024-01-24 at 18:32 +0800, chenxiaolong wrote: > > > On 20:09 +0800 on Tuesday, 2024-01-23, Xi Ruoyao wrote: > > > > The vect_int_mo

Re: [PATCH] testsuite: Make pr104992.c irrelated to target vector feature [PR113418]

2024-01-24 Thread Xi Ruoyao
On Wed, 2024-01-24 at 18:32 +0800, chenxiaolong wrote: > On 20:09 +0800 on Tuesday, 2024-01-23, Xi Ruoyao wrote: > > The vect_int_mod target selector is evaluated with the options in > > DEFAULT_VECTCFLAGS in effect, but these options are not automatically > > passed to

Re: [PATCH] LoongArch: Fix incorrect return type for frecipe/frsqrte intrinsic functions

2024-01-24 Thread Xi Ruoyao
n __inline float >  __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) >  __frecipe_s (float _1) >  { > -  __builtin_loongarch_frecipe_s ((float) _1); > +  return (float) __builtin_loongarch_frecipe_s ((float) _1); I don't think the (float) conversion is needed. -- Xi Ruoyao School of Aerospace Science and Technology, Xidian University

Pushed: [PATCH] MIPS: Fix wrong MSA FP vector negation

2024-02-05 Thread Xi Ruoyao
On Mon, 2024-02-05 at 09:56 +0800, YunQiang Su wrote: > Xi Ruoyao 于2024年2月5日周一 02:01写道: > > > > We expanded (neg x) to (minus const0 x) for MSA FP vectors, this is > > wrong because -0.0 is not 0 - 0.0.  This causes some Python tests to > > fail when Pytho

[PATCH] testsuite: Add a test case for negating FP vectors containing zeros

2024-02-06 Thread Xi Ruoyao
Recently I've fixed two wrong FP vector negate implementation which caused wrong sign bits in zeros in targets (r14-8786 and r14-8801). To prevent a similar issue from happening again, add a test case. Tested on x86_64 (with SSE2, AVX, AVX2, and AVX512F), AArch64, MIPS (with MSA), LoongArch

Re: LoongArch: Backport r14-4674 "LoongArch: Delete macro definition ASM_OUTPUT_ALIGN_WITH_NOP."?

2024-02-09 Thread Xi Ruoyao
On Fri, 2024-02-09 at 00:02 +0800, chenglulu wrote: > > 在 2024/2/7 上午12:23, Xi Ruoyao 写道: > > Hi Lulu, > > > > I'm proposing to backport r14-4674 "LoongArch: Delete macro definition > > ASM_OUTPUT_ALIGN_WITH_NOP." to releases/gcc-12 and releases/gcc-13

Re: LoongArch: Backport r14-4674 "LoongArch: Delete macro definition ASM_OUTPUT_ALIGN_WITH_NOP."?

2024-02-20 Thread Xi Ruoyao
On Tue, 2024-02-20 at 19:25 +0800, Xi Ruoyao wrote: > On Tue, 2024-02-20 at 10:07 +0800, chenglulu wrote: > > > So I think that without worrying about performance and ensuring that > > there is no problem > > > > with binutils, I think we can ma

Re: LoongArch: Backport r14-4674 "LoongArch: Delete macro definition ASM_OUTPUT_ALIGN_WITH_NOP."?

2024-02-20 Thread Xi Ruoyao
test failures due to "excessive errors" if running the GCC test suite with these earlier GAS versions. Maybe we'll have to add some autoconf-based probing for the linker anyway? -- Xi Ruoyao School of Aerospace Science and Technology, Xidian University

Re: LoongArch: Backport r14-4674 "LoongArch: Delete macro definition ASM_OUTPUT_ALIGN_WITH_NOP."?

2024-02-20 Thread Xi Ruoyao
On Tue, 2024-02-20 at 19:50 +0800, chenglulu wrote: > > 在 2024/2/20 下午7:31, Xi Ruoyao 写道: > > On Tue, 2024-02-20 at 19:25 +0800, Xi Ruoyao wrote: > > > On Tue, 2024-02-20 at 10:07 +0800, chenglulu wrote: > > > > > > > So I think that witho

[PATCH] LoongArch: Don't falsely claim gold supported in toplevel configure

2024-02-22 Thread Xi Ruoyao
The gold linker has never been ported to LoongArch (and it seems unlikely to be ported in the future as the new architectures are focusing on lld and/or mold for fast linkers). ChangeLog: * configure.ac (ENABLE_GOLD): Remove loongarch*-*-* from target list. * configure:

Re: [PATCH] testsuite: Add a test case for negating FP vectors containing zeros

2024-02-06 Thread Xi Ruoyao
On Tue, 2024-02-06 at 17:55 +0800, Xi Ruoyao wrote: > Recently I've fixed two wrong FP vector negate implementation which > caused wrong sign bits in zeros in targets (r14-8786 and r14-8801).  To > prevent a similar issue from happening again, add a test case. > > Tested on x86_64

LoongArch: Backport r14-4674 "LoongArch: Delete macro definition ASM_OUTPUT_ALIGN_WITH_NOP."?

2024-02-06 Thread Xi Ruoyao
eases/gcc-12 and releases/gcc-13 then? -- Xi Ruoyao School of Aerospace Science and Technology, Xidian University

Re: [C PATCH, v2] Add Walloc-size to warn about insufficient size in allocations [PR71219]

2023-12-06 Thread Xi Ruoyao
n Uecker has pointed out the alignment may be different with the different order of arguments, per C23 (N2293). With earlier versions of the standard some people believe the alignment should not be different, while the other people disagree (as the text is not very clear). -- Xi Ruoyao Sch

[PATCH] LoongArch: Expand left rotate to right rotate with negated amount

2023-12-18 Thread Xi Ruoyao
gcc/ChangeLog: * config/loongarch/loongarch.md (rotl3): New define_expand. * config/loongarch/simd.md (vrotl3): Likewise. (rotl3): Likewise. gcc/testsuite/ChangeLog: * gcc.target/loongarch/rotl-with-rotr.c: New test. *

[PATCH] middle-end: Call negate_rtx instead of simplify_gen_unary expanding rotate shift [PR113033]

2023-12-18 Thread Xi Ruoyao
With simplify_gen_unary we end up with a not fully expanded RTX like (set (reg:SI 90) (and:SI (neg:SI (reg:SI 80)) (const_int 63))) Then it will cause an ICE with unrecognizable insn. gcc/ChangeLog: PR middle-end/113033 * expmed.cc (expand_shift_1): When expanding rotate

Re: [PATCH] LoongArch: Use the movcf2gr instruction to implement cstore4

2023-12-14 Thread Xi Ruoyao
ac93f execute >      ../../gcc/gcc/ira.cc:6161 -- Xi Ruoyao School of Aerospace Science and Technology, Xidian University

Re: [PATCH] middle-end: Call negate_rtx instead of simplify_gen_unary expanding rotate shift [PR113033]

2023-12-18 Thread Xi Ruoyao
I've looked e.g. at i386 vec_init and that is exactly what it does, > see the various tests + force_reg calls in ix86_expand_vector_init*. Ok, I'm abandoning abandon this patch and I'll rework. -- Xi Ruoyao School of Aerospace Science and Technology, Xidian University

Re: [PATCH] middle-end: Call negate_rtx instead of simplify_gen_unary expanding rotate shift [PR113033]

2023-12-18 Thread Xi Ruoyao
On Mon, 2023-12-18 at 18:45 +0100, Jakub Jelinek wrote: > On Tue, Dec 19, 2023 at 12:48:46AM +0800, Xi Ruoyao wrote: > > > > gcc/ChangeLog: > > > > > > > > PR middle-end/113033 > > > > * expmed.cc (expand_shift_1): When expa

Re: [PATCH] middle-end: Call negate_rtx instead of simplify_gen_unary expanding rotate shift [PR113033]

2023-12-18 Thread Xi Ruoyao
On Mon, 2023-12-18 at 08:39 -0700, Jeff Law wrote: > > > On 12/18/23 06:42, Xi Ruoyao wrote: > > With simplify_gen_unary we end up with a not fully expanded RTX like > > > > (set (reg:SI 90) (and:SI (neg:SI (reg:SI 80)) (const_int 63))) > &g

[PATCH 0/2] LoongArch: Fix PR113033 and clean up code

2023-12-18 Thread Xi Ruoyao
up is separated into the 2nd patch to make reviewing easier. Bootstrapped and regtested on loongarch64-linux-gnu. Ok for trunk? Xi Ruoyao (2): LoongArch: Use force_reg instead of gen_reg_rtx + emit_move_insn in vec_init expander [PR113033] LoongArch: Clean up vec_init expander gcc

  1   2   3   4   5   6   7   8   9   10   >