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 059693858C41 for ; Tue, 5 Dec 2023 09:21:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 059693858C41 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 059693858C41 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=1701768120; cv=none; b=FEEYtSm8z0BhvMCE2oWO1f0PH+hD3b9TbzzL7u1v0CeM6f9ZFFOjr12k25lwyVwsCg7qIHe+uknavjFcYNS+tSOO0GlblYYj/GyCxVoeSnX2jqbb30VZwKo+veRqTsMKOKt7hbfNeg+Rylt/1GwgqhRlHb19GV/p6dIXbsdfkAg= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701768120; c=relaxed/simple; bh=MRbg9QwrikmmjxwbdgT2RVFzPrAU4sFJd6fff4NYfqc=; h=Message-ID:Subject:From:To:Date:MIME-Version; b=K/z4O2dw5RvkzWex3z4rXBbZO1SQDL9d2L/7E9JUiCtIR0CGGuUWpx8oZq9xAeadEnlUJfEyT/CRFHZ8zSQgN5jIDDD6ngoAocAv+Z+SLBJ6iCWiH8zuZnVTYnxdQf9agRy0TPFBymTpVAmLFbrOhO14rR0s1EXEpDsR1phf8Kk= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from loongson.cn (unknown [10.20.4.86]) by gateway (Coremail) with SMTP id _____8Dxl+iy625l4P8+AA--.24157S3; Tue, 05 Dec 2023 17:21:54 +0800 (CST) Received: from [10.20.4.86] (unknown [10.20.4.86]) by localhost.localdomain (Coremail) with SMTP id AQAAf8Bxni+y625lv1JVAA--.57613S3; Tue, 05 Dec 2023 17:21:54 +0800 (CST) Message-ID: Subject: Re: [PATCH v1] LoongArch: Modify the check type of the vector builtin function. From: chenxiaolong To: Xi Ruoyao , gcc-patches@gcc.gnu.org Cc: i@xen0n.name, xuchenghua@loongson.cn, chenglulu@loongson.cn Date: Tue, 05 Dec 2023 17:21:54 +0800 In-Reply-To: References: <20231204121433.54245-1-chenxiaolong@loongson.cn> <60954f58a9de3494d75899e6dd5cdff7ca2685de.camel@xry111.site> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.30.5-1.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID:AQAAf8Bxni+y625lv1JVAA--.57613S3 X-CM-SenderInfo: hfkh05xldrz0tqj6z05rqj20fqof0/1tbiAQAQBWVuiKwFPwAAsB X-Coremail-Antispam: 1Uk129KBj93XoW7WFWDXFW7Cw13JF45tr48Xwc_yoW8AFW3pF WDJF1akr4vya13Zw12vr48uw4ayws7G3W5JrZ5Wr17A3Z8Gr97tF4akFy5ua4xuryFg3WF ya1Ygw1q9F90yFXCm3ZEXasCq-sJn29KB7ZKAUJUUUUU529EdanIXcx71UUUUU7KY7ZEXa sCq-sGcSsGvfJ3Ic02F40EFcxC0VAKzVAqx4xG6I80ebIjqfuFe4nvWSU5nxnvy29KBjDU 0xBIdaVrnRJUUUkjb4IE77IF4wAFF20E14v26r1j6r4UM7CY07I20VC2zVCF04k26cxKx2 IYs7xG6rWj6s0DM7CIcVAFz4kK6r1Y6r17M28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48v e4kI8wA2z4x0Y4vE2Ix0cI8IcVAFwI0_Gr0_Xr1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI 0_Gr0_Cr1l84ACjcxK6I8E87Iv67AKxVW8Jr0_Cr1UM28EF7xvwVC2z280aVCY1x0267AK xVW8Jr0_Cr1UM2AIxVAIcxkEcVAq07x20xvEncxIr21l57IF6xkI12xvs2x26I8E6xACxx 1l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r106r15McIj6I8E87Iv 67AKxVWUJVW8JwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IY64vIr41l42xK82IYc2Ij64 vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2IqxVAqx4xG67AKxVWUJVWUGwC20s026x8G jcxK67AKxVWUGVWUWwC2zVAF1VAY17CE14v26r126r1DMIIYrxkI7VAKI48JMIIF0xvE2I x0cI8IcVAFwI0_Jr0_JF4lIxAIcVC0I7IYx2IY6xkF7I0E14v26r1j6r4UMIIF0xvE42xK 8VAvwI8IcIk0rVWUJVWUCwCI42IY6I8E87Iv67AKxVWUJVW8JwCI42IY6I8E87Iv6xkF7I 0E14v26r1j6r4UYxBIdaVFxhVjvjDU0xZFpf9x07jUsqXUUUUU= X-Spam-Status: No, score=-5.3 required=5.0 tests=BAYES_00,BODY_8BITS,KAM_DMARC_STATUS,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: 在 2023-12-04一的 20:38 +0800,Xi Ruoyao写道: > On Mon, 2023-12-04 at 20:31 +0800, Xi Ruoyao wrote: > > On Mon, 2023-12-04 at 20:14 +0800, chenxiaolong wrote: > > > On LoongArch architecture, using the latest gcc14 in regression > > > test, > > > it is found that the vector test cases in vector directory appear > > > FAIL > > > entries with unmatched pointer types. In order to solve this kind > > > of > > > problem, the type of the variable in the check result is modified > > > with > > > the parameter type defined in the vector builtin function. > > > > IMO we should write something more readable: > > > > static inline > > void ASSERTEQ_64 (int line, const void *_ref, const void *_res) > > { > > if (memcmp (_ref, _res, 16) == 0) > > return; > > > > const char *ref = (const char *)_ref; > > const char *res = (const char *)_res; > > > > printf ("error %s:%d: result mismatch\n", __FILE__, line); > > > > printf ("ref:"); > > for (int i = 0; i < 16; i++) > > printf (" %02x", ref[i]); > > Sorry, should be " %02hhx" here. > > > printf ("\nres:"); > > for (int i = 0; i < 16; i++) > > printf (" %02x", res[i]); > > Likewise. > > > putchar ('\n'); > > abort (); > > } According to your suggestion, the check of the built-in function was modifiedin the simd_correctness_check.h file, and the types of the actual parameters of the built-in function were inconsistent with those of the formal parameters. The problems with the GCC regression test are as follows: ... note: expected 'const void *' but argument is of type '__m128i' error: incompatible type for argument 3 of 'ASSERTEQ_64' ... The reason is that the types used in __m{128i,128,128d} are defined in the vector header file (lsxintrin.h or lasxintrin.h), and their basic types do not match the parameter types corresponding to the functions.