mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-14 07:30:32 +02:00
Add scm->f64 intrinsic
* libguile/vm-engine.c (call-f64<-scm): New intrinsic kind. (scm->f64): Disable instruction. * libguile/intrinsics.h (SCM_FOR_ALL_VM_INTRINSICS): * libguile/intrinsics.c (scm_bootstrap_intrinsics): * module/language/cps/reify-primitives.scm (compute-known-primitives): * module/system/vm/assembler.scm (define-f64<-scm-intrinsic): Add scm->f64.
This commit is contained in:
parent
59f1f5a6a7
commit
b9f7621e13
5 changed files with 27 additions and 9 deletions
|
@ -1563,7 +1563,23 @@ VM_NAME (scm_i_thread *thread, struct scm_vm *vp,
|
|||
NEXT (2);
|
||||
}
|
||||
|
||||
VM_DEFINE_OP (55, unused_55, NULL, NOP)
|
||||
VM_DEFINE_OP (55, call_f64_from_scm, "call-f64<-scm", OP2 (X8_S12_S12, C32) | OP_DST)
|
||||
{
|
||||
scm_t_uint8 dst, src;
|
||||
double res;
|
||||
scm_t_f64_from_scm_intrinsic intrinsic;
|
||||
|
||||
UNPACK_12_12 (op, dst, src);
|
||||
intrinsic = intrinsics[ip[1]];
|
||||
|
||||
SYNC_IP ();
|
||||
res = intrinsic (SP_REF (src));
|
||||
CACHE_SP ();
|
||||
SP_SET_F64 (dst, res);
|
||||
|
||||
NEXT (2);
|
||||
}
|
||||
|
||||
VM_DEFINE_OP (56, unused_56, NULL, NOP)
|
||||
{
|
||||
vm_error_bad_instruction (op);
|
||||
|
@ -2219,13 +2235,7 @@ VM_NAME (scm_i_thread *thread, struct scm_vm *vp,
|
|||
abort (); /* never reached */
|
||||
}
|
||||
|
||||
/* scm->f64 dst:12 src:12
|
||||
*
|
||||
* Unpack a raw double-precision floating-point value from SRC and
|
||||
* place it in DST. Note that SRC can be any value on which
|
||||
* scm_to_double can operate.
|
||||
*/
|
||||
VM_DEFINE_OP (136, scm_to_f64, "scm->f64", OP1 (X8_S12_S12) | OP_DST)
|
||||
VM_DEFINE_OP (136, unused_136, NULL, NOP)
|
||||
{
|
||||
scm_t_uint16 dst, src;
|
||||
UNPACK_12_12 (op, dst, src);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue