mirror of
https://github.com/BLAKE2/libb2
synced 2024-11-22 20:21:59 +01:00
Fix missing xgetbv on downlevel compilers
This commit is contained in:
parent
0f7c898301
commit
c4283b3469
@ -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)
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user