scarv / xcrypto

XCrypto: a cryptographic ISE for RISC-V
MIT License
90 stars 10 forks source link

xc.ld.[h|b] #41

Closed ben-marshall closed 5 years ago

ben-marshall commented 5 years ago

These instructions are versions of xc.ld.hu and xc.ld.bu which blank the rest of the register rather than updating a specific part of it.

The "u" in "hu" and "bu" stands for "update" rather than "unsigned", which might be worth pointing out explicitly in each of the instructions which use it.

ben-marshall commented 5 years ago

@danpage - The load and store instructions are really tight on the encoding space. We can't fit two extra instructions like this which have the same flexibility as their "u" counterparts.

The idea behind the "u" versions was to be able to load a word worth of bytes from different places without needing to do things like shifting and masking.

Given this intended use case, would it be sensible to make the versions of xc.ld.[h|b]u where the byte/halfword of the destination register is the zeroth one blank the rest of the register. This is a change of functionality to the existing instructions, rather than adding new encodings.

It would mean you can't load to the zeroth byte/halfword of a register without blanking the rest, but I don't see that being much of a constraint if you were going to load the rest of the register with data anyway.

ben-marshall commented 5 years ago

xc.ld.b x, y(z) would then be a pseudonym for xc.ld.bu 0,0,x, y(z)

ben-marshall commented 5 years ago

Decision: