-
Notifications
You must be signed in to change notification settings - Fork 0
Feature request #3
To allow reg ptr
(and reg ptr
arrays) to appear in arguments of exported function. Such as in:
param int NLIMBS = 7;
export fn bn_eq(reg ptr u64[NLIMBS] x y) -> reg u64 { ... }
This would allow to save an array copy between memory and the stack where those arrays are handled by the library.
Of course, such a declaration should also be read as a user provided assumption that the memory regions pointed by those reg ptr
registers are not aliased between themselves and with any memory chunk reachable by other pointer arguments passed to the function.
In general, we would like not only readable reg ptr
s, but also writable reg ptr
s (and possibly in/out arguments, c.f. feature request #2). In that case, the syntax becomes a little bit stranger, because it would allow reg ptr
s to appear at the result type of the exported function (even though they are of course absent from the generated code). E.g.
export fn bn_addn(reg ptr u64[NLIMBS] x y) -> reg ptr u64[NLIMBS] { ... }