From owner-p4-projects@FreeBSD.ORG Thu Dec 4 00:30:38 2014 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 05B7EC6A; Thu, 4 Dec 2014 00:30:38 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BABEEC68 for ; Thu, 4 Dec 2014 00:30:37 +0000 (UTC) Received: from skunkworks.freebsd.org (skunkworks.freebsd.org [IPv6:2001:1900:2254:2068::682:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A6E936C4 for ; Thu, 4 Dec 2014 00:30:37 +0000 (UTC) Received: from skunkworks.freebsd.org ([127.0.1.74]) by skunkworks.freebsd.org (8.14.9/8.14.9) with ESMTP id sB40Uboj061853 for ; Thu, 4 Dec 2014 00:30:37 GMT (envelope-from jmg@freebsd.org) Received: (from perforce@localhost) by skunkworks.freebsd.org (8.14.9/8.14.9/Submit) id sB40UbBD061850 for perforce@freebsd.org; Thu, 4 Dec 2014 00:30:37 GMT (envelope-from jmg@freebsd.org) Date: Thu, 4 Dec 2014 00:30:37 GMT Message-Id: <201412040030.sB40UbBD061850@skunkworks.freebsd.org> X-Authentication-Warning: skunkworks.freebsd.org: perforce set sender to jmg@freebsd.org using -f From: John-Mark Gurney Subject: PERFORCE change 1203489 for review To: Perforce Change Reviews Precedence: bulk X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.18-1 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Dec 2014 00:30:38 -0000 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) */