Lines Matching refs:ty

245 get_homogeneous_type (ffi_type *ty)
247 if (ty->type == FFI_TYPE_STRUCT && ty->elements)
251 = get_homogeneous_type (ty->elements[0]);
252 for (i =1; ty->elements[i]; i++)
258 if (ty->elements[i]->type == FFI_TYPE_STRUCT
259 && ty->elements[i]->elements)
261 iteration_type = get_homogeneous_type (ty->elements[i]);
265 iteration_type = ty->elements[i]->type;
277 return ty->type;
284 If ty is not a STRUCT this function will return 0. */
287 element_count (ffi_type *ty)
289 if (ty->type == FFI_TYPE_STRUCT && ty->elements)
293 for (n = 0; ty->elements[n]; n++)
295 if (ty->elements[n]->type == FFI_TYPE_STRUCT
296 && ty->elements[n]->elements)
297 elems += element_count (ty->elements[n]);
314 is_hfa (ffi_type *ty)
316 if (ty->type == FFI_TYPE_STRUCT
317 && ty->elements[0]
318 && is_floating_type (get_homogeneous_type (ty)))
320 unsigned n = element_count (ty);
339 is_register_candidate (ffi_type *ty)
341 switch (ty->type)
362 if (is_hfa (ty))
366 else if (ty->size > 16)
378 return (ty->size + 7) / 8 < N_X_ARG_REG;
394 is_v_register_candidate (ffi_type *ty)
396 return is_floating_type (ty->type)
397 || (ty->type == FFI_TYPE_STRUCT && is_hfa (ty));
554 ffi_type *ty,
559 unsigned elems = element_count (ty);
566 memcpy (allocate_to_stack (state, stack, ty->alignment, ty->size),
568 ty->size);
573 unsigned short type = get_homogeneous_type (ty);
665 ffi_type *ty = ecif->cif->arg_types[i];
666 switch (ty->type)
690 ecif->avalue[i], ty->type);
694 if (is_hfa (ty))
696 copy_hfa_to_reg_or_stack (ecif->avalue[i], ty, context,
699 else if (ty->size > 16)
708 else if (available_x (&state) >= (ty->size + 7) / 8)
715 for (j = 0; j < (ty->size + 7) / 8; j++)
730 memcpy (allocate_to_stack (&state, stack, ty->alignment,
731 ty->size), ecif->avalue + i, ty->size);
966 ffi_type *ty = cif->arg_types[i];
968 switch (ty->type)
989 &state, ty->type);
994 if (is_hfa (ty))
996 unsigned n = element_count (ty);
1000 avalue[i] = allocate_to_stack (&state, stack, ty->alignment,
1001 ty->size);
1005 switch (get_homogeneous_type (ty))
1020 UINT32 *p = avalue[i] = alloca (ty->size);
1021 for (j = 0; j < element_count (ty); j++)
1041 UINT64 *p = avalue[i] = alloca (ty->size);
1042 for (j = 0; j < element_count (ty); j++)
1063 else if (ty->size > 16)
1072 else if (available_x (&state) >= (ty->size + 7) / 8)
1075 state.ngrn += (ty->size + 7) / 8;
1081 avalue[i] = allocate_to_stack (&state, stack, ty->alignment,
1082 ty->size);