Skip to content

Commit

Permalink
x86inc: Add support for GFNI instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
Gramner authored and MasterNobody committed Mar 6, 2019
1 parent d3fa8b9 commit 3e5aed9
Showing 1 changed file with 17 additions and 13 deletions.
30 changes: 17 additions & 13 deletions common/x86/x86inc.asm
Original file line number Diff line number Diff line change
Expand Up @@ -835,19 +835,20 @@ BRANCH_INSTR jz, je, jnz, jne, jl, jle, jnl, jnle, jg, jge, jng, jnge, ja, jae,
%assign cpuflags_sse4 (1<<10)| cpuflags_ssse3
%assign cpuflags_sse42 (1<<11)| cpuflags_sse4
%assign cpuflags_aesni (1<<12)| cpuflags_sse42
%assign cpuflags_avx (1<<13)| cpuflags_sse42
%assign cpuflags_xop (1<<14)| cpuflags_avx
%assign cpuflags_fma4 (1<<15)| cpuflags_avx
%assign cpuflags_fma3 (1<<16)| cpuflags_avx
%assign cpuflags_bmi1 (1<<17)| cpuflags_avx|cpuflags_lzcnt
%assign cpuflags_bmi2 (1<<18)| cpuflags_bmi1
%assign cpuflags_avx2 (1<<19)| cpuflags_fma3|cpuflags_bmi2
%assign cpuflags_avx512 (1<<20)| cpuflags_avx2 ; F, CD, BW, DQ, VL

%assign cpuflags_cache32 (1<<21)
%assign cpuflags_cache64 (1<<22)
%assign cpuflags_aligned (1<<23) ; not a cpu feature, but a function variant
%assign cpuflags_atom (1<<24)
%assign cpuflags_gfni (1<<13)| cpuflags_sse42
%assign cpuflags_avx (1<<14)| cpuflags_sse42
%assign cpuflags_xop (1<<15)| cpuflags_avx
%assign cpuflags_fma4 (1<<16)| cpuflags_avx
%assign cpuflags_fma3 (1<<17)| cpuflags_avx
%assign cpuflags_bmi1 (1<<18)| cpuflags_avx|cpuflags_lzcnt
%assign cpuflags_bmi2 (1<<19)| cpuflags_bmi1
%assign cpuflags_avx2 (1<<20)| cpuflags_fma3|cpuflags_bmi2
%assign cpuflags_avx512 (1<<21)| cpuflags_avx2 ; F, CD, BW, DQ, VL

%assign cpuflags_cache32 (1<<22)
%assign cpuflags_cache64 (1<<23)
%assign cpuflags_aligned (1<<24) ; not a cpu feature, but a function variant
%assign cpuflags_atom (1<<25)

; Returns a boolean value expressing whether or not the specified cpuflag is enabled.
%define cpuflag(x) (((((cpuflags & (cpuflags_ %+ x)) ^ (cpuflags_ %+ x)) - 1) >> 31) & 1)
Expand Down Expand Up @@ -1441,6 +1442,9 @@ AVX_INSTR divss, sse, 1, 0, 0
AVX_INSTR dppd, sse4, 1, 1, 0
AVX_INSTR dpps, sse4, 1, 1, 0
AVX_INSTR extractps, sse4, 1
AVX_INSTR gf2p8affineinvqb, gfni, 0, 1, 0
AVX_INSTR gf2p8affineqb, gfni, 0, 1, 0
AVX_INSTR gf2p8mulb, gfni, 0, 0, 0
AVX_INSTR haddpd, sse3, 1, 0, 0
AVX_INSTR haddps, sse3, 1, 0, 0
AVX_INSTR hsubpd, sse3, 1, 0, 0
Expand Down

0 comments on commit 3e5aed9

Please sign in to comment.