From: "Rob van der Heij" <[email protected]>
Sent: Tuesday, June 03, 2014 3:58 AM


On 2 June 2014 19:30, Tony Harminc <[email protected]> wrote:

Is LHI Rn,0 faster than SR Rn,Rn? I'd expect them to be the same, but
SR is half the size, and so lessens the amount of i-cache used.

The effect of the footprint is a challenge to measure, but that would also
vote against unrolling the loop for 16 byte. But apart from that, replacing
the LHI Rx,0 with SR Rx,Rx made it a bit slower (and LA is just the same as
LHI despite what others hinted).

If you wanted it to be fast, you'd use LR to clear the register (from a second
register pre-loaded with zero).
KISS is best.

And I notice that the DR is not that expensive, so maybe avoiding the division
by frequent compare and subtract might not be a clear win either.

Unless for some special cases, DR would take longer than shifting.
Executing compares/shifts/subtracts would generally take a lot longer
than D and DR.

---
This email is free from viruses and malware because avast! Antivirus protection 
is active.
http://www.avast.com

Reply via email to