This is an archive of the discontinued LLVM Phabricator instance.

[PowerPC] Implement vec_xxsldwi and vec_xxpermdi builtins - llvm portion.
AbandonedPublic

Authored by jtony on May 2 2017, 6:32 PM.

Details

Summary

The vec_xxsldwi and vec_xxpermdi builtins are missing from altivec.h. This has been requested by developers working on libvpx for VP9 support for Google. Define intrinsics to map to the corresponding PowerPC hard instruction (XXSLDWI, and XXPERMDI) directly.

Diff Detail

Event Timeline

jtony created this revision.May 2 2017, 6:32 PM
nemanjai edited edge metadata.May 2 2017, 8:14 PM

Minor nit, the description doesn't need to have the signatures for the builtins (since this patch does not add any such builtins). Also, ATTRS_o_ai is an implementation detail and not part of the signatures required - on an unrelated note, it will probably not even be used in the final implementation.

lib/Target/PowerPC/PPCInstrVSX.td
2283

These don't need to be here. The instructions are not P9 specific. All targets with VSX have them.

test/CodeGen/PowerPC/p9-xxpermdi.ll
1 ↗(On Diff #97539)

No need to restrict this to P9.

jtony retitled this revision from [PowerPC] Implement vec_xxsldi and vec_xxpermdi builtins - llvm portion. to [PowerPC] Implement vec_xxsldwi and vec_xxpermdi builtins - llvm portion..May 3 2017, 8:34 AM
jtony edited the summary of this revision. (Show Details)
jtony updated this revision to Diff 97655.May 3 2017, 8:42 AM
jtony marked an inline comment as done.

Address the comments from Nemanja.

jtony marked an inline comment as done.May 3 2017, 8:43 AM
kbarton accepted this revision.May 4 2017, 7:49 PM

Please add the PR that this problem is addressing to the summary.

Aside from that, LGTM.

This revision is now accepted and ready to land.May 4 2017, 7:49 PM
echristo requested changes to this revision.May 4 2017, 8:29 PM

A quick question:

I think the clang side of these can lower into generic vector operations rather than intrinsics right? Which would mean that we don't need intrinsics defined for these?

Thoughts?

-eric

This revision now requires changes to proceed.May 4 2017, 8:29 PM
jtony abandoned this revision.May 8 2017, 7:58 AM

These builtins (vec_permdi, vec_xlsdwi) can lower into generic vector operations on the clang side only rather than intrinsics in the llvm part and bulitins in the clang part, abandon this patch and re-implement another one in just clang portion.