Set Prefer_No_AVX512 flag for hygon platform

Benchmarks indicate evex can be more profitable on Hygon hardware
than AVX512. So add Prefer_No_AVX512 to make it run with evex.

Change-Id: Icc59492f71fde7a783a8bd315714ffd6f7ecaf29
Signed-off-by: Li jing <lijing@hygon.cn>
Signed-off-by: Xie jiamei <xiejiamei@hygon.cn>
This commit is contained in:
Xie jiamei 2025-11-11 10:28:54 +08:00 committed by H.J. Lu
parent e52d9542cd
commit 1707b23382
1 changed files with 7 additions and 0 deletions

View File

@ -1129,6 +1129,13 @@ disable_tsx:
cpu_features->preferred[index_arch_AVX_Fast_Unaligned_Load]
&= ~bit_arch_AVX_Fast_Unaligned_Load;
}
else if (model == 0x7)
{
/* Benchmarks indicate evex can be more profitable on Hygon
hardware than AVX512. */
cpu_features->preferred[index_arch_Prefer_No_AVX512]
|= bit_arch_Prefer_No_AVX512;
}
}
else
{