x86/cpu: Add AVX512_FP16 cpu feature
PATCH 1/1 x86/cpu: Add AVX512_FP16 cpu feature
AVX512 Half-precision floating point (FP16) has better performance compared to FP32 if the presicion or magnitude requirements are met. It's defined as CPUID.(EAX=7,ECX=0):EDX[bit 23].
Refer to
https://software.intel.com/content/www/us/en/develop/download/\
intel-architecture-instruction-set-extensions-programming-reference.html
--- target/i386/cpu.c | 2 +- target/i386/cpu.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-)
target/i386/cpu.c +1 -1
@@ -979,7 +979,7 @@ static FeatureWordInfo feature_word_info[FEATURE_WORDS] = {"avx512-vp2intersect" ,NULL ,"md-clear" ,NULL ,NULL ,NULL ,"serialize" ,NULL ,"tsx-ldtrk" ,NULL ,NULL /* pconfig */ ,NULL , -NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,"avx512-fp16" ,NULL ,NULL ,"spec-ctrl" ,"stibp" , NULL, "arch-capabilities", "core-capability", "ssbd", },
target/i386/cpu.h +2 -0
@@ -784,6 +784,8 @@ typedef uint64_t FeatureWordArray[FEATURE_WORDS];#define CPUID_7_0_EDX_SERIALIZE (1U << 14)/* TSX Suspend Load Address Tracking instruction */ #define CPUID_7_0_EDX_TSX_LDTRK (1U << 16) +/* AVX512_FP16 instruction */ +#define CPUID_7_0_EDX_AVX512_FP16 (1U << 23)/* Speculation Control */ #define CPUID_7_0_EDX_SPEC_CTRL (1U << 26)/* Single Thread Indirect Branch Predictors */
Signature · 1 line
2.17.1
On 2020-12-16 at 23:40 CET, Cathy Zhang wrote...
Quoted 2 lines
AVX512 Half-precision floating point (FP16) has better performance compared to FP32 if the presicion or magnitude requirements are met.
spelling: precision
Quoted 30 lines
It's defined as CPUID.(EAX=7,ECX=0):EDX[bit 23].
Refer to
https://software.intel.com/content/www/us/en/develop/download/\
intel-architecture-instruction-set-extensions-programming-reference.htmlSigned-off-by Cathy Zhang <[email protected]>--- target/i386/cpu.c | 2 +- target/i386/cpu.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-)target/i386/cpu.c +1
-1@@ -979,7 +979,7 @@ static FeatureWordInfo feature_word_info[FEATURE_WORDS] = {"avx512-vp2intersect" ,NULL ,"md-clear" ,NULL ,NULL ,NULL ,"serialize" ,NULL ,"tsx-ldtrk" ,NULL ,NULL /* pconfig */ ,NULL , -NULL ,NULL ,NULL ,NULL , +NULL ,NULL ,NULL ,"avx512-fp16" ,NULL ,NULL ,"spec-ctrl" ,"stibp" , NULL, "arch-capabilities", "core-capability", "ssbd", },target/i386/cpu.h +0
-0
target/i386/cpu.h typedef uint64_t FeatureWordArray[FEATURE_WORDS]; · line 791
Quoted 8 lines
target/i386/cpu.h +2
-0@@ -784,6 +784,8 @@ typedef uint64_t FeatureWordArray[FEATURE_WORDS];#define CPUID_7_0_EDX_SERIALIZE (1U << 14)/* TSX Suspend Load Address Tracking instruction */ #define CPUID_7_0_EDX_TSX_LDTRK (1U << 16) +/* AVX512_FP16 instruction */ +#define CPUID_7_0_EDX_AVX512_FP16 (1U << 23)/* Speculation Control */ #define CPUID_7_0_EDX_SPEC_CTRL (1U << 26)/* Single Thread Indirect Branch Predictors */
--
Cheers,
Christophe de Dinechin (IRC c3d)
Eduardo Habkost
AppliedQuoted 9 lines · Cathy Zhang
AVX512 Half-precision floating point (FP16) has better performance compared to FP32 if the presicion or magnitude requirements are met. It's defined as CPUID.(EAX=7,ECX=0):EDX[bit 23].
Refer to
https://software.intel.com/content/www/us/en/develop/download/\
intel-architecture-instruction-set-extensions-programming-reference.htmlSigned-off-by Cathy Zhang <[email protected]>
Queued, thanks!
Signature · 1 line
Eduardo