This is an archive of the discontinued LLVM Phabricator instance.

Add support for e500mc extpid instructions
ClosedPublic

Authored by vit9696 on Oct 24 2017, 11:05 AM.

Details

Reviewers
hfinkel
uweigand
Summary

This change allows one to assemble (and disassemble) PPC32 external pid instructions specific to e500mc CPUs.
The list and details are available in https://www.nxp.com/docs/en/reference-manual/E500MCRM.pdf (3.4.11.2).
The encoding is defined in http://cache.freescale.com/files/32bit/doc/ref_manual/EREF_RM.pdf (6.4).

This was additionally tested against gcc except dcbzlep instruction which gcc does not support.

Diff Detail

Event Timeline

vit9696 created this revision.Oct 24 2017, 11:05 AM
hfinkel added inline comments.Oct 24 2017, 11:15 AM
lib/Target/PowerPC/PPCInstrInfo.td
3940

You have patterns on a bunch of these? Do you intend to add code-generation support for these instructions, or just assembler/disassembler support? If the latter, remove the patterns.

vit9696 added inline comments.Oct 24 2017, 11:26 AM
lib/Target/PowerPC/PPCInstrInfo.td
3940

According to the docs these instructions behave the same way at the non-extpid ones, so I tried to preserve as much information as possible. I don't think one could be able to use them in normal C (they are all privileged and specific), but if someone decides to add the intrinsics sooner or later it might help.
If you are think it is better to leave them out (I personally do not need anything but inline/outline asm/disasm), then I am fine with it. Could group stuff (e.g. PPC970_DGroup_Single) be also taken out in this case?

hfinkel added inline comments.Oct 24 2017, 11:32 AM
lib/Target/PowerPC/PPCInstrInfo.td
3940

I don't think one could be able to use them in normal C (they are all privileged and specific), but if someone decides to add the intrinsics sooner or later it might help.

In that case, they shouldn't have patterns (because we might get them from instruction selection in normal C code). Please remove the patterns.

Could group stuff (e.g. PPC970_DGroup_Single) be also taken out in this case?

Yes, you can leave those out as well (it's meaningless in this context).

vit9696 updated this revision to Diff 120114.Oct 24 2017, 12:08 PM

Removed the unnecessary codegen patterns.

vit9696 marked an inline comment as done.Oct 24 2017, 12:08 PM
hfinkel edited edge metadata.Oct 26 2017, 3:55 PM

Please also add a disassembler test in test/MC/Disassembler/PowerPC based on test/MC/PowerPC/ppc32-extpid-e500.s.

vit9696 updated this revision to Diff 120509.Oct 26 2017, 4:14 PM

@hfinkel, thanks for a reminder, somehow forgot about it. Added now :)

hfinkel accepted this revision.Oct 26 2017, 4:21 PM

LGTM

This revision is now accepted and ready to land.Oct 26 2017, 4:21 PM
vit9696 added a comment.EditedNov 29 2017, 8:55 PM

Ping, could you commit this please?

vit9696 closed this revision.Dec 10 2017, 9:00 AM

This got merged, thx to tnorthover.