From patchwork Thu Jun 9 23:55:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 36122 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:6914:b0:82:6b11:2509 with SMTP id q20csp655277pzj; Thu, 9 Jun 2022 16:59:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyRh/G+6FaffCfwdQ7dFiMfGu/JV3N75d9X0pNOJzhW4qe0l7fHfeIAxeS/SfUZSyr+12V7 X-Received: by 2002:a17:906:9254:b0:708:cf8e:25a5 with SMTP id c20-20020a170906925400b00708cf8e25a5mr37698337ejx.119.1654819184475; Thu, 09 Jun 2022 16:59:44 -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 c3-20020a17090620c300b00711f6238bb1si7222438ejc.606.2022.06.09.16.59.44; Thu, 09 Jun 2022 16:59:44 -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; dkim=neutral (body hash did not verify) header.i=@outlook.com header.s=selector1 header.b=mOMNcvfi; arc=fail (body hash mismatch); 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=outlook.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 9266B68B8D4; Fri, 10 Jun 2022 02:56:50 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-oln040092073020.outbound.protection.outlook.com [40.92.73.20]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 66F4168B8C5 for ; Fri, 10 Jun 2022 02:56:47 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MHaDqLIpsgiaXPtckpI5dhS1nileQcrVh5knsrGOton7ar9Kv0EKGNyfh84wGhQl0v1uCtAttVS8vjzkddws+/uu3Fsp52I1VZAldVOprwC3AEQA8nau+XzirtJ8UOys72GjQ6co7aO2YeVEBRrlstI5zZ3gWMezylG6M9DAb37HlHEnOKWY52VRY3s0TXQnuJWyRL8Ch/o7s0U9Kfp7tHxSVCOshxU+mxYdgG5hzveCp4UHLW4clIUOxpDBo7/upDmyUhryzzW9dXVNBMWLH8DRr+d2gK9awVBGfiocWN7FpnDgJj/8ixkXthe7aBmlZzvtNCefSIPvy7jDjLvnMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=e4Rnv1n3oHpwiKNfpqBxkHACVxxKkTdFnsBBaj+D830=; b=YclsQ9a4hwH4E2cDEItsFrWEYCqaPa2aOYKaUJvULs7cOUA7XTdy8xzPVDL7wLm9q10wZn8OyX2BDuZtnOqaXcohBtFzS50Fs3kcEHbD3PrVeHyRzD5qjwbzpB5xFybU+MYDTfYCqpzERGdWTZRJ1fU6mS2NR9qF4GGMkPUnPnoc1s35EmnWajWeGAdHLCuKW8kNLk48hmCigLUYbsn2IMcBsL42p82IXEOKkQBa5aLw82ppS1g8PshwUT45u1rSeuL3CfWRxMTwJxFF3YtMWYtGbhb6JP/R0JzXpInZjyvqkDRRm1umUg7cVAVbAU0B7Fk2zzIfGiE5l4G2V8dFGA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=e4Rnv1n3oHpwiKNfpqBxkHACVxxKkTdFnsBBaj+D830=; b=mOMNcvfiTKxT5jCnuT7KuEIwYtPXc49mGGA/CUbruTOoMTfLuMzi2FX32vx6XN2t6YuV+UEjSWImc0FsXScb2nKau1XmEfB4O1QRWjT6Nza4okji0A6bfk0073u1GR/8SHe+aY60ZMtpImZ+Kj0MkjXIkO6pL+kMqzs7RjicXEZsXHAXfmcniBEiY+fU+X6QRzxhUZkNHgW33VS6kyBPyAZTwYihMbBdd3Ogts/AdxOfS2Pxoum9ONoYmRQOM38M7xRhfklg88W7cqn52P7v6+aSpvP6Dmj/FEGSd8yDcyxNkywoqYbHGHRhNaNqRkt7a3YRgoGTdB3EFNuEtGPWAw== Received: from DB6PR0101MB2214.eurprd01.prod.exchangelabs.com (2603:10a6:4:42::27) by DB6PR01MB3862.eurprd01.prod.exchangelabs.com (2603:10a6:6:48::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5314.15; Thu, 9 Jun 2022 23:56:44 +0000 Received: from DB6PR0101MB2214.eurprd01.prod.exchangelabs.com ([fe80::60b9:9f29:40cc:f01c]) by DB6PR0101MB2214.eurprd01.prod.exchangelabs.com ([fe80::60b9:9f29:40cc:f01c%10]) with mapi id 15.20.5332.013; Thu, 9 Jun 2022 23:56:44 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 10 Jun 2022 01:55:06 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [G8Z65jLJRJl70m7Zcd6qDxu+C8qYyE+C] X-ClientProxiedBy: AM5PR04CA0005.eurprd04.prod.outlook.com (2603:10a6:206:1::18) To DB6PR0101MB2214.eurprd01.prod.exchangelabs.com (2603:10a6:4:42::27) X-Microsoft-Original-Message-ID: <20220609235523.458689-24-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b84c58a8-560b-4663-a8df-08da4a73b4af X-MS-Exchange-SLBlob-MailProps: S/btQ8cKWiTijo6adWu98SHbtEySq1lKMY/u9/dCHeuGrjcp4sPm30bBzK6iL9NRH3pv2T48t5UtlSMmn3RS56xP/ZLBwOAOQ9na7FHO5Zi/6G4awXOLFZIHmmxHq0gsJbJ4Glj4GslRowsDZ2O1h/H2tZ4Z7rr7vIV9Dh82POXty0aF8YlOzIC4bfDex8u9tUZxtLLmZDdXrGqA9LEW22+sgmjZelu5TAFlXyRFyQPMCDiwPpHb+SRZHWTIvD727TOaNwhtPfLEJIBF9NfNaGVyDS/yTRjdx8K/PQTu3FvNY9W+ohLSCPSFLufu3qInoPhMlsGaG4EE72KJV+wthToLRSa98+28k762EAdvgAvLdj+05ABBEFD+aNBvSYni7up6cWAbHuIQf9/vuAiAJrvU3FvoL42PRWONcGsQ46tvqeIw6l0f3SwhhD5FjH8EPZyrQBG7z/cyzl1w1nfG9L8fwrqLkoKVnkIFkF4BveEk5Zb23ECHNlrlMmuQJONEJMGHWjCJC53WueAyxCxbjs5lYozvIzuATxGm8HTm4+ETaBYJp8nrfYhgN6CRrthfzLTt6Ky+H6H6DbUez45KOXJQfhZkaQrztVH6oyo6SxlEnbLAPXqlexy9C6nsvZzaOVPgnzpZOht7LfrZ5HYpiCG0nq4R4XZmvQAHxZgezq8E0YfOoIrO1uu5D9OnhWdd45jKhTRKBcPFNxbKjYGrWxkgwkIy9PMpWWH5yRdimSzvCCMPncTV/FXhH4W7/WalRf19dFOmONY= X-MS-TrafficTypeDiagnostic: DB6PR01MB3862:EE_ X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: AjO0s7bAT8CVjw3HsMwbKF11JkVj4NPNluD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enant-Network-Message-Id: b84c58a8-560b-4663-a8df-08da4a73b4af X-MS-Exchange-CrossTenant-AuthSource: DB6PR0101MB2214.eurprd01.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jun 2022 23:56:44.1795 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR01MB3862 Subject: [FFmpeg-devel] [PATCH 24/41] avcodec/x86/idctdsp_init: Disable overridden functions on x64 X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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: Andreas Rheinhardt Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: 9wCOkM3Xb6Sw x64 always has MMX, MMXEXT, SSE and SSE2 and this means that some functions for MMX, MMXEXT, SSE and 3dnow are always overridden by other functions (unless one e.g. explicitly disables SSE2). This commit therefore disables the MMX as well as the non-64 bit (which are overridden by the 64bit specific implementation) at compile-time for x64. Signed-off-by: Andreas Rheinhardt --- libavcodec/tests/x86/dct.c | 2 +- libavcodec/x86/idctdsp.asm | 6 ++++++ libavcodec/x86/idctdsp_init.c | 4 ++++ libavcodec/x86/simple_idct.asm | 2 ++ 4 files changed, 13 insertions(+), 1 deletion(-) diff --git a/libavcodec/tests/x86/dct.c b/libavcodec/tests/x86/dct.c index 1eb9400567..144d055cff 100644 --- a/libavcodec/tests/x86/dct.c +++ b/libavcodec/tests/x86/dct.c @@ -73,7 +73,7 @@ static const struct algo fdct_tab_arch[] = { }; static const struct algo idct_tab_arch[] = { -#if HAVE_MMX_EXTERNAL +#if ARCH_X86_32 && HAVE_MMX_EXTERNAL { "SIMPLE-MMX", ff_simple_idct_mmx, FF_IDCT_PERM_SIMPLE, AV_CPU_FLAG_MMX }, #endif #if CONFIG_MPEG4_DECODER && HAVE_X86ASM diff --git a/libavcodec/x86/idctdsp.asm b/libavcodec/x86/idctdsp.asm index 089425a9ab..701a8c5a43 100644 --- a/libavcodec/x86/idctdsp.asm +++ b/libavcodec/x86/idctdsp.asm @@ -74,8 +74,10 @@ cglobal put_signed_pixels_clamped, 3, 4, %1, block, pixels, lsize, lsize3 RET %endmacro +%if ARCH_X86_32 INIT_MMX mmx PUT_SIGNED_PIXELS_CLAMPED 0 +%endif INIT_XMM sse2 PUT_SIGNED_PIXELS_CLAMPED 3 @@ -117,8 +119,10 @@ cglobal put_pixels_clamped, 3, 4, 2, block, pixels, lsize, lsize3 RET %endmacro +%if ARCH_X86_32 INIT_MMX mmx PUT_PIXELS_CLAMPED +%endif INIT_XMM sse2 PUT_PIXELS_CLAMPED @@ -177,7 +181,9 @@ cglobal add_pixels_clamped, 3, 3, 5, block, pixels, lsize RET %endmacro +%if ARCH_X86_32 INIT_MMX mmx ADD_PIXELS_CLAMPED +%endif INIT_XMM sse2 ADD_PIXELS_CLAMPED diff --git a/libavcodec/x86/idctdsp_init.c b/libavcodec/x86/idctdsp_init.c index 9103b92ce7..41ba9d68cb 100644 --- a/libavcodec/x86/idctdsp_init.c +++ b/libavcodec/x86/idctdsp_init.c @@ -63,6 +63,7 @@ av_cold void ff_idctdsp_init_x86(IDCTDSPContext *c, AVCodecContext *avctx, { int cpu_flags = av_get_cpu_flags(); +#if ARCH_X86_32 if (EXTERNAL_MMX(cpu_flags)) { c->put_signed_pixels_clamped = ff_put_signed_pixels_clamped_mmx; c->put_pixels_clamped = ff_put_pixels_clamped_mmx; @@ -79,12 +80,14 @@ av_cold void ff_idctdsp_init_x86(IDCTDSPContext *c, AVCodecContext *avctx, c->perm_type = FF_IDCT_PERM_SIMPLE; } } +#endif if (EXTERNAL_SSE2(cpu_flags)) { c->put_signed_pixels_clamped = ff_put_signed_pixels_clamped_sse2; c->put_pixels_clamped = ff_put_pixels_clamped_sse2; c->add_pixels_clamped = ff_add_pixels_clamped_sse2; +#if ARCH_X86_32 if (!high_bit_depth && avctx->lowres == 0 && (avctx->idct_algo == FF_IDCT_AUTO || @@ -94,6 +97,7 @@ av_cold void ff_idctdsp_init_x86(IDCTDSPContext *c, AVCodecContext *avctx, c->idct_add = ff_simple_idct_add_sse2; c->perm_type = FF_IDCT_PERM_SIMPLE; } +#endif if (ARCH_X86_64 && !high_bit_depth && diff --git a/libavcodec/x86/simple_idct.asm b/libavcodec/x86/simple_idct.asm index 6fedbb5784..002fdede90 100644 --- a/libavcodec/x86/simple_idct.asm +++ b/libavcodec/x86/simple_idct.asm @@ -25,6 +25,7 @@ %include "libavutil/x86/x86util.asm" +%if ARCH_X86_32 SECTION_RODATA cextern pb_80 @@ -887,3 +888,4 @@ cglobal simple_idct_add, 3, 4, 8, 128, pixels, lsize, block, t0 lea pixelsq, [pixelsq+lsizeq*2] ADD_PIXELS_CLAMPED 96 RET +%endif