James Giles wrote:
> ...
>
>Well, adopting C as an implementation language pessimizes the
>system. In any case, C isn't zero or one, it's zero or non-zero.
>Any choice you made would not penalize C.
>
Using C as an "implementation language" is a long way from using C's
convention for true and false results. We're talking about the result of
a compare operation. In C, that result is required to be 0 or 1. The
reference is sections 6.5.8 and 6.5.9 of the C standard.
>
>But I still don't believe you set logicals *in hardware* to an
>INTEGER 0 or 1. I'll bet the result of a floating point compare
>is not of type INTEGER at all. It's probably a single bit somewhere
>:-(if not more than one bit like Intel chips use). Or maybe even a
>conditional jump form.
>
At the hardware level, the result is a 64 bit value in the result
register specified in the instruction. For false, all the bits are 0.
For true, the upper 63 bits are 0 and the low order bit is 1. Whether
these are "INTEGER" or not is beside the point. That's a Fortran term,
not a hardware term. But the bit patterns are identical to the
representations of the integer values 0 and 1.
>
>Once again, the language should *not* specify what the canonical
>internal form of a LOGICAL should be. That is, the standard
>document *should* be mute on the subject. Whatever you do as
>implementors is your business. It should be your business. It
>should not be the business of any language designer.
>
On that we agree.
Cheers,
Bill
>
>
>
>
--
Bill Long [log in to unmask]
Fortran Technical Support & voice: 651-605-9024
Bioinformatics Software Development fax: 651-605-9142
Cray Inc., 1340 Mendota Heights Rd., Mendota Heights, MN, 55120
|