From patchwork Wed Apr 22 17:49:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?FR=C3=89D=C3=89RIC_RECOULES?= X-Patchwork-Id: 19175 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 563E844B3E1 for ; Wed, 22 Apr 2020 20:57:13 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 3E47768BD08; Wed, 22 Apr 2020 20:57:13 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from smtp.smtpout.orange.fr (smtp11.smtpout.orange.fr [80.12.242.133]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 5246568BCFE for ; Wed, 22 Apr 2020 20:57:06 +0300 (EEST) Received: from is232189.intra.cea.fr ([46.193.2.18]) by mwinf5d22 with ME id VtpN220080PJwDa03tpWbN; Wed, 22 Apr 2020 19:49:31 +0200 X-ME-Helo: is232189.intra.cea.fr X-ME-Auth: ZnJlZGVyaWMucmVjb3VsZXNAb3JhbmdlLmZy X-ME-Date: Wed, 22 Apr 2020 19:49:31 +0200 X-ME-IP: 46.193.2.18 From: frederic.recoules@univ-grenoble-alpes.fr To: ffmpeg-devel@ffmpeg.org Date: Wed, 22 Apr 2020 19:49:16 +0200 Message-Id: <20200422174918.7290-3-frederic.recoules@univ-grenoble-alpes.fr> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200422174918.7290-1-frederic.recoules@univ-grenoble-alpes.fr> References: <20200422174918.7290-1-frederic.recoules@univ-grenoble-alpes.fr> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 3/5] [inline assembly] prepares for mmx clobbers akin to xmm 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 Cc: =?utf-8?q?Fr=C3=A9d=C3=A9ric_Recoules?= Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" From: Frédéric Recoules --- configure | 4 ++++ libavutil/x86/asm.h | 20 ++++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/configure b/configure index 6533b43250..ddfea5ccfa 100755 --- a/configure +++ b/configure @@ -2275,6 +2275,7 @@ TOOLCHAIN_FEATURES=" symver_gnu_asm vfp_args xform_asm + mmx_clobbers xmm_clobbers " @@ -5917,6 +5918,9 @@ EOF check_inline_asm ebx_available '""::"b"(0)' && check_inline_asm ebx_available '"":::"%ebx"' + # check whether mmx clobbers are supported + check_inline_asm mmx_clobbers '"":::"%mm0"' + # check whether xmm clobbers are supported check_inline_asm xmm_clobbers '"":::"%xmm0"' diff --git a/libavutil/x86/asm.h b/libavutil/x86/asm.h index 9bff42d628..bb3c13f5c1 100644 --- a/libavutil/x86/asm.h +++ b/libavutil/x86/asm.h @@ -79,6 +79,26 @@ typedef int x86_reg; # define BROKEN_RELOCATIONS 1 #endif +/* + * If gcc is not set to support mmx (-mmmx) it will not accept mmx registers + * in the clobber list for inline asm. MMX_CLOBBERS takes a list of mmx + * registers to be marked as clobbered and evaluates to nothing if they are + * not supported, or to the list itself if they are supported. Since a clobber + * list may not be empty, XMM_CLOBBERS_ONLY should be used if the mmx + * registers are the only in the clobber list. + * For example a list with "eax" and "mm0" as clobbers should become: + * : MMX_CLOBBERS("mm0",) "eax" + * and a list with only "mm0" should become: + * MMX_CLOBBERS_ONLY("mm0") + */ +#if HAVE_MMX_CLOBBERS +# define MMX_CLOBBERS(...) __VA_ARGS__ +# define MMX_CLOBBERS_ONLY(...) : __VA_ARGS__ +#else +# define MMX_CLOBBERS(...) +# define MMX_CLOBBERS_ONLY(...) +#endif + /* * If gcc is not set to support sse (-msse) it will not accept xmm registers * in the clobber list for inline asm. XMM_CLOBBERS takes a list of xmm