This is an archive of the discontinued LLVM Phabricator instance.

[mips] Macro expansion for ld, sd for O32
ClosedPublic

Authored by sdardis on Sep 14 2016, 6:17 AM.

Details

Summary

ld and sd when assembled for the O32 ABI expand to a pair of 32 bit word loads
or stores using the specified source or destination register and the next
register.

This patch does not add support for the cases where the offset is greater than
a 16 bit signed immediate as that would lead to a wrong/misleading error
message as the assembler would report "instruction requires a CPU feature
not currently enabled" for ld & sd for MIPS64 when their offset is not a signed
16 bit number.

This fixes PR/29159.

Thanks to Sean Bruno for reporting this issue!

Event Timeline

sdardis updated this revision to Diff 71338.Sep 14 2016, 6:17 AM
sdardis retitled this revision from to [mips] Macro expansion for ld, sd for O32.
sdardis updated this object.
sdardis set the repository for this revision to rL LLVM.
sdardis added subscribers: llvm-commits, seanbruno.

patch applied, rebuilding clang for testing.

emaste added a subscriber: emaste.Sep 14 2016, 6:31 AM
seanbruno accepted this revision.Sep 14 2016, 6:57 AM
seanbruno added a reviewer: seanbruno.

Yep, thank you very much. This seems to do the right thing!

This revision is now accepted and ready to land.Sep 14 2016, 6:57 AM
vkalintiris requested changes to this revision.Sep 22 2016, 7:05 AM
vkalintiris edited edge metadata.
vkalintiris added inline comments.
lib/Target/Mips/AsmParser/MipsAsmParser.cpp
3902–3903

The GNU assembler orders these instructions in decreasing offsets when the source register is the same with the destination register.

lib/Target/Mips/MipsInstrInfo.td
264–266

We should group this with the ISA_MIPS1_NOT_* classes above.

This revision now requires changes to proceed.Sep 22 2016, 7:06 AM
sdardis updated this revision to Diff 73627.Oct 5 2016, 5:10 AM
sdardis edited edge metadata.
sdardis removed rL LLVM as the repository for this revision.
sdardis marked 2 inline comments as done.

Addressed review comments.

vkalintiris accepted this revision.Oct 18 2016, 6:38 AM
vkalintiris edited edge metadata.

LGTM.

This revision is now accepted and ready to land.Oct 18 2016, 6:38 AM
sdardis closed this revision.Oct 18 2016, 7:37 AM

Thanks, committed rL284481 .