Hi Marco,
I'm not sure of your representation, but if, in #1, you mean to have the c.addi instruction coming earlier in the instruction stream than the addi instruction, then addi[15:0] comes earlier in the instruction stream than addi[31:16].
So you'll see
| c.addi[15:0] | addi[15:0] |
instead and then it's clear whether the addi is a 16-bit instruction or a 32-bit instruction.
Regardless of endianness, addi[31:16] is at a higher address than addi[15:0] - to avoid the problem (I think) you're describing. Section 1.5 of the Unprivileged spec says:
RISC-V base ISAs have either little-endian or big-endian memory systems, with the privileged
architecture further defining bi-endian operation. Instructions are stored in memory as a sequence
of 16-bit little-endian parcels, regardless of memory system endianness. Parcels forming one in-
struction are stored at increasing halfword addresses, with the lowest-addressed parcel holding the
lowest-numbered bits in the instruction specification.
Bill
EXTERNAL MAIL
--
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 view this discussion on the web visit https://groups.google.com/a/groups.riscv.org/d/msgid/isa-dev/8c5642c0-d0bd-4014-86a9-06cd187a40cdn%40groups.riscv.org.