jasmin-lang / jasmin

Language for high-assurance and high-speed cryptography
MIT License
271 stars 55 forks source link

ARM: change semantics of long multiplication instructions #958

Closed bgregoir closed 1 week ago

vbgl commented 2 weeks ago

Ping Vincent (@vincentvbh) in case he has got some feedback.

vincentvbh commented 2 weeks ago

Thank you for making the changes. I'll immediately notify people I know that are using umull and smull.

vbgl commented 1 week ago

I have a doubt about the change for the signed multiplication. Can someone please double-check?

sarranz commented 1 week ago

Sorry, you mean the instruction description? Why would it be different than the unsigned version?

vbgl commented 1 week ago

Because when I compare execution on hardware and in the semantics, it used to be OK and now output words are swapped.

bgregoir commented 1 week ago

For me I think, it is ok. And that it is not incompatible with the fact that you checked hardware with software before. Before this commit (hi, lo) = SMULL(x, y) ----> SMULL lo hi x y semantics (highbit (x y ), lowbit (x y)) (hi, lo) = UMULL(x, y) ----> UMULL lo hi x y after : (lo, hi) = SMULL(x, y) ----> SMULL lo hi x y semantics (lowbit(x y), highbit (x y))

In all cases (before/after and source/assembly) you have lo <- lowbit(x y) and hi <- highbit (x y) Assuming lo <> hi.

vbgl commented 1 week ago

Fausse alerte. Sorry for the noise.