Page MenuHomePhabricator

Big-endian version of vpermxor

Authored by tislam on Nov 24 2021, 7:53 AM.



A big-endian version of vpermxor, named vpermxor_be, is added to LLVM and Clang. vpermxor_be can be called directly on both the little-endian and the big-endian platforms.

Diff Detail

Event Timeline

tislam created this revision.Nov 24 2021, 7:53 AM
tislam requested review of this revision.Nov 24 2021, 7:53 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptNov 24 2021, 7:53 AM

Please also add a test for this builtin to the front end test clang/test/CodeGen/builtins-ppc-crypto.c


Although it would be redundant, it is not invalid to use this builtin/intrinsic in BE compilations. As such, please move this to a block that has only the
[HasVSX, HasP8Altivec] predicates as the desired code is the same for LE/BE.


Please clean up this test case a bit:

  • Run opt --passes="default<O2>" on it to clean up the unnecessary code
  • Remove the attributes
  • The 755 permissions on the test case are unusual
  • Produce the CHECK's automatically using $LLVM_SRC/utils/
  • Add a BE invocation (either the P8 or the P9 can just use the powerpc64-unknown-linux-gnu triple)
tislam updated this revision to Diff 389775.Nov 25 2021, 7:06 AM
tislam edited the summary of this revision. (Show Details)
  • Added test for vpermxor_be in clang/test/CodeGen/builtins-ppc-crypto.c.
  • Placed vpermxor_be under [HasVSX, HasP8Altivec] in llvm/lib/Target/PowerPC/
  • Updated test llvm/test/CodeGen/PowerPC/crypto_bifs_be.ll.
nemanjai accepted this revision.Nov 30 2021, 3:19 AM



Nit: the v16i8 should be aligned with the v16i8 above.


There isn't really any difference in how we handle this on P9 so this run line is probably superfluous. Feel free to get rid of it when pushing this upstream.

This revision is now accepted and ready to land.Nov 30 2021, 3:19 AM
tislam updated this revision to Diff 390683.Nov 30 2021, 6:25 AM
tislam marked 2 inline comments as done.
  • The P9 RUN step on big-endian platform is removed from the lit test.
  • Fixed formatting in llvm/lib/Target/PowerPC/
This revision was automatically updated to reflect the committed changes.