From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Jacobowitz To: Andrew Cagney Cc: David B Anderson , gdb-patches@sources.redhat.com Subject: Re: [rfa] mips argument passing fixes for o32 Date: Sun, 15 Jul 2001 15:22:00 -0000 Message-id: <20010715152239.A21579@nevyn.them.org> References: <200107130003.RAA57770@quasar.engr.sgi.com> <3B521018.5080706@cygnus.com> X-SW-Source: 2001-07/msg00361.html On Sun, Jul 15, 2001 at 05:50:16PM -0400, Andrew Cagney wrote: > You wouldn't have access to such a machine by any chance? :-) > > I'm getting the feeling I'm wrong with this one - for some strange > historical reason LE o32 really does left/right shift small parameters > (I'm still mining the archives). > > Assuming that is the case ... > > > if (!MIPS_EABI > > && MIPS_SAVED_REGSIZE < 8 > > - && TARGET_BYTE_ORDER == BIG_ENDIAN > > + && (TARGET_BYTE_ORDER == BIG_ENDIAN > > + || TYPE_LENGTH (arg_type) < MIPS_SAVED_REGSIZE) > > && partial_len < MIPS_SAVED_REGSIZE > > && (typecode == TYPE_CODE_STRUCT || > > typecode == TYPE_CODE_UNION)) > > I don't know that line being added should be > > > > || TYPE_LENGTH (arg_type) < MIPS_SAVED_REGSIZE > > > it should at least be guarded by ``ABI == o32''. What does LE n32 do > for instance? > If GCC, for o32, always left shifts the structs dregs (PARTIAL_LEN < > MIPS_SAVED_REGSIZE) then is just the ABI test needed? That's not what it does, though. It only left-shifts the dregs if they constitute the entire structure; thus the check I used. Little-endian will left-shift only small structs, while big-endian will left-shift small structs or leftovers. As for when it is done, GCC says: if (struct_p && int_size_in_bytes (type) < UNITS_PER_WORD && ! TARGET_64BIT && mips_abi != ABI_EABI) However, there's a comment to the effect that the !TARGET_64BIT is actually wrong, and being used only for efficiency. So I'm not sure precisely when this applies. It seems that !MIPS_EABI and MIPS_SAVED_REGSIZE < 8 would agree with at least the way that GCC does things, but GCC is not a sterling example of n32 or n64 compatibility. > PS: That function is the official example of how to _not_ multi-arch an ABI. And does it ever show... -- Daniel Jacobowitz Carnegie Mellon University MontaVista Software Debian GNU/Linux Developer