Re: LoongArch incorrect codegen for std::byte_swap
On Sat, 2024-07-27 at 17:38 -0700, Andrew Pinski via Gcc-help wrote: > On Sat, Jul 27, 2024 at 3:37 PM pifminns deettnta via Gcc > wrote: > > > > using uint_least64_t = __UINT_LEAST64_TYPE__; > > > > uint_least64_t testbswap(uint_least64_t a) noexcept > > { > > return __builtin_bswap64(a); > > } > > > > clang: > > https://godbolt.org/z/z8GTsazf4 > > > > > > _Z9testbswapm: > > revb.d $a0, $a0 > > ret > > > > > > GCC: > > > > https://godbolt.org/z/PabfxP9ve > > > > _Z9testbswapm: > > revb.4h $r4,$r4 > > revh.d $r4,$r4 > > jr $r1 > > > > It should just use revb.d for bswap, not separate them into two. > > The code generation is not wrong, just not as good. > GCC swaps bytes inside 4 half words and then swaps the half words. > > I looked into the history of GCC's code generation here and noticed it > comes from the original port when committed upstream. even the bswap32 > is also done using 2 instructions. Now I am suspecting is the original > Loongson ISA didn't have revb.d/revb.2w when the GCC port was done and > it was added afterwards and GCC port was never updated to use the new > instructions. revb.2w and revb.d are available since day one. I've no idea why they weren't used. (Also strangely there's no revb.w, so on the [still insubstantial] 32-bit LoongArch we would have to use revb.2h + rotri.w. for bswap32, but it may change before a real 32-bit CPU is launched.) I'm preparing a patch. -- Xi Ruoyao School of Aerospace Science and Technology, Xidian University
Re: Nonbootstrap build with Apple clang broken in gm2
FX Coudert writes: >> Ah yes indeed it is systematic. Many thanks for spotting this - git >> pushed GNU flex required >> https://gcc.gnu.org/pipermail/gcc-cvs/2024-July/406305.html > > Couldn’t the generated files be committed to the tree, so that flex is not > needed (unless one modifies the source). This is what is done for the other > use of flex. > > FX Thanks for the hint, yes opened PR 116123 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116123 regards, Gaius
Re: GCC 14.2 Release Candidate available from gcc.gnu.org
Since the RC I've fixed a few 14/15 C++ regressions with extremely safe patches, and wonder what you think about pushing them to the branch at this point: 115583, 115986, 115561 Sorry these came so late. Jason On Tue, Jul 23, 2024 at 8:51 AM Jakub Jelinek via Gcc wrote: > The first release candidate for GCC 14.2 is available from > > https://gcc.gnu.org/pub/gcc/snapshots/14.2.0-RC-20240723/ > ftp://gcc.gnu.org/pub/gcc/snapshots/14.2.0-RC-20240723/ > > and shortly its mirrors. It has been generated from git commit > r14-10504-ga544898f6dd6a16. > > I have so far bootstrapped and tested the release candidate on > x86_64-linux. > Please test it and report any issues to bugzilla. > > If all goes well, we'd like to release 14.2 on Tuesday, Jul 30th. > >
gcc-15-20240728 is now available
Snapshot gcc-15-20240728 is now available on https://gcc.gnu.org/pub/gcc/snapshots/15-20240728/ and on various mirrors, see https://gcc.gnu.org/mirrors.html for details. This snapshot has been generated from the GCC 15 git branch with the following options: git://gcc.gnu.org/git/gcc.git branch master revision d5f1948640815a554d106542c2e91e4e117aa3bc You'll find: gcc-15-20240728.tar.xz Complete GCC SHA256=c9654ca9307c3c30c9d631f3b0b3bb2a3683c6f38d153d414b21957dbdd5c59a SHA1=1b6c767c08df369bb80383e2371157d9d1e3efae Diffs from 15-20240721 are available in the diffs/ subdirectory. When a particular snapshot is ready for public consumption the LATEST-15 link is updated and a message is sent to the gcc list. Please do not use a snapshot before it has been announced that way.