From patchwork Fri May 6 18:02:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 570199 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:66c4:0:0:0:0 with SMTP id x4csp1912983mal; Fri, 6 May 2022 11:04:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwIvenHbUYwWhVazGDq/oTT8HClwjXtKKOryqckoVgfs1XYgbtC6WF/+bNII0DDUmLRcDMx X-Received: by 2002:ac8:58d5:0:b0:2f3:850b:6996 with SMTP id u21-20020ac858d5000000b002f3850b6996mr3927077qta.676.1651860275621; Fri, 06 May 2022 11:04:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651860275; cv=none; d=google.com; s=arc-20160816; b=MLrCng+s6L8lSPdAnLbI7wSeeYIN6fu+b9KE2VZs9Yjs0hXquhUQqOre4zt45lhvWF bgn+4LLmEGbYO6PpXBNWu/qh2csCv5YcewMThqMEyaaBwANPNU4+wFG4Z/tQ0FPuPFoP 5Uk4SbpIwgPJTcV5w6TXFn6ELI5nMhg+hF4oQBN4rVTmKKlAIeZmCImsJr9LF+ErK2/L 9bk8LuFJXZipIPL73uPET8HVYUrAlo6QZkPsUSGbmh0sv5eYQ+OCHdZ86/0ot/Lmfxgi EffugqdEFNSAYYUteeznfI2tCNz/eIbqM4kZk9hNnha9SKLm68rCa0BABbBb0fGuOyfr NHcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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:cc:to :from:dkim-signature; bh=4YqOGbb38qjiPY2dXCdLJrEWMXvDZh6b/gyG/7bmWLA=; b=C85C0IocyCsTD/RIBwM9iDYm3BXuZmIS2UtrCbt28izWN07SU85qq8v8wrFar528Hw 7SywdRSzhJ7FaN5oJdiYEa4ZWMSA/sXDpXwosTn3nKCkF/dWK1EQVWz7OHxD9V7N6p3q JOFNDzudBopueNyB/iLyW5moA6ltN5rbskALVcpb6s8LgQSfLeYR40FBatago9f8Jmae WL0AbO3UiKRZUAXnKk51vFWE3vabui8oQR4tyDe7FC2paB923yC3bggf5MRb8KtzFhHa AvA9JEtAaPj5eXjszakJQh8LjE7qZw9B7uBQV/fa8hsaax+Mp1lqU3KpNsX7Tx7ChsVb iXjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=IdsrfcLZ; 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 p6-20020a05620a112600b0069ffbdcbbeasi2388468qkk.537.2022.05.06.11.04.35 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 06 May 2022 11:04:35 -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=IdsrfcLZ; 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]:47144 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nn2Jf-0006FI-5v for patch@linaro.org; Fri, 06 May 2022 14:04:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59492) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nn2I1-0005CH-FO for qemu-devel@nongnu.org; Fri, 06 May 2022 14:02:53 -0400 Received: from mail-oi1-x22d.google.com ([2607:f8b0:4864:20::22d]:40650) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nn2Hz-0003q2-S6 for qemu-devel@nongnu.org; Fri, 06 May 2022 14:02:53 -0400 Received: by mail-oi1-x22d.google.com with SMTP id y63so8288915oia.7 for ; Fri, 06 May 2022 11:02:51 -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=4YqOGbb38qjiPY2dXCdLJrEWMXvDZh6b/gyG/7bmWLA=; b=IdsrfcLZ8C03H55YUSl/U83BSKIlU4ZHuCoBO/cHOqftzrO88aBwlrh9tD49aF7sB6 bhHKBX79dfoIw/6HtqDXrPwUeITfgPHbN6IIrNP0nVevYNGvFRy696qYGbTi9SgsY2dA 8rnGp40uhml0l1IpCavyvjBBl06oee8tWQBOPX+gsQNZGPazl2ntzkQ4D/pBDDNwo0wB mrQ5AtsX7XiKd8TnkyGjRKPeF7cUpFTvPzzNJRVtBTPG1UA4vOUDc8yhuFaGc7mo/Wrp 8oHSMVskAxu5TQu0tavzviCyqVv93tHH64BZMZ0DkZWQ9149ATNHae5QT5jgB2MwHq0y n2hA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=4YqOGbb38qjiPY2dXCdLJrEWMXvDZh6b/gyG/7bmWLA=; b=ERKfjtcS3/Wy2HbbT6zEkkkknlr2BG+OMAQ+ZDptmlBY/z1Lfu3JAKNPMRUOqRhVZ3 m626tZkBYEFPQZV0Hxl70n38xVXNvm/NRBrI+c4bzT4aRouzqwiSFKxznfPcr7i+kLrG 77AAq1STrHnXbhe5Ucj4QArNdy+FxdTDLNqFH6EHlqKcEdqOzykaU91vFn3dwEziU9Kc klqif7ElkiVeTieDrvtMSp/wGaKGqdgin3YRZhca3pi5m5g37+UytlsayyD192ZXYMbr tJAWpZg0WyUQ3wtZ9psNH5SLvhuPIXvM28dqi/M1kfBY9IPyTyjTyMX64P3jqV27Bw/5 x7yw== X-Gm-Message-State: AOAM532DJLDCkt6eav8z1QTT9obEbHI4kPnw4ThulJqPhD7fIjpz/A8H 4gmZh7je/rl+NPUTgYYT2zqfiIKCpRlYGw== X-Received: by 2002:a05:6808:220d:b0:326:4eb1:6911 with SMTP id bd13-20020a056808220d00b003264eb16911mr2128189oib.200.1651860170775; Fri, 06 May 2022 11:02:50 -0700 (PDT) Received: from stoup.. ([2607:fb90:5fe1:b497:51bb:ba21:d1a7:eac2]) by smtp.gmail.com with ESMTPSA id e4-20020a056870c0c400b000e686d1389esm1780002oad.56.2022.05.06.11.02.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 May 2022 11:02:50 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, Peter Maydell Subject: [PATCH v6 03/24] target/arm: Merge zcr reginfo Date: Fri, 6 May 2022 13:02:21 -0500 Message-Id: <20220506180242.216785-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220506180242.216785-1-richard.henderson@linaro.org> References: <20220506180242.216785-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::22d; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x22d.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Drop zcr_no_el2_reginfo and merge the 3 registers into one array, now that ZCR_EL2 can be squashed to RES0 and ZCR_EL3 dropped while registering. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/arm/helper.c | 55 ++++++++++++++------------------------------- 1 file changed, 17 insertions(+), 38 deletions(-) diff --git a/target/arm/helper.c b/target/arm/helper.c index ea2788b3d5..72d05070f0 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -6122,35 +6122,22 @@ static void zcr_write(CPUARMState *env, const ARMCPRegInfo *ri, } } -static const ARMCPRegInfo zcr_el1_reginfo = { - .name = "ZCR_EL1", .state = ARM_CP_STATE_AA64, - .opc0 = 3, .opc1 = 0, .crn = 1, .crm = 2, .opc2 = 0, - .access = PL1_RW, .type = ARM_CP_SVE, - .fieldoffset = offsetof(CPUARMState, vfp.zcr_el[1]), - .writefn = zcr_write, .raw_writefn = raw_write -}; - -static const ARMCPRegInfo zcr_el2_reginfo = { - .name = "ZCR_EL2", .state = ARM_CP_STATE_AA64, - .opc0 = 3, .opc1 = 4, .crn = 1, .crm = 2, .opc2 = 0, - .access = PL2_RW, .type = ARM_CP_SVE, - .fieldoffset = offsetof(CPUARMState, vfp.zcr_el[2]), - .writefn = zcr_write, .raw_writefn = raw_write -}; - -static const ARMCPRegInfo zcr_no_el2_reginfo = { - .name = "ZCR_EL2", .state = ARM_CP_STATE_AA64, - .opc0 = 3, .opc1 = 4, .crn = 1, .crm = 2, .opc2 = 0, - .access = PL2_RW, .type = ARM_CP_SVE, - .readfn = arm_cp_read_zero, .writefn = arm_cp_write_ignore -}; - -static const ARMCPRegInfo zcr_el3_reginfo = { - .name = "ZCR_EL3", .state = ARM_CP_STATE_AA64, - .opc0 = 3, .opc1 = 6, .crn = 1, .crm = 2, .opc2 = 0, - .access = PL3_RW, .type = ARM_CP_SVE, - .fieldoffset = offsetof(CPUARMState, vfp.zcr_el[3]), - .writefn = zcr_write, .raw_writefn = raw_write +static const ARMCPRegInfo zcr_reginfo[] = { + { .name = "ZCR_EL1", .state = ARM_CP_STATE_AA64, + .opc0 = 3, .opc1 = 0, .crn = 1, .crm = 2, .opc2 = 0, + .access = PL1_RW, .type = ARM_CP_SVE, + .fieldoffset = offsetof(CPUARMState, vfp.zcr_el[1]), + .writefn = zcr_write, .raw_writefn = raw_write }, + { .name = "ZCR_EL2", .state = ARM_CP_STATE_AA64, + .opc0 = 3, .opc1 = 4, .crn = 1, .crm = 2, .opc2 = 0, + .access = PL2_RW, .type = ARM_CP_SVE, + .fieldoffset = offsetof(CPUARMState, vfp.zcr_el[2]), + .writefn = zcr_write, .raw_writefn = raw_write }, + { .name = "ZCR_EL3", .state = ARM_CP_STATE_AA64, + .opc0 = 3, .opc1 = 6, .crn = 1, .crm = 2, .opc2 = 0, + .access = PL3_RW, .type = ARM_CP_SVE, + .fieldoffset = offsetof(CPUARMState, vfp.zcr_el[3]), + .writefn = zcr_write, .raw_writefn = raw_write }, }; void hw_watchpoint_update(ARMCPU *cpu, int n) @@ -8233,15 +8220,7 @@ void register_cp_regs_for_features(ARMCPU *cpu) } if (cpu_isar_feature(aa64_sve, cpu)) { - define_one_arm_cp_reg(cpu, &zcr_el1_reginfo); - if (arm_feature(env, ARM_FEATURE_EL2)) { - define_one_arm_cp_reg(cpu, &zcr_el2_reginfo); - } else { - define_one_arm_cp_reg(cpu, &zcr_no_el2_reginfo); - } - if (arm_feature(env, ARM_FEATURE_EL3)) { - define_one_arm_cp_reg(cpu, &zcr_el3_reginfo); - } + define_arm_cp_regs(cpu, zcr_reginfo); } #ifdef TARGET_AARCH64