Minor refactor.

It doesn't save space (but if I reuse it once it will.)
This commit is contained in:
Simon Forman 2019-11-09 21:20:31 -08:00
parent 2b9034f6d5
commit cde066eb86
1 changed files with 10 additions and 10 deletions

View File

@ -137,16 +137,16 @@ language.
label(Label)]. label(Label)].
(unpack_pair(From, HeadAddr, TailAddr, Base)) --> (unpack_pair(From, HeadAddr, TailAddr, Base)) -->
[lsl_imm(HeadAddr, From, 2), % Trim off the type tag 00 bits. [lsl_imm(HeadAddr, From, 2)], % Trim off the type tag 00 bits.
asr_imm(HeadAddr, HeadAddr, 17), % HeadAddr := From >> 15 (roll_down_add_base_if_not_zero(HeadAddr, Base)),
eq_offset(Label0), % if the offset is zero don't add the address. it's empty list. [lsl_imm(TailAddr, From, 17)], % Trim off tag and head address.
add(HeadAddr, HeadAddr, Base), (roll_down_add_base_if_not_zero(TailAddr, Base)).
label(Label0),
lsl_imm(TailAddr, From, 17), % Get the offset of the third stack cell (roll_down_add_base_if_not_zero(Addr, Base)) -->
asr_imm(TailAddr, TailAddr, 17), % while preserving the sign. [asr_imm(Addr, Addr, 17), % Preserving sign.
eq_offset(Label1), % if the offset is zero don't add the address. it's empty list. eq_offset(Label), % If the offset is zero don't add the address. it's empty list.
add(TailAddr, TailAddr, Base), add(Addr, Addr, Base),
label(Label1)]. label(Label)].
(load(From, To)) --> [load_word(From, To, 0)]. (load(From, To)) --> [load_word(From, To, 0)].