This is an archive of the discontinued LLVM Phabricator instance.

[LoongArch] Support parsing la* pseudo instructions
ClosedPublic

Authored by wangleiat on Nov 15 2022, 3:08 AM.

Details

Summary

This patch makes IAS compatible with GAS. It accepts la* pseudo
instructions. And expands la{,.local,.global} into different
instructions according to different features.

Default:
    la = la.global = la.got
    la.local = la.pcrel
With feature "+la-global-with-pcrel":
    la = la.global = la.pcrel
With feature "+la-global-with-abs":
    la = la.global = la.abs
With feature "+la-local-with-abs":
    la.local = la.abs
With features "+la-global-with-pcrel,+la-global-with-abs"(disorder):
    la = la.global = la.pcrel

Note: To keep consistent with GAS behavior, the "la" can only have

one register operand.

Diff Detail

Event Timeline

wangleiat created this revision.Nov 15 2022, 3:08 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 15 2022, 3:08 AM
wangleiat requested review of this revision.Nov 15 2022, 3:08 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 15 2022, 3:08 AM
SixWeining accepted this revision.Nov 17 2022, 4:00 AM

I have verified that this is compatible with GAS.

LGTM and let's wait for others.

This revision is now accepted and ready to land.Nov 17 2022, 4:00 AM
This revision was landed with ongoing or failed builds.Nov 20 2022, 11:34 PM
This revision was automatically updated to reflect the committed changes.