mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-12 06:41:13 +02:00
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.
This commit is contained in:
parent
880d68ea22
commit
9355985154
5 changed files with 1 additions and 30 deletions
|
@ -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.
|
||||
|
|
|
@ -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))
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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*)))
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue