riscv / riscv-CMOs

https://jira.riscv.org/browse/RVG-59
Creative Commons Attribution 4.0 International
77 stars 12 forks source link

update instruction descriptions #51

Closed dkruckemyer-ventana closed 2 years ago

dkruckemyer-ventana commented 2 years ago

add offset to mnemonics and update description text

kito-cheng commented 2 years ago

As a GNU toolchain maintainer, LGTM, thanks!

and thanks @a4lg push this forward :)

cmuellner commented 2 years ago

LGTM

a4lg commented 2 years ago

LGTM.

Proposed version number (1.0.1) is nice because it wouldn't change the extension version itself.

ubc-guy commented 2 years ago

am I misunderstanding the phrase "any expression that computes the offset shall evaluate to zero" ?

what is the value of allowing/specifying an offset (expression) if it always evaluates to zero?

perhaps it's just the wording -- replacing "shall" with "must" would sit better with me, as it allows me to understand that the imm field must be zero due to encoding limitations (not "shall be zero" without a rationale).

a4lg commented 2 years ago

My intent (on GNU Binutils) is,

  1. The encoding does not allow specifying actual offset (effectively, only offset of zero is allowed).
  2. But new textual form looks like handling regular pointers, offset(rs).
  3. I didn't want any inconsistent behaviors between regular offset(rs) and this 0(rs).
    For instance, if ld t0, ZERO(a0) is acceptable (ZERO is an expression or a macro that evaluates to zero), cbo.zero ZERO(a0) should be acceptable, too.

It was also easy because we have precedent examples (atomic "A"-extension instructions).

brucehoult commented 2 years ago

I don't know if we have our own document specifying wordings such as this. I think most groups follow the IETF RFC definitions: https://datatracker.ietf.org/doc/html/rfc2119

MUST is preferred but SHALL has exactly the same formal meaning.

In any case, the possibility is left syntactically that there might be an alternative encoding (perhaps 48 bits) in future that allows non-zero offsets.

dkruckemyer-ventana commented 2 years ago

My actual preference is "must" but for some reason I thought "shall" was preferred more generally. The latter was used in this document originally, so I wrote "shall" to be consistent. I'm not aware of any formal decision to use one or the other, but a quick search through the other RISC-V docs reveals they have both (though "must" appears more frequently than "shall"). Something to update later, I guess.