This is an archive of the discontinued LLVM Phabricator instance.

Add missing builtins to altivec.h for ABI compliance (vol. 1)
ClosedPublic

Authored by nemanjai on Jun 23 2015, 12:36 AM.

Details

Summary

This is the first round of additions of missing builtins listed in the ABI document. More to come (this builds onto what seurer already addes). This patch adds:
vector signed long long vec_abs(vector signed long long)
vector double vec_abs(vector double) {
vector signed long long vec_add(vector signed long long, vector signed long long)
vector unsigned long long vec_add(vector unsigned long long, vector unsigned long long)
vector double vec_add(vector double, vector double)
vector double vec_and(vector bool long long, vector double)
vector double vec_and(vector double, vector bool long long)
vector double vec_and(vector double, vector double)
vector signed long long vec_and(vector signed long long, vector signed long long)
vector double vec_andc(vector bool long long, vector double)
vector double vec_andc(vector double, vector bool long long)
vector double vec_andc(vector double, vector double)
vector signed long long vec_andc(vector signed long long, vector signed long long)
vector double vec_ceil(vector double)
vector bool long long vec_cmpeq(vector double, vector double)
vector bool long long vec_cmpge(vector double, vector double)
vector bool long long vec_cmpge(vector signed long long, vector signed long long)
vector bool long long vec_cmpge(vector unsigned long long, vector unsigned long long)
vector bool long long vec_cmpgt(vector double, vector double)
vector bool long long vec_cmple(vector double, vector double)
vector bool long long vec_cmple(vector signed long long, vector signed long long)
vector bool long long vec_cmple(vector unsigned long long, vector unsigned long long)
vector bool long long vec_cmplt(vector double, vector double)
vector bool long long vec_cmplt(vector signed long long, vector signed long long)
vector bool long long vec_cmplt(vector unsigned long long, vector unsigned long long)

Diff Detail

Repository
rL LLVM

Event Timeline

nemanjai updated this revision to Diff 28204.Jun 23 2015, 12:36 AM
nemanjai retitled this revision from to Add missing builtins to altivec.h for ABI compliance (vol. 1).
nemanjai updated this object.
nemanjai edited the test plan for this revision. (Show Details)
nemanjai set the repository for this revision to rL LLVM.
nemanjai added a subscriber: Unknown Object (MLST).
nemanjai added inline comments.Jun 23 2015, 12:48 AM
lib/Headers/altivec.h
780

Not sure how I missed this here, but I've updated it in my patch: the missing "static"

1120

Similar issue with missing "static"

1689

Since the vector float version of this has a VSX and non-VSX version, I updated all of them to just forward the other function. In case we end up with VSX versions for the others as well, the logic does not have to be repeated.

test/CodeGen/builtins-ppc-p8vector.c
4

Added -target-feature +vsx to avoid errors about "vector double" and to generate the correct errors for functions that are only overloaded with VSX (vec_cmpge, vec_cmple).

nemanjai added a subscriber: Unknown Object (MLST).Jun 23 2015, 12:58 AM
wschmidt accepted this revision.Jun 23 2015, 1:14 PM
wschmidt edited edge metadata.

LGTM, with the changes you've identified and with a couple inline comments addressed. Thanks!

lib/Headers/altivec.h
797

Just FYI -- the above three are listed in the test case I gave you as "low priority." It's fine that you added them, but for similarly marked ones please defer them until after unmarked ones are complete. (We are not exactly deprecating these, but they make little sense and we will be listing them in a separate table in the vector API -- "not recommended" or something. There is an overuse of vector bool, mixing it with other types where it doesn't make much sense.)

test/CodeGen/builtins-ppc-p8vector.c
4

This should be a comment in the test, not just in the review.

This revision is now accepted and ready to land.Jun 23 2015, 1:14 PM
nemanjai closed this revision.Jun 26 2015, 12:28 PM

Committed revision 240821.