Storage-operand references are of three
types: fetches, stores, and updates. Storage-Operand Fetch References When the bytes of a storage operand
participate in the instruction execution
only as a source, the operand is called
a fetch-type operand, and the reference to the location is called a storage­
operand fetch reference. A fetch-type
operand is identified in individual
instruction definitions by indicating
that the access exception is for fetch.
All bits within a single byte of a fetch
reference are accessed concurrently.
When an operand consists of more than
one byte, the bytes may be fetched from
storage piecemeal, one byte at a time.
Unless otherwise specified, the bytes are not necessarily fetched in any
particular sequence.
The storage-operand fetch references of
one instruction occur after those of all
preceding instructions and before those
of subsequent instructions, as observed
by other CPUs and by channels. The
operands of anyone instruction are
fetched in the sequence specified for
that instruction. Storage-Operand Store References When the bytes of a storage operand
participate in the instruction execution
only as a destination, to the extent of
being replaced by the result, the oper­
and is called a store-type operand, and
the reference to the location is called a storage-operand store reference. A
store-type operand is identified in
individual instruction definitions by
indicating that the access exception is for store.
All bits within a single byte of a store
reference are accessed concurrently.
When an operand consists of more than one byte, the bytes may be placed in
storage piecemeal, one byte at a time.
Unless otherwise specified, the bytes
are not necessarily stored 1n any
particular sequence.
The CPU may delay placing results in
storage. There is no defined limit on
the length of time that results may remain pending before they are stored.
This delay does not affect the sequence
in which results are placed in storage.
The results of one instruction are
placed in storage after the results of all preceding instructions have been
placed in storage and before any results
of the succeeding instructions are stored, as observed by other CPUs and by
channels. The results of anyone
instruction are stored in the sequence
specified for that instruction.
The CPU does not fetch operands or DAT­ table entries from a storage location
until all information destined for that
location by the CPU has been stored. Prefetched instructions may appear to be updated before the information appears
in storage.
The stores are necessarily completed
only as a result of a serializing opera­
tion and before the CPU enters the
stopped state. Storage-Operand Update References
In some instructions, the storage­
operand location participates both as a source and as a destination. In these cases, the reference to the location
consists first in a fetch and subse­
quently in a store. The operand is called an update-type operand, and the
combination of the two accesses is
referred to as an update reference.
Instructions such as MOVE lONES, TRANS­
LATE, OR (OC, 01), and ADD DECIMAL cause an update to the first-operand location.
An update-type operand is identified in the individual instruction definition by
indicating that the access exception is
for both fetch and store.
For most instructions which have update-type operands, the fetch and
store accesses associated with an update reference do not necessarily occur one immediately after the other, and it is possible for other CPUs and channels to
make fetch and store accesses to the
same location during this time. Such an
update reference is sometimes called a
noninterlocked-update storage reference.
For certain special instructions, the
update reference is interlocked against
certain accesses by other CPUs. Such an
update reference is called an
interlocked-update reference. The fetch
and store accesses associated with an
interlocked-update reference do not
necessarily occur one immediately after
the other, but all store accesses and
the fetch and store accesses associated
with interlocked-update references by
other CPUs are prevented from occurring
at the same location between the fetch
and the store accesses of an
interlocked-update reference. Accesses
by channels may occur to the location
during the interlock period.
The storage-operand update references
for the following instructions appear to
be an interlocked-update reference as
observed by other CPUs. The instruc­
tions TEST AND SET, COMPARE AND SWAP, Chapter 5. Program Execution 5-29
and COMPARE DOUBLE AND SWAP perform an
interlocked-update reference. On models
in which the STORE CHARACTERS UNDER MASK
instruction with a mask of zero fetches
and stores the byte designated by the
second-operand address, the fetch and
store accesses are an interlocked-update
reference. For DAS tracing, the
current-entry-control word in the
trace-table-entry header is changed by
means of an interlocked-update
reference. Within the limitations of the
requirements, the fetch and
accesses associated with an
reference follow the same rules
fetches and stores described
previous sections. Programming Notes above
store update as the
in the
1. When two CPUs attempt to update information at a common main­
storage location by means of a
noninterlocked-update reference, it is possible for both CPUs to fetch
the information and subsequently
make the store access. The change
made by the first CPU to store the result in such a case is lost. Similarly, if one CPU updates the
contents of a field by means of a
noninterlocked-update reference,
but another CPU makes a store
access to that field between the
fetch and store parts of the update reference, the effect of the store is lost. If, instead of a store access, a CPU makes an
interlocked-update reference to the
common storage field between the
fetch and store portions of a noninterlocked-update reference due
to another CPU, any change in the
contents produced by the
interlocked-update reference is lost.
2. The instructions TEST AND SET, COMPARE AND SWAP, and COMPARE DOUBLE AND SWAP facilitate updating
of a common storage field by two or
more CPUs. To ensure that no
changes are lost, all CPUs must use an instruction providing an inter­
locked-update reference. In addition, the program must ensure
that channels do not store into the
same storage location since such
stores may occur between the fetch
and store portions of an
interlocked-update reference.
3. Only those bytes which are included
in the result field of both oper­
ations are considered to be part of the common main-storage location. However, all bits within a common
byte are considered to be common
even if the bits modified by the 5-30 System/370 Principles of Operation 4.
two operations do not overlap. As
an example, if (1) one CPU executes
the instruction OR (OC) with a
length of 1 and the value 80 hex in
the second-operand location and
(2) the other CPU executes AND (NC) with a length of 1 and the value FE
hex in the second-operand location,
and (3) the first operand of both
instructions is the same byte, then
the result of one of the updates
can be lost.
When the store access is part of an
update reference by the CPU, the
execution of the storing is not
necessarily contingent on whether
the information to be stored is
different from the original
contents of the location. In
particular, the contents of all
designated byte locations are
replaced, and, for each byte in the
field, the entire contents of the
byte are replaced.
Depending on the model,
to store information
performed, for example,
following cases:
an access
may be in the
a. Execution of the OR instruction (O! or OC) with a second oper­
and of all zeros.
b. Execution of OR (OC) with the
first- and second-operand
fields coinciding.
c. For those locations of the first operand of TRANSLATE
where the argument and function
values are the same. STORAGE-OPERAND CONSISTENCY Single-Access References
A fetch reference is said to be a single-access reference if the value is
fetched in a single access to each byte of the data field. In the case of over­
lapping operands, the location may be
accessed once for each operand. A
store-type reference is said to be a
single-access reference if a single
store access occurs to each byte
location within the data field. An
update reference is said to be single­
access if both the fetch and store
accesses are each single-access.
Except for the accesses associated with
multiple-access references and the
stores associated with storage change
and restoration for DAT-associated
access exceptions, all storage-operand
references are single-access references.
Previous Page Next Page