Updated: 11 December 1998 |
VAX MACRO and Instruction Set Reference Manual
Previous | Contents | Index |
Insert Entry into Queue at Tail, Interlocked
opcode entry.ab, header.aq
if {insertion succeeded} then | |
begin | |
N <--- 0; | |
Z <--- (entry) EQL (entry+4); ! First entry in queue | |
V <--- 0; | |
C <--- 0; | |
end; | |
else | |
begin | |
N <--- 0; | |
Z <--- 0; | |
V <--- 0; | |
C <--- 1; ! Secondary interlock failed | |
end; |
5D | INSQTI | Insert Entry into Queue at Tail, Interlocked |
The entry specified by the entry operand is inserted into the queue preceding the header. If the entry inserted was the first one in the queue, the condition code Z-bit is set; otherwise, it is cleared. The insertion is a noninterruptible operation. The insertion is interlocked to prevent concurrent interlocked insertions or removals at the head or tail of the same queue by another process even in a multiprocessor environment. Before performing any part of the operation, the processor validates that the entire operation can be completed. This method ensures that if a memory management exception occurs (see Appendix E), queue is left in a consistent state. If the instruction fails to acquire the secondary interlock, then, if no exception conditions exist, the instruction sets condition codes and terminates.
Notes
INSERT: INSQHI ... ; Was queue empty? BEQL 1$ ; Yes BCS INSERT ; Try inserting again CALL WAIT(...) ; No, wait 1$: |
Insert Entry in Queue
opcode entry.ab, pred.ab
N||<--- (entry) LSS (entry+4); | |
Z||<--- (entry) EQL (entry+4); ! First entry in queue | |
V||<--- 0; | |
C||<--- (entry) LSSU (entry+4); |
0E | INSQUE | Insert Entry in Queue |
The entry specified by the entry operand is inserted into the queue following the entry specified by the predecessor operand. If the entry inserted was the first one in the queue, the condition code Z-bit is set; otherwise it is cleared. The insertion is a noninterruptible operation. Before performing any part of the operation, the processor validates that the entire operation can be completed. This method ensures that if a memory management exception occurs (see Appendix E), the queue is left in a consistent state.
Notes
INSQUE entry, h ; h is queue head |
INSQUE entry,@h+4 ; h is queue head (Note "@" in this case only) |
INSQUE entry,p ; p is predecessor |
INSQUE ... ; Was queue empty? BEQL 1$ ; Yes CALL WAIT(...) ; No, wait 1$: |
Remove Entry from Queue at Head, Interlocked
opcode header.aq, addr.wl
if {removal succeeded} then | |
begin | |
N <--- 0; | |
Z <--- (header) EQL 0; ! Queue empty after removal | |
V <--- {queue empty before this instruction}; | |
C <--- 0; | |
end; | |
else | |
begin | |
N <--- 0; | |
Z <--- 0; | |
V <--- 1; ! Did not remove anything | |
C <--- 1; ! Secondary interlock failed | |
end; |
5E | REMQHI | Remove Entry from Queue at Head, Interlocked |
If the secondary interlock is clear, the queue entry following the header is removed from the queue and the address operand is replaced by the address of the entry removed. If the queue was empty prior to this instruction, or if the secondary interlock failed, the condition code V-bit is set; otherwise it is cleared.If the interlock succeeded and the queue is empty at the end of this instruction, the condition code Z-bit is set; otherwise, it is cleared. The removal is interlocked to prevent concurrent interlocked insertions or removals at the head or tail of the same queue by another process even in a multiprocessor environment. 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. If the instruction fails to acquire the secondary interlock, then, if no exception conditions exist, the instruction sets condition codes and terminates.
Notes
1$: REMQHI ... ; Removed last? BEQL 2$ ; Yes BCS 1$ ; Try removing again CALL ACTIVATE(...) ; Activate other waiters 2$: |
1$: REMQHI ... ; Anything removed? BVS 2$ ; No . process removed entry . BR 1$ ; . 2$ BCS 1$ ; Try removing again queue empty |
Remove Entry from Queue at Tail, Interlocked
opcode header.aq, addr.wl
if {removal succeeded} then | |
begin | |
N <--- 0; | |
Z <--- (header + 4) EQL 0; ! Queue empty after removal | |
V <--- {queue empty before this instruction}; | |
C <--- 0; | |
end; | |
else | |
begin | |
N <--- 0; | |
Z <--- 0; | |
V <--- 1; ! Did not remove anything | |
C <--- 1; ! Secondary interlock failed | |
end; |
5F | REMQTI | Remove Entry from Queue at Tail, Interlocked |
If the secondary interlock is clear, the queue entry preceding the header is removed from the queue and the address operand is replaced by the address of the entry removed. If the queue was empty prior to this instruction, or if the secondary interlock failed, the condition code V-bit is set; otherwise it is cleared.If the interlock succeeded and the queue is empty at the end of this instruction, the condition code Z-bit is set; otherwise it is cleared. The removal is interlocked to prevent concurrent interlocked insertions or removals at the head or tail of the same queue by another process, even in a multiprocessor environment. 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. If the instruction fails to acquire the secondary interlock, then, if no exception conditions exist, the instruction sets condition codes and terminates.
Notes
1$: REMQTI ... ; Removed last? BEQL 2$ ; Yes BCS 1$ ; Try removing again CALL ACTIVATE(...) ; Activate other waiters 2$: |
1$: REMQTI ... ; Anything removed? BVS 2$ ; No . process removed entry . BR 1$ ; . 2$: BCS 1$ ; Try removing again queue empty |
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.
Notes
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:
Previous | Next | Contents | Index |
Copyright © Compaq Computer Corporation 1998. All rights reserved. Legal |
4515PRO_022.HTML
|