diff options
-rw-r--r-- | share/txr/stdlib/asm.tl | 3 | ||||
-rw-r--r-- | share/txr/stdlib/compiler.tl | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/share/txr/stdlib/asm.tl b/share/txr/stdlib/asm.tl index 33eed4bf..1c4e76c2 100644 --- a/share/txr/stdlib/asm.tl +++ b/share/txr/stdlib/asm.tl @@ -45,6 +45,7 @@ (defstruct assembler nil buf bstr + (max-treg 0) (labdef (hash)) (labref (hash)) (:static imm-width (relate '(si mi bi) '(10 16 32))) @@ -169,6 +170,8 @@ (not (< parg 1024))) oc.(synerr "argument ~a of ~s isn't a small register" n syntax)) + (when (and (member type '(r rs d ds)) (< parg 256)) + (set me.max-treg (max parg me.max-treg))) parg)) pattern (rest syntax) (range 1))) diff --git a/share/txr/stdlib/compiler.tl b/share/txr/stdlib/compiler.tl index 0a46e0ae..bab0d341 100644 --- a/share/txr/stdlib/compiler.tl +++ b/share/txr/stdlib/compiler.tl @@ -1302,7 +1302,7 @@ co.(free-treg oreg) co.(check-treg-leak) as.(asm ^(,*frag.code (end ,frag.oreg))) - (vm-make-desc co.nlev co.treg-cntr as.buf co.(get-datavec) co.(get-funvec))))) + (vm-make-desc co.nlev (succ as.max-treg) as.buf co.(get-datavec) co.(get-funvec))))) (defvarl %file-suff-rx% #/[.][^\\\/.]+/) |