On 30/01/14 17:10, Richard Sandiford wrote:

Right, in the context:

   Just in case: the point I was trying to make in the second paragraph
   was that the code in the patch only triggers (as you say) because the
   address isn't seen as mode-dependent.  But this kind of address does
   look mode-dependent to me, since it only works for MEM modes that have
   the same number of elements as the index vector.  So this does sound
   like a case where mode_dependent_address_p ought to return true.

   If we do support vector addresses than I think the right fix is to
   check VECTOR_MODE_P there.

   http://gcc.gnu.org/ml/gcc/2014-01/msg00242.html

I.e. there == mode_dependent_address_p (defined in recog.c).

 From this I understood that you agreed that if vector_mode is supported
for an address the check should be in simplify_rtx as it would prevent
all target ports from adding the check to their hook, making it
therefore more generic. You re-enforced this when you said:
"I'd just prefer it
to be in generic code because I think it's a target-independent rule."

No, I meant that I'd prefer it to be done in the target-independent
mode_dependent_address_p function.  This was in response to:

   Well, isn't it the case that a mem with vector mode is always mode
   dependent, in which case adding VECTOR_MODE_P to mode-dependent target
   hook would be enough making the patch not so useful?

   http://gcc.gnu.org/ml/gcc/2014-01/msg00248.html

where it sounded like you were instead going to add the check to your
target's TARGET_MODE_DEPENDENT_ADDRESS_P hook.  I don't think it makes
sense to defer the VECTOR_MODE_P check to the target hook since I don't
know how target-independent code could attach any meaning to something
like (mem:V4HI (reg:V4SI ...)) -> (mem:DI (reg:V4SI ...)).

Again, this is all on the basis that vector-mode addresses really
are supported.


Now I understand what you mean. I was pretty confused by what you meant by target-independent mode_dependent_address_p because initially I had the feeling that targetm.mode_dependent_address_p was being called in simplify_rtx but there's actually a mode_dependent_address_p in recog.c and there is where you suggested to add the check _if_ vector modes are supported. Got it.

I apologize for my misunderstanding and thank you for your patience.

--
Paulo Matos

Thanks,
Richard


Reply via email to