mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-14 15:09:09 +00:00
Make improvements
This commit is contained in:
parent
3e4fd4b0ad
commit
e44a0cf6f8
256 changed files with 23100 additions and 2294 deletions
|
@ -1,16 +1,21 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_INTRIN_PDEP_H_
|
||||
#define COSMOPOLITAN_LIBC_INTRIN_PDEP_H_
|
||||
#include "libc/nexgen32e/x86feature.h"
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
/* TODO(jart): Implement polyfill. */
|
||||
#define pdep(NUMBER, BITMASK) \
|
||||
uint64_t pdep(uint64_t, uint64_t) pureconst;
|
||||
|
||||
#define PDEP(NUMBER, BITMASK) \
|
||||
({ \
|
||||
typeof(BITMASK) ShuffledBits, Number = (NUMBER); \
|
||||
asm("pdep\t%2,%1,%0" : "=r"(ShuffledBits) : "r"(Number), "rm"(BITMASK)); \
|
||||
ShuffledBits; \
|
||||
})
|
||||
|
||||
#define pdep(NUMBER, BITMASK) \
|
||||
(!X86_HAVE(BMI2) ? pdep(NUMBER, BITMASK) : PDEP(NUMBER, BITMASK))
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_LIBC_INTRIN_PDEP_H_ */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue