This is an archive of the discontinued LLVM Phabricator instance.

[PowerPC][Power10] Implement Vector Permute Builtins in LLVM/Clang
AbandonedPublic

Authored by biplmish on Jun 15 2020, 3:56 AM.

Details

Reviewers
nemanjai
lei
power-llvm-team
Group Reviewers
Restricted Project
Summary

This patch implements builtins for the following prototypes:

vector unsigned char vec_insertl (unsigned char, vector unsigned char, unsigned int);
vector unsigned short vec_insertl (unsigned short, vector unsigned short, unsigned int);
vector unsigned int vec_insertl (unsigned int, vector unsigned int, unsigned int);
vector unsigned long long vec_insertl (unsigned long long, vector unsigned long long, unsigned int);
vector unsigned char vec_insertl (vector unsigned char, vector unsigned char, unsigned int;
vector unsigned short vec_insertl (vector unsigned short, vector unsigned short, unsigned int);
vector unsigned int vec_insertl (vector unsigned int, vector unsigned int, unsigned int);
vector unsigned char vec_inserth (unsigned char, vector unsigned char, unsigned int);
vector unsigned short vec_inserth (unsigned short, vector unsigned short, unsigned int);
vector unsigned int vec_inserth (unsigned int, vector unsigned int, unsigned int);
vector unsigned long long vec_inserth (unsigned long long, vector unsigned long long, unsigned int);
vector unsigned char vec_inserth (vector unsigned char, vector unsigned char, unsigned int);
vector unsigned short vec_inserth (vector unsigned short, vector unsigned short, unsigned int);
vector unsigned int vec_inserth (vector unsigned int, vector unsigned int, unsigned int);

vector signed int vec_replace_elt (vector signed int, signed int, const int);
vector unsigned int vec_replace_elt (vector unsigned int, unsigned int, const int);
vector float vec_replace_elt (vector float, float, const int);
vector signed long long vec_replace_elt (vector signed long long, signed long long, const int);
vector unsigned long long vec_replace_elt (vector unsigned long long, unsigned long long, const int);
vector double rec_replace_elt (vector double, double, const int);

vector unsigned char vec_replace_unaligned (vector unsigned char, signed int, const int);
vector unsigned char vec_replace_unaligned (vector unsigned char, unsigned int, const int);
vector unsigned char vec_replace_unaligned (vector unsigned char, float, const int);
vector unsigned char vec_replace_unaligned (vector unsigned char, signed long long, const int);
vector unsigned char vec_replace_unaligned (vector unsigned char, unsigned long long, const int);
vector unsigned char vec_replace_unaligned (vector unsigned char, double, const int);

vector signed char vec_sldb (vector signed char, vector signed char, const unsigned int);
vector unsigned char vec_sldb (vector unsigned char, vector unsigned char, const unsigned int);
vector signed short vec_sldb (vector signed short, vector signed short, const unsigned int);
vector unsigned short vec_sldb (vector unsigned short, vector unsigned short, const unsigned int);
vector signed int vec_sldb (vector signed int, vector signed int, const unsigned int);
vector unsigned int vec_sldb (vectoextracthr unsigned int, vector unsigned int, const unsigned int);
vector signed long long vec_sldb (vector signed long long, vector signed long long, const unsigned int);
vector unsigned long long vec_sldb (vector unsigned long long, vector unsigned long long, const unsigned int);
vector signed char vec_srdb (vector signed char, vector signed char, const unsigned int);
vector unsigned char vec_srdb (vector unsigned char, vector unsigned char, const unsigned int);
vector signed short vec_srdb (vector signed short, vector signed short, const unsigned int);
vector unsigned short vec_srdb (vector unsigned short, vector unsigned short, const unsigned int);
vector signed int vec_srdb (vector signed int, vector signed int, const unsigned int);
vector unsigned int vec_srdb (vector unsigned int, vector unsigned int, const unsigned int);
vector signed long long vec_srdb (vector signed long long, vector signed long long, const unsigned int);extracth
vector unsigned long long vec_srdb (vector unsigned long long, vector unsigned long long, const unsigned int);

vector signed int vec_splati (const signed int);
vector float vec_splati (const float);

vector double vec_splatid (const float);

vector signed int vec_splati_ins (vector signed int, const unsigned int, const signed int);
vector unsigned int vec_splati_ins (vector unsigned int, const unsigned int, const unsigned int);
vector float vec_splati_ins (vector float, const unsigned int, const float);

vector signed char vec_blendv (vector signed char, vector signed char, vector unsigned char);
vector unsigned char vec_blendv (vector unsigned char, vector unsigned char, vector unsigned char);
vector signed short vec_blendv (vector signed short, vector signed short, vector unsigned short);
vector unsigned short vec_blendv (vector unsigned short, vector unsigned short, vector unsigned short);
vector signed int vec_blendv (vector signed int, vector signed int, vector unsigned int);
vector unsigned int vec_blendv (vector unsigned int, vector unsigned int, vector unsigned int);
vector signed long long vec_blendv (vector signed long long, vector signed long long, vector unsigned long long);
vector unsigned long long vec_blendv (vector unsigned long long, vector unsigned long long, vector unsigned long long);
vector float vec_blendv (vector float, vector float, vector unsigned int);
vector double vec_blendv (vector double, vector double, vector unsigned long long);

vector signed char vec_permx (vector signed char, vector signed char, vector unsigned char, const int);
vector unsigned char vec_permx (vector unsigned char, vector unsigned char, vector unsigned char, const int);
vector signed short vec_permx (vector signed short, vector signed short, vector unsigned char, const int);
vector unsigned short vec_permx (vector unsigned short, vector unsigned short, vector unsigned char, const int);
vector signed int vec_permx (vector signed int, vector signed int, vector unsigned char, const int);
vector unsigned int vec_permx (vector unsigned int, vector unsigned int, vector unsigned char, const int);
vector signed long long vec_permx (vector signed long long, vector signed long long, vector unsigned char, const int);
vector unsigned long long vec_permx (vector unsigned long long, vector unsigned long long, vector unsigned char, const int);
vector float vec_permx (vector float, vector float, vector unsigned char, const int);
vector double vec_permx (vector double, vector double, vector unsigned char, const int);

Depends on D80758

Diff Detail

Event Timeline

biplmish created this revision.Jun 15 2020, 3:56 AM
jsji added a reviewer: Restricted Project.Jun 16 2020, 8:29 AM

This is a huge patch. I suggest you to split them into small ones for each kind of builtins, so that, it would be more easy to review.

lei added a comment.Jun 23 2020, 7:37 AM

This is PR still valid? I see dup def in https://reviews.llvm.org/D82365.

biplmish abandoned this revision.Jun 23 2020, 8:46 AM
biplmish updated this revision to Diff 274670.Jun 30 2020, 8:19 PM
This comment was removed by biplmish.
biplmish abandoned this revision.Jun 30 2020, 8:20 PM