+1

Dr. Shum's papers are the best if you are serious about this stuff. There
are other factors such as data placement and instruction sequence that are
MUCH more significant than "how long does BCTR take?" Dr. Shum's paper will
let you understand what the heck is going on in a Z CPU under the covers. It
is pretty amazing!

I would not +1 on benchmarking however. The result of a particular benchmark
may say more about the benchmark than about the instructions benchmarked.
"AHI outperforms LA" may be true for a particular benchmark because of how
it is organized; it may not be true for other cases. But yes, +1 on "all of
them perform comparably." Other factors are what matter, not AHI or LA.

Charles


-----Original Message-----
From: IBM Mainframe Assembler List [mailto:[email protected]]
On Behalf Of Mike Hochee
Sent: Wednesday, March 10, 2021 5:00 PM
To: [email protected]
Subject: Re: Add 1, Subtract 1

Hi Michael, 

You may want to check out the IBM Z optimization primers if you're super
serious about this. Here's a link, and I believe there's a z15 version as
well in 2020...
https://community.ibm.com/HigherLogic/System/DownloadDocumentFile.ashx?Docum
entFileKey=d1cdb394-0159-464c-92a3-3f74f8c545c4  

I did a little very rough benchmarking a few years ago on a z13 and found
that all of the instructions you mentioned performed comparably. I suspect
the same is true today. 

HTH, 
Mike  
 
-----Original Message-----
From: IBM Mainframe Assembler List [mailto:[email protected]]
On Behalf Of Schmitt, Michael
Sent: Wednesday, March 10, 2021 6:26 PM
To: [email protected]
Subject: Add 1, Subtract 1

Caution! This message was sent from outside your organization.

I was taught long ago to add 1 to a register using LA r#,1(,r#) and to
subtract 1 using BCTR r#,0.

Is the fastest way now to use AHI r#,1 and AHI r#,-1?

Reply via email to