DWARF Standard


HOME
SPECIFICATIONS
FAQ
ISSUES



201007.1 Markus Metzger Wide Registers in Location Description Expressions Enhancement Open


Section 2.5.1.3, pg 29
Some architectures support registers that are wider than the DWARF stack.
Compilers may choose to store a vector of values in those registers that are
relevant for describing the location of objects, such as base addresses or
offsets from a common base address.

To support extracting those values from such wide registers and using them in
location expressions, we propose adding a family of opcodes that operate similar
to the existing `DW_OP_piece` and `DW_OP_bit_piece` operators.  Instead of
defining parts of a composite location, however, they read the piece's value and
push it onto the DWARF stack.

We further propose similar operators for extensions of piece operators that
expect their arguments on the DWARF stack that were proposed in
[http://dwarfstd.org/ShowIssue.php?issue=200720.1].

Architectures supporting SIMD (Single Instruction Multiple Data) may find even
their wide registers not wide enough for storing addresses or offsets for all
SIMD lanes.  Compilers would typically choose to allocate the vector across
adjacent registers.

The base register is no longer fixed in this case; it depends on the SIMD lane.
While producers may encode this using control-flow operations, the resulting
expressions tend to get big and complicated.  We propose a new operator that
behaves similar to `DW_OP_regx` but that takes its argument register number from
the DWARF stack.

===

Section 2.5.1.3, pg. 29ff.

Add

    16. DW_OP_push_piece

        The DW_OP_push_piece operation takes a single operand, which is a 1-byte
        unsigned value that defines the size in bytes.  The size must not exceed
        the size of the generic type.

        It pops the top stack element, which must be a simple location
        description, reads size bytes from that location, and pushes the value
        onto the stack.

    17. DW_OP_push_bit_piece

        The DW_OP_push_bit_piece operation takes two operands.  The first
        operand is a 1-byte unsigned value that defines the size in bits, which
        must not exceed the size of the generic type.  The second operand is a
        ULEB128 number that gives the offset in bits.

        It pops the top stack element, which must be a simple location
        description, reads size bits from that location starting at offset, and
        pushes the value onto the stack.

    18. DW_OP_push_piece_stack

        The DW_OP_push_piece_stack operation works similar to DW_OP_push_piece
        except that it takes its argument from the DWARF stack.

    19. DW_OP_push_bit_piece_stack

        The DW_OP_push_bit_piece_stack operation works similar to
        DW_OP_push_bit_piece except that it takes its arguments from the DWARF
        stack.

        The first argument, the size in bits of the piece, is taken from the top
        of the stack.  The second argument, the offset in bits from the location
        defined by the preceding DWARF location description, is taken from the
        second stack location.

        Both arguments are popped from the DWARF stack.


Section 2.6.1.1.3, pg. 39f.

Add

    2. DW_OP_regs

       The DW_OP_regs operation pops the top stack element and interprets it as
       register number.




All logos and trademarks in this site are property of their respective owner.
The comments are property of their posters, all the rest © 2007-2020 by DWARF Standards Committee.