core: Handle GCC support for vector instructions

So after the next patch, when dwarf_loader will use this new core
functionality, it recognizes:

908 typedef int __m64 __attribute__ ((__vector_size__ (8))); size: 8
909 int         array __attribute__ ((__vector_size__ (8))); size: 8
910 int         array __attribute__ ((__vector_size__ (4))); size: 4
911 short int   array __attribute__ ((__vector_size__ (2))); size: 2
912 char        array __attribute__ ((__vector_size__ (1))); size: 1

The above output was obtained using pdwtags.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
Arnaldo Carvalho de Melo 2009-03-23 16:56:57 -03:00
parent fc0827327b
commit d6d845f0d7
2 changed files with 10 additions and 2 deletions

View File

@ -281,7 +281,7 @@ static size_t array_type__fprintf(const struct tag *tag_self,
printed = type__fprintf(type, cu, name, conf, fp);
for (i = 0; i < self->dimensions; ++i) {
if (conf->flat_arrays) {
if (conf->flat_arrays || self->is_vector) {
/*
* Seen on the Linux kernel on tun_filter:
*
@ -297,7 +297,14 @@ static size_t array_type__fprintf(const struct tag *tag_self,
printed += fprintf(fp, "[%u]", self->nr_entries[i]);
}
if (conf->flat_arrays)
if (self->is_vector) {
type = tag__follow_typedef(tag_self, cu);
if (flat_dimensions == 0)
flat_dimensions = 1;
printed += fprintf(fp, " __attribute__ ((__vector_size__ (%llu)))",
flat_dimensions * tag__size(type, cu));
} else if (conf->flat_arrays)
printed += fprintf(fp, "[%llu]", flat_dimensions);
return printed;

View File

@ -850,6 +850,7 @@ struct array_type {
struct tag tag;
uint32_t *nr_entries;
uint8_t dimensions;
bool is_vector;
};
static inline struct array_type *tag__array_type(const struct tag *self)