Go to the first, previous, next, last section, table of contents.
Value and location conversions are highly dependent on the target machine.
They are also very loosely specified in the 1988 standard.
(The 1992 standard seems an improvement.)
The GNU Chill compiler interprets mode(exp)
as follows:
-
If exp is a referable location,
and the size of (the mode of) exp is the same as the size of mode,
a location conversion is used.
It is implemented exactly as:
(refmode(-> exp))->
,
where refmode is a synmode for REF mode
.
The programmer is responsible for making sure that alignment
restrictions on machine addresses are not violated.
If both mode and the mode of exp are discrete modes,
alignment should not be a problem, and we get the same conversion
as a standard value conversion.
-
If exp is a constant,
and the size of (the mode of) exp is the same as the size of mode,
then a value conversion is performed. This conversion is done
at compile time, and it has not been implemented for all types.
Specifically, converting to or from a floating-point type is not implemented.
-
If both mode and the mode of exp are discrete modes,
then a value conversion is performed, as described in Z.200.
-
If both mode and the mode of exp are reference modes,
then a value conversion is allowed.
The same is true is one mode is a reference mode, and the other
is an integral mode of the same size.
Go to the first, previous, next, last section, table of contents.