From patchwork Thu Jun 9 23:55:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 36139 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:6914:b0:82:6b11:2509 with SMTP id q20csp656756pzj; Thu, 9 Jun 2022 17:03:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwEL+dom97Z+kzoBln4e5V+TWoIaMKNKsMwe/i1FsPvHOfgLS9aLTorvviayoLpL74KAM3q X-Received: by 2002:a17:906:33cc:b0:711:609f:8a63 with SMTP id w12-20020a17090633cc00b00711609f8a63mr25473747eja.128.1654819381548; Thu, 09 Jun 2022 17:03:01 -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 aj12-20020a1709069a4c00b006fef833c67dsi5634493ejc.168.2022.06.09.17.03.00; Thu, 09 Jun 2022 17:03:01 -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=LXRCfsmh; 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 1801768B965; Fri, 10 Jun 2022 02:57:48 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05olkn2017.outbound.protection.outlook.com [40.92.91.17]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 61ED168B864 for ; Fri, 10 Jun 2022 02:57:45 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kyvh8GnU3mMVAm0kvOBybel8+uV6oQJLMPl4o0hQiMNsADukOgBICEFw5770fc43xz7pKU/0e7RIAFqsb57qVnPAbwOYQVLBNppktbxCUp+dVwowIZy9ifr7CwGR7seqUmLFm1rMBu8oo3pO/dIQgAMEyClcWASVM7sO7pfgm/ZaOQPANm+hHmYU4IDkfiknh5RDG9A9XOSR7atcOO3urerc7mblorj+q0ZbKZVL294BKoTCqjYTFC2+eQ0UlzcnngaIsy12xDDuthKGprAihKSb3xlUEjECZ+pRBV7tm0v1pKD0aAF65maF/ndnJOHN7DCFZxx4DzTTXEtsJt+pFQ== 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=6loOczMUmpjppQ8PhqWtpG2L3ZCuAIM8caa3ByB9FPE=; b=URjn3VuZfjpMhxQ4RMY2NgoF97V3QTjLcpSZTIyPD6LWDdcxSWQYnZi/kRhy6YRdJObxq14y2ZoEVfR0yAs+vtSaVmc2zFQm55UJL6G9IylvZKXOZ2k3HWSMTQnO/PiO4/GhkD9P8kYiNBcxD0OJ4qHJCdNbz2KiRILlEg4a8Bi727yrIAwF/R35hUUTlvxUTneON7AhkgtL6c0xzwWus3mLHuwh3f67/qdkyXvVYBWG9SlqiwYP7euh95nP44vKgeuYu2sm5K8655fzU2PzUtcyaXULTrbERJKeZKKkbHwIfTj0Txdq52m5TrblS4V6MAToA9oUEwr9fRKB43YUDA== 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=6loOczMUmpjppQ8PhqWtpG2L3ZCuAIM8caa3ByB9FPE=; b=LXRCfsmhs80TeXbdeDNqRzZbJig8JeS3PmyVIwDK/pIWLfXhbTlPJzMft1q3qCtf5S8fYWFoL6q5w4zLtwCsHAMBEH0cxtLHsjfOcaXVSz/cZzPPQP9UuqMxyZscw5ZeegVWBaDOIoM7IIICxa3ZkgONVXHN5OlsaSPlu2vioYFaWK9ig67tjVYiI2/F9g0o9V/O4zE6L6Oaaktt+FPq9ufObX2upUhXWKRCak9i9XDte56rPc5SNVrtlxWPzIfBdI1Al966rNelDQ69lsTLP2zXC//Y2yL+QBanQNDe3lSqZDbnI8uns3Xh2vrJl4pea394Xkmrvx+wxiIP2kMcKQ== Received: from DB6PR0101MB2214.eurprd01.prod.exchangelabs.com (2603:10a6:4:42::27) by AM0PR01MB5699.eurprd01.prod.exchangelabs.com (2603:10a6:208:176::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5332.12; Thu, 9 Jun 2022 23:57: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:57:44 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 10 Jun 2022 01:55:23 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [fRZoI5/lNtUjZEaZbSd3XECorpPv0ubn] 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-41-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ad08c843-2a98-47f2-6af3-08da4a73d8b3 X-MS-Exchange-SLBlob-MailProps: S/btQ8cKWiTijo6adWu98SHbtEySq1lKry91Qzc+7yrqqC4Hgj5YvKApKZ4lKiCIjpAZHTJ/dFzcm0uHrYV1BVSNCUSRQ+kBRAoNUqXiLvpE+wvw6GJNM7k47zqjD2zi/t0QFQLwnVFv9OFazV6Nfx3kN80LDsp/FxD13sh9Aivu7ac4RC3FW6+OKsfA4PhzBPPsyG/ronDDPUYpDxL1dhp59XtV+Q19fFwQsouNFM93Ikg5y+sNGianWcDv6at9bES2lr+hrNUZtLzajRlQs8jtLp5S/zVmAS5A9V1UdXeIje2dXhA9RwfkiZafI8N8xEL+/eMfZHuQX+TgxbtyX1hYR7sJrm5q8Fha9aXiukBXlZ7P8VG3WcrB0/ULwauChdm7JL1+N/EsA6qO5UAXNwA10sOipnsKos0YxkQQjjtJWuSIp0LPY4hd9bOYZ1r282nLz6Joj0a3DBfwidFv1n34rtA7gKv7mZD/g+fAX4VpnsI+4OSzBf0eekatpm9e8zcOK+8UVN94N/xAGZBWWVs98uPvVmny5eJttkAoqTCV4G1qir0AnVB4R/dvmtHdndrp4/WOppHSFOydt90zbDZ/phAPbBTqYmLajW9Yb5LsKKkSugolj5XEYBIBgRk7xQli1Puh8vLx75F3obKnXGLl50adQuY2dXddrwJ0tAO2bPZ41Zpz5FqZ9+f/0958TCE7PuX83zoenSjccy7MfmOpAbPi7cS2YZOIMZLvMvvGQ+WYOQP1XeRgZfvZNRBUpO5JwAM+354= X-MS-TrafficTypeDiagnostic: AM0PR01MB5699:EE_ X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: b7X4LBQMe3H1u7Ppsu8H3wRMzMqbYxeG5hvN7uJjNq8n+F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message-Id: ad08c843-2a98-47f2-6af3-08da4a73d8b3 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:57:44.5865 (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: AM0PR01MB5699 Subject: [FFmpeg-devel] [PATCH 41/41] avutil/x86/pixelutils_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: vnxcevKAUvu2 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 8x8 MMX (overridden by MMXEXT) as well as the 16x16 MMXEXT (overridden by SSE2) sad functions at compile-time for x64. Signed-off-by: Andreas Rheinhardt --- libavutil/x86/pixelutils.asm | 4 ++++ libavutil/x86/pixelutils_init.c | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/libavutil/x86/pixelutils.asm b/libavutil/x86/pixelutils.asm index 8b45ead78b..ea79186e19 100644 --- a/libavutil/x86/pixelutils.asm +++ b/libavutil/x86/pixelutils.asm @@ -25,6 +25,7 @@ SECTION .text +%if ARCH_X86_32 ;------------------------------------------------------------------------------- ; int ff_pixelutils_sad_8x8_mmx(const uint8_t *src1, ptrdiff_t stride1, ; const uint8_t *src2, ptrdiff_t stride2); @@ -62,6 +63,7 @@ cglobal pixelutils_sad_8x8, 4,4,0, src1, stride1, src2, stride2 movd eax, m6 movzx eax, ax RET +%endif ;------------------------------------------------------------------------------- ; int ff_pixelutils_sad_8x8_mmxext(const uint8_t *src1, ptrdiff_t stride1, @@ -83,6 +85,7 @@ cglobal pixelutils_sad_8x8, 4,4,0, src1, stride1, src2, stride2 movd eax, m2 RET +%if ARCH_X86_32 ;------------------------------------------------------------------------------- ; int ff_pixelutils_sad_16x16_mmxext(const uint8_t *src1, ptrdiff_t stride1, ; const uint8_t *src2, ptrdiff_t stride2); @@ -102,6 +105,7 @@ cglobal pixelutils_sad_16x16, 4,4,0, src1, stride1, src2, stride2 %endrep movd eax, m2 RET +%endif ;------------------------------------------------------------------------------- ; int ff_pixelutils_sad_16x16_sse2(const uint8_t *src1, ptrdiff_t stride1, diff --git a/libavutil/x86/pixelutils_init.c b/libavutil/x86/pixelutils_init.c index 184a3a4a9f..e74d5634d7 100644 --- a/libavutil/x86/pixelutils_init.c +++ b/libavutil/x86/pixelutils_init.c @@ -53,9 +53,11 @@ void ff_pixelutils_sad_init_x86(av_pixelutils_sad_fn *sad, int aligned) { int cpu_flags = av_get_cpu_flags(); +#if ARCH_X86_32 if (EXTERNAL_MMX(cpu_flags)) { sad[2] = ff_pixelutils_sad_8x8_mmx; } +#endif // The best way to use SSE2 would be to do 2 SADs in parallel, // but we'd have to modify the pixelutils API to return SIMD functions. @@ -65,7 +67,9 @@ void ff_pixelutils_sad_init_x86(av_pixelutils_sad_fn *sad, int aligned) // so just use the MMX 8x8 version even when SSE2 is available. if (EXTERNAL_MMXEXT(cpu_flags)) { sad[2] = ff_pixelutils_sad_8x8_mmxext; +#if ARCH_X86_32 sad[3] = ff_pixelutils_sad_16x16_mmxext; +#endif } if (EXTERNAL_SSE2(cpu_flags)) {