Date: Thu, 4 Dec 2014 00:30:37 GMT From: John-Mark Gurney <jmg@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 1203489 for review Message-ID: <201412040030.sB40UbBD061850@skunkworks.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://p4web.freebsd.org/@@1203489?ac=10 Change 1203489 by jmg@jmg_carbon2 on 2014/12/04 00:30:34 add an emulation of _mm_insert_epi64 for i386... Why they didn't add an pinsrdq which could only load from memory or something similar is beyond me... This gets things compiling and working on i386 again... Sponsored by: FreeBSD Foundation Sponsored by: Netgate Affected files ... .. //depot/projects/opencrypto/sys/crypto/aesni/aesni_ghash.c#6 edit Differences ... ==== //depot/projects/opencrypto/sys/crypto/aesni/aesni_ghash.c#6 (text+ko) ==== @@ -85,6 +85,23 @@ return _mm_movemask_epi8(cmp) == 0xffff; } +#ifdef __i386__ +static inline __m128i +_mm_insert_epi64(__m128i a, int64_t b, const int ndx) +{ + + if (!ndx) { + a = _mm_insert_epi32(a, b, 0); + a = _mm_insert_epi32(a, b >> 32, 1); + } else { + a = _mm_insert_epi32(a, b, 2); + a = _mm_insert_epi32(a, b >> 32, 3); + } + + return a; +} +#endif + /* some code from carry-less-multiplication-instruction-in-gcm-mode-paper.pdf */ /* Figure 5. Code Sample - Performing Ghash Using Algorithms 1 and 5 (C) */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201412040030.sB40UbBD061850>
