I've wondered the same thing. Does it make sense to use two branches where one would do, to make the conditional branch the unlikely path?
> And next year's model may negate the effort with something such as JIT analysis. I think even last year's model is more sophisticated than simply "always assuming the branch will not be taken" but that is the default if all other analyses fail. Charles -----Original Message----- From: IBM Mainframe Assembler List [mailto:ASSEMBLER-LIST@LISTSERV.UGA.EDU] On Behalf Of Paul Gilmartin Sent: Tuesday, May 16, 2017 7:32 AM To: ASSEMBLER-LIST@LISTSERV.UGA.EDU Subject: Re: Quick error termination of an assembler routine (Was: Performance of Decimal Floating Point Instruction) On 2017-05-16, at 07:59, Pieter Wiid wrote: > That's what the book says -- except for unconditional branches, BCT > and BXLE (and the relative and G variants) which predicts a branch. > I have wondered in cases where the programmer knows a priori that branch taken is more likely whether a branch around a branch better exploits the branch prediction rules. For example, instead of: BC MASK,TARGET Incorrectly predicts branch not taken How about: BC 15-MASK,*+8 Correctly predicts branch not taken B TARGET Correctly predicts branch taken Of course it would be better, if practical, to rearrange the code. And next year's model may negate the effort with something such as JIT analysis.