From patchwork Sun May 1 05:50:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 568568 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:6886:0:0:0:0 with SMTP id m6csp7709537map; Sat, 30 Apr 2022 23:49:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwfRODRx25To4uXgpfYxrBFcoqLD7rb+x3aiDC5zOM7YympTX3bAXKap3KciY8Z7vpagoft X-Received: by 2002:a05:620a:4011:b0:69e:bef5:8bfa with SMTP id h17-20020a05620a401100b0069ebef58bfamr4767418qko.369.1651387779761; Sat, 30 Apr 2022 23:49:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651387779; cv=none; d=google.com; s=arc-20160816; b=cznaTvVmr4Aof8bdVphOXT+RYGnku4POX7V65Z1s2SWgXevpRG4OEc9ewAVCKW0KvZ 6K5DWKf27P8MxZEVMZlbc2pXVls+m6fKBDpVGR7sZKdm6lOScl1AOpsqsMVbVENVdFC6 /wbtH0j4OuVi6Ivagtnyx3T69wTq3nuLVYI0y5S64kVhPrF+3VKPI54Iqq+rY867oqCf 6oqqXXUlY4yVK37+lqaqKuw2mXRfpwxRC/lI1U+CjzB40RV+l7yGrI6YtqcKaRggq0iy iLx5uDqEws9ITtmWmkaNBo7l+1GlwRyY1++XeTgDTj6mKxZAeSj7K+LfJE6NA6zhEvR/ 2knQ== 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=fg33AYGqWxlbsFqDHnUVCK+5A1bEa2zIHmnKmyfZL/g=; b=Ap7YgTnL4Qjuw+FnVBanJD2SfekGG3Zf5kl9kdIDtiTZWJ5JIql3SrMG8NLnVsmEhS fSbmBpX//pU3pRfFvWgADtrYf8fJa7OCNzUr7wAT/fBVSFJ0UqGMOIUNi2ko1RSbCXJH ldVhMRoDq6Ahnw7m5LaZsBilJmhF0l/9EWKoJrOhm8QmcwpXXgz/CNvy03HttUj72hZZ zXGT1Ijbqgc/NiBqlAaqrwYnWGh3IAN7wFkRLYH5NCldGmZcHhyH6OHMozkqzrLbbCTt V1UHyQ8hTUgSBRMC0GmogxbmhJXSRocSA0Ozd5hkOPEe13WNdCgJGUdfrSF7i54hCdcJ 18vA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=uaexpWmw; 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 bs12-20020a05620a470c00b0069c2e712b12si5125149qkb.600.2022.04.30.23.49.39 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 30 Apr 2022 23:49:39 -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=uaexpWmw; 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]:58344 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nl3Ol-0007Tr-B3 for patch@linaro.org; Sun, 01 May 2022 02:49:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43688) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nl2Tw-0006ti-Oj for qemu-devel@nongnu.org; Sun, 01 May 2022 01:50:59 -0400 Received: from mail-pj1-x1030.google.com ([2607:f8b0:4864:20::1030]:37600) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nl2Ts-0001KL-1B for qemu-devel@nongnu.org; Sun, 01 May 2022 01:50:54 -0400 Received: by mail-pj1-x1030.google.com with SMTP id t11-20020a17090ad50b00b001d95bf21996so13756154pju.2 for ; Sat, 30 Apr 2022 22:50: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=fg33AYGqWxlbsFqDHnUVCK+5A1bEa2zIHmnKmyfZL/g=; b=uaexpWmwTOmJFccnWa30znhIT5ngRAKa25R5CwGDYNtV2cmATC76F5QSL27b3l556o Wl+Hz2pPTCofWAdBbzdO4LogUB+5l/TENer+FXgfeIjNlFZ4Kc2Ghz4d7iKY3uvMR5H6 KpVwydUESd/qGAf8W+1xm59IaSRAIavwAOBWtEV3UFDk74iJ97xP85YZAZgmjru78kbM jdzgjSeUmdlJmDXHP5rBLt3+dMMCC6E2yn7wk0W1ZXfquMm6SvWOK3GA5/WSR1shfwiF +kkBeoJ9OcaBHsQ9jHhayXyzw6RSyai6nkzMJplSJml+7w+WOGpfnzBWW59UubTW198G W9BQ== 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=fg33AYGqWxlbsFqDHnUVCK+5A1bEa2zIHmnKmyfZL/g=; b=4UdQ+jkZ4iO7TKy7Gso6uaxAu93ObBiCoLAgyp1UyPRcCjH4N9pgMA7MlKW4nVIV+p eFp3h0cSCfvioj7xQVCQyERq9mIWNDAv9V0u+55q43Wt1gCJLJsV2XQI5N/7IZf7zz5H ui8P3f4QvL99w6yJoyIg8bFIM5HbG7DSQA02FsVC0BmQweAwLYy6JENXLMKrc6nGUCfm 8TkO9xHVGzQSGqirLRT9Do7O1ZDW+k9Z/wN25hiDLkTqeVjJFGAhmLMch8KZjbYK7i8y U8iSLJ0ec/5vnxAbVj/E2X4K/oDeYGDPprFiEChv8+WWq8FwyOY2c/DMU1uPH0rpI6KC gzUA== X-Gm-Message-State: AOAM533K9bF0hv0xPDgblMsKIPRohG8gtka7E3hKbiHbt2IifLWEzYI5 BmZ2mrvFM5gRT49Y/6fp0KGfKpMhnOITaQ== X-Received: by 2002:a17:902:f60e:b0:158:5c4d:d9b0 with SMTP id n14-20020a170902f60e00b001585c4dd9b0mr6558268plg.63.1651384250698; Sat, 30 Apr 2022 22:50:50 -0700 (PDT) Received: from stoup.. ([71.212.142.129]) by smtp.gmail.com with ESMTPSA id cm18-20020a17090afa1200b001cd8e9ea22asm17310342pjb.52.2022.04.30.22.50.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 30 Apr 2022 22:50:50 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v4 22/45] target/arm: Merge zcr reginfo Date: Sat, 30 Apr 2022 22:50:04 -0700 Message-Id: <20220501055028.646596-23-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220501055028.646596-1-richard.henderson@linaro.org> References: <20220501055028.646596-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1030; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1030.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: , Cc: qemu-arm@nongnu.org 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. Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell --- 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 e24e0749ac..228472506d 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) @@ -8230,15 +8217,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