SPU LLVM: Add m_use_vnni

- Alderlake and Sapphirerapids will require an update to the llvm fork before they can be detected
This commit is contained in:
Malcolm Jestadt 2021-08-30 13:32:51 -04:00 committed by Ivan
parent d304b52391
commit 43cc62d267
3 changed files with 15 additions and 3 deletions

View file

@ -63,14 +63,24 @@ void cpu_translator::initialize(llvm::LLVMContext& context, llvm::ExecutionEngin
m_use_avx512 = true; m_use_avx512 = true;
} }
// Test VNNI feature (TODO)
if (cpu == "cascadelake" ||
cpu == "cooperlake" ||
cpu == "alderlake")
{
m_use_vnni = true;
}
// Test AVX-512_icelake features (TODO) // Test AVX-512_icelake features (TODO)
if (cpu == "icelake" || if (cpu == "icelake" ||
cpu == "icelake-client" || cpu == "icelake-client" ||
cpu == "icelake-server" || cpu == "icelake-server" ||
cpu == "tigerlake" || cpu == "tigerlake" ||
cpu == "rocketlake") cpu == "rocketlake" ||
cpu == "sapphirerapids")
{ {
m_use_avx512_icl = true; m_use_avx512_icl = true;
m_use_vnni = true;
} }
} }

View file

@ -2451,6 +2451,9 @@ protected:
// Allow skylake-x tier AVX-512 // Allow skylake-x tier AVX-512
bool m_use_avx512 = false; bool m_use_avx512 = false;
// Allow VNNI
bool m_use_vnni = false;
// Allow Icelake tier AVX-512 // Allow Icelake tier AVX-512
bool m_use_avx512_icl = false; bool m_use_avx512_icl = false;

View file

@ -7032,8 +7032,7 @@ public:
void SUMB(spu_opcode_t op) void SUMB(spu_opcode_t op)
{ {
// TODO: Some future CPUS will support VNNI but not avx512 if (m_use_vnni)
if (m_use_avx512_icl)
{ {
const auto [a, b] = get_vrs<u32[4]>(op.ra, op.rb); const auto [a, b] = get_vrs<u32[4]>(op.ra, op.rb);
const auto zeroes = splat<u32[4]>(0); const auto zeroes = splat<u32[4]>(0);