From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 8C63545BCB for ; Fri, 26 May 2023 08:03:27 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 2D9CC68C1C1; Fri, 26 May 2023 11:03:24 +0300 (EEST) Received: from mail-lf1-f54.google.com (mail-lf1-f54.google.com [209.85.167.54]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 6ECC468C091 for ; Fri, 26 May 2023 11:03:17 +0300 (EEST) Received: by mail-lf1-f54.google.com with SMTP id 2adb3069b0e04-4f3a611b3ddso2269881e87.0 for ; Fri, 26 May 2023 01:03:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=martin-st.20221208.gappssmtp.com; s=20221208; t=1685088196; x=1687680196; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=acagDSYhdq7056Wg6SktGzB/auJImajSYlFtr1r6ZlQ=; b=gqbRh9qNOW2J4Ex63gMIT6jLFlfQPLj3gFy7K8lVvKotVCLQhno7DcPwC8cUM3e44n G8MnmMo2kdkjg5YSbEdq6eqsWRWCK2iKW7SpjlaviC5hkwp3P3l+dU27UmnCs+WrN7pS 0x3RlPRoIqeLiOuxjvjphWI6uExxzIvvLOsvSyzLBk6xjjlE+3WXTmW73l/wjmC2/AZc bpPl5PyZlwermUZNDZvQWvAwpGJK5FiqFEpr/RGhqxjCXwwZS8Cd1gb/Rdpxc9HEOH/+ vPA5QrXgzm9pZ/IsofkTM/BoQfxP0qISMDeCMw8xtXfpbZ/0IMeSUM29MAywtqybYJvp be5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685088196; x=1687680196; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=acagDSYhdq7056Wg6SktGzB/auJImajSYlFtr1r6ZlQ=; b=JcA2g0S4EvZVZ7DFdFkYb1qBHre15wZkfWU/TTGNq5lnoaJcMGEN9MY27ZeAaPybw2 6aQW9yA0UBIeAvmI/sMgQ3SARtF1sdo6RL3EjPCni3a5DlM3Q5KBf8A98wlY8pYBRx8/ e69b+goAZcWoAH25tBFNrm5gd7n0/KtNF11Z1HETKh16tHkqIIbjoAhnfAC9EiWhg2AO UoyisHOR7h0qDGSE6cP3K2+IXpxQ8uqgS3SM+V4FPFQqje6gfXtedNQXiM80S/WYUbaj uFXLf2nfnktg6Xjz67Cn+6gEkIUrF1sd6wvxdrYJ/CgkS5tLI9WZaKlfxVj0KRwiaA3H 3Uvg== X-Gm-Message-State: AC+VfDwJ1t15HwkgCsuGW5WRxSyofFMOWyTTBBuokI9M+2NYHiRKIveo YvCeHPUCegINMmJ64yOJi3WgMHnLPL0mKtPLki1wOw== X-Google-Smtp-Source: ACHHUZ6233P307lju1h2RDRbgGz6EksPs6EKdhWSn0/hjMBwJkf2OA0JbBN08gTsSEuXrVl2QMUW2g== X-Received: by 2002:ac2:446d:0:b0:4f3:b9c8:5da with SMTP id y13-20020ac2446d000000b004f3b9c805damr343203lfl.33.1685088196113; Fri, 26 May 2023 01:03:16 -0700 (PDT) Received: from localhost (dsl-tkubng21-58c01c-243.dhcp.inet.fi. [88.192.28.243]) by smtp.gmail.com with ESMTPSA id u2-20020a056512040200b004f4c3feb9f1sm517251lfk.62.2023.05.26.01.03.15 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 26 May 2023 01:03:15 -0700 (PDT) From: =?UTF-8?q?Martin=20Storsj=C3=B6?= To: ffmpeg-devel@ffmpeg.org Date: Fri, 26 May 2023 11:03:12 +0300 Message-Id: <20230526080315.83424-1-martin@martin.st> X-Mailer: git-send-email 2.37.1 (Apple Git-137.1) MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 1/4] configure: aarch64: Support assembling the dotprod and i8mm arch extensions 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 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: These are available since ARMv8.4-a and ARMv8.6-a respectively, but can also be available optionally since ARMv8.2-a. Check if these are available for use unconditionally (e.g. if compiling with -march=armv8.6-a), or if they can be enabled with specific assembler directives. Use ".arch_extension " for enabling a specific extension in assembly; the same can also be achieved with ".arch armv8.2-a+", but with .arch_extension is easier to combine multiple separate features. Enabling these extensions requires setting a base architecture level of armv8.2-a with .arch. Don't add ".arch armv8.2-a" unless necessary; if the base level is high enough (which might unlock other extensions without .arch_extension), we don't want to lower it. Only add .arch/.arch_extension if needed, e.g. current clang fails to recognize the dotprod and i8mm features in .arch_extension, but can successfully assemble these instructions if part of the baseline set with -march. --- configure | 77 ++++++++++++++++++++++++++++++++++++++++- libavutil/aarch64/asm.S | 13 +++++++ 2 files changed, 89 insertions(+), 1 deletion(-) diff --git a/configure b/configure index 87f7afc2e1..3c7473efb2 100755 --- a/configure +++ b/configure @@ -454,6 +454,8 @@ Optimization options (experts only): --disable-armv6t2 disable armv6t2 optimizations --disable-vfp disable VFP optimizations --disable-neon disable NEON optimizations + --disable-dotprod disable DOTPROD optimizations + --disable-i8mm disable I8MM optimizations --disable-inline-asm disable use of inline assembly --disable-x86asm disable use of standalone x86 assembly --disable-mipsdsp disable MIPS DSP ASE R1 optimizations @@ -1154,6 +1156,41 @@ check_insn(){ check_as ${1}_external "$2" } +check_archext_insn(){ + log check_archext_insn "$@" + feature="$1" + base_arch="$2" + archext="$3" + instr="$4" + # Check if the assembly is accepted unconditionally in either inline or + # external assembly. + check_inline_asm ${feature}_inline "\"$instr\"" + check_as ${feature}_external "$instr" + + enabled_any ${feature}_inline ${feature}_external || disable ${feature} + + if disabled ${feature}_external; then + # If not accepted unconditionally, check if we can assemble it + # with a suitable .arch_extension directive. + test_as <