optimising_20integer_20division
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| optimising_20integer_20division [2018/03/31 13:19] – external edit 127.0.0.1 | optimising_20integer_20division [2024/01/05 00:22] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 32: | Line 32: | ||
| 00B423FA C1 E8 1F shr eax,31 | 00B423FA C1 E8 1F shr eax,31 | ||
| 00B423FD 03 D0 add edx,eax | 00B423FD 03 D0 add edx,eax | ||
| - | \\ In the case of **FN_udiv** the dividend can be any register (except eax) or a memory location. For **FN_sdiv** the dividend can be any register (except eax and edx) or a memory location. The divisor can be any 32-bit value except zero.\\ \\ Here is the code of the macros:\\ | + | \\ In the case of **FN_udiv** the dividend can be any register (except eax) or a memory location. For **FN_sdiv** the dividend can be any register (except eax and edx) or a memory location. The divisor can be any 32-bit value except zero.\\ \\ Here is the code of the macros: |
| + | |||
| + | <code bb4w> | ||
| REM Generate assembler code for fast unsigned division by a constant | REM Generate assembler code for fast unsigned division by a constant | ||
| REM Dividend may be a memory location or a register other than eax | REM Dividend may be a memory location or a register other than eax | ||
| Line 131: | Line 133: | ||
| DEF FNintu(N) = ((N / 2) << 1) - (INT(N / 2) <> N / 2) | DEF FNintu(N) = ((N / 2) << 1) - (INT(N / 2) <> N / 2) | ||
| DEF FNuint(N%) = (N% >>> | DEF FNuint(N%) = (N% >>> | ||
| + | </ | ||
optimising_20integer_20division.1522502371.txt.gz · Last modified: 2024/01/05 00:17 (external edit)