[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 12/24: Remove integer->char op
From: |
Andy Wingo |
Subject: |
[Guile-commits] 12/24: Remove integer->char op |
Date: |
Tue, 10 Apr 2018 13:24:14 -0400 (EDT) |
wingo pushed a commit to branch master
in repository guile.
commit 935598515407376a42c7e3f6a28437ed62c660f8
Author: Andy Wingo <address@hidden>
Date: Tue Apr 10 13:33:13 2018 +0200
Remove integer->char op
* libguile/vm-engine.c (integer->char): Remove unused op.
* module/language/cps/types.scm:
* module/language/cps/effects-analysis.scm:
* module/language/cps/compile-bytecode.scm (compile-function): Remove
integer->char cases.
* module/system/vm/assembler.scm: Remove emit-integer->char.
---
libguile/vm-engine.c | 22 +---------------------
module/language/cps/compile-bytecode.scm | 2 --
module/language/cps/effects-analysis.scm | 1 -
module/language/cps/types.scm | 5 -----
module/system/vm/assembler.scm | 1 -
5 files changed, 1 insertion(+), 30 deletions(-)
diff --git a/libguile/vm-engine.c b/libguile/vm-engine.c
index 73b9914..0a0df20 100644
--- a/libguile/vm-engine.c
+++ b/libguile/vm-engine.c
@@ -2837,32 +2837,12 @@ VM_NAME (scm_i_thread *thread, struct scm_vm *vp,
VM_DEFINE_OP (172, unused_172, NULL, NOP)
VM_DEFINE_OP (173, unused_173, NULL, NOP)
VM_DEFINE_OP (174, unused_174, NULL, NOP)
+ VM_DEFINE_OP (175, unused_175, NULL, NOP)
{
vm_error_bad_instruction (op);
abort (); /* never reached */
}
- /* integer->char a:12 b:12
- *
- * Convert the U64 value in B to a Scheme character, and return it in
- * A.
- */
- VM_DEFINE_OP (175, integer_to_char, "integer->char", OP1 (X8_S12_S12) |
OP_DST)
- {
- scm_t_uint16 dst, src;
- scm_t_uint64 x;
-
- UNPACK_12_12 (op, dst, src);
- x = SP_REF_U64 (src);
-
- VM_ASSERT (x <= (scm_t_uint64) SCM_CODEPOINT_MAX,
- vm_error_out_of_range_uint64 ("integer->char", x));
-
- SP_SET (dst, SCM_MAKE_ITAG8 ((scm_t_bits) (scm_t_wchar) x,
scm_tc8_char));
-
- NEXT (1);
- }
-
/* char->integer a:12 b:12
*
* Untag the character in B to U64, and return it in A.
diff --git a/module/language/cps/compile-bytecode.scm
b/module/language/cps/compile-bytecode.scm
index a5488d4..aa8c120 100644
--- a/module/language/cps/compile-bytecode.scm
+++ b/module/language/cps/compile-bytecode.scm
@@ -177,8 +177,6 @@
idx))
(($ $primcall 'char->integer #f (src))
(emit-char->integer asm (from-sp dst) (from-sp (slot src))))
- (($ $primcall 'integer->char #f (src))
- (emit-integer->char asm (from-sp dst) (from-sp (slot src))))
(($ $primcall 'add/immediate y (x))
(emit-add/immediate asm (from-sp dst) (from-sp (slot x)) y))
(($ $primcall 'sub/immediate y (x))
diff --git a/module/language/cps/effects-analysis.scm
b/module/language/cps/effects-analysis.scm
index 98eee02..7b65671 100644
--- a/module/language/cps/effects-analysis.scm
+++ b/module/language/cps/effects-analysis.scm
@@ -545,7 +545,6 @@ the LABELS that are clobbered by the effects of LABEL."
(define-primitive-effects
((untag-char _))
((tag-char _))
- ((integer->char _) &type-check)
((char->integer _) &type-check))
;; Atomics are a memory and a compiler barrier; they cause all effects
diff --git a/module/language/cps/types.scm b/module/language/cps/types.scm
index f0313b9..1f24e02 100644
--- a/module/language/cps/types.scm
+++ b/module/language/cps/types.scm
@@ -1605,11 +1605,6 @@ minimum, and maximum."
(define-type-inferrer (tag-char u64 result)
(define! result &char 0 (min (&max u64) *max-codepoint*)))
-(define-simple-type-checker (integer->char (&u64 0 *max-codepoint*)))
-(define-type-inferrer (integer->char i result)
- (restrict! i &u64 0 *max-codepoint*)
- (define! result &char (&min/0 i) (min (&max i) *max-codepoint*)))
-
(define-type-inferrer (char->integer c result)
(restrict! c &char 0 *max-codepoint*)
(define! result &u64 (&min/0 c) (min (&max c) *max-codepoint*)))
diff --git a/module/system/vm/assembler.scm b/module/system/vm/assembler.scm
index ffc9138..cd12f2c 100644
--- a/module/system/vm/assembler.scm
+++ b/module/system/vm/assembler.scm
@@ -260,7 +260,6 @@
emit-srsh/immediate
emit-ulsh/immediate
emit-char->integer
- emit-integer->char
emit-class-of
emit-make-array
emit-scm->f64
- [Guile-commits] branch master updated (98fc9c0 -> 59f1f5a), Andy Wingo, 2018/04/10
- [Guile-commits] 04/24: CPS conversion lowers string-length, Andy Wingo, 2018/04/10
- [Guile-commits] 10/24: Remove string-set! VM op, Andy Wingo, 2018/04/10
- [Guile-commits] 07/24: Remove now-unused string-length, string-ref, Andy Wingo, 2018/04/10
- [Guile-commits] 03/24: Remove specific instructions for add, etc from VM, Andy Wingo, 2018/04/10
- [Guile-commits] 06/24: Lower string-ref in CPS conversion, Andy Wingo, 2018/04/10
- [Guile-commits] 11/24: Instruction explosion for integer->char, Andy Wingo, 2018/04/10
- [Guile-commits] 16/24: Add load-label instruction, Andy Wingo, 2018/04/10
- [Guile-commits] 21/24: Add string->number etc as macro instructions to reify-primitives, Andy Wingo, 2018/04/10
- [Guile-commits] 12/24: Remove integer->char op,
Andy Wingo <=
- [Guile-commits] 13/24: Instruction explosion for char->integer, Andy Wingo, 2018/04/10
- [Guile-commits] 05/24: Add VM ops needed for string-ref, Andy Wingo, 2018/04/10
- [Guile-commits] 01/24: Add instrinsics to runtime, Andy Wingo, 2018/04/10
- [Guile-commits] 02/24: Compile some generic arithmetic to intrinsic calls, Andy Wingo, 2018/04/10
- [Guile-commits] 23/24: Remove class-of opcode, Andy Wingo, 2018/04/10
- [Guile-commits] 19/24: string->number, etc intrinsics, Andy Wingo, 2018/04/10
- [Guile-commits] 24/24: Remove load-typed-array, make-array opcodes, Andy Wingo, 2018/04/10
- [Guile-commits] 20/24: Remove string->number, etc opcodes, Andy Wingo, 2018/04/10
- [Guile-commits] 09/24: Explode "string-set!", Andy Wingo, 2018/04/10
- [Guile-commits] 14/24: Remove char->integer from VM, Andy Wingo, 2018/04/10