I wonder if it is really a 'problem'. What kind of mormal program does this 
amount of branches back to where it just came from, messing up the entire 
pipeline. Is it efficient to optimize a z13 for this kind of programs? Isn't it 
better to optimize for the millions of other programs who are executed much 
more often than this one?

Kees.

-----Original Message-----
From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On Behalf 
Of David Crayford
Sent: 29 April, 2016 14:41
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: An explanation for branch performance?

We're doing some performance work on our assembler code and one of my 
colleagues ran the following test which was surprising. Unconditional 
branching can add significant overhead. I always believed that 
conditional branches were expensive because the branch predictor needed 
to do more work and unconditional branches were easy to predict. Does 
anybody have an explanation for this. Our machine is z114. It appears 
that it's even worse on a z13.

Here's the code.

I wrote a simple program - it tight loops 1 billion times


          L     R4,=A(1*1000*1000*1000)
          LTR   R4,R4
          J     LOOP
*
LOOP     DS   0D                  .LOOP START
          B     NEXT

NEXT     JCT   R4,LOOP

The loop starts with a branch ... I tested it twice - when the CC is 
matched (branch happens) and when it is not matched (falls through)

1. When the CC is matched and branching happens, CPU TIME=2.94 seconds
2. When the CC is not matched the code falls through, CPU TIME=1.69 
seconds - a reduction of 42%

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
********************************************************
For information, services and offers, please visit our web site: 
http://www.klm.com. This e-mail and any attachment may contain confidential and 
privileged material intended for the addressee only. If you are not the 
addressee, you are notified that no part of the e-mail or any attachment may be 
disclosed, copied or distributed, and that any other action related to this 
e-mail or attachment is strictly prohibited, and may be unlawful. If you have 
received this e-mail by error, please notify the sender immediately by return 
e-mail, and delete this message. 

Koninklijke Luchtvaart Maatschappij NV (KLM), its subsidiaries and/or its 
employees shall not be liable for the incorrect or incomplete transmission of 
this e-mail or any attachments, nor responsible for any delay in receipt. 
Koninklijke Luchtvaart Maatschappij N.V. (also known as KLM Royal Dutch 
Airlines) is registered in Amstelveen, The Netherlands, with registered number 
33014286
********************************************************
                        


----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to