TOTRL.L.E N ~TH
EXPoN ENTLENGTHEXPO~E~,,I'rVALU4
e.-O
[e,,o, JJ...I
INFINITYNOT'-A-
NUrvaBEI~.
C.aN)
RERL..
LONGR£BL
TgMR
REAL
3E bits
'3 bits~4 bi-t-5
80 bit5
I I bi'i~
15
its
p.,1
_ [
~.,o_ I
~'~-
<o..F')
e.-/l"-I,-F':O e:ll,..I,~:O
e.tl...I,i.l,.F':O
e:ll-"l ,.4~0
:~l...i
,-C¢O
e,Jl..-I,i.I,-~-O
The Temporary Real format (identical to the8087 register format) is intended to hold inter-mediates and to support accurate Long Real cal-culations. It has an explicit leading bit (i) inthe significand thus allowing unnormalized arith-metic. However, the algorithms are designed sothat normalized operands will always yield nor-malized results.The algorithms specified by the standard re-quire that the completely precise result of anoperation be rounded to the nearest representablenumber, breaking ties by rounding to the nearesteven number. This default mode of rounding iscalled "unbiased round to nearest". There are,optional "directed rounding" modes that are spec-ified to yield1. the nearest neighbor less than or equalto the true result.2. the nearest neighbor greater than orequal to the true result.The 8087 provides these rounding modes as con-trolled by a field (RC) in the CONTROL WORD.
The 8087, which does all calculations inTemporary Real format, has another field in theCONTROL word for specifying the precision to whicha result is rounded (PC). Thus, the precision ofresults is independent of the precision of operandsand, though held in Temporary Real format and ben-efitting from extended range, may be forced toReal, Long Real or Temporary Real. This controlis provided for languages that do not allow ex-tended precision intermediates and to allow thesame code to be run under different precision set-tings as an aid to error estimation.
The standard also specifies that all excep-tions must be detected and that an implementationshould permit exception handling. The 8087 sup-ports this by detecting six types of exceptionsand by generating an interrupt if the exception isnot masked. If an interrupt is generated, the in-terrupt procedure (exception handler) has avail-able the exception flags, a pointer to the instruc-tion causing the interrupt and a pointer to thedatum if memory was addressed. The six exceptions,each of which has an associated "sticky" flag (onceset it remains set until reset by software), arelisted below.i. I :
invalid operationthis exception is signaled by stackoverflow or underflow, the use of aNAN as an operand and several othercases as listed in ~3]
2. D : denormalized operandat least one operand is denormalized
3. Q :
zero divisorthe dividend is finite and nonzerowhile the divisor is zero4. 0 :overflowthe exponent of the result is toolarge for the destination's format
5. U : underflowthe exponent of the result is toosmall for the destination's format
6. P : inexact resultthe delivered result is not equal tothe completely precise result but hasbeen roundedSince the default response to overflow andzero divisor is to set the result ton , the 8087supports two modes of infinity arithmetic:
I.affine - there are two infinites, one(-~) less than all other numbers and one(+cx:~) greater
2.projective - there is only one infinity(the sign on--is ignored) which closesthe number system analogous to the pointat~on the Reimann sphere.These two modes require the representation oftwo zeros (±0) which are "equal" in comparison andall other operations except division where*I/+O=,loc~+I#O:-~. The mode of infinity arithmetic is de-termined by a field (IC) in the CONTROL word.There are instructions that support the stand-ard by controlling rounding, precision and infin-ity arithmetic and by permitting complete exceptionhandling. These instructions load and store eitherthe control word or the entire environment andstore the exception flags.The features and instructions discussed abovesupport the Intel floating-point (REALMATH) stand-ard but additional capability is also desired.3.2 Capability ExtensionThe 8087, by supporting the required and op-tional aspects of the standard and by supportingseveral features not mentioned by the standard,significantly extends the capabilities of the 8086family beyond that expected from a typical floating-point processor. These extensions include addi-tional data types, provision of exact arithmetic,support for interval arithmetic and special func-tions.
176
Leave a Comment