MCPcopy Create free account
hub / github.com/numpy/numpy / libdivide_mullhi_s32_vector

Function libdivide_mullhi_s32_vector

numpy/core/include/numpy/libdivide/libdivide.h:1241–1247  ·  view source on GitHub ↗

b is one 32-bit value repeated.

Source from the content-addressed store, hash-verified

1239
1240// b is one 32-bit value repeated.
1241static inline __m512i libdivide_mullhi_s32_vector(__m512i a, __m512i b) {
1242 __m512i hi_product_0Z2Z = _mm512_srli_epi64(_mm512_mul_epi32(a, b), 32);
1243 __m512i a1X3X = _mm512_srli_epi64(a, 32);
1244 __m512i mask = _mm512_set_epi32(-1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0);
1245 __m512i hi_product_Z1Z3 = _mm512_and_si512(_mm512_mul_epi32(a1X3X, b), mask);
1246 return _mm512_or_si512(hi_product_0Z2Z, hi_product_Z1Z3);
1247}
1248
1249// Here, y is assumed to contain one 64-bit value repeated.
1250// https://stackoverflow.com/a/28827013

Callers 2

libdivide_s32_do_vectorFunction · 0.85

Calls 1

Tested by

no test coverage detected