* Ping: RFA: Consider int and same-size short as equivalent vector components @ 2013-09-05 14:50 Joern Rennecke 2013-09-05 14:57 ` Nathan Sidwell 2013-09-07 0:01 ` Ping: RFA: Consider int and same-size short as equivalent vector components Jason Merrill 0 siblings, 2 replies; 6+ messages in thread From: Joern Rennecke @ 2013-09-05 14:50 UTC (permalink / raw) To: gcc-patches Cc: oseph Myers, Richard Henderson, Jason Merrill, Mark Mitchell, Nathan Sidwell Apart from Paolo Carlini's suggestion to improve the wording of the ChangeLog, this patch hasn't been reviewed for more than a week: http://gcc.gnu.org/ml/gcc-patches/2013-08/msg01634.html ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Ping: RFA: Consider int and same-size short as equivalent vector components 2013-09-05 14:50 Ping: RFA: Consider int and same-size short as equivalent vector components Joern Rennecke @ 2013-09-05 14:57 ` Nathan Sidwell 2013-09-05 16:43 ` RFA: accept opaque vectors as compatible to same-size,same-element-size vectors in binary operations (Was: Re: Ping: RFA: Consider int and same-size short as equivalent vector components) Joern Rennecke 2013-09-07 0:01 ` Ping: RFA: Consider int and same-size short as equivalent vector components Jason Merrill 1 sibling, 1 reply; 6+ messages in thread From: Nathan Sidwell @ 2013-09-05 14:57 UTC (permalink / raw) To: Joern Rennecke Cc: gcc-patches, oseph Myers, Richard Henderson, Jason Merrill, Mark Mitchell, Nathan Sidwell On 09/05/13 15:50, Joern Rennecke wrote: > Apart from Paolo Carlini's suggestion to improve the wording of the ChangeLog, > this patch hasn't been reviewed for more than a week: > http://gcc.gnu.org/ml/gcc-patches/2013-08/msg01634.html I don't think the issue is whether they should be treated as equivalent, but whether there's an implicit promotion from (say) vec-of-int to vec-of-long. For instance, given: int_vec_t i; long_vec_t l; if: s < l is well formed, then think it reasonable for: void Foo (long_vec_t); ... Foo (i); to be well formed too. Is that true with your patch? Now, what implicit promotions are permitted? IIUC you're saying that promotions that don't change the element size are ok. I'm fine with that (provided references aren't involved). nathan ^ permalink raw reply [flat|nested] 6+ messages in thread
* RFA: accept opaque vectors as compatible to same-size,same-element-size vectors in binary operations (Was: Re: Ping: RFA: Consider int and same-size short as equivalent vector components) 2013-09-05 14:57 ` Nathan Sidwell @ 2013-09-05 16:43 ` Joern Rennecke 0 siblings, 0 replies; 6+ messages in thread From: Joern Rennecke @ 2013-09-05 16:43 UTC (permalink / raw) To: Nathan Sidwell Cc: gcc-patches, oseph Myers, Richard Henderson, Jason Merrill, Mark Mitchell, Nathan Sidwell Quoting Nathan Sidwell <nathan@acm.org>: > On 09/05/13 15:50, Joern Rennecke wrote: >> Apart from Paolo Carlini's suggestion to improve the wording of the >> ChangeLog, >> this patch hasn't been reviewed for more than a week: >> http://gcc.gnu.org/ml/gcc-patches/2013-08/msg01634.html I suppose the original subject has become a bit misleading... I've changed it in this replay, though it becomes quite a mouthful... > I don't think the issue is whether they should be treated as > equivalent, but whether there's an implicit promotion from (say) > vec-of-int to vec-of-long. For instance, given: > > int_vec_t i; > long_vec_t l; > > if: > s < l > is well formed, then think it reasonable for: > void Foo (long_vec_t); > ... > Foo (i); > to be well formed too. Is that true with your patch? My patch doesn't touch this area. First, what it changes is only type checking for binary operators applied to vectors. Second, the types for which the type checking is relaxed are opaque vectors, types that are generated by gcc as intermediate results, and, as I mentioned in the patch posting, the documentation for TYPE_VECOR_OPAQUE says that "the frontends should not emit warnings about missing conversions to other vector types of the same size." ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Ping: RFA: Consider int and same-size short as equivalent vector components 2013-09-05 14:50 Ping: RFA: Consider int and same-size short as equivalent vector components Joern Rennecke 2013-09-05 14:57 ` Nathan Sidwell @ 2013-09-07 0:01 ` Jason Merrill 2013-09-07 2:44 ` Joern Rennecke 1 sibling, 1 reply; 6+ messages in thread From: Jason Merrill @ 2013-09-07 0:01 UTC (permalink / raw) To: Joern Rennecke, gcc-patches Cc: Joseph Myers, Richard Henderson, Mark Mitchell, Nathan Sidwell On 09/05/2013 10:50 AM, Joern Rennecke wrote: > (vector_types_compatible_elements_p): New function. Why do we need this as well as vector_types_convertible_p? For that matter, why do we need both vector_types_convertible_p and vector_targets_convertible_p? Jason ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Ping: RFA: Consider int and same-size short as equivalent vector components 2013-09-07 0:01 ` Ping: RFA: Consider int and same-size short as equivalent vector components Jason Merrill @ 2013-09-07 2:44 ` Joern Rennecke 2013-09-07 17:00 ` Jason Merrill 0 siblings, 1 reply; 6+ messages in thread From: Joern Rennecke @ 2013-09-07 2:44 UTC (permalink / raw) To: Jason Merrill Cc: gcc-patches, Joseph Myers, Richard Henderson, Mark Mitchell, Nathan Sidwell Quoting Jason Merrill <jason@redhat.com>: > On 09/05/2013 10:50 AM, Joern Rennecke wrote: >> (vector_types_compatible_elements_p): New function. > > Why do we need this as well as vector_types_convertible_p? For that > matter, why do we need both vector_types_convertible_p and > vector_targets_convertible_p? vector_targets_convertible_p is used for pointer types. The callers do a hop, skip and dance to check that the qualifiers are satisfactory, while OTOH vector_targets_convertible_p ignores the number of elements in the vectors. That's fine with vectors as we can consider, say, a vector of 8 elements as two consecutive vectors of 4 elements, and that works fine with pointers. vector_types_convertible is used for pointer value types. It could in principle call vector_targets_convertible_p as a subroutine, but then the check for vector type would be duplicated with its callers, and also the purpose of vector_targets_convertible_p would become muddled. Where vector_types_convertible returns true, a conversion might still be needed to make the types match. vector_types_compatible_elements_p was supposed to be a minimal change from same_scalar_type_ignoring_signedness to fix the treatment of opaque vectors in binary operators. Where it returns true, and the other checks of the caller succeed (being vector types in he first place, and matching number of elements), we can just treat the types as essentially the same. I suppose we could replace same_scalar_type_ignoring_signedness / vector_types_compatible_elements_p by vector_compatible_p, but that would change the behaviour in a number of ways. First, we would no longer allow sign changes by default, this would be only available with -flax-vector-conversions, and to the extend that the types_compatible_p lang hook says so; OTOH, whatever else it says is compatible, would then also be (as long as -flax-vector-conversions is in effect). Is that change wanted? Also, we would presumably need to insert conversions at times. And should we allow different-sized vectors to match? If so, what would be the result type? ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Ping: RFA: Consider int and same-size short as equivalent vector components 2013-09-07 2:44 ` Joern Rennecke @ 2013-09-07 17:00 ` Jason Merrill 0 siblings, 0 replies; 6+ messages in thread From: Jason Merrill @ 2013-09-07 17:00 UTC (permalink / raw) To: Joern Rennecke Cc: gcc-patches, Joseph Myers, Richard Henderson, Mark Mitchell, Nathan Sidwell On 09/06/2013 08:58 PM, Joern Rennecke wrote: > vector_targets_convertible_p is used for pointer types. The callers > do a hop, skip and dance to check that the qualifiers are satisfactory, > while OTOH vector_targets_convertible_p ignores the number of elements > in the vectors. That's fine with vectors as we can consider, say, > a vector of 8 elements as two consecutive vectors of 4 elements, and > that works fine with pointers. > > vector_types_convertible is used for pointer value types. > It could in principle call vector_targets_convertible_p as a subroutine, > but then the check for vector type would be duplicated with its callers, > and also the purpose of vector_targets_convertible_p would become > muddled. > Where vector_types_convertible returns true, a conversion might still be > needed to make the types match. > > vector_types_compatible_elements_p was supposed to be a minimal change > from same_scalar_type_ignoring_signedness to fix the treatment of > opaque vectors in binary operators. Where it returns true, and > the other checks of the caller succeed (being vector types in he first > place, and matching number of elements), we can just treat the types > as essentially the same. Your earlier patch is OK if you add this information to the comments for the various functions and have them mention each other. Jason ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2013-09-07 16:53 UTC | newest] Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2013-09-05 14:50 Ping: RFA: Consider int and same-size short as equivalent vector components Joern Rennecke 2013-09-05 14:57 ` Nathan Sidwell 2013-09-05 16:43 ` RFA: accept opaque vectors as compatible to same-size,same-element-size vectors in binary operations (Was: Re: Ping: RFA: Consider int and same-size short as equivalent vector components) Joern Rennecke 2013-09-07 0:01 ` Ping: RFA: Consider int and same-size short as equivalent vector components Jason Merrill 2013-09-07 2:44 ` Joern Rennecke 2013-09-07 17:00 ` Jason Merrill
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).