[Bug 213271] devel/marisa-trie: enable SSE2 by default for amd64 or depending on CPUTYPE
bugzilla-noreply at freebsd.org
bugzilla-noreply at freebsd.org
Mon Oct 10 04:13:32 UTC 2016
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=213271
--- Comment #3 from Jan Beich (mail not working) <jbeich at FreeBSD.org> ---
dmesg(8) or rather /var/run/dmesg.boot is a basic CPUID check in kernel. What
you probably want is extract supported features out of compiler, similar to bug
112997. Output depends on compiler type and version, so any make(1) magic would
have to accomodate. Here's an example:
#############################
.ifnmake describe
_CC1!= ${CC} -E -v -march=native -</dev/null 2>&1 | fgrep cc1
. if ${_CC1:M*-triple*} # clang
_SIMD= ${_CC1:M+*:S/^+//:S/.//g}
. else
_SIMD= ${_CC1:N-mno-*:N-march*:N-mtune*:M-m*:S/-m//:S/.//g}
. endif
MACHINE_CPU+= ${_SIMD}
.endif
print-simd:
@${ECHO} ${_SIMD}
#############################
$ cc -v |& fgrep ' version'
FreeBSD clang version 3.9.0 (tags/RELEASE_390/final 280324) (based on LLVM
3.9.0)
$ gcc6 -v |& fgrep ' version'
gcc version 6.2.0 (FreeBSD Ports Collection)
$ make print-simd
sse2 cx16 prfchw bmi2 xsavec fsgsbase popcnt aes xsaves smap mmx rdseed hle
clflushopt xsave invpcidavx rtm fma bmi rdrnd sse41 sse42 avx2 sse lzcnt pclmul
f16c ssse3 sgx cmov movbe xsaveopt adx sse3
$ make print-simd CC=gcc6
mmx sse sse2 sse3 ssse3 cx16 sahf movbe aes pclmul popcnt abm fma bmi bmi2 avx
avx2 sse42 sse41 lzcnt rtm hle rdrnd f16c fsgsbase rdseed prfchw adx fxsr xsave
xsaveopt clflushopt xsavec xsaves
$ make -V OPTIONS_DEFAULT
ADX AES AMD64 AVX AVX2 BMI BMI2 CLFLUSHOPT CMOV CX16 F16C FMA FMA3 FSGSBASE
HLE INVPCID LZCNT MMX MOVBE PCLMUL POPCNT PRFCHW RDRND RDSEED RTM SGX SMAP SSE
SSE2 SSE3 SSE41 SSE42 SSSE3 XSAVE XSAVEC XSAVEOPT XSAVES
#############################
It maybe worth to write new USES for to supplant bsd.cpu.mk but let's keep
individual port's Makefiles in a declarative style. This means complex stuff
like conditionals, shell invocations should be avoided or kept to minimum.
--
You are receiving this mail because:
You are the assignee for the bug.
More information about the freebsd-ports-bugs
mailing list