I think you missed the point. My suggestion was to remove existing read-modify-write instructions from the ISA.
To view this discussion on the web visit https://groups.google.com/a/groups.riscv.org/d/msgid/isa-dev/b404673c-7114-4595-a6d1-dbe7a1e8fe24%40groups.riscv.org.
--
You received this message because you are subscribed to the Google Groups "RISC-V ISA Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isa-dev+unsubscribe@groups.riscv.org.
To post to this group, send email to isa...@groups.riscv.org.
Visit this group at https://groups.google.com/a/groups.riscv.org/group/isa-dev/.
The RISC-V privileged architecture (and a few other parts) are built around these instructions supporting atomic RMW, so isn’t going to change.
You already listed a few techniques that current microarchitectures use to handle such instructions (serialization, renaming), and I’m not aware of any ISA with a privileged architecture that doesn’t need some such instructions (where new status value partly depends on old status value) to be handled. Does your current ISA support privileged modes and not need any such control/status register updates?
Krste
> On Apr 17, 2017, at 9:22 AM, Hugo Décharnes <hdec...@outlook.fr> wrote:
>
> I don't know what you meant, but what I emphasized was the problematic atomic nature of the operations, preventing them from gently fitting into existing out-of-order designs. This is from a micro-architect point of view, not an ISA-architect one.
>
> --
> You received this message because you are subscribed to the Google Groups "RISC-V ISA Dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to isa-dev+unsubscribe@groups.riscv.org.
> To post to this group, send email to isa...@groups.riscv.org.
> Visit this group at https://groups.google.com/a/groups.riscv.org/group/isa-dev/.
> To view this discussion on the web visit https://groups.google.com/a/groups.riscv.org/d/msgid/isa-dev/435f2889-e8fc-42e6-8b07-75ee939fe3be%40groups.riscv.org.
--
You received this message because you are subscribed to the Google Groups "RISC-V ISA Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isa-dev+unsubscribe@groups.riscv.org.
To post to this group, send email to isa...@groups.riscv.org.
Visit this group at https://groups.google.com/a/groups.riscv.org/group/isa-dev/.
To view this discussion on the web visit https://groups.google.com/a/groups.riscv.org/d/msgid/isa-dev/5ED7E319-51B2-4A99-A6EF-D4AEFAA49845%40berkeley.edu.
"I’m not aware of any ISA with a privileged architecture that doesn’t need some such instructions": OR1K? I can see why these types of instructions make sense (in the multiprocessor case), but they come at the cost of increasing hardware complexity. One of the beautiful aspects of the core of RISC-V is that it errs towards simplicity of hardware implementation. I think this is one (albeit irreversible) case where the ISA designers got it wrong.---Matthew Hicks
On Mon, Apr 17, 2017 at 12:43 PM, Krste Asanovic <kr...@berkeley.edu> wrote:
The RISC-V privileged architecture (and a few other parts) are built around these instructions supporting atomic RMW, so isn’t going to change.
You already listed a few techniques that current microarchitectures use to handle such instructions (serialization, renaming), and I’m not aware of any ISA with a privileged architecture that doesn’t need some such instructions (where new status value partly depends on old status value) to be handled. Does your current ISA support privileged modes and not need any such control/status register updates?
Krste
> On Apr 17, 2017, at 9:22 AM, Hugo Décharnes <hdec...@outlook.fr> wrote:
>
> I don't know what you meant, but what I emphasized was the problematic atomic nature of the operations, preventing them from gently fitting into existing out-of-order designs. This is from a micro-architect point of view, not an ISA-architect one.
>
> --
> You received this message because you are subscribed to the Google Groups "RISC-V ISA Dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to isa-dev+u...@groups.riscv.org.
> To post to this group, send email to isa...@groups.riscv.org.
> Visit this group at https://groups.google.com/a/groups.riscv.org/group/isa-dev/.
> To view this discussion on the web visit https://groups.google.com/a/groups.riscv.org/d/msgid/isa-dev/435f2889-e8fc-42e6-8b07-75ee939fe3be%40groups.riscv.org.
--
You received this message because you are subscribed to the Google Groups "RISC-V ISA Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isa-dev+u...@groups.riscv.org.
To post to this group, send email to isa...@groups.riscv.org.
Visit this group at https://groups.google.com/a/groups.riscv.org/group/isa-dev/.
To view this discussion on the web visit https://groups.google.com/a/groups.riscv.org/d/msgid/isa-dev/5ED7E319-51B2-4A99-A6EF-D4AEFAA49845%40berkeley.edu.
--
You received this message because you are subscribed to the Google Groups "RISC-V ISA Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isa-dev+u...@groups.riscv.org.
To post to this group, send email to isa...@groups.riscv.org.
Visit this group at https://groups.google.com/a/groups.riscv.org/group/isa-dev/.
To view this discussion on the web visit https://groups.google.com/a/groups.riscv.org/d/msgid/isa-dev/CAAQi22atGNpBcLJm4Q8LTmr1ZdU5VLOVeJeW5sGecoF-RUMS6w%40mail.gmail.com.
given the kind of things CSRs do, and the infrequency with which they need to be done, I'm kind of lost on the need to make all this out-of-order stuff work? What'sthe benefit?ron
On Mon, Apr 17, 2017 at 12:26 PM Matthew Hicks <mdh...@gmail.com> wrote:
"I’m not aware of any ISA with a privileged architecture that doesn’t need some such instructions": OR1K? I can see why these types of instructions make sense (in the multiprocessor case), but they come at the cost of increasing hardware complexity. One of the beautiful aspects of the core of RISC-V is that it errs towards simplicity of hardware implementation. I think this is one (albeit irreversible) case where the ISA designers got it wrong.---Matthew Hicks
On Mon, Apr 17, 2017 at 12:43 PM, Krste Asanovic <kr...@berkeley.edu> wrote:
The RISC-V privileged architecture (and a few other parts) are built around these instructions supporting atomic RMW, so isn’t going to change.
You already listed a few techniques that current microarchitectures use to handle such instructions (serialization, renaming), and I’m not aware of any ISA with a privileged architecture that doesn’t need some such instructions (where new status value partly depends on old status value) to be handled. Does your current ISA support privileged modes and not need any such control/status register updates?
Krste
> On Apr 17, 2017, at 9:22 AM, Hugo Décharnes <hdec...@outlook.fr> wrote:
>
> I don't know what you meant, but what I emphasized was the problematic atomic nature of the operations, preventing them from gently fitting into existing out-of-order designs. This is from a micro-architect point of view, not an ISA-architect one.
>
> --
> You received this message because you are subscribed to the Google Groups "RISC-V ISA Dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to isa-dev+unsubscribe@groups.riscv.org.
> To post to this group, send email to isa...@groups.riscv.org.
> Visit this group at https://groups.google.com/a/groups.riscv.org/group/isa-dev/.
> To view this discussion on the web visit https://groups.google.com/a/groups.riscv.org/d/msgid/isa-dev/435f2889-e8fc-42e6-8b07-75ee939fe3be%40groups.riscv.org.
--
You received this message because you are subscribed to the Google Groups "RISC-V ISA Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isa-dev+unsubscribe@groups.riscv.org.
To post to this group, send email to isa...@groups.riscv.org.
Visit this group at https://groups.google.com/a/groups.riscv.org/group/isa-dev/.
To view this discussion on the web visit https://groups.google.com/a/groups.riscv.org/d/msgid/isa-dev/5ED7E319-51B2-4A99-A6EF-D4AEFAA49845%40berkeley.edu.
--
You received this message because you are subscribed to the Google Groups "RISC-V ISA Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isa-dev+unsubscribe@groups.riscv.org.
By your own logic, it would be a better ISA design decision to use the more simple move to/from CSR instructions than the existing more complex versions, because these are such a rare case during software execution. Unfortunately, the gates required to implement the more complex (existing) instructions are there sucking power and taking up area during the entire execution. To me, this is a pretty clear case where (R)educed is better than (C)omplex when it comes to ISA design.---Matthew Hicks
On Mon, Apr 17, 2017 at 3:43 PM, ron minnich <rmin...@gmail.com> wrote:
given the kind of things CSRs do, and the infrequency with which they need to be done, I'm kind of lost on the need to make all this out-of-order stuff work? What'sthe benefit?ron
On Mon, Apr 17, 2017 at 12:26 PM Matthew Hicks <mdh...@gmail.com> wrote:
"I’m not aware of any ISA with a privileged architecture that doesn’t need some such instructions": OR1K? I can see why these types of instructions make sense (in the multiprocessor case), but they come at the cost of increasing hardware complexity. One of the beautiful aspects of the core of RISC-V is that it errs towards simplicity of hardware implementation. I think this is one (albeit irreversible) case where the ISA designers got it wrong.---Matthew Hicks
On Mon, Apr 17, 2017 at 12:43 PM, Krste Asanovic <kr...@berkeley.edu> wrote:
The RISC-V privileged architecture (and a few other parts) are built around these instructions supporting atomic RMW, so isn’t going to change.
You already listed a few techniques that current microarchitectures use to handle such instructions (serialization, renaming), and I’m not aware of any ISA with a privileged architecture that doesn’t need some such instructions (where new status value partly depends on old status value) to be handled. Does your current ISA support privileged modes and not need any such control/status register updates?
Krste
> On Apr 17, 2017, at 9:22 AM, Hugo Décharnes <hdec...@outlook.fr> wrote:
>
> I don't know what you meant, but what I emphasized was the problematic atomic nature of the operations, preventing them from gently fitting into existing out-of-order designs. This is from a micro-architect point of view, not an ISA-architect one.
>
> --
> You received this message because you are subscribed to the Google Groups "RISC-V ISA Dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to isa-dev+u...@groups.riscv.org.
> To post to this group, send email to isa...@groups.riscv.org.
> Visit this group at https://groups.google.com/a/groups.riscv.org/group/isa-dev/.
> To view this discussion on the web visit https://groups.google.com/a/groups.riscv.org/d/msgid/isa-dev/435f2889-e8fc-42e6-8b07-75ee939fe3be%40groups.riscv.org.
--
You received this message because you are subscribed to the Google Groups "RISC-V ISA Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isa-dev+u...@groups.riscv.org.
To post to this group, send email to isa...@groups.riscv.org.
Visit this group at https://groups.google.com/a/groups.riscv.org/group/isa-dev/.
To view this discussion on the web visit https://groups.google.com/a/groups.riscv.org/d/msgid/isa-dev/5ED7E319-51B2-4A99-A6EF-D4AEFAA49845%40berkeley.edu.
--
You received this message because you are subscribed to the Google Groups "RISC-V ISA Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isa-dev+u...@groups.riscv.org.
To post to this group, send email to isa...@groups.riscv.org.
Visit this group at https://groups.google.com/a/groups.riscv.org/group/isa-dev/.
To view this discussion on the web visit https://groups.google.com/a/groups.riscv.org/d/msgid/isa-dev/CAAQi22atGNpBcLJm4Q8LTmr1ZdU5VLOVeJeW5sGecoF-RUMS6w%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "RISC-V ISA Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isa-dev+u...@groups.riscv.org.
To post to this group, send email to isa...@groups.riscv.org.
Visit this group at https://groups.google.com/a/groups.riscv.org/group/isa-dev/.
To view this discussion on the web visit https://groups.google.com/a/groups.riscv.org/d/msgid/isa-dev/CAAQi22YWFd_NzfRzTO-A1gGekW4kV5wAx5EB_9mfkBrX%2BTw0rw%40mail.gmail.com.
>>>>> On Mon, 17 Apr 2017 15:26:41 -0400, Matthew Hicks <mdh...@gmail.com> said:
| "I’m not aware of any ISA with a privileged architecture that doesn’t need some
| such instructions": OR1K?
OR1K has add-with-carry which reads a bit from the status register,
then writes it.
It also has a special behavior of move-to-status-register for clearing
interrupt bits which is similar to the RISC-V read-and-clear-bit
instruction.
| I can see why these types of instructions make sense
| (in the multiprocessor case), but they come at the cost of increasing hardware
| complexity.
It really isn't much complexity given you have to handle status
registers in general, and you have to handle instructions that
atomically read a register and write a register.
| One of the beautiful aspects of the core of RISC-V is that it errs
| towards simplicity of hardware implementation. I think this is one (albeit
| irreversible) case where the ISA designers got it wrong.
We wanted to standardize the pattern rather than having every
operation on CSRs be potentially special-cased. You can specialize
the CSR logic to only support the operations needed for your set of
implemented CSRs, but we figure it's usually going to be easier to
just implement the one pipeline for everything.
Krste
| ---Matthew Hicks
| On Mon, Apr 17, 2017 at 12:43 PM, Krste Asanovic <kr...@berkeley.edu> wrote:
| The RISC-V privileged architecture (and a few other parts) are built around
| these instructions supporting atomic RMW, so isn’t going to change.
| You already listed a few techniques that current microarchitectures use to
| handle such instructions (serialization, renaming), and I’m not aware of
| any ISA with a privileged architecture that doesn’t need some such
| instructions (where new status value partly depends on old status value) to
| be handled. Does your current ISA support privileged modes and not need
| any such control/status register updates?
| Krste
|| On Apr 17, 2017, at 9:22 AM, Hugo Décharnes <hdec...@outlook.fr> wrote:
||
|| I don't know what you meant, but what I emphasized was the problematic
| atomic nature of the operations, preventing them from gently fitting into
| existing out-of-order designs. This is from a micro-architect point of
| view, not an ISA-architect one.
||
|| --
|| You received this message because you are subscribed to the Google Groups
| "RISC-V ISA Dev" group.
|| To unsubscribe from this group and stop receiving emails from it, send an
| email to isa-dev+unsubscribe@groups.riscv.org.
|| To post to this group, send email to isa...@groups.riscv.org.
|| Visit this group at https://groups.google.com/a/groups.riscv.org/group/
| isa-dev/.
|| To view this discussion on the web visit https://groups.google.com/a/
| groups.riscv.org/d/msgid/isa-dev/435f2889-e8fc-42e6-8b07-
| 75ee939fe3be%40groups.riscv.org.
| --
| You received this message because you are subscribed to the Google Groups
| "RISC-V ISA Dev" group.
| To unsubscribe from this group and stop receiving emails from it, send an
| email to isa-dev+unsubscribe@groups.riscv.org.
| To post to this group, send email to isa...@groups.riscv.org.
| Visit this group at https://groups.google.com/a/groups.riscv.org/group/isa-
| dev/.
| To view this discussion on the web visit https://groups.google.com/a/
| groups.riscv.org/d/msgid/isa-dev/5ED7E319-51B2-4A99-A6EF-
| D4AEFAA49845%40berkeley.edu.
I'm guessing your real concern is that RISC-V CSR instructions can
both read the old value into a new architectural register and update
CSR with a new value, i.e., the real difference with other ISAs is
that there are two register writes per instruction (one to CSR and one
to GPR).
Some pure storage CSRs (like *scratch with no side effects) could be
renamed and handled by treating as more architectural registers, with
the common case of pure swaps handled with rename table tricks, but
because we also allow these to be manipulated with side effects (i.e.,
bit set/clear) they need different handling, e..g, cracking the CSR
instruction into a read-write-GPR uop, then a read-modify-write-CSR
uop.
We could restrict supported CSR operations to just those required on
each register, but this would complicate the spec, and most likely the
implementation. We chose instead to standardize on a common pattern.
It's not clear a high-performance implementation would bother with any
CSR renaming, and I'm fairly sure all current OoO processors have to
handle some serializing instructions, so I don't see how there's a
real performance/complexity hit for the RISC-V scheme
Note that this does not rename *epc, *cause, and *tval into the main
register file, but instead places them in a separate array (that need
not be physically contiguous--tval for "bad instruction" and tval for
"bad address" may be in different places, with epc somewhere else
entirely) with its own rename table and dedicated write ports for the
hardware-controlled updates.
The *scratch and *tvec registers are exactly the CSRs that I suggest
could be renamed into the main PRF, since they are accessed equivalently
to general-purpose registers. Nor is renaming strictly needed, although
it would improve the performance of exchanging *scratch with a GPR; a
processor could implement {m,h,s,u}{scratch,tvec} as "x32" through
"x40". Admittedly, *tvec-as-quasi-GPR is less likely to be useful than
*scratch-as-quasi-GPR, but some implementations might benefit from the
ability to dispatch a supervisor trap by "executing" "JALR x0,
[scause*4](stvec)" using the same logic as for ordinary JALR.
It will not, but placing *epc, *cause, and *tval{insn,addr,zero} in
their own register file (not the main PRF) with dedicated write ports
for updates would permit loading those CSRs to proceed in parallel with
normal execution and permit eliminating any visible trap latency that
would otherwise come from loading values into *epc, *cause, and *tval.
This is close to speculating a trap on every instruction and requires
either that the "running" row be copied into the appropriate set when a
trap is actually taken or that the "trap parameter" registers be renamed
within their own file to permit swapping the "running" row with the
appropriate set. This is needed because the ISA specifies that the
less-privileged "trap parameter" CSRs retain their values when a
more-privileged trap is taken. (In other words, whatever value was last
written to sepc, either by the supervisor or by hardware, is visible on
a subsequent monitor trap. It is probably meaningless, but it is
preserved.)
Minimizing the visible latency of a trap (by doing as much as possible
in parallel, even if this amounts to speculating a trap on every
instruction) could be beneficial since some traps, particularly ECALL,
are fully predictable. In this way, the cost of ECALL could be brought
down to that of an unconditional jump, which would bring the cost of a
system call to only a bit more than an ordinary function call through a
dispatch procedure. I maintain that this would be good.