<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On 30 Jul 2014, at 21:29, Ulrich Weigand wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><span class="Apple-style-span" style="font-family: monospace; ">The ELFv1 ABI is used on 64-bit big-endian Linux and AIX.<br></span></span></blockquote></div><br><div>There's one small difference between the two: with the 64 bit ELFv1/SVR4 ABI, tail padding for structs passed by value is only performed in case the struct is larger than 8 bytes, while for AIX 64 bit it's always done. As an aside, on Darwin/ppc64 it's done if the aggregate's size is not in [1,2,4].</div><div><br></div><div>For an example, look at the assembly code for the program below. I don't have the setup to compile for Linux/AIX PPC64 with clang, so I don't know what LLVM does right now (I performed the tests with gcc).</div><div><br></div><div><br></div><div>Jonas</div><div><br></div><div>***</div><div><div>struct str7 {</div><div> char a[7];</div><div>};</div><div><br></div><div>int f7(struct str7 s)</div><div>{</div><div> return s.a[0]+s.a[6];</div><div>}</div><div><br></div><div>int main(int argc)</div><div>{</div><div> struct str7 s7;</div><div> s7.a[0]=argc;</div><div> s7.a[6]=argc;</div><div> return f7(s7);</div><div>}</div></div><div>***</div><div><br></div><div>- Linux/ppc64 (gcc 4.7.2):</div><div><br></div><div>main:</div><div>[initialise s7 on stack]</div><div><div><span class="Apple-tab-span" style="white-space:pre"> </span>ld 9,112(31)</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>srdi 3,9,8 ; shift struct into least significant bits = remove tail padding</div></div><div><div><span class="Apple-tab-span" style="white-space:pre"> </span>bl f7</div></div><div><br></div><div><br></div><div>- AIX/ppc64 (gcc 4.8.1):</div><div><br></div><div><div>[initialise s7, identical code as on Linux]</div><div></div><div> ld 3,112(31) ; keep struct aligned in most signifcant bits (i.e., with tail padding)</div><div> bl .f7</div></div><div><br></div></body></html>