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
Historically we've encoded jumps as having an index of the target basic block as its argument. Later we've redesigned it so that now jumps are encoded with a relative byte offset to where they're supposed to jump (so that we don't require an O(n) pass before execution). However, the ProgramBlobBuilder still works the same as it did, for example:
Here the jump(1) means that it will jump to the add_imm(A0, A0, 200) instruction (yes, it will be an infinite loop).
The task
Refactor the builder so that it accepts an absolute instruction number instead of a basic block number (we can't have it accept byte offsets or relative byte offsets since our instructions are variable length, so if it accepted byte offsets it'd make it literally impossible to use).
So the example that I've given should now look like this (it should still produce exactly the same code, but now jump accepts the index of the target instruction instead of the index of the target basic block):
Background
Historically we've encoded jumps as having an index of the target basic block as its argument. Later we've redesigned it so that now jumps are encoded with a relative byte offset to where they're supposed to jump (so that we don't require an O(n) pass before execution). However, the
ProgramBlobBuilder
still works the same as it did, for example:Here the
jump(1)
means that it will jump to theadd_imm(A0, A0, 200)
instruction (yes, it will be an infinite loop).The task
Refactor the builder so that it accepts an absolute instruction number instead of a basic block number (we can't have it accept byte offsets or relative byte offsets since our instructions are variable length, so if it accepted byte offsets it'd make it literally impossible to use).
So the example that I've given should now look like this (it should still produce exactly the same code, but now
jump
accepts the index of the target instruction instead of the index of the target basic block):The text was updated successfully, but these errors were encountered: