This is an archive of the discontinued LLVM Phabricator instance.

[mips] Fix li/la differences between IAS and GAS.
ClosedPublic

Authored by dsanders on Jul 6 2015, 9:54 AM.

Details

Summary
  • Signed 16-bit should have priority over unsigned.
  • For la, unsigned 16-bit must use ori+addu rather than directly use ori.
  • Correct tests on 32-bit immediates with 64-bit predicates by sign-extending the immediate beforehand. For example, isInt<16>(0xffff8000) should be true and use addiu.

Also split li/la testing into separate files due to their size.

Diff Detail

Event Timeline

dsanders updated this revision to Diff 29102.Jul 6 2015, 9:54 AM
dsanders retitled this revision from to [mips] Fix li/la differences between IAS and GAS..
dsanders updated this object.
dsanders added a reviewer: vkalintiris.
dsanders added a subscriber: llvm-commits.
vkalintiris accepted this revision.Jul 13 2015, 7:08 AM
vkalintiris edited edge metadata.

LGTM. I noted just some trivial suggestions.

lib/Target/Mips/AsmParser/MipsAsmParser.cpp
1730

There's no need for using templates.

1882–1886

Can you use your newly defined emitRR* functions here and for the ORi instruction down below (lines: 1912-1917)?

test/MC/Mips/macro-li-bad.s
3–6

We don't need the Nxx-ONLY prefixes.

This revision is now accepted and ready to land.Jul 13 2015, 7:08 AM
dsanders marked 3 inline comments as done.Jul 14 2015, 5:22 AM
dsanders added inline comments.
lib/Target/Mips/AsmParser/MipsAsmParser.cpp
1882–1886

Done. I've also done the LUi's.

dsanders closed this revision.Jul 14 2015, 5:24 AM
dsanders marked an inline comment as done.