On Fri, 20 Aug 2010 08:26:28 -0500, McKown, John wrote:
>THEPROG CSECT
>         STM    14,12,12(13)
>         LR     12,15
>         USING  THEPROG,12,11,10
>         LAY    11,4096(,12)
>         LAY    10,4096(,11)

I realize that the STM implies that the program is not in 64-bit mode, but a
better sequence would be:
         LA    12,0(,15)
         LAY   11,4096(,15)
         LAY   10,4096*2(,15)

LA is better than LR because it works in any addressing mode and clears the
non-address bits. Also if R12 is used immediately as a base register, LA
provides the result to the pipeline faster than LR.  And basing the LAY
instructions off of R15 instead of R12 eliminates the pipeline stalls caused
by each instruction being dependent on the prior.

David

Reply via email to