Re: PL/I RFE to vote for (or not)

2020-09-02 Thread Paul Gilmartin
On Wed, 2 Sep 2020 20:39:27 +, Robert Prins wrote:
>
>>> quotient = QUOTREM(dividend, divisor, remainder),
>>>
>>> With quotient and remainder generated in one go by the execution of a DP
>>> instruction (and probably/possibly/maybe/likely  also by the various other
>>> divide instructions)
>>>
>>> https://www.ibm.com/developerworks/rfe/execute?use_case=viewRfe_ID=145001
>>>
>> Might this be better handled by an optimizing compiler's collapsing
>> common expressions, benefiting existing code with no source change?
>
>Yes, obviously, but Enterprise PL/I doesn't seem to realise this when a 
>division
>by a value is followed by a modulo(same-value).
>
But likewise:
quotient = QUOTREM(dividend, divisor, remainder);
doesn't exist.  Either would require a compiler enhancement.
I favor the technique that would benefit the most users
with no changes to source code that might be incompatible
with older compilers.

-- gil

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


Re: PL/I RFE to vote for (or not)

2020-09-02 Thread Frank Swarbrick
There is one advantage to COBOL's rather archaic arithmetic statements:

DIVIDE dividend  BY  divisor  GIVING quotient  REMAINDER remain
DIVIDE divisor INTO dividend  GIVING quotient  REMAINDER remain



From: IBM Mainframe Discussion List  on behalf of 
Robert Prins 
Sent: Wednesday, September 2, 2020 1:17 PM
To: IBM-MAIN@LISTSERV.UA.EDU 
Subject: PL/I RFE to vote for (or not)

quotient = QUOTREM(dividend, divisor, remainder),

With quotient and remainder generated in one go by the execution of a DP
instruction (and probably/possibly/maybe/likely  also by the various other
divide instructions)

https://www.ibm.com/developerworks/rfe/execute?use_case=viewRfe_ID=145001
--
Robert AH Prins
robert.ah.prins(a)gmail.com
The hitchhiking grandfather - https://prino.neocities.org/indez.html
Some REXX code for use on z/OS - https://prino.neocities.org/zOS/zOS-Tools.html

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

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


Re: PL/I RFE to vote for (or not)

2020-09-02 Thread Robert Prins

On 2020-09-02 17:02, Paul Gilmartin wrote:

On Wed, 2 Sep 2020 19:17:21 + , Robert Prins wrote:


quotient = QUOTREM(dividend, divisor, remainder),

With quotient and remainder generated in one go by the execution of a DP
instruction (and probably/possibly/maybe/likely  also by the various other
divide instructions)

https://www.ibm.com/developerworks/rfe/execute?use_case=viewRfe_ID=145001


Might this be better handled by an optimizing compiler's collapsing
common expressions, benefiting existing code with no source change?


Yes, obviously, but Enterprise PL/I doesn't seem to realise this when a division 
by a value is followed by a modulo(same-value).


Robert
--
Robert AH Prins
robert(a)prino(d)org
The hitchhiking grandfather - https://prino.neocities.org/indez.html
Some REXX code for use on z/OS - https://prino.neocities.org/zOS/zOS-Tools.html

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


Re: PL/I RFE to vote for (or not)

2020-09-02 Thread Paul Gilmartin
On Wed, 2 Sep 2020 19:17:21 + , Robert Prins wrote:

>quotient = QUOTREM(dividend, divisor, remainder),
>
>With quotient and remainder generated in one go by the execution of a DP
>instruction (and probably/possibly/maybe/likely  also by the various other
>divide instructions)
>
>https://www.ibm.com/developerworks/rfe/execute?use_case=viewRfe_ID=145001
>
Might this be better handled by an optimizing compiler's collapsing
common expressions, benefiting existing code with no source change?

-- gil

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