purplesyringa's blog
-
Superoptimizing an FPU emulator
Superoptimization is the process where a compiler automatically finds the optimal sequence for a loop-free sequence of instructions. – Wikipedia Compilers are good at making mechanical transformations that make code faster. Unfortunately, most of them are not as good at non-trivial reasoning, so they can’t invent a completely novel approach to solving your problem. When designing a library for floating-point calculations, I had to implement a function that takes a float f and produces a...
-
Things I wish I knew before starting speedrunning
I started speedrunning Minecraft a while ago. It’s an interesting niche with many tutorials and a helpful community, so all the information you need is freely available. But I used to struggle a lot, because it wasn’t clear to me how to learn to execute this stuff – partially because my hand-eye coordination and reaction time suck, but also because most of the advice on improving mechanics is literally “play more”, and for me personally familiarity doesn’t easily translate into improvements....
-
Who is vfmaddrnd231pd??
vfmaddrnd231pd is a unique instruction from the FMA instruction set. Most instructions in that set have mnemonics like vfmadd231pd, but here rnd means something very specific. The Intel Software Development Manual documents it as: VFMADDRND231PD – Fused Multiply-Add of Packed Double-Precision Floating-Point Values with rounding control […] The immediate byte defines several bit fields that control rounding, DAZ, FTZ, and exception suppression (See Table 5-3).
- Vectorized CLZ and CTZ
- Grieving the loss of details
- Write while learning
- Don't call yourself an artisanal programmer
- The NX bit is not just about security
- accept() and socket inheritance
- DuplicateHandle works on sockets, mostly
- Race-free handle inheritance, maybe
- std::process::Command is a bad citizen on Windows
- Impressions of Teal
- Thoughts on "SIMD in Pure Python"
- log is non-monotonic in PHP and Lua
- Sorted rank coding
- Quadrupling code performance with a "useless" if
- Optimal parse with phminposuw
- Does technical blogging spark joy?
- Suffix BWT vs cyclic shift BWT, and fast computation