From patchwork Wed Jul 14 18:06:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 476822 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp808016jao; Wed, 14 Jul 2021 11:07:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJweWz1BYAJjuIV12i1ipTdNef2pJroJOddcnVj3aTfxe1X10V/PtzWddUxyXD1NDmbsGVa+ X-Received: by 2002:ac2:59db:: with SMTP id x27mr5545974lfn.547.1626286045643; Wed, 14 Jul 2021 11:07:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626286045; cv=none; d=google.com; s=arc-20160816; b=yW6TEVDGmrL8rqHNUPmu2sQj0EFSYfGh/VWUd9EsmWqzi/kHiXge8+PMI7xvSJhzQi Y3e3Een50dgjXnXyQ2T7YV341vPOszej3KDInCL+hyUgpcYQKd0jLA6F98J4JvbuejUe lQzv/OkFyWP8QjK7rpLnR3nn/MnXgysQvs3KWDKbxALwme/xilDKlRJKEGszr+6fGBYW cXWk9R4Db1i3LwqI8STivtnPw3p23xNQ7hKmiTFaCpr5A69UBNNVgZLiajNrEQhLDi+I 2EpoCtfBGv8/3dCCIqbZqi1IyHZwSb5SRmaSEKUXcU+zTCEnnWp+RGjGD79YXVQNxe1w WlcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=fx1IYlUB1apyvNip9CdKVB8bhhKr7Iu1pMhRVbOHLjQ=; b=a+SYJweTrZTP2d0oZ8JGImitLC4sv4WValxxtKrcFnuuWvy3u72QRA91IFqwTMTv/H Bygf0/RFIVaM60a+UBI7aHaRK9bLU/SrOe/O1+7Dj46Ucu+EWGrj1EouDQns3rO9uADr 1xeFUhUjbuUbAzkFqMMd8dfJJTp1yYvU1NE1bHQ3hqDHHbTIegoxTi/BTrkzpSk/l2Yo DzCsOC3UQDDpex1kjnn015jQtDCx/QfeWlS4nHk7z94jpXsTlwBJeTDzURSA55t8chHl a+t4L7Y7JGIrEM+Wruzwiw5umc/zprtKVGl5wVLC48tRqlGv09rexsOwcHsxzZvBNcR5 +8OA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vpXfsZxA; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d13si4554257lfv.523.2021.07.14.11.07.25 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 14 Jul 2021 11:07:25 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vpXfsZxA; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:57112 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m3jI4-0002ur-Fr for patch@linaro.org; Wed, 14 Jul 2021 14:07:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33608) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m3jHM-0002uK-JE for qemu-devel@nongnu.org; Wed, 14 Jul 2021 14:06:40 -0400 Received: from mail-pf1-x432.google.com ([2607:f8b0:4864:20::432]:42882) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m3jHL-0000qK-1y for qemu-devel@nongnu.org; Wed, 14 Jul 2021 14:06:40 -0400 Received: by mail-pf1-x432.google.com with SMTP id y4so2735659pfi.9 for ; Wed, 14 Jul 2021 11:06:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=fx1IYlUB1apyvNip9CdKVB8bhhKr7Iu1pMhRVbOHLjQ=; b=vpXfsZxAj9HyJcTED1cx6W27B1XFidizESj0ocXKQ9v3bvkNbx6nFLchz2WMmaIUg1 DT3/kxCMQ4AG6f6Em02bjqwT3DiSal/dj2CcRHXIq9OUmyKYypnkbEaeRqAc3KNwUeVc 14elr+Da9hyI6QpePz71aJPZc+SdSALn5Wmlk1ui90CfSphu4WkE977OWKU644rKa23Q z4fDanpp95ra1YvCRGp4t1EHrpQDVSyoqKG/b9xD2yxxdtoxj+wniaKR5bg76KVvpCku bjgTR54uD0Do4zWg31yEurxOQRZfHyLJGo1aqYDXdUDAl/hKNo/YYWMywQpBlpRj1OW+ Km5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=fx1IYlUB1apyvNip9CdKVB8bhhKr7Iu1pMhRVbOHLjQ=; b=T99eUGj1szBuXQQeBjrdOguyeVs1BWPqUZGPjr+CTv4bJ0YlElhodDkw9nyKc1UIA+ 12jhqQYeQIAk3HKLIV3ltEnF6i0xyF0g9njrOQ14dLKJSC0aQciVxiU850YyMh2ti4ts v6WVFw37XT9n52JKWE1MBrvDnFNB2ZzgVUuwIFhnIaRbQcYXeipPhGPN1PS5VZIFlbiE yU8gt/ouJp8Ih11OdNH7wPCqwXzikWqZ4LlfLV5jzcVF6FoWkCQgD8e6g56iWLdg6yND qb7BYosJmZAIXUUV183O/yRaxyn/ZemNyNZdDUX21sIIqKB4LT/LIVkYP8nJpH1d9FgX BRgw== X-Gm-Message-State: AOAM531oeg2vxd+UsPQg7Tq0jozqegZBmWmx3FHt3i9fgxmXSSc4k/ut DyDKBgsgbjhPHYKrxVH4Ing/YAi7djt+8A== X-Received: by 2002:a63:ff25:: with SMTP id k37mr10718246pgi.353.1626285997644; Wed, 14 Jul 2021 11:06:37 -0700 (PDT) Received: from localhost.localdomain ([75.147.178.105]) by smtp.gmail.com with ESMTPSA id d1sm2853521pju.16.2021.07.14.11.06.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Jul 2021 11:06:37 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 1/2] target/arm: Export aarch64_sve_zcr_get_valid_len Date: Wed, 14 Jul 2021 11:06:34 -0700 Message-Id: <20210714180635.1648966-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210714180635.1648966-1-richard.henderson@linaro.org> References: <20210714180635.1648966-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::432; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x432.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Rename from sve_zcr_get_valid_len and make accessible from outside of helper.c. Signed-off-by: Richard Henderson --- target/arm/cpu.h | 2 ++ target/arm/helper.c | 8 +++++--- 2 files changed, 7 insertions(+), 3 deletions(-) -- 2.25.1 diff --git a/target/arm/cpu.h b/target/arm/cpu.h index be9a4dceae..52e99344c5 100644 --- a/target/arm/cpu.h +++ b/target/arm/cpu.h @@ -1060,6 +1060,8 @@ int arm_cpu_write_elf64_note(WriteCoreDumpFunction f, CPUState *cs, int arm_cpu_write_elf32_note(WriteCoreDumpFunction f, CPUState *cs, int cpuid, void *opaque); +uint32_t aarch64_sve_zcr_get_valid_len(ARMCPU *cpu, uint32_t start_len); + #ifdef TARGET_AARCH64 int aarch64_cpu_gdb_read_register(CPUState *cpu, GByteArray *buf, int reg); int aarch64_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg); diff --git a/target/arm/helper.c b/target/arm/helper.c index 910ace4274..a49067c115 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -6454,11 +6454,13 @@ int sve_exception_el(CPUARMState *env, int el) return 0; } -static uint32_t sve_zcr_get_valid_len(ARMCPU *cpu, uint32_t start_len) +uint32_t aarch64_sve_zcr_get_valid_len(ARMCPU *cpu, uint32_t start_len) { uint32_t end_len; - end_len = start_len &= 0xf; + start_len = MIN(start_len, ARM_MAX_VQ - 1); + end_len = start_len; + if (!test_bit(start_len, cpu->sve_vq_map)) { end_len = find_last_bit(cpu->sve_vq_map, start_len); assert(end_len < start_len); @@ -6484,7 +6486,7 @@ uint32_t sve_zcr_len_for_el(CPUARMState *env, int el) zcr_len = MIN(zcr_len, 0xf & (uint32_t)env->vfp.zcr_el[3]); } - return sve_zcr_get_valid_len(cpu, zcr_len); + return aarch64_sve_zcr_get_valid_len(cpu, zcr_len); } static void zcr_write(CPUARMState *env, const ARMCPRegInfo *ri,