This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: (define_address ...) suggestions needed


Denis Chertykov <denisc@overta.ru> writes:

> (define_address "post_inc"
>   [(mem (post_inc:HI (match_operand:HI 0 "register_operand" "e")))]
>   .....
>   [(set_attr "address_cost" "2")
>    (set_attr "address_mode_dependent" "yes")])
> ------------------------------------------------------
> I'm use `mem' only for checking mode and because `genrecog' generates
> ready code for a address recognizing.

It was a bad idea because ADDRESS_COST and
GO_IF_MODE_DEPENDENT_ADDRESS don't pass a mode for `mem' and I can't
recognize address.

 (define_address "post_inc_HI"
   [(mem:HI (post_inc:HI (match_operand:HI 0 "register_operand" "e")))]

Can't be recognized from ADDRESS_COST because memory mode isn't known
inside ADDRESS_COST.

I want to change (define_address ...) syntax to something like:

(define_address "post_inc:QI:HI:SI:DI"
  [(post_inc:HI (match_operand:HI 0 "register_operand" "e"))]
  ...
) ;; this address valid for memory operand in QI,HI,SI,DI mode

(define_address "post_inc:~DI"
  [(post_inc:HI (match_operand:HI 0 "register_operand" "e"))]
  ...
) ;; this address valid for memory operand in any mode except DI


In this cases I will have a one address pattern for any memory mode.

May be somebody have a better ideas about (define_address ...) syntax.
Any suggestions ?

PS: now I'm work on substituting BASE_REG_CLASS and INDEX_REG_CLASS
in the reload.c in find_reloads_address. (nightmare)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]