On Mon, 17 Feb 2014 07:49:18 -0500, Peter Relson wrote:
>
>If the "branch technique" is faster, and depending on how high a
>percentage "most of the time" (as in "most of the time CURRENT will be
>zero") is, then the branch technique given as the alternative to no-branch
>is likely not optimal. Even with branch prediction technology, it is still
>better to have the "expected path" not take a branch.
>
>So, for example (when LT is available),
>
(It's possible that CURRENT has just been calculated and CC is
already set.)

>         LT    Rx,CURRENT
>         JNZ   Need_To_Add
>Return_From_Need_To_Add DS 0H
>...
>Need_To_Add DS 0H
>         A     Rx,SUM
>         ST    Rx,SUM
>         J     Return_From_Need_To_Add
> 
Is there a maxim here?  When the programmer expects that a branch
will usually be taken, is it better to avoid:

        BC    C,USUALLY

and code instad:

         BC    15-C,*+8
         B     USUALLY

???

>Then you get to factor in how much "readability" is worth to you.
>  
Macros are your friend.  But does providing "readability" at the
programming interface level make such a macro unpleasantly
verbose internally?

-- gil

----------------------------------------------------------------------
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