This is an archive of the discontinued LLVM Phabricator instance.

[ARM] Add poly64_t on AArch32.
ClosedPublic

Authored by stuij on May 11 2020, 4:40 AM.

Details

Summary

The poly64 types are guarded with ifdefs for AArch64 only. This is wrong. This
was also incorrectly documented in the ACLE spec, but this has been rectified in
the latest release. See paragraph 13.1.2 "Vector data types":

https://developer.arm.com/docs/101028/latest

This patch was written by Alexandros Lamprineas.

Diff Detail

Event Timeline

stuij created this revision.May 11 2020, 4:40 AM
stuij updated this revision to Diff 264586.May 18 2020, 4:42 AM

adhere to attribution conventions

stuij edited the summary of this revision. (Show Details)May 20 2020, 3:46 AM
stuij updated this revision to Diff 265987.May 25 2020, 2:44 AM

added testing

stuij retitled this revision from [ARM][BFloat] Add poly64_t on AArch32. to [ARM] Add poly64_t on AArch32..May 26 2020, 4:00 AM

Should poly128_t be available on AArch32 too? I don't see anything in the ACLE version you linked restricting it to AArch64 only, and the intrinsics reference has a number of intrinsics available for both ISAs using it.

clang/include/clang/Basic/TargetBuiltins.h
160

Should Poly128 be in this list too?

clang/lib/Sema/SemaType.cpp
7659

The version of the ACLE you linked says all polynomial types are unsigned, not mentioning any difference between AArch32 and AArch64:

poly8_t, poly16_t, poly64_t and poly128_t are defined as unsigned integer types. It is unspecified whether these are the same type as uint8_t, uint16_t, uint64_t and uint128_t for overloading and mangling purposes.

Maybe this is something left over from an old version of the ACLE which needs updating now?

Should poly128_t be available on AArch32 too? I don't see anything in the ACLE version you linked restricting it to AArch64 only, and the intrinsics reference has a number of intrinsics available for both ISAs using it.

It should but it is not that simple. The reason it is not available is that __int128_t is not supported in AArch32. I think that is future work, since this patch unblocks the bfloat reinterpret_cast patch, which btw is annotated with TODO comments regarding the poly128_t type for AArch32.

clang/lib/Sema/SemaType.cpp
7646

@ostannard according to this comment it seems there has been some divergence between AArch64 and AArch32 and now is too late to change. If the ACLE doesn't say so, maybe it should.

ostannard accepted this revision.May 28 2020, 6:53 AM

Ok, LGTM.

This revision is now accepted and ready to land.May 28 2020, 6:53 AM
This revision was automatically updated to reflect the committed changes.