1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-14 15:40:19 +02:00

Add bv-length instruction

* libguile/vm-engine.c (bv-length): New instruction.
* module/language/cps/compile-bytecode.scm (compile-function):
* module/language/cps/effects-analysis.scm (bv-length):
* module/language/cps/primitives.scm (*instruction-aliases*):
* module/language/cps/slot-allocation.scm (compute-var-representations):
* module/language/cps/types.scm (bv-length):
* module/language/tree-il/compile-cps.scm (convert): Add support for
  bv-length.
* module/system/vm/assembler.scm: Export emit-bv-length.
This commit is contained in:
Andy Wingo 2015-11-19 22:12:04 +01:00
parent 870ac91a4e
commit 8464cc576c
8 changed files with 28 additions and 5 deletions

View file

@ -3341,7 +3341,19 @@ VM_NAME (scm_i_thread *thread, struct scm_vm *vp,
NEXT (1);
}
VM_DEFINE_OP (145, unused_145, NULL, NOP)
/* bv-length dst:12 src:12
*
* Store the length of the bytevector in SRC in DST, as an untagged
* 64-bit integer.
*/
VM_DEFINE_OP (145, bv_length, "bv-length", OP1 (X8_S12_S12) | OP_DST)
{
ARGS1 (bv);
VM_VALIDATE_BYTEVECTOR (bv, "bytevector-length");
SP_SET_U64 (dst, SCM_BYTEVECTOR_LENGTH (bv));
NEXT (1);
}
VM_DEFINE_OP (146, unused_146, NULL, NOP)
VM_DEFINE_OP (147, unused_147, NULL, NOP)
VM_DEFINE_OP (148, unused_148, NULL, NOP)