From: "Tony Harminc" <[email protected]>
Sent: Tuesday, June 03, 2014 11:42 AM
On 2 June 2014 19:56, Robin Vowels <[email protected]> wrote:
From: "Tony Harminc" <[email protected]>
Sent: Tuesday, June 03, 2014 3:30 AM
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.
XR Rn,Rn is faster than SR.
I doubt it. Perhaps on much older machines, but I have little doubt
that modern machines have special cases for most or all common ways of
zeroing a register, e.g. SR Rn, Rn and XR Rn, Rn and LA Rn,0 and LHI
Rn,0 .
Longer instructions tend to run slower.
And of course these are just the 32-bit versions.
That's all the OP was using.
Yes, of
course there are many more ways of zeroing a register, but I doubt
there's much of a business case for optimizing things like LAY for
this.
But does it matter?
Such an instruction should be executed only once, and once only.
It shouldn't be in the loop.
Well that surely depends on what the loop is doing.
No it doesn't -- even if you are accumulating two 16-bit sums.
You may be interested to know thaty IC doesn't change the upper bytes of a
register.
---
This email is free from viruses and malware because avast! Antivirus protection
is active.
http://www.avast.com