From drow@false.org  Mon Nov  7 00:09:20 2011
From: drow@false.org (Daniel Jacobowitz)
Date: Sun, 6 Nov 2011 19:09:20 -0500
Subject: [Dwarf-Discuss] Vector base types...
In-Reply-To: <4EAEF006.9070406@eagercon.com>
References: <7691DC9FC60C9E4F88A0BBCA628F55FF0540B3958A@sausexmbp02.amd.com>
	<4EAEE64F.4080504@eagercon.com>
	<7691DC9FC60C9E4F88A0BBCA628F55FF0540B39637@sausexmbp02.amd.com>
	<4EAEF006.9070406@eagercon.com>
Message-ID: <CAN9gPaHnHeGeoef+Ngbdvy-fqhOYmTUu3wywSVC_VkyupE44=Q@mail.gmail.com>

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



--
Thanks,
Daniel



