PERFORCE change 1203489 for review

John-Mark Gurney jmg at FreeBSD.org
Thu Dec 4 00:30:38 UTC 2014


http://p4web.freebsd.org/@@1203489?ac=10

Change 1203489 by jmg at 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) */


More information about the p4-projects mailing list