Skip to content

Commit

Permalink
ASIMD detection on ARMv8
Browse files Browse the repository at this point in the history
  • Loading branch information
hgomez-sonarsource committed Oct 18, 2016
1 parent f1b24f5 commit eaed1c9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions libretro-common/features/features_cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -704,6 +704,15 @@ uint64_t cpu_features_get(void)
if (check_arm_cpu_feature("vfpv4"))
cpu |= RETRO_SIMD_VFPV4;

if (check_arm_cpu_feature("asymd"))
{
cpu |= RETRO_SIMD_ASIMD;
#ifdef __ARM_NEON__
cpu |= RETRO_SIMD_NEON;
arm_enable_runfast_mode();
#endif
}

#if 0
check_arm_cpu_feature("swp");
check_arm_cpu_feature("half");
Expand Down Expand Up @@ -748,6 +757,7 @@ uint64_t cpu_features_get(void)
if (cpu & RETRO_SIMD_VMX128) strlcat(buf, " VMX128", sizeof(buf));
if (cpu & RETRO_SIMD_VFPU) strlcat(buf, " VFPU", sizeof(buf));
if (cpu & RETRO_SIMD_PS) strlcat(buf, " PS", sizeof(buf));
if (cpu & RETRO_SIMD_ASIMD) strlcat(buf, " ASIMD", sizeof(buf));

return cpu;
}
1 change: 1 addition & 0 deletions libretro-common/include/libretro.h
Original file line number Diff line number Diff line change
Expand Up @@ -1316,6 +1316,7 @@ struct retro_log_callback
#define RETRO_SIMD_POPCNT (1 << 18)
#define RETRO_SIMD_MOVBE (1 << 19)
#define RETRO_SIMD_CMOV (1 << 20)
#define RETRO_SIMD_ASIMD (1 << 21)

typedef uint64_t retro_perf_tick_t;
typedef int64_t retro_time_t;
Expand Down

0 comments on commit eaed1c9

Please sign in to comment.