-
Notifications
You must be signed in to change notification settings - Fork 194
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
Non-standard assembler usage #105
Comments
Historically, the behavior of the GNU assembler has been the de facto spec, though I realize that's a bit hegemonic. Philosophically, a constant value is a valid address. My preference in this case is to maximize compatibility: update the spec to clarify that constant-valued addresses are legal addresses for the purposes of |
Hi Jeremy, The erro is in the file: compliance_io.h that is managed and provided by the target. Since the compilation, linking and execution of the test is responsibility of the target, the framework cannot impose any restrictions there. If ris5cy wants the compile the tests with clang and gcc then it should change the respective compliance_io.h. I did a grep and quick glance indicates that atleast this particular case isn't occurring anywhere else in the tests. |
@aswaterman Agreed the spec needs changing, since it says "symbol". Clang is clear what is a symbol and what is a constant. Initial implementations inherently define specifications - that is common in many areas. We just need to clean up the gaps, so the spec becomes the golden reference. @neelgala It is reasonable for the compliance test suite to require compliance with the spec, but where bugs are found, responsibility for resolution needs to be placed on the target owner. So this issue should be assigned to that person. Do you know who owns the RI5CY target? |
I think @bluewww was the author of the PR for adding ri5scy. I just wanted to say that it is a bug only if RI5CY wants to be Clang compatible. The compliace framework declares a combination of SDK and Device Target as RISC-V compliant. Also, I think #107 and #106 (post resolution) should probably end up as guidelines within the Test-format spec. Maybe the RI5CY guys could fix this. |
I track it for now, but I don't really use clang. The quick fix would probably be to define a symbol with the correct constant and load that. |
The code in question doesn't actually use the constant directly, it does
this:
#define RVTEST_CUSTOM1 0x10000000
And then uses RVTEST_CUSTOM1 as an argument to a macro.
So, is the fix simple to change it to:
RVTEST_CUSTOM1 equ 0x10000000. ?
…On Wed, Apr 22, 2020 at 6:25 AM bluew ***@***.***> wrote:
I track it for now, but I don't really use clang. The quick fix would
probably be to define a symbol with the correct constant and load that.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#105 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AHPXVJRPAFAVDLX4ODCXIG3RN3V4ZANCNFSM4MN6OXTA>
.
|
The other fix (which I've mentioned elsewhere) is to change the LA in riscv-target/ri5cy/compliance_io.h to be LI. |
Same issue in compiling riscv-tests with
clang is not happy with symbol defined in ld script.
|
I have a pending LLVM MC patch to fix this. You can use |
https://reviews.llvm.org/D57319 (LLVM 9) has fixed https://reviews.llvm.org/D92293 will fix |
Is this something that can be closed now? |
No comments, so I'm closing this. Reopen if someone can show it is still failing. |
Sorry to reopen this issue.
Disassembly for
Disassembly for
|
Not sure whether this is an asm spec bug or an LLVM bug, but it doesn’t seem like a bug in this repo. I suggest raising this issue elsewhere and using your workaround locally (or use GNU tools as a workaround). |
beat me to it. That is pretty strange LLVM behavior.
…On Sat, Feb 26, 2022 at 12:21 AM Andrew Waterman ***@***.***> wrote:
Sounds like you should open the issue on LLVM, not here.
—
Reply to this email directly, view it on GitHub
<#105 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AHPXVJWU256JCMBXPAIIHQLU5CEPVANCNFSM4MN6OXTA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you modified the open/close state.Message
ID: ***@***.***>
|
OK, I have posted this issue to llvm maillist. |
This patch improves compatibility with GNU assembler by adding support for constant immediate in la and lla pseudo instruction, and expanding it in the same way as we currently expands li pseudo instruction. Links to discussion related to the above issue in the community - riscv-non-isa/riscv-arch-test#105 riscv-non-isa/riscv-arch-test#108 riscv-non-isa/riscv-arch-test#106 Reviewed By: craig.topper Differential Revision: https://reviews.llvm.org/D150133
This patch improves compatibility with GNU assembler by adding support for constant immediate in la and lla pseudo instruction, and expanding it in the same way as we currently expands li pseudo instruction. Links to discussion related to the above issue in the community - riscv-non-isa/riscv-arch-test#105 riscv-non-isa/riscv-arch-test#108 riscv-non-isa/riscv-arch-test#106 Reviewed By: craig.topper Differential Revision: https://reviews.llvm.org/D150133
The Clang/LLVM compiler is stricter than GCC in complying with the RISC-V assembler specification. If I used the latest Clang/LLVM compiler to compile the benchmarks, I get a failure. Extracting an individual test shows this:
This instruction sequence comes from the expansion of one of the standard header macros.
The error is that the RISC-V standard requires the second operand to the
la
pseudo-instruction to be a symbol, not a constant. It just happens that GCC accepts a constant - arguably a bug in GCC, certainly an unofficial extension.It seems to me that a compliance test suite should strictly follow the standard!
(this would also seem to indicate that no one is using Clang/LLVM with the compliance tests, which would certainly seem to be a good sanity check).
The text was updated successfully, but these errors were encountered: