Page MenuHomePhabricator

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

Authored by biplmish on Mon, Jun 29, 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.Mon, Jun 29, 8:05 AM
Herald added a project: Restricted Project. · View Herald TranscriptMon, Jun 29, 8:05 AM
steven.zhang added inline comments.
llvm/lib/Target/PowerPC/PPCInstrPrefix.td
723

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.Mon, Jun 29, 9:36 PM
biplmish added inline comments.
llvm/lib/Target/PowerPC/PPCInstrPrefix.td
723

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

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

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

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

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

llvm/include/llvm/IR/IntrinsicsPowerPC.td
1023

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
764

nit: indentation

767

nit: indentation

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

Anonymous patterns at then of this file please.

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

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

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

This is not a vector blend builtin ....

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

Corrected the patch to contain only vec_blendv builtins.

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

I think overall it LGTM.

clang/lib/Headers/altivec.h
16924

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
1030

nit: spaces after , for the input types.

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