Skip to content

Conversation

@tompng
Copy link
Member

@tompng tompng commented Jul 17, 2025

Remove optimization path for c->frac[i] == 1 AND first two DECDIGs of divisor and remainder is the same condition.
I think it's worth erasing from the view of maintaining because the condition to enter this optimization path is too strict. (0.02% of the division executed in test).

Remove unused carry logic in VpDivd
It is never needed in test. Never needed in 100million random division experiment(with BASE_FIG=2 to cover many corner cases)
Carry only needs when c->frac[i] is wrongly calculated to 0, but it never happens because VpDivd strictly compares b->frac[i=0...b_prec] with r->frac[ind_c+i]

tompng added 2 commits July 17, 2025 22:20
It only speeds up about 3% in the best case.
About 99.98% case running the test, it won't enter to this optimization path.
@tompng tompng merged commit 073edce into ruby:master Jul 17, 2025
79 checks passed
@tompng tompng deleted the vpdivd_remove_low_freq_opt branch July 17, 2025 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant