-
Notifications
You must be signed in to change notification settings - Fork 12.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[RISCV] Add Qualcomm uC Xqciac (Load-Store Adress calculation) extens…
…ion (#121037) This extension adds 3 instructions that perform load-store address calculation. The current spec can be found at: https://github.com/quic/riscv-unified-db/releases/latest This patch adds assembler only support. --------- Co-authored-by: Harsh Chandel <hchandel@qti.qualcomm.com> Co-authored-by: Sudharsan Veeravalli <quic_svs@quicinc.com>
- Loading branch information
1 parent
02e8972
commit 1557eed
Showing
13 changed files
with
169 additions
and
3 deletions.
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
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
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
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
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
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,43 @@ | ||
# Xqciac - Qualcomm uC Load-Store Address Calculation Extension | ||
# RUN: not llvm-mc -triple riscv32 -mattr=+experimental-xqciac < %s 2>&1 \ | ||
# RUN: | FileCheck -check-prefixes=CHECK,CHECK-IMM %s | ||
# RUN: not llvm-mc -triple riscv32 -mattr=-experimental-xqciac < %s 2>&1 \ | ||
# RUN: | FileCheck -check-prefixes=CHECK,CHECK-EXT %s | ||
|
||
# CHECK: :[[@LINE+1]]:14: error: invalid operand for instruction | ||
qc.c.muladdi x5, x10, 4 | ||
|
||
# CHECK: :[[@LINE+1]]:1: error: too few operands for instruction | ||
qc.c.muladdi x15 | ||
|
||
# CHECK-IMM: :[[@LINE+1]]:24: error: immediate must be an integer in the range [0, 31] | ||
qc.c.muladdi x10, x15, 32 | ||
|
||
# CHECK-EXT: :[[@LINE+1]]:1: error: instruction requires the following: 'Xqciac' (Qualcomm uC Load-Store Address Calculation Extension) | ||
qc.c.muladdi x10, x15, 20 | ||
|
||
|
||
# CHECK: :[[@LINE+1]]:12: error: invalid operand for instruction | ||
qc.muladdi x0, x10, 1048577 | ||
|
||
# CHECK: :[[@LINE+1]]:1: error: too few operands for instruction | ||
qc.muladdi x10 | ||
|
||
# CHECK-IMM: :[[@LINE+1]]:22: error: operand must be a symbol with %lo/%pcrel_lo/%tprel_lo modifier or an integer in the range [-2048, 2047] | ||
qc.muladdi x10, x15, 8589934592 | ||
|
||
# CHECK-EXT: :[[@LINE+1]]:1: error: instruction requires the following: 'Xqciac' (Qualcomm uC Load-Store Address Calculation Extension) | ||
qc.muladdi x10, x15, 577 | ||
|
||
|
||
# CHECK: :[[@LINE+1]]:11: error: invalid operand for instruction | ||
qc.shladd 0, x10, 1048577 | ||
|
||
# CHECK: :[[@LINE+1]]:1: error: too few operands for instruction | ||
qc.shladd x10 | ||
|
||
# CHECK-IMM: :[[@LINE+1]]:26: error: immediate must be an integer in the range [4, 31] | ||
qc.shladd x10, x15, x11, 2 | ||
|
||
# CHECK-EXT: :[[@LINE+1]]:1: error: instruction requires the following: 'Xqciac' (Qualcomm uC Load-Store Address Calculation Extension) | ||
qc.shladd x10, x15, x11, 5 |
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,49 @@ | ||
# Xqciac - Qualcomm uC Load-Store Address Calculation Extension | ||
# RUN: llvm-mc %s -triple=riscv32 -mattr=+experimental-xqciac -riscv-no-aliases -show-encoding \ | ||
# RUN: | FileCheck -check-prefixes=CHECK-ENC,CHECK-INST %s | ||
# RUN: llvm-mc -filetype=obj -triple riscv32 -mattr=+experimental-xqciac < %s \ | ||
# RUN: | llvm-objdump --mattr=+experimental-xqciac -M no-aliases --no-print-imm-hex -d - \ | ||
# RUN: | FileCheck -check-prefix=CHECK-INST %s | ||
# RUN: llvm-mc %s -triple=riscv32 -mattr=+experimental-xqciac -show-encoding \ | ||
# RUN: | FileCheck -check-prefixes=CHECK-ENC,CHECK-INST %s | ||
# RUN: llvm-mc -filetype=obj -triple riscv32 -mattr=+experimental-xqciac < %s \ | ||
# RUN: | llvm-objdump --mattr=+experimental-xqciac --no-print-imm-hex -d - \ | ||
# RUN: | FileCheck -check-prefix=CHECK-INST %s | ||
|
||
# CHECK-INST: qc.c.muladdi a0, a1, 0 | ||
# CHECK-ENC: encoding: [0x8a,0x21] | ||
qc.c.muladdi x10, x11, 0 | ||
|
||
# CHECK-INST: qc.c.muladdi a0, a1, 31 | ||
# CHECK-ENC: encoding: [0xea,0x3d] | ||
qc.c.muladdi x10, x11, 31 | ||
|
||
# CHECK-INST: qc.c.muladdi a0, a1, 16 | ||
# CHECK-ENC: encoding: [0xaa,0x21] | ||
qc.c.muladdi x10, x11, 16 | ||
|
||
|
||
# CHECK-INST: qc.muladdi tp, t0, 1234 | ||
# CHECK-ENC: encoding: [0x0b,0xe2,0x22,0x4d] | ||
qc.muladdi x4, x5, 1234 | ||
|
||
# CHECK-INST: qc.muladdi a0, a1, -2048 | ||
# CHECK-ENC: encoding: [0x0b,0xe5,0x05,0x80] | ||
qc.muladdi x10, x11, -2048 | ||
|
||
# CHECK-INST: qc.muladdi a0, a1, 2047 | ||
# CHECK-ENC: encoding: [0x0b,0xe5,0xf5,0x7f] | ||
qc.muladdi x10, x11, 2047 | ||
|
||
|
||
# CHECK-INST: qc.shladd tp, t0, t1, 12 | ||
# CHECK-ENC: encoding: [0x0b,0xb2,0x62,0x58] | ||
qc.shladd x4, x5, x6, 12 | ||
|
||
# CHECK-INST: qc.shladd a0, a1, a2, 4 | ||
# CHECK-ENC: encoding: [0x0b,0xb5,0xc5,0x48] | ||
qc.shladd x10, x11, x12, 4 | ||
|
||
# CHECK-INST: qc.shladd a0, a1, a2, 31 | ||
# CHECK-ENC: encoding: [0x0b,0xb5,0xc5,0x7e] | ||
qc.shladd x10, x11, x12, 31 |
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