提供支持AVX2支持F16C的所有处理器?

问题描述 投票:0回答:1

如果您正在进行运行时CPU调度,则应检查F16C功能位,如果使用它。
x86 x86-64 simd avx2 half-precision-float
1个回答
0
投票
-march=x86-64-v3

的一部分,这是一个常见的

Haswell-level-level-level基线

。 您可以在模拟器或VM中遇到此功能组合,该功能掩盖了一些CPUID位。 这是可能的,但不太可能,如果对特征位做出假设,则这种虚拟机可能无法正确运行所有软件。 或者,某些未来的CPU可能会在其F16C指令中有一个错误,并且微型模块更新会禁用这些错误,但不能禁用AVX2。 (这似乎不是很合理,因为它们只是简单的硬件执行单元,这些单元并不特别或棘手。)

因此,您不应该在有和没有F16C的情况下手动对单独的AVX2版本进行矢量矢量化。  If someone disables F16C in their VM, it would be very reasonable for your program to just fall back to your SSE2 or SSE4 version, or whatever version you have that's not AVX2.
Of if you don't do runtime CPU detection and are wondering whether to build with -march=x86-64-v3 and use half-precision floats to save memory bandwidth in a program that uses AVX2, yeah go for it.  Via的第一个AVX2 CPU缺乏FMA,但它仅在嵌入式系统中发现,并且此时非常旧。
    

最新问题
© www.soinside.com 2019 - 2025. All rights reserved.