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