-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[RISCV] Add Qualcomm uC Xqciio (External Input Output) extension #132721
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
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
12e1667
[RISCV] Add Qualcomm uC Xqciio (External Input Output) extension
hchandel 9860e14
fixup! Fix invalid test
hchandel 2bd1ff1
fixup! Address comments and failures
hchandel faa91ba
Merge branch 'main' into xqciio
lenary 441c143
clang-format
lenary 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,20 @@ | ||
# Xqciio - Qualcomm uC External Input Output extension | ||
# RUN: llvm-mc %s -triple=riscv32 -mattr=+experimental-xqciio -riscv-no-aliases -show-encoding \ | ||
# RUN: | FileCheck -check-prefixes=CHECK-ENC,CHECK-INST %s | ||
# RUN: llvm-mc -filetype=obj -triple riscv32 -mattr=+experimental-xqciio < %s \ | ||
# RUN: | llvm-objdump --mattr=+experimental-xqciio -M no-aliases --no-print-imm-hex -d - \ | ||
# RUN: | FileCheck -check-prefix=CHECK-INST %s | ||
# RUN: llvm-mc %s -triple=riscv32 -mattr=+experimental-xqciio -show-encoding \ | ||
# RUN: | FileCheck -check-prefixes=CHECK-ENC,CHECK-INST %s | ||
# RUN: llvm-mc -filetype=obj -triple riscv32 -mattr=+experimental-xqciio < %s \ | ||
# RUN: | llvm-objdump --mattr=+experimental-xqciio --no-print-imm-hex -d - \ | ||
# RUN: | FileCheck -check-prefix=CHECK-INST %s | ||
|
||
# CHECK-INST: qc.outw t0, 0(a0) | ||
# CHECK-ENC: encoding: [0x8b,0x42,0x05,0x00] | ||
qc.outw x5, (x10) | ||
|
||
|
||
# CHECK-INST: qc.inw t0, 0(a0) | ||
# CHECK-ENC: encoding: [0x8b,0x52,0x05,0x00] | ||
qc.inw x5, (x10) |
This file contains hidden or 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,40 @@ | ||
# Xqciio - Qualcomm uC External Input Output Extension | ||
# RUN: not llvm-mc -triple riscv32 -mattr=+experimental-xqciio < %s 2>&1 \ | ||
# RUN: | FileCheck -check-prefixes=CHECK,CHECK-PLUS %s | ||
# RUN: not llvm-mc -triple riscv32 -mattr=-experimental-xqciio < %s 2>&1 \ | ||
# RUN: | FileCheck -check-prefixes=CHECK,CHECK-MINUS %s | ||
|
||
# CHECK: :[[@LINE+1]]:18: error: expected register | ||
qc.outw x5, 2048(10) | ||
|
||
# CHECK-PLUS: :[[@LINE+1]]:13: error: immediate must be a multiple of 4 bytes in the range [0, 16380] | ||
qc.outw x5, x10 | ||
|
||
# CHECK-MINUS: :[[@LINE+1]]:13: error: invalid operand for instruction | ||
qc.outw x5, x10 | ||
|
||
# CHECK-PLUS: :[[@LINE+1]]:13: error: immediate must be a multiple of 4 bytes in the range [0, 16380] | ||
qc.outw x5, 4099(x10) | ||
|
||
# CHECK-MINUS: :[[@LINE+1]]:1: error: instruction requires the following: 'Xqciio' (Qualcomm uC External Input Output Extension) | ||
qc.outw x5, 2048(x10) | ||
|
||
|
||
# CHECK: :[[@LINE+1]]:19: error: expected register | ||
qc.inw x23, 16380(17) | ||
|
||
# CHECK-PLUS: :[[@LINE+1]]:13: error: immediate must be a multiple of 4 bytes in the range [0, 16380] | ||
qc.inw x23, x17 | ||
|
||
# CHECK-MINUS: :[[@LINE+1]]:13: error: invalid operand for instruction | ||
qc.inw x23, x17 | ||
|
||
# CHECK-PLUS: :[[@LINE+2]]:8: error: register must be a GPR excluding zero (x0) | ||
# CHECK-MINUS: :[[@LINE+1]]:8: error: invalid operand for instruction | ||
qc.inw x0, 16380(x17) | ||
|
||
# CHECK-PLUS: :[[@LINE+1]]:13: error: immediate must be a multiple of 4 bytes in the range [0, 16380] | ||
qc.inw x23, 16384(x17) | ||
|
||
# CHECK-MINUS: :[[@LINE+1]]:1: error: instruction requires the following: 'Xqciio' (Qualcomm uC External Input Output Extension) | ||
qc.inw x23, 16380(x17) |
This file contains hidden or 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,20 @@ | ||
# Xqciio - Qualcomm uC External Input Output Extension | ||
# RUN: llvm-mc %s -triple=riscv32 -mattr=+experimental-xqciio -riscv-no-aliases -show-encoding \ | ||
# RUN: | FileCheck -check-prefixes=CHECK-ENC,CHECK-INST %s | ||
# RUN: llvm-mc -filetype=obj -triple riscv32 -mattr=+experimental-xqciio < %s \ | ||
# RUN: | llvm-objdump --mattr=+experimental-xqciio -M no-aliases --no-print-imm-hex -d - \ | ||
# RUN: | FileCheck -check-prefix=CHECK-INST %s | ||
# RUN: llvm-mc %s -triple=riscv32 -mattr=+experimental-xqciio -show-encoding \ | ||
# RUN: | FileCheck -check-prefixes=CHECK-ENC,CHECK-INST %s | ||
# RUN: llvm-mc -filetype=obj -triple riscv32 -mattr=+experimental-xqciio < %s \ | ||
# RUN: | llvm-objdump --mattr=+experimental-xqciio --no-print-imm-hex -d - \ | ||
# RUN: | FileCheck -check-prefix=CHECK-INST %s | ||
|
||
|
||
# CHECK-INST: qc.outw t0, 2048(a0) | ||
# CHECK-ENC: encoding: [0x8b,0x42,0x05,0x20] | ||
qc.outw x5, 2048(x10) | ||
|
||
# CHECK-INST: qc.inw s7, 16380(a7) | ||
# CHECK-ENC: encoding: [0x8b,0xdb,0xf8,0xff] | ||
qc.inw x23, 16380(x17) |
This file contains hidden or 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
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.
Both this and
qc.outw
need aliases where$imm14
is omitted from the assembly - in which case the immediate value should be 0.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.
FYI, I'm looking at using MIOperandInfo to create sub-operands and change how we do parsing so we can get rid of these kinds of InstAliases.
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.
That would be good. I did wonder if there was a nice way with optional operands, but I think that gets messy as the optionality is on the immediate and not on the combination.
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.
@lenary I added aliases for both of them.