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

Avoid needless 64-bit args on 32-bit machines for some intrinsics

* libguile/intrinsics.h:
* libguile/intrinsics.c (string_set_x): Change to take size_t and u32 as
  args.
  (allocate_words): Change to take size_t as arg.
* libguile/vm.c (expand_apply_argument): Rename from rest_arg_length,
  and also handle the stack manipulation.
* libguile/vm-engine.c (expand-apply-argument): Update for intrinsic
  change.
  (call-scm-sz-u32): Rename from call-scm-u64-u64, as it matches its
  uses and will compile better on 32-bit systems.
* module/system/vm/assembler.scm (define-scm-sz-u32-intrinsic):
  (string-set!): Update for new instrinsic call inst.
* libguile/jit.c (compile_call_scm_sz_u32): Adapt.
This commit is contained in:
Andy Wingo 2018-08-13 14:24:44 +02:00
parent 11940f4c72
commit d4abe8bbed
6 changed files with 26 additions and 31 deletions

View file

@ -1016,21 +1016,9 @@ VM_NAME (scm_thread *thread)
*/
VM_DEFINE_OP (30, expand_apply_argument, "expand-apply-argument", OP1 (X32))
{
int list_len;
SCM list;
list = SP_REF (0);
SYNC_IP ();
list_len = CALL_INTRINSIC (rest_arg_length, (list));
ALLOC_FRAME (FRAME_LOCALS_COUNT () - 1 + list_len);
while (list_len--)
{
SP_SET (list_len, SCM_CAR (list));
list = SCM_CDR (list);
}
CALL_INTRINSIC (expand_apply_argument, (thread));
CACHE_SP ();
NEXT (1);
}
@ -1380,10 +1368,10 @@ VM_NAME (scm_thread *thread)
NEXT (2);
}
VM_DEFINE_OP (53, call_scm_u64_u64, "call-scm-u64-u64", OP2 (X8_S8_S8_S8, C32))
VM_DEFINE_OP (53, call_scm_sz_u32, "call-scm-sz-u32", OP2 (X8_S8_S8_S8, C32))
{
uint8_t a, b, c;
scm_t_scm_u64_u64_intrinsic intrinsic;
scm_t_scm_sz_u32_intrinsic intrinsic;
UNPACK_8_8_8 (op, a, b, c);
intrinsic = intrinsics[ip[1]];