diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2018-03-23 06:50:58 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2018-03-23 06:50:58 -0700 |
commit | 690038a3c75463681c2acc49689f0472b1698e89 (patch) | |
tree | b43d0fead7be6bc3ba55b9b93c00e10cb835e013 /ftw.c | |
parent | 73784f852159b14c42024bb2451c4c83067f4d6c (diff) | |
download | txr-690038a3c75463681c2acc49689f0472b1698e89.tar.gz txr-690038a3c75463681c2acc49689f0472b1698e89.tar.bz2 txr-690038a3c75463681c2acc49689f0472b1698e89.zip |
vm: change encoding of getv, setv and related.
In most compiler uses of bindv, getv and setv,
the operand which names the dynamic symbol is the data table:
a d0-dff register. The source or destination register of the
transfer could be anything. Therefore, the existing encoding
is suboptimal: the symbol is being put into the full sized
operand field of the instruction, and the source or
destination register into the small, ten-bit extra field
in the upper half. This breaks on cases like (set x y)
where x is a deeply nested lexical variable and y is
a dynamic variable. Let's reverse the encoding.
* share/txr/stdlib/asm.tl (op-getv, op-setv): Reverse the
operands. All derived opcodes follow this since they
reuse the code via inheritance.
* vm.c (vm_get_binding): Fetch the symbol from the small
operand field rather than the main operand field.
(vm_getsym, vm_getbind, vm_setsym, vm_bindv): Pull the
destination or source from the main operand of the instruction
rather than the small opreand.
Diffstat (limited to 'ftw.c')
0 files changed, 0 insertions, 0 deletions