This is an archive of the discontinued LLVM Phabricator instance.

[ARM] Neon Polynomial vadd Intrinsic fix
ClosedPublic

Authored by rsanthir.quic on Apr 19 2021, 9:12 AM.

Details

Summary

The Neon vadd intrinsics were added to the ARMSIMD intrinsic map,
however due to being defined under an AArch64 guard in arm_neon.td,
were not previously useable on ARM. This change rectifies that.

It is important to note that poly128 is not valid on ARM, thus it was
extracted out of the original arm_neon.td definition and separated
for the sake of AArch64.

Diff Detail

Event Timeline

rsanthir.quic created this revision.Apr 19 2021, 9:12 AM
rsanthir.quic requested review of this revision.Apr 19 2021, 9:12 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 19 2021, 9:12 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript

I'd merge https://reviews.llvm.org/D100499 into this given that it's only one line.

clang/include/clang/Basic/arm_neon.td
712

This isn't a crypto intrinsic, it just happens to be right after a block like:

let ArchGuard = "__ARM_ARCH >= 8 && defined(__ARM_FEATURE_CRYPTO)" in {
<...>
def SM4EKEY : SInst<"vsm4ekey", "...", "QUi">;
}

You could instead say:

// Non poly128_t vaddp for Arm and AArch64

(keep the todo)

1179–1181

Add a comment here, something like poly128_t vadd for AArch64 only, see VADDP_Q for the rest.

Also the def names seem backwards, shouldn't this one be VADDP_Q and the one for Arm and AArch64 be VADDP?

Then your comment here is "see VADDP for the rest" which seems correct.

clang/test/CodeGen/arm-poly-add.c
5

You can remove the +bf16 feature.

rsanthir.quic marked an inline comment as done.Apr 26 2021, 9:41 AM
rsanthir.quic added inline comments.
clang/include/clang/Basic/arm_neon.td
712

I agree that it isn't strictly crypto, I think it is used primarily for cryptographic applications. I'll apply your suggestion

rsanthir.quic marked an inline comment as done.

minor fixes and merged https://reviews.llvm.org/D100499

This revision is now accepted and ready to land.Apr 27 2021, 1:24 AM
This revision was landed with ongoing or failed builds.Apr 28 2021, 12:01 PM
This revision was automatically updated to reflect the committed changes.