summaryrefslogtreecommitdiffstats
path: root/share
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2019-01-09 06:44:54 -0800
committerKaz Kylheku <kaz@kylheku.com>2019-01-09 06:44:54 -0800
commit1fb852f2bca2e70bde656ed28654a1f75b40f068 (patch)
tree154dc3682f9fa12473aa0afc781a1383b695b540 /share
parent0cd4fc4869d368c81436a43e3df59d0d42022783 (diff)
downloadtxr-1fb852f2bca2e70bde656ed28654a1f75b40f068.tar.gz
txr-1fb852f2bca2e70bde656ed28654a1f75b40f068.tar.bz2
txr-1fb852f2bca2e70bde656ed28654a1f75b40f068.zip
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%.
Diffstat (limited to 'share')
-rw-r--r--share/txr/stdlib/asm.tl4
-rw-r--r--share/txr/stdlib/vm-param.tl3
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)