Lines Matching refs:ty

248 get_homogeneous_type (ffi_type *ty)
250 if (ty->type == FFI_TYPE_STRUCT && ty->elements)
254 = get_homogeneous_type (ty->elements[0]);
255 for (i =1; ty->elements[i]; i++)
261 if (ty->elements[i]->type == FFI_TYPE_STRUCT
262 && ty->elements[i]->elements)
264 iteration_type = get_homogeneous_type (ty->elements[i]);
268 iteration_type = ty->elements[i]->type;
280 return ty->type;
287 If ty is not a STRUCT this function will return 0. */
290 element_count (ffi_type *ty)
292 if (ty->type == FFI_TYPE_STRUCT && ty->elements)
296 for (n = 0; ty->elements[n]; n++)
298 if (ty->elements[n]->type == FFI_TYPE_STRUCT
299 && ty->elements[n]->elements)
300 elems += element_count (ty->elements[n]);
317 is_hfa (ffi_type *ty)
319 if (ty->type == FFI_TYPE_STRUCT
320 && ty->elements[0]
321 && is_floating_type (get_homogeneous_type (ty)))
323 unsigned n = element_count (ty);
342 is_register_candidate (ffi_type *ty)
344 switch (ty->type)
365 if (is_hfa (ty))
369 else if (ty->size > 16)
381 return (ty->size + 7) / 8 < N_X_ARG_REG;
397 is_v_register_candidate (ffi_type *ty)
399 return is_floating_type (ty->type)
400 || (ty->type == FFI_TYPE_STRUCT && is_hfa (ty));
557 ffi_type *ty,
562 unsigned elems = element_count (ty);
569 memcpy (allocate_to_stack (state, stack, ty->alignment, ty->size),
571 ty->size);
576 unsigned short type = get_homogeneous_type (ty);
668 ffi_type *ty = ecif->cif->arg_types[i];
669 switch (ty->type)
693 ecif->avalue[i], ty->type);
697 if (is_hfa (ty))
699 copy_hfa_to_reg_or_stack (ecif->avalue[i], ty, context,
702 else if (ty->size > 16)
711 else if (available_x (&state) >= (ty->size + 7) / 8)
718 for (j = 0; j < (ty->size + 7) / 8; j++)
733 memcpy (allocate_to_stack (&state, stack, ty->alignment,
734 ty->size), ecif->avalue + i, ty->size);
977 ffi_type *ty = cif->arg_types[i];
979 switch (ty->type)
1000 &state, ty->type);
1005 if (is_hfa (ty))
1007 unsigned n = element_count (ty);
1011 avalue[i] = allocate_to_stack (&state, stack, ty->alignment,
1012 ty->size);
1016 switch (get_homogeneous_type (ty))
1031 UINT32 *p = avalue[i] = alloca (ty->size);
1032 for (j = 0; j < element_count (ty); j++)
1052 UINT64 *p = avalue[i] = alloca (ty->size);
1053 for (j = 0; j < element_count (ty); j++)
1074 else if (ty->size > 16)
1083 else if (available_x (&state) >= (ty->size + 7) / 8)
1086 state.ngrn += (ty->size + 7) / 8;
1092 avalue[i] = allocate_to_stack (&state, stack, ty->alignment,
1093 ty->size);