shithub: riscv

Download patch

ref: a00b6bdbfa72a1688a866edf5f825720c9874ada
parent: 5cdabc5eb16db432abcf61dc126bfb7f9b2978c1
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Thu Jun 9 19:12:46 EDT 2016

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.