Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Ken Werner <ken@linux.vnet.ibm.com>
To: Joel Brobecker <brobecker@adacore.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [patch] GNU vector unop support
Date: Thu, 07 Oct 2010 16:23:00 -0000	[thread overview]
Message-ID: <201010071823.22427.ken@linux.vnet.ibm.com> (raw)
In-Reply-To: <20101006232659.GC12651@adacore.com>

On Thursday, October 07, 2010 1:26:59 am Joel Brobecker wrote:
> > > One question: Is it possible to have a non-array vector type?
> > > In other words, can we just check for TYPE_VECTOR (type) instead
> > > of TYPE_CODE (type) and TYPE_VECTOR (type)?
> > 
> > No, not that I'm aware of. Even a GNU Vector with a single element
> > only is an array underneath. My understanding is that querying the
> > flag_vector is only legal if the type is an array.
> 
> I feel that this makes the check for the TYPE_CODE a little superfluous.
> But at the same time, the code handling vectors then assumes that the
> underlying type is an array.

Ok, I see your point. : ) It seems my statement was incorrect. I missed that 
various backends (e.g. i386-tdep.c:i386_mmx_type or rs6000-
tdep.c:rs6000_builtin_type_vec64) create vectors with TYPE_CODE_UNION for 
their vector registers. Therefore checking the vector flag only may not always 
work as expected.

> > ChangeLog:
> > 
> > 2010-10-04  Ken Werner  <ken.werner@de.ibm.com>
> > 
> > 	* valarith.c (value_pos, value_neg, value_complement): Handle
> > 	vector types.
> > 	* valops.c (value_one): Likewise.
> > 
> > testsuite/ChangeLog:
> > 
> > 2010-10-04  Ken Werner  <ken.werner@de.ibm.com>
> > 
> > 	* gdb.base/gnu_vector.exp: Add unary operator tests.
> 
> This is OK.

Thanks. I'd prefer to wait with the commit until the lval-issue gets resolved.

> If it was just me, I'd probably wrap the checks for vector types
> inside a function (such as type_is_vector or vector_type_p), with
> a comment explaining the reason why we check for the TYPE_CODE
> despite the fact that, normally, all types with the `vector' flag
> should be arrays.  (this is just a soft suggestion, and to be treated
> as a followup patch, if not ignored)

It would clearly improve the readability of the source code. Giving vectors a 
distinct type code may also be an option.

Regards
Ken


  reply	other threads:[~2010-10-07 16:23 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-17 12:58 Ken Werner
2010-09-28 16:04 ` Ken Werner
     [not found] ` <20100930185634.GC6213@adacore.com>
2010-10-01 17:45   ` [patch] fix pre-/post- in-/decrement Ken Werner
2010-10-04 13:01     ` Ulrich Weigand
2010-10-04 19:47       ` Ken Werner
2010-10-04 20:45         ` Daniel Jacobowitz
2010-10-04 21:58           ` Ulrich Weigand
2010-10-04 22:59             ` Daniel Jacobowitz
2010-10-04 23:25               ` Ulrich Weigand
2010-10-05  1:17                 ` Daniel Jacobowitz
2010-10-05 13:28                   ` Ulrich Weigand
2010-10-05 13:42                     ` Daniel Jacobowitz
2010-10-06 18:59                       ` [rfc] Fix value_assign return value (Re: [patch] fix pre-/post- in-/decrement) Ulrich Weigand
2010-10-26 13:42                         ` Daniel Jacobowitz
2010-12-01 16:51                           ` Ulrich Weigand
2010-10-06 20:55                       ` [patch] fix pre-/post- in-/decrement Vladimir Prus
2010-10-07 12:38         ` Ken Werner
2010-10-12 23:00           ` Tom Tromey
2010-10-13  8:45             ` Andreas Schwab
2010-10-13  9:23             ` Ken Werner
2010-10-13 16:07               ` Daniel Jacobowitz
2010-10-13 19:01               ` Tom Tromey
2010-10-19  7:38                 ` Ken Werner
2010-11-02  8:23                   ` Ken Werner
2010-11-02 20:31                   ` Tom Tromey
2010-11-03 13:52                     ` Ken Werner
2010-10-04 20:52   ` [patch] GNU vector unop support Ken Werner
2010-10-06 23:27     ` Joel Brobecker
2010-10-07 16:23       ` Ken Werner [this message]
2010-11-03 14:07       ` Ken Werner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201010071823.22427.ken@linux.vnet.ibm.com \
    --to=ken@linux.vnet.ibm.com \
    --cc=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox