highway
highway copied to clipboard
Query about sandybridge with AES instruction from AVX2
Will adding an AES instruction to get sse4 damage the CPU sandybridge? Intel Sandy Bridge CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, POPCNT, CX16, SAHF, FXSR, AVX, XSAVE and PCLMUL instruction set support.
Hi @Jamaika1 , Highway's SSE4 target requires AES. This means your CPU can (and will automatically) only use the HWY_SSSE3 target, which is somewhat slower than SSE4.
If you want SSE4 and are sure that the software does not use AES (e.g. the AESRound() intrinsic - JPEG XL currently does not), you could consider changing in targets.cc
constexpr uint64_t kGroupSSE4 = Bit(FeatureIndex::kSSE41) | Bit(FeatureIndex::kSSE42) | Bit(FeatureIndex::kCLMUL) | Bit(FeatureIndex::kAES) | kGroupSSSE3;
to
constexpr uint64_t kGroupSSE4 = Bit(FeatureIndex::kSSE41) | Bit(FeatureIndex::kSSE42) | Bit(FeatureIndex::kCLMUL) | kGroupSSSE3;
The worst that can happen is that software using AES will then crash with SIGILL, but I do not see how that could damage the CPU.
Please feel free to reopen if any action is required here :)