| James Giles 2008-01-22, 7:27 pm |
| glen herrmannsfeldt wrote:
> James Giles wrote:
> (snip)
>
>
> On many machines an aligned fullword operation is faster than
> a byte operation. This has been true for a while, and is likely
> more true on newer machines.
OK scale my example up a little. Suppose you're on a platform
where the default INTEGER/LOGICAL/REAL size is 64-bits
and the C companion processor makes the same decision for
int, bool, and float. It may still be faster for doing .NEQV.
to load, process, and store only the high order 32-bits of a
LOGICAL value. Since the low order half isn't relevant to
the meaning of LOGICAL values anyway, what's the problem?
The point is that your program can't portably make *any*
assumptions about TRANSFERred data (other than the property
that immediately TRANSFERring back yields the original value,
provided the intermediate type is big enough). It's best to avoid
TRANSFER unless nothing else works at all.
--
J. Giles
"I conclude that there are two ways of constructing a software
design: One way is to make it so simple that there are obviously
no deficiencies and the other way is to make it so complicated
that there are no obvious deficiencies." -- C. A. R. Hoare
|