[OpenVMS documentation]
[Site home] [Send comments] [Help with this site] [How to order documentation] [OpenVMS site] [Compaq site]
Updated: 11 December 1998

OpenVMS Debugger Manual


Previous Contents Index

16.3.5 Examining and Depositing into the Vector Registers (V0 to V15)

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 16.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 16.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

16.4 Examining and Depositing Vector Instructions

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

16.4.1 Examining Vector Instructions and Their Operands

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:

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:

  1. The EXAMINE/OPERANDS command shows that a VLDL instruction is about to be executed. The instruction will load longword-integer data from array ARR, starting at ARR+8 bytes, into register V0, as shown in Figure 16-1. Figure 16-1 shows the contents of V0 after the instruction has been executed. Array ARR is indexed 1 to n, not 0 to n--1 (Fortran example).
  2. The stride value (#4) of the VLDL instruction specifies the number of bytes between the start addresses of array elements.
  3. The instruction operand ARR+8 denotes the start of array element 3, ARR(3). The EXAMINE/OPERANDS command displays only the first element of array ARR that is operated upon (see item ).
  4. The current values of VLR and VMR will cause the VLDL instruction to load the contents of array elements ARR(3), ARR(5), and ARR(7) into register elements V0(0), V0(2), and V0(4), respectively. The EXAMINE/OPERANDS command shows the contents of V0 before the instruction has been executed.
  5. For reference, the EXAMINE ARR(1:8) command displays the full range of array elements that are associated with the load operation.

Figure 16-1 Masked Loading of Array Elements from Memory into a Vector Register


16.4.2 Depositing Vector Instructions

The techniques for depositing VAX scalar instructions also apply to depositing vector instructions (see Section 4.3.2). For example, the following command deposits a masked VVMULF vector instruction at the current PC address:


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):

16.5 Using a Mask When Examining Vector Registers or Instructions

Section 16.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:

16.5.1 Using VMR as the Default Mask

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>

16.5.2 Using a Slice of VMR as the Mask

If you specify a slice of VMR with the EXAMINE/TMASK or EXAMINE/FMASK command, the output is displayed according to the following conventions:

16.5.3 Using a Mask Other Than VMR

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:


Previous Next Contents Index

[Site home] [Send comments] [Help with this site] [How to order documentation] [OpenVMS site] [Compaq site]
[OpenVMS documentation]

Copyright © Compaq Computer Corporation 1998. All rights reserved.

Legal
4538PRO_033.HTML