MD5 speed improvement ideas
#19
(10-17-2010, 04:19 PM)Dalibor Wrote: There is MAD instruction (page 51) which performs multiplication and addition, so you can improve the bit rotation operation.
Unfortunately this won't work as integer MAD is just a virtual instruction. PTX isn't real assembler, so it may looks like you're optimizing some instructions but after real compilation to ISA you won't found anything good. As there even no 32-bit integer multiplication for G80-GT200 hardware MAD will be replaced by several 24-bit multiplications and additions (or even back to SHL+ADD if compiler will notice 2^n value).

And for Fermi usual rotate construction like
#define ROTATE(a,n) (((a)<<(n)) | ((a)>>(32-(n))))
will be automatically transformed into
#define ROTATE(a,n) (((a)<<(n)) + ((a)>>(32-(n))))
thus making "fused" SHL+ADD possible.

Shortly, NVCC compiler is smart enough to make rotates as fast as possible, no need for special actions from programmer.

But idea for MD5's 3rd round optimization was nice, never seen it before, thanks Smile.
Reply


Messages In This Thread
MD5 speed improvement ideas - by Dalibor - 10-09-2010, 08:54 PM
RE: MD5 speed improvement ideas - by D3ad0ne - 10-09-2010, 10:37 PM
RE: MD5 speed improvement ideas - by Dalibor - 10-10-2010, 09:00 AM
RE: MD5 speed improvement ideas - by ksp - 10-10-2010, 09:54 AM
RE: MD5 speed improvement ideas - by atom - 10-10-2010, 10:53 AM
RE: MD5 speed improvement ideas - by Dalibor - 10-10-2010, 10:49 PM
RE: MD5 speed improvement ideas - by atom - 10-11-2010, 12:37 PM
RE: MD5 speed improvement ideas - by Dalibor - 10-11-2010, 10:46 PM
RE: MD5 speed improvement ideas - by atom - 10-13-2010, 10:14 AM
RE: MD5 speed improvement ideas - by Dalibor - 10-14-2010, 03:02 PM
RE: MD5 speed improvement ideas - by atom - 10-15-2010, 01:11 PM
RE: MD5 speed improvement ideas - by atom - 10-15-2010, 03:26 PM
RE: MD5 speed improvement ideas - by Dalibor - 10-16-2010, 12:43 AM
RE: MD5 speed improvement ideas - by D3ad0ne - 10-16-2010, 12:33 AM
RE: MD5 speed improvement ideas - by atom - 10-17-2010, 10:42 AM
RE: MD5 speed improvement ideas - by Dalibor - 10-17-2010, 04:19 PM
RE: MD5 speed improvement ideas - by IvanG - 10-17-2010, 08:12 PM
RE: MD5 speed improvement ideas - by Dalibor - 11-01-2010, 11:15 AM
RE: MD5 speed improvement ideas - by Rolf - 10-17-2010, 04:55 PM
RE: MD5 speed improvement ideas - by D3ad0ne - 10-17-2010, 07:33 PM
RE: MD5 speed improvement ideas - by IvanG - 12-14-2010, 06:55 PM