summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2016-06-09 23:12:46 +0200
committercinap_lenrek <cinap_lenrek@felloff.net>2016-06-09 23:12:46 +0200
commita00b6bdbfa72a1688a866edf5f825720c9874ada (patch)
tree82b2e1a62cc75c007039fe07663300706947f381 /lib
parent5cdabc5eb16db432abcf61dc126bfb7f9b2978c1 (diff)
downloadplan9front-a00b6bdbfa72a1688a866edf5f825720c9874ada.tar.xz
8c, 6c: native ROL (cyclic shift) instruction support, improve peephole optimizers
introduce rolor() function to subsitute (a << c) | (a >> (bits(a) - c)) with (a <<< c) where <<< is cyclic rotation and c is constant. this almost doubles the speed of chacha encryption of 386 and amd64. the peephole optimizer used to stop when it hit a shift or rol instruction when attempting to eleminate moves by register substitution. but we do not have to as long as the shift count operand is not CX (which cannot be substituted) and CX is not a subject for substitution.
Diffstat (limited to 'lib')
0 files changed, 0 insertions, 0 deletions