This is an archive of the discontinued LLVM Phabricator instance.

[PowerPC] Implement remaining vector comparison builtins
ClosedPublic

Authored by jtony on Oct 31 2016, 12:32 PM.

Details

Summary

Signatures:
vector bool char vec_cmpeq (vector bool char, vector bool char);
vector bool int vec_cmpeq (vector bool int, vector bool int);
vector bool long long vec_cmpeq (vector bool long long, vector bool long long);
vector bool short vec_cmpeq (vector bool short, vector bool short);

Diff Detail

Event Timeline

jtony updated this revision to Diff 76459.Oct 31 2016, 12:32 PM
jtony retitled this revision from to Implement remaining vector comparison builtins.
jtony updated this object.
jtony added a subscriber: llvm-commits.
jtony updated this object.Nov 1 2016, 10:47 AM
jtony updated this revision to Diff 76617.Nov 1 2016, 12:39 PM

Fix some existing problems in the original source (not introduced by this patch). Calling vec_cmpeq function with two different type parameters will cause ambiguous errors. Have to explicitly convert the type of one parameter to the type of another parameter. Make the two input parameters consistent so the compiler knows exactly which overloads to invoke.

nemanjai edited edge metadata.Nov 3 2016, 12:37 AM

I think that other than the few minor nits, this patch is fine.

lib/Headers/altivec.h
1556

When we have all three overloads, the order in the rest of the file is typically:

  1. signed <TYPE>
  2. unsigned <TYPE>
  3. bool <TYPE>

Let's keep this consistent please.

2379

I assume that this change was made by clang-format. However, I think this is one of those examples where not formatting according to its rules makes the code more readable. So I personally prefer the old formatting.

jtony retitled this revision from Implement remaining vector comparison builtins to [PowerPC] Implement remaining vector comparison builtins.Nov 3 2016, 7:09 AM
jtony edited edge metadata.
jtony added subscribers: cfe-commits, echristo.
jtony updated this revision to Diff 76862.Nov 3 2016, 8:12 AM
jtony marked 2 inline comments as done.

Fix a few format and layout issues.

Format: clang-format is not always correct, sometimes separate parameters in different lines is better.
Layout: put the overloaded builtin functions in such order: signed version, unsigned version and bool version.

jtony updated this revision to Diff 77036.Nov 7 2016, 7:44 AM

I migrated the commit from the old anonymous repository to the new jtony repository to prepare for committing upstream (use git svn dcommit). Should not have any difference with the previous patches, update it just in case.

kbarton accepted this revision.Nov 7 2016, 7:46 PM
kbarton edited edge metadata.

LGTM

This revision is now accepted and ready to land.Nov 7 2016, 7:46 PM
jtony edited edge metadata.Nov 7 2016, 8:31 PM
jtony closed this revision.Nov 10 2016, 6:19 AM