Index: src/OFSystemInfo.h ================================================================== --- src/OFSystemInfo.h +++ src/OFSystemInfo.h @@ -182,36 +182,8 @@ * * @return Whether the CPU supports AVX2 */ + (bool)supportsAVX2; #endif - -#ifdef OF_PPC_ASM -/*! - * @brief Returns whether the CPU supports AltiVec. - * - * @warning This method only checks CPU support and assumes OS support! - * - * @note This method is only available on PowerPC. - * - * @return Whether the CPU supports AltiVec - */ -+ (bool)supportsAltiVec; -#endif - -#ifdef OF_MIPS_ASM -/*! - * @brief Returns whether the CPU supports MXU. - * - * MXU is the SIMD extension of the JZ47XX SoCs. - * - * @warning This method only checks CPU support and assumes OS support! - * - * @note This method is only available on MIPS. - * - * @return Whether the CPU supports MXU - */ -+ (bool)supportsMXU; -#endif @end OF_ASSUME_NONNULL_END Index: src/OFSystemInfo.m ================================================================== --- src/OFSystemInfo.m +++ src/OFSystemInfo.m @@ -44,31 +44,19 @@ # include #endif #ifdef __QNX__ # include #endif -#if defined(OF_PPC_ASM) || defined(OF_MIPS_ASM) -# include -# include -#endif #if defined(OF_X86_64_ASM) || defined(OF_X86_ASM) struct x86_regs { uint32_t eax, ebx, ecx, edx; }; #endif static size_t pageSize; static size_t numberOfCPUs; -#if defined(OF_PPC_ASM) -static sig_atomic_t supportsAltiVec = 0; -#elif defined(OF_MIPS_ASM) -static sig_atomic_t supportsMXU = 0; -#endif -#if defined(OF_PPC_ASM) || defined(OF_MIPS_ASM) -static sigjmp_buf SIGILLJumpBuffer; -#endif #if defined(OF_X86_64_ASM) static OF_INLINE struct x86_regs OF_CONST_FUNC x86_cpuid(uint32_t eax, uint32_t ecx) { @@ -105,45 +93,11 @@ return regs; } #endif -#if defined(OF_PPC_ASM) || defined(OF_MIPS_ASM) -static void -SIGILLHandler(int signal) -{ - siglongjmp(SIGILLJumpBuffer, 1); -} -#endif - @implementation OFSystemInfo -#if defined(OF_PPC_ASM) || defined(OF_MIPS_ASM) -+ (void)load -{ - if (sigsetjmp(SIGILLJumpBuffer, 1) == 0) { - signal(SIGILL, SIGILLHandler); -# if defined(OF_PPC_ASM) - __asm__ __volatile__ ( - "vor v0, v0, v0" - ); - supportsAltiVec = 1; -# elif defined(OF_MIPS_ASM) - /* This also enables the MXU */ - __asm__ __volatile__ ( - "li $t0, 1\n\t" - ".word 0x7008042f /* s32i2m xr16, $t0 */" - : - : - : "$8" /* $t0 */ - ); - supportsMXU = 1; -# endif - } - signal(SIGILL, SIG_DFL); -} -#endif - + (void)initialize { if (self != [OFSystemInfo class]) return; @@ -414,21 +368,7 @@ + (bool)supportsAVX2 { return x86_cpuid(0, 0).eax >= 7 && (x86_cpuid(7, 0).ebx & (1 << 5)); } -#endif - -#ifdef OF_PPC_ASM -+ (bool)supportsAltiVec -{ - return supportsAltiVec; -} -#endif - -#ifdef OF_MIPS_ASM -+ (bool)supportsMXU -{ - return supportsMXU; -} #endif @end