This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static uint64_t | |
b24_expand (uint16_t seq) | |
{ | |
#define seq_prep(x) 0, (uint32_t)((x) << 12U | \ | |
(x) >> 4U) << 16U | (x) | |
__m128i k = _mm_shuffle_epi8( | |
_mm_set_epi64x(seq_prep(seq)), | |
_mm_set_epi64x(UINT64_C(0x0303030301010101), \ | |
UINT64_C(0x0202020200000000))); | |
#undef seq_prep |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <errno.h> | |
#include <inttypes.h> | |
#include <limits.h> | |
#include <stdint.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#ifdef __aarch64__ | |
#include <arm_neon.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** @file popcnt.h | |
*/ | |
#ifndef POPCNT_H_ | |
#define POPCNT_H_ | |
#include <limits.h> | |
#include <stdint.h> | |
#undef define_popcnt | |
#undef popcnt16_impl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <math.h> | |
int main(void) | |
{ | |
typeof(sizeof M_E) | |
t=pow ( M_E, | |
((typeof(sizeof M_E))01 << ' ') | |
/(typeof( M_E))0xf0f04ef) | |
/ M_PI; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#define MAX_FIZZBUZZ_LENGTH 8 | |
#define MAX_NUMBER_LENGTH 10 | |
typedef struct { | |
int (*evaluate)(int); | |
char *(*transform)(void); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @file b24.c | |
* | |
* Compiling with MSVC 19.41 or later: | |
* | |
* cl.exe /TC /std:clatest /O2 /Oi /GL /GF /Zo- /favor:AMD64 /arch:AVX2 b24.c /Fe: b24.exe /MD | |
*/ | |
#include <errno.h> | |
#include <inttypes.h> | |
#include <stdbool.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.PHONY: default gnu23 gnu23.mk | |
default:| gnu23; $(info $(CC) -std=$(gnu23)) | |
gnu23:| gnu23.mk; $(eval include gnu23.mk) | |
gnu23.mk: gnu23.h; @$(CC) -E -xc -P $< >$@ | |
gnu23.h: $(lastword $(MAKEFILE_LIST)); $(call cstd,$@) @: | |
override cstd =$(file >$1,$(.cstd)) | |
override .cstd =$(call \ | |
P,#ifdef __clang_major__) $(call \ | |
L,#if __clang_major__ > 17) $(call \ | |
L,override gnu23 := gnu23) $(call \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
{ base64 -d | tar xJf - && make >/dev/null && ./stringy_prime "$@"; } << EOF | |
/Td6WFoAAATm1rRGAgAhAQwAAACPmEGc4Hf/E3hdACaYSWZp2dmN5MBFtReU64IZsyM5tnRakSFu | |
UPbdIR/QuF5EFRUUhH/5HwelTiMRTMQTMB8haLGg9CMnIdukTtlgXKTJM/Kd0AxEruxtr46KoLCE | |
5wH2u0auKErz8PuO5Sohr/jU5hsMknDSkidKBpsGJPDBc0JRlAJaJ1w2Yvn75B8bpsgQvr+vPFR4 | |
98UB7klgs9DC4xH4PakHpWzf7Oj8YqPgZDnqj+mqcWPQ6dhdjsbkbQw+SUZRRN5EpBKyVa2q4QJs | |
4o9u+lIkKVTDrFwnLqgMoHogm/VKoolkGLBFD1gyNxNdxMU6M1PX8Ja6m/JVu/xhQFMAuKWAe1p7 | |
79K1RWjGJLTnJCXLHvxxn33La80M6RAPZf0hPo93iTz8Lhu5NsP0bfe1QgX3WqXB70f5TMt8nZSN | |
UYmb+8HtRCjMv/xBowOuxcYHY2oeUuHb2+lavETFfeqc/7wuFwMBUwhrkCf++AC0k6oBgbcte5X4 | |
Th79/TqLq+NYm/7sEobxti/sqRvtI6onS3CyiJeBdFUDEBJ22zkZ/B65PagiVkkgCnbXeal21NWb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <limits.h> | |
#include <stddef.h> | |
#include <stdint.h> | |
#define popcnt(x) (size_t)({\ | |
typeof (_Generic(x, \ | |
int32_t: (uint32_t)1, \ | |
int64_t: (uint64_t)1, \ | |
uint32_t: (uint32_t)1, \ | |
uint64_t: (uint64_t)1))y=x; \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Compile with "gcc -std=c23 -mbmi2 -mlzcnt" (gcc-14) | |
* or "gcc -std=c2x -mbmi2 -mlzcnt" (gcc-13) | |
*/ | |
#include <errno.h> | |
#include <stdint.h> | |
#include <stdio.h> | |
#include <immintrin.h> | |
static void | |
bitpr (uint64_t n) |
NewerOlder