Compaq ECQD2KCTE manual Trap Barrier, Trapb

Models: ECQD2KCTE

1 371
Download 371 pages 20.35 Kb
Page 200
Image 200

4.11.9 Trap Barrier

Format:

TRAPB

!Memory format

Operation:

{TRAPB does not appear to issue until all prior instructions

are guaranteed to complete without causing any arithmetic traps}.

Exceptions:

None

Instruction mnemonics:

TRAPB

Trap Barrier

Qualifiers:

None

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.

4–144Alpha Architecture Handbook

Page 200
Image 200
Compaq ECQD2KCTE manual Trap Barrier, Trapb