On Fri, 13 Oct 2023 14:28:58 GMT, Jorn Vernee <jver...@openjdk.org> wrote:
>>> Just to clarify, is the ABI equal to what is described in this table: >>> https://www.ibm.com/docs/en/xl-c-and-cpp-aix/16.1?topic=data-using-alignment-modes >>> ? >>> >>> This shows `double` having 8-byte alignment, but being 4-byte aligned when >>> not the first member of an aggregate. >> >> Interesting! This matches my understanding. I can see that doubles are >> 4-byte aligned within structures. The 8-byte alignment of the first member >> is already established by the allocation alignment. >> >> I have only read the ABI documentation for linux. IBM will have to cover AIX >> specific details if there are more questions. > > Discussed this a bit with Maurizio. There are a few things to consider: > > - `cannonicalLayouts` allows for just a single mapping from type name to > layout. I think `double` should map to the 8-byte aligned layout. (the same > alignment you get from `_Alignof(double)` in C). > - We have to relax the checking done by the linker on AIX. Maybe change > `AbstractLinker::checkLayoutRecursive` call some `checkStructMemberLayout` > method, that by default just calls `checkLayoutRecursive`, but which the AIX > linker can override to implement it's special rules for doubles. > - We need a small spec update to allow for struct field layouts that are not > canonical layouts. I'll take a stab at that, and then get back to you. Thanks for your outstanding support! I'm awaiting feedback from IBM and a solution for the subtask https://bugs.openjdk.org/browse/JDK-8317799. There shouldn't be much work to be done after that, I guess. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/16179#discussion_r1358368099