On Fri, 10 Nov 2023 at 08:27, Seymour J Metz <[email protected]> wrote:
> I know that it's model dependent and also depends on the cache loading,
> but are there cases where there is a measurable performance difference
> between these?
>
> LAY Rx,4096
> LHI Rx,4096
>
It seems highly implausible to me that there'd be any difference. Surely
the LAY case of base and index register = 0 are special cased, and there
need be no waiting for the actual value of R0 to settle.
A case I find a bit more interesting is setting up the typical second base
register.
LAY Rx,4096(,Ry)
vs
LR Rx,Ry
AHI Rx,4096
or the pre-LAY sequence
LA Rx,4095(,Ry)
LA Rx,1(,Rx)
(or occasionally 2048 in both - symmetry?) both of which are surely slower
than either of the single-instruction approaches.
Stylistically in any case I prefer the LAY over LHI/AHI, because it somehow
emphasizes to me the notion of incrementing one register by 4096 over the
other. In your original case, and assuming there's no performance
difference, I'd choose based on what Rx is going to used for. If it's going
to be part of stepping through addresses (setting up for a BXLE or the
like), then I'd use LAY. Otherwise LHI.
Tony H.
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN