Compaq ECQD2KCTE Laptop User Manual


 
4–144 Alpha Architecture Handbook
4.11.9 Trap Barrier
Format:
Operation:
{TRAPB does not appear to issue until all prior instructions
are guaranteed to complete without causing any arithmetic traps}.
Exceptions:
Instruction mnemonics:
Qualifiers:
Description:
The TRAPB instruction allows software to guarantee that in a pipelined implementation, all
previous arithmetic instructions will complete without incurring any arithmetic traps before the
TRAPB or any instructions after it are issued.
If an arithmetic exception occurs for which trapping is enabled, the TRAPB instruction acts
like a fault. In this case, the value of the Program Counter reported to the program may be the
address of the TRAPB instruction (or earlier) but is never the address of the instruction follow-
ing the TRAPB.
This fault behavior by TRAPB allows software, using one TRAPB instruction for each excep-
tion domain, to isolate the address range in which an exception occurs. If the address of the
instruction following the TRAPB were allowed, there would be no way to distinguish an
exception in the address range preceding a label from an exception in the range that includes
the label along with the faulting instruction and a branch back to the label. This case arises
when the code is not following exception completion rules but is inserting TRAPB instruc-
tions to isolate exceptions to the proper scope.
Use of TRAPB should be compared with use of the EXCB instruction; see Section 4.11.4.
TRAPB
!Memory format
None
TRAPB Trap Barrier
None