This is an archive of the discontinued LLVM Phabricator instance.

[AArch64] Allow PAC mnemonics in the HINT space with PAC disabled
ClosedPublic

Authored by pbarrio on Apr 17 2020, 7:51 AM.

Details

Summary

It is important to emit HINT instructions instead of PAC ones when
PAC is disabled. This allows compatibility with other assemblers
(e.g. GAS). This was implemented in commit da33762de853.

Still, developers of assembly code will want to write code that is
compatible with both pre- and post-PAC CPUs. They could use HINT
mnemonics, but the new mnemonics are a lot more readable (e.g.
paciaz instead of hint #24), and they will result in the same
encodings. So, while LLVM should not *emit* the new mnemonics when
PAC is disabled, this patch will at least make LLVM *accept*
assembly code that uses them.

Diff Detail

Event Timeline

pbarrio created this revision.Apr 17 2020, 7:51 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 17 2020, 7:51 AM
ostannard accepted this revision.Apr 20 2020, 9:37 AM
ostannard added a subscriber: ostannard.

It would be nice to also print the mnemonic as a comment on the hint instruction, as these will commonly show up in compiled code. It looks like AArch64InstPrinter has access to a CommentStream which could be used for this.

That said, this patch LGTM on its own, the above is just a nice-to-have which could be done later.

This revision is now accepted and ready to land.Apr 20 2020, 9:37 AM
pbarrio updated this revision to Diff 258959.Apr 21 2020, 3:45 AM

Rebase to trigger C.I.

pbarrio updated this revision to Diff 259054.Apr 21 2020, 10:44 AM

Another rebase to pass C.I. - looks like it was broken outside this commit

This revision was automatically updated to reflect the committed changes.