Repository navigation
Docs: the DSP div step leaves half the quotient for a 48-bit dividend - #1938
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner
|
Thanks for pulling this into the effects guide. Could you scope the shortcut to the positive operands used by Ghost Cut and say that doubling the dividend still has to leave the fractional quotient in range? The DSP56300 manual’s DIV entry requires a nonzero divisor and a dividend whose fractional magnitude is smaller than the divisor’s. Without that qualifier, the line reads as a recipe for any 48-bit input. DSP56300 Family Manual, DIV |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
divstep is a fractional divide. With a 48-bit dividend's high word in a1 and low word in a0, carry cleared (andi #$fe,ccr) and 24div x0,asteps, a0 holds floor((dividend / 2) / divisor), not floor(dividend / divisor). Nothing in the guides says so. While building Ghost Cut (Ghost Cut 0.1.0-experimental (draft): a tempo-synced microlooper on FX2 #1935) its tempo-synced loop lengths silently came out half as long until the table held 2N (see the TABLE comment insdk/drafts/ghost-cut/ghost_cut_ref.pyon that branch).docs/module-guides/effects.md: the half quotient, and the two ways to get N / D (shift the dividend left once withasl a, or store 2N).sdk/octabam/AGENTS.mdis untouched. Changelog:changelog/2026-11-21-dsp-div-half-quotient.md.dsp_hoston Ghost Cut's loop length and matches the fractional arithmetic (a 47-bit fraction over a 23-bit fraction leaves a 23-bit quotient, one bit short of the integer one). Could a check catch it instead? No: storing N or 2N is a semantic choice, so no source gate can tell which quotient a module meant. What caught it is the module's own reference model compared sample for sample withdsp_host, which the line points to.npm run pr:readyis Ready.docs/module-guides/effects.md.🤖 Generated with Claude Code