On Tue, Oct 07, 2025 at 06:55:25PM +0000, Tamar Christina wrote:
> > ...
> >
> > In general we should produce DWARF based on the type, not the mode.  It’s
> > supposed to map to the source, not the target.  The layout of a svebool is 
> > the
> > same with or without SVE enabled, no?
> 
> You're right, the svbool_t specifically is always registered with VNx16BI, so
> It'll always be single bit precision.  So in that regard Yury's patch is 
> correct if we
> only ever put out DWARF for svbool_t.
> 
> I however don't know what the expected experience here is.
> 
> Consider:
> 
> #include <arm_sve.h>
> 
> svbool_t f8 ()
> {
>   return svptrue_b8 ();
> }
> 
> svbool_t f16 ()
> {
>   return svptrue_b16 ();
> }
> 
> The first one has every bit significant, and the second one it's every 2nd 
> bit.
> But with DW_AT_bit_stride = 1, I'm not sure how a user in GDB is able to tell
> If the register values belong to a predicate where every other lane is 
> inactive
> or one where every entry is active.

The way I understand it is that DWARF would have information about svbool_t type
only. A variable of this type (i.e. a predicate) would have different meaning
depending on what type it is applied to. A pattern like

1 0 0 0 1 0 0 0 .. 0

might mean

{ true, true, false, ... }

for svuint32_t, but it would mean

{ true, false, true, false, true, false ... }

for svuint16_t. So, as far as the *type* is concerned, using stride of 1 bit
makes sense to me.

Thanks,
Yury

Reply via email to