Document revision date: 19 July 1999 | |
Previous | Contents | Index |
Remove Entry from Queue
opcode entry.ab,addr.wl
N|| <--- (entry) LSS (entry+4); | |
Z|| <--- (entry) EQL (entry+4); ! Queue empty | |
V|| <--- (entry) EQL (entry+4); ! No entry to remove | |
C|| <--- (entry) LSSU (entry+4); |
0F | REMQUE | Remove Entry from Queue |
The queue entry specified by the entry operand is removed from the queue. The address operand is replaced by the address of the entry removed. If there was no entry in the queue to be removed, the condition code V-bit is set; otherwise it is cleared. If the queue is empty at the end of this instruction, the condition code Z-bit is set; otherwise it is cleared. The removal is a noninterruptible operation. Before performing any part of the operation, the processor validates that the entire operation can be completed. This ensures that if a memory management exception occurs (see Appendix E), the queue is left in a consistent state.
REMQUE @h,addr ; h is queue header |
REMQUE @h+4,addr ; h is queue header |
REMQUE entry,addr |
REMQUE ... ; Queue empty? BEQL 1$ ; Yes CALL ACTIVATE(...) ; Activate other waiters 1$: |
1$: REMQUE ... ; Anything removed? BVS EMPTY ; No . . . BR 1$ |
9.2.8 Floating-Point Instructions
Floating-point instructions operate on the following four data types:
To be consistent with the floating-point instruction set, which faults on reserved operands (see Chapter 8), software-implemented floating-point functions (for example, the absolute function) should verify that no input operands are reserved. An easy way to do this is a floating move or test of the input operands.
To make high-speed, floating-point operations easier, restrictions are placed on the addressing mode combinations usable within a single floating-point instruction. These combinations involve the logically inconsistent simultaneous use of a value as both a floating-point operand and an address.
If, within the same instruction, you use the contents of register Rn as
both a part of a floating-point input operand (an .rf, .rd, .rg, .rh,
.mf, .md, .mg, or .mh operand) and as an address in an addressing mode
that modifies Rn (autoincrement, autodecrement, or autoincrement
deferred), the value of the floating-point operand is UNPREDICTABLE.
9.2.8.1 Introduction
Mathematically, a floating-point number may be defined as having the following form:
(+ or -) (2**K)*f
where K is an integer and f is a nonnegative fraction. For a nonvanishing number, K and f are uniquely determined by imposing the following condition:
1/2 LEQ f LSS 1. |
The fractional factor, f, of the number is then said to be binary normalized. For the number 0, f must be assigned the value zero, and the value of K is indeterminate.
VAX derives these floating-point data formats from this mathematical representation for floating-point numbers. Four types of floating-point data are provided: the two standard PDP-11 formats (F_floating and D_floating), and two extended-range formats (G_floating and H_floating). Single-precision, or floating, data is 32 bits long. Double-precision, or D_floating, data is 64 bits long. Extended-range double-precision, or G_floating, data is 64 bits long. Extended-range quadruple-precision, or H_floating, data is 128 bits long. Use sign magnitude notation as follows:
The VAX has the standard arithmetic operations ADD, SUB, MUL, and DIV implemented for all four floating-point data types. The results of these operations are always rounded, as described in Section 9.2.8.3. In addition, VAX has two composite operations, EMOD and POLY, also implemented for all four floating-point data types. EMOD generates a product of two operands and then separates the product into its integer and fractional terms. POLY evaluates a polynomial, given the degree, the argument, and a pointer to a table of coefficients. Details on the operation of EMOD and POLY are given in their respective descriptions. All of these instructions are subject to the rounding errors associated with floating-point operations, as well as to exponent overflow and underflow. Accuracy is discussed in Section 9.2.8.3. Exceptions are discussed in Appendix E.
The VAX architecture also has a complete set of instructions for conversion from integer arithmetic types (byte, word, longword) to all floating types (F_floating, D_floating, G_floating, H_floating), and vice versa. The VAX architecture also has a set of instructions for conversion between all of the floating types except between D_floating and G_floating. Many of these instructions are exact, in the sense defined in Section 9.2.8.3. However, a few may generate rounding error, floating overflow, or floating underflow, or induce integer overflow. Details are given in the description of the CVT instructions.
The following move-type instructions are always exact: MOV, NEG, CLR, CMP, and TST. The ACB (Add Compare and Branch) instruction is subject to rounding errors, overflow, and underflow.
All of the floating-point instructions on the VAX architecture fault if
they encounter a reserved operand. Floating-point instructions also
fault on the occurrence of floating overflow or divide by zero, and the
condition codes are UNPREDICTABLE. The FU bit in the processor status
word (PSW) is available to enable or disable an exception on underflow.
If the FU bit is clear, no exception occurs on underflow and zero is
returned as the result. If the FU bit is set, a fault occurs on
underflow. Further details on the actions taken if any of these
exceptions occurs are included in the descriptions of the instructions
and discussed in Appendix E.
9.2.8.3 Accuracy
This section discusses general comments on the accuracy of the VAX floating-point instruction set. The descriptions of the individual instructions may include additional details on their accuracy.
An instruction is defined to be exact if its result, extended on the right by an infinite sequence of zeros, is identical to that of an infinite precision calculation involving the same operands. The prior accuracy of the operands is ignored. For all arithmetic operations except DIV, a zero operand implies that the instruction is exact. The instruction is exact for DIV if the 0 operand is the dividend. If the 0 operand is the divisor, division is undefined and the instruction faults.
For nonzero floating-point operands, the fractional factor is binary normalized with 24 or 56 bits for single-precision (F_floating) or double-precision (D_floating), respectively; and 53 or 113 bits for extended-range double-precision (G_floating), and extended-range quadruple-precision (H_floating), respectively. The ADD, SUB, MUL, and DIV instructions require an overflow bit (on the left) and two guard bits (on the right) to guarantee the return of a rounded result identical to the corresponding infinite precision operation rounded to the specified word length. With these two guard bits, a rounded result has an error bound of 1/2 LSB (least significant bit).
Note that an arithmetic result is exact if no nonzero bits are lost in chopping the infinite precision result to the data length to be stored. Chopping is defined to mean that the 24 (F_floating), 56 (D_floating), 53 (G_floating), or 113 (H_floating) high-order bits of the normalized fractional factor of a result are stored; the rest of the bits are discarded. The first bit lost in chopping is referred to as the "rounding" bit. The value of a rounded result is related to the chopped result as follows:
All VAX processors implement rounding to produce results identical to the results produced by the following algorithm: add a 1 to the rounding bit and propagate the carry, if it occurs. Note that a renormalization may be required after rounding takes place. If this occurs, the new rounding bit will be 0; therefore, it can occur only once. The following statements summarize the relations among chopped, rounded, and true (infinite precision) results:
The following instructions are described in this section:
Description and Opcode | Number of Instructions | |
---|---|---|
1. |
Add 2 Operand
ADD{F,D,G,H}2 add.rx, sum.mx |
4 |
2. |
Add 3 Operand
ADD{F,D,G,H}3 add1.rx, add2.rx, sum.wx |
4 |
3. |
Clear
CLR{L=F,Q=D=G,O=H} dst.wx |
3 |
4. |
Compare
CMP{F,D,G,H} src1.rx, src2.rx |
4 |
5. |
Convert
CVT{F,D,G,H}{B,W,L,F,D,G,H} src.rx, dst.wy CVT{B,W,L}{F,D,G,H} src.rx, dst.wy All pairs except FF,DD,GG,HH,DG, and GD |
34 |
6. |
Convert Rounded
CVTR{F,D,G,H}L src.rx, dst.wl |
4 |
7. |
Divide 2 Operand
DIV{F,D,G,H}2 divr.rx, quo.mx |
4 |
8. |
Divide 3 Operand
DIV{F,D,G,H}3 divr.rx, divd.rx, quo.wx |
4 |
9. |
Extended Modulus
EMOD{F,D} mulr.rx, mulrx.rb, muld.rx, int.wl, fract.wx EMOD{G,H} mulr.rx, mulrx.rw, muld.rx, int.wl, fract.wx |
4 |
10. |
Move Negated
MNEG{F,D,G,H} src.rx, dst.wx |
4 |
11. |
Move
MOV{F,D,G,H} src.rx, dst.wx |
4 |
12. |
Multiply 2 Operand
MUL{F,D,G,H}2 mulr.rx, prod.mx |
4 |
13. |
Multiply 3 Operand
MUL{F,D,G,H}3 mulr.rx, muld.rx, prod.wx |
4 |
14. |
Polynomial Evaluation F_floating
POLYF arg.rf, degree.rw, tbladdr.ab, {R0-3.wl} |
1 |
15. |
Polynomial Evaluation D_floating
POLYD arg.rd, degree.rw, tbladdr.ab, {R0-5.wl} |
1 |
16. |
Polynomial Evaluation G_floating
POLYG arg.rg, degree.rw, tbladdr.ab, {R0-5.wl} |
1 |
17. |
Polynomial Evaluation H_floating
POLYH arg.rh, degree.rw, tbladdr.ab, {R0-5.wl,-16(SP):-1(SP).wb} |
1 |
18. |
Subtract 2 Operand
SUB{F,D,G,H}2 sub.rx, dif.mx |
4 |
19. |
Subtract 3 Operand
SUB{F,D,G,H}3 sub.rx, min.rx, dif.wx |
4 |
20. |
Test
TST{F,D,G,H} src.rx |
4 |
The following floating-point instructions are described in Section 9.2.4.
Description and Opcode | Number of Instructions | |
---|---|---|
1. |
Add Compare and Branch
ACB{F,D,G,H} limit.rx, add.rx, index.mx, displ.bw |
4 |
Compare is LE on positive add, GE on
negative add. |
Add
2operand: opcode add.rx, sum.mx
3operand: opcode add1.rx, add2.rx, sum.wx
N|| <--- sum LSS 0; | |
Z|| <--- sum EQL 0; | |
V|| <--- 0; | |
C|| <--- 0; |
40 | ADDF2 | Add F_floating 2 Operand |
41 | ADDF3 | Add F_floating 3 Operand |
60 | ADDD2 | Add D_floating 2 Operand |
61 | ADDD3 | Add D_floating 3 Operand |
40FD | ADDG2 | Add G_floating 2 Operand |
41FD | ADDG3 | Add G_floating 3 Operand |
60FD | ADDH2 | Add H_floating 2 Operand |
61FD | ADDH3 | Add H_floating 3 Operand |
In 2 operand format, the addend operand is added to the sum operand, and the sum operand is replaced by the rounded result. In 3 operand format, the addend 1 operand is added to the addend 2 operand, and the sum operand is replaced by the rounded result.
Clear
opcode dst.wx
N|| <--- 0; | |
Z|| <--- 1; | |
V|| <--- 0; | |
C|| <--- C; |
D4 | CLRF | Clear F_floating |
7C | CLRD | Clear D_floating, |
CLRG | Clear G_floating | |
7CFD | CLRH | Clear H_floating |
The destination operand is replaced by zero.
CLRx dst is equivalent to MOVx S^#0, dst, but is 1 byte shorter.
Previous | Next | Contents | Index |
privacy and legal statement | ||
4515PRO_023.HTML |