# Recognized fields:
# "Name": the isa extension name, the package will be ${Name}-support
# "Architecture": archs to build the package on, wildcards are ok
# "Test": how to detect it, defaults to return !__builtin_cpu_supports("$Name");
#     If the test program dies (SIGILL/etc), that's ok, the answer is "no".
# CFLAGS: passed to the C compiler, can include link-time flags too.
# Description: added to package's description.

Name: sse2
Architecture: any-i386
Description:
 These instructions are available on processors from Pentium 4 onward,
 including any 64-bit capable.  There's no SSE2 on Pentium 3, Athlon XP,
 Via C3, Quark -- and older.

Name: sse3
Architecture: any-i386 any-amd64
Description:
 These instructions are available on almost any 64-bit capable processors
 except for some early AMD models (Sledgehammer and Clawhammer), but not
 most 32-bit only hardware.

Name: sse4.1
Architecture: any-i386 any-amd64
Description:
 These instructions are available on Intel processors since Penryn (circa
 2008), but notably not on anything AMD until 2011-13, starting with family
 15h (Bulldozer then Jaguar).

Name: sse4.2
Architecture: any-i386 any-amd64
Description:
 These instructions are available on Intel processors since Nehalem (circa
 2008), but notably not on anything AMD until 2011-13, starting with family
 15h (Bulldozer then Jaguar).

Name: altivec
Architecture: powerpc
Test: asm volatile("vsldoi %v1,%v1,%v1,0");
# gcc-16 has __builtin_cpu_supports("altivec") but it's not reliable: silently
# gives wrong answer on qemu, wrong versions of glibc, non-glibc, etc.
# Thus, let's use SIGILL instead.

Name: neon
Architecture: armhf
CFLAGS: -mfpu=neon
Test: asm volatile("VMUL.I16 q0,q0,q1");
Description:
 These instructions are available on the vast majority of armhf hardware
 but not guaranteed before ARMv8 (ie, 64-bit capable).

Name: armv6
Architecture: armel
Test: return !need_armv_version(6);
Description:
 This architecture is available the newer armel machine like
 for instance Raspberry Pi, but not guaranted by architecture
 baseline. This architecture is available since ARM11 product
 family including ARM1136J(F)-S, ARM1156T2(F)-S,
 ARM1176JZ(F)-S, ARM1136EJ(F)-S and ARM11MPCore
 processors. Boards include the Raspberry Pi model 1 and
 Raspberry Pi Zero.

Name: armv6k
Architecture: armel
Test: return !(need_armv_version(6) && (getauxval(AT_HWCAP) & HWCAP_ARM_TLS));
Description:
 This architecture is available the newer armel machine like
 for instance Raspberry Pi, but not guaranted by architecture
 baseline. This architecture is available since ARM11 product
 family and include armv6k instruction set.
 Boards include the Raspberry Pi model 1 and
 Raspberry Pi Zero.



Name: armv7
Architecture: armel
Test: return !need_armv_version(7);
Description:
 This architecture is available the newer armel machine like
 for instance amrhf supported cpu, but not guaranted by architecture
 baseline. This architecture is available since Cortex-A product
 family including Cortex-A5, Cortex-A7,
 Cortex-A8, Cortex-A9, Cortex-A12, Cortex-A15 and Cortex-A17
 processors. Boards include the Raspberry Pi 2.

Name: armv8
Architecture: armel armhf
Test: return !need_armv_version(8);
Description:
 This architecture is available the newer armel machine like
 for instance armhf port, but not guaranted by architecture
 baseline. This architecture is available since Cortex-A product
 family including Cortex-A32 and all arm64
 processors. Boards include the Raspberry Pi 3 and Raspberry Pi 4.

Name: vfp
Architecture: armel
Test: return !(getauxval(AT_HWCAP) & HWCAP_ARM_VFP)
Description:
  Detect vector floating point version 2. VFP was obsoleted by ARM, so check VFP
  flag from kernel and armv >= 5.

Name: vfpv2
Architecture: armel
Test: return !(need_armv_version(5) && (getauxval(AT_HWCAP) & HWCAP_ARM_VFP))
Description:
  Detect vector floating point version 2.

Name: vfpv3
Architecture: armel
Test: return !(getauxval(AT_HWCAP) & HWCAP_ARM_VFPv3)
Description:
  Detect vector floating point version 3.
