Skip to content

Commit

Permalink
Merge branch 'm4' of https://github.com/noloader/libb2 into m4
Browse files Browse the repository at this point in the history
  • Loading branch information
noloader committed Jul 1, 2020
2 parents 296f2fb + 7ccac60 commit 5c3967f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/blake2-dispatch.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,13 @@ static inline void cpuid( uint32_t *eax, uint32_t *ebx, uint32_t *ecx, uint32_t
#endif
}

/* xgetbv insn is GCC 4.5 and above. The byte codes sidestep the limitation */
/* Also see http://www.agner.org/optimize/vectorclass/read.php?i=65 */
static inline uint64_t xgetbv(uint32_t xcr)
{
uint32_t a, d;
__asm__ __volatile__(
"xgetbv"
".byte 0x0f, 0x01, 0xd0"
: "=a"(a),"=d"(d)
: "c"(xcr)
);
Expand Down

0 comments on commit 5c3967f

Please sign in to comment.