-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Q Extension No Longer Supported in GCC 14 #1586
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
What does This is what I get:
The So far I have been unable to identify a GCC patch on the mailing list that might have caused this change in behaviour between GCC 13 and 14. |
Maybe this is relevant...? But that change dates back 8 years or so... |
@cmuellner or @kito-cheng - would you happen to know what patches/changes caused this situation? And why? |
FWIW neither is the Nor is any I wonder if this gives a clue? Maybe when @jordancarlin - with GCC 13 did the compiler ever generate any |
Looking into the history of That said, GCC releases before GCC 14 indeed accepted Note, that Binutils has "Q" support (there is an entry for "q" in |
@TommyMurphyTM1234 @cmuellner Thanks for helping look into this. I know that Q was never listed in the march help documentation. When using Q with gcc 13 it was with assembly files, so GCC wasn’t generating any Q instructions from C, but it was able to compile them into an elf file. If this small amount of support was removed since there was no corresponding backend, what is the best path forward for assembly files that contain Q instructions? https://github.com/openhwgroup/cvw implements Q support, so our tool flow for compiling tests breaks with GCC 14 at the moment. |
Would it work for you to use the assembler instead of the compiler (e.g. |
I'm not as familiar with using the assembler directly so will need to look into it and get back to you. Thanks for the idea. |
You just invoke the assembler directly, as @cmuellner suggested by calling The documentation for the assembler is here: (Thanks for the clarifying info @cmuellner! 👍). |
Yes. Just switching to |
I suspect it has to do with a file that is #included and the assembler not supporting linking. It looks like I will need to directly call the linker first before using the assembler. |
That doesn't make sense. |
Maybe provide a small self-contained test case and people will be able to advise. |
Just for completeness on the original issue, this fails:
|
@TommyMurphyTM1234 With GCC 13 we were using the following command in a Makefile to compile tests. I've included one of the simple tests along with the linker script below. The included test doesn't actually have a Q instruction in it because that is a much more complicated test, but should be able to compile with the same options. %.elf: $(SRCDIR)/%.$(SEXT) WALLY-init-lib.h Makefile
riscv64-unknown-elf-gcc -g -o $@ -march=rv64gqc_zfa_zba_zbb_zbc_zbs_zfh_zicboz_zicbop_zicbom_zbkb_zbkx_zknd_zkne_zknh -mabi=lp64 -mcmodel=medany -nostartfiles -Tlink.ld $< I changed the Makefile to use the command below, but get a very different result now. I assume this is because it is not using the linker script. Sorry if that was unclear before. %.elf: $(SRCDIR)/%.$(SEXT) WALLY-init-lib.h Makefile
riscv64-unknown-elf-as -g -o $@ -march=rv64gqc_zfa_zba_zbb_zbc_zbs_zfh_zicboz_zicbop_zicbom_zbkb_zbkx_zknd_zkne_zknh -mabi=lp64 $< |
Oops. Meant after the assembler |
You should probably try changing it with GCC 13 first to ensure that you get the same results with your original Your modified version ONLY seems to call (I'm using |
Thanks for all the help. Our Q tests are working now. I ended up having to run just the preprocessor of gcc first to handle the #includes, then the assembler for the files that depend on Q, and finally the linker. |
The update from GCC 13 to GCC 14 seems to have broken the Q extension. Prior to #1531 including q in the march string worked correctly and compiled quad-precision floating-point instructions. Now it fails before it even begins compiling while checking march. If q is left out of the march string it (unsurprisingly) fails on unrecognized instructions when it hits a q instruction in an assembly file. The exact error message is below.
The text was updated successfully, but these errors were encountered: