From mboxrd@z Thu Jan 1 00:00:00 1970 From: Joern Rennecke To: rth@cygnus.com Cc: michaelh@ongaonga.chch.cri.nz, egcs@cygnus.com Subject: Re: Autoincrement addressing modes Date: Mon, 16 Mar 1998 20:25:00 -0000 Message-id: <199803162251.WAA08886@phal.cygnus.co.uk> References: <19980212023505.17080@dot.cygnus.com> X-SW-Source: 1998-03/msg00557.html > > (define_address > > [(mem:SF (match_operand:SI 0 "base_register" "a"))] > > "" > > "*%0") > > I think this is a swell idea. I can see it as being particularly > useful to use this kind of description to help auto-generate > GO_IF_LEGITIMATE_ADDRESS and LEGITIMIZE_ADDRESS. As it is not a > few ports lie to gcc about how addresses really work with -fpic, > perhaps if it were easier to describe, ports would quite lying. > > Though I would get rid of the mem and add a name, > > (define_address "base_disp" > [(plus:DI (match_operand:DI 0 "register_operand" "r") > (match_operand:DI 1 "const16_operand" "I"))] > "" > "%1(%0)") Adding a name is fine, but I wouldn't want to drop the mem. Note that the mem has a mode, which is useful for a number of ports. If it is not useful, you can still leave out the mode (i.e., it will be VoidMODE). moreover, we need some way to link the address forms to the places where they are possible - e.g. it is common that the set of allowed addresses for loads is different from the ones allowed for stores. Should that be a list of constraints - e.g. "g" could be only for reading general operands, "=g" only for writing general operands, "=g,g" for either of these, "+g" only for read-write general operands, "=" for and kind of write-only operand... Or should we put lists of addressing modes in some other kind of declaration in the machine description? E.g.: (define_load ["base", "base_disp", "auto_inc"]) (define_store ["base", "base_disp", "auto_dec"]) (define_mem_arith ["base", "base_disp"])