-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
initial bulk array op implementations #363
Conversation
The opcodes here seem fine to me. We can figure out permanent opcodes alongside everything else just before we go to phase 4. |
For the record, |
I'm happy to switch this PR to match the reservations listed in that doc (IIUC, |
What needs to happen to get this landed? Do we need an update to MVP.md to accompany the work here, or can that come later? |
@rossberg PTAL! |
interpreter/exec/eval.ml
Outdated
let seg = data c.frame.inst y in | ||
let bs = Data.bytes seg in | ||
let j = I32.to_int_u y_off in | ||
(* TODO: unify with ArrayNewData *) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you extend the Data module with a load_num function analogous to Memory.load_num and use that here and for ArrayNewData?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
opening Type/Value in Data seems to cause a build circularity. For now I'm factoring this out into a shared helper in eval.ml
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, that is very odd. What's the circularity? I cannot reproduce it on main.
@rossberg PTAL |
match v with | ||
| Num n -> Plain (Const (n @@ at)) | ||
| Vec v -> Plain (VecConst (v @@ at)) | ||
| Ref r -> Refer r | ||
|
||
let value_of_data_ind (seg : Data.data) (st : storage_type) (j : int) at = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we somehow make this mirror the load_num/load_vec functions in Memory.ml?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure what you have in mind here. Now that I've at least pulled this out as an auxiliary definition, would you be willing to take on refactoring it as a small follow-up PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay.
interpreter/exec/eval.ml
Outdated
let seg = data c.frame.inst y in | ||
let bs = Data.bytes seg in | ||
let j = I32.to_int_u y_off in | ||
(* TODO: unify with ArrayNewData *) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, that is very odd. What's the circularity? I cannot reproduce it on main.
Co-authored-by: Andreas Rossberg <[email protected]>
Co-authored-by: Andreas Rossberg <[email protected]>
Co-authored-by: Andreas Rossberg <[email protected]>
Co-authored-by: Andreas Rossberg <[email protected]>
Co-authored-by: Andreas Rossberg <[email protected]>
Co-authored-by: Andreas Rossberg <[email protected]>
Co-authored-by: Andreas Rossberg <[email protected]>
Co-authored-by: Andreas Rossberg <[email protected]>
Co-authored-by: Andreas Rossberg <[email protected]>
Co-authored-by: Andreas Rossberg <[email protected]>
Co-authored-by: Andreas Rossberg <[email protected]>
Co-authored-by: Andreas Rossberg <[email protected]>
@rossberg PTAL, everything should be resolved except the issue with |
match v with | ||
| Num n -> Plain (Const (n @@ at)) | ||
| Vec v -> Plain (VecConst (v @@ at)) | ||
| Ref r -> Refer r | ||
|
||
let value_of_data_ind (seg : Data.data) (st : storage_type) (j : int) at = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay.
merging now 🥳 |
See #313, and more specifically this comment.
This patch only updates the interpreter, the overview is not updated.
Note - this patch currently using the following opcode encodings in the hope of provoking more permanent suggestions: