pushreg BP
setfp
- sub SP, 16
+ stalloc 16
mov IN, [BP + 12]
mov OUT, [BP + 16]
and SP, ~15
// c += d; b ^= c; b <<<= 7
paddd xmm2, xmm3
- pshufd xmm3, xmm3, SHUF(3, 0, 1, 2)
+ pshufd xmm3, xmm3, SHUF(2, 1, 0, 3)
pxor xmm1, xmm2
- pshufd xmm2, xmm2, SHUF(2, 3, 0, 1)
+ pshufd xmm2, xmm2, SHUF(1, 0, 3, 2)
movdqa xmm4, xmm1
pslld xmm1, 7
psrld xmm4, 25
//
// The shuffles have quite high latency, so they've mostly been
// pushed upwards. The remaining one can't be moved, though.
- pshufd xmm1, xmm1, SHUF(1, 2, 3, 0)
+ pshufd xmm1, xmm1, SHUF(0, 3, 2, 1)
// Apply the diagonal quarterround to each of the columns
// simultaneously.
// c += d; b ^= c; b <<<= 7
paddd xmm2, xmm3
- pshufd xmm3, xmm3, SHUF(1, 2, 3, 0)
+ pshufd xmm3, xmm3, SHUF(0, 3, 2, 1)
pxor xmm1, xmm2
- pshufd xmm2, xmm2, SHUF(2, 3, 0, 1)
+ pshufd xmm2, xmm2, SHUF(1, 0, 3, 2)
movdqa xmm4, xmm1
pslld xmm1, 7
psrld xmm4, 25
// Finally, finish off undoing the transpose, and we're done for this
// doubleround. Again, most of this was done above so we don't have
// to wait for the shuffles.
- pshufd xmm1, xmm1, SHUF(3, 0, 1, 2)
+ pshufd xmm1, xmm1, SHUF(2, 1, 0, 3)
// Decrement the loop counter and see if we should go round again.
sub NR, 2