This is an archive of the discontinued LLVM Phabricator instance.

Add VSX loads/stores to fastisel for PPC target
ClosedPublic

Authored by seurer on Nov 14 2014, 11:43 AM.

Details

Summary

This patch adds VSX floating point loads and stores to fastisel.

Along with the change to tablegen (D6220), VSX instructions are now fully supported in fastisel.

Diff Detail

Event Timeline

seurer updated this revision to Diff 16219.Nov 14 2014, 11:43 AM
seurer retitled this revision from to Add VSX loads/stores to fastisel for PPC target.
seurer updated this object.
seurer edited the test plan for this revision. (Show Details)
seurer added reviewers: echristo, hfinkel, wschmidt.
seurer added a subscriber: Unknown Object (MLST).
echristo edited edge metadata.Nov 14 2014, 1:11 PM

Few nits:

Clang-format? :)

Periods at the end of sentences.

Couple of inline comments.

Thanks!

/home/seurer/llvm/llvm-oneoff/lib/Target/PowerPC/PPCFastISel.cpp
143

I'd prefer to pull the Register != 0 out of this so that we can keep the general pattern of checking it. Thoughts?

492

Hmm.. explain the assert here?

wschmidt edited edge metadata.Nov 14 2014, 1:39 PM

Looks pretty good -- just a couple of inline comments.

/home/seurer/llvm/llvm-oneoff/lib/Target/PowerPC/PPCFastISel.cpp
145

I'd like to see this named isVSFRCRegister or the like. The VSFRC class comprises only the most-significant-half of each of the VSX registers (the VSRs), so I feel the name is misleading.

492

Yeah, I don't get this either.

seurer added inline comments.Nov 14 2014, 4:15 PM
/home/seurer/llvm/llvm-oneoff/lib/Target/PowerPC/PPCFastISel.cpp
143

If the register is 0 then the call to getRegClass will fail in an assertion. Or rather, another function it calls will fail.

145

OK, done.

seurer added inline comments.Nov 14 2014, 4:19 PM
/home/seurer/llvm/llvm-oneoff/lib/Target/PowerPC/PPCFastISel.cpp
492

Early on when I was experimenting with this the base reg was sometimes 0 which caused code further on to fail. It is no longer necessary and I will remove it.

echristo added inline comments.Nov 14 2014, 4:22 PM
/home/seurer/llvm/llvm-oneoff/lib/Target/PowerPC/PPCFastISel.cpp
143

Sure. Make it an assert rather than a check? Should be checking that ResultReg isn't equal to 0 earlier I think.

seurer updated this revision to Diff 16448.Nov 20 2014, 1:35 PM
seurer edited edge metadata.

Updated with changes to address comments.

Note: the check for ResultReg != 0 for the load case is really necessary.

hfinkel accepted this revision.Nov 20 2014, 7:28 PM
hfinkel edited edge metadata.

You have formatting to fix, otherwise LGTM.

In case you did not know, you can run clang-format directly on your patch file.

/home/seurer/llvm/llvm-oneoff/lib/Target/PowerPC/PPCFastISel.cpp
489

Comma after 0.

490

Extra space before 'be'

491

No space after isVSFRCRegister.

506

Add spaces around ==.

520

Add spaces around ==.

622

Comma after 0.

623

Extra space before 'be'.

636

Add spaces around ==.

653

Add spaces around ==.

This revision is now accepted and ready to land.Nov 20 2014, 7:28 PM
seurer closed this revision.Dec 8 2014, 6:56 AM

Code checked in [llvm] r223507