Closed catageek closed 9 years ago
I'm seeing that on x86 the division instruction accepts the same input wide as the output wide of multiplication. In other words, on 32 bit x86 :
I see ok the new two instructions (signed version), even we could remove/replace the old division for this way, and make it symmetrical.
WDIV (Wide DIVision) and SWDIV (Signed Wide DIVision) ???
You can do 64-bit multiplication with 32-bit multiplication, and 64-bit division with 32-bit division, if I'm not mistaken.
Funny... I take a look of how does this ARM :
Look : http://www.phatcode.net/res/260/files/html/AdvancedArithmetica2.html
Seeing that, I think that isn't necessary a wide division. Also, think that 64 bit output would be rarely used on the multiplication. Is there because a 32 bit multiplication would generate 64 bit wide output very easy.
64 bit multiplication already exists, but we can't divide the result obtained.
The proposal is to define a division instruction that takes 3 registers in input and performs: Rd = Rd:Rs / Rn Y = Rd:Rs % Rn
Where Rd:Rs is the 64 bit value, using Rd for the upper 32 bits and Rs for the lower 32 bits.