This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: overhead of bfd_{get,put}*()
On Tue, 23 Feb 2010, David Miller wrote:
> From: "Joseph S. Myers" <joseph@codesourcery.com>
> Date: Tue, 23 Feb 2010 17:55:59 +0000 (UTC)
>
> > What you can do is something along the lines of: if GCC, load using a
> > packed structure type; leave it to the GCC target to know what
> > instructions are OK for such a load.
>
> I'm on sparc which requires alignment so this won't help me at
> all. It's going to emit the same ugly song and dance of byte
> loads and shift/ors we use right now.
Hopefully the more complicated option of the runtime check for alignment
(using __builtin_expect to mark the aligned case as very likely) would
help. If you inline the functions it might even be possible for the
compiler to deduce the alignment in some cases, though I suspect that
won't happen much. Of course you'd need to benchmark to see what helps.
--
Joseph S. Myers
joseph@codesourcery.com