@rygorous@mastodon.gamedev.place
2025-03-03 06:57 UTC
@kenshirriff That explanation doesn't really work. Why is multiplying by 7 "just shift by 3 to get 8x and subtract 1x" considered easy but 3 (which is shift by 1 and add 1x) hard?
Does the Pentium really use straight radix 8? Normally multipliers use modified Booth recoding into signed digits.
The more common modified r4 Booth uses signed digit set (-2, -1, 0, 1, 2). All trivial or shifts.
Modified r8 Booth uses (-4, -3, -2, -1, 0, 1, 2, 3, 4). So pow2s + 3. That seems more likely.
Replies (2)
-
@rygorous@mastodon.gamedev.place 2025-03-03 07:07
@kenshirriff Modified Booth recoding gives you a more convenient digit set to work with, and it's also convenient to support both unsigned and signed multiplies with the same circuit. The FMUL circuit in the Pentium 1 is _the_ multiplier. There is no separate integer multiplier circuit IIRC. Integer muls execute on the FPU. (The x87 with its 80-bit floats with 16b exp + 64b mantissa is sufficiently wide for the 32x32 -> 64 muls on offer.)
-
@amonakov@mastodon.gamedev.place 2025-03-03 07:09
@rygorous @kenshirriff re. first paragraph, I was wondering about that too, and turns out the article explains that better: 8x translates to incrementing the next three-bit group