From patchwork Tue May 12 05:33:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hongtao Liu X-Patchwork-Id: 1288184 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=gcc.gnu.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=p+B755fX; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49LmX55676z9sRY for ; Tue, 12 May 2020 15:27:17 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id BD71B383F840; Tue, 12 May 2020 05:27:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BD71B383F840 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1589261235; bh=OMIDmyRFjbPTtHsD4R+tmED/qMGQAVTa+zn2ODwS0rg=; h=Date:Subject:To:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=p+B755fXmpegTOoq5b4Tkuk2pbztZa1Bxd1CDwpbNTq8sSQaQfOecPuNKFrUPOOYP sSMaCKnw7ECSorzSVXC7GAsLcg5WrguMGwQ4QDHTStdJLNsFTGhF00AhlwNv96pVoy 1VY4M42WCmR62hmA6Y7Uy5Q7rEKPepLIUVD/IoOA= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-ua1-x92c.google.com (mail-ua1-x92c.google.com [IPv6:2607:f8b0:4864:20::92c]) by sourceware.org (Postfix) with ESMTPS id 5B3D13851C07 for ; Tue, 12 May 2020 05:27:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 5B3D13851C07 Received: by mail-ua1-x92c.google.com with SMTP id g35so4298800uad.0 for ; Mon, 11 May 2020 22:27:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=OMIDmyRFjbPTtHsD4R+tmED/qMGQAVTa+zn2ODwS0rg=; b=LzcRqkfy6Tj7AcfqR2enrzeAdJer+5QIt7WhoRMjYuu4JcCtPydQxT1DD6yjhKf66E UEXzrYRnkt6Hq8HJjhk3aO6AyGeIvQGoXqOCOw35QXZwgNZk+dzvNfHhps9Jq7x3S8j6 dgK+X5RNAJUXCE7paxJ1CAawK0boB+iWN5M+Bx0RkaILv8wQ6vqq2UG7/fcbQdBeLHbg JH7pMrrmcozdcUfCGaNZdGZP6qxAhaKF2hmV0jtpmkOHjLdzXZbUZagXtdVzhoUOeWDb 7GgXq1wKYn1PiY7gmhivrayZsJyvErM/hEs0EgWchNkyro1K2XANWGXVij6A2epOjZ90 cL/A== X-Gm-Message-State: AGi0PuZtssqYM5/8vHpAV6IVKwaIHlf9pfLg5992Qw/E8GXRxM2ynf6N DQpw1gwGUDuywxACWDhOSUm+PmMjJeH3FktgOjC+dTLlzSo= X-Google-Smtp-Source: APiQypKllwT3loDUKajX0LIYCnReILJ6MDEloFeoLyxqsC5wpR6aDpn1Uv89VYDBZypDpvrH5hdD4Rn4EQqrrB5dgCo= X-Received: by 2002:a9f:25b8:: with SMTP id 53mr13890585uaf.102.1589261231536; Mon, 11 May 2020 22:27:11 -0700 (PDT) MIME-Version: 1.0 Date: Tue, 12 May 2020 13:33:07 +0800 Message-ID: Subject: [PATCH] [PR94118]] Update documentation for x86 operand modifier. To: GCC Patches , Uros Bizjak X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Hongtao Liu via Gcc-patches From: Hongtao Liu Reply-To: Hongtao Liu Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" Documents operand modifiers which are available in asm stmt but missing in document. | Modifier | Description | Available in asm stmt | Existed in documentation | | --- | --- | ------- | ----- | | L,W,B,Q,S,T | print the opcode suffix for specified size of operand. | Available | Not | | C | print opcode suffix for set/cmov insn. | Not | - | | c | like C, but print reversed condition | Not | - | | F,f | likewise, but for floating-point. | Not | - | | O | if HAVE_AS_IX86_CMOV_SUN_SYNTAX, expand to "w.", "l." or "q.", otherwise nothing | Not | - | | R | print embedded rounding and sae. | Available | Not | | r | print only sae. | Available | Not | | z | print the opcode suffix for the size of the current operand. | Available | Existed | | Z | likewise, with special suffixes for x87 instructions. | Availble | Not | | * | print a star (in certain assembler syntax) | Not | - | | A | print an absolute memory reference. | Available | Existed | | E | print address with DImode register names if TARGET_64BIT. | Available | Existed | | w | print the operand as if it's a "word" (HImode) even if it isn't. | Available | Existed | | s | print a shift double count, followed by the assemblers argument delimiter. | Available | Not | | b | print the QImode name of the register for the indicated operand %b0 would print %al if operands[0] is reg 0. | Available | Existed | | w | likewise, print the HImode name of the register. | Available | Existed | | k | likewise, print the SImode name of the register. | Available | Existed | | q | likewise, print the DImode name of the register. | Available | Existed | | x | likewise, print the V4SFmode name of the register. | Available | Not | | t | likewise, print the V8SFmode name of the register. | Available | Not | | g | likewise, print the V16SFmode name of the register. | Avaliable | Not | | h | print the QImode name for a "high" register, either ah, bh, ch or dh. | Available | Existed | | y | print "st(0)" instead of "st" as a register. | Available | Not | | d | print duplicated register operand for AVX instruction. | Available | Not | | D | print condition for SSE cmp instruction. | Not | - | | P | if PIC, print an @PLT suffix. | Available | Existed | | p | print raw symbol name. | Available | Existed | | X | don't print any sort of PIC '@' suffix for a symbol. | Not | - | | & | print some in-use local-dynamic symbol name. | Not | - | | H | print a memory address offset by 8; used for sse high-parts | Available | Existed | | Y | print condition for XOP pcom* instruction. | Not | - | | V | print naked full integer register name without %. | Available | Existed | | + | print a branch hint as 'cs' or 'ds' prefix | Not | - | | ; | print a semicolon (after prefixes due to bug in older gas). | Not | - | | ~ | print "i" if TARGET_AVX2, "f" otherwise. | Not | - | | ^ | print addr32 prefix if TARGET_64BIT and Pmode != word_mode | Not | - | | M | print addr32 prefix for TARGET_X32 with VSIB address. | Not | - | | ! | print NOTRACK prefix for jxx/call/ret instructions if required. | Not | - | | N | print maskz if it's constant 0 operand. | Available | Not | | I | print comparision predicate operand for sse cmp condition. | Not | - | Bootstrap is ok. gcc/ChangeLog PR target/94118 * doc/extend.texi (x86Operandmodifiers): Document more x86 operand modifier. * gcc/config/i386/i386.c: Add comment for operand modifier N and I. From 333ee5ef21e6903f2893c9dcf3bb941b88516542 Mon Sep 17 00:00:00 2001 From: liuhongt Date: Fri, 8 May 2020 17:47:33 +0800 Subject: [PATCH] Document more x86 operand modifier. Documents operand modifiers which are available in asm stmt but missing in document. | Modifier | Description | Available in asm stmt | Existed in documentation | | --- | --- | ------- | ----- | | L,W,B,Q,S,T | print the opcode suffix for specified size of operand. | Available | Not | | C | print opcode suffix for set/cmov insn. | Not | - | | c | like C, but print reversed condition | Not | - | | F,f | likewise, but for floating-point. | Not | - | | O | if HAVE_AS_IX86_CMOV_SUN_SYNTAX, expand to "w.", "l." or "q.", otherwise nothing | Not | - | | R | print embedded rounding and sae. | Available | Not | | r | print only sae. | Available | Not | | z | print the opcode suffix for the size of the current operand. | Available | Existed | | Z | likewise, with special suffixes for x87 instructions. | Availble | Not | | * | print a star (in certain assembler syntax) | Not | - | | A | print an absolute memory reference. | Available | Existed | | E | print address with DImode register names if TARGET_64BIT. | Available | Existed | | w | print the operand as if it's a "word" (HImode) even if it isn't. | Available | Existed | | s | print a shift double count, followed by the assemblers argument delimiter. | Available | Not | | b | print the QImode name of the register for the indicated operand %b0 would print %al if operands[0] is reg 0. | Available | Existed | | w | likewise, print the HImode name of the register. | Available | Existed | | k | likewise, print the SImode name of the register. | Available | Existed | | q | likewise, print the DImode name of the register. | Available | Existed | | x | likewise, print the V4SFmode name of the register. | Available | Not | | t | likewise, print the V8SFmode name of the register. | Available | Not | | g | likewise, print the V16SFmode name of the register. | Avaliable | Not | | h | print the QImode name for a "high" register, either ah, bh, ch or dh. | Available | Existed | | y | print "st(0)" instead of "st" as a register. | Available | Not | | d | print duplicated register operand for AVX instruction. | Available | Not | | D | print condition for SSE cmp instruction. | Not | - | | P | if PIC, print an @PLT suffix. | Available | Existed | | p | print raw symbol name. | Available | Existed | | X | don't print any sort of PIC '@' suffix for a symbol. | Not | - | | & | print some in-use local-dynamic symbol name. | Not | - | | H | print a memory address offset by 8; used for sse high-parts | Available | Existed | | Y | print condition for XOP pcom* instruction. | Not | - | | V | print naked full integer register name without %. | Available | Existed | | + | print a branch hint as 'cs' or 'ds' prefix | Not | - | | ; | print a semicolon (after prefixes due to bug in older gas). | Not | - | | ~ | print "i" if TARGET_AVX2, "f" otherwise. | Not | - | | ^ | print addr32 prefix if TARGET_64BIT and Pmode != word_mode | Not | - | | M | print addr32 prefix for TARGET_X32 with VSIB address. | Not | - | | ! | print NOTRACK prefix for jxx/call/ret instructions if required. | Not | - | | N | print maskz if it's constant 0 operand. | Available | Not | | I | print comparision predicate operand for sse cmp condition. | Not | - | gcc/ChangeLog PR target/94118 * doc/extend.texi (x86Operandmodifiers): Document more x86 operand modifier. * gcc/config/i386/i386.c: Add comment for operand modifier N and I. Modified-by: liuhongt --- gcc/config/i386/i386.c | 2 + gcc/doc/extend.texi | 94 +++++++++++++++++++++++++++++++++++++++++- 2 files changed, 94 insertions(+), 2 deletions(-) diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index b40f443ba8a..405f6ba2622 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -12506,6 +12506,8 @@ print_reg (rtx x, int code, FILE *file) ^ -- print addr32 prefix if TARGET_64BIT and Pmode != word_mode M -- print addr32 prefix for TARGET_X32 with VSIB address. ! -- print NOTRACK prefix for jxx/call/ret instructions if required. + N -- print maskz if it's constant 0 operand. + I -- print comparision predicate operand for sse cmp condition. */ void diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi index 936c22e2fe7..7095d1f3e86 100644 --- a/gcc/doc/extend.texi +++ b/gcc/doc/extend.texi @@ -10431,6 +10431,15 @@ for the @samp{att} and @samp{intel} dialects of assembler: @item @code{%3} @tab @code{$.L3} @tab @code{OFFSET FLAT:.L3} +@item @code{%4} +@tab @code{$8} +@tab @code{8} +@item @code{%5} +@tab @code{%xmm0} +@tab @code{xmm0} +@item @code{%7} +@tab @code{$0} +@tab @code{0} @end multitable The table below shows the list of supported modifiers and their effects. @@ -10447,17 +10456,32 @@ The table below shows the list of supported modifiers and their effects. @tab @code{%b0} @tab @code{%al} @tab @code{al} +@item @code{B} +@tab print the opcode suffix of b. +@tab @code{%B0} +@tab @code{b} +@tab @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{d} +@tab print duplicated register operand for AVX instruction. +@tab @code{%d5} +@tab @code{%xmm0, %xmm0} +@tab @code{xmm0, xmm0} @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{g} +@tab Print the V16SFmode name of the register. +@tab @code{%g0} +@tab @code{%zmm0} +@tab @code{zmm0} @item @code{h} @tab Print the QImode name for a ``high'' register. @tab @code{%h0} @@ -10479,6 +10503,16 @@ high 8 bytes of SSE values. For a memref in (%rax), it generates @tab @code{%l3} @tab @code{.L3} @tab @code{.L3} +@item @code{L} +@tab print the opcode suffix of l. +@tab @code{%L0} +@tab @code{l} +@tab +@item @code{N} +@tab print maskz. +@tab @code{%N7} +@tab @code{@{z@}} +@tab @code{@{z@}} @item @code{p} @tab Print raw symbol name (without syntax-specific prefixes). @tab @code{%p2} @@ -10494,20 +10528,76 @@ issue the bare constant. See @code{p} above. @tab @code{%q0} @tab @code{%rax} @tab @code{rax} +@item @code{Q} +@tab print the opcode suffix of q. +@tab @code{%Q0} +@tab @code{q} +@tab +@item @code{R} +@tab print embedded rounding and sae. +@tab @code{%R4} +@tab @code{@{rn-sae@}, } +@tab @code{, @{rn-sae@}} +@item @code{r} +@tab print only sae. +@tab @code{%r4} +@tab @code{@{sae@}, } +@tab @code{, @{sae@}} +@item @code{s} +@tab print a shift double count, followed by the assemblers argument +delimiterprint the opcode suffix of s. +@tab @code{%s1} +@tab @code{$2, } +@tab @code{2, } +@item @code{S} +@tab print the opcode suffix of s. +@tab @code{%S0} +@tab @code{s} +@tab +@item @code{t} +@tab print the V8SFmode name of the register. +@tab @code{%t5} +@tab @code{%ymm0} +@tab @code{ymm0} +@item @code{T} +@tab print the opcode suffix of t. +@tab @code{%T0} +@tab @code{t} +@tab +@item @code{V} +@tab print naked full integer register name without %. +@tab @code{%V0} +@tab @code{eax} +@tab @code{eax} @item @code{w} @tab Print the HImode name of the register. @tab @code{%w0} @tab @code{%ax} @tab @code{ax} +@item @code{W} +@tab print the opcode suffix of w. +@tab @code{%W0} +@tab @code{w} +@tab +@item @code{x} +@tab print the V4SFmode name of the register. +@tab @code{%x5} +@tab @code{%xmm0} +@tab @code{xmm0} +@item @code{y} +@tab print "st(0)" instead of "st" as a register. +@tab @code{%y6} +@tab @code{%st(0)} +@tab @code{st(0)} @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{Z} +@tab Like @code{z}, with special suffixes for x87 instructions. @end multitable -@code{V} is a special modifier which prints the name of the full integer -register without @code{%}. @anchor{x86floatingpointasmoperands} @subsubsection x86 Floating-Point @code{asm} Operands -- 2.18.1