From 0d16c5f4b98508bb5629bf280e356318c5253535 Mon Sep 17 00:00:00 2001 From: Matiq Date: Sun, 16 Aug 2026 23:10:12 +0300 Subject: [PATCH] docs: giant FFT plan generator analysis (notes_giant_fft.md) --- notes_giant_fft.md | 52 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 notes_giant_fft.md diff --git a/notes_giant_fft.md b/notes_giant_fft.md new file mode 100644 index 0000000..a0d3407 --- /dev/null +++ b/notes_giant_fft.md @@ -0,0 +1,52 @@ +# FUN_18002f980 (giant) — recursive FFT plan/permuation generator + +Signature: `ulonglong *FUN_18002f980(plan*, log2, src, flags, depth, uVar2, scratch)` + +Role: builds the FFT stage plan (bit-reverse ordering + sign-flip masks), +NOT a numeric executor (no FP math inside; all integer indexing). + +## Factor split (top) +``` +iVar2 = DAT_181c5e0fc[log2] // per-log2 factor (4/8/9/13... from static table) +iVar19 = log2 - iVar2 // reduced log2 for subproblem +if iVar19 < 0x12: pu = FUN_18002e360(iVar19, scr) // small-plan path (radix2/3 generator) +else: pu = FUN_18002f980(plan, iVar19, scr, ..., depth+1) // recurse +*(plan + 0x78 + depth*8) = pu // store sub-plan ptr per depth +*(plan + 0x38) = param_6 // (entry stores callback/context) +*(plan + 0x1c) = (1< radix-8 permute block + local_900[k]=src[±idx*8] (and ^= DAT_181c5e1e0 for negative/reflected) + processed 16 qwords = 8 complex pairs; groups x butterflies + next stage: uVar26 <<= 2; iVar16 -= 2 // radix-4 sweep + else branch radix-3: uVar26 <<= 3; iVar16 -= 3 + ... + } +while (iVar12 < log2) +outer while (uVar24 < (iVar25-1+iVar33)/iVar33) +``` + +## Key masive consts +- DAT_181c5e1e0 = sign-flip XOR mask (bit for im part) applied to mirrored indices. +- DAT_181c5e0fc / 181c5e15c / 181c5e3fc = per-log2 factor tables (read as int, index log2). +- Base small planner FUN_18002e360: iVar6=1<10 -> 2 else 3; loops similarly, returns param_4 (plan tail). +- Return: puVar10 + (1<