From patchwork Fri Dec 15 15:38:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Martin_Storsj=C3=B6?= X-Patchwork-Id: 45163 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:1225:b0:181:818d:5e7f with SMTP id v37csp5741776pzf; Fri, 15 Dec 2023 07:39:11 -0800 (PST) X-Google-Smtp-Source: AGHT+IEjp+x7XfG5hCakdcoP5BG7sdvhNXNY8dsrBf2qcxP7FsyjSpU1+F8AcuguGG8rod5BVumz X-Received: by 2002:aa7:c0d3:0:b0:54a:ff0f:78d6 with SMTP id j19-20020aa7c0d3000000b0054aff0f78d6mr13592393edp.0.1702654751727; Fri, 15 Dec 2023 07:39:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702654751; cv=none; d=google.com; s=arc-20160816; b=zWoI3eDLsx6CFhQgyA+OMLv451vAl554AXJ0CvUYNlbQ63QmQMfjgQEC4AFy/PZ5G3 63QWvCvKQik0fFTDqsaF7F1E8MedkTd07xJIPw03kWycG7IRgXCfyjLDGSjqjIdLQ7DM FwBfG9GhXrtsvPysESRJK5JAANYhqZfUPajFQ4VUUa5dNSoP9MjH3LRx3jSCycDhyVDR g/WV1yaUCY4qKoGycsvTy/pVvYTbIOpMV3rZ9R5mWDyAUqJ7nBOgmw6TqL36nqdY+3Aw ltaASEYg474KN1qNNlPM8N2sSQ3xXMPicR0ayGzwJYs9j/A4icJWzGwcIu3qc6Erg8Us m9bg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; 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:message-id:date:to:from :dkim-signature:delivered-to; bh=PcCVRfZcK6v6Q9h7kkWkGQLnKIlpDZH5DS4TJawjtZ4=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=fbV3pB+6LNOr+W8lgAdklXi2O7rLqXZzwzTWRfZV6dW428Ox5XExUSyfhf1JLuAP1Y lV9k/vYCCxEg8TcIEwz+Nu3jCADfOhbvXuXXO1Oi6uYURGzIFZgOeR3xl22e1Cu2baA7 cKJAY+Yv0NOOU8XsaT1WE5AcQ41qfOnKFV8rvtT2XVvK85JcKW4WOKzWDMsVg87BgWT4 WyzOwSNYdxsjS97eHpI+fYR2b5cRAeFZYiR6VYuCMLA+IBujY3mafNi+7pxpq+y/ST1t /r2uNYsjeHLT5r3neuAdW5KaRkn9Jigo8lPk+7t4QPoNWchdpcAdF/wPpBLHfZC2iTCm IaOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@martin-st.20230601.gappssmtp.com header.s=20230601 header.b=KXev8d8J; 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 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id eh22-20020a0564020f9600b0055283724255si1307316edb.502.2023.12.15.07.38.58; Fri, 15 Dec 2023 07:39:11 -0800 (PST) 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=@martin-st.20230601.gappssmtp.com header.s=20230601 header.b=KXev8d8J; 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 Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 8C94768D0FB; Fri, 15 Dec 2023 17:38:54 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-lf1-f44.google.com (mail-lf1-f44.google.com [209.85.167.44]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 54C8668CF93 for ; Fri, 15 Dec 2023 17:38:47 +0200 (EET) Received: by mail-lf1-f44.google.com with SMTP id 2adb3069b0e04-50bf82f4409so1868130e87.0 for ; Fri, 15 Dec 2023 07:38:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=martin-st.20230601.gappssmtp.com; s=20230601; t=1702654726; x=1703259526; darn=ffmpeg.org; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=cEBq/WQVrzUbgPYKOzcH6DdYgAKuwJ61CEolA0c6nGE=; b=KXev8d8JK5P/GuT+w4J6dN2qZL2QLRkYZJs/EpbCr9uEdCmixNvvBBsjifzswTUvET XbR6XhrwH6mrBZPzchT9WJL+z2+Bt6ta9pLwAlM3yus1WSanTjR1LCVcMiPwK0Yc/cXs Rl/bc7QSKXgO2vwmu+qILwwOoSRaF3EBULVUuovJVAnT2X5NuPRZJWVXQMunLNaXhuRl e3AH+etFetv4nTwRey7EOWlahhyAIKEDUaQxkWvmKUVWTxTPS6wznQKLOmpLBIFT0j6y Clg/Ak0FIJQTxCpiSL+TYhVtsNDU6Xp3rC9sWRXGeOG8QnwZ/fUbr09ytZWkAxXrX1A6 Boxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702654726; x=1703259526; 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=cEBq/WQVrzUbgPYKOzcH6DdYgAKuwJ61CEolA0c6nGE=; b=NaE+bXuKSUDSBalD4pCmaJ1z2OnPLi6G4wIAyMwlncvSzayWi50b9Z7ywAJZdkOxPL in4OIRy0bQ7Lz87JyF0LdPdpWE0v8F+DhsNWJYbbJaK5WT62ICz89MPfNC0y8nh01JT9 RLacjhpmSk2Zz8xZFcCBqgxv3yvnZAIuDBoMsmuJxdmEMxNSDP/g9ybJT/FF7O3IVBni BsM14jlpO5Kr8JkOY7ohMeKzZva2NLxSrntP6kFLI8OrpbEUFjdZvRNZPPxNvZ+H70Ua /eXrOvyI5TU/wktY7TbFKCIMxibkh9f2eG6/K/Jcou0K+BdL1dzq6rB0OuFx4NsAD0IY 10Yw== X-Gm-Message-State: AOJu0YwhrLma043f4y2vz3pASbUW72wN66f7uqZL1nKicwdkqwbUnjT6 mcJ8sq+0/rdqL4kkQn9VxQvHXLby/Y45CkeC+Zbdkg== X-Received: by 2002:ac2:46ce:0:b0:50d:1842:551d with SMTP id p14-20020ac246ce000000b0050d1842551dmr5826820lfo.13.1702654725916; Fri, 15 Dec 2023 07:38:45 -0800 (PST) Received: from localhost (dsl-tkubng21-58c01c-243.dhcp.inet.fi. [88.192.28.243]) by smtp.gmail.com with ESMTPSA id w30-20020a0565120b1e00b0050c05910a2bsm2094884lfu.43.2023.12.15.07.38.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Dec 2023 07:38:45 -0800 (PST) From: =?utf-8?q?Martin_Storsj=C3=B6?= To: ffmpeg-devel@ffmpeg.org Date: Fri, 15 Dec 2023 17:38:45 +0200 Message-Id: <20231215153845.161544-1-martin@martin.st> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v2] riscv: vc1dsp: Don't check vlenb before checking the CPU flags 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: 3bzmF2sSEjKp We can't call ff_get_rv_vlenb() if we don't have RVV available at all. Due to the SIGILL signal handler in checkasm catching it, in an unexpected place, this caused checkasm to hang instead of reporting the issue. Acked-by: RĂ©mi Denis-Courmont --- libavcodec/riscv/vc1dsp_init.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/libavcodec/riscv/vc1dsp_init.c b/libavcodec/riscv/vc1dsp_init.c index 0d22d28f4d..e47b644f80 100644 --- a/libavcodec/riscv/vc1dsp_init.c +++ b/libavcodec/riscv/vc1dsp_init.c @@ -35,15 +35,13 @@ av_cold void ff_vc1dsp_init_riscv(VC1DSPContext *dsp) #if HAVE_RVV int flags = av_get_cpu_flags(); - if (ff_get_rv_vlenb() >= 16) { + if (flags & AV_CPU_FLAG_RVV_I32 && ff_get_rv_vlenb() >= 16) { + dsp->vc1_inv_trans_4x8_dc = ff_vc1_inv_trans_4x8_dc_rvv; + dsp->vc1_inv_trans_4x4_dc = ff_vc1_inv_trans_4x4_dc_rvv; if (flags & AV_CPU_FLAG_RVV_I64) { dsp->vc1_inv_trans_8x8_dc = ff_vc1_inv_trans_8x8_dc_rvv; dsp->vc1_inv_trans_8x4_dc = ff_vc1_inv_trans_8x4_dc_rvv; } - if (flags & AV_CPU_FLAG_RVV_I32) { - dsp->vc1_inv_trans_4x8_dc = ff_vc1_inv_trans_4x8_dc_rvv; - dsp->vc1_inv_trans_4x4_dc = ff_vc1_inv_trans_4x4_dc_rvv; - } } #endif }