Technical data

Implementation-defined Behavior [10]
Pointers on UNICOS systems differ from pointers on UNICOS/mk systems. The
sections that follow describe pointer implementation on each type of system.
10.1.2.7.1 Pointers on UNICOS Systems
Although a pointer value can be stored in an object of integer type, an operation
may give different results when performed on the same value treated as an
integer or as a pointer. An integer result should not be used as a pointer. For
example, do not assume that adding 5 to an integer is the same as adding 5
to a pointer, because the result is affected by the kind of pointer used in the
operation. In particular, results may differ from those on a system using a simpler
representation of pointers, such as UNICOS/mk systems.
Pointers other than character pointers are internally represented just like integers:
as a single 64-bit field. Character pointers use one of the formats shown in Figure
1, page 149, depending on the size of A registers.
32 31
0
Unused (zeros)
Address
63 58 57
Offset
a10856
All other Cray PVP systems
Figure 1. Character Pointer Format
Converting a 64-bit integer to a character pointer type results in a pointer to the
byte specified by the value in the offset field of the word specified in the address
field.
10.1.2.7.2 Pointers on UNICOS/mk Systems
Pointers on UNICOS/mk systems are byte pointers. Byte pointers use the same
internal representation as integers; a byte pointer counts the numbers of bytes
from the first address.
A pointer can be explicitly converted to any integral type large enough to hold it.
The result will have the same bit pattern as the original pointer. Similarly, any
value of integral type can be explicitly converted to a pointer. The resulting
pointer will have the same bit pattern as the original integral type.
S217936 149