Skip to content

ENH: Detect CPU features on FreeBSD/powerpc64*#22967

Merged
charris merged 1 commit intonumpy:maintenance/1.24.xfrom
charris:backport-22777
Jan 9, 2023
Merged

ENH: Detect CPU features on FreeBSD/powerpc64*#22967
charris merged 1 commit intonumpy:maintenance/1.24.xfrom
charris:backport-22777

Conversation

@charris
Copy link
Copy Markdown
Member

@charris charris commented Jan 8, 2023

Backport of #22777.

  1. FreeBSD uses elf_aux_info() instead of getauxval.
  2. Switch to using compiler macros for detecting POWER platform FreeBSD sets the machine name (what uname -m prints) on all powerpc* to just powerpc. To identify actual architecture, uname -p should be used, but this is not present in uname() function. Thus, the only way to correctly detect platform is to use what uname prints and also check compiler defines.

1. FreeBSD uses elf_aux_info() instead of getauxval.
2. Switch to using compiler macros for detecting POWER platform
FreeBSD sets the machine name (what uname -m prints) on all powerpc* to
just powerpc. To identify actual architecture, uname -p should be used,
but this is not present in uname() function. Thus, the only way to
correctly detect platform is to use what uname prints and also check
compiler defines.
@charris charris added 08 - Backport Used to tag backport PRs component: SIMD Issues in SIMD (fast instruction sets) code or machinery 36 - Build Build related PR labels Jan 8, 2023
@charris charris added this to the 1.24.2 release milestone Jan 8, 2023
@charris charris merged commit 4b53673 into numpy:maintenance/1.24.x Jan 9, 2023
@charris charris deleted the backport-22777 branch January 9, 2023 00:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

01 - Enhancement 08 - Backport Used to tag backport PRs 36 - Build Build related PR component: SIMD Issues in SIMD (fast instruction sets) code or machinery

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants