diff options
author | Richard Sandiford <r.sandiford@uk.ibm.com> | 2009-07-18 07:52:53 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2009-07-18 07:52:53 +0000 |
commit | 1d4479957bdda8182a8a442afa53fef543984c56 (patch) | |
tree | 6549d97285ea079c388418550c41de587a9f4cd2 /gcc/doc/md.texi | |
parent | 406d1650fb890e9e3f6972280e971bdef38bc302 (diff) | |
download | gcc-1d4479957bdda8182a8a442afa53fef543984c56.zip gcc-1d4479957bdda8182a8a442afa53fef543984c56.tar.gz gcc-1d4479957bdda8182a8a442afa53fef543984c56.tar.bz2 |
md.texi: Document the new PowerPC "es" constraint.
gcc/
* doc/md.texi: Document the new PowerPC "es" constraint.
Document that "m" can include automodified addresses on this target,
and explain how %U must be used. Extend the "Q" and "Z" documentation
to suggest "es" as well as "m".
* config/rs6000/constraints.md (es): New memory constraint.
(Q, Z): Update strings to match new documentation.
gcc/testsuite/
* gcc.target/powerpc/asm-es-1.c: New test.
* gcc.target/powerpc/asm-es-2.c: Likewise.
From-SVN: r149766
Diffstat (limited to 'gcc/doc/md.texi')
-rw-r--r-- | gcc/doc/md.texi | 35 |
1 files changed, 31 insertions, 4 deletions
diff --git a/gcc/doc/md.texi b/gcc/doc/md.texi index f4ca2b0..d9dca7a 100644 --- a/gcc/doc/md.texi +++ b/gcc/doc/md.texi @@ -1972,13 +1972,40 @@ instruction per word Integer/Floating point constant that can be loaded into a register using three instructions +@item m +Memory operand. Note that on PowerPC targets, @code{m} can include +addresses that update the base register. It is therefore only safe +to use @samp{m} in an @code{asm} statement if that @code{asm} statement +accesses the operand exactly once. The @code{asm} statement must also +use @samp{%U@var{<opno>}} as a placeholder for the ``update'' flag in the +corresponding load or store instruction. For example: + +@smallexample +asm ("st%U0 %1,%0" : "=m" (mem) : "r" (val)); +@end smallexample + +is correct but: + +@smallexample +asm ("st %1,%0" : "=m" (mem) : "r" (val)); +@end smallexample + +is not. Use @code{es} rather than @code{m} if you don't want the +base register to be updated. + +@item es +A ``stable'' memory operand; that is, one which does not include any +automodification of the base register. Unlike @samp{m}, this constraint +can be used in @code{asm} statements that might access the operand +several times, or that might not access it at all. + @item Q -Memory operand that is an offset from a register (@samp{m} is preferable -for @code{asm} statements) +Memory operand that is an offset from a register (it is usually better +to use @samp{m} or @samp{es} in @code{asm} statements) @item Z -Memory operand that is an indexed or indirect from a register (@samp{m} is -preferable for @code{asm} statements) +Memory operand that is an indexed or indirect from a register (it is +usually better to use @samp{m} or @samp{es} in @code{asm} statements) @item R AIX TOC entry |