You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With byte addressing of dmem we need to increment the dmem pointer by 32 (full WLEN word) when auto increment is used. In OTBN we only support a single increment of either the reg pointer or the dmem pointer directly in the load/store instruction. If both pointers are supposed to be incremented we add an additional ADDI. In the modexp code snippet we need to adjust this (e.g. here) in order to work with byte addressing.
There are two options:
Increment the dmem pointer not the reg pointer in the load/store instruction and increment the reg pointer by 1 with the ADDI
Keep incrementing the reg pointer but increment the dmem pointer with ADDI by 32
To me, #1 seems to be the cleaner solution and should also be the default when porting code.
The text was updated successfully, but these errors were encountered:
Both options work and don't make much of a difference, the addi immediate can deal with the value 32 without trouble. But I agree with you, option 1 seems slightly nicer.
With byte addressing of dmem we need to increment the dmem pointer by 32 (full
WLEN
word) when auto increment is used. In OTBN we only support a single increment of either the reg pointer or the dmem pointer directly in the load/store instruction. If both pointers are supposed to be incremented we add an additionalADDI
. In the modexp code snippet we need to adjust this (e.g. here) in order to work with byte addressing.There are two options:
1
with theADDI
ADDI
by 32To me, #1 seems to be the cleaner solution and should also be the default when porting code.
The text was updated successfully, but these errors were encountered: