Find coefficients for Algorithm 4.2: Optimized code generation of unsigned q=n/d for constant nonzero d Input: N 32 or 64 (width of divide) d divisor (not a power of 2) Output: *pshpre pre-shift *pm factor *pshpost post-shift
true Use algorithm: t1 = MULUH(m, n) q = SRL(t1 + SRL(n - t1, 1), shpost - 1)
false Use algorithm: q = SRL(MULUH(m, SRL(n, shpre)), shpost)
See Implementation
Find coefficients for Algorithm 4.2: Optimized code generation of unsigned q=n/d for constant nonzero d Input: N 32 or 64 (width of divide) d divisor (not a power of 2) Output: *pshpre pre-shift *pm factor *pshpost post-shift