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
{{ message }}
Repository navigation
Add a get_value operator to duplicate a value from the expression stack. #685
Would there be any immediate interest in adding an operator, say get_value, to duplicate a value from the expression stack?
With the post-order encoding there is already the issue that expression results accumulate in blocks to be discarded at the block exits. It seems consistent with the SSA decoder to allow re-use of these, so why not take advantage of them. Each of these could be viewed as binding a block local variable that could be accessed. So rather than block we could effective have let:
(let (($v1 (f64.load ...))
($v2 (i32.load ...))
(_ (f64.store :offset 8 (get_value $v2) (get_value $v1)))
(_ (f64.store :offset 16 (get_value $v2) (get_value $v1))))
;; The fall through result.
(get_value $v1))
Adding this now might allow some experimentation with the tooling, to take advantage of this.
It's not necessary to land this change, and it can be explored in local work, and local tools can rewrite the wast into this encoding, but might there happen to be any interesting in such an incremental change?
Funny, I posted #693 without having seen your recent comment. Isn't the proposal here simply to introduce a new kind of local variable - a block-scoped single-assignment variable? I had the impression that such variables had been proposed earlier - or do I misremember?
So what your latest comment is doing is just changing the syntax of your original proposal?
Activity
qwertie commentedon May 23, 2016
Funny, I posted #693 without having seen your recent comment. Isn't the proposal here simply to introduce a new kind of local variable - a block-scoped single-assignment variable? I had the impression that such variables had been proposed earlier - or do I misremember?
So what your latest comment is doing is just changing the syntax of your original proposal?