summaryrefslogtreecommitdiff
path: root/module/system/vm/assembler.scm
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2015-11-20 14:52:35 +0100
committerAndy Wingo <wingo@pobox.com>2015-12-01 11:30:55 +0100
commitbdfa1c1b424fc6d408c55e7db17cb3ed7117606a (patch)
treec2c128b948d8de50b7fc2bc67af5a1e662a57a52 /module/system/vm/assembler.scm
parent8f18b71b7afcd475553f760f83af7d79fc34cf01 (diff)
downloadguile-bdfa1c1b424fc6d408c55e7db17cb3ed7117606a.tar.gz
Add tagged and untagged arithmetic ops with immediate operands
* libguile/vm-engine.c (add/immediate, sub/immediate) (uadd/immediate, usub/immediate, umul/immediate): New instructions. * module/language/cps/compile-bytecode.scm (compile-function): * module/language/cps/slot-allocation.scm (compute-needs-slot): * module/language/cps/types.scm: * module/system/vm/assembler.scm (system): * module/language/cps/effects-analysis.scm: Support for new instructions. * module/language/cps/optimize.scm (optimize-first-order-cps): Move primcall specialization to the last step -- the only benefit of doing it earlier was easier reasoning about side effects, and we're already doing that in a more general way with (language cps types). * module/language/cps/specialize-primcalls.scm (specialize-primcalls): Specialize add and sub to add/immediate and sub/immediate, and specialize u64 addition as well. U64 specialization doesn't work now though because computing constant values doesn't work for U64s; oh well.
Diffstat (limited to 'module/system/vm/assembler.scm')
-rw-r--r--module/system/vm/assembler.scm5
1 files changed, 5 insertions, 0 deletions
diff --git a/module/system/vm/assembler.scm b/module/system/vm/assembler.scm
index 9dcd6dc79..07333112f 100644
--- a/module/system/vm/assembler.scm
+++ b/module/system/vm/assembler.scm
@@ -129,7 +129,9 @@
(emit-set-car!* . emit-set-car!)
(emit-set-cdr!* . emit-set-cdr!)
(emit-add* . emit-add)
+ (emit-add/immediate* . emit-add/immediate)
(emit-sub* . emit-sub)
+ (emit-sub/immediate* . emit-sub/immediate)
(emit-mul* . emit-mul)
(emit-div* . emit-div)
(emit-quo* . emit-quo)
@@ -143,6 +145,9 @@
(emit-uadd* . emit-uadd)
(emit-usub* . emit-usub)
(emit-umul* . emit-umul)
+ (emit-uadd/immediate* . emit-uadd/immediate)
+ (emit-usub/immediate* . emit-usub/immediate)
+ (emit-umul/immediate* . emit-umul/immediate)
(emit-logand* . emit-logand)
(emit-logior* . emit-logior)
(emit-logxor* . emit-logxor)