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
// coroutines for C adapted from Simon Tatham's coroutines | |
// https://www.chiark.greenend.org.uk/~sgtatham/coroutines.html | |
// | |
// this implementation utilizes __VA_ARGS__ and __COUNTER__ | |
// to avoid a begin/end pair of macros. | |
#include <stdlib.h> | |
#include <stdio.h> | |
#include <stdbool.h> | |
// modify this if you don't like the `self->name` format |
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
// x64 encoding | |
enum Reg { | |
RAX, RCX, RDX, RBX, RSP, RBP, RSI, RDI, | |
R8, R9, R10, R11, R12, R13, R14, R15, | |
}; | |
enum XmmReg { | |
XMM0, XMM1, XMM2, XMM3, XMM4, XMM5, XMM6, XMM7, | |
XMM8, XMM9, XMM10, XMM11, XMM12, XMM13, XMM14, XMM15, |
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
#if _WIN32 | |
// measure the time in seconds to run f(). doubles will retain nanosecond precision. | |
template<typename F> | |
double timeit(F f) { | |
LARGE_INTEGER freq; | |
QueryPerformanceFrequency(&freq); | |
LARGE_INTEGER start; | |
QueryPerformanceCounter(&start); | |
f(); | |
LARGE_INTEGER end; |
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
http://courses.cms.caltech.edu/cs179/ | |
http://www.amd.com/Documents/GCN_Architecture_whitepaper.pdf | |
https://community.arm.com/graphics/b/blog | |
http://cdn.imgtec.com/sdk-documentation/PowerVR+Hardware.Architecture+Overview+for+Developers.pdf | |
http://cdn.imgtec.com/sdk-documentation/PowerVR+Series5.Architecture+Guide+for+Developers.pdf | |
https://www.imgtec.com/blog/a-look-at-the-powervr-graphics-architecture-tile-based-rendering/ | |
https://www.imgtec.com/blog/the-dr-in-tbdr-deferred-rendering-in-rogue/ | |
http://developer.amd.com/tools-and-sdks/opencl-zone/amd-accelerated-parallel-processing-app-sdk/opencl-optimization-guide/#50401334_pgfId-412605 | |
https://fgiesen.wordpress.com/2011/07/09/a-trip-through-the-graphics-pipeline-2011-index/ | |
https://community.arm.com/graphics/b/documents/posts/moving-mobile-graphics#siggraph2015 |
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
Vex is a minimalistic markup language with the motto "form without meaning". | |
This is going to @italic=really hurt. | |
// @author: Per Vognsen | |
// @version: 1.3 | |
The weather forecast for @date is @weather. | |
@list{ |
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
// first attempt - poor search for the final const | |
x = (9303801 * x) & 0xFFFFFF; | |
y = (5176057 * y) & 0xFFFFFF; | |
x ^= y; | |
x = (5056925 * x) & 0xFFFFFF; | |
return x; | |
------------- | |
Mathematica: |