From patchwork Sun Oct 2 20:53:17 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carl Eugen Hoyos X-Patchwork-Id: 837 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.140.66 with SMTP id o63csp1281845vsd; Sun, 2 Oct 2016 13:53:30 -0700 (PDT) X-Received: by 10.194.239.226 with SMTP id vv2mr10991660wjc.219.1475441610330; Sun, 02 Oct 2016 13:53:30 -0700 (PDT) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id c184si15521220wmd.123.2016.10.02.13.53.29; Sun, 02 Oct 2016 13:53:30 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 813C2689C46; Sun, 2 Oct 2016 23:53:13 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-dmta-pe03-1.mx.upcmail.net (vie01a-dmta-pe03-1.mx.upcmail.net [62.179.121.160]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 3FFAE689B28 for ; Sun, 2 Oct 2016 23:53:06 +0300 (EEST) Received: from [172.31.216.43] (helo=vie01a-pemc-psmtp-pe01) by vie01a-dmta-pe03.mx.upcmail.net with esmtp (Exim 4.87) (envelope-from ) id 1bqnl9-0005I4-2f for ffmpeg-devel@ffmpeg.org; Sun, 02 Oct 2016 22:53:19 +0200 Received: from [192.168.1.3] ([80.110.105.204]) by vie01a-pemc-psmtp-pe01 with SMTP @ mailcloud.upcmail.net id qktH1t00j4Qd8D401ktJ4k; Sun, 02 Oct 2016 22:53:19 +0200 X-SourceIP: 80.110.105.204 From: Carl Eugen Hoyos To: FFmpeg development discussions and patches Date: Sun, 2 Oct 2016 22:53:17 +0200 User-Agent: KMail/1.9.10 MIME-Version: 1.0 Message-Id: <201610022253.17825.cehoyos@ag.or.at> Subject: [FFmpeg-devel] [RFC]lavu/x86/pixelutils: Call emms before returning. X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Hi! The functions in libavutil/x86/pixelutils.asm are exported to the library users if I understand the code correctly. I suspect it can be expected that the MMX state is reset after returning. Fixes the pixelutils fate test with musl on x86-32. Please comment, Carl Eugen From f16831e6dc0f36c8f290d927bf51142c64fe8afc Mon Sep 17 00:00:00 2001 From: Carl Eugen Hoyos Date: Sun, 2 Oct 2016 22:45:51 +0200 Subject: [PATCH] lavu/x86/pixelutils: Call emms before returning. The functions are exported and the library user can expect that the MMX state is reset after returning. --- libavutil/x86/pixelutils.asm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libavutil/x86/pixelutils.asm b/libavutil/x86/pixelutils.asm index 7af3007..092eb6e 100644 --- a/libavutil/x86/pixelutils.asm +++ b/libavutil/x86/pixelutils.asm @@ -61,6 +61,7 @@ cglobal pixelutils_sad_8x8, 4,4,0, src1, stride1, src2, stride2 paddw m6, m0 movd eax, m6 movzx eax, ax + emms RET ;------------------------------------------------------------------------------- @@ -81,6 +82,7 @@ cglobal pixelutils_sad_8x8, 4,4,0, src1, stride1, src2, stride2 lea src2q, [src2q + 2*stride2q] %endrep movd eax, m2 + emms RET ;------------------------------------------------------------------------------- @@ -101,6 +103,7 @@ cglobal pixelutils_sad_16x16, 4,4,0, src1, stride1, src2, stride2 add src2q, stride2q %endrep movd eax, m2 + emms RET ;------------------------------------------------------------------------------- @@ -131,6 +134,7 @@ cglobal pixelutils_sad_16x16, 4,4,5, src1, stride1, src2, stride2 movhlps m0, m4 paddw m4, m0 movd eax, m4 + emms RET ;------------------------------------------------------------------------------- @@ -158,6 +162,7 @@ cglobal pixelutils_sad_%1_16x16, 4,4,3, src1, stride1, src2, stride2 movhlps m0, m2 paddw m2, m0 movd eax, m2 + emms RET %endmacro