This is an archive of the discontinued LLVM Phabricator instance.

[AArch64, COFF] Interpret .align as power of two for COFF as well
ClosedPublic

Authored by mstorsjo on Jul 18 2017, 4:14 AM.

Details

Summary

Remove some unrelated directives that can't be assembled for COFF from the existing jump table test and rerun that test for windows as well.

Diff Detail

Repository
rL LLVM

Event Timeline

mstorsjo created this revision.Jul 18 2017, 4:14 AM
efriedma added inline comments.Jul 18 2017, 10:48 AM
lib/Target/AArch64/MCTargetDesc/AArch64MCAsmInfo.cpp
108 ↗(On Diff #107056)

Is there any particular reason to choose one way or the other here?

test/MC/AArch64/jump-table.s
2 ↗(On Diff #107056)

This is just checking whether llvm-mc crashes; is that intentional?

mstorsjo added inline comments.Jul 18 2017, 12:26 PM
lib/Target/AArch64/MCTargetDesc/AArch64MCAsmInfo.cpp
108 ↗(On Diff #107056)

In my case, it is to make it possible to assemble existing handwritten aarch64 gas assembly (that currently targets linux and darwin) for windows as well. For armv7, we already have the same situation where linux/darwin gas assembly also can be built for windows, but only while using the armv7-windows-gnu target, not the armv7-windows-msvc target.

If you'd prefer that, I could try to make that distinction here as well, and only match the gas behaviour in the -gnu variant.

test/MC/AArch64/jump-table.s
2 ↗(On Diff #107056)

It's intentional in the sense that I wanted to test that .align 3 is interpreted as 8 byte alignment; prior to the code change this fails to assemble since 3 bytes isn't a valid alignment.

efriedma added inline comments.Jul 18 2017, 1:07 PM
lib/Target/AArch64/MCTargetDesc/AArch64MCAsmInfo.cpp
108 ↗(On Diff #107056)

Should be fine as-is, I think; ARMCOFFMCAsmInfoMicrosoft also sets AlignmentIsInBytes to false.

test/MC/AArch64/jump-table.s
2 ↗(On Diff #107056)

I'd prefer a test that actually verifies that the .align directive produces the correct object file.

mstorsjo updated this revision to Diff 107165.Jul 18 2017, 1:19 PM

Updated to a completely new test that explicitly checks the alignment.

efriedma added inline comments.Jul 18 2017, 2:02 PM
test/MC/COFF/aarch64-align.s
1 ↗(On Diff #107165)

Test needs to be in a directory which allows AArch64 tests (probably test/MC/AArch64/). lit.local.cfg for test/MC/COFF/ requires the x86 backend.

mstorsjo updated this revision to Diff 107274.Jul 19 2017, 3:09 AM

Moved the test to the MC/AArch64 directory.

This revision is now accepted and ready to land.Jul 19 2017, 12:29 PM
This revision was automatically updated to reflect the committed changes.