Fix two bugs:
- Erroneous shift of 2 in a bytes to bits conversion.
- Use reverse subtract rather than negate for value that is subsequently
used as operand #2 in a shift operation.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Liming Gao <liming.gao@intel.com>
bic src1, src1, #3\r
bic src2, src2, #3\r
add limit, limit, tmp1 // Adjust the limit for the extra.\r
- lsl tmp1, tmp1, #2 // Bytes beyond alignment -> bits.\r
+ lsl tmp1, tmp1, #3 // Bytes beyond alignment -> bits.\r
ldr data1, [src1], #4\r
- neg tmp1, tmp1 // Bits to alignment -32.\r
+ rsb tmp1, tmp1, #32 // Bits to alignment -32.\r
ldr data2, [src2], #4\r
mov tmp2, #~0\r
\r