• Embed Doc
  • Readcast
  • Collections
  • CommentGo Back
Download
 
THE INTEL~8087 NUMERIC DATA PROCESSOR
John Palmer
Intel Corporation
This paper describes a new device, the Intel~8087 Numeric Data Processor, with unprecedentedspeed, accuracy and capability. Its modified stackarchitecture and instruction set are explained andillustrative examples are included. The 8087,which conforms to the proposed IEEE FloAting-PointStandard, is a coprocessor in the Intel~8086 fam-ily. It supports seven data types: three REAL,three INTEGER and one packed BCD format, and per-forms all necessary numeric operations from addi-tion to logarithmic and trigonometric functions.new applications, most notably interval arithmetic[1]. The 8087 provides an unprecedented level ofcapability, safety and reliability with high per-formance and low cost and is a prime example of thealmost incredible possibilities in combining soft-ware and architectural expertise with VLSI proces-sing capability.2.0 8087 OVERVIEWThe 8087 consists of a stack of registers forholding operands and results, a set of registersconstituting its environment and a set of instruc-tions.The stack is a set of 8 registers, each 80bits wide. Associated with the stack is a threebit stack pointer, TOP, and with each stack elementa two bit tag. (Both the tags and TOP physicallybelong to the ENVIRONMENT but will be shown withthe stack.) The stack elements are numbered rela-tive to TOP (ST(i) means the ith stack element fromthe top of stack) as shown bel~.1.0 INTRODUCTIONThe Intel~)8087 is a high performance gen-eral purpose nume~c data processor. It is apart of the InteNJ8086 family and can be usedwith either the 8086 or the 8088 to extend theirinstruction sets by over 120 numeric data manip-ulation operations. The 8087 is not a peripheralbut a coprocessor; it monitors the instructionstream and when an 8086/8088 ESCAPE instructionis read, the 8087 takes over the bus and inter-prets and executes the ESCAPE instruction as oneof its own instructions. This tightly coupledcoprocessing interface permits the 8087 to exe-cute numeric instructions while the 8086 executesany others. The concurrent instruction executionincreases the throughput of the system. Further-more, the 8087 is the only chip that must be addedto an 8086 (8088) system to provide numeric capa-bility that exceeds software in speed by more thana factor of 100.The 8087 is intended to be general purposeand satisfy a very wide range of needs for math-ematical computation. It is fast enough for agreat many scientific and statistical calculations;it is accurate enough for business and commercialcomputation; and it is precise enough for entirelyTAGS
i
II
STACK
¢- SIGN
-7,=15 EXPONENT 51GNIFleRND
o
ST{~)
ST (a)
ST(K)
ST(o) STBCKST(G)
5T(5)
ST(4)
The tag field is used to detect uninitializedstack elements and to designate special values(e.g. zero) for microcode optimization.The value represented in a register has 64bits of precision and a range of about 10±4900 (15bit exponent). A more complete description of theregister values will be given in Section 3.
CH1494-4/80/0000-0174 $00.75 © 1980 IEEE
474
 
The 8087 environment consists of sevenas illustrated below.
B Z TOP~
C AISIN -iP U O (~!DI
words
ST/~TU5CONTROLWORDTAG
WOR.D
~NST~UC-
T
ion
RDDIZESS
DATAThe STATUS word consists of the EXCEPTIONflags (0-7) and the STATUS bits (8-15) where themeanings are (* indicates a field reserved forfuture use):EXCEPTION FLAGSI : invalid operationD : denormalized operandQ : division of nonzero by zero0 : overflowU : underflowP : inexact (precision)N : indicates a pending interruptSTATUS BITSZ,C,A,S : condition code bits for variousinstructions (e.g. COMPARE)TOP : stack pointerB : indicates whether the 8087 isBUSY (used for synchronization)The CONTROL WORD consists of EXCEPTION MASKSand CONTROL BITS. For each exception there is amask which if reset allows an interrupt to be gen-erated (if M = O) but if set the interrupt is sup-pressed and the 8087 executes a default exceptionhandling procedure (on chip) and continues (theprocedure will be explained in Section III). TheM mask is the 8087 interrupt enable/disable bit.The CONTROL BITS have the following meaningPC :precision control - results are roundedto one of three precisions: TemporaryReal (64 bits), Long Real (53 bits),Real (24 bits).RC : rounding control - results are roundedin one of four directions: unbiasedround to nearest, round towards +~ ,round towards -~, round towards zero.IC : infinity control - there are two typesof infinity arithmetic provided: affineand projective.The TAG word contains tags describing thecontents of the corresponding stack elements. Theinstruction and data pointers are the addresses ofan instruction (and its referenced data if any) ifit causes an exception that generates an interrupt.There are four types of 8087 instructions: theCORE set, the EXTENDED set, the SPECIAL FUNCTIONset and the ADMINISTRATIVE set. The core set in-cludes load and store of the stack values and a-rithmetic operators: add, subtract, multiply, di-vide and compare. The extended set is for loadingand storing three special formats (see Section 3).The special function set includes square root andtranscendental function support. The administra-tive instructions are used for context switchingand processor control. Most of the instructionswill be described in more detail as the 8087 de-sign goals are explained.3.0 DESIGN GOALSThe 8087 is designed to achieve several majorgoals. First, the 8087 conforms to an improvedand expanded version of Intel's standard for float-ing-point arithmetic C2]. Second, the 8087 prov-ides significantly more capability than mainframeand minicomputer floating-point processors andconsequently has applications beyond scientificcomputation. Third, the 8087 is convenient to usein assembly language and easy to generate code forin high level language. And finally the capabil-ities of VLSI are used to provide all this function-ality with high performance and efficiency in asingle device.3.1 Floating-Point StandardThe Intel floating-point standard, called theREALMATH standard, was originally specified in1977 C2] and implemented in several products (FPAL,SBC-310, FORTRAN-80, BASIC-80). At about that timean IEEE committee was formed to propose a floating-point standard for microprocessors. Intel was in-vited to participate and offered its standard forconsideration.At the time this paper was written it had be-come apparent that the majority of the committeehad agreed on a revised and expanded version ofIntel's standard [3]. The standard specifies dataformats, rounding algorithms and exception han-dling.The standard specifies and the 8087 supportsthree floating-point data types: Real (singleprecision), Long Real (double precision) and Tem-porary Real (extended precision). All formats arebinary and each has a biased exponent. The valuesrepresented by the three formats are shown below.
,~m ~ o
'Tq 6~I~hL
0
I
t75
 
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
of 00

Leave a Comment

You must be to leave a comment.
Submit
Characters: ...
You must be to leave a comment.
Submit
Characters: ...