Masked operations are explained in Section 15.4.1 and Section 15.5. This section describes how to display and change the value of VMR.
To examine one or more specific elements (bits) of VMR, use the same technique that you use to examine an array variable. (See Section 4.2.3.)
For example, the output of the following command shows that bit 5 of VMR is set (Fortran array syntax):
DBG> EXAMINE %VMR(5) 0\%VMR(5): 1 DBG>
The following command displays the values of bits 4 to 6 of VMR. Bits 4 and 5 are set, and bit 6 is clear:
DBG> EXAMINE %VMR(4:6) 0\%VMR (4): 1 (5): 1 (6): 0 DBG>
By default, when you examine VMR without specifying subscripts, the debugger displays the value of the register as a quadword integer in hexadecimal format to reduce the size of the output display. For example:
DBG> EXAMINE %VMR 0\%VMR (0): 0FFFFFFF FFFFFFFF DBG>
By specifying the EXAMINE/BIN %VMR or EXAMINE %VMR(0:63) command, you can display the value of each bit of VMR in a 64-row array format.
As with an array variable, you can deposit a value into one bit of VMR at a time. For example:
DBG> EXAMINE %VMR(37) 0\%VMR(37): 1 DBG> DEPOSIT %VMR(37) = 0 DBG> EXAMINE %VMR(37) 0\%VMR(37): 0 DBG>
You can also deposit a quadword integer value into the entire aggregate by using the DEPOSIT/QUADWORD command. For example:
DBG> DEPOSIT/QUADWORD %VMR = %HEX 0FFFFF DBG> EXAMINE %VMR 0\%VMR (0): 00000000 000FFFFF DBG>
When specifying an element of VMR in a language expression, remember that VMR is an array of bits. You might have to temporarily set the language to one that allows bit operations, such as C or BLISS. For example:
DBG> SET LANGUAGE C DBG> DEFINE/VALUE K = 0 DBG> FOR I=0 TO 63 DO (IF %VMR[I] == 1 THEN (DEF/VAL K = K + 1))
There are 16 vector registers, designated V0 to V15. Each of the vector registers has 64 elements, numbered 0 to 63, and each element has 64 bits (one quadword).
To examine one or more elements of a vector register, use the same technique that you use to examine an array variable. (See Section 4.2.3.) The examples in this section use Fortran array syntax:
DBG> EXAMINE %V3 !Examine all elements of V3 DBG> EXAMINE %V3(27) !Examine element 27 of V3 DBG> EXAMINE %V3(3:14) !Examine elements 3 to 14 of V3 DBG> EXAMINE %V0(2),%V3(1:4) !Examine element 2 of V0 and !elements 1 to 4 of V3
The values of register elements are displayed in an indexed format similar to that used for an array variable. For example, the following command displays the values of elements 1 to 3 of register V1:
DBG> EXAMINE %V1(1:3) 0\%V1 (1): 3 (2): 138 (3): 51 DBG>
You cannot examine a range of vector registers. For example, the following commands are invalid:
DBG> EXAMINE %V0:%V3 DBG> EXAMINE %V2(7):%V3(12)
As with an array variable, you can deposit a value into only one element of a vector register at a time. For example, the following command deposits the integer value 8531 into element 9 of V0:
DBG> DEPOSIT %V0(9) = 8531
The current value of the vector length register (VLR) limits the highest register element that you can examine or deposit into. (See Section 15.3.3.) Therefore, the following commands are equivalent:
DBG> EXAMINE %V1 DBG> EXAMINE %V1(0:%VLR-1)
The expression 0:%VLR--1 specifies the range of register elements that are denoted by the current value of VLR.
By default, the debugger treats each element of a vector register as a longword integer and displays the value in the current radix. For example:
DBG> EXAMINE %V3(27) 0\%V3(27): 5983 DBG> DEPOSIT %V3(27) = 3625 DBG> EXAMINE %V3(27) 0\%V3(27): 3625 DBG>
However, note that a register value that is examined in the context of a vector instruction (that is, as an instruction operand) is displayed in the data type that is appropriate for the instruction (see Section 15.4.1.
To display the full (quadword) value of an element of a vector register as a quadword integer, use the EXAMINE/QUADWORD command. Similarly, to deposit a quadword integer value into a register element, use the command DEPOSIT/QUADWORD.
You can also use any of the other type qualifiers associated with the EXAMINE and DEPOSIT commands (for example, /FLOAT) to override the default type. For example:
DBG> EXAMINE %V5(2) 0\%V5(2): 0 DBG> EXAMINE/D_FLOAT %V5(2) 0\%V5(2): 0.0000000000000000 DBG>
You can use register symbols in language expressions subject to the restrictions on using aggregate data structures in language expressions. (See Section 4.1.6.1.) For example, the following expression is valid (Fortran syntax):
DBG> EVALUATE %V0(4) .EQ. %V1(4)
However, the following expression is not valid because more than one register element is specified:
DBG> EVALUATE %V0 .EQ. %V1
The techniques for manipulating vector instructions include all of those used for scalar instructions (described in Section 4.3) and additional techniques specific to vector instructions:
Whether you are examining or depositing vector instructions, the debugger correctly processes the vector instruction qualifiers according to the instructions to which they apply. The following table summarizes the functions of these qualifiers. See the OpenVMS MACRO and Instruction Set Reference Manual for complete information about their use.
Instruction Qualifier | Description |
---|---|
/U | Enable floating underflow (vector floating-point instructions) |
/V | Enable integer overflow (vector integer instructions) |
/M | Modify intent (VLD x and VGATH x instructions) |
/0 | Perform masked operations only on elements for which the VMR bit is 0 |
/1 | Perform masked operations only on elements for which the VMR bit is 1 |
When you examine a program location that contains a vector instruction, the debugger decodes that instruction and translates it and its operands into their MACRO assembler form with the following restrictions (see the OpenVMS MACRO and Instruction Set Reference Manual for details about instruction opcodes):
The command EXAMINE/OPERANDS .%PC enables you to display the instruction at the current PC value and its operands. (See Section 4.3.1.) When you examine a vector instruction with this command, the values of any vector register operands are displayed as for an array variable. For example (Fortran array syntax):
DBG> EXAMINE/OPERANDS .%PC PROG$MAIN\%LINE 81+19: VSTL V0,W^-572(FP),S^#4 V0 contains: 0\%V0(0): 137445504 0\%V0(1): 137445504 0\%V0(2): 137445504 W^-572(FP) 2145991456 contains 2 DBG>
As with scalar instructions, operand values are displayed in the data type that is appropriate for the examined instruction.
When you use the EXAMINE/OPERANDS command, the display of register elements depends on the following factors:
VVADDF/1 V0,V1,V2
These concepts are shown in the following two examples, which show an unmasked and a masked register-to-register operation, respectively.
In this example, the examined instruction, VVADDF, is performing an unmasked operation so that the current value of VMR is irrelevant. All elements from 0 to 5 are displayed.
DBG> EXAMINE %VLR 0\%VLR: 6 DBG> EXAMINE %VMR(0:5) 0\%VMR (0): 1 (1): 0 (2): 1 (3): 0 (4): 1 (5): 0 DBG> EXAMINE/OPERANDS .%PC PROG$MAIN\%LINE 12: VVADDF V0,V1,V2 V0 contains: 0\%V0(0): 7.0000000 0\%V0(1): 7.0000000 . . 0\%V0(5): 7.0000000 V1 contains: 0\%V1(0): 4.0000000 0\%V1(1): 4.0000000 . . 0\%V1(5): 4.0000000 V2 contains: 0\%V2(0): 5.0000000 0\%V2(1): 5.0000000 . . 0\%V2(5): 5.0000000 DBG>
In the next example, the same VVADDF instruction is performing a masked operation. The instruction qualifier /1 specifies that elements that match the set bits (bit value 1) in VMR are operated on.
DBG> EXAMINE %VLR 0\%VLR: 6 DBG> EXAMINE %VMR(0:5) 0\%VMR (0): 1 (1): 0 (2): 1 (3): 0 (4): 1 (5): 0 DBG> EXAMINE/OPERANDS .%PC PROG$MAIN\%LINE 12: VVADDF/1 V0,V1,V2 V0 contains: 0\%V0(0): 7.0000000 0\%V0(2): 7.0000000 0\%V0(4): 7.0000000 V1 contains: 0\%V0(0): 4.0000000 0\%V0(2): 4.0000000 0\%V0(4): 4.0000000 V2 contains: 0\%V0(0): 5.0000000 0\%V0(2): 5.0000000 0\%V0(4): 5.0000000 DBG>
The next example shows a masked operation that loads data from memory to a vector register. Comments, keyed to the callouts, follow the example.
DBG> EXAMINE %VLR 0\%VLR: 6 DBG> EXAMINE %VMR(0:5) 0\%VMR (0): 1 (1): 0 (2): 1 (3): 0 (4): 1 (5): 0 DBG> EXAMINE/OPERANDS .%PC (1) PROG$MAIN\%LINE 31+12: VLDL/1 ARR+8,#4,V0 (2) PROG$MAIN\ARR(3) (address 1024) contains 35 (3) V0 contains: 0\%V0(0): 0 (4) 0\%V0(2): 0 0\%V0(4): 0 DBG> EXAMINE ARR(1:8) (5) PROG$MAIN\ARR (1): 9 (2): 17 (3): 35 (4): 73 (5): 81 (6): 6 (7): 7 (8): 49 DBG>
The following comments refer to the callouts in the previous example:
Figure 15-1 Masked Loading of Array Elements from Memory into a Vector Register
DBG> DEPOSIT/INSTRUCTION .%PC = "VVMULF/0 V2,V3,V7"
Note the following information when depositing vector instructions (see the OpenVMS MACRO and Instruction Set Reference Manual for details about instruction opcodes):
Section 15.4.1 explains how the command EXAMINE/OPERANDS .%PC displays vector instruction operands, depending on whether or not the operation is masked by the vector mask register (VMR).
This section explains how to specify an arbitrary mask in order to simulate or override the effect of VMR and obtain the following results:
You specify a mask by using the /TMASK or /FMASK qualifier with the EXAMINE command.
Note
The remainder of this section describes use of the /TMASK and /FMASK qualifiers when examining vector registers. Unless indicated otherwise, the discussion also applies to use of these qualifiers when examining memory arrays.
The /TMASK qualifier applies the EXAMINE command only to the elements of the examined register that correspond to the set bits (bit value: 1) of the mask. The /FMASK qualifier applies the EXAMINE command only to the elements that correspond to the clear bits (bit value: 0) of the mask.
The current value of VLR limits the highest element of a vector register that you can examine. However, the value of VLR does not affect examining an array in memory.
You can optionally specify a mask (in the form of a mask address expression) with the /TMASK and /FMASK qualifiers. For more information:
By default, if you do not specify a mask with the EXAMINE/TMASK or EXAMINE/FMASK command, VMR is used as the mask. That is, the EXAMINE command is applied only to the elements of the vector register that correspond to the set bits (in the case of /TMASK) or clear bits (in the case of /FMASK) of VMR.
In the following examples, VLR has the value 6 and VMR(0:VLR--1) has the following set of values:
DBG> EXAMINE %VMR(0:%VLR-1) 0\%VMR (0): 1 (1): 0 (2): 1 (3): 0 (4): 1 (5): 0 DBG>
The following command displays the value of V3 without using a mask. All elements of V3 from 0 to VLR--1 are displayed:
DBG> EXAMINE %V3 0\%V3 (0): 17 (1): 138 (2): 3 (3): 9 (4): 51 (5): 252 DBG>
The following command displays the elements of V3 (in the range from 0 to VLR--1) for which VMR(i) has the value 1:
DBG> EXAMINE/TMASK %V3 0\%V3 (0): 17 (2): 3 (4): 51 DBG>
The following command displays the elements of V3 (in the range from 0 to VLR--1) for which VMR(i) has the value 0:
DBG> EXAMINE/FMASK %V3 0\%V3 (1): 138 (3): 9 (5): 252 DBG>
In the following example, the /FMASK qualifier is used when examining an instruction and its vector-register operands. The EXAMINE/OPERANDS/FMASK command displays the register-operand elements (in the range from 0 to VLR--1) for which VMR(i) has the value 0:
DBG> EXAMINE/OPERANDS/FMASK .%PC PROG$MAIN\%LINE 341+16: VVEQLL V0,V1 V0 contains: 0\%V0(1): 0 0\%V0(3): 0 0\%V0(5): 0 V1 contains: 0\%V1(1): 0 0\%V1(3): 0 0\%V1(5): 0 DBG>
If you specify a slice of VMR with the EXAMINE/TMASK or EXAMINE/FMASK command, the output is displayed according to the following conventions:
DBG> EXAMINE %VLR 0\%VLR: 12 DBG> EXAMINE %VMR(3:5) 0\%VMR (3): 1 (4): 1 (5): 1 DBG> EXAMINE/TMASK=(%VMR(3:5)) %V0(3:10) 0\%V0 (3): 9 (4): 51 (5): 252 DBG>
DBG> EXAMINE %VLR 0\%VLR: 12 DBG> EXAMINE %VMR(4:7) 0\%VMR (4): 1 (5): 0 (6): 1 (7): 1 DBG> EXAMINE/TMASK=(%VMR(4:7)) %V0(3:10) %DEBUG-I-MASKMISMATCH, mask/target subscripts do not match, displaying mask 0\%V0 %VMR(4): 1 %V0(3): 9 %VMR(6): 1 %V0(5): 252 %VMR(7): 1 %V0(6): 56 DBG>
If you specify a mask address expression other than VMR with the EXAMINE/TMASK or EXAMINE/FMASK command, the value at that address is used as the mask subject to the following conventions:
DBG> EXAMINE %VLR 0\%VLR: 6 DBG> EXAMINE BOOL_ARR PROG$MAIN\BOOL_ARR (0): 0 (1): 0 (2): 1 (3): 0 DBG> EXAMINE/FMASK=(BOOL_ARR) %V0 %DEBUG-I-MASKNOTVMR, mask used is not %VMR, displaying specified mask 0\%V0 BOOL_ARR(0): 0 %V0(0): 17 BOOL_ARR(1): 0 %V0(1): 138 BOOL_ARR(3): 0 %V0(3): 9 DBG>
DBG> EXAMINE BOOL_VAR PROG$MAIN\BOOL_VAR: 1 DBG> EXAMINE/TMASK=(BOOL_VAR) %V0 %DEBUG-I-MASKNOTVMR, mask used is not %VMR, displaying specified mask 0\%V0 BOOL_VAR: 1 %V0(0): 17 DBG>
When using the EXAMINE command, you can specify various forms of composite address expressions---expressions that include byte offsets from a given address. For example, if X is an integer variable, the following EXAMINE command displays the value currently stored at the memory location that is 6 bytes beyond the address of X:
DBG> EXAMINE X + 6 MOD3\X+6: 274903 DBG>
The examples in this section show how to specify composite address expressions of a form that might be appropriate for a vectorized program.
The following example shows how you might verify the effect of a VSCATL instruction. The instructions shown are decoded from a Fortran program.
DBG> EXAMINE %VLR 0\%VLR: 5 DBG> EXAMINE/OPERANDS .%PC (1) PROG1$MAIN\%LINE 9+32: VSCATL V7,W^-804(R11),V9 V7 contains: 0\%V7(0): 11 (2) 0\%V7(1): 13 0\%V7(2): 15 0\%V7(3): 17 0\%V7(4): 19 W^-804(R11)PROG1$MAIN\ARRX(1) (address 1820) contains 0 (3) V9 contains: 0\%V9(0): 0 (4) 0\%V9(1): 8 0\%V9(2): 16 0\%V9(3): 24 0\%V9(4): 32 DBG> SHOW SYMBOL/TYPE ARRX (5) data PROG1$MAIN\ARRX array descriptor type, 1 dimension, bounds: [1:200], size: 800 bytes cell type: atomic type, longword integer, size: 4 bytes DBG> EXAMINE ARRX(1) + .%V9(0:%VLR-1) (6) PROG1$MAIN\ARRX(1): 0 PROG1$MAIN\ARRX(3): 0 PROG1$MAIN\ARRX(5): 0 PROG1$MAIN\ARRX(7): 0 PROG1$MAIN\ARRX(9): 0 DBG> STEP/INSTRUCTION (7) stepped to PROG1$MAIN\%LINE 9+40: MOVZBL I^#64,AP DBG> EXAMINE ARRX(1) + .%V9(0:%VLR-1) (8) PROG1$MAIN\ARRX(1): 11 PROG1$MAIN\ARRX(3): 13 PROG1$MAIN\ARRX(5): 15 PROG1$MAIN\ARRX(7): 17 PROG1$MAIN\ARRX(9): 19 DBG>
The following comments refer to the callouts in the previous example:
The next example shows how to specify a more complex vector address expression with the EXAMINE command.
Assume that array ARRZ has contiguous quadword-integer (8-byte) elements. The fourth EXAMINE command in the example displays the values of vector elements in memory, starting at element ARRZ(1). As in the previous example, the debugger symbolizes the locations of vector elements in terms of the array elements. The location of successive vector elements relative to ARRZ(1) is computed by adding the values contained in registers V1 and V3 to specify a combined offset for a particular element. The order in which vector elements are displayed is determined by cycling through all the values in the last specified register (V3(0:2)) for each value in the first specified register (V1). In this example, the values of all vector elements are 0.
DBG> EXAMINE %VLR 0\%VLR: 4 DBG> EXAMINE %V1 0\%V1 (0): 0 (1): 4 (2): 8 (3): 12 DBG> EXAMINE %V3 0\%V1 (0): 0 (1): 8 (2): 16 (3): 24 DBG> EXAMINE ARRZ(1) + .%V1(0:3) + .%V3(0:2) PROG4$MAIN\ARRZ(1): 0 ! ARRZ(1)+0+0 PROG4$MAIN\ARRZ(2): 0 ! ARRZ(1)+0+8 PROG4$MAIN\ARRZ(3): 0 ! ARRZ(1)+0+16 PROG4$MAIN\ARRZ(1)+4: 0 ! ARRZ(1)+4+0 PROG4$MAIN\ARRZ(2)+4: 0 ! ARRZ(1)+4+8 PROG4$MAIN\ARRZ(3)+4: 0 ! ARRZ(1)+4+16 PROG4$MAIN\ARRZ(2): 0 ! ARRZ(1)+8+0 PROG4$MAIN\ARRZ(3): 0 ! ARRZ(1)+8+8 PROG4$MAIN\ARRZ(4): 0 ! ARRZ(1)+8+16 PROG4$MAIN\ARRZ(2)+4: 0 ! ARRZ(1)+12+0 PROG4$MAIN\ARRZ(3)+4: 0 ! ARRZ(1)+12+8 PROG4$MAIN\ARRZ(4)+4: 0 ! ARRZ(1)+12+16 DBG>
When a vector instruction causes a floating-point exception in a vector element, the exception result is encoded into the corresponding element of the destination register.
4538P025.HTM OSSG Documentation 22-NOV-1996 13:02:09.08
Copyright © Digital Equipment Corporation 1996. All Rights Reserved.