From patchwork Mon Feb 24 22:22:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 183781 Delivered-To: patch@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp921341ile; Mon, 24 Feb 2020 14:23:04 -0800 (PST) X-Google-Smtp-Source: APXvYqw9Z3jPXWOaHg82Y0Wet7NUsgm4YM63TtT8Lyy9dLEqaY4hD6HDRnunP06GdGCSutLXiZYB X-Received: by 2002:ad4:5051:: with SMTP id m17mr15722422qvq.53.1582582984213; Mon, 24 Feb 2020 14:23:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582582984; cv=none; d=google.com; s=arc-20160816; b=g4TfuofCpvqWgy6GiGXkBG53fsrUDtKqmUgkKbFiaS1oFhcKegYjWseSVgsd+w3KvM GMpmGG5Z+iGnS15tM+pVp8O0Au0r5GDaWnlpkGWw+0rNVSQsRyYGvuAixOzyGkMT1+De iUlknTOvvotZLGBx1IzjTTyNbfPnT6GvMMmjuf6cLoksfCILK93EnBTftPxcuV9JsOVZ qgBQ9dw0HhDbJXRGlZT9hq/741e4yxyAb8J6K2LjFS8K80vxJkSKMOpHvsCVjOz5pcIM o2hv306Hq5hDRxcu3n/oyTCT+mOQUzFdk38SxhBaFJDCmukeHPqBm/v0J9wHFc9TuZPT KNew== 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=Sk0MOHyrllS0IcT8aMOfzN1UEtehTWfA11kplAVqlII=; b=S8byKonSKTu4pbsOzv+PWBWjZF7D0CPHDMn3fRIVJLmMDV+/BDqJw7YjdDQP7PERHQ DwCVzByHHCtosZ1IGCz1hV8+F7dRX5Geg9994mVqA1PHs9brcZuavddjHuwrdyqGujfH 5+E3+fxXoLqI+wb5EPWAuKhVDaC8UYmqIzhR5Mx050nUpZ7Er9jxHcVwPdXr8FhDRlUE qhwZ0sZmh9uxMvyAvI8145ZruEOnhxzkZ6eg2Bxt9Utiw4IsZu5zePggYrxxgeeyOUhY SIBxn7Px6AziEkHsjLfi1Am5V8wVOLaSa8ewp1bM0a8KArOAH62JqBID8sOmFwxq05QI N+eA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=uxlYRhCS; 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 q17si6595682qtn.40.2020.02.24.14.23.04 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 24 Feb 2020 14:23:04 -0800 (PST) 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=uxlYRhCS; 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]:45084 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j6M7z-0004WY-Kd for patch@linaro.org; Mon, 24 Feb 2020 17:23:03 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:37692) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j6M7b-00041V-MT for qemu-devel@nongnu.org; Mon, 24 Feb 2020 17:22:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j6M7Z-0005jh-Ig for qemu-devel@nongnu.org; Mon, 24 Feb 2020 17:22:39 -0500 Received: from mail-pg1-x542.google.com ([2607:f8b0:4864:20::542]:41730) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j6M7Z-0005jA-B8 for qemu-devel@nongnu.org; Mon, 24 Feb 2020 17:22:37 -0500 Received: by mail-pg1-x542.google.com with SMTP id 70so5836435pgf.8 for ; Mon, 24 Feb 2020 14:22:37 -0800 (PST) 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=Sk0MOHyrllS0IcT8aMOfzN1UEtehTWfA11kplAVqlII=; b=uxlYRhCSH4fS8zWfj8VjQDzE3g3bBU/eoB0Vtq5JAmM3GnyuIpRxWGbviTEvhBPt5z 7bQ9XP4JsMhy7wq9Juq87Fvo+9dlonqBwvfy/UDnqmokfRaYnKyn9BJ5ArIYd5sT9Lni P+aFXA840NgV3/nsAJOAvPPpD8tkJZ3erQMGM7pBgQrSFA7mvbuxkgqvhziviYdCzIaQ T349Rsuc0vg/tuJT69bl2YlTR4pBk63TbMi+NMXWChKK99SLUIGJjcs+eAGSTOUQ1RZ8 F6U/D4plCkjczUamaNFnp9/UW5ItQlvBfBbg2+/wqtVX6uyPzeNMw049L0krORY2v+Xx UlWQ== 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=Sk0MOHyrllS0IcT8aMOfzN1UEtehTWfA11kplAVqlII=; b=NSaetnvaTX5zf7HXQm1AndGjvDTdTrnUxFHXhxcmcNEXeBJjjm1hIcZgyI3IHvqRIH Vm1pzbcVKRi/YsVQkYfWGHcCmx0p/vQ3NEH2TX+TFcI3ndy6Imy7X0Jc2YcKYikeyFdC mgz6kuHgMT0Re5l/dQsJvK3te5/7vFaSfFyt8511J874kjnLjhTa4rtxyY2kzLJYLiSg VeDE1OOO+UlYRlmZxU2qttFAdJwP5Ywg5paV/UvHr7pakJfXyuYvB7PcRMxBOGg4mfoh O8SZBbNzrUaSfLjSlf09T/QaXv8Ldccyf4aZAPX79HkwUmr2rBH4ybYJSlCnq1F9XDZ/ Mwaw== X-Gm-Message-State: APjAAAVASnRE3rSf0gcC0eVYLf2ZD4otLT9GjfpqtR7HQGKJdevr6+N4 Nf/LYQZrpVmCU0VeCwrlXLovpDUkL3k= X-Received: by 2002:a62:f94d:: with SMTP id g13mr53023785pfm.60.1582582955690; Mon, 24 Feb 2020 14:22:35 -0800 (PST) Received: from localhost.localdomain (97-126-123-70.tukw.qwest.net. [97.126.123.70]) by smtp.gmail.com with ESMTPSA id o6sm13897097pgg.37.2020.02.24.14.22.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Feb 2020 14:22:35 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 01/17] target/arm: Add isar_feature_aa32_vfp_simd Date: Mon, 24 Feb 2020 14:22:16 -0800 Message-Id: <20200224222232.13807-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200224222232.13807-1-richard.henderson@linaro.org> References: <20200224222232.13807-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::542 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" Use this in the places that were checking ARM_FEATURE_VFP, and are obviously testing for the existance of the register set as opposed to testing for some particular instruction extension. Signed-off-by: Richard Henderson --- target/arm/cpu.h | 9 +++++++++ hw/intc/armv7m_nvic.c | 20 ++++++++++---------- linux-user/arm/signal.c | 4 ++-- target/arm/arch_dump.c | 11 ++++++----- target/arm/cpu.c | 4 ++-- target/arm/helper.c | 4 ++-- target/arm/m_helper.c | 11 ++++++----- 7 files changed, 37 insertions(+), 26 deletions(-) -- 2.20.1 Reviewed-by: Peter Maydell diff --git a/target/arm/cpu.h b/target/arm/cpu.h index 65171cb30e..a128d48d40 100644 --- a/target/arm/cpu.h +++ b/target/arm/cpu.h @@ -3450,6 +3450,15 @@ static inline bool isar_feature_aa32_fp16_arith(const ARMISARegisters *id) return FIELD_EX64(id->id_aa64pfr0, ID_AA64PFR0, FP) == 1; } +static inline bool isar_feature_aa32_vfp_simd(const ARMISARegisters *id) +{ + /* + * Return true if either VFP or SIMD is implemented. + * In this case, a minimum of VFP w/ D0-D15. + */ + return FIELD_EX32(id->mvfr0, MVFR0, SIMDREG) > 0; +} + static inline bool isar_feature_aa32_simd_r32(const ARMISARegisters *id) { /* Return true if D16-D31 are implemented */ diff --git a/hw/intc/armv7m_nvic.c b/hw/intc/armv7m_nvic.c index 22a43e4984..a62587eb3f 100644 --- a/hw/intc/armv7m_nvic.c +++ b/hw/intc/armv7m_nvic.c @@ -1262,12 +1262,12 @@ static uint32_t nvic_readl(NVICState *s, uint32_t offset, MemTxAttrs attrs) case 0xd84: /* CSSELR */ return cpu->env.v7m.csselr[attrs.secure]; case 0xd88: /* CPACR */ - if (!arm_feature(&cpu->env, ARM_FEATURE_VFP)) { + if (!cpu_isar_feature(aa32_vfp_simd, cpu)) { return 0; } return cpu->env.v7m.cpacr[attrs.secure]; case 0xd8c: /* NSACR */ - if (!attrs.secure || !arm_feature(&cpu->env, ARM_FEATURE_VFP)) { + if (!attrs.secure || !cpu_isar_feature(aa32_vfp_simd, cpu)) { return 0; } return cpu->env.v7m.nsacr; @@ -1417,7 +1417,7 @@ static uint32_t nvic_readl(NVICState *s, uint32_t offset, MemTxAttrs attrs) } return cpu->env.v7m.sfar; case 0xf34: /* FPCCR */ - if (!arm_feature(&cpu->env, ARM_FEATURE_VFP)) { + if (!cpu_isar_feature(aa32_vfp_simd, cpu)) { return 0; } if (attrs.secure) { @@ -1444,12 +1444,12 @@ static uint32_t nvic_readl(NVICState *s, uint32_t offset, MemTxAttrs attrs) return value; } case 0xf38: /* FPCAR */ - if (!arm_feature(&cpu->env, ARM_FEATURE_VFP)) { + if (!cpu_isar_feature(aa32_vfp_simd, cpu)) { return 0; } return cpu->env.v7m.fpcar[attrs.secure]; case 0xf3c: /* FPDSCR */ - if (!arm_feature(&cpu->env, ARM_FEATURE_VFP)) { + if (!cpu_isar_feature(aa32_vfp_simd, cpu)) { return 0; } return cpu->env.v7m.fpdscr[attrs.secure]; @@ -1711,13 +1711,13 @@ static void nvic_writel(NVICState *s, uint32_t offset, uint32_t value, } break; case 0xd88: /* CPACR */ - if (arm_feature(&cpu->env, ARM_FEATURE_VFP)) { + if (cpu_isar_feature(aa32_vfp_simd, cpu)) { /* We implement only the Floating Point extension's CP10/CP11 */ cpu->env.v7m.cpacr[attrs.secure] = value & (0xf << 20); } break; case 0xd8c: /* NSACR */ - if (attrs.secure && arm_feature(&cpu->env, ARM_FEATURE_VFP)) { + if (attrs.secure && cpu_isar_feature(aa32_vfp_simd, cpu)) { /* We implement only the Floating Point extension's CP10/CP11 */ cpu->env.v7m.nsacr = value & (3 << 10); } @@ -1951,7 +1951,7 @@ static void nvic_writel(NVICState *s, uint32_t offset, uint32_t value, break; } case 0xf34: /* FPCCR */ - if (arm_feature(&cpu->env, ARM_FEATURE_VFP)) { + if (cpu_isar_feature(aa32_vfp_simd, cpu)) { /* Not all bits here are banked. */ uint32_t fpccr_s; @@ -2005,13 +2005,13 @@ static void nvic_writel(NVICState *s, uint32_t offset, uint32_t value, } break; case 0xf38: /* FPCAR */ - if (arm_feature(&cpu->env, ARM_FEATURE_VFP)) { + if (cpu_isar_feature(aa32_vfp_simd, cpu)) { value &= ~7; cpu->env.v7m.fpcar[attrs.secure] = value; } break; case 0xf3c: /* FPDSCR */ - if (arm_feature(&cpu->env, ARM_FEATURE_VFP)) { + if (cpu_isar_feature(aa32_vfp_simd, cpu)) { value &= 0x07c00000; cpu->env.v7m.fpdscr[attrs.secure] = value; } diff --git a/linux-user/arm/signal.c b/linux-user/arm/signal.c index b0e753801b..d96fc27ce1 100644 --- a/linux-user/arm/signal.c +++ b/linux-user/arm/signal.c @@ -346,7 +346,7 @@ static void setup_sigframe_v2(struct target_ucontext_v2 *uc, setup_sigcontext(&uc->tuc_mcontext, env, set->sig[0]); /* Save coprocessor signal frame. */ regspace = uc->tuc_regspace; - if (arm_feature(env, ARM_FEATURE_VFP)) { + if (cpu_isar_feature(aa32_vfp_simd, env_archcpu(env))) { regspace = setup_sigframe_v2_vfp(regspace, env); } if (arm_feature(env, ARM_FEATURE_IWMMXT)) { @@ -671,7 +671,7 @@ static int do_sigframe_return_v2(CPUARMState *env, /* Restore coprocessor signal frame */ regspace = uc->tuc_regspace; - if (arm_feature(env, ARM_FEATURE_VFP)) { + if (cpu_isar_feature(aa32_vfp_simd, env_archcpu(env))) { regspace = restore_sigframe_v2_vfp(env, regspace); if (!regspace) { return 1; diff --git a/target/arm/arch_dump.c b/target/arm/arch_dump.c index 2345dec3c2..7693e17e96 100644 --- a/target/arm/arch_dump.c +++ b/target/arm/arch_dump.c @@ -363,9 +363,11 @@ int arm_cpu_write_elf32_note(WriteCoreDumpFunction f, CPUState *cs, int cpuid, void *opaque) { struct arm_note note; - CPUARMState *env = &ARM_CPU(cs)->env; + ARMCPU *cpu = ARM_CPU(cs); + CPUARMState *env = &cpu->env; DumpState *s = opaque; - int ret, i, fpvalid = !!arm_feature(env, ARM_FEATURE_VFP); + int ret, i; + bool fpvalid = cpu_isar_feature(aa32_vfp_simd, cpu); arm_note_init(¬e, s, "CORE", 5, NT_PRSTATUS, sizeof(note.prstatus)); @@ -444,7 +446,6 @@ int cpu_get_dump_info(ArchDumpInfo *info, ssize_t cpu_get_note_size(int class, int machine, int nr_cpus) { ARMCPU *cpu = ARM_CPU(first_cpu); - CPUARMState *env = &cpu->env; size_t note_size; if (class == ELFCLASS64) { @@ -452,12 +453,12 @@ ssize_t cpu_get_note_size(int class, int machine, int nr_cpus) note_size += AARCH64_PRFPREG_NOTE_SIZE; #ifdef TARGET_AARCH64 if (cpu_isar_feature(aa64_sve, cpu)) { - note_size += AARCH64_SVE_NOTE_SIZE(env); + note_size += AARCH64_SVE_NOTE_SIZE(&cpu->env); } #endif } else { note_size = ARM_PRSTATUS_NOTE_SIZE; - if (arm_feature(env, ARM_FEATURE_VFP)) { + if (cpu_isar_feature(aa32_vfp_simd, cpu)) { note_size += ARM_VFP_NOTE_SIZE; } } diff --git a/target/arm/cpu.c b/target/arm/cpu.c index 2eadf4dcb8..be4c2a1253 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -293,7 +293,7 @@ static void arm_cpu_reset(CPUState *s) env->v7m.ccr[M_REG_S] |= R_V7M_CCR_UNALIGN_TRP_MASK; } - if (arm_feature(env, ARM_FEATURE_VFP)) { + if (cpu_isar_feature(aa32_vfp_simd, cpu)) { env->v7m.fpccr[M_REG_NS] = R_V7M_FPCCR_ASPEN_MASK; env->v7m.fpccr[M_REG_S] = R_V7M_FPCCR_ASPEN_MASK | R_V7M_FPCCR_LSPEN_MASK | R_V7M_FPCCR_S_MASK; @@ -1011,7 +1011,7 @@ static void arm_cpu_dump_state(CPUState *cs, FILE *f, int flags) int numvfpregs = 0; if (cpu_isar_feature(aa32_simd_r32, cpu)) { numvfpregs = 32; - } else if (arm_feature(env, ARM_FEATURE_VFP)) { + } else if (cpu_isar_feature(aa32_vfp_simd, cpu)) { numvfpregs = 16; } for (i = 0; i < numvfpregs; i++) { diff --git a/target/arm/helper.c b/target/arm/helper.c index 79db169e04..8841cc7fde 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -894,7 +894,7 @@ static void cpacr_write(CPUARMState *env, const ARMCPRegInfo *ri, * ASEDIS [31] and D32DIS [30] are both UNK/SBZP without VFP. * TRCDIS [28] is RAZ/WI since we do not implement a trace macrocell. */ - if (arm_feature(env, ARM_FEATURE_VFP)) { + if (cpu_isar_feature(aa32_vfp_simd, env_archcpu(env))) { /* VFP coprocessor: cp10 & cp11 [23:20] */ mask |= (1 << 31) | (1 << 30) | (0xf << 20); @@ -7814,7 +7814,7 @@ void arm_cpu_register_gdb_regs_for_features(ARMCPU *cpu) } else if (cpu_isar_feature(aa32_simd_r32, cpu)) { gdb_register_coprocessor(cs, vfp_gdb_get_reg, vfp_gdb_set_reg, 35, "arm-vfp3.xml", 0); - } else if (arm_feature(env, ARM_FEATURE_VFP)) { + } else if (cpu_isar_feature(aa32_vfp_simd, cpu)) { gdb_register_coprocessor(cs, vfp_gdb_get_reg, vfp_gdb_set_reg, 19, "arm-vfp.xml", 0); } diff --git a/target/arm/m_helper.c b/target/arm/m_helper.c index 33d414a684..5e8a795d20 100644 --- a/target/arm/m_helper.c +++ b/target/arm/m_helper.c @@ -738,7 +738,8 @@ static uint32_t v7m_integrity_sig(CPUARMState *env, uint32_t lr) */ uint32_t sig = 0xfefa125a; - if (!arm_feature(env, ARM_FEATURE_VFP) || (lr & R_V7M_EXCRET_FTYPE_MASK)) { + if (!cpu_isar_feature(aa32_vfp_simd, env_archcpu(env)) + || (lr & R_V7M_EXCRET_FTYPE_MASK)) { sig |= 1; } return sig; @@ -841,7 +842,7 @@ static void v7m_exception_taken(ARMCPU *cpu, uint32_t lr, bool dotailchain, if (dotailchain) { /* Sanitize LR FType and PREFIX bits */ - if (!arm_feature(env, ARM_FEATURE_VFP)) { + if (!cpu_isar_feature(aa32_vfp_simd, cpu)) { lr |= R_V7M_EXCRET_FTYPE_MASK; } lr = deposit32(lr, 24, 8, 0xff); @@ -1373,7 +1374,7 @@ static void do_v7m_exception_exit(ARMCPU *cpu) ftype = excret & R_V7M_EXCRET_FTYPE_MASK; - if (!arm_feature(env, ARM_FEATURE_VFP) && !ftype) { + if (!ftype && !cpu_isar_feature(aa32_vfp_simd, cpu)) { qemu_log_mask(LOG_GUEST_ERROR, "M profile: zero FTYPE in exception " "exit PC value 0x%" PRIx32 " is UNPREDICTABLE " "if FPU not present\n", @@ -2450,7 +2451,7 @@ void HELPER(v7m_msr)(CPUARMState *env, uint32_t maskreg, uint32_t val) * SFPA is RAZ/WI from NS. FPCA is RO if NSACR.CP10 == 0, * RES0 if the FPU is not present, and is stored in the S bank */ - if (arm_feature(env, ARM_FEATURE_VFP) && + if (cpu_isar_feature(aa32_vfp_simd, env_archcpu(env)) && extract32(env->v7m.nsacr, 10, 1)) { env->v7m.control[M_REG_S] &= ~R_V7M_CONTROL_FPCA_MASK; env->v7m.control[M_REG_S] |= val & R_V7M_CONTROL_FPCA_MASK; @@ -2565,7 +2566,7 @@ void HELPER(v7m_msr)(CPUARMState *env, uint32_t maskreg, uint32_t val) env->v7m.control[env->v7m.secure] &= ~R_V7M_CONTROL_NPRIV_MASK; env->v7m.control[env->v7m.secure] |= val & R_V7M_CONTROL_NPRIV_MASK; } - if (arm_feature(env, ARM_FEATURE_VFP)) { + if (cpu_isar_feature(aa32_vfp_simd, env_archcpu(env))) { /* * SFPA is RAZ/WI from NS or if no FPU. * FPCA is RO if NSACR.CP10 == 0, RES0 if the FPU is not present. From patchwork Mon Feb 24 22:22:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 183780 Delivered-To: patch@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp921183ile; Mon, 24 Feb 2020 14:22:54 -0800 (PST) X-Google-Smtp-Source: APXvYqyrUOvZDWQPPO02qyR7JHyDEWhaTo5dLBELXXPtx3qG6YxUQ8cQ1xlugil7jqjS78cnyCZN X-Received: by 2002:aed:3786:: with SMTP id j6mr52109241qtb.62.1582582974501; Mon, 24 Feb 2020 14:22:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582582974; cv=none; d=google.com; s=arc-20160816; b=a6ChIcQdF8PA06vPjaIJS6XE4fjamXiBPAEgmDihgvKa0nmC41O0TZG/+Ql2Yk0Faf zpqPr/6JuYzs+9PHXAQMK4p+zzs+yfz2PAwaAzsPtu/uhVOeziUuvWcsPDhe9Ea/AptC PG6wR4z3Nq/0NrXtOvvM2sSv71oUZ15sFOfiyojAvgzy8fpKLufqXHm1i6shAIUSsLZn xQJvZy1A2zEYJYZb4ARH9sjgsL/DIOTnUCP8k9HJ9MQQXr/kuM4VMJrwQ0gslgub0kqT FQ4pGxCyTwaIk7zvRTjVo7UJ9atolyib1OoIsmxwVF+dqCwvTlzhbVhn5UZsNSUlpGWl ADGw== 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=8VBDdJ2XXe8vgr+0Pu3Ei4ErsKpoLGqHBt+iFGkJN3g=; b=K7g6MRyIrD8XADASP1ZSBZAxbAAlyyolKj+594RAOfRwTCeD5g09pOnNtyzZdmZKPs /p7XvHie2oXRaX8zRvIGfWI9SN3lbzUhy6nWiljwn+SAQjURpgfYxh1JUoqAD/j9u9CB RUPmWNu6WpY0YL1/9Qvg/zo8yPVxMJPuYLtUSYr/nmABn+XhVP2sQY3hIXagnhn1mIc/ 4c1h4auoIeo+/t12Q/MGRCgXcTJkW6V1UeEPvTKKGqytlnayXM1URST+QfqMgDWTWzEj 2Iab4zS3ZJ4RXmhvLRVbszVk2QB+4bXd7CBx3vNImb6qay4S8GsLvYkQk6n7y4Lj/AYH 4fDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=w4z1kwQP; 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 z185si1285795qkb.269.2020.02.24.14.22.54 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 24 Feb 2020 14:22:54 -0800 (PST) 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=w4z1kwQP; 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]:44994 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j6M7p-00046t-Uz for patch@linaro.org; Mon, 24 Feb 2020 17:22:53 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:37700) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j6M7c-00042V-8p for qemu-devel@nongnu.org; Mon, 24 Feb 2020 17:22:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j6M7a-0005ka-Kx for qemu-devel@nongnu.org; Mon, 24 Feb 2020 17:22:40 -0500 Received: from mail-pf1-x444.google.com ([2607:f8b0:4864:20::444]:41222) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j6M7a-0005k1-F3 for qemu-devel@nongnu.org; Mon, 24 Feb 2020 17:22:38 -0500 Received: by mail-pf1-x444.google.com with SMTP id j9so6066832pfa.8 for ; Mon, 24 Feb 2020 14:22:38 -0800 (PST) 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=8VBDdJ2XXe8vgr+0Pu3Ei4ErsKpoLGqHBt+iFGkJN3g=; b=w4z1kwQPk/JnG8w6+Gzb05842L5NXu3+w8WpW7vUfNqbqCMHrdqbpeYCQcgMnHQSJL w/eeRExZx6WeEVRuZUOMNoy2nBfCkUbBkGSyUOlC2RU9EvebswVAAQJVFXESkXgl9jfp LhVZs8CDzaQsjN/Wsy00R9Mg5uWmsSstW3lgPWAkjG6aL97/KG+caAXy1Wgh8ghLjjOD NcKRIiddA5BmQxl7Qjg4Lr3sl0pEbFhGFFvNn+8t0tOUV7G2qu1P8uzs33Pm9sWwp7rl cOu58Qv+gdNwnx6DkWFcYrJaPgZTqM9LBfr8rjd39+dykYGt02PEjR3RjykOTVsOn/WB coaA== 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=8VBDdJ2XXe8vgr+0Pu3Ei4ErsKpoLGqHBt+iFGkJN3g=; b=Q91KNZNP7PgZi3K5MjgNIE9M4UU1IsuA7BdxevVHrgwX6cgL+Tr8s1FRUsmCaFdJJA kVXSCUuHdCJqkKxfWVzJIJiBLNpZKU9ptWwiaEeVVhmLumqnvr2wy34Q6y8BYYzAV7nj +iEW+WSHb+AGg/nr8QnZ6YiRCJZRRahD+O6u6fiAsY6FtfDn8CDn35Ceq8IA0TYkXx2p 2nzTBdZO+qHVlzE74ki8VxcFg2CIMe4Z1dMcm/HIXRQRfrWWntaBu+T7q1oyDCTeQMHr Mdqc4mGxcIP2Em9GrSjZUIeYu+tiJXdkC8R+5DL72HK0CL9MN4RF1ZK3uITZN8oY6Ldp 8PxQ== X-Gm-Message-State: APjAAAVd3dIux1Qf75H4GWybHO/4lvptCT/JTYDfXUKPt/nNcO8iXQWD J1UFYhoQ+H60sg8YPG8gCz08XbjdpQo= X-Received: by 2002:a63:48f:: with SMTP id 137mr8382543pge.245.1582582957128; Mon, 24 Feb 2020 14:22:37 -0800 (PST) Received: from localhost.localdomain (97-126-123-70.tukw.qwest.net. [97.126.123.70]) by smtp.gmail.com with ESMTPSA id o6sm13897097pgg.37.2020.02.24.14.22.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Feb 2020 14:22:36 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 02/17] target/arm: Rename isar_feature_aa32_fpdp_v2 Date: Mon, 24 Feb 2020 14:22:17 -0800 Message-Id: <20200224222232.13807-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200224222232.13807-1-richard.henderson@linaro.org> References: <20200224222232.13807-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::444 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, =?utf-8?q?Philippe_Math?= =?utf-8?q?ieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" The old name, isar_feature_aa32_fpdp, does not reflect that the test includes VFPv2. We will introduce another feature tests for VFPv3. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/arm/cpu.h | 4 ++-- target/arm/translate-vfp.inc.c | 40 +++++++++++++++++----------------- 2 files changed, 22 insertions(+), 22 deletions(-) -- 2.20.1 diff --git a/target/arm/cpu.h b/target/arm/cpu.h index a128d48d40..1e6eac0cd2 100644 --- a/target/arm/cpu.h +++ b/target/arm/cpu.h @@ -3470,9 +3470,9 @@ static inline bool isar_feature_aa32_fpshvec(const ARMISARegisters *id) return FIELD_EX32(id->mvfr0, MVFR0, FPSHVEC) > 0; } -static inline bool isar_feature_aa32_fpdp(const ARMISARegisters *id) +static inline bool isar_feature_aa32_fpdp_v2(const ARMISARegisters *id) { - /* Return true if CPU supports double precision floating point */ + /* Return true if CPU supports double precision floating point, VFPv2 */ return FIELD_EX32(id->mvfr0, MVFR0, FPDP) > 0; } diff --git a/target/arm/translate-vfp.inc.c b/target/arm/translate-vfp.inc.c index ba46e2557a..e94876c30c 100644 --- a/target/arm/translate-vfp.inc.c +++ b/target/arm/translate-vfp.inc.c @@ -206,7 +206,7 @@ static bool trans_VSEL(DisasContext *s, arg_VSEL *a) return false; } - if (dp && !dc_isar_feature(aa32_fpdp, s)) { + if (dp && !dc_isar_feature(aa32_fpdp_v2, s)) { return false; } @@ -339,7 +339,7 @@ static bool trans_VMINMAXNM(DisasContext *s, arg_VMINMAXNM *a) return false; } - if (dp && !dc_isar_feature(aa32_fpdp, s)) { + if (dp && !dc_isar_feature(aa32_fpdp_v2, s)) { return false; } @@ -425,7 +425,7 @@ static bool trans_VRINT(DisasContext *s, arg_VRINT *a) return false; } - if (dp && !dc_isar_feature(aa32_fpdp, s)) { + if (dp && !dc_isar_feature(aa32_fpdp_v2, s)) { return false; } @@ -488,7 +488,7 @@ static bool trans_VCVT(DisasContext *s, arg_VCVT *a) return false; } - if (dp && !dc_isar_feature(aa32_fpdp, s)) { + if (dp && !dc_isar_feature(aa32_fpdp_v2, s)) { return false; } @@ -1313,7 +1313,7 @@ static bool do_vfp_3op_dp(DisasContext *s, VFPGen3OpDPFn *fn, return false; } - if (!dc_isar_feature(aa32_fpdp, s)) { + if (!dc_isar_feature(aa32_fpdp_v2, s)) { return false; } @@ -1462,7 +1462,7 @@ static bool do_vfp_2op_dp(DisasContext *s, VFPGen2OpDPFn *fn, int vd, int vm) return false; } - if (!dc_isar_feature(aa32_fpdp, s)) { + if (!dc_isar_feature(aa32_fpdp_v2, s)) { return false; } @@ -1827,7 +1827,7 @@ static bool trans_VFM_dp(DisasContext *s, arg_VFM_dp *a) return false; } - if (!dc_isar_feature(aa32_fpdp, s)) { + if (!dc_isar_feature(aa32_fpdp_v2, s)) { return false; } @@ -1926,7 +1926,7 @@ static bool trans_VMOV_imm_dp(DisasContext *s, arg_VMOV_imm_dp *a) return false; } - if (!dc_isar_feature(aa32_fpdp, s)) { + if (!dc_isar_feature(aa32_fpdp_v2, s)) { return false; } @@ -2070,7 +2070,7 @@ static bool trans_VCMP_dp(DisasContext *s, arg_VCMP_dp *a) return false; } - if (!dc_isar_feature(aa32_fpdp, s)) { + if (!dc_isar_feature(aa32_fpdp_v2, s)) { return false; } @@ -2143,7 +2143,7 @@ static bool trans_VCVT_f64_f16(DisasContext *s, arg_VCVT_f64_f16 *a) return false; } - if (!dc_isar_feature(aa32_fpdp, s)) { + if (!dc_isar_feature(aa32_fpdp_v2, s)) { return false; } @@ -2209,7 +2209,7 @@ static bool trans_VCVT_f16_f64(DisasContext *s, arg_VCVT_f16_f64 *a) return false; } - if (!dc_isar_feature(aa32_fpdp, s)) { + if (!dc_isar_feature(aa32_fpdp_v2, s)) { return false; } @@ -2269,7 +2269,7 @@ static bool trans_VRINTR_dp(DisasContext *s, arg_VRINTR_dp *a) return false; } - if (!dc_isar_feature(aa32_fpdp, s)) { + if (!dc_isar_feature(aa32_fpdp_v2, s)) { return false; } @@ -2330,7 +2330,7 @@ static bool trans_VRINTZ_dp(DisasContext *s, arg_VRINTZ_dp *a) return false; } - if (!dc_isar_feature(aa32_fpdp, s)) { + if (!dc_isar_feature(aa32_fpdp_v2, s)) { return false; } @@ -2389,7 +2389,7 @@ static bool trans_VRINTX_dp(DisasContext *s, arg_VRINTX_dp *a) return false; } - if (!dc_isar_feature(aa32_fpdp, s)) { + if (!dc_isar_feature(aa32_fpdp_v2, s)) { return false; } @@ -2417,7 +2417,7 @@ static bool trans_VCVT_sp(DisasContext *s, arg_VCVT_sp *a) return false; } - if (!dc_isar_feature(aa32_fpdp, s)) { + if (!dc_isar_feature(aa32_fpdp_v2, s)) { return false; } @@ -2445,7 +2445,7 @@ static bool trans_VCVT_dp(DisasContext *s, arg_VCVT_dp *a) return false; } - if (!dc_isar_feature(aa32_fpdp, s)) { + if (!dc_isar_feature(aa32_fpdp_v2, s)) { return false; } @@ -2499,7 +2499,7 @@ static bool trans_VCVT_int_dp(DisasContext *s, arg_VCVT_int_dp *a) return false; } - if (!dc_isar_feature(aa32_fpdp, s)) { + if (!dc_isar_feature(aa32_fpdp_v2, s)) { return false; } @@ -2539,7 +2539,7 @@ static bool trans_VJCVT(DisasContext *s, arg_VJCVT *a) return false; } - if (!dc_isar_feature(aa32_fpdp, s)) { + if (!dc_isar_feature(aa32_fpdp_v2, s)) { return false; } @@ -2632,7 +2632,7 @@ static bool trans_VCVT_fix_dp(DisasContext *s, arg_VCVT_fix_dp *a) return false; } - if (!dc_isar_feature(aa32_fpdp, s)) { + if (!dc_isar_feature(aa32_fpdp_v2, s)) { return false; } @@ -2728,7 +2728,7 @@ static bool trans_VCVT_dp_int(DisasContext *s, arg_VCVT_dp_int *a) return false; } - if (!dc_isar_feature(aa32_fpdp, s)) { + if (!dc_isar_feature(aa32_fpdp_v2, s)) { return false; } From patchwork Mon Feb 24 22:22:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 183792 Delivered-To: patch@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp928587ile; Mon, 24 Feb 2020 14:31:53 -0800 (PST) X-Google-Smtp-Source: APXvYqz2+bWAFxQD5X4htwauD2oX5weNym6iNJfAHlo3BC8ck37dxM6b2yv0+tY1MQGL7XmYKtz6 X-Received: by 2002:ad4:518b:: with SMTP id b11mr48284630qvp.195.1582583513298; Mon, 24 Feb 2020 14:31:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582583513; cv=none; d=google.com; s=arc-20160816; b=jo2sNtnDN7BMNe91zjps69Li+sYQ94b5BOP+dCdN8Lk9eodT5XRFTVve6Y+z+Sf8RE CQgINBI+E1ecpDjIF7Cvg4fEnmMczTLHNeBQ+K8hEahiU6cCrIeN4Mgu1bkvmlfmhC4y ekLM/i5mACM6G2eOD+5gVgUDDLH+fs/5aHl2vK4B04jULINmSlbq+PAYuufBWoplZAXN 9lJ/AGPqYglt3gmulJAHrxz9cZhRpAb0zW4/C8t7AhF2uKGBBCJhOQvZhn2A5NrlW3d0 kk8vGovCMT6MuJKwXwW/xJTE1dMcWTv365f64KM/Moghv6XOBLq4IX6rVS4Oo1zCHXyj PcHw== 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=+KPvmzpCR5seSYv8kHpAw1AZPr6kKDFij7TNxO0T5iM=; b=g5m+GO4rbV7p6fqwfUn1oRbZXiw0q+40m0/XR6tLkKjkw7tGBIIsIE4pj3d2UuGx1f +vHgN4NXgtbVMK0OeImNSJS0PXbu3rnx57E5OPI3mYacTp1O2cRCx0bi9CbEWaH7t0Mt epLpt7a9OwFcIpIsl0PYWONjWB4Kg5ZxO/NUGv3r/lVuBz2yKQ4w79TQsI91gXDuC06a EZvG57+koYYVi1dPzvj0qOmio1W6LznPtZsrRQRtQvjbZQIITMISzlAyOtkvBcm9pXeQ QoiMKP26bPSSJAgR9GbWAxdmVmxJOtBNvzspgtD2g6OeH7JRTfX6+TYurOvFpirL+4Fy GZsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Uqbxg0jS; 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 w23si7419685qka.223.2020.02.24.14.31.53 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 24 Feb 2020 14:31:53 -0800 (PST) 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=Uqbxg0jS; 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]:45448 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j6MGW-0003VI-OT for patch@linaro.org; Mon, 24 Feb 2020 17:31:52 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:37723) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j6M7d-00043h-1z for qemu-devel@nongnu.org; Mon, 24 Feb 2020 17:22:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j6M7b-0005mb-Uw for qemu-devel@nongnu.org; Mon, 24 Feb 2020 17:22:40 -0500 Received: from mail-pf1-x442.google.com ([2607:f8b0:4864:20::442]:45681) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j6M7b-0005kz-Og for qemu-devel@nongnu.org; Mon, 24 Feb 2020 17:22:39 -0500 Received: by mail-pf1-x442.google.com with SMTP id 2so6053155pfg.12 for ; Mon, 24 Feb 2020 14:22:39 -0800 (PST) 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=+KPvmzpCR5seSYv8kHpAw1AZPr6kKDFij7TNxO0T5iM=; b=Uqbxg0jSTQpcnURf4xEmKosWe03wCLnDnGlU62zj/rU1xQnYsUL6vQG0jaC9wVQPXK WtQff6VthTSvakTFz3/W48U2KAmz1ecxTW2YtTKKJcpUBA5mFUF66a+hScksICwFjzFp 6Jx+BTSAHh5bSaUNHhiG+8my02XfdjFc9oxNwoPRWYeAuVVrEvZwX4AvVmIPGtSwtE/V GiMAskG/CbY5Y4X2h09T25GrenbWLQwWBergpjA/5zPM8bhnIbpRmbe/OcqIYL6bu469 PE00pxAprU2rjHmVybQtqoMaC9amatDPxORqbb3//kIu0dbLah9VUG7vdo6iOM8n1ECW il7g== 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=+KPvmzpCR5seSYv8kHpAw1AZPr6kKDFij7TNxO0T5iM=; b=tcjG2SEzxHT/aIEhNs+iUSHZFXYFnbuWyYGGxgE+yUtEAhPe9iB+qipYfUK2hkHdOL jM+DshqIbWhzu/rrYsLY3G8UUW0CWwKiVzhKKWvllIckp+N4zaC9qHzD0b5lhmKAzMd0 WbZqA0sUnbb7j0Lj2PSpqbTnYayypNfbZQXsQu1/1LIo5Hy1W71c4M4rp3kYnDSMYSN5 qtDjaP7+IRLJriSzwM1IgVt3v92CSM4hNNAKEcme1IQNZScbNxuCUJ77C62h4mOKwxM4 FVAsmXfswlXWC1Cli78HIwHkU/H8mx+u9MprKbAKcvwNLl2PxJ9Qh4oK9iKaybh2n+l7 a19w== X-Gm-Message-State: APjAAAXhWkFPer01NmA8BIdWo7AObRBoV2QkCZ1z8SaczI/l8hen1T5C DbpzT44rMMjKqXOAdpHfn4Ju0Daj+8k= X-Received: by 2002:aa7:8ad9:: with SMTP id b25mr53268382pfd.70.1582582958411; Mon, 24 Feb 2020 14:22:38 -0800 (PST) Received: from localhost.localdomain (97-126-123-70.tukw.qwest.net. [97.126.123.70]) by smtp.gmail.com with ESMTPSA id o6sm13897097pgg.37.2020.02.24.14.22.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Feb 2020 14:22:37 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 03/17] target/arm: Add isar_feature_aa32_{fpsp_v2, fpsp_v3, fpdp_v3} Date: Mon, 24 Feb 2020 14:22:18 -0800 Message-Id: <20200224222232.13807-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200224222232.13807-1-richard.henderson@linaro.org> References: <20200224222232.13807-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::442 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" We will shortly use these to test for VFPv2 and VFPv3 in different situations. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/arm/cpu.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) -- 2.20.1 diff --git a/target/arm/cpu.h b/target/arm/cpu.h index 1e6eac0cd2..f7a90f512e 100644 --- a/target/arm/cpu.h +++ b/target/arm/cpu.h @@ -3470,12 +3470,30 @@ static inline bool isar_feature_aa32_fpshvec(const ARMISARegisters *id) return FIELD_EX32(id->mvfr0, MVFR0, FPSHVEC) > 0; } +static inline bool isar_feature_aa32_fpsp_v2(const ARMISARegisters *id) +{ + /* Return true if CPU supports single precision floating point, VFPv2 */ + return FIELD_EX32(id->mvfr0, MVFR0, FPSP) > 0; +} + +static inline bool isar_feature_aa32_fpsp_v3(const ARMISARegisters *id) +{ + /* Return true if CPU supports single precision floating point, VFPv3 */ + return FIELD_EX32(id->mvfr0, MVFR0, FPSP) >= 2; +} + static inline bool isar_feature_aa32_fpdp_v2(const ARMISARegisters *id) { /* Return true if CPU supports double precision floating point, VFPv2 */ return FIELD_EX32(id->mvfr0, MVFR0, FPDP) > 0; } +static inline bool isar_feature_aa32_fpdp_v3(const ARMISARegisters *id) +{ + /* Return true if CPU supports double precision floating point, VFPv3 */ + return FIELD_EX32(id->mvfr0, MVFR0, FPDP) >= 2; +} + /* * We always set the FP and SIMD FP16 fields to indicate identical * levels of support (assuming SIMD is implemented at all), so From patchwork Mon Feb 24 22:22:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 183794 Delivered-To: patch@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp929870ile; Mon, 24 Feb 2020 14:33:16 -0800 (PST) X-Google-Smtp-Source: APXvYqyYN2W7P1jhVS/kfm4uv+5RYpviYRbmXpQil7Mip5n8Yg+kCuLaY62hY6yYgGsPSvrF7JNO X-Received: by 2002:a37:4550:: with SMTP id s77mr15709537qka.336.1582583596422; Mon, 24 Feb 2020 14:33:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582583596; cv=none; d=google.com; s=arc-20160816; b=toYADIe73L7pK8MSNjR24JGeAgcHdmGIj5aMtl6EJ5Xn1CNvFNy6U/CJgt/t3LF+rC mxZtQN9pm8G54uTMxJDkuTFyePSOUudPb/nK5eHNxIJtHnJe3ELi0/3blBCO747Jl5SQ Nk9zR1FXq/kxVs2BuY9oUW7Dy4Hhk1owOC8LmuCD6L3IaSkkh/g+wcY72XF2nkhQeFJd gsU5mSLs1ZbyACkpLcLX+JC9++ITYKg8ZCnhqVMmunacnWtwxy81Ex9x5emq2hJhTxGQ TXIQOQUju5NwkZxG6p7F/mZrn0Cw13BM4F2AB8SnSX2GjThsgWFvpkMkkA8lPvr33mdv RuQQ== 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=fkzyGWRSXdTJhJxOryRfsTh15ycVqgk6twtD/0ShqhM=; b=ZHo83l5XVc/MXjpcUJFcyGuK7gIBXQ6+JfKtOKRKfHxpj/3U/h78MIq4VOWt+/Kpcx isZi9eBQoo8Yn9X4VmSpXt+pkIwA9uNC9CnQSZ4FV6DhbC3jUPA/oAdAZQ/Y98s3tUBP OcOKK/6/v7DL1QtYE0gKkIn+UVci4Pyc/NdpuqI/VgKldVWv1a3w/8hSInagadUk0YZd F5GpSEW20BacWKq1W3qbrBcq6hKHfRm9Qmxvy9Gcq8PZzjGOzw9RC4d0seuwouU5kLmQ 91ARFma1wx2XlwiJEquDEblE0u5ev4lyEM3q5W9q12pe+CiVBENQCxxsETS/Qf4fc7PA BU2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZIiZp6BQ; 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 b6si6277567qkh.297.2020.02.24.14.33.16 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 24 Feb 2020 14:33:16 -0800 (PST) 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=ZIiZp6BQ; 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]:45488 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j6MHr-000682-Qm for patch@linaro.org; Mon, 24 Feb 2020 17:33:15 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:37756) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j6M7e-00046A-D9 for qemu-devel@nongnu.org; Mon, 24 Feb 2020 17:22:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j6M7d-0005o0-6C for qemu-devel@nongnu.org; Mon, 24 Feb 2020 17:22:42 -0500 Received: from mail-pj1-x1042.google.com ([2607:f8b0:4864:20::1042]:55947) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j6M7d-0005nN-0s for qemu-devel@nongnu.org; Mon, 24 Feb 2020 17:22:41 -0500 Received: by mail-pj1-x1042.google.com with SMTP id d5so353532pjz.5 for ; Mon, 24 Feb 2020 14:22:40 -0800 (PST) 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=fkzyGWRSXdTJhJxOryRfsTh15ycVqgk6twtD/0ShqhM=; b=ZIiZp6BQh+GleQv7Rca9wbyU29s8BiX2n4uTR5x20mHeKhHbeebuX10GFqD2eluxOF tRazJJiFtlhw4byypMlQrIcFmTcvKFGF2V9TFs8emCHyF8K4lb41bSseWDu/pdLIx0qr 9iAMcK5Wpqmblmz8rsO42bucwfaAHrueDlm40r3zyLML/nqAGtJncI6yfbmERfJFCRSO osetWS7UntZ3ANyaQ+XlcLNfvhDUQUPihLW19yKr1ohMyu6QXl14GkFchAr4bsy186/F zBu8bro/sGqV5ExjHQ5IKSgWw84psiP8dOw4Ycwn5imVJthVM/XZREnvTzghKm/1BleQ KFMQ== 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=fkzyGWRSXdTJhJxOryRfsTh15ycVqgk6twtD/0ShqhM=; b=CIuvpRQKMWRE0PKZOa9dkOWSZNzMp/13Wh0d16f5KM4Mptb62EWqOVIWhLUuT2mN/6 V7esvuahbLKnSg/obcKe2AOvcYxEkg0qrXapAdhbJnQMNXt+rLvn9QfGneMVXNP+ezAm QK8+AqQ0cEvj1TgMFF0yxGKmyXrI34m3ma6L3MPUHkwExlNHNM2SOIvyVW7aDX0TPMWh JEztQA0o8SHazareTmZjOuYDX5wrn1qz1T9wdYZA9l8jZlp/Bo0eOZeBOLB5efAMjT5Y tCEbcxG3VVMCkUxl+HnHblXuN/kDFAiBtiRUaOM4ctLoZtBXzPCaKIEDwRQMyJwEQuQp ReYw== X-Gm-Message-State: APjAAAVEe/5kLPsNRqy/TzRJMnjUJGe9cru/6JAgT0tCQAwUwaF/uKhw xfqVA0Wrq3FTeK/YtHEXNnlr1+lKJYE= X-Received: by 2002:a17:90b:14a:: with SMTP id em10mr1479681pjb.4.1582582959513; Mon, 24 Feb 2020 14:22:39 -0800 (PST) Received: from localhost.localdomain (97-126-123-70.tukw.qwest.net. [97.126.123.70]) by smtp.gmail.com with ESMTPSA id o6sm13897097pgg.37.2020.02.24.14.22.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Feb 2020 14:22:38 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 04/17] target/arm: Add isar_feature_aa64_fp_simd, isar_feature_aa32_vfp Date: Mon, 24 Feb 2020 14:22:19 -0800 Message-Id: <20200224222232.13807-5-richard.henderson@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200224222232.13807-1-richard.henderson@linaro.org> References: <20200224222232.13807-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::1042 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" We cannot easily create "any" functions for these, because the ID_AA64PFR0 fields for FP and SIMD signal "enabled" with zero. Which means that an aarch32-only cpu will return incorrect results when testing the aarch64 registers. To use these, we must either have context or additionally test vs ARM_FEATURE_AARCH64. Signed-off-by: Richard Henderson --- target/arm/cpu.h | 11 +++++++++++ target/arm/cpu.c | 9 ++++++--- target/arm/machine.c | 5 +++-- 3 files changed, 20 insertions(+), 5 deletions(-) -- 2.20.1 Reviewed-by: Peter Maydell diff --git a/target/arm/cpu.h b/target/arm/cpu.h index f7a90f512e..b94d2a5ace 100644 --- a/target/arm/cpu.h +++ b/target/arm/cpu.h @@ -3494,6 +3494,11 @@ static inline bool isar_feature_aa32_fpdp_v3(const ARMISARegisters *id) return FIELD_EX32(id->mvfr0, MVFR0, FPDP) >= 2; } +static inline bool isar_feature_aa32_vfp(const ARMISARegisters *id) +{ + return isar_feature_aa32_fpsp_v2(id) || isar_feature_aa32_fpdp_v2(id); +} + /* * We always set the FP and SIMD FP16 fields to indicate identical * levels of support (assuming SIMD is implemented at all), so @@ -3696,6 +3701,12 @@ static inline bool isar_feature_aa64_dcpodp(const ARMISARegisters *id) return FIELD_EX64(id->id_aa64isar1, ID_AA64ISAR1, DPB) >= 2; } +static inline bool isar_feature_aa64_fp_simd(const ARMISARegisters *id) +{ + /* We always set the AdvSIMD and FP fields identically. */ + return FIELD_EX64(id->id_aa64pfr0, ID_AA64PFR0, FP) != 0xf; +} + static inline bool isar_feature_aa64_fp16(const ARMISARegisters *id) { /* We always set the AdvSIMD and FP fields identically wrt FP16. */ diff --git a/target/arm/cpu.c b/target/arm/cpu.c index be4c2a1253..5be4c25809 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -1260,7 +1260,9 @@ void arm_cpu_post_init(Object *obj) * KVM does not currently allow us to lie to the guest about its * ID/feature registers, so the guest always sees what the host has. */ - if (arm_feature(&cpu->env, ARM_FEATURE_VFP)) { + if (arm_feature(&cpu->env, ARM_FEATURE_AARCH64) + ? cpu_isar_feature(aa64_fp_simd, cpu) + : cpu_isar_feature(aa32_vfp, cpu)) { cpu->has_vfp = true; if (!kvm_enabled()) { qdev_property_add_static(DEVICE(obj), &arm_cpu_has_vfp_property); @@ -1636,8 +1638,9 @@ static void arm_cpu_realizefn(DeviceState *dev, Error **errp) * We rely on no XScale CPU having VFP so we can use the same bits in the * TB flags field for VECSTRIDE and XSCALE_CPAR. */ - assert(!(arm_feature(env, ARM_FEATURE_VFP) && - arm_feature(env, ARM_FEATURE_XSCALE))); + assert(arm_feature(&cpu->env, ARM_FEATURE_AARCH64) || + !cpu_isar_feature(aa32_vfp_simd, cpu) || + !arm_feature(env, ARM_FEATURE_XSCALE)); if (arm_feature(env, ARM_FEATURE_V7) && !arm_feature(env, ARM_FEATURE_M) && diff --git a/target/arm/machine.c b/target/arm/machine.c index 241890ac8c..c5a2114f51 100644 --- a/target/arm/machine.c +++ b/target/arm/machine.c @@ -9,9 +9,10 @@ static bool vfp_needed(void *opaque) { ARMCPU *cpu = opaque; - CPUARMState *env = &cpu->env; - return arm_feature(env, ARM_FEATURE_VFP); + return (arm_feature(&cpu->env, ARM_FEATURE_AARCH64) + ? cpu_isar_feature(aa64_fp_simd, cpu) + : cpu_isar_feature(aa32_vfp_simd, cpu)); } static int get_fpscr(QEMUFile *f, void *opaque, size_t size, From patchwork Mon Feb 24 22:22:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 183795 Delivered-To: patch@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp930079ile; Mon, 24 Feb 2020 14:33:29 -0800 (PST) X-Google-Smtp-Source: APXvYqzKwdZDcTZL3YSS4t6E+8v6RM6MRIUGnpLG5LR9ajbYIqj8fNyUWzL8FBm+92cZALkOW8WH X-Received: by 2002:ae9:ef4c:: with SMTP id d73mr5244434qkg.201.1582583609479; Mon, 24 Feb 2020 14:33:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582583609; cv=none; d=google.com; s=arc-20160816; b=vw4Zw86vf6Z16pRSj2/u9nOE3SFy1L99j+UiCuJ03PDHbu3OaZJwWiZRjLS6eFowHq 0lkOhvywke0ESb/k97iF1H3FoQ81pKV7UDuh7q8PP6VJ+19fCsZQlEA2sZbyzuVR+SPz Hob27Tc/peKoUO+xCpsGL3VHOnRt6vIgE31PzCuNQfSoYzNFXDxO2Sykze4VIGCOHls6 lwLucieyB9ZgYpyrbo6w1n/B+qcYR2mFBYW7MXAq6IFOjH/dYmoah9TJUhstbWBYuqpX QFcCgjbvELf4pkfqKJtmnLHrJRzVW258dD2m6xw5DWYYotaDxrfTVaANuAM6NU2zgOQi FbZw== 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=LpDXkMJymCkBigdAeSGEBRetKSjrJSWM6nnEjxNkcOs=; b=xrm0cqflNUG5z5dECutBDemTLyaSGVPsXjvMsHCEJhX4VdkbbV0g8AKPTHKUjaSb0n vJoCt+raZKqGOKdTbCg912KtCtmpLMcV9SyEzBEeA+hhyGPhCmhq5tniNK44x8fXpYgv ml1SfJbVlzlua/KkOTvCvr36ra+oCRu28NBjlHQ/wl9Mszof5mitRBUZMZM85Up6/o3D Gj29FDfE1JOE2ZkoKCqKnnb59vwnbLPEOVWD9/yOnU8NLfY+fIb/+sdamS9yo4YMUatn +f28SEMPd4krCoTtBHSyRjhSPfzvd9eRMAk2aGHt0fF9jRLitFzCxXldaamVA/O9oafh Uh7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qLd16Hzs; 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 h17si7293086qkl.256.2020.02.24.14.33.29 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 24 Feb 2020 14:33:29 -0800 (PST) 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=qLd16Hzs; 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]:45492 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j6MI5-0006F2-0L for patch@linaro.org; Mon, 24 Feb 2020 17:33:29 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:37780) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j6M7f-00048Y-Es for qemu-devel@nongnu.org; Mon, 24 Feb 2020 17:22:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j6M7e-0005oj-Cw for qemu-devel@nongnu.org; Mon, 24 Feb 2020 17:22:43 -0500 Received: from mail-pf1-x444.google.com ([2607:f8b0:4864:20::444]:45684) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j6M7e-0005oE-72 for qemu-devel@nongnu.org; Mon, 24 Feb 2020 17:22:42 -0500 Received: by mail-pf1-x444.google.com with SMTP id 2so6053207pfg.12 for ; Mon, 24 Feb 2020 14:22:42 -0800 (PST) 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=LpDXkMJymCkBigdAeSGEBRetKSjrJSWM6nnEjxNkcOs=; b=qLd16HzsDhSXKCYXkXTlKuDt3c3IGFTybZKTVNQZ0oLUH6Q+wFmc3ojgqTmTBF+lga reJBMEOc3d0HGrcJWT+5pwn2YuKZCj7XZZFktyRYUhs1t4j4rUnLOdTd279+hI3k80bV 7RThRAywKqCbT/aTKrIhDoNm2C6MZf+TOEC3UhL1Ol0t3Vm3pWHsjiEbXyRmCZ2ra/Pa 2G6G2HWCRPzSaPEW79O9mQAyX6IG9oQ5EQKhoYUlE1K4dTiQ3dSsZxZT9esq71c5YkvW r+wS9B8Givx3o6jzFYJt8CABwk4oq0ENTfg9MiHRnkRh0xNyLIWCYVvIcODDOxRQPdyO GFhQ== 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=LpDXkMJymCkBigdAeSGEBRetKSjrJSWM6nnEjxNkcOs=; b=HCeAlyaA3NXMvIwIalmKDYQK7jzQxcG0/AfGqydIWq6mrlK4EfF0DWNMHOiPapTLct 4cZnSOlxPyFjSibiqbIiyMxw4VO7DHnCxmtuvzP7TlVE3UZkrval56VPVGcTx3M5xjAi 1V+2HsGgOvm6UA84gUqJjWK/snSY1F7PpSYkucaw1ARnSkSe0a/5taL7XxTzV1LcfetF r2YAXwjyAjlZTMQD0nUbbP/0XoJ9DtFJ76JgYw8N9DzDyakck8ks7Fw8z5CKkIylLsHn vY5t1NqffO8wnAufKzAIbk5D80VT/cADrkRjNXNueKWI/JHzVEzMEevdYd+7EzYMoHWj l2/Q== X-Gm-Message-State: APjAAAXrF8sJuT2co9hAjS9tCeW9ITARIK5z/sm3CqIBaEPatYL+yoUy iNNxDmvRwuFQzRyZqYkUsgVNgPzJoKM= X-Received: by 2002:a63:2842:: with SMTP id o63mr56554627pgo.317.1582582960842; Mon, 24 Feb 2020 14:22:40 -0800 (PST) Received: from localhost.localdomain (97-126-123-70.tukw.qwest.net. [97.126.123.70]) by smtp.gmail.com with ESMTPSA id o6sm13897097pgg.37.2020.02.24.14.22.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Feb 2020 14:22:40 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 05/17] target/arm: Improve ID_AA64PFR0 FP/SIMD validation Date: Mon, 24 Feb 2020 14:22:20 -0800 Message-Id: <20200224222232.13807-6-richard.henderson@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200224222232.13807-1-richard.henderson@linaro.org> References: <20200224222232.13807-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::444 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" When sanity checking id_aa64pfr0, use the raw FP and SIMD fields, because the values must match. Delay the test until we've finished modifying the id_aa64pfr0 register. Signed-off-by: Richard Henderson --- target/arm/cpu.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) -- 2.20.1 diff --git a/target/arm/cpu.c b/target/arm/cpu.c index 5be4c25809..f10f34b655 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -1427,17 +1427,6 @@ static void arm_cpu_realizefn(DeviceState *dev, Error **errp) return; } - if (arm_feature(env, ARM_FEATURE_AARCH64) && - cpu->has_vfp != cpu->has_neon) { - /* - * This is an architectural requirement for AArch64; AArch32 is - * more flexible and permits VFP-no-Neon and Neon-no-VFP. - */ - error_setg(errp, - "AArch64 CPUs must have both VFP and Neon or neither"); - return; - } - if (!cpu->has_vfp) { uint64_t t; uint32_t u; @@ -1537,6 +1526,18 @@ static void arm_cpu_realizefn(DeviceState *dev, Error **errp) cpu->isar.mvfr0 = u; } + if (arm_feature(env, ARM_FEATURE_AARCH64) && + FIELD_EX64(cpu->isar.id_aa64pfr0, ID_AA64PFR0, FP) != + FIELD_EX64(cpu->isar.id_aa64pfr0, ID_AA64PFR0, ADVSIMD)) { + /* + * This is an architectural requirement for AArch64. Not only + * both vfp and advsimd or neither, but further both must + * support fp16 or neither. + */ + error_setg(errp, "AArch64 CPUs must match VFP and NEON"); + return; + } + if (arm_feature(env, ARM_FEATURE_M) && !cpu->has_dsp) { uint32_t u; From patchwork Mon Feb 24 22:22:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 183785 Delivered-To: patch@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp924666ile; Mon, 24 Feb 2020 14:26:58 -0800 (PST) X-Google-Smtp-Source: APXvYqxZ4A0Lmet9JIsYEoPvU46xbw2ua6kCsSAyAudg5omahRzorSMr/oxeQtiufOZo7fjTQBG9 X-Received: by 2002:a05:620a:12b4:: with SMTP id x20mr15721115qki.308.1582583218258; Mon, 24 Feb 2020 14:26:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582583218; cv=none; d=google.com; s=arc-20160816; b=HF4EnGnqUReSWKhaHv5U9yAXP+pqsHoK7bT8RjCgCvQ1pyXXGQvyLL2RFrAlqOqwMh nYI/eVY7BN+5SsqzKfG6s0g7tI1ql6p5X7URXicBlUiVCUTiiCXva8m4Oq3NsLNgpIe0 yHFtuwTs8FA28tLUalV6NidBq/Gac+bbm+GUSKi//TseiSMnG6gFp09+Idv7IzbTCig3 PJCn8V9UJfiJj31Pt6PFI+rY9KBwpi17nUA50+sfLGCRJy/7r0XBBysyxTXcfD1/n3YX nFV+640M3pwV9TKoU9lmlUFtsB/WvGti5uVG575lGEVMohAhlu2E4+uSBVpMRLArAUiM qEYQ== 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=04w4nAykREQYlFaDlCPkF+ClHIRvIg4T3qLIcZORCLQ=; b=uGTxMzcnVeIKpV+gKeAipmKJf2jnE1iQM/SPeZaNHo0FxLKwag5aohqb/AmxBiCa3p XdgX2kEYmmgCJEIcms37phnFIKiGtHLGsH1xGv88HmR88/+Td6Aa4a6Y3F0qaCweA2Jc ifMVjB/rZPle/3av/TZKpEaqHDXXhWPR2d1+aTJ/ZDjdgvsksAI9TMfLJzX0GB83eIhx Aiw4k2ooKSJwUvv+U4PqV/Na0NWwH/ndtrXV7MZLcPGjHrIVJ8lLr7DIDfO3Wk16n/fm oodP9458KYxVmkVbOeD288j92UmQ2PRCCBTaPz0aUOFOAiRIL+D2EGp72AbGgeyvWRGe YwrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RESOnh7Z; 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 x75si6790439qka.192.2020.02.24.14.26.58 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 24 Feb 2020 14:26:58 -0800 (PST) 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=RESOnh7Z; 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]:45284 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j6MBl-00043i-N6 for patch@linaro.org; Mon, 24 Feb 2020 17:26:57 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:37813) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j6M7h-0004FX-QY for qemu-devel@nongnu.org; Mon, 24 Feb 2020 17:22:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j6M7g-0005q7-2O for qemu-devel@nongnu.org; Mon, 24 Feb 2020 17:22:45 -0500 Received: from mail-pg1-x543.google.com ([2607:f8b0:4864:20::543]:34555) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j6M7f-0005pV-Qw for qemu-devel@nongnu.org; Mon, 24 Feb 2020 17:22:44 -0500 Received: by mail-pg1-x543.google.com with SMTP id j4so5853440pgi.1 for ; Mon, 24 Feb 2020 14:22:43 -0800 (PST) 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=04w4nAykREQYlFaDlCPkF+ClHIRvIg4T3qLIcZORCLQ=; b=RESOnh7ZVqABL9e9EkhNypENrNTmIKFmCDKjHRkcvufJlnIaC9RFyKDoEJFf1Smggp ZHSp1nb9lEGqnGBLq73Y9irDfXnuXHdtMPad+XEFGkD4utjPp3p+Co1jO5R37pkxmhmY 1n2d2LjG7T/OGZA9V2uOoy6YC/RJLnH1kbxK8dU9UtV4rSsyANp6vNN4oEW64CdttH07 MyIZwJbXfwT0pMB1M+uOd5dUVgFelzZBvOAMkyk7+bk0pSHvDbHE7y0lW3Gf7O7F2cbi MEGUhJT+kUlf0pCrO6X4bLOegZ+tHoUoO0424X1zVf7iqMrrEMvhhckceleTAZmOItfS ZFGw== 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=04w4nAykREQYlFaDlCPkF+ClHIRvIg4T3qLIcZORCLQ=; b=Uwj/q6BQPRIEttvUzaJgPSvn193ULyVgtN2itYuTY9/7FeXfzwr77zzQb5UPBNdXao yBsumYCi3pN6TCf3HOlvekR9gOZXjntdaE0RQ9xeLcXUxbVzuf6tE/v449ZYQwWn0gb1 OBwE8NUg16GqpTFgHMCDANriqwGFPL5vS7goNdr8tH/toEK7oYXRTt6hcXjg6zftRyn/ qQEP5ERYE/ZUt9bQh8UC3zMCI4qJqjSzonZHkC5KJ+oYBXMFIuua6Ao2XbeWRwlXjthG c40e3rwBzSlMXbG9jVRVxHLMvnQBt0SMSMAUuUu3pHfJPdp87zaKP2tPChFqIFwqP7ch DzdQ== X-Gm-Message-State: APjAAAVAYTzlDprM9c/dtm/t3Q7K7Ga8MewrJ4DBLan7irqLWHM5WQtG usVbj7da6Mo0y+jzrcsRov4RnCYPR2U= X-Received: by 2002:a65:65c8:: with SMTP id y8mr25943548pgv.36.1582582962103; Mon, 24 Feb 2020 14:22:42 -0800 (PST) Received: from localhost.localdomain (97-126-123-70.tukw.qwest.net. [97.126.123.70]) by smtp.gmail.com with ESMTPSA id o6sm13897097pgg.37.2020.02.24.14.22.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Feb 2020 14:22:41 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 06/17] target/arm: Perform fpdp_v2 check first Date: Mon, 24 Feb 2020 14:22:21 -0800 Message-Id: <20200224222232.13807-7-richard.henderson@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200224222232.13807-1-richard.henderson@linaro.org> References: <20200224222232.13807-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::543 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" Shuffle the order of the checks so that we test the ISA before we test anything else, such as the register arguments. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/arm/translate-vfp.inc.c | 140 +++++++++++++++++---------------- 1 file changed, 71 insertions(+), 69 deletions(-) -- 2.20.1 diff --git a/target/arm/translate-vfp.inc.c b/target/arm/translate-vfp.inc.c index e94876c30c..ff30165045 100644 --- a/target/arm/translate-vfp.inc.c +++ b/target/arm/translate-vfp.inc.c @@ -200,13 +200,13 @@ static bool trans_VSEL(DisasContext *s, arg_VSEL *a) return false; } - /* UNDEF accesses to D16-D31 if they don't exist */ - if (dp && !dc_isar_feature(aa32_simd_r32, s) && - ((a->vm | a->vn | a->vd) & 0x10)) { + if (dp && !dc_isar_feature(aa32_fpdp_v2, s)) { return false; } - if (dp && !dc_isar_feature(aa32_fpdp_v2, s)) { + /* UNDEF accesses to D16-D31 if they don't exist */ + if (dp && !dc_isar_feature(aa32_simd_r32, s) && + ((a->vm | a->vn | a->vd) & 0x10)) { return false; } @@ -333,13 +333,13 @@ static bool trans_VMINMAXNM(DisasContext *s, arg_VMINMAXNM *a) return false; } - /* UNDEF accesses to D16-D31 if they don't exist */ - if (dp && !dc_isar_feature(aa32_simd_r32, s) && - ((a->vm | a->vn | a->vd) & 0x10)) { + if (dp && !dc_isar_feature(aa32_fpdp_v2, s)) { return false; } - if (dp && !dc_isar_feature(aa32_fpdp_v2, s)) { + /* UNDEF accesses to D16-D31 if they don't exist */ + if (dp && !dc_isar_feature(aa32_simd_r32, s) && + ((a->vm | a->vn | a->vd) & 0x10)) { return false; } @@ -419,13 +419,13 @@ static bool trans_VRINT(DisasContext *s, arg_VRINT *a) return false; } - /* UNDEF accesses to D16-D31 if they don't exist */ - if (dp && !dc_isar_feature(aa32_simd_r32, s) && - ((a->vm | a->vd) & 0x10)) { + if (dp && !dc_isar_feature(aa32_fpdp_v2, s)) { return false; } - if (dp && !dc_isar_feature(aa32_fpdp_v2, s)) { + /* UNDEF accesses to D16-D31 if they don't exist */ + if (dp && !dc_isar_feature(aa32_simd_r32, s) && + ((a->vm | a->vd) & 0x10)) { return false; } @@ -483,12 +483,12 @@ static bool trans_VCVT(DisasContext *s, arg_VCVT *a) return false; } - /* UNDEF accesses to D16-D31 if they don't exist */ - if (dp && !dc_isar_feature(aa32_simd_r32, s) && (a->vm & 0x10)) { + if (dp && !dc_isar_feature(aa32_fpdp_v2, s)) { return false; } - if (dp && !dc_isar_feature(aa32_fpdp_v2, s)) { + /* UNDEF accesses to D16-D31 if they don't exist */ + if (dp && !dc_isar_feature(aa32_simd_r32, s) && (a->vm & 0x10)) { return false; } @@ -1308,12 +1308,12 @@ static bool do_vfp_3op_dp(DisasContext *s, VFPGen3OpDPFn *fn, TCGv_i64 f0, f1, fd; TCGv_ptr fpst; - /* UNDEF accesses to D16-D31 if they don't exist */ - if (!dc_isar_feature(aa32_simd_r32, s) && ((vd | vn | vm) & 0x10)) { + if (!dc_isar_feature(aa32_fpdp_v2, s)) { return false; } - if (!dc_isar_feature(aa32_fpdp_v2, s)) { + /* UNDEF accesses to D16-D31 if they don't exist */ + if (!dc_isar_feature(aa32_simd_r32, s) && ((vd | vn | vm) & 0x10)) { return false; } @@ -1457,12 +1457,12 @@ static bool do_vfp_2op_dp(DisasContext *s, VFPGen2OpDPFn *fn, int vd, int vm) int veclen = s->vec_len; TCGv_i64 f0, fd; - /* UNDEF accesses to D16-D31 if they don't exist */ - if (!dc_isar_feature(aa32_simd_r32, s) && ((vd | vm) & 0x10)) { + if (!dc_isar_feature(aa32_fpdp_v2, s)) { return false; } - if (!dc_isar_feature(aa32_fpdp_v2, s)) { + /* UNDEF accesses to D16-D31 if they don't exist */ + if (!dc_isar_feature(aa32_simd_r32, s) && ((vd | vm) & 0x10)) { return false; } @@ -1827,7 +1827,9 @@ static bool trans_VFM_dp(DisasContext *s, arg_VFM_dp *a) return false; } - if (!dc_isar_feature(aa32_fpdp_v2, s)) { + /* UNDEF accesses to D16-D31 if they don't exist. */ + if (!dc_isar_feature(aa32_simd_r32, s) && + ((a->vd | a->vn | a->vm) & 0x10)) { return false; } @@ -1921,12 +1923,12 @@ static bool trans_VMOV_imm_dp(DisasContext *s, arg_VMOV_imm_dp *a) vd = a->vd; - /* UNDEF accesses to D16-D31 if they don't exist. */ - if (!dc_isar_feature(aa32_simd_r32, s) && (vd & 0x10)) { + if (!dc_isar_feature(aa32_fpdp_v2, s)) { return false; } - if (!dc_isar_feature(aa32_fpdp_v2, s)) { + /* UNDEF accesses to D16-D31 if they don't exist. */ + if (!dc_isar_feature(aa32_simd_r32, s) && (vd & 0x10)) { return false; } @@ -2060,6 +2062,10 @@ static bool trans_VCMP_dp(DisasContext *s, arg_VCMP_dp *a) { TCGv_i64 vd, vm; + if (!dc_isar_feature(aa32_fpdp_v2, s)) { + return false; + } + /* Vm/M bits must be zero for the Z variant */ if (a->z && a->vm != 0) { return false; @@ -2070,10 +2076,6 @@ static bool trans_VCMP_dp(DisasContext *s, arg_VCMP_dp *a) return false; } - if (!dc_isar_feature(aa32_fpdp_v2, s)) { - return false; - } - if (!vfp_access_check(s)) { return true; } @@ -2134,6 +2136,10 @@ static bool trans_VCVT_f64_f16(DisasContext *s, arg_VCVT_f64_f16 *a) TCGv_i32 tmp; TCGv_i64 vd; + if (!dc_isar_feature(aa32_fpdp_v2, s)) { + return false; + } + if (!dc_isar_feature(aa32_fp16_dpconv, s)) { return false; } @@ -2143,10 +2149,6 @@ static bool trans_VCVT_f64_f16(DisasContext *s, arg_VCVT_f64_f16 *a) return false; } - if (!dc_isar_feature(aa32_fpdp_v2, s)) { - return false; - } - if (!vfp_access_check(s)) { return true; } @@ -2200,6 +2202,10 @@ static bool trans_VCVT_f16_f64(DisasContext *s, arg_VCVT_f16_f64 *a) TCGv_i32 tmp; TCGv_i64 vm; + if (!dc_isar_feature(aa32_fpdp_v2, s)) { + return false; + } + if (!dc_isar_feature(aa32_fp16_dpconv, s)) { return false; } @@ -2209,10 +2215,6 @@ static bool trans_VCVT_f16_f64(DisasContext *s, arg_VCVT_f16_f64 *a) return false; } - if (!dc_isar_feature(aa32_fpdp_v2, s)) { - return false; - } - if (!vfp_access_check(s)) { return true; } @@ -2260,6 +2262,10 @@ static bool trans_VRINTR_dp(DisasContext *s, arg_VRINTR_dp *a) TCGv_ptr fpst; TCGv_i64 tmp; + if (!dc_isar_feature(aa32_fpdp_v2, s)) { + return false; + } + if (!dc_isar_feature(aa32_vrint, s)) { return false; } @@ -2269,10 +2275,6 @@ static bool trans_VRINTR_dp(DisasContext *s, arg_VRINTR_dp *a) return false; } - if (!dc_isar_feature(aa32_fpdp_v2, s)) { - return false; - } - if (!vfp_access_check(s)) { return true; } @@ -2321,6 +2323,10 @@ static bool trans_VRINTZ_dp(DisasContext *s, arg_VRINTZ_dp *a) TCGv_i64 tmp; TCGv_i32 tcg_rmode; + if (!dc_isar_feature(aa32_fpdp_v2, s)) { + return false; + } + if (!dc_isar_feature(aa32_vrint, s)) { return false; } @@ -2330,10 +2336,6 @@ static bool trans_VRINTZ_dp(DisasContext *s, arg_VRINTZ_dp *a) return false; } - if (!dc_isar_feature(aa32_fpdp_v2, s)) { - return false; - } - if (!vfp_access_check(s)) { return true; } @@ -2380,6 +2382,10 @@ static bool trans_VRINTX_dp(DisasContext *s, arg_VRINTX_dp *a) TCGv_ptr fpst; TCGv_i64 tmp; + if (!dc_isar_feature(aa32_fpdp_v2, s)) { + return false; + } + if (!dc_isar_feature(aa32_vrint, s)) { return false; } @@ -2389,10 +2395,6 @@ static bool trans_VRINTX_dp(DisasContext *s, arg_VRINTX_dp *a) return false; } - if (!dc_isar_feature(aa32_fpdp_v2, s)) { - return false; - } - if (!vfp_access_check(s)) { return true; } @@ -2412,12 +2414,12 @@ static bool trans_VCVT_sp(DisasContext *s, arg_VCVT_sp *a) TCGv_i64 vd; TCGv_i32 vm; - /* UNDEF accesses to D16-D31 if they don't exist. */ - if (!dc_isar_feature(aa32_simd_r32, s) && (a->vd & 0x10)) { + if (!dc_isar_feature(aa32_fpdp_v2, s)) { return false; } - if (!dc_isar_feature(aa32_fpdp_v2, s)) { + /* UNDEF accesses to D16-D31 if they don't exist. */ + if (!dc_isar_feature(aa32_simd_r32, s) && (a->vd & 0x10)) { return false; } @@ -2440,12 +2442,12 @@ static bool trans_VCVT_dp(DisasContext *s, arg_VCVT_dp *a) TCGv_i64 vm; TCGv_i32 vd; - /* UNDEF accesses to D16-D31 if they don't exist. */ - if (!dc_isar_feature(aa32_simd_r32, s) && (a->vm & 0x10)) { + if (!dc_isar_feature(aa32_fpdp_v2, s)) { return false; } - if (!dc_isar_feature(aa32_fpdp_v2, s)) { + /* UNDEF accesses to D16-D31 if they don't exist. */ + if (!dc_isar_feature(aa32_simd_r32, s) && (a->vm & 0x10)) { return false; } @@ -2494,12 +2496,12 @@ static bool trans_VCVT_int_dp(DisasContext *s, arg_VCVT_int_dp *a) TCGv_i64 vd; TCGv_ptr fpst; - /* UNDEF accesses to D16-D31 if they don't exist. */ - if (!dc_isar_feature(aa32_simd_r32, s) && (a->vd & 0x10)) { + if (!dc_isar_feature(aa32_fpdp_v2, s)) { return false; } - if (!dc_isar_feature(aa32_fpdp_v2, s)) { + /* UNDEF accesses to D16-D31 if they don't exist. */ + if (!dc_isar_feature(aa32_simd_r32, s) && (a->vd & 0x10)) { return false; } @@ -2530,6 +2532,10 @@ static bool trans_VJCVT(DisasContext *s, arg_VJCVT *a) TCGv_i32 vd; TCGv_i64 vm; + if (!dc_isar_feature(aa32_fpdp_v2, s)) { + return false; + } + if (!dc_isar_feature(aa32_jscvt, s)) { return false; } @@ -2539,10 +2545,6 @@ static bool trans_VJCVT(DisasContext *s, arg_VJCVT *a) return false; } - if (!dc_isar_feature(aa32_fpdp_v2, s)) { - return false; - } - if (!vfp_access_check(s)) { return true; } @@ -2623,6 +2625,10 @@ static bool trans_VCVT_fix_dp(DisasContext *s, arg_VCVT_fix_dp *a) TCGv_ptr fpst; int frac_bits; + if (!dc_isar_feature(aa32_fpdp_v2, s)) { + return false; + } + if (!arm_dc_feature(s, ARM_FEATURE_VFP3)) { return false; } @@ -2632,10 +2638,6 @@ static bool trans_VCVT_fix_dp(DisasContext *s, arg_VCVT_fix_dp *a) return false; } - if (!dc_isar_feature(aa32_fpdp_v2, s)) { - return false; - } - if (!vfp_access_check(s)) { return true; } @@ -2723,12 +2725,12 @@ static bool trans_VCVT_dp_int(DisasContext *s, arg_VCVT_dp_int *a) TCGv_i64 vm; TCGv_ptr fpst; - /* UNDEF accesses to D16-D31 if they don't exist. */ - if (!dc_isar_feature(aa32_simd_r32, s) && (a->vm & 0x10)) { + if (!dc_isar_feature(aa32_fpdp_v2, s)) { return false; } - if (!dc_isar_feature(aa32_fpdp_v2, s)) { + /* UNDEF accesses to D16-D31 if they don't exist. */ + if (!dc_isar_feature(aa32_simd_r32, s) && (a->vm & 0x10)) { return false; } From patchwork Mon Feb 24 22:22:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 183782 Delivered-To: patch@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp922951ile; Mon, 24 Feb 2020 14:24:55 -0800 (PST) X-Google-Smtp-Source: APXvYqzIf1gEMN8mG7C152vPOgnTx1NX2q4x9Ukhm5ekCeJcbeH6fdTDzykGzM4pZs1nSMC+Bg7X X-Received: by 2002:ac8:4f05:: with SMTP id b5mr43509695qte.288.1582583095590; Mon, 24 Feb 2020 14:24:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582583095; cv=none; d=google.com; s=arc-20160816; b=j3xXwVgcsFAtsumcFMdzoUsA+mUjhUjViUraQb5gfwCaZj6RsHs1Gfa4uOadqbufyX 8XAalUA5BDeQBjGxQuaQNfLUp3Dxc4FcQ0XCxi82lhgYUd5bBTcVKEfobwVSvEKHz9bh hVGJft/eQFECh8p2tVvMB054wEHpvmOgE6kSfaghSu7CgoHRJwWmLSZqrkn57v+/nnfS RMHghO4Bfiy8Elouhu/n8ENAEHrgnHK2rI8+TWV9NWM5y/Vju9+HvP++blM2qYXtVf/G k8YKiBm6q6PDDty0Ct7UrfGSRHn7yDYwi4W5aiqrI23ojqhxrb2m8y+q1Qr2ThsSrd48 2wag== 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=BR6sc2PsWl2NSv+8xYHc8XwgP3dTmPaC/PPPaHkcT3I=; b=DuUpfvUl8UlALGoXlezqoKXNcBQVQoGvAOrhlDGi1ilhAiTXskdhe9HdvjGQqGGZQ2 i/Gqar1Qhl3JRM2Kw6juEZy3TQKBvau9c2fZMIMJZJ4T84wT6rad29uMnnxJttRtQbyM ujK0u1JwzgO9FwdUn5hMO71r3cnbBOlWwjYYy05QU8MPm9izvhYuvondlXuLGyTjU7l3 OQhyJ/1tELUY4SqTgbfNZn2Wcd983h9qj+pLRBpWK5RvJnqJhgNCUd0nKDBy8qk7GuMd a+ip4MghcGpeTJbK7WzODl1JqKLBwuoNd/+MfcdX3gIwO6yZsCoeqBZbp4tWpEO4oCVH dGZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=DQ2dparv; 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 g2si7042734qtm.158.2020.02.24.14.24.55 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 24 Feb 2020 14:24:55 -0800 (PST) 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=DQ2dparv; 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]:45224 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j6M9n-0008Tf-40 for patch@linaro.org; Mon, 24 Feb 2020 17:24:55 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:37821) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j6M7i-0004Gp-91 for qemu-devel@nongnu.org; Mon, 24 Feb 2020 17:22:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j6M7h-0005qj-3B for qemu-devel@nongnu.org; Mon, 24 Feb 2020 17:22:46 -0500 Received: from mail-pl1-x644.google.com ([2607:f8b0:4864:20::644]:44407) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j6M7g-0005qI-US for qemu-devel@nongnu.org; Mon, 24 Feb 2020 17:22:45 -0500 Received: by mail-pl1-x644.google.com with SMTP id d9so4608418plo.11 for ; Mon, 24 Feb 2020 14:22:44 -0800 (PST) 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=BR6sc2PsWl2NSv+8xYHc8XwgP3dTmPaC/PPPaHkcT3I=; b=DQ2dparviTdEn1mh9O1lQXFqY3QilS/OGLcCZ+Huii0oWHWSzMo2G6iYtJircXbGPC /gAs6Dz8gir/vzxWET88fVpkmNSKc9+2luOAiZAjF0Ku+ZxAu4d6PYJwpeTPwXFh5sbL WfbVPfeBSClTLbogMwUlHYwdhKFqwxIDs79mlGZwtkLb7rU8oQkS/7vn4aqqy5Bi12jK RMKhCYFJiMk6wKsXBKcc+8aHSsbS5aUVr3WOL1zmUoexLsBHUEDkdmR3/YUp1WnIvznY wHHoF6y1K2n+o4Xn2vd+RYvHv5u7D+lA+gSZexh7+p0KLkcIlT3EpzoqEcoSlJppmiJ5 5TuQ== 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=BR6sc2PsWl2NSv+8xYHc8XwgP3dTmPaC/PPPaHkcT3I=; b=Tr10TcxxPt9iQNmKbz+BIhsCB9ReHaaqnRNCYspgRtgEKhvjOp/F28c8gGYv5QmLi4 Rf4t4JqEetsu7oyfBIXiRcpUlKQ9bF9PNSD/cd6yBdxY/RlNCh0Gyd5NcpUNf7fCb04g c/9U9A8jm8WXl0O7l7a7Mp+dGPkXkPlnxMWXNgD57a5M0kek+3QpwntZ5zQXtQsfOVWi btN92ZTsA9t+Rfxlt+qFd0frBRh9FoQvWE3EEius7Nlth9cgk9fMrNLrQ935ix5hLO8R YXSDNZ62dz3Y9aykk4u2KclPdJwJp2YASm+8Lrcn3J5XNDbxM6CxcA8Y7Ps7OwUl784p l6FQ== X-Gm-Message-State: APjAAAWclI+iAr2ASR+UpaI5no/8K9kZz7+f8uU97V0J/4L1Ui5gfSTN VvUQg3Wuq9xABM8Lz4Cp9alVYrmF61I= X-Received: by 2002:a17:902:8d83:: with SMTP id v3mr52983013plo.282.1582582963580; Mon, 24 Feb 2020 14:22:43 -0800 (PST) Received: from localhost.localdomain (97-126-123-70.tukw.qwest.net. [97.126.123.70]) by smtp.gmail.com with ESMTPSA id o6sm13897097pgg.37.2020.02.24.14.22.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Feb 2020 14:22:42 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 07/17] target/arm: Replace ARM_FEATURE_VFP3 checks with fp{sp, dp}_v3 Date: Mon, 24 Feb 2020 14:22:22 -0800 Message-Id: <20200224222232.13807-8-richard.henderson@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200224222232.13807-1-richard.henderson@linaro.org> References: <20200224222232.13807-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::644 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" Sort this check to the start of a trans_* function. Merge this with any existing test for fpdp_v2. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/arm/translate-vfp.inc.c | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) -- 2.20.1 diff --git a/target/arm/translate-vfp.inc.c b/target/arm/translate-vfp.inc.c index ff30165045..51d46f4302 100644 --- a/target/arm/translate-vfp.inc.c +++ b/target/arm/translate-vfp.inc.c @@ -717,7 +717,7 @@ static bool trans_VMSR_VMRS(DisasContext *s, arg_VMSR_VMRS *a) * VFPv2 allows access to FPSID from userspace; VFPv3 restricts * all ID registers to privileged access only. */ - if (IS_USER(s) && arm_dc_feature(s, ARM_FEATURE_VFP3)) { + if (IS_USER(s) && dc_isar_feature(aa32_fpsp_v3, s)) { return false; } ignore_vfp_enabled = true; @@ -746,7 +746,7 @@ static bool trans_VMSR_VMRS(DisasContext *s, arg_VMSR_VMRS *a) case ARM_VFP_FPINST: case ARM_VFP_FPINST2: /* Not present in VFPv3 */ - if (IS_USER(s) || arm_dc_feature(s, ARM_FEATURE_VFP3)) { + if (IS_USER(s) || dc_isar_feature(aa32_fpsp_v3, s)) { return false; } break; @@ -1873,12 +1873,12 @@ static bool trans_VMOV_imm_sp(DisasContext *s, arg_VMOV_imm_sp *a) vd = a->vd; - if (!dc_isar_feature(aa32_fpshvec, s) && - (veclen != 0 || s->vec_stride != 0)) { + if (!dc_isar_feature(aa32_fpsp_v3, s)) { return false; } - if (!arm_dc_feature(s, ARM_FEATURE_VFP3)) { + if (!dc_isar_feature(aa32_fpshvec, s) && + (veclen != 0 || s->vec_stride != 0)) { return false; } @@ -1923,7 +1923,7 @@ static bool trans_VMOV_imm_dp(DisasContext *s, arg_VMOV_imm_dp *a) vd = a->vd; - if (!dc_isar_feature(aa32_fpdp_v2, s)) { + if (!dc_isar_feature(aa32_fpdp_v3, s)) { return false; } @@ -1937,10 +1937,6 @@ static bool trans_VMOV_imm_dp(DisasContext *s, arg_VMOV_imm_dp *a) return false; } - if (!arm_dc_feature(s, ARM_FEATURE_VFP3)) { - return false; - } - if (!vfp_access_check(s)) { return true; } @@ -2565,7 +2561,7 @@ static bool trans_VCVT_fix_sp(DisasContext *s, arg_VCVT_fix_sp *a) TCGv_ptr fpst; int frac_bits; - if (!arm_dc_feature(s, ARM_FEATURE_VFP3)) { + if (!dc_isar_feature(aa32_fpsp_v3, s)) { return false; } @@ -2625,11 +2621,7 @@ static bool trans_VCVT_fix_dp(DisasContext *s, arg_VCVT_fix_dp *a) TCGv_ptr fpst; int frac_bits; - if (!dc_isar_feature(aa32_fpdp_v2, s)) { - return false; - } - - if (!arm_dc_feature(s, ARM_FEATURE_VFP3)) { + if (!dc_isar_feature(aa32_fpdp_v3, s)) { return false; } From patchwork Mon Feb 24 22:22:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 183796 Delivered-To: patch@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp931783ile; Mon, 24 Feb 2020 14:35:30 -0800 (PST) X-Google-Smtp-Source: APXvYqwzOfhnb9D4vpB+8i/rL8S1frFSq9yK/LTRM5wja84j6RQIIFnfHBxZ/KPHnDO1RG5Krs8L X-Received: by 2002:ad4:5429:: with SMTP id g9mr44769044qvt.134.1582583730060; Mon, 24 Feb 2020 14:35:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582583730; cv=none; d=google.com; s=arc-20160816; b=XmkMbqbE/64Cd3XN90zAsnZ4rciCfu29w/VLwB5vcRJqz4Yxn984OZE3QFHN5cDMkk pGJxD75s3fBNJ0yYslIvtCYfCvnN9+UWujYBFkmOk3F7m2gGvPCLt37YAcps+40YUEM4 Lq6kV6iqaqntHU3e6pOb1kQS2egCReYzNEGBKMpqhn4KfCXXINSFVeqPJr//sRcllXmr EK5DDsR62HVQNBOVZ7t4FJl+NODIdQDgqmm+IPWNVXOMTXRML04YVToSDvqNqudWGkHg OH6LloJmtXzmqGODSA2hPsjC6oAgG5toMws94gf4PS5D/tlwqTd5mM/OoeV9669uTBnS 2vcQ== 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=nZ29NUYH0rX/kvQeepGmU3q2/jzjoKfkqGWPwiKmojM=; b=yHojxJKT8wlgUCFUrzpmSstFh8RTkvjoo/l6qAa/SmyH7jYNn9ZHtFzSgOXIeEzJWM qQjt5WxAqYzWnFsoLbAea4L+n1JSOuYjy2OStHoC8VDlhkGVQK8tUZtR2PdM+YD1HQXk ugXEYCGkf21xD6mK0jRz5gooFrlPFVsZnsVJwxkj1rIl/yEKfGj7Mf/zbeip8t+h73gX srObUtBaAkB/mNlZpcfEgElYs37B3Jlx48/+bKRRM0CyLY/KIdMb2/eeYfIeze53FPsD U22DSPvPBU/F/xjiLj6lVNRBrL5RwgOLaZs2JVYPTdAdktGRnze2S1jH6SsLE6Mtb97y 9xDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xxvrA+og; 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 o34si6415989qtd.109.2020.02.24.14.35.29 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 24 Feb 2020 14:35:30 -0800 (PST) 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=xxvrA+og; 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]:45542 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j6MK1-0000o4-Hr for patch@linaro.org; Mon, 24 Feb 2020 17:35:29 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:37855) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j6M7j-0004LC-T2 for qemu-devel@nongnu.org; Mon, 24 Feb 2020 17:22:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j6M7i-0005rm-Eg for qemu-devel@nongnu.org; Mon, 24 Feb 2020 17:22:47 -0500 Received: from mail-pl1-x644.google.com ([2607:f8b0:4864:20::644]:43379) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j6M7i-0005rG-8v for qemu-devel@nongnu.org; Mon, 24 Feb 2020 17:22:46 -0500 Received: by mail-pl1-x644.google.com with SMTP id p11so4611651plq.10 for ; Mon, 24 Feb 2020 14:22:46 -0800 (PST) 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=nZ29NUYH0rX/kvQeepGmU3q2/jzjoKfkqGWPwiKmojM=; b=xxvrA+ogSQK5y+8pjt/5xu+j9hsVv24loOIm+bdauHtMM2SQWn2Nq3tSXsmW6h4/Rl Fx9QkPuJqgiaNXdzImh97cao6XiPvw5Gf7F9GTDKpcaAav/lVC99oH3SBGFqWFdkpxdV bbVzoN0aRklZwTaO/TEVXdT55mxPY26ZHyc8Xz6xajt0T+8qtUBDEpuL7olNRJMKSKAD R74cgMCYhDAfCtfQ7eH3+BIeEO9xnpazBVEWhLxiWOO6cRFUL2ZebfmV1xxz9kNxyvt8 5sPxVXZBUhqSXqG8+Pry3qLsTquv6lG49B5lBx9JgPSCZEIQ5QL5mBR5Y+Co6f2x5Kx7 lSDg== 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=nZ29NUYH0rX/kvQeepGmU3q2/jzjoKfkqGWPwiKmojM=; b=oV3p01GQKvVc2lMbk8EceaMvENam4UY4k8WigIR8UQuozWfUPQ+P4kaZOta5Pb81mG iUABZPGrP3E0TAgyjjTdiziOKC3uybhSdVoGStm440IoTqLjaHi98HOII/8cIx6b3U3u 4Q3t/KvDO39tt0Qe60ysyAR3YGtsHAdbEyIk2Y/feDrrIK5BX0Dz3Ha3vEt/Gu4F0cuQ CJKE8M4O0M4z9UxsYj7OHUe6fQke14UbxTdUv/nLa8QWvjILzLOnvIwgfHMBTm9KDS8p /ovNKEFfk8T08yfSTG4D91iMUUZbRs404j0EFRSpj+boA542KK9k0B6IwBdjL6iRke5Y rNlg== X-Gm-Message-State: APjAAAWnc49pdcWms20jAJC9WcQ8WWj4rXt4tG9i5iVxue8HvGgk7tI7 f2whGle/UsYTNrAekfiN8lKjNtlICGw= X-Received: by 2002:a17:902:8b85:: with SMTP id ay5mr48009211plb.253.1582582964790; Mon, 24 Feb 2020 14:22:44 -0800 (PST) Received: from localhost.localdomain (97-126-123-70.tukw.qwest.net. [97.126.123.70]) by smtp.gmail.com with ESMTPSA id o6sm13897097pgg.37.2020.02.24.14.22.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Feb 2020 14:22:44 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 08/17] target/arm: Add missing checks for fpsp_v2 Date: Mon, 24 Feb 2020 14:22:23 -0800 Message-Id: <20200224222232.13807-9-richard.henderson@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200224222232.13807-1-richard.henderson@linaro.org> References: <20200224222232.13807-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::644 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" We will eventually remove the early ARM_FEATURE_VFP test, so add a proper test for each trans_* that does not already have another ISA test. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/arm/translate-vfp.inc.c | 78 ++++++++++++++++++++++++++++++---- 1 file changed, 69 insertions(+), 9 deletions(-) -- 2.20.1 diff --git a/target/arm/translate-vfp.inc.c b/target/arm/translate-vfp.inc.c index 51d46f4302..f88a95438f 100644 --- a/target/arm/translate-vfp.inc.c +++ b/target/arm/translate-vfp.inc.c @@ -555,6 +555,13 @@ static bool trans_VMOV_to_gp(DisasContext *s, arg_VMOV_to_gp *a) int pass; uint32_t offset; + /* SIZE == 2 is a VFP instruction; otherwise NEON. */ + if (a->size == 2 + ? !dc_isar_feature(aa32_fpsp_v2, s) + : !arm_dc_feature(s, ARM_FEATURE_NEON)) { + return false; + } + /* UNDEF accesses to D16-D31 if they don't exist */ if (!dc_isar_feature(aa32_simd_r32, s) && (a->vn & 0x10)) { return false; @@ -564,10 +571,6 @@ static bool trans_VMOV_to_gp(DisasContext *s, arg_VMOV_to_gp *a) pass = extract32(offset, 2, 1); offset = extract32(offset, 0, 2) * 8; - if (a->size != 2 && !arm_dc_feature(s, ARM_FEATURE_NEON)) { - return false; - } - if (!vfp_access_check(s)) { return true; } @@ -614,6 +617,13 @@ static bool trans_VMOV_from_gp(DisasContext *s, arg_VMOV_from_gp *a) int pass; uint32_t offset; + /* SIZE == 2 is a VFP instruction; otherwise NEON. */ + if (a->size == 2 + ? !dc_isar_feature(aa32_fpsp_v2, s) + : !arm_dc_feature(s, ARM_FEATURE_NEON)) { + return false; + } + /* UNDEF accesses to D16-D31 if they don't exist */ if (!dc_isar_feature(aa32_simd_r32, s) && (a->vn & 0x10)) { return false; @@ -623,10 +633,6 @@ static bool trans_VMOV_from_gp(DisasContext *s, arg_VMOV_from_gp *a) pass = extract32(offset, 2, 1); offset = extract32(offset, 0, 2) * 8; - if (a->size != 2 && !arm_dc_feature(s, ARM_FEATURE_NEON)) { - return false; - } - if (!vfp_access_check(s)) { return true; } @@ -700,6 +706,10 @@ static bool trans_VMSR_VMRS(DisasContext *s, arg_VMSR_VMRS *a) TCGv_i32 tmp; bool ignore_vfp_enabled = false; + if (!dc_isar_feature(aa32_fpsp_v2, s)) { + return false; + } + if (arm_dc_feature(s, ARM_FEATURE_M)) { /* * The only M-profile VFP vmrs/vmsr sysreg is FPSCR. @@ -844,6 +854,10 @@ static bool trans_VMOV_single(DisasContext *s, arg_VMOV_single *a) { TCGv_i32 tmp; + if (!dc_isar_feature(aa32_fpsp_v2, s)) { + return false; + } + if (!vfp_access_check(s)) { return true; } @@ -873,6 +887,10 @@ static bool trans_VMOV_64_sp(DisasContext *s, arg_VMOV_64_sp *a) { TCGv_i32 tmp; + if (!dc_isar_feature(aa32_fpsp_v2, s)) { + return false; + } + /* * VMOV between two general-purpose registers and two single precision * floating point registers @@ -908,8 +926,12 @@ static bool trans_VMOV_64_dp(DisasContext *s, arg_VMOV_64_dp *a) /* * VMOV between two general-purpose registers and one double precision - * floating point register + * floating point register. Note that this does not require support + * for double precision arithmetic. */ + if (!dc_isar_feature(aa32_fpsp_v2, s)) { + return false; + } /* UNDEF accesses to D16-D31 if they don't exist */ if (!dc_isar_feature(aa32_simd_r32, s) && (a->vm & 0x10)) { @@ -946,6 +968,10 @@ static bool trans_VLDR_VSTR_sp(DisasContext *s, arg_VLDR_VSTR_sp *a) uint32_t offset; TCGv_i32 addr, tmp; + if (!dc_isar_feature(aa32_fpsp_v2, s)) { + return false; + } + if (!vfp_access_check(s)) { return true; } @@ -977,6 +1003,11 @@ static bool trans_VLDR_VSTR_dp(DisasContext *s, arg_VLDR_VSTR_dp *a) TCGv_i32 addr; TCGv_i64 tmp; + /* Note that this does not require support for double arithmetic. */ + if (!dc_isar_feature(aa32_fpsp_v2, s)) { + return false; + } + /* UNDEF accesses to D16-D31 if they don't exist */ if (!dc_isar_feature(aa32_simd_r32, s) && (a->vd & 0x10)) { return false; @@ -1013,6 +1044,10 @@ static bool trans_VLDM_VSTM_sp(DisasContext *s, arg_VLDM_VSTM_sp *a) TCGv_i32 addr, tmp; int i, n; + if (!dc_isar_feature(aa32_fpsp_v2, s)) { + return false; + } + n = a->imm; if (n == 0 || (a->vd + n) > 32) { @@ -1086,6 +1121,11 @@ static bool trans_VLDM_VSTM_dp(DisasContext *s, arg_VLDM_VSTM_dp *a) TCGv_i64 tmp; int i, n; + /* Note that this does not require support for double arithmetic. */ + if (!dc_isar_feature(aa32_fpsp_v2, s)) { + return false; + } + n = a->imm >> 1; if (n == 0 || (a->vd + n) > 32 || n > 16) { @@ -1234,6 +1274,10 @@ static bool do_vfp_3op_sp(DisasContext *s, VFPGen3OpSPFn *fn, TCGv_i32 f0, f1, fd; TCGv_ptr fpst; + if (!dc_isar_feature(aa32_fpsp_v2, s)) { + return false; + } + if (!dc_isar_feature(aa32_fpshvec, s) && (veclen != 0 || s->vec_stride != 0)) { return false; @@ -1388,6 +1432,10 @@ static bool do_vfp_2op_sp(DisasContext *s, VFPGen2OpSPFn *fn, int vd, int vm) int veclen = s->vec_len; TCGv_i32 f0, fd; + if (!dc_isar_feature(aa32_fpsp_v2, s)) { + return false; + } + if (!dc_isar_feature(aa32_fpshvec, s) && (veclen != 0 || s->vec_stride != 0)) { return false; @@ -2023,6 +2071,10 @@ static bool trans_VCMP_sp(DisasContext *s, arg_VCMP_sp *a) { TCGv_i32 vd, vm; + if (!dc_isar_feature(aa32_fpsp_v2, s)) { + return false; + } + /* Vm/M bits must be zero for the Z variant */ if (a->z && a->vm != 0) { return false; @@ -2466,6 +2518,10 @@ static bool trans_VCVT_int_sp(DisasContext *s, arg_VCVT_int_sp *a) TCGv_i32 vm; TCGv_ptr fpst; + if (!dc_isar_feature(aa32_fpsp_v2, s)) { + return false; + } + if (!vfp_access_check(s)) { return true; } @@ -2684,6 +2740,10 @@ static bool trans_VCVT_sp_int(DisasContext *s, arg_VCVT_sp_int *a) TCGv_i32 vm; TCGv_ptr fpst; + if (!dc_isar_feature(aa32_fpsp_v2, s)) { + return false; + } + if (!vfp_access_check(s)) { return true; } From patchwork Mon Feb 24 22:22:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 183783 Delivered-To: patch@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp923829ile; Mon, 24 Feb 2020 14:25:59 -0800 (PST) X-Google-Smtp-Source: APXvYqxuVvAng/wJ1eat16q4aEifjcdfUOCTn2Y1S8xHu2UWG9+S11G24ZuTIw1/3OVfsLHrrorz X-Received: by 2002:a05:620a:74c:: with SMTP id i12mr4187549qki.286.1582583159391; Mon, 24 Feb 2020 14:25:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582583159; cv=none; d=google.com; s=arc-20160816; b=T4f2Tb8cPMDWqZyQnZDXOt9sgtrcRCx4VCLarDa3YQ+QZq9eZv36NdIXPNxJFDU/ju ce7auLqpUqaUCSpHawok+Ck16A4Zw1Hf5a+94qIp4GyZmCH9m5e8lGMERXCBjaslRJcw VYm3jd7FZFF0h41zkic/xd9P3ksqE0++orK6aPtg+KNWX2qX1g/gwOoboGLapJh78vYz tW8pVTTeAWc3YIScSq43fApg4V++IrALPVCsyonN9jbNXNUvjKXxdJTWgSnTQ87UrTFY HjuF+Ajv/xAT7a2fOAIi2HXGRrygVJCz+oYuNtYlmnU0NPBVSH4a0VBeUhFeAwxIcexS NddA== 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=ABqg53SHadErlQ1KJw2EVsyG66DudT3m5ptP92s2kV4=; b=S2d3hZRbZrZ5uycH3iTtxxJ8s6p2ey0yovYd7HQ25NrpJdF+AyTPfsBpaJHQNxg3ES ApQOx4E5sZnINp4cmTqadAxTqngD4xM906B4R6k1zf58D8UgJCEsssgJBZrgPdyWxP/i KOGiMz0UR8lJa11jUOxdvR+GRrfh/JdwzoMybfxkIR4EsojfOpgENs7FwH8YOL1a8ov4 V4q2vSjgKLlgYGzj49NXh0gkPWNy7pYQmAZAVjlZ0oAmBv8xCK4Ip2Is3tbrg3oWtaj3 n3XgoIwEeEEhgg3HgxTsBdpJe/5dtSnhvyWPpkv7hH5BnuLbKBld6FGmQatDY/4LAjNy zD3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="ml/LGDeM"; 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 s40si6329966qtj.384.2020.02.24.14.25.59 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 24 Feb 2020 14:25:59 -0800 (PST) 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="ml/LGDeM"; 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]:45260 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j6MAo-0002WH-Ry for patch@linaro.org; Mon, 24 Feb 2020 17:25:58 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:37880) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j6M7l-0004OL-0i for qemu-devel@nongnu.org; Mon, 24 Feb 2020 17:22:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j6M7j-0005sN-Jo for qemu-devel@nongnu.org; Mon, 24 Feb 2020 17:22:48 -0500 Received: from mail-pf1-x443.google.com ([2607:f8b0:4864:20::443]:42367) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j6M7j-0005s0-EQ for qemu-devel@nongnu.org; Mon, 24 Feb 2020 17:22:47 -0500 Received: by mail-pf1-x443.google.com with SMTP id 4so6063238pfz.9 for ; Mon, 24 Feb 2020 14:22:47 -0800 (PST) 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=ABqg53SHadErlQ1KJw2EVsyG66DudT3m5ptP92s2kV4=; b=ml/LGDeM83+tA/QuI9WQvvsXX+P52t3WEQ5SAtw+bAXUiCz0nN4ReHgPEwUqPnhZsD fvaMa4fOI+ttGPyxkAZ9L1Lmrvf8zS1PcbbxL1VHrWWls1eInuHQnSTvLqjuv3VJ/z6j xEknPQQu8h1NZrIAz9KLGE92mSw1cUXs3TPPo7TxBramSMrtftYEeINKRFenVtvGrtQ3 ag2l6KyYT3IwXljfc13/ciUf7TWjY2fEQfAAmXsfiZFwCaVutE8sSFASLtWEi1hibzgz fXsfpQNt1C1TKFcdttXosEUF7SQv5UM7zM4I4khWEUSsKbbDQSICfBSyAWs4adBpF/uL +Kcg== 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=ABqg53SHadErlQ1KJw2EVsyG66DudT3m5ptP92s2kV4=; b=Wl/+dzLAELPNeJDe1FU30Hr+CwxUDVcENljyV7olbxWt1pLTva1OMxQS6ZP7pRx+iU vN26uoyeo6YBPQhZZHCkF5MYxA9U9nMCr0+D7k2kdGbzzZQjKocEu5IDQfCL4HWrsB5X 6wUHqNvTzRKZklvUIPgR1f/28g5X9cxRYJT/ZdwAXYtb/mmUdwLF7L56UfmvO3An6VoL Qsa89UKokj68SgB2UQgq7n3yT1vRgKjch8gIaS5PW6S09GXlw8pEoVPM94Xv7+eBpdTc TrtBBLltvtzG1BmFgR/hv3MZA07wPff5GpPliPG2ExlehQ5O4OVnRHPLCjKly/R/NzFY l0og== X-Gm-Message-State: APjAAAWyKTwrmmEN8reYwRAtUlFLUjvutgNW+iN5E52AgWi3bsaK2Z2j TV1nxdnrabbzZCpRW0v2c+x7pEdMBHM= X-Received: by 2002:a65:5905:: with SMTP id f5mr17972398pgu.87.1582582966092; Mon, 24 Feb 2020 14:22:46 -0800 (PST) Received: from localhost.localdomain (97-126-123-70.tukw.qwest.net. [97.126.123.70]) by smtp.gmail.com with ESMTPSA id o6sm13897097pgg.37.2020.02.24.14.22.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Feb 2020 14:22:45 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 09/17] target/arm: Replace ARM_FEATURE_VFP4 with isar_feature_aa32_simdfmac Date: Mon, 24 Feb 2020 14:22:24 -0800 Message-Id: <20200224222232.13807-10-richard.henderson@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200224222232.13807-1-richard.henderson@linaro.org> References: <20200224222232.13807-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::443 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" All remaining tests for VFP4 are for fused multiply-add insns. Since the MVFR1 field is used for both VFP and NEON, move its adjustment from the !has_neon block to the (!has_vfp && !has_neon) block. Test for vfp of the appropraite width alongside the test for simdfmac within translate-vfp.inc.c. Within disas_neon_data_insn, we have already tested for ARM_FEATURE_NEON. Signed-off-by: Richard Henderson --- v2: Applied Peter's fixups, plus test fpdp_v2 in trans_VFM_dp. --- target/arm/cpu.h | 12 ++++++++++++ target/arm/cpu.c | 6 +++++- target/arm/translate-vfp.inc.c | 22 ++++++++++++++++++---- target/arm/translate.c | 2 +- 4 files changed, 36 insertions(+), 6 deletions(-) -- 2.20.1 Reviewed-by: Peter Maydell diff --git a/target/arm/cpu.h b/target/arm/cpu.h index b94d2a5ace..b29b0eddfc 100644 --- a/target/arm/cpu.h +++ b/target/arm/cpu.h @@ -3514,6 +3514,18 @@ static inline bool isar_feature_aa32_fp16_dpconv(const ARMISARegisters *id) return FIELD_EX32(id->mvfr1, MVFR1, FPHP) > 1; } +/* + * Note that this ID register field covers both VFP and Neon FMAC, + * so should usually be tested in combination with some other + * check that confirms the presence of whichever of VFP or Neon is + * relevant, to avoid accidentally enabling a Neon feature on + * a VFP-no-Neon core or vice-versa. + */ +static inline bool isar_feature_aa32_simdfmac(const ARMISARegisters *id) +{ + return FIELD_EX32(id->mvfr1, MVFR1, SIMDFMAC) != 0; +} + static inline bool isar_feature_aa32_vsel(const ARMISARegisters *id) { return FIELD_EX32(id->mvfr2, MVFR2, FPMISC) >= 1; diff --git a/target/arm/cpu.c b/target/arm/cpu.c index f10f34b655..bdcaa46b8a 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -1501,7 +1501,6 @@ static void arm_cpu_realizefn(DeviceState *dev, Error **errp) u = FIELD_DP32(u, MVFR1, SIMDINT, 0); u = FIELD_DP32(u, MVFR1, SIMDSP, 0); u = FIELD_DP32(u, MVFR1, SIMDHP, 0); - u = FIELD_DP32(u, MVFR1, SIMDFMAC, 0); cpu->isar.mvfr1 = u; u = cpu->isar.mvfr2; @@ -1524,6 +1523,11 @@ static void arm_cpu_realizefn(DeviceState *dev, Error **errp) u = cpu->isar.mvfr0; u = FIELD_DP32(u, MVFR0, SIMDREG, 0); cpu->isar.mvfr0 = u; + + /* Despite the name, this field covers both VFP and Neon */ + u = cpu->isar.mvfr1; + u = FIELD_DP32(u, MVFR1, SIMDFMAC, 0); + cpu->isar.mvfr1 = u; } if (arm_feature(env, ARM_FEATURE_AARCH64) && diff --git a/target/arm/translate-vfp.inc.c b/target/arm/translate-vfp.inc.c index f88a95438f..03ba8d7aac 100644 --- a/target/arm/translate-vfp.inc.c +++ b/target/arm/translate-vfp.inc.c @@ -1803,11 +1803,18 @@ static bool trans_VFM_sp(DisasContext *s, arg_VFM_sp *a) /* * Present in VFPv4 only. + * Note that we can't rely on the SIMDFMAC check alone, because + * in a Neon-no-VFP core that ID register field will be non-zero. + */ + if (!dc_isar_feature(aa32_simdfmac, s) || + !dc_isar_feature(aa32_fpsp_v2, s)) { + return false; + } + /* * In v7A, UNPREDICTABLE with non-zero vector length/stride; from * v8A, must UNDEF. We choose to UNDEF for both v7A and v8A. */ - if (!arm_dc_feature(s, ARM_FEATURE_VFP4) || - (s->vec_len != 0 || s->vec_stride != 0)) { + if (s->vec_len != 0 || s->vec_stride != 0) { return false; } @@ -1861,11 +1868,18 @@ static bool trans_VFM_dp(DisasContext *s, arg_VFM_dp *a) /* * Present in VFPv4 only. + * Note that we can't rely on the SIMDFMAC check alone, because + * in a Neon-no-VFP core that ID register field will be non-zero. + */ + if (!dc_isar_feature(aa32_simdfmac, s) || + !dc_isar_feature(aa32_fpdp_v2, s)) { + return false; + } + /* * In v7A, UNPREDICTABLE with non-zero vector length/stride; from * v8A, must UNDEF. We choose to UNDEF for both v7A and v8A. */ - if (!arm_dc_feature(s, ARM_FEATURE_VFP4) || - (s->vec_len != 0 || s->vec_stride != 0)) { + if (s->vec_len != 0 || s->vec_stride != 0) { return false; } diff --git a/target/arm/translate.c b/target/arm/translate.c index 79880adaad..0489e0cdaa 100644 --- a/target/arm/translate.c +++ b/target/arm/translate.c @@ -5150,7 +5150,7 @@ static int disas_neon_data_insn(DisasContext *s, uint32_t insn) } break; case NEON_3R_VFM_VQRDMLSH: - if (!arm_dc_feature(s, ARM_FEATURE_VFP4)) { + if (!dc_isar_feature(aa32_simdfmac, s)) { return 1; } break; From patchwork Mon Feb 24 22:22:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 183787 Delivered-To: patch@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp925326ile; Mon, 24 Feb 2020 14:27:50 -0800 (PST) X-Google-Smtp-Source: APXvYqyXyXvCIHQf6VcaaHbeRXSKMR9m1VmpUk1sUzH49SIVCa7YB8MATa1PP6MLKoZuKmmuNkQt X-Received: by 2002:ac8:7b24:: with SMTP id l4mr50535328qtu.3.1582583270450; Mon, 24 Feb 2020 14:27:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582583270; cv=none; d=google.com; s=arc-20160816; b=HcX18F0j7mFFh/bKO7UOYN1DHqmfRwtYslGttQnd7i0ia8zqWx7w1fp/+FhUUQivOL w7jVNTBdyOvcMDpMr3wyW/M0uUFkrzdxw2F0R0N4zovrxWbxkPw+W9dCUjK7eR3B4MVt oW+a1/goCAZHKWwhBDHJpjyORgZlCYvZzTZSv2JMKJUnycyUoWhfehdnawDOCTQusTJ3 /dzUQRQIx/u5Z7I8Us2OCIEUUkYRCxbTruwb0NyCEAKksGzeMjLw3cjxDheBsgF8KG2o croGq+v3e8eOEueZrlB1PKpt7MXGrYIjvhSvYw9L9Sy1Vih3LLlxuFSrgf+TIxBbvu1y je7Q== 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=aSn4NAeocUzSgV/L7ik2kDrtmTdvw88vbNjqxC4Yo9c=; b=f6HmLGtio/UxTopf5QqvvDhSPbJ8De33wcXyW3PBPze8v6+nPEL57XRMF33Y5zDRGW pedv03nlCWD7Fcb6uohXtCIUl1ZQXqqPFJrPT9gpVbBGzU1UrDf+3QKJ3HQjT3yv3F7a tuzRxPrg1YHBZR9e+CzFhKvPrIXgsPNZB+jNnor+L3yQp+aWPzcx9Gr+bp7Jnk+gKuxu cCtvVw0vNdj7gFWznXzQxiXRiO6L7IZsOrG9jrRZEfIsGhXqNQCzYK4rberF1h1cely/ YWPQeF2JiBCb2Qc51hDw3GnBKhpywNwbXpLwdy/kzOPkicvPgGhhGjiX83JF5WYC+cvk z/0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TBKc1TFH; 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 b19si1788935qkc.272.2020.02.24.14.27.50 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 24 Feb 2020 14:27:50 -0800 (PST) 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=TBKc1TFH; 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]:45318 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j6MCb-0005YN-TI for patch@linaro.org; Mon, 24 Feb 2020 17:27:49 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:37896) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j6M7l-0004Q9-Lw for qemu-devel@nongnu.org; Mon, 24 Feb 2020 17:22:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j6M7k-0005sz-MD for qemu-devel@nongnu.org; Mon, 24 Feb 2020 17:22:49 -0500 Received: from mail-pf1-x442.google.com ([2607:f8b0:4864:20::442]:38331) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j6M7k-0005sg-HJ for qemu-devel@nongnu.org; Mon, 24 Feb 2020 17:22:48 -0500 Received: by mail-pf1-x442.google.com with SMTP id x185so6073421pfc.5 for ; Mon, 24 Feb 2020 14:22:48 -0800 (PST) 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=aSn4NAeocUzSgV/L7ik2kDrtmTdvw88vbNjqxC4Yo9c=; b=TBKc1TFH1MMrxxLoVXabVlAV3gqrsgo51CyXapcsrKPErDkzNFao8O+HimXPIXMkg6 mz460C2vxEDWs9gdokRZxbg+5mwHXlh8tGuh8ohO1U/AHeSH1K5Qa3iNTv6FVXtr9ulb ExI0aQ9IQj7nx9KiV6NUvd1+fNDPffQCj9XHkqQGO/On7bQ7BUnKf2TqqTqjWju8ygEo kUV9+XNmz3AyRxW+ZgZrU1qa8Yh/p9ldWDH+rS11GGfCwYGJT9ZI9X/QlrK/Gmaw05aN DRifucgRRgm473OC7VXWhcPBKSWWCcZDqqNd7hZYxBdPatYud8GxbeK56sy6EESVZ5bi sbnA== 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=aSn4NAeocUzSgV/L7ik2kDrtmTdvw88vbNjqxC4Yo9c=; b=Cw4Gsr1xlkn+8f3bBOK0qqzb6s7pNWLpwGEs13tJbNkz7CkacenyIJigwye9Ag6eNU 27gxPx+CCjMsk5uvNChQrCEJetnDtS/0ZYXqeeM/iL4VC1b9qxR3NeoFRi+HcxLjS5L0 eXMlgFymN73ylV9U5BROfPNY4dqnMewz5oh7InNVVM6G3Hc3yCBeveuuCGBCSuqW8CfV jn68mRL9CTQvOqlhxIeXOMfu6ej7Zw+/YgP1MMgZITahnghGXXwiP3/KuaKWR8enY6Te v1Hk1JtytKyPYnNJQBIDpBYJP+sfd7RsxHeHqjUcAFEiIv3puZyqBLPh6YLZQGzOu393 MjIQ== X-Gm-Message-State: APjAAAWSh/YxXlTDdbquS1k05xQ4VYcDG5Gr/5PVsMbjZd3E7XdL2FCc XL0EjRNBdO2vmgk/sef6w0sevQw44SY= X-Received: by 2002:a62:1594:: with SMTP id 142mr53296303pfv.18.1582582967322; Mon, 24 Feb 2020 14:22:47 -0800 (PST) Received: from localhost.localdomain (97-126-123-70.tukw.qwest.net. [97.126.123.70]) by smtp.gmail.com with ESMTPSA id o6sm13897097pgg.37.2020.02.24.14.22.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Feb 2020 14:22:46 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 10/17] target/arm: Remove ARM_FEATURE_VFP check from disas_vfp_insn Date: Mon, 24 Feb 2020 14:22:25 -0800 Message-Id: <20200224222232.13807-11-richard.henderson@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200224222232.13807-1-richard.henderson@linaro.org> References: <20200224222232.13807-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::442 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" We now have proper ISA checks within each trans_* function. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/arm/translate.c | 4 ---- 1 file changed, 4 deletions(-) -- 2.20.1 diff --git a/target/arm/translate.c b/target/arm/translate.c index 0489e0cdaa..893911fca7 100644 --- a/target/arm/translate.c +++ b/target/arm/translate.c @@ -2652,10 +2652,6 @@ static void gen_neon_dup_high16(TCGv_i32 var) */ static int disas_vfp_insn(DisasContext *s, uint32_t insn) { - if (!arm_dc_feature(s, ARM_FEATURE_VFP)) { - return 1; - } - /* * If the decodetree decoder handles this insn it will always * emit code to either execute the insn or generate an appropriate From patchwork Mon Feb 24 22:22:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 183784 Delivered-To: patch@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp924465ile; Mon, 24 Feb 2020 14:26:43 -0800 (PST) X-Google-Smtp-Source: APXvYqzfAdtybF1FBuDzQ9SajBSlzA7oh41wIOtZheiZ4pE+HiJhSUDFXpuXhdPgyoYMuP5z53mO X-Received: by 2002:ac8:46d1:: with SMTP id h17mr49032501qto.309.1582583203093; Mon, 24 Feb 2020 14:26:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582583203; cv=none; d=google.com; s=arc-20160816; b=c7f6FFDpP0UarRceUGhXicCM5cT+UYcI+UCM/TC87XUv42R3Y75rgTJD30R9YsZPke DSuZ3trozVO62hvKpcq67yPqJjDHddeYtxcX/Hsd4W8m6AOBlPuoBdh6fLNXOKqlrOBp HnRKGV/NyIZFzSuyDeJ3Oe27j5S64JIvf1Wre1bRIrm1mX7b/DZYZlqJncpYtHCxRbPs vd2zTw9lxM+sIfDiBfcxToqMhaOFedO7TZuZ1UBCcWnFHy9U95E05OL+aH6T8zUY/6Yz QJte72WnlOncrO7BFSoEUN9cK/7ozBZV5w8EIu0XKglcuacB8a9p8YWaeWl/AxGv/VV7 L5Kw== 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=/XrE+Up+cXUxsM0gL0c1JdFdbzGsxHOx44lIg6PgF9w=; b=Vq1d6PhH4vL60u7kYzhqMgZNCtUBBREJAe2n1plri+N+p6gAv4gRAaHfke35ms7llp LSXIsWu89Q+yenaoVWKByU7zcqY93xfyDjXgM+CDtbkk5HKXeEVWaGMXaASZPt/DbMmd gq72wvRKaH7W8KBrfLg2gNNFkHvjHY4+BCZHNi2J7cPU4ypFY3U3OOFczqNB9BPkcG7D 323mg+hw9998y6NQuyUwQ1uMCSwcfI6S1Z0HoJa5mANbJMLtxmtWZnNjLvkG75PR8HpP 1eUgjBQLO4bbE5wKxsV8Nw+twEkeuRdt+8ioka6eRc7BAdB05G+upzx6BPstpCYSc83j iMTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DqnWzbNx; 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 j22si6863824qkl.215.2020.02.24.14.26.43 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 24 Feb 2020 14:26:43 -0800 (PST) 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=DqnWzbNx; 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]:45278 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j6MBW-0003Dq-KG for patch@linaro.org; Mon, 24 Feb 2020 17:26:42 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:37932) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j6M7n-0004UJ-DB for qemu-devel@nongnu.org; Mon, 24 Feb 2020 17:22:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j6M7m-0005u6-5l for qemu-devel@nongnu.org; Mon, 24 Feb 2020 17:22:51 -0500 Received: from mail-pg1-x544.google.com ([2607:f8b0:4864:20::544]:41734) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j6M7m-0005tc-0M for qemu-devel@nongnu.org; Mon, 24 Feb 2020 17:22:50 -0500 Received: by mail-pg1-x544.google.com with SMTP id 70so5836646pgf.8 for ; Mon, 24 Feb 2020 14:22:49 -0800 (PST) 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=/XrE+Up+cXUxsM0gL0c1JdFdbzGsxHOx44lIg6PgF9w=; b=DqnWzbNxh8Dfu17ddDQn6T1OQZu7vWr0VryhkU2LOZ3wVTZveXG9VwFPACvyX+kotp luzQ7dsUURqJH7TyJ2FN3f2GeTRWagyzbhLScn88M+tTqxsOWaK1MtYglgqD5fcuMBXL lBt+Hfd8auzVoPlx62lOZK7HHNhECi3LWw+Wy75KwWRpex/bbKjlr6fWsG4im72D+yB0 Oi3hAUYfD/rG3jVK5glITd5G7LkywlFAiLTU8jPPyr6bGmRTVFEGUsyRkhlXzzyADx72 WBguXTUcEQFICZfq7KdmKtEE3hi8ZmfcU4lQDvo50Io5/5mI4LD/Nemrt/kbN5JfR3KP zgUA== 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=/XrE+Up+cXUxsM0gL0c1JdFdbzGsxHOx44lIg6PgF9w=; b=HXuWHqOZ81acdgnMavu5KOeRrlnoLq90b33O80OZvghhX57baKDBFX7kkbkwi/6ne0 NKM8heEzrAXs66eCWNYp/eI6TJlmLyC6J4k+1rPj/86dEN/LO7QJZh7LSosNymWUdB7P I/yX3LgZiRLyiKF23M8Wrs+1VYkxRl0SLEhIGzYmKtaE541wmaD2zY09i+i4TKadzUrI PJcHaM13tUYAsbxaxTwWq++cBy5xXthOEaX3c7ZLuiPJd7CPB86aj9Sm30ibhmFnfnew cwwoyNwKA5wDDBved6JskxrPsOlCiWc2OvqicyoPD5XTDGVK/jsIm0gPrGOtXZP8JayJ OWlw== X-Gm-Message-State: APjAAAUqTsewjQUPgFQ5UfRcPN5qgpiW/n2K8yJturKROL0fGCINzvLr dzrCDU5VWsgiQvy2+LU1L+7T0+nj3nE= X-Received: by 2002:a62:7b93:: with SMTP id w141mr55183624pfc.226.1582582968607; Mon, 24 Feb 2020 14:22:48 -0800 (PST) Received: from localhost.localdomain (97-126-123-70.tukw.qwest.net. [97.126.123.70]) by smtp.gmail.com with ESMTPSA id o6sm13897097pgg.37.2020.02.24.14.22.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Feb 2020 14:22:48 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 11/17] target/arm: Move VLLDM and VLSTM to vfp.decode Date: Mon, 24 Feb 2020 14:22:26 -0800 Message-Id: <20200224222232.13807-12-richard.henderson@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200224222232.13807-1-richard.henderson@linaro.org> References: <20200224222232.13807-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::544 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" Now that we no longer have an early check for ARM_FEATURE_VFP, we can use the proper ISA check in trans_VLLDM_VLSTM. Signed-off-by: Richard Henderson --- v2: Fix !secure (pmm) --- target/arm/vfp.decode | 2 ++ target/arm/translate-vfp.inc.c | 39 +++++++++++++++++++++++++ target/arm/translate.c | 53 ++++++---------------------------- 3 files changed, 50 insertions(+), 44 deletions(-) -- 2.20.1 Reviewed-by: Peter Maydell diff --git a/target/arm/vfp.decode b/target/arm/vfp.decode index a67b3f29ee..592fe9e1e4 100644 --- a/target/arm/vfp.decode +++ b/target/arm/vfp.decode @@ -242,3 +242,5 @@ VCVT_sp_int ---- 1110 1.11 110 s:1 .... 1010 rz:1 1.0 .... \ vd=%vd_sp vm=%vm_sp VCVT_dp_int ---- 1110 1.11 110 s:1 .... 1011 rz:1 1.0 .... \ vd=%vd_sp vm=%vm_dp + +VLLDM_VLSTM 1110 1100 001 l:1 rn:4 0000 1010 0000 0000 diff --git a/target/arm/translate-vfp.inc.c b/target/arm/translate-vfp.inc.c index 03ba8d7aac..1964af3ea5 100644 --- a/target/arm/translate-vfp.inc.c +++ b/target/arm/translate-vfp.inc.c @@ -2828,3 +2828,42 @@ static bool trans_VCVT_dp_int(DisasContext *s, arg_VCVT_dp_int *a) tcg_temp_free_ptr(fpst); return true; } + +/* + * Decode VLLDM and VLSTM are nonstandard because: + * * if there is no FPU then these insns must NOP in + * Secure state and UNDEF in Nonsecure state + * * if there is an FPU then these insns do not have + * the usual behaviour that vfp_access_check() provides of + * being controlled by CPACR/NSACR enable bits or the + * lazy-stacking logic. + */ +static bool trans_VLLDM_VLSTM(DisasContext *s, arg_VLLDM_VLSTM *a) +{ + TCGv_i32 fptr; + + if (!arm_dc_feature(s, ARM_FEATURE_M) || + !arm_dc_feature(s, ARM_FEATURE_V8)) { + return false; + } + /* If not secure, UNDEF. */ + if (!s->v8m_secure) { + return false; + } + /* If no fpu, NOP. */ + if (!dc_isar_feature(aa32_vfp, s)) { + return true; + } + + fptr = load_reg(s, a->rn); + if (a->l) { + gen_helper_v7m_vlldm(cpu_env, fptr); + } else { + gen_helper_v7m_vlstm(cpu_env, fptr); + } + tcg_temp_free_i32(fptr); + + /* End the TB, because we have updated FP control bits */ + s->base.is_jmp = DISAS_UPDATE; + return true; +} diff --git a/target/arm/translate.c b/target/arm/translate.c index 893911fca7..5b7cad1ea2 100644 --- a/target/arm/translate.c +++ b/target/arm/translate.c @@ -10962,53 +10962,18 @@ static void disas_thumb2_insn(DisasContext *s, uint32_t insn) goto illegal_op; /* op0 = 0b11 : unallocated */ } - /* - * Decode VLLDM and VLSTM first: these are nonstandard because: - * * if there is no FPU then these insns must NOP in - * Secure state and UNDEF in Nonsecure state - * * if there is an FPU then these insns do not have - * the usual behaviour that disas_vfp_insn() provides of - * being controlled by CPACR/NSACR enable bits or the - * lazy-stacking logic. - */ - if (arm_dc_feature(s, ARM_FEATURE_V8) && - (insn & 0xffa00f00) == 0xec200a00) { - /* 0b1110_1100_0x1x_xxxx_xxxx_1010_xxxx_xxxx - * - VLLDM, VLSTM - * We choose to UNDEF if the RAZ bits are non-zero. - */ - if (!s->v8m_secure || (insn & 0x0040f0ff)) { + if (disas_vfp_insn(s, insn)) { + if (((insn >> 8) & 0xe) == 10 && + dc_isar_feature(aa32_fpsp_v2, s)) { + /* FP, and the CPU supports it */ goto illegal_op; + } else { + /* All other insns: NOCP */ + gen_exception_insn(s, s->pc_curr, EXCP_NOCP, + syn_uncategorized(), + default_exception_el(s)); } - - if (arm_dc_feature(s, ARM_FEATURE_VFP)) { - uint32_t rn = (insn >> 16) & 0xf; - TCGv_i32 fptr = load_reg(s, rn); - - if (extract32(insn, 20, 1)) { - gen_helper_v7m_vlldm(cpu_env, fptr); - } else { - gen_helper_v7m_vlstm(cpu_env, fptr); - } - tcg_temp_free_i32(fptr); - - /* End the TB, because we have updated FP control bits */ - s->base.is_jmp = DISAS_UPDATE; - } - break; } - if (arm_dc_feature(s, ARM_FEATURE_VFP) && - ((insn >> 8) & 0xe) == 10) { - /* FP, and the CPU supports it */ - if (disas_vfp_insn(s, insn)) { - goto illegal_op; - } - break; - } - - /* All other insns: NOCP */ - gen_exception_insn(s, s->pc_curr, EXCP_NOCP, syn_uncategorized(), - default_exception_el(s)); break; } if ((insn & 0xfe000a00) == 0xfc000800 From patchwork Mon Feb 24 22:22:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 183797 Delivered-To: patch@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp932667ile; Mon, 24 Feb 2020 14:36:37 -0800 (PST) X-Google-Smtp-Source: APXvYqzPwvFY/i8nNA475ZpHBHT42fmA4HnajdhNegn4DZrRTk+Prg/D3Er8/pyLIzkl8Efjzfwp X-Received: by 2002:ac8:2a55:: with SMTP id l21mr52123104qtl.111.1582583797486; Mon, 24 Feb 2020 14:36:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582583797; cv=none; d=google.com; s=arc-20160816; b=LN+mNSrxdrFWB3g1oPtRBqSyLUu7K6ewNG+4mdbskmVsH6PnrsWrgoaFwgCIcRF5yP olwsvGNnIXv4z3uOt0TCOKrE+meIKz2N5jUvDt50y85oaaU3eOCZe31/HncH0fPEEdVd 0gl58GCkx7vlJU0J72zEB5F1ngqoa9ju6GRkqe0EDXAEiWcFHY66PL1ZwIujpktoggxS DX9LDJIhoJFL8TGZsk/aXbonC+u+0w/nUJB5OMSlpb7LAuut9+3cNJKc33yLwglaxw0d qZGNu+f8JXSyPlt2TnKqVEzzSTVDJLVj592HCzhtA7yFJhMSw+82cI7ISjzOa3gDrtIz ifBw== 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=Jm8KlY79fmi10gEwUaheKwxsBU3LYmbPeN5QBjFnnb0=; b=MbLHAQxwNJMremFMPRLKJq7BGpBnRaE7x/5/RERoOamwAtDq/AiQ8goQgzRmt8hOV1 S7VNbSR5OO/F4AVyK8HshRnGWEE7HJ36VrHTg1UZYInstLe+jhQVst9+UWWsrBoLm1kZ at9dG5EL8MKOiCuzvyHda8pNVuiKyubOBbq047S5RF7KVOjFRpOoX8fQKfsVT/U0SMqI TDss1N5/ho34Fjd2SYuzcda7zTxXN3AGVJAiqyK+Mto+FzJF5+VLfCJBtNCRrbyc9f0V rNqqb1RgN5GcuwqtR8iixxBcD5TF/5qnNfKzlytehns9DS34dyhClb5BUdr1/eCBHV0K fFoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=tF5EoHy5; 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 j26si6514446qka.48.2020.02.24.14.36.37 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 24 Feb 2020 14:36:37 -0800 (PST) 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=tF5EoHy5; 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]:45574 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j6ML7-0001tI-14 for patch@linaro.org; Mon, 24 Feb 2020 17:36:37 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:37955) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j6M7o-0004Xp-Pt for qemu-devel@nongnu.org; Mon, 24 Feb 2020 17:22:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j6M7n-0005us-Cv for qemu-devel@nongnu.org; Mon, 24 Feb 2020 17:22:52 -0500 Received: from mail-pg1-x543.google.com ([2607:f8b0:4864:20::543]:46341) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j6M7n-0005uN-6V for qemu-devel@nongnu.org; Mon, 24 Feb 2020 17:22:51 -0500 Received: by mail-pg1-x543.google.com with SMTP id y30so5817897pga.13 for ; Mon, 24 Feb 2020 14:22:51 -0800 (PST) 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=Jm8KlY79fmi10gEwUaheKwxsBU3LYmbPeN5QBjFnnb0=; b=tF5EoHy5mkqDGJ11etcAOiB0Np57GLPUdwsPK1yz19pH0koGH/STl2Yc73VDAWUgAh NdMaFiBTz/m0AgPc41k0z+WeYCY7EoYDLsq+ttMBFy95yDu0iyl8EBY+nQ1AiBYyuWPB owt6cWmAv/x+1NU12HAuE+eaMv6RydEtWKiTi95pALW1Q3zEBPY9kkL/hJVBZHNE6Jd5 5FlAuAYCr+VouSgI+8lUb6FZCo8DP4zjcZ7w59QZBng0cUjQun7RUdcCEMOPMbLx1A9v YtnMTi3yiQTJXWJT/T2VF0kWoPmUKxPlqwL3bm4YM5b2ewvHkTf/a2N++NnCmt721GlC TVUA== 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=Jm8KlY79fmi10gEwUaheKwxsBU3LYmbPeN5QBjFnnb0=; b=RxmscznJrQEcYEYPaSag40yF7v8JP2v4dEdZr8xlHLxLyxaM6DwxgAzydS9I1zzWm8 zWcP16/ESR0NDPi2x7zCWfjsqesBhz8rnc+MsTG4fJZPJD1zFiZd1+BKMCfhjeT1d9q6 ms9hphNby7gCylFqwojUeLiwgyrT2Hq6BUjyacZAEquET7Al4d4nD8N4UjHsW37k4rKo iEGPOMs2Ca1XQCBrULObMx6yu/VCFFg+cnLFV9rjrk6O+q+UqG4gPNW78Ic2FPvuQY2a i4kUD9xVCZsg62fvWnzyixM9zlgP9rqym3uhjdlHThGdmVib/XDsGsVsl7R3OiWijn1T U1Mg== X-Gm-Message-State: APjAAAX0Bvh8kQS/LushH/M4sBIDwIveCsLuXf0PRXB0tTaLxJAC8Dfr J2eziG7PKH9NBtVi4YpuGoPT8wrYQ2s= X-Received: by 2002:a62:ab06:: with SMTP id p6mr29829193pff.52.1582582969821; Mon, 24 Feb 2020 14:22:49 -0800 (PST) Received: from localhost.localdomain (97-126-123-70.tukw.qwest.net. [97.126.123.70]) by smtp.gmail.com with ESMTPSA id o6sm13897097pgg.37.2020.02.24.14.22.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Feb 2020 14:22:49 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 12/17] target/arm: Move the vfp decodetree calls next to the base isa Date: Mon, 24 Feb 2020 14:22:27 -0800 Message-Id: <20200224222232.13807-13-richard.henderson@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200224222232.13807-1-richard.henderson@linaro.org> References: <20200224222232.13807-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::543 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" Have the calls adjacent as an intermediate step toward actually merging the decodes. Signed-off-by: Richard Henderson --- v2: Fix fallthrough in disas_arm_insn vs vfp insns. --- target/arm/translate.c | 83 +++++++++++++++--------------------------- 1 file changed, 29 insertions(+), 54 deletions(-) -- 2.20.1 Reviewed-by: Peter Maydell diff --git a/target/arm/translate.c b/target/arm/translate.c index 5b7cad1ea2..6259064ea7 100644 --- a/target/arm/translate.c +++ b/target/arm/translate.c @@ -2646,31 +2646,6 @@ static void gen_neon_dup_high16(TCGv_i32 var) tcg_temp_free_i32(tmp); } -/* - * Disassemble a VFP instruction. Returns nonzero if an error occurred - * (ie. an undefined instruction). - */ -static int disas_vfp_insn(DisasContext *s, uint32_t insn) -{ - /* - * If the decodetree decoder handles this insn it will always - * emit code to either execute the insn or generate an appropriate - * exception; so we don't need to ever return non-zero to tell - * the calling code to emit an UNDEF exception. - */ - if (extract32(insn, 28, 4) == 0xf) { - if (disas_vfp_uncond(s, insn)) { - return 0; - } - } else { - if (disas_vfp(s, insn)) { - return 0; - } - } - /* If the decodetree decoder didn't handle this insn, it must be UNDEF */ - return 1; -} - static inline bool use_goto_tb(DisasContext *s, target_ulong dest) { #ifndef CONFIG_USER_ONLY @@ -10778,7 +10753,9 @@ static void disas_arm_insn(DisasContext *s, unsigned int insn) ARCH(5); /* Unconditional instructions. */ - if (disas_a32_uncond(s, insn)) { + /* TODO: Perhaps merge these into one decodetree output file. */ + if (disas_a32_uncond(s, insn) || + disas_vfp_uncond(s, insn)) { return; } /* fall back to legacy decoder */ @@ -10805,13 +10782,6 @@ static void disas_arm_insn(DisasContext *s, unsigned int insn) } return; } - if ((insn & 0x0f000e10) == 0x0e000a00) { - /* VFP. */ - if (disas_vfp_insn(s, insn)) { - goto illegal_op; - } - return; - } if ((insn & 0x0e000f00) == 0x0c000100) { if (arm_dc_feature(s, ARM_FEATURE_IWMMXT)) { /* iWMMXt register transfer. */ @@ -10842,7 +10812,9 @@ static void disas_arm_insn(DisasContext *s, unsigned int insn) arm_skip_unless(s, cond); } - if (disas_a32(s, insn)) { + /* TODO: Perhaps merge these into one decodetree output file. */ + if (disas_a32(s, insn) || + disas_vfp(s, insn)) { return; } /* fall back to legacy decoder */ @@ -10852,11 +10824,10 @@ static void disas_arm_insn(DisasContext *s, unsigned int insn) case 0xd: case 0xe: if (((insn >> 8) & 0xe) == 10) { - /* VFP. */ - if (disas_vfp_insn(s, insn)) { - goto illegal_op; - } - } else if (disas_coproc_insn(s, insn)) { + /* VFP, but failed disas_vfp. */ + goto illegal_op; + } + if (disas_coproc_insn(s, insn)) { /* Coprocessor. */ goto illegal_op; } @@ -10945,7 +10916,14 @@ static void disas_thumb2_insn(DisasContext *s, uint32_t insn) ARCH(6T2); } - if (disas_t32(s, insn)) { + /* + * TODO: Perhaps merge these into one decodetree output file. + * Note disas_vfp is written for a32 with cond field in the + * top nibble. The t32 encoding requires 0xe in the top nibble. + */ + if (disas_t32(s, insn) || + disas_vfp_uncond(s, insn) || + ((insn >> 28) == 0xe && disas_vfp(s, insn))) { return; } /* fall back to legacy decoder */ @@ -10962,17 +10940,15 @@ static void disas_thumb2_insn(DisasContext *s, uint32_t insn) goto illegal_op; /* op0 = 0b11 : unallocated */ } - if (disas_vfp_insn(s, insn)) { - if (((insn >> 8) & 0xe) == 10 && - dc_isar_feature(aa32_fpsp_v2, s)) { - /* FP, and the CPU supports it */ - goto illegal_op; - } else { - /* All other insns: NOCP */ - gen_exception_insn(s, s->pc_curr, EXCP_NOCP, - syn_uncategorized(), - default_exception_el(s)); - } + if (((insn >> 8) & 0xe) == 10 && + dc_isar_feature(aa32_fpsp_v2, s)) { + /* FP, and the CPU supports it */ + goto illegal_op; + } else { + /* All other insns: NOCP */ + gen_exception_insn(s, s->pc_curr, EXCP_NOCP, + syn_uncategorized(), + default_exception_el(s)); } break; } @@ -10995,9 +10971,8 @@ static void disas_thumb2_insn(DisasContext *s, uint32_t insn) goto illegal_op; } } else if (((insn >> 8) & 0xe) == 10) { - if (disas_vfp_insn(s, insn)) { - goto illegal_op; - } + /* VFP, but failed disas_vfp. */ + goto illegal_op; } else { if (insn & (1 << 28)) goto illegal_op; From patchwork Mon Feb 24 22:22:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 183786 Delivered-To: patch@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp925243ile; Mon, 24 Feb 2020 14:27:42 -0800 (PST) X-Google-Smtp-Source: APXvYqzyiOdVlDHcFa8115F0ktgL5MRTw4I9wc8khRBfhlG7IPNJ6r1MS3THLCo3/R4yoYZRIhxT X-Received: by 2002:ac8:a8b:: with SMTP id d11mr48549563qti.94.1582583262548; Mon, 24 Feb 2020 14:27:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582583262; cv=none; d=google.com; s=arc-20160816; b=qR/rpHbGkicI2YfpKWzURs8hR12QAtBXdPdbecdg41iAN0JVr4sAXQM0MYzaI5kHpb 8sMI5O26kAMH9cwlHKsSf+W3f/tF4AN65UveIbztSTf3dZJ7kwwEmMVPuT5m5lZW4KCJ 6TAaU5abVW25scSXE2ys4Rbk5hSEF+88NgVCTr8pHFW5cxs8JuBvAvfBwmFkjJ9zobYP kmb3JUoJKjh32ETKfq/aUiulZJVw5AkXK68ae8p7KTrTEKJZ9gbNr9LKO1X35ns/tB7d WLu7YOjueklgHTpS25eOa1yqppW+nLktkcCVQAMkpzfK6JQD+G2vuduiDz/2910e5KYY AWpA== 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=+oOoLUU3WLw+5ICoiVu4+Hc3ZhB0R58hfDF27U8damo=; b=XL9ogU1Q1+I5G4u62LdzjsjiTvWCk9epIXsirtEiJDu7PM0FPJF4wbFkYZgGWpidcq fmva4SV614HSTtUMd8Hn3bGn2eXsY/X+RpCFwbkTYx9Q8ApFB+x2946Ryy0fHh0MnQM/ RNpuGhGdGhTPvUB0+O+O9ySB5o/9c05cmBKQbweFNmgZ8G+hjVDs1HPAQJiLh8k7LhYZ kFZcU+27wYny8LV+QkCa1w7Z4ksocsahwJcx1ZQpoXYk/ojOIgqwTLJi+3Hkspmgw+d+ /9iDkxe/0sNEEyTj6dPLhOb4j2zzV8eZ/DprOYmRkDTYstRvEKgAto2JLPZyjbVaEhRE 9dDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rdl7P8Hq; 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 d5si6372685qtq.370.2020.02.24.14.27.42 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 24 Feb 2020 14:27:42 -0800 (PST) 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=rdl7P8Hq; 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]:45305 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j6MCU-0004pz-21 for patch@linaro.org; Mon, 24 Feb 2020 17:27:42 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:37983) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j6M7q-0004cD-Dj for qemu-devel@nongnu.org; Mon, 24 Feb 2020 17:22:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j6M7p-0005wD-9i for qemu-devel@nongnu.org; Mon, 24 Feb 2020 17:22:54 -0500 Received: from mail-pf1-x441.google.com ([2607:f8b0:4864:20::441]:42366) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j6M7p-0005va-4s for qemu-devel@nongnu.org; Mon, 24 Feb 2020 17:22:53 -0500 Received: by mail-pf1-x441.google.com with SMTP id 4so6063337pfz.9 for ; Mon, 24 Feb 2020 14:22:53 -0800 (PST) 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=+oOoLUU3WLw+5ICoiVu4+Hc3ZhB0R58hfDF27U8damo=; b=rdl7P8Hq3/Kg6rc5J+JkXLQCkrD0N+nW18ABtWYzqGWWkBGsh7eEjsudKWGDZ7ZfEY wZoQL1mW+Hc49keUzSaVOAlix7bgnO1oLscek8OrwZ32UHD6WQoIgb+ZdMIm1eXyYzbU UAa4rWrVsgHqo601t0T5xz00ihQS1EL0lCeJgC/jyJAQzcLyattgoA717oZhwROmD7Q4 tTDjkP/nIgC5ApOYGOu7JhW7323wE4rWCpGlZylwqmLrMdlWxl28SNhzcfjyff7dOvcj wMLhEU7rGOCfm1JNTy7p8quWT4edfyC1/VPbxboWZUjgZUqv4wxOIuM1XYNTe/FSWHV/ OkkQ== 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=+oOoLUU3WLw+5ICoiVu4+Hc3ZhB0R58hfDF27U8damo=; b=mL0YQ1wRfHxjtG0m3dJwT/d5fONL/kNsC0MhxS/VyzLZ6+SLz9SpiwhQJcRjtVfjQB OOSZJEVSQwDBI/KS0gG5h5T89BOwNqYcg+Nj7PLZydUM0CPeM3a74RNegQ2HdEl/Hcja exmqRr4vNodd/wh5Hssb7vLGLFmLCKxP5AMBb6tnyHPLop4PzeqkHGApjf7mumb+Hvt3 RFWntUut5Al4gOD3SzYhjzdsa2Ri5iuPxDnk9IG2PGKoNj/7m9R7Iuta0gdtjvmO7sHz w95QyC4XdjqzgGYFCY73QSPBNUmWzdNMjWDriJXhkoRVjosIkgBfOACfEGamLWmP28JL N1Dg== X-Gm-Message-State: APjAAAWIAewxJFMWEphoVfdPhZsI+D0c90XqGaayUtk8Tp3+GT1ymBoS dgis1ti52NvgTEuUeDcnL7o5QRROvgI= X-Received: by 2002:a62:1dca:: with SMTP id d193mr54769709pfd.140.1582582971891; Mon, 24 Feb 2020 14:22:51 -0800 (PST) Received: from localhost.localdomain (97-126-123-70.tukw.qwest.net. [97.126.123.70]) by smtp.gmail.com with ESMTPSA id o6sm13897097pgg.37.2020.02.24.14.22.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Feb 2020 14:22:51 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 13/17] linux-user/arm: Replace ARM_FEATURE_VFP* tests for HWCAP Date: Mon, 24 Feb 2020 14:22:28 -0800 Message-Id: <20200224222232.13807-14-richard.henderson@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200224222232.13807-1-richard.henderson@linaro.org> References: <20200224222232.13807-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::441 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" Use isar feature tests instead of feature bit tests. Although none of QEMUs current cpus have VFPv3 without D32, replace the large comment explaining why with one line that sets ARM_HWCAP_ARM_VFPv3D16 under the correct conditions. Mirror the test sequence used in the linux kernel. Signed-off-by: Richard Henderson --- v2: Use isar_feature_aa32_vfp. --- linux-user/elfload.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) -- 2.20.1 Reviewed-by: Peter Maydell diff --git a/linux-user/elfload.c b/linux-user/elfload.c index b1a895f24c..86cda127b7 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -468,22 +468,25 @@ static uint32_t get_elf_hwcap(void) /* EDSP is in v5TE and above, but all our v5 CPUs are v5TE */ GET_FEATURE(ARM_FEATURE_V5, ARM_HWCAP_ARM_EDSP); - GET_FEATURE(ARM_FEATURE_VFP, ARM_HWCAP_ARM_VFP); GET_FEATURE(ARM_FEATURE_IWMMXT, ARM_HWCAP_ARM_IWMMXT); GET_FEATURE(ARM_FEATURE_THUMB2EE, ARM_HWCAP_ARM_THUMBEE); GET_FEATURE(ARM_FEATURE_NEON, ARM_HWCAP_ARM_NEON); - GET_FEATURE(ARM_FEATURE_VFP3, ARM_HWCAP_ARM_VFPv3); GET_FEATURE(ARM_FEATURE_V6K, ARM_HWCAP_ARM_TLS); - GET_FEATURE(ARM_FEATURE_VFP4, ARM_HWCAP_ARM_VFPv4); + GET_FEATURE(ARM_FEATURE_LPAE, ARM_HWCAP_ARM_LPAE); GET_FEATURE_ID(aa32_arm_div, ARM_HWCAP_ARM_IDIVA); GET_FEATURE_ID(aa32_thumb_div, ARM_HWCAP_ARM_IDIVT); - /* All QEMU's VFPv3 CPUs have 32 registers, see VFP_DREG in translate.c. - * Note that the ARM_HWCAP_ARM_VFPv3D16 bit is always the inverse of - * ARM_HWCAP_ARM_VFPD32 (and so always clear for QEMU); it is unrelated - * to our VFP_FP16 feature bit. - */ - GET_FEATURE(ARM_FEATURE_VFP3, ARM_HWCAP_ARM_VFPD32); - GET_FEATURE(ARM_FEATURE_LPAE, ARM_HWCAP_ARM_LPAE); + GET_FEATURE_ID(aa32_vfp, ARM_HWCAP_ARM_VFP); + + if (cpu_isar_feature(aa32_fpsp_v3, cpu) || + cpu_isar_feature(aa32_fpdp_v3, cpu)) { + hwcaps |= ARM_HWCAP_ARM_VFPv3; + if (cpu_isar_feature(aa32_simd_r32, cpu)) { + hwcaps |= ARM_HWCAP_ARM_VFPD32; + } else { + hwcaps |= ARM_HWCAP_ARM_VFPv3D16; + } + } + GET_FEATURE_ID(aa32_simdfmac, ARM_HWCAP_ARM_VFPv4); return hwcaps; } From patchwork Mon Feb 24 22:22:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 183791 Delivered-To: patch@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp927358ile; Mon, 24 Feb 2020 14:30:32 -0800 (PST) X-Google-Smtp-Source: APXvYqz9P34nq3qBKN9JBQM7SBbWg4D9Tb1nN2WAszJpRCDimDKJ8NWKko3GhzQ5e6JE3Axn/mnD X-Received: by 2002:ac8:424f:: with SMTP id r15mr49617420qtm.71.1582583432478; Mon, 24 Feb 2020 14:30:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582583432; cv=none; d=google.com; s=arc-20160816; b=WFpUGjQ4/1HQaQkDGESzeATt6wUMpuat3HCv+s38InU1DVj+8uYZPt+5cseFm0cyU2 oqaHEaiczSlfar7TdKQzHI0tU15R/PrO1RhLyhGuqJLV8JwitM2wNiyAaXE0KN/eQrqU MUcmDrCwJ8RDPK/kf9jsLy2ugdAyehrxO8zgU2AR3Q5HiQE19bEnGzOqp7sp50OFTYK9 +zTnR+6vJrTnu7nCAK19KAF+R/vjyx5C0fGDAGHINLcSAjwkLpaYsxGp09So7CvQSUTF 9U2TQzI0nbzUkKImY8tNunuTAUpEeZuijrp8sdn5ffwZWlwQYNHP1eTvefjA0DILFlX0 rQ/g== 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=Ic31+5+7BISn+IpIxJxTLFKxAz0Jem6L/fKBKMDWBDA=; b=dCrzHKcE8n103vZ+xK6PIriPH/DgEsFHO03+kGEKqANZYIjucM07zTQVbIqbvxiapy SE2g49oI+QkPiNEGkn5XPbjkApBJizZDH4yS6ghK8Jv4RFELfNX473fzku2jvuEJTMdO 7aLb/El9XTuyVxaDulZPnRS/7JZ3gYH5Iu6TK3B7ZpwzqEDTBa0xFIc8MMSVEU8isXBa 6s23bGPmIm7eW50UB6W7mGVZgdiW+UDIg6stPlvc5J+80AY8RoFb2Fuuv1IAxU3iWowx xH9Um1nxjov6AnIbr3D3wlve2O1HvXyUo62TuvnwwZkGkPB3iB51+ZWfWg/d+r5HWnn1 pIvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gcnxit0i; 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 h55si6368564qtb.87.2020.02.24.14.30.32 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 24 Feb 2020 14:30:32 -0800 (PST) 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=gcnxit0i; 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]:45410 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j6MFD-0001uJ-Ti for patch@linaro.org; Mon, 24 Feb 2020 17:30:31 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:38037) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j6M7t-0004jt-9t for qemu-devel@nongnu.org; Mon, 24 Feb 2020 17:22:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j6M7r-0005xV-Cy for qemu-devel@nongnu.org; Mon, 24 Feb 2020 17:22:57 -0500 Received: from mail-pl1-x641.google.com ([2607:f8b0:4864:20::641]:36894) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j6M7r-0005x6-5e for qemu-devel@nongnu.org; Mon, 24 Feb 2020 17:22:55 -0500 Received: by mail-pl1-x641.google.com with SMTP id q4so491752pls.4 for ; Mon, 24 Feb 2020 14:22:55 -0800 (PST) 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=Ic31+5+7BISn+IpIxJxTLFKxAz0Jem6L/fKBKMDWBDA=; b=gcnxit0i8C2xmL/KuIbp4zzhY4HYBK8VuEwDghoHNUe0dzly8T3kbpPLrk/LlUiesK AqXabWKVEzIofCEpmhqNLbb1OoPDt54zsKF2nK0PbMc9a4S9kwLfnkrFCP7tW6A8I1hx kBMzE8MXWh+mPB/KwUDgItGrS4LHhsuiQX3Qr7iD6cewilGFC0M4GgyqQOrtjU/8lm6U SIvRktjx2isE3QVcOMn7syT8KAoAhBGv3Sm5RRBu0UYOKDYd8HstjyEndghnsymI5TVg HIlsQHXR0ljhmYo/0sZ1ahIqkkzShOJq1nshNc2XHmXlvpmRSm1NO9gNMp8LRRjHweL5 Cq7Q== 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=Ic31+5+7BISn+IpIxJxTLFKxAz0Jem6L/fKBKMDWBDA=; b=o4u3Zc7C6R8BtL9uVEnheH7RhXDhV2+GBGoi/tnrmN6SFqAKNYoSIHdOsdcPziT1/Z FnL/hI91B4WQ81VTOozunZMLCTujNGyZl2rfVF8tC4+2FeJUdWi/U8Zb3RzSfIat7tdL QvOXS/0mHaFyuWfS3I9hSFW5Td0D8k3KbhD5y1lCfNSjbf2lC39+fJJrxOAFGsAjvalT bw5Ze+V8FbSHk8ppNn6pzXamF2b752fpJNSCezWHdkvLjT/snjhJgB0NpxKuMyqyZ/dg Wcfuo0lPeRfhN1cHj2LfoF21O+sWAob/brHOl/fK+lkUn2PF+Wi/iZ/dKLG9oMc7ZLC+ q1dw== X-Gm-Message-State: APjAAAVWxsUYdmweD576cggKQ95izqzKXIwkgKNA7kkNnqhNk7ay9PJA XnIev0nIVVmtj4CDXnswfl702gagU7U= X-Received: by 2002:a17:90a:654a:: with SMTP id f10mr1473976pjs.50.1582582972978; Mon, 24 Feb 2020 14:22:52 -0800 (PST) Received: from localhost.localdomain (97-126-123-70.tukw.qwest.net. [97.126.123.70]) by smtp.gmail.com with ESMTPSA id o6sm13897097pgg.37.2020.02.24.14.22.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Feb 2020 14:22:52 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 14/17] target/arm: Remove ARM_FEATURE_VFP* Date: Mon, 24 Feb 2020 14:22:29 -0800 Message-Id: <20200224222232.13807-15-richard.henderson@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200224222232.13807-1-richard.henderson@linaro.org> References: <20200224222232.13807-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::641 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" We have converted all tests against these features to ISAR tests. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/arm/cpu.h | 3 --- target/arm/cpu.c | 25 ------------------------- target/arm/cpu64.c | 3 --- target/arm/kvm32.c | 5 ----- target/arm/kvm64.c | 1 - 5 files changed, 37 deletions(-) -- 2.20.1 diff --git a/target/arm/cpu.h b/target/arm/cpu.h index b29b0eddfc..05aa9711cd 100644 --- a/target/arm/cpu.h +++ b/target/arm/cpu.h @@ -1880,7 +1880,6 @@ QEMU_BUILD_BUG_ON(ARRAY_SIZE(((ARMCPU *)0)->ccsidr) <= R_V7M_CSSELR_INDEX_MASK); * mapping in linux-user/elfload.c:get_elf_hwcap(). */ enum arm_features { - ARM_FEATURE_VFP, ARM_FEATURE_AUXCR, /* ARM1026 Auxiliary control register. */ ARM_FEATURE_XSCALE, /* Intel XScale extensions. */ ARM_FEATURE_IWMMXT, /* Intel iwMMXt extension. */ @@ -1889,7 +1888,6 @@ enum arm_features { ARM_FEATURE_V7, ARM_FEATURE_THUMB2, ARM_FEATURE_PMSA, /* no MMU; may have Memory Protection Unit */ - ARM_FEATURE_VFP3, ARM_FEATURE_NEON, ARM_FEATURE_M, /* Microcontroller profile. */ ARM_FEATURE_OMAPCP, /* OMAP specific CP15 ops handling. */ @@ -1900,7 +1898,6 @@ enum arm_features { ARM_FEATURE_V5, ARM_FEATURE_STRONGARM, ARM_FEATURE_VAPA, /* cp15 VA to PA lookups */ - ARM_FEATURE_VFP4, /* VFPv4 (implies that NEON is v2) */ ARM_FEATURE_GENERIC_TIMER, ARM_FEATURE_MVFR, /* Media and VFP Feature Registers 0 and 1 */ ARM_FEATURE_DUMMY_C15_REGS, /* RAZ/WI all of cp15 crn=15 */ diff --git a/target/arm/cpu.c b/target/arm/cpu.c index bdcaa46b8a..ebff98cb36 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -1208,13 +1208,6 @@ void arm_cpu_post_init(Object *obj) if (arm_feature(&cpu->env, ARM_FEATURE_M)) { set_feature(&cpu->env, ARM_FEATURE_PMSA); } - /* Similarly for the VFP feature bits */ - if (arm_feature(&cpu->env, ARM_FEATURE_VFP4)) { - set_feature(&cpu->env, ARM_FEATURE_VFP3); - } - if (arm_feature(&cpu->env, ARM_FEATURE_VFP3)) { - set_feature(&cpu->env, ARM_FEATURE_VFP); - } if (arm_feature(&cpu->env, ARM_FEATURE_CBAR) || arm_feature(&cpu->env, ARM_FEATURE_CBAR_RO)) { @@ -1431,10 +1424,6 @@ static void arm_cpu_realizefn(DeviceState *dev, Error **errp) uint64_t t; uint32_t u; - unset_feature(env, ARM_FEATURE_VFP); - unset_feature(env, ARM_FEATURE_VFP3); - unset_feature(env, ARM_FEATURE_VFP4); - t = cpu->isar.id_aa64isar1; t = FIELD_DP64(t, ID_AA64ISAR1, JSCVT, 0); cpu->isar.id_aa64isar1 = t; @@ -1866,7 +1855,6 @@ static void arm926_initfn(Object *obj) cpu->dtb_compatible = "arm,arm926"; set_feature(&cpu->env, ARM_FEATURE_V5); - set_feature(&cpu->env, ARM_FEATURE_VFP); set_feature(&cpu->env, ARM_FEATURE_DUMMY_C15_REGS); set_feature(&cpu->env, ARM_FEATURE_CACHE_TEST_CLEAN); cpu->midr = 0x41069265; @@ -1907,7 +1895,6 @@ static void arm1026_initfn(Object *obj) cpu->dtb_compatible = "arm,arm1026"; set_feature(&cpu->env, ARM_FEATURE_V5); - set_feature(&cpu->env, ARM_FEATURE_VFP); set_feature(&cpu->env, ARM_FEATURE_AUXCR); set_feature(&cpu->env, ARM_FEATURE_DUMMY_C15_REGS); set_feature(&cpu->env, ARM_FEATURE_CACHE_TEST_CLEAN); @@ -1955,7 +1942,6 @@ static void arm1136_r2_initfn(Object *obj) cpu->dtb_compatible = "arm,arm1136"; set_feature(&cpu->env, ARM_FEATURE_V6); - set_feature(&cpu->env, ARM_FEATURE_VFP); set_feature(&cpu->env, ARM_FEATURE_DUMMY_C15_REGS); set_feature(&cpu->env, ARM_FEATURE_CACHE_DIRTY_REG); set_feature(&cpu->env, ARM_FEATURE_CACHE_BLOCK_OPS); @@ -1987,7 +1973,6 @@ static void arm1136_initfn(Object *obj) cpu->dtb_compatible = "arm,arm1136"; set_feature(&cpu->env, ARM_FEATURE_V6K); set_feature(&cpu->env, ARM_FEATURE_V6); - set_feature(&cpu->env, ARM_FEATURE_VFP); set_feature(&cpu->env, ARM_FEATURE_DUMMY_C15_REGS); set_feature(&cpu->env, ARM_FEATURE_CACHE_DIRTY_REG); set_feature(&cpu->env, ARM_FEATURE_CACHE_BLOCK_OPS); @@ -2018,7 +2003,6 @@ static void arm1176_initfn(Object *obj) cpu->dtb_compatible = "arm,arm1176"; set_feature(&cpu->env, ARM_FEATURE_V6K); - set_feature(&cpu->env, ARM_FEATURE_VFP); set_feature(&cpu->env, ARM_FEATURE_VAPA); set_feature(&cpu->env, ARM_FEATURE_DUMMY_C15_REGS); set_feature(&cpu->env, ARM_FEATURE_CACHE_DIRTY_REG); @@ -2051,7 +2035,6 @@ static void arm11mpcore_initfn(Object *obj) cpu->dtb_compatible = "arm,arm11mpcore"; set_feature(&cpu->env, ARM_FEATURE_V6K); - set_feature(&cpu->env, ARM_FEATURE_VFP); set_feature(&cpu->env, ARM_FEATURE_VAPA); set_feature(&cpu->env, ARM_FEATURE_MPIDR); set_feature(&cpu->env, ARM_FEATURE_DUMMY_C15_REGS); @@ -2117,7 +2100,6 @@ static void cortex_m4_initfn(Object *obj) set_feature(&cpu->env, ARM_FEATURE_M); set_feature(&cpu->env, ARM_FEATURE_M_MAIN); set_feature(&cpu->env, ARM_FEATURE_THUMB_DSP); - set_feature(&cpu->env, ARM_FEATURE_VFP4); cpu->midr = 0x410fc240; /* r0p0 */ cpu->pmsav7_dregion = 8; cpu->isar.mvfr0 = 0x10110021; @@ -2148,7 +2130,6 @@ static void cortex_m7_initfn(Object *obj) set_feature(&cpu->env, ARM_FEATURE_M); set_feature(&cpu->env, ARM_FEATURE_M_MAIN); set_feature(&cpu->env, ARM_FEATURE_THUMB_DSP); - set_feature(&cpu->env, ARM_FEATURE_VFP4); cpu->midr = 0x411fc272; /* r1p2 */ cpu->pmsav7_dregion = 8; cpu->isar.mvfr0 = 0x10110221; @@ -2180,7 +2161,6 @@ static void cortex_m33_initfn(Object *obj) set_feature(&cpu->env, ARM_FEATURE_M_MAIN); set_feature(&cpu->env, ARM_FEATURE_M_SECURITY); set_feature(&cpu->env, ARM_FEATURE_THUMB_DSP); - set_feature(&cpu->env, ARM_FEATURE_VFP4); cpu->midr = 0x410fd213; /* r0p3 */ cpu->pmsav7_dregion = 16; cpu->sau_sregion = 8; @@ -2264,7 +2244,6 @@ static void cortex_r5f_initfn(Object *obj) ARMCPU *cpu = ARM_CPU(obj); cortex_r5_initfn(obj); - set_feature(&cpu->env, ARM_FEATURE_VFP3); cpu->isar.mvfr0 = 0x10110221; cpu->isar.mvfr1 = 0x00000011; } @@ -2283,7 +2262,6 @@ static void cortex_a8_initfn(Object *obj) cpu->dtb_compatible = "arm,cortex-a8"; set_feature(&cpu->env, ARM_FEATURE_V7); - set_feature(&cpu->env, ARM_FEATURE_VFP3); set_feature(&cpu->env, ARM_FEATURE_NEON); set_feature(&cpu->env, ARM_FEATURE_THUMB2EE); set_feature(&cpu->env, ARM_FEATURE_DUMMY_C15_REGS); @@ -2351,7 +2329,6 @@ static void cortex_a9_initfn(Object *obj) cpu->dtb_compatible = "arm,cortex-a9"; set_feature(&cpu->env, ARM_FEATURE_V7); - set_feature(&cpu->env, ARM_FEATURE_VFP3); set_feature(&cpu->env, ARM_FEATURE_NEON); set_feature(&cpu->env, ARM_FEATURE_THUMB2EE); set_feature(&cpu->env, ARM_FEATURE_EL3); @@ -2416,7 +2393,6 @@ static void cortex_a7_initfn(Object *obj) cpu->dtb_compatible = "arm,cortex-a7"; set_feature(&cpu->env, ARM_FEATURE_V7VE); - set_feature(&cpu->env, ARM_FEATURE_VFP4); set_feature(&cpu->env, ARM_FEATURE_NEON); set_feature(&cpu->env, ARM_FEATURE_THUMB2EE); set_feature(&cpu->env, ARM_FEATURE_GENERIC_TIMER); @@ -2462,7 +2438,6 @@ static void cortex_a15_initfn(Object *obj) cpu->dtb_compatible = "arm,cortex-a15"; set_feature(&cpu->env, ARM_FEATURE_V7VE); - set_feature(&cpu->env, ARM_FEATURE_VFP4); set_feature(&cpu->env, ARM_FEATURE_NEON); set_feature(&cpu->env, ARM_FEATURE_THUMB2EE); set_feature(&cpu->env, ARM_FEATURE_GENERIC_TIMER); diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c index 0929401a4d..5cda580231 100644 --- a/target/arm/cpu64.c +++ b/target/arm/cpu64.c @@ -102,7 +102,6 @@ static void aarch64_a57_initfn(Object *obj) cpu->dtb_compatible = "arm,cortex-a57"; set_feature(&cpu->env, ARM_FEATURE_V8); - set_feature(&cpu->env, ARM_FEATURE_VFP4); set_feature(&cpu->env, ARM_FEATURE_NEON); set_feature(&cpu->env, ARM_FEATURE_GENERIC_TIMER); set_feature(&cpu->env, ARM_FEATURE_AARCH64); @@ -156,7 +155,6 @@ static void aarch64_a53_initfn(Object *obj) cpu->dtb_compatible = "arm,cortex-a53"; set_feature(&cpu->env, ARM_FEATURE_V8); - set_feature(&cpu->env, ARM_FEATURE_VFP4); set_feature(&cpu->env, ARM_FEATURE_NEON); set_feature(&cpu->env, ARM_FEATURE_GENERIC_TIMER); set_feature(&cpu->env, ARM_FEATURE_AARCH64); @@ -210,7 +208,6 @@ static void aarch64_a72_initfn(Object *obj) cpu->dtb_compatible = "arm,cortex-a72"; set_feature(&cpu->env, ARM_FEATURE_V8); - set_feature(&cpu->env, ARM_FEATURE_VFP4); set_feature(&cpu->env, ARM_FEATURE_NEON); set_feature(&cpu->env, ARM_FEATURE_GENERIC_TIMER); set_feature(&cpu->env, ARM_FEATURE_AARCH64); diff --git a/target/arm/kvm32.c b/target/arm/kvm32.c index 7981ae3bc4..f703c4fcad 100644 --- a/target/arm/kvm32.c +++ b/target/arm/kvm32.c @@ -147,7 +147,6 @@ bool kvm_arm_get_host_cpu_features(ARMHostCPUFeatures *ahcf) * bits, but a few must be tested. */ set_feature(&features, ARM_FEATURE_V7VE); - set_feature(&features, ARM_FEATURE_VFP3); set_feature(&features, ARM_FEATURE_GENERIC_TIMER); if (extract32(id_pfr0, 12, 4) == 1) { @@ -156,10 +155,6 @@ bool kvm_arm_get_host_cpu_features(ARMHostCPUFeatures *ahcf) if (extract32(ahcf->isar.mvfr1, 12, 4) == 1) { set_feature(&features, ARM_FEATURE_NEON); } - if (extract32(ahcf->isar.mvfr1, 28, 4) == 1) { - /* FMAC support implies VFPv4 */ - set_feature(&features, ARM_FEATURE_VFP4); - } ahcf->features = features; diff --git a/target/arm/kvm64.c b/target/arm/kvm64.c index 0ad96c3500..93ba1448da 100644 --- a/target/arm/kvm64.c +++ b/target/arm/kvm64.c @@ -649,7 +649,6 @@ bool kvm_arm_get_host_cpu_features(ARMHostCPUFeatures *ahcf) * feature bits. */ set_feature(&features, ARM_FEATURE_V8); - set_feature(&features, ARM_FEATURE_VFP4); set_feature(&features, ARM_FEATURE_NEON); set_feature(&features, ARM_FEATURE_AARCH64); set_feature(&features, ARM_FEATURE_PMU); From patchwork Mon Feb 24 22:22:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 183793 Delivered-To: patch@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp929315ile; Mon, 24 Feb 2020 14:32:40 -0800 (PST) X-Google-Smtp-Source: APXvYqwWRmBGFnSRQ1z3wlRYpKBlsJrjviuXD/ralw0bhmFRqKGSWCcpok9JNVqwk+18KdAKtsPl X-Received: by 2002:aed:2f01:: with SMTP id l1mr49401065qtd.391.1582583560581; Mon, 24 Feb 2020 14:32:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582583560; cv=none; d=google.com; s=arc-20160816; b=UstMLUSwqxkTKcru96aDLQuDzmzappwDDkfLCBOUqbZYdT9tXzxMrMy9fouvGOFSHP 8wVypnMLp6CbIThhiFvnGMtiRuvpvmVIn3PnGqZsciyJtEL/FgLF2qYVY/wbB+1UzgYq kS//+ATIJV4aalgxP8GYI/R77mGQUX1f0cKWbb1Ogzt2PcfJsdAB/bJUfIFB7ijihiJm pYNK6+MyZcJQXA28FbHVbs3x6nxmdj9OzDUy7Q998k7ugY8nkTaYOtEuihF9xxzTE7v6 0jSh12FnPZOf66I3DNrAqaomFmJY4XmrWQZ/ZoYbBIYA5Yyshb3PTmrRCYuzY9ScMYGP Q+PA== 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=UjJ9iZKHSouFYZlDrlpMHjdteZRncNwvhF4XGeCLWsY=; b=QBqo7pk+2OfyNoOJb4bK11KI7E4Ez5ryL/X0/53TV+dfRSM/b9KX78O5vMqfynMwu8 SNKJyvQDtevKjQwXjkiKOwp9jIG6klqdoHx7Ngp+5la4R621p4bXatl04gWqsAXlo7zw EXey+OcN1JNjiz8kVjNDzCo2R0XVE9qCNLQ/72IsARBdQaKUCmXbR/9JLkeo3S5l9tKu nErhk9p9GK3dhJ7yKYSEd6C9aSL8j+r0RgjXqHB/RkSrHEfp8uvcoULnviCpCRwLR9XW IHgjhXS2I2HOzM6jXOf195JY/gmZCcWzwN4l7uQt8UpYIV1KTI94qxGv+DxHd/Jy6BzC odBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=v6587C+n; 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 dm17si6103391qvb.139.2020.02.24.14.32.40 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 24 Feb 2020 14:32:40 -0800 (PST) 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=v6587C+n; 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]:45472 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j6MHI-0004yr-2o for patch@linaro.org; Mon, 24 Feb 2020 17:32:40 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:38055) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j6M7t-0004lF-T8 for qemu-devel@nongnu.org; Mon, 24 Feb 2020 17:22:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j6M7s-0005yC-6l for qemu-devel@nongnu.org; Mon, 24 Feb 2020 17:22:57 -0500 Received: from mail-pl1-x643.google.com ([2607:f8b0:4864:20::643]:46458) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j6M7r-0005xb-Vj for qemu-devel@nongnu.org; Mon, 24 Feb 2020 17:22:56 -0500 Received: by mail-pl1-x643.google.com with SMTP id y8so4607982pll.13 for ; Mon, 24 Feb 2020 14:22:55 -0800 (PST) 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=UjJ9iZKHSouFYZlDrlpMHjdteZRncNwvhF4XGeCLWsY=; b=v6587C+nZ28pjxxCIAVJ4LI3tsgys+6pFrwhEJSb6vYV7gLZeXAHDEwUXdZe2TDkyE C4xNY32wTN5M9/i1N6MjlN+LXLR6QVt5hxks8T2YiHDinvyG3RhHHRYCcEydSbrlHUWS KNJ83G5bGZxIsu0Nq4VEGK2y4MzEwoMm2Y1TYCgfKRhw0hsPq4RMPouuL1WiEwrOaB1T mftxYmIDk0X1gxYVvu4IKeAQaIPUc8Vt8smiYXBZN7hUvyxCKtpidMZ239zaLcafk9xM PJdFAIfoW3BrHak2XsL3tSc7yGx5yeOtG7bvrmovAJI1ci8Ohvo6T2hoCrt3aCOoJKU7 PVPg== 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=UjJ9iZKHSouFYZlDrlpMHjdteZRncNwvhF4XGeCLWsY=; b=kqk4+8Ckgm386ILRCIOXKSxcf0l3G4X29pmUfhiBqB6qmePWnL2V7V4bJcNOi7Hjkm svSfJFQbelpE5Z0hRdQStD7tHHsuHHqdAPycvYobSWyIY6XgcTBCwgE5HCj9q7EheSQY EirArhYFfCEkhc83q2OaZV68GJ1IB8EB5G5Ki4xROiMxKQCE1BKWeALQ0TVpjUgMcXSx 7zvKixtGrb2vkCInHnSmyR8/RMQKx59Luv/DTX3NK6+Mj7TKYTFsVuJAyWy1alHkLk+c u3kxGfDB9pbDyEHH0SzyxwKKEeTQvvwO8KqxpsJSvYQ/6j/uZXS+Yqgrl1bF+eLYqui+ iURQ== X-Gm-Message-State: APjAAAV3uP8MX2NGWEhoL2HJphjW+CxeGcBZ3PODfFfe9dGmJAIN2uX0 GnEXlTGfzVBy6faxWosDwWmQazqDbks= X-Received: by 2002:a17:90a:db0f:: with SMTP id g15mr1404254pjv.40.1582582974177; Mon, 24 Feb 2020 14:22:54 -0800 (PST) Received: from localhost.localdomain (97-126-123-70.tukw.qwest.net. [97.126.123.70]) by smtp.gmail.com with ESMTPSA id o6sm13897097pgg.37.2020.02.24.14.22.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Feb 2020 14:22:53 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 15/17] target/arm: Add formats for some vfp 2 and 3-register insns Date: Mon, 24 Feb 2020 14:22:30 -0800 Message-Id: <20200224222232.13807-16-richard.henderson@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200224222232.13807-1-richard.henderson@linaro.org> References: <20200224222232.13807-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::643 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" Those vfp instructions without extra opcode fields can share a common @format for brevity. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/arm/vfp.decode | 134 ++++++++++++++++-------------------------- 1 file changed, 52 insertions(+), 82 deletions(-) -- 2.20.1 diff --git a/target/arm/vfp.decode b/target/arm/vfp.decode index 592fe9e1e4..4f294f88be 100644 --- a/target/arm/vfp.decode +++ b/target/arm/vfp.decode @@ -46,6 +46,14 @@ %vmov_imm 16:4 0:4 +@vfp_dnm_s ................................ vm=%vm_sp vn=%vn_sp vd=%vd_sp +@vfp_dnm_d ................................ vm=%vm_dp vn=%vn_dp vd=%vd_dp + +@vfp_dm_ss ................................ vm=%vm_sp vd=%vd_sp +@vfp_dm_dd ................................ vm=%vm_dp vd=%vd_dp +@vfp_dm_ds ................................ vm=%vm_sp vd=%vd_dp +@vfp_dm_sd ................................ vm=%vm_dp vd=%vd_sp + # VMOV scalar to general-purpose register; note that this does # include some Neon cases. VMOV_to_gp ---- 1110 u:1 1. 1 .... rt:4 1011 ... 1 0000 \ @@ -66,20 +74,15 @@ VDUP ---- 1110 1 b:1 q:1 0 .... rt:4 1011 . 0 e:1 1 0000 \ vn=%vn_dp VMSR_VMRS ---- 1110 111 l:1 reg:4 rt:4 1010 0001 0000 -VMOV_single ---- 1110 000 l:1 .... rt:4 1010 . 001 0000 \ - vn=%vn_sp +VMOV_single ---- 1110 000 l:1 .... rt:4 1010 . 001 0000 vn=%vn_sp -VMOV_64_sp ---- 1100 010 op:1 rt2:4 rt:4 1010 00.1 .... \ - vm=%vm_sp -VMOV_64_dp ---- 1100 010 op:1 rt2:4 rt:4 1011 00.1 .... \ - vm=%vm_dp +VMOV_64_sp ---- 1100 010 op:1 rt2:4 rt:4 1010 00.1 .... vm=%vm_sp +VMOV_64_dp ---- 1100 010 op:1 rt2:4 rt:4 1011 00.1 .... vm=%vm_dp # Note that the half-precision variants of VLDR and VSTR are # not part of this decodetree at all because they have bits [9:8] == 0b01 -VLDR_VSTR_sp ---- 1101 u:1 .0 l:1 rn:4 .... 1010 imm:8 \ - vd=%vd_sp -VLDR_VSTR_dp ---- 1101 u:1 .0 l:1 rn:4 .... 1011 imm:8 \ - vd=%vd_dp +VLDR_VSTR_sp ---- 1101 u:1 .0 l:1 rn:4 .... 1010 imm:8 vd=%vd_sp +VLDR_VSTR_dp ---- 1101 u:1 .0 l:1 rn:4 .... 1011 imm:8 vd=%vd_dp # We split the load/store multiple up into two patterns to avoid # overlap with other insns in the "Advanced SIMD load/store and 64-bit move" @@ -100,50 +103,32 @@ VLDM_VSTM_dp ---- 1101 0.1 l:1 rn:4 .... 1011 imm:8 \ vd=%vd_dp p=1 u=0 w=1 # 3-register VFP data-processing; bits [23,21:20,6] identify the operation. -VMLA_sp ---- 1110 0.00 .... .... 1010 .0.0 .... \ - vm=%vm_sp vn=%vn_sp vd=%vd_sp -VMLA_dp ---- 1110 0.00 .... .... 1011 .0.0 .... \ - vm=%vm_dp vn=%vn_dp vd=%vd_dp +VMLA_sp ---- 1110 0.00 .... .... 1010 .0.0 .... @vfp_dnm_s +VMLA_dp ---- 1110 0.00 .... .... 1011 .0.0 .... @vfp_dnm_d -VMLS_sp ---- 1110 0.00 .... .... 1010 .1.0 .... \ - vm=%vm_sp vn=%vn_sp vd=%vd_sp -VMLS_dp ---- 1110 0.00 .... .... 1011 .1.0 .... \ - vm=%vm_dp vn=%vn_dp vd=%vd_dp +VMLS_sp ---- 1110 0.00 .... .... 1010 .1.0 .... @vfp_dnm_s +VMLS_dp ---- 1110 0.00 .... .... 1011 .1.0 .... @vfp_dnm_d -VNMLS_sp ---- 1110 0.01 .... .... 1010 .0.0 .... \ - vm=%vm_sp vn=%vn_sp vd=%vd_sp -VNMLS_dp ---- 1110 0.01 .... .... 1011 .0.0 .... \ - vm=%vm_dp vn=%vn_dp vd=%vd_dp +VNMLS_sp ---- 1110 0.01 .... .... 1010 .0.0 .... @vfp_dnm_s +VNMLS_dp ---- 1110 0.01 .... .... 1011 .0.0 .... @vfp_dnm_d -VNMLA_sp ---- 1110 0.01 .... .... 1010 .1.0 .... \ - vm=%vm_sp vn=%vn_sp vd=%vd_sp -VNMLA_dp ---- 1110 0.01 .... .... 1011 .1.0 .... \ - vm=%vm_dp vn=%vn_dp vd=%vd_dp +VNMLA_sp ---- 1110 0.01 .... .... 1010 .1.0 .... @vfp_dnm_s +VNMLA_dp ---- 1110 0.01 .... .... 1011 .1.0 .... @vfp_dnm_d -VMUL_sp ---- 1110 0.10 .... .... 1010 .0.0 .... \ - vm=%vm_sp vn=%vn_sp vd=%vd_sp -VMUL_dp ---- 1110 0.10 .... .... 1011 .0.0 .... \ - vm=%vm_dp vn=%vn_dp vd=%vd_dp +VMUL_sp ---- 1110 0.10 .... .... 1010 .0.0 .... @vfp_dnm_s +VMUL_dp ---- 1110 0.10 .... .... 1011 .0.0 .... @vfp_dnm_d -VNMUL_sp ---- 1110 0.10 .... .... 1010 .1.0 .... \ - vm=%vm_sp vn=%vn_sp vd=%vd_sp -VNMUL_dp ---- 1110 0.10 .... .... 1011 .1.0 .... \ - vm=%vm_dp vn=%vn_dp vd=%vd_dp +VNMUL_sp ---- 1110 0.10 .... .... 1010 .1.0 .... @vfp_dnm_s +VNMUL_dp ---- 1110 0.10 .... .... 1011 .1.0 .... @vfp_dnm_d -VADD_sp ---- 1110 0.11 .... .... 1010 .0.0 .... \ - vm=%vm_sp vn=%vn_sp vd=%vd_sp -VADD_dp ---- 1110 0.11 .... .... 1011 .0.0 .... \ - vm=%vm_dp vn=%vn_dp vd=%vd_dp +VADD_sp ---- 1110 0.11 .... .... 1010 .0.0 .... @vfp_dnm_s +VADD_dp ---- 1110 0.11 .... .... 1011 .0.0 .... @vfp_dnm_d -VSUB_sp ---- 1110 0.11 .... .... 1010 .1.0 .... \ - vm=%vm_sp vn=%vn_sp vd=%vd_sp -VSUB_dp ---- 1110 0.11 .... .... 1011 .1.0 .... \ - vm=%vm_dp vn=%vn_dp vd=%vd_dp +VSUB_sp ---- 1110 0.11 .... .... 1010 .1.0 .... @vfp_dnm_s +VSUB_dp ---- 1110 0.11 .... .... 1011 .1.0 .... @vfp_dnm_d -VDIV_sp ---- 1110 1.00 .... .... 1010 .0.0 .... \ - vm=%vm_sp vn=%vn_sp vd=%vd_sp -VDIV_dp ---- 1110 1.00 .... .... 1011 .0.0 .... \ - vm=%vm_dp vn=%vn_dp vd=%vd_dp +VDIV_sp ---- 1110 1.00 .... .... 1010 .0.0 .... @vfp_dnm_s +VDIV_dp ---- 1110 1.00 .... .... 1011 .0.0 .... @vfp_dnm_d VFM_sp ---- 1110 1.01 .... .... 1010 . o2:1 . 0 .... \ vm=%vm_sp vn=%vn_sp vd=%vd_sp o1=1 @@ -159,25 +144,17 @@ VMOV_imm_sp ---- 1110 1.11 .... .... 1010 0000 .... \ VMOV_imm_dp ---- 1110 1.11 .... .... 1011 0000 .... \ vd=%vd_dp imm=%vmov_imm -VMOV_reg_sp ---- 1110 1.11 0000 .... 1010 01.0 .... \ - vd=%vd_sp vm=%vm_sp -VMOV_reg_dp ---- 1110 1.11 0000 .... 1011 01.0 .... \ - vd=%vd_dp vm=%vm_dp +VMOV_reg_sp ---- 1110 1.11 0000 .... 1010 01.0 .... @vfp_dm_ss +VMOV_reg_dp ---- 1110 1.11 0000 .... 1011 01.0 .... @vfp_dm_dd -VABS_sp ---- 1110 1.11 0000 .... 1010 11.0 .... \ - vd=%vd_sp vm=%vm_sp -VABS_dp ---- 1110 1.11 0000 .... 1011 11.0 .... \ - vd=%vd_dp vm=%vm_dp +VABS_sp ---- 1110 1.11 0000 .... 1010 11.0 .... @vfp_dm_ss +VABS_dp ---- 1110 1.11 0000 .... 1011 11.0 .... @vfp_dm_dd -VNEG_sp ---- 1110 1.11 0001 .... 1010 01.0 .... \ - vd=%vd_sp vm=%vm_sp -VNEG_dp ---- 1110 1.11 0001 .... 1011 01.0 .... \ - vd=%vd_dp vm=%vm_dp +VNEG_sp ---- 1110 1.11 0001 .... 1010 01.0 .... @vfp_dm_ss +VNEG_dp ---- 1110 1.11 0001 .... 1011 01.0 .... @vfp_dm_dd -VSQRT_sp ---- 1110 1.11 0001 .... 1010 11.0 .... \ - vd=%vd_sp vm=%vm_sp -VSQRT_dp ---- 1110 1.11 0001 .... 1011 11.0 .... \ - vd=%vd_dp vm=%vm_dp +VSQRT_sp ---- 1110 1.11 0001 .... 1010 11.0 .... @vfp_dm_ss +VSQRT_dp ---- 1110 1.11 0001 .... 1011 11.0 .... @vfp_dm_dd VCMP_sp ---- 1110 1.11 010 z:1 .... 1010 e:1 1.0 .... \ vd=%vd_sp vm=%vm_sp @@ -190,32 +167,26 @@ VCVT_f32_f16 ---- 1110 1.11 0010 .... 1010 t:1 1.0 .... \ VCVT_f64_f16 ---- 1110 1.11 0010 .... 1011 t:1 1.0 .... \ vd=%vd_dp vm=%vm_sp -# VCVTB and VCVTT to f16: Vd format is always vd_sp; Vm format depends on size bit +# VCVTB and VCVTT to f16: Vd format is always vd_sp; +# Vm format depends on size bit VCVT_f16_f32 ---- 1110 1.11 0011 .... 1010 t:1 1.0 .... \ vd=%vd_sp vm=%vm_sp VCVT_f16_f64 ---- 1110 1.11 0011 .... 1011 t:1 1.0 .... \ vd=%vd_sp vm=%vm_dp -VRINTR_sp ---- 1110 1.11 0110 .... 1010 01.0 .... \ - vd=%vd_sp vm=%vm_sp -VRINTR_dp ---- 1110 1.11 0110 .... 1011 01.0 .... \ - vd=%vd_dp vm=%vm_dp +VRINTR_sp ---- 1110 1.11 0110 .... 1010 01.0 .... @vfp_dm_ss +VRINTR_dp ---- 1110 1.11 0110 .... 1011 01.0 .... @vfp_dm_dd -VRINTZ_sp ---- 1110 1.11 0110 .... 1010 11.0 .... \ - vd=%vd_sp vm=%vm_sp -VRINTZ_dp ---- 1110 1.11 0110 .... 1011 11.0 .... \ - vd=%vd_dp vm=%vm_dp +VRINTZ_sp ---- 1110 1.11 0110 .... 1010 11.0 .... @vfp_dm_ss +VRINTZ_dp ---- 1110 1.11 0110 .... 1011 11.0 .... @vfp_dm_dd -VRINTX_sp ---- 1110 1.11 0111 .... 1010 01.0 .... \ - vd=%vd_sp vm=%vm_sp -VRINTX_dp ---- 1110 1.11 0111 .... 1011 01.0 .... \ - vd=%vd_dp vm=%vm_dp +VRINTX_sp ---- 1110 1.11 0111 .... 1010 01.0 .... @vfp_dm_ss +VRINTX_dp ---- 1110 1.11 0111 .... 1011 01.0 .... @vfp_dm_dd -# VCVT between single and double: Vm precision depends on size; Vd is its reverse -VCVT_sp ---- 1110 1.11 0111 .... 1010 11.0 .... \ - vd=%vd_dp vm=%vm_sp -VCVT_dp ---- 1110 1.11 0111 .... 1011 11.0 .... \ - vd=%vd_sp vm=%vm_dp +# VCVT between single and double: +# Vm precision depends on size; Vd is its reverse +VCVT_sp ---- 1110 1.11 0111 .... 1010 11.0 .... @vfp_dm_ds +VCVT_dp ---- 1110 1.11 0111 .... 1011 11.0 .... @vfp_dm_sd # VCVT from integer to floating point: Vm always single; Vd depends on size VCVT_int_sp ---- 1110 1.11 1000 .... 1010 s:1 1.0 .... \ @@ -224,8 +195,7 @@ VCVT_int_dp ---- 1110 1.11 1000 .... 1011 s:1 1.0 .... \ vd=%vd_dp vm=%vm_sp # VJCVT is always dp to sp -VJCVT ---- 1110 1.11 1001 .... 1011 11.0 .... \ - vd=%vd_sp vm=%vm_dp +VJCVT ---- 1110 1.11 1001 .... 1011 11.0 .... @vfp_dm_sd # VCVT between floating-point and fixed-point. The immediate value # is in the same format as a Vm single-precision register number. From patchwork Mon Feb 24 22:22:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 183790 Delivered-To: patch@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp927185ile; Mon, 24 Feb 2020 14:30:21 -0800 (PST) X-Google-Smtp-Source: APXvYqwDODLj9VANfr3NU3ifVNRRo+Bs70CVNxWymfbpMsmgT2/wrSrJX90RUaGz3pnqiAdtPs3m X-Received: by 2002:aed:35c1:: with SMTP id d1mr49759619qte.218.1582583421645; Mon, 24 Feb 2020 14:30:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582583421; cv=none; d=google.com; s=arc-20160816; b=RsfflNGmGnRronkkLXVTGjAt5o3EY1vWEBvVbWDc+HTE8Zb9ETuypQrbjxoI70pdbu X7TMaMx6C2WQp5W8ax6An1W2FCC9mZJaeRwg5hYKusVoTbw0bWer222DfoYlkExjeM39 PXaU3U22KzppMvzryCUmS13c5TqLwrgAS2Hu72U9fn9gfpldF3xgt2V/yiR5EKcHAdj4 ldAdGVi01i9kIwSNBQfn7Kf/GbmBXjYaKA85Wz6tPZlyVDH1yz5l8d8pH/5TCJYLLHG5 NIVH052PRTT1REgAbrrA5oh6mWVJMsZi3fE0qoPQZXpIAEfLbUlCLkgqpfIOJ75C2/u7 U0eQ== 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=N2dqLxgdt7qGgHLw+VE7Z3TBav3OjyXi4mGQvjqJ7no=; b=SJYKA0kGlXEEjKtuNf/VkSr4RHQ8Y/zm4IS3+4+QSfoNUL0J0BNJbOAjaTLNemqD1X GXjAg2h9D0wXdnVHcNWPQBXflG0ZoSp+AP/10E9PGgWBqkc1ueBab/+indXVIof0/ppT ChoexMPdAcEnsOFcr6t0I71gbxasxH/JRohq35QLSPPUv2NpJCsSvGrc06M5bRej4Szj KCO4LtFUv6qNcpOTex7dL9l6GunGijAJh7GkCjzVRo4bqasUqSSs7ftE1H7U6wiF5+eW DF+Pc+w1YOPUqQXhAZj9kf0cQluWKfzpNr7HQtYhumdW5OHa/MwmTvJhZzwsE7QIUL+3 sdFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dHF8Q9QA; 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 b129si4868466qkc.107.2020.02.24.14.30.21 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 24 Feb 2020 14:30:21 -0800 (PST) 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=dHF8Q9QA; 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]:45396 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j6MF3-0001aB-3e for patch@linaro.org; Mon, 24 Feb 2020 17:30:21 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:38059) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j6M7u-0004lz-6c for qemu-devel@nongnu.org; Mon, 24 Feb 2020 17:22:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j6M7s-0005yf-Uu for qemu-devel@nongnu.org; Mon, 24 Feb 2020 17:22:58 -0500 Received: from mail-pj1-x1041.google.com ([2607:f8b0:4864:20::1041]:34224) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j6M7s-0005yJ-PI for qemu-devel@nongnu.org; Mon, 24 Feb 2020 17:22:56 -0500 Received: by mail-pj1-x1041.google.com with SMTP id f2so320041pjq.1 for ; Mon, 24 Feb 2020 14:22:56 -0800 (PST) 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=N2dqLxgdt7qGgHLw+VE7Z3TBav3OjyXi4mGQvjqJ7no=; b=dHF8Q9QAoA5L8xBMfhYW2OB4bDW1HYNPABGNrIYqYAG9fRvqaMdPbdjSCfeElQEpQy PwCiAAwsvjKtQ+3h0B0tP+eINa904zjIyQS61S53tcPJzYG34vjzfhgXPiveG9siUzGG DsK1Wz1XoSVZVWxXU+WOkbMXiOb4L0wmW8XestPSjCD4mNMxNQZPR4Xt2VKp1wtzYiPV NpQhAqncAKVGABN3DLqYIXbcAF0yGrb8pRON8JDmBnXFSxAvAST+BAetVXmttlwLsF0T oraing11oa0ncQMSbXq5/27Y1/jYfHP+Xl15hvb2h4zU3i9/RdL7V0Pe2N+Y9fgdnSeZ 5KDA== 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=N2dqLxgdt7qGgHLw+VE7Z3TBav3OjyXi4mGQvjqJ7no=; b=hmXhnCQsxw7h8zeybwEpZqZaJX3fQFmVyRq5aYKeM1WDP+5IFQ6UA008updt2/rsC/ 01NythYBOzd1GeFQKgbi5UWv+3uUTxlU1KqR1GIWWHhQGg1qCaSXVTOc0l1mOiK7cEWa tqsDSw+T9J021L+uYzYsd6IeJUWzitPFTIi2jbPbpP2OF165xXCCUVpTaNgvnLK5rYSk F85vhY/ENtyR0pXbvPtFTiiNTUkQuC5xUSmmU1srllm0kwOjh1tn3rfN8qveFy1I5CUz wiYwZutfWMDH9HW2Gzqm+c62xnDJJiz1hvnzoop1hMjcj4g6UkETtX7Vrd9M7MIe9yrw FwJw== X-Gm-Message-State: APjAAAV1q4vWsxlJc4wGtvrUfmW6MGzb84nRYIxUVE/H7FBsCofO5vo7 gM/IeHxhdOlYbAtvfnqXXaR1GPt+wEk= X-Received: by 2002:a17:90a:36af:: with SMTP id t44mr1414093pjb.25.1582582975279; Mon, 24 Feb 2020 14:22:55 -0800 (PST) Received: from localhost.localdomain (97-126-123-70.tukw.qwest.net. [97.126.123.70]) by smtp.gmail.com with ESMTPSA id o6sm13897097pgg.37.2020.02.24.14.22.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Feb 2020 14:22:54 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 16/17] target/arm: Split VFM decode Date: Mon, 24 Feb 2020 14:22:31 -0800 Message-Id: <20200224222232.13807-17-richard.henderson@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200224222232.13807-1-richard.henderson@linaro.org> References: <20200224222232.13807-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::1041 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" Passing the raw o1 and o2 fields from the manual is less instructive than it might be. Do the full decode and let the trans_* functions pass in booleans to a helper. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/arm/vfp.decode | 17 +++++------ target/arm/translate-vfp.inc.c | 52 ++++++++++++++++++++++++++++++---- 2 files changed, 55 insertions(+), 14 deletions(-) -- 2.20.1 diff --git a/target/arm/vfp.decode b/target/arm/vfp.decode index 4f294f88be..5fd70f975a 100644 --- a/target/arm/vfp.decode +++ b/target/arm/vfp.decode @@ -130,14 +130,15 @@ VSUB_dp ---- 1110 0.11 .... .... 1011 .1.0 .... @vfp_dnm_d VDIV_sp ---- 1110 1.00 .... .... 1010 .0.0 .... @vfp_dnm_s VDIV_dp ---- 1110 1.00 .... .... 1011 .0.0 .... @vfp_dnm_d -VFM_sp ---- 1110 1.01 .... .... 1010 . o2:1 . 0 .... \ - vm=%vm_sp vn=%vn_sp vd=%vd_sp o1=1 -VFM_dp ---- 1110 1.01 .... .... 1011 . o2:1 . 0 .... \ - vm=%vm_dp vn=%vn_dp vd=%vd_dp o1=1 -VFM_sp ---- 1110 1.10 .... .... 1010 . o2:1 . 0 .... \ - vm=%vm_sp vn=%vn_sp vd=%vd_sp o1=2 -VFM_dp ---- 1110 1.10 .... .... 1011 . o2:1 . 0 .... \ - vm=%vm_dp vn=%vn_dp vd=%vd_dp o1=2 +VFMA_sp ---- 1110 1.10 .... .... 1010 .0. 0 .... @vfp_dnm_s +VFMS_sp ---- 1110 1.10 .... .... 1010 .1. 0 .... @vfp_dnm_s +VFNMA_sp ---- 1110 1.01 .... .... 1010 .0. 0 .... @vfp_dnm_s +VFNMS_sp ---- 1110 1.01 .... .... 1010 .1. 0 .... @vfp_dnm_s + +VFMA_dp ---- 1110 1.10 .... .... 1011 .0.0 .... @vfp_dnm_d +VFMS_dp ---- 1110 1.10 .... .... 1011 .1.0 .... @vfp_dnm_d +VFNMA_dp ---- 1110 1.01 .... .... 1011 .0.0 .... @vfp_dnm_d +VFNMS_dp ---- 1110 1.01 .... .... 1011 .1.0 .... @vfp_dnm_d VMOV_imm_sp ---- 1110 1.11 .... .... 1010 0000 .... \ vd=%vd_sp imm=%vmov_imm diff --git a/target/arm/translate-vfp.inc.c b/target/arm/translate-vfp.inc.c index 1964af3ea5..41aa67c133 100644 --- a/target/arm/translate-vfp.inc.c +++ b/target/arm/translate-vfp.inc.c @@ -1784,7 +1784,7 @@ static bool trans_VDIV_dp(DisasContext *s, arg_VDIV_dp *a) return do_vfp_3op_dp(s, gen_helper_vfp_divd, a->vd, a->vn, a->vm, false); } -static bool trans_VFM_sp(DisasContext *s, arg_VFM_sp *a) +static bool do_vfm_sp(DisasContext *s, arg_VFMA_sp *a, bool neg_n, bool neg_d) { /* * VFNMA : fd = muladd(-fd, fn, fm) @@ -1828,12 +1828,12 @@ static bool trans_VFM_sp(DisasContext *s, arg_VFM_sp *a) neon_load_reg32(vn, a->vn); neon_load_reg32(vm, a->vm); - if (a->o2) { + if (neg_n) { /* VFNMS, VFMS */ gen_helper_vfp_negs(vn, vn); } neon_load_reg32(vd, a->vd); - if (a->o1 & 1) { + if (neg_d) { /* VFNMA, VFNMS */ gen_helper_vfp_negs(vd, vd); } @@ -1849,7 +1849,27 @@ static bool trans_VFM_sp(DisasContext *s, arg_VFM_sp *a) return true; } -static bool trans_VFM_dp(DisasContext *s, arg_VFM_dp *a) +static bool trans_VFMA_sp(DisasContext *s, arg_VFMA_sp *a) +{ + return do_vfm_sp(s, a, false, false); +} + +static bool trans_VFMS_sp(DisasContext *s, arg_VFMS_sp *a) +{ + return do_vfm_sp(s, a, true, false); +} + +static bool trans_VFNMA_sp(DisasContext *s, arg_VFNMA_sp *a) +{ + return do_vfm_sp(s, a, false, true); +} + +static bool trans_VFNMS_sp(DisasContext *s, arg_VFNMS_sp *a) +{ + return do_vfm_sp(s, a, true, true); +} + +static bool do_vfm_dp(DisasContext *s, arg_VFMA_dp *a, bool neg_n, bool neg_d) { /* * VFNMA : fd = muladd(-fd, fn, fm) @@ -1905,12 +1925,12 @@ static bool trans_VFM_dp(DisasContext *s, arg_VFM_dp *a) neon_load_reg64(vn, a->vn); neon_load_reg64(vm, a->vm); - if (a->o2) { + if (neg_n) { /* VFNMS, VFMS */ gen_helper_vfp_negd(vn, vn); } neon_load_reg64(vd, a->vd); - if (a->o1 & 1) { + if (neg_d) { /* VFNMA, VFNMS */ gen_helper_vfp_negd(vd, vd); } @@ -1926,6 +1946,26 @@ static bool trans_VFM_dp(DisasContext *s, arg_VFM_dp *a) return true; } +static bool trans_VFMA_dp(DisasContext *s, arg_VFMA_dp *a) +{ + return do_vfm_dp(s, a, false, false); +} + +static bool trans_VFMS_dp(DisasContext *s, arg_VFMS_dp *a) +{ + return do_vfm_dp(s, a, true, false); +} + +static bool trans_VFNMA_dp(DisasContext *s, arg_VFNMA_dp *a) +{ + return do_vfm_dp(s, a, false, true); +} + +static bool trans_VFNMS_dp(DisasContext *s, arg_VFNMS_dp *a) +{ + return do_vfm_dp(s, a, true, true); +} + static bool trans_VMOV_imm_sp(DisasContext *s, arg_VMOV_imm_sp *a) { uint32_t delta_d = 0; From patchwork Mon Feb 24 22:22:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 183789 Delivered-To: patch@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp926522ile; Mon, 24 Feb 2020 14:29:30 -0800 (PST) X-Google-Smtp-Source: APXvYqxabOr5amM9m7TxxsZ9XVvs8Pb/dJZKNNTTuYA7KvtsUbhCJjY8MqJ4LRca3AstHDkYTAC+ X-Received: by 2002:aed:35c1:: with SMTP id d1mr49755489qte.218.1582583370779; Mon, 24 Feb 2020 14:29:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582583370; cv=none; d=google.com; s=arc-20160816; b=xz5jG2ccWl0Vatxdg5cOB7JutE+eJ1tK4kbbPkVHy8FquIevXgvmoMZ+cLlLuogwHZ 2OxB7alrNV29ULD7FDCM5HvClUCD10X+WYhVxwVB7x7QYVKz9korzAVlVSH1fg/0a15Y 5/bg85GMAp1fhRTqatJ042wCZGML+LirvP86DzR0oLzNlAs4psq5NvVTXivl6pPpsCBz wh36lD+nGMXBsVBMuJ/rCZH6LAAl0WN/Dv6gMrlObA3Cm9Txo4mPGHLpLnR1AINUAyOC sHGF+GeTH5TtDmvXzGjppeSmtTJF6NuQ6Xu5m83zCQhq6bg5CNfsPg6Gdc9rfBwZeemd Dj+g== 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=NtGab2HLNp8uF7NgRHRNjel2MNsIDKcBiKBTctaOBVU=; b=UcQdwrK+CzdXJFqIeH/mykU94tWk4s8AhxXGGp/I45Zf1YsXEXwccbA0DDWRnMnil6 RrV0ZE9GtSeN3PFcm0Rd4l9D/t1lnd3ZJBtmFSrrq10lhFJ3lLQLI6O0p2HIrRnOsQc6 ZL/xBNAXSuZyADfc0FpCROZ2htwUrw050Qn6zf3r8GCXlZz614+y4lIZoYyy1Xs+v/EH 115TyaSEpCOR9AdbBO394iZc8FuB4rgN7M0ZBfn9YXHObI4VWRNu8ewJ2KA2PSu4vBV1 kfaQH+7e+iOeIX1sartocYpAwYHfOzivz4gNw8l75Zfrv3iMIg43VHVbQOMntHsE0ku0 XZ8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=iQKbjljP; 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 c8si6578466qtg.53.2020.02.24.14.29.30 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 24 Feb 2020 14:29:30 -0800 (PST) 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=iQKbjljP; 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]:45374 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j6MEE-0008JO-7Y for patch@linaro.org; Mon, 24 Feb 2020 17:29:30 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:38093) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j6M7v-0004pp-Jh for qemu-devel@nongnu.org; Mon, 24 Feb 2020 17:23:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j6M7u-0005za-7k for qemu-devel@nongnu.org; Mon, 24 Feb 2020 17:22:59 -0500 Received: from mail-pg1-x544.google.com ([2607:f8b0:4864:20::544]:43792) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j6M7u-0005z3-1n for qemu-devel@nongnu.org; Mon, 24 Feb 2020 17:22:58 -0500 Received: by mail-pg1-x544.google.com with SMTP id u12so5829888pgb.10 for ; Mon, 24 Feb 2020 14:22:57 -0800 (PST) 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=NtGab2HLNp8uF7NgRHRNjel2MNsIDKcBiKBTctaOBVU=; b=iQKbjljPuxbGNNgKNsXt6A8vQsPZeMQ6t0A/1omR+FMYdp6gH6ymirmemstaOOBQ2i mSvR53Eeo717IJ30DBt4YVBmg2w/S5gRZ0kWUImGOyPp2z14cXRjxIF0hELBUuFkFVae jdr0vLr2hLkwbkX9nqcahPOQbXLBCXwV472O1Ux7Ad71QDgfNUeCkkxBSTq/v1kkhskQ t/gAY366vjLW4cwxfY+tbPLekF15AG4h95KJtSL8cl6k3CXY+HDEkun6xIqYSVU6jMlz ohrvbBrYTOmpyU/a6BCvL0mPBKU7xat2KxWeDb2QEJlUdPNfz3ybK6NewtrreHlgjnzD M1RA== 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=NtGab2HLNp8uF7NgRHRNjel2MNsIDKcBiKBTctaOBVU=; b=HYVtA3F7NbLwHnQIDkZJOn7OHCzoa707UiCj90W5P3fdRrkP+EYZWNfKJVVXqZIu5s 79ERUpzYq305LeLGuxHX1XBF040YePbNgvfX2ucvZMtfigLim57fXAlre+DaA3wS4DES 0MF6hhfVyEJH9wdbZyXgShxWZ7kvI+ZVhVLxnuRTSte2mk9CkNcuFoamqUm0QVyZ086Y O6n5dQxOcdfgeUvHH4efOiZOCYNklXXo2OtxugoMSRtPW4XIaKjVTHGxGdrYAW92VqH1 96gReBTcmNTiijNt75938JlFGaDYl7e+DQ6lGJ3SzgWXigG0UHkA+Ctgajsa4Fnu/5QM cg9Q== X-Gm-Message-State: APjAAAXR8LuzUV11dMJa8clTZwtXf47/w78kWSKr+EqYvCzjMxZwEEsE M7CMRkAN8JISHyXPO4xe6/YyjseoGc0= X-Received: by 2002:a63:3085:: with SMTP id w127mr16713345pgw.176.1582582976686; Mon, 24 Feb 2020 14:22:56 -0800 (PST) Received: from localhost.localdomain (97-126-123-70.tukw.qwest.net. [97.126.123.70]) by smtp.gmail.com with ESMTPSA id o6sm13897097pgg.37.2020.02.24.14.22.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Feb 2020 14:22:56 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 17/17] target/arm: Split VMINMAXNM decode Date: Mon, 24 Feb 2020 14:22:32 -0800 Message-Id: <20200224222232.13807-18-richard.henderson@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200224222232.13807-1-richard.henderson@linaro.org> References: <20200224222232.13807-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::544 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" Passing the raw op field from the manual is less instructive than it might be. Do the full decode and use the existing helpers to perform the expansion. Since these are v8 insns, VECLEN+VECSTRIDE are already RES0. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/arm/vfp-uncond.decode | 12 ++-- target/arm/translate-vfp.inc.c | 109 +++++++++++---------------------- 2 files changed, 44 insertions(+), 77 deletions(-) -- 2.20.1 diff --git a/target/arm/vfp-uncond.decode b/target/arm/vfp-uncond.decode index 5af1f2ee66..34ca164266 100644 --- a/target/arm/vfp-uncond.decode +++ b/target/arm/vfp-uncond.decode @@ -41,15 +41,19 @@ %vd_dp 22:1 12:4 %vd_sp 12:4 22:1 +@vfp_dnm_s ................................ vm=%vm_sp vn=%vn_sp vd=%vd_sp +@vfp_dnm_d ................................ vm=%vm_dp vn=%vn_dp vd=%vd_dp + VSEL 1111 1110 0. cc:2 .... .... 1010 .0.0 .... \ vm=%vm_sp vn=%vn_sp vd=%vd_sp dp=0 VSEL 1111 1110 0. cc:2 .... .... 1011 .0.0 .... \ vm=%vm_dp vn=%vn_dp vd=%vd_dp dp=1 -VMINMAXNM 1111 1110 1.00 .... .... 1010 . op:1 .0 .... \ - vm=%vm_sp vn=%vn_sp vd=%vd_sp dp=0 -VMINMAXNM 1111 1110 1.00 .... .... 1011 . op:1 .0 .... \ - vm=%vm_dp vn=%vn_dp vd=%vd_dp dp=1 +VMAXNM_sp 1111 1110 1.00 .... .... 1010 .0.0 .... @vfp_dnm_s +VMINNM_sp 1111 1110 1.00 .... .... 1010 .1.0 .... @vfp_dnm_s + +VMAXNM_dp 1111 1110 1.00 .... .... 1011 .0.0 .... @vfp_dnm_d +VMINNM_dp 1111 1110 1.00 .... .... 1011 .1.0 .... @vfp_dnm_d VRINT 1111 1110 1.11 10 rm:2 .... 1010 01.0 .... \ vm=%vm_sp vd=%vd_sp dp=0 diff --git a/target/arm/translate-vfp.inc.c b/target/arm/translate-vfp.inc.c index 41aa67c133..b087bbd812 100644 --- a/target/arm/translate-vfp.inc.c +++ b/target/arm/translate-vfp.inc.c @@ -322,79 +322,6 @@ static bool trans_VSEL(DisasContext *s, arg_VSEL *a) return true; } -static bool trans_VMINMAXNM(DisasContext *s, arg_VMINMAXNM *a) -{ - uint32_t rd, rn, rm; - bool dp = a->dp; - bool vmin = a->op; - TCGv_ptr fpst; - - if (!dc_isar_feature(aa32_vminmaxnm, s)) { - return false; - } - - if (dp && !dc_isar_feature(aa32_fpdp_v2, s)) { - return false; - } - - /* UNDEF accesses to D16-D31 if they don't exist */ - if (dp && !dc_isar_feature(aa32_simd_r32, s) && - ((a->vm | a->vn | a->vd) & 0x10)) { - return false; - } - - rd = a->vd; - rn = a->vn; - rm = a->vm; - - if (!vfp_access_check(s)) { - return true; - } - - fpst = get_fpstatus_ptr(0); - - if (dp) { - TCGv_i64 frn, frm, dest; - - frn = tcg_temp_new_i64(); - frm = tcg_temp_new_i64(); - dest = tcg_temp_new_i64(); - - neon_load_reg64(frn, rn); - neon_load_reg64(frm, rm); - if (vmin) { - gen_helper_vfp_minnumd(dest, frn, frm, fpst); - } else { - gen_helper_vfp_maxnumd(dest, frn, frm, fpst); - } - neon_store_reg64(dest, rd); - tcg_temp_free_i64(frn); - tcg_temp_free_i64(frm); - tcg_temp_free_i64(dest); - } else { - TCGv_i32 frn, frm, dest; - - frn = tcg_temp_new_i32(); - frm = tcg_temp_new_i32(); - dest = tcg_temp_new_i32(); - - neon_load_reg32(frn, rn); - neon_load_reg32(frm, rm); - if (vmin) { - gen_helper_vfp_minnums(dest, frn, frm, fpst); - } else { - gen_helper_vfp_maxnums(dest, frn, frm, fpst); - } - neon_store_reg32(dest, rd); - tcg_temp_free_i32(frn); - tcg_temp_free_i32(frm); - tcg_temp_free_i32(dest); - } - - tcg_temp_free_ptr(fpst); - return true; -} - /* * Table for converting the most common AArch32 encoding of * rounding mode to arm_fprounding order (which matches the @@ -1784,6 +1711,42 @@ static bool trans_VDIV_dp(DisasContext *s, arg_VDIV_dp *a) return do_vfp_3op_dp(s, gen_helper_vfp_divd, a->vd, a->vn, a->vm, false); } +static bool trans_VMINNM_sp(DisasContext *s, arg_VMINNM_sp *a) +{ + if (!dc_isar_feature(aa32_vminmaxnm, s)) { + return false; + } + return do_vfp_3op_sp(s, gen_helper_vfp_minnums, + a->vd, a->vn, a->vm, false); +} + +static bool trans_VMAXNM_sp(DisasContext *s, arg_VMAXNM_sp *a) +{ + if (!dc_isar_feature(aa32_vminmaxnm, s)) { + return false; + } + return do_vfp_3op_sp(s, gen_helper_vfp_maxnums, + a->vd, a->vn, a->vm, false); +} + +static bool trans_VMINNM_dp(DisasContext *s, arg_VMINNM_dp *a) +{ + if (!dc_isar_feature(aa32_vminmaxnm, s)) { + return false; + } + return do_vfp_3op_dp(s, gen_helper_vfp_minnumd, + a->vd, a->vn, a->vm, false); +} + +static bool trans_VMAXNM_dp(DisasContext *s, arg_VMAXNM_dp *a) +{ + if (!dc_isar_feature(aa32_vminmaxnm, s)) { + return false; + } + return do_vfp_3op_dp(s, gen_helper_vfp_maxnumd, + a->vd, a->vn, a->vm, false); +} + static bool do_vfm_sp(DisasContext *s, arg_VFMA_sp *a, bool neg_n, bool neg_d) { /*