On Thu, Apr 06, 2023 at 07:52:32AM -0400, Ron Brender wrote: > Various thoughts... > > > Not sure if supporting dimensions in the way which is done > > for arrays is needed (I believe vector types are always one-dimensional > > indexed from 0). > > "always"? There are many element by element operations on multidimensional > arrays that might benefit > from use of vector hardware. Why make that an orphaned option?
I'm not aware of any compiler having multi-dimensional vectors. > > And we almost certainly want to allow vectors on DWARF expression stack; > > What is so special about vector types in this regard. What do you have > against values of array or structure types being > on the stack (the latter especially because they are often/mostly passed by > value in many languages, even C)? > I don't see the point of vector types being special. I thought Ben has posted the details. In memory they look the same as 0 based arrays, but they often have different calling conventions (argument passing, returning), they support various arithmetic operations on them, in C++ they support even comparisons (though, unlike scalar comparisons, vector comparisons produce element values 0 for false and -1/all ones for true), they don't promote to pointers. So, for the debug info consumers it is significantly different behavior than arrays. If a is int a[16];, then a + 2 is &a[0] + 2, while if a is int __attribute__((vector_size (16 * sizeof (int)))), a + 2 would be either an error if the language extension doesn't allow vector + scalar, or {a[0]+2,a[1]+2,a[2]+2,...,a[15]+2} vector. Jakub -- Dwarf-discuss mailing list Dwarf-discuss@lists.dwarfstd.org https://lists.dwarfstd.org/mailman/listinfo/dwarf-discuss