summaryrefslogtreecommitdiff
path: root/module/system/vm/assembler.scm
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2018-04-12 18:14:00 +0200
committerAndy Wingo <wingo@pobox.com>2018-04-13 10:09:56 +0200
commitdff85f6f9f62fae93b240f018212542a58e86437 (patch)
treee7b31984cd01d451094e9bfdd608aa3a61c3e499 /module/system/vm/assembler.scm
parentb32d3cc6f7f521f67637f30f83327110264b9dee (diff)
downloadguile-dff85f6f9f62fae93b240f018212542a58e86437.tar.gz
Explode atomic box ops to new atomic instructions
* libguile/instructions.c (FOR_EACH_INSTRUCTION_WORD_TYPE): Add C8_S24 word type. * libguile/vm-engine.c (UNPACK_8_24): New helper. (atomic-scm-ref/immediate, atomic-scm-set!/immediate) (atomic-swap-scm!/immediate, atomic-scm-compare-and-swap!/immediate): New instructions. (make-atomic-box, atomic-box-ref, atomic-box-set!, atomic-box-swap!) (atomic-box-compare-and-swap!): Disable these ops. * module/language/bytecode.scm (compute-instruction-arity): Add C8_S24 support. * module/system/vm/assembler.scm: Add C8_S24 support. Export assemblers for new opcodes. * module/system/vm/disassembler.scm (disassembler): Support C8_S24. * module/language/cps/compile-bytecode.scm (compile-function): Replace old atomic-box assemblers with the new instructions. * module/language/cps/effects-analysis.scm (annotation->memory-kind): * module/language/cps/types.scm (annotation->type): Add cases for atomic boxes. Mark as all memory kinds because atomic ops serialize memory accesses. * module/language/tree-il/compile-cps.scm (make-atomic-box): (ensure-atomic-box, atomic-box-ref, atomic-box-set!): (atomic-box-swap!, atomic-box-compare-and-swap!): Explode these ops to more basic instructions. * module/system/base/types/internal.scm (%tc7-atomic-box): Add forgotten export.
Diffstat (limited to 'module/system/vm/assembler.scm')
-rw-r--r--module/system/vm/assembler.scm13
1 files changed, 8 insertions, 5 deletions
diff --git a/module/system/vm/assembler.scm b/module/system/vm/assembler.scm
index 6d97d6070..6b249d4cf 100644
--- a/module/system/vm/assembler.scm
+++ b/module/system/vm/assembler.scm
@@ -182,6 +182,11 @@
emit-f32-set!
emit-f64-set!
+ emit-atomic-scm-ref/immediate
+ emit-atomic-scm-set!/immediate
+ emit-atomic-scm-swap!/immediate
+ emit-atomic-scm-compare-and-swap!/immediate
+
;; Intrinsics.
emit-add
emit-add/immediate
@@ -270,11 +275,6 @@
emit-load-f64
emit-load-u64
emit-load-s64
- emit-make-atomic-box
- emit-atomic-box-ref
- emit-atomic-box-set!
- emit-atomic-box-swap!
- emit-atomic-box-compare-and-swap!
emit-handle-interrupts
emit-text
@@ -678,6 +678,8 @@ later by the linker."
(emit asm 0))
((C8_C24 a b)
(emit asm (pack-u8-u24 a b)))
+ ((C8_S24 a b)
+ (emit asm (pack-u8-u24 a b)))
((C16_C16 a b)
(emit asm (pack-u16-u16 a b)))
((B1_X7_L24 a label)
@@ -952,6 +954,7 @@ later by the linker."
('L32 #'(label))
('LO32 #'(label offset))
('C8_C24 #'(a b))
+ ('C8_S24 #'(a b))
('C16_C16 #'(a b))
('B1_X7_L24 #'(a label))
('B1_C7_L24 #'(a b label))