libretro / libretro-common

Reusable coding blocks useful for libretro core and frontend development, written primarily in C. Permissively licensed.
146 stars 76 forks source link

Improve ARM runtime feature detection on Linux #176

Open linkmauve opened 4 years ago

linkmauve commented 4 years ago

getauxval(AT_HWCAP) is the best way to check for features on ARM and AArch64, as it doesn’t require parsing a file, instead it just returns a value provided by the kernel in our address space.

This has been tested on a Nintendo Switch running ArchLinuxARM, on both AArch64 and AArch32.

inactive123 commented 3 years ago

Would this code work on Android and iOS?

linkmauve commented 3 years ago

I actually don’t know, I don’t have any such device available so I only tested on Linux. According to Android’s documentation it should, but I couldn’t find anything similar for iOS.

Edit: this codepath is only used on Linux anyway, we could extend it to Android but it doesn’t make sense for iOS it seems.

phcoder commented 2 years ago

Edit: this codepath is only used on Linux anyway, we could extend it to Android but it doesn’t make sense for iOS it seems.

Linux and Android. Android defines linux as well