This is an archive of the discontinued LLVM Phabricator instance.

Big-endian version of vpermxor
ClosedPublic

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

Details

Summary

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

llvm/lib/Target/PowerPC/PPCInstrVSX.td
2500

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.

llvm/test/CodeGen/PowerPC/crypto_bifs_be.ll
10

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/update_llc_test_checks.py
  • 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/PPCInstrVSX.td.
  • Updated test llvm/test/CodeGen/PowerPC/crypto_bifs_be.ll.
nemanjai accepted this revision.Nov 30 2021, 3:19 AM

LGTM.

llvm/lib/Target/PowerPC/PPCInstrVSX.td
2506

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

llvm/test/CodeGen/PowerPC/crypto_bifs_be.ll
9

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/PPCInstrVSX.td
This revision was automatically updated to reflect the committed changes.