mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-24 12:20:20 +02:00
Add support for unboxed s64 values
* libguile/frames.c (enum stack_item_representation): (scm_to_stack_item_representation): (scm_frame_local_ref, scm_frame_local_set_x): Support for S64 representations. * libguile/frames.h (union scm_vm_stack_element): Add signed 64-bit integer field. * libguile/vm-engine.c (scm->s64, s64->scm, load-s64): New instructions. * module/language/cps/compile-bytecode.scm (compile-function): * module/language/cps/cse.scm (compute-equivalent-subexpressions): * module/language/cps/effects-analysis.scm: * module/language/cps/slot-allocation.scm (compute-var-representations) (compute-needs-slot, allocate-slots): * module/language/cps/utils.scm (compute-constant-values): * module/language/cps/specialize-primcalls.scm (specialize-primcalls): Add support for new primcalls. * module/language/cps/types.scm (&s64): New type. (&s64-min, &s64-max, &u64-max): New convenience definitions. (&range-min, &range-max): Use &s64-min and &u64-max names. (scm->s64, load-s64, s64->scm): Add support for new primcalls. * module/system/vm/assembler.scm (emit-scm->s64, emit-s64->scm) (emit-load-s64): New exports. * module/system/vm/assembler.scm (write-arities): Support for s64 slots. * module/system/vm/debug.scm (arity-definitions): Support for s64 slots.
This commit is contained in:
parent
f34688ad25
commit
8bf77f7192
12 changed files with 116 additions and 15 deletions
|
@ -242,7 +242,8 @@ enum stack_item_representation
|
|||
{
|
||||
STACK_ITEM_SCM = 0,
|
||||
STACK_ITEM_F64 = 1,
|
||||
STACK_ITEM_U64 = 2
|
||||
STACK_ITEM_U64 = 2,
|
||||
STACK_ITEM_S64 = 3
|
||||
};
|
||||
|
||||
static enum stack_item_representation
|
||||
|
@ -254,6 +255,8 @@ scm_to_stack_item_representation (SCM x, const char *subr, int pos)
|
|||
return STACK_ITEM_F64;
|
||||
if (scm_is_eq (x, scm_from_latin1_symbol ("u64")))
|
||||
return STACK_ITEM_U64;
|
||||
if (scm_is_eq (x, scm_from_latin1_symbol ("s64")))
|
||||
return STACK_ITEM_S64;
|
||||
|
||||
scm_wrong_type_arg (subr, pos, x);
|
||||
return 0; /* Not reached. */
|
||||
|
@ -286,6 +289,8 @@ SCM_DEFINE (scm_frame_local_ref, "frame-local-ref", 3, 0, 0,
|
|||
return scm_from_double (item->as_f64);
|
||||
case STACK_ITEM_U64:
|
||||
return scm_from_uint64 (item->as_u64);
|
||||
case STACK_ITEM_S64:
|
||||
return scm_from_int64 (item->as_s64);
|
||||
default:
|
||||
abort();
|
||||
}
|
||||
|
@ -326,6 +331,9 @@ SCM_DEFINE (scm_frame_local_set_x, "frame-local-set!", 4, 0, 0,
|
|||
case STACK_ITEM_U64:
|
||||
item->as_u64 = scm_to_uint64 (val);
|
||||
break;
|
||||
case STACK_ITEM_S64:
|
||||
item->as_s64 = scm_to_int64 (val);
|
||||
break;
|
||||
default:
|
||||
abort();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue