From patchwork Wed Oct 23 15:00:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 177302 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp877572ill; Wed, 23 Oct 2019 08:24:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqwdKulJd8AtNkI3aS3rTqTtmcN5qKCfIh6GqrChn5pGdJ1AQw1r+zuKqKfyqO1mfxtbYnrO X-Received: by 2002:aa7:cd68:: with SMTP id ca8mr15621053edb.58.1571844258036; Wed, 23 Oct 2019 08:24:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571844258; cv=none; d=google.com; s=arc-20160816; b=YAlNcmRR5HLGEExvDXSGG+zHp4sVbp9mNg7oi6aeEsOUurhkJ+xhHFlP7jUCWkWkHd NAtWEn2K5QUj7qNuMLuTeCqPhHc9byN+PfPJoooPuXWm9ccK9t/FXRDuriSSnEOzBBcE EnkrM4LB0QbTa+3SsNbRfpxj2P4HaIKPgVAhhuLyfJL9e7aHCgDAsPo8N8glypbz2poG 5ZzhOt3WjZgVBAEpfagzTzy0OVNoXlUVNmr0otJvotX/e2/MLiMwhqBbimxVIzXC+/Yx YzsKJw1G2oRWdPyveCqBmqYx9rebb6qPAeBoT1W+Jus+0qnEY2zPoQLsk1gx+1iJzrps FNsQ== 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=ksJ29EsO4EC0RqRT/ptTGb/nh233vty3hFHL48/i7gI=; b=CwUVOuYoePTc4r/zY5gUMtqOm+7hgVqmAbqyZyCqQgLk2C7GGNhuoBb2OX1bTKWsk8 Wxhf/A8nBGoP5RtOiU7HK0h6pl2Pqdfumsx8pWyUMMZOFvyrGnyzDE+LYKeLLccxh5ix T6HF6Q9vhhburKJfto9aAC9eqpzaWFGE/SwBUoaeHBeZAM0xwkBocQcz2OwqOJ3StZDP Si/A86RBiiQx6MGLyrBMdlFcnSCtRT6SxgZYiEXcnyoPm5mP0lS7OIFEG0zObdbjLnr2 0Wf6X1M2EDYjebLwVJKihLDzhBA8kD8hFT4VvDnk/6bLaf3Jp52rqFSZJ5GPZjpQOS+h Qv3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=ToQyPTDt; 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=fail (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 y22si1722954eju.150.2019.10.23.08.24.17 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 23 Oct 2019 08:24:17 -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=fail header.i=@linaro.org header.s=google header.b=ToQyPTDt; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:39388 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNIUi-0001ZI-94 for patch@linaro.org; Wed, 23 Oct 2019 11:24:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35240) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNI8u-000899-1W for qemu-devel@nongnu.org; Wed, 23 Oct 2019 11:01:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNI8r-0001FQ-By for qemu-devel@nongnu.org; Wed, 23 Oct 2019 11:01:43 -0400 Received: from mail-qt1-x844.google.com ([2607:f8b0:4864:20::844]:33722) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iNI8r-00018U-3l for qemu-devel@nongnu.org; Wed, 23 Oct 2019 11:01:41 -0400 Received: by mail-qt1-x844.google.com with SMTP id r5so32789254qtd.0 for ; Wed, 23 Oct 2019 08:01:25 -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=ksJ29EsO4EC0RqRT/ptTGb/nh233vty3hFHL48/i7gI=; b=ToQyPTDtGgKWs253kz1CECPIV+6/w1Axc2rqud0q/XD45AKLnTK3jL26xz1ef0xRP8 KwEpp57ALlTCzWKaaQPEvvSk3E8uxlVb2Ez52IJxC2+ijQT+o0pQEq0qjvzTNavYI8b5 +y/UNhxiiO8xVwUQdL70UKQ5loEDksmc10WwKT0lfBmO4vYb4j4aqrkHMKbAP64oateO S+7h2AbDRg4s88Xro5zkyh7JjitiGd637Lloe6pUMAzbK3Dg1ictt+mP9n8UEw0JntxN iitFcX8P1GOXE4vtNMR00cqbxIhPMlQTR4nIODejXzIRjnMOY6uSa4ijkbf0ed9C8+By KuXg== 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=ksJ29EsO4EC0RqRT/ptTGb/nh233vty3hFHL48/i7gI=; b=BK0Kjs+NoCs6MLr7eUTVp/PqipfTTTEfKzELaZHRYDNcgajBSEtgqCcQ2h9OeqNScI lhsIphpTLCefLV8o1K95SjAada9TsNB2vd4SPQX4vY3DKY2hEP7zP4amTUAThKSaUI9K SvSLLMrLTuwfgWzK40AW5SmWQT3dZ0WnhDYiPSn95lzLw42VRVDivzB1UkPyoH5aFbMT gnVMjqUIRgddRmgPRYHoZOosi6BsOVbAiewe4MfavkR0FEHlm9yjWh14NHr6zMfOfsUp OH6s2nRRrczhBrrN5bqBLRPTBI3qxUKj1OVBk31Y7plIIeCdfwZPPXJi7O0fgRfkVdt8 sMAw== X-Gm-Message-State: APjAAAVZn+1384z7LVkdVspYVsOc/DVxCBWchyP2emH5T3dXFaAuQ6zL gg8oNckh+kJmiXtg4kVF2f1dK5hqSaw= X-Received: by 2002:ac8:1604:: with SMTP id p4mr9899981qtj.276.1571842883078; Wed, 23 Oct 2019 08:01:23 -0700 (PDT) Received: from localhost.localdomain (198-4-20-64.static.cosmoweb.net. [64.20.4.198]) by smtp.gmail.com with ESMTPSA id l189sm11030168qke.69.2019.10.23.08.01.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Oct 2019 08:01:21 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v9 15/24] target/arm: Add HELPER(rebuild_hflags_{a32, a64, m32}) Date: Wed, 23 Oct 2019 11:00:48 -0400 Message-Id: <20191023150057.25731-16-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191023150057.25731-1-richard.henderson@linaro.org> References: <20191023150057.25731-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::844 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, qemu-arm@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This functions are given the mode and el state of the cpu and writes the computed value to env->hflags. Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson --- target/arm/helper.h | 4 ++++ target/arm/helper.c | 24 ++++++++++++++++++++++++ 2 files changed, 28 insertions(+) -- 2.17.1 diff --git a/target/arm/helper.h b/target/arm/helper.h index 1fb2cb5a77..3d4ec267a2 100644 --- a/target/arm/helper.h +++ b/target/arm/helper.h @@ -90,6 +90,10 @@ DEF_HELPER_4(msr_banked, void, env, i32, i32, i32) DEF_HELPER_2(get_user_reg, i32, env, i32) DEF_HELPER_3(set_user_reg, void, env, i32, i32) +DEF_HELPER_FLAGS_2(rebuild_hflags_m32, TCG_CALL_NO_RWG, void, env, int) +DEF_HELPER_FLAGS_2(rebuild_hflags_a32, TCG_CALL_NO_RWG, void, env, int) +DEF_HELPER_FLAGS_2(rebuild_hflags_a64, TCG_CALL_NO_RWG, void, env, int) + DEF_HELPER_1(vfp_get_fpscr, i32, env) DEF_HELPER_2(vfp_set_fpscr, void, env, i32) diff --git a/target/arm/helper.c b/target/arm/helper.c index 37424e3d4d..b2d701cf00 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -11220,6 +11220,30 @@ void arm_rebuild_hflags(CPUARMState *env) env->hflags = rebuild_hflags_internal(env); } +void HELPER(rebuild_hflags_m32)(CPUARMState *env, int el) +{ + int fp_el = fp_exception_el(env, el); + ARMMMUIdx mmu_idx = arm_mmu_idx_el(env, el); + + env->hflags = rebuild_hflags_m32(env, fp_el, mmu_idx); +} + +void HELPER(rebuild_hflags_a32)(CPUARMState *env, int el) +{ + int fp_el = fp_exception_el(env, el); + ARMMMUIdx mmu_idx = arm_mmu_idx_el(env, el); + + env->hflags = rebuild_hflags_a32(env, fp_el, mmu_idx); +} + +void HELPER(rebuild_hflags_a64)(CPUARMState *env, int el) +{ + int fp_el = fp_exception_el(env, el); + ARMMMUIdx mmu_idx = arm_mmu_idx_el(env, el); + + env->hflags = rebuild_hflags_a64(env, el, fp_el, mmu_idx); +} + void cpu_get_tb_cpu_state(CPUARMState *env, target_ulong *pc, target_ulong *cs_base, uint32_t *pflags) {