Well, got some time unexpectedly. I redid my TRUNC tests. And my original test 
code was a poor test. TRUNC(OPT) is significantly better than TRUNC(BIN) for 
both fullword and halfword binary fields using the MULTIPLY and DIVIDE verbs.

TRUNC(OPT): DIVIDE LSS-FULLWORD-1 BY LSS-FULLWORD-2

L     6,8(0,5)                LSS-FULLWORD-1
SRDA  6,32(0)
D     6,16(0,5)               LSS-FULLWORD-2
ST    7,8(0,5)                LSS-FULLWORD-1

Can't really get anything better.

TRUNC(BIN) of the same sentence:

         L     6,16(0,5)               LSS-FULLWORD-2
         SRDA  6,32(0)
         L     0,8(0,5)                LSS-FULLWORD-1
         SRDA  0,32(0)
         D     0,0(0,12)               SYSLIT AT +0
         CVD   1,352(0,13)             TS2=16
         MVO   338(6,13),355(5,13)     TS2=2
         CVD   0,352(0,13)             TS2=16
         TM    343(13),X'10'           TS2=7
         MVC   343(5,13),355(13)       TS2=7
         BC    8,332(0,11)             GN=19(000390)
         OI    347(13),X'01'           TS2=11
GN=19    EQU   *
         MVC   336(2,13),8(12)         TS2=0
         D     6,0(0,12)               SYSLIT AT +0
         CVD   7,368(0,13)             TS2=32
         MVO   352(6,13),371(5,13)     TS2=16
         CVD   6,368(0,13)             TS2=32
         TM    357(13),X'10'           TS2=21
         MVC   357(5,13),371(13)       TS2=21
         BC    8,374(0,11)             GN=20(0003BA)
         OI    361(13),X'01'           TS2=25
GN=20    EQU   *
         DP    336(12,13),356(6,13)    TS2=0
         ZAP   376(10,13),336(6,13)    TS2=40
         MVC   368(8,13),89(10)        TS2=32
         MVC   371(5,13),381(13)       TS2=35
         CVB   4,368(0,13)             TS2=32
         MVO   371(5,13),376(5,13)     TS2=35
         CVB   7,368(0,13)             TS2=32
         M     6,0(0,12)               SYSLIT AT +0
         ALR   7,4
         BC    12,426(0,11)            GN=21(0003EE)
         A     6,4(0,12)               SYSLIT AT +4
GN=21    EQU   *
         LTR   4,4
         BC    11,436(0,11)            GN=22(0003F8)
         S     6,4(0,12)               SYSLIT AT +4
GN=22    EQU   *
         ST    7,8(0,5)                LSS-FULLWORD-1

Really bad. MULTIPLY of a halfword is also very good for TRUNC(OPT) and equally 
horrible for TRUNC(BIN).

-- 
John McKown 
Systems Engineer IV
IT

Administrative Services Group

HealthMarkets(r)

9151 Boulevard 26 * N. Richland Hills * TX 76010
(817) 255-3225 phone * 
[email protected] * www.HealthMarkets.com

Confidentiality Notice: This e-mail message may contain confidential or 
proprietary information. If you are not the intended recipient, please contact 
the sender by reply e-mail and destroy all copies of the original message. 
HealthMarkets(r) is the brand name for products underwritten and issued by the 
insurance subsidiaries of HealthMarkets, Inc. -The Chesapeake Life Insurance 
Company(r), Mid-West National Life Insurance Company of TennesseeSM and The 
MEGA Life and Health Insurance Company.SM

 

> -----Original Message-----
> From: IBM Mainframe Discussion List 
> [mailto:[email protected]] On Behalf Of Clark Morris
> Sent: Friday, April 13, 2012 9:53 AM
> To: [email protected]
> Subject: Re: Modernizing the BCP code ?
> 
> On 12 Apr 2012 09:48:17 -0700, in bit.listserv.ibm-main you wrote:
> 
> >Now that you mention it, I remember that the C/C++ compiler 
> has a architecture option to control the instructions 
> generated. I should have known that the PL/X compiler would 
> too. I didn't know that they both share the same back-end. I 
> wish that the COBOL compiler did. I am constantly amazed at 
> the amount of code generate by a simpe:
> >
> > ADD +1 TO WS-INTEGER.
> >
> >when WS-INTEGER is defined as PIC S9(9) BINARY or NATIVE. 
> COBOL seems to have an inordinate love for PACKED-DECIMAL. 
> Someone once said it was due to ANSI standards compliance. 
> Might be worth it, in CPU saved, to license the C compiler 
> and port the OpenCOBOL
> >
> >Unless I somehow have the wrong compile parameters.
>  Make sure you have TRUNC(OPT) implied or expressed in the compile
> parameters.  If you have TRUNC(STD) then WS-INTEGER must be in the
> range -999,999,999 through +999,999,999.  TRUN(BIN) always has been
> fiasco.
> 
> Clark Morris
> 
> ----------------------------------------------------------------------
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to [email protected] with the message: INFO IBM-MAIN
> 
> 

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to