]> Git Repo - qemu.git/commitdiff
target/arm: Enable SVE for aarch64-linux-user
authorRichard Henderson <[email protected]>
Fri, 29 Jun 2018 14:11:15 +0000 (15:11 +0100)
committerPeter Maydell <[email protected]>
Fri, 29 Jun 2018 14:11:15 +0000 (15:11 +0100)
Enable ARM_FEATURE_SVE for the generic "max" cpu.

Tested-by: Alex BennĂ©e <[email protected]>
Reviewed-by: Peter Maydell <[email protected]>
Signed-off-by: Richard Henderson <[email protected]>
Message-id: 20180627043328[email protected]
Signed-off-by: Peter Maydell <[email protected]>
linux-user/elfload.c
target/arm/cpu.c
target/arm/cpu64.c

index 13bc78d0c8665218be41cb1cb00dabef22d73e5b..d1231ad07a3183a32669c44900a5f7167254502d 100644 (file)
@@ -584,6 +584,7 @@ static uint32_t get_elf_hwcap(void)
     GET_FEATURE(ARM_FEATURE_V8_ATOMICS, ARM_HWCAP_A64_ATOMICS);
     GET_FEATURE(ARM_FEATURE_V8_RDM, ARM_HWCAP_A64_ASIMDRDM);
     GET_FEATURE(ARM_FEATURE_V8_FCMA, ARM_HWCAP_A64_FCMA);
+    GET_FEATURE(ARM_FEATURE_SVE, ARM_HWCAP_A64_SVE);
 #undef GET_FEATURE
 
     return hwcaps;
index 2ae4fffafb96b75fa669da218a784212b388dc4f..6dcc552e143abde85cd6619a67437e0af2368529 100644 (file)
@@ -164,6 +164,13 @@ static void arm_cpu_reset(CPUState *s)
         env->cp15.sctlr_el[1] |= SCTLR_UCT | SCTLR_UCI | SCTLR_DZE;
         /* and to the FP/Neon instructions */
         env->cp15.cpacr_el1 = deposit64(env->cp15.cpacr_el1, 20, 2, 3);
+        /* and to the SVE instructions */
+        env->cp15.cpacr_el1 = deposit64(env->cp15.cpacr_el1, 16, 2, 3);
+        env->cp15.cptr_el[3] |= CPTR_EZ;
+        /* with maximum vector length */
+        env->vfp.zcr_el[1] = ARM_MAX_VQ - 1;
+        env->vfp.zcr_el[2] = ARM_MAX_VQ - 1;
+        env->vfp.zcr_el[3] = ARM_MAX_VQ - 1;
 #else
         /* Reset into the highest available EL */
         if (arm_feature(env, ARM_FEATURE_EL3)) {
index c50dcd4077daaf4fb28cb49cab8c1a3e2c51120b..0360d7efc5e30d45d002e3c7fa1394d14337c312 100644 (file)
@@ -252,6 +252,7 @@ static void aarch64_max_initfn(Object *obj)
         set_feature(&cpu->env, ARM_FEATURE_V8_RDM);
         set_feature(&cpu->env, ARM_FEATURE_V8_FP16);
         set_feature(&cpu->env, ARM_FEATURE_V8_FCMA);
+        set_feature(&cpu->env, ARM_FEATURE_SVE);
         /* For usermode -cpu max we can use a larger and more efficient DCZ
          * blocksize since we don't have to follow what the hardware does.
          */
This page took 0.035647 seconds and 4 git commands to generate.