Differences From Artifact [db62f84bfb]:
- File
src/OFSystemInfo.m
— part of check-in
[952af5f0aa]
at
2015-10-24 20:53:32
on branch trunk
— OFSystemInfo.h: Use OF_X86 rather than OF_X86_ASM
The availability of the interface should not depend on whether inline
assembly is available or not, but rather on the CPU architecture.In case no inline assembly is available, false is returned for
everything. (user: js, size: 8517) [annotate] [blame] [check-ins using]
To Artifact [918d680213]:
- File src/OFSystemInfo.m — part of check-in [2ba8ec1bf1] at 2015-11-02 21:49:33 on branch trunk — Add +[OFSystemInfo supportsAltiVec] (user: js, size: 8872) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
21 22 23 24 25 26 27 28 29 30 31 32 33 34 | /* Work around __block being used by glibc */ #include <stdlib.h> /* include any libc header to get the libc defines */ #ifdef __GLIBC__ # undef __USE_XOPEN #endif #include <unistd.h> #import "OFSystemInfo.h" #import "OFString.h" #import "OFArray.h" #import "OFDictionary.h" #import "OFApplication.h" | > > > > > > | 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | /* Work around __block being used by glibc */ #include <stdlib.h> /* include any libc header to get the libc defines */ #ifdef __GLIBC__ # undef __USE_XOPEN #endif #include <unistd.h> #include "platform.h" #ifdef OF_MAC_OS_X # include <sys/sysctl.h> #endif #import "OFSystemInfo.h" #import "OFString.h" #import "OFArray.h" #import "OFDictionary.h" #import "OFApplication.h" |
︙ | ︙ | |||
363 364 365 366 367 368 369 370 | } + (bool)supportsAVX2 { return x86_cpuid(0, 0).eax >= 7 && (x86_cpuid(7, 0).ebx & (1 << 5)); } #endif @end | > > > > > > > > > > > > > > > | 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 | } + (bool)supportsAVX2 { return x86_cpuid(0, 0).eax >= 7 && (x86_cpuid(7, 0).ebx & (1 << 5)); } #endif #if defined(OF_POWERPC) || defined(OF_POWERPC64) + (bool)supportsAltiVec { # ifdef OF_MAC_OS_X int name[2] = { CTL_HW, HW_VECTORUNIT }, value = 0; size_t length = sizeof(value); if (sysctl(name, 2, &value, &length, NULL, 0) == 0) return value; # endif return 0; } #endif @end |