John W. Kennedy wrote:
[snip]
>
> But unless you're writing a critical piece of kernel code, it's not
> likely to matter.
>
Oh, I agree. This is actually an algorithm that I first wrote 20 years
ago, or more, and which I decided to work on mainly for practice to use
some of the newer instructions. It may not ever be used in a production
program, though some ideas may well wind up in production, or I may
alter the two major production usages of the algorithm, though in one of
them register usage is so tight the LM idea probably will not work. In
the sample program, the literals are actually about 512 bytes from the
LM, and could easily be moved to less than 256 bytes, so they will
almost certainly be paged in.
There is actually a fifth option. Reg 2 is the base reg. By using the
LHI instructions, coupled with using the relative branch instructions
that are already there, I do not have to set reg 2, and by changing the
regs from 3 to 5 to 2 to 4, I do not have to save and restore a reg.
This probably won't save anything, though, since if the save area is
double word aligned, which is usually the case in my code, reg 4 is the
first 4 bytes of a double word.


|