This is an archive of the discontinued LLVM Phabricator instance.

[AArch64] Fix two bugs in the .inst directive
ClosedPublic

Authored by olista01 on Jan 20 2016, 4:12 AM.

Details

Summary

The AArch64 .inst directive was implemented using EmitIntValue, which resulted in both $x and $d (code and data) mapping symbols being emitted at the same address. This fixes it to only emit the $x mapping symbol.

EmitIntValue also emits the value in big-endian order when targeting big-endian systems, but instructions are always emitted in little-endian order for AArch64.

Diff Detail

Repository
rL LLVM

Event Timeline

olista01 updated this revision to Diff 45370.Jan 20 2016, 4:12 AM
olista01 retitled this revision from to [AArch64] Fix two bugs in the .inst directive.
olista01 updated this object.
olista01 added a reviewer: t.p.northover.
olista01 set the repository for this revision to rL LLVM.
olista01 added a subscriber: llvm-commits.
rengolin added inline comments.Jan 20 2016, 4:16 AM
lib/Target/AArch64/MCTargetDesc/AArch64ELFStreamer.cpp
120 ↗(On Diff #45370)

Does this mean AArch64 BE was emitting all instructions the wrong way around until now?

olista01 added inline comments.Jan 20 2016, 4:35 AM
lib/Target/AArch64/MCTargetDesc/AArch64ELFStreamer.cpp
120 ↗(On Diff #45370)

No, this function is only used for the .inst directive.

rengolin accepted this revision.Jan 20 2016, 4:40 AM
rengolin added a reviewer: rengolin.

Otherwise, LGTM. Thanks!

lib/Target/AArch64/MCTargetDesc/AArch64ELFStreamer.cpp
120 ↗(On Diff #45370)

Ah, right! EmitInstruction is just up there. ok. Can you add a one-line comment to this function saying it's *just* for .inst?

This revision is now accepted and ready to land.Jan 20 2016, 4:40 AM
This revision was automatically updated to reflect the committed changes.