public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Document some arch-specific operand modifiers
@ 2018-03-14 17:05 Borislav Petkov
  2018-04-17 15:42 ` Borislav Petkov
  2018-05-30 22:56 ` Jeff Law
  0 siblings, 2 replies; 3+ messages in thread
From: Borislav Petkov @ 2018-03-14 17:05 UTC (permalink / raw)
  To: gcc-patches; +Cc: Michael Matz, Richard Biener

Hi,

here's an attempt to document some of the inline asm operand modifiers
which make sense and which get used so that people can find what they
mean in the docs.

This is my first gcc patch so there might be clumsiness ahead. :)

Thanks,
Boris.

gcc/Changelog:

2018-03-14  Borislav Petkov  <bp@suse.de>

       * gcc/doc/extend.texi: document some arch-specific asm operand modifiers
         and sort entries.
       * gcc/config/i386/i386.c: fix typo.

---
 gcc/ChangeLog          |  6 ++++
 gcc/config/i386/i386.c |  2 +-
 gcc/doc/extend.texi    | 79 +++++++++++++++++++++++++++++++++-----------------
 3 files changed, 60 insertions(+), 27 deletions(-)

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 4d56c473e68b..c3d83a2fe15c 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2018-03-14  Borislav Petkov  <bp@suse.de>
+
+	* gcc/doc/extend.texi: document some arch-specific asm operand modifiers
+	  and sort entries.
+	* gcc/config/i386/i386.c: fix typo.
+
 2018-01-21  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
 	    David Edelsohn <dje.gcc@gmail.com>
 
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 72d25ae4f722..da634afa1e08 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -17847,7 +17847,7 @@ print_reg (rtx x, int code, FILE *file)
    F,f -- likewise, but for floating-point.
    O -- if HAVE_AS_IX86_CMOV_SUN_SYNTAX, expand to "w.", "l." or "q.",
 	otherwise nothing
-   R -- print embeded rounding and sae.
+   R -- print embedded rounding and sae.
    r -- print only sae.
    z -- print the opcode suffix for the size of the current operand.
    Z -- likewise, with special suffixes for x87 instructions.
diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi
index dce808f1eab1..321576bac292 100644
--- a/gcc/doc/extend.texi
+++ b/gcc/doc/extend.texi
@@ -9224,14 +9224,14 @@ top:
 
    asm volatile goto ("some assembler instructions here"
    : /* No outputs. */
-   : "q" (iInt), "X" (sizeof(unsigned char) + 1)
+   : "q" (iInt), "X" (sizeof(unsigned char) + 1), "i" (42)
    : /* No clobbers. */
    : top);
 @}
 @end example
 
-With no modifiers, this is what the output from the operands would be for the 
-@samp{att} and @samp{intel} dialects of assembler:
+With no modifiers, this is what the output from the operands would be
+for the @samp{att} and @samp{intel} dialects of assembler:
 
 @multitable {Operand} {$.L2} {OFFSET FLAT:.L2}
 @headitem Operand @tab @samp{att} @tab @samp{intel}
@@ -9241,55 +9241,82 @@ With no modifiers, this is what the output from the operands would be for the
 @item @code{%1}
 @tab @code{$2}
 @tab @code{2}
-@item @code{%2}
-@tab @code{$.L2}
-@tab @code{OFFSET FLAT:.L2}
+@item @code{%3}
+@tab @code{$.L3}
+@tab @code{OFFSET FLAT:.L3}
 @end multitable
 
 The table below shows the list of supported modifiers and their effects.
 
 @multitable {Modifier} {Print the opcode suffix for the size of th} {Operand} {@samp{att}} {@samp{intel}}
 @headitem Modifier @tab Description @tab Operand @tab @samp{att} @tab @samp{intel}
-@item @code{z}
-@tab Print the opcode suffix for the size of the current integer operand (one of @code{b}/@code{w}/@code{l}/@code{q}).
-@tab @code{%z0}
-@tab @code{l}
-@tab 
+@item @code{a}
+@tab Print an absolute memory reference.
+@tab @code{%A0}
+@tab @code{*%rax}
+@tab @code{rax}
 @item @code{b}
 @tab Print the QImode name of the register.
 @tab @code{%b0}
 @tab @code{%al}
 @tab @code{al}
+@item @code{c}
+@tab Require a constant operand and print the constant expression with no punctuation.
+@tab @code{%c1}
+@tab @code{2}
+@tab @code{2}
+@item @code{E}
+@tab Print the address in Double Integer (DImode) mode (8 bytes) when the target is 64-bit.
+Otherwise mode is unspecified (VOIDmode).
+@tab @code{%E1}
+@tab @code{%(rax)}
+@tab @code{[rax]}
 @item @code{h}
 @tab Print the QImode name for a ``high'' register.
 @tab @code{%h0}
 @tab @code{%ah}
 @tab @code{ah}
-@item @code{w}
-@tab Print the HImode name of the register.
-@tab @code{%w0}
-@tab @code{%ax}
-@tab @code{ax}
+@item @code{H}
+@tab Add 8 bytes to an offsettable memory reference. Useful when accessing the
+high 8 bytes of SSE values. For a memref in (%rax), it generates
+@tab @code{%H0}
+@tab @code{8(%rax)}
+@tab @code{8[rax]}
 @item @code{k}
 @tab Print the SImode name of the register.
 @tab @code{%k0}
 @tab @code{%eax}
 @tab @code{eax}
+@item @code{l}
+@tab Print the label name with no punctuation.
+@tab @code{%l3}
+@tab @code{.L3}
+@tab @code{.L3}
+@item @code{p}
+@tab Print raw symbol name (without syntax-specific prefixes).
+@tab @code{%p2}
+@tab @code{42}
+@tab @code{42}
+@item @code{P}
+@tab If used for a function, print the PLT suffix and generate PIC code.
+For example, emit @code{foo@@PLT} instead of 'foo' for the function
+foo(). If used for a constant, drop all syntax-specific prefixes and
+issue the bare constant. See @code{p} above.
 @item @code{q}
 @tab Print the DImode name of the register.
 @tab @code{%q0}
 @tab @code{%rax}
 @tab @code{rax}
-@item @code{l}
-@tab Print the label name with no punctuation.
-@tab @code{%l2}
-@tab @code{.L2}
-@tab @code{.L2}
-@item @code{c}
-@tab Require a constant operand and print the constant expression with no punctuation.
-@tab @code{%c1}
-@tab @code{2}
-@tab @code{2}
+@item @code{w}
+@tab Print the HImode name of the register.
+@tab @code{%w0}
+@tab @code{%ax}
+@tab @code{ax}
+@item @code{z}
+@tab Print the opcode suffix for the size of the current integer operand (one of @code{b}/@code{w}/@code{l}/@code{q}).
+@tab @code{%z0}
+@tab @code{l}
+@tab 
 @end multitable
 
 @code{V} is a special modifier which prints the name of the full integer
-- 
2.13.0

-- 
SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg)
-- 

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

* Re: [PATCH] Document some arch-specific operand modifiers
  2018-03-14 17:05 [PATCH] Document some arch-specific operand modifiers Borislav Petkov
@ 2018-04-17 15:42 ` Borislav Petkov
  2018-05-30 22:56 ` Jeff Law
  1 sibling, 0 replies; 3+ messages in thread
From: Borislav Petkov @ 2018-04-17 15:42 UTC (permalink / raw)
  To: gcc-patches; +Cc: Michael Matz, Richard Biener

On Wed, Mar 14, 2018 at 05:35:21PM +0100, Borislav Petkov wrote:
> Hi,
> 
> here's an attempt to document some of the inline asm operand modifiers
> which make sense and which get used so that people can find what they
> mean in the docs.
> 
> This is my first gcc patch so there might be clumsiness ahead. :)
> 
> Thanks,
> Boris.
> 
> gcc/Changelog:
> 
> 2018-03-14  Borislav Petkov  <bp@suse.de>
> 
>        * gcc/doc/extend.texi: document some arch-specific asm operand modifiers
>          and sort entries.
>        * gcc/config/i386/i386.c: fix typo.

Looks forgotten, lemme ping people...

-- 
Regards/Gruss,
    Boris.

SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg)
-- 

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

* Re: [PATCH] Document some arch-specific operand modifiers
  2018-03-14 17:05 [PATCH] Document some arch-specific operand modifiers Borislav Petkov
  2018-04-17 15:42 ` Borislav Petkov
@ 2018-05-30 22:56 ` Jeff Law
  1 sibling, 0 replies; 3+ messages in thread
From: Jeff Law @ 2018-05-30 22:56 UTC (permalink / raw)
  To: Borislav Petkov, gcc-patches; +Cc: Michael Matz, Richard Biener

On 03/14/2018 10:35 AM, Borislav Petkov wrote:
> Hi,
> 
> here's an attempt to document some of the inline asm operand modifiers
> which make sense and which get used so that people can find what they
> mean in the docs.
> 
> This is my first gcc patch so there might be clumsiness ahead. :)
> 
> Thanks,
> Boris.
> 
> gcc/Changelog:
> 
> 2018-03-14  Borislav Petkov  <bp@suse.de>
> 
>        * gcc/doc/extend.texi: document some arch-specific asm operand modifiers
>          and sort entries.
>        * gcc/config/i386/i386.c: fix typo.
I commited the doc fix to the trunk.  Richi already fixed the x86
backend typo.

jeff

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

end of thread, other threads:[~2018-05-30 22:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-14 17:05 [PATCH] Document some arch-specific operand modifiers Borislav Petkov
2018-04-17 15:42 ` Borislav Petkov
2018-05-30 22:56 ` Jeff Law

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