let Neon builtin function accept a const variable #144625
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
FORCE_INLINE __m128i _mm_sll_epi64(__m128i a, __m128i count) { long long c = count.vect_s64[0]; const int mc = c; __m128i result_m128i; if (likely(c >= 0 && c < 64)) { result_m128i.vect_s64 = vshlq_n_s64(a.vect_s64, mc); } else { result_m128i.vect_s64 = vdupq_n_s64(0); } return result_m128i; }
vshlq_n_s64 is an Neon intrinsics, 2nd parameter of this function needs a const int, however it failed in current CLANG Latest version. This patch used to support this feature which make Neon intrinsics can receive a const int variable instead of literal.