This is an archive of the discontinued LLVM Phabricator instance.

[MSP430] Implement PUSHM and POPM instructions
Needs ReviewPublic

Authored by jozefl on Sep 22 2021, 6:06 AM.

Details

Reviewers
asl
atrosinenko
Summary

The MSP430X CPU supports the PUSHM and POPM instructions, which can push
and pop multiple registers to and from the stack in a single
instruction.

For example:

pushm #2, r10
popm  #2, r10

is equivalent to:

push r10
push r9
pop r9
pop r10

PUSHM and POPM only cost 2+n cycles, with a size of one word, so their
use can significantly improve performance and reduce code size,
compared to using individual PUSH and POP instructions.

In addition to the LLVM regression tests, I also ran the dg.exp, execute.exp,
and dg-torture.exp testsuites from GCC, using the MSP430 Binutils simulator.
The results for -mcpu=msp430{,x} were unchanged compared to the results for
without the patch.

If the patch is acceptable, I would appreciate it if someone would apply it
for me using the name and email
"Jozef Lawrynowicz <jozefl.opensrc@gmail.com>",
as I do not have commit access.

Thanks,
Jozef

Diff Detail

Event Timeline

jozefl created this revision.Sep 22 2021, 6:06 AM
jozefl requested review of this revision.Sep 22 2021, 6:06 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 22 2021, 6:06 AM
jozefl updated this revision to Diff 374472.Sep 23 2021, 1:31 AM

Fix clang-tidy warnings.

jozefl updated this revision to Diff 377873.Oct 7 2021, 8:39 AM

Rebase.

jozefl updated this revision to Diff 379308.Oct 13 2021, 1:57 AM

Rebase to fix pre-merge tests.

Ping.

Thanks,
Jozef

Ping.

Thanks,
Jozef

Ping.

Thanks,
Jozef