13#if !defined(__clang__)
14static_assert(
false,
"This only works on clang.");
21#if defined(__ARM_NEON)
35for (
size_t i = 0;
i < 8;
i++) {
37 assert(-
b[
i] <=
a[
i] &&
a[
i] <= UINT16_MAX -
b[
i]);
46 auto m = [](int16_t r, int16_t
s) {
47 const int32_t rounding = 1 << 14;
48 int32_t temp = (int32_t)r * (int32_t)
s + rounding;
49 return (int16_t)(temp >> 15);
51 for (
int i = 0;
i < 8;
i++) {
61 auto m = [](int16_t r, int16_t
s) {
62 const int64_t rounding = 1 << (esize - 1);
63 int64_t product = 2LL * (int64_t)r * (int64_t)
s + rounding;
64 int64_t
result = product >> esize;
67 if (int64_t limit = (1LL << (esize - 1)) - 1;
result > limit) {
result = limit; }
68 if (int64_t limit = -(1LL << (esize - 1)) ;
result < limit) {
result = limit; }
71 for (
int i = 0;
i < 8;
i++) {
static I16 simulate_ssse3_mm_mulhrs_epi16(I16 a, I16 b)
static U16 constrained_add(I16 a, U16 b)
static Q15 simulate_neon_vqrdmulhq_s16(Q15 a, Q15 b)
__attribute__((visibility("default"))) int RunBenchmarks(int argc
T __attribute__((ext_vector_type(N))) V