From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by sourceware.org (Postfix) with ESMTP id B9EF63858D33 for ; Fri, 22 Dec 2023 10:00:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B9EF63858D33 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=loongson.cn Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=loongson.cn ARC-Filter: OpenARC Filter v1.0.0 sourceware.org B9EF63858D33 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=114.242.206.163 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1703239204; cv=none; b=JnaD4B+HB7yLifGpDyC0DEC0hLAkiymTAMcEwVHmP2EhOVHY5ebvUa2fyhqhR4DRg3f9ROBgqOf9bOQVY7opD32fWT49BsYICUX0BN718IMrbFeWkyzwPBDvPASbXFyDvZImWMy5lyqHqjxNlPlhrLmjHAWZuaY2Wz9ZTntsVzQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1703239204; c=relaxed/simple; bh=8+uOCok31j1jusLIci5SjN4y0/K8S0rN98koo3fBsA0=; h=Subject:To:From:Message-ID:Date:MIME-Version; b=F31lzsapnYFFcFWhnYeU8i6LaCthYyrSYmu9T4wEgTFNAULRMqWJhvV0B5YV68U3+Ut9KHKO1zpys6hYTUCUsyWsx7NipNHwM9UpDJxxeOzVRXlcae41CkbqTUTIBBu1+N+KuAUinM4Uo+gWE9qdlLCnfcorhXqfkB+FEuoMaCY= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from loongson.cn (unknown [10.20.4.107]) by gateway (Coremail) with SMTP id _____8CxhfAYXoVlM9ADAA--.19331S3; Fri, 22 Dec 2023 17:59:53 +0800 (CST) Received: from [10.20.4.107] (unknown [10.20.4.107]) by localhost.localdomain (Coremail) with SMTP id AQAAf8BxH+UXXoVlwnUFAA--.27634S3; Fri, 22 Dec 2023 17:59:52 +0800 (CST) Subject: Re:[pushed] [PATCH v2] LoongArch: Add asm modifiers to the LSX and LASX directives in the doc. To: chenxiaolong , gcc-patches@gcc.gnu.org Cc: xry111@xry111.site, i@xen0n.name, xuchenghua@loongson.cn References: <20231205064435.61292-1-chenxiaolong@loongson.cn> From: chenglulu Message-ID: Date: Fri, 22 Dec 2023 17:59:51 +0800 User-Agent: Mozilla/5.0 (X11; Linux loongarch64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <20231205064435.61292-1-chenxiaolong@loongson.cn> Content-Type: text/plain; charset=gbk; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-CM-TRANSID:AQAAf8BxH+UXXoVlwnUFAA--.27634S3 X-CM-SenderInfo: xfkh0wpoxo3qxorr0wxvrqhubq/ X-Coremail-Antispam: 1Uk129KBj93XoWxGFWfWF4rCr1kXFWUKr4DGFX_yoW5CF4fpw sFkwnYgrn7Jws29w1fAw48uFs8J3s2yw4UurWxtryqkrn0gryFqr43try29a97Cw1YvrW7 t3yUG3y8Cay5tagCm3ZEXasCq-sJn29KB7ZKAUJUUUU8529EdanIXcx71UUUUU7KY7ZEXa sCq-sGcSsGvfJ3Ic02F40EFcxC0VAKzVAqx4xG6I80ebIjqfuFe4nvWSU5nxnvy29KBjDU 0xBIdaVrnRJUUUv2b4IE77IF4wAFF20E14v26r1j6r4UM7CY07I20VC2zVCF04k26cxKx2 IYs7xG6rWj6s0DM7CIcVAFz4kK6r106r15M28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48v e4kI8wA2z4x0Y4vE2Ix0cI8IcVAFwI0_Gr0_Xr1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI 0_Gr0_Cr1l84ACjcxK6I8E87Iv67AKxVW8Jr0_Cr1UM28EF7xvwVC2z280aVCY1x0267AK xVW8Jr0_Cr1UM2AIxVAIcxkEcVAq07x20xvEncxIr21l57IF6xkI12xvs2x26I8E6xACxx 1l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r106r15McIj6I8E87Iv 67AKxVWUJVW8JwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IY64vIr41lc7I2V7IY0VAS07 AlzVAYIcxG8wCF04k20xvY0x0EwIxGrwCFx2IqxVCFs4IE7xkEbVWUJVW8JwC20s026c02 F40E14v26r1j6r18MI8I3I0E7480Y4vE14v26r106r1rMI8E67AF67kF1VAFwI0_JF0_Jw 1lIxkGc2Ij64vIr41lIxAIcVC0I7IYx2IY67AKxVWUJVWUCwCI42IY6xIIjxv20xvEc7Cj xVAFwI0_Jr0_Gr1lIxAIcVCF04k26cxKx2IYs7xG6r1j6r1xMIIF0xvEx4A2jsIE14v26r 1j6r4UMIIF0xvEx4A2jsIEc7CjxVAFwI0_Jr0_GrUvcSsGvfC2KfnxnUUI43ZEXa7IU1Ek sDUUUUU== X-Spam-Status: No, score=-12.1 required=5.0 tests=BAYES_00,GIT_PATCH_0,KAM_DMARC_STATUS,MIME_CHARSET_FARAWAY,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Pushed to r14-6800. ÔÚ 2023/12/5 ÏÂÎç2:44, chenxiaolong дµÀ: > gcc/ChangeLog: > > * doc/extend.texi:Add modifiers to the vector of asm in the doc. > * doc/md.texi:Refine the description of the modifier 'f' in the doc. > --- > gcc/doc/extend.texi | 47 +++++++++++++++++++++++++++++++++++++++++++++ > gcc/doc/md.texi | 2 +- > 2 files changed, 48 insertions(+), 1 deletion(-) > > diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi > index 32ae15e1d5b..d87a079704c 100644 > --- a/gcc/doc/extend.texi > +++ b/gcc/doc/extend.texi > @@ -11820,10 +11820,57 @@ The list below describes the supported modifiers and their effects for LoongArch > @item @code{d} @tab Same as @code{c}. > @item @code{i} @tab Print the character ''@code{i}'' if the operand is not a register. > @item @code{m} @tab Same as @code{c}, but the printed value is @code{operand - 1}. > +@item @code{u} @tab Print a LASX register. > +@item @code{w} @tab Print a LSX register. > @item @code{X} @tab Print a constant integer operand in hexadecimal. > @item @code{z} @tab Print the operand in its unmodified form, followed by a comma. > @end multitable > > +References to input and output operands in the assembler template of extended > +asm statements can use modifiers to affect the way the operands are formatted > +in the code output to the assembler. For example, the following code uses the > +'w' modifier for LoongArch: > + > +@example > +test-asm.c: > + > +#include > + > +__m128i foo (void) > +@{ > +__m128i a,b,c; > +__asm__ ("vadd.d %w0,%w1,%w2\n\t" > + :"=f" (c) > + :"f" (a),"f" (b)); > + > +return c; > +@} > + > +@end example > + > +@noindent > +The compile command for the test case is as follows: > + > +@example > +gcc test-asm.c -mlsx -S -o test-asm.s > +@end example > + > +@noindent > +The assembly statement produces the following assembly code: > + > +@example > +vadd.d $vr0,$vr0,$vr1 > +@end example > + > +This is a 128-bit vector addition instruction, @code{c} (referred to in the > +template string as %0) is the output, and @code{a} (%1) and @code{b} (%2) are > +the inputs. @code{__m128i} is a vector data type defined in the file > +@code{lsxintrin.h} (@xref{LoongArch SX Vector Intrinsics}). The symbol '=f' > +represents a constraint using a floating-point register as an output type, and > +the 'f' in the input operand represents a constraint using a floating-point > +register operand, which can refer to the definition of a constraint > +(@xref{Constraints}) in gcc. > + > @anchor{riscvOperandmodifiers} > @subsubsection RISC-V Operand Modifiers > > diff --git a/gcc/doc/md.texi b/gcc/doc/md.texi > index 536ce997f01..2274da5ff69 100644 > --- a/gcc/doc/md.texi > +++ b/gcc/doc/md.texi > @@ -2881,7 +2881,7 @@ $r1h > @item LoongArch---@file{config/loongarch/constraints.md} > @table @code > @item f > -A floating-point register (if available). > +A floating-point or vector register (if available). > @item k > A memory operand whose address is formed by a base register and > (optionally scaled) index register.