[LLVMdev] stack alignment restriction

Bill Wendling wendling at apple.com
Wed Dec 29 05:45:30 PST 2010


On Dec 28, 2010, at 4:02 PM, drizzle drizzle wrote:

> Hi
>   Is there a way to enforce a different alignment on vales on stack
> as compared to other basic types.  Particularly, i would like
> characters to be stored at 2 byte boundary.
> 
Check out examples in the lib/Target/* directories. For instance in X86CallingConv.td, we have things like this:

def CC_X86_64_C : CallingConv<[
...
  // __m64 vectors get 8-byte stack slots that are 8-byte aligned.                                                      
  CCIfType<[x86mmx,v1i64], CCAssignToStack<8, 8>>
}

The second parameter to CCAssigneToStack is the alignment for that type.

-bw





More information about the llvm-dev mailing list