public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: Different addressing modes for loads and stores?
@ 2003-05-14 14:20 Ulrich Weigand
  0 siblings, 0 replies; 2+ messages in thread
From: Ulrich Weigand @ 2003-05-14 14:20 UTC (permalink / raw)
  To: fcook; +Cc: gcc

Fred Cook wrote:

>My loads support base+offset and base+register addressing while stores
>only have base+offset addressing. My GO_IF_LEGITIMATE_ADDRESS macro
>accepts both addressing modes. Now the question is how to prevent that
>the base+register mode is used for stores. For that changed the movsi
>pattern to:
[snip]
>and I used the EXTRA_CONSTRAINT macro to accept only base+offset
>if the letter argument is 'S'. However, this does not lead to what
>I wanted to achieve. "=r,Sm" or "=r,mS" also does not work.

We've had similar problems on s390 with different addressing modes.
To fix this, I've added the EXTRA_MEMORY_CONSTRAINT feature; this
should do what you want ...


Mit freundlichen Gruessen / Best Regards

Ulrich Weigand

--
  Dr. Ulrich Weigand
  Linux for S/390 Design & Development
  IBM Deutschland Entwicklung GmbH, Schoenaicher Str. 220, 71032 Boeblingen
  Phone: +49-7031/16-3727   ---   Email: Ulrich.Weigand@de.ibm.com

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

* Different addressing modes for loads and stores?
@ 2003-05-14 13:18 Fred Cook
  0 siblings, 0 replies; 2+ messages in thread
From: Fred Cook @ 2003-05-14 13:18 UTC (permalink / raw)
  To: gcc

Hi,

How to deal with load and store instructions that have different addressing
modes? This is not unusual so there must be a solution. What I did is
specifying the following pattern in the .md file for word loads and
stores:

(define_insn "movsi"
   [(set (match_operand:SI 0 "nonimmediate_operand" "=r,m")
         (match_operand:SI 1 "general_operand" "m,r"))]
   ""
   "@
   load %1 -> %0
   store %0 %1"
)

My loads support base+offset and base+register addressing while stores
only have base+offset addressing. My GO_IF_LEGITIMATE_ADDRESS macro
accepts both addressing modes. Now the question is how to prevent that
the base+register mode is used for stores. For that changed the movsi
pattern to:

(define_insn "movsi"
   [(set (match_operand:SI 0 "nonimmediate_operand" "=r,S")
         (match_operand:SI 1 "general_operand" "m,r"))]
   ""
   "@
   load %1 -> %0
   store %0 %1"
)

and I used the EXTRA_CONSTRAINT macro to accept only base+offset
if the letter argument is 'S'. However, this does not lead to what
I wanted to achieve. "=r,Sm" or "=r,mS" also does not work.

Any idea how to solve this problem?

Thanks,

Fred.

_________________________________________________________________
MSN 8 with e-mail virus protection service: 2 months FREE*  
http://join.msn.com/?page=features/virus

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

end of thread, other threads:[~2003-05-14 14:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-05-14 14:20 Different addressing modes for loads and stores? Ulrich Weigand
  -- strict thread matches above, loose matches on Subject: below --
2003-05-14 13:18 Fred Cook

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