Skip to content

Instantly share code, notes, and snippets.

instruction test sequences "scraped" from https://github.com/dougallj/applecpu / https://dougallj.github.io/applecpu/firestorm.html
A53 A520 A720 X4
1.00 1.00 0.50 0.50 STR_reg_uxtw_64.html Test 2: throughput
3.00 4.00 2.00 2.00 SQSUB_v_4S.html Test 2: Latency 1->2
3.00 4.00 2.00 2.00 SQSUB_v_4S.html Test 3: Latency 1->3
1.00 0.50 0.50 0.25 SQSUB_v_4S.html Test 4: throughput
3.00 8.01 6.00 7.00 FCVTZS_s_fp_D_to_W.html Test 2: Latency 1->2 roundtrip
1.00 1.00 1.00 1.00 FCVTZS_s_fp_D_to_W.html Test 3: throughput
1.00 3.00 2.00 2.00 SLI_s_D.html Test 2: Latency 1->1
@dzaima
dzaima / I.csv
Created June 3, 2025 16:05
RISC-V multiplication
Multiplier Instructions Size Code
0 1 2 c.sub t0, a0, a0
1 1 2 c.slli t0, a0, 0
2 1 2 c.slli t0, a0, 1
3 2 6 slli t0, a0, 1; c.add t1, t0, a0
4 1 2 c.slli t0, a0, 2
5 2 6 slli t0, a0, 2; c.add t1, t0, a0
6 3 8 c.add t0, a0, a0; slli t1, t0, 2; c.sub t2, t1, t0
7 2 6 slli t0, a0, 3; c.sub t1, t0, a0
8 1 2 c.slli t0, a0, 3
// WIDTH: number of bytes to load/store in one instruction for bandwidth tests
// default: 32
// WIDTH∊1 2 4 8: regular integer loads
// x86-64 WIDTH==16 - SSE; WIDTH==32 - AVX2, WIDTH==64 - AVX-512
// aarch64: WIDTH==16 - NEON loads; WIDTH==32 uses an ldp
// UNALIGNED: number of bytes to misalign tested pointers by
// CLOCK_RATE: number of clock cycles in a second on the target processor
// TEST_LAT: test latency instead of bandwidth; latency tests aligned 8-byte loads
#ifndef CLOCK_RATE
// ==UserScript==
// @name TIO fancy search & enter
// @namespace http://tampermonkey.net/
// @version 0.1
// @description sort languages fancily
// @author dzaima
// @match https://tio.run/
// @grant none
// ==/UserScript==
const DEBUG = false;
//raw directions
const UL = 0; const U = 1; const UR = 2;
const L = 3; const C = 4; const R = 5;
const DL = 6; const D = 7; const DR = 8;
//directions from the reference point
const ul = 16; const u = 17; const ur = 18;
const l = 19; const c = 20; const r = 21;
const dl = 22; const d = 23; const dr = 24;
default shift #
alt ctrl #
# #
MAP
## ## ## ## ## ## ## ## ## ## ## ## ## .. .. ..
## ## ## ## ## ## ## ## ## ## ## ## ## .. .. ..
□’ ¹№ ²# ³# ⁴# ⁵# ⁶# ⁷# ⁸∙ ⁹⁽ ⁰⁾ ┌╔ ≠┼ ┘┐ ## .. ## .. .. ÷# ## κ#
## ## ## ## ## ## ## ## ## ## #∆ ## #╗ ╝# ## .. ## .. .. ## ## ##
const STRING = 0,
FUNCTION = 1;
function tokenize (prog) {
var tokens = [];
while (prog != "") {
let token;
prog = prog.replace(/^("(\\.|[^"])*"|[^"][^ ]*)( |$)/, (all, f)=>(token = f,""));
let type = FUNCTION;
if (token[0] == "\"") {
type = STRING;
67 //base recipes
+5*4 //5 recipes (armor+material block) have 5 versions so 5*4 because 1 of them have been counted
+5*4 //tools, same as above
+3 //pressure plate
= 110
1st RLE
10,1,1,1,1,1,1,3,1,1,2,1,1,1,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,1,1,3,1,1,3,1,1,2,1,1,1,2,1,1,5,1,1,1,3,1,1,5,1,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,1,1,2,1,1,1,1,1,1,1,1,1,3,1,1,1,1,1,1,2,1,1,2,1,1,1,1,1,1,1,1,1,1,5,1,1,1,1,1,1,6,1,1,1,1,1,1,1,1,1,1,1,3,1,1,4,1,1,1,1,1,3,1,1,1,1,1,1,1,1,1,1,1,1,1,4,1,1,6,1,1,2,1,1,1,1,1,1,1,1,1,1,5,1,1,1,1,1,1,1,1,1,1,2,1,1,1,1,1,2,1,1,1,1,1,4,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,4,1,1,1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/\\\//\\///\/\ ///\\\///\\\ /\/\\\//\\///\/\///\\\///\\\/\/\\\//\\///\/\ ///\\\///\\\ /\/\\\//\\///\/\///\\\///\\\/\/\\\//\\///\/\
\/\/ \/\/ \/\/\\\///\\\///\/\/ \/\/ \/\/////\\\\////\\\\\/\/ \/\/ \/\/\\\///\\\///\/\/ \/\/ \/\/ ////\\\\////\\\\ \/\/ \/\/ \/\/\\\///\\\///\/\/ \/\/ \/\/////\\\\////\\\\\/\/ \/\/ \/\/\\\///\\\///\/\/ \/\/ \/\/
/\/\ /\/\ /\/\ \\//\\// /\/\ /\/\ /\/\\\\\////\\\\/////\/\ /\/\ /\/\ \\//