3 ms·
While AMD GPU can't do 64x64 multiplies that give 128-bit results, they still can do a 32x32 multiply with a 64-bit result. (MULHI_INT and MULLO_INT instruction
by WheretIB 11y ago
While AMD GPU can't do 64x64 multiplies that give 128-bit results, they still can do a 32x32 multiply with a 64-bit result. (MULHI_INT and MULLO_INT instructions).
And you can do add-with-carry manually on the AMD GPU using two instructions: ADDC_UINT to get the carry flag from an addition followed by ADD_PREV to add it.
- brucedawson 11y agoGood to know. I was not aware of those instructions. It would be interesting to see how well a GPU can do compared to a CPU. Doing 64-bit math gives an automatic four-to-one advantage (it takes four 32x32 multiplies to replicate a single 64x64 multiply) so the GPU would be starting out at a disadvantage, plus GPUs run at lower clock rates and have other disadvantages, but perhaps their many many cores would be enough to overcome this.