[LLVMdev] Another struct-return question

Reid Kleckner rnk at google.com
Fri Jan 23 10:20:22 PST 2015


On Fri, Jan 23, 2015 at 9:17 AM, Rodney M. Bates <rodney_bates at lcwb.coop>
wrote:
>
> So the next question is, what about fields that that occupy only whole
> bytes, but
> are not 2^n bytes or aren't aligned to their size.  Should I treat these as
> bitfields and produce shift-and-mask operations to access them?
>

I would represent this with unaligned accesses. You can set the alignment
on loads and stores generated for field access down to what the struct
layout guarantees.

I just checked, and the Sparc backend will splice up such loads into
individual byte accesses.


> Thanks for the advice.


No problem. :)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150123/fdb47894/attachment.html>


More information about the llvm-dev mailing list