This is an archive of the discontinued LLVM Phabricator instance.

Implement vector shift builtins - clang portion.
ClosedPublic

Authored by jtony on Oct 28 2016, 11:46 AM.

Details

Summary

Builtins implemented in this patch:

vector bool long long vec_sld (vector bool long long, vector bool long long, const int);
vector signed long long vec_sld (vector signed long long, vector signed long long, const int);
vector unsigned long long vec_sld (vector unsigned long long, vector unsigned long long, const int);
vector double vec_sld (vector double, vector double, const int);
vector signed char vec_sldw (vector signed char, vector signed char, const int);
vector unsigned char vec_sldw (vector unsigned char, vector unsigned char, const int);
vector signed int vec_sldw (vector signed int, vector signed int, const int);
vector unsigned int vec_sldw (vector unsigned int, vector unsigned int, const int);
vector signed long long vec_sldw (vector signed long long, vector signed long long, const int);
vector unsigned long long vec_sldw (vector unsigned long long, vector unsigned long long, const int);
vector signed short vec_sldw (vector signed short, vector signed short, const int);
vector unsigned short vec_sldw (vector unsigned short, vector unsigned short, const int);
vector signed long long vec_sll (vector signed long long, vector unsigned char);
vector unsigned long long vec_sll (vector unsigned long long, vector unsigned char);
vector signed long long vec_slo (vector signed long long, vector signed char);
vector signed long long vec_slo (vector signed long long, vector unsigned char);
vector unsigned long long vec_slo (vector unsigned long long, vector signed char);
vector unsigned long long vec_slo (vector unsigned long long, vector unsigned char);
vector unsigned char vec_slv (vector unsigned char, vector unsigned char);
vector signed long long vec_srl (vector signed long long, vector unsigned char);
vector unsigned long long vec_srl (vector unsigned long long, vector unsigned char);
vector signed long long vec_sro (vector signed long long, vector signed char);
vector signed long long vec_sro (vector signed long long, vector unsigned char);
vector unsigned long long vec_sro (vector unsigned long long, vector signed char);
vector unsigned long long vec_sro (vector unsigned long long, vector unsigned char);
vector unsigned char vec_srv (vector unsigned char, vector unsigned char);

Diff Detail

Event Timeline

jtony updated this revision to Diff 76221.Oct 28 2016, 11:46 AM
jtony retitled this revision from to Implement vector shift builtins - clang portion..
jtony updated this object.
jtony added a subscriber: llvm-commits.
nemanjai edited edge metadata.Oct 31 2016, 1:04 AM

This LGTM. I'll let @kbarton have another look as well.

kbarton accepted this revision.Oct 31 2016, 9:13 AM
kbarton edited edge metadata.

Aside from some formatting issues, this LGTM.

lib/Headers/altivec.h
7689

Lines too long. Please run clang-format on these sections you've added to adjust the formatting.

7800

This is a minor nit, but I seem to remember definitions in this file being orderd by size: char, short, int, long, long long.
Can you please move these definitions up, to between the char and int, for consistency?

7811

Add /* vec_slv */ for consistency

This revision is now accepted and ready to land.Oct 31 2016, 9:13 AM
echristo added inline comments.Oct 31 2016, 12:52 PM
lib/Headers/altivec.h
7800

Might want to make sure and clang format everything.

Tony, please address the comments and update the patch here before I can commit it for you.

jtony updated this revision to Diff 76550.Nov 1 2016, 7:00 AM
jtony edited edge metadata.
jtony marked 4 inline comments as done.

Fix the format issues according to code review suggestion.

Committed revision 285694.
Tony please close this review pending no buildbot failures.

jtony closed this revision.Nov 1 2016, 10:46 AM