-/*
- * mini-arm-gsharedvt.c: gsharedvt support code for arm
+/**
+ * \file
+ * gsharedvt support code for arm
*
* Authors:
* Zoltan Varga <vargaz@gmail.com>
MonoMethodSignature *caller_sig, *callee_sig;
int aindex, i;
gboolean var_ret = FALSE;
+ gboolean have_fregs = FALSE;
CallInfo *cinfo, *gcinfo;
MonoMethodSignature *sig, *gsig;
GPtrArray *map;
int *src = NULL, *dst = NULL;
int nsrc, ndst, nslots, src_slot, arg_marshal;
+ if (ainfo->storage == RegTypeFP || ainfo2->storage == RegTypeFP) {
+ have_fregs = TRUE;
+ continue;
+ }
+
/*
* The src descriptor looks like this:
* - 4 bits src slot
else
src_slot = map_stack_slot (ainfo->offset / 4);
g_assert (ndst < 256);
- g_assert (src_slot < 16);
- src [0] = (ndst << 4) | src_slot;
+ g_assert (src_slot < 256);
+ src [0] = (ndst << 8) | src_slot;
if (ainfo2->storage == RegTypeGeneral && ainfo2->size != 0 && ainfo2->size != 4) {
/* Have to load less than 4 bytes */
ndst = get_arg_slots (ainfo2, &dst);
}
if (nsrc)
- src [0] |= (arg_marshal << 16);
+ src [0] |= (arg_marshal << 24);
nslots = MIN (nsrc, ndst);
for (i = 0; i < nslots; ++i)
info->ret_marshal = GSHAREDVT_RET_IREGS;
break;
case RegTypeFP:
- // FIXME: VFP
- if (cinfo->ret.size == 4)
- info->ret_marshal = GSHAREDVT_RET_IREG;
- else
- info->ret_marshal = GSHAREDVT_RET_IREGS;
+ if (mono_arm_is_hard_float ()) {
+ if (cinfo->ret.size == 4)
+ info->ret_marshal = GSHAREDVT_RET_VFP_R4;
+ else
+ info->ret_marshal = GSHAREDVT_RET_VFP_R8;
+ } else {
+ if (cinfo->ret.size == 4)
+ info->ret_marshal = GSHAREDVT_RET_IREG;
+ else
+ info->ret_marshal = GSHAREDVT_RET_IREGS;
+ }
break;
case RegTypeStructByAddr:
info->ret_marshal = GSHAREDVT_RET_NONE;
}
info->stack_usage = ALIGN_TO (info->stack_usage, MONO_ARCH_FRAME_ALIGNMENT);
-
- g_free (caller_cinfo);
- g_free (callee_cinfo);
+ info->caller_cinfo = caller_cinfo;
+ info->callee_cinfo = callee_cinfo;
+ info->have_fregs = have_fregs;
return info;
}
-#endif
\ No newline at end of file
+#endif