-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Labels
Description
The goal here is to support a notion of cast in zkasm, such as the following:
fn f(flag u1, val u64) -> (res u16) {
if flag == 1 goto cast_u16
res = 0
return
cast_u16:
res = u16(val)
return
}
Currently, this can be implemented using the following:
fn f(flag u1, val u64) -> (res u16) {
if flag == 1 goto cast_u16
res = 0
return
cast_u16:
var tmp u48
tmp, res = (u16) val
if tmp != 0 goto exit_f
return
exit_f:
fail
}