I understand. I don't even need a computer to do that :-) The "return" was
just to discourage the optimizer to throw away all the code because I
didn't use the result.
The thing that kept me awake briefly was whether the optimizer would
recognize that the shortcut and code a single compare with tw
Rob,
Interestingly, when I take your C example,
if ( j < k ) m = -1;
else if (j > k) m = 1;
else m = 0;
return m;
and rewrite it trivially modified in PL/I as
if j < k then m = -1;
else if j > k then m = 1;
else m = 0;
return (m);
I cannot reproduce your results.
John Gilmor
From: "Rob van der Heij"
Sent: Wednesday, October 23, 2013 8:12 PM
Since the machine architectures that came to mind all have this 3-state
result after comparison, I expected the compiler to take advantage of it
when I write something like
if ( j < k ) m = -1;
else if (j > k) m = 1;
else m
Since the machine architectures that came to mind all have this 3-state
result after comparison, I expected the compiler to take advantage of it
when I write something like
if ( j < k ) m = -1;
else if (j > k) m = 1;
else m = 0;
return m;
A few surprises with gcc, like pretty dumb code wit
From: "John Gilmore"
Sent: Tuesday, October 22, 2013 9:31 AM
PL/I was robbed of FIXEDOVERFLOW for binary fixed values.
Use SIZE instead.
It is still
available for PL/I decimal fixed, i.e., packed decimal values.
The LE does in fact make a facility available for executing what is in
efff
PL/I was robbed of FIXEDOVERFLOW for binary fixed values. It is still
available for PL/I decimal fixed, i.e., packed decimal values.
The LE does in fact make a facility available for executing what is in
efffect an arbitrary SPM instruction; but it is documented so
poorly---It has been all but h
On 2013-10-21 11:06, John Gilmore wrote:
>
> [signum] is available as a BIF called sign in PL/I, where it is [almost
> always]
> implemented in line. An analogous function is available for strings
> in C, where it is implemented as a library subroutine. It has always
> been available in FORTRAN