This file contains hidden or 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
#!/bin/bash | |
cflags="-O3 -std=c++14 -ggdb3 -frecord-gcc-switches" | |
ldflags="-grecord-gcc-switches -gcolumn-info" | |
# Cleanup | |
rm -rf obj | |
rm test test.pdb | |
mkdir -p obj |
This file contains hidden or 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 <sys/mman.h> | |
#include <stdio.h> | |
int main(void) | |
{ | |
int *map = mmap( | |
0, | |
4096, | |
PROT_READ|PROT_WRITE|PROT_EXEC, | |
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, |
This file contains hidden or 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
#!/bin/bash | |
export PATH=$PATH:$HOME/x86_64-linux-musl/bin | |
export CC=x86_64-linux-musl-gcc | |
export CXX=x86_64-linux-musl-g++ | |
# If needed | |
export CC="$CC -static --static" | |
export CXX="$CXX -static --static" |
This file contains hidden or 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
#ifdef BENCHMARK_HAS_CXX11 | |
#undef BENCHMARK_HAS_CXX11 | |
#endif | |
#include <benchmark/benchmark.h> | |
#include <windows.h> | |
static constexpr size_t MemorySize = 0x10'000 * 4800; /* 300 MiB */ | |
/* #define MEMSET \ */ | |
/* do { \ */ |
This file contains hidden or 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 <stdatomic.h> | |
#include <stdint.h> | |
#include <x86intrin.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <linux/futex.h> | |
#include <sys/time.h> | |
#include <pthread.h> | |
static uint64_t |
This file contains hidden or 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 <string.h> | |
#include <math.h> | |
#define clamp(d, min, max) ((d) < (min) ? (min) : ((d) > (max) ? (max) : (d))) | |
float | |
sRGB_encode(float v) | |
{ |
This file contains hidden or 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
#!/bin/bash | |
export PATH=$PATH:$HOME/x86_64-linux-musl/bin | |
export CC=x86_64-linux-musl-gcc | |
export CXX=x86_64-linux-musl-g++ | |
# If needed | |
export CC="$CC -static --static" | |
export CXX="$CXX -static --static" |
This file contains hidden or 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
#!/bin/bash | |
export PATH=$PATH:$HOME/x86_64-linux-musl/bin | |
export CC=x86_64-linux-musl-gcc | |
export CXX=x86_64-linux-musl-g++ | |
# If needed | |
export CC="$CC -static --static" | |
export CXX="$CXX -static --static" |
This file contains hidden or 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
@echo off | |
setlocal enableextensions disabledelayedexpansion | |
(for %%a in (%*) do if exist "%%~a" ( | |
pushd "%%~dpa" && ( copy /b "%%~nxa"+,, & popd ) | |
) else ( | |
type nul > "%%~fa" | |
)) >nul 2>&1 |
This file contains hidden or 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> | |
// #define CLANG_OR_GCC | |
// Compile with -O3 -std=c++11 for Clang version | |
#define VS | |
// Compile with -O3 -fms-compatibility -std=c++11 for VS version | |
#if defined(CLANG_OR_GCC) | |
typedef float float2 __attribute__((ext_vector_type(2))); |