-
Notifications
You must be signed in to change notification settings - Fork 653
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
[wavedrom, ,svg] | ||
.... | ||
{reg:[ | ||
{ bits: 2, name: 0x1, type: 8 }, | ||
{ bits: 5, name: 0x0 }, | ||
{ bits: 1, name: 0x1, type: 4 }, | ||
{ bits: 3, name: 'n[2:0]', type: 4 }, | ||
{ bits: 1, name: 0x0, type: 4 }, | ||
{ bits: 1, name: 0x0 }, | ||
{ bits: 3, name: 0x3 }, | ||
]} | ||
.... |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
[wavedrom, ,svg] | ||
.... | ||
{reg:[ | ||
{ bits: 7, name: 0x73, attr: ['SYSTEM'], type: 8 }, | ||
{ bits: 5, name: 'rd', type: 2 }, | ||
{ bits: 3, name: 0x4 }, | ||
{ bits: 5, name: 'rs1', type: 4 }, | ||
{ bits: 2, name: 'n[1:0]' }, | ||
{ bits: 4, name: 0x7 }, | ||
{ bits: 2, name: 'n[3:2]' }, | ||
{ bits: 2, name: 0x0 }, | ||
{ bits: 1, name: 'n[4]' }, | ||
{ bits: 1, name: 0x1 }, | ||
], config: {fontsize: 11}} | ||
.... |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
[wavedrom, ,svg] | ||
.... | ||
{reg:[ | ||
{ bits: 7, name: 0x73, attr: ['SYSTEM'], type: 8 }, | ||
{ bits: 5, name: 'rd', type: 2 }, | ||
{ bits: 3, name: 0x4 }, | ||
{ bits: 5, name: 'rs1', type: 4 }, | ||
{ bits: 5, name: 'rs2', type: 4 }, | ||
{ bits: 1, name: 0x1 }, | ||
{ bits: 2, name: 'n[1:0]' }, | ||
{ bits: 2, name: 0x0 }, | ||
{ bits: 1, name: 'n[2]' }, | ||
{ bits: 1, name: 0x1 }, | ||
], config: {fontsize: 11}} | ||
.... |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
[[zimop]] | ||
== "Zimop" May-Be-Operations Extension, Version 0.1 | ||
This chapter defines the "Zimop" extension, which introduces the concept of | ||
instructions that _may be operations_ (MOPs). MOPs are initially defined to | ||
perform no useful operation and raise no exceptions, but might be redefined by | ||
later extensions to perform some other action. The Zimop extension defines an | ||
encoding space for 40 MOPs. | ||
|
||
[NOTE] | ||
==== | ||
It is sometimes desirable to define instruction-set extensions whose | ||
instructions do not raise illegal-instruction exceptions when the extension is | ||
This comment has been minimized.
Sorry, something went wrong. |
||
not implemented. For example, programs with control-flow integrity checks can | ||
This comment has been minimized.
Sorry, something went wrong.
gfavor
Collaborator
|
||
execute correctly on implementations without the corresponding extension, | ||
provided the checks are simply ignored. Implementing these checks as MOPs | ||
allows the same programs to run on implementations with or without the | ||
corresponding extension. | ||
Although similar in some respects to HINTs, most MOPs cannot be encoded as | ||
This comment has been minimized.
Sorry, something went wrong.
gfavor
Collaborator
|
||
HINTs, because MOPs might sometimes alter architectural state, which HINTs are | ||
This comment has been minimized.
Sorry, something went wrong.
gfavor
Collaborator
|
||
forbidden from doing. | ||
==== | ||
|
||
The Zimop extension defines 32 MOP instructions named `mop.r.__n__`, where | ||
__n__ is an integer between 0 and 31, inclusive. | ||
Unless redefined by another extension, these instructions simply write 0 to | ||
`x[rd]`. Their encoding allows future extensions to define them to read `x[rs1]`, | ||
as well as write `x[rd]`. | ||
This comment has been minimized.
Sorry, something went wrong.
gfavor
Collaborator
|
||
|
||
include::images/wavedrom/mop-r.adoc[] | ||
[[mop-r]] | ||
|
||
The Zimop extension additionally defines 8 MOP instructions named | ||
`mop.rr.__n__`, where __n__ is an integer between 0 and 7, inclusive. | ||
Unless redefined by another extension, these instructions simply | ||
write 0 to `x[rd]`. Their encoding allows future extensions to define them to | ||
read `x[rs1]` and `x[rs2]`, as well as write `x[rd]`. | ||
This comment has been minimized.
Sorry, something went wrong. |
||
|
||
include::images/wavedrom/mop-rr.adoc[] | ||
[[mop-rr]] | ||
|
||
NOTE: These MOPs are encoded in the SYSTEM major opcode in part because it is | ||
expected their behavior will be modulated by privileged CSR state. | ||
|
||
NOTE: These MOPs are defined to write `x[rd]`, rather than performing no | ||
operation, to simplify instruction decoding and to allow testing the presence | ||
of features by branching on the zeroness of the result. | ||
|
||
The MOPs defined in the Zimop extension are not guaranteed to carry | ||
a syntactic dependency from `x[rs1]` or `x[rs2]` to `x[rd]`. | ||
|
||
NOTE: Not carrying a syntactic dependence relieves straightforward | ||
implementations of reading `x[rs1]` and `x[rs2]`. | ||
|
||
<<< | ||
|
||
=== "Zcmop" Compressed May-Be-Operations Extension, Version 0.1 | ||
|
||
This section defines the "Zcmop" extension, which defines eight 16-bit MOP | ||
instructions named `c.mop.__n__`, where __n__ is an integer between 0 and 7, | ||
inclusive. `c.mop.__n__` is encoded in the reserved encoding space | ||
corresponding to `c.lui x__m__, 0`, where __m__=2__n__+1. These instructions | ||
are defined to not write any register. Their encoding allows future extensions | ||
to define them to read register `x[__m__]`. | ||
This comment has been minimized.
Sorry, something went wrong.
gfavor
Collaborator
|
||
|
||
include::images/wavedrom/c-mop.adoc[] | ||
[[c-mop]] | ||
|
||
|
||
NOTE: The expectation is that each Zcmop instruction is equivalent to some | ||
Zimop instruction, but the choice of expansion (if any) is left to the | ||
extension that redefines the MOP. |
In the Priv spec "illegal instruction" exception does not have a hyphen.