This is an archive of the discontinued LLVM Phabricator instance.

[X86] Add -malign-double support
AbandonedPublic

Authored by phosek on Sep 14 2015, 12:16 PM.

Details

Reviewers
None
Summary

The -malign-double flag causes i64 and f64 types to have alignment 8
instead of 4. On x86-64, -malign-double is enabled by default.

Diff Detail

Event Timeline

phosek updated this revision to Diff 34722.Sep 14 2015, 12:16 PM
phosek retitled this revision from to [X86] Add -malign-double support.
phosek updated this object.
phosek set the repository for this revision to rL LLVM.Sep 14 2015, 12:22 PM
jfb added a comment.Sep 14 2015, 12:31 PM

GCC's description is:

-malign-double
-mno-align-double
Control whether GCC aligns double, long double, and long long variables on a two word boundary or a one word boundary. Aligning double variables on a two word boundary will produce code that runs somewhat faster on a `Pentium' at the expense of more memory.
On x86-64, -malign-double is enabled by default.

Warning: if you use the -malign-double switch, structures containing the above types will be aligned differently than the published application binary interface specifications for the 386 and will not be binary compatible with structures in code compiled without that switch.

I think this should be similar.

Could you also check stack spill alignment?

Could you also test the following from GCC's test suite:

./gcc/testsuite/g++.old-deja/g++.abi/bitfields.C
./gcc/testsuite/g++.old-deja/g++.abi/aggregates.C
./gcc/testsuite/g++.old-deja/g++.abi/align.C