[Dwarf-Discuss] Representing the location of smaller values in vector registers

Michael Eager eager at eagercon.com
Wed Mar 9 11:20:38 PST 2016

On 03/09/2016 10:00 AM, David Blaikie wrote:
> On Wed, Mar 9, 2016 at 9:57 AM, Michael Eager <eager at eagercon.com <mailto:eager at eagercon.com>> wrote:
>     On 03/09/2016 09:33 AM, Jakub Jelinek wrote:
>         On Wed, Mar 09, 2016 at 08:36:44AM -0800, Michael Eager wrote:
>             How is the "float" type described?
>             A value which is contained in a register larger than the size of
>             the value should be described by a DW_TAG_base_type.  (DWARF 4,
>             Sect. 5.1, bottom of page 75).
>             For a 32-bit float in a 128-bit container, use something like the following:
>                 DW_TAG_base_type
>                   DW_AT_name "float"
>                   DW_AT_encoding DW_ATE_float
>                   DW_AT_byte_size 16
>                   DW_AT_bit_size 32
>                   DW_AT_data_bit_offset 0
>             Note that there is no requirement that the names on base types
>             be unique.  There may be more than one with the name "float".
>         I don't think this can really work.  A particular variable (etc., whatever
>         has type) can have just one type, while whether it lives in a larger
>         container or not really depends on where the value lives.
>         The same variable could live in one .debug_loc range in memory
>         (where it certainly can't pretend it lives in a larger container, because it
>         does not, it is 32-bit there), or when in some other range it lives in
>         a general purpose register (which can be 32-bit or 64-bit and either fits in
>         there exactly, or is passed in the low bits of that), or in %xmm* register
>         (128-bit container, but, actually sometimes 256-bit and other times 512-bit
>         container).  I'd say LLDB is just broken to complain about this.  The ABI
>         specifies what it means when a float lives in memory, or in GPRs, or in
>         XMM/YMM/ZMM registers.
>     My comment was based on the DWARF in Adrian's email, which describes
>     a 32-bit floating point variable allocated to a 128-bit register.  Adrian's
>     DWARF doesn't describe a 32-bit variable in memory which is loaded into a
>     larger register during the course of expression evaluation, which would
>     be described by a location list.
>     A 32-variable stored in a 32-bit memory location may have a location list
>     which specifies that the value may be found in particular registers (either
>     larger or smaller) during it's lifetime.  That would be a different description
>     in DWARF.
> Why would it be useful to say that an entry in a location list cannot always be used as a direct
> location for a variable? (what if the location list only includes registers - should the type then
> be changed to the representation you're suggesting? That seems awkward for producers and doesn't
> seem to help consumers)

I didn't say that.

Variable definitions describe where the variable is defined.
If the size of the variable is different from the size of
the container, it should be described as such.

This has nothing to do with location lists.

Michael Eager	 eager at eagercon.com
1960 Park Blvd., Palo Alto, CA 94306  650-325-8077

More information about the Dwarf-Discuss mailing list