Re: Builtin for consulting value analysis (better ffs() code gen)
在 2024-03-14 23:33, Andrew Cooper via Gcc 写道: And for x86's arch_ffs(), unsigned int arch_ffs(unsigned int x) { unsigned int res; if ( __builtin_constant_p(x > 0) && x > 0 ) { // Well defined when x is known non-zero asm("bsf %1, %0" : "=r"(res) : "rm"(x)); Even if you may assume that the destination operand is always destroyed, the hardware has no knowledge about that, so this statement has a dependency on `res`, and shouldn't be declared `=r`. I think it's better to remove this `if`. The other branch below clearly eliminates the dependency. } else { // The architects say this is safe even for 0. res = -1; asm("bsf %1, %0" : "+r"(res) : "rm"(x)); } return res + 1; } -- Best regards, LIU Hao OpenPGP_signature.asc Description: OpenPGP digital signature
Re: [RFC] add regenerate Makefile target
On Wed, 20 Mar 2024 at 16:34, Simon Marchi wrote: > > On 3/18/24 13:25, Christophe Lyon wrote: > > Well the rule to regenerate Makefile.in (eg in in opcodes/) is a bit > > more complex > > than just calling automake. IIUC it calls automake --foreign it any of > > *.m4 file from $(am__configure_deps) that is newer than Makefile.in > > (with an early exit in the loop), does nothing if Makefile.am or > > doc/local.mk are newer than Makefile.in, and then calls 'automake > > --foreign Makefile' > > The rules looks complex because they've been generated by automake, this > Makefile.in is not written by hand. And I guess automake has put > `--foreign` there because foreign is used in Makefile.am: Yes, I know :-) > > AUTOMAKE_OPTIONS = foreign no-dist > > But a simple call so `automake -f` (or `autoreconf -f`) just works, as > automake picks up the foreign option from AUTOMAKE_OPTIONS, so a human > or an external script who wants to regenerate things would probably just > use that. Indeed. I guess my concern is: if some change happens to Makefile.am/Makefile.in which would imply that 'autoreconf -f' would not work, how do we make sure autoregen.py (or whatever script) is updated accordingly? Or maybe whatever change is made to Makefile.am/Makefile.in, 'autoreconf -f' is supposed to handle it without additional flag? > > > The bot I want to put in place would regenerate things as they are > > supposed to be, then build and run the testsuite to make sure that > > what is supposed to be committed would work (if the committer > > regenerates everything correctly) > > For your job, would it be fine to just force-regenerate everything and > ignore timestamps (just like the buildbot's autoregen job wants to do)? > It would waste a few cycles, but it would be much simpler. > Yes, that would achieve the purpose: be able to handle as many patches as possible in precommit-CI. And as described earlier, for binutils this currently means: autoregen confgure --enable-maintainer-mode make all (with a low -j value otherwise we have random build failures) and my proposal to workaround the problem with -j is to do make all-bfd all-libiberty regenerate -j1 make all -j XXX Another possibility would be a policy change in how patches are submitted, to require that they contain all the autogenerated files. > Simon
gcc-11-20240321 is now available
Snapshot gcc-11-20240321 is now available on https://gcc.gnu.org/pub/gcc/snapshots/11-20240321/ and on various mirrors, see https://gcc.gnu.org/mirrors.html for details. This snapshot has been generated from the GCC 11 git branch with the following options: git://gcc.gnu.org/git/gcc.git branch releases/gcc-11 revision c1c32d29e05fa1ea3f9ebf9f9b7a132abc7acbad You'll find: gcc-11-20240321.tar.xz Complete GCC SHA256=84eebbd5a6ec9f97350e978fd0344aa2abd9757fbb962058752892182ed515bd SHA1=0a77d7605c183d93558b92e08cb9ee3e8b0cecd8 Diffs from 11-20240314 are available in the diffs/ subdirectory. When a particular snapshot is ready for public consumption the LATEST-11 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.
Interest in Contributing to OpenACC Support & Code Offloading Projects for GSOC
Hello, I hope this message finds you well. My name is Soumya Ranjan, and I hold a Bachelor's degree in Electrical Engineering and a Master's in Computer Engineering. I am currently working as a Firmware Engineer at Qualcomm Wireless R&D. I recently discovered your organization and the exciting GSOC projects you are proposing, namely "Offloading to a separate process on the same host" and "Enhance OpenACC support." I am writing to express my enthusiastic interest in potentially contributing to either of these projects and to inquire about the next steps to formally apply or draft a proposal. My academic journey was enriched with substantial coursework in operating systems and parallel computing, sparking a deep interest in efficient computational strategies and optimizations. My professional experience has further developed my skills in C/C++, offloading compilation, and inter-process communication. Given this foundation, I am confident in my capacity to make a meaningful contribution to either the project focused on enhancing debugging capabilities for offloaded code or the one aimed at filling the existing gaps in OpenACC support, depending on where my skills can be best utilized. I realize I am reaching out at a time when proposals are likely already underway. I apologize for this timing and am committed to diligently catching up. I've started to familiarize myself with the "Before You Apply" guidelines on your website to ensure I understand the necessary preparatory steps. Could you kindly advise if there are any additional specific steps I should follow or particular aspects of either project you would recommend focusing on in my proposal? The prospect of contributing to advancements in either domain is highly motivating to me, and I am keen to align my efforts with the project's most pressing needs. I am eager to learn more about how I can integrate into your team and contribute effectively. I believe this opportunity aligns perfectly with my professional aspirations and skills, and I am excited about the potential collaboration. Thank you very much for considering my application. I look forward to the opportunity to further discuss how I can contribute to the success of your project. Warm regards, Soumya Ranjan