[Dwarf-Discuss] Vector base types...

Daniel Jacobowitz drow@false.org
Mon Nov 7 00:09:20 GMT 2011

On Mon, Oct 31, 2011 at 2:59 PM, Michael Eager <eager at eagercon.com> wrote:
> On 10/31/2011 11:44 AM, Relph, Richard wrote:
>> ?In memory, there are alignment restrictions that apply to float16
>> that don't apply to an array of floats. The required alignment of the latter is the same as for
>> float (4 bytes), while the alignment of the former could be as bad as the size of a single
>> float16 (64 bytes).
> Allocation restrictions are usually only known to the compiler and not represented in DWARF.

There are also calling convention differences.  That's the main thing
GDB uses the flag for - e.g. a vector int might be passed in an
Altivec register instead of as an address.

> > Other than that, no differences that I can think of. The debugger is looking
>> for a way (short of name recognition) to know which access methods apply to a variable...
>> DW_AT_GNU_vector may be an interesting 'flag' to differentiate an array from a vector. Does the
>> value mean anything? I tried googling it, but haven't stumbled across the answer to that just
>> yet.

I think it's just a flag attribute.

>> -----Original Message----- From: Michael Eager [mailto:eager at eagercon.com] Sent: Monday, October
>> 31, 2011 11:18 AM To: Relph, Richard Cc: dwarf-discuss at lists.dwarfstd.org Subject: Re:
>> [Dwarf-Discuss] Vector base types...
>> On 10/31/2011 10:30 AM, Relph, Richard wrote:
>>> Is there a convention for representing vector base types in a language?
>>> Our language (OpenCL) has 2, 3, 4, 8, and 16 element vectors of each of the normal C base types
>>> and we?re currently representing them in an ad hoc way. We?d like to follow whatever convention
>>> exists for doing this, but we haven?t figured out what that is. Setting DW_AT_byte_size to the
>>> size of one element begs the question of how many, and setting it to the size of the type
>>> itself is ambiguous (unless you peek at the name? which we are resisting, though perhaps that
>>> ?right way?.) A char4, short2, and int all have 4 bytes and the same encoding.
>> Is there a functional difference between an array and a vector?
> --
> Michael Eager ? ?eager at eagercon.com
> 1960 Park Blvd., Palo Alto, CA 94306 ?650-325-8077
> _______________________________________________
> Dwarf-Discuss mailing list
> Dwarf-Discuss at lists.dwarfstd.org
> http://lists.dwarfstd.org/listinfo.cgi/dwarf-discuss-dwarfstd.org


More information about the Dwarf-discuss mailing list