From patchwork Wed Aug 21 23:24:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ramiro Polla X-Patchwork-Id: 51111 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:612c:4062:b0:48e:c0f8:d0de with SMTP id kz34csp773461vqb; Wed, 21 Aug 2024 18:51:20 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVhAdbw3snVL15+Ru5iC1CvnuSIQIndJZ06TfpJhi/8eNlfc+xSNUEGqxD9Uq5NZc+emoZ5gFnVeN5YMsQ219Vl@gmail.com X-Google-Smtp-Source: AGHT+IEgOLk96NiKQEQwlQwk9XpCo+qLYMLC2cJB8WxQFmw9LvRJQylObZqyQgTCpXuZBqV9Jk97 X-Received: by 2002:a05:6512:e97:b0:52e:9921:6dff with SMTP id 2adb3069b0e04-5334fcf84d2mr141988e87.26.1724291480180; Wed, 21 Aug 2024 18:51:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1724291480; cv=none; d=google.com; s=arc-20240605; b=djT5QZI3WIFqu201OQUTUfSCap1rLU+FkEdcMQADyM9ZwlzE07j9hH0de46xNlIGZK qd4llsRv1xpd3TMXnk24tSqD7r45Ti/xqQJJKAEx1aozyTPzMNad2+3k+Fr9gw8xZC0m 13/9zwBQsp2kQgAcl/OlHKOo0k1f558kHQ+4tVNo+dr/JAbshmptsWOcKzpt7HlWR5/v mNrvST5JvJWNUpYrZ57nfeiCEcxdQvFwtuwDaGibWGyijtrQxnE3WcLLTuMay8Mc5h2g EdcQUO5rB41/5aEE4CoY8AlHXdKoPPPE6cJBRCh2zbCLWd36F9SW9v4fatBg/pZnqWbt sLOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:dkim-signature:delivered-to; bh=UCCAz8GersVF/l2mw99bzf3mzhLdFbhYC8i1NXlcuxI=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=ZZq7WeqjvlmpMwLKo/l3S+4IrfTnxQTUBxPQ+M5l34o6tYIMLXxqvjAieWKNyx+WvI MzcEECDCzWfCSb/3hik4u5jWUASwszXhPi8bUkdL0zxrz5beDs21GNmCdABoC1Q/Lw4q 4h3plKP62bP6LW9r3W4sG9/hmO/rt4Mwupq0vzdkNLq+cVPSNMAWf+R88Dhz723xwCEA Xc/WBc8nBtrOUNFcqSekBMvOzOZk5fojoQNoJn7oj2st5oFCplz/c14+XEJ37UV7zHuo htwyGrECGzFah/izMFHP915CzgDbs1OKtyQeC6Z70+velcuzDi6wSne3JvQHFxIsSVMv 4rJA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20230601 header.b=j74jA09N; 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=gmail.com; dara=fail header.i=@gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id 2adb3069b0e04-5334ea95cfcsi145455e87.569.2024.08.21.18.51.19; Wed, 21 Aug 2024 18:51:20 -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=@gmail.com header.s=20230601 header.b=j74jA09N; 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=gmail.com; dara=fail header.i=@gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id D14D268DDEB; Thu, 22 Aug 2024 02:25:09 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ed1-f54.google.com (mail-ed1-f54.google.com [209.85.208.54]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 9AAE168DD80 for ; Thu, 22 Aug 2024 02:24:59 +0300 (EEST) Received: by mail-ed1-f54.google.com with SMTP id 4fb4d7f45d1cf-5bed92f638fso262511a12.2 for ; Wed, 21 Aug 2024 16:24:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1724282698; x=1724887498; darn=ffmpeg.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=58M6mmAd9Qf0xuMrUG/Ik5Ht64WkeqjiqG/YCL/YCro=; b=j74jA09NU3UFg42iDcBxpM1JzszUFoT34TJ9PYiv+BUSJ2hdMYC1TbcJLdnxlfazyZ 48x8SJs6IzmvMErtY1/+SHP9YRq1ZqvBXOZF0qGAgesKh0Ymn8dgQQsEM5P5PNEfuAfd XxtnAFhYaKWyyUjHADePsIWoFki5nUnUQ4Z0yYSN1/njt+PyaT3dwhvcGRIZNB+gqh/T B2F947s5ZWkHcI77SVWDxYxKTTbzwc0dqKq1eEFgYPkkZ4FqPecPFJKQD1rYcbDWQXar R32FWhck59dlM4a5hFV9JtGFjHRKZbosndqCdo/8g8pySb0R+j11vc6WQy4FYcFCOnq2 8Y3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724282698; x=1724887498; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=58M6mmAd9Qf0xuMrUG/Ik5Ht64WkeqjiqG/YCL/YCro=; b=OCztgmaRbdg5Z4FqhfV+hWP3bZE8l1BRUKyYrhQAp9QpFxHH15XO9EmvYho9dECwNm UPUtBWeBQNmfOCwEsw6Ix/abMEwCS8dr8PlLhJyn9d84mRo5GfUjuo+mpjv4BTcxgMwA Zn10MjK6znvhsml1Krlmo933FJ5he92LjQbcw6qH4RDwX3uiVA0tLJ9zLcQ7ddfgRxQI 1n7z55hd0/B1lI2jQVs4UbiYTO7l5rWo2MU5MTmA2mxSPg4JBzXMUr9xfT5z46rAkW+G dwuYD1Vvh+Fxi/VqL4uUeX9dgz0rUvBlWeKrPMTINCl88l3/1p3pmWSOB8YrzJaz0y+G P8eQ== X-Gm-Message-State: AOJu0Yy+JSuC7JBz6XC/sKH282rJFv7MIgtwXUj4fTv9MosyWooUp+Wr lgVTIv8C+V2a1/iKn0DK1QxBdJcP4vtb94owDr+muu+w6CFbApF6u4whotw/ X-Received: by 2002:a05:6402:35c4:b0:5be:fe26:dac1 with SMTP id 4fb4d7f45d1cf-5c0791d07fbmr27186a12.3.1724282698404; Wed, 21 Aug 2024 16:24:58 -0700 (PDT) Received: from localhost.localdomain (196.105-180-91.adsl-dyn.isp.belgacom.be. [91.180.105.196]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5c044ddc0d0sm164644a12.10.2024.08.21.16.24.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Aug 2024 16:24:58 -0700 (PDT) From: Ramiro Polla To: ffmpeg-devel@ffmpeg.org Date: Thu, 22 Aug 2024 01:24:55 +0200 Message-Id: <20240821232455.238469-3-ramiro.polla@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20240821232455.238469-1-ramiro.polla@gmail.com> References: <20240821232455.238469-1-ramiro.polla@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] avutil/aarch64: add AV_COPY128 and AV_ZERO128 macros 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: F5Yi5Uz7tq+O --- libavutil/aarch64/intreadwrite.h | 42 ++++++++++++++++++++++++++++++++ libavutil/intreadwrite.h | 4 ++- 2 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 libavutil/aarch64/intreadwrite.h diff --git a/libavutil/aarch64/intreadwrite.h b/libavutil/aarch64/intreadwrite.h new file mode 100644 index 0000000000..4ce2d64987 --- /dev/null +++ b/libavutil/aarch64/intreadwrite.h @@ -0,0 +1,42 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVUTIL_AARCH64_INTREADWRITE_H +#define AVUTIL_AARCH64_INTREADWRITE_H + +#if HAVE_INTRINSICS_NEON + +#include + +#define AV_COPY128 AV_COPY128 +static av_always_inline void AV_COPY128(void *d, const void *s) +{ + uint8x16_t tmp = vld1q_u8((const uint8_t *)s); + vst1q_u8((uint8_t *)d, tmp); +} + +#define AV_ZERO128 AV_ZERO128 +static av_always_inline void AV_ZERO128(void *d) +{ + uint8x16_t zero = vdupq_n_u8(0); + vst1q_u8((uint8_t *)d, zero); +} + +#endif /* HAVE_INTRINSICS_NEON */ + +#endif /* AVUTIL_AARCH64_INTREADWRITE_H */ diff --git a/libavutil/intreadwrite.h b/libavutil/intreadwrite.h index 120bdbc8f0..ffd15a1502 100644 --- a/libavutil/intreadwrite.h +++ b/libavutil/intreadwrite.h @@ -64,7 +64,9 @@ typedef union { #include "config.h" -#if ARCH_MIPS +#if ARCH_AARCH64 +# include "aarch64/intreadwrite.h" +#elif ARCH_MIPS # include "mips/intreadwrite.h" #elif ARCH_PPC # include "ppc/intreadwrite.h"