Let's think about the old way and the new way:
Old Way:
L Rx,BinaryVariable
CVD Rx,WorkDblWd
UNPK Zoned_Decimal_Target,WorkDblWd
* And then fix the sign nibble for unsigned target with (perhaps) OI
target+length-1,X'F0'
New Way:
L Rx,BinaryVariable
CXFTR F0,0,Rx,B'1000' Use DFP rounding default, suppress
inexact-value exception
CZXT F0, Zoned_Decimal_Target,M3
* M3 is used to tell the instruction how to set the sign of the result
No idea if it is faster or not, but CXFTR is a register-to-register operation
(albeit general register and floating-point register) and CZXT is
register-to-storage, while CVD is register-to-storage and UNPK is
storage-to-storage. Maybe the (possible) storage-to-storage cache-delay
penalty for UNPK makes up for any slower FP operation speed?
Only the back-end optimization routine can tell you that for sure, and it isn't
talking. Remember though, that back end is reportedly shared with the Java JIT
back end, and is supposed to be "very knowledgeable" about the fastest way to
run code on a given architecture level.
Trust but verify. Run 5-10 production-volume batch tests of pre-COBOL V5 and
COBOL V5 versions of your program, measuring both CPU and elapsed time, and
then average the results. If there are real savings there, why do we care how
it is done? (Except when we have to debug that abend at oh-dark-thirty, of
course.)
HTH
Peter
-----Original Message-----
From: IBM Mainframe Assembler List [mailto:[email protected]] On
Behalf Of Peter Hunkeler
Sent: Wednesday, May 10, 2017 1:08 PM
To: [email protected]
Subject: Performance of Decimal Floating Point Instruction
Out of curiosity.
I see that Cobol V5.2 (and up) is making use of decimal floating point
instructions instead of traditional instruction a lot. For example, a MOVE from
a binary number field to a character field is done with CZXT decimal floating
point instruction.
Is the performance of floating point instruction so much better today? I seem
to remember that floating point instructions had not been the fastest in
earlier times and machines (I may be wrong with this).
Opinions?
--
Peter Hunkeler
This message and any attachments are intended only for the use of the addressee
and may contain information that is privileged and confidential. If the reader
of the message is not the intended recipient or an authorized representative of
the intended recipient, you are hereby notified that any dissemination of this
communication is strictly prohibited. If you have received this communication
in error, please notify us immediately by e-mail and delete the message and any
attachments from your system.