Skip to content

Instantly share code, notes, and snippets.

View bitRAKE's full-sized avatar
🏠
Working from home.

Rickey Bowers Jr. bitRAKE

🏠
Working from home.
View GitHub Profile
@bitRAKE
bitRAKE / Euler.five.asm
Last active April 13, 2025 17:20
Euler's sum of powers conjecture, k=5
; couldn't help myself after watching the video:
; https://www.youtube.com/watch?v=YMpdGLvqlrM
; (there is a better way, tomorrow perhaps)
; Euler's sum of powers conjecture.
; https://en.wikipedia.org/wiki/Euler%27s_sum_of_powers_conjecture
;
; It is unknown whether the conjecture fails or holds for any value k ≥ 6.
;
; Euler's conjecture was disproven by L. J. Lander and T. R. Parkin in 1966 when,
@bitRAKE
bitRAKE / bitmap_decode_ctz.asm
Last active April 13, 2025 17:19
convert bitmask buffer to array indices
; references:
; https://branchfree.org/2018/05/22/bits-to-indexes-in-bmi2-and-avx-512/
; https://lemire.me/blog/2018/03/08/iterating-over-set-bits-quickly-simd-edition/
; http://0x80.pl/notesen/2019-01-05-avx512vbmi-remove-spaces.html
align 64
; RCX : number of quadword to convert
; RSI : source bit array
; RDI : destination index array
bitmap_decode_ctz:
jrcxz .all_zero
@bitRAKE
bitRAKE / array_nearsmallest.asm
Last active April 13, 2025 17:21
All nearest smaller values, Barbay, Fischer & Navarro (2012)
; All nearest smaller values, Barbay, Fischer & Navarro (2012)
; https://arxiv.org/abs/1009.5863
; We assume an artificial overall minimum at [rsi]
; EAX: [0,N)
mov eax,1
@0: lea edx,[rax-1]
add eax,1
jmp @1
@2: mov edx,[rdi+rdx*4]
@1: mov ecx,[rsi+rax*4-4]
@odzhan
odzhan / kitty.c
Created December 7, 2019 08:56
KITTY Compression Algorithm
//
// KITTY compression algorithm, by snowcat
// converted to C, by odzhan
// 2019-12-07
//
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <time.h>
@plus7
plus7 / Rationale.md
Created October 15, 2011 03:52 — forked from leegao/Rationale.md
JIT for dummies: JIT compiling RPN in python

If you don't care about the explanation, scroll down to find the code, it's 50 some odd lines and written by someone who doesn't know any better. You have been warned.

What it does

This is a very simple proof of concept jitting RPN calculator implemented in python. Basically, it takes the source code, tokenizes it via whitespace, and asks itself one simple question: am I looking at a number or not?

First, let's talk about the underlying program flow. Pretend that you are a shoe connoisseur with a tiny desk. You may only have two individual shoes on that desk at any one time, but should you ever purchase a new one or get harassed by an unruly shoe salesman without realizing that you have the power to say no (or even maybe?), you can always sweep aside one of the two shoes on the desk (the one on the right, because you're a lefty and you feel that the left side is always superior) onto the messy floor, put the other shoe on the right hand side, and then place your newly acquired shoe in