-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[RISCV] Add Smrnmi extension #111668
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
[RISCV] Add Smrnmi extension #111668
Changes from all commits
c7a9b55
91125a1
6014139
8706286
6844754
7922fbb
c8fccb5
3d6f0fe
805fd8a
35588a3
f497950
7db01e7
29eaa52
3c5f6d1
1858bed
dedaf01
3086afc
95567b3
88dfe2b
1350674
116aa08
e077536
6249ffb
2452b33
5a58844
769d395
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1913,6 +1913,66 @@ csrrs t1, mhpmcounter31, zero | |
csrrs t2, 0xB1F, zero | ||
|
||
|
||
###################################### | ||
# Machine Counter Setup | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Section title is incorrect. The registers are already tested in rv32-machine-csr-names.s but they should be in this file. That was a mistake. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Okay, I haven't made any modifications to the content of this file |
||
###################################### | ||
# mnscratch | ||
# name | ||
# CHECK-INST: csrrs t1, mnscratch, zero | ||
# CHECK-ENC: encoding: [0x73,0x23,0x00,0x74] | ||
# CHECK-INST-ALIAS: csrr t1, mnscratch | ||
# uimm12 | ||
# CHECK-INST: csrrs t2, mnscratch, zero | ||
# CHECK-ENC: encoding: [0xf3,0x23,0x00,0x74] | ||
# CHECK-INST-ALIAS: csrr t2, mnscratch | ||
# name | ||
csrrs t1, mnscratch, zero | ||
# uimm12 | ||
csrrs t2, 0x740, zero | ||
|
||
# mnepc | ||
# name | ||
# CHECK-INST: csrrs t1, mnepc, zero | ||
# CHECK-ENC: encoding: [0x73,0x23,0x10,0x74] | ||
# CHECK-INST-ALIAS: csrr t1, mnepc | ||
# uimm12 | ||
# CHECK-INST: csrrs t2, mnepc, zero | ||
# CHECK-ENC: encoding: [0xf3,0x23,0x10,0x74] | ||
# CHECK-INST-ALIAS: csrr t2, mnepc | ||
# name | ||
csrrs t1, mnepc, zero | ||
# uimm12 | ||
csrrs t2, 0x741, zero | ||
|
||
# mncause | ||
# name | ||
# CHECK-INST: csrrs t1, mncause, zero | ||
# CHECK-ENC: encoding: [0x73,0x23,0x20,0x74] | ||
# CHECK-INST-ALIAS: csrr t1, mncause | ||
# uimm12 | ||
# CHECK-INST: csrrs t2, mncause, zero | ||
# CHECK-ENC: encoding: [0xf3,0x23,0x20,0x74] | ||
# CHECK-INST-ALIAS: csrr t2, mncause | ||
# name | ||
csrrs t1, mncause, zero | ||
# uimm12 | ||
csrrs t2, 0x742, zero | ||
|
||
# mnstatus | ||
# name | ||
# CHECK-INST: csrrs t1, mnstatus, zero | ||
# CHECK-ENC: encoding: [0x73,0x23,0x40,0x74] | ||
# CHECK-INST-ALIAS: csrr t1, mnstatus | ||
# uimm12 | ||
# CHECK-INST: csrrs t2, mnstatus, zero | ||
# CHECK-ENC: encoding: [0xf3,0x23,0x40,0x74] | ||
# CHECK-INST-ALIAS: csrr t2, mnstatus | ||
# name | ||
csrrs t1, mnstatus, zero | ||
# uimm12 | ||
csrrs t2, 0x744, zero | ||
|
||
|
||
###################################### | ||
# Machine Counter Setup | ||
###################################### | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# RUN: not llvm-mc -triple riscv32 -mattr=+smrnmi < %s 2>&1 | FileCheck %s | ||
# RUN: not llvm-mc -triple riscv64 -mattr=+smrnmi < %s 2>&1 | FileCheck %s | ||
|
||
mnret 0x10 # CHECK: :[[@LINE]]:7: error: invalid operand for instruction |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# RUN: llvm-mc %s -triple=riscv32 -mattr=+smrnmi -riscv-no-aliases -show-encoding \ | ||
# RUN: | FileCheck -check-prefixes=CHECK,CHECK-INST %s | ||
# RUN: llvm-mc %s -triple=riscv64 -mattr=+smrnmi -riscv-no-aliases -show-encoding \ | ||
# RUN: | FileCheck -check-prefixes=CHECK,CHECK-INST %s | ||
# RUN: llvm-mc -filetype=obj -triple riscv32 -mattr=+smrnmi < %s \ | ||
# RUN: | llvm-objdump --mattr=+smrnmi -M no-aliases -d - \ | ||
# RUN: | FileCheck -check-prefix=CHECK-INST %s | ||
# RUN: llvm-mc -filetype=obj -triple riscv64 -mattr=+smrnmi < %s \ | ||
# RUN: | llvm-objdump --mattr=+smrnmi -M no-aliases -d - \ | ||
# RUN: | FileCheck -check-prefix=CHECK-INST %s | ||
|
||
# CHECK-INST: mnret | ||
# CHECK: encoding: [0x73,0x00,0x20,0x70] | ||
mnret |
Uh oh!
There was an error while loading. Please reload this page.