Data Format .
Guard Digit .
Number Representation Normalization Instructions .
ADD NORMALIZED
ADD UNNORMALIZED
COMPARE DIVIDE HALVE . LOAD LOAD AND TEST LOAD COMPLEMENT. LOAD NEGATIVE. LOAD POSITIVE LOAD ROUNDED MULTIPLY. STORE .
SUBTRACT NORMALIZED
SUBTRACT UN NORMALIZED
Contents
The floating-point instructions are used to perform
calculations on operands with a wide range of mag­
nitude and to yield results scaled to preserve preci­
sion.
A floating-point number consists of a signed ex­
ponent, represented by the characteristic, and a
signed fraction. The quantity expressed by this
number is the product of the fraction and the num­
ber 16 raised to the power of the exponent. The
exponent is expressed in excess-64 binary notation
(see "Number Representation"); the fraction is ex­
pressed as a hexadecimal number having a radix
point to the left of the high-order digit.
To avoid unnecessary storing and loading opera­
tions for results and operands, four floating-point
registers are provided. The floating-point instruc­
tions provide for the loading, rounding, adding, sub­
tracting, comparing, multiplying, dividing, and stor­
ing, as well as the sign control, of short, long, and
extended operands. Short operands generally provide
faster processing and require less storage than long
or extended operands. On the other hand, long and
extended operands provide greater precision in com­
putation. Operations may be either register to regis­
ter or storage to register.
For addition, subtraction, multiplication, and divi­
sion, instructions are provided that generate normal­
ized results. Normalized results preserve the highest
Floating-Point Instructions
157
158
159
159 160 160 162
163
163
164
165
165
165
166
166
166
167
168
169
169
precision in the operation. For addition and subtrac­
tion, instructions are also provided that generate
unnormalized results. Normalized and unnormalized
operands may be used in any floating-point opera­
tion.
The condition code is set as a result of all sign­
control, add, subtract, and compare operations.
The rounding and extended-operand instructions
are part of the extended-precision floating-point
feature. The other floating-point instructions and the
registers are part of the floating-point feature.
Data Format
Floating-point data occupies a fixed-length format,
which may be either a four-byte (short) format, an
eight-byte (long) format, or a 16-byte (extended)
format. The short and long formats may be designat­
ed as operands both in main storage and in the
floating-point registers, whereas the extended for­
mats can be designated only in the floating-point
registers.
The floating-point registers are numbered 0, 2, 4,
and 6. Designation of an odd-numbered register in
the Rt or R2 field of a floating-point instruction
causes the operation to be suppressed and a program
interruption for specification exception to occur.
Floating-Point Instructions 157
Short Floating-Point Number lsi ____ o 1 8 31
Long Floating-Point Number S Charactl3ristic 63
Extended Floating-Point Number I s I Characteristic High-Drder Half of F o 8 ' 63
64 72 Low-Order Half 127
In the short and long formats, the first bit is the
sign bit (51). The subsequent seven bit positions are
occupied by the characteristic. The following field
contains the fraction, which, depending on the for­
mat, consists of six or 14 hexadecimal digits.
Short floating-point numbers occupy only the
leftmost 32 bit positions of a floating-point register.
When a floating-point register is used as the source
of a short floating-point number, the rightmost 32
bit positions of the register are ignored. When a
floating-point register is used as the destination of a
short floating-point number, the rightmost 32 bit
positions IOf the register remain unchanged.
An extended floating-point number has a 28-digit
fraction and consists of two long floating-point num­
bers in consecutive floating-point registers. Two
pairs of fllDating-point registers can be used as
sources of extended operands or destinations of ex­
tended results: registers 0, 2 and registers 4, 6 .. The
designation of any other register pair causes the op­
eration to be and a program interruption
for a specification exception to occur.
The two long floating-point numbers comprising
an extended floating-point number are called the
high-order and low-order parts. The high-order part
may be allY long floating-point number. If it is nor­
malized, the extended number is considered normal­
ized. The characteristic of the high-order part is the
characteristic of the extended number, and the sign
of the high-order part is the sign of the extended
number.
The fraction field of the low-order part contains
the 14 low-order hexadecimal digits of the 28-digit
extended fraction. The sign and characteristic of the
low-order part of an extended operand are ignored,
the value of the number being assumed such as if the
158 System/370 Principles of Operation sign of the low-order part were the same as that of
the high-order part, and the characteristic of the
low-order part were 14 less than that of the high­
order part. In extended results, the sign of the low­
order part is made the same as that of the high-order
part, and, unless the result is a true zero, the low­
order characteristic is made 14 less than the high­
order characteristic. When the subtraction of 14
causes the low-order characteristic to become less
than zero, it is made 128 larger than its correct val­
ue. Exponent-underflow is indicated only when the
high-order characteristic underflows.
The entire set of floating-point functions is availa­
ble for short and long operands. These instructions
generate a result that has the same format as the
sources, except that in the case of MULTIPLY, a
long product is produced from a short multiplier and
multiplicand. For extended operands, instructions
are provided for normalized addition, subtraction,
and multiplication. Additionally, two multiplication
instructions are provided that generate an extended
product from a long multiplier and multiplicand.
The rounding instructions provide for rounding from
extended to long format and from long to short for-
mat. i Programming Note
A long floating-point number can be extended to the
extended format by appending any long floating­
point number having a zero fraction, including a true
zero. Conversion from the extended to the long for­
mat can be accomplished by truncation or by means
of LOAD ROUNDED. In the absence of an exponent overflow or expo­
nent underflow, the long floating-point number con­
stituting the low-order part of an extended result
correctly expresses the value of the low-order part of
the extended result when the characteristic of the
high-order part is 14 or higher. This relation is true
also when the result is a true zero. When the high­
order characteristic is less than 14 but the number is
not a true zero, the low-order part, when addressed
as a long floating-point number, does not have the
correct characteristic value.
Guard Digit
Although final results have six fraction digits in the
short format, 14 fraction digits in the long format,
and 28 fraction digits in the extended format, inter­
mediate results in ADD NORMALIZED, SUB­ TRACT NORMALIZED, ADD UNNORMAL­ IZED, SUBTRACT UNNORMALIZED, COM- P ARE, HALVE, and MULTIPLY may have one
additional low-order digit. This low-order digit, the
Previous Page Next Page