-
Notifications
You must be signed in to change notification settings - Fork 4
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
Updates #3
Merged
Merged
Updates #3
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# MC test of sample S4E MAC instruction extensions | ||
|
||
# RUN: not llvm-mc -triple=riscv32 --mattr=+xs4emac %s 2>&1 \ | ||
# RUN: | FileCheck %s --check-prefixes=CHECK-ERROR | ||
|
||
s4e.reset_acc 0 | ||
# CHECK-ERROR: invalid operand for instruction | ||
|
||
s4e.reset_acc t1 | ||
# CHECK-ERROR: invalid operand for instruction | ||
|
||
s4e.get_acc_lo 0 | ||
# CHECK-ERROR: invalid operand for instruction | ||
|
||
s4e.get_acc_hi 0 | ||
# CHECK-ERROR: invalid operand for instruction | ||
|
||
s4e.macu_32 s5, 0 | ||
# CHECK-ERROR: invalid operand for instruction | ||
|
||
s4e.macs_32 0, a7 | ||
# CHECK-ERROR: invalid operand for instruction | ||
|
||
s4e.macu_64 s5, 0 | ||
# CHECK-ERROR: invalid operand for instruction | ||
|
||
s4e.macs_64 0, a7 | ||
# CHECK-ERROR: invalid operand for instruction |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# MC test of sample S4E MAC instruction extensions | ||
|
||
# RUN: llvm-mc -triple=riscv32 --mattr=+xs4emac -show-encoding %s \ | ||
# RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INSTR | ||
# RUN: not llvm-mc -triple riscv32 %s 2>&1 \ | ||
# RUN: | FileCheck -check-prefix=CHECK-NO-EXT %s | ||
|
||
s4e.reset_acc | ||
# CHECK-INSTR: s4e.reset_acc | ||
# CHECK-ENCODING: [0x0b,0x00,0x00,0x00] | ||
# CHECK-NO-EXT: instruction requires the following: 'XS4EMAC' (X_S4E_MAC Extension){{$}} | ||
|
||
s4e.get_acc_lo t1 | ||
# CHECK-INSTR: s4e.get_acc_lo t1 | ||
# CHECK-ENCODING: [0x0b,0x03,0x00,0x02] | ||
# CHECK-NO-EXT: instruction requires the following: 'XS4EMAC' (X_S4E_MAC Extension){{$}} | ||
|
||
s4e.get_acc_hi s9 | ||
# CHECK-INSTR: s4e.get_acc_hi s9 | ||
# CHECK-ENCODING: [0x8b,0x0c,0x00,0x04] | ||
# CHECK-NO-EXT: instruction requires the following: 'XS4EMAC' (X_S4E_MAC Extension){{$}} | ||
|
||
s4e.macu_32 s5, a7 | ||
# CHECK-INSTR: s4e.macu_32 s5, a7 | ||
# CHECK-ENCODING: [0x0b,0x90,0x1a,0x01] | ||
# CHECK-NO-EXT: instruction requires the following: 'XS4EMAC' (X_S4E_MAC Extension){{$}} | ||
|
||
s4e.macs_32 s5, a7 | ||
# CHECK-INSTR: s4e.macs_32 s5, a7 | ||
# CHECK-ENCODING: [0x0b,0x90,0x1a,0x03] | ||
# CHECK-NO-EXT: instruction requires the following: 'XS4EMAC' (X_S4E_MAC Extension){{$}} | ||
|
||
s4e.macu_64 s5, a7 | ||
# CHECK-INSTR: s4e.macu_64 s5, a7 | ||
# CHECK-ENCODING: [0x0b,0xa0,0x1a,0x01] | ||
# CHECK-NO-EXT: instruction requires the following: 'XS4EMAC' (X_S4E_MAC Extension){{$}} | ||
|
||
s4e.macs_64 s5, a7 | ||
# CHECK-INSTR: s4e.macs_64 s5, a7 | ||
# CHECK-ENCODING: [0x0b,0xa0,0x1a,0x03] | ||
# CHECK-NO-EXT: instruction requires the following: 'XS4EMAC' (X_S4E_MAC Extension){{$}} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I thought I understood any universal rule for how RISC-V instructions get named I'd be suggesting that a generation rule is placed elsewhere, but it would surely need the possibility of overriding per-instruction anyway.
As I remember it, the assembly statement was added to CoreDSL to support disassembly in the MINRES tooling and gets concatenated into a Python string (hence the "name" array of integer registers, supplemented in the FP instructions with the "f" array. If some directly addressable custom registers get added through an extension then some more generic way of labeling them will be needed). So an extension written using this approach would probably break the MINRES tooling - given how under-specified the "assembly" statement is this isn't an immediate issue, but maybe an additional "instruction" statement would be safer than extending what's there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed earlier. This mnemonic syntax is part of the CoreDSL spec and supported by the MINRES tooling. It is entirely optional but Seal5 can make use of it. The extensible compiler will not understand it but there is no need to fix this as an older commit of this repo can still be used.
Could we please merge this soon @thomasgoodfellow ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BTW the syntax change happened here: Minres/CoreDSL#80 (comment)