@@ -562,7 +562,7 @@ npy__cpu_init_features(void)
562
562
563
563
#elif defined(NPY_CPU_PPC64 ) || defined(NPY_CPU_PPC64LE )
564
564
565
- #if defined(__linux__ ) || defined(__FreeBSD__ )
565
+ #if defined(__linux__ ) || defined(__FreeBSD__ ) || defined( __OpenBSD__ )
566
566
#ifdef __FreeBSD__
567
567
#include <machine/cpu.h> // defines PPC_FEATURE_HAS_VSX
568
568
#endif
@@ -585,7 +585,7 @@ static void
585
585
npy__cpu_init_features (void )
586
586
{
587
587
memset (npy__cpu_have , 0 , sizeof (npy__cpu_have [0 ]) * NPY_CPU_FEATURE_MAX );
588
- #if defined(__linux__ ) || defined(__FreeBSD__ )
588
+ #if defined(__linux__ ) || defined(__FreeBSD__ ) || defined( __OpenBSD__ )
589
589
#ifdef __linux__
590
590
unsigned int hwcap = getauxval (AT_HWCAP );
591
591
if ((hwcap & PPC_FEATURE_HAS_VSX ) == 0 )
@@ -612,7 +612,7 @@ npy__cpu_init_features(void)
612
612
npy__cpu_have [NPY_CPU_FEATURE_VSX2 ] = (hwcap & PPC_FEATURE2_ARCH_2_07 ) != 0 ;
613
613
npy__cpu_have [NPY_CPU_FEATURE_VSX3 ] = (hwcap & PPC_FEATURE2_ARCH_3_00 ) != 0 ;
614
614
npy__cpu_have [NPY_CPU_FEATURE_VSX4 ] = (hwcap & PPC_FEATURE2_ARCH_3_1 ) != 0 ;
615
- // TODO: AIX, OpenBSD
615
+ // TODO: AIX
616
616
#else
617
617
npy__cpu_have [NPY_CPU_FEATURE_VSX ] = 1 ;
618
618
#if defined(NPY_CPU_PPC64LE ) || defined(NPY_HAVE_VSX2 )
@@ -698,7 +698,7 @@ npy__cpu_init_features_arm8(void)
698
698
npy__cpu_have [NPY_CPU_FEATURE_ASIMD ] = 1 ;
699
699
}
700
700
701
- #if defined(__linux__ ) || defined(__FreeBSD__ )
701
+ #if defined(__linux__ ) || defined(__FreeBSD__ ) || defined( __OpenBSD__ )
702
702
/*
703
703
* we aren't sure of what kind kernel or clib we deal with
704
704
* so we play it safe
@@ -709,7 +709,7 @@ npy__cpu_init_features_arm8(void)
709
709
#if defined(__linux__ )
710
710
__attribute__((weak )) unsigned long getauxval (unsigned long ); // linker should handle it
711
711
#endif
712
- #ifdef __FreeBSD__
712
+ #if defined( __FreeBSD__ ) || defined( __OpenBSD__ )
713
713
__attribute__((weak )) int elf_aux_info (int , void * , int ); // linker should handle it
714
714
715
715
static unsigned long getauxval (unsigned long k )
@@ -807,7 +807,7 @@ static void
807
807
npy__cpu_init_features (void )
808
808
{
809
809
memset (npy__cpu_have , 0 , sizeof (npy__cpu_have [0 ]) * NPY_CPU_FEATURE_MAX );
810
- #ifdef __linux__
810
+ #if defined( __linux__ ) || defined( __FreeBSD__ ) || defined( __OpenBSD__ )
811
811
if (npy__cpu_init_features_linux ())
812
812
return ;
813
813
#endif
0 commit comments