Bug 234291 - LLVM does not support CPU feature detection on non-x86 platforms
Summary: LLVM does not support CPU feature detection on non-x86 platforms
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-toolchain (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-12-23 10:32 UTC by Greg V
Modified: 2018-12-24 12:05 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Greg V 2018-12-23 10:32:01 UTC
llvm::sys::getHostCPUFeatures (lib/Support/Host.cpp): https://llvm.org/doxygen/Host_8cpp_source.html#l01427

only supports Linux's /proc/cpuinfo on non-x86 architectures.

One known user of that API is lang/ponyc, where I contributed a workaround: https://github.com/ponylang/ponyc/commit/81ba52c90cb87a049be8052754a8b031de59593d

There should be versions of this function for FreeBSD/aarch64 (by reading ID_AA64ISAR0_EL1/ID_AA64PFR0_EL1/ID_AA64ISAR1_EL1 in userspace) and armv\d|powerpc(64)? (via elf_aux_info).
Comment 1 Dimitry Andric freebsd_committer 2018-12-24 12:05:18 UTC
If we implement anything for this, it should be reviewed upstream first.  That said, I know next to nothing about ARM CPU features... :)