This is an archive of the discontinued LLVM Phabricator instance.

[Power10] Implement Vector Blend Builtins in LLVM/Clang
ClosedPublic

Authored by biplmish on Jun 29 2020, 8:05 AM.

Details

Reviewers
amyk
lei
Group Reviewers
Restricted Project
Commits
rGca464639a1c9: [PowerPC] Implement Vector Blend Builtins in LLVM/Clang
Summary

This patch implements builtins for the following prototypes:

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);

Diff Detail

Event Timeline

biplmish created this revision.Jun 29 2020, 8:05 AM
steven.zhang added inline comments.
llvm/lib/Target/PowerPC/PPCInstrPrefix.td
548

I am not familiar with P10 new instructions. Are these prefix instructions ? I guess it is new P10 VSX instruction.

biplmish marked an inline comment as done.Jun 29 2020, 9:36 PM
biplmish added inline comments.
llvm/lib/Target/PowerPC/PPCInstrPrefix.td
548

Yes these are new P10 VSX instructions but are prefixed(64 bit instructions).

biplmish updated this revision to Diff 274675.Jun 30 2020, 8:48 PM

Repatching after the p10 vector blend instructions have been merged upstream.

lei added a comment.Jul 1 2020, 6:22 AM

p10-permute-ops.ll => builtins-ppc-p10permute.ll

llvm/include/llvm/IR/IntrinsicsPowerPC.td
971

nit: indentation
This line should match previous.. here it should be under t in int_ppc_... and following lines addjusted accordingly.
Applies to all 4 defs.

llvm/lib/Target/PowerPC/PPCInstrPrefix.td
551

nit: indentation

554

nit: indentation

lei added inline comments.Jul 2 2020, 10:35 AM
llvm/lib/Target/PowerPC/PPCInstrPrefix.td
559

Anonymous patterns at then of this file please.

biplmish updated this revision to Diff 275168.Jul 2 2020, 10:59 AM

Correct indentations and place anonymous patterns at the end of the file.

lei added inline comments.Jul 2 2020, 12:01 PM
clang/include/clang/Basic/BuiltinsPPC.def
439

This is not a vector blend builtin ....

biplmish updated this revision to Diff 275215.Jul 2 2020, 1:24 PM

Corrected the patch to contain only vec_blendv builtins.

amyk accepted this revision as: amyk.Jul 2 2020, 2:06 PM

I think overall it LGTM.

clang/lib/Headers/altivec.h
16858

A minor nit perhaps we should put vec_blendv on the next line for consistency, as you put it on the next line in a number of places.

llvm/include/llvm/IR/IntrinsicsPowerPC.td
971

nit: spaces after , for the input types.

This revision is now accepted and ready to land.Jul 2 2020, 2:06 PM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptJul 2 2020, 3:08 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript