]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Add infrastructure for detection of 32-bit ARMv8 capable CPUs (Valgrind side).
authorJulian Seward <jseward@acm.org>
Wed, 3 Aug 2016 11:40:36 +0000 (11:40 +0000)
committerJulian Seward <jseward@acm.org>
Wed, 3 Aug 2016 11:40:36 +0000 (11:40 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15921

coregrind/m_initimg/initimg-linux.c
coregrind/m_machine.c

index cb87c7e1c0e9d8f764579a6b065dbcc00bb8190c..7abcea591f1582c3cf46d390c4e24ed22efdde5d 100644 (file)
@@ -691,8 +691,9 @@ Addr setup_client_stack( void*  init_sp,
                                "ARM has-neon from-auxv: %s\n",
                                has_neon ? "YES" : "NO");
               VG_(machine_arm_set_has_NEON)( has_neon );
-              #define VKI_HWCAP_TLS 32768
+#             define VKI_HWCAP_TLS 32768
               Bool has_tls = (auxv->u.a_val & VKI_HWCAP_TLS) > 0;
+#             undef VKI_HWCAP_TLS
               VG_(debugLog)(2, "initimg",
                                "ARM has-tls from-auxv: %s\n",
                                has_tls ? "YES" : "NO");
index 34273d7a84f4178ccced0cbfe4dfde97f1d36024..0384f873d060944abd7923fd59f81772512fd523 100644 (file)
@@ -1523,7 +1523,7 @@ Bool VG_(machine_get_hwcaps)( void )
      vki_sigaction_fromK_t saved_sigill_act, saved_sigfpe_act;
      vki_sigaction_toK_t     tmp_sigill_act,   tmp_sigfpe_act;
 
-     volatile Bool have_VFP, have_VFP2, have_VFP3, have_NEON;
+     volatile Bool have_VFP, have_VFP2, have_VFP3, have_NEON, have_V8;
      volatile Int archlevel;
      Int r;
 
@@ -1602,6 +1602,19 @@ Bool VG_(machine_get_hwcaps)( void )
         }
      }
 
+     /* ARMv8 insns */
+     have_V8 = True;
+     if (archlevel == 7) {
+        if (VG_MINIMAL_SETJMP(env_unsup_insn)) {
+           have_V8 = False;
+        } else {
+           __asm__ __volatile__(".word 0xF3044F54"); /* VMAXNM.F32 q2,q2,q2 */
+        }
+        if (have_V8 && have_NEON && have_VFP3) {
+           archlevel = 8;
+        }
+     }
+
      VG_(convert_sigaction_fromK_to_toK)(&saved_sigill_act, &tmp_sigill_act);
      VG_(convert_sigaction_fromK_to_toK)(&saved_sigfpe_act, &tmp_sigfpe_act);
      VG_(sigaction)(VKI_SIGILL, &tmp_sigill_act, NULL);