qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 1/2] target/arm: Disable VFPv4-D32 when NEON is not available


From: Cédric Le Goater
Subject: Re: [PATCH 1/2] target/arm: Disable VFPv4-D32 when NEON is not available
Date: Fri, 30 Sep 2022 16:59:35 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.0

On 9/29/22 13:44, Peter Maydell wrote:
On Wed, 28 Sept 2022 at 17:47, Cédric Le Goater <clg@kaod.org> wrote:

As the Cortex A7 MPCore Technical reference says :

   "When FPU option is selected without NEON, the FPU is VFPv4-D16 and
   uses 16 double-precision registers. When the FPU is implemented with
   NEON, the FPU is VFPv4-D32 and uses 32 double-precision registers.
   This register bank is shared with NEON."

Modify the mvfr0 register value of the cortex A7 to advertise only 16
registers when NEON is not available, and not 32 registers.

Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
  target/arm/cpu.c | 4 ++++
  1 file changed, 4 insertions(+)

diff --git a/target/arm/cpu.c b/target/arm/cpu.c
index 7ec3281da9aa..01dc74c32add 100644
--- a/target/arm/cpu.c
+++ b/target/arm/cpu.c
@@ -1684,6 +1684,10 @@ static void arm_cpu_realizefn(DeviceState *dev, Error 
**errp)
          cpu->isar.id_isar6 = u;

          if (!arm_feature(env, ARM_FEATURE_M)) {
+            u = cpu->isar.mvfr0;
+            u = FIELD_DP32(u, MVFR0, SIMDREG, 1); /* 16 registers */
+            cpu->isar.mvfr0 = u;
+

Architecturally, Neon implies that you must have 32 dp registers,
but not having Neon does not imply that you must only have 16.
In particular, the Cortex-A15 always implements VFPv4-D32
whether Neon is enabled or not.

If you want to be able to turn off D32 and restrict to 16
registers, I think you need to add a separate property to
control that.

Something like "vfp-d16" ?

Thanks,

C.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]