[PATCH] D81836: [PowerPC][Power10] Implement Vector Permute Builtins in LLVM/Clang

Biplob Mishra via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 15 04:19:06 PDT 2020


biplmish created this revision.
biplmish added reviewers: nemanjai, lei, power-llvm-team.
biplmish added projects: clang, LLVM, PowerPC.
Herald added subscribers: llvm-commits, cfe-commits, shchenz, hiraditya.

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 <https://reviews.llvm.org/D80758>


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D81836

Files:
  clang/include/clang/Basic/BuiltinsPPC.def
  clang/lib/Headers/altivec.h
  clang/test/CodeGen/builtins-ppc-p10vector.c
  llvm/include/llvm/IR/IntrinsicsPowerPC.td
  llvm/lib/Target/PowerPC/PPCISelLowering.cpp
  llvm/lib/Target/PowerPC/PPCISelLowering.h
  llvm/lib/Target/PowerPC/PPCInstrInfo.td
  llvm/lib/Target/PowerPC/PPCInstrPrefix.td
  llvm/lib/Target/PowerPC/PPCScheduleP9.td
  llvm/test/CodeGen/PowerPC/p10-permute-ops.ll
  llvm/test/MC/Disassembler/PowerPC/p10insts.txt
  llvm/test/MC/PowerPC/p10.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D81836.270707.patch
Type: text/x-patch
Size: 85293 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200615/2a9f3731/attachment-0001.bin>


More information about the cfe-commits mailing list