aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJason Merrill <jason@gcc.gnu.org>2003-12-18 16:27:03 -0500
committerJason Merrill <jason@gcc.gnu.org>2003-12-18 16:27:03 -0500
commit373a04f11bacb75962fc334f3cec2ffd47950afb (patch)
treec4c1b61aec7a4a7c333ac6ee355fad68ade4b3f7 /gcc
parentf37d2ca669c58f728b040337a9556c30d9e57f9a (diff)
downloadgcc-373a04f11bacb75962fc334f3cec2ffd47950afb.zip
gcc-373a04f11bacb75962fc334f3cec2ffd47950afb.tar.gz
gcc-373a04f11bacb75962fc334f3cec2ffd47950afb.tar.bz2
note that in-out operands should only be used with register constraints
From-SVN: r74802
Diffstat (limited to 'gcc')
-rw-r--r--gcc/doc/extend.texi25
1 files changed, 13 insertions, 12 deletions
diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi
index 21456db..ac03855 100644
--- a/gcc/doc/extend.texi
+++ b/gcc/doc/extend.texi
@@ -3913,18 +3913,19 @@ The ordinary output operands must be write-only; GCC will assume that
the values in these operands before the instruction are dead and need
not be generated. Extended asm supports input-output or read-write
operands. Use the constraint character @samp{+} to indicate such an
-operand and list it with the output operands.
-
-When the constraints for the read-write operand (or the operand in which
-only some of the bits are to be changed) allows a register, you may, as
-an alternative, logically split its function into two separate operands,
-one input operand and one write-only output operand. The connection
-between them is expressed by constraints which say they need to be in
-the same location when the instruction executes. You can use the same C
-expression for both operands, or different expressions. For example,
-here we write the (fictitious) @samp{combine} instruction with
-@code{bar} as its read-only source operand and @code{foo} as its
-read-write destination:
+operand and list it with the output operands. You should only use
+read-write operands when the constraints for the operand (or the
+operand in which only some of the bits are to be changed) allow a
+register.
+
+You may, as an alternative, logically split its function into two
+separate operands, one input operand and one write-only output
+operand. The connection between them is expressed by constraints
+which say they need to be in the same location when the instruction
+executes. You can use the same C expression for both operands, or
+different expressions. For example, here we write the (fictitious)
+@samp{combine} instruction with @code{bar} as its read-only source
+operand and @code{foo} as its read-write destination:
@example
asm ("combine %2,%0" : "=r" (foo) : "0" (foo), "g" (bar));