public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Autoincrement addressing modes
@ 1998-02-11 18:20 Michael P. Hayes
  1998-02-11 16:33 ` Joern Rennecke
  1998-02-12  6:42 ` Richard Henderson
  0 siblings, 2 replies; 16+ messages in thread
From: Michael P. Hayes @ 1998-02-11 18:20 UTC (permalink / raw)
  To: gcc2, egcs

I have been working on generalised support for autoincrement
addressing modes, where the increment may be a constant (not just the
width of the data type), an index register, or even potentially a
scaled index register, circularly modified base register, or
bit-reversed base register.

The format I've used is:

(post_modify (reg base) (expr))
(pre_modify (reg base) (expr))

where in the first case (reg base) is used as the address and then
this gets set to (expr) and in the second case (reg base) gets set
to (expr) and then used as the address.

Currently, I've patched flow.c and reload.c to handle the common
forms:

({post,pre}_modify (reg base) (plus (reg base) (reg index)))  
({post,pre}_modify (reg base) (plus (reg base) (const_int)))
({post,pre}_modify (reg base) (minus (reg base) (reg index)))

supporting addressing modes such as:

*(base += index)
*(base += const)
*(base -= index)

At this stage I'm interested in what other common forms should be
supported.

I'm also wondering if it is worthwhile to describe the addressing
modes of a machine, using something like:

(define_address
 [(mem:SF (match_operand:SI 0 "base_register" "a"))]
 ""
 "*%0")

or

(define_address
 [(mem:SI (plus:SI (match_operand:SI 0 "base_register" "a")
                   (match_operand:SI 1 "index_register" "x")))]
 ""
 "*%0(%1)")

or

(define_address
 [(mem:SI (post_modify:SI (match_operand:SI 0 "base_register" "a")
                          (plus:SI (match_dup 0)
                                  (match_operand:SI 1 "index_register" "x"))))]
 ""
 "*%0++(%1)")



^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~1998-03-17 13:29 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-02-11 18:20 Autoincrement addressing modes Michael P. Hayes
1998-02-11 16:33 ` Joern Rennecke
1998-02-11 17:22   ` Jeffrey A Law
1998-02-11 17:22     ` Michael P. Hayes
1998-02-11 16:33       ` Joern Rennecke
1998-02-11 18:20       ` Joern Rennecke
1998-02-11 18:20       ` Jeffrey A Law
1998-02-12  6:42 ` Richard Henderson
1998-02-14 15:24   ` Michael P. Hayes
1998-03-16 20:25   ` Joern Rennecke
1998-03-16 20:25     ` Richard Henderson
1998-03-16 20:25       ` Michael P. Hayes
1998-03-16 20:25         ` Joern Rennecke
1998-03-17  1:28           ` Richard Henderson
1998-03-17 13:29             ` Joern Rennecke
1998-03-16 20:44     ` Michael P. Hayes

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).