Optimize String::isAscii using AVX2 or NEON (not tested with MSVC yet).

Added EE::System::CPU static class to query about CPU capabilities.
This commit is contained in:
Martín Lucas Golini
2026-01-04 19:47:48 -03:00
parent 331f769590
commit dbcb93a438
6 changed files with 305 additions and 17 deletions

View File

@@ -316,6 +316,12 @@ typedef signed long long Int64;
typedef unsigned long long Uint64;
#endif
#if defined( __x86_64__ ) || defined( _M_X64 )
#define EE_ARCH_X86_64
#elif defined( __aarch64__ ) || defined( _M_ARM64 )
#define EE_ARCH_ARM64
#endif
#if defined( EE_LINUX_64 ) || defined( EE_SPARC_64 ) || defined( __osf__ ) || \
( defined( _WIN64 ) && !defined( _XBOX ) ) || defined( __64BIT__ ) || defined( __LP64 ) || \
defined( __LP64__ ) || defined( _LP64 ) || defined( _ADDR64 ) || defined( _CRAYC )

View File

@@ -0,0 +1,17 @@
#ifndef EE_SYSTEM_CPU_HPP
#define EE_SYSTEM_CPU_HPP
#include <eepp/config.hpp>
namespace EE { namespace System {
class EE_API CPU {
public:
static bool hasAVX2();
static bool hasNEON();
};
}} // namespace EE::System
#endif // EE_SYSTEM_CPU_HPP