+ else
+ {
+ /* Reduce the parameter down to something that fits in a
+ "word". */
+ char word[MAX_REGISTER_SIZE];
+ memset (word, 0, MAX_REGISTER_SIZE);
+ if (len > tdep->wordsize
+ || TYPE_CODE (type) == TYPE_CODE_STRUCT
+ || TYPE_CODE (type) == TYPE_CODE_UNION)
+ {
+ /* Structs and large values are put on an 8 byte
+ aligned stack ... */
+ structoffset = align_up (structoffset, 8);
+ if (write_pass)
+ write_memory (sp + structoffset, val, len);
+ /* ... and then a "word" pointing to that address is
+ passed as the parameter. */
+ store_unsigned_integer (word, tdep->wordsize,
+ sp + structoffset);
+ structoffset += len;
+ }
+ else if (TYPE_CODE (type) == TYPE_CODE_INT)
+ /* Sign or zero extend the "int" into a "word". */
+ store_unsigned_integer (word, tdep->wordsize,
+ unpack_long (type, val));
+ else
+ /* Always goes in the low address. */
+ memcpy (word, val, len);
+ /* Store that "word" in a register, or on the stack.
+ The words have "4" byte alignment. */
+ if (greg <= 10)
+ {
+ if (write_pass)
+ regcache_cooked_write (regcache,
+ tdep->ppc_gp0_regnum + greg,
+ word);
+ greg++;
+ }
+ else
+ {
+ argoffset = align_up (argoffset, tdep->wordsize);
+ if (write_pass)
+ write_memory (sp + argoffset, word, tdep->wordsize);
+ argoffset += tdep->wordsize;
+ }
+ }
+ }
+
+ /* Compute the actual stack space requirements. */
+ if (!write_pass)
+ {
+ /* Remember the amount of space needed by the arguments. */
+ argspace = argoffset;
+ /* Allocate space for both the arguments and the structures. */
+ sp -= (argoffset + structoffset);
+ /* Ensure that the stack is still 16 byte aligned. */
+ sp = align_down (sp, 16);
+ }