From 1fb852f2bca2e70bde656ed28654a1f75b40f068 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Wed, 9 Jan 2019 06:44:54 -0800 Subject: asm/compiler: rename small level/index constants. * share/txr/stdlib/vm-param.tl (%max-sm-lev-idx%): This constant is named inconsistently relative to %max-lev-idx%. It is providing the maximum level (encodable in a small operand), whereas %max-lev-idx% provides the maximum index within a level. It is hereby renamed to %max-sm-lev%. The %max-sm-lev-idx% name is re-used to denote the quantity which it suggests: the maximum index within a level (encodable in a small operand), which is 63. * share/txr/stdlib/asm.tl (small-op-p): Use the new %max-sm-lev-idx% in place of %sm-lev-size%, getting rid of the funny range starting with -1. Replace the original %max-sm-lev-idx% with its new name, %max-sm-lev%. --- share/txr/stdlib/asm.tl | 4 ++-- share/txr/stdlib/vm-param.tl | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/share/txr/stdlib/asm.tl b/share/txr/stdlib/asm.tl index bf2da421..58bd72b2 100644 --- a/share/txr/stdlib/asm.tl +++ b/share/txr/stdlib/asm.tl @@ -302,8 +302,8 @@ (defun small-op-p (val) (with-lev-idx (lv ix) val - (and (< -1 ix %sm-lev-size%) - (<= 0 lv %max-sm-lev-idx%)))) + (and (<= 0 ix %max-sm-lev-idx%) + (<= 0 lv %max-sm-lev%)))) (defun enc-small-op (val) (with-lev-idx (lv ix) val diff --git a/share/txr/stdlib/vm-param.tl b/share/txr/stdlib/vm-param.tl index bac6287e..3ce993c4 100644 --- a/share/txr/stdlib/vm-param.tl +++ b/share/txr/stdlib/vm-param.tl @@ -31,5 +31,6 @@ (defsymacro %max-v-lev% (macro-time (ppred %max-lev%))) (defsymacro %imm-width% 32) (defsymacro %sm-lev-size% 64) -(defsymacro %max-sm-lev-idx% 15) +(defsymacro %max-sm-lev-idx% (macro-time (pred %sm-lev-size%))) +(defsymacro %max-sm-lev% 15) (defsymacro %sm-lev-bits% 6) -- cgit v1.2.3