From patchwork Mon Sep 11 03:44:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: chenxiaolong X-Patchwork-Id: 137874 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ab0a:0:b0:3f2:4152:657d with SMTP id m10csp1857474vqo; Sun, 10 Sep 2023 20:47:36 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHXGShKrGmzwPUmBT3x1w2tuiDs/msTZt4iAdj32Mq4lvMS7DVMGA3APS2B0du2M15qSKEJ X-Received: by 2002:a17:906:1db2:b0:99c:85af:7aa6 with SMTP id u18-20020a1709061db200b0099c85af7aa6mr8222028ejh.28.1694404055817; Sun, 10 Sep 2023 20:47:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694404055; cv=none; d=google.com; s=arc-20160816; b=ln3wjYb+SJGffcp4QNO4IlSej499j5pl0irHJQT8zsiyp5fVoxdL4o4ihIRcEBKSCa M7c/eWJ4PjzhUDdeW+nXBFN6PG+EPoetB9q+WgIzuPXGCxO/Zc9hFF1IEeGbTIaUHtEL rBSFIrCYFnay6nTtZPu+qvF8QqgwziZbAdXPoyPp9OoJQaVf1I97FoN7cSYukQ8q2zvK qSBOsTf9CGZ+pY0V4Ej0SSMwh1R0qks+l4dpGwYzdAZmGnZcYPMmQU703mAVtVutFWyh i95SSxHy3YcBq9bWK8gkbRx+Ru4i4Kf6obL8LsaojfuA9FRtDW71WAVWvWDHVvmNMbXe RRWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dmarc-filter:delivered-to; bh=R7V73w2jK8oRRkWKth5D455cY8tZTNMUbYiRVEfG9go=; fh=BpFCyCzVJo4znJIvOjeDfKzcGsF6Q+JgJbJ+1ev/kM4=; b=nXYckqvlOcZJpk1heo925rFT1BaJgGfEpS6xcn4HnYdXyvLl40avFWY2DC3LjqFdo2 Hue5FLLNEcGswXCKJtaHIY1mkACZVAinEAaf/gMwRHDrtsP3N1iSwJQ49mQ97Zfrz/VA eC+6/6YKyiAXmGZtRtvVEh3EOs/SUs5eInRu4mQteWfXWUCAaEzJvP3nITAzMgJjIk2e taqJhb3XrmMmo2tdi9II/E1NxQ3u6ki2TaDqyPv0N7RN+8o2TCtgRkW4apU80s5BoRfV YqgGX9pHBAmjvjrErw3/WJ0lagvpya8U2+bLcfVJ8Lb70Sazje6iTEK5qL9YrCzlfmj2 8ddQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id lc14-20020a170906dfee00b0099e028b0201si5839924ejc.962.2023.09.10.20.47.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 Sep 2023 20:47:35 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B8E773831390 for ; Mon, 11 Sep 2023 03:46:13 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from eggs.gnu.org (eggs.gnu.org [IPv6:2001:470:142:3::10]) by sourceware.org (Postfix) with ESMTPS id 003383857705 for ; Mon, 11 Sep 2023 03:45:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 003383857705 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=loongson.cn Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=loongson.cn Received: from mail.loongson.cn ([114.242.206.163]) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qfXro-00074G-Lb for gcc-patches@gcc.gnu.org; Sun, 10 Sep 2023 23:45:44 -0400 Received: from loongson.cn (unknown [10.10.130.252]) by gateway (Coremail) with SMTP id _____8BxuOhbjf5k4EQkAA--.35357S3; Mon, 11 Sep 2023 11:45:31 +0800 (CST) Received: from slurm-master.loongson.cn (unknown [10.10.130.252]) by localhost.localdomain (Coremail) with SMTP id AQAAf8Dx_yNXjf5kzKZ2AA--.44820S5; Mon, 11 Sep 2023 11:45:30 +0800 (CST) From: Xiaolong Chen To: gcc-patches@gcc.gnu.org Subject: [PATCH v3 1/9] LoongArch: Add tests of -mstrict-align option. Date: Mon, 11 Sep 2023 11:44:31 +0800 Message-Id: <20230911034439.8266-2-chenxiaolong@loongson.cn> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230911034439.8266-1-chenxiaolong@loongson.cn> References: <20230911034439.8266-1-chenxiaolong@loongson.cn> MIME-Version: 1.0 X-CM-TRANSID: AQAAf8Dx_yNXjf5kzKZ2AA--.44820S5 X-CM-SenderInfo: hfkh05xldrz0tqj6z05rqj20fqof0/1tbiAQALBWT9QjYDlAAAs1 X-Coremail-Antispam: 1Uk129KBj9xXoWruw4kJw4fJw13Zw13Gw13Jrc_yoWfJrcEyF y7X3s3Gr4Uua1xCFW0vryUCF9akws3XFySqFWFqFs7XFyDXFs0yFWDJFZrZFyjkr18JFZx Ga9avrnayF9xtosvyTuYvTs0mTUanT9S1TB71UUUUUDqnTZGkaVYY2UrUUUUj1kv1TuYvT s0mT0YCTnIWjqI5I8CrVACY4xI64kE6c02F40Ex7xfYxn0WfASr-VFAUDa7-sFnT9fnUUI cSsGvfJTRUUUb7AYFVCjjxCrM7AC8VAFwI0_Jr0_Gr1l1xkIjI8I6I8E6xAIw20EY4v20x vaj40_Wr0E3s1l1IIY67AEw4v_Jrv_JF1l8cAvFVAK0II2c7xJM28CjxkF64kEwVA0rcxS w2x7M28EF7xvwVC0I7IYx2IY67AKxVW5JVW7JwA2z4x0Y4vE2Ix0cI8IcVCY1x0267AKxV W8JVWxJwA2z4x0Y4vEx4A2jsIE14v26r4UJVWxJr1l84ACjcxK6I8E87Iv6xkF7I0E14v2 6r4UJVWxJr1le2I262IYc4CY6c8Ij28IcVAaY2xG8wAqjxCEc2xF0cIa020Ex4CE44I27w Aqx4xG64xvF2IEw4CE5I8CrVC2j2WlYx0E2Ix0cI8IcVAFwI0_JF0_Jw1lYx0Ex4A2jsIE 14v26r1j6r4UMcvjeVCFs4IE7xkEbVWUJVW8JwACjcxG0xvY0x0EwIxGrwCF04k20xvY0x 0EwIxGrwCFx2IqxVCFs4IE7xkEbVWUJVW8JwC20s026c02F40E14v26r1j6r18MI8I3I0E 7480Y4vE14v26r106r1rMI8E67AF67kF1VAFwI0_JF0_Jw1lIxkGc2Ij64vIr41lIxAIcV C0I7IYx2IY67AKxVWUJVWUCwCI42IY6xIIjxv20xvEc7CjxVAFwI0_Jr0_Gr1lIxAIcVCF 04k26cxKx2IYs7xG6r1j6r1xMIIF0xvEx4A2jsIE14v26r1j6r4UMIIF0xvEx4A2jsIEc7 CjxVAFwI0_Jr0_GrUvcSsGvfC2KfnxnUUI43ZEXa7IU82g43UUUUU== Received-SPF: pass client-ip=114.242.206.163; envelope-from=chenxiaolong@loongson.cn; helo=mail.loongson.cn X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Status: No, score=-13.7 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, KAM_SHORT, SPF_FAIL, SPF_HELO_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Xiaolong Chen , xuchenghua@loongson.cn, chenglulu@loongson.cn, i@xen0n.name Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1776711427261277556 X-GMAIL-MSGID: 1776711427261277556 gcc/testsuite/ChangeLog: * gcc.target/loongarch/strict-align.c: New test. --- gcc/testsuite/gcc.target/loongarch/strict-align.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 gcc/testsuite/gcc.target/loongarch/strict-align.c diff --git a/gcc/testsuite/gcc.target/loongarch/strict-align.c b/gcc/testsuite/gcc.target/loongarch/strict-align.c new file mode 100644 index 00000000000..040d849584b --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/strict-align.c @@ -0,0 +1,12 @@ +/* { dg-do compile } */ +/* { dg-options "-Ofast -mstrict-align -mlasx" } */ +/* { dg-final { scan-assembler-not "vfadd.s" } } */ + +void +foo (float *restrict x, float *restrict y) +{ + x[0] = x[0] + y[0]; + x[1] = x[1] + y[1]; + x[2] = x[2] + y[2]; + x[3] = x[3] + y[3]; +} From patchwork Mon Sep 11 03:44:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: chenxiaolong X-Patchwork-Id: 137873 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ab0a:0:b0:3f2:4152:657d with SMTP id m10csp1857283vqo; Sun, 10 Sep 2023 20:46:54 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHTykg1UHTN/rZRpZoFR93ViIre7jW5KxA++M+We/sz7i+3INWLIfBQE/eGvN3kTZ4C9/eo X-Received: by 2002:a2e:990b:0:b0:2bd:f8:1b6a with SMTP id v11-20020a2e990b000000b002bd00f81b6amr5753151lji.36.1694404013805; Sun, 10 Sep 2023 20:46:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694404013; cv=none; d=google.com; s=arc-20160816; b=cVjtq4dhLaXxG5xYOc/8txNHHYAJBttAzg3Iq8KVAzjW3fqydUUbm3cpYeTRsI81kW gm3S6EE461psm2g1rfjnbFXFy0WRG7Ehrz3YDltfz+NXW1845IxCbJBGagCt7RC5hft3 e+brTRNSI9cQwENM+rX89NtrbQEPUeZC5xe4socL0xkdoB33qkvedHHiGF4+YvptAngi CmDJPXPhzprCm1QP3e+UtiGUhLADuMstldiMLatdhcxGlWVCJA0ND4yiZHIrI+X2uhQw PWjcsBRZpLoXQKkywhRg27S2ndMUvut0fZE30XsMX/nwvnoSFuG2PI5Iq1iD4s2TpFe3 aNVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dmarc-filter:delivered-to; bh=WA9R7l/imekZbfO0nvZE+5FEjUIZFXkFGLbrQ9y97VI=; fh=BpFCyCzVJo4znJIvOjeDfKzcGsF6Q+JgJbJ+1ev/kM4=; b=twMduQoMPTgNWRm7vu7IRSlLzSHY1Uw09Uq1EIFBtr1l+UpiJkud72ucfOsSn6ZQ21 IfLOz/p2wI9VO6YCzQUdHnJIF1RQnsabpMfww+6RHImmTcAqnihuqaW/z74ixNvnuZdJ 1CR9zizyldU+46uLhDA3Z1zvJZZnvjUx+7JP3YVJFc0BWnL4DxIuCZiFz/UifiKJCFYX wKRMEmPBrO0a9H5FDbrPpnViL9SkdutyDTRH3MwIopLiC/yTLqOMf04vcGMvQkoikC1z 8W3U6jF0qVZWFJCNCHP3v2UVoCRTTfviKyVq0Hky1vx2EwxOVON5d4gjh1Znzwc2Pf8j dCSQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id mh25-20020a170906eb9900b009a59b604305si5975831ejb.406.2023.09.10.20.46.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 Sep 2023 20:46:53 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 2D1FC38515F7 for ; Mon, 11 Sep 2023 03:46:03 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by sourceware.org (Postfix) with ESMTP id 619053858D3C for ; Mon, 11 Sep 2023 03:45:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 619053858D3C Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=loongson.cn Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=loongson.cn Received: from loongson.cn (unknown [10.10.130.252]) by gateway (Coremail) with SMTP id _____8BxXetejf5k4kQkAA--.288S3; Mon, 11 Sep 2023 11:45:34 +0800 (CST) Received: from slurm-master.loongson.cn (unknown [10.10.130.252]) by localhost.localdomain (Coremail) with SMTP id AQAAf8Dx_yNXjf5kzKZ2AA--.44820S6; Mon, 11 Sep 2023 11:45:32 +0800 (CST) From: Xiaolong Chen To: gcc-patches@gcc.gnu.org Subject: [PATCH v3 2/9] LoongArch: Add testsuite framework for Loongson SX/ASX. Date: Mon, 11 Sep 2023 11:44:32 +0800 Message-Id: <20230911034439.8266-3-chenxiaolong@loongson.cn> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230911034439.8266-1-chenxiaolong@loongson.cn> References: <20230911034439.8266-1-chenxiaolong@loongson.cn> MIME-Version: 1.0 X-CM-TRANSID: AQAAf8Dx_yNXjf5kzKZ2AA--.44820S6 X-CM-SenderInfo: hfkh05xldrz0tqj6z05rqj20fqof0/1tbiAQALBWT9QjYDlgAAs3 X-Coremail-Antispam: 1Uk129KBj93XoWxZw1kZr45JryxWr48CF1xWFX_yoWrJF17pa y7Zr1a9F4xWa9xWrnrWay5AF45ZFn7GFWavFyft3y8Cry7t3sFvF1kKrnxXFy3Ja45Ar4S 93Zxuw1UXan8ZabCm3ZEXasCq-sJn29KB7ZKAUJUUUU8529EdanIXcx71UUUUU7KY7ZEXa sCq-sGcSsGvfJ3Ic02F40EFcxC0VAKzVAqx4xG6I80ebIjqfuFe4nvWSU5nxnvy29KBjDU 0xBIdaVrnRJUUUkFb4IE77IF4wAFF20E14v26r1j6r4UM7CY07I20VC2zVCF04k26cxKx2 IYs7xG6rWj6s0DM7CIcVAFz4kK6r1j6r18M28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48v e4kI8wA2z4x0Y4vE2Ix0cI8IcVAFwI0_Xr0_Ar1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI 0_Gr0_Cr1l84ACjcxK6I8E87Iv67AKxVW8Jr0_Cr1UM28EF7xvwVC2z280aVCY1x0267AK xVW8Jr0_Cr1UM2AIxVAIcxkEcVAq07x20xvEncxIr21l57IF6xkI12xvs2x26I8E6xACxx 1l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r126r1DMcIj6I8E87Iv 67AKxVWUJVW8JwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IYc2Ij64vIr41l42xK82IYc2 Ij64vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2IqxVAqx4xG67AKxVWUJVWUGwC20s02 6x8GjcxK67AKxVWUGVWUWwC2zVAF1VAY17CE14v26r126r1DMIIYrxkI7VAKI48JMIIF0x vE2Ix0cI8IcVAFwI0_JFI_Gr1lIxAIcVC0I7IYx2IY6xkF7I0E14v26r1j6r4UMIIF0xvE 42xK8VAvwI8IcIk0rVWUJVWUCwCI42IY6I8E87Iv67AKxVWUJVW8JwCI42IY6I8E87Iv6x kF7I0E14v26r1j6r4UYxBIdaVFxhVjvjDU0xZFpf9x07UMpBfUUUUU= X-Spam-Status: No, score=-12.1 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, KAM_SHORT, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Xiaolong Chen , xuchenghua@loongson.cn, chenglulu@loongson.cn, i@xen0n.name Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1776711383079196242 X-GMAIL-MSGID: 1776711383079196242 gcc/testsuite/ChangeLog: * gcc.target/loongarch/vector/loongarch-vector.exp: New test. * gcc.target/loongarch/vector/simd_correctness_check.h: New test. --- .../loongarch/vector/loongarch-vector.exp | 42 +++++++++++++++ .../loongarch/vector/simd_correctness_check.h | 54 +++++++++++++++++++ 2 files changed, 96 insertions(+) create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/loongarch-vector.exp create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/simd_correctness_check.h diff --git a/gcc/testsuite/gcc.target/loongarch/vector/loongarch-vector.exp b/gcc/testsuite/gcc.target/loongarch/vector/loongarch-vector.exp new file mode 100644 index 00000000000..f33bad82cb2 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/loongarch-vector.exp @@ -0,0 +1,42 @@ +#Copyright(C) 2021 - 2023 Free Software Foundation, Inc. + +#This program is free software; you can redistribute it and / or modify +#it under the terms of the GNU General Public License as published by +#the Free Software Foundation; either version 3 of the License, or +#(at your option) any later version. +# +#This program is distributed in the hope that it will be useful, +#but WITHOUT ANY WARRANTY; without even the implied warranty of +#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the +#GNU General Public License for more details. +# +#You should have received a copy of the GNU General Public License +#along with GCC; see the file COPYING3.If not see +# . + +#GCC testsuite that uses the `dg.exp' driver. + +#Exit immediately if this isn't a LoongArch target. +if ![istarget loongarch*-*-*] then { + return +} + +#Load support procs. +load_lib gcc-dg.exp + +#If a testcase doesn't have special options, use these. +global DEFAULT_CFLAGS +if ![info exists DEFAULT_CFLAGS] then { + set DEFAULT_CFLAGS " -mlasx" +} + +#Initialize `dg'. +dg-init + +#Main loop. +dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/lsx/*.\[cS\]]] \ + "" $DEFAULT_CFLAGS +dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/lasx/*.\[cS\]]] \ + "" $DEFAULT_CFLAGS +# All done. +dg-finish diff --git a/gcc/testsuite/gcc.target/loongarch/vector/simd_correctness_check.h b/gcc/testsuite/gcc.target/loongarch/vector/simd_correctness_check.h new file mode 100644 index 00000000000..eb7fbd59cc7 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/simd_correctness_check.h @@ -0,0 +1,54 @@ +#include +#include +#include + +#define ASSERTEQ_64(line, ref, res) \ + do \ + { \ + int fail = 0; \ + for (size_t i = 0; i < sizeof (res) / sizeof (res[0]); ++i) \ + { \ + long *temp_ref = &ref[i], *temp_res = &res[i]; \ + if (abs (*temp_ref - *temp_res) > 0) \ + { \ + printf (" error: %s at line %ld , expected " #ref \ + "[%ld]:0x%lx, got: 0x%lx\n", \ + __FILE__, line, i, *temp_ref, *temp_res); \ + fail = 1; \ + } \ + } \ + if (fail == 1) \ + abort (); \ + } \ + while (0) + +#define ASSERTEQ_32(line, ref, res) \ + do \ + { \ + int fail = 0; \ + for (size_t i = 0; i < sizeof (res) / sizeof (res[0]); ++i) \ + { \ + int *temp_ref = &ref[i], *temp_res = &res[i]; \ + if (abs (*temp_ref - *temp_res) > 0) \ + { \ + printf (" error: %s at line %ld , expected " #ref \ + "[%ld]:0x%x, got: 0x%x\n", \ + __FILE__, line, i, *temp_ref, *temp_res); \ + fail = 1; \ + } \ + } \ + if (fail == 1) \ + abort (); \ + } \ + while (0) + +#define ASSERTEQ_int(line, ref, res) \ + do \ + { \ + if (ref != res) \ + { \ + printf (" error: %s at line %ld , expected %d, got %d\n", __FILE__, \ + line, ref, res); \ + } \ + } \ + while (0) From patchwork Mon Sep 11 03:44:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: chenxiaolong X-Patchwork-Id: 137876 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ab0a:0:b0:3f2:4152:657d with SMTP id m10csp1858082vqo; Sun, 10 Sep 2023 20:50:07 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFigAVvwJiyrB/v444hlgLMwvIywP5Z+83HPIzpU5FKWOpBNoj6mDjMOZPYs+Eo2LgUHFYs X-Received: by 2002:a2e:9f57:0:b0:2bc:bef0:8612 with SMTP id v23-20020a2e9f57000000b002bcbef08612mr6908301ljk.23.1694404207135; Sun, 10 Sep 2023 20:50:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694404207; cv=none; d=google.com; s=arc-20160816; b=TDLa2ogio4P2EY4KdOnKo1nD4Tp94/4jwLSvZIj+DSuVRHiUeqLnQIh9bUqAm/0Xd4 NbRA5H23avAOxC2jzSGfDrzX7cB6K5CZ/NhrBZ0CD/To0y7doyhidAuiE1PiP2OV3kc7 mkgsK1fI/dlCudGdTlK41U/NkYHyMgDgYe08nXUvhL69uPSGzGq0Ezaa+0/MWaNflQnn Wh5oRwxnfQZ+mBnqS4kODP115aF8AJpleLBcyE+9Tcqgtcr5XxHC4mNdjdUAAAaRB+Vp j3ncpisDkSG/Zj6Jew6nrHDoqVNmMrB1J66WeXrPuHnAik7UF/NgF3CiZjByizChT2yY is4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dmarc-filter:delivered-to; bh=sni+n9CxylcwHTPifjyAjc768LnxSDX+4o+wtsL3uHk=; fh=BpFCyCzVJo4znJIvOjeDfKzcGsF6Q+JgJbJ+1ev/kM4=; b=A2OXzfmtgaUhc5SMeC9hihkAw36pWn237Io9rRS7xZg8tsbFopV9rx9pbVYzs/pXJy S8GnDMUaMpOTogY931xgCYSYKFoslyyXI+NNak5T3l+OMaiwkBq3tbTYga0wGvoa7yrN WJF/Rp4X22OhzbUZ4KPWiSdlrebkuiFrC3zW1qZTRdd2WRb7heHqS+wWH0G+oIaLzGDJ a1IpBJSY9Ub9wUArs374cAGe/Pz+EyaVDJRTKhVzl2S7NH7H6YdRqERe8Iz042kP9iH4 J4VE9kMNl+GUw29boEJ4dRYqH1jQY2D3MFzdZdm3d4E+Ln64RYzkrVfKhjBzVEC3+l9W xLDg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id gs8-20020a170906f18800b009a633d5a432si5568725ejb.252.2023.09.10.20.50.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 Sep 2023 20:50:07 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C3DF838279A6 for ; Mon, 11 Sep 2023 03:46:44 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by sourceware.org (Postfix) with ESMTP id 7D9C83858407 for ; Mon, 11 Sep 2023 03:45:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7D9C83858407 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=loongson.cn Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=loongson.cn Received: from loongson.cn (unknown [10.10.130.252]) by gateway (Coremail) with SMTP id _____8AxqOhgjf5k5kQkAA--.34876S3; Mon, 11 Sep 2023 11:45:36 +0800 (CST) Received: from slurm-master.loongson.cn (unknown [10.10.130.252]) by localhost.localdomain (Coremail) with SMTP id AQAAf8Dx_yNXjf5kzKZ2AA--.44820S7; Mon, 11 Sep 2023 11:45:35 +0800 (CST) From: Xiaolong Chen To: gcc-patches@gcc.gnu.org Subject: [PATCH v3 3/9] LoongArch: Add tests for Loongson SX builtin functions. Date: Mon, 11 Sep 2023 11:44:33 +0800 Message-Id: <20230911034439.8266-4-chenxiaolong@loongson.cn> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230911034439.8266-1-chenxiaolong@loongson.cn> References: <20230911034439.8266-1-chenxiaolong@loongson.cn> MIME-Version: 1.0 X-CM-TRANSID: AQAAf8Dx_yNXjf5kzKZ2AA--.44820S7 X-CM-SenderInfo: hfkh05xldrz0tqj6z05rqj20fqof0/1tbiAQALBWT9QjYDmAAAs5 X-Coremail-Antispam: 1Uk129KBj9DXoWDKF4xGryDAw1DXw4fCF17urX_yoW8Gw4kZF gEga12gr4DZF1qyrW2y3yxGryrJa9xGr1jv3Z3Xa40q3W7tr1DZ3Z0q34DuF18W3y7XFy7 J3Z5WFy7uF18Xa1vqosvyTuYvTs0mTUanT9S1TB71UUUUUDqnTZGkaVYY2UrUUUUj1kv1T uYvTs0mT0YCTnIWjqI5I8CrVACY4xI64kE6c02F40Ex7xfYxn0WfASr-VFAUDa7-sFnT9f nUUIcSsGvfJTRUUUb7AYFVCjjxCrM7AC8VAFwI0_Jr0_Gr1l1xkIjI8I6I8E6xAIw20EY4 v20xvaj40_Wr0E3s1l1IIY67AEw4v_Jrv_JF1l8cAvFVAK0II2c7xJM28CjxkF64kEwVA0 rcxSw2x7M28EF7xvwVC0I7IYx2IY67AKxVW5JVW7JwA2z4x0Y4vE2Ix0cI8IcVCY1x0267 AKxVW8JVWxJwA2z4x0Y4vEx4A2jsIE14v26r4UJVWxJr1l84ACjcxK6I8E87Iv6xkF7I0E 14v26r4UJVWxJr1le2I262IYc4CY6c8Ij28IcVAaY2xG8wAqjxCEc2xF0cIa020Ex4CE44 I27wAqx4xG64xvF2IEw4CE5I8CrVC2j2WlYx0E2Ix0cI8IcVAFwI0_Jw0_WrylYx0Ex4A2 jsIE14v26r4j6F4UMcvjeVCFs4IE7xkEbVWUJVW8JwACjcxG0xvY0x0EwIxGrwCF04k20x vY0x0EwIxGrwCFx2IqxVCFs4IE7xkEbVWUJVW8JwC20s026c02F40E14v26r1j6r18MI8I 3I0E7480Y4vE14v26r106r1rMI8E67AF67kF1VAFwI0_JF0_Jw1lIxkGc2Ij64vIr41lIx AIcVC0I7IYx2IY67AKxVWUCVW8JwCI42IY6xIIjxv20xvEc7CjxVAFwI0_Jr0_Gr1lIxAI cVCF04k26cxKx2IYs7xG6r1j6r1xMIIF0xvEx4A2jsIE14v26r1j6r4UMIIF0xvEx4A2js IEc7CjxVAFwI0_Jr0_GrUvcSsGvfC2KfnxnUUI43ZEXa7IU8l38UUUUUU== X-Spam-Status: No, score=-12.2 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, KAM_SHORT, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Xiaolong Chen , xuchenghua@loongson.cn, chenglulu@loongson.cn, i@xen0n.name Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1776711585644074701 X-GMAIL-MSGID: 1776711585644074701 gcc/testsuite/ChangeLog: * gcc.target/loongarch/vector/lsx/lsx-builtin.c: New test. --- .../loongarch/vector/lsx/lsx-builtin.c | 5038 +++++++++++++++++ 1 file changed, 5038 insertions(+) create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-builtin.c diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-builtin.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-builtin.c new file mode 100644 index 00000000000..dcc8f9211bd --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-builtin.c @@ -0,0 +1,5038 @@ +/* Test builtins for LOONGARCH LSX ASE instructions */ +/* { dg-do compile } */ +/* { dg-options "-mlsx" } */ +/* { dg-final { scan-assembler-times "lsx_vsll_b:.*vsll\\.b.*lsx_vsll_b" 1 } } + */ +/* { dg-final { scan-assembler-times "lsx_vsll_h:.*vsll\\.h.*lsx_vsll_h" 1 } } + */ +/* { dg-final { scan-assembler-times "lsx_vsll_w:.*vsll\\.w.*lsx_vsll_w" 1 } } + */ +/* { dg-final { scan-assembler-times "lsx_vsll_d:.*vsll\\.d.*lsx_vsll_d" 1 } } + */ +/* { dg-final { scan-assembler-times "lsx_vslli_b:.*vslli\\.b.*lsx_vslli_b" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vslli_h:.*vslli\\.h.*lsx_vslli_h" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vslli_w:.*vslli\\.w.*lsx_vslli_w" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vslli_d:.*vslli\\.d.*lsx_vslli_d" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vsra_b:.*vsra\\.b.*lsx_vsra_b" 1 } } + */ +/* { dg-final { scan-assembler-times "lsx_vsra_h:.*vsra\\.h.*lsx_vsra_h" 1 } } + */ +/* { dg-final { scan-assembler-times "lsx_vsra_w:.*vsra\\.w.*lsx_vsra_w" 1 } } + */ +/* { dg-final { scan-assembler-times "lsx_vsra_d:.*vsra\\.d.*lsx_vsra_d" 1 } } + */ +/* { dg-final { scan-assembler-times "lsx_vsrai_b:.*vsrai\\.b.*lsx_vsrai_b" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vsrai_h:.*vsrai\\.h.*lsx_vsrai_h" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vsrai_w:.*vsrai\\.w.*lsx_vsrai_w" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vsrai_d:.*vsrai\\.d.*lsx_vsrai_d" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vsrar_b:.*vsrar\\.b.*lsx_vsrar_b" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vsrar_h:.*vsrar\\.h.*lsx_vsrar_h" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vsrar_w:.*vsrar\\.w.*lsx_vsrar_w" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vsrar_d:.*vsrar\\.d.*lsx_vsrar_d" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vsrari_b:.*vsrari\\.b.*lsx_vsrari_b" + * 1 } } */ +/* { dg-final { scan-assembler-times "lsx_vsrari_h:.*vsrari\\.h.*lsx_vsrari_h" + * 1 } } */ +/* { dg-final { scan-assembler-times "lsx_vsrari_w:.*vsrari\\.w.*lsx_vsrari_w" + * 1 } } */ +/* { dg-final { scan-assembler-times "lsx_vsrari_d:.*vsrari\\.d.*lsx_vsrari_d" + * 1 } } */ +/* { dg-final { scan-assembler-times "lsx_vsrl_b:.*vsrl\\.b.*lsx_vsrl_b" 1 } } + */ +/* { dg-final { scan-assembler-times "lsx_vsrl_h:.*vsrl\\.h.*lsx_vsrl_h" 1 } } + */ +/* { dg-final { scan-assembler-times "lsx_vsrl_w:.*vsrl\\.w.*lsx_vsrl_w" 1 } } + */ +/* { dg-final { scan-assembler-times "lsx_vsrl_d:.*vsrl\\.d.*lsx_vsrl_d" 1 } } + */ +/* { dg-final { scan-assembler-times "lsx_vsrli_b:.*vsrli\\.b.*lsx_vsrli_b" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vsrli_h:.*vsrli\\.h.*lsx_vsrli_h" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vsrli_w:.*vsrli\\.w.*lsx_vsrli_w" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vsrli_d:.*vsrli\\.d.*lsx_vsrli_d" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vsrlr_b:.*vsrlr\\.b.*lsx_vsrlr_b" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vsrlr_h:.*vsrlr\\.h.*lsx_vsrlr_h" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vsrlr_w:.*vsrlr\\.w.*lsx_vsrlr_w" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vsrlr_d:.*vsrlr\\.d.*lsx_vsrlr_d" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vsrlri_b:.*vsrlri\\.b.*lsx_vsrlri_b" + * 1 } } */ +/* { dg-final { scan-assembler-times "lsx_vsrlri_h:.*vsrlri\\.h.*lsx_vsrlri_h" + * 1 } } */ +/* { dg-final { scan-assembler-times "lsx_vsrlri_w:.*vsrlri\\.w.*lsx_vsrlri_w" + * 1 } } */ +/* { dg-final { scan-assembler-times "lsx_vsrlri_d:.*vsrlri\\.d.*lsx_vsrlri_d" + * 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vbitclr_b:.*vbitclr\\.b.*lsx_vbitclr_b" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vbitclr_h:.*vbitclr\\.h.*lsx_vbitclr_h" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vbitclr_w:.*vbitclr\\.w.*lsx_vbitclr_w" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vbitclr_d:.*vbitclr\\.d.*lsx_vbitclr_d" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vbitclri_b:.*vbitclri\\.b.*lsx_vbitclri_b" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vbitclri_h:.*vbitclri\\.h.*lsx_vbitclri_h" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vbitclri_w:.*vbitclri\\.w.*lsx_vbitclri_w" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vbitclri_d:.*vbitclri\\.d.*lsx_vbitclri_d" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vbitset_b:.*vbitset\\.b.*lsx_vbitset_b" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vbitset_h:.*vbitset\\.h.*lsx_vbitset_h" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vbitset_w:.*vbitset\\.w.*lsx_vbitset_w" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vbitset_d:.*vbitset\\.d.*lsx_vbitset_d" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vbitseti_b:.*vbitseti\\.b.*lsx_vbitseti_b" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vbitseti_h:.*vbitseti\\.h.*lsx_vbitseti_h" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vbitseti_w:.*vbitseti\\.w.*lsx_vbitseti_w" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vbitseti_d:.*vbitseti\\.d.*lsx_vbitseti_d" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vbitrev_b:.*vbitrev\\.b.*lsx_vbitrev_b" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vbitrev_h:.*vbitrev\\.h.*lsx_vbitrev_h" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vbitrev_w:.*vbitrev\\.w.*lsx_vbitrev_w" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vbitrev_d:.*vbitrev\\.d.*lsx_vbitrev_d" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vbitrevi_b:.*vbitrevi\\.b.*lsx_vbitrevi_b" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vbitrevi_h:.*vbitrevi\\.h.*lsx_vbitrevi_h" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vbitrevi_w:.*vbitrevi\\.w.*lsx_vbitrevi_w" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vbitrevi_d:.*vbitrevi\\.d.*lsx_vbitrevi_d" 1 } } */ +/* { dg-final { scan-assembler-times "lsx_vadd_b:.*vadd\\.b.*lsx_vadd_b" 1 } } + */ +/* { dg-final { scan-assembler-times "lsx_vadd_h:.*vadd\\.h.*lsx_vadd_h" 1 } } + */ +/* { dg-final { scan-assembler-times "lsx_vadd_w:.*vadd\\.w.*lsx_vadd_w" 1 } } + */ +/* { dg-final { scan-assembler-times "lsx_vadd_d:.*vadd\\.d.*lsx_vadd_d" 1 } } + */ +/* { dg-final { scan-assembler-times "lsx_vaddi_bu:.*vaddi\\.bu.*lsx_vaddi_bu" + * 1 } } */ +/* { dg-final { scan-assembler-times "lsx_vaddi_hu:.*vaddi\\.hu.*lsx_vaddi_hu" + * 1 } } */ +/* { dg-final { scan-assembler-times "lsx_vaddi_wu:.*vaddi\\.wu.*lsx_vaddi_wu" + * 1 } } */ +/* { dg-final { scan-assembler-times "lsx_vaddi_du:.*vaddi\\.du.*lsx_vaddi_du" + * 1 } } */ +/* { dg-final { scan-assembler-times "lsx_vsub_b:.*vsub\\.b.*lsx_vsub_b" 1 } } + */ +/* { dg-final { scan-assembler-times "lsx_vsub_h:.*vsub\\.h.*lsx_vsub_h" 1 } } + */ +/* { dg-final { scan-assembler-times "lsx_vsub_w:.*vsub\\.w.*lsx_vsub_w" 1 } } + */ +/* { dg-final { scan-assembler-times "lsx_vsub_d:.*vsub\\.d.*lsx_vsub_d" 1 } } + */ +/* { dg-final { scan-assembler-times "lsx_vsubi_bu:.*vsubi\\.bu.*lsx_vsubi_bu" + * 1 } } */ +/* { dg-final { scan-assembler-times "lsx_vsubi_hu:.*vsubi\\.hu.*lsx_vsubi_hu" + * 1 } } */ +/* { dg-final { scan-assembler-times "lsx_vsubi_wu:.*vsubi\\.wu.*lsx_vsubi_wu" + * 1 } } */ +/* { dg-final { scan-assembler-times "lsx_vsubi_du:.*vsubi\\.du.*lsx_vsubi_du" + * 1 } } */ +/* { dg-final { scan-assembler-times "lsx_vmax_b:.*vmax\\.b.*lsx_vmax_b" 1 } } + */ +/* { dg-final { scan-assembler-times "lsx_vmax_h:.*vmax\\.h.*lsx_vmax_h" 1 } } + */ +/* { dg-final { scan-assembler-times "lsx_vmax_w:.*vmax\\.w.*lsx_vmax_w" 1 } } + */ +/* { dg-final { scan-assembler-times "lsx_vmax_d:.*vmax\\.d.*lsx_vmax_d" 1 } } + */ +/* { dg-final { scan-assembler-times "lsx_vmaxi_b:.*vmaxi\\.b.*lsx_vmaxi_b" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vmaxi_h:.*vmaxi\\.h.*lsx_vmaxi_h" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vmaxi_w:.*vmaxi\\.w.*lsx_vmaxi_w" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vmaxi_d:.*vmaxi\\.d.*lsx_vmaxi_d" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vmax_bu:.*vmax\\.bu.*lsx_vmax_bu" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vmax_hu:.*vmax\\.hu.*lsx_vmax_hu" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vmax_wu:.*vmax\\.wu.*lsx_vmax_wu" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vmax_du:.*vmax\\.du.*lsx_vmax_du" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vmaxi_bu:.*vmaxi\\.bu.*lsx_vmaxi_bu" + * 1 } } */ +/* { dg-final { scan-assembler-times "lsx_vmaxi_hu:.*vmaxi\\.hu.*lsx_vmaxi_hu" + * 1 } } */ +/* { dg-final { scan-assembler-times "lsx_vmaxi_wu:.*vmaxi\\.wu.*lsx_vmaxi_wu" + * 1 } } */ +/* { dg-final { scan-assembler-times "lsx_vmaxi_du:.*vmaxi\\.du.*lsx_vmaxi_du" + * 1 } } */ +/* { dg-final { scan-assembler-times "lsx_vmin_b:.*vmin\\.b.*lsx_vmin_b" 1 } } + */ +/* { dg-final { scan-assembler-times "lsx_vmin_h:.*vmin\\.h.*lsx_vmin_h" 1 } } + */ +/* { dg-final { scan-assembler-times "lsx_vmin_w:.*vmin\\.w.*lsx_vmin_w" 1 } } + */ +/* { dg-final { scan-assembler-times "lsx_vmin_d:.*vmin\\.d.*lsx_vmin_d" 1 } } + */ +/* { dg-final { scan-assembler-times "lsx_vmini_b:.*vmini\\.b.*lsx_vmini_b" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vmini_h:.*vmini\\.h.*lsx_vmini_h" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vmini_w:.*vmini\\.w.*lsx_vmini_w" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vmini_d:.*vmini\\.d.*lsx_vmini_d" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vmin_bu:.*vmin\\.bu.*lsx_vmin_bu" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vmin_hu:.*vmin\\.hu.*lsx_vmin_hu" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vmin_wu:.*vmin\\.wu.*lsx_vmin_wu" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vmin_du:.*vmin\\.du.*lsx_vmin_du" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vmini_bu:.*vmini\\.bu.*lsx_vmini_bu" + * 1 } } */ +/* { dg-final { scan-assembler-times "lsx_vmini_hu:.*vmini\\.hu.*lsx_vmini_hu" + * 1 } } */ +/* { dg-final { scan-assembler-times "lsx_vmini_wu:.*vmini\\.wu.*lsx_vmini_wu" + * 1 } } */ +/* { dg-final { scan-assembler-times "lsx_vmini_du:.*vmini\\.du.*lsx_vmini_du" + * 1 } } */ +/* { dg-final { scan-assembler-times "lsx_vseq_b:.*vseq\\.b.*lsx_vseq_b" 1 } } + */ +/* { dg-final { scan-assembler-times "lsx_vseq_h:.*vseq\\.h.*lsx_vseq_h" 1 } } + */ +/* { dg-final { scan-assembler-times "lsx_vseq_w:.*vseq\\.w.*lsx_vseq_w" 1 } } + */ +/* { dg-final { scan-assembler-times "lsx_vseq_d:.*vseq\\.d.*lsx_vseq_d" 1 } } + */ +/* { dg-final { scan-assembler-times "lsx_vseqi_b:.*vseqi\\.b.*lsx_vseqi_b" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vseqi_h:.*vseqi\\.h.*lsx_vseqi_h" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vseqi_w:.*vseqi\\.w.*lsx_vseqi_w" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vseqi_d:.*vseqi\\.d.*lsx_vseqi_d" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vslti_b:.*vslti\\.b.*lsx_vslti_b" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vslt_b:.*vslt\\.b.*lsx_vslt_b" 1 } } + */ +/* { dg-final { scan-assembler-times "lsx_vslt_h:.*vslt\\.h.*lsx_vslt_h" 1 } } + */ +/* { dg-final { scan-assembler-times "lsx_vslt_w:.*vslt\\.w.*lsx_vslt_w" 1 } } + */ +/* { dg-final { scan-assembler-times "lsx_vslt_d:.*vslt\\.d.*lsx_vslt_d" 1 } } + */ +/* { dg-final { scan-assembler-times "lsx_vslti_h:.*vslti\\.h.*lsx_vslti_h" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vslti_w:.*vslti\\.w.*lsx_vslti_w" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vslti_d:.*vslti\\.d.*lsx_vslti_d" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vslt_bu:.*vslt\\.bu.*lsx_vslt_bu" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vslt_hu:.*vslt\\.hu.*lsx_vslt_hu" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vslt_wu:.*vslt\\.wu.*lsx_vslt_wu" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vslt_du:.*vslt\\.du.*lsx_vslt_du" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vslti_bu:.*vslti\\.bu.*lsx_vslti_bu" + * 1 } } */ +/* { dg-final { scan-assembler-times "lsx_vslti_hu:.*vslti\\.hu.*lsx_vslti_hu" + * 1 } } */ +/* { dg-final { scan-assembler-times "lsx_vslti_wu:.*vslti\\.wu.*lsx_vslti_wu" + * 1 } } */ +/* { dg-final { scan-assembler-times "lsx_vslti_du:.*vslti\\.du.*lsx_vslti_du" + * 1 } } */ +/* { dg-final { scan-assembler-times "lsx_vsle_b:.*vsle\\.b.*lsx_vsle_b" 1 } } + */ +/* { dg-final { scan-assembler-times "lsx_vsle_h:.*vsle\\.h.*lsx_vsle_h" 1 } } + */ +/* { dg-final { scan-assembler-times "lsx_vsle_w:.*vsle\\.w.*lsx_vsle_w" 1 } } + */ +/* { dg-final { scan-assembler-times "lsx_vsle_d:.*vsle\\.d.*lsx_vsle_d" 1 } } + */ +/* { dg-final { scan-assembler-times "lsx_vslei_b:.*vslei\\.b.*lsx_vslei_b" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vslei_h:.*vslei\\.h.*lsx_vslei_h" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vslei_w:.*vslei\\.w.*lsx_vslei_w" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vslei_d:.*vslei\\.d.*lsx_vslei_d" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vsle_bu:.*vsle\\.bu.*lsx_vsle_bu" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vsle_hu:.*vsle\\.hu.*lsx_vsle_hu" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vsle_wu:.*vsle\\.wu.*lsx_vsle_wu" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vsle_du:.*vsle\\.du.*lsx_vsle_du" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vslei_bu:.*vslei\\.bu.*lsx_vslei_bu" + * 1 } } */ +/* { dg-final { scan-assembler-times "lsx_vslei_hu:.*vslei\\.hu.*lsx_vslei_hu" + * 1 } } */ +/* { dg-final { scan-assembler-times "lsx_vslei_wu:.*vslei\\.wu.*lsx_vslei_wu" + * 1 } } */ +/* { dg-final { scan-assembler-times "lsx_vslei_du:.*vslei\\.du.*lsx_vslei_du" + * 1 } } */ +/* { dg-final { scan-assembler-times "lsx_vsat_b:.*vsat\\.b.*lsx_vsat_b" 1 } } + */ +/* { dg-final { scan-assembler-times "lsx_vsat_h:.*vsat\\.h.*lsx_vsat_h" 1 } } + */ +/* { dg-final { scan-assembler-times "lsx_vsat_w:.*vsat\\.w.*lsx_vsat_w" 1 } } + */ +/* { dg-final { scan-assembler-times "lsx_vsat_d:.*vsat\\.d.*lsx_vsat_d" 1 } } + */ +/* { dg-final { scan-assembler-times "lsx_vsat_bu:.*vsat\\.bu.*lsx_vsat_bu" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vsat_hu:.*vsat\\.hu.*lsx_vsat_hu" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vsat_wu:.*vsat\\.wu.*lsx_vsat_wu" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vsat_du:.*vsat\\.du.*lsx_vsat_du" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vadda_b:.*vadda\\.b.*lsx_vadda_b" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vadda_h:.*vadda\\.h.*lsx_vadda_h" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vadda_w:.*vadda\\.w.*lsx_vadda_w" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vadda_d:.*vadda\\.d.*lsx_vadda_d" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vsadd_b:.*vsadd\\.b.*lsx_vsadd_b" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vsadd_h:.*vsadd\\.h.*lsx_vsadd_h" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vsadd_w:.*vsadd\\.w.*lsx_vsadd_w" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vsadd_d:.*vsadd\\.d.*lsx_vsadd_d" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vsadd_bu:.*vsadd\\.bu.*lsx_vsadd_bu" + * 1 } } */ +/* { dg-final { scan-assembler-times "lsx_vsadd_hu:.*vsadd\\.hu.*lsx_vsadd_hu" + * 1 } } */ +/* { dg-final { scan-assembler-times "lsx_vsadd_wu:.*vsadd\\.wu.*lsx_vsadd_wu" + * 1 } } */ +/* { dg-final { scan-assembler-times "lsx_vsadd_du:.*vsadd\\.du.*lsx_vsadd_du" + * 1 } } */ +/* { dg-final { scan-assembler-times "lsx_vavg_b:.*vavg\\.b.*lsx_vavg_b" 1 } } + */ +/* { dg-final { scan-assembler-times "lsx_vavg_h:.*vavg\\.h.*lsx_vavg_h" 1 } } + */ +/* { dg-final { scan-assembler-times "lsx_vavg_w:.*vavg\\.w.*lsx_vavg_w" 1 } } + */ +/* { dg-final { scan-assembler-times "lsx_vavg_d:.*vavg\\.d.*lsx_vavg_d" 1 } } + */ +/* { dg-final { scan-assembler-times "lsx_vavg_bu:.*vavg\\.bu.*lsx_vavg_bu" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vavg_hu:.*vavg\\.hu.*lsx_vavg_hu" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vavg_wu:.*vavg\\.wu.*lsx_vavg_wu" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vavg_du:.*vavg\\.du.*lsx_vavg_du" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vavgr_b:.*vavgr\\.b.*lsx_vavgr_b" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vavgr_h:.*vavgr\\.h.*lsx_vavgr_h" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vavgr_w:.*vavgr\\.w.*lsx_vavgr_w" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vavgr_d:.*vavgr\\.d.*lsx_vavgr_d" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vavgr_bu:.*vavgr\\.bu.*lsx_vavgr_bu" + * 1 } } */ +/* { dg-final { scan-assembler-times "lsx_vavgr_hu:.*vavgr\\.hu.*lsx_vavgr_hu" + * 1 } } */ +/* { dg-final { scan-assembler-times "lsx_vavgr_wu:.*vavgr\\.wu.*lsx_vavgr_wu" + * 1 } } */ +/* { dg-final { scan-assembler-times "lsx_vavgr_du:.*vavgr\\.du.*lsx_vavgr_du" + * 1 } } */ +/* { dg-final { scan-assembler-times "lsx_vssub_b:.*vssub\\.b.*lsx_vssub_b" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vssub_h:.*vssub\\.h.*lsx_vssub_h" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vssub_w:.*vssub\\.w.*lsx_vssub_w" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vssub_d:.*vssub\\.d.*lsx_vssub_d" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vssub_bu:.*vssub\\.bu.*lsx_vssub_bu" + * 1 } } */ +/* { dg-final { scan-assembler-times "lsx_vssub_hu:.*vssub\\.hu.*lsx_vssub_hu" + * 1 } } */ +/* { dg-final { scan-assembler-times "lsx_vssub_wu:.*vssub\\.wu.*lsx_vssub_wu" + * 1 } } */ +/* { dg-final { scan-assembler-times "lsx_vssub_du:.*vssub\\.du.*lsx_vssub_du" + * 1 } } */ +/* { dg-final { scan-assembler-times "lsx_vabsd_b:.*vabsd\\.b.*lsx_vabsd_b" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vabsd_h:.*vabsd\\.h.*lsx_vabsd_h" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vabsd_w:.*vabsd\\.w.*lsx_vabsd_w" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vabsd_d:.*vabsd\\.d.*lsx_vabsd_d" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vabsd_bu:.*vabsd\\.bu.*lsx_vabsd_bu" + * 1 } } */ +/* { dg-final { scan-assembler-times "lsx_vabsd_hu:.*vabsd\\.hu.*lsx_vabsd_hu" + * 1 } } */ +/* { dg-final { scan-assembler-times "lsx_vabsd_wu:.*vabsd\\.wu.*lsx_vabsd_wu" + * 1 } } */ +/* { dg-final { scan-assembler-times "lsx_vabsd_du:.*vabsd\\.du.*lsx_vabsd_du" + * 1 } } */ +/* { dg-final { scan-assembler-times "lsx_vmul_b:.*vmul\\.b.*lsx_vmul_b" 1 } } + */ +/* { dg-final { scan-assembler-times "lsx_vmul_h:.*vmul\\.h.*lsx_vmul_h" 1 } } + */ +/* { dg-final { scan-assembler-times "lsx_vmul_w:.*vmul\\.w.*lsx_vmul_w" 1 } } + */ +/* { dg-final { scan-assembler-times "lsx_vmul_d:.*vmul\\.d.*lsx_vmul_d" 1 } } + */ +/* { dg-final { scan-assembler-times "lsx_vmadd_b:.*vmadd\\.b.*lsx_vmadd_b" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vmadd_h:.*vmadd\\.h.*lsx_vmadd_h" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vmadd_w:.*vmadd\\.w.*lsx_vmadd_w" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vmadd_d:.*vmadd\\.d.*lsx_vmadd_d" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vmsub_b:.*vmsub\\.b.*lsx_vmsub_b" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vmsub_h:.*vmsub\\.h.*lsx_vmsub_h" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vmsub_w:.*vmsub\\.w.*lsx_vmsub_w" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vmsub_d:.*vmsub\\.d.*lsx_vmsub_d" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vdiv_b:.*vdiv\\.b.*lsx_vdiv_b" 1 } } + */ +/* { dg-final { scan-assembler-times "lsx_vdiv_h:.*vdiv\\.h.*lsx_vdiv_h" 1 } } + */ +/* { dg-final { scan-assembler-times "lsx_vdiv_w:.*vdiv\\.w.*lsx_vdiv_w" 1 } } + */ +/* { dg-final { scan-assembler-times "lsx_vdiv_d:.*vdiv\\.d.*lsx_vdiv_d" 1 } } + */ +/* { dg-final { scan-assembler-times "lsx_vdiv_bu:.*vdiv\\.bu.*lsx_vdiv_bu" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vdiv_hu:.*vdiv\\.hu.*lsx_vdiv_hu" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vdiv_wu:.*vdiv\\.wu.*lsx_vdiv_wu" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vdiv_du:.*vdiv\\.du.*lsx_vdiv_du" 1 } + * } */ +/* { dg-final { scan-assembler-times + * "lsx_vhaddw_h_b:.*vhaddw\\.h\\.b.*lsx_vhaddw_h_b" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vhaddw_w_h:.*vhaddw\\.w\\.h.*lsx_vhaddw_w_h" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vhaddw_d_w:.*vhaddw\\.d\\.w.*lsx_vhaddw_d_w" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vhaddw_hu_bu:.*vhaddw\\.hu\\.bu.*lsx_vhaddw_hu_bu" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vhaddw_wu_hu:.*vhaddw\\.wu\\.hu.*lsx_vhaddw_wu_hu" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vhaddw_du_wu:.*vhaddw\\.du\\.wu.*lsx_vhaddw_du_wu" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vhsubw_h_b:.*vhsubw\\.h\\.b.*lsx_vhsubw_h_b" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vhsubw_w_h:.*vhsubw\\.w\\.h.*lsx_vhsubw_w_h" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vhsubw_d_w:.*vhsubw\\.d\\.w.*lsx_vhsubw_d_w" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vhsubw_hu_bu:.*vhsubw\\.hu\\.bu.*lsx_vhsubw_hu_bu" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vhsubw_wu_hu:.*vhsubw\\.wu\\.hu.*lsx_vhsubw_wu_hu" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vhsubw_du_wu:.*vhsubw\\.du\\.wu.*lsx_vhsubw_du_wu" 1 } } */ +/* { dg-final { scan-assembler-times "lsx_vmod_b:.*vmod\\.b.*lsx_vmod_b" 1 } } + */ +/* { dg-final { scan-assembler-times "lsx_vmod_h:.*vmod\\.h.*lsx_vmod_h" 1 } } + */ +/* { dg-final { scan-assembler-times "lsx_vmod_w:.*vmod\\.w.*lsx_vmod_w" 1 } } + */ +/* { dg-final { scan-assembler-times "lsx_vmod_d:.*vmod\\.d.*lsx_vmod_d" 1 } } + */ +/* { dg-final { scan-assembler-times "lsx_vmod_bu:.*vmod\\.bu.*lsx_vmod_bu" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vmod_hu:.*vmod\\.hu.*lsx_vmod_hu" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vmod_wu:.*vmod\\.wu.*lsx_vmod_wu" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vmod_du:.*vmod\\.du.*lsx_vmod_du" 1 } + * } */ +/* { dg-final { scan-assembler-times + * "lsx_vreplve_b:.*vreplve\\.b.*lsx_vreplve_b" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vreplve_h:.*vreplve\\.h.*lsx_vreplve_h" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vreplve_w:.*vreplve\\.w.*lsx_vreplve_w" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vreplve_d:.*vreplve\\.d.*lsx_vreplve_d" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vreplvei_b:.*vreplvei\\.b.*lsx_vreplvei_b" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vreplvei_h:.*vreplvei\\.h.*lsx_vreplvei_h" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vreplvei_w:.*vreplvei\\.w.*lsx_vreplvei_w" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vreplvei_d:.*vreplvei\\.d.*lsx_vreplvei_d" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vpickev_b:.*vpickev\\.b.*lsx_vpickev_b" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vpickev_h:.*vpickev\\.h.*lsx_vpickev_h" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vpickev_w:.*vpickev\\.w.*lsx_vpickev_w" 1 } } */ +/* { dg-final { scan-assembler-times "lsx_vpickev_d:.*vilvl\\.d.*lsx_vpickev_d" + * 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vpickod_b:.*vpickod\\.b.*lsx_vpickod_b" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vpickod_h:.*vpickod\\.h.*lsx_vpickod_h" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vpickod_w:.*vpickod\\.w.*lsx_vpickod_w" 1 } } */ +/* { dg-final { scan-assembler-times "lsx_vpickod_d:.*vilvh\\.d.*lsx_vpickod_d" + * 1 } } */ +/* { dg-final { scan-assembler-times "lsx_vilvh_b:.*vilvh\\.b.*lsx_vilvh_b" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vilvh_h:.*vilvh\\.h.*lsx_vilvh_h" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vilvh_w:.*vilvh\\.w.*lsx_vilvh_w" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vilvh_d:.*vilvh\\.d.*lsx_vilvh_d" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vilvl_b:.*vilvl\\.b.*lsx_vilvl_b" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vilvl_h:.*vilvl\\.h.*lsx_vilvl_h" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vilvl_w:.*vilvl\\.w.*lsx_vilvl_w" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vilvl_d:.*vilvl\\.d.*lsx_vilvl_d" 1 } + * } */ +/* { dg-final { scan-assembler-times + * "lsx_vpackev_b:.*vpackev\\.b.*lsx_vpackev_b" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vpackev_h:.*vpackev\\.h.*lsx_vpackev_h" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vpackev_w:.*vpackev\\.w.*lsx_vpackev_w" 1 } } */ +/* { dg-final { scan-assembler-times "lsx_vpackev_d:.*vilvl\\.d.*lsx_vpackev_d" + * 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vpackod_b:.*vpackod\\.b.*lsx_vpackod_b" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vpackod_h:.*vpackod\\.h.*lsx_vpackod_h" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vpackod_w:.*vpackod\\.w.*lsx_vpackod_w" 1 } } */ +/* { dg-final { scan-assembler-times "lsx_vpackod_d:.*vilvh\\.d.*lsx_vpackod_d" + * 1 } } */ +/* { dg-final { scan-assembler-times "lsx_vshuf_h:.*vshuf\\.h.*lsx_vshuf_h" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vshuf_w:.*vshuf\\.w.*lsx_vshuf_w" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vshuf_d:.*vshuf\\.d.*lsx_vshuf_d" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vand_v:.*vand\\.v.*lsx_vand_v" 1 } } + */ +/* { dg-final { scan-assembler-times "lsx_vandi_b:.*vandi\\.b.*lsx_vandi_b" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vor_v:.*vor\\.v.*lsx_vor_v" 1 } } */ +/* { dg-final { scan-assembler-times "lsx_vori_b:.*vbitseti\\.b.*lsx_vori_b" 1 + * } } */ +/* { dg-final { scan-assembler-times "lsx_vnor_v:.*vnor\\.v.*lsx_vnor_v" 1 } } + */ +/* { dg-final { scan-assembler-times "lsx_vnori_b:.*vnori\\.b.*lsx_vnori_b" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vxor_v:.*vxor\\.v.*lsx_vxor_v" 1 } } + */ +/* { dg-final { scan-assembler-times "lsx_vxori_b:.*vbitrevi\\.b.*lsx_vxori_b" + * 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vbitsel_v:.*vbitsel\\.v.*lsx_vbitsel_v" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vbitseli_b:.*vbitseli\\.b.*lsx_vbitseli_b" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vshuf4i_b:.*vshuf4i\\.b.*lsx_vshuf4i_b" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vshuf4i_h:.*vshuf4i\\.h.*lsx_vshuf4i_h" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vshuf4i_w:.*vshuf4i\\.w.*lsx_vshuf4i_w" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vreplgr2vr_b:.*vreplgr2vr\\.b.*lsx_vreplgr2vr_b" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vreplgr2vr_h:.*vreplgr2vr\\.h.*lsx_vreplgr2vr_h" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vreplgr2vr_w:.*vreplgr2vr\\.w.*lsx_vreplgr2vr_w" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vreplgr2vr_d:.*vreplgr2vr\\.d.*lsx_vreplgr2vr_d" 1 } } */ +/* { dg-final { scan-assembler-times "lsx_vpcnt_b:.*vpcnt\\.b.*lsx_vpcnt_b" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vpcnt_h:.*vpcnt\\.h.*lsx_vpcnt_h" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vpcnt_w:.*vpcnt\\.w.*lsx_vpcnt_w" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vpcnt_d:.*vpcnt\\.d.*lsx_vpcnt_d" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vclo_b:.*vclo\\.b.*lsx_vclo_b" 1 } } + */ +/* { dg-final { scan-assembler-times "lsx_vclo_h:.*vclo\\.h.*lsx_vclo_h" 1 } } + */ +/* { dg-final { scan-assembler-times "lsx_vclo_w:.*vclo\\.w.*lsx_vclo_w" 1 } } + */ +/* { dg-final { scan-assembler-times "lsx_vclo_d:.*vclo\\.d.*lsx_vclo_d" 1 } } + */ +/* { dg-final { scan-assembler-times "lsx_vclz_b:.*vclz\\.b.*lsx_vclz_b" 1 } } + */ +/* { dg-final { scan-assembler-times "lsx_vclz_h:.*vclz\\.h.*lsx_vclz_h" 1 } } + */ +/* { dg-final { scan-assembler-times "lsx_vclz_w:.*vclz\\.w.*lsx_vclz_w" 1 } } + */ +/* { dg-final { scan-assembler-times "lsx_vclz_d:.*vclz\\.d.*lsx_vclz_d" 1 } } + */ +/* { dg-final { scan-assembler-times + * "lsx_vpickve2gr_b:.*vpickve2gr\\.b.*lsx_vpickve2gr_b" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vpickve2gr_h:.*vpickve2gr\\.h.*lsx_vpickve2gr_h" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vpickve2gr_w:.*vpickve2gr\\.w.*lsx_vpickve2gr_w" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vpickve2gr_d:.*vpickve2gr\\.d.*lsx_vpickve2gr_d" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vpickve2gr_bu:.*vpickve2gr\\.bu.*lsx_vpickve2gr_bu" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vpickve2gr_hu:.*vpickve2gr\\.hu.*lsx_vpickve2gr_hu" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vpickve2gr_wu:.*vpickve2gr\\.wu.*lsx_vpickve2gr_wu" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vpickve2gr_du:.*vpickve2gr\\.du.*lsx_vpickve2gr_du" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vinsgr2vr_b:.*vinsgr2vr\\.b.*lsx_vinsgr2vr_b" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vinsgr2vr_h:.*vinsgr2vr\\.h.*lsx_vinsgr2vr_h" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vinsgr2vr_w:.*vinsgr2vr\\.w.*lsx_vinsgr2vr_w" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vinsgr2vr_d:.*vinsgr2vr\\.d.*lsx_vinsgr2vr_d" 1 } } */ +/* { dg-final { scan-assembler-times "lsx_vfadd_s:.*vfadd\\.s.*lsx_vfadd_s" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vfadd_d:.*vfadd\\.d.*lsx_vfadd_d" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vfsub_s:.*vfsub\\.s.*lsx_vfsub_s" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vfsub_d:.*vfsub\\.d.*lsx_vfsub_d" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vfmul_s:.*vfmul\\.s.*lsx_vfmul_s" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vfmul_d:.*vfmul\\.d.*lsx_vfmul_d" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vfdiv_s:.*vfdiv\\.s.*lsx_vfdiv_s" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vfdiv_d:.*vfdiv\\.d.*lsx_vfdiv_d" 1 } + * } */ +/* { dg-final { scan-assembler-times + * "lsx_vfcvt_h_s:.*vfcvt\\.h\\.s.*lsx_vfcvt_h_s" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vfcvt_s_d:.*vfcvt\\.s\\.d.*lsx_vfcvt_s_d" 1 } } */ +/* { dg-final { scan-assembler-times "lsx_vfmin_s:.*vfmin\\.s.*lsx_vfmin_s" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vfmin_d:.*vfmin\\.d.*lsx_vfmin_d" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vfmina_s:.*vfmina\\.s.*lsx_vfmina_s" + * 1 } } */ +/* { dg-final { scan-assembler-times "lsx_vfmina_d:.*vfmina\\.d.*lsx_vfmina_d" + * 1 } } */ +/* { dg-final { scan-assembler-times "lsx_vfmax_s:.*vfmax\\.s.*lsx_vfmax_s" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vfmax_d:.*vfmax\\.d.*lsx_vfmax_d" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vfmaxa_s:.*vfmaxa\\.s.*lsx_vfmaxa_s" + * 1 } } */ +/* { dg-final { scan-assembler-times "lsx_vfmaxa_d:.*vfmaxa\\.d.*lsx_vfmaxa_d" + * 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vfclass_s:.*vfclass\\.s.*lsx_vfclass_s" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vfclass_d:.*vfclass\\.d.*lsx_vfclass_d" 1 } } */ +/* { dg-final { scan-assembler-times "lsx_vfsqrt_s:.*vfsqrt\\.s.*lsx_vfsqrt_s" + * 1 } } */ +/* { dg-final { scan-assembler-times "lsx_vfsqrt_d:.*vfsqrt\\.d.*lsx_vfsqrt_d" + * 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vfrecip_s:.*vfrecip\\.s.*lsx_vfrecip_s" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vfrecip_d:.*vfrecip\\.d.*lsx_vfrecip_d" 1 } } */ +/* { dg-final { scan-assembler-times "lsx_vfrint_s:.*vfrint\\.s.*lsx_vfrint_s" + * 1 } } */ +/* { dg-final { scan-assembler-times "lsx_vfrint_d:.*vfrint\\.d.*lsx_vfrint_d" + * 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vfrsqrt_s:.*vfrsqrt\\.s.*lsx_vfrsqrt_s" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vfrsqrt_d:.*vfrsqrt\\.d.*lsx_vfrsqrt_d" 1 } } */ +/* { dg-final { scan-assembler-times "lsx_vflogb_s:.*vflogb\\.s.*lsx_vflogb_s" + * 1 } } */ +/* { dg-final { scan-assembler-times "lsx_vflogb_d:.*vflogb\\.d.*lsx_vflogb_d" + * 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vfcvth_s_h:.*vfcvth\\.s\\.h.*lsx_vfcvth_s_h" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vfcvth_d_s:.*vfcvth\\.d\\.s.*lsx_vfcvth_d_s" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vfcvtl_s_h:.*vfcvtl\\.s\\.h.*lsx_vfcvtl_s_h" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vfcvtl_d_s:.*vfcvtl\\.d\\.s.*lsx_vfcvtl_d_s" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vftint_w_s:.*vftint\\.w\\.s.*lsx_vftint_w_s" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vftint_l_d:.*vftint\\.l\\.d.*lsx_vftint_l_d" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vftint_wu_s:.*vftint\\.wu\\.s.*lsx_vftint_wu_s" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vftint_lu_d:.*vftint\\.lu\\.d.*lsx_vftint_lu_d" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vftintrz_w_s:.*vftintrz\\.w\\.s.*lsx_vftintrz_w_s" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vftintrz_l_d:.*vftintrz\\.l\\.d.*lsx_vftintrz_l_d" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vftintrz_wu_s:.*vftintrz\\.wu\\.s.*lsx_vftintrz_wu_s" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vftintrz_lu_d:.*vftintrz\\.lu\\.d.*lsx_vftintrz_lu_d" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vffint_s_w:.*vffint\\.s\\.w.*lsx_vffint_s_w" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vffint_d_l:.*vffint\\.d\\.l.*lsx_vffint_d_l" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vffint_s_wu:.*vffint\\.s\\.wu.*lsx_vffint_s_wu" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vffint_d_lu:.*vffint\\.d\\.lu.*lsx_vffint_d_lu" 1 } } */ +/* { dg-final { scan-assembler-times "lsx_vandn_v:.*vandn\\.v.*lsx_vandn_v" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vneg_b:.*vneg\\.b.*lsx_vneg_b" 1 } } + */ +/* { dg-final { scan-assembler-times "lsx_vneg_h:.*vneg\\.h.*lsx_vneg_h" 1 } } + */ +/* { dg-final { scan-assembler-times "lsx_vneg_w:.*vneg\\.w.*lsx_vneg_w" 1 } } + */ +/* { dg-final { scan-assembler-times "lsx_vneg_d:.*vneg\\.d.*lsx_vneg_d" 1 } } + */ +/* { dg-final { scan-assembler-times "lsx_vmuh_b:.*vmuh\\.b.*lsx_vmuh_b" 1 } } + */ +/* { dg-final { scan-assembler-times "lsx_vmuh_h:.*vmuh\\.h.*lsx_vmuh_h" 1 } } + */ +/* { dg-final { scan-assembler-times "lsx_vmuh_w:.*vmuh\\.w.*lsx_vmuh_w" 1 } } + */ +/* { dg-final { scan-assembler-times "lsx_vmuh_d:.*vmuh\\.d.*lsx_vmuh_d" 1 } } + */ +/* { dg-final { scan-assembler-times "lsx_vmuh_bu:.*vmuh\\.bu.*lsx_vmuh_bu" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vmuh_hu:.*vmuh\\.hu.*lsx_vmuh_hu" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vmuh_wu:.*vmuh\\.wu.*lsx_vmuh_wu" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vmuh_du:.*vmuh\\.du.*lsx_vmuh_du" 1 } + * } */ +/* { dg-final { scan-assembler-times + * "lsx_vsllwil_h_b:.*vsllwil\\.h\\.b.*lsx_vsllwil_h_b" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vsllwil_w_h:.*vsllwil\\.w\\.h.*lsx_vsllwil_w_h" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vsllwil_d_w:.*vsllwil\\.d\\.w.*lsx_vsllwil_d_w" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vsllwil_hu_bu:.*vsllwil\\.hu\\.bu.*lsx_vsllwil_hu_bu" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vsllwil_wu_hu:.*vsllwil\\.wu\\.hu.*lsx_vsllwil_wu_hu" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vsllwil_du_wu:.*vsllwil\\.du\\.wu.*lsx_vsllwil_du_wu" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vsran_b_h:.*vsran\\.b\\.h.*lsx_vsran_b_h" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vsran_h_w:.*vsran\\.h\\.w.*lsx_vsran_h_w" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vsran_w_d:.*vsran\\.w\\.d.*lsx_vsran_w_d" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vssran_b_h:.*vssran\\.b\\.h.*lsx_vssran_b_h" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vssran_h_w:.*vssran\\.h\\.w.*lsx_vssran_h_w" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vssran_w_d:.*vssran\\.w\\.d.*lsx_vssran_w_d" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vssran_bu_h:.*vssran\\.bu\\.h.*lsx_vssran_bu_h" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vssran_hu_w:.*vssran\\.hu\\.w.*lsx_vssran_hu_w" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vssran_wu_d:.*vssran\\.wu\\.d.*lsx_vssran_wu_d" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vsrarn_b_h:.*vsrarn\\.b\\.h.*lsx_vsrarn_b_h" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vsrarn_h_w:.*vsrarn\\.h\\.w.*lsx_vsrarn_h_w" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vsrarn_w_d:.*vsrarn\\.w\\.d.*lsx_vsrarn_w_d" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vssrarn_b_h:.*vssrarn\\.b\\.h.*lsx_vssrarn_b_h" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vssrarn_h_w:.*vssrarn\\.h\\.w.*lsx_vssrarn_h_w" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vssrarn_w_d:.*vssrarn\\.w\\.d.*lsx_vssrarn_w_d" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vssrarn_bu_h:.*vssrarn\\.bu\\.h.*lsx_vssrarn_bu_h" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vssrarn_hu_w:.*vssrarn\\.hu\\.w.*lsx_vssrarn_hu_w" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vssrarn_wu_d:.*vssrarn\\.wu\\.d.*lsx_vssrarn_wu_d" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vsrln_b_h:.*vsrln\\.b\\.h.*lsx_vsrln_b_h" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vsrln_h_w:.*vsrln\\.h\\.w.*lsx_vsrln_h_w" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vsrln_w_d:.*vsrln\\.w\\.d.*lsx_vsrln_w_d" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vssrln_bu_h:.*vssrln\\.bu\\.h.*lsx_vssrln_bu_h" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vssrln_hu_w:.*vssrln\\.hu\\.w.*lsx_vssrln_hu_w" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vssrln_wu_d:.*vssrln\\.wu\\.d.*lsx_vssrln_wu_d" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vsrlrn_b_h:.*vsrlrn\\.b\\.h.*lsx_vsrlrn_b_h" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vsrlrn_h_w:.*vsrlrn\\.h\\.w.*lsx_vsrlrn_h_w" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vsrlrn_w_d:.*vsrlrn\\.w\\.d.*lsx_vsrlrn_w_d" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vssrlrn_bu_h:.*vssrlrn\\.bu\\.h.*lsx_vssrlrn_bu_h" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vssrlrn_hu_w:.*vssrlrn\\.hu\\.w.*lsx_vssrlrn_hu_w" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vssrlrn_wu_d:.*vssrlrn\\.wu\\.d.*lsx_vssrlrn_wu_d" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vfrstpi_b:.*vfrstpi\\.b.*lsx_vfrstpi_b" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vfrstpi_h:.*vfrstpi\\.h.*lsx_vfrstpi_h" 1 } } */ +/* { dg-final { scan-assembler-times "lsx_vfrstp_b:.*vfrstp\\.b.*lsx_vfrstp_b" + * 1 } } */ +/* { dg-final { scan-assembler-times "lsx_vfrstp_h:.*vfrstp\\.h.*lsx_vfrstp_h" + * 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vshuf4i_d:.*vshuf4i\\.d.*lsx_vshuf4i_d" 1 } } */ +/* { dg-final { scan-assembler-times "lsx_vbsrl_v:.*vbsrl\\.v.*lsx_vbsrl_v" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vbsll_v:.*vbsll\\.v.*lsx_vbsll_v" 1 } + * } */ +/* { dg-final { scan-assembler-times + * "lsx_vextrins_b:.*vextrins\\.b.*lsx_vextrins_b" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vextrins_h:.*vextrins\\.h.*lsx_vextrins_h" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vextrins_w:.*vextrins\\.w.*lsx_vextrins_w" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vextrins_d:.*vextrins\\.d.*lsx_vextrins_d" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vmskltz_b:.*vmskltz\\.b.*lsx_vmskltz_b" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vmskltz_h:.*vmskltz\\.h.*lsx_vmskltz_h" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vmskltz_w:.*vmskltz\\.w.*lsx_vmskltz_w" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vmskltz_d:.*vmskltz\\.d.*lsx_vmskltz_d" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vsigncov_b:.*vsigncov\\.b.*lsx_vsigncov_b" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vsigncov_h:.*vsigncov\\.h.*lsx_vsigncov_h" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vsigncov_w:.*vsigncov\\.w.*lsx_vsigncov_w" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vsigncov_d:.*vsigncov\\.d.*lsx_vsigncov_d" 1 } } */ +/* { dg-final { scan-assembler-times "lsx_vfmadd_s:.*vfmadd\\.s.*lsx_vfmadd_s" + * 1 } } */ +/* { dg-final { scan-assembler-times "lsx_vfmadd_d:.*vfmadd\\.d.*lsx_vfmadd_d" + * 1 } } */ +/* { dg-final { scan-assembler-times "lsx_vfmsub_s:.*vfmsub\\.s.*lsx_vfmsub_s" + * 1 } } */ +/* { dg-final { scan-assembler-times "lsx_vfmsub_d:.*vfmsub\\.d.*lsx_vfmsub_d" + * 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vfnmadd_s:.*vfnmadd\\.s.*lsx_vfnmadd_s" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vfnmadd_d:.*vfnmadd\\.d.*lsx_vfnmadd_d" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vfnmsub_s:.*vfnmsub\\.s.*lsx_vfnmsub_s" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vfnmsub_d:.*vfnmsub\\.d.*lsx_vfnmsub_d" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vftintrne_w_s:.*vftintrne\\.w\\.s.*lsx_vftintrne_w_s" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vftintrne_l_d:.*vftintrne\\.l\\.d.*lsx_vftintrne_l_d" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vftintrp_w_s:.*vftintrp\\.w\\.s.*lsx_vftintrp_w_s" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vftintrp_l_d:.*vftintrp\\.l\\.d.*lsx_vftintrp_l_d" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vftintrm_w_s:.*vftintrm\\.w\\.s.*lsx_vftintrm_w_s" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vftintrm_l_d:.*vftintrm\\.l\\.d.*lsx_vftintrm_l_d" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vftint_w_d:.*vftint\\.w\\.d.*lsx_vftint_w_d" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vffint_s_l:.*vffint\\.s\\.l.*lsx_vffint_s_l" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vftintrz_w_d:.*vftintrz\\.w\\.d.*lsx_vftintrz_w_d" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vftintrp_w_d:.*vftintrp\\.w\\.d.*lsx_vftintrp_w_d" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vftintrm_w_d:.*vftintrm\\.w\\.d.*lsx_vftintrm_w_d" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vftintrne_w_d:.*vftintrne\\.w\\.d.*lsx_vftintrne_w_d" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vftintl_l_s:.*vftintl\\.l\\.s.*lsx_vftintl_l_s" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vftinth_l_s:.*vftinth\\.l\\.s.*lsx_vftinth_l_s" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vffinth_d_w:.*vffinth\\.d\\.w.*lsx_vffinth_d_w" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vffintl_d_w:.*vffintl\\.d\\.w.*lsx_vffintl_d_w" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vftintrzl_l_s:.*vftintrzl\\.l\\.s.*lsx_vftintrzl_l_s" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vftintrzh_l_s:.*vftintrzh\\.l\\.s.*lsx_vftintrzh_l_s" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vftintrpl_l_s:.*vftintrpl\\.l\\.s.*lsx_vftintrpl_l_s" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vftintrph_l_s:.*vftintrph\\.l\\.s.*lsx_vftintrph_l_s" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vftintrml_l_s:.*vftintrml\\.l\\.s.*lsx_vftintrml_l_s" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vftintrmh_l_s:.*vftintrmh\\.l\\.s.*lsx_vftintrmh_l_s" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vftintrnel_l_s:.*vftintrnel\\.l\\.s.*lsx_vftintrnel_l_s" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vftintrneh_l_s:.*vftintrneh\\.l\\.s.*lsx_vftintrneh_l_s" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vfrintrne_s:.*vfrintrne\\.s.*lsx_vfrintrne_s" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vfrintrne_d:.*vfrintrne\\.d.*lsx_vfrintrne_d" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vfrintrz_s:.*vfrintrz\\.s.*lsx_vfrintrz_s" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vfrintrz_d:.*vfrintrz\\.d.*lsx_vfrintrz_d" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vfrintrp_s:.*vfrintrp\\.s.*lsx_vfrintrp_s" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vfrintrp_d:.*vfrintrp\\.d.*lsx_vfrintrp_d" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vfrintrm_s:.*vfrintrm\\.s.*lsx_vfrintrm_s" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vfrintrm_d:.*vfrintrm\\.d.*lsx_vfrintrm_d" 1 } } */ +/* { dg-final { scan-assembler-times "lsx_vstelm_b:.*vstelm\\.b.*lsx_vstelm_b" + * 1 } } */ +/* { dg-final { scan-assembler-times "lsx_vstelm_h:.*vstelm\\.h.*lsx_vstelm_h" + * 1 } } */ +/* { dg-final { scan-assembler-times "lsx_vstelm_w:.*vstelm\\.w.*lsx_vstelm_w" + * 1 } } */ +/* { dg-final { scan-assembler-times "lsx_vstelm_d:.*vstelm\\.d.*lsx_vstelm_d" + * 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vaddwev_d_w:.*vaddwev\\.d\\.w.*lsx_vaddwev_d_w" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vaddwev_w_h:.*vaddwev\\.w\\.h.*lsx_vaddwev_w_h" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vaddwev_h_b:.*vaddwev\\.h\\.b.*lsx_vaddwev_h_b" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vaddwod_d_w:.*vaddwod\\.d\\.w.*lsx_vaddwod_d_w" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vaddwod_w_h:.*vaddwod\\.w\\.h.*lsx_vaddwod_w_h" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vaddwod_h_b:.*vaddwod\\.h\\.b.*lsx_vaddwod_h_b" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vaddwev_d_wu:.*vaddwev\\.d\\.wu.*lsx_vaddwev_d_wu" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vaddwev_w_hu:.*vaddwev\\.w\\.hu.*lsx_vaddwev_w_hu" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vaddwev_h_bu:.*vaddwev\\.h\\.bu.*lsx_vaddwev_h_bu" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vaddwod_d_wu:.*vaddwod\\.d\\.wu.*lsx_vaddwod_d_wu" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vaddwod_w_hu:.*vaddwod\\.w\\.hu.*lsx_vaddwod_w_hu" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vaddwod_h_bu:.*vaddwod\\.h\\.bu.*lsx_vaddwod_h_bu" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vaddwev_d_wu_w:.*vaddwev\\.d\\.wu\\.w.*lsx_vaddwev_d_wu_w" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vaddwev_w_hu_h:.*vaddwev\\.w\\.hu\\.h.*lsx_vaddwev_w_hu_h" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vaddwev_h_bu_b:.*vaddwev\\.h\\.bu\\.b.*lsx_vaddwev_h_bu_b" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vaddwod_d_wu_w:.*vaddwod\\.d\\.wu\\.w.*lsx_vaddwod_d_wu_w" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vaddwod_w_hu_h:.*vaddwod\\.w\\.hu\\.h.*lsx_vaddwod_w_hu_h" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vaddwod_h_bu_b:.*vaddwod\\.h\\.bu\\.b.*lsx_vaddwod_h_bu_b" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vsubwev_d_w:.*vsubwev\\.d\\.w.*lsx_vsubwev_d_w" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vsubwev_w_h:.*vsubwev\\.w\\.h.*lsx_vsubwev_w_h" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vsubwev_h_b:.*vsubwev\\.h\\.b.*lsx_vsubwev_h_b" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vsubwod_d_w:.*vsubwod\\.d\\.w.*lsx_vsubwod_d_w" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vsubwod_w_h:.*vsubwod\\.w\\.h.*lsx_vsubwod_w_h" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vsubwod_h_b:.*vsubwod\\.h\\.b.*lsx_vsubwod_h_b" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vsubwev_d_wu:.*vsubwev\\.d\\.wu.*lsx_vsubwev_d_wu" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vsubwev_w_hu:.*vsubwev\\.w\\.hu.*lsx_vsubwev_w_hu" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vsubwev_h_bu:.*vsubwev\\.h\\.bu.*lsx_vsubwev_h_bu" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vsubwod_d_wu:.*vsubwod\\.d\\.wu.*lsx_vsubwod_d_wu" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vsubwod_w_hu:.*vsubwod\\.w\\.hu.*lsx_vsubwod_w_hu" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vsubwod_h_bu:.*vsubwod\\.h\\.bu.*lsx_vsubwod_h_bu" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vaddwev_q_d:.*vaddwev\\.q\\.d.*lsx_vaddwev_q_d" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vaddwod_q_d:.*vaddwod\\.q\\.d.*lsx_vaddwod_q_d" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vaddwev_q_du:.*vaddwev\\.q\\.du.*lsx_vaddwev_q_du" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vaddwod_q_du:.*vaddwod\\.q\\.du.*lsx_vaddwod_q_du" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vsubwev_q_d:.*vsubwev\\.q\\.d.*lsx_vsubwev_q_d" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vsubwod_q_d:.*vsubwod\\.q\\.d.*lsx_vsubwod_q_d" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vsubwev_q_du:.*vsubwev\\.q\\.du.*lsx_vsubwev_q_du" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vsubwod_q_du:.*vsubwod\\.q\\.du.*lsx_vsubwod_q_du" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vaddwev_q_du_d:.*vaddwev\\.q\\.du\\.d.*lsx_vaddwev_q_du_d" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vaddwod_q_du_d:.*vaddwod\\.q\\.du\\.d.*lsx_vaddwod_q_du_d" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vmulwev_d_w:.*vmulwev\\.d\\.w.*lsx_vmulwev_d_w" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vmulwev_w_h:.*vmulwev\\.w\\.h.*lsx_vmulwev_w_h" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vmulwev_h_b:.*vmulwev\\.h\\.b.*lsx_vmulwev_h_b" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vmulwod_d_w:.*vmulwod\\.d\\.w.*lsx_vmulwod_d_w" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vmulwod_w_h:.*vmulwod\\.w\\.h.*lsx_vmulwod_w_h" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vmulwod_h_b:.*vmulwod\\.h\\.b.*lsx_vmulwod_h_b" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vmulwev_d_wu:.*vmulwev\\.d\\.wu.*lsx_vmulwev_d_wu" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vmulwev_w_hu:.*vmulwev\\.w\\.hu.*lsx_vmulwev_w_hu" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vmulwev_h_bu:.*vmulwev\\.h\\.bu.*lsx_vmulwev_h_bu" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vmulwod_d_wu:.*vmulwod\\.d\\.wu.*lsx_vmulwod_d_wu" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vmulwod_w_hu:.*vmulwod\\.w\\.hu.*lsx_vmulwod_w_hu" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vmulwod_h_bu:.*vmulwod\\.h\\.bu.*lsx_vmulwod_h_bu" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vmulwev_d_wu_w:.*vmulwev\\.d\\.wu\\.w.*lsx_vmulwev_d_wu_w" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vmulwev_w_hu_h:.*vmulwev\\.w\\.hu\\.h.*lsx_vmulwev_w_hu_h" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vmulwev_h_bu_b:.*vmulwev\\.h\\.bu\\.b.*lsx_vmulwev_h_bu_b" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vmulwod_d_wu_w:.*vmulwod\\.d\\.wu\\.w.*lsx_vmulwod_d_wu_w" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vmulwod_w_hu_h:.*vmulwod\\.w\\.hu\\.h.*lsx_vmulwod_w_hu_h" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vmulwod_h_bu_b:.*vmulwod\\.h\\.bu\\.b.*lsx_vmulwod_h_bu_b" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vmulwev_q_d:.*vmulwev\\.q\\.d.*lsx_vmulwev_q_d" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vmulwod_q_d:.*vmulwod\\.q\\.d.*lsx_vmulwod_q_d" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vmulwev_q_du:.*vmulwev\\.q\\.du.*lsx_vmulwev_q_du" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vmulwod_q_du:.*vmulwod\\.q\\.du.*lsx_vmulwod_q_du" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vmulwev_q_du_d:.*vmulwev\\.q\\.du\\.d.*lsx_vmulwev_q_du_d" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vmulwod_q_du_d:.*vmulwod\\.q\\.du\\.d.*lsx_vmulwod_q_du_d" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vhaddw_q_d:.*vhaddw\\.q\\.d.*lsx_vhaddw_q_d" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vhaddw_qu_du:.*vhaddw\\.qu\\.du.*lsx_vhaddw_qu_du" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vhsubw_q_d:.*vhsubw\\.q\\.d.*lsx_vhsubw_q_d" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vhsubw_qu_du:.*vhsubw\\.qu\\.du.*lsx_vhsubw_qu_du" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vmaddwev_d_w:.*vmaddwev\\.d\\.w.*lsx_vmaddwev_d_w" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vmaddwev_w_h:.*vmaddwev\\.w\\.h.*lsx_vmaddwev_w_h" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vmaddwev_h_b:.*vmaddwev\\.h\\.b.*lsx_vmaddwev_h_b" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vmaddwev_d_wu:.*vmaddwev\\.d\\.wu.*lsx_vmaddwev_d_wu" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vmaddwev_w_hu:.*vmaddwev\\.w\\.hu.*lsx_vmaddwev_w_hu" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vmaddwev_h_bu:.*vmaddwev\\.h\\.bu.*lsx_vmaddwev_h_bu" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vmaddwod_d_w:.*vmaddwod\\.d\\.w.*lsx_vmaddwod_d_w" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vmaddwod_w_h:.*vmaddwod\\.w\\.h.*lsx_vmaddwod_w_h" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vmaddwod_h_b:.*vmaddwod\\.h\\.b.*lsx_vmaddwod_h_b" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vmaddwod_d_wu:.*vmaddwod\\.d\\.wu.*lsx_vmaddwod_d_wu" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vmaddwod_w_hu:.*vmaddwod\\.w\\.hu.*lsx_vmaddwod_w_hu" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vmaddwod_h_bu:.*vmaddwod\\.h\\.bu.*lsx_vmaddwod_h_bu" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vmaddwev_d_wu_w:.*vmaddwev\\.d\\.wu\\.w.*lsx_vmaddwev_d_wu_w" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vmaddwev_w_hu_h:.*vmaddwev\\.w\\.hu\\.h.*lsx_vmaddwev_w_hu_h" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vmaddwev_h_bu_b:.*vmaddwev\\.h\\.bu\\.b.*lsx_vmaddwev_h_bu_b" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vmaddwod_d_wu_w:.*vmaddwod\\.d\\.wu\\.w.*lsx_vmaddwod_d_wu_w" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vmaddwod_w_hu_h:.*vmaddwod\\.w\\.hu\\.h.*lsx_vmaddwod_w_hu_h" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vmaddwod_h_bu_b:.*vmaddwod\\.h\\.bu\\.b.*lsx_vmaddwod_h_bu_b" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vmaddwev_q_d:.*vmaddwev\\.q\\.d.*lsx_vmaddwev_q_d" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vmaddwod_q_d:.*vmaddwod\\.q\\.d.*lsx_vmaddwod_q_d" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vmaddwev_q_du:.*vmaddwev\\.q\\.du.*lsx_vmaddwev_q_du" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vmaddwod_q_du:.*vmaddwod\\.q\\.du.*lsx_vmaddwod_q_du" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vmaddwev_q_du_d:.*vmaddwev\\.q\\.du\\.d.*lsx_vmaddwev_q_du_d" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vmaddwod_q_du_d:.*vmaddwod\\.q\\.du\\.d.*lsx_vmaddwod_q_du_d" 1 } } */ +/* { dg-final { scan-assembler-times "lsx_vrotr_b:.*vrotr\\.b.*lsx_vrotr_b" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vrotr_h:.*vrotr\\.h.*lsx_vrotr_h" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vrotr_w:.*vrotr\\.w.*lsx_vrotr_w" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vrotr_d:.*vrotr\\.d.*lsx_vrotr_d" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vadd_q:.*vadd\\.q.*lsx_vadd_q" 1 } } + */ +/* { dg-final { scan-assembler-times "lsx_vsub_q:.*vsub\\.q.*lsx_vsub_q" 1 } } + */ +/* { dg-final { scan-assembler-times + * "lsx_vldrepl_b:.*vldrepl\\.b.*lsx_vldrepl_b" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vldrepl_h:.*vldrepl\\.h.*lsx_vldrepl_h" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vldrepl_w:.*vldrepl\\.w.*lsx_vldrepl_w" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vldrepl_d:.*vldrepl\\.d.*lsx_vldrepl_d" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vmskgez_b:.*vmskgez\\.b.*lsx_vmskgez_b" 1 } } */ +/* { dg-final { scan-assembler-times "lsx_vmsknz_b:.*vmsknz\\.b.*lsx_vmsknz_b" + * 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vexth_h_b:.*vexth\\.h\\.b.*lsx_vexth_h_b" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vexth_w_h:.*vexth\\.w\\.h.*lsx_vexth_w_h" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vexth_d_w:.*vexth\\.d\\.w.*lsx_vexth_d_w" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vexth_q_d:.*vexth\\.q\\.d.*lsx_vexth_q_d" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vexth_hu_bu:.*vexth\\.hu\\.bu.*lsx_vexth_hu_bu" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vexth_wu_hu:.*vexth\\.wu\\.hu.*lsx_vexth_wu_hu" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vexth_du_wu:.*vexth\\.du\\.wu.*lsx_vexth_du_wu" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vexth_qu_du:.*vexth\\.qu\\.du.*lsx_vexth_qu_du" 1 } } */ +/* { dg-final { scan-assembler-times "lsx_vrotri_b:.*vrotri\\.b.*lsx_vrotri_b" + * 1 } } */ +/* { dg-final { scan-assembler-times "lsx_vrotri_h:.*vrotri\\.h.*lsx_vrotri_h" + * 1 } } */ +/* { dg-final { scan-assembler-times "lsx_vrotri_w:.*vrotri\\.w.*lsx_vrotri_w" + * 1 } } */ +/* { dg-final { scan-assembler-times "lsx_vrotri_d:.*vrotri\\.d.*lsx_vrotri_d" + * 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vextl_q_d:.*vextl\\.q\\.d.*lsx_vextl_q_d" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vsrlni_b_h:.*vsrlni\\.b\\.h.*lsx_vsrlni_b_h" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vsrlni_h_w:.*vsrlni\\.h\\.w.*lsx_vsrlni_h_w" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vsrlni_w_d:.*vsrlni\\.w\\.d.*lsx_vsrlni_w_d" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vsrlni_d_q:.*vsrlni\\.d\\.q.*lsx_vsrlni_d_q" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vsrlrni_b_h:.*vsrlrni\\.b\\.h.*lsx_vsrlrni_b_h" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vsrlrni_h_w:.*vsrlrni\\.h\\.w.*lsx_vsrlrni_h_w" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vsrlrni_w_d:.*vsrlrni\\.w\\.d.*lsx_vsrlrni_w_d" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vsrlrni_d_q:.*vsrlrni\\.d\\.q.*lsx_vsrlrni_d_q" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vssrlni_b_h:.*vssrlni\\.b\\.h.*lsx_vssrlni_b_h" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vssrlni_h_w:.*vssrlni\\.h\\.w.*lsx_vssrlni_h_w" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vssrlni_w_d:.*vssrlni\\.w\\.d.*lsx_vssrlni_w_d" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vssrlni_d_q:.*vssrlni\\.d\\.q.*lsx_vssrlni_d_q" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vssrlni_bu_h:.*vssrlni\\.bu\\.h.*lsx_vssrlni_bu_h" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vssrlni_hu_w:.*vssrlni\\.hu\\.w.*lsx_vssrlni_hu_w" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vssrlni_wu_d:.*vssrlni\\.wu\\.d.*lsx_vssrlni_wu_d" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vssrlni_du_q:.*vssrlni\\.du\\.q.*lsx_vssrlni_du_q" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vssrlrni_b_h:.*vssrlrni\\.b\\.h.*lsx_vssrlrni_b_h" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vssrlrni_h_w:.*vssrlrni\\.h\\.w.*lsx_vssrlrni_h_w" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vssrlrni_w_d:.*vssrlrni\\.w\\.d.*lsx_vssrlrni_w_d" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vssrlrni_d_q:.*vssrlrni\\.d\\.q.*lsx_vssrlrni_d_q" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vssrlrni_bu_h:.*vssrlrni\\.bu\\.h.*lsx_vssrlrni_bu_h" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vssrlrni_hu_w:.*vssrlrni\\.hu\\.w.*lsx_vssrlrni_hu_w" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vssrlrni_wu_d:.*vssrlrni\\.wu\\.d.*lsx_vssrlrni_wu_d" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vssrlrni_du_q:.*vssrlrni\\.du\\.q.*lsx_vssrlrni_du_q" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vsrani_b_h:.*vsrani\\.b\\.h.*lsx_vsrani_b_h" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vsrani_h_w:.*vsrani\\.h\\.w.*lsx_vsrani_h_w" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vsrani_w_d:.*vsrani\\.w\\.d.*lsx_vsrani_w_d" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vsrani_d_q:.*vsrani\\.d\\.q.*lsx_vsrani_d_q" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vsrarni_b_h:.*vsrarni\\.b\\.h.*lsx_vsrarni_b_h" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vsrarni_h_w:.*vsrarni\\.h\\.w.*lsx_vsrarni_h_w" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vsrarni_w_d:.*vsrarni\\.w\\.d.*lsx_vsrarni_w_d" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vsrarni_d_q:.*vsrarni\\.d\\.q.*lsx_vsrarni_d_q" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vssrani_b_h:.*vssrani\\.b\\.h.*lsx_vssrani_b_h" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vssrani_h_w:.*vssrani\\.h\\.w.*lsx_vssrani_h_w" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vssrani_w_d:.*vssrani\\.w\\.d.*lsx_vssrani_w_d" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vssrani_d_q:.*vssrani\\.d\\.q.*lsx_vssrani_d_q" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vssrani_bu_h:.*vssrani\\.bu\\.h.*lsx_vssrani_bu_h" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vssrani_hu_w:.*vssrani\\.hu\\.w.*lsx_vssrani_hu_w" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vssrani_wu_d:.*vssrani\\.wu\\.d.*lsx_vssrani_wu_d" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vssrani_du_q:.*vssrani\\.du\\.q.*lsx_vssrani_du_q" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vssrarni_b_h:.*vssrarni\\.b\\.h.*lsx_vssrarni_b_h" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vssrarni_h_w:.*vssrarni\\.h\\.w.*lsx_vssrarni_h_w" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vssrarni_w_d:.*vssrarni\\.w\\.d.*lsx_vssrarni_w_d" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vssrarni_d_q:.*vssrarni\\.d\\.q.*lsx_vssrarni_d_q" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vssrarni_bu_h:.*vssrarni\\.bu\\.h.*lsx_vssrarni_bu_h" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vssrarni_hu_w:.*vssrarni\\.hu\\.w.*lsx_vssrarni_hu_w" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vssrarni_wu_d:.*vssrarni\\.wu\\.d.*lsx_vssrarni_wu_d" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vssrarni_du_q:.*vssrarni\\.du\\.q.*lsx_vssrarni_du_q" 1 } } */ +/* { dg-final { scan-assembler-times "lsx_vpermi_w:.*vpermi\\.w.*lsx_vpermi_w" + * 1 } } */ +/* { dg-final { scan-assembler-times "lsx_vld:.*vld.*lsx_vld" 1 } } */ +/* { dg-final { scan-assembler-times "lsx_vst:.*vst.*lsx_vst" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vssrlrn_b_h:.*vssrlrn\\.b\\.h.*lsx_vssrlrn_b_h" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vssrlrn_h_w:.*vssrlrn\\.h\\.w.*lsx_vssrlrn_h_w" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vssrlrn_w_d:.*vssrlrn\\.w\\.d.*lsx_vssrlrn_w_d" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vssrln_b_h:.*vssrln\\.b\\.h.*lsx_vssrln_b_h" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vssrln_h_w:.*vssrln\\.h\\.w.*lsx_vssrln_h_w" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vssrln_w_d:.*vssrln\\.w\\.d.*lsx_vssrln_w_d" 1 } } */ +/* { dg-final { scan-assembler-times "lsx_vorn_v:.*vorn\\.v.*lsx_vorn_v" 1 } } + */ +/* { dg-final { scan-assembler-times "lsx_vldi:.*vldi.*lsx_vldi" 1 } } */ +/* { dg-final { scan-assembler-times "lsx_vshuf_b:.*vshuf\\.b.*lsx_vshuf_b" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_vldx:.*vldx.*lsx_vldx" 1 } } */ +/* { dg-final { scan-assembler-times "lsx_vstx:.*vstx.*lsx_vstx" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vextl_qu_du:.*vextl\\.qu\\.du.*lsx_vextl_qu_du" 1 } } */ +/* { dg-final { scan-assembler-times "lsx_bnz_b:.*vsetanyeqz\\.b.*lsx_bnz_b" 1 + * } } */ +/* { dg-final { scan-assembler-times "lsx_bnz_d:.*vsetanyeqz\\.d.*lsx_bnz_d" 1 + * } } */ +/* { dg-final { scan-assembler-times "lsx_bnz_h:.*vsetanyeqz\\.h.*lsx_bnz_h" 1 + * } } */ +/* { dg-final { scan-assembler-times "lsx_bnz_v:.*vseteqz\\.v.*lsx_bnz_v" 1 } } + */ +/* { dg-final { scan-assembler-times "lsx_bnz_w:.*vsetanyeqz\\.w.*lsx_bnz_w" 1 + * } } */ +/* { dg-final { scan-assembler-times "lsx_bz_b:.*vsetallnez\\.b.*lsx_bz_b" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_bz_d:.*vsetallnez\\.d.*lsx_bz_d" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_bz_h:.*vsetallnez\\.h.*lsx_bz_h" 1 } + * } */ +/* { dg-final { scan-assembler-times "lsx_bz_v:.*vsetnez\\.v.*lsx_bz_v" 1 } } + */ +/* { dg-final { scan-assembler-times "lsx_bz_w:.*vsetallnez\\.w.*lsx_bz_w" 1 } + * } */ +/* { dg-final { scan-assembler-times + * "lsx_vfcmp_caf_d:.*vfcmp\\.caf\\.d.*lsx_vfcmp_caf_d" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vfcmp_caf_s:.*vfcmp\\.caf\\.s.*lsx_vfcmp_caf_s" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vfcmp_ceq_d:.*vfcmp\\.ceq\\.d.*lsx_vfcmp_ceq_d" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vfcmp_ceq_s:.*vfcmp\\.ceq\\.s.*lsx_vfcmp_ceq_s" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vfcmp_cle_d:.*vfcmp\\.cle\\.d.*lsx_vfcmp_cle_d" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vfcmp_cle_s:.*vfcmp\\.cle\\.s.*lsx_vfcmp_cle_s" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vfcmp_clt_d:.*vfcmp\\.clt\\.d.*lsx_vfcmp_clt_d" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vfcmp_clt_s:.*vfcmp\\.clt\\.s.*lsx_vfcmp_clt_s" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vfcmp_cne_d:.*vfcmp\\.cne\\.d.*lsx_vfcmp_cne_d" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vfcmp_cne_s:.*vfcmp\\.cne\\.s.*lsx_vfcmp_cne_s" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vfcmp_cor_d:.*vfcmp\\.cor\\.d.*lsx_vfcmp_cor_d" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vfcmp_cor_s:.*vfcmp\\.cor\\.s.*lsx_vfcmp_cor_s" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vfcmp_cueq_d:.*vfcmp\\.cueq\\.d.*lsx_vfcmp_cueq_d" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vfcmp_cueq_s:.*vfcmp\\.cueq\\.s.*lsx_vfcmp_cueq_s" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vfcmp_cule_d:.*vfcmp\\.cule\\.d.*lsx_vfcmp_cule_d" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vfcmp_cule_s:.*vfcmp\\.cule\\.s.*lsx_vfcmp_cule_s" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vfcmp_cult_d:.*vfcmp\\.cult\\.d.*lsx_vfcmp_cult_d" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vfcmp_cult_s:.*vfcmp\\.cult\\.s.*lsx_vfcmp_cult_s" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vfcmp_cun_d:.*vfcmp\\.cun\\.d.*lsx_vfcmp_cun_d" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vfcmp_cune_d:.*vfcmp\\.cune\\.d.*lsx_vfcmp_cune_d" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vfcmp_cune_s:.*vfcmp\\.cune\\.s.*lsx_vfcmp_cune_s" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vfcmp_cun_s:.*vfcmp\\.cun\\.s.*lsx_vfcmp_cun_s" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vfcmp_saf_d:.*vfcmp\\.saf\\.d.*lsx_vfcmp_saf_d" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vfcmp_saf_s:.*vfcmp\\.saf\\.s.*lsx_vfcmp_saf_s" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vfcmp_seq_d:.*vfcmp\\.seq\\.d.*lsx_vfcmp_seq_d" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vfcmp_seq_s:.*vfcmp\\.seq\\.s.*lsx_vfcmp_seq_s" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vfcmp_sle_d:.*vfcmp\\.sle\\.d.*lsx_vfcmp_sle_d" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vfcmp_sle_s:.*vfcmp\\.sle\\.s.*lsx_vfcmp_sle_s" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vfcmp_slt_d:.*vfcmp\\.slt\\.d.*lsx_vfcmp_slt_d" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vfcmp_slt_s:.*vfcmp\\.slt\\.s.*lsx_vfcmp_slt_s" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vfcmp_sne_d:.*vfcmp\\.sne\\.d.*lsx_vfcmp_sne_d" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vfcmp_sne_s:.*vfcmp\\.sne\\.s.*lsx_vfcmp_sne_s" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vfcmp_sor_d:.*vfcmp\\.sor\\.d.*lsx_vfcmp_sor_d" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vfcmp_sor_s:.*vfcmp\\.sor\\.s.*lsx_vfcmp_sor_s" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vfcmp_sueq_d:.*vfcmp\\.sueq\\.d.*lsx_vfcmp_sueq_d" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vfcmp_sueq_s:.*vfcmp\\.sueq\\.s.*lsx_vfcmp_sueq_s" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vfcmp_sule_d:.*vfcmp\\.sule\\.d.*lsx_vfcmp_sule_d" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vfcmp_sule_s:.*vfcmp\\.sule\\.s.*lsx_vfcmp_sule_s" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vfcmp_sult_d:.*vfcmp\\.sult\\.d.*lsx_vfcmp_sult_d" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vfcmp_sult_s:.*vfcmp\\.sult\\.s.*lsx_vfcmp_sult_s" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vfcmp_sun_d:.*vfcmp\\.sun\\.d.*lsx_vfcmp_sun_d" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vfcmp_sune_d:.*vfcmp\\.sune\\.d.*lsx_vfcmp_sune_d" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vfcmp_sune_s:.*vfcmp\\.sune\\.s.*lsx_vfcmp_sune_s" 1 } } */ +/* { dg-final { scan-assembler-times + * "lsx_vfcmp_sun_s:.*vfcmp\\.sun\\.s.*lsx_vfcmp_sun_s" 1 } } */ +/* { dg-final { scan-assembler-times "lsx_vrepli_b:.*vrepli\\.b.*lsx_vrepli_b" + * 1 } } */ +/* { dg-final { scan-assembler-times "lsx_vrepli_d:.*vrepli\\.d.*lsx_vrepli_d" + * 1 } } */ +/* { dg-final { scan-assembler-times "lsx_vrepli_h:.*vrepli\\.h.*lsx_vrepli_h" + * 1 } } */ +/* { dg-final { scan-assembler-times "lsx_vrepli_w:.*vrepli\\.w.*lsx_vrepli_w" + * 1 } } */ + +typedef signed char v16i8 __attribute__ ((vector_size (16), aligned (16))); +typedef signed char v16i8_b __attribute__ ((vector_size (16), aligned (1))); +typedef unsigned char v16u8 __attribute__ ((vector_size (16), aligned (16))); +typedef unsigned char v16u8_b __attribute__ ((vector_size (16), aligned (1))); +typedef short v8i16 __attribute__ ((vector_size (16), aligned (16))); +typedef short v8i16_h __attribute__ ((vector_size (16), aligned (2))); +typedef unsigned short v8u16 __attribute__ ((vector_size (16), aligned (16))); +typedef unsigned short v8u16_h __attribute__ ((vector_size (16), aligned (2))); +typedef int v4i32 __attribute__ ((vector_size (16), aligned (16))); +typedef int v4i32_w __attribute__ ((vector_size (16), aligned (4))); +typedef unsigned int v4u32 __attribute__ ((vector_size (16), aligned (16))); +typedef unsigned int v4u32_w __attribute__ ((vector_size (16), aligned (4))); +typedef long long v2i64 __attribute__ ((vector_size (16), aligned (16))); +typedef long long v2i64_d __attribute__ ((vector_size (16), aligned (8))); +typedef unsigned long long v2u64 + __attribute__ ((vector_size (16), aligned (16))); +typedef unsigned long long v2u64_d + __attribute__ ((vector_size (16), aligned (8))); +typedef float v4f32 __attribute__ ((vector_size (16), aligned (16))); +typedef float v4f32_w __attribute__ ((vector_size (16), aligned (4))); +typedef double v2f64 __attribute__ ((vector_size (16), aligned (16))); +typedef double v2f64_d __attribute__ ((vector_size (16), aligned (8))); + +typedef long long __m128i + __attribute__ ((__vector_size__ (16), __may_alias__)); +typedef float __m128 __attribute__ ((__vector_size__ (16), __may_alias__)); +typedef double __m128d __attribute__ ((__vector_size__ (16), __may_alias__)); + +v16i8 +__lsx_vsll_b (v16i8 _1, v16i8 _2) +{ + return __builtin_lsx_vsll_b (_1, _2); +} +v8i16 +__lsx_vsll_h (v8i16 _1, v8i16 _2) +{ + return __builtin_lsx_vsll_h (_1, _2); +} +v4i32 +__lsx_vsll_w (v4i32 _1, v4i32 _2) +{ + return __builtin_lsx_vsll_w (_1, _2); +} +v2i64 +__lsx_vsll_d (v2i64 _1, v2i64 _2) +{ + return __builtin_lsx_vsll_d (_1, _2); +} +v16i8 +__lsx_vslli_b (v16i8 _1) +{ + return __builtin_lsx_vslli_b (_1, 1); +} +v8i16 +__lsx_vslli_h (v8i16 _1) +{ + return __builtin_lsx_vslli_h (_1, 1); +} +v4i32 +__lsx_vslli_w (v4i32 _1) +{ + return __builtin_lsx_vslli_w (_1, 1); +} +v2i64 +__lsx_vslli_d (v2i64 _1) +{ + return __builtin_lsx_vslli_d (_1, 1); +} +v16i8 +__lsx_vsra_b (v16i8 _1, v16i8 _2) +{ + return __builtin_lsx_vsra_b (_1, _2); +} +v8i16 +__lsx_vsra_h (v8i16 _1, v8i16 _2) +{ + return __builtin_lsx_vsra_h (_1, _2); +} +v4i32 +__lsx_vsra_w (v4i32 _1, v4i32 _2) +{ + return __builtin_lsx_vsra_w (_1, _2); +} +v2i64 +__lsx_vsra_d (v2i64 _1, v2i64 _2) +{ + return __builtin_lsx_vsra_d (_1, _2); +} +v16i8 +__lsx_vsrai_b (v16i8 _1) +{ + return __builtin_lsx_vsrai_b (_1, 1); +} +v8i16 +__lsx_vsrai_h (v8i16 _1) +{ + return __builtin_lsx_vsrai_h (_1, 1); +} +v4i32 +__lsx_vsrai_w (v4i32 _1) +{ + return __builtin_lsx_vsrai_w (_1, 1); +} +v2i64 +__lsx_vsrai_d (v2i64 _1) +{ + return __builtin_lsx_vsrai_d (_1, 1); +} +v16i8 +__lsx_vsrar_b (v16i8 _1, v16i8 _2) +{ + return __builtin_lsx_vsrar_b (_1, _2); +} +v8i16 +__lsx_vsrar_h (v8i16 _1, v8i16 _2) +{ + return __builtin_lsx_vsrar_h (_1, _2); +} +v4i32 +__lsx_vsrar_w (v4i32 _1, v4i32 _2) +{ + return __builtin_lsx_vsrar_w (_1, _2); +} +v2i64 +__lsx_vsrar_d (v2i64 _1, v2i64 _2) +{ + return __builtin_lsx_vsrar_d (_1, _2); +} +v16i8 +__lsx_vsrari_b (v16i8 _1) +{ + return __builtin_lsx_vsrari_b (_1, 1); +} +v8i16 +__lsx_vsrari_h (v8i16 _1) +{ + return __builtin_lsx_vsrari_h (_1, 1); +} +v4i32 +__lsx_vsrari_w (v4i32 _1) +{ + return __builtin_lsx_vsrari_w (_1, 1); +} +v2i64 +__lsx_vsrari_d (v2i64 _1) +{ + return __builtin_lsx_vsrari_d (_1, 1); +} +v16i8 +__lsx_vsrl_b (v16i8 _1, v16i8 _2) +{ + return __builtin_lsx_vsrl_b (_1, _2); +} +v8i16 +__lsx_vsrl_h (v8i16 _1, v8i16 _2) +{ + return __builtin_lsx_vsrl_h (_1, _2); +} +v4i32 +__lsx_vsrl_w (v4i32 _1, v4i32 _2) +{ + return __builtin_lsx_vsrl_w (_1, _2); +} +v2i64 +__lsx_vsrl_d (v2i64 _1, v2i64 _2) +{ + return __builtin_lsx_vsrl_d (_1, _2); +} +v16i8 +__lsx_vsrli_b (v16i8 _1) +{ + return __builtin_lsx_vsrli_b (_1, 1); +} +v8i16 +__lsx_vsrli_h (v8i16 _1) +{ + return __builtin_lsx_vsrli_h (_1, 1); +} +v4i32 +__lsx_vsrli_w (v4i32 _1) +{ + return __builtin_lsx_vsrli_w (_1, 1); +} +v2i64 +__lsx_vsrli_d (v2i64 _1) +{ + return __builtin_lsx_vsrli_d (_1, 1); +} +v16i8 +__lsx_vsrlr_b (v16i8 _1, v16i8 _2) +{ + return __builtin_lsx_vsrlr_b (_1, _2); +} +v8i16 +__lsx_vsrlr_h (v8i16 _1, v8i16 _2) +{ + return __builtin_lsx_vsrlr_h (_1, _2); +} +v4i32 +__lsx_vsrlr_w (v4i32 _1, v4i32 _2) +{ + return __builtin_lsx_vsrlr_w (_1, _2); +} +v2i64 +__lsx_vsrlr_d (v2i64 _1, v2i64 _2) +{ + return __builtin_lsx_vsrlr_d (_1, _2); +} +v16i8 +__lsx_vsrlri_b (v16i8 _1) +{ + return __builtin_lsx_vsrlri_b (_1, 1); +} +v8i16 +__lsx_vsrlri_h (v8i16 _1) +{ + return __builtin_lsx_vsrlri_h (_1, 1); +} +v4i32 +__lsx_vsrlri_w (v4i32 _1) +{ + return __builtin_lsx_vsrlri_w (_1, 1); +} +v2i64 +__lsx_vsrlri_d (v2i64 _1) +{ + return __builtin_lsx_vsrlri_d (_1, 1); +} +v16u8 +__lsx_vbitclr_b (v16u8 _1, v16u8 _2) +{ + return __builtin_lsx_vbitclr_b (_1, _2); +} +v8u16 +__lsx_vbitclr_h (v8u16 _1, v8u16 _2) +{ + return __builtin_lsx_vbitclr_h (_1, _2); +} +v4u32 +__lsx_vbitclr_w (v4u32 _1, v4u32 _2) +{ + return __builtin_lsx_vbitclr_w (_1, _2); +} +v2u64 +__lsx_vbitclr_d (v2u64 _1, v2u64 _2) +{ + return __builtin_lsx_vbitclr_d (_1, _2); +} +v16u8 +__lsx_vbitclri_b (v16u8 _1) +{ + return __builtin_lsx_vbitclri_b (_1, 1); +} +v8u16 +__lsx_vbitclri_h (v8u16 _1) +{ + return __builtin_lsx_vbitclri_h (_1, 1); +} +v4u32 +__lsx_vbitclri_w (v4u32 _1) +{ + return __builtin_lsx_vbitclri_w (_1, 1); +} +v2u64 +__lsx_vbitclri_d (v2u64 _1) +{ + return __builtin_lsx_vbitclri_d (_1, 1); +} +v16u8 +__lsx_vbitset_b (v16u8 _1, v16u8 _2) +{ + return __builtin_lsx_vbitset_b (_1, _2); +} +v8u16 +__lsx_vbitset_h (v8u16 _1, v8u16 _2) +{ + return __builtin_lsx_vbitset_h (_1, _2); +} +v4u32 +__lsx_vbitset_w (v4u32 _1, v4u32 _2) +{ + return __builtin_lsx_vbitset_w (_1, _2); +} +v2u64 +__lsx_vbitset_d (v2u64 _1, v2u64 _2) +{ + return __builtin_lsx_vbitset_d (_1, _2); +} +v16u8 +__lsx_vbitseti_b (v16u8 _1) +{ + return __builtin_lsx_vbitseti_b (_1, 1); +} +v8u16 +__lsx_vbitseti_h (v8u16 _1) +{ + return __builtin_lsx_vbitseti_h (_1, 1); +} +v4u32 +__lsx_vbitseti_w (v4u32 _1) +{ + return __builtin_lsx_vbitseti_w (_1, 1); +} +v2u64 +__lsx_vbitseti_d (v2u64 _1) +{ + return __builtin_lsx_vbitseti_d (_1, 1); +} +v16u8 +__lsx_vbitrev_b (v16u8 _1, v16u8 _2) +{ + return __builtin_lsx_vbitrev_b (_1, _2); +} +v8u16 +__lsx_vbitrev_h (v8u16 _1, v8u16 _2) +{ + return __builtin_lsx_vbitrev_h (_1, _2); +} +v4u32 +__lsx_vbitrev_w (v4u32 _1, v4u32 _2) +{ + return __builtin_lsx_vbitrev_w (_1, _2); +} +v2u64 +__lsx_vbitrev_d (v2u64 _1, v2u64 _2) +{ + return __builtin_lsx_vbitrev_d (_1, _2); +} +v16u8 +__lsx_vbitrevi_b (v16u8 _1) +{ + return __builtin_lsx_vbitrevi_b (_1, 1); +} +v8u16 +__lsx_vbitrevi_h (v8u16 _1) +{ + return __builtin_lsx_vbitrevi_h (_1, 1); +} +v4u32 +__lsx_vbitrevi_w (v4u32 _1) +{ + return __builtin_lsx_vbitrevi_w (_1, 1); +} +v2u64 +__lsx_vbitrevi_d (v2u64 _1) +{ + return __builtin_lsx_vbitrevi_d (_1, 1); +} +v16i8 +__lsx_vadd_b (v16i8 _1, v16i8 _2) +{ + return __builtin_lsx_vadd_b (_1, _2); +} +v8i16 +__lsx_vadd_h (v8i16 _1, v8i16 _2) +{ + return __builtin_lsx_vadd_h (_1, _2); +} +v4i32 +__lsx_vadd_w (v4i32 _1, v4i32 _2) +{ + return __builtin_lsx_vadd_w (_1, _2); +} +v2i64 +__lsx_vadd_d (v2i64 _1, v2i64 _2) +{ + return __builtin_lsx_vadd_d (_1, _2); +} +v16i8 +__lsx_vaddi_bu (v16i8 _1) +{ + return __builtin_lsx_vaddi_bu (_1, 1); +} +v8i16 +__lsx_vaddi_hu (v8i16 _1) +{ + return __builtin_lsx_vaddi_hu (_1, 1); +} +v4i32 +__lsx_vaddi_wu (v4i32 _1) +{ + return __builtin_lsx_vaddi_wu (_1, 1); +} +v2i64 +__lsx_vaddi_du (v2i64 _1) +{ + return __builtin_lsx_vaddi_du (_1, 1); +} +v16i8 +__lsx_vsub_b (v16i8 _1, v16i8 _2) +{ + return __builtin_lsx_vsub_b (_1, _2); +} +v8i16 +__lsx_vsub_h (v8i16 _1, v8i16 _2) +{ + return __builtin_lsx_vsub_h (_1, _2); +} +v4i32 +__lsx_vsub_w (v4i32 _1, v4i32 _2) +{ + return __builtin_lsx_vsub_w (_1, _2); +} +v2i64 +__lsx_vsub_d (v2i64 _1, v2i64 _2) +{ + return __builtin_lsx_vsub_d (_1, _2); +} +v16i8 +__lsx_vsubi_bu (v16i8 _1) +{ + return __builtin_lsx_vsubi_bu (_1, 1); +} +v8i16 +__lsx_vsubi_hu (v8i16 _1) +{ + return __builtin_lsx_vsubi_hu (_1, 1); +} +v4i32 +__lsx_vsubi_wu (v4i32 _1) +{ + return __builtin_lsx_vsubi_wu (_1, 1); +} +v2i64 +__lsx_vsubi_du (v2i64 _1) +{ + return __builtin_lsx_vsubi_du (_1, 1); +} +v16i8 +__lsx_vmax_b (v16i8 _1, v16i8 _2) +{ + return __builtin_lsx_vmax_b (_1, _2); +} +v8i16 +__lsx_vmax_h (v8i16 _1, v8i16 _2) +{ + return __builtin_lsx_vmax_h (_1, _2); +} +v4i32 +__lsx_vmax_w (v4i32 _1, v4i32 _2) +{ + return __builtin_lsx_vmax_w (_1, _2); +} +v2i64 +__lsx_vmax_d (v2i64 _1, v2i64 _2) +{ + return __builtin_lsx_vmax_d (_1, _2); +} +v16i8 +__lsx_vmaxi_b (v16i8 _1) +{ + return __builtin_lsx_vmaxi_b (_1, 1); +} +v8i16 +__lsx_vmaxi_h (v8i16 _1) +{ + return __builtin_lsx_vmaxi_h (_1, 1); +} +v4i32 +__lsx_vmaxi_w (v4i32 _1) +{ + return __builtin_lsx_vmaxi_w (_1, 1); +} +v2i64 +__lsx_vmaxi_d (v2i64 _1) +{ + return __builtin_lsx_vmaxi_d (_1, 1); +} +v16u8 +__lsx_vmax_bu (v16u8 _1, v16u8 _2) +{ + return __builtin_lsx_vmax_bu (_1, _2); +} +v8u16 +__lsx_vmax_hu (v8u16 _1, v8u16 _2) +{ + return __builtin_lsx_vmax_hu (_1, _2); +} +v4u32 +__lsx_vmax_wu (v4u32 _1, v4u32 _2) +{ + return __builtin_lsx_vmax_wu (_1, _2); +} +v2u64 +__lsx_vmax_du (v2u64 _1, v2u64 _2) +{ + return __builtin_lsx_vmax_du (_1, _2); +} +v16u8 +__lsx_vmaxi_bu (v16u8 _1) +{ + return __builtin_lsx_vmaxi_bu (_1, 1); +} +v8u16 +__lsx_vmaxi_hu (v8u16 _1) +{ + return __builtin_lsx_vmaxi_hu (_1, 1); +} +v4u32 +__lsx_vmaxi_wu (v4u32 _1) +{ + return __builtin_lsx_vmaxi_wu (_1, 1); +} +v2u64 +__lsx_vmaxi_du (v2u64 _1) +{ + return __builtin_lsx_vmaxi_du (_1, 1); +} +v16i8 +__lsx_vmin_b (v16i8 _1, v16i8 _2) +{ + return __builtin_lsx_vmin_b (_1, _2); +} +v8i16 +__lsx_vmin_h (v8i16 _1, v8i16 _2) +{ + return __builtin_lsx_vmin_h (_1, _2); +} +v4i32 +__lsx_vmin_w (v4i32 _1, v4i32 _2) +{ + return __builtin_lsx_vmin_w (_1, _2); +} +v2i64 +__lsx_vmin_d (v2i64 _1, v2i64 _2) +{ + return __builtin_lsx_vmin_d (_1, _2); +} +v16i8 +__lsx_vmini_b (v16i8 _1) +{ + return __builtin_lsx_vmini_b (_1, 1); +} +v8i16 +__lsx_vmini_h (v8i16 _1) +{ + return __builtin_lsx_vmini_h (_1, 1); +} +v4i32 +__lsx_vmini_w (v4i32 _1) +{ + return __builtin_lsx_vmini_w (_1, 1); +} +v2i64 +__lsx_vmini_d (v2i64 _1) +{ + return __builtin_lsx_vmini_d (_1, 1); +} +v16u8 +__lsx_vmin_bu (v16u8 _1, v16u8 _2) +{ + return __builtin_lsx_vmin_bu (_1, _2); +} +v8u16 +__lsx_vmin_hu (v8u16 _1, v8u16 _2) +{ + return __builtin_lsx_vmin_hu (_1, _2); +} +v4u32 +__lsx_vmin_wu (v4u32 _1, v4u32 _2) +{ + return __builtin_lsx_vmin_wu (_1, _2); +} +v2u64 +__lsx_vmin_du (v2u64 _1, v2u64 _2) +{ + return __builtin_lsx_vmin_du (_1, _2); +} +v16u8 +__lsx_vmini_bu (v16u8 _1) +{ + return __builtin_lsx_vmini_bu (_1, 1); +} +v8u16 +__lsx_vmini_hu (v8u16 _1) +{ + return __builtin_lsx_vmini_hu (_1, 1); +} +v4u32 +__lsx_vmini_wu (v4u32 _1) +{ + return __builtin_lsx_vmini_wu (_1, 1); +} +v2u64 +__lsx_vmini_du (v2u64 _1) +{ + return __builtin_lsx_vmini_du (_1, 1); +} +v16i8 +__lsx_vseq_b (v16i8 _1, v16i8 _2) +{ + return __builtin_lsx_vseq_b (_1, _2); +} +v8i16 +__lsx_vseq_h (v8i16 _1, v8i16 _2) +{ + return __builtin_lsx_vseq_h (_1, _2); +} +v4i32 +__lsx_vseq_w (v4i32 _1, v4i32 _2) +{ + return __builtin_lsx_vseq_w (_1, _2); +} +v2i64 +__lsx_vseq_d (v2i64 _1, v2i64 _2) +{ + return __builtin_lsx_vseq_d (_1, _2); +} +v16i8 +__lsx_vseqi_b (v16i8 _1) +{ + return __builtin_lsx_vseqi_b (_1, 1); +} +v8i16 +__lsx_vseqi_h (v8i16 _1) +{ + return __builtin_lsx_vseqi_h (_1, 1); +} +v4i32 +__lsx_vseqi_w (v4i32 _1) +{ + return __builtin_lsx_vseqi_w (_1, 1); +} +v2i64 +__lsx_vseqi_d (v2i64 _1) +{ + return __builtin_lsx_vseqi_d (_1, 1); +} +v16i8 +__lsx_vslti_b (v16i8 _1) +{ + return __builtin_lsx_vslti_b (_1, 1); +} +v16i8 +__lsx_vslt_b (v16i8 _1, v16i8 _2) +{ + return __builtin_lsx_vslt_b (_1, _2); +} +v8i16 +__lsx_vslt_h (v8i16 _1, v8i16 _2) +{ + return __builtin_lsx_vslt_h (_1, _2); +} +v4i32 +__lsx_vslt_w (v4i32 _1, v4i32 _2) +{ + return __builtin_lsx_vslt_w (_1, _2); +} +v2i64 +__lsx_vslt_d (v2i64 _1, v2i64 _2) +{ + return __builtin_lsx_vslt_d (_1, _2); +} +v8i16 +__lsx_vslti_h (v8i16 _1) +{ + return __builtin_lsx_vslti_h (_1, 1); +} +v4i32 +__lsx_vslti_w (v4i32 _1) +{ + return __builtin_lsx_vslti_w (_1, 1); +} +v2i64 +__lsx_vslti_d (v2i64 _1) +{ + return __builtin_lsx_vslti_d (_1, 1); +} +v16i8 +__lsx_vslt_bu (v16u8 _1, v16u8 _2) +{ + return __builtin_lsx_vslt_bu (_1, _2); +} +v8i16 +__lsx_vslt_hu (v8u16 _1, v8u16 _2) +{ + return __builtin_lsx_vslt_hu (_1, _2); +} +v4i32 +__lsx_vslt_wu (v4u32 _1, v4u32 _2) +{ + return __builtin_lsx_vslt_wu (_1, _2); +} +v2i64 +__lsx_vslt_du (v2u64 _1, v2u64 _2) +{ + return __builtin_lsx_vslt_du (_1, _2); +} +v16i8 +__lsx_vslti_bu (v16u8 _1) +{ + return __builtin_lsx_vslti_bu (_1, 1); +} +v8i16 +__lsx_vslti_hu (v8u16 _1) +{ + return __builtin_lsx_vslti_hu (_1, 1); +} +v4i32 +__lsx_vslti_wu (v4u32 _1) +{ + return __builtin_lsx_vslti_wu (_1, 1); +} +v2i64 +__lsx_vslti_du (v2u64 _1) +{ + return __builtin_lsx_vslti_du (_1, 1); +} +v16i8 +__lsx_vsle_b (v16i8 _1, v16i8 _2) +{ + return __builtin_lsx_vsle_b (_1, _2); +} +v8i16 +__lsx_vsle_h (v8i16 _1, v8i16 _2) +{ + return __builtin_lsx_vsle_h (_1, _2); +} +v4i32 +__lsx_vsle_w (v4i32 _1, v4i32 _2) +{ + return __builtin_lsx_vsle_w (_1, _2); +} +v2i64 +__lsx_vsle_d (v2i64 _1, v2i64 _2) +{ + return __builtin_lsx_vsle_d (_1, _2); +} +v16i8 +__lsx_vslei_b (v16i8 _1) +{ + return __builtin_lsx_vslei_b (_1, 1); +} +v8i16 +__lsx_vslei_h (v8i16 _1) +{ + return __builtin_lsx_vslei_h (_1, 1); +} +v4i32 +__lsx_vslei_w (v4i32 _1) +{ + return __builtin_lsx_vslei_w (_1, 1); +} +v2i64 +__lsx_vslei_d (v2i64 _1) +{ + return __builtin_lsx_vslei_d (_1, 1); +} +v16i8 +__lsx_vsle_bu (v16u8 _1, v16u8 _2) +{ + return __builtin_lsx_vsle_bu (_1, _2); +} +v8i16 +__lsx_vsle_hu (v8u16 _1, v8u16 _2) +{ + return __builtin_lsx_vsle_hu (_1, _2); +} +v4i32 +__lsx_vsle_wu (v4u32 _1, v4u32 _2) +{ + return __builtin_lsx_vsle_wu (_1, _2); +} +v2i64 +__lsx_vsle_du (v2u64 _1, v2u64 _2) +{ + return __builtin_lsx_vsle_du (_1, _2); +} +v16i8 +__lsx_vslei_bu (v16u8 _1) +{ + return __builtin_lsx_vslei_bu (_1, 1); +} +v8i16 +__lsx_vslei_hu (v8u16 _1) +{ + return __builtin_lsx_vslei_hu (_1, 1); +} +v4i32 +__lsx_vslei_wu (v4u32 _1) +{ + return __builtin_lsx_vslei_wu (_1, 1); +} +v2i64 +__lsx_vslei_du (v2u64 _1) +{ + return __builtin_lsx_vslei_du (_1, 1); +} +v16i8 +__lsx_vsat_b (v16i8 _1) +{ + return __builtin_lsx_vsat_b (_1, 1); +} +v8i16 +__lsx_vsat_h (v8i16 _1) +{ + return __builtin_lsx_vsat_h (_1, 1); +} +v4i32 +__lsx_vsat_w (v4i32 _1) +{ + return __builtin_lsx_vsat_w (_1, 1); +} +v2i64 +__lsx_vsat_d (v2i64 _1) +{ + return __builtin_lsx_vsat_d (_1, 1); +} +v16u8 +__lsx_vsat_bu (v16u8 _1) +{ + return __builtin_lsx_vsat_bu (_1, 1); +} +v8u16 +__lsx_vsat_hu (v8u16 _1) +{ + return __builtin_lsx_vsat_hu (_1, 1); +} +v4u32 +__lsx_vsat_wu (v4u32 _1) +{ + return __builtin_lsx_vsat_wu (_1, 1); +} +v2u64 +__lsx_vsat_du (v2u64 _1) +{ + return __builtin_lsx_vsat_du (_1, 1); +} +v16i8 +__lsx_vadda_b (v16i8 _1, v16i8 _2) +{ + return __builtin_lsx_vadda_b (_1, _2); +} +v8i16 +__lsx_vadda_h (v8i16 _1, v8i16 _2) +{ + return __builtin_lsx_vadda_h (_1, _2); +} +v4i32 +__lsx_vadda_w (v4i32 _1, v4i32 _2) +{ + return __builtin_lsx_vadda_w (_1, _2); +} +v2i64 +__lsx_vadda_d (v2i64 _1, v2i64 _2) +{ + return __builtin_lsx_vadda_d (_1, _2); +} +v16i8 +__lsx_vsadd_b (v16i8 _1, v16i8 _2) +{ + return __builtin_lsx_vsadd_b (_1, _2); +} +v8i16 +__lsx_vsadd_h (v8i16 _1, v8i16 _2) +{ + return __builtin_lsx_vsadd_h (_1, _2); +} +v4i32 +__lsx_vsadd_w (v4i32 _1, v4i32 _2) +{ + return __builtin_lsx_vsadd_w (_1, _2); +} +v2i64 +__lsx_vsadd_d (v2i64 _1, v2i64 _2) +{ + return __builtin_lsx_vsadd_d (_1, _2); +} +v16u8 +__lsx_vsadd_bu (v16u8 _1, v16u8 _2) +{ + return __builtin_lsx_vsadd_bu (_1, _2); +} +v8u16 +__lsx_vsadd_hu (v8u16 _1, v8u16 _2) +{ + return __builtin_lsx_vsadd_hu (_1, _2); +} +v4u32 +__lsx_vsadd_wu (v4u32 _1, v4u32 _2) +{ + return __builtin_lsx_vsadd_wu (_1, _2); +} +v2u64 +__lsx_vsadd_du (v2u64 _1, v2u64 _2) +{ + return __builtin_lsx_vsadd_du (_1, _2); +} +v16i8 +__lsx_vavg_b (v16i8 _1, v16i8 _2) +{ + return __builtin_lsx_vavg_b (_1, _2); +} +v8i16 +__lsx_vavg_h (v8i16 _1, v8i16 _2) +{ + return __builtin_lsx_vavg_h (_1, _2); +} +v4i32 +__lsx_vavg_w (v4i32 _1, v4i32 _2) +{ + return __builtin_lsx_vavg_w (_1, _2); +} +v2i64 +__lsx_vavg_d (v2i64 _1, v2i64 _2) +{ + return __builtin_lsx_vavg_d (_1, _2); +} +v16u8 +__lsx_vavg_bu (v16u8 _1, v16u8 _2) +{ + return __builtin_lsx_vavg_bu (_1, _2); +} +v8u16 +__lsx_vavg_hu (v8u16 _1, v8u16 _2) +{ + return __builtin_lsx_vavg_hu (_1, _2); +} +v4u32 +__lsx_vavg_wu (v4u32 _1, v4u32 _2) +{ + return __builtin_lsx_vavg_wu (_1, _2); +} +v2u64 +__lsx_vavg_du (v2u64 _1, v2u64 _2) +{ + return __builtin_lsx_vavg_du (_1, _2); +} +v16i8 +__lsx_vavgr_b (v16i8 _1, v16i8 _2) +{ + return __builtin_lsx_vavgr_b (_1, _2); +} +v8i16 +__lsx_vavgr_h (v8i16 _1, v8i16 _2) +{ + return __builtin_lsx_vavgr_h (_1, _2); +} +v4i32 +__lsx_vavgr_w (v4i32 _1, v4i32 _2) +{ + return __builtin_lsx_vavgr_w (_1, _2); +} +v2i64 +__lsx_vavgr_d (v2i64 _1, v2i64 _2) +{ + return __builtin_lsx_vavgr_d (_1, _2); +} +v16u8 +__lsx_vavgr_bu (v16u8 _1, v16u8 _2) +{ + return __builtin_lsx_vavgr_bu (_1, _2); +} +v8u16 +__lsx_vavgr_hu (v8u16 _1, v8u16 _2) +{ + return __builtin_lsx_vavgr_hu (_1, _2); +} +v4u32 +__lsx_vavgr_wu (v4u32 _1, v4u32 _2) +{ + return __builtin_lsx_vavgr_wu (_1, _2); +} +v2u64 +__lsx_vavgr_du (v2u64 _1, v2u64 _2) +{ + return __builtin_lsx_vavgr_du (_1, _2); +} +v16i8 +__lsx_vssub_b (v16i8 _1, v16i8 _2) +{ + return __builtin_lsx_vssub_b (_1, _2); +} +v8i16 +__lsx_vssub_h (v8i16 _1, v8i16 _2) +{ + return __builtin_lsx_vssub_h (_1, _2); +} +v4i32 +__lsx_vssub_w (v4i32 _1, v4i32 _2) +{ + return __builtin_lsx_vssub_w (_1, _2); +} +v2i64 +__lsx_vssub_d (v2i64 _1, v2i64 _2) +{ + return __builtin_lsx_vssub_d (_1, _2); +} +v16u8 +__lsx_vssub_bu (v16u8 _1, v16u8 _2) +{ + return __builtin_lsx_vssub_bu (_1, _2); +} +v8u16 +__lsx_vssub_hu (v8u16 _1, v8u16 _2) +{ + return __builtin_lsx_vssub_hu (_1, _2); +} +v4u32 +__lsx_vssub_wu (v4u32 _1, v4u32 _2) +{ + return __builtin_lsx_vssub_wu (_1, _2); +} +v2u64 +__lsx_vssub_du (v2u64 _1, v2u64 _2) +{ + return __builtin_lsx_vssub_du (_1, _2); +} +v16i8 +__lsx_vabsd_b (v16i8 _1, v16i8 _2) +{ + return __builtin_lsx_vabsd_b (_1, _2); +} +v8i16 +__lsx_vabsd_h (v8i16 _1, v8i16 _2) +{ + return __builtin_lsx_vabsd_h (_1, _2); +} +v4i32 +__lsx_vabsd_w (v4i32 _1, v4i32 _2) +{ + return __builtin_lsx_vabsd_w (_1, _2); +} +v2i64 +__lsx_vabsd_d (v2i64 _1, v2i64 _2) +{ + return __builtin_lsx_vabsd_d (_1, _2); +} +v16u8 +__lsx_vabsd_bu (v16u8 _1, v16u8 _2) +{ + return __builtin_lsx_vabsd_bu (_1, _2); +} +v8u16 +__lsx_vabsd_hu (v8u16 _1, v8u16 _2) +{ + return __builtin_lsx_vabsd_hu (_1, _2); +} +v4u32 +__lsx_vabsd_wu (v4u32 _1, v4u32 _2) +{ + return __builtin_lsx_vabsd_wu (_1, _2); +} +v2u64 +__lsx_vabsd_du (v2u64 _1, v2u64 _2) +{ + return __builtin_lsx_vabsd_du (_1, _2); +} +v16i8 +__lsx_vmul_b (v16i8 _1, v16i8 _2) +{ + return __builtin_lsx_vmul_b (_1, _2); +} +v8i16 +__lsx_vmul_h (v8i16 _1, v8i16 _2) +{ + return __builtin_lsx_vmul_h (_1, _2); +} +v4i32 +__lsx_vmul_w (v4i32 _1, v4i32 _2) +{ + return __builtin_lsx_vmul_w (_1, _2); +} +v2i64 +__lsx_vmul_d (v2i64 _1, v2i64 _2) +{ + return __builtin_lsx_vmul_d (_1, _2); +} +v16i8 +__lsx_vmadd_b (v16i8 _1, v16i8 _2, v16i8 _3) +{ + return __builtin_lsx_vmadd_b (_1, _2, _3); +} +v8i16 +__lsx_vmadd_h (v8i16 _1, v8i16 _2, v8i16 _3) +{ + return __builtin_lsx_vmadd_h (_1, _2, _3); +} +v4i32 +__lsx_vmadd_w (v4i32 _1, v4i32 _2, v4i32 _3) +{ + return __builtin_lsx_vmadd_w (_1, _2, _3); +} +v2i64 +__lsx_vmadd_d (v2i64 _1, v2i64 _2, v2i64 _3) +{ + return __builtin_lsx_vmadd_d (_1, _2, _3); +} +v16i8 +__lsx_vmsub_b (v16i8 _1, v16i8 _2, v16i8 _3) +{ + return __builtin_lsx_vmsub_b (_1, _2, _3); +} +v8i16 +__lsx_vmsub_h (v8i16 _1, v8i16 _2, v8i16 _3) +{ + return __builtin_lsx_vmsub_h (_1, _2, _3); +} +v4i32 +__lsx_vmsub_w (v4i32 _1, v4i32 _2, v4i32 _3) +{ + return __builtin_lsx_vmsub_w (_1, _2, _3); +} +v2i64 +__lsx_vmsub_d (v2i64 _1, v2i64 _2, v2i64 _3) +{ + return __builtin_lsx_vmsub_d (_1, _2, _3); +} +v16i8 +__lsx_vdiv_b (v16i8 _1, v16i8 _2) +{ + return __builtin_lsx_vdiv_b (_1, _2); +} +v8i16 +__lsx_vdiv_h (v8i16 _1, v8i16 _2) +{ + return __builtin_lsx_vdiv_h (_1, _2); +} +v4i32 +__lsx_vdiv_w (v4i32 _1, v4i32 _2) +{ + return __builtin_lsx_vdiv_w (_1, _2); +} +v2i64 +__lsx_vdiv_d (v2i64 _1, v2i64 _2) +{ + return __builtin_lsx_vdiv_d (_1, _2); +} +v16u8 +__lsx_vdiv_bu (v16u8 _1, v16u8 _2) +{ + return __builtin_lsx_vdiv_bu (_1, _2); +} +v8u16 +__lsx_vdiv_hu (v8u16 _1, v8u16 _2) +{ + return __builtin_lsx_vdiv_hu (_1, _2); +} +v4u32 +__lsx_vdiv_wu (v4u32 _1, v4u32 _2) +{ + return __builtin_lsx_vdiv_wu (_1, _2); +} +v2u64 +__lsx_vdiv_du (v2u64 _1, v2u64 _2) +{ + return __builtin_lsx_vdiv_du (_1, _2); +} +v8i16 +__lsx_vhaddw_h_b (v16i8 _1, v16i8 _2) +{ + return __builtin_lsx_vhaddw_h_b (_1, _2); +} +v4i32 +__lsx_vhaddw_w_h (v8i16 _1, v8i16 _2) +{ + return __builtin_lsx_vhaddw_w_h (_1, _2); +} +v2i64 +__lsx_vhaddw_d_w (v4i32 _1, v4i32 _2) +{ + return __builtin_lsx_vhaddw_d_w (_1, _2); +} +v8u16 +__lsx_vhaddw_hu_bu (v16u8 _1, v16u8 _2) +{ + return __builtin_lsx_vhaddw_hu_bu (_1, _2); +} +v4u32 +__lsx_vhaddw_wu_hu (v8u16 _1, v8u16 _2) +{ + return __builtin_lsx_vhaddw_wu_hu (_1, _2); +} +v2u64 +__lsx_vhaddw_du_wu (v4u32 _1, v4u32 _2) +{ + return __builtin_lsx_vhaddw_du_wu (_1, _2); +} +v8i16 +__lsx_vhsubw_h_b (v16i8 _1, v16i8 _2) +{ + return __builtin_lsx_vhsubw_h_b (_1, _2); +} +v4i32 +__lsx_vhsubw_w_h (v8i16 _1, v8i16 _2) +{ + return __builtin_lsx_vhsubw_w_h (_1, _2); +} +v2i64 +__lsx_vhsubw_d_w (v4i32 _1, v4i32 _2) +{ + return __builtin_lsx_vhsubw_d_w (_1, _2); +} +v8i16 +__lsx_vhsubw_hu_bu (v16u8 _1, v16u8 _2) +{ + return __builtin_lsx_vhsubw_hu_bu (_1, _2); +} +v4i32 +__lsx_vhsubw_wu_hu (v8u16 _1, v8u16 _2) +{ + return __builtin_lsx_vhsubw_wu_hu (_1, _2); +} +v2i64 +__lsx_vhsubw_du_wu (v4u32 _1, v4u32 _2) +{ + return __builtin_lsx_vhsubw_du_wu (_1, _2); +} +v16i8 +__lsx_vmod_b (v16i8 _1, v16i8 _2) +{ + return __builtin_lsx_vmod_b (_1, _2); +} +v8i16 +__lsx_vmod_h (v8i16 _1, v8i16 _2) +{ + return __builtin_lsx_vmod_h (_1, _2); +} +v4i32 +__lsx_vmod_w (v4i32 _1, v4i32 _2) +{ + return __builtin_lsx_vmod_w (_1, _2); +} +v2i64 +__lsx_vmod_d (v2i64 _1, v2i64 _2) +{ + return __builtin_lsx_vmod_d (_1, _2); +} +v16u8 +__lsx_vmod_bu (v16u8 _1, v16u8 _2) +{ + return __builtin_lsx_vmod_bu (_1, _2); +} +v8u16 +__lsx_vmod_hu (v8u16 _1, v8u16 _2) +{ + return __builtin_lsx_vmod_hu (_1, _2); +} +v4u32 +__lsx_vmod_wu (v4u32 _1, v4u32 _2) +{ + return __builtin_lsx_vmod_wu (_1, _2); +} +v2u64 +__lsx_vmod_du (v2u64 _1, v2u64 _2) +{ + return __builtin_lsx_vmod_du (_1, _2); +} +v16i8 +__lsx_vreplve_b (v16i8 _1, int _2) +{ + return __builtin_lsx_vreplve_b (_1, _2); +} +v8i16 +__lsx_vreplve_h (v8i16 _1, int _2) +{ + return __builtin_lsx_vreplve_h (_1, _2); +} +v4i32 +__lsx_vreplve_w (v4i32 _1, int _2) +{ + return __builtin_lsx_vreplve_w (_1, _2); +} +v2i64 +__lsx_vreplve_d (v2i64 _1, int _2) +{ + return __builtin_lsx_vreplve_d (_1, _2); +} +v16i8 +__lsx_vreplvei_b (v16i8 _1) +{ + return __builtin_lsx_vreplvei_b (_1, 1); +} +v8i16 +__lsx_vreplvei_h (v8i16 _1) +{ + return __builtin_lsx_vreplvei_h (_1, 1); +} +v4i32 +__lsx_vreplvei_w (v4i32 _1) +{ + return __builtin_lsx_vreplvei_w (_1, 1); +} +v2i64 +__lsx_vreplvei_d (v2i64 _1) +{ + return __builtin_lsx_vreplvei_d (_1, 1); +} +v16i8 +__lsx_vpickev_b (v16i8 _1, v16i8 _2) +{ + return __builtin_lsx_vpickev_b (_1, _2); +} +v8i16 +__lsx_vpickev_h (v8i16 _1, v8i16 _2) +{ + return __builtin_lsx_vpickev_h (_1, _2); +} +v4i32 +__lsx_vpickev_w (v4i32 _1, v4i32 _2) +{ + return __builtin_lsx_vpickev_w (_1, _2); +} +v2i64 +__lsx_vpickev_d (v2i64 _1, v2i64 _2) +{ + return __builtin_lsx_vpickev_d (_1, _2); +} +v16i8 +__lsx_vpickod_b (v16i8 _1, v16i8 _2) +{ + return __builtin_lsx_vpickod_b (_1, _2); +} +v8i16 +__lsx_vpickod_h (v8i16 _1, v8i16 _2) +{ + return __builtin_lsx_vpickod_h (_1, _2); +} +v4i32 +__lsx_vpickod_w (v4i32 _1, v4i32 _2) +{ + return __builtin_lsx_vpickod_w (_1, _2); +} +v2i64 +__lsx_vpickod_d (v2i64 _1, v2i64 _2) +{ + return __builtin_lsx_vpickod_d (_1, _2); +} +v16i8 +__lsx_vilvh_b (v16i8 _1, v16i8 _2) +{ + return __builtin_lsx_vilvh_b (_1, _2); +} +v8i16 +__lsx_vilvh_h (v8i16 _1, v8i16 _2) +{ + return __builtin_lsx_vilvh_h (_1, _2); +} +v4i32 +__lsx_vilvh_w (v4i32 _1, v4i32 _2) +{ + return __builtin_lsx_vilvh_w (_1, _2); +} +v2i64 +__lsx_vilvh_d (v2i64 _1, v2i64 _2) +{ + return __builtin_lsx_vilvh_d (_1, _2); +} +v16i8 +__lsx_vilvl_b (v16i8 _1, v16i8 _2) +{ + return __builtin_lsx_vilvl_b (_1, _2); +} +v8i16 +__lsx_vilvl_h (v8i16 _1, v8i16 _2) +{ + return __builtin_lsx_vilvl_h (_1, _2); +} +v4i32 +__lsx_vilvl_w (v4i32 _1, v4i32 _2) +{ + return __builtin_lsx_vilvl_w (_1, _2); +} +v2i64 +__lsx_vilvl_d (v2i64 _1, v2i64 _2) +{ + return __builtin_lsx_vilvl_d (_1, _2); +} +v16i8 +__lsx_vpackev_b (v16i8 _1, v16i8 _2) +{ + return __builtin_lsx_vpackev_b (_1, _2); +} +v8i16 +__lsx_vpackev_h (v8i16 _1, v8i16 _2) +{ + return __builtin_lsx_vpackev_h (_1, _2); +} +v4i32 +__lsx_vpackev_w (v4i32 _1, v4i32 _2) +{ + return __builtin_lsx_vpackev_w (_1, _2); +} +v2i64 +__lsx_vpackev_d (v2i64 _1, v2i64 _2) +{ + return __builtin_lsx_vpackev_d (_1, _2); +} +v16i8 +__lsx_vpackod_b (v16i8 _1, v16i8 _2) +{ + return __builtin_lsx_vpackod_b (_1, _2); +} +v8i16 +__lsx_vpackod_h (v8i16 _1, v8i16 _2) +{ + return __builtin_lsx_vpackod_h (_1, _2); +} +v4i32 +__lsx_vpackod_w (v4i32 _1, v4i32 _2) +{ + return __builtin_lsx_vpackod_w (_1, _2); +} +v2i64 +__lsx_vpackod_d (v2i64 _1, v2i64 _2) +{ + return __builtin_lsx_vpackod_d (_1, _2); +} +v8i16 +__lsx_vshuf_h (v8i16 _1, v8i16 _2, v8i16 _3) +{ + return __builtin_lsx_vshuf_h (_1, _2, _3); +} +v4i32 +__lsx_vshuf_w (v4i32 _1, v4i32 _2, v4i32 _3) +{ + return __builtin_lsx_vshuf_w (_1, _2, _3); +} +v2i64 +__lsx_vshuf_d (v2i64 _1, v2i64 _2, v2i64 _3) +{ + return __builtin_lsx_vshuf_d (_1, _2, _3); +} +v16u8 +__lsx_vand_v (v16u8 _1, v16u8 _2) +{ + return __builtin_lsx_vand_v (_1, _2); +} +v16u8 +__lsx_vandi_b (v16u8 _1) +{ + return __builtin_lsx_vandi_b (_1, 1); +} +v16u8 +__lsx_vor_v (v16u8 _1, v16u8 _2) +{ + return __builtin_lsx_vor_v (_1, _2); +} +v16u8 +__lsx_vori_b (v16u8 _1) +{ + return __builtin_lsx_vori_b (_1, 1); +} +v16u8 +__lsx_vnor_v (v16u8 _1, v16u8 _2) +{ + return __builtin_lsx_vnor_v (_1, _2); +} +v16u8 +__lsx_vnori_b (v16u8 _1) +{ + return __builtin_lsx_vnori_b (_1, 1); +} +v16u8 +__lsx_vxor_v (v16u8 _1, v16u8 _2) +{ + return __builtin_lsx_vxor_v (_1, _2); +} +v16u8 +__lsx_vxori_b (v16u8 _1) +{ + return __builtin_lsx_vxori_b (_1, 1); +} +v16u8 +__lsx_vbitsel_v (v16u8 _1, v16u8 _2, v16u8 _3) +{ + return __builtin_lsx_vbitsel_v (_1, _2, _3); +} +v16u8 +__lsx_vbitseli_b (v16u8 _1, v16u8 _2) +{ + return __builtin_lsx_vbitseli_b (_1, _2, 1); +} +v16i8 +__lsx_vshuf4i_b (v16i8 _1) +{ + return __builtin_lsx_vshuf4i_b (_1, 1); +} +v8i16 +__lsx_vshuf4i_h (v8i16 _1) +{ + return __builtin_lsx_vshuf4i_h (_1, 1); +} +v4i32 +__lsx_vshuf4i_w (v4i32 _1) +{ + return __builtin_lsx_vshuf4i_w (_1, 1); +} +v16i8 +__lsx_vreplgr2vr_b (int _1) +{ + return __builtin_lsx_vreplgr2vr_b (_1); +} +v8i16 +__lsx_vreplgr2vr_h (int _1) +{ + return __builtin_lsx_vreplgr2vr_h (_1); +} +v4i32 +__lsx_vreplgr2vr_w (int _1) +{ + return __builtin_lsx_vreplgr2vr_w (_1); +} +v2i64 +__lsx_vreplgr2vr_d (long _1) +{ + return __builtin_lsx_vreplgr2vr_d (_1); +} +v16i8 +__lsx_vpcnt_b (v16i8 _1) +{ + return __builtin_lsx_vpcnt_b (_1); +} +v8i16 +__lsx_vpcnt_h (v8i16 _1) +{ + return __builtin_lsx_vpcnt_h (_1); +} +v4i32 +__lsx_vpcnt_w (v4i32 _1) +{ + return __builtin_lsx_vpcnt_w (_1); +} +v2i64 +__lsx_vpcnt_d (v2i64 _1) +{ + return __builtin_lsx_vpcnt_d (_1); +} +v16i8 +__lsx_vclo_b (v16i8 _1) +{ + return __builtin_lsx_vclo_b (_1); +} +v8i16 +__lsx_vclo_h (v8i16 _1) +{ + return __builtin_lsx_vclo_h (_1); +} +v4i32 +__lsx_vclo_w (v4i32 _1) +{ + return __builtin_lsx_vclo_w (_1); +} +v2i64 +__lsx_vclo_d (v2i64 _1) +{ + return __builtin_lsx_vclo_d (_1); +} +v16i8 +__lsx_vclz_b (v16i8 _1) +{ + return __builtin_lsx_vclz_b (_1); +} +v8i16 +__lsx_vclz_h (v8i16 _1) +{ + return __builtin_lsx_vclz_h (_1); +} +v4i32 +__lsx_vclz_w (v4i32 _1) +{ + return __builtin_lsx_vclz_w (_1); +} +v2i64 +__lsx_vclz_d (v2i64 _1) +{ + return __builtin_lsx_vclz_d (_1); +} +int +__lsx_vpickve2gr_b (v16i8 _1) +{ + return __builtin_lsx_vpickve2gr_b (_1, 1); +} +int +__lsx_vpickve2gr_h (v8i16 _1) +{ + return __builtin_lsx_vpickve2gr_h (_1, 1); +} +int +__lsx_vpickve2gr_w (v4i32 _1) +{ + return __builtin_lsx_vpickve2gr_w (_1, 1); +} +long +__lsx_vpickve2gr_d (v2i64 _1) +{ + return __builtin_lsx_vpickve2gr_d (_1, 1); +} +unsigned int +__lsx_vpickve2gr_bu (v16i8 _1) +{ + return __builtin_lsx_vpickve2gr_bu (_1, 1); +} +unsigned int +__lsx_vpickve2gr_hu (v8i16 _1) +{ + return __builtin_lsx_vpickve2gr_hu (_1, 1); +} +unsigned int +__lsx_vpickve2gr_wu (v4i32 _1) +{ + return __builtin_lsx_vpickve2gr_wu (_1, 1); +} +unsigned long int +__lsx_vpickve2gr_du (v2i64 _1) +{ + return __builtin_lsx_vpickve2gr_du (_1, 1); +} +v16i8 +__lsx_vinsgr2vr_b (v16i8 _1) +{ + return __builtin_lsx_vinsgr2vr_b (_1, 1, 1); +} +v8i16 +__lsx_vinsgr2vr_h (v8i16 _1) +{ + return __builtin_lsx_vinsgr2vr_h (_1, 1, 1); +} +v4i32 +__lsx_vinsgr2vr_w (v4i32 _1) +{ + return __builtin_lsx_vinsgr2vr_w (_1, 1, 1); +} +v2i64 +__lsx_vinsgr2vr_d (v2i64 _1) +{ + return __builtin_lsx_vinsgr2vr_d (_1, 1, 1); +} +v4f32 +__lsx_vfadd_s (v4f32 _1, v4f32 _2) +{ + return __builtin_lsx_vfadd_s (_1, _2); +} +v2f64 +__lsx_vfadd_d (v2f64 _1, v2f64 _2) +{ + return __builtin_lsx_vfadd_d (_1, _2); +} +v4f32 +__lsx_vfsub_s (v4f32 _1, v4f32 _2) +{ + return __builtin_lsx_vfsub_s (_1, _2); +} +v2f64 +__lsx_vfsub_d (v2f64 _1, v2f64 _2) +{ + return __builtin_lsx_vfsub_d (_1, _2); +} +v4f32 +__lsx_vfmul_s (v4f32 _1, v4f32 _2) +{ + return __builtin_lsx_vfmul_s (_1, _2); +} +v2f64 +__lsx_vfmul_d (v2f64 _1, v2f64 _2) +{ + return __builtin_lsx_vfmul_d (_1, _2); +} +v4f32 +__lsx_vfdiv_s (v4f32 _1, v4f32 _2) +{ + return __builtin_lsx_vfdiv_s (_1, _2); +} +v2f64 +__lsx_vfdiv_d (v2f64 _1, v2f64 _2) +{ + return __builtin_lsx_vfdiv_d (_1, _2); +} +v8i16 +__lsx_vfcvt_h_s (v4f32 _1, v4f32 _2) +{ + return __builtin_lsx_vfcvt_h_s (_1, _2); +} +v4f32 +__lsx_vfcvt_s_d (v2f64 _1, v2f64 _2) +{ + return __builtin_lsx_vfcvt_s_d (_1, _2); +} +v4f32 +__lsx_vfmin_s (v4f32 _1, v4f32 _2) +{ + return __builtin_lsx_vfmin_s (_1, _2); +} +v2f64 +__lsx_vfmin_d (v2f64 _1, v2f64 _2) +{ + return __builtin_lsx_vfmin_d (_1, _2); +} +v4f32 +__lsx_vfmina_s (v4f32 _1, v4f32 _2) +{ + return __builtin_lsx_vfmina_s (_1, _2); +} +v2f64 +__lsx_vfmina_d (v2f64 _1, v2f64 _2) +{ + return __builtin_lsx_vfmina_d (_1, _2); +} +v4f32 +__lsx_vfmax_s (v4f32 _1, v4f32 _2) +{ + return __builtin_lsx_vfmax_s (_1, _2); +} +v2f64 +__lsx_vfmax_d (v2f64 _1, v2f64 _2) +{ + return __builtin_lsx_vfmax_d (_1, _2); +} +v4f32 +__lsx_vfmaxa_s (v4f32 _1, v4f32 _2) +{ + return __builtin_lsx_vfmaxa_s (_1, _2); +} +v2f64 +__lsx_vfmaxa_d (v2f64 _1, v2f64 _2) +{ + return __builtin_lsx_vfmaxa_d (_1, _2); +} +v4i32 +__lsx_vfclass_s (v4f32 _1) +{ + return __builtin_lsx_vfclass_s (_1); +} +v2i64 +__lsx_vfclass_d (v2f64 _1) +{ + return __builtin_lsx_vfclass_d (_1); +} +v4f32 +__lsx_vfsqrt_s (v4f32 _1) +{ + return __builtin_lsx_vfsqrt_s (_1); +} +v2f64 +__lsx_vfsqrt_d (v2f64 _1) +{ + return __builtin_lsx_vfsqrt_d (_1); +} +v4f32 +__lsx_vfrecip_s (v4f32 _1) +{ + return __builtin_lsx_vfrecip_s (_1); +} +v2f64 +__lsx_vfrecip_d (v2f64 _1) +{ + return __builtin_lsx_vfrecip_d (_1); +} +v4f32 +__lsx_vfrint_s (v4f32 _1) +{ + return __builtin_lsx_vfrint_s (_1); +} +v2f64 +__lsx_vfrint_d (v2f64 _1) +{ + return __builtin_lsx_vfrint_d (_1); +} +v4f32 +__lsx_vfrsqrt_s (v4f32 _1) +{ + return __builtin_lsx_vfrsqrt_s (_1); +} +v2f64 +__lsx_vfrsqrt_d (v2f64 _1) +{ + return __builtin_lsx_vfrsqrt_d (_1); +} +v4f32 +__lsx_vflogb_s (v4f32 _1) +{ + return __builtin_lsx_vflogb_s (_1); +} +v2f64 +__lsx_vflogb_d (v2f64 _1) +{ + return __builtin_lsx_vflogb_d (_1); +} +v4f32 +__lsx_vfcvth_s_h (v8i16 _1) +{ + return __builtin_lsx_vfcvth_s_h (_1); +} +v2f64 +__lsx_vfcvth_d_s (v4f32 _1) +{ + return __builtin_lsx_vfcvth_d_s (_1); +} +v4f32 +__lsx_vfcvtl_s_h (v8i16 _1) +{ + return __builtin_lsx_vfcvtl_s_h (_1); +} +v2f64 +__lsx_vfcvtl_d_s (v4f32 _1) +{ + return __builtin_lsx_vfcvtl_d_s (_1); +} +v4i32 +__lsx_vftint_w_s (v4f32 _1) +{ + return __builtin_lsx_vftint_w_s (_1); +} +v2i64 +__lsx_vftint_l_d (v2f64 _1) +{ + return __builtin_lsx_vftint_l_d (_1); +} +v4u32 +__lsx_vftint_wu_s (v4f32 _1) +{ + return __builtin_lsx_vftint_wu_s (_1); +} +v2u64 +__lsx_vftint_lu_d (v2f64 _1) +{ + return __builtin_lsx_vftint_lu_d (_1); +} +v4i32 +__lsx_vftintrz_w_s (v4f32 _1) +{ + return __builtin_lsx_vftintrz_w_s (_1); +} +v2i64 +__lsx_vftintrz_l_d (v2f64 _1) +{ + return __builtin_lsx_vftintrz_l_d (_1); +} +v4u32 +__lsx_vftintrz_wu_s (v4f32 _1) +{ + return __builtin_lsx_vftintrz_wu_s (_1); +} +v2u64 +__lsx_vftintrz_lu_d (v2f64 _1) +{ + return __builtin_lsx_vftintrz_lu_d (_1); +} +v4f32 +__lsx_vffint_s_w (v4i32 _1) +{ + return __builtin_lsx_vffint_s_w (_1); +} +v2f64 +__lsx_vffint_d_l (v2i64 _1) +{ + return __builtin_lsx_vffint_d_l (_1); +} +v4f32 +__lsx_vffint_s_wu (v4u32 _1) +{ + return __builtin_lsx_vffint_s_wu (_1); +} +v2f64 +__lsx_vffint_d_lu (v2u64 _1) +{ + return __builtin_lsx_vffint_d_lu (_1); +} +v16u8 +__lsx_vandn_v (v16u8 _1, v16u8 _2) +{ + return __builtin_lsx_vandn_v (_1, _2); +} +v16i8 +__lsx_vneg_b (v16i8 _1) +{ + return __builtin_lsx_vneg_b (_1); +} +v8i16 +__lsx_vneg_h (v8i16 _1) +{ + return __builtin_lsx_vneg_h (_1); +} +v4i32 +__lsx_vneg_w (v4i32 _1) +{ + return __builtin_lsx_vneg_w (_1); +} +v2i64 +__lsx_vneg_d (v2i64 _1) +{ + return __builtin_lsx_vneg_d (_1); +} +v16i8 +__lsx_vmuh_b (v16i8 _1, v16i8 _2) +{ + return __builtin_lsx_vmuh_b (_1, _2); +} +v8i16 +__lsx_vmuh_h (v8i16 _1, v8i16 _2) +{ + return __builtin_lsx_vmuh_h (_1, _2); +} +v4i32 +__lsx_vmuh_w (v4i32 _1, v4i32 _2) +{ + return __builtin_lsx_vmuh_w (_1, _2); +} +v2i64 +__lsx_vmuh_d (v2i64 _1, v2i64 _2) +{ + return __builtin_lsx_vmuh_d (_1, _2); +} +v16u8 +__lsx_vmuh_bu (v16u8 _1, v16u8 _2) +{ + return __builtin_lsx_vmuh_bu (_1, _2); +} +v8u16 +__lsx_vmuh_hu (v8u16 _1, v8u16 _2) +{ + return __builtin_lsx_vmuh_hu (_1, _2); +} +v4u32 +__lsx_vmuh_wu (v4u32 _1, v4u32 _2) +{ + return __builtin_lsx_vmuh_wu (_1, _2); +} +v2u64 +__lsx_vmuh_du (v2u64 _1, v2u64 _2) +{ + return __builtin_lsx_vmuh_du (_1, _2); +} +v8i16 +__lsx_vsllwil_h_b (v16i8 _1) +{ + return __builtin_lsx_vsllwil_h_b (_1, 1); +} +v4i32 +__lsx_vsllwil_w_h (v8i16 _1) +{ + return __builtin_lsx_vsllwil_w_h (_1, 1); +} +v2i64 +__lsx_vsllwil_d_w (v4i32 _1) +{ + return __builtin_lsx_vsllwil_d_w (_1, 1); +} +v8u16 +__lsx_vsllwil_hu_bu (v16u8 _1) +{ + return __builtin_lsx_vsllwil_hu_bu (_1, 1); +} +v4u32 +__lsx_vsllwil_wu_hu (v8u16 _1) +{ + return __builtin_lsx_vsllwil_wu_hu (_1, 1); +} +v2u64 +__lsx_vsllwil_du_wu (v4u32 _1) +{ + return __builtin_lsx_vsllwil_du_wu (_1, 1); +} +v16i8 +__lsx_vsran_b_h (v8i16 _1, v8i16 _2) +{ + return __builtin_lsx_vsran_b_h (_1, _2); +} +v8i16 +__lsx_vsran_h_w (v4i32 _1, v4i32 _2) +{ + return __builtin_lsx_vsran_h_w (_1, _2); +} +v4i32 +__lsx_vsran_w_d (v2i64 _1, v2i64 _2) +{ + return __builtin_lsx_vsran_w_d (_1, _2); +} +v16i8 +__lsx_vssran_b_h (v8i16 _1, v8i16 _2) +{ + return __builtin_lsx_vssran_b_h (_1, _2); +} +v8i16 +__lsx_vssran_h_w (v4i32 _1, v4i32 _2) +{ + return __builtin_lsx_vssran_h_w (_1, _2); +} +v4i32 +__lsx_vssran_w_d (v2i64 _1, v2i64 _2) +{ + return __builtin_lsx_vssran_w_d (_1, _2); +} +v16u8 +__lsx_vssran_bu_h (v8u16 _1, v8u16 _2) +{ + return __builtin_lsx_vssran_bu_h (_1, _2); +} +v8u16 +__lsx_vssran_hu_w (v4u32 _1, v4u32 _2) +{ + return __builtin_lsx_vssran_hu_w (_1, _2); +} +v4u32 +__lsx_vssran_wu_d (v2u64 _1, v2u64 _2) +{ + return __builtin_lsx_vssran_wu_d (_1, _2); +} +v16i8 +__lsx_vsrarn_b_h (v8i16 _1, v8i16 _2) +{ + return __builtin_lsx_vsrarn_b_h (_1, _2); +} +v8i16 +__lsx_vsrarn_h_w (v4i32 _1, v4i32 _2) +{ + return __builtin_lsx_vsrarn_h_w (_1, _2); +} +v4i32 +__lsx_vsrarn_w_d (v2i64 _1, v2i64 _2) +{ + return __builtin_lsx_vsrarn_w_d (_1, _2); +} +v16i8 +__lsx_vssrarn_b_h (v8i16 _1, v8i16 _2) +{ + return __builtin_lsx_vssrarn_b_h (_1, _2); +} +v8i16 +__lsx_vssrarn_h_w (v4i32 _1, v4i32 _2) +{ + return __builtin_lsx_vssrarn_h_w (_1, _2); +} +v4i32 +__lsx_vssrarn_w_d (v2i64 _1, v2i64 _2) +{ + return __builtin_lsx_vssrarn_w_d (_1, _2); +} +v16u8 +__lsx_vssrarn_bu_h (v8u16 _1, v8u16 _2) +{ + return __builtin_lsx_vssrarn_bu_h (_1, _2); +} +v8u16 +__lsx_vssrarn_hu_w (v4u32 _1, v4u32 _2) +{ + return __builtin_lsx_vssrarn_hu_w (_1, _2); +} +v4u32 +__lsx_vssrarn_wu_d (v2u64 _1, v2u64 _2) +{ + return __builtin_lsx_vssrarn_wu_d (_1, _2); +} +v16i8 +__lsx_vsrln_b_h (v8i16 _1, v8i16 _2) +{ + return __builtin_lsx_vsrln_b_h (_1, _2); +} +v8i16 +__lsx_vsrln_h_w (v4i32 _1, v4i32 _2) +{ + return __builtin_lsx_vsrln_h_w (_1, _2); +} +v4i32 +__lsx_vsrln_w_d (v2i64 _1, v2i64 _2) +{ + return __builtin_lsx_vsrln_w_d (_1, _2); +} +v16u8 +__lsx_vssrln_bu_h (v8u16 _1, v8u16 _2) +{ + return __builtin_lsx_vssrln_bu_h (_1, _2); +} +v8u16 +__lsx_vssrln_hu_w (v4u32 _1, v4u32 _2) +{ + return __builtin_lsx_vssrln_hu_w (_1, _2); +} +v4u32 +__lsx_vssrln_wu_d (v2u64 _1, v2u64 _2) +{ + return __builtin_lsx_vssrln_wu_d (_1, _2); +} +v16i8 +__lsx_vsrlrn_b_h (v8i16 _1, v8i16 _2) +{ + return __builtin_lsx_vsrlrn_b_h (_1, _2); +} +v8i16 +__lsx_vsrlrn_h_w (v4i32 _1, v4i32 _2) +{ + return __builtin_lsx_vsrlrn_h_w (_1, _2); +} +v4i32 +__lsx_vsrlrn_w_d (v2i64 _1, v2i64 _2) +{ + return __builtin_lsx_vsrlrn_w_d (_1, _2); +} +v16u8 +__lsx_vssrlrn_bu_h (v8u16 _1, v8u16 _2) +{ + return __builtin_lsx_vssrlrn_bu_h (_1, _2); +} +v8u16 +__lsx_vssrlrn_hu_w (v4u32 _1, v4u32 _2) +{ + return __builtin_lsx_vssrlrn_hu_w (_1, _2); +} +v4u32 +__lsx_vssrlrn_wu_d (v2u64 _1, v2u64 _2) +{ + return __builtin_lsx_vssrlrn_wu_d (_1, _2); +} +v16i8 +__lsx_vfrstpi_b (v16i8 _1, v16i8 _2) +{ + return __builtin_lsx_vfrstpi_b (_1, _2, 1); +} +v8i16 +__lsx_vfrstpi_h (v8i16 _1, v8i16 _2) +{ + return __builtin_lsx_vfrstpi_h (_1, _2, 1); +} +v16i8 +__lsx_vfrstp_b (v16i8 _1, v16i8 _2, v16i8 _3) +{ + return __builtin_lsx_vfrstp_b (_1, _2, _3); +} +v8i16 +__lsx_vfrstp_h (v8i16 _1, v8i16 _2, v8i16 _3) +{ + return __builtin_lsx_vfrstp_h (_1, _2, _3); +} +v2i64 +__lsx_vshuf4i_d (v2i64 _1, v2i64 _2) +{ + return __builtin_lsx_vshuf4i_d (_1, _2, 1); +} +v16i8 +__lsx_vbsrl_v (v16i8 _1) +{ + return __builtin_lsx_vbsrl_v (_1, 1); +} +v16i8 +__lsx_vbsll_v (v16i8 _1) +{ + return __builtin_lsx_vbsll_v (_1, 1); +} +v16i8 +__lsx_vextrins_b (v16i8 _1, v16i8 _2) +{ + return __builtin_lsx_vextrins_b (_1, _2, 1); +} +v8i16 +__lsx_vextrins_h (v8i16 _1, v8i16 _2) +{ + return __builtin_lsx_vextrins_h (_1, _2, 1); +} +v4i32 +__lsx_vextrins_w (v4i32 _1, v4i32 _2) +{ + return __builtin_lsx_vextrins_w (_1, _2, 1); +} +v2i64 +__lsx_vextrins_d (v2i64 _1, v2i64 _2) +{ + return __builtin_lsx_vextrins_d (_1, _2, 1); +} +v16i8 +__lsx_vmskltz_b (v16i8 _1) +{ + return __builtin_lsx_vmskltz_b (_1); +} +v8i16 +__lsx_vmskltz_h (v8i16 _1) +{ + return __builtin_lsx_vmskltz_h (_1); +} +v4i32 +__lsx_vmskltz_w (v4i32 _1) +{ + return __builtin_lsx_vmskltz_w (_1); +} +v2i64 +__lsx_vmskltz_d (v2i64 _1) +{ + return __builtin_lsx_vmskltz_d (_1); +} +v16i8 +__lsx_vsigncov_b (v16i8 _1, v16i8 _2) +{ + return __builtin_lsx_vsigncov_b (_1, _2); +} +v8i16 +__lsx_vsigncov_h (v8i16 _1, v8i16 _2) +{ + return __builtin_lsx_vsigncov_h (_1, _2); +} +v4i32 +__lsx_vsigncov_w (v4i32 _1, v4i32 _2) +{ + return __builtin_lsx_vsigncov_w (_1, _2); +} +v2i64 +__lsx_vsigncov_d (v2i64 _1, v2i64 _2) +{ + return __builtin_lsx_vsigncov_d (_1, _2); +} +v4f32 +__lsx_vfmadd_s (v4f32 _1, v4f32 _2, v4f32 _3) +{ + return __builtin_lsx_vfmadd_s (_1, _2, _3); +} +v2f64 +__lsx_vfmadd_d (v2f64 _1, v2f64 _2, v2f64 _3) +{ + return __builtin_lsx_vfmadd_d (_1, _2, _3); +} +v4f32 +__lsx_vfmsub_s (v4f32 _1, v4f32 _2, v4f32 _3) +{ + return __builtin_lsx_vfmsub_s (_1, _2, _3); +} +v2f64 +__lsx_vfmsub_d (v2f64 _1, v2f64 _2, v2f64 _3) +{ + return __builtin_lsx_vfmsub_d (_1, _2, _3); +} +v4f32 +__lsx_vfnmadd_s (v4f32 _1, v4f32 _2, v4f32 _3) +{ + return __builtin_lsx_vfnmadd_s (_1, _2, _3); +} +v2f64 +__lsx_vfnmadd_d (v2f64 _1, v2f64 _2, v2f64 _3) +{ + return __builtin_lsx_vfnmadd_d (_1, _2, _3); +} +v4f32 +__lsx_vfnmsub_s (v4f32 _1, v4f32 _2, v4f32 _3) +{ + return __builtin_lsx_vfnmsub_s (_1, _2, _3); +} +v2f64 +__lsx_vfnmsub_d (v2f64 _1, v2f64 _2, v2f64 _3) +{ + return __builtin_lsx_vfnmsub_d (_1, _2, _3); +} +v4i32 +__lsx_vftintrne_w_s (v4f32 _1) +{ + return __builtin_lsx_vftintrne_w_s (_1); +} +v2i64 +__lsx_vftintrne_l_d (v2f64 _1) +{ + return __builtin_lsx_vftintrne_l_d (_1); +} +v4i32 +__lsx_vftintrp_w_s (v4f32 _1) +{ + return __builtin_lsx_vftintrp_w_s (_1); +} +v2i64 +__lsx_vftintrp_l_d (v2f64 _1) +{ + return __builtin_lsx_vftintrp_l_d (_1); +} +v4i32 +__lsx_vftintrm_w_s (v4f32 _1) +{ + return __builtin_lsx_vftintrm_w_s (_1); +} +v2i64 +__lsx_vftintrm_l_d (v2f64 _1) +{ + return __builtin_lsx_vftintrm_l_d (_1); +} +v4i32 +__lsx_vftint_w_d (v2f64 _1, v2f64 _2) +{ + return __builtin_lsx_vftint_w_d (_1, _2); +} +v4f32 +__lsx_vffint_s_l (v2i64 _1, v2i64 _2) +{ + return __builtin_lsx_vffint_s_l (_1, _2); +} +v4i32 +__lsx_vftintrz_w_d (v2f64 _1, v2f64 _2) +{ + return __builtin_lsx_vftintrz_w_d (_1, _2); +} +v4i32 +__lsx_vftintrp_w_d (v2f64 _1, v2f64 _2) +{ + return __builtin_lsx_vftintrp_w_d (_1, _2); +} +v4i32 +__lsx_vftintrm_w_d (v2f64 _1, v2f64 _2) +{ + return __builtin_lsx_vftintrm_w_d (_1, _2); +} +v4i32 +__lsx_vftintrne_w_d (v2f64 _1, v2f64 _2) +{ + return __builtin_lsx_vftintrne_w_d (_1, _2); +} +v2i64 +__lsx_vftintl_l_s (v4f32 _1) +{ + return __builtin_lsx_vftintl_l_s (_1); +} +v2i64 +__lsx_vftinth_l_s (v4f32 _1) +{ + return __builtin_lsx_vftinth_l_s (_1); +} +v2f64 +__lsx_vffinth_d_w (v4i32 _1) +{ + return __builtin_lsx_vffinth_d_w (_1); +} +v2f64 +__lsx_vffintl_d_w (v4i32 _1) +{ + return __builtin_lsx_vffintl_d_w (_1); +} +v2i64 +__lsx_vftintrzl_l_s (v4f32 _1) +{ + return __builtin_lsx_vftintrzl_l_s (_1); +} +v2i64 +__lsx_vftintrzh_l_s (v4f32 _1) +{ + return __builtin_lsx_vftintrzh_l_s (_1); +} +v2i64 +__lsx_vftintrpl_l_s (v4f32 _1) +{ + return __builtin_lsx_vftintrpl_l_s (_1); +} +v2i64 +__lsx_vftintrph_l_s (v4f32 _1) +{ + return __builtin_lsx_vftintrph_l_s (_1); +} +v2i64 +__lsx_vftintrml_l_s (v4f32 _1) +{ + return __builtin_lsx_vftintrml_l_s (_1); +} +v2i64 +__lsx_vftintrmh_l_s (v4f32 _1) +{ + return __builtin_lsx_vftintrmh_l_s (_1); +} +v2i64 +__lsx_vftintrnel_l_s (v4f32 _1) +{ + return __builtin_lsx_vftintrnel_l_s (_1); +} +v2i64 +__lsx_vftintrneh_l_s (v4f32 _1) +{ + return __builtin_lsx_vftintrneh_l_s (_1); +} +v4f32 +__lsx_vfrintrne_s (v4f32 _1) +{ + return __builtin_lsx_vfrintrne_s (_1); +} +v2f64 +__lsx_vfrintrne_d (v2f64 _1) +{ + return __builtin_lsx_vfrintrne_d (_1); +} +v4f32 +__lsx_vfrintrz_s (v4f32 _1) +{ + return __builtin_lsx_vfrintrz_s (_1); +} +v2f64 +__lsx_vfrintrz_d (v2f64 _1) +{ + return __builtin_lsx_vfrintrz_d (_1); +} +v4f32 +__lsx_vfrintrp_s (v4f32 _1) +{ + return __builtin_lsx_vfrintrp_s (_1); +} +v2f64 +__lsx_vfrintrp_d (v2f64 _1) +{ + return __builtin_lsx_vfrintrp_d (_1); +} +v4f32 +__lsx_vfrintrm_s (v4f32 _1) +{ + return __builtin_lsx_vfrintrm_s (_1); +} +v2f64 +__lsx_vfrintrm_d (v2f64 _1) +{ + return __builtin_lsx_vfrintrm_d (_1); +} +void +__lsx_vstelm_b (v16i8 _1, void *_2) +{ + return __builtin_lsx_vstelm_b (_1, _2, 1, 1); +} +void +__lsx_vstelm_h (v8i16 _1, void *_2) +{ + return __builtin_lsx_vstelm_h (_1, _2, 2, 1); +} +void +__lsx_vstelm_w (v4i32 _1, void *_2) +{ + return __builtin_lsx_vstelm_w (_1, _2, 4, 1); +} +void +__lsx_vstelm_d (v2i64 _1, void *_2) +{ + return __builtin_lsx_vstelm_d (_1, _2, 8, 1); +} +v2i64 +__lsx_vaddwev_d_w (v4i32 _1, v4i32 _2) +{ + return __builtin_lsx_vaddwev_d_w (_1, _2); +} +v4i32 +__lsx_vaddwev_w_h (v8i16 _1, v8i16 _2) +{ + return __builtin_lsx_vaddwev_w_h (_1, _2); +} +v8i16 +__lsx_vaddwev_h_b (v16i8 _1, v16i8 _2) +{ + return __builtin_lsx_vaddwev_h_b (_1, _2); +} +v2i64 +__lsx_vaddwod_d_w (v4i32 _1, v4i32 _2) +{ + return __builtin_lsx_vaddwod_d_w (_1, _2); +} +v4i32 +__lsx_vaddwod_w_h (v8i16 _1, v8i16 _2) +{ + return __builtin_lsx_vaddwod_w_h (_1, _2); +} +v8i16 +__lsx_vaddwod_h_b (v16i8 _1, v16i8 _2) +{ + return __builtin_lsx_vaddwod_h_b (_1, _2); +} +v2i64 +__lsx_vaddwev_d_wu (v4u32 _1, v4u32 _2) +{ + return __builtin_lsx_vaddwev_d_wu (_1, _2); +} +v4i32 +__lsx_vaddwev_w_hu (v8u16 _1, v8u16 _2) +{ + return __builtin_lsx_vaddwev_w_hu (_1, _2); +} +v8i16 +__lsx_vaddwev_h_bu (v16u8 _1, v16u8 _2) +{ + return __builtin_lsx_vaddwev_h_bu (_1, _2); +} +v2i64 +__lsx_vaddwod_d_wu (v4u32 _1, v4u32 _2) +{ + return __builtin_lsx_vaddwod_d_wu (_1, _2); +} +v4i32 +__lsx_vaddwod_w_hu (v8u16 _1, v8u16 _2) +{ + return __builtin_lsx_vaddwod_w_hu (_1, _2); +} +v8i16 +__lsx_vaddwod_h_bu (v16u8 _1, v16u8 _2) +{ + return __builtin_lsx_vaddwod_h_bu (_1, _2); +} +v2i64 +__lsx_vaddwev_d_wu_w (v4u32 _1, v4i32 _2) +{ + return __builtin_lsx_vaddwev_d_wu_w (_1, _2); +} +v4i32 +__lsx_vaddwev_w_hu_h (v8u16 _1, v8i16 _2) +{ + return __builtin_lsx_vaddwev_w_hu_h (_1, _2); +} +v8i16 +__lsx_vaddwev_h_bu_b (v16u8 _1, v16i8 _2) +{ + return __builtin_lsx_vaddwev_h_bu_b (_1, _2); +} +v2i64 +__lsx_vaddwod_d_wu_w (v4u32 _1, v4i32 _2) +{ + return __builtin_lsx_vaddwod_d_wu_w (_1, _2); +} +v4i32 +__lsx_vaddwod_w_hu_h (v8u16 _1, v8i16 _2) +{ + return __builtin_lsx_vaddwod_w_hu_h (_1, _2); +} +v8i16 +__lsx_vaddwod_h_bu_b (v16u8 _1, v16i8 _2) +{ + return __builtin_lsx_vaddwod_h_bu_b (_1, _2); +} +v2i64 +__lsx_vsubwev_d_w (v4i32 _1, v4i32 _2) +{ + return __builtin_lsx_vsubwev_d_w (_1, _2); +} +v4i32 +__lsx_vsubwev_w_h (v8i16 _1, v8i16 _2) +{ + return __builtin_lsx_vsubwev_w_h (_1, _2); +} +v8i16 +__lsx_vsubwev_h_b (v16i8 _1, v16i8 _2) +{ + return __builtin_lsx_vsubwev_h_b (_1, _2); +} +v2i64 +__lsx_vsubwod_d_w (v4i32 _1, v4i32 _2) +{ + return __builtin_lsx_vsubwod_d_w (_1, _2); +} +v4i32 +__lsx_vsubwod_w_h (v8i16 _1, v8i16 _2) +{ + return __builtin_lsx_vsubwod_w_h (_1, _2); +} +v8i16 +__lsx_vsubwod_h_b (v16i8 _1, v16i8 _2) +{ + return __builtin_lsx_vsubwod_h_b (_1, _2); +} +v2i64 +__lsx_vsubwev_d_wu (v4u32 _1, v4u32 _2) +{ + return __builtin_lsx_vsubwev_d_wu (_1, _2); +} +v4i32 +__lsx_vsubwev_w_hu (v8u16 _1, v8u16 _2) +{ + return __builtin_lsx_vsubwev_w_hu (_1, _2); +} +v8i16 +__lsx_vsubwev_h_bu (v16u8 _1, v16u8 _2) +{ + return __builtin_lsx_vsubwev_h_bu (_1, _2); +} +v2i64 +__lsx_vsubwod_d_wu (v4u32 _1, v4u32 _2) +{ + return __builtin_lsx_vsubwod_d_wu (_1, _2); +} +v4i32 +__lsx_vsubwod_w_hu (v8u16 _1, v8u16 _2) +{ + return __builtin_lsx_vsubwod_w_hu (_1, _2); +} +v8i16 +__lsx_vsubwod_h_bu (v16u8 _1, v16u8 _2) +{ + return __builtin_lsx_vsubwod_h_bu (_1, _2); +} +v2i64 +__lsx_vaddwev_q_d (v2i64 _1, v2i64 _2) +{ + return __builtin_lsx_vaddwev_q_d (_1, _2); +} +v2i64 +__lsx_vaddwod_q_d (v2i64 _1, v2i64 _2) +{ + return __builtin_lsx_vaddwod_q_d (_1, _2); +} +v2i64 +__lsx_vaddwev_q_du (v2u64 _1, v2u64 _2) +{ + return __builtin_lsx_vaddwev_q_du (_1, _2); +} +v2i64 +__lsx_vaddwod_q_du (v2u64 _1, v2u64 _2) +{ + return __builtin_lsx_vaddwod_q_du (_1, _2); +} +v2i64 +__lsx_vsubwev_q_d (v2i64 _1, v2i64 _2) +{ + return __builtin_lsx_vsubwev_q_d (_1, _2); +} +v2i64 +__lsx_vsubwod_q_d (v2i64 _1, v2i64 _2) +{ + return __builtin_lsx_vsubwod_q_d (_1, _2); +} +v2i64 +__lsx_vsubwev_q_du (v2u64 _1, v2u64 _2) +{ + return __builtin_lsx_vsubwev_q_du (_1, _2); +} +v2i64 +__lsx_vsubwod_q_du (v2u64 _1, v2u64 _2) +{ + return __builtin_lsx_vsubwod_q_du (_1, _2); +} +v2i64 +__lsx_vaddwev_q_du_d (v2u64 _1, v2i64 _2) +{ + return __builtin_lsx_vaddwev_q_du_d (_1, _2); +} +v2i64 +__lsx_vaddwod_q_du_d (v2u64 _1, v2i64 _2) +{ + return __builtin_lsx_vaddwod_q_du_d (_1, _2); +} +v2i64 +__lsx_vmulwev_d_w (v4i32 _1, v4i32 _2) +{ + return __builtin_lsx_vmulwev_d_w (_1, _2); +} +v4i32 +__lsx_vmulwev_w_h (v8i16 _1, v8i16 _2) +{ + return __builtin_lsx_vmulwev_w_h (_1, _2); +} +v8i16 +__lsx_vmulwev_h_b (v16i8 _1, v16i8 _2) +{ + return __builtin_lsx_vmulwev_h_b (_1, _2); +} +v2i64 +__lsx_vmulwod_d_w (v4i32 _1, v4i32 _2) +{ + return __builtin_lsx_vmulwod_d_w (_1, _2); +} +v4i32 +__lsx_vmulwod_w_h (v8i16 _1, v8i16 _2) +{ + return __builtin_lsx_vmulwod_w_h (_1, _2); +} +v8i16 +__lsx_vmulwod_h_b (v16i8 _1, v16i8 _2) +{ + return __builtin_lsx_vmulwod_h_b (_1, _2); +} +v2i64 +__lsx_vmulwev_d_wu (v4u32 _1, v4u32 _2) +{ + return __builtin_lsx_vmulwev_d_wu (_1, _2); +} +v4i32 +__lsx_vmulwev_w_hu (v8u16 _1, v8u16 _2) +{ + return __builtin_lsx_vmulwev_w_hu (_1, _2); +} +v8i16 +__lsx_vmulwev_h_bu (v16u8 _1, v16u8 _2) +{ + return __builtin_lsx_vmulwev_h_bu (_1, _2); +} +v2i64 +__lsx_vmulwod_d_wu (v4u32 _1, v4u32 _2) +{ + return __builtin_lsx_vmulwod_d_wu (_1, _2); +} +v4i32 +__lsx_vmulwod_w_hu (v8u16 _1, v8u16 _2) +{ + return __builtin_lsx_vmulwod_w_hu (_1, _2); +} +v8i16 +__lsx_vmulwod_h_bu (v16u8 _1, v16u8 _2) +{ + return __builtin_lsx_vmulwod_h_bu (_1, _2); +} +v2i64 +__lsx_vmulwev_d_wu_w (v4u32 _1, v4i32 _2) +{ + return __builtin_lsx_vmulwev_d_wu_w (_1, _2); +} +v4i32 +__lsx_vmulwev_w_hu_h (v8u16 _1, v8i16 _2) +{ + return __builtin_lsx_vmulwev_w_hu_h (_1, _2); +} +v8i16 +__lsx_vmulwev_h_bu_b (v16u8 _1, v16i8 _2) +{ + return __builtin_lsx_vmulwev_h_bu_b (_1, _2); +} +v2i64 +__lsx_vmulwod_d_wu_w (v4u32 _1, v4i32 _2) +{ + return __builtin_lsx_vmulwod_d_wu_w (_1, _2); +} +v4i32 +__lsx_vmulwod_w_hu_h (v8u16 _1, v8i16 _2) +{ + return __builtin_lsx_vmulwod_w_hu_h (_1, _2); +} +v8i16 +__lsx_vmulwod_h_bu_b (v16u8 _1, v16i8 _2) +{ + return __builtin_lsx_vmulwod_h_bu_b (_1, _2); +} +v2i64 +__lsx_vmulwev_q_d (v2i64 _1, v2i64 _2) +{ + return __builtin_lsx_vmulwev_q_d (_1, _2); +} +v2i64 +__lsx_vmulwod_q_d (v2i64 _1, v2i64 _2) +{ + return __builtin_lsx_vmulwod_q_d (_1, _2); +} +v2i64 +__lsx_vmulwev_q_du (v2u64 _1, v2u64 _2) +{ + return __builtin_lsx_vmulwev_q_du (_1, _2); +} +v2i64 +__lsx_vmulwod_q_du (v2u64 _1, v2u64 _2) +{ + return __builtin_lsx_vmulwod_q_du (_1, _2); +} +v2i64 +__lsx_vmulwev_q_du_d (v2u64 _1, v2i64 _2) +{ + return __builtin_lsx_vmulwev_q_du_d (_1, _2); +} +v2i64 +__lsx_vmulwod_q_du_d (v2u64 _1, v2i64 _2) +{ + return __builtin_lsx_vmulwod_q_du_d (_1, _2); +} +v2i64 +__lsx_vhaddw_q_d (v2i64 _1, v2i64 _2) +{ + return __builtin_lsx_vhaddw_q_d (_1, _2); +} +v2u64 +__lsx_vhaddw_qu_du (v2u64 _1, v2u64 _2) +{ + return __builtin_lsx_vhaddw_qu_du (_1, _2); +} +v2i64 +__lsx_vhsubw_q_d (v2i64 _1, v2i64 _2) +{ + return __builtin_lsx_vhsubw_q_d (_1, _2); +} +v2u64 +__lsx_vhsubw_qu_du (v2u64 _1, v2u64 _2) +{ + return __builtin_lsx_vhsubw_qu_du (_1, _2); +} +v2i64 +__lsx_vmaddwev_d_w (v2i64 _1, v4i32 _2, v4i32 _3) +{ + return __builtin_lsx_vmaddwev_d_w (_1, _2, _3); +} +v4i32 +__lsx_vmaddwev_w_h (v4i32 _1, v8i16 _2, v8i16 _3) +{ + return __builtin_lsx_vmaddwev_w_h (_1, _2, _3); +} +v8i16 +__lsx_vmaddwev_h_b (v8i16 _1, v16i8 _2, v16i8 _3) +{ + return __builtin_lsx_vmaddwev_h_b (_1, _2, _3); +} +v2u64 +__lsx_vmaddwev_d_wu (v2u64 _1, v4u32 _2, v4u32 _3) +{ + return __builtin_lsx_vmaddwev_d_wu (_1, _2, _3); +} +v4u32 +__lsx_vmaddwev_w_hu (v4u32 _1, v8u16 _2, v8u16 _3) +{ + return __builtin_lsx_vmaddwev_w_hu (_1, _2, _3); +} +v8u16 +__lsx_vmaddwev_h_bu (v8u16 _1, v16u8 _2, v16u8 _3) +{ + return __builtin_lsx_vmaddwev_h_bu (_1, _2, _3); +} +v2i64 +__lsx_vmaddwod_d_w (v2i64 _1, v4i32 _2, v4i32 _3) +{ + return __builtin_lsx_vmaddwod_d_w (_1, _2, _3); +} +v4i32 +__lsx_vmaddwod_w_h (v4i32 _1, v8i16 _2, v8i16 _3) +{ + return __builtin_lsx_vmaddwod_w_h (_1, _2, _3); +} +v8i16 +__lsx_vmaddwod_h_b (v8i16 _1, v16i8 _2, v16i8 _3) +{ + return __builtin_lsx_vmaddwod_h_b (_1, _2, _3); +} +v2u64 +__lsx_vmaddwod_d_wu (v2u64 _1, v4u32 _2, v4u32 _3) +{ + return __builtin_lsx_vmaddwod_d_wu (_1, _2, _3); +} +v4u32 +__lsx_vmaddwod_w_hu (v4u32 _1, v8u16 _2, v8u16 _3) +{ + return __builtin_lsx_vmaddwod_w_hu (_1, _2, _3); +} +v8u16 +__lsx_vmaddwod_h_bu (v8u16 _1, v16u8 _2, v16u8 _3) +{ + return __builtin_lsx_vmaddwod_h_bu (_1, _2, _3); +} +v2i64 +__lsx_vmaddwev_d_wu_w (v2i64 _1, v4u32 _2, v4i32 _3) +{ + return __builtin_lsx_vmaddwev_d_wu_w (_1, _2, _3); +} +v4i32 +__lsx_vmaddwev_w_hu_h (v4i32 _1, v8u16 _2, v8i16 _3) +{ + return __builtin_lsx_vmaddwev_w_hu_h (_1, _2, _3); +} +v8i16 +__lsx_vmaddwev_h_bu_b (v8i16 _1, v16u8 _2, v16i8 _3) +{ + return __builtin_lsx_vmaddwev_h_bu_b (_1, _2, _3); +} +v2i64 +__lsx_vmaddwod_d_wu_w (v2i64 _1, v4u32 _2, v4i32 _3) +{ + return __builtin_lsx_vmaddwod_d_wu_w (_1, _2, _3); +} +v4i32 +__lsx_vmaddwod_w_hu_h (v4i32 _1, v8u16 _2, v8i16 _3) +{ + return __builtin_lsx_vmaddwod_w_hu_h (_1, _2, _3); +} +v8i16 +__lsx_vmaddwod_h_bu_b (v8i16 _1, v16u8 _2, v16i8 _3) +{ + return __builtin_lsx_vmaddwod_h_bu_b (_1, _2, _3); +} +v2i64 +__lsx_vmaddwev_q_d (v2i64 _1, v2i64 _2, v2i64 _3) +{ + return __builtin_lsx_vmaddwev_q_d (_1, _2, _3); +} +v2i64 +__lsx_vmaddwod_q_d (v2i64 _1, v2i64 _2, v2i64 _3) +{ + return __builtin_lsx_vmaddwod_q_d (_1, _2, _3); +} +v2u64 +__lsx_vmaddwev_q_du (v2u64 _1, v2u64 _2, v2u64 _3) +{ + return __builtin_lsx_vmaddwev_q_du (_1, _2, _3); +} +v2u64 +__lsx_vmaddwod_q_du (v2u64 _1, v2u64 _2, v2u64 _3) +{ + return __builtin_lsx_vmaddwod_q_du (_1, _2, _3); +} +v2i64 +__lsx_vmaddwev_q_du_d (v2i64 _1, v2u64 _2, v2i64 _3) +{ + return __builtin_lsx_vmaddwev_q_du_d (_1, _2, _3); +} +v2i64 +__lsx_vmaddwod_q_du_d (v2i64 _1, v2u64 _2, v2i64 _3) +{ + return __builtin_lsx_vmaddwod_q_du_d (_1, _2, _3); +} +v16i8 +__lsx_vrotr_b (v16i8 _1, v16i8 _2) +{ + return __builtin_lsx_vrotr_b (_1, _2); +} +v8i16 +__lsx_vrotr_h (v8i16 _1, v8i16 _2) +{ + return __builtin_lsx_vrotr_h (_1, _2); +} +v4i32 +__lsx_vrotr_w (v4i32 _1, v4i32 _2) +{ + return __builtin_lsx_vrotr_w (_1, _2); +} +v2i64 +__lsx_vrotr_d (v2i64 _1, v2i64 _2) +{ + return __builtin_lsx_vrotr_d (_1, _2); +} +v2i64 +__lsx_vadd_q (v2i64 _1, v2i64 _2) +{ + return __builtin_lsx_vadd_q (_1, _2); +} +v2i64 +__lsx_vsub_q (v2i64 _1, v2i64 _2) +{ + return __builtin_lsx_vsub_q (_1, _2); +} +v16i8 +__lsx_vldrepl_b (void *_1) +{ + return __builtin_lsx_vldrepl_b (_1, 1); +} +v8i16 +__lsx_vldrepl_h (void *_1) +{ + return __builtin_lsx_vldrepl_h (_1, 2); +} +v4i32 +__lsx_vldrepl_w (void *_1) +{ + return __builtin_lsx_vldrepl_w (_1, 4); +} +v2i64 +__lsx_vldrepl_d (void *_1) +{ + return __builtin_lsx_vldrepl_d (_1, 8); +} +v16i8 +__lsx_vmskgez_b (v16i8 _1) +{ + return __builtin_lsx_vmskgez_b (_1); +} +v16i8 +__lsx_vmsknz_b (v16i8 _1) +{ + return __builtin_lsx_vmsknz_b (_1); +} +v8i16 +__lsx_vexth_h_b (v16i8 _1) +{ + return __builtin_lsx_vexth_h_b (_1); +} +v4i32 +__lsx_vexth_w_h (v8i16 _1) +{ + return __builtin_lsx_vexth_w_h (_1); +} +v2i64 +__lsx_vexth_d_w (v4i32 _1) +{ + return __builtin_lsx_vexth_d_w (_1); +} +v2i64 +__lsx_vexth_q_d (v2i64 _1) +{ + return __builtin_lsx_vexth_q_d (_1); +} +v8u16 +__lsx_vexth_hu_bu (v16u8 _1) +{ + return __builtin_lsx_vexth_hu_bu (_1); +} +v4u32 +__lsx_vexth_wu_hu (v8u16 _1) +{ + return __builtin_lsx_vexth_wu_hu (_1); +} +v2u64 +__lsx_vexth_du_wu (v4u32 _1) +{ + return __builtin_lsx_vexth_du_wu (_1); +} +v2u64 +__lsx_vexth_qu_du (v2u64 _1) +{ + return __builtin_lsx_vexth_qu_du (_1); +} +v16i8 +__lsx_vrotri_b (v16i8 _1) +{ + return __builtin_lsx_vrotri_b (_1, 1); +} +v8i16 +__lsx_vrotri_h (v8i16 _1) +{ + return __builtin_lsx_vrotri_h (_1, 1); +} +v4i32 +__lsx_vrotri_w (v4i32 _1) +{ + return __builtin_lsx_vrotri_w (_1, 1); +} +v2i64 +__lsx_vrotri_d (v2i64 _1) +{ + return __builtin_lsx_vrotri_d (_1, 1); +} +v2i64 +__lsx_vextl_q_d (v2i64 _1) +{ + return __builtin_lsx_vextl_q_d (_1); +} +v16i8 +__lsx_vsrlni_b_h (v16i8 _1, v16i8 _2) +{ + return __builtin_lsx_vsrlni_b_h (_1, _2, 1); +} +v8i16 +__lsx_vsrlni_h_w (v8i16 _1, v8i16 _2) +{ + return __builtin_lsx_vsrlni_h_w (_1, _2, 1); +} +v4i32 +__lsx_vsrlni_w_d (v4i32 _1, v4i32 _2) +{ + return __builtin_lsx_vsrlni_w_d (_1, _2, 1); +} +v2i64 +__lsx_vsrlni_d_q (v2i64 _1, v2i64 _2) +{ + return __builtin_lsx_vsrlni_d_q (_1, _2, 1); +} +v16i8 +__lsx_vsrlrni_b_h (v16i8 _1, v16i8 _2) +{ + return __builtin_lsx_vsrlrni_b_h (_1, _2, 1); +} +v8i16 +__lsx_vsrlrni_h_w (v8i16 _1, v8i16 _2) +{ + return __builtin_lsx_vsrlrni_h_w (_1, _2, 1); +} +v4i32 +__lsx_vsrlrni_w_d (v4i32 _1, v4i32 _2) +{ + return __builtin_lsx_vsrlrni_w_d (_1, _2, 1); +} +v2i64 +__lsx_vsrlrni_d_q (v2i64 _1, v2i64 _2) +{ + return __builtin_lsx_vsrlrni_d_q (_1, _2, 1); +} +v16i8 +__lsx_vssrlni_b_h (v16i8 _1, v16i8 _2) +{ + return __builtin_lsx_vssrlni_b_h (_1, _2, 1); +} +v8i16 +__lsx_vssrlni_h_w (v8i16 _1, v8i16 _2) +{ + return __builtin_lsx_vssrlni_h_w (_1, _2, 1); +} +v4i32 +__lsx_vssrlni_w_d (v4i32 _1, v4i32 _2) +{ + return __builtin_lsx_vssrlni_w_d (_1, _2, 1); +} +v2i64 +__lsx_vssrlni_d_q (v2i64 _1, v2i64 _2) +{ + return __builtin_lsx_vssrlni_d_q (_1, _2, 1); +} +v16u8 +__lsx_vssrlni_bu_h (v16u8 _1, v16i8 _2) +{ + return __builtin_lsx_vssrlni_bu_h (_1, _2, 1); +} +v8u16 +__lsx_vssrlni_hu_w (v8u16 _1, v8i16 _2) +{ + return __builtin_lsx_vssrlni_hu_w (_1, _2, 1); +} +v4u32 +__lsx_vssrlni_wu_d (v4u32 _1, v4i32 _2) +{ + return __builtin_lsx_vssrlni_wu_d (_1, _2, 1); +} +v2u64 +__lsx_vssrlni_du_q (v2u64 _1, v2i64 _2) +{ + return __builtin_lsx_vssrlni_du_q (_1, _2, 1); +} +v16i8 +__lsx_vssrlrni_b_h (v16i8 _1, v16i8 _2) +{ + return __builtin_lsx_vssrlrni_b_h (_1, _2, 1); +} +v8i16 +__lsx_vssrlrni_h_w (v8i16 _1, v8i16 _2) +{ + return __builtin_lsx_vssrlrni_h_w (_1, _2, 1); +} +v4i32 +__lsx_vssrlrni_w_d (v4i32 _1, v4i32 _2) +{ + return __builtin_lsx_vssrlrni_w_d (_1, _2, 1); +} +v2i64 +__lsx_vssrlrni_d_q (v2i64 _1, v2i64 _2) +{ + return __builtin_lsx_vssrlrni_d_q (_1, _2, 1); +} +v16u8 +__lsx_vssrlrni_bu_h (v16u8 _1, v16i8 _2) +{ + return __builtin_lsx_vssrlrni_bu_h (_1, _2, 1); +} +v8u16 +__lsx_vssrlrni_hu_w (v8u16 _1, v8i16 _2) +{ + return __builtin_lsx_vssrlrni_hu_w (_1, _2, 1); +} +v4u32 +__lsx_vssrlrni_wu_d (v4u32 _1, v4i32 _2) +{ + return __builtin_lsx_vssrlrni_wu_d (_1, _2, 1); +} +v2u64 +__lsx_vssrlrni_du_q (v2u64 _1, v2i64 _2) +{ + return __builtin_lsx_vssrlrni_du_q (_1, _2, 1); +} +v16i8 +__lsx_vsrani_b_h (v16i8 _1, v16i8 _2) +{ + return __builtin_lsx_vsrani_b_h (_1, _2, 1); +} +v8i16 +__lsx_vsrani_h_w (v8i16 _1, v8i16 _2) +{ + return __builtin_lsx_vsrani_h_w (_1, _2, 1); +} +v4i32 +__lsx_vsrani_w_d (v4i32 _1, v4i32 _2) +{ + return __builtin_lsx_vsrani_w_d (_1, _2, 1); +} +v2i64 +__lsx_vsrani_d_q (v2i64 _1, v2i64 _2) +{ + return __builtin_lsx_vsrani_d_q (_1, _2, 1); +} +v16i8 +__lsx_vsrarni_b_h (v16i8 _1, v16i8 _2) +{ + return __builtin_lsx_vsrarni_b_h (_1, _2, 1); +} +v8i16 +__lsx_vsrarni_h_w (v8i16 _1, v8i16 _2) +{ + return __builtin_lsx_vsrarni_h_w (_1, _2, 1); +} +v4i32 +__lsx_vsrarni_w_d (v4i32 _1, v4i32 _2) +{ + return __builtin_lsx_vsrarni_w_d (_1, _2, 1); +} +v2i64 +__lsx_vsrarni_d_q (v2i64 _1, v2i64 _2) +{ + return __builtin_lsx_vsrarni_d_q (_1, _2, 1); +} +v16i8 +__lsx_vssrani_b_h (v16i8 _1, v16i8 _2) +{ + return __builtin_lsx_vssrani_b_h (_1, _2, 1); +} +v8i16 +__lsx_vssrani_h_w (v8i16 _1, v8i16 _2) +{ + return __builtin_lsx_vssrani_h_w (_1, _2, 1); +} +v4i32 +__lsx_vssrani_w_d (v4i32 _1, v4i32 _2) +{ + return __builtin_lsx_vssrani_w_d (_1, _2, 1); +} +v2i64 +__lsx_vssrani_d_q (v2i64 _1, v2i64 _2) +{ + return __builtin_lsx_vssrani_d_q (_1, _2, 1); +} +v16u8 +__lsx_vssrani_bu_h (v16u8 _1, v16i8 _2) +{ + return __builtin_lsx_vssrani_bu_h (_1, _2, 1); +} +v8u16 +__lsx_vssrani_hu_w (v8u16 _1, v8i16 _2) +{ + return __builtin_lsx_vssrani_hu_w (_1, _2, 1); +} +v4u32 +__lsx_vssrani_wu_d (v4u32 _1, v4i32 _2) +{ + return __builtin_lsx_vssrani_wu_d (_1, _2, 1); +} +v2u64 +__lsx_vssrani_du_q (v2u64 _1, v2i64 _2) +{ + return __builtin_lsx_vssrani_du_q (_1, _2, 1); +} +v16i8 +__lsx_vssrarni_b_h (v16i8 _1, v16i8 _2) +{ + return __builtin_lsx_vssrarni_b_h (_1, _2, 1); +} +v8i16 +__lsx_vssrarni_h_w (v8i16 _1, v8i16 _2) +{ + return __builtin_lsx_vssrarni_h_w (_1, _2, 1); +} +v4i32 +__lsx_vssrarni_w_d (v4i32 _1, v4i32 _2) +{ + return __builtin_lsx_vssrarni_w_d (_1, _2, 1); +} +v2i64 +__lsx_vssrarni_d_q (v2i64 _1, v2i64 _2) +{ + return __builtin_lsx_vssrarni_d_q (_1, _2, 1); +} +v16u8 +__lsx_vssrarni_bu_h (v16u8 _1, v16i8 _2) +{ + return __builtin_lsx_vssrarni_bu_h (_1, _2, 1); +} +v8u16 +__lsx_vssrarni_hu_w (v8u16 _1, v8i16 _2) +{ + return __builtin_lsx_vssrarni_hu_w (_1, _2, 1); +} +v4u32 +__lsx_vssrarni_wu_d (v4u32 _1, v4i32 _2) +{ + return __builtin_lsx_vssrarni_wu_d (_1, _2, 1); +} +v2u64 +__lsx_vssrarni_du_q (v2u64 _1, v2i64 _2) +{ + return __builtin_lsx_vssrarni_du_q (_1, _2, 1); +} +v4i32 +__lsx_vpermi_w (v4i32 _1, v4i32 _2) +{ + return __builtin_lsx_vpermi_w (_1, _2, 1); +} +v16i8 +__lsx_vld (void *_1) +{ + return __builtin_lsx_vld (_1, 1); +} +void +__lsx_vst (v16i8 _1, void *_2) +{ + return __builtin_lsx_vst (_1, _2, 1); +} +v16i8 +__lsx_vssrlrn_b_h (v8i16 _1, v8i16 _2) +{ + return __builtin_lsx_vssrlrn_b_h (_1, _2); +} +v8i16 +__lsx_vssrlrn_h_w (v4i32 _1, v4i32 _2) +{ + return __builtin_lsx_vssrlrn_h_w (_1, _2); +} +v4i32 +__lsx_vssrlrn_w_d (v2i64 _1, v2i64 _2) +{ + return __builtin_lsx_vssrlrn_w_d (_1, _2); +} +v16i8 +__lsx_vssrln_b_h (v8i16 _1, v8i16 _2) +{ + return __builtin_lsx_vssrln_b_h (_1, _2); +} +v8i16 +__lsx_vssrln_h_w (v4i32 _1, v4i32 _2) +{ + return __builtin_lsx_vssrln_h_w (_1, _2); +} +v4i32 +__lsx_vssrln_w_d (v2i64 _1, v2i64 _2) +{ + return __builtin_lsx_vssrln_w_d (_1, _2); +} +v16i8 +__lsx_vorn_v (v16i8 _1, v16i8 _2) +{ + return __builtin_lsx_vorn_v (_1, _2); +} +v2i64 +__lsx_vldi () +{ + return __builtin_lsx_vldi (1); +} +v16i8 +__lsx_vshuf_b (v16i8 _1, v16i8 _2, v16i8 _3) +{ + return __builtin_lsx_vshuf_b (_1, _2, _3); +} +v16i8 +__lsx_vldx (void *_1) +{ + return __builtin_lsx_vldx (_1, 1); +} +void +__lsx_vstx (v16i8 _1, void *_2) +{ + return __builtin_lsx_vstx (_1, _2, 1); +} +v2u64 +__lsx_vextl_qu_du (v2u64 _1) +{ + return __builtin_lsx_vextl_qu_du (_1); +} +int +__lsx_bnz_b (v16u8 _1) +{ + return __builtin_lsx_bnz_b (_1); +} +int +__lsx_bnz_d (v2u64 _1) +{ + return __builtin_lsx_bnz_d (_1); +} +int +__lsx_bnz_h (v8u16 _1) +{ + return __builtin_lsx_bnz_h (_1); +} +int +__lsx_bnz_v (v16u8 _1) +{ + return __builtin_lsx_bnz_v (_1); +} +int +__lsx_bnz_w (v4u32 _1) +{ + return __builtin_lsx_bnz_w (_1); +} +int +__lsx_bz_b (v16u8 _1) +{ + return __builtin_lsx_bz_b (_1); +} +int +__lsx_bz_d (v2u64 _1) +{ + return __builtin_lsx_bz_d (_1); +} +int +__lsx_bz_h (v8u16 _1) +{ + return __builtin_lsx_bz_h (_1); +} +int +__lsx_bz_v (v16u8 _1) +{ + return __builtin_lsx_bz_v (_1); +} +int +__lsx_bz_w (v4u32 _1) +{ + return __builtin_lsx_bz_w (_1); +} +v2i64 +__lsx_vfcmp_caf_d (v2f64 _1, v2f64 _2) +{ + return __builtin_lsx_vfcmp_caf_d (_1, _2); +} +v4i32 +__lsx_vfcmp_caf_s (v4f32 _1, v4f32 _2) +{ + return __builtin_lsx_vfcmp_caf_s (_1, _2); +} +v2i64 +__lsx_vfcmp_ceq_d (v2f64 _1, v2f64 _2) +{ + return __builtin_lsx_vfcmp_ceq_d (_1, _2); +} +v4i32 +__lsx_vfcmp_ceq_s (v4f32 _1, v4f32 _2) +{ + return __builtin_lsx_vfcmp_ceq_s (_1, _2); +} +v2i64 +__lsx_vfcmp_cle_d (v2f64 _1, v2f64 _2) +{ + return __builtin_lsx_vfcmp_cle_d (_1, _2); +} +v4i32 +__lsx_vfcmp_cle_s (v4f32 _1, v4f32 _2) +{ + return __builtin_lsx_vfcmp_cle_s (_1, _2); +} +v2i64 +__lsx_vfcmp_clt_d (v2f64 _1, v2f64 _2) +{ + return __builtin_lsx_vfcmp_clt_d (_1, _2); +} +v4i32 +__lsx_vfcmp_clt_s (v4f32 _1, v4f32 _2) +{ + return __builtin_lsx_vfcmp_clt_s (_1, _2); +} +v2i64 +__lsx_vfcmp_cne_d (v2f64 _1, v2f64 _2) +{ + return __builtin_lsx_vfcmp_cne_d (_1, _2); +} +v4i32 +__lsx_vfcmp_cne_s (v4f32 _1, v4f32 _2) +{ + return __builtin_lsx_vfcmp_cne_s (_1, _2); +} +v2i64 +__lsx_vfcmp_cor_d (v2f64 _1, v2f64 _2) +{ + return __builtin_lsx_vfcmp_cor_d (_1, _2); +} +v4i32 +__lsx_vfcmp_cor_s (v4f32 _1, v4f32 _2) +{ + return __builtin_lsx_vfcmp_cor_s (_1, _2); +} +v2i64 +__lsx_vfcmp_cueq_d (v2f64 _1, v2f64 _2) +{ + return __builtin_lsx_vfcmp_cueq_d (_1, _2); +} +v4i32 +__lsx_vfcmp_cueq_s (v4f32 _1, v4f32 _2) +{ + return __builtin_lsx_vfcmp_cueq_s (_1, _2); +} +v2i64 +__lsx_vfcmp_cule_d (v2f64 _1, v2f64 _2) +{ + return __builtin_lsx_vfcmp_cule_d (_1, _2); +} +v4i32 +__lsx_vfcmp_cule_s (v4f32 _1, v4f32 _2) +{ + return __builtin_lsx_vfcmp_cule_s (_1, _2); +} +v2i64 +__lsx_vfcmp_cult_d (v2f64 _1, v2f64 _2) +{ + return __builtin_lsx_vfcmp_cult_d (_1, _2); +} +v4i32 +__lsx_vfcmp_cult_s (v4f32 _1, v4f32 _2) +{ + return __builtin_lsx_vfcmp_cult_s (_1, _2); +} +v2i64 +__lsx_vfcmp_cun_d (v2f64 _1, v2f64 _2) +{ + return __builtin_lsx_vfcmp_cun_d (_1, _2); +} +v2i64 +__lsx_vfcmp_cune_d (v2f64 _1, v2f64 _2) +{ + return __builtin_lsx_vfcmp_cune_d (_1, _2); +} +v4i32 +__lsx_vfcmp_cune_s (v4f32 _1, v4f32 _2) +{ + return __builtin_lsx_vfcmp_cune_s (_1, _2); +} +v4i32 +__lsx_vfcmp_cun_s (v4f32 _1, v4f32 _2) +{ + return __builtin_lsx_vfcmp_cun_s (_1, _2); +} +v2i64 +__lsx_vfcmp_saf_d (v2f64 _1, v2f64 _2) +{ + return __builtin_lsx_vfcmp_saf_d (_1, _2); +} +v4i32 +__lsx_vfcmp_saf_s (v4f32 _1, v4f32 _2) +{ + return __builtin_lsx_vfcmp_saf_s (_1, _2); +} +v2i64 +__lsx_vfcmp_seq_d (v2f64 _1, v2f64 _2) +{ + return __builtin_lsx_vfcmp_seq_d (_1, _2); +} +v4i32 +__lsx_vfcmp_seq_s (v4f32 _1, v4f32 _2) +{ + return __builtin_lsx_vfcmp_seq_s (_1, _2); +} +v2i64 +__lsx_vfcmp_sle_d (v2f64 _1, v2f64 _2) +{ + return __builtin_lsx_vfcmp_sle_d (_1, _2); +} +v4i32 +__lsx_vfcmp_sle_s (v4f32 _1, v4f32 _2) +{ + return __builtin_lsx_vfcmp_sle_s (_1, _2); +} +v2i64 +__lsx_vfcmp_slt_d (v2f64 _1, v2f64 _2) +{ + return __builtin_lsx_vfcmp_slt_d (_1, _2); +} +v4i32 +__lsx_vfcmp_slt_s (v4f32 _1, v4f32 _2) +{ + return __builtin_lsx_vfcmp_slt_s (_1, _2); +} +v2i64 +__lsx_vfcmp_sne_d (v2f64 _1, v2f64 _2) +{ + return __builtin_lsx_vfcmp_sne_d (_1, _2); +} +v4i32 +__lsx_vfcmp_sne_s (v4f32 _1, v4f32 _2) +{ + return __builtin_lsx_vfcmp_sne_s (_1, _2); +} +v2i64 +__lsx_vfcmp_sor_d (v2f64 _1, v2f64 _2) +{ + return __builtin_lsx_vfcmp_sor_d (_1, _2); +} +v4i32 +__lsx_vfcmp_sor_s (v4f32 _1, v4f32 _2) +{ + return __builtin_lsx_vfcmp_sor_s (_1, _2); +} +v2i64 +__lsx_vfcmp_sueq_d (v2f64 _1, v2f64 _2) +{ + return __builtin_lsx_vfcmp_sueq_d (_1, _2); +} +v4i32 +__lsx_vfcmp_sueq_s (v4f32 _1, v4f32 _2) +{ + return __builtin_lsx_vfcmp_sueq_s (_1, _2); +} +v2i64 +__lsx_vfcmp_sule_d (v2f64 _1, v2f64 _2) +{ + return __builtin_lsx_vfcmp_sule_d (_1, _2); +} +v4i32 +__lsx_vfcmp_sule_s (v4f32 _1, v4f32 _2) +{ + return __builtin_lsx_vfcmp_sule_s (_1, _2); +} +v2i64 +__lsx_vfcmp_sult_d (v2f64 _1, v2f64 _2) +{ + return __builtin_lsx_vfcmp_sult_d (_1, _2); +} +v4i32 +__lsx_vfcmp_sult_s (v4f32 _1, v4f32 _2) +{ + return __builtin_lsx_vfcmp_sult_s (_1, _2); +} +v2i64 +__lsx_vfcmp_sun_d (v2f64 _1, v2f64 _2) +{ + return __builtin_lsx_vfcmp_sun_d (_1, _2); +} +v2i64 +__lsx_vfcmp_sune_d (v2f64 _1, v2f64 _2) +{ + return __builtin_lsx_vfcmp_sune_d (_1, _2); +} +v4i32 +__lsx_vfcmp_sune_s (v4f32 _1, v4f32 _2) +{ + return __builtin_lsx_vfcmp_sune_s (_1, _2); +} +v4i32 +__lsx_vfcmp_sun_s (v4f32 _1, v4f32 _2) +{ + return __builtin_lsx_vfcmp_sun_s (_1, _2); +} +v16i8 +__lsx_vrepli_b () +{ + return __builtin_lsx_vrepli_b (1); +} +v2i64 +__lsx_vrepli_d () +{ + return __builtin_lsx_vrepli_d (1); +} +v8i16 +__lsx_vrepli_h () +{ + return __builtin_lsx_vrepli_h (1); +} +v4i32 +__lsx_vrepli_w () +{ + return __builtin_lsx_vrepli_w (1); +} From patchwork Mon Sep 11 03:44:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: chenxiaolong X-Patchwork-Id: 137877 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ab0a:0:b0:3f2:4152:657d with SMTP id m10csp1858101vqo; Sun, 10 Sep 2023 20:50:11 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGlTr5u5CH273K0ROrupjAzht6tG6+XLaCXx/de4laB8vmm98cqUnVJfBby+Y35AqmSd817 X-Received: by 2002:a19:381c:0:b0:500:b3f2:73e2 with SMTP id f28-20020a19381c000000b00500b3f273e2mr6046411lfa.50.1694404211462; Sun, 10 Sep 2023 20:50:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694404211; cv=none; d=google.com; s=arc-20160816; b=KIMdor5CPVToc5StdbfxRlJVWYE8cZ0cSBkGaGwqKW0+FAbMKgUJbioIYke+wITaCW weRh6GNKZFkFn4SQjM//UhpqFlIOzUab2Ll3B2vm2vPccicknKy0V4u2jnO34B7MjztI sLirZlyX6j3lJKkM0Z0gRdDJAaT4dcfy/V1FKreOcdqpDHg1C91pikstheAKbLK92+X+ C0JtSge3DldMtL6fWGCpGb5uSxwG5C9WVWjZrghkE5qe+3Ay2l27t1MhQlUcT2YNWcmS vNTh1vic6K1W5OIhjuJm+RcJb3L7AhcF7C9i6oHeONxxn87ZyToU6P7csaM0ig+QyF+M WMIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dmarc-filter:delivered-to; bh=eaOdaGvwPivkVrf8WBQINX2S2BUbtcKsA+RCac3Vppg=; fh=BpFCyCzVJo4znJIvOjeDfKzcGsF6Q+JgJbJ+1ev/kM4=; b=rouou7Np0Xf8sXU3MjJmjpvOFXN0k5pJyXb4Bor2QSLmwUqxtwCruGnE5Jcok1RCso YQc9D+YA31q4svCECeGRiV9ALfoUYH3d1YFGDwHGPsbrPFaF8oPsK7xc85X2W5vV/y1L ppvJw5ic0mCOOGShcizkOl9A3HrRa83SXb8/olXMH6Nf49RZTXXtyImiLJO27nfK7JFT ecnL0b3X5vdZC5jcbgD2duI5PVWRhbHfPBfVFmPSRDA/ICLKAP4ijcSVW9iPy41kl7eT 4TuOx5VrGg1X9Vk9NwTsBq6Qt0bxe6/nCgmd70xP3xsT+DofptujqwS/xwL9l7DUvhRh kiAw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id p24-20020a17090628d800b0096ae15237a1si5941427ejd.486.2023.09.10.20.50.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 Sep 2023 20:50:11 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id BDE023826FDF for ; Mon, 11 Sep 2023 03:46:45 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by sourceware.org (Postfix) with ESMTP id 9DE5C3858024 for ; Mon, 11 Sep 2023 03:45:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9DE5C3858024 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=loongson.cn Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=loongson.cn Received: from loongson.cn (unknown [10.10.130.252]) by gateway (Coremail) with SMTP id _____8DxFehijf5k60QkAA--.12137S3; Mon, 11 Sep 2023 11:45:38 +0800 (CST) Received: from slurm-master.loongson.cn (unknown [10.10.130.252]) by localhost.localdomain (Coremail) with SMTP id AQAAf8Dx_yNXjf5kzKZ2AA--.44820S8; Mon, 11 Sep 2023 11:45:37 +0800 (CST) From: Xiaolong Chen To: gcc-patches@gcc.gnu.org Subject: [PATCH v3 4/9] LoongArch:Added support for SX vector floating-point instructions. Date: Mon, 11 Sep 2023 11:44:34 +0800 Message-Id: <20230911034439.8266-5-chenxiaolong@loongson.cn> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230911034439.8266-1-chenxiaolong@loongson.cn> References: <20230911034439.8266-1-chenxiaolong@loongson.cn> MIME-Version: 1.0 X-CM-TRANSID: AQAAf8Dx_yNXjf5kzKZ2AA--.44820S8 X-CM-SenderInfo: hfkh05xldrz0tqj6z05rqj20fqof0/1tbiAQALBWT9QjYDmgAAs7 X-Coremail-Antispam: 1Uk129KBj9UXoW7Xw47Zw1rXF18p5X_GFWDXF17pr17Xr13Gr W8AayYyrWUtFy2vF95Ar92yas7Jr17J3sFkw1DKF9xXr47C34UAr4Dt3W7XFy3trn8GF4U tr4UJwcCm3ZEXasCq-sJn29KB7ZKAUJUUUUU529EdanIXcx71UUUUU7KY7ZEXasCq-sGcS sGvfJ3Ic02F40EFcxC0VAKzVAqx4xG6I80ebIjqfuFe4nvWSU5nxnvy29KBjDU0xBIdaVr nRJUUUk2b4IE77IF4wAFF20E14v26r1j6r4UM7CY07I20VC2zVCF04k26cxKx2IYs7xG6r Wj6s0DM7CIcVAFz4kK6r1j6r18M28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48ve4kI8wA2 z4x0Y4vE2Ix0cI8IcVAFwI0_Xr0_Ar1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI0_Gr0_Cr 1l84ACjcxK6I8E87Iv67AKxVW8Jr0_Cr1UM28EF7xvwVC2z280aVCY1x0267AKxVW8Jr0_ Cr1UM2AIxVAIcxkEcVAq07x20xvEncxIr21l57IF6xkI12xvs2x26I8E6xACxx1l5I8CrV ACY4xI64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r1q6rW5McIj6I8E87Iv67AKxVW8 JVWxJwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IYc2Ij64vIr41l42xK82IYc2Ij64vIr4 1l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2IqxVAqx4xG67AKxVWUJVWUGwC20s026x8GjcxK 67AKxVWUGVWUWwC2zVAF1VAY17CE14v26r126r1DMIIYrxkI7VAKI48JMIIF0xvE2Ix0cI 8IcVAFwI0_Gr0_Xr1lIxAIcVC0I7IYx2IY6xkF7I0E14v26r4j6F4UMIIF0xvE42xK8VAv wI8IcIk0rVWUJVWUCwCI42IY6I8E87Iv67AKxVW8JVWxJwCI42IY6I8E87Iv6xkF7I0E14 v26r4j6r4UJbIYCTnIWIevJa73UjIFyTuYvjxU2F4iUUUUU X-Spam-Status: No, score=-12.2 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, KAM_SHORT, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Xiaolong Chen , xuchenghua@loongson.cn, chenglulu@loongson.cn, i@xen0n.name Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1776711590409823764 X-GMAIL-MSGID: 1776711590409823764 gcc/testsuite/ChangeLog: * gcc.target/loongarch/vector/lsx/lsx-vfcvt-1.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vfcvt-2.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vffint-1.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vffint-2.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vffint-3.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vfrint_d.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vfrint_s.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vftint-1.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vftint-2.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vftint-3.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vftint-4.c: New test. --- .../loongarch/vector/lsx/lsx-vfcvt-1.c | 398 +++++++ .../loongarch/vector/lsx/lsx-vfcvt-2.c | 278 +++++ .../loongarch/vector/lsx/lsx-vffint-1.c | 161 +++ .../loongarch/vector/lsx/lsx-vffint-2.c | 264 +++++ .../loongarch/vector/lsx/lsx-vffint-3.c | 102 ++ .../loongarch/vector/lsx/lsx-vfrint_d.c | 230 ++++ .../loongarch/vector/lsx/lsx-vfrint_s.c | 350 ++++++ .../loongarch/vector/lsx/lsx-vftint-1.c | 349 ++++++ .../loongarch/vector/lsx/lsx-vftint-2.c | 695 +++++++++++ .../loongarch/vector/lsx/lsx-vftint-3.c | 1028 +++++++++++++++++ .../loongarch/vector/lsx/lsx-vftint-4.c | 345 ++++++ 11 files changed, 4200 insertions(+) create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfcvt-1.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfcvt-2.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vffint-1.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vffint-2.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vffint-3.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfrint_d.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfrint_s.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vftint-1.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vftint-2.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vftint-3.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vftint-4.c diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfcvt-1.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfcvt-1.c new file mode 100644 index 00000000000..d4a86e26241 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfcvt-1.c @@ -0,0 +1,398 @@ +/* { dg-do run } */ +/* { dg-options "-mlsx -w -fno-strict-aliasing" } */ +#include "../simd_correctness_check.h" +#include + +int +main () +{ + __m128i __m128i_op0, __m128i_op1, __m128i_op2, __m128i_out, __m128i_result; + __m128 __m128_op0, __m128_op1, __m128_op2, __m128_out, __m128_result; + __m128d __m128d_op0, __m128d_op1, __m128d_op2, __m128d_out, __m128d_result; + + int int_op0, int_op1, int_op2, int_out, int_result, i = 1, fail; + long int long_op0, long_op1, long_op2, lont_out, lont_result; + long int long_int_out, long_int_result; + unsigned int unsigned_int_out, unsigned_int_result; + unsigned long int unsigned_long_int_out, unsigned_long_int_result; + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x00e0000000e00000; + *((int *)&__m128_result[3]) = 0x00000000; + *((int *)&__m128_result[2]) = 0x00000000; + *((int *)&__m128_result[1]) = 0x00000000; + *((int *)&__m128_result[0]) = 0x00000000; + __m128_out = __lsx_vfcvth_s_h (__m128i_op0); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000002a55005501; + *((unsigned long *)&__m128i_op0[0]) = 0x0000002a55000001; + *((int *)&__m128_result[3]) = 0x00000000; + *((int *)&__m128_result[2]) = 0x36280000; + *((int *)&__m128_result[1]) = 0x42a00000; + *((int *)&__m128_result[0]) = 0x42a02000; + __m128_out = __lsx_vfcvth_s_h (__m128i_op0); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0xf436f3f5; + *((int *)&__m128_op0[0]) = 0x2f4ef4a8; + *((unsigned long *)&__m128d_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000; + __m128d_out = __lsx_vfcvth_d_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffcfb799f1; + *((unsigned long *)&__m128i_op0[0]) = 0x0282800002828282; + *((int *)&__m128_result[3]) = 0xffffe000; + *((int *)&__m128_result[2]) = 0xffffe000; + *((int *)&__m128_result[1]) = 0xc1f6e000; + *((int *)&__m128_result[0]) = 0xbb3e2000; + __m128_out = __lsx_vfcvth_s_h (__m128i_op0); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000040004000100; + *((int *)&__m128_result[3]) = 0x00000000; + *((int *)&__m128_result[2]) = 0x00000000; + *((int *)&__m128_result[1]) = 0x00000000; + *((int *)&__m128_result[0]) = 0x00000000; + __m128_out = __lsx_vfcvth_s_h (__m128i_op0); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((int *)&__m128_result[3]) = 0x00000000; + *((int *)&__m128_result[2]) = 0x00000000; + *((int *)&__m128_result[1]) = 0x00000000; + *((int *)&__m128_result[0]) = 0x00000000; + __m128_out = __lsx_vfcvth_s_h (__m128i_op0); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((int *)&__m128_result[3]) = 0x00000000; + *((int *)&__m128_result[2]) = 0x00000000; + *((int *)&__m128_result[1]) = 0x00000000; + *((int *)&__m128_result[0]) = 0x00000000; + __m128_out = __lsx_vfcvth_s_h (__m128i_op0); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000006f00001f0a; + *((unsigned long *)&__m128i_op0[0]) = 0x0000958affff995d; + *((int *)&__m128_result[3]) = 0x00000000; + *((int *)&__m128_result[2]) = 0x36de0000; + *((int *)&__m128_result[1]) = 0x00000000; + *((int *)&__m128_result[0]) = 0x3be14000; + __m128_out = __lsx_vfcvth_s_h (__m128i_op0); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x41dfffff00000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((int *)&__m128_result[3]) = 0x403be000; + *((int *)&__m128_result[2]) = 0xffffe000; + *((int *)&__m128_result[1]) = 0x00000000; + *((int *)&__m128_result[0]) = 0x00000000; + __m128_out = __lsx_vfcvth_s_h (__m128i_op0); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((int *)&__m128_op0[3]) = 0x63637687; + *((int *)&__m128_op0[2]) = 0x636316bb; + *((int *)&__m128_op0[1]) = 0x63636363; + *((int *)&__m128_op0[0]) = 0x63636363; + *((unsigned long *)&__m128d_result[1]) = 0x446c6ed0e0000000; + *((unsigned long *)&__m128d_result[0]) = 0x446c62d760000000; + __m128d_out = __lsx_vfcvth_d_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0x00000000; + *((unsigned long *)&__m128d_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000; + __m128d_out = __lsx_vfcvth_d_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((int *)&__m128_op0[3]) = 0x000000ff; + *((int *)&__m128_op0[2]) = 0x000000ff; + *((int *)&__m128_op0[1]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0x00000000; + *((unsigned long *)&__m128d_result[1]) = 0x371fe00000000000; + *((unsigned long *)&__m128d_result[0]) = 0x371fe00000000000; + __m128d_out = __lsx_vfcvth_d_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x6363636363636363; + *((int *)&__m128_result[3]) = 0x00000000; + *((int *)&__m128_result[2]) = 0x00000000; + *((int *)&__m128_result[1]) = 0x00000000; + *((int *)&__m128_result[0]) = 0x00000000; + __m128_out = __lsx_vfcvth_s_h (__m128i_op0); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfffffffff7fff7ef; + *((unsigned long *)&__m128i_op0[0]) = 0x80808080ffffffff; + *((int *)&__m128_result[3]) = 0xffffe000; + *((int *)&__m128_result[2]) = 0xffffe000; + *((int *)&__m128_result[1]) = 0xc6ffe000; + *((int *)&__m128_result[0]) = 0xc6fde000; + __m128_out = __lsx_vfcvth_s_h (__m128i_op0); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((int *)&__m128_op0[3]) = 0xffffffff; + *((int *)&__m128_op0[2]) = 0xffffffff; + *((int *)&__m128_op0[1]) = 0xffffffff; + *((int *)&__m128_op0[0]) = 0xffffffff; + *((unsigned long *)&__m128d_result[1]) = 0xffffffffe0000000; + *((unsigned long *)&__m128d_result[0]) = 0xffffffffe0000000; + __m128d_out = __lsx_vfcvth_d_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((int *)&__m128_result[3]) = 0x00000000; + *((int *)&__m128_result[2]) = 0x00000000; + *((int *)&__m128_result[1]) = 0x00000000; + *((int *)&__m128_result[0]) = 0x00000000; + __m128_out = __lsx_vfcvth_s_h (__m128i_op0); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((int *)&__m128_result[3]) = 0x00000000; + *((int *)&__m128_result[2]) = 0x00000000; + *((int *)&__m128_result[1]) = 0x00000000; + *((int *)&__m128_result[0]) = 0x00000000; + __m128_out = __lsx_vfcvth_s_h (__m128i_op0); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffe1ffc100000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000400000; + *((int *)&__m128_result[3]) = 0xfffc2000; + *((int *)&__m128_result[2]) = 0xfff82000; + *((int *)&__m128_result[1]) = 0x00000000; + *((int *)&__m128_result[0]) = 0x00000000; + __m128_out = __lsx_vfcvth_s_h (__m128i_op0); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((int *)&__m128_result[3]) = 0x00000000; + *((int *)&__m128_result[2]) = 0x00000000; + *((int *)&__m128_result[1]) = 0x00000000; + *((int *)&__m128_result[0]) = 0x00000000; + __m128_out = __lsx_vfcvth_s_h (__m128i_op0); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0x00000000; + *((unsigned long *)&__m128d_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000; + __m128d_out = __lsx_vfcvth_d_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((int *)&__m128_op0[3]) = 0x0000b3a6; + *((int *)&__m128_op0[2]) = 0x000067da; + *((int *)&__m128_op0[1]) = 0x00004e42; + *((int *)&__m128_op0[0]) = 0x0000c26a; + *((unsigned long *)&__m128d_result[1]) = 0x379674c000000000; + *((unsigned long *)&__m128d_result[0]) = 0x3789f68000000000; + __m128d_out = __lsx_vfcvth_d_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0xffffffff; + *((int *)&__m128_op0[1]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0xffff0000; + *((unsigned long *)&__m128d_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[0]) = 0xffffffffe0000000; + __m128d_out = __lsx_vfcvth_d_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((int *)&__m128_result[3]) = 0x00000000; + *((int *)&__m128_result[2]) = 0x00000000; + *((int *)&__m128_result[1]) = 0x00000000; + *((int *)&__m128_result[0]) = 0x00000000; + __m128_out = __lsx_vfcvth_s_h (__m128i_op0); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0001001001000080; + *((unsigned long *)&__m128i_op0[0]) = 0x4195d926d8018000; + *((int *)&__m128_result[3]) = 0x33800000; + *((int *)&__m128_result[2]) = 0x35800000; + *((int *)&__m128_result[1]) = 0x37800000; + *((int *)&__m128_result[0]) = 0x37000000; + __m128_out = __lsx_vfcvth_s_h (__m128i_op0); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0xffffffff; + *((int *)&__m128_op0[0]) = 0xffffffff; + *((unsigned long *)&__m128d_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000; + __m128d_out = __lsx_vfcvth_d_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((int *)&__m128_result[3]) = 0xffffe000; + *((int *)&__m128_result[2]) = 0xffffe000; + *((int *)&__m128_result[1]) = 0xffffe000; + *((int *)&__m128_result[0]) = 0xffffe000; + __m128_out = __lsx_vfcvtl_s_h (__m128i_op0); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0x00000000; + *((unsigned long *)&__m128d_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000; + __m128d_out = __lsx_vfcvtl_d_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000a000a000a000a; + *((unsigned long *)&__m128i_op0[0]) = 0x000a000a000a000a; + *((int *)&__m128_result[3]) = 0x35200000; + *((int *)&__m128_result[2]) = 0x35200000; + *((int *)&__m128_result[1]) = 0x35200000; + *((int *)&__m128_result[0]) = 0x35200000; + __m128_out = __lsx_vfcvtl_s_h (__m128i_op0); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0x00000000; + *((unsigned long *)&__m128d_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000; + __m128d_out = __lsx_vfcvtl_d_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((int *)&__m128_op0[3]) = 0x00000100; + *((int *)&__m128_op0[2]) = 0x0f00fe00; + *((int *)&__m128_op0[1]) = 0x0000017f; + *((int *)&__m128_op0[0]) = 0xff00fe7f; + *((unsigned long *)&__m128d_result[1]) = 0x3727f00000000000; + *((unsigned long *)&__m128d_result[0]) = 0xc7e01fcfe0000000; + __m128d_out = __lsx_vfcvtl_d_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0x00000000; + *((unsigned long *)&__m128d_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000; + __m128d_out = __lsx_vfcvtl_d_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0x00000020; + *((int *)&__m128_op0[0]) = 0x00000020; + *((unsigned long *)&__m128d_result[1]) = 0x36f0000000000000; + *((unsigned long *)&__m128d_result[0]) = 0x36f0000000000000; + __m128d_out = __lsx_vfcvtl_d_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((int *)&__m128_op0[3]) = 0xffffffff; + *((int *)&__m128_op0[2]) = 0xbd994889; + *((int *)&__m128_op0[1]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0x0a092444; + *((unsigned long *)&__m128d_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[0]) = 0x3941248880000000; + __m128d_out = __lsx_vfcvtl_d_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x62cbf96e4acfaf40; + *((unsigned long *)&__m128i_op0[0]) = 0xf0bc9a5278285a4a; + *((int *)&__m128_result[3]) = 0xc6178000; + *((int *)&__m128_result[2]) = 0xbb4a4000; + *((int *)&__m128_result[1]) = 0x47050000; + *((int *)&__m128_result[0]) = 0x43494000; + __m128_out = __lsx_vfcvtl_s_h (__m128i_op0); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((int *)&__m128_op0[3]) = 0x00040004; + *((int *)&__m128_op0[2]) = 0x00040004; + *((int *)&__m128_op0[1]) = 0x00040004; + *((int *)&__m128_op0[0]) = 0x00040004; + *((unsigned long *)&__m128d_result[1]) = 0x37c0001000000000; + *((unsigned long *)&__m128d_result[0]) = 0x37c0001000000000; + __m128d_out = __lsx_vfcvtl_d_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xff00ff00ff00ff00; + *((unsigned long *)&__m128i_op0[0]) = 0xff00ff00ff00ff00; + *((int *)&__m128_result[3]) = 0xffe00000; + *((int *)&__m128_result[2]) = 0xffe00000; + *((int *)&__m128_result[1]) = 0xffe00000; + *((int *)&__m128_result[0]) = 0xffe00000; + __m128_out = __lsx_vfcvtl_s_h (__m128i_op0); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((int *)&__m128_result[3]) = 0x00000000; + *((int *)&__m128_result[2]) = 0x00000000; + *((int *)&__m128_result[1]) = 0x00000000; + *((int *)&__m128_result[0]) = 0x00000000; + __m128_out = __lsx_vfcvtl_s_h (__m128i_op0); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((int *)&__m128_result[3]) = 0x00000000; + *((int *)&__m128_result[2]) = 0x00000000; + *((int *)&__m128_result[1]) = 0x00000000; + *((int *)&__m128_result[0]) = 0x00000000; + __m128_out = __lsx_vfcvtl_s_h (__m128i_op0); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000ffffffff; + *((int *)&__m128_result[3]) = 0x00000000; + *((int *)&__m128_result[2]) = 0x00000000; + *((int *)&__m128_result[1]) = 0xffffe000; + *((int *)&__m128_result[0]) = 0xffffe000; + __m128_out = __lsx_vfcvtl_s_h (__m128i_op0); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0x00000000; + *((unsigned long *)&__m128d_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000; + __m128d_out = __lsx_vfcvtl_d_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0x00000000; + *((unsigned long *)&__m128d_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000; + __m128d_out = __lsx_vfcvtl_d_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0x007f7f7f; + *((unsigned long *)&__m128d_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[0]) = 0x380fdfdfc0000000; + __m128d_out = __lsx_vfcvtl_d_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfcvt-2.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfcvt-2.c new file mode 100644 index 00000000000..e8f4f12b992 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfcvt-2.c @@ -0,0 +1,278 @@ +/* { dg-do run } */ +/* { dg-options "-mlsx -w -fno-strict-aliasing" } */ +#include "../simd_correctness_check.h" +#include + +int +main () +{ + __m128i __m128i_op0, __m128i_op1, __m128i_op2, __m128i_out, __m128i_result; + __m128 __m128_op0, __m128_op1, __m128_op2, __m128_out, __m128_result; + __m128d __m128d_op0, __m128d_op1, __m128d_op2, __m128d_out, __m128d_result; + + int int_op0, int_op1, int_op2, int_out, int_result, i = 1, fail; + long int long_op0, long_op1, long_op2, lont_out, lont_result; + long int long_int_out, long_int_result; + unsigned int unsigned_int_out, unsigned_int_result; + unsigned long int unsigned_long_int_out, unsigned_long_int_result; + + *((int *)&__m128_op0[3]) = 0x004200a0; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0x004200a0; + *((int *)&__m128_op0[0]) = 0x00200001; + *((int *)&__m128_op1[3]) = 0x004200a0; + *((int *)&__m128_op1[2]) = 0x00000000; + *((int *)&__m128_op1[1]) = 0x004200a0; + *((int *)&__m128_op1[0]) = 0x00200000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcvt_h_s (__m128_op0, __m128_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0xffffffff; + *((int *)&__m128_op0[2]) = 0xffffffff; + *((int *)&__m128_op0[1]) = 0xffffffff; + *((int *)&__m128_op0[0]) = 0xffffffff; + *((int *)&__m128_op1[3]) = 0x00010001; + *((int *)&__m128_op1[2]) = 0x0001007c; + *((int *)&__m128_op1[1]) = 0x00010001; + *((int *)&__m128_op1[0]) = 0x00010001; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcvt_h_s (__m128_op0, __m128_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0x00000000; + *((int *)&__m128_op1[3]) = 0x00000000; + *((int *)&__m128_op1[2]) = 0x00000000; + *((int *)&__m128_op1[1]) = 0x00000000; + *((int *)&__m128_op1[0]) = 0x00000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcvt_h_s (__m128_op0, __m128_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0xffffffff; + *((int *)&__m128_op0[2]) = 0xffffffff; + *((int *)&__m128_op0[1]) = 0xffffffff; + *((int *)&__m128_op0[0]) = 0xffffffff; + *((int *)&__m128_op1[3]) = 0x00000000; + *((int *)&__m128_op1[2]) = 0x00000000; + *((int *)&__m128_op1[1]) = 0x00000000; + *((int *)&__m128_op1[0]) = 0x00000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcvt_h_s (__m128_op0, __m128_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0x00000000; + *((int *)&__m128_op1[3]) = 0x80808080; + *((int *)&__m128_op1[2]) = 0x80808080; + *((int *)&__m128_op1[1]) = 0x80808080; + *((int *)&__m128_op1[0]) = 0x80808080; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x8000800080008000; + __m128i_out = __lsx_vfcvt_h_s (__m128_op0, __m128_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0xffffffff; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0xffffffff; + *((int *)&__m128_op0[0]) = 0xffffffff; + *((int *)&__m128_op1[3]) = 0x00000000; + *((int *)&__m128_op1[2]) = 0x00000000; + *((int *)&__m128_op1[1]) = 0x00000000; + *((int *)&__m128_op1[0]) = 0x00000000; + *((unsigned long *)&__m128i_result[1]) = 0xffff0000ffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcvt_h_s (__m128_op0, __m128_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0x00000000; + *((int *)&__m128_op1[3]) = 0x00000000; + *((int *)&__m128_op1[2]) = 0x00000000; + *((int *)&__m128_op1[1]) = 0x00000000; + *((int *)&__m128_op1[0]) = 0x00000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcvt_h_s (__m128_op0, __m128_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0xffffffff; + *((int *)&__m128_op0[2]) = 0xfffffffc; + *((int *)&__m128_op0[1]) = 0xffffffff; + *((int *)&__m128_op0[0]) = 0xfffffffc; + *((int *)&__m128_op1[3]) = 0x00000001; + *((int *)&__m128_op1[2]) = 0x00000000; + *((int *)&__m128_op1[1]) = 0x00000000; + *((int *)&__m128_op1[0]) = 0x00000103; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcvt_h_s (__m128_op0, __m128_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000800000000000; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000; + *((int *)&__m128_result[3]) = 0x00000000; + *((int *)&__m128_result[2]) = 0x00000000; + *((int *)&__m128_result[1]) = 0x00000000; + *((int *)&__m128_result[0]) = 0x00000000; + __m128_out = __lsx_vfcvt_s_d (__m128d_op0, __m128d_op1); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000; + *((int *)&__m128_result[3]) = 0x00000000; + *((int *)&__m128_result[2]) = 0x00000000; + *((int *)&__m128_result[1]) = 0x00000000; + *((int *)&__m128_result[0]) = 0x00000000; + __m128_out = __lsx_vfcvt_s_d (__m128d_op0, __m128d_op1); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000; + *((int *)&__m128_result[3]) = 0x00000000; + *((int *)&__m128_result[2]) = 0x00000000; + *((int *)&__m128_result[1]) = 0x00000000; + *((int *)&__m128_result[0]) = 0x00000000; + __m128_out = __lsx_vfcvt_s_d (__m128d_op0, __m128d_op1); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x00000049000000c0; + *((unsigned long *)&__m128d_op0[0]) = 0x00000000ffffff29; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[0]) = 0x0000000100000000; + *((int *)&__m128_result[3]) = 0x00000000; + *((int *)&__m128_result[2]) = 0x00000000; + *((int *)&__m128_result[1]) = 0x00000000; + *((int *)&__m128_result[0]) = 0x00000000; + __m128_out = __lsx_vfcvt_s_d (__m128d_op0, __m128d_op1); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000; + *((int *)&__m128_result[3]) = 0x00000000; + *((int *)&__m128_result[2]) = 0x00000000; + *((int *)&__m128_result[1]) = 0x00000000; + *((int *)&__m128_result[0]) = 0x00000000; + __m128_out = __lsx_vfcvt_s_d (__m128d_op0, __m128d_op1); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[1]) = 0x7ff0000000000000; + *((unsigned long *)&__m128d_op1[0]) = 0x7ff0000000000000; + *((int *)&__m128_result[3]) = 0x00000000; + *((int *)&__m128_result[2]) = 0x00000000; + *((int *)&__m128_result[1]) = 0x7f800000; + *((int *)&__m128_result[0]) = 0x7f800000; + __m128_out = __lsx_vfcvt_s_d (__m128d_op0, __m128d_op1); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x000000002c002400; + *((unsigned long *)&__m128d_op1[1]) = 0x7ef400ad21fc7081; + *((unsigned long *)&__m128d_op1[0]) = 0x28bf0351ec69b5f2; + *((int *)&__m128_result[3]) = 0x00000000; + *((int *)&__m128_result[2]) = 0x00000000; + *((int *)&__m128_result[1]) = 0x7f800000; + *((int *)&__m128_result[0]) = 0x00000000; + __m128_out = __lsx_vfcvt_s_d (__m128d_op0, __m128d_op1); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x00000dc300003ffb; + *((unsigned long *)&__m128d_op0[0]) = 0x00000dc300003ffb; + *((unsigned long *)&__m128d_op1[1]) = 0x0000ffff3fbfffff; + *((unsigned long *)&__m128d_op1[0]) = 0x7fffffff7fffffff; + *((int *)&__m128_result[3]) = 0x00000000; + *((int *)&__m128_result[2]) = 0x00000000; + *((int *)&__m128_result[1]) = 0x00000000; + *((int *)&__m128_result[0]) = 0x7ffffffb; + __m128_out = __lsx_vfcvt_s_d (__m128d_op0, __m128d_op1); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((unsigned long *)&__m128d_op0[1]) = 0xbba0c07b51230d5c; + *((unsigned long *)&__m128d_op0[0]) = 0xa15f3f9e8763c2b9; + *((unsigned long *)&__m128d_op1[1]) = 0xbba0c07b51230d5c; + *((unsigned long *)&__m128d_op1[0]) = 0xa15f3f9e8763c2b9; + *((int *)&__m128_result[3]) = 0x9d0603db; + *((int *)&__m128_result[2]) = 0x80000000; + *((int *)&__m128_result[1]) = 0x9d0603db; + *((int *)&__m128_result[0]) = 0x80000000; + __m128_out = __lsx_vfcvt_s_d (__m128d_op0, __m128d_op1); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000005; + *((unsigned long *)&__m128d_op1[1]) = 0x8101010181010101; + *((unsigned long *)&__m128d_op1[0]) = 0x8101010181010101; + *((int *)&__m128_result[3]) = 0x00000000; + *((int *)&__m128_result[2]) = 0x00000000; + *((int *)&__m128_result[1]) = 0x80000000; + *((int *)&__m128_result[0]) = 0x80000000; + __m128_out = __lsx_vfcvt_s_d (__m128d_op0, __m128d_op1); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((unsigned long *)&__m128d_op0[1]) = 0xffc00000ff800000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128d_op1[0]) = 0xffffffffffffffff; + *((int *)&__m128_result[3]) = 0xff800000; + *((int *)&__m128_result[2]) = 0x00000000; + *((int *)&__m128_result[1]) = 0xffffffff; + *((int *)&__m128_result[0]) = 0xffffffff; + __m128_out = __lsx_vfcvt_s_d (__m128d_op0, __m128d_op1); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0xfffdfffe80008000; + *((unsigned long *)&__m128d_op1[1]) = 0x000000ff00000000; + *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000; + *((int *)&__m128_result[3]) = 0x00000000; + *((int *)&__m128_result[2]) = 0xffeffff4; + *((int *)&__m128_result[1]) = 0x00000000; + *((int *)&__m128_result[0]) = 0x00000000; + __m128_out = __lsx_vfcvt_s_d (__m128d_op0, __m128d_op1); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x7f8000007f800000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000; + *((int *)&__m128_result[3]) = 0x7f800000; + *((int *)&__m128_result[2]) = 0x00000000; + *((int *)&__m128_result[1]) = 0x00000000; + *((int *)&__m128_result[0]) = 0x00000000; + __m128_out = __lsx_vfcvt_s_d (__m128d_op0, __m128d_op1); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000090; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000090; + *((unsigned long *)&__m128d_op1[1]) = 0x004eff6200d2ff76; + *((unsigned long *)&__m128d_op1[0]) = 0xff70002800be00a0; + *((int *)&__m128_result[3]) = 0x00000000; + *((int *)&__m128_result[2]) = 0x00000000; + *((int *)&__m128_result[1]) = 0x00000000; + *((int *)&__m128_result[0]) = 0xff800000; + __m128_out = __lsx_vfcvt_s_d (__m128d_op0, __m128d_op1); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vffint-1.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vffint-1.c new file mode 100644 index 00000000000..85db95762e4 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vffint-1.c @@ -0,0 +1,161 @@ +/* { dg-do run } */ +/* { dg-options "-mlsx -w -fno-strict-aliasing" } */ +#include "../simd_correctness_check.h" +#include + +int +main () +{ + __m128i __m128i_op0, __m128i_op1, __m128i_op2, __m128i_out, __m128i_result; + __m128 __m128_op0, __m128_op1, __m128_op2, __m128_out, __m128_result; + __m128d __m128d_op0, __m128d_op1, __m128d_op2, __m128d_out, __m128d_result; + + int int_op0, int_op1, int_op2, int_out, int_result, i = 1, fail; + long int long_op0, long_op1, long_op2, lont_out, lont_result; + long int long_int_out, long_int_result; + unsigned int unsigned_int_out, unsigned_int_result; + unsigned long int unsigned_long_int_out, unsigned_long_int_result; + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000; + __m128d_out = __lsx_vffinth_d_w (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000; + __m128d_out = __lsx_vffinth_d_w (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000001f0a; + *((unsigned long *)&__m128d_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000; + __m128d_out = __lsx_vffinth_d_w (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x7fffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0x7fffffffffffffff; + *((unsigned long *)&__m128d_result[1]) = 0x41dfffffffc00000; + *((unsigned long *)&__m128d_result[0]) = 0xbff0000000000000; + __m128d_out = __lsx_vffinth_d_w (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + int_out = __lsx_vpickve2gr_w (__m128i_op0, 0x2); + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000003a24; + *((unsigned long *)&__m128i_op0[0]) = 0x003dbe88077c78c1; + *((unsigned long *)&__m128d_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[0]) = 0x40cd120000000000; + __m128d_out = __lsx_vffinth_d_w (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000; + __m128d_out = __lsx_vffinth_d_w (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000040; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000040; + *((unsigned long *)&__m128d_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[0]) = 0x4050000000000000; + __m128d_out = __lsx_vffinth_d_w (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0086000000040000; + *((unsigned long *)&__m128i_op0[0]) = 0x0082000000000007; + *((unsigned long *)&__m128d_result[1]) = 0x4160c00000000000; + *((unsigned long *)&__m128d_result[0]) = 0x4110000000000000; + __m128d_out = __lsx_vffinth_d_w (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000; + __m128d_out = __lsx_vffinth_d_w (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xff8000010f800000; + *((unsigned long *)&__m128d_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000; + __m128d_out = __lsx_vffinth_d_w (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000000051649b6; + *((unsigned long *)&__m128i_op0[0]) = 0x0000003e0000003f; + *((unsigned long *)&__m128d_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[0]) = 0x41945926d8000000; + __m128d_out = __lsx_vffinth_d_w (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000; + __m128d_out = __lsx_vffintl_d_w (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfe82fe0200000000; + *((unsigned long *)&__m128i_op0[0]) = 0xfe82fe0200000000; + *((unsigned long *)&__m128d_result[1]) = 0xc177d01fe0000000; + *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000; + __m128d_out = __lsx_vffintl_d_w (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000; + __m128d_out = __lsx_vffintl_d_w (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000100010001007c; + *((unsigned long *)&__m128i_op0[0]) = 0x0001000100010001; + *((unsigned long *)&__m128d_result[1]) = 0x40f0001000000000; + *((unsigned long *)&__m128d_result[0]) = 0x40f0001000000000; + __m128d_out = __lsx_vffintl_d_w (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000100013fa0; + *((unsigned long *)&__m128d_result[1]) = 0x3ff0000000000000; + *((unsigned long *)&__m128d_result[0]) = 0x40f3fa0000000000; + __m128d_out = __lsx_vffintl_d_w (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000fffe0001; + *((unsigned long *)&__m128d_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[0]) = 0xc0fffff000000000; + __m128d_out = __lsx_vffintl_d_w (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000; + __m128d_out = __lsx_vffintl_d_w (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000; + __m128d_out = __lsx_vffintl_d_w (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000; + __m128d_out = __lsx_vffintl_d_w (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vffint-2.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vffint-2.c new file mode 100644 index 00000000000..f8839cfcd7b --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vffint-2.c @@ -0,0 +1,264 @@ +/* { dg-do run } */ +/* { dg-options "-mlsx -w -fno-strict-aliasing" } */ +#include "../simd_correctness_check.h" +#include + +int +main () +{ + __m128i __m128i_op0, __m128i_op1, __m128i_op2, __m128i_out, __m128i_result; + __m128 __m128_op0, __m128_op1, __m128_op2, __m128_out, __m128_result; + __m128d __m128d_op0, __m128d_op1, __m128d_op2, __m128d_out, __m128d_result; + + int int_op0, int_op1, int_op2, int_out, int_result, i = 1, fail; + long int long_op0, long_op1, long_op2, lont_out, lont_result; + long int long_int_out, long_int_result; + unsigned int unsigned_int_out, unsigned_int_result; + unsigned long int unsigned_long_int_out, unsigned_long_int_result; + + *((unsigned long *)&__m128i_op0[1]) = 0x03ff03ff03ff03ff; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[1]) = 0x438ff81ff81ff820; + *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000; + __m128d_out = __lsx_vffint_d_l (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x4f8000004f800000; + *((unsigned long *)&__m128i_op0[0]) = 0x4f8000004f800000; + *((unsigned long *)&__m128d_result[1]) = 0x43d3e0000013e000; + *((unsigned long *)&__m128d_result[0]) = 0x43d3e0000013e000; + __m128d_out = __lsx_vffint_d_l (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000; + __m128d_out = __lsx_vffint_d_l (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000; + __m128d_out = __lsx_vffint_d_l (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128d_result[1]) = 0xbff0000000000000; + *((unsigned long *)&__m128d_result[0]) = 0xbff0000000000000; + __m128d_out = __lsx_vffint_d_l (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0674c8868a74fc80; + *((unsigned long *)&__m128i_op0[0]) = 0xfdce8003090b0906; + *((unsigned long *)&__m128d_result[1]) = 0x4399d3221a29d3f2; + *((unsigned long *)&__m128d_result[0]) = 0xc3818bffe7b7a7b8; + __m128d_out = __lsx_vffint_d_l (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00ff00ff00ff00ff; + *((unsigned long *)&__m128i_op0[0]) = 0x00ff00ff00ff00ff; + *((int *)&__m128_result[3]) = 0x4b7f00ff; + *((int *)&__m128_result[2]) = 0x4b7f00ff; + *((int *)&__m128_result[1]) = 0x4b7f00ff; + *((int *)&__m128_result[0]) = 0x4b7f00ff; + __m128_out = __lsx_vffint_s_w (__m128i_op0); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000401000001; + *((unsigned long *)&__m128i_op0[0]) = 0x0001000100000004; + *((int *)&__m128_result[3]) = 0x40800000; + *((int *)&__m128_result[2]) = 0x4b800000; + *((int *)&__m128_result[1]) = 0x47800080; + *((int *)&__m128_result[0]) = 0x40800000; + __m128_out = __lsx_vffint_s_w (__m128i_op0); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000800000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((int *)&__m128_result[3]) = 0x47000000; + *((int *)&__m128_result[2]) = 0x00000000; + *((int *)&__m128_result[1]) = 0x00000000; + *((int *)&__m128_result[0]) = 0x00000000; + __m128_out = __lsx_vffint_s_w (__m128i_op0); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_op0[0]) = 0x76f424887fffffff; + *((int *)&__m128_result[3]) = 0x00000000; + *((int *)&__m128_result[2]) = 0x3f800000; + *((int *)&__m128_result[1]) = 0x4eede849; + *((int *)&__m128_result[0]) = 0x4f000000; + __m128_out = __lsx_vffint_s_w (__m128i_op0); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xd70b30c96ea9f4e8; + *((unsigned long *)&__m128i_op0[0]) = 0xa352bfac9269e0aa; + *((int *)&__m128_result[3]) = 0xce23d33d; + *((int *)&__m128_result[2]) = 0x4edd53ea; + *((int *)&__m128_result[1]) = 0xceb95a81; + *((int *)&__m128_result[0]) = 0xcedb2c3f; + __m128_out = __lsx_vffint_s_w (__m128i_op0); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((int *)&__m128_result[3]) = 0x00000000; + *((int *)&__m128_result[2]) = 0x3f800000; + *((int *)&__m128_result[1]) = 0x00000000; + *((int *)&__m128_result[0]) = 0x00000000; + __m128_out = __lsx_vffint_s_w (__m128i_op0); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((int *)&__m128_result[3]) = 0x00000000; + *((int *)&__m128_result[2]) = 0x00000000; + *((int *)&__m128_result[1]) = 0x00000000; + *((int *)&__m128_result[0]) = 0x00000000; + __m128_out = __lsx_vffint_s_w (__m128i_op0); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((int *)&__m128_result[3]) = 0x00000000; + *((int *)&__m128_result[2]) = 0x00000000; + *((int *)&__m128_result[1]) = 0x00000000; + *((int *)&__m128_result[0]) = 0x00000000; + __m128_out = __lsx_vffint_s_w (__m128i_op0); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000003ff8; + *((int *)&__m128_result[3]) = 0x00000000; + *((int *)&__m128_result[2]) = 0x00000000; + *((int *)&__m128_result[1]) = 0x00000000; + *((int *)&__m128_result[0]) = 0x467fe000; + __m128_out = __lsx_vffint_s_w (__m128i_op0); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffff80000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((int *)&__m128_result[3]) = 0xbf800000; + *((int *)&__m128_result[2]) = 0x00000000; + *((int *)&__m128_result[1]) = 0xcf000000; + *((int *)&__m128_result[0]) = 0x00000000; + __m128_out = __lsx_vffint_s_l (__m128i_op0, __m128i_op1); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((int *)&__m128_result[3]) = 0x00000000; + *((int *)&__m128_result[2]) = 0x00000000; + *((int *)&__m128_result[1]) = 0x00000000; + *((int *)&__m128_result[0]) = 0x00000000; + __m128_out = __lsx_vffint_s_l (__m128i_op0, __m128i_op1); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x7f8000007f800000; + *((unsigned long *)&__m128i_op0[0]) = 0x7f8000007f800000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((int *)&__m128_result[3]) = 0x5eff0000; + *((int *)&__m128_result[2]) = 0x5eff0000; + *((int *)&__m128_result[1]) = 0x00000000; + *((int *)&__m128_result[0]) = 0x00000000; + __m128_out = __lsx_vffint_s_l (__m128i_op0, __m128i_op1); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000000000000e3; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xfda9b23a624082fd; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000ffff0000; + *((int *)&__m128_result[3]) = 0x43630000; + *((int *)&__m128_result[2]) = 0x00000000; + *((int *)&__m128_result[1]) = 0xdc159371; + *((int *)&__m128_result[0]) = 0x4f7fff00; + __m128_out = __lsx_vffint_s_l (__m128i_op0, __m128i_op1); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((int *)&__m128_result[3]) = 0x00000000; + *((int *)&__m128_result[2]) = 0x00000000; + *((int *)&__m128_result[1]) = 0x00000000; + *((int *)&__m128_result[0]) = 0x00000000; + __m128_out = __lsx_vffint_s_l (__m128i_op0, __m128i_op1); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((int *)&__m128_result[3]) = 0x00000000; + *((int *)&__m128_result[2]) = 0x00000000; + *((int *)&__m128_result[1]) = 0x00000000; + *((int *)&__m128_result[0]) = 0x00000000; + __m128_out = __lsx_vffint_s_l (__m128i_op0, __m128i_op1); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000040; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000040; + *((int *)&__m128_result[3]) = 0x00000000; + *((int *)&__m128_result[2]) = 0x00000000; + *((int *)&__m128_result[1]) = 0x42800000; + *((int *)&__m128_result[0]) = 0x42800000; + __m128_out = __lsx_vffint_s_l (__m128i_op0, __m128i_op1); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000100; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000100; + *((int *)&__m128_result[3]) = 0x00000000; + *((int *)&__m128_result[2]) = 0x00000000; + *((int *)&__m128_result[1]) = 0x43800000; + *((int *)&__m128_result[0]) = 0x43800000; + __m128_out = __lsx_vffint_s_l (__m128i_op0, __m128i_op1); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((int *)&__m128_result[3]) = 0x00000000; + *((int *)&__m128_result[2]) = 0x00000000; + *((int *)&__m128_result[1]) = 0x00000000; + *((int *)&__m128_result[0]) = 0x00000000; + __m128_out = __lsx_vffint_s_l (__m128i_op0, __m128i_op1); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x001effae001effae; + *((unsigned long *)&__m128i_op1[0]) = 0x001effae001effae; + *((int *)&__m128_result[3]) = 0x00000000; + *((int *)&__m128_result[2]) = 0x00000000; + *((int *)&__m128_result[1]) = 0x59f7fd70; + *((int *)&__m128_result[0]) = 0x59f7fd70; + __m128_out = __lsx_vffint_s_l (__m128i_op0, __m128i_op1); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000ffff0000ffff; + *((unsigned long *)&__m128i_op0[0]) = 0x0000ffff0000ffff; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x000ef0000000003b; + *((int *)&__m128_result[3]) = 0x577fff00; + *((int *)&__m128_result[2]) = 0x577fff00; + *((int *)&__m128_result[1]) = 0x00000000; + *((int *)&__m128_result[0]) = 0x596f0000; + __m128_out = __lsx_vffint_s_l (__m128i_op0, __m128i_op1); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vffint-3.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vffint-3.c new file mode 100644 index 00000000000..9150e27ca27 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vffint-3.c @@ -0,0 +1,102 @@ +/* { dg-do run } */ +/* { dg-options "-mlsx -w -fno-strict-aliasing" } */ +#include "../simd_correctness_check.h" +#include + +int +main () +{ + __m128i __m128i_op0, __m128i_op1, __m128i_op2, __m128i_out, __m128i_result; + __m128 __m128_op0, __m128_op1, __m128_op2, __m128_out, __m128_result; + __m128d __m128d_op0, __m128d_op1, __m128d_op2, __m128d_out, __m128d_result; + + int int_op0, int_op1, int_op2, int_out, int_result, i = 1, fail; + long int long_op0, long_op1, long_op2, lont_out, lont_result; + long int long_int_out, long_int_result; + unsigned int unsigned_int_out, unsigned_int_result; + unsigned long int unsigned_long_int_out, unsigned_long_int_result; + + *((unsigned long *)&__m128i_op0[1]) = 0x8493941335f5cc0c; + *((unsigned long *)&__m128i_op0[0]) = 0x625a7312befcb21e; + *((unsigned long *)&__m128d_result[1]) = 0x43e092728266beba; + *((unsigned long *)&__m128d_result[0]) = 0x43d8969cc4afbf2d; + __m128d_out = __lsx_vffint_d_lu (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000; + __m128d_out = __lsx_vffint_d_lu (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000; + __m128d_out = __lsx_vffint_d_lu (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000; + __m128d_out = __lsx_vffint_d_lu (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((int *)&__m128_result[3]) = 0x00000000; + *((int *)&__m128_result[2]) = 0x00000000; + *((int *)&__m128_result[1]) = 0x00000000; + *((int *)&__m128_result[0]) = 0x00000000; + __m128_out = __lsx_vffint_s_wu (__m128i_op0); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000001600000016; + *((unsigned long *)&__m128i_op0[0]) = 0x0000001600000016; + *((int *)&__m128_result[3]) = 0x41b00000; + *((int *)&__m128_result[2]) = 0x41b00000; + *((int *)&__m128_result[1]) = 0x41b00000; + *((int *)&__m128_result[0]) = 0x41b00000; + __m128_out = __lsx_vffint_s_wu (__m128i_op0); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((int *)&__m128_result[3]) = 0x4f800000; + *((int *)&__m128_result[2]) = 0x4f800000; + *((int *)&__m128_result[1]) = 0x4f800000; + *((int *)&__m128_result[0]) = 0x4f800000; + __m128_out = __lsx_vffint_s_wu (__m128i_op0); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000442800007b50; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffff0204; + *((int *)&__m128_result[3]) = 0x46885000; + *((int *)&__m128_result[2]) = 0x46f6a000; + *((int *)&__m128_result[1]) = 0x4f800000; + *((int *)&__m128_result[0]) = 0x4f7fff02; + __m128_out = __lsx_vffint_s_wu (__m128i_op0); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((int *)&__m128_result[3]) = 0x00000000; + *((int *)&__m128_result[2]) = 0x00000000; + *((int *)&__m128_result[1]) = 0x00000000; + *((int *)&__m128_result[0]) = 0x00000000; + __m128_out = __lsx_vffint_s_wu (__m128i_op0); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((int *)&__m128_result[3]) = 0x00000000; + *((int *)&__m128_result[2]) = 0x00000000; + *((int *)&__m128_result[1]) = 0x00000000; + *((int *)&__m128_result[0]) = 0x00000000; + __m128_out = __lsx_vffint_s_wu (__m128i_op0); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfrint_d.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfrint_d.c new file mode 100644 index 00000000000..c60ff2b466c --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfrint_d.c @@ -0,0 +1,230 @@ +/* { dg-do run } */ +/* { dg-options "-mlsx -w -fno-strict-aliasing" } */ +/* { dg-timeout 500 } */ +#include "../simd_correctness_check.h" +#include +int +main () +{ + __m128i __m128i_op0, __m128i_op1, __m128i_op2, __m128i_out, __m128i_result; + __m128 __m128_op0, __m128_op1, __m128_op2, __m128_out, __m128_result; + __m128d __m128d_op0, __m128d_op1, __m128d_op2, __m128d_out, __m128d_result; + + int int_op0, int_op1, int_op2, int_out, int_result, i = 1, fail; + long int long_op0, long_op1, long_op2, lont_out, lont_result; + long int long_int_out, long_int_result; + unsigned int unsigned_int_out, unsigned_int_result; + unsigned long int unsigned_long_int_out, unsigned_long_int_result; + + *((unsigned long *)&__m128d_op0[1]) = 0x0000ffff0000ffff; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000; + __m128d_out = __lsx_vfrint_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0003000300030003; + *((unsigned long *)&__m128d_op0[0]) = 0x0003000700020005; + *((unsigned long *)&__m128d_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000; + __m128d_out = __lsx_vfrint_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x7fff7fff7fff7fff; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[1]) = 0x7fff7fff7fff7fff; + *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000; + __m128d_out = __lsx_vfrint_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x7ff0000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x7ff0000000000000; + *((unsigned long *)&__m128d_result[1]) = 0x7ff0000000000000; + *((unsigned long *)&__m128d_result[0]) = 0x7ff0000000000000; + __m128d_out = __lsx_vfrint_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x00ff000100ff00fe; + *((unsigned long *)&__m128d_op0[0]) = 0x00ff003000ff00a0; + *((unsigned long *)&__m128d_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000; + __m128d_out = __lsx_vfrint_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0xfd200ed2fd370775; + *((unsigned long *)&__m128d_op0[0]) = 0x96198318780e32c5; + *((unsigned long *)&__m128d_result[1]) = 0xfd200ed2fd370775; + *((unsigned long *)&__m128d_result[0]) = 0x8000000000000000; + __m128d_out = __lsx_vfrint_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000; + __m128d_out = __lsx_vfrintrne_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0xe0404041e0404041; + *((unsigned long *)&__m128d_op0[0]) = 0xe0404041e0404041; + *((unsigned long *)&__m128d_result[1]) = 0xe0404041e0404041; + *((unsigned long *)&__m128d_result[0]) = 0xe0404041e0404041; + __m128d_out = __lsx_vfrintrne_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000080800000808; + *((unsigned long *)&__m128d_op0[0]) = 0x0000080800000808; + *((unsigned long *)&__m128d_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000; + __m128d_out = __lsx_vfrintrne_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128d_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128d_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128d_result[0]) = 0xffffffffffffffff; + __m128d_out = __lsx_vfrintrne_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000868686868686; + *((unsigned long *)&__m128d_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000; + __m128d_out = __lsx_vfrintrne_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000; + __m128d_out = __lsx_vfrintrp_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000002000; + *((unsigned long *)&__m128d_op0[0]) = 0xfffc002000000000; + *((unsigned long *)&__m128d_result[1]) = 0x3ff0000000000000; + *((unsigned long *)&__m128d_result[0]) = 0xfffc002000000000; + __m128d_out = __lsx_vfrintrp_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x9c9c9c9c00000000; + *((unsigned long *)&__m128d_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[0]) = 0x8000000000000000; + __m128d_out = __lsx_vfrintrp_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x00007fff00007fff; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[1]) = 0x3ff0000000000000; + *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000; + __m128d_out = __lsx_vfrintrp_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000007f00ff00ff; + *((unsigned long *)&__m128d_op0[0]) = 0x00ff00ff00ff00ff; + *((unsigned long *)&__m128d_result[1]) = 0x3ff0000000000000; + *((unsigned long *)&__m128d_result[0]) = 0x3ff0000000000000; + __m128d_out = __lsx_vfrintrp_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000077af9450; + *((unsigned long *)&__m128d_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[0]) = 0x3ff0000000000000; + __m128d_out = __lsx_vfrintrp_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0xff02ff1bff02ff23; + *((unsigned long *)&__m128d_op0[0]) = 0x0000ffffff02fff4; + *((unsigned long *)&__m128d_result[1]) = 0xff02ff1bff02ff23; + *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000; + __m128d_out = __lsx_vfrintrm_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000; + __m128d_out = __lsx_vfrintrm_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000001; + *((unsigned long *)&__m128d_op0[0]) = 0x6a57a30ff0000000; + *((unsigned long *)&__m128d_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[0]) = 0x6a57a30ff0000000; + __m128d_out = __lsx_vfrintrm_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000001300000013; + *((unsigned long *)&__m128d_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000; + __m128d_out = __lsx_vfrintrm_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128d_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128d_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128d_result[0]) = 0xffffffffffffffff; + __m128d_out = __lsx_vfrintrm_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0xffffffff02000000; + *((unsigned long *)&__m128d_op0[0]) = 0x1f81e3779b97f4a8; + *((unsigned long *)&__m128d_result[1]) = 0xffffffff02000000; + *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000; + __m128d_out = __lsx_vfrintrm_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0001000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0001000000000000; + *((unsigned long *)&__m128d_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000; + __m128d_out = __lsx_vfrintrm_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000; + __m128d_out = __lsx_vfrintrz_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x98ff98ff220e220d; + *((unsigned long *)&__m128d_op0[0]) = 0xa2e1a2601ff01ff0; + *((unsigned long *)&__m128d_result[1]) = 0x8000000000000000; + *((unsigned long *)&__m128d_result[0]) = 0x8000000000000000; + __m128d_out = __lsx_vfrintrz_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000004; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000; + __m128d_out = __lsx_vfrintrz_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x00000000abba7980; + *((unsigned long *)&__m128d_op0[0]) = 0x00000000ccf98000; + *((unsigned long *)&__m128d_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000; + __m128d_out = __lsx_vfrintrz_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0xfe3bfb01fe3bfe01; + *((unsigned long *)&__m128d_op0[0]) = 0xfe03fe3ffe01fa21; + *((unsigned long *)&__m128d_result[1]) = 0xfe3bfb01fe3bfe01; + *((unsigned long *)&__m128d_result[0]) = 0xfe03fe3ffe01fa21; + __m128d_out = __lsx_vfrintrz_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x5847b72626ce61ef; + *((unsigned long *)&__m128d_op0[0]) = 0x110053f401e7cced; + *((unsigned long *)&__m128d_result[1]) = 0x5847b72626ce61ef; + *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000; + __m128d_out = __lsx_vfrintrz_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfrint_s.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfrint_s.c new file mode 100644 index 00000000000..12cb02303e3 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfrint_s.c @@ -0,0 +1,350 @@ +/* { dg-do run } */ +/* { dg-options "-mlsx -w -fno-strict-aliasing" } */ +/* { dg-timeout 500 } */ +#include "../simd_correctness_check.h" +#include +int +main () +{ + __m128i __m128i_op0, __m128i_op1, __m128i_op2, __m128i_out, __m128i_result; + __m128 __m128_op0, __m128_op1, __m128_op2, __m128_out, __m128_result; + __m128d __m128d_op0, __m128d_op1, __m128d_op2, __m128d_out, __m128d_result; + + int int_op0, int_op1, int_op2, int_out, int_result, i = 1, fail; + long int long_op0, long_op1, long_op2, lont_out, lont_result; + long int long_int_out, long_int_result; + unsigned int unsigned_int_out, unsigned_int_result; + unsigned long int unsigned_long_int_out, unsigned_long_int_result; + + *((int *)&__m128_op0[3]) = 0x00100010; + *((int *)&__m128_op0[2]) = 0x00030000; + *((int *)&__m128_op0[1]) = 0x00060002; + *((int *)&__m128_op0[0]) = 0x00000000; + *((int *)&__m128_result[3]) = 0x00000000; + *((int *)&__m128_result[2]) = 0x00000000; + *((int *)&__m128_result[1]) = 0x00000000; + *((int *)&__m128_result[0]) = 0x00000000; + __m128_out = __lsx_vfrint_s (__m128_op0); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0x00000000; + *((int *)&__m128_result[3]) = 0x00000000; + *((int *)&__m128_result[2]) = 0x00000000; + *((int *)&__m128_result[1]) = 0x00000000; + *((int *)&__m128_result[0]) = 0x00000000; + __m128_out = __lsx_vfrint_s (__m128_op0); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((int *)&__m128_op0[3]) = 0x00000001; + *((int *)&__m128_op0[2]) = 0xca02f854; + *((int *)&__m128_op0[1]) = 0x00000001; + *((int *)&__m128_op0[0]) = 0x00013fa0; + *((int *)&__m128_result[3]) = 0x00000000; + *((int *)&__m128_result[2]) = 0xca02f854; + *((int *)&__m128_result[1]) = 0x00000000; + *((int *)&__m128_result[0]) = 0x00000000; + __m128_out = __lsx_vfrint_s (__m128_op0); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((int *)&__m128_op0[3]) = 0x000000ad; + *((int *)&__m128_op0[2]) = 0x00007081; + *((int *)&__m128_op0[1]) = 0x00000351; + *((int *)&__m128_op0[0]) = 0x0000b5f2; + *((int *)&__m128_result[3]) = 0x00000000; + *((int *)&__m128_result[2]) = 0x00000000; + *((int *)&__m128_result[1]) = 0x00000000; + *((int *)&__m128_result[0]) = 0x00000000; + __m128_out = __lsx_vfrint_s (__m128_op0); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((int *)&__m128_op0[3]) = 0x00ff00ef; + *((int *)&__m128_op0[2]) = 0x00ff010f; + *((int *)&__m128_op0[1]) = 0x00ff00ff; + *((int *)&__m128_op0[0]) = 0x00ff010f; + *((int *)&__m128_result[3]) = 0x00000000; + *((int *)&__m128_result[2]) = 0x00000000; + *((int *)&__m128_result[1]) = 0x00000000; + *((int *)&__m128_result[0]) = 0x00000000; + __m128_out = __lsx_vfrint_s (__m128_op0); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0x00000000; + *((int *)&__m128_result[3]) = 0x00000000; + *((int *)&__m128_result[2]) = 0x00000000; + *((int *)&__m128_result[1]) = 0x00000000; + *((int *)&__m128_result[0]) = 0x00000000; + __m128_out = __lsx_vfrintrne_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128_result, __m128_out); + + *((int *)&__m128_op0[3]) = 0x00130013; + *((int *)&__m128_op0[2]) = 0x00130013; + *((int *)&__m128_op0[1]) = 0x00130013; + *((int *)&__m128_op0[0]) = 0x00130013; + *((int *)&__m128_result[3]) = 0x00000000; + *((int *)&__m128_result[2]) = 0x00000000; + *((int *)&__m128_result[1]) = 0x00000000; + *((int *)&__m128_result[0]) = 0x00000000; + __m128_out = __lsx_vfrintrne_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128_result, __m128_out); + + *((int *)&__m128_op0[3]) = 0x20202020; + *((int *)&__m128_op0[2]) = 0x20202020; + *((int *)&__m128_op0[1]) = 0x20202020; + *((int *)&__m128_op0[0]) = 0x20207fff; + *((int *)&__m128_result[3]) = 0x00000000; + *((int *)&__m128_result[2]) = 0x00000000; + *((int *)&__m128_result[1]) = 0x00000000; + *((int *)&__m128_result[0]) = 0x00000000; + __m128_out = __lsx_vfrintrne_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128_result, __m128_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0x01f50000; + *((int *)&__m128_result[3]) = 0x00000000; + *((int *)&__m128_result[2]) = 0x00000000; + *((int *)&__m128_result[1]) = 0x00000000; + *((int *)&__m128_result[0]) = 0x00000000; + __m128_out = __lsx_vfrintrne_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128_result, __m128_out); + + *((int *)&__m128_op0[3]) = 0xffffffff; + *((int *)&__m128_op0[2]) = 0xffffffff; + *((int *)&__m128_op0[1]) = 0xffffffff; + *((int *)&__m128_op0[0]) = 0xffffffff; + *((int *)&__m128_result[3]) = 0xffffffff; + *((int *)&__m128_result[2]) = 0xffffffff; + *((int *)&__m128_result[1]) = 0xffffffff; + *((int *)&__m128_result[0]) = 0xffffffff; + __m128_out = __lsx_vfrintrne_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128_result, __m128_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x00000001; + *((int *)&__m128_op0[1]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0x00000001; + *((int *)&__m128_result[3]) = 0x00000000; + *((int *)&__m128_result[2]) = 0x00000000; + *((int *)&__m128_result[1]) = 0x00000000; + *((int *)&__m128_result[0]) = 0x00000000; + __m128_out = __lsx_vfrintrne_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128_result, __m128_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0x00020004; + *((int *)&__m128_op0[0]) = 0x00000001; + *((int *)&__m128_result[3]) = 0x00000000; + *((int *)&__m128_result[2]) = 0x00000000; + *((int *)&__m128_result[1]) = 0x00000000; + *((int *)&__m128_result[0]) = 0x00000000; + __m128_out = __lsx_vfrintrne_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128_result, __m128_out); + + *((int *)&__m128_op0[3]) = 0xfffbfffb; + *((int *)&__m128_op0[2]) = 0xfffbfffb; + *((int *)&__m128_op0[1]) = 0xfffbfffb; + *((int *)&__m128_op0[0]) = 0xfffbfffb; + *((int *)&__m128_result[3]) = 0xfffbfffb; + *((int *)&__m128_result[2]) = 0xfffbfffb; + *((int *)&__m128_result[1]) = 0xfffbfffb; + *((int *)&__m128_result[0]) = 0xfffbfffb; + __m128_out = __lsx_vfrintrne_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128_result, __m128_out); + + *((int *)&__m128_op0[3]) = 0x0ff780a1; + *((int *)&__m128_op0[2]) = 0x0efc01af; + *((int *)&__m128_op0[1]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0xfe7f0000; + *((int *)&__m128_result[3]) = 0x00000000; + *((int *)&__m128_result[2]) = 0x00000000; + *((int *)&__m128_result[1]) = 0x00000000; + *((int *)&__m128_result[0]) = 0xfe7f0000; + __m128_out = __lsx_vfrintrne_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128_result, __m128_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0x00000000; + *((int *)&__m128_result[3]) = 0x00000000; + *((int *)&__m128_result[2]) = 0x00000000; + *((int *)&__m128_result[1]) = 0x00000000; + *((int *)&__m128_result[0]) = 0x00000000; + __m128_out = __lsx_vfrintrp_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128_result, __m128_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0xefffffff; + *((int *)&__m128_op0[1]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0x00000000; + *((int *)&__m128_result[3]) = 0x00000000; + *((int *)&__m128_result[2]) = 0xefffffff; + *((int *)&__m128_result[1]) = 0x00000000; + *((int *)&__m128_result[0]) = 0x00000000; + __m128_out = __lsx_vfrintrp_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128_result, __m128_out); + + *((int *)&__m128_op0[3]) = 0xffffffff; + *((int *)&__m128_op0[2]) = 0xffffff00; + *((int *)&__m128_op0[1]) = 0xffffffff; + *((int *)&__m128_op0[0]) = 0xffffff00; + *((int *)&__m128_result[3]) = 0xffffffff; + *((int *)&__m128_result[2]) = 0xffffff00; + *((int *)&__m128_result[1]) = 0xffffffff; + *((int *)&__m128_result[0]) = 0xffffff00; + __m128_out = __lsx_vfrintrp_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128_result, __m128_out); + + *((int *)&__m128_op0[3]) = 0xffffb96b; + *((int *)&__m128_op0[2]) = 0xffff57c9; + *((int *)&__m128_op0[1]) = 0xffff6080; + *((int *)&__m128_op0[0]) = 0xffff4417; + *((int *)&__m128_result[3]) = 0xffffb96b; + *((int *)&__m128_result[2]) = 0xffff57c9; + *((int *)&__m128_result[1]) = 0xffff6080; + *((int *)&__m128_result[0]) = 0xffff4417; + __m128_out = __lsx_vfrintrp_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128_result, __m128_out); + + *((int *)&__m128_op0[3]) = 0x00ff00ff; + *((int *)&__m128_op0[2]) = 0x00ff00ff; + *((int *)&__m128_op0[1]) = 0x62cbf96e; + *((int *)&__m128_op0[0]) = 0x4acfaf40; + *((int *)&__m128_result[3]) = 0x3f800000; + *((int *)&__m128_result[2]) = 0x3f800000; + *((int *)&__m128_result[1]) = 0x62cbf96e; + *((int *)&__m128_result[0]) = 0x4acfaf40; + __m128_out = __lsx_vfrintrp_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128_result, __m128_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x00002000; + *((int *)&__m128_op0[1]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0x1fe02000; + *((int *)&__m128_result[3]) = 0x00000000; + *((int *)&__m128_result[2]) = 0x3f800000; + *((int *)&__m128_result[1]) = 0x00000000; + *((int *)&__m128_result[0]) = 0x3f800000; + __m128_out = __lsx_vfrintrp_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128_result, __m128_out); + + *((int *)&__m128_op0[3]) = 0xffffffff; + *((int *)&__m128_op0[2]) = 0xffffffff; + *((int *)&__m128_op0[1]) = 0xffffffff; + *((int *)&__m128_op0[0]) = 0xffffffff; + *((int *)&__m128_result[3]) = 0xffffffff; + *((int *)&__m128_result[2]) = 0xffffffff; + *((int *)&__m128_result[1]) = 0xffffffff; + *((int *)&__m128_result[0]) = 0xffffffff; + __m128_out = __lsx_vfrintrp_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128_result, __m128_out); + + *((int *)&__m128_op0[3]) = 0x63636363; + *((int *)&__m128_op0[2]) = 0x63abdf16; + *((int *)&__m128_op0[1]) = 0x41f8e080; + *((int *)&__m128_op0[0]) = 0x16161198; + *((int *)&__m128_result[3]) = 0x63636363; + *((int *)&__m128_result[2]) = 0x63abdf16; + *((int *)&__m128_result[1]) = 0x42000000; + *((int *)&__m128_result[0]) = 0x3f800000; + __m128_out = __lsx_vfrintrp_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128_result, __m128_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0x00000000; + *((int *)&__m128_result[3]) = 0x00000000; + *((int *)&__m128_result[2]) = 0x00000000; + *((int *)&__m128_result[1]) = 0x00000000; + *((int *)&__m128_result[0]) = 0x00000000; + __m128_out = __lsx_vfrintrm_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128_result, __m128_out); + + *((int *)&__m128_op0[3]) = 0xa5c4c774; + *((int *)&__m128_op0[2]) = 0x856ba83b; + *((int *)&__m128_op0[1]) = 0x8003caef; + *((int *)&__m128_op0[0]) = 0x54691124; + *((int *)&__m128_result[3]) = 0xbf800000; + *((int *)&__m128_result[2]) = 0xbf800000; + *((int *)&__m128_result[1]) = 0xbf800000; + *((int *)&__m128_result[0]) = 0x54691124; + __m128_out = __lsx_vfrintrm_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128_result, __m128_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x00010002; + *((int *)&__m128_op0[1]) = 0xffffffff; + *((int *)&__m128_op0[0]) = 0xff960015; + *((int *)&__m128_result[3]) = 0x00000000; + *((int *)&__m128_result[2]) = 0x00000000; + *((int *)&__m128_result[1]) = 0xffffffff; + *((int *)&__m128_result[0]) = 0xffd60015; + __m128_out = __lsx_vfrintrm_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128_result, __m128_out); + + *((int *)&__m128_op0[3]) = 0xffffffff; + *((int *)&__m128_op0[2]) = 0x3c992b2e; + *((int *)&__m128_op0[1]) = 0xffffffff; + *((int *)&__m128_op0[0]) = 0xffff730f; + *((int *)&__m128_result[3]) = 0xffffffff; + *((int *)&__m128_result[2]) = 0x00000000; + *((int *)&__m128_result[1]) = 0xffffffff; + *((int *)&__m128_result[0]) = 0xffff730f; + __m128_out = __lsx_vfrintrz_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128_result, __m128_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x00000001; + *((int *)&__m128_op0[1]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0x00000016; + *((int *)&__m128_result[3]) = 0x00000000; + *((int *)&__m128_result[2]) = 0x00000000; + *((int *)&__m128_result[1]) = 0x00000000; + *((int *)&__m128_result[0]) = 0x00000000; + __m128_out = __lsx_vfrintrz_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128_result, __m128_out); + + *((int *)&__m128_op0[3]) = 0x18171615; + *((int *)&__m128_op0[2]) = 0x17161514; + *((int *)&__m128_op0[1]) = 0x16151413; + *((int *)&__m128_op0[0]) = 0x15141312; + *((int *)&__m128_result[3]) = 0x00000000; + *((int *)&__m128_result[2]) = 0x00000000; + *((int *)&__m128_result[1]) = 0x00000000; + *((int *)&__m128_result[0]) = 0x00000000; + __m128_out = __lsx_vfrintrz_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128_result, __m128_out); + + *((int *)&__m128_op0[3]) = 0x62cbf96e; + *((int *)&__m128_op0[2]) = 0x4acfaf40; + *((int *)&__m128_op0[1]) = 0xf0bc9a52; + *((int *)&__m128_op0[0]) = 0x78285a4a; + *((int *)&__m128_result[3]) = 0x62cbf96e; + *((int *)&__m128_result[2]) = 0x4acfaf40; + *((int *)&__m128_result[1]) = 0xf0bc9a52; + *((int *)&__m128_result[0]) = 0x78285a4a; + __m128_out = __lsx_vfrintrz_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128_result, __m128_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0x00000000; + *((int *)&__m128_result[3]) = 0x00000000; + *((int *)&__m128_result[2]) = 0x00000000; + *((int *)&__m128_result[1]) = 0x00000000; + *((int *)&__m128_result[0]) = 0x00000000; + __m128_out = __lsx_vfrintrz_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128_result, __m128_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vftint-1.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vftint-1.c new file mode 100644 index 00000000000..8d0d56632ab --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vftint-1.c @@ -0,0 +1,349 @@ +/* { dg-do run } */ +/* { dg-options "-mlsx -w -fno-strict-aliasing" } */ +#include "../simd_correctness_check.h" +#include + +int +main () +{ + __m128i __m128i_op0, __m128i_op1, __m128i_op2, __m128i_out, __m128i_result; + __m128 __m128_op0, __m128_op1, __m128_op2, __m128_out, __m128_result; + __m128d __m128d_op0, __m128d_op1, __m128d_op2, __m128d_out, __m128d_result; + + int int_op0, int_op1, int_op2, int_out, int_result, i = 1, fail; + long int long_op0, long_op1, long_op2, lont_out, lont_result; + long int long_int_out, long_int_result; + unsigned int unsigned_int_out, unsigned_int_result; + unsigned long int unsigned_long_int_out, unsigned_long_int_result; + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftint_l_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x000000017fff9000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000210011084; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftint_l_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftint_l_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftint_l_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftint_l_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x000000000000040d; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftint_l_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0008000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x00ff000000ff0000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftint_l_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x004f1fcfd01f9f9f; + *((unsigned long *)&__m128d_op0[0]) = 0x9f4fcfcfcf800000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftint_l_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0001000100010001; + *((unsigned long *)&__m128d_op0[0]) = 0x0001000100010001; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftint_l_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x9c7c266e3faa293c; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftint_l_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x00007fff00007fff; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrne_l_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x000000ffffffffff; + *((unsigned long *)&__m128d_op0[0]) = 0xffffff0000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrne_l_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrne_l_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrne_l_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrne_l_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrne_l_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrne_l_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000015d926c7; + *((unsigned long *)&__m128d_op0[0]) = 0x000000000000e41b; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000001; + __m128i_out = __lsx_vftintrp_l_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrp_l_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrp_l_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000777777777777; + *((unsigned long *)&__m128d_op0[0]) = 0xffff7777ffff7777; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrp_l_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000001; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000001; + __m128i_out = __lsx_vftintrp_l_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrp_l_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000100000001; + *((unsigned long *)&__m128d_op0[0]) = 0x0000004000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrm_l_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128d_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrm_l_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0080000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0xf4b6f3f52f4ef4a8; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x8000000000000000; + __m128i_out = __lsx_vftintrm_l_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrm_l_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128d_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrm_l_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0101010101010101; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrm_l_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000001; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrm_l_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrm_l_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrm_l_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrm_l_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0xff80ffffffffff80; + *((unsigned long *)&__m128d_op0[0]) = 0x0000ff80ffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x8000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrm_l_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrm_l_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrm_l_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrz_l_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrz_l_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrz_l_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x00000000b5207f80; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrz_l_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrz_l_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128d_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrz_l_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0xffff007f00000000; + *((unsigned long *)&__m128d_op0[0]) = 0xffff007f00000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrz_l_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0xbff0000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0xc0f3fa0080000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xfffffffffffec060; + __m128i_out = __lsx_vftintrz_l_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrz_l_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrz_l_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000ebd20000714f; + *((unsigned long *)&__m128d_op0[0]) = 0x00012c8a0000a58a; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrz_l_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vftint-2.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vftint-2.c new file mode 100644 index 00000000000..5dba807f694 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vftint-2.c @@ -0,0 +1,695 @@ +/* { dg-do run } */ +/* { dg-options "-mlsx -w -fno-strict-aliasing" } */ +#include "../simd_correctness_check.h" +#include + +int +main () +{ + __m128i __m128i_op0, __m128i_op1, __m128i_op2, __m128i_out, __m128i_result; + __m128 __m128_op0, __m128_op1, __m128_op2, __m128_out, __m128_result; + __m128d __m128d_op0, __m128d_op1, __m128d_op2, __m128d_out, __m128d_result; + + int int_op0, int_op1, int_op2, int_out, int_result, i = 1, fail; + long int long_op0, long_op1, long_op2, lont_out, lont_result; + long int long_int_out, long_int_result; + unsigned int unsigned_int_out, unsigned_int_result; + unsigned long int unsigned_long_int_out, unsigned_long_int_result; + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0x00000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintl_l_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x00d4ccb8; + *((int *)&__m128_op0[1]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0x00124888; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintl_l_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0x00000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintl_l_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0xfff00000; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0xfff00000; + *((int *)&__m128_op0[0]) = 0x00000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintl_l_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0x00000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintl_l_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x80000000; + *((int *)&__m128_op0[2]) = 0xffffd860; + *((int *)&__m128_op0[1]) = 0x7fffffff; + *((int *)&__m128_op0[0]) = 0x80000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintl_l_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00008000; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0x00008000; + *((int *)&__m128_op0[0]) = 0x00000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintl_l_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0x00000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftinth_l_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0xff80ffff; + *((int *)&__m128_op0[2]) = 0xffffffff; + *((int *)&__m128_op0[1]) = 0x7ffffffe; + *((int *)&__m128_op0[0]) = 0xffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftinth_l_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0x4f804f80; + *((int *)&__m128_op0[0]) = 0x4f804f80; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftinth_l_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x0000007b; + *((int *)&__m128_op0[1]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0x00000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftinth_l_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0x00000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftinth_l_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0x00000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftinth_l_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00000600; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0x00000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftinth_l_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0xffffffff; + *((int *)&__m128_op0[2]) = 0xffffffff; + *((int *)&__m128_op0[1]) = 0xffffffff; + *((int *)&__m128_op0[0]) = 0xffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftinth_l_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x3f800000; + *((int *)&__m128_op0[1]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0x00000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000001; + __m128i_out = __lsx_vftinth_l_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0x04870ba0; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftinth_l_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0x00009c7c; + *((int *)&__m128_op0[0]) = 0x00007176; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftinth_l_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0xffffffff; + *((int *)&__m128_op0[2]) = 0xffffffff; + *((int *)&__m128_op0[1]) = 0xffffffff; + *((int *)&__m128_op0[0]) = 0xffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftinth_l_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0x00000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftinth_l_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x0667ae56; + *((int *)&__m128_op0[1]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0x00000020; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftinth_l_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0x00000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrnel_l_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0xffffffff; + *((int *)&__m128_op0[2]) = 0xffffffff; + *((int *)&__m128_op0[1]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0x00000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrnel_l_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x887c8beb; + *((int *)&__m128_op0[2]) = 0x969e00f2; + *((int *)&__m128_op0[1]) = 0x101f8b68; + *((int *)&__m128_op0[0]) = 0x0b6f8095; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrnel_l_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00020000; + *((int *)&__m128_op0[2]) = 0x00020000; + *((int *)&__m128_op0[1]) = 0x000001fc; + *((int *)&__m128_op0[0]) = 0x00000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrnel_l_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0x00000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrnel_l_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0x00000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrnel_l_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0x00000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrnel_l_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0x00020000; + *((int *)&__m128_op0[0]) = 0xffff0001; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrnel_l_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x0a752a55; + *((int *)&__m128_op0[1]) = 0x0a753500; + *((int *)&__m128_op0[0]) = 0xa9fa0d06; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrnel_l_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0xffffffff; + *((int *)&__m128_op0[1]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0x00000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrpl_l_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x7fffffff; + *((int *)&__m128_op0[2]) = 0x7fffffff; + *((int *)&__m128_op0[1]) = 0x7fffffff; + *((int *)&__m128_op0[0]) = 0x00000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrpl_l_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x000d0254; + *((int *)&__m128_op0[2]) = 0x0000007e; + *((int *)&__m128_op0[1]) = 0x00000014; + *((int *)&__m128_op0[0]) = 0x00140014; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000001; + __m128i_out = __lsx_vftintrpl_l_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0x00000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrpl_l_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0x39412488; + *((int *)&__m128_op0[0]) = 0x80000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrpl_l_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0x00000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrpl_l_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x00000014; + *((int *)&__m128_op0[1]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0x00000014; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000001; + __m128i_out = __lsx_vftintrpl_l_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00010001; + *((int *)&__m128_op0[2]) = 0x00010001; + *((int *)&__m128_op0[1]) = 0x00010001; + *((int *)&__m128_op0[0]) = 0x00010001; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000001; + __m128i_out = __lsx_vftintrpl_l_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0x00000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrpl_l_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0x00000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrpl_l_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0x2e34594c; + *((int *)&__m128_op0[0]) = 0x3b000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000001; + __m128i_out = __lsx_vftintrpl_l_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0x00000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrml_l_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0x00000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrml_l_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0xffffffff; + *((int *)&__m128_op0[2]) = 0xffffffff; + *((int *)&__m128_op0[1]) = 0x7ffffffe; + *((int *)&__m128_op0[0]) = 0xffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrml_l_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00010001; + *((int *)&__m128_op0[2]) = 0x00010001; + *((int *)&__m128_op0[1]) = 0x00010001; + *((int *)&__m128_op0[0]) = 0x00010001; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrml_l_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x7ff000ff; + *((int *)&__m128_op0[1]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0x00000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrml_l_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0x00000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrml_l_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x00ff00ff; + *((int *)&__m128_op0[1]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0x00000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrzl_l_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0x00000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrzl_l_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0x00000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrzl_l_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0x00000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrzl_l_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0xfffefffe; + *((int *)&__m128_op0[2]) = 0xfffeffff; + *((int *)&__m128_op0[1]) = 0xfffefffe; + *((int *)&__m128_op0[0]) = 0xfffeffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrzl_l_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0x00000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrzl_l_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x0000033a; + *((int *)&__m128_op0[2]) = 0x0bde0853; + *((int *)&__m128_op0[1]) = 0x0a960e6b; + *((int *)&__m128_op0[0]) = 0x0a4f0000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrzl_l_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0xffffffff; + *((int *)&__m128_op0[2]) = 0xffffffff; + *((int *)&__m128_op0[1]) = 0x7ffffffe; + *((int *)&__m128_op0[0]) = 0xffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrneh_l_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0xfffffffe; + *((int *)&__m128_op0[0]) = 0x00000001; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrneh_l_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0xffffffff; + *((int *)&__m128_op0[2]) = 0xffffffff; + *((int *)&__m128_op0[1]) = 0xffffffff; + *((int *)&__m128_op0[0]) = 0xffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrneh_l_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00000001; + *((int *)&__m128_op0[2]) = 0x7ffeffff; + *((int *)&__m128_op0[1]) = 0x00000001; + *((int *)&__m128_op0[0]) = 0x7ffeffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrneh_l_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0x00000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrneh_l_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0xffffffff; + *((int *)&__m128_op0[2]) = 0xffffffff; + *((int *)&__m128_op0[1]) = 0xffffffff; + *((int *)&__m128_op0[0]) = 0xffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrneh_l_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0x80808080; + *((int *)&__m128_op0[0]) = 0x80638063; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrph_l_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0x00000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrph_l_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x00000080; + *((int *)&__m128_op0[1]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0x00000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000001; + __m128i_out = __lsx_vftintrph_l_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0x00000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrph_l_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x80000000; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0x00000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrmh_l_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0x00000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrmh_l_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00ff00ff; + *((int *)&__m128_op0[2]) = 0x00ff00ff; + *((int *)&__m128_op0[1]) = 0x62cbf96e; + *((int *)&__m128_op0[0]) = 0x4acfaf40; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrmh_l_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0xffffffff; + *((int *)&__m128_op0[2]) = 0x0000ac26; + *((int *)&__m128_op0[1]) = 0x00ff0000; + *((int *)&__m128_op0[0]) = 0x00000001; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrmh_l_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x6420e020; + *((int *)&__m128_op0[2]) = 0x8400c4e3; + *((int *)&__m128_op0[1]) = 0x20c4e0c4; + *((int *)&__m128_op0[0]) = 0xe0da6499; + *((unsigned long *)&__m128i_result[1]) = 0x7fffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrzh_l_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0xfbffffff; + *((int *)&__m128_op0[2]) = 0xffffffff; + *((int *)&__m128_op0[1]) = 0x7bffffff; + *((int *)&__m128_op0[0]) = 0xffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x8000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrzh_l_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x18171615; + *((int *)&__m128_op0[2]) = 0x17161514; + *((int *)&__m128_op0[1]) = 0x16151413; + *((int *)&__m128_op0[0]) = 0x15141312; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrzh_l_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0xffffffff; + *((int *)&__m128_op0[0]) = 0xffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrzh_l_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0x046a09ec; + *((int *)&__m128_op0[0]) = 0x009c0000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrzh_l_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0xffffffff; + *((int *)&__m128_op0[2]) = 0xffffffff; + *((int *)&__m128_op0[1]) = 0xffffffff; + *((int *)&__m128_op0[0]) = 0xffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrzh_l_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x4f4f4f4f; + *((int *)&__m128_op0[2]) = 0x4f4f4f4f; + *((int *)&__m128_op0[1]) = 0x4f4f4f4f; + *((int *)&__m128_op0[0]) = 0x4f4f4f4f; + *((unsigned long *)&__m128i_result[1]) = 0x00000000cf4f4f00; + *((unsigned long *)&__m128i_result[0]) = 0x00000000cf4f4f00; + __m128i_out = __lsx_vftintrzh_l_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vftint-3.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vftint-3.c new file mode 100644 index 00000000000..7f6d2f4d1ad --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vftint-3.c @@ -0,0 +1,1028 @@ +/* { dg-do run } */ +/* { dg-options "-mlsx -w -fno-strict-aliasing" } */ +#include "../simd_correctness_check.h" +#include + +int +main () +{ + __m128i __m128i_op0, __m128i_op1, __m128i_op2, __m128i_out, __m128i_result; + __m128 __m128_op0, __m128_op1, __m128_op2, __m128_out, __m128_result; + __m128d __m128d_op0, __m128d_op1, __m128d_op2, __m128d_out, __m128d_result; + + int int_op0, int_op1, int_op2, int_out, int_result, i = 1, fail; + long int long_op0, long_op1, long_op2, lont_out, lont_result; + long int long_int_out, long_int_result; + unsigned int unsigned_int_out, unsigned_int_result; + unsigned long int unsigned_long_int_out, unsigned_long_int_result; + + *((unsigned long *)&__m128d_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128d_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftint_w_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[1]) = 0x52527d7d52527d7d; + *((unsigned long *)&__m128d_op1[0]) = 0x52527d7d52527d7d; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x7fffffff7fffffff; + __m128i_out = __lsx_vftint_w_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x0000ffff; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0x0000ffff; + *((int *)&__m128_op0[0]) = 0x0000ffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftint_w_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00000001; + *((int *)&__m128_op0[2]) = 0xfffffffe; + *((int *)&__m128_op0[1]) = 0x00000001; + *((int *)&__m128_op0[0]) = 0xfffffffe; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftint_w_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x00040100; + *((int *)&__m128_op0[1]) = 0x00010001; + *((int *)&__m128_op0[0]) = 0x00010000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftint_w_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0x0000ffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftint_w_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftint_w_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[1]) = 0xffffffff00000000; + *((unsigned long *)&__m128d_op1[0]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftint_w_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0xfffffffffffff800; + *((unsigned long *)&__m128d_op0[0]) = 0x8000000080000000; + *((unsigned long *)&__m128d_op1[1]) = 0xffffffff00000080; + *((unsigned long *)&__m128d_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftint_w_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00000001; + *((int *)&__m128_op0[2]) = 0xfffffffe; + *((int *)&__m128_op0[1]) = 0x00000001; + *((int *)&__m128_op0[0]) = 0xfffffffe; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftint_w_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000e0180000e810; + *((unsigned long *)&__m128d_op0[0]) = 0x0000f0080000f800; + *((unsigned long *)&__m128d_op1[1]) = 0x0000e0180000e810; + *((unsigned long *)&__m128d_op1[0]) = 0x0000f0080000f800; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftint_w_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0xffd30000; + *((int *)&__m128_op0[2]) = 0x00130000; + *((int *)&__m128_op0[1]) = 0xffd30000; + *((int *)&__m128_op0[0]) = 0x00130000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftint_w_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[0]) = 0x7ff8000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftint_w_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0xe1000000; + *((int *)&__m128_op0[2]) = 0x4deb2610; + *((int *)&__m128_op0[1]) = 0xe101e001; + *((int *)&__m128_op0[0]) = 0x4dec4089; + *((unsigned long *)&__m128i_result[1]) = 0x800000001d64c200; + *((unsigned long *)&__m128i_result[0]) = 0x800000001d881120; + __m128i_out = __lsx_vftint_w_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[1]) = 0x0000ffffffffffff; + *((unsigned long *)&__m128d_op1[0]) = 0x0000ffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftint_w_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftint_w_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0x76f42488; + *((int *)&__m128_op0[0]) = 0x80000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x7fffffff00000000; + __m128i_out = __lsx_vftint_w_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0x0000001f; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftint_w_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftint_w_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128d_op1[0]) = 0x9c9c9c9c9c9c9c9c; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftint_w_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0202f5f80000ff00; + *((unsigned long *)&__m128d_op1[1]) = 0x00000000ffffffff; + *((unsigned long *)&__m128d_op1[0]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftint_w_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x003fffc0; + *((int *)&__m128_op0[2]) = 0xffc0003f; + *((int *)&__m128_op0[1]) = 0xffc0ffc0; + *((int *)&__m128_op0[0]) = 0x003f003f; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftint_w_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0xffffff7fffffffff; + *((unsigned long *)&__m128d_op0[0]) = 0xffffff8000000000; + *((unsigned long *)&__m128d_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrne_w_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0x42652524; + *((int *)&__m128_op0[0]) = 0x00000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000003900000000; + __m128i_out = __lsx_vftintrne_w_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0xff00ff7f; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0x00000000; + *((unsigned long *)&__m128i_result[1]) = 0x8000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrne_w_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrne_w_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0xffffffff; + *((int *)&__m128_op0[2]) = 0x7f800000; + *((int *)&__m128_op0[1]) = 0x2d1da85b; + *((int *)&__m128_op0[0]) = 0x7f800000; + *((unsigned long *)&__m128i_result[1]) = 0x000000007fffffff; + *((unsigned long *)&__m128i_result[0]) = 0x000000007fffffff; + __m128i_out = __lsx_vftintrne_w_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[1]) = 0x7f8000007f800000; + *((unsigned long *)&__m128d_op1[0]) = 0x7f8000007f800000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x7fffffff7fffffff; + __m128i_out = __lsx_vftintrne_w_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrne_w_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x80307028; + *((int *)&__m128_op0[2]) = 0xffffffff; + *((int *)&__m128_op0[1]) = 0x8040007f; + *((int *)&__m128_op0[0]) = 0xffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrne_w_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrne_w_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0xffffffff; + *((int *)&__m128_op0[0]) = 0xffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrne_w_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x00000000fefefe6a; + *((unsigned long *)&__m128d_op0[0]) = 0x00000000c2bac2c2; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrne_w_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x000000002bfd9461; + *((unsigned long *)&__m128d_op1[1]) = 0x000000004fc04f81; + *((unsigned long *)&__m128d_op1[0]) = 0x000000004fc04f80; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrne_w_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrne_w_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x000000000000001f; + *((unsigned long *)&__m128d_op0[0]) = 0x000000000000001f; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrne_w_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000003a0000003a; + *((unsigned long *)&__m128d_op1[1]) = 0x37c0001000000000; + *((unsigned long *)&__m128d_op1[0]) = 0x37c0001000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrne_w_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000068; + *((unsigned long *)&__m128d_op1[1]) = 0x6363636363636363; + *((unsigned long *)&__m128d_op1[0]) = 0x6363636363636363; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x7fffffff7fffffff; + __m128i_out = __lsx_vftintrne_w_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0x00000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrne_w_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x4429146a7b4c88b2; + *((unsigned long *)&__m128d_op0[0]) = 0xe22b3595efa4aa0c; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x7fffffff80000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrne_w_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0x00000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrne_w_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0001000000000000; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[0]) = 0x0000000400000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrne_w_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x00000000fffffff5; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000001; + *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrne_w_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x7fffffff7fffffff; + *((unsigned long *)&__m128d_op0[0]) = 0x7fffffff7fffffff; + *((unsigned long *)&__m128d_op1[1]) = 0xe7e5560400010001; + *((unsigned long *)&__m128d_op1[0]) = 0xe7e5dabf00010001; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x8000000080000000; + __m128i_out = __lsx_vftintrne_w_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0x00000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrne_w_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x03050302; + *((int *)&__m128_op0[1]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0x03010302; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrne_w_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000600007fff; + *((unsigned long *)&__m128d_op0[0]) = 0x00000008ffffa209; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[0]) = 0x046a09ec009c0000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrne_w_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x000aa822; + *((int *)&__m128_op0[2]) = 0xa79308f6; + *((int *)&__m128_op0[1]) = 0x03aa355e; + *((int *)&__m128_op0[0]) = 0x1d37b5a1; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrne_w_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0xffffff00; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0xffffffff; + *((int *)&__m128_op0[0]) = 0xffff0000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrne_w_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0x00000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrne_w_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0x00001802; + *((int *)&__m128_op0[0]) = 0x041b0013; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000100000001; + __m128i_out = __lsx_vftintrp_w_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrp_w_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrp_w_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x004200a000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x004200a000200000; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000100000001; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrp_w_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000fe00ff; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[0]) = 0x0000ffff0000ffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000001; + __m128i_out = __lsx_vftintrp_w_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0001000100010001; + *((unsigned long *)&__m128d_op0[0]) = 0x0001000101fd01fe; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000100000001; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrp_w_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000c2f90000bafa; + *((unsigned long *)&__m128d_op1[1]) = 0x00000000ffffffff; + *((unsigned long *)&__m128d_op1[0]) = 0x00000000fffff800; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_result[0]) = 0x0000000100000001; + __m128i_out = __lsx_vftintrp_w_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0xff80ffff; + *((int *)&__m128_op0[2]) = 0xffffffff; + *((int *)&__m128_op0[1]) = 0x7ffffffe; + *((int *)&__m128_op0[0]) = 0xffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrp_w_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0101080408040804; + *((unsigned long *)&__m128d_op0[0]) = 0x0804080407040804; + *((unsigned long *)&__m128d_op1[1]) = 0x0101080408040804; + *((unsigned long *)&__m128d_op1[0]) = 0x0804080407040804; + *((unsigned long *)&__m128i_result[1]) = 0x0000000100000001; + *((unsigned long *)&__m128i_result[0]) = 0x0000000100000001; + __m128i_out = __lsx_vftintrp_w_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00010001; + *((int *)&__m128_op0[2]) = 0x00010001; + *((int *)&__m128_op0[1]) = 0x00010001; + *((int *)&__m128_op0[0]) = 0x00010001; + *((unsigned long *)&__m128i_result[1]) = 0x0000000100000001; + *((unsigned long *)&__m128i_result[0]) = 0x0000000100000001; + __m128i_out = __lsx_vftintrp_w_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrp_w_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x00000003ffda00f3; + *((unsigned long *)&__m128d_op0[0]) = 0x00000003ffda00f3; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000100000001; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrp_w_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0xfffffadf; + *((int *)&__m128_op0[2]) = 0xfedbfefe; + *((int *)&__m128_op0[1]) = 0x5f5f7bfe; + *((int *)&__m128_op0[0]) = 0xdefb5ada; + *((unsigned long *)&__m128i_result[1]) = 0x0000000080000000; + *((unsigned long *)&__m128i_result[0]) = 0x7fffffff80000000; + __m128i_out = __lsx_vftintrp_w_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0xffa6ff91fdd8ef77; + *((unsigned long *)&__m128d_op0[0]) = 0x061202bffb141c38; + *((unsigned long *)&__m128d_op1[1]) = 0xfefffffffed08f77; + *((unsigned long *)&__m128d_op1[0]) = 0x8160cdd2f365ed0d; + *((unsigned long *)&__m128i_result[1]) = 0x8000000000000001; + *((unsigned long *)&__m128i_result[0]) = 0x8000000000000000; + __m128i_out = __lsx_vftintrp_w_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00000001; + *((int *)&__m128_op0[2]) = 0x084314a6; + *((int *)&__m128_op0[1]) = 0x00000001; + *((int *)&__m128_op0[0]) = 0x084314a6; + *((unsigned long *)&__m128i_result[1]) = 0x0000000100000001; + *((unsigned long *)&__m128i_result[0]) = 0x0000000100000001; + __m128i_out = __lsx_vftintrp_w_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x3f413f4100000000; + *((unsigned long *)&__m128d_op0[0]) = 0x7f801fe000000000; + *((unsigned long *)&__m128d_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128d_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x000000017fffffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrp_w_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0x00000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrp_w_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrp_w_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrp_w_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0xfe3bfb01fe3bfe01; + *((unsigned long *)&__m128d_op0[0]) = 0xfe03fe3ffe01fa21; + *((unsigned long *)&__m128d_op1[1]) = 0xfe3bfb01fe3bfe01; + *((unsigned long *)&__m128d_op1[0]) = 0xfe03fe3ffe01fa21; + *((unsigned long *)&__m128i_result[1]) = 0x8000000080000000; + *((unsigned long *)&__m128i_result[0]) = 0x8000000080000000; + __m128i_out = __lsx_vftintrp_w_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x3a800000; + *((int *)&__m128_op0[2]) = 0x3a800000; + *((int *)&__m128_op0[1]) = 0x000ef000; + *((int *)&__m128_op0[0]) = 0x0000003b; + *((unsigned long *)&__m128i_result[1]) = 0x0000000100000001; + *((unsigned long *)&__m128i_result[0]) = 0x0000000100000001; + __m128i_out = __lsx_vftintrp_w_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x10404000; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0x09610001; + *((int *)&__m128_op0[0]) = 0x00000001; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrm_w_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrm_w_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0x00000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrm_w_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0x00000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrm_w_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x0000001a; + *((int *)&__m128_op0[2]) = 0xfffffff7; + *((int *)&__m128_op0[1]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0x00000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrm_w_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128d_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrm_w_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[1]) = 0x0800080008000800; + *((unsigned long *)&__m128d_op1[0]) = 0x0800080008000800; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrm_w_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x000000000202fe02; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000001; + *((unsigned long *)&__m128d_op1[0]) = 0xffff00fc0000ff02; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrm_w_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0x00000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrm_w_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00040004; + *((int *)&__m128_op0[2]) = 0x00040004; + *((int *)&__m128_op0[1]) = 0x00040004; + *((int *)&__m128_op0[0]) = 0x00040004; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrm_w_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0xffffffff; + *((int *)&__m128_op0[0]) = 0xffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrm_w_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00ffff00; + *((int *)&__m128_op0[2]) = 0xff00ff00; + *((int *)&__m128_op0[1]) = 0x00ffff00; + *((int *)&__m128_op0[0]) = 0xff00ff00; + *((unsigned long *)&__m128i_result[1]) = 0x0000000080000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000080000000; + __m128i_out = __lsx_vftintrm_w_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x013ec13e; + *((int *)&__m128_op0[1]) = 0xc03fc03f; + *((int *)&__m128_op0[0]) = 0xc0ff00ff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xfffffffdfffffff8; + __m128i_out = __lsx_vftintrm_w_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x7fffffff7ffffffb; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000000ff00ff; + *((unsigned long *)&__m128d_op1[0]) = 0x0000000000ff00ff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrm_w_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0x43800000; + *((int *)&__m128_op0[0]) = 0x43800000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000010000000100; + __m128i_out = __lsx_vftintrm_w_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x00000014; + *((int *)&__m128_op0[1]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0x00000014; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrm_w_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrm_w_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrm_w_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0x00000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrm_w_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0x00000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrz_w_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000017fda829; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrz_w_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[1]) = 0x8000000000000000; + *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrz_w_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0xffffffff; + *((int *)&__m128_op0[0]) = 0xfffffff7; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrz_w_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x80307028ffffffff; + *((unsigned long *)&__m128d_op0[0]) = 0x8040007fffffffff; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrz_w_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0xff84fff4; + *((int *)&__m128_op0[2]) = 0xff84fff4; + *((int *)&__m128_op0[1]) = 0xffffffff; + *((int *)&__m128_op0[0]) = 0xfffffff0; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrz_w_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0x00000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrz_w_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0x00000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrz_w_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[1]) = 0x7fff0007e215b122; + *((unsigned long *)&__m128d_op1[0]) = 0x7ffeffff7bfff828; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrz_w_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0x07ffc000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrz_w_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0xffffffff; + *((int *)&__m128_op0[1]) = 0xffff0000; + *((int *)&__m128_op0[0]) = 0x0000ffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrz_w_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000158; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000158; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrz_w_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrz_w_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0xffffffff; + *((int *)&__m128_op0[2]) = 0xffffffff; + *((int *)&__m128_op0[1]) = 0xffffffff; + *((int *)&__m128_op0[0]) = 0xffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrz_w_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0x00000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrz_w_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrz_w_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0xf039b8c0; + *((int *)&__m128_op0[2]) = 0xc61e81ef; + *((int *)&__m128_op0[1]) = 0x6db7da53; + *((int *)&__m128_op0[0]) = 0xfbd2e34b; + *((unsigned long *)&__m128i_result[1]) = 0x80000000ffffd860; + *((unsigned long *)&__m128i_result[0]) = 0x7fffffff80000000; + __m128i_out = __lsx_vftintrz_w_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0x00020000; + *((int *)&__m128_op0[0]) = 0xffff0001; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrz_w_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00027113; + *((int *)&__m128_op0[2]) = 0x50a27112; + *((int *)&__m128_op0[1]) = 0x00d57017; + *((int *)&__m128_op0[0]) = 0x94027113; + *((unsigned long *)&__m128i_result[1]) = 0x000000007fffffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrz_w_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0xff80ff80; + *((int *)&__m128_op0[2]) = 0x7e017f01; + *((int *)&__m128_op0[1]) = 0x7f3b7f3f; + *((int *)&__m128_op0[0]) = 0x7f3b7f21; + *((unsigned long *)&__m128i_result[1]) = 0x000000007fffffff; + *((unsigned long *)&__m128i_result[0]) = 0x7fffffff7fffffff; + __m128i_out = __lsx_vftintrz_w_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0xffffffffffffffee; + *((unsigned long *)&__m128d_op0[0]) = 0x00000000011ff040; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrz_w_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128d_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128d_op1[1]) = 0x00000000047fe2f0; + *((unsigned long *)&__m128d_op1[0]) = 0x00000000047fe2f0; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrz_w_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vftint-4.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vftint-4.c new file mode 100644 index 00000000000..9c5bb913134 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vftint-4.c @@ -0,0 +1,345 @@ +/* { dg-do run } */ +/* { dg-options "-mlsx -w -fno-strict-aliasing" } */ +#include "../simd_correctness_check.h" +#include + +int +main () +{ + __m128i __m128i_op0, __m128i_op1, __m128i_op2, __m128i_out, __m128i_result; + __m128 __m128_op0, __m128_op1, __m128_op2, __m128_out, __m128_result; + __m128d __m128d_op0, __m128d_op1, __m128d_op2, __m128d_out, __m128d_result; + + int int_op0, int_op1, int_op2, int_out, int_result, i = 1, fail; + long int long_op0, long_op1, long_op2, lont_out, lont_result; + long int long_int_out, long_int_result; + unsigned int unsigned_int_out, unsigned_int_result; + unsigned long int unsigned_long_int_out, unsigned_long_int_result; + + *((int *)&__m128_op0[3]) = 0x0000c77c; + *((int *)&__m128_op0[2]) = 0x000047cd; + *((int *)&__m128_op0[1]) = 0x0000c0f1; + *((int *)&__m128_op0[0]) = 0x00006549; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftint_wu_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0x00000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftint_wu_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0xffffffff; + *((int *)&__m128_op0[2]) = 0xffffffff; + *((int *)&__m128_op0[1]) = 0xffffffff; + *((int *)&__m128_op0[0]) = 0xffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftint_wu_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0x00000001; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftint_wu_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0xffffffff; + *((int *)&__m128_op0[0]) = 0xfffffff0; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftint_wu_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0xffffffff; + *((int *)&__m128_op0[2]) = 0x00000001; + *((int *)&__m128_op0[1]) = 0xffffffee; + *((int *)&__m128_op0[0]) = 0x00000004; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftint_wu_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x0000ffff; + *((int *)&__m128_op0[1]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0x00000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftint_wu_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0x00000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftint_wu_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x63636363; + *((int *)&__m128_op0[2]) = 0x63636363; + *((int *)&__m128_op0[1]) = 0x63636363; + *((int *)&__m128_op0[0]) = 0x63636363; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vftint_wu_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0xfffffffe; + *((int *)&__m128_op0[0]) = 0xffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrz_wu_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x02020004; + *((int *)&__m128_op0[2]) = 0x02020202; + *((int *)&__m128_op0[1]) = 0x00002000; + *((int *)&__m128_op0[0]) = 0x00010000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrz_wu_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x7fff7fff; + *((int *)&__m128_op0[2]) = 0x7fff7fff; + *((int *)&__m128_op0[1]) = 0x00000001; + *((int *)&__m128_op0[0]) = 0x0000003f; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrz_wu_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x000000ff; + *((int *)&__m128_op0[2]) = 0x808000ff; + *((int *)&__m128_op0[1]) = 0x000000ff; + *((int *)&__m128_op0[0]) = 0x808000ff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrz_wu_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x7f7f7f7f; + *((int *)&__m128_op0[1]) = 0x00000001; + *((int *)&__m128_op0[0]) = 0x00000010; + *((unsigned long *)&__m128i_result[1]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrz_wu_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0x00000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrz_wu_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00002000; + *((int *)&__m128_op0[2]) = 0x00002000; + *((int *)&__m128_op0[1]) = 0x10000000; + *((int *)&__m128_op0[0]) = 0x10000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrz_wu_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x00000001; + *((int *)&__m128_op0[1]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0x00000001; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrz_wu_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x67eb85af; + *((int *)&__m128_op0[2]) = 0xb2ebb000; + *((int *)&__m128_op0[1]) = 0xc8847ef6; + *((int *)&__m128_op0[0]) = 0xed3f2000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrz_wu_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0x00000001; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrz_wu_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000400000004000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000400000007004; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftint_lu_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftint_lu_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x3c600000ff800000; + *((unsigned long *)&__m128d_op0[0]) = 0xfffffffffffffffe; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftint_lu_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x6a57a30ff0000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vftint_lu_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftint_lu_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x40f0001000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x40f0001000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000010001; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000010001; + __m128i_out = __lsx_vftint_lu_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000005; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftint_lu_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000014; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000014; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftint_lu_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftint_lu_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x3a8000003a800000; + *((unsigned long *)&__m128d_op0[0]) = 0x000ef0000000003b; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftint_lu_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x000000009c83e21a; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000022001818; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftint_lu_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000800000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrz_lu_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrz_lu_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0080000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0080000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrz_lu_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrz_lu_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000001; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000001; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrz_lu_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x800000001d64c200; + *((unsigned long *)&__m128d_op0[0]) = 0x800000001d881120; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrz_lu_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x00000000f0009d3c; + *((unsigned long *)&__m128d_op0[0]) = 0x000000016fff9dff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrz_lu_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000040a04000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000040a04000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrz_lu_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x8000800080008000; + *((unsigned long *)&__m128d_op0[0]) = 0x8000800080008000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrz_lu_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrz_lu_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0001000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x03fc03fc03fc03fc; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vftintrz_lu_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} From patchwork Mon Sep 11 03:44:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: chenxiaolong X-Patchwork-Id: 137879 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ab0a:0:b0:3f2:4152:657d with SMTP id m10csp1858270vqo; Sun, 10 Sep 2023 20:50:56 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGeD8fr7q6lHUWQ5zlBXdg7sU2hrRauvupRPuwx0glXvptbLEW5EMWok83zAEc8VrZXH//y X-Received: by 2002:aa7:d5ce:0:b0:523:47cf:5034 with SMTP id d14-20020aa7d5ce000000b0052347cf5034mr7347972eds.34.1694404256270; Sun, 10 Sep 2023 20:50:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694404256; cv=none; d=google.com; s=arc-20160816; b=ED0H0opsOLhP7lghY19lhqFSUlw9YiNclTIejo2/u4QIRRhYgwhrDFOJSlyvKrQV6u j3j+6M8t7ylfIEIb5LEdiPdCx+ZPj4/SaVytMRHuiTFpjfdCExY3tyMGfYNqhuqIHFP5 ZKUPa7HEE1ufOTRTMYD3JhpGhfLN598HnaNXaBx9+axrx7XTiCa8iYgzzo7bNkcwMOZg qJmMt3mlPJq8VcKBMtRHozUlO9pju2HM/MSSzbcFF1HHUCUNW+Mkq7RB2b35gMw/DhdC d3vXqUxiroI0yaW4ZgNqPReG/Sud9Ti1xX/EumFMtDu40WVez3CJVDSqV3607BAgeEqR XRFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dmarc-filter:delivered-to; bh=nIReRXveJdFIBKQl/BShY+L7H8D3qOh36YE90Zqe2uU=; fh=BpFCyCzVJo4znJIvOjeDfKzcGsF6Q+JgJbJ+1ev/kM4=; b=XQMhOtRQN6mvpgjdh8hsZCOMNnYfdbNJzlbw0xaIxQ6zeJdBeDJFWfxZgipy0mwZS/ cRfvowKtQ8CUHnmbNBM1991kcG+lSHnTZXQkO3wUKO6N8sgcOCar0GM7Fbh2Yvv5J6Fu EHDBJnxkCDInK5/x+WdJ2wGtOUuhPO6XyhKpVsjqvejmQHuv87kZZrvFWbRdYUrl+BbS 4SON4mUUqv4gTa6DEnO5BcjUf1vRwp16E6/JXOvJtyLlpmgSieUX8bmmGQV1MfCwD4eN Om6fe3VkGF67VbsP9WFaDR/qiNlLFqGcJJCSflj31RYhffonwdJtrO9I2BF1QUcQq1Ny UreA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id p2-20020a056402074200b00522394947c9si6123491edy.632.2023.09.10.20.50.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 Sep 2023 20:50:56 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 830903896C0C for ; Mon, 11 Sep 2023 03:46:55 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by sourceware.org (Postfix) with ESMTP id 14BB63858423 for ; Mon, 11 Sep 2023 03:45:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 14BB63858423 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=loongson.cn Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=loongson.cn Received: from loongson.cn (unknown [10.10.130.252]) by gateway (Coremail) with SMTP id _____8AxEvBljf5k7kQkAA--.4797S3; Mon, 11 Sep 2023 11:45:41 +0800 (CST) Received: from slurm-master.loongson.cn (unknown [10.10.130.252]) by localhost.localdomain (Coremail) with SMTP id AQAAf8Dx_yNXjf5kzKZ2AA--.44820S9; Mon, 11 Sep 2023 11:45:39 +0800 (CST) From: Xiaolong Chen To: gcc-patches@gcc.gnu.org Subject: [PATCH v3 5/9] LoongArch:Add SX instructions for vector arithmetic addition operations. Date: Mon, 11 Sep 2023 11:44:35 +0800 Message-Id: <20230911034439.8266-6-chenxiaolong@loongson.cn> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230911034439.8266-1-chenxiaolong@loongson.cn> References: <20230911034439.8266-1-chenxiaolong@loongson.cn> MIME-Version: 1.0 X-CM-TRANSID: AQAAf8Dx_yNXjf5kzKZ2AA--.44820S9 X-CM-SenderInfo: hfkh05xldrz0tqj6z05rqj20fqof0/1tbiAQALBWT9QjYDnAAAs9 X-Coremail-Antispam: 1Uk129KBj97XoW8CF15uF45Gr48ZF45GoXrprW7urWDXoWUAa 4UZw4rCFZxX3W5Jw13Z343Kr1Yk3Z3Cr17Awn0yw4Dtr4Ivry7ZFsxtF1Utw1ayrW3Zw13 Xr4xJ348Ar1kl-sFpf9Il3svdjkaLaAFLSUrUUUUbb8apTn2vfkv8UJUUUU8wcxFpf9Il3 svdxBIdaVrn0xqx4xG64xvF2IEw4CE5I8CrVC2j2Jv73VFW2AGmfu7bjvjm3AaLaJ3UjIY CTnIWjp_UUUY87kC6x804xWl14x267AKxVWUJVW8JwAFc2x0x2IEx4CE42xK8VAvwI8IcI k0rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2ocxC64kIII0Yj41l84x0c7CEw4AK67xGY2AK 021l84ACjcxK6xIIjxv20xvE14v26ryj6F1UM28EF7xvwVC0I7IYx2IY6xkF7I0E14v26r 4j6F4UM28EF7xvwVC2z280aVAFwI0_Gr1j6F4UJwA2z4x0Y4vEx4A2jsIEc7CjxVAFwI0_ Gr1j6F4UJwAS0I0E0xvYzxvE52x082IY62kv0487Mc804VCY07AIYIkI8VC2zVCFFI0UMc 02F40EFcxC0VAKzVAqx4xG6I80ewAv7VC0I7IYx2IY67AKxVWUtVWrXwAv7VC2z280aVAF wI0_Gr0_Cr1lOx8S6xCaFVCjc4AY6r1j6r4UM4x0Y48IcxkI7VAKI48JMxAIw28IcxkI7V AKI48JMxC20s026xCaFVCjc4AY6r1j6r4UMI8I3I0E5I8CrVAFwI0_Jr0_Jr4lx2IqxVCj r7xvwVAFwI0_JrI_JrWlx4CE17CEb7AF67AKxVWUAVWUtwCIc40Y0x0EwIxGrwCI42IY6x IIjxv20xvE14v26r4j6ryUMIIF0xvE2Ix0cI8IcVCY1x0267AKxVW8JVWxJwCI42IY6xAI w20EY4v20xvaj40_Jr0_JF4lIxAIcVC2z280aVAFwI0_Gr0_Cr1lIxAIcVC2z280aVCY1x 0267AKxVW8JVW8JrUvcSsGvfC2KfnxnUUI43ZEXa7IU84xRDUUUUU== X-Spam-Status: No, score=-12.3 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, KAM_SHORT, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Xiaolong Chen , xuchenghua@loongson.cn, chenglulu@loongson.cn, i@xen0n.name Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1776711637218506345 X-GMAIL-MSGID: 1776711637218506345 gcc/testsuite/ChangeLog: * gcc.target/loongarch/vector/lsx/lsx-vadd.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vadda.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vaddi.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vaddwev-1.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vaddwev-2.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vaddwev-3.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vaddwod-1.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vaddwod-2.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vaddwod-3.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vhaddw-1.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vhaddw-2.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vmadd.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vmaddwev-1.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vmaddwev-2.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vmaddwev-3.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vmaddwod-1.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vmaddwod-2.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vmaddwod-3.c: New test. --- .../loongarch/vector/lsx/lsx-vadd.c | 416 +++++++++++++++ .../loongarch/vector/lsx/lsx-vadda.c | 344 ++++++++++++ .../loongarch/vector/lsx/lsx-vaddi.c | 251 +++++++++ .../loongarch/vector/lsx/lsx-vaddwev-1.c | 335 ++++++++++++ .../loongarch/vector/lsx/lsx-vaddwev-2.c | 344 ++++++++++++ .../loongarch/vector/lsx/lsx-vaddwev-3.c | 425 +++++++++++++++ .../loongarch/vector/lsx/lsx-vaddwod-1.c | 408 +++++++++++++++ .../loongarch/vector/lsx/lsx-vaddwod-2.c | 344 ++++++++++++ .../loongarch/vector/lsx/lsx-vaddwod-3.c | 237 +++++++++ .../loongarch/vector/lsx/lsx-vhaddw-1.c | 488 ++++++++++++++++++ .../loongarch/vector/lsx/lsx-vhaddw-2.c | 452 ++++++++++++++++ .../loongarch/vector/lsx/lsx-vmadd.c | 450 ++++++++++++++++ .../loongarch/vector/lsx/lsx-vmaddwev-1.c | 472 +++++++++++++++++ .../loongarch/vector/lsx/lsx-vmaddwev-2.c | 383 ++++++++++++++ .../loongarch/vector/lsx/lsx-vmaddwev-3.c | 383 ++++++++++++++ .../loongarch/vector/lsx/lsx-vmaddwod-1.c | 372 +++++++++++++ .../loongarch/vector/lsx/lsx-vmaddwod-2.c | 438 ++++++++++++++++ .../loongarch/vector/lsx/lsx-vmaddwod-3.c | 460 +++++++++++++++++ 18 files changed, 7002 insertions(+) create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vadd.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vadda.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vaddi.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vaddwev-1.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vaddwev-2.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vaddwev-3.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vaddwod-1.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vaddwod-2.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vaddwod-3.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vhaddw-1.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vhaddw-2.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmadd.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmaddwev-1.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmaddwev-2.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmaddwev-3.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmaddwod-1.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmaddwod-2.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmaddwod-3.c diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vadd.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vadd.c new file mode 100644 index 00000000000..7cfb989e4e6 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vadd.c @@ -0,0 +1,416 @@ +/* { dg-do run } */ +/* { dg-options "-mlsx -w -fno-strict-aliasing" } */ +#include "../simd_correctness_check.h" +#include + +int +main () +{ + __m128i __m128i_op0, __m128i_op1, __m128i_op2, __m128i_out, __m128i_result; + __m128 __m128_op0, __m128_op1, __m128_op2, __m128_out, __m128_result; + __m128d __m128d_op0, __m128d_op1, __m128d_op2, __m128d_out, __m128d_result; + + int int_op0, int_op1, int_op2, int_out, int_result, i = 1, fail; + long int long_op0, long_op1, long_op2, lont_out, lont_result; + long int long_int_out, long_int_result; + unsigned int unsigned_int_out, unsigned_int_result; + unsigned long int unsigned_long_int_out, unsigned_long_int_result; + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vadd_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000b0000000b; + *((unsigned long *)&__m128i_op0[0]) = 0x000201000000000b; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000fc0000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000b0000000b; + *((unsigned long *)&__m128i_result[0]) = 0x0002010000fc000b; + __m128i_out = __lsx_vadd_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000017fda829; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000017fda829; + __m128i_out = __lsx_vadd_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffff0000; + *((unsigned long *)&__m128i_op0[0]) = 0x000000000001fffe; + *((unsigned long *)&__m128i_op1[1]) = 0x7f7f7f7f00107f04; + *((unsigned long *)&__m128i_op1[0]) = 0x7f0000fd7f0000fd; + *((unsigned long *)&__m128i_result[1]) = 0x7e7e7e7eff0f7f04; + *((unsigned long *)&__m128i_result[0]) = 0x7f0000fd7f01fffb; + __m128i_out = __lsx_vadd_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vadd_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0080000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xf4b6f3f52f4ef4a8; + *((unsigned long *)&__m128i_op1[1]) = 0x195f307a5d04acbb; + *((unsigned long *)&__m128i_op1[0]) = 0x6a1a3fbb3c90260e; + *((unsigned long *)&__m128i_result[1]) = 0x19df307a5d04acbb; + *((unsigned long *)&__m128i_result[0]) = 0x5ed032b06bde1ab6; + __m128i_out = __lsx_vadd_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x5555001400005111; + *((unsigned long *)&__m128i_op0[0]) = 0xffabbeab55110140; + *((unsigned long *)&__m128i_op1[1]) = 0x5555001400005111; + *((unsigned long *)&__m128i_op1[0]) = 0xffabbeab55110140; + *((unsigned long *)&__m128i_result[1]) = 0xaaaa00280000a222; + *((unsigned long *)&__m128i_result[0]) = 0xfe567c56aa220280; + __m128i_out = __lsx_vadd_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xf51cf8dad6040188; + *((unsigned long *)&__m128i_op1[0]) = 0x0982e2daf234ed87; + *((unsigned long *)&__m128i_result[1]) = 0xf51cf8dad6040188; + *((unsigned long *)&__m128i_result[0]) = 0x0982e2daf234ed87; + __m128i_out = __lsx_vadd_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000000490000004d; + *((unsigned long *)&__m128i_op0[0]) = 0x00000001ffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000073; + *((unsigned long *)&__m128i_op1[0]) = 0x000000000000002a; + *((unsigned long *)&__m128i_result[1]) = 0x00000049000000c0; + *((unsigned long *)&__m128i_result[0]) = 0x00000001ffffff29; + __m128i_out = __lsx_vadd_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000000000000bd3d; + *((unsigned long *)&__m128i_op0[0]) = 0x000000007fff0000; + *((unsigned long *)&__m128i_op1[1]) = 0x000000000000bd30; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000d7fff0000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000007a6d; + *((unsigned long *)&__m128i_result[0]) = 0x0000000dfefe0000; + __m128i_out = __lsx_vadd_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfffd000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xfffd000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xfefa000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vadd_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0xfefefefefefefefe; + *((unsigned long *)&__m128i_result[0]) = 0xfefefefefefefefe; + __m128i_out = __lsx_vadd_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0038000000051fff; + *((unsigned long *)&__m128i_op0[0]) = 0x003c000000022021; + *((unsigned long *)&__m128i_op1[1]) = 0x7fff0101ffffe000; + *((unsigned long *)&__m128i_op1[0]) = 0x7fffffffa0204000; + *((unsigned long *)&__m128i_result[1]) = 0x7f370101ff04ffff; + *((unsigned long *)&__m128i_result[0]) = 0x7f3bffffa0226021; + __m128i_out = __lsx_vadd_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vadd_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vadd_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x1baf8eabd26bc629; + *((unsigned long *)&__m128i_op0[0]) = 0x1c2640b9a8e9fb49; + *((unsigned long *)&__m128i_op1[1]) = 0x0002dab8746acf8e; + *((unsigned long *)&__m128i_op1[0]) = 0x00036dd1c5c15856; + *((unsigned long *)&__m128i_result[1]) = 0x1bb1686346d595b7; + *((unsigned long *)&__m128i_result[0]) = 0x1c29ad8a6daa539f; + __m128i_out = __lsx_vadd_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vadd_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000003; + *((unsigned long *)&__m128i_op1[1]) = 0xfeffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xfeffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0xfeffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xfeffffffffff0002; + __m128i_out = __lsx_vadd_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000008; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000008; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vadd_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0001ffff00000000; + *((unsigned long *)&__m128i_op1[1]) = 0xff800000ff800000; + *((unsigned long *)&__m128i_op1[0]) = 0xff800000c3080000; + *((unsigned long *)&__m128i_result[1]) = 0xff800000ff800000; + *((unsigned long *)&__m128i_result[0]) = 0xff81ffffc3080000; + __m128i_out = __lsx_vadd_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x004200a000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x004200a000200001; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x004200a000000000; + *((unsigned long *)&__m128i_result[0]) = 0x004200a000200001; + __m128i_out = __lsx_vadd_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000001f0000001f; + *((unsigned long *)&__m128i_op1[0]) = 0x0000001f0000001f; + *((unsigned long *)&__m128i_result[1]) = 0x0000001f0000001f; + *((unsigned long *)&__m128i_result[0]) = 0x0000001f0000001f; + __m128i_out = __lsx_vadd_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x00ff00ff00ff00ff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00ff00ff00ff00ff; + __m128i_out = __lsx_vadd_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vadd_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0029aeaca57d74e6; + *((unsigned long *)&__m128i_op0[0]) = 0xdbe332365392c686; + *((unsigned long *)&__m128i_op1[1]) = 0x000056f64adb9464; + *((unsigned long *)&__m128i_op1[0]) = 0x29ca096f235819c2; + *((unsigned long *)&__m128i_result[1]) = 0x002a05a2f059094a; + *((unsigned long *)&__m128i_result[0]) = 0x05ad3ba576eae048; + __m128i_out = __lsx_vadd_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vadd_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000010; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000010; + __m128i_out = __lsx_vadd_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x000000000000000d; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000400; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x000000000000040d; + __m128i_out = __lsx_vadd_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000001300000013; + *((unsigned long *)&__m128i_op0[0]) = 0x0000001300000013; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000001300000013; + *((unsigned long *)&__m128i_result[0]) = 0x0000001300000013; + __m128i_out = __lsx_vadd_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vadd_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000100000100; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000100000100; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000100000100; + *((unsigned long *)&__m128i_result[0]) = 0x00000001000000ff; + __m128i_out = __lsx_vadd_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000300000001; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000100010001; + *((unsigned long *)&__m128i_op1[1]) = 0xfffffffffffffffa; + *((unsigned long *)&__m128i_op1[0]) = 0xfffffffffffffffa; + *((unsigned long *)&__m128i_result[1]) = 0x00000002fffffffb; + *((unsigned long *)&__m128i_result[0]) = 0x000000010000fffb; + __m128i_out = __lsx_vadd_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vadd_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vadd_q (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000000060000000e; + *((unsigned long *)&__m128i_op0[0]) = 0x0000001201fe01e9; + *((unsigned long *)&__m128i_op1[1]) = 0x000000060000000e; + *((unsigned long *)&__m128i_op1[0]) = 0x0000001201fe01e9; + *((unsigned long *)&__m128i_result[1]) = 0x0000000c0000001c; + *((unsigned long *)&__m128i_result[0]) = 0x0000002403fc03d2; + __m128i_out = __lsx_vadd_q (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0001000100010001; + *((unsigned long *)&__m128i_op0[0]) = 0x0001000100010001; + *((unsigned long *)&__m128i_op1[1]) = 0xfff0000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0xfff0000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xfff1000100010001; + *((unsigned long *)&__m128i_result[0]) = 0xfff1000100010001; + __m128i_out = __lsx_vadd_q (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xd70b30c96ea9f4e8; + *((unsigned long *)&__m128i_op1[0]) = 0xa352bfac9269e0aa; + *((unsigned long *)&__m128i_result[1]) = 0xd70b30c96ea9f4e8; + *((unsigned long *)&__m128i_result[0]) = 0xa352bfac9269e0aa; + __m128i_out = __lsx_vadd_q (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xfffffffffffffffa; + *((unsigned long *)&__m128i_op1[0]) = 0xfffffffffffffffa; + *((unsigned long *)&__m128i_result[1]) = 0xfffffffffffffffa; + *((unsigned long *)&__m128i_result[0]) = 0xfffffffffffffffa; + __m128i_out = __lsx_vadd_q (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0001001100110068; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0001001100110067; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vadd_q (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x379674c000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x3789f68000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x379674c000000000; + *((unsigned long *)&__m128i_result[0]) = 0x3789f68000000000; + __m128i_out = __lsx_vadd_q (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vadd_q (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000555889; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000002580f01; + *((unsigned long *)&__m128i_op1[1]) = 0x00060fbf02040fbf; + *((unsigned long *)&__m128i_op1[0]) = 0x00020fbf02000fbf; + *((unsigned long *)&__m128i_result[1]) = 0x00060fbf02596848; + *((unsigned long *)&__m128i_result[0]) = 0x00020fbf04581ec0; + __m128i_out = __lsx_vadd_q (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0001388928513889; + *((unsigned long *)&__m128i_op0[0]) = 0x006938094a013889; + *((unsigned long *)&__m128i_op1[1]) = 0x0001388928513889; + *((unsigned long *)&__m128i_op1[0]) = 0x006938094a013889; + *((unsigned long *)&__m128i_result[1]) = 0x0002711250a27112; + *((unsigned long *)&__m128i_result[0]) = 0x00d2701294027112; + __m128i_out = __lsx_vadd_q (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x001effae001effae; + *((unsigned long *)&__m128i_op0[0]) = 0x001effae001effae; + *((unsigned long *)&__m128i_op1[1]) = 0x2006454690d3de87; + *((unsigned long *)&__m128i_op1[0]) = 0x2006454690d3de87; + *((unsigned long *)&__m128i_result[1]) = 0x202544f490f2de35; + *((unsigned long *)&__m128i_result[0]) = 0x202544f490f2de35; + __m128i_out = __lsx_vadd_q (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vadda.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vadda.c new file mode 100644 index 00000000000..4bb699eab4a --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vadda.c @@ -0,0 +1,344 @@ +/* { dg-do run } */ +/* { dg-options "-mlsx -w -fno-strict-aliasing" } */ +#include "../simd_correctness_check.h" +#include + +int +main () +{ + __m128i __m128i_op0, __m128i_op1, __m128i_op2, __m128i_out, __m128i_result; + __m128 __m128_op0, __m128_op1, __m128_op2, __m128_out, __m128_result; + __m128d __m128d_op0, __m128d_op1, __m128d_op2, __m128d_out, __m128d_result; + + int int_op0, int_op1, int_op2, int_out, int_result, i = 1, fail; + long int long_op0, long_op1, long_op2, lont_out, lont_result; + long int long_int_out, long_int_result; + unsigned int unsigned_int_out, unsigned_int_result; + unsigned long int unsigned_long_int_out, unsigned_long_int_result; + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vadda_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vadda_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x52527d7d52527d7d; + *((unsigned long *)&__m128i_op1[0]) = 0x52527d7d52527d7d; + *((unsigned long *)&__m128i_result[1]) = 0x52527d7d52527d7d; + *((unsigned long *)&__m128i_result[0]) = 0x52527d7d52527d7d; + __m128i_out = __lsx_vadda_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x00000001fffc001f; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0101010202050120; + *((unsigned long *)&__m128i_result[0]) = 0x0101010102020202; + __m128i_out = __lsx_vadda_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0003000300030003; + *((unsigned long *)&__m128i_op0[0]) = 0x0003000700020005; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0003000300030003; + *((unsigned long *)&__m128i_result[0]) = 0x0003000700020005; + __m128i_out = __lsx_vadda_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0101010101010101; + *((unsigned long *)&__m128i_result[0]) = 0x0101010101010101; + __m128i_out = __lsx_vadda_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vadda_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x4f8000004f800000; + *((unsigned long *)&__m128i_op0[0]) = 0x4f8000004f800000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x4f8000004f800000; + *((unsigned long *)&__m128i_result[0]) = 0x4f8000004f800000; + __m128i_out = __lsx_vadda_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vadda_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xfffcfffcfffcfffc; + *((unsigned long *)&__m128i_op1[0]) = 0xfffcfffcfffcfffc; + *((unsigned long *)&__m128i_result[1]) = 0x0003000300030004; + *((unsigned long *)&__m128i_result[0]) = 0x0003000300030004; + __m128i_out = __lsx_vadda_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x5c9c9c9ce3636363; + *((unsigned long *)&__m128i_op0[0]) = 0x63635c9e63692363; + *((unsigned long *)&__m128i_op1[1]) = 0xf0fd800080000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000a00028004000; + *((unsigned long *)&__m128i_result[1]) = 0x6b9fe3649c9d6363; + *((unsigned long *)&__m128i_result[0]) = 0x6363bc9e8b696363; + __m128i_out = __lsx_vadda_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000100000001; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000100000001; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vadda_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vadda_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x1111111111111111; + *((unsigned long *)&__m128i_op0[0]) = 0x1111111111111111; + *((unsigned long *)&__m128i_op1[1]) = 0x0000002000000020; + *((unsigned long *)&__m128i_op1[0]) = 0x0000002000000020; + *((unsigned long *)&__m128i_result[1]) = 0x1111113111111131; + *((unsigned long *)&__m128i_result[0]) = 0x1111113111111131; + __m128i_out = __lsx_vadda_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000000006a9a5c; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000092444; + *((unsigned long *)&__m128i_op1[1]) = 0x00000000006a9a5c; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000092444; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000d4ccb8; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000124888; + __m128i_out = __lsx_vadda_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_op0[0]) = 0x76f424887fffffff; + *((unsigned long *)&__m128i_op1[1]) = 0xfff082f000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x003f000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x000f7d1000000001; + *((unsigned long *)&__m128i_result[0]) = 0x773324887fffffff; + __m128i_out = __lsx_vadda_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfffffacdb6dbecac; + *((unsigned long *)&__m128i_op0[0]) = 0x1f5533a694f902c0; + *((unsigned long *)&__m128i_op1[1]) = 0x5a6f5c53ebed3faa; + *((unsigned long *)&__m128i_op1[0]) = 0xa36aca4435b8b8e1; + *((unsigned long *)&__m128i_result[1]) = 0x5a6f61865d36d3aa; + *((unsigned long *)&__m128i_result[0]) = 0x7bea6962a0bfb621; + __m128i_out = __lsx_vadda_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000008140c80; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000008140c80; + __m128i_out = __lsx_vadda_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000fffe0000ff45; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffff000000b9; + *((unsigned long *)&__m128i_op1[1]) = 0xffd5002affffffff; + *((unsigned long *)&__m128i_op1[0]) = 0x343d8dc6b0ed5a08; + *((unsigned long *)&__m128i_result[1]) = 0x012b012c01010246; + *((unsigned long *)&__m128i_result[0]) = 0x353e743b50135a4f; + __m128i_out = __lsx_vadda_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0003c853c843c87e; + *((unsigned long *)&__m128i_op1[0]) = 0x0003c853c843c87e; + *((unsigned long *)&__m128i_result[1]) = 0x0003c853c843c87e; + *((unsigned long *)&__m128i_result[0]) = 0x0003c853c843c87e; + __m128i_out = __lsx_vadda_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000200000002000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffe000ffdf; + *((unsigned long *)&__m128i_result[1]) = 0x0000200000002001; + *((unsigned long *)&__m128i_result[0]) = 0x000000001fff0021; + __m128i_out = __lsx_vadda_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000008; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0101010101010109; + *((unsigned long *)&__m128i_result[0]) = 0x0101010101010101; + __m128i_out = __lsx_vadda_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000005452505; + *((unsigned long *)&__m128i_op0[0]) = 0x00000004442403e4; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000ffffffe0; + *((unsigned long *)&__m128i_result[1]) = 0x0000000005452505; + *((unsigned long *)&__m128i_result[0]) = 0x000000044525043c; + __m128i_out = __lsx_vadda_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x5d7f5d807fea807f; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x5d7f5d807fea807f; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xbafebb00ffd500fe; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vadda_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000208000002080; + *((unsigned long *)&__m128i_op0[0]) = 0x0000208000002080; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000208000002080; + *((unsigned long *)&__m128i_result[0]) = 0x0000208000002080; + __m128i_out = __lsx_vadda_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x8000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x8000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x8000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x8000000000000000; + __m128i_out = __lsx_vadda_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x7fff00007fff0000; + *((unsigned long *)&__m128i_op0[0]) = 0x7fff00007fff0000; + *((unsigned long *)&__m128i_op1[1]) = 0x003f0000003f0000; + *((unsigned long *)&__m128i_op1[0]) = 0x003f0000003f0000; + *((unsigned long *)&__m128i_result[1]) = 0x803e0000803e0000; + *((unsigned long *)&__m128i_result[0]) = 0x803e0000803e0000; + __m128i_out = __lsx_vadda_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000800000008000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000800000008000; + *((unsigned long *)&__m128i_result[1]) = 0x0000800000008000; + *((unsigned long *)&__m128i_result[0]) = 0x0000800000008000; + __m128i_out = __lsx_vadda_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000001400000014; + *((unsigned long *)&__m128i_op0[0]) = 0x0000001400000000; + *((unsigned long *)&__m128i_op1[1]) = 0xfff9000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0xfffc000400000000; + *((unsigned long *)&__m128i_result[1]) = 0x0007001400000014; + *((unsigned long *)&__m128i_result[0]) = 0x0004001000000000; + __m128i_out = __lsx_vadda_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x8080808080808080; + *((unsigned long *)&__m128i_op0[0]) = 0x8080808080808080; + *((unsigned long *)&__m128i_op1[1]) = 0x8080808080808080; + *((unsigned long *)&__m128i_op1[0]) = 0x8080808080808080; + *((unsigned long *)&__m128i_result[1]) = 0xfefeff00fefeff00; + *((unsigned long *)&__m128i_result[0]) = 0xfefeff00fefeff00; + __m128i_out = __lsx_vadda_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000008; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000008; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vadda_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000000084d12ce; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000024170000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000020300000; + *((unsigned long *)&__m128i_result[1]) = 0x00000000084d12ce; + *((unsigned long *)&__m128i_result[0]) = 0x0000000044470000; + __m128i_out = __lsx_vadda_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x6363636363636363; + *((unsigned long *)&__m128i_op0[0]) = 0x6363636363636363; + *((unsigned long *)&__m128i_op1[1]) = 0xff01ff01ac025c87; + *((unsigned long *)&__m128i_op1[0]) = 0xff01ff01ac465ca1; + *((unsigned long *)&__m128i_result[1]) = 0x64616462b76106dc; + *((unsigned long *)&__m128i_result[0]) = 0x64616462b71d06c2; + __m128i_out = __lsx_vadda_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffaeffaeffaeffae; + *((unsigned long *)&__m128i_op1[0]) = 0xffaeffaeffaeffae; + *((unsigned long *)&__m128i_result[1]) = 0x0051005200510052; + *((unsigned long *)&__m128i_result[0]) = 0x0051005200510052; + __m128i_out = __lsx_vadda_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x3a8000003a800000; + *((unsigned long *)&__m128i_op0[0]) = 0x3bc000003a800000; + *((unsigned long *)&__m128i_op1[1]) = 0x0a0000000a000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0a0000000a000000; + *((unsigned long *)&__m128i_result[1]) = 0x4480000044800000; + *((unsigned long *)&__m128i_result[0]) = 0x45c0000044800000; + __m128i_out = __lsx_vadda_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x6363636363636363; + *((unsigned long *)&__m128i_op0[0]) = 0x6363636363636363; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_result[1]) = 0x6363636363636363; + *((unsigned long *)&__m128i_result[0]) = 0x6363636463636363; + __m128i_out = __lsx_vadda_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vaddi.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vaddi.c new file mode 100644 index 00000000000..77afabe92fa --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vaddi.c @@ -0,0 +1,251 @@ +/* { dg-do run } */ +/* { dg-options "-mlsx -w -fno-strict-aliasing" } */ +#include "../simd_correctness_check.h" +#include + +int +main () +{ + __m128i __m128i_op0, __m128i_op1, __m128i_op2, __m128i_out, __m128i_result; + __m128 __m128_op0, __m128_op1, __m128_op2, __m128_out, __m128_result; + __m128d __m128d_op0, __m128d_op1, __m128d_op2, __m128d_out, __m128d_result; + + int int_op0, int_op1, int_op2, int_out, int_result, i = 1, fail; + long int long_op0, long_op1, long_op2, lont_out, lont_result; + long int long_int_out, long_int_result; + unsigned int unsigned_int_out, unsigned_int_result; + unsigned long int unsigned_long_int_out, unsigned_long_int_result; + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000001; + *((unsigned long *)&__m128i_result[1]) = 0x1414141414141415; + *((unsigned long *)&__m128i_result[0]) = 0x1414141414141415; + __m128i_out = __lsx_vaddi_bu (__m128i_op0, 0x14); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0505050505050505; + *((unsigned long *)&__m128i_result[0]) = 0x0505050504040404; + __m128i_out = __lsx_vaddi_bu (__m128i_op0, 0x5); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000008140c80; + *((unsigned long *)&__m128i_result[1]) = 0x1f1f1f1f1f1f1f1f; + *((unsigned long *)&__m128i_result[0]) = 0x1f1f1f1f27332b9f; + __m128i_out = __lsx_vaddi_bu (__m128i_op0, 0x1f); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000001; + *((unsigned long *)&__m128i_result[1]) = 0x0303030303030303; + *((unsigned long *)&__m128i_result[0]) = 0x0303030303030304; + __m128i_out = __lsx_vaddi_bu (__m128i_op0, 0x3); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x8080808080808080; + *((unsigned long *)&__m128i_op0[0]) = 0x8080808080808080; + *((unsigned long *)&__m128i_result[1]) = 0x8f8f8f8f8f8f8f8f; + *((unsigned long *)&__m128i_result[0]) = 0x8f8f8f8f8f8f8f8f; + __m128i_out = __lsx_vaddi_bu (__m128i_op0, 0xf); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0018001800180018; + *((unsigned long *)&__m128i_result[0]) = 0x0018001800180018; + __m128i_out = __lsx_vaddi_hu (__m128i_op0, 0x18); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000080000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000080000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0019081900190019; + *((unsigned long *)&__m128i_result[0]) = 0x0019081900190019; + __m128i_out = __lsx_vaddi_hu (__m128i_op0, 0x19); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x000a000a000a000a; + *((unsigned long *)&__m128i_result[0]) = 0x000a000a000a000a; + __m128i_out = __lsx_vaddi_hu (__m128i_op0, 0xa); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffc1000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000ff0000; + *((unsigned long *)&__m128i_result[1]) = 0xffcc000b000b000b; + *((unsigned long *)&__m128i_result[0]) = 0x000b000b010a000b; + __m128i_out = __lsx_vaddi_hu (__m128i_op0, 0xb); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x001f001f001f001f; + *((unsigned long *)&__m128i_result[0]) = 0x001f001f001f001f; + __m128i_out = __lsx_vaddi_hu (__m128i_op0, 0x1f); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x001c001c001c001c; + *((unsigned long *)&__m128i_result[0]) = 0x001c001c001c001c; + __m128i_out = __lsx_vaddi_hu (__m128i_op0, 0x1c); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x67eb85afb2ebb000; + *((unsigned long *)&__m128i_op0[0]) = 0xc8847ef6ed3f2000; + *((unsigned long *)&__m128i_result[1]) = 0x680485c8b304b019; + *((unsigned long *)&__m128i_result[0]) = 0xc89d7f0fed582019; + __m128i_out = __lsx_vaddi_hu (__m128i_op0, 0x19); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000a0000000a; + *((unsigned long *)&__m128i_result[0]) = 0x0000000a0000000a; + __m128i_out = __lsx_vaddi_wu (__m128i_op0, 0xa); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000001000001; + *((unsigned long *)&__m128i_op0[0]) = 0xffffe000ffff1fff; + *((unsigned long *)&__m128i_result[1]) = 0x000000090100000a; + *((unsigned long *)&__m128i_result[0]) = 0xffffe009ffff2008; + __m128i_out = __lsx_vaddi_wu (__m128i_op0, 0x9); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000200000002; + *((unsigned long *)&__m128i_result[0]) = 0x0000000300000003; + __m128i_out = __lsx_vaddi_wu (__m128i_op0, 0x3); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfc01fcfefc02fdf7; + *((unsigned long *)&__m128i_op0[0]) = 0xfe00fcfffe01fd01; + *((unsigned long *)&__m128i_result[1]) = 0xfc01fd13fc02fe0c; + *((unsigned long *)&__m128i_result[0]) = 0xfe00fd14fe01fd16; + __m128i_out = __lsx_vaddi_wu (__m128i_op0, 0x15); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000001300000013; + *((unsigned long *)&__m128i_result[0]) = 0x0000001300000013; + __m128i_out = __lsx_vaddi_wu (__m128i_op0, 0x13); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000000000000bd3d; + *((unsigned long *)&__m128i_op0[0]) = 0x000000007fff0000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000c0000bd49; + *((unsigned long *)&__m128i_result[0]) = 0x0000000c7fff000c; + __m128i_out = __lsx_vaddi_wu (__m128i_op0, 0xc); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000fffe0001; + *((unsigned long *)&__m128i_result[1]) = 0x0000000500000005; + *((unsigned long *)&__m128i_result[0]) = 0x00000005fffe0006; + __m128i_out = __lsx_vaddi_wu (__m128i_op0, 0x5); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000000fffffeff; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x00000009ffffff08; + *((unsigned long *)&__m128i_result[0]) = 0x0000000900000009; + __m128i_out = __lsx_vaddi_wu (__m128i_op0, 0x9); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x55aa55aa55aa55ab; + *((unsigned long *)&__m128i_op0[0]) = 0xaa55555655aaaaa8; + *((unsigned long *)&__m128i_result[1]) = 0x55aa55c355aa55c4; + *((unsigned long *)&__m128i_result[0]) = 0xaa55556f55aaaac1; + __m128i_out = __lsx_vaddi_wu (__m128i_op0, 0x19); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000020; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000040; + *((unsigned long *)&__m128i_result[1]) = 0x0000000e0000002e; + *((unsigned long *)&__m128i_result[0]) = 0x0000000e0000004e; + __m128i_out = __lsx_vaddi_wu (__m128i_op0, 0xe); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000400000004; + *((unsigned long *)&__m128i_result[0]) = 0x0000000400000004; + __m128i_out = __lsx_vaddi_wu (__m128i_op0, 0x4); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x003f0000ffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0x003f0000ffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x003f000400000003; + *((unsigned long *)&__m128i_result[0]) = 0x003f000400000003; + __m128i_out = __lsx_vaddi_wu (__m128i_op0, 0x4); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xff8000010f800000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000900000009; + *((unsigned long *)&__m128i_result[0]) = 0xff80000a0f800009; + __m128i_out = __lsx_vaddi_wu (__m128i_op0, 0x9); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x30eb020302101b03; + *((unsigned long *)&__m128i_op0[0]) = 0x020310d0c0030220; + *((unsigned long *)&__m128i_result[1]) = 0x30eb022002101b20; + *((unsigned long *)&__m128i_result[0]) = 0x020310edc003023d; + __m128i_out = __lsx_vaddi_wu (__m128i_op0, 0x1d); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x59f7fd7059f7fd70; + *((unsigned long *)&__m128i_result[1]) = 0x0000001700000017; + *((unsigned long *)&__m128i_result[0]) = 0x59f7fd8759f7fd87; + __m128i_out = __lsx_vaddi_wu (__m128i_op0, 0x17); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x6420e0208400c4c4; + *((unsigned long *)&__m128i_op0[0]) = 0x20c4e0c4e0da647a; + *((unsigned long *)&__m128i_result[1]) = 0x6420e0208400c4e3; + *((unsigned long *)&__m128i_result[0]) = 0x20c4e0c4e0da6499; + __m128i_out = __lsx_vaddi_du (__m128i_op0, 0x1f); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x21201f1e1d001b1a; + *((unsigned long *)&__m128i_op0[0]) = 0x1918171615141312; + *((unsigned long *)&__m128i_result[1]) = 0x21201f1e1d001b25; + *((unsigned long *)&__m128i_result[0]) = 0x191817161514131d; + __m128i_out = __lsx_vaddi_du (__m128i_op0, 0xb); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000014; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000014; + __m128i_out = __lsx_vaddi_du (__m128i_op0, 0x14); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000004000000040; + *((unsigned long *)&__m128i_op0[0]) = 0x00007770ffff9411; + *((unsigned long *)&__m128i_result[1]) = 0x000000400000004c; + *((unsigned long *)&__m128i_result[0]) = 0x00007770ffff941d; + __m128i_out = __lsx_vaddi_du (__m128i_op0, 0xc); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000016; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000016; + __m128i_out = __lsx_vaddi_du (__m128i_op0, 0x16); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000800000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x000000080000000b; + *((unsigned long *)&__m128i_result[0]) = 0x000000000000000b; + __m128i_out = __lsx_vaddi_du (__m128i_op0, 0xb); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vaddwev-1.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vaddwev-1.c new file mode 100644 index 00000000000..b7b16a325bf --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vaddwev-1.c @@ -0,0 +1,335 @@ +/* { dg-do run } */ +/* { dg-options "-mlsx -w -fno-strict-aliasing" } */ +#include "../simd_correctness_check.h" +#include + +int +main () +{ + __m128i __m128i_op0, __m128i_op1, __m128i_op2, __m128i_out, __m128i_result; + __m128 __m128_op0, __m128_op1, __m128_op2, __m128_out, __m128_result; + __m128d __m128d_op0, __m128d_op1, __m128d_op2, __m128d_out, __m128d_result; + + int int_op0, int_op1, int_op2, int_out, int_result, i = 1, fail; + long int long_op0, long_op1, long_op2, lont_out, lont_result; + long int long_int_out, long_int_result; + unsigned int unsigned_int_out, unsigned_int_result; + unsigned long int unsigned_long_int_out, unsigned_long_int_result; + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vaddwev_h_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0001000100010001; + *((unsigned long *)&__m128i_op0[0]) = 0x0001000100010001; + *((unsigned long *)&__m128i_op1[1]) = 0x000000000000007b; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x000100010001007c; + *((unsigned long *)&__m128i_result[0]) = 0x0001000100010001; + __m128i_out = __lsx_vaddwev_h_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x3fffffff80000000; + *((unsigned long *)&__m128i_op0[0]) = 0x00003ffd000a4000; + *((unsigned long *)&__m128i_op1[1]) = 0xfffd000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xfffcffff00000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000fffd000a0000; + __m128i_out = __lsx_vaddwev_h_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0800080008000800; + *((unsigned long *)&__m128i_op0[0]) = 0x0800080008000800; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vaddwev_h_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x7fff00007fff0000; + *((unsigned long *)&__m128i_op0[0]) = 0x7fff00007fff0000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffff0000ffff0000; + *((unsigned long *)&__m128i_result[0]) = 0xffff0000ffff0000; + __m128i_out = __lsx_vaddwev_h_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vaddwev_h_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000000490000004d; + *((unsigned long *)&__m128i_op0[0]) = 0x00000001ffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0xff000000ff00ff00; + *((unsigned long *)&__m128i_op1[0]) = 0xff00ff0000000000; + *((unsigned long *)&__m128i_result[1]) = 0x00000049ffffff4d; + *((unsigned long *)&__m128i_result[0]) = 0xffffff01ffffffff; + __m128i_out = __lsx_vaddwev_w_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vaddwev_w_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x003fffff00000000; + *((unsigned long *)&__m128i_op1[0]) = 0x003fffff00000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_result[0]) = 0xffffffff00000000; + __m128i_out = __lsx_vaddwev_w_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000000005e695e95; + *((unsigned long *)&__m128i_op0[0]) = 0x5e695e96c396b402; + *((unsigned long *)&__m128i_op1[1]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000005e94; + *((unsigned long *)&__m128i_result[0]) = 0x00005e96ffffb402; + __m128i_out = __lsx_vaddwev_w_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vaddwev_w_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0101010101010101; + *((unsigned long *)&__m128i_op0[0]) = 0x0101010101010101; + *((unsigned long *)&__m128i_op1[1]) = 0xfffffffffffffffb; + *((unsigned long *)&__m128i_op1[0]) = 0xfffffffffffffffb; + *((unsigned long *)&__m128i_result[1]) = 0x00000100000000fc; + *((unsigned long *)&__m128i_result[0]) = 0x00000100000000fc; + __m128i_out = __lsx_vaddwev_w_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000158; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000158; + __m128i_out = __lsx_vaddwev_w_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vaddwev_w_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vaddwev_d_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000005d5d; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000005d5d; + __m128i_out = __lsx_vaddwev_d_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vaddwev_d_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x5c9c9c9ce3636363; + *((unsigned long *)&__m128i_op0[0]) = 0x63635c9e63692363; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffe3636363; + *((unsigned long *)&__m128i_result[0]) = 0x0000000063692363; + __m128i_out = __lsx_vaddwev_d_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x0202020202020203; + *((unsigned long *)&__m128i_op1[0]) = 0x0202020202020203; + *((unsigned long *)&__m128i_result[1]) = 0x0000000002020202; + *((unsigned long *)&__m128i_result[0]) = 0x0000000002020202; + __m128i_out = __lsx_vaddwev_d_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x1817161517161514; + *((unsigned long *)&__m128i_op0[0]) = 0x1615141315141312; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_op1[0]) = 0x76f424887fffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000017161515; + *((unsigned long *)&__m128i_result[0]) = 0x0000000095141311; + __m128i_out = __lsx_vaddwev_d_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vaddwev_d_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffff00000000ffff; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x000000000000fffe; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vaddwev_d_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_op0[0]) = 0xfdfef9ff0efff900; + *((unsigned long *)&__m128i_op1[1]) = 0xfffcfd000000fb00; + *((unsigned long *)&__m128i_op1[0]) = 0x0001fe00f8000700; + *((unsigned long *)&__m128i_result[1]) = 0x000000000000fb01; + *((unsigned long *)&__m128i_result[0]) = 0x0000000007000000; + __m128i_out = __lsx_vaddwev_d_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x00ff00ff00ff00ff; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000080806362; + *((unsigned long *)&__m128i_op1[0]) = 0x807f808000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffff80806362; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000ff00ff; + __m128i_out = __lsx_vaddwev_d_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000010002; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000ff960015; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000010002; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffff960015; + __m128i_out = __lsx_vaddwev_d_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xf6548a1747e59090; + *((unsigned long *)&__m128i_op0[0]) = 0x27b169bbb8145f50; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000047e59090; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffb8145f50; + __m128i_out = __lsx_vaddwev_d_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00bbfff7fffffff7; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffff008ff820; + *((unsigned long *)&__m128i_op1[1]) = 0x00bbfff7fffffff7; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffff008ff820; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffee; + *((unsigned long *)&__m128i_result[0]) = 0x00000000011ff040; + __m128i_out = __lsx_vaddwev_d_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x0001000100010001; + *((unsigned long *)&__m128i_op1[0]) = 0x000100010001fffe; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x000100010001fffd; + __m128i_out = __lsx_vaddwev_q_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vaddwev_q_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000001000000010; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffc2ffe700000007; + *((unsigned long *)&__m128i_op1[0]) = 0x0000ffc100010001; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000ffc100010001; + __m128i_out = __lsx_vaddwev_q_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vaddwev_q_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffff80df00000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x00000000dfa6e0c6; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000d46cdc13; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00000000d46cdc13; + __m128i_out = __lsx_vaddwev_q_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xfe813f00fe813f00; + *((unsigned long *)&__m128i_op1[0]) = 0xfe813f00fe813f00; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xfe813f00fe813f00; + __m128i_out = __lsx_vaddwev_q_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vaddwev_q_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xfffffffffffffffe; + __m128i_out = __lsx_vaddwev_q_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vaddwev-2.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vaddwev-2.c new file mode 100644 index 00000000000..a407cadfbaa --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vaddwev-2.c @@ -0,0 +1,344 @@ +/* { dg-do run } */ +/* { dg-options "-mlsx -w -fno-strict-aliasing" } */ +#include "../simd_correctness_check.h" +#include + +int +main () +{ + __m128i __m128i_op0, __m128i_op1, __m128i_op2, __m128i_out, __m128i_result; + __m128 __m128_op0, __m128_op1, __m128_op2, __m128_out, __m128_result; + __m128d __m128d_op0, __m128d_op1, __m128d_op2, __m128d_out, __m128d_result; + + int int_op0, int_op1, int_op2, int_out, int_result, i = 1, fail; + long int long_op0, long_op1, long_op2, lont_out, lont_result; + long int long_int_out, long_int_result; + unsigned int unsigned_int_out, unsigned_int_result; + unsigned long int unsigned_long_int_out, unsigned_long_int_result; + + *((unsigned long *)&__m128i_op0[1]) = 0x0000ffff0000ffff; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x000000ff000000ff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vaddwev_h_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0400040004000400; + *((unsigned long *)&__m128i_op0[0]) = 0x0400040004000400; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vaddwev_h_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x061006100613030c; + *((unsigned long *)&__m128i_op1[0]) = 0x4d6814ef9c77ce46; + *((unsigned long *)&__m128i_result[1]) = 0x010f010f0112010b; + *((unsigned long *)&__m128i_result[0]) = 0x016701ee01760145; + __m128i_out = __lsx_vaddwev_h_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vaddwev_h_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x1000100010001000; + *((unsigned long *)&__m128i_op1[0]) = 0x1000100010001000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vaddwev_h_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000ffac0a000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x000000ac00000000; + __m128i_out = __lsx_vaddwev_h_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xf589caff5605f2fa; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000014eb54ab; + *((unsigned long *)&__m128i_op1[0]) = 0x14eb6a002a406a00; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000eb00ab; + *((unsigned long *)&__m128i_result[0]) = 0x017400ff004500fa; + __m128i_out = __lsx_vaddwev_h_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x000000ff000000ff; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x000000ff000000ff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vaddwev_w_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x10f917d72d3d01e4; + *((unsigned long *)&__m128i_op0[0]) = 0x203e16d116de012b; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x000017d7000001e4; + *((unsigned long *)&__m128i_result[0]) = 0x000016d10000012b; + __m128i_out = __lsx_vaddwev_w_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vaddwev_w_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000000ff000000ff; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000ffff3fbfffff; + *((unsigned long *)&__m128i_op1[0]) = 0x7fffffff7fffffff; + *((unsigned long *)&__m128i_result[1]) = 0x000100fe000100fe; + *((unsigned long *)&__m128i_result[0]) = 0x0000ffff0000ffff; + __m128i_out = __lsx_vaddwev_w_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0003c853c843c87e; + *((unsigned long *)&__m128i_op0[0]) = 0x0003c853c843c87e; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffff000000ff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0001c8520000c97d; + *((unsigned long *)&__m128i_result[0]) = 0x0001c8520001c87d; + __m128i_out = __lsx_vaddwev_w_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vaddwev_w_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vaddwev_w_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000ffff0000ffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000ffff0000ffff; + __m128i_out = __lsx_vaddwev_w_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x67eb85afb2ebb000; + *((unsigned long *)&__m128i_op0[0]) = 0xc8847ef6ed3f2000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000ffac0a000000; + *((unsigned long *)&__m128i_result[1]) = 0x000085af0000b000; + *((unsigned long *)&__m128i_result[0]) = 0x00017ea200002000; + __m128i_out = __lsx_vaddwev_w_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vaddwev_d_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x00000000ffffffff; + __m128i_out = __lsx_vaddwev_d_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000024; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000024; + __m128i_out = __lsx_vaddwev_d_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00307028003f80b0; + *((unsigned long *)&__m128i_op0[0]) = 0x0040007fff800000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x00000000003f80b0; + *((unsigned long *)&__m128i_result[0]) = 0x00000000ff800000; + __m128i_out = __lsx_vaddwev_d_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000001; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000001; + __m128i_out = __lsx_vaddwev_d_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000000000000001f; + *((unsigned long *)&__m128i_op0[0]) = 0x000000000000001f; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x000000000000001f; + *((unsigned long *)&__m128i_result[0]) = 0x000000000000001f; + __m128i_out = __lsx_vaddwev_d_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x8080808080808080; + *((unsigned long *)&__m128i_op1[0]) = 0xffff80ffffff80ff; + *((unsigned long *)&__m128i_result[1]) = 0x000000018080807f; + *((unsigned long *)&__m128i_result[0]) = 0x00000001ffff80fe; + __m128i_out = __lsx_vaddwev_d_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x7fff000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vaddwev_q_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000001; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000001; + __m128i_out = __lsx_vaddwev_q_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vaddwev_q_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffff8000000000; + *((unsigned long *)&__m128i_op1[0]) = 0xffffff8000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xffffff8000000000; + __m128i_out = __lsx_vaddwev_q_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x1000000010000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000180100100000; + *((unsigned long *)&__m128i_op1[1]) = 0x8000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000b5207f80; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00001801b5307f80; + __m128i_out = __lsx_vaddwev_q_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000001300000013; + *((unsigned long *)&__m128i_op0[0]) = 0x0000001300000013; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000001300000013; + __m128i_out = __lsx_vaddwev_q_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffe218ffffea10; + *((unsigned long *)&__m128i_op0[0]) = 0xfffff208fffffa02; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xfffff208fffffa02; + __m128i_out = __lsx_vaddwev_q_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000080000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000080000000; + __m128i_out = __lsx_vaddwev_q_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000000003fbf3fbf; + *((unsigned long *)&__m128i_op0[0]) = 0x7fff7fff7fff7ff8; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x000000000000000f; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x7fff7fff7fff8007; + __m128i_out = __lsx_vaddwev_q_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000ffff00000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0002000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000014; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000014; + __m128i_out = __lsx_vaddwev_q_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vaddwev_q_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x7f8000007f800000; + *((unsigned long *)&__m128i_op1[0]) = 0x7f8000007f800000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x7f8000007f800000; + __m128i_out = __lsx_vaddwev_q_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x6363636363636363; + *((unsigned long *)&__m128i_op0[0]) = 0xffd27db010d20fbf; + *((unsigned long *)&__m128i_op1[1]) = 0x6363636363636363; + *((unsigned long *)&__m128i_op1[0]) = 0xffd27db010d20fbf; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_result[0]) = 0xffa4fb6021a41f7e; + __m128i_out = __lsx_vaddwev_q_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vaddwev-3.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vaddwev-3.c new file mode 100644 index 00000000000..4d5c6099844 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vaddwev-3.c @@ -0,0 +1,425 @@ +/* { dg-do run } */ +/* { dg-options "-mlsx -w -fno-strict-aliasing" } */ +#include "../simd_correctness_check.h" +#include + +int +main () +{ + __m128i __m128i_op0, __m128i_op1, __m128i_op2, __m128i_out, __m128i_result; + __m128 __m128_op0, __m128_op1, __m128_op2, __m128_out, __m128_result; + __m128d __m128d_op0, __m128d_op1, __m128d_op2, __m128d_out, __m128d_result; + + int int_op0, int_op1, int_op2, int_out, int_result, i = 1, fail; + long int long_op0, long_op1, long_op2, lont_out, lont_result; + long int long_int_out, long_int_result; + unsigned int unsigned_int_out, unsigned_int_result; + unsigned long int unsigned_long_int_out, unsigned_long_int_result; + + *((unsigned long *)&__m128i_op0[1]) = 0x0403cfcf01c1595e; + *((unsigned long *)&__m128i_op0[0]) = 0x837cd5db43fc55d4; + *((unsigned long *)&__m128i_op1[1]) = 0x0404038383838404; + *((unsigned long *)&__m128i_op1[0]) = 0x0404038383838404; + *((unsigned long *)&__m128i_result[1]) = 0x0007005200440062; + *((unsigned long *)&__m128i_result[0]) = 0x0080005e007f00d8; + __m128i_out = __lsx_vaddwev_h_bu_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vaddwev_h_bu_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vaddwev_h_bu_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffcafff8ff; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000000000a0; + *((unsigned long *)&__m128i_op1[1]) = 0xe6d4572c8a5835bc; + *((unsigned long *)&__m128i_op1[0]) = 0xe5017c2ac9ca9fd0; + *((unsigned long *)&__m128i_result[1]) = 0x00d3012b015700bb; + *((unsigned long *)&__m128i_result[0]) = 0x0001002affca0070; + __m128i_out = __lsx_vaddwev_h_bu_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000fea0000fffe; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x6363771163631745; + *((unsigned long *)&__m128i_op1[0]) = 0x636363ec6363636c; + *((unsigned long *)&__m128i_result[1]) = 0x006300fb00630143; + *((unsigned long *)&__m128i_result[0]) = 0x0063ffec0063006c; + __m128i_out = __lsx_vaddwev_h_bu_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x000000000000ffff; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x000000000000ffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vaddwev_h_bu_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x6363636363636363; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x9c9c9c9c9c9c9c9d; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffff0000; + __m128i_out = __lsx_vaddwev_h_bu_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x8080ffffffff8080; + *((unsigned long *)&__m128i_op1[0]) = 0x00008080ffffffff; + *((unsigned long *)&__m128i_result[1]) = 0xff80ffffffffff80; + *((unsigned long *)&__m128i_result[0]) = 0x0000ff80ffffffff; + __m128i_out = __lsx_vaddwev_h_bu_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00197f26cb658837; + *((unsigned long *)&__m128i_op0[0]) = 0x01009aa4a301084b; + *((unsigned long *)&__m128i_op1[1]) = 0x001effae001effae; + *((unsigned long *)&__m128i_op1[0]) = 0x001effae001effae; + *((unsigned long *)&__m128i_result[1]) = 0x0037ffd40083ffe5; + *((unsigned long *)&__m128i_result[0]) = 0x001e0052001ffff9; + __m128i_out = __lsx_vaddwev_h_bu_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffff00ffffff00ff; + *((unsigned long *)&__m128i_op0[0]) = 0xffff0000ffff0000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000f50000000900; + *((unsigned long *)&__m128i_op1[0]) = 0x0000090900000998; + *((unsigned long *)&__m128i_result[1]) = 0x00ff00ff00ff00ff; + *((unsigned long *)&__m128i_result[0]) = 0x00ff000900ffff98; + __m128i_out = __lsx_vaddwev_h_bu_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x10f881a20ffd02b0; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000ff800000; + *((unsigned long *)&__m128i_result[1]) = 0xfff8ffa2fffdffb0; + *((unsigned long *)&__m128i_result[0]) = 0x00000000ff800000; + __m128i_out = __lsx_vaddwev_h_bu_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vaddwev_w_hu_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x7fff7fff7fff7fff; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x00007fff00007fff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vaddwev_w_hu_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000001; + *((unsigned long *)&__m128i_op1[1]) = 0x000000000000007b; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x000000000000007b; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000001; + __m128i_out = __lsx_vaddwev_w_hu_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x1e0200001e020000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xfffcfffcfffcfffd; + *((unsigned long *)&__m128i_op1[0]) = 0xfffcfffdfffcfffd; + *((unsigned long *)&__m128i_result[1]) = 0xfffffffcfffffffd; + *((unsigned long *)&__m128i_result[0]) = 0xfffffffdfffffffd; + __m128i_out = __lsx_vaddwev_w_hu_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xff00ff00ff00ff00; + *((unsigned long *)&__m128i_op0[0]) = 0xff00ff00ff00ff00; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000ff000000ff00; + *((unsigned long *)&__m128i_result[0]) = 0x0000ff000000ff00; + __m128i_out = __lsx_vaddwev_w_hu_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000005; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000005; + __m128i_out = __lsx_vaddwev_w_hu_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0101010101010101; + *((unsigned long *)&__m128i_op0[0]) = 0x0101010101010101; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000010100000101; + *((unsigned long *)&__m128i_result[0]) = 0x0000010100000101; + __m128i_out = __lsx_vaddwev_w_hu_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000400000004; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000400000004; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000400000004; + *((unsigned long *)&__m128i_result[0]) = 0x0000000400000004; + __m128i_out = __lsx_vaddwev_w_hu_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vaddwev_w_hu_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x8000000080000008; + *((unsigned long *)&__m128i_op1[0]) = 0xa2f54a1ea2f54a1e; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000008; + *((unsigned long *)&__m128i_result[0]) = 0x00004a1e00004a1e; + __m128i_out = __lsx_vaddwev_w_hu_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000868686868686; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000000000ff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000868600008785; + __m128i_out = __lsx_vaddwev_w_hu_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x63636b6afe486741; + *((unsigned long *)&__m128i_op0[0]) = 0x41f8e880ffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0xe363636363abdf16; + *((unsigned long *)&__m128i_op1[0]) = 0x41f8e08016161198; + *((unsigned long *)&__m128i_result[1]) = 0x0000cecd00004657; + *((unsigned long *)&__m128i_result[0]) = 0x0000c90000011197; + __m128i_out = __lsx_vaddwev_w_hu_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000001000f000e; + *((unsigned long *)&__m128i_op0[0]) = 0x0000fff1000ffffe; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x00000000000f000e; + *((unsigned long *)&__m128i_result[0]) = 0x00000000000ffffe; + __m128i_out = __lsx_vaddwev_d_wu_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0c07e181ffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0x3430af9effffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x00000000ffffffff; + __m128i_out = __lsx_vaddwev_d_wu_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000fe00ff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000fe00ff; + __m128i_out = __lsx_vaddwev_d_wu_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x00060012000e002b; + *((unsigned long *)&__m128i_op1[0]) = 0x00000049ffffffaa; + *((unsigned long *)&__m128i_result[1]) = 0x00000000000e002b; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffaa; + __m128i_out = __lsx_vaddwev_d_wu_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000006f00001f0a; + *((unsigned long *)&__m128i_op0[0]) = 0x0000958affff995d; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000bfffffffe0f6; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000001f0a; + *((unsigned long *)&__m128i_result[0]) = 0x00000000ffff7a53; + __m128i_out = __lsx_vaddwev_d_wu_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffff7f80ffff7f80; + *((unsigned long *)&__m128i_op0[0]) = 0xffff7f80ffff7f80; + *((unsigned long *)&__m128i_op1[1]) = 0xffff7f80ffff7f80; + *((unsigned long *)&__m128i_op1[0]) = 0xffff7f80ffff7f80; + *((unsigned long *)&__m128i_result[1]) = 0x00000000fffeff00; + *((unsigned long *)&__m128i_result[0]) = 0x00000000fffeff00; + __m128i_out = __lsx_vaddwev_d_wu_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vaddwev_d_wu_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0008000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x00000000003dffc2; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000003dffc2; + *((unsigned long *)&__m128i_result[1]) = 0x00000000003dffc2; + *((unsigned long *)&__m128i_result[0]) = 0x00000000003dffc2; + __m128i_out = __lsx_vaddwev_d_wu_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0080008000800080; + *((unsigned long *)&__m128i_op0[0]) = 0x0080006b0000000b; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000800080; + *((unsigned long *)&__m128i_result[0]) = 0x000000000000000b; + __m128i_out = __lsx_vaddwev_d_wu_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x00ff00ff00ff00ff; + *((unsigned long *)&__m128i_op1[0]) = 0x00ff00ff00ff00ff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000ff00ff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000ff00ff; + __m128i_out = __lsx_vaddwev_d_wu_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000455555555; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000055555555; + __m128i_out = __lsx_vaddwev_d_wu_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xff7f810100001000; + *((unsigned long *)&__m128i_op0[0]) = 0x000400530050ffa6; + *((unsigned long *)&__m128i_op1[1]) = 0xffff007fff810001; + *((unsigned long *)&__m128i_op1[0]) = 0x000400530050ffa6; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffff811001; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000a1ff4c; + __m128i_out = __lsx_vaddwev_d_wu_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000002000000020; + *((unsigned long *)&__m128i_op0[0]) = 0x0000001f0000001f; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0x7fffffff7fffffff; + *((unsigned long *)&__m128i_result[1]) = 0x000000000000001f; + *((unsigned long *)&__m128i_result[0]) = 0x000000008000001e; + __m128i_out = __lsx_vaddwev_d_wu_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xd3259a2984048c23; + *((unsigned long *)&__m128i_op0[0]) = 0xf9796558e39953fd; + *((unsigned long *)&__m128i_op1[1]) = 0x86dd8341b164f12b; + *((unsigned long *)&__m128i_op1[0]) = 0x9611c3985b3159f5; + *((unsigned long *)&__m128i_result[1]) = 0x0000000035697d4e; + *((unsigned long *)&__m128i_result[0]) = 0x000000013ecaadf2; + __m128i_out = __lsx_vaddwev_d_wu_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00ff00ef00ff010f; + *((unsigned long *)&__m128i_op0[0]) = 0x00ff00ff00ff010f; + *((unsigned long *)&__m128i_op1[1]) = 0x0001000100010001; + *((unsigned long *)&__m128i_op1[0]) = 0xc1f03e1042208410; + *((unsigned long *)&__m128i_result[1]) = 0x0000000001000110; + *((unsigned long *)&__m128i_result[0]) = 0x00000000431f851f; + __m128i_out = __lsx_vaddwev_d_wu_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vaddwev_q_du_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x7fff7fff7fff7fff; + *((unsigned long *)&__m128i_op1[0]) = 0x000000030000003f; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x000000030000003f; + __m128i_out = __lsx_vaddwev_q_du_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xfffffffffffffffe; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vaddwev_q_du_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffbfffffffbf; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffbfffffffbf; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xffffffbfffffffbe; + __m128i_out = __lsx_vaddwev_q_du_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x06b1213ef1efa299; + *((unsigned long *)&__m128i_op0[0]) = 0x8312f5424ca4a07f; + *((unsigned long *)&__m128i_op1[1]) = 0x1f1f1f1f1f1f1f00; + *((unsigned long *)&__m128i_op1[0]) = 0x1f1f1f27332b9f00; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xa23214697fd03f7f; + __m128i_out = __lsx_vaddwev_q_du_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vaddwev_q_du_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x80000000ffffd860; + *((unsigned long *)&__m128i_op1[0]) = 0x7fffffff80000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x7fffffff80000000; + __m128i_out = __lsx_vaddwev_q_du_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vaddwod-1.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vaddwod-1.c new file mode 100644 index 00000000000..0ebe8c8a9fb --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vaddwod-1.c @@ -0,0 +1,408 @@ +/* { dg-do run } */ +/* { dg-options "-mlsx -w -fno-strict-aliasing" } */ +#include "../simd_correctness_check.h" +#include + +int +main () +{ + __m128i __m128i_op0, __m128i_op1, __m128i_op2, __m128i_out, __m128i_result; + __m128 __m128_op0, __m128_op1, __m128_op2, __m128_out, __m128_result; + __m128d __m128d_op0, __m128d_op1, __m128d_op2, __m128d_out, __m128d_result; + + int int_op0, int_op1, int_op2, int_out, int_result, i = 1, fail; + long int long_op0, long_op1, long_op2, lont_out, lont_result; + long int long_int_out, long_int_result; + unsigned int unsigned_int_out, unsigned_int_result; + unsigned long int unsigned_long_int_out, unsigned_long_int_result; + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000ca354688; + *((unsigned long *)&__m128i_op1[1]) = 0x0404038383838404; + *((unsigned long *)&__m128i_op1[0]) = 0x0404038383838404; + *((unsigned long *)&__m128i_result[1]) = 0x00040003ff83ff84; + *((unsigned long *)&__m128i_result[0]) = 0x00040003ff4dffca; + __m128i_out = __lsx_vaddwod_h_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x000000000000040d; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000004; + __m128i_out = __lsx_vaddwod_h_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x00001f5400000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000014; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000014; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000001f00000000; + __m128i_out = __lsx_vaddwod_h_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000f80007; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vaddwod_h_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + unsigned_int_out = __lsx_vpickve2gr_bu (__m128i_op0, 0xb); + *((unsigned long *)&__m128i_op0[1]) = 0x003fffff00000000; + *((unsigned long *)&__m128i_op0[0]) = 0x003fffff00000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000ffff00000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000ffff00000000; + __m128i_out = __lsx_vaddwod_h_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffff0100ff; + *((unsigned long *)&__m128i_result[1]) = 0xfffefffefffefffe; + *((unsigned long *)&__m128i_result[0]) = 0xfffefffefffeffff; + __m128i_out = __lsx_vaddwod_h_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vaddwod_h_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vaddwod_h_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vaddwod_h_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x478b478b38031779; + *((unsigned long *)&__m128i_op0[0]) = 0x6b769e690fa1e119; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000001030103; + *((unsigned long *)&__m128i_result[1]) = 0x0047004700380017; + *((unsigned long *)&__m128i_result[0]) = 0x006bff9e0010ffe2; + __m128i_out = __lsx_vaddwod_h_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xc0b4d1a5f8babad3; + *((unsigned long *)&__m128i_op0[0]) = 0xbbc8ecc5f3ced5f3; + *((unsigned long *)&__m128i_op1[1]) = 0xc0b4d1a5f8babad3; + *((unsigned long *)&__m128i_op1[0]) = 0xbbc8ecc5f3ced5f3; + *((unsigned long *)&__m128i_result[1]) = 0xff80ffa2fff0ff74; + *((unsigned long *)&__m128i_result[0]) = 0xff76ffd8ffe6ffaa; + __m128i_out = __lsx_vaddwod_h_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000800; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000800000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vaddwod_w_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vaddwod_w_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x1f54e0ab00000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00001f5400000000; + __m128i_out = __lsx_vaddwod_w_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x000000000000000f; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vaddwod_w_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000208000002080; + *((unsigned long *)&__m128i_op0[0]) = 0x0000208000002080; + *((unsigned long *)&__m128i_op1[1]) = 0xd70b30c96ea9f4e8; + *((unsigned long *)&__m128i_op1[0]) = 0xa352bfac9269e0aa; + *((unsigned long *)&__m128i_result[1]) = 0xffffd70b00006ea9; + *((unsigned long *)&__m128i_result[0]) = 0xffffa352ffff9269; + __m128i_out = __lsx_vaddwod_w_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000208000002080; + *((unsigned long *)&__m128i_op0[0]) = 0x0000208000002080; + *((unsigned long *)&__m128i_op1[1]) = 0xd70b30c96ea9f4e8; + *((unsigned long *)&__m128i_op1[0]) = 0xa352bfac9269e0aa; + *((unsigned long *)&__m128i_result[1]) = 0xffffd70b00006ea9; + *((unsigned long *)&__m128i_result[0]) = 0xffffa352ffff9269; + __m128i_out = __lsx_vaddwod_w_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vaddwod_w_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vaddwod_w_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xff800000ff800000; + *((unsigned long *)&__m128i_op0[0]) = 0xe593c8c4e593c8c4; + *((unsigned long *)&__m128i_op1[1]) = 0x8144ffff01c820a4; + *((unsigned long *)&__m128i_op1[0]) = 0x9b2ee1a4034b4e34; + *((unsigned long *)&__m128i_result[1]) = 0xffff80c400000148; + *((unsigned long *)&__m128i_result[0]) = 0xffff80c1ffffe8de; + __m128i_out = __lsx_vaddwod_w_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0xfffffffefffffffe; + *((unsigned long *)&__m128i_result[0]) = 0xfffffffefffffffe; + __m128i_out = __lsx_vaddwod_w_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xa486c90f6537b8d7; + *((unsigned long *)&__m128i_op0[0]) = 0x58bcc2013ea1cc1e; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffa486c90f; + *((unsigned long *)&__m128i_result[0]) = 0x0000000058bcc201; + __m128i_out = __lsx_vaddwod_d_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x00001802041b0013; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_op1[0]) = 0x00001802041b0014; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000003004; + __m128i_out = __lsx_vaddwod_d_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffff02000200; + *((unsigned long *)&__m128i_op1[1]) = 0xffffe000ffffe000; + *((unsigned long *)&__m128i_op1[0]) = 0xffffe000ffffe000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffdfff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffdfff; + __m128i_out = __lsx_vaddwod_d_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000fbf83468; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000fbf83468; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vaddwod_d_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x7fffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000001; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffff82bb9784; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffc6bb97ac; + *((unsigned long *)&__m128i_result[1]) = 0x000000007ffffffe; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vaddwod_d_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x4f804f804f804f80; + *((unsigned long *)&__m128i_op0[0]) = 0x4f804f804f804f80; + *((unsigned long *)&__m128i_op1[1]) = 0x00000001000fbff9; + *((unsigned long *)&__m128i_op1[0]) = 0x000000002ff9afef; + *((unsigned long *)&__m128i_result[1]) = 0x000000004f804f81; + *((unsigned long *)&__m128i_result[0]) = 0x000000004f804f80; + __m128i_out = __lsx_vaddwod_d_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000001000000010; + *((unsigned long *)&__m128i_op0[0]) = 0x0000001000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000001000000010; + *((unsigned long *)&__m128i_op1[0]) = 0x0000001000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000020; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000020; + __m128i_out = __lsx_vaddwod_d_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000001000000010; + *((unsigned long *)&__m128i_op0[0]) = 0x0000001000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x000000000000fff0; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000010; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000010; + __m128i_out = __lsx_vaddwod_d_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffff0000ffff0000; + *((unsigned long *)&__m128i_op0[0]) = 0xfffe00029f9f6061; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0x64e464e464e464e4; + *((unsigned long *)&__m128i_result[1]) = 0xfffffffffffeffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000064e264e6; + __m128i_out = __lsx_vaddwod_d_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vaddwod_d_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0305030203020502; + *((unsigned long *)&__m128i_op0[0]) = 0x0301030203020502; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000003050302; + *((unsigned long *)&__m128i_result[0]) = 0x0000000003010302; + __m128i_out = __lsx_vaddwod_d_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000ff0000ff0000; + *((unsigned long *)&__m128i_op0[0]) = 0x01fc020000fe0100; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000ff0000ff0000; + __m128i_out = __lsx_vaddwod_q_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vaddwod_q_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vaddwod_q_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xff84fff4ff84fff4; + *((unsigned long *)&__m128i_op1[0]) = 0x00a6ffceffb60052; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xff84fff4ff84fff4; + __m128i_out = __lsx_vaddwod_q_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000000fefefe6a; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000c2bac2c2; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00000000fefefe6a; + __m128i_out = __lsx_vaddwod_q_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000002000000020; + *((unsigned long *)&__m128i_op0[0]) = 0x0000002000000020; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0032000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000002000000020; + __m128i_out = __lsx_vaddwod_q_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vaddwod_q_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffff0000; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffff0000; + __m128i_out = __lsx_vaddwod_q_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x5a57bacbd7e39680; + *((unsigned long *)&__m128i_op0[0]) = 0x6bae051ffed76001; + *((unsigned long *)&__m128i_op1[1]) = 0xf3e6586b60d7b152; + *((unsigned long *)&__m128i_op1[0]) = 0xf7077b934ac0e000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x4e3e133738bb47d2; + __m128i_out = __lsx_vaddwod_q_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000117d00007f7b; + *((unsigned long *)&__m128i_op0[0]) = 0x0000093d0000187f; + *((unsigned long *)&__m128i_op1[1]) = 0x7d7f027f7c7f7c79; + *((unsigned long *)&__m128i_op1[0]) = 0x7e7f7e7f027f032f; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x7d7f13fc7c7ffbf4; + __m128i_out = __lsx_vaddwod_q_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vaddwod_q_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vaddwod-2.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vaddwod-2.c new file mode 100644 index 00000000000..379517f39c6 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vaddwod-2.c @@ -0,0 +1,344 @@ +/* { dg-do run } */ +/* { dg-options "-mlsx -w -fno-strict-aliasing" } */ +#include "../simd_correctness_check.h" +#include + +int +main () +{ + __m128i __m128i_op0, __m128i_op1, __m128i_op2, __m128i_out, __m128i_result; + __m128 __m128_op0, __m128_op1, __m128_op2, __m128_out, __m128_result; + __m128d __m128d_op0, __m128d_op1, __m128d_op2, __m128d_out, __m128d_result; + + int int_op0, int_op1, int_op2, int_out, int_result, i = 1, fail; + long int long_op0, long_op1, long_op2, lont_out, lont_result; + long int long_int_out, long_int_result; + unsigned int unsigned_int_out, unsigned_int_result; + unsigned long int unsigned_long_int_out, unsigned_long_int_result; + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vaddwod_h_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x08fdc221bfdb1927; + *((unsigned long *)&__m128i_op0[0]) = 0x4303c67e9b7fb213; + *((unsigned long *)&__m128i_op1[1]) = 0x08fdc221bfdb1927; + *((unsigned long *)&__m128i_op1[0]) = 0x4303c67e9b7fb213; + *((unsigned long *)&__m128i_result[1]) = 0x00100184017e0032; + *((unsigned long *)&__m128i_result[0]) = 0x0086018c01360164; + __m128i_out = __lsx_vaddwod_h_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xff77777807777775; + *((unsigned long *)&__m128i_op0[0]) = 0xe6eeef00eeeeeebf; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x000000000000f00f; + *((unsigned long *)&__m128i_result[1]) = 0x00ff007700070077; + *((unsigned long *)&__m128i_result[0]) = 0x00e600ef00ee01de; + __m128i_out = __lsx_vaddwod_h_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x00ff00ff00ff00ff; + *((unsigned long *)&__m128i_result[0]) = 0x00ff00ff00ff00ff; + __m128i_out = __lsx_vaddwod_h_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vaddwod_h_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00ff00ff00ff00ff; + __m128i_out = __lsx_vaddwod_h_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000ffff00000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000ffff0000ffff; + __m128i_out = __lsx_vaddwod_w_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x000000030000003f; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vaddwod_w_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000ffff0000ffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vaddwod_w_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x4429146a7b4c88b2; + *((unsigned long *)&__m128i_op1[0]) = 0xe22b3595efa4aa0c; + *((unsigned long *)&__m128i_result[1]) = 0x0000442900007b4c; + *((unsigned long *)&__m128i_result[0]) = 0x0000e22b0000efa4; + __m128i_out = __lsx_vaddwod_w_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vaddwod_w_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x6363636363636363; + *((unsigned long *)&__m128i_op1[1]) = 0x0006000000040000; + *((unsigned long *)&__m128i_op1[0]) = 0x0002000000000007; + *((unsigned long *)&__m128i_result[1]) = 0x0000000600000004; + *((unsigned long *)&__m128i_result[0]) = 0x0000636500006363; + __m128i_out = __lsx_vaddwod_w_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0808080808080808; + *((unsigned long *)&__m128i_op0[0]) = 0x0808080808080808; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000000000a6; + *((unsigned long *)&__m128i_result[1]) = 0x0000080800000808; + *((unsigned long *)&__m128i_result[0]) = 0x0000080800000808; + __m128i_out = __lsx_vaddwod_w_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x8000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x8000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000800000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000800000000000; + __m128i_out = __lsx_vaddwod_w_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000ffff0000ffff; + *((unsigned long *)&__m128i_result[0]) = 0x000000000000ffff; + __m128i_out = __lsx_vaddwod_w_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vaddwod_w_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vaddwod_w_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000ffff0000ffff; + *((unsigned long *)&__m128i_op0[0]) = 0x0001fffe0001fefc; + *((unsigned long *)&__m128i_op1[1]) = 0x0000ffff0000ffff; + *((unsigned long *)&__m128i_op1[0]) = 0x0001fffe0001fefc; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000200000002; + __m128i_out = __lsx_vaddwod_w_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000fff80000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xff8000010f800000; + *((unsigned long *)&__m128i_result[1]) = 0x0000ffff0000ffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000ff8000010f78; + __m128i_out = __lsx_vaddwod_w_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vaddwod_d_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfffffffffffffff7; + *((unsigned long *)&__m128i_op0[0]) = 0xfffffffffffffc01; + *((unsigned long *)&__m128i_op1[1]) = 0xfffffffffffffff7; + *((unsigned long *)&__m128i_op1[0]) = 0xfffffffffffffc01; + *((unsigned long *)&__m128i_result[1]) = 0x00000001fffffffe; + *((unsigned long *)&__m128i_result[0]) = 0x00000001fffffffe; + __m128i_out = __lsx_vaddwod_d_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vaddwod_d_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vaddwod_d_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x370bdfecffecffec; + *((unsigned long *)&__m128i_op0[0]) = 0x370bdfecffecffec; + *((unsigned long *)&__m128i_op1[1]) = 0x370bdfecffecffec; + *((unsigned long *)&__m128i_op1[0]) = 0x370bdfecffecffec; + *((unsigned long *)&__m128i_result[1]) = 0x000000006e17bfd8; + *((unsigned long *)&__m128i_result[0]) = 0x000000006e17bfd8; + __m128i_out = __lsx_vaddwod_d_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000158; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vaddwod_d_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vaddwod_d_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x003f000400000003; + *((unsigned long *)&__m128i_op0[0]) = 0x003f000400000003; + *((unsigned long *)&__m128i_op1[1]) = 0x0001000000010000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000400004; + *((unsigned long *)&__m128i_result[0]) = 0x00000000003f0004; + __m128i_out = __lsx_vaddwod_d_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000001; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vaddwod_d_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x7f8000017f800001; + *((unsigned long *)&__m128i_op0[0]) = 0x7f8000017f800001; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x000000007f800001; + *((unsigned long *)&__m128i_result[0]) = 0x000000007f800001; + __m128i_out = __lsx_vaddwod_d_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vaddwod_d_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vaddwod_q_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000100000001; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000200000000; + __m128i_out = __lsx_vaddwod_q_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vaddwod_q_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x379674c000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x3789f68000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x379674c000000000; + __m128i_out = __lsx_vaddwod_q_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000001000000010; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vaddwod_q_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vaddwod_q_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vaddwod-3.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vaddwod-3.c new file mode 100644 index 00000000000..30dc8351839 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vaddwod-3.c @@ -0,0 +1,237 @@ +/* { dg-do run } */ +/* { dg-options "-mlsx -w -fno-strict-aliasing" } */ +#include "../simd_correctness_check.h" +#include + +int +main () +{ + __m128i __m128i_op0, __m128i_op1, __m128i_op2, __m128i_out, __m128i_result; + __m128 __m128_op0, __m128_op1, __m128_op2, __m128_out, __m128_result; + __m128d __m128d_op0, __m128d_op1, __m128d_op2, __m128d_out, __m128d_result; + + int int_op0, int_op1, int_op2, int_out, int_result, i = 1, fail; + long int long_op0, long_op1, long_op2, lont_out, lont_result; + long int long_int_out, long_int_result; + unsigned int unsigned_int_out, unsigned_int_result; + unsigned long int unsigned_long_int_out, unsigned_long_int_result; + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_op1[1]) = 0x00000000a16316b0; + *((unsigned long *)&__m128i_op1[0]) = 0x16161616a16316b0; + *((unsigned long *)&__m128i_result[1]) = 0x00ff00ffffa10016; + *((unsigned long *)&__m128i_result[0]) = 0x01150115ffa10016; + __m128i_out = __lsx_vaddwod_h_bu_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x7f7f7f7f7f7f7f7f; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0xfffffffffffffffe; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x007e007e007e007e; + *((unsigned long *)&__m128i_result[0]) = 0x00ff00ff00ff00ff; + __m128i_out = __lsx_vaddwod_h_bu_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000120002000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000100013fa0; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000200020; + *((unsigned long *)&__m128i_result[0]) = 0x000000000000003f; + __m128i_out = __lsx_vaddwod_h_bu_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vaddwod_h_bu_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000000007fffffff; + *((unsigned long *)&__m128i_op0[0]) = 0x7fffffff7fffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x000000007fffffff; + *((unsigned long *)&__m128i_op1[0]) = 0x7fffffff7fffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000fe00fe; + *((unsigned long *)&__m128i_result[0]) = 0x00fe00fe00fe00fe; + __m128i_out = __lsx_vaddwod_h_bu_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000000000011ffee; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000000dfff2; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x00000000000000ff; + *((unsigned long *)&__m128i_result[0]) = 0x00000000000000ff; + __m128i_out = __lsx_vaddwod_h_bu_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x00e0000000e00000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x000000e0000000e0; + __m128i_out = __lsx_vaddwod_w_hu_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffff7100fffc; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x00ff00ffffa10016; + *((unsigned long *)&__m128i_op1[0]) = 0x01150115ffa10016; + *((unsigned long *)&__m128i_result[1]) = 0x000100fe000070a1; + *((unsigned long *)&__m128i_result[0]) = 0x00000115ffffffa1; + __m128i_out = __lsx_vaddwod_w_hu_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vaddwod_w_hu_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000fffe0000fffe; + __m128i_out = __lsx_vaddwod_w_hu_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffe218ffffea10; + *((unsigned long *)&__m128i_op0[0]) = 0xfffff208fffffa02; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000ffff0000ffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000ffff0000ffff; + __m128i_out = __lsx_vaddwod_w_hu_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x000001000f00fe00; + *((unsigned long *)&__m128i_op1[0]) = 0x0000017fff00fe7f; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000f00; + *((unsigned long *)&__m128i_result[0]) = 0x00000000ffffff00; + __m128i_out = __lsx_vaddwod_w_hu_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vaddwod_w_hu_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + unsigned_int_out = __lsx_vpickve2gr_hu (__m128i_op0, 0x5); + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vaddwod_w_hu_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x04faf60009f5f092; + *((unsigned long *)&__m128i_op0[0]) = 0x04fafa9200000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0xfff9fffefff9ffff; + *((unsigned long *)&__m128i_result[1]) = 0x000004fa000009f5; + *((unsigned long *)&__m128i_result[0]) = 0x000004f3fffffff9; + __m128i_out = __lsx_vaddwod_w_hu_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000001; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vaddwod_q_du_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000c2f90000bafa; + *((unsigned long *)&__m128i_op0[0]) = 0x8000c2fa8000c2fa; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000c2f90000bafa; + __m128i_out = __lsx_vaddwod_q_du_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vaddwod_q_du_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00001fff00001fff; + *((unsigned long *)&__m128i_op0[0]) = 0x00000003fffffffc; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00001fff00001fff; + __m128i_out = __lsx_vaddwod_q_du_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vaddwod_q_du_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x8000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x8000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x8000000000000000; + __m128i_out = __lsx_vaddwod_q_du_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vaddwod_q_du_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000807bf0a1f80; + *((unsigned long *)&__m128i_op0[0]) = 0x00000800ecedee68; + *((unsigned long *)&__m128i_op1[1]) = 0x5847b72626ce61ef; + *((unsigned long *)&__m128i_op1[0]) = 0x110053f401e7cced; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x5847bf2de5d8816f; + __m128i_out = __lsx_vaddwod_q_du_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffff000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xffff000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000100000155; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xffff000000000000; + __m128i_out = __lsx_vaddwod_q_du_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vhaddw-1.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vhaddw-1.c new file mode 100644 index 00000000000..af75f8e4ee0 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vhaddw-1.c @@ -0,0 +1,488 @@ +/* { dg-do run } */ +/* { dg-options "-mlsx -w -fno-strict-aliasing" } */ +#include "../simd_correctness_check.h" +#include + +int +main () +{ + __m128i __m128i_op0, __m128i_op1, __m128i_op2, __m128i_out, __m128i_result; + __m128 __m128_op0, __m128_op1, __m128_op2, __m128_out, __m128_result; + __m128d __m128d_op0, __m128d_op1, __m128d_op2, __m128d_out, __m128d_result; + + int int_op0, int_op1, int_op2, int_out, int_result, i = 1, fail; + long int long_op0, long_op1, long_op2, lont_out, lont_result; + long int long_int_out, long_int_result; + unsigned int unsigned_int_out, unsigned_int_result; + unsigned long int unsigned_long_int_out, unsigned_long_int_result; + + *((unsigned long *)&__m128i_op0[1]) = 0x4ee85545068f3133; + *((unsigned long *)&__m128i_op0[0]) = 0x870968c1f56bb3cd; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x004e005500060031; + *((unsigned long *)&__m128i_result[0]) = 0xff870068fff5ffb3; + __m128i_out = __lsx_vhaddw_h_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x000000000000000d; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vhaddw_h_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfff082f000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x003f000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xc04d600d3aded151; + *((unsigned long *)&__m128i_op1[0]) = 0xc000000000000001; + *((unsigned long *)&__m128i_result[1]) = 0x004cff8fffde0051; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000001; + __m128i_out = __lsx_vhaddw_h_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vhaddw_h_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vhaddw_h_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vhaddw_h_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x3ff0000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x3ff0000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x800000007fffffff; + *((unsigned long *)&__m128i_op1[0]) = 0x800000007fffffff; + *((unsigned long *)&__m128i_result[1]) = 0x003f0000ffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x003f0000ffffffff; + __m128i_out = __lsx_vhaddw_h_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0042003e0042002f; + *((unsigned long *)&__m128i_op1[0]) = 0x0001fffc0001fffc; + *((unsigned long *)&__m128i_result[1]) = 0x0042003e0042002f; + *((unsigned long *)&__m128i_result[0]) = 0x0001fffc0001fffc; + __m128i_out = __lsx_vhaddw_h_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vhaddw_h_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x7505443065413aed; + *((unsigned long *)&__m128i_op0[0]) = 0x0100d6effefd0498; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000750500006541; + *((unsigned long *)&__m128i_result[0]) = 0x00000100fffffefd; + __m128i_out = __lsx_vhaddw_w_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffff00ff00; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffff00ffff00; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0xfffffffffffffff7; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffff00; + *((unsigned long *)&__m128i_result[0]) = 0xfffffffe000000f6; + __m128i_out = __lsx_vhaddw_w_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x00000001fffffffe; + *((unsigned long *)&__m128i_op1[0]) = 0x00000001fffffffe; + *((unsigned long *)&__m128i_result[1]) = 0x00000001fffffffe; + *((unsigned long *)&__m128i_result[0]) = 0x00000001fffffffe; + __m128i_out = __lsx_vhaddw_w_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffff0000ffff0000; + *((unsigned long *)&__m128i_op0[0]) = 0xffff0000ffff0000; + *((unsigned long *)&__m128i_op1[1]) = 0xffff0000ffff0000; + *((unsigned long *)&__m128i_op1[0]) = 0xffff0000ffff0000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vhaddw_w_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x4050000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vhaddw_w_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000f80007; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00000000000000f8; + __m128i_out = __lsx_vhaddw_w_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000040; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000040; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vhaddw_w_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vhaddw_w_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xff80ffffffffff80; + *((unsigned long *)&__m128i_op0[0]) = 0x0000ff80ffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_result[1]) = 0xffffff7ffffffffe; + *((unsigned long *)&__m128i_result[0]) = 0x00000000fffffffe; + __m128i_out = __lsx_vhaddw_w_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vhaddw_w_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xce9035c49ffff570; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000004; + *((unsigned long *)&__m128i_op1[0]) = 0xce9035c49ffff574; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000004; + *((unsigned long *)&__m128i_result[0]) = 0x00000454ffff9573; + __m128i_out = __lsx_vhaddw_w_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x80007fc000003f00; + *((unsigned long *)&__m128i_op0[0]) = 0x7d187e427c993f80; + *((unsigned long *)&__m128i_op1[1]) = 0x7500000075000000; + *((unsigned long *)&__m128i_op1[0]) = 0x7500000075000000; + *((unsigned long *)&__m128i_result[1]) = 0xffff800000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00007d1800007c99; + __m128i_out = __lsx_vhaddw_w_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vhaddw_w_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x5555000054100000; + *((unsigned long *)&__m128i_op1[0]) = 0x5555000154100155; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000100000155; + __m128i_out = __lsx_vhaddw_w_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vhaddw_w_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vhaddw_d_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vhaddw_d_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000200; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000200; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000200; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000200; + __m128i_out = __lsx_vhaddw_d_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xfffffffebe6ed565; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xfffffffebe6ed565; + *((unsigned long *)&__m128i_result[1]) = 0xfffffffffffffffe; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffbe6ed563; + __m128i_out = __lsx_vhaddw_d_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x78c00000ff000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000078c00000; + __m128i_out = __lsx_vhaddw_d_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x7d3ac60000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x000000007d3ac600; + __m128i_out = __lsx_vhaddw_d_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vhaddw_d_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x7fffffff82bb9784; + *((unsigned long *)&__m128i_op1[0]) = 0x7fffffffc6bb97ac; + *((unsigned long *)&__m128i_result[1]) = 0xffffffff82bb9784; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffc6bb97ac; + __m128i_out = __lsx_vhaddw_d_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vhaddw_d_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vhaddw_d_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x003f0000ffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0x003f0000ffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x003f0000ffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0x003f0000ffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x00000000003effff; + *((unsigned long *)&__m128i_result[0]) = 0x00000000003effff; + __m128i_out = __lsx_vhaddw_d_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vhaddw_d_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0xf359f359f359f359; + *((unsigned long *)&__m128i_op1[0]) = 0xf359f359f359f359; + *((unsigned long *)&__m128i_result[1]) = 0xfffffffff359f358; + *((unsigned long *)&__m128i_result[0]) = 0xfffffffff359f358; + __m128i_out = __lsx_vhaddw_d_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x6363636363636363; + *((unsigned long *)&__m128i_op0[0]) = 0x6363636363636363; + *((unsigned long *)&__m128i_op1[1]) = 0x7f8000007f800000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x00000000e2e36363; + *((unsigned long *)&__m128i_result[0]) = 0x0000000063636363; + __m128i_out = __lsx_vhaddw_d_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vhaddw_q_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffe000ffffe000; + *((unsigned long *)&__m128i_op0[0]) = 0xffffe000ffffe000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffff02000200; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffe00001ffe200; + __m128i_out = __lsx_vhaddw_q_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000383; + *((unsigned long *)&__m128i_op0[0]) = 0xe400000003ffc001; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000001000001; + *((unsigned long *)&__m128i_op1[0]) = 0xffffe000ffff1fff; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffe000ffff2382; + __m128i_out = __lsx_vhaddw_q_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x03574e39e496cbc9; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000001010000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x03574e38e496cbc9; + __m128i_out = __lsx_vhaddw_q_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xabff54e911f71b07; + *((unsigned long *)&__m128i_op0[0]) = 0xa9ec4882f216ea11; + *((unsigned long *)&__m128i_op1[1]) = 0xfc01fcfefc02fdf7; + *((unsigned long *)&__m128i_op1[0]) = 0xfe00fcfffe01fd01; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xaa0051e90ff91808; + __m128i_out = __lsx_vhaddw_q_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vhaddw_q_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xfffffffe00000001; + *((unsigned long *)&__m128i_op1[1]) = 0x7fff7fff7fff7fff; + *((unsigned long *)&__m128i_op1[0]) = 0x000000030000003f; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x000000030000003f; + __m128i_out = __lsx_vhaddw_q_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xfffffff000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vhaddw_q_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x00000000ffff53d9; + *((unsigned long *)&__m128i_op1[0]) = 0xffff0001ffff9515; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffff0001ffff9514; + __m128i_out = __lsx_vhaddw_q_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x9c9c9c9c9c9c9c9c; + *((unsigned long *)&__m128i_op0[0]) = 0x9c9c9c9c9c9c9c9c; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x9c9c9c9c9c9c9c9c; + __m128i_out = __lsx_vhaddw_q_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000200000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0002000200000001; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000200000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0002000200000001; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0002000400000001; + __m128i_out = __lsx_vhaddw_q_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xff80ff807e017f01; + *((unsigned long *)&__m128i_op0[0]) = 0x7f3b7f3f7f3b7f21; + *((unsigned long *)&__m128i_op1[1]) = 0x0a0000001e000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0a000000f6000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0980ff8174017f01; + __m128i_out = __lsx_vhaddw_q_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x3a8000003a800000; + *((unsigned long *)&__m128i_op1[0]) = 0x000ef0000000003b; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x000ef0000000003b; + __m128i_out = __lsx_vhaddw_q_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000011ff040; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00000000011ff040; + __m128i_out = __lsx_vhaddw_q_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vhaddw-2.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vhaddw-2.c new file mode 100644 index 00000000000..37c769a2dc2 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vhaddw-2.c @@ -0,0 +1,452 @@ +/* { dg-do run } */ +/* { dg-options "-mlsx -w -fno-strict-aliasing" } */ +#include "../simd_correctness_check.h" +#include + +int +main () +{ + __m128i __m128i_op0, __m128i_op1, __m128i_op2, __m128i_out, __m128i_result; + __m128 __m128_op0, __m128_op1, __m128_op2, __m128_out, __m128_result; + __m128d __m128d_op0, __m128d_op1, __m128d_op2, __m128d_out, __m128d_result; + + int int_op0, int_op1, int_op2, int_out, int_result, i = 1, fail; + long int long_op0, long_op1, long_op2, lont_out, lont_result; + long int long_int_out, long_int_result; + unsigned int unsigned_int_out, unsigned_int_result; + unsigned long int unsigned_long_int_out, unsigned_long_int_result; + + *((unsigned long *)&__m128i_op0[1]) = 0x00000000fff8fff8; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000fff80000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000ff00ff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000ff0000; + __m128i_out = __lsx_vhaddw_hu_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xff80000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0xff80000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0080000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0080000000000000; + __m128i_out = __lsx_vhaddw_hu_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vhaddw_hu_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x5252525252525252; + *((unsigned long *)&__m128i_op0[0]) = 0x5252525252525252; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0052005200520052; + *((unsigned long *)&__m128i_result[0]) = 0x0052005200520052; + __m128i_out = __lsx_vhaddw_hu_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vhaddw_hu_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x000000000000fffd; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_result[1]) = 0x00ff00ff00ff00ff; + *((unsigned long *)&__m128i_result[0]) = 0x00ff00ff000000ff; + __m128i_out = __lsx_vhaddw_hu_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00060012000e002b; + *((unsigned long *)&__m128i_op0[0]) = 0x00000049ffffffaa; + *((unsigned long *)&__m128i_op1[1]) = 0x000000060000000e; + *((unsigned long *)&__m128i_op1[0]) = 0x000000127fffffea; + *((unsigned long *)&__m128i_result[1]) = 0x000000060000000e; + *((unsigned long *)&__m128i_result[0]) = 0x0000001201fe01e9; + __m128i_out = __lsx_vhaddw_hu_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x5d7f5d807fea807f; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x007f008000ea007f; + *((unsigned long *)&__m128i_result[0]) = 0x00ff00ff00ff00ff; + __m128i_out = __lsx_vhaddw_hu_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vhaddw_hu_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vhaddw_wu_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x4f804f804f804f80; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x4f804f804f804f80; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00009f0000009f00; + __m128i_out = __lsx_vhaddw_wu_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000bd3d00000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000bd3d00000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000bd3d00000000; + __m128i_out = __lsx_vhaddw_wu_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vhaddw_wu_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000000000000001f; + *((unsigned long *)&__m128i_op0[0]) = 0x000000000000001f; + *((unsigned long *)&__m128i_op1[1]) = 0xffff007f00000000; + *((unsigned long *)&__m128i_op1[0]) = 0xffff007f00000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000007f00000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000007f00000000; + __m128i_out = __lsx_vhaddw_wu_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x7ef400ad21fc7081; + *((unsigned long *)&__m128i_op1[0]) = 0x28bf0351ec69b5f2; + *((unsigned long *)&__m128i_result[1]) = 0x000000ad00007081; + *((unsigned long *)&__m128i_result[0]) = 0x000003510000b5f2; + __m128i_out = __lsx_vhaddw_wu_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x5252adadadadadad; + *((unsigned long *)&__m128i_op1[0]) = 0xadad52525252adad; + *((unsigned long *)&__m128i_result[1]) = 0x0000adad0000adad; + *((unsigned long *)&__m128i_result[0]) = 0x000052520000adad; + __m128i_out = __lsx_vhaddw_wu_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000ffff0000ffff; + *((unsigned long *)&__m128i_op0[0]) = 0x0000ff8000010f78; + *((unsigned long *)&__m128i_op1[1]) = 0x002a001a001a000b; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000001a0000000b; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000001; + __m128i_out = __lsx_vhaddw_wu_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x7500000075007500; + *((unsigned long *)&__m128i_op0[0]) = 0x00feff8000ff80ff; + *((unsigned long *)&__m128i_op1[1]) = 0xffff800000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x00007d1800007c99; + *((unsigned long *)&__m128i_result[1]) = 0x0000f50000007500; + *((unsigned long *)&__m128i_result[0]) = 0x00007e1600007d98; + __m128i_out = __lsx_vhaddw_wu_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffff760386bdae46; + *((unsigned long *)&__m128i_op0[0]) = 0xc1fc7941bc7e00ff; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0802080408060803; + *((unsigned long *)&__m128i_result[1]) = 0x0000ffff000086bd; + *((unsigned long *)&__m128i_result[0]) = 0x0000ca000000c481; + __m128i_out = __lsx_vhaddw_wu_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x000000000007fff9; + *((unsigned long *)&__m128i_op1[1]) = 0xffff2356fe165486; + *((unsigned long *)&__m128i_op1[0]) = 0x5efeb3165bd7653d; + *((unsigned long *)&__m128i_result[1]) = 0x0000235600005486; + *((unsigned long *)&__m128i_result[0]) = 0x0000b31600006544; + __m128i_out = __lsx_vhaddw_wu_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x9c83e21a22001818; + *((unsigned long *)&__m128i_op0[0]) = 0xdd3b8b02563b2d7b; + *((unsigned long *)&__m128i_op1[1]) = 0x4f4f4f4f4f4f4f4f; + *((unsigned long *)&__m128i_op1[0]) = 0x4f4f4f4f4f4f4f4f; + *((unsigned long *)&__m128i_result[1]) = 0x0000ebd20000714f; + *((unsigned long *)&__m128i_result[0]) = 0x00012c8a0000a58a; + __m128i_out = __lsx_vhaddw_wu_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000003; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vhaddw_du_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xa8beed87bc3f2be1; + *((unsigned long *)&__m128i_op0[0]) = 0x0024d8f6a494006a; + *((unsigned long *)&__m128i_op1[1]) = 0xfeffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xfeffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x00000001a8beed86; + *((unsigned long *)&__m128i_result[0]) = 0x000000010024d8f5; + __m128i_out = __lsx_vhaddw_du_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000001; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000001; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000001; + __m128i_out = __lsx_vhaddw_du_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00000000ffffffff; + __m128i_out = __lsx_vhaddw_du_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vhaddw_du_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000078c00000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_op1[0]) = 0x6a57a30ff0000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_result[0]) = 0x00000000f0000000; + __m128i_out = __lsx_vhaddw_du_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x000000000000040d; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vhaddw_du_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000001; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vhaddw_du_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x00000001fffffffe; + *((unsigned long *)&__m128i_result[0]) = 0x00000001fffffffe; + __m128i_out = __lsx_vhaddw_du_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_op1[1]) = 0x80000000b57ec564; + *((unsigned long *)&__m128i_op1[0]) = 0x8000000083ff0be0; + *((unsigned long *)&__m128i_result[1]) = 0x00000001b57ec563; + *((unsigned long *)&__m128i_result[0]) = 0x0000000183ff0bdf; + __m128i_out = __lsx_vhaddw_du_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00000000ffffffff; + __m128i_out = __lsx_vhaddw_du_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vhaddw_du_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x8000e2e3ffffd1d3; + *((unsigned long *)&__m128i_op0[0]) = 0x8000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x000000008000e2e3; + *((unsigned long *)&__m128i_result[0]) = 0x0000000080000000; + __m128i_out = __lsx_vhaddw_du_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000200010002; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000200000002; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000200010002; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000200000002; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000010004; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000004; + __m128i_out = __lsx_vhaddw_du_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x00000000ffffffff; + __m128i_out = __lsx_vhaddw_du_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x00000001fffffffe; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vhaddw_du_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000001000000001; + *((unsigned long *)&__m128i_op1[0]) = 0x0000001000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vhaddw_du_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_op1[1]) = 0x4ee85545ffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0x870968c1f56bb3cd; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x870968c1f56bb3cd; + __m128i_out = __lsx_vhaddw_qu_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x000000000000013d; + *((unsigned long *)&__m128i_op1[1]) = 0x0010001000030000; + *((unsigned long *)&__m128i_op1[0]) = 0x0006000200000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0006000200000000; + __m128i_out = __lsx_vhaddw_qu_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffff01ff01; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_result[0]) = 0xfffffffffffffffe; + __m128i_out = __lsx_vhaddw_qu_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vhaddw_qu_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000000000000001b; + *((unsigned long *)&__m128i_op0[0]) = 0x000000000000001b; + *((unsigned long *)&__m128i_op1[1]) = 0x00000000001b0000; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000001b0000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00000000001b001b; + __m128i_out = __lsx_vhaddw_qu_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000004870ba0; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000004870ba0; + __m128i_out = __lsx_vhaddw_qu_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000010000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000010000000; + *((unsigned long *)&__m128i_op1[1]) = 0xff800000ff800000; + *((unsigned long *)&__m128i_op1[0]) = 0xff800000ff800000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xff8000010f800000; + __m128i_out = __lsx_vhaddw_qu_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x00007fff7fff8000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vhaddw_qu_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x00000000000003e2; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vhaddw_qu_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vhaddw_qu_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmadd.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmadd.c new file mode 100644 index 00000000000..3fade5157cc --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmadd.c @@ -0,0 +1,450 @@ +/* { dg-do run } */ +/* { dg-options "-mlsx -w -fno-strict-aliasing" } */ +#include "../simd_correctness_check.h" +#include + +int +main () +{ + __m128i __m128i_op0, __m128i_op1, __m128i_op2, __m128i_out, __m128i_result; + __m128 __m128_op0, __m128_op1, __m128_op2, __m128_out, __m128_result; + __m128d __m128d_op0, __m128d_op1, __m128d_op2, __m128d_out, __m128d_result; + + int int_op0, int_op1, int_op2, int_out, int_result, i = 1, fail; + long int long_op0, long_op1, long_op2, lont_out, lont_result; + long int long_int_out, long_int_result; + unsigned int unsigned_int_out, unsigned_int_result; + unsigned long int unsigned_long_int_out, unsigned_long_int_result; + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0xffffffffa486c90f; + *((unsigned long *)&__m128i_op2[0]) = 0x1f52d710bf295626; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmadd_w (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmadd_d (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmadd_b (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x7ff0000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x7ff0000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vmadd_b (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000ffff00000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000ffff0000ffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmadd_d (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000200000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000200000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000200000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmadd_h (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmadd_d (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffff7f01ff01; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x78c00000ff000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffff7f01ff01; + __m128i_out = __lsx_vmadd_b (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmadd_h (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xfa31dfa21672e711; + *((unsigned long *)&__m128i_op1[0]) = 0x1304db85e468073a; + *((unsigned long *)&__m128i_op2[1]) = 0x887c8beb969e00f2; + *((unsigned long *)&__m128i_op2[0]) = 0x101f8b680b6f8095; + *((unsigned long *)&__m128i_result[1]) = 0x7582ed22cb1c6e12; + *((unsigned long *)&__m128i_result[0]) = 0x35aaa61c944f34c2; + __m128i_out = __lsx_vmadd_d (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x5252525252525252; + *((unsigned long *)&__m128i_op0[0]) = 0x5252525252525252; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op2[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x5252525252525252; + *((unsigned long *)&__m128i_result[0]) = 0x5252525252525252; + __m128i_out = __lsx_vmadd_b (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + int_out = __lsx_vpickve2gr_b (__m128i_op0, 0xc); + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xfffffffffffffffe; + *((unsigned long *)&__m128i_op2[1]) = 0xbfffbfffbfffbffe; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x4000400040004002; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmadd_d (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfe01fe01fe01fe01; + *((unsigned long *)&__m128i_op0[0]) = 0xfe01fe01fe01fe01; + *((unsigned long *)&__m128i_op1[1]) = 0xfe01fe01fe01fe01; + *((unsigned long *)&__m128i_op1[0]) = 0xfe01fe01fe01fe01; + *((unsigned long *)&__m128i_op2[1]) = 0xff00ff00ff00ff00; + *((unsigned long *)&__m128i_op2[0]) = 0xff00ff00ff00ff00; + *((unsigned long *)&__m128i_result[1]) = 0xf10cf508f904fd01; + *((unsigned long *)&__m128i_result[0]) = 0xf10cf508f904fd01; + __m128i_out = __lsx_vmadd_d (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffb080ffffb080; + *((unsigned long *)&__m128i_op1[0]) = 0xffffb080ffffb080; + *((unsigned long *)&__m128i_op2[1]) = 0x004fcfcfd01f9f9f; + *((unsigned long *)&__m128i_op2[0]) = 0x9f4fcfcfcf800000; + *((unsigned long *)&__m128i_result[1]) = 0x3504b5fd2dee1f80; + *((unsigned long *)&__m128i_result[0]) = 0x4676f70fc0000000; + __m128i_out = __lsx_vmadd_d (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xf7f7f7ff8e8c6d7e; + *((unsigned long *)&__m128i_op0[0]) = 0xf7f7f7f7f7f7fbff; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_op2[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0xf7f7f7ff8e8c6d7e; + *((unsigned long *)&__m128i_result[0]) = 0xf7f7f7f7f7f7fbff; + __m128i_out = __lsx_vmadd_h (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0808080808080808; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmadd_d (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000002000000020; + *((unsigned long *)&__m128i_op0[0]) = 0x0000002000000020; + *((unsigned long *)&__m128i_op1[1]) = 0x0fbc1df53c1ae3f9; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000ff820f81; + *((unsigned long *)&__m128i_op2[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op2[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0xf144e32bc4e61d27; + *((unsigned long *)&__m128i_result[0]) = 0x00000020017ef19f; + __m128i_out = __lsx_vmadd_b (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000004b01; + *((unsigned long *)&__m128i_op1[1]) = 0x00d3012acc56f9bb; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000000000a0; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000004b01; + __m128i_out = __lsx_vmadd_w (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x0000001000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000ffff0000ffff; + *((unsigned long *)&__m128i_op2[0]) = 0x0000ffff0000ff00; + *((unsigned long *)&__m128i_result[1]) = 0xffffffefffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vmadd_h (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000001010001; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffff0000ffff; + *((unsigned long *)&__m128i_op2[1]) = 0x0fff0fff0fff0fff; + *((unsigned long *)&__m128i_op2[0]) = 0x0fff0fff0fff0fff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xf001f0010101f002; + __m128i_out = __lsx_vmadd_h (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmadd_d (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000fffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0x0010000000000001; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000007f41; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x000fffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x0010000000000001; + __m128i_out = __lsx_vmadd_h (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x01ff020000ff03ff; + *((unsigned long *)&__m128i_op0[0]) = 0x01346b8d00b04c5a; + *((unsigned long *)&__m128i_op1[1]) = 0x002affd600000001; + *((unsigned long *)&__m128i_op1[0]) = 0xcbc2723a4f12a5f8; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x01ff020000ff03ff; + *((unsigned long *)&__m128i_result[0]) = 0x01346b8d00b04c5a; + __m128i_out = __lsx_vmadd_b (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000080808000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000080808000; + __m128i_out = __lsx_vmadd_h (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x4040404040404040; + *((unsigned long *)&__m128i_op1[0]) = 0x4040404040404040; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmadd_d (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00ff000000ff0000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x00ff000000ff0000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmadd_w (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000455555555; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000455555555; + __m128i_out = __lsx_vmadd_b (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x007f00ff00ff00fe; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x7ffffffe00000000; + *((unsigned long *)&__m128i_op2[0]) = 0x7ffffffe00000000; + *((unsigned long *)&__m128i_result[1]) = 0x007f00ff00ff00fe; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmadd_b (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xdcec560380000000; + *((unsigned long *)&__m128i_op0[0]) = 0x08ec7f7f80000000; + *((unsigned long *)&__m128i_op1[1]) = 0x7fff010181010102; + *((unsigned long *)&__m128i_op1[0]) = 0x7fffffff81010102; + *((unsigned long *)&__m128i_op2[1]) = 0x32d8f0a905b6c59b; + *((unsigned long *)&__m128i_op2[0]) = 0x322a52fc2ba83b96; + *((unsigned long *)&__m128i_result[1]) = 0xaa14efac3bb62636; + *((unsigned long *)&__m128i_result[0]) = 0xd6c22c8353a80d2c; + __m128i_out = __lsx_vmadd_h (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op2[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vmadd_w (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x8080808080808080; + *((unsigned long *)&__m128i_op2[0]) = 0x8080808080808080; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmadd_w (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x00009c7c00007176; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0xff000000001f1f00; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00009c7c00007176; + __m128i_out = __lsx_vmadd_h (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00060fbf00040fbf; + *((unsigned long *)&__m128i_op0[0]) = 0x00020fbf00000fbf; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x9727b8499727b849; + *((unsigned long *)&__m128i_op2[0]) = 0x12755900b653f081; + *((unsigned long *)&__m128i_result[1]) = 0x00060fbf00040fbf; + *((unsigned long *)&__m128i_result[0]) = 0x00020fbf00000fbf; + __m128i_out = __lsx_vmadd_b (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000021100000211; + *((unsigned long *)&__m128i_op0[0]) = 0xfb141d31fb141d31; + *((unsigned long *)&__m128i_op1[1]) = 0x001effae001effae; + *((unsigned long *)&__m128i_op1[0]) = 0x001effae001effae; + *((unsigned long *)&__m128i_op2[1]) = 0x2006454690d3de87; + *((unsigned long *)&__m128i_op2[0]) = 0x2006454690d3de87; + *((unsigned long *)&__m128i_result[1]) = 0xc0b4d1a5f8babad3; + *((unsigned long *)&__m128i_result[0]) = 0xbbc8ecc5f3ced5f3; + __m128i_out = __lsx_vmadd_h (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0674c886fcba4e98; + *((unsigned long *)&__m128i_op0[0]) = 0xfdce8003090b0906; + *((unsigned long *)&__m128i_op1[1]) = 0x003fffc0ffc0003f; + *((unsigned long *)&__m128i_op1[0]) = 0xffc0ffc0003f003f; + *((unsigned long *)&__m128i_op2[1]) = 0x002a05a2f059094a; + *((unsigned long *)&__m128i_op2[0]) = 0x05ad3ba576eae048; + *((unsigned long *)&__m128i_result[1]) = 0xd4a6cc27d02397ce; + *((unsigned long *)&__m128i_result[0]) = 0x24b85f887e903abe; + __m128i_out = __lsx_vmadd_d (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x7f8000007f800000; + *((unsigned long *)&__m128i_op0[0]) = 0x7f8000007f800000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0700f8ff0700f8ff; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000007020701; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000007010701; + *((unsigned long *)&__m128i_result[1]) = 0x7f8000007f800000; + *((unsigned long *)&__m128i_result[0]) = 0x7f8000008680f1ff; + __m128i_out = __lsx_vmadd_h (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x6363636463abdf17; + *((unsigned long *)&__m128i_op0[0]) = 0x41f8e08016161198; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x6363636463abdf17; + *((unsigned long *)&__m128i_result[0]) = 0x41f8e08016161198; + __m128i_out = __lsx_vmadd_w (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffff00ff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op2[1]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_op2[0]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmadd_h (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000ff800000; + *((unsigned long *)&__m128i_op1[1]) = 0x17c64aaef639f093; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0xf6548a1747e59090; + *((unsigned long *)&__m128i_op2[0]) = 0x27b169bbb8145f50; + *((unsigned long *)&__m128i_result[1]) = 0x10f881a20ffd02b0; + *((unsigned long *)&__m128i_result[0]) = 0x00000000ff800000; + __m128i_out = __lsx_vmadd_h (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmaddwev-1.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmaddwev-1.c new file mode 100644 index 00000000000..d3fd83da757 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmaddwev-1.c @@ -0,0 +1,472 @@ +/* { dg-do run } */ +/* { dg-options "-mlsx -w -fno-strict-aliasing" } */ +#include "../simd_correctness_check.h" +#include + +int +main () +{ + __m128i __m128i_op0, __m128i_op1, __m128i_op2, __m128i_out, __m128i_result; + __m128 __m128_op0, __m128_op1, __m128_op2, __m128_out, __m128_result; + __m128d __m128d_op0, __m128d_op1, __m128d_op2, __m128d_out, __m128d_result; + + int int_op0, int_op1, int_op2, int_out, int_result, i = 1, fail; + long int long_op0, long_op1, long_op2, lont_out, lont_result; + long int long_int_out, long_int_result; + unsigned int unsigned_int_out, unsigned_int_result; + unsigned long int unsigned_long_int_out, unsigned_long_int_result; + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000036de0000; + *((unsigned long *)&__m128i_op1[0]) = 0x000000003be14000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000001f0a; + *((unsigned long *)&__m128i_op2[0]) = 0x00000000ffff7a53; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00000000001f0000; + __m128i_out = __lsx_vmaddwev_h_b (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000000000000006f; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000001f0a; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x000000000000006f; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000001f0a; + __m128i_out = __lsx_vmaddwev_h_b (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x000000000000cdc1; + *((unsigned long *)&__m128i_op1[1]) = 0xe93d0bd19ff0c170; + *((unsigned long *)&__m128i_op1[0]) = 0x5237c1bac9eadf55; + *((unsigned long *)&__m128i_op2[1]) = 0x05d0ae6002e8748e; + *((unsigned long *)&__m128i_op2[0]) = 0xcd1de80217374041; + *((unsigned long *)&__m128i_result[1]) = 0xf490ee600180ce20; + *((unsigned long *)&__m128i_result[0]) = 0x063bff74fb46e356; + __m128i_out = __lsx_vmaddwev_h_b (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x4040404040404040; + *((unsigned long *)&__m128i_op1[0]) = 0x4040404040404040; + *((unsigned long *)&__m128i_op2[1]) = 0x4040404040404040; + *((unsigned long *)&__m128i_op2[0]) = 0x4040404040404040; + *((unsigned long *)&__m128i_result[1]) = 0x0fff0fff0fff0fff; + *((unsigned long *)&__m128i_result[0]) = 0x0fff0fff0fff0fff; + __m128i_out = __lsx_vmaddwev_h_b (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x6363636363636363; + *((unsigned long *)&__m128i_op0[0]) = 0x6363636363636363; + *((unsigned long *)&__m128i_op1[1]) = 0x6363636363636363; + *((unsigned long *)&__m128i_op1[0]) = 0x6363636363636363; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x6363636363636363; + *((unsigned long *)&__m128i_result[0]) = 0x6363636363636363; + __m128i_out = __lsx_vmaddwev_h_b (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmaddwev_h_b (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffff0000ffff0000; + *((unsigned long *)&__m128i_op0[0]) = 0xfffe00029f9f6061; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x3f5ec0a0feefa0b0; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x000000007fff7fff; + *((unsigned long *)&__m128i_result[1]) = 0xffff0000ffff0000; + *((unsigned long *)&__m128i_result[0]) = 0xfffe00029fb060b1; + __m128i_out = __lsx_vmaddwev_h_b (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + int_out = __lsx_vpickve2gr_w (__m128i_op0, 0x3); + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000008; + *((unsigned long *)&__m128i_op0[0]) = 0xfffffffffffffff8; + *((unsigned long *)&__m128i_op1[1]) = 0x8d78336c83652b86; + *((unsigned long *)&__m128i_op1[0]) = 0x39c51f389c0d6112; + *((unsigned long *)&__m128i_op2[1]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_op2[0]) = 0xffff0001ffff0000; + *((unsigned long *)&__m128i_result[1]) = 0x00000000ff9b0082; + *((unsigned long *)&__m128i_result[0]) = 0x003a0037fff2fff8; + __m128i_out = __lsx_vmaddwev_h_b (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000000ff0000857a; + *((unsigned long *)&__m128i_op0[0]) = 0x05fafe0101fe000e; + *((unsigned long *)&__m128i_op1[1]) = 0x000000ff0000857a; + *((unsigned long *)&__m128i_op1[0]) = 0x05fafe0101fe000e; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x000000ff0000857a; + *((unsigned long *)&__m128i_result[0]) = 0x05fafe0101fe000e; + __m128i_out = __lsx_vmaddwev_h_b (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmaddwev_w_h (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffff82bb9784; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffc6bb97ac; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x7fffffff82bb9784; + *((unsigned long *)&__m128i_op2[0]) = 0x7fffffffc6bb97ac; + *((unsigned long *)&__m128i_result[1]) = 0xffffffff82bb9784; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffc6bb97ac; + __m128i_out = __lsx_vmaddwev_w_h (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x05d0ba0002e8802e; + *((unsigned long *)&__m128i_op0[0]) = 0xd005e802174023d6; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xc000c000c000ff81; + *((unsigned long *)&__m128i_op2[1]) = 0x0ba00ba00ba00ba0; + *((unsigned long *)&__m128i_op2[0]) = 0x0ba00ba00ba011eb; + *((unsigned long *)&__m128i_result[1]) = 0x05d0ae6002e8748e; + *((unsigned long *)&__m128i_result[0]) = 0xcd1de80217374041; + __m128i_out = __lsx_vmaddwev_w_h (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000010000; + *((unsigned long *)&__m128i_op1[0]) = 0x00ff00ff00fe00ff; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x00000fff00000e36; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x000fef01000e27ca; + __m128i_out = __lsx_vmaddwev_w_h (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x7fff00007fff0000; + *((unsigned long *)&__m128i_op1[0]) = 0x7fff00007fff0000; + *((unsigned long *)&__m128i_op2[1]) = 0x7fff00007fff0000; + *((unsigned long *)&__m128i_op2[0]) = 0x7fff00007fff0000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmaddwev_w_h (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000040; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000040; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000040; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000040; + __m128i_out = __lsx_vmaddwev_w_h (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x680485c8b304b019; + *((unsigned long *)&__m128i_op0[0]) = 0xc89d7f0fed582019; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x000000003ddc5dac; + *((unsigned long *)&__m128i_op2[1]) = 0x67157b5100005000; + *((unsigned long *)&__m128i_op2[0]) = 0x387c7e0a133f2000; + *((unsigned long *)&__m128i_result[1]) = 0x680485c8b304b019; + *((unsigned long *)&__m128i_result[0]) = 0xc89d7f0ff90da019; + __m128i_out = __lsx_vmaddwev_w_h (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000ff0000ff0000; + *((unsigned long *)&__m128i_op1[0]) = 0x01fc020000fe0100; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmaddwev_d_w (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x8000000080000000; + *((unsigned long *)&__m128i_op0[0]) = 0x7fffffff7fffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000200000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x8000000080000000; + *((unsigned long *)&__m128i_result[0]) = 0x7fffffff7fffffff; + __m128i_out = __lsx_vmaddwev_d_w (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmaddwev_d_w (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000100fe000100fe; + *((unsigned long *)&__m128i_op0[0]) = 0x0000ffff0000ffff; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0xffff0000ffff0000; + *((unsigned long *)&__m128i_result[1]) = 0x000100fe000100fe; + *((unsigned long *)&__m128i_result[0]) = 0x0000ffff0000ffff; + __m128i_out = __lsx_vmaddwev_d_w (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0xa23214697fd03f7f; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vmaddwev_d_w (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmaddwev_d_w (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000010000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmaddwev_d_w (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x7c7c9c0000007176; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x00000000f3040705; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x7c7c9c0000007176; + __m128i_out = __lsx_vmaddwev_d_w (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x022002101b200203; + *((unsigned long *)&__m128i_op0[0]) = 0x022002101b200203; + *((unsigned long *)&__m128i_op1[1]) = 0x022002101b200203; + *((unsigned long *)&__m128i_op1[0]) = 0x022002101b200203; + *((unsigned long *)&__m128i_op2[1]) = 0x000000080c43b700; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x036caeeca7592703; + *((unsigned long *)&__m128i_result[0]) = 0x022002101b200203; + __m128i_out = __lsx_vmaddwev_d_w (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x9c83e21a22001818; + *((unsigned long *)&__m128i_op1[0]) = 0xdd3b8b02563b2d7b; + *((unsigned long *)&__m128i_op2[1]) = 0x000000009c83e21a; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000022001818; + *((unsigned long *)&__m128i_result[1]) = 0xf2c97aaa7d8fa270; + *((unsigned long *)&__m128i_result[0]) = 0x0b73e427f7cfcb88; + __m128i_out = __lsx_vmaddwev_d_w (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmaddwev_q_d (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmaddwev_q_d (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmaddwev_q_d (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0010001000030000; + *((unsigned long *)&__m128i_op0[0]) = 0x0006000200000000; + *((unsigned long *)&__m128i_op1[1]) = 0x7505445465593af1; + *((unsigned long *)&__m128i_op1[0]) = 0x0100d6effefd0498; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0010001000030000; + *((unsigned long *)&__m128i_result[0]) = 0x0006000200000000; + __m128i_out = __lsx_vmaddwev_q_d (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000800; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000800; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000800; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmaddwev_q_d (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0007000000040000; + *((unsigned long *)&__m128i_op0[0]) = 0x0003000000010000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000780000007800; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0007000000040000; + *((unsigned long *)&__m128i_result[0]) = 0x0003000000010000; + __m128i_out = __lsx_vmaddwev_q_d (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmaddwev_q_d (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xf047ef0000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmaddwev_q_d (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffff80800001; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffff80800001; + *((unsigned long *)&__m128i_op1[1]) = 0xfffffffff7fff7ef; + *((unsigned long *)&__m128i_op1[0]) = 0x80808080ffffffff; + *((unsigned long *)&__m128i_op2[1]) = 0x0000080800000808; + *((unsigned long *)&__m128i_op2[0]) = 0x0000080800000808; + *((unsigned long *)&__m128i_result[1]) = 0xfffffbff8888080a; + *((unsigned long *)&__m128i_result[0]) = 0x080803ff807ff7f9; + __m128i_out = __lsx_vmaddwev_q_d (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x3fc03fc000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x7f801fe000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op2[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x3fc03fc000000000; + *((unsigned long *)&__m128i_result[0]) = 0x7f801fe000000000; + __m128i_out = __lsx_vmaddwev_q_d (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x01fe01fd01fd01fd; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x5d7f5d007f6a007f; + *((unsigned long *)&__m128i_op2[0]) = 0x7fff7fff7fff7f00; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmaddwev_q_d (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000060000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000500000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000060000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmaddwev_q_d (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0xf8f8f8f8f8f8f8f8; + *((unsigned long *)&__m128i_op2[0]) = 0xf8f8f8f8f8f8f8f8; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmaddwev_q_d (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmaddwev_q_d (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op2[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmaddwev_q_d (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmaddwev-2.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmaddwev-2.c new file mode 100644 index 00000000000..83928568584 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmaddwev-2.c @@ -0,0 +1,383 @@ +/* { dg-do run } */ +/* { dg-options "-mlsx -w -fno-strict-aliasing" } */ +#include "../simd_correctness_check.h" +#include + +int +main () +{ + __m128i __m128i_op0, __m128i_op1, __m128i_op2, __m128i_out, __m128i_result; + __m128 __m128_op0, __m128_op1, __m128_op2, __m128_out, __m128_result; + __m128d __m128d_op0, __m128d_op1, __m128d_op2, __m128d_out, __m128d_result; + + int int_op0, int_op1, int_op2, int_out, int_result, i = 1, fail; + long int long_op0, long_op1, long_op2, lont_out, lont_result; + long int long_int_out, long_int_result; + unsigned int unsigned_int_out, unsigned_int_result; + unsigned long int unsigned_long_int_out, unsigned_long_int_result; + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000001; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmaddwev_h_bu (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x7fffffff00000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x7fffffff00000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x7fffffff00000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x7e00fe0000000000; + __m128i_out = __lsx_vmaddwev_h_bu (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0808080808080808; + *((unsigned long *)&__m128i_op0[0]) = 0x0808080808080808; + *((unsigned long *)&__m128i_op1[1]) = 0xfffffffbffffff85; + *((unsigned long *)&__m128i_op1[0]) = 0xfffffffc0000fdfc; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0808080808080808; + *((unsigned long *)&__m128i_result[0]) = 0x0808080808080808; + __m128i_out = __lsx_vmaddwev_h_bu (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x3941248880000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x3941248880000000; + *((unsigned long *)&__m128i_op2[1]) = 0x3ff0000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x40f3fa0000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x76f4248880000000; + __m128i_out = __lsx_vmaddwev_h_bu (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000e36400005253; + *((unsigned long *)&__m128i_op2[0]) = 0x000035ed0000e000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmaddwev_h_bu (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0080008000800080; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmaddwev_h_bu (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmaddwev_h_bu (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x400000003fffffff; + *((unsigned long *)&__m128i_op0[0]) = 0x4000000040000000; + *((unsigned long *)&__m128i_op1[1]) = 0x000000007fffffff; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x400000003fffffff; + *((unsigned long *)&__m128i_result[0]) = 0x4000000040000000; + __m128i_out = __lsx_vmaddwev_h_bu (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xf1f1f1f149ed7273; + *((unsigned long *)&__m128i_op0[0]) = 0x78508ad4ec2ffcde; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000ffdfdc0d; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x00000000ffdfdc0d; + *((unsigned long *)&__m128i_result[1]) = 0xf1f1f1f149ed7273; + *((unsigned long *)&__m128i_result[0]) = 0x78508ad4ae70fd87; + __m128i_out = __lsx_vmaddwev_h_bu (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000440efffff000; + *((unsigned long *)&__m128i_op0[0]) = 0x000000000000003b; + *((unsigned long *)&__m128i_op1[1]) = 0x0000ffff0000ffff; + *((unsigned long *)&__m128i_op1[0]) = 0x0000ffff0000ffff; + *((unsigned long *)&__m128i_op2[1]) = 0x440ef000440ef000; + *((unsigned long *)&__m128i_op2[0]) = 0x4400000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000440efffff000; + *((unsigned long *)&__m128i_result[0]) = 0x000000000000003b; + __m128i_out = __lsx_vmaddwev_h_bu (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmaddwev_w_hu (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000000000ffc2f; + *((unsigned long *)&__m128i_op0[0]) = 0x00201df000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffc2ffe700000007; + *((unsigned long *)&__m128i_op1[0]) = 0x0000ffc100010001; + *((unsigned long *)&__m128i_op2[1]) = 0x00010020fffeffde; + *((unsigned long *)&__m128i_op2[0]) = 0x011f57c100201a46; + *((unsigned long *)&__m128i_result[1]) = 0x001ffce00016fb41; + *((unsigned long *)&__m128i_result[0]) = 0x57cb857100001a46; + __m128i_out = __lsx_vmaddwev_w_hu (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmaddwev_w_hu (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmaddwev_w_hu (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffff0000ffff0000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffff0000ffff0000; + *((unsigned long *)&__m128i_op1[0]) = 0x7ff0000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0xffff0000ffff0000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffff0000ffff0000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmaddwev_w_hu (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x8000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000800000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000800000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmaddwev_w_hu (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x7c7c9c0000007176; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x00ff000000001f1f; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x7c7c9c0000007176; + __m128i_out = __lsx_vmaddwev_w_hu (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xbfd10d0d7b6b6b73; + *((unsigned long *)&__m128i_op0[0]) = 0xc5c53492f25acbf2; + *((unsigned long *)&__m128i_op1[1]) = 0xff000000001f1f00; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xbfd10d0d7b6b6b73; + *((unsigned long *)&__m128i_result[0]) = 0xc5c53492f25acbf2; + __m128i_out = __lsx_vmaddwev_w_hu (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x34947b4b11684f92; + *((unsigned long *)&__m128i_op0[0]) = 0xd73691661e5b68b4; + *((unsigned long *)&__m128i_op1[1]) = 0x000016f303dff6d2; + *((unsigned long *)&__m128i_op1[0]) = 0x000016f303dff6d2; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x7fffffff00000001; + *((unsigned long *)&__m128i_result[1]) = 0x34947b4b11684f92; + *((unsigned long *)&__m128i_result[0]) = 0xee297a731e5c5f86; + __m128i_out = __lsx_vmaddwev_w_hu (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000ffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0x0001000100000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0177fff0fffffff0; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000011ff8bc; + *((unsigned long *)&__m128i_op2[1]) = 0x00bbfff7fffffff7; + *((unsigned long *)&__m128i_op2[0]) = 0xffffffff008ff820; + *((unsigned long *)&__m128i_result[1]) = 0xffe8008fffe7008f; + *((unsigned long *)&__m128i_result[0]) = 0x00010001f1153780; + __m128i_out = __lsx_vmaddwev_w_hu (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000100000001; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000100000021; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmaddwev_d_wu (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0001000100010002; + *((unsigned long *)&__m128i_op0[0]) = 0x0001000100010001; + *((unsigned long *)&__m128i_op1[1]) = 0x0001000100010002; + *((unsigned long *)&__m128i_op1[0]) = 0x0001000100010001; + *((unsigned long *)&__m128i_op2[1]) = 0x8080808080808080; + *((unsigned long *)&__m128i_op2[0]) = 0x8080808080808080; + *((unsigned long *)&__m128i_result[1]) = 0x0001808281820102; + *((unsigned long *)&__m128i_result[0]) = 0x0001808201018081; + __m128i_out = __lsx_vmaddwev_d_wu (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000010100fe0101; + *((unsigned long *)&__m128i_op2[0]) = 0xffff0200ffff01ff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmaddwev_d_wu (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000017fda829; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmaddwev_q_du (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000100000001; + *((unsigned long *)&__m128i_op1[0]) = 0x7f8000007f800000; + *((unsigned long *)&__m128i_op2[1]) = 0x00ffff0000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x00ffff0000000000; + *((unsigned long *)&__m128i_result[1]) = 0x007f7f80807f7f80; + *((unsigned long *)&__m128i_result[0]) = 0x8000000000000000; + __m128i_out = __lsx_vmaddwev_q_du (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000020302030; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000020302030; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmaddwev_q_du (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x7fffffff7fffffff; + *((unsigned long *)&__m128i_op0[0]) = 0x0101010101010101; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x3fffffffc0000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x7fffffff7fffffff; + *((unsigned long *)&__m128i_result[0]) = 0x0101010101010101; + __m128i_out = __lsx_vmaddwev_q_du (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000000006e17bfd8; + *((unsigned long *)&__m128i_op0[0]) = 0x000000006e17bfd8; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0xffffff0100000001; + *((unsigned long *)&__m128i_op2[0]) = 0xffffff0100000001; + *((unsigned long *)&__m128i_result[1]) = 0x000000006e17bfd8; + *((unsigned long *)&__m128i_result[0]) = 0x000000006e17bfd8; + __m128i_out = __lsx_vmaddwev_q_du (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0001000100000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xfffffffffffffffe; + *((unsigned long *)&__m128i_op1[0]) = 0xfffffffffffffffe; + *((unsigned long *)&__m128i_op2[1]) = 0xfffffffffffffffe; + *((unsigned long *)&__m128i_op2[0]) = 0xfffffffffffffffe; + *((unsigned long *)&__m128i_result[1]) = 0x00010000fffffffc; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000004; + __m128i_out = __lsx_vmaddwev_q_du (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000000008000e2e3; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000080000000; + *((unsigned long *)&__m128i_op1[1]) = 0x000000008000e2e3; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000080000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x00ff00ff00ff00ff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000080806362; + *((unsigned long *)&__m128i_result[0]) = 0x807f808000000000; + __m128i_out = __lsx_vmaddwev_q_du (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfffffffffffffffa; + *((unsigned long *)&__m128i_op0[0]) = 0xfffffffffffffffa; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xfffffffffffffffa; + *((unsigned long *)&__m128i_result[0]) = 0xfffffffffffffffa; + __m128i_out = __lsx_vmaddwev_q_du (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x8101010181010101; + *((unsigned long *)&__m128i_op1[0]) = 0x8101010181010101; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmaddwev_q_du (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0001000101010001; + *((unsigned long *)&__m128i_op0[0]) = 0x0001000100010001; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000014; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000014; + *((unsigned long *)&__m128i_op2[1]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_op2[0]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_result[1]) = 0x0001000101010015; + *((unsigned long *)&__m128i_result[0]) = 0x0000ffed00010001; + __m128i_out = __lsx_vmaddwev_q_du (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmaddwev-3.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmaddwev-3.c new file mode 100644 index 00000000000..bab2c6cf385 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmaddwev-3.c @@ -0,0 +1,383 @@ +/* { dg-do run } */ +/* { dg-options "-mlsx -w -fno-strict-aliasing" } */ +#include "../simd_correctness_check.h" +#include + +int +main () +{ + __m128i __m128i_op0, __m128i_op1, __m128i_op2, __m128i_out, __m128i_result; + __m128 __m128_op0, __m128_op1, __m128_op2, __m128_out, __m128_result; + __m128d __m128d_op0, __m128d_op1, __m128d_op2, __m128d_out, __m128d_result; + + int int_op0, int_op1, int_op2, int_out, int_result, i = 1, fail; + long int long_op0, long_op1, long_op2, lont_out, lont_result; + long int long_int_out, long_int_result; + unsigned int unsigned_int_out, unsigned_int_result; + unsigned long int unsigned_long_int_out, unsigned_long_int_result; + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0xc0c00000c0c00000; + *((unsigned long *)&__m128i_op2[0]) = 0xc0c00c01c2cd0009; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmaddwev_h_bu_b (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x7f78787f00f7f700; + *((unsigned long *)&__m128i_op1[0]) = 0x0000f7f700f7f700; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmaddwev_h_bu_b (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000400; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000400; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000400; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000400; + __m128i_out = __lsx_vmaddwev_h_bu_b (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x000000000000040d; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmaddwev_h_bu_b (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000080003f80ffff; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000002000000020; + *((unsigned long *)&__m128i_op1[0]) = 0x0000002000000020; + *((unsigned long *)&__m128i_op2[1]) = 0x3ff0010000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x3ff0010000000000; + *((unsigned long *)&__m128i_result[1]) = 0x000080003f80ffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmaddwev_h_bu_b (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x000000000000007b; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmaddwev_h_bu_b (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0xff81ff82ff810081; + *((unsigned long *)&__m128i_op2[0]) = 0xff82ff810081ff81; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmaddwev_h_bu_b (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmaddwev_h_bu_b (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0808080808080808; + *((unsigned long *)&__m128i_op0[0]) = 0x0808080808080808; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0808080808080808; + *((unsigned long *)&__m128i_result[0]) = 0x0808080808080808; + __m128i_out = __lsx_vmaddwev_h_bu_b (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffff8000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffff8000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000800000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000800000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffff8000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmaddwev_h_bu_b (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x841f000fc28f801f; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x841f000fc28f801f; + *((unsigned long *)&__m128i_op2[1]) = 0xff800000ff800000; + *((unsigned long *)&__m128i_op2[0]) = 0xe593c8c4e593c8c4; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x76ecfc8b85ac78db; + __m128i_out = __lsx_vmaddwev_h_bu_b (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x000000000000fff3; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000001; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x000000000000040d; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000010400; + __m128i_out = __lsx_vmaddwev_w_hu_h (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmaddwev_w_hu_h (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000001ca02f854; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000100013fa0; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x00000001ca02f854; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000100013fa0; + *((unsigned long *)&__m128i_result[1]) = 0x00000001ca02f854; + *((unsigned long *)&__m128i_result[0]) = 0x0000000100013fa0; + __m128i_out = __lsx_vmaddwev_w_hu_h (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x00000002b0995850; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffff80005613; + *((unsigned long *)&__m128i_op1[0]) = 0x007f800000000000; + *((unsigned long *)&__m128i_op2[1]) = 0xffffffff80005613; + *((unsigned long *)&__m128i_op2[0]) = 0x007f800000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffff00011cf0c569; + *((unsigned long *)&__m128i_result[0]) = 0xc0000002b0995850; + __m128i_out = __lsx_vmaddwev_w_hu_h (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x000000ffffff81fe; + *((unsigned long *)&__m128i_op1[0]) = 0xffffff00ffff7e01; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x000000fffe01fd02; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00fe00fffe86f901; + __m128i_out = __lsx_vmaddwev_w_hu_h (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmaddwev_d_wu_w (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000004000; + *((unsigned long *)&__m128i_op1[0]) = 0xfff8004000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmaddwev_d_wu_w (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmaddwev_d_wu_w (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xbfffbfffbfffbffe; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0xbfffbfffbfffbffe; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xbfffbfffbfffbffe; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmaddwev_d_wu_w (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffd3000000130000; + *((unsigned long *)&__m128i_op0[0]) = 0xffd3000000130000; + *((unsigned long *)&__m128i_op1[1]) = 0xffd3000000130000; + *((unsigned long *)&__m128i_op1[0]) = 0xffd3000000130000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffd3000000130000; + *((unsigned long *)&__m128i_result[0]) = 0xffd3000000130000; + __m128i_out = __lsx_vmaddwev_d_wu_w (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_op1[1]) = 0x00000000003dffc2; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000003dffc2; + *((unsigned long *)&__m128i_op2[1]) = 0x00000000003dffc2; + *((unsigned long *)&__m128i_op2[0]) = 0x00000000003dffc2; + *((unsigned long *)&__m128i_result[1]) = 0x00000f02e1f80f04; + *((unsigned long *)&__m128i_result[0]) = 0x00000f02e1f80f04; + __m128i_out = __lsx_vmaddwev_d_wu_w (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vmaddwev_d_wu_w (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfffefffe00000000; + *((unsigned long *)&__m128i_op0[0]) = 0xfffefffe00000000; + *((unsigned long *)&__m128i_op1[1]) = 0x98147a504d145000; + *((unsigned long *)&__m128i_op1[0]) = 0x377b810912c0e000; + *((unsigned long *)&__m128i_op2[1]) = 0x5a57bacbd7e39680; + *((unsigned long *)&__m128i_op2[0]) = 0x6bae051ffed76001; + *((unsigned long *)&__m128i_result[1]) = 0xf3eb458161080000; + *((unsigned long *)&__m128i_result[0]) = 0xffe9454286c0e000; + __m128i_out = __lsx_vmaddwev_d_wu_w (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0051005200510052; + *((unsigned long *)&__m128i_op1[0]) = 0x0051005200510052; + *((unsigned long *)&__m128i_op2[1]) = 0xffaeffaeffaeffae; + *((unsigned long *)&__m128i_op2[0]) = 0xffaeffaeffaeffae; + *((unsigned long *)&__m128i_result[1]) = 0xffffe65ecc1be5bc; + *((unsigned long *)&__m128i_result[0]) = 0xffffe65ecc1be5bc; + __m128i_out = __lsx_vmaddwev_d_wu_w (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xf1f1f1f149ed7273; + *((unsigned long *)&__m128i_op0[0]) = 0xf1f1f1f1865e65a1; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000ffff941d; + *((unsigned long *)&__m128i_op2[1]) = 0xf1f1f1f149ed7273; + *((unsigned long *)&__m128i_op2[0]) = 0xf1f1f1f1865e65a1; + *((unsigned long *)&__m128i_result[1]) = 0xf1f1f1f149ed7273; + *((unsigned long *)&__m128i_result[0]) = 0x78508ad4ec2ffcde; + __m128i_out = __lsx_vmaddwev_d_wu_w (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000ffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0x0000ffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x0000ffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0x0000ffffffffffff; + *((unsigned long *)&__m128i_op2[1]) = 0x000000120000000d; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000e0000000e; + *((unsigned long *)&__m128i_result[1]) = 0x0001000cfffffff2; + *((unsigned long *)&__m128i_result[0]) = 0x0001000dfffffff1; + __m128i_out = __lsx_vmaddwev_d_wu_w (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vmaddwev_q_du_d (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000001ff000001ff; + *((unsigned long *)&__m128i_op0[0]) = 0x000001ff000001ff; + *((unsigned long *)&__m128i_op1[1]) = 0x000001ff000001ff; + *((unsigned long *)&__m128i_op1[0]) = 0x000001ff000001ff; + *((unsigned long *)&__m128i_op2[1]) = 0xff80ffffffffffff; + *((unsigned long *)&__m128i_op2[0]) = 0x7ffffffeffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x000002fe800000ff; + *((unsigned long *)&__m128i_result[0]) = 0x7ffffe0100000000; + __m128i_out = __lsx_vmaddwev_q_du_d (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xff00000000000001; + *((unsigned long *)&__m128i_op1[1]) = 0x7fffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000001; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0xff80000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xfe80000000000001; + __m128i_out = __lsx_vmaddwev_q_du_d (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmaddwev_q_du_d (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmaddwev_q_du_d (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000080; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0001000100010001; + *((unsigned long *)&__m128i_op2[0]) = 0x0001000100010001; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000080; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmaddwev_q_du_d (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmaddwod-1.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmaddwod-1.c new file mode 100644 index 00000000000..5875aa5978d --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmaddwod-1.c @@ -0,0 +1,372 @@ +/* { dg-do run } */ +/* { dg-options "-mlsx -w -fno-strict-aliasing" } */ +#include "../simd_correctness_check.h" +#include + +int +main () +{ + __m128i __m128i_op0, __m128i_op1, __m128i_op2, __m128i_out, __m128i_result; + __m128 __m128_op0, __m128_op1, __m128_op2, __m128_out, __m128_result; + __m128d __m128d_op0, __m128d_op1, __m128d_op2, __m128d_out, __m128d_result; + + int int_op0, int_op1, int_op2, int_out, int_result, i = 1, fail; + long int long_op0, long_op1, long_op2, lont_out, lont_result; + long int long_int_out, long_int_result; + unsigned int unsigned_int_out, unsigned_int_result; + unsigned long int unsigned_long_int_out, unsigned_long_int_result; + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmaddwod_h_b (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000010000000002; + *((unsigned long *)&__m128i_op0[0]) = 0x0000008000000080; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000c7fff000c; + *((unsigned long *)&__m128i_op1[0]) = 0x1000100010001000; + *((unsigned long *)&__m128i_op2[1]) = 0xfffff000f0008d3c; + *((unsigned long *)&__m128i_op2[0]) = 0xfffff0016fff8d3d; + *((unsigned long *)&__m128i_result[1]) = 0x00000100f8100002; + *((unsigned long *)&__m128i_result[0]) = 0xfff0ff8006f0f950; + __m128i_out = __lsx_vmaddwod_h_b (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x007ffd0001400840; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x007ffd0001400840; + __m128i_out = __lsx_vmaddwod_h_b (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000002000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000002000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0xffff0000ffff0000; + *((unsigned long *)&__m128i_op2[1]) = 0x000000ff000000ff; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000002000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000002000; + __m128i_out = __lsx_vmaddwod_h_b (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0001000100010058; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0001000100010058; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmaddwod_h_b (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000ffac0a000000; + *((unsigned long *)&__m128i_op1[1]) = 0x000000200000001b; + *((unsigned long *)&__m128i_op1[0]) = 0x0000002000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000ffac0a000000; + __m128i_out = __lsx_vmaddwod_h_b (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000017fda829; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000017fda829; + __m128i_out = __lsx_vmaddwod_w_h (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0xff8000000000ffff; + *((unsigned long *)&__m128i_op1[0]) = 0x000800000000ffff; + *((unsigned long *)&__m128i_op2[1]) = 0x697eba2bedfa9c82; + *((unsigned long *)&__m128i_op2[0]) = 0xd705c77a7025c899; + *((unsigned long *)&__m128i_result[1]) = 0xffcb410000000000; + *((unsigned long *)&__m128i_result[0]) = 0xfffeb827ffffffff; + __m128i_out = __lsx_vmaddwod_w_h (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000fffffc00; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000200010; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00000000fffffc00; + __m128i_out = __lsx_vmaddwod_w_h (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x000000000000000f; + *((unsigned long *)&__m128i_op1[1]) = 0x000000c5ac01015b; + *((unsigned long *)&__m128i_op1[0]) = 0xaaacac88a3a9a96a; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x000000000000000f; + __m128i_out = __lsx_vmaddwod_w_h (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x7ef4002d21fc7001; + *((unsigned long *)&__m128i_op0[0]) = 0x28bf02d1ec6a35b2; + *((unsigned long *)&__m128i_op1[1]) = 0xffffb96bffff57c9; + *((unsigned long *)&__m128i_op1[0]) = 0xffff6080ffff4417; + *((unsigned long *)&__m128i_op2[1]) = 0xff800000ff800000; + *((unsigned long *)&__m128i_op2[0]) = 0xff8000007fc00000; + *((unsigned long *)&__m128i_result[1]) = 0x7ef400ad21fc7081; + *((unsigned long *)&__m128i_result[0]) = 0x28bf0351ec69b5f2; + __m128i_out = __lsx_vmaddwod_w_h (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0001200100012001; + *((unsigned long *)&__m128i_op1[0]) = 0x0001000100010001; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmaddwod_w_h (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000100000001; + *((unsigned long *)&__m128i_op1[1]) = 0xbf8000000000ffff; + *((unsigned long *)&__m128i_op1[0]) = 0xcf00000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0xbf80000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0xcf00000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x1040400000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0961000100000001; + __m128i_out = __lsx_vmaddwod_d_w (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x03574e3a62407e03; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000001010000; + *((unsigned long *)&__m128i_op1[1]) = 0x7da9b23a624082fd; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000ffff0000; + *((unsigned long *)&__m128i_op2[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x03574e39e496cbc9; + *((unsigned long *)&__m128i_result[0]) = 0x0000000001010000; + __m128i_out = __lsx_vmaddwod_d_w (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0400040004000400; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0xfffffffff8f8dada; + *((unsigned long *)&__m128i_op2[0]) = 0xffffffff01018888; + *((unsigned long *)&__m128i_result[1]) = 0x0400040004000400; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmaddwod_d_w (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x000000030000003f; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmaddwod_d_w (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x3f77aab500000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000ffc100010001; + *((unsigned long *)&__m128i_op2[1]) = 0x3f77aab500000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000ffc100010001; + *((unsigned long *)&__m128i_result[1]) = 0x0fbc1df53c1ae3f9; + *((unsigned long *)&__m128i_result[0]) = 0x00000000ff820f81; + __m128i_out = __lsx_vmaddwod_d_w (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmaddwod_d_w (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000020000020; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000020000020; + *((unsigned long *)&__m128i_op2[1]) = 0x00000000ff801c9e; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000810000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmaddwod_d_w (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000700000004e000; + *((unsigned long *)&__m128i_op0[0]) = 0x0003000000012020; + *((unsigned long *)&__m128i_op1[1]) = 0x003f0000ffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0x003f0000ffffffff; + *((unsigned long *)&__m128i_op2[1]) = 0x00000000e00a18f5; + *((unsigned long *)&__m128i_op2[0]) = 0x000000002023dcdc; + *((unsigned long *)&__m128i_result[1]) = 0x000700000004e000; + *((unsigned long *)&__m128i_result[0]) = 0x0003000000012020; + __m128i_out = __lsx_vmaddwod_d_w (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x000000120000000d; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000e0000000e; + *((unsigned long *)&__m128i_op2[1]) = 0x0000ffffffffffff; + *((unsigned long *)&__m128i_op2[0]) = 0x0000ffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x000000000011ffee; + *((unsigned long *)&__m128i_result[0]) = 0x00000000000dfff2; + __m128i_out = __lsx_vmaddwod_d_w (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmaddwod_q_d (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0x7ff8000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffff7fffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffff8000000000; + *((unsigned long *)&__m128i_op2[1]) = 0xffffff7fffffffff; + *((unsigned long *)&__m128i_op2[0]) = 0xffffff8000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000003fff; + *((unsigned long *)&__m128i_result[0]) = 0x7ff8010000000001; + __m128i_out = __lsx_vmaddwod_q_d (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmaddwod_q_d (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000ff000000ff00; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x000000ff000000ff; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000ff000000ff00; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000ff0000ff0000; + *((unsigned long *)&__m128i_result[0]) = 0x01fc020000fe0100; + __m128i_out = __lsx_vmaddwod_q_d (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x78c00000ff000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x78c00000ff000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x78c00000ff000000; + __m128i_out = __lsx_vmaddwod_q_d (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op2[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmaddwod_q_d (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfefefefefefefefe; + *((unsigned long *)&__m128i_op0[0]) = 0xfefefefefefefefe; + *((unsigned long *)&__m128i_op1[1]) = 0x1000100010001000; + *((unsigned long *)&__m128i_op1[0]) = 0x1000100010001000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x1000100012030e02; + *((unsigned long *)&__m128i_result[1]) = 0xfefefefefefefefe; + *((unsigned long *)&__m128i_result[0]) = 0xfefefefefefefefe; + __m128i_out = __lsx_vmaddwod_q_d (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000080800000808; + *((unsigned long *)&__m128i_op0[0]) = 0x0000080800000808; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x010105017878f8f6; + *((unsigned long *)&__m128i_op2[0]) = 0xf8f8fd0180810907; + *((unsigned long *)&__m128i_result[1]) = 0x0000080800000808; + *((unsigned long *)&__m128i_result[0]) = 0x0000080800000808; + __m128i_out = __lsx_vmaddwod_q_d (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmaddwod_q_d (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000158; + *((unsigned long *)&__m128i_op1[1]) = 0x0001000100010058; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000158; + __m128i_out = __lsx_vmaddwod_q_d (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x328e1080889415a0; + *((unsigned long *)&__m128i_op0[0]) = 0x3960b1a401811060; + *((unsigned long *)&__m128i_op1[1]) = 0x328e1080889415a0; + *((unsigned long *)&__m128i_op1[0]) = 0x3960b1a401811060; + *((unsigned long *)&__m128i_op2[1]) = 0x020310edc003023d; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x32f3c7a38f9f4b8b; + *((unsigned long *)&__m128i_result[0]) = 0x2c9e5069f5d57780; + __m128i_out = __lsx_vmaddwod_q_d (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmaddwod-2.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmaddwod-2.c new file mode 100644 index 00000000000..4be7fce8269 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmaddwod-2.c @@ -0,0 +1,438 @@ +/* { dg-do run } */ +/* { dg-options "-mlsx -w -fno-strict-aliasing" } */ +#include "../simd_correctness_check.h" +#include + +int +main () +{ + __m128i __m128i_op0, __m128i_op1, __m128i_op2, __m128i_out, __m128i_result; + __m128 __m128_op0, __m128_op1, __m128_op2, __m128_out, __m128_result; + __m128d __m128d_op0, __m128d_op1, __m128d_op2, __m128d_out, __m128d_result; + + int int_op0, int_op1, int_op2, int_out, int_result, i = 1, fail; + long int long_op0, long_op1, long_op2, lont_out, lont_result; + long int long_int_out, long_int_result; + unsigned int unsigned_int_out, unsigned_int_result; + unsigned long int unsigned_long_int_out, unsigned_long_int_result; + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xd8248069ffe78077; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0d0d0d0d0d0d0d0d; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0xd8248069ffe78077; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xe31c86e90cda86f7; + __m128i_out = __lsx_vmaddwod_h_bu (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00010020fffeffde; + *((unsigned long *)&__m128i_op0[0]) = 0x0100400100200e68; + *((unsigned long *)&__m128i_op1[1]) = 0x00010020fffeffde; + *((unsigned long *)&__m128i_op1[0]) = 0x0100400100200e68; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x1ff85ffe2ae5d973; + *((unsigned long *)&__m128i_result[1]) = 0x00010020fffeffde; + *((unsigned long *)&__m128i_result[0]) = 0x011f57c100201a46; + __m128i_out = __lsx_vmaddwod_h_bu (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xbafebb00ffd500fe; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmaddwod_h_bu (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x0c0b0a090b0a0908; + *((unsigned long *)&__m128i_op1[0]) = 0x0a09080709080706; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vmaddwod_h_bu (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffc0800000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0xffffffffc0800000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffc0800000; + __m128i_out = __lsx_vmaddwod_h_bu (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmaddwod_w_hu (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmaddwod_w_hu (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmaddwod_w_hu (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000003a24; + *((unsigned long *)&__m128i_op0[0]) = 0x003dbe88077c78c1; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000008; + *((unsigned long *)&__m128i_op1[0]) = 0x0020002000200020; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000008; + *((unsigned long *)&__m128i_op2[0]) = 0x0020002000200020; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000003a24; + *((unsigned long *)&__m128i_result[0]) = 0x003dc288077c7cc1; + __m128i_out = __lsx_vmaddwod_w_hu (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffc0000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xffc0000000000004; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000455555555; + *((unsigned long *)&__m128i_result[1]) = 0xffc0000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xffc0000000000004; + __m128i_out = __lsx_vmaddwod_w_hu (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmaddwod_w_hu (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x000000000000053a; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmaddwod_w_hu (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmaddwod_w_hu (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmaddwod_w_hu (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000020; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op2[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmaddwod_w_hu (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000036280001; + *((unsigned long *)&__m128i_op0[0]) = 0x42a0000042a02001; + *((unsigned long *)&__m128i_op1[1]) = 0x0000005555555554; + *((unsigned long *)&__m128i_op1[0]) = 0x0000005555555554; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000036280001; + *((unsigned long *)&__m128i_result[0]) = 0x42a0000042a02001; + __m128i_out = __lsx_vmaddwod_d_wu (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000fe00ff; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000ff00fe; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000fe00ff; + __m128i_out = __lsx_vmaddwod_d_wu (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000000ffff946c; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffff946b; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffff3c992b2e; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffff730f; + *((unsigned long *)&__m128i_op2[1]) = 0x00000000ffff946c; + *((unsigned long *)&__m128i_op2[0]) = 0xffffffffffff946b; + *((unsigned long *)&__m128i_result[1]) = 0x00000000ffff946c; + *((unsigned long *)&__m128i_result[0]) = 0xfffffffdffff946c; + __m128i_out = __lsx_vmaddwod_d_wu (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000080000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000080000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000401000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000080000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000080000000000; + __m128i_out = __lsx_vmaddwod_d_wu (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfffffffffffff800; + *((unsigned long *)&__m128i_op0[0]) = 0x00ff000000ff0000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xfffffffffffff800; + *((unsigned long *)&__m128i_result[0]) = 0x00ff000000ff0000; + __m128i_out = __lsx_vmaddwod_d_wu (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0006ffff0004ffff; + *((unsigned long *)&__m128i_op1[0]) = 0x0002ffff0000ffff; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0xffffffff7f800000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0002fffefffd0001; + __m128i_out = __lsx_vmaddwod_d_wu (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmaddwod_d_wu (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x7ff8000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x7ff8000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmaddwod_d_wu (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000000ffffe000; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000c6fde000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0xe000e0006080b040; + *((unsigned long *)&__m128i_result[1]) = 0x00000000ffffe000; + *((unsigned long *)&__m128i_result[0]) = 0x00000000c6fde000; + __m128i_out = __lsx_vmaddwod_d_wu (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op2[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmaddwod_d_wu (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x021b7d24c9678a35; + *((unsigned long *)&__m128i_op1[0]) = 0x030298a6a1030a49; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmaddwod_d_wu (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000000000a752a55; + *((unsigned long *)&__m128i_op0[0]) = 0x0a753500950fa306; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000100000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000200000000; + *((unsigned long *)&__m128i_op2[1]) = 0x000000000a752a55; + *((unsigned long *)&__m128i_op2[0]) = 0x0a753500950fa306; + *((unsigned long *)&__m128i_result[1]) = 0x000000000a752a55; + *((unsigned long *)&__m128i_result[0]) = 0x0a753500a9fa0d06; + __m128i_out = __lsx_vmaddwod_d_wu (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x4f4f4f4f4f4f4f4f; + *((unsigned long *)&__m128i_op0[0]) = 0x4f4f4f4f4f4f4f4f; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x4f4f4f4f4f4f4f4f; + *((unsigned long *)&__m128i_result[0]) = 0x4f4f4f4f4f4f4f4f; + __m128i_out = __lsx_vmaddwod_d_wu (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000017fda829; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmaddwev_q_du (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000100000001; + *((unsigned long *)&__m128i_op1[0]) = 0x7f8000007f800000; + *((unsigned long *)&__m128i_op2[1]) = 0x00ffff0000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x00ffff0000000000; + *((unsigned long *)&__m128i_result[1]) = 0x007f7f80807f7f80; + *((unsigned long *)&__m128i_result[0]) = 0x8000000000000000; + __m128i_out = __lsx_vmaddwev_q_du (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000020302030; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000020302030; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmaddwev_q_du (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x7fffffff7fffffff; + *((unsigned long *)&__m128i_op0[0]) = 0x0101010101010101; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x3fffffffc0000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x7fffffff7fffffff; + *((unsigned long *)&__m128i_result[0]) = 0x0101010101010101; + __m128i_out = __lsx_vmaddwev_q_du (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000000006e17bfd8; + *((unsigned long *)&__m128i_op0[0]) = 0x000000006e17bfd8; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0xffffff0100000001; + *((unsigned long *)&__m128i_op2[0]) = 0xffffff0100000001; + *((unsigned long *)&__m128i_result[1]) = 0x000000006e17bfd8; + *((unsigned long *)&__m128i_result[0]) = 0x000000006e17bfd8; + __m128i_out = __lsx_vmaddwev_q_du (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0001000100000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xfffffffffffffffe; + *((unsigned long *)&__m128i_op1[0]) = 0xfffffffffffffffe; + *((unsigned long *)&__m128i_op2[1]) = 0xfffffffffffffffe; + *((unsigned long *)&__m128i_op2[0]) = 0xfffffffffffffffe; + *((unsigned long *)&__m128i_result[1]) = 0x00010000fffffffc; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000004; + __m128i_out = __lsx_vmaddwev_q_du (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000000008000e2e3; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000080000000; + *((unsigned long *)&__m128i_op1[1]) = 0x000000008000e2e3; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000080000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x00ff00ff00ff00ff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000080806362; + *((unsigned long *)&__m128i_result[0]) = 0x807f808000000000; + __m128i_out = __lsx_vmaddwev_q_du (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfffffffffffffffa; + *((unsigned long *)&__m128i_op0[0]) = 0xfffffffffffffffa; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xfffffffffffffffa; + *((unsigned long *)&__m128i_result[0]) = 0xfffffffffffffffa; + __m128i_out = __lsx_vmaddwev_q_du (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x8101010181010101; + *((unsigned long *)&__m128i_op1[0]) = 0x8101010181010101; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmaddwev_q_du (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0001000101010001; + *((unsigned long *)&__m128i_op0[0]) = 0x0001000100010001; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000014; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000014; + *((unsigned long *)&__m128i_op2[1]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_op2[0]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_result[1]) = 0x0001000101010015; + *((unsigned long *)&__m128i_result[0]) = 0x0000ffed00010001; + __m128i_out = __lsx_vmaddwev_q_du (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmaddwod-3.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmaddwod-3.c new file mode 100644 index 00000000000..8a4c39502f5 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmaddwod-3.c @@ -0,0 +1,460 @@ +/* { dg-do run } */ +/* { dg-options "-mlsx -w -fno-strict-aliasing" } */ +#include "../simd_correctness_check.h" +#include + +int +main () +{ + __m128i __m128i_op0, __m128i_op1, __m128i_op2, __m128i_out, __m128i_result; + __m128 __m128_op0, __m128_op1, __m128_op2, __m128_out, __m128_result; + __m128d __m128d_op0, __m128d_op1, __m128d_op2, __m128d_out, __m128d_result; + + int int_op0, int_op1, int_op2, int_out, int_result, i = 1, fail; + long int long_op0, long_op1, long_op2, lont_out, lont_result; + long int long_int_out, long_int_result; + unsigned int unsigned_int_out, unsigned_int_result; + unsigned long int unsigned_long_int_out, unsigned_long_int_result; + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x00003fe00ffe3fe0; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmaddwod_h_bu_b (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000b5207f80; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op2[0]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00000000b5207f80; + __m128i_out = __lsx_vmaddwod_h_bu_b (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffe218ffffea10; + *((unsigned long *)&__m128i_op0[0]) = 0xfffff208fffffa02; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000004; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000004; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0xfffff208fffffa02; + *((unsigned long *)&__m128i_result[1]) = 0xffffe218ffffea10; + *((unsigned long *)&__m128i_result[0]) = 0xfffff208fffffa02; + __m128i_out = __lsx_vmaddwod_h_bu_b (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000bd3d00000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000bd3d00000000; + *((unsigned long *)&__m128i_op2[1]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000bd3d00000000; + __m128i_out = __lsx_vmaddwod_h_bu_b (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000ffff0000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0032000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x2020202020202020; + *((unsigned long *)&__m128i_op2[0]) = 0x2020202020207f7f; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x00000000ffff0000; + __m128i_out = __lsx_vmaddwod_h_bu_b (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00d3012acc56f9bb; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000000000a0; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000100013fa0; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000120002000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000100013fa0; + *((unsigned long *)&__m128i_result[1]) = 0x00d3012acc56f9bb; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000001021; + __m128i_out = __lsx_vmaddwod_h_bu_b (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0002000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000014; + *((unsigned long *)&__m128i_op1[1]) = 0x0002000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000ffff00000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0002000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000014; + __m128i_out = __lsx_vmaddwod_h_bu_b (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000800000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000800000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmaddwod_h_bu_b (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000001; + *((unsigned long *)&__m128i_op2[1]) = 0x4399d3221a29d3f2; + *((unsigned long *)&__m128i_op2[0]) = 0xc3818bffe7b7a7b8; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmaddwod_h_bu_b (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000467fe000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000003ff8; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000003ff8; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00000000467fef81; + __m128i_out = __lsx_vmaddwod_h_bu_b (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmaddwod_w_hu_h (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x7fc0000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x1e801ffc00000000; + *((unsigned long *)&__m128i_op1[1]) = 0x000000000000ffff; + *((unsigned long *)&__m128i_op1[0]) = 0x0000ff020000fff4; + *((unsigned long *)&__m128i_op2[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op2[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x7fc0000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x1e801ffc00000000; + __m128i_out = __lsx_vmaddwod_w_hu_h (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmaddwod_w_hu_h (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x3c600000ff800000; + *((unsigned long *)&__m128i_op1[0]) = 0xfffffffffffffffe; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmaddwod_w_hu_h (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xfe80000000000001; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xfe80000000000001; + __m128i_out = __lsx_vmaddwod_w_hu_h (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x00007f7f00007f7f; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmaddwod_w_hu_h (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00ffffff03ffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffff00013fff; + *((unsigned long *)&__m128i_op1[1]) = 0x000088500000f6a0; + *((unsigned long *)&__m128i_op1[0]) = 0x0001fffd00000407; + *((unsigned long *)&__m128i_op2[1]) = 0x0000442900007b4c; + *((unsigned long *)&__m128i_op2[0]) = 0x0000e22b0000efa4; + *((unsigned long *)&__m128i_result[1]) = 0x00ffffff03ffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffff00013fff; + __m128i_out = __lsx_vmaddwod_w_hu_h (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x14ccc6320176a4d2; + *((unsigned long *)&__m128i_op0[0]) = 0x685670d37e80682a; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x000000007fffffff; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x14ccc6320176a4d2; + *((unsigned long *)&__m128i_result[0]) = 0x685670d37e80682a; + __m128i_out = __lsx_vmaddwod_w_hu_h (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xc0411fe800000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x7fff7fff7fff7fff; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x601fbfbeffffffff; + __m128i_out = __lsx_vmaddwod_w_hu_h (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmaddwod_w_hu_h (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffc105d1aa; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffbc19ecca; + *((unsigned long *)&__m128i_op2[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op2[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0xffff0000ffff3efa; + *((unsigned long *)&__m128i_result[0]) = 0xffff0000ffff43e6; + __m128i_out = __lsx_vmaddwod_w_hu_h (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000ffffffa7; + *((unsigned long *)&__m128i_op1[1]) = 0x00c2758000bccf42; + *((unsigned long *)&__m128i_op1[0]) = 0x00a975be00accf03; + *((unsigned long *)&__m128i_op2[1]) = 0x00c2758000bccf42; + *((unsigned long *)&__m128i_op2[0]) = 0x00a975be00accf03; + *((unsigned long *)&__m128i_result[1]) = 0x0000930400008a10; + *((unsigned long *)&__m128i_result[0]) = 0x00006f9100007337; + __m128i_out = __lsx_vmaddwod_w_hu_h (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmaddwod_w_hu_h (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000ffff00000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmaddwod_d_wu_w (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0010001000100010; + *((unsigned long *)&__m128i_op2[0]) = 0x001000100010c410; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vmaddwod_d_wu_w (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xff02ff1bff02ff23; + *((unsigned long *)&__m128i_op0[0]) = 0x0000ffffff02fff4; + *((unsigned long *)&__m128i_op1[1]) = 0xff02ff1bff02ff23; + *((unsigned long *)&__m128i_op1[0]) = 0x0000ffffff02fff4; + *((unsigned long *)&__m128i_op2[1]) = 0x7fc000007fc00000; + *((unsigned long *)&__m128i_op2[0]) = 0x1e801ffc7fc00000; + *((unsigned long *)&__m128i_result[1]) = 0x7e44bde9b842ff23; + *((unsigned long *)&__m128i_result[0]) = 0x00011e80007edff8; + __m128i_out = __lsx_vmaddwod_d_wu_w (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000100000001; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0xfffffffeffffffff; + *((unsigned long *)&__m128i_op2[1]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000100000001; + __m128i_out = __lsx_vmaddwod_d_wu_w (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xe0d56a9774f3ea31; + *((unsigned long *)&__m128i_op0[0]) = 0xe0dd268932a5edf9; + *((unsigned long *)&__m128i_op1[1]) = 0xe0d56a9774f3ea31; + *((unsigned long *)&__m128i_op1[0]) = 0xe0dd268932a5edf9; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0xd8248069ffe78077; + *((unsigned long *)&__m128i_result[1]) = 0xe0d56a9774f3ea31; + *((unsigned long *)&__m128i_result[0]) = 0xbddaa86803e33c2a; + __m128i_out = __lsx_vmaddwod_d_wu_w (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0028280000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0028280000282800; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_op2[1]) = 0x7505853d654185f5; + *((unsigned long *)&__m128i_op2[0]) = 0x01010000fefe0101; + *((unsigned long *)&__m128i_result[1]) = 0x0028280000000000; + *((unsigned long *)&__m128i_result[0]) = 0x012927ffff272800; + __m128i_out = __lsx_vmaddwod_d_wu_w (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00ffff7f00ff00ff; + *((unsigned long *)&__m128i_op0[0]) = 0x00ff007f0101017f; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000020000000; + *((unsigned long *)&__m128i_op1[0]) = 0x000000183fffffe5; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000073; + *((unsigned long *)&__m128i_op2[0]) = 0x000000000000002a; + *((unsigned long *)&__m128i_result[1]) = 0x00ffff7f00ff00ff; + *((unsigned long *)&__m128i_result[0]) = 0x00ff007f0101017f; + __m128i_out = __lsx_vmaddwod_d_wu_w (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x3f8000003f800000; + *((unsigned long *)&__m128i_op0[0]) = 0x3f8000003f800000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x000000002bfd9461; + *((unsigned long *)&__m128i_op2[1]) = 0x3f8000003f800001; + *((unsigned long *)&__m128i_op2[0]) = 0x3f8000003f800001; + *((unsigned long *)&__m128i_result[1]) = 0x3f8000003f800000; + *((unsigned long *)&__m128i_result[0]) = 0x3f8000003f800000; + __m128i_out = __lsx_vmaddwod_d_wu_w (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000095896a760000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0x006f0efe258ca851; + *((unsigned long *)&__m128i_op2[1]) = 0xffff7fc8ffff8000; + *((unsigned long *)&__m128i_op2[0]) = 0xffff200000000000; + *((unsigned long *)&__m128i_result[1]) = 0x000015516a768038; + *((unsigned long *)&__m128i_result[0]) = 0xffffff9ed2e1c000; + __m128i_out = __lsx_vmaddwod_d_wu_w (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000120002000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000100013fa0; + *((unsigned long *)&__m128i_op1[1]) = 0x2000200000013fa0; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000013fa0; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000120002000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000100013fa0; + __m128i_out = __lsx_vmaddwod_d_wu_w (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0080008000800080; + *((unsigned long *)&__m128i_op0[0]) = 0x0080006b00000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x001b19b1c9c6da5a; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x001b19b1c9c6da5a; + *((unsigned long *)&__m128i_result[1]) = 0x0080008000800080; + *((unsigned long *)&__m128i_result[0]) = 0x008003496dea0c61; + __m128i_out = __lsx_vmaddwod_d_wu_w (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vmaddwev_q_du_d (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000001ff000001ff; + *((unsigned long *)&__m128i_op0[0]) = 0x000001ff000001ff; + *((unsigned long *)&__m128i_op1[1]) = 0x000001ff000001ff; + *((unsigned long *)&__m128i_op1[0]) = 0x000001ff000001ff; + *((unsigned long *)&__m128i_op2[1]) = 0xff80ffffffffffff; + *((unsigned long *)&__m128i_op2[0]) = 0x7ffffffeffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x000002fe800000ff; + *((unsigned long *)&__m128i_result[0]) = 0x7ffffe0100000000; + __m128i_out = __lsx_vmaddwev_q_du_d (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xff00000000000001; + *((unsigned long *)&__m128i_op1[1]) = 0x7fffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000001; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0xff80000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xfe80000000000001; + __m128i_out = __lsx_vmaddwev_q_du_d (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmaddwev_q_du_d (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmaddwev_q_du_d (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000080; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0001000100010001; + *((unsigned long *)&__m128i_op2[0]) = 0x0001000100010001; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000080; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmaddwev_q_du_d (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} From patchwork Mon Sep 11 03:44:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: chenxiaolong X-Patchwork-Id: 137875 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ab0a:0:b0:3f2:4152:657d with SMTP id m10csp1857938vqo; Sun, 10 Sep 2023 20:49:32 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFO7wot6QRk1Z/i8BfU6J84nh8EJvW1CGSncBawAo1g8GzQZRnCqhFntoUbgngVBXr4Xx0t X-Received: by 2002:a05:6512:3188:b0:500:b7dc:6c90 with SMTP id i8-20020a056512318800b00500b7dc6c90mr7244660lfe.36.1694404172022; Sun, 10 Sep 2023 20:49:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694404171; cv=none; d=google.com; s=arc-20160816; b=akLIbdbhK6WCoHkEIDffwd3MqNFNuhX3Yco6UpJqtlWXs0zwRH5i8N2kThGNwpQ4We 6FUcx3VGW/8NuVG8rukkZ1H676FetcXQsbPAa1NcyXSDjVmBILaViIeGhuIdIc1DQpEp Ai9zASxDawIc0Yg+G7Da+N4M+h5uXz0Fmp6KiaESLU5cJMpqe18SboXya5ym+dp32nKz PyDEu0WI83BZ6wswSc49Kodt1eJs9mm1Ionu/a6Wjiq0fyca8wkfyt/c2yOiAL/JlSH/ 4W16hoSIK9GrTy0C5VHtzYuW6ojKTWiDCHCGuV8u0pg4PnY8HRMnZWJKfkJ+XlhU2GIL DApw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dmarc-filter:delivered-to; bh=9JbRBkczUe3L/blrw63KRrlHd5dO+jo4SUeXRLQ4UR8=; fh=BpFCyCzVJo4znJIvOjeDfKzcGsF6Q+JgJbJ+1ev/kM4=; b=Yn9MQQSWkovnnB7RT3Yi0M4y7EFyWFpZcPX27Om//419br0IywMyIo5zvJtbZpzVGb N3KGwwaZm+Rfu/d2mulqHB5WP4CcI9KOK1Z6eLxJgZQQvRD0Ha+UkXylXEd/SBbg87y8 OBT8esWnXkDvN11P9tTaXXhHA7sQNEtfnKWW/ZkCKc/YpY+K6k84I4DrYokrmPX+rWgE udGlZLXCXyVkviuxpzVS7tdCyLue/YYjVXh92If8KWcmfu4cs672IA87X/FHFQB3WICn Pu8PAMTP0v7tH8kKOF5LNNU9Vc3HtnWlkn34X5jAIF90KARrDKevj4wRL3yxXSHyyDK2 Yghw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id s13-20020a170906454d00b00993a68a3afcsi5943533ejq.489.2023.09.10.20.49.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 Sep 2023 20:49:31 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 4F7073865C12 for ; Mon, 11 Sep 2023 03:46:38 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by sourceware.org (Postfix) with ESMTP id 2A970385734F for ; Mon, 11 Sep 2023 03:45:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2A970385734F Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=loongson.cn Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=loongson.cn Received: from loongson.cn (unknown [10.10.130.252]) by gateway (Coremail) with SMTP id _____8CxtPBnjf5k8EQkAA--.6493S3; Mon, 11 Sep 2023 11:45:43 +0800 (CST) Received: from slurm-master.loongson.cn (unknown [10.10.130.252]) by localhost.localdomain (Coremail) with SMTP id AQAAf8Dx_yNXjf5kzKZ2AA--.44820S10; Mon, 11 Sep 2023 11:45:42 +0800 (CST) From: Xiaolong Chen To: gcc-patches@gcc.gnu.org Subject: [PATCH v3 6/9] LoongArch:Add vector subtraction arithmetic operation SX instruction. Date: Mon, 11 Sep 2023 11:44:36 +0800 Message-Id: <20230911034439.8266-7-chenxiaolong@loongson.cn> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230911034439.8266-1-chenxiaolong@loongson.cn> References: <20230911034439.8266-1-chenxiaolong@loongson.cn> MIME-Version: 1.0 X-CM-TRANSID: AQAAf8Dx_yNXjf5kzKZ2AA--.44820S10 X-CM-SenderInfo: hfkh05xldrz0tqj6z05rqj20fqof0/1tbiAQALBWT9QjYDngAAs- X-Coremail-Antispam: 1Uk129KBj9DXoWkKr1kJFy7Zw4UuFy3Gw1DCFX_yoW8KFy7Cr X_JFnxJFykWF4SvrnrXr1DZr98uw4UXanF9a1UAF1qq3Wktw18Ca45AFyIvr17Jw1DZ3Wr ZFyDZry8Crn8GF1UKosvyTuYvTs0mTUanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUj1kv1T uYvTs0mT0YCTnIWjqI5I8CrVACY4xI64kE6c02F40Ex7xfYxn0WfASr-VFAUDa7-sFnT9f nUUIcSsGvfJTRUUUb28YFVCjjxCrM7AC8VAFwI0_Jr0_Gr1l1xkIjI8I6I8E6xAIw20EY4 v20xvaj40_Wr0E3s1l1IIY67AEw4v_Jr0_Jr4l8cAvFVAK0II2c7xJM28CjxkF64kEwVA0 rcxSw2x7M28EF7xvwVC0I7IYx2IY67AKxVW5JVW7JwA2z4x0Y4vE2Ix0cI8IcVCY1x0267 AKxVW8JVWxJwA2z4x0Y4vEx4A2jsIE14v26r4UJVWxJr1l84ACjcxK6I8E87Iv6xkF7I0E 14v26r4UJVWxJr1le2I262IYc4CY6c8Ij28IcVAaY2xG8wAqjxCEc2xF0cIa020Ex4CE44 I27wAqx4xG64xvF2IEw4CE5I8CrVC2j2WlYx0E2Ix0cI8IcVAFwI0_Jw0_WrylYx0Ex4A2 jsIE14v26r4j6F4UMcvjeVCFs4IE7xkEbVWUJVW8JwACjcxG0xvY0x0EwIxGrwCF04k20x vY0x0EwIxGrwCFx2IqxVCFs4IE7xkEbVWUJVW8JwC20s026c02F40E14v26r1j6r18MI8I 3I0E7480Y4vE14v26r106r1rMI8E67AF67kF1VAFwI0_JF0_Jw1lIxkGc2Ij64vIr41lIx AIcVC0I7IYx2IY67AKxVW8JVW5JwCI42IY6xIIjxv20xvEc7CjxVAFwI0_Gr0_Cr1lIxAI cVCF04k26cxKx2IYs7xG6r1j6r1xMIIF0xvEx4A2jsIE14v26r4j6F4UMIIF0xvEx4A2js IEc7CjxVAFwI0_Gr0_Gr1UYxBIdaVFxhVjvjDU0xZFpf9x07j8CztUUUUU= X-Spam-Status: No, score=-12.4 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, KAM_SHORT, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Xiaolong Chen , xuchenghua@loongson.cn, chenglulu@loongson.cn, i@xen0n.name Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1776711548878128036 X-GMAIL-MSGID: 1776711548878128036 gcc/testsuite/ChangeLog: * gcc.target/loongarch/vector/lsx/lsx-vhsubw-1.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vhsubw-2.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vmsub.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vssub-1.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vssub-2.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vsub.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vsubi.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vsubwev-1.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vsubwev-2.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vsubwod-1.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vsubwod-2.c: New test. --- .../loongarch/vector/lsx/lsx-vhsubw-1.c | 327 +++++++++++++ .../loongarch/vector/lsx/lsx-vhsubw-2.c | 353 ++++++++++++++ .../loongarch/vector/lsx/lsx-vmsub.c | 461 ++++++++++++++++++ .../loongarch/vector/lsx/lsx-vssub-1.c | 398 +++++++++++++++ .../loongarch/vector/lsx/lsx-vssub-2.c | 408 ++++++++++++++++ .../loongarch/vector/lsx/lsx-vsub.c | 381 +++++++++++++++ .../loongarch/vector/lsx/lsx-vsubi.c | 329 +++++++++++++ .../loongarch/vector/lsx/lsx-vsubwev-1.c | 326 +++++++++++++ .../loongarch/vector/lsx/lsx-vsubwev-2.c | 417 ++++++++++++++++ .../loongarch/vector/lsx/lsx-vsubwod-1.c | 326 +++++++++++++ .../loongarch/vector/lsx/lsx-vsubwod-2.c | 308 ++++++++++++ 11 files changed, 4034 insertions(+) create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vhsubw-1.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vhsubw-2.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmsub.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vssub-1.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vssub-2.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsub.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsubi.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsubwev-1.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsubwev-2.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsubwod-1.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsubwod-2.c diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vhsubw-1.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vhsubw-1.c new file mode 100644 index 00000000000..0b51cb8cfd0 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vhsubw-1.c @@ -0,0 +1,327 @@ +/* { dg-do run } */ +/* { dg-options "-mlsx -w -fno-strict-aliasing" } */ +#include "../simd_correctness_check.h" +#include + +int +main () +{ + __m128i __m128i_op0, __m128i_op1, __m128i_op2, __m128i_out, __m128i_result; + __m128 __m128_op0, __m128_op1, __m128_op2, __m128_out, __m128_result; + __m128d __m128d_op0, __m128d_op1, __m128d_op2, __m128d_out, __m128d_result; + + int int_op0, int_op1, int_op2, int_out, int_result, i = 1, fail; + long int long_op0, long_op1, long_op2, lont_out, lont_result; + long int long_int_out, long_int_result; + unsigned int unsigned_int_out, unsigned_int_result; + unsigned long int unsigned_long_int_out, unsigned_long_int_result; + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000fffffc00; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000010000; + __m128i_out = __lsx_vhsubw_h_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x00007f8000007f80; + *((unsigned long *)&__m128i_op1[0]) = 0x00007f8000007f80; + *((unsigned long *)&__m128i_result[1]) = 0x0000008000000080; + *((unsigned long *)&__m128i_result[0]) = 0x0000008000000080; + __m128i_out = __lsx_vhsubw_h_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffff00; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffff07effffe; + *((unsigned long *)&__m128i_result[1]) = 0x0001000100010000; + *((unsigned long *)&__m128i_result[0]) = 0x0001000100110002; + __m128i_out = __lsx_vhsubw_h_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + unsigned_int_out = __lsx_vpickve2gr_wu (__m128i_op0, 0x2); + *((unsigned long *)&__m128i_op0[1]) = 0x00000000ffffff01; + *((unsigned long *)&__m128i_op0[0]) = 0xffffeff400000df4; + *((unsigned long *)&__m128i_op1[1]) = 0x0000006f00001f0a; + *((unsigned long *)&__m128i_op1[0]) = 0x0000958affff995d; + *((unsigned long *)&__m128i_result[1]) = 0x0000ff91fffffff5; + *((unsigned long *)&__m128i_result[0]) = 0xffff00650001ffb0; + __m128i_out = __lsx_vhsubw_h_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000bfffffffe0f6; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x000000010001000a; + __m128i_out = __lsx_vhsubw_h_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x41dfffffffc00000; + *((unsigned long *)&__m128i_op0[0]) = 0xbff0000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0008000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0101010101010101; + *((unsigned long *)&__m128i_result[1]) = 0x0039ffffffff0000; + *((unsigned long *)&__m128i_result[0]) = 0xffbeffffffffffff; + __m128i_out = __lsx_vhsubw_h_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x370bdfecffecffec; + *((unsigned long *)&__m128i_op0[0]) = 0x370bdfecffecffec; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000008140c80; + *((unsigned long *)&__m128i_result[1]) = 0x0037ffdfffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x0037ffdfffeb007f; + __m128i_out = __lsx_vhsubw_h_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vhsubw_h_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x98147a504d145000; + *((unsigned long *)&__m128i_op0[0]) = 0x377b810912c0e000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x4e3e133738bb47d2; + *((unsigned long *)&__m128i_result[1]) = 0xff98007a004d0050; + *((unsigned long *)&__m128i_result[0]) = 0xfff9ff4a0057000e; + __m128i_out = __lsx_vhsubw_h_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x00000501ffff0005; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0001000100010001; + *((unsigned long *)&__m128i_result[0]) = 0x0001000600000001; + __m128i_out = __lsx_vhsubw_h_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x00020000ffff0001; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0001000100010001; + *((unsigned long *)&__m128i_result[0]) = 0x0001000100000001; + __m128i_out = __lsx_vhsubw_h_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000ffae001effae; + *((unsigned long *)&__m128i_op0[0]) = 0x001effae001effae; + *((unsigned long *)&__m128i_op1[1]) = 0x5252525252525252; + *((unsigned long *)&__m128i_op1[0]) = 0x5252525252525252; + *((unsigned long *)&__m128i_result[1]) = 0xffaeffadffaeffad; + *((unsigned long *)&__m128i_result[0]) = 0xffaeffadffaeffad; + __m128i_out = __lsx_vhsubw_h_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x000201000000000b; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000fc0000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000200000000; + __m128i_out = __lsx_vhsubw_w_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffff01ff01; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00000000ffffff02; + __m128i_out = __lsx_vhsubw_w_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000100000001; + *((unsigned long *)&__m128i_result[0]) = 0x0000000100000000; + __m128i_out = __lsx_vhsubw_w_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vhsubw_w_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000100000001; + *((unsigned long *)&__m128i_result[0]) = 0x0000000100000001; + __m128i_out = __lsx_vhsubw_w_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000000000ff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00000000ffffff01; + __m128i_out = __lsx_vhsubw_w_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x9727b8499727b849; + *((unsigned long *)&__m128i_op0[0]) = 0x12755900b653f081; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x7d7f13fc7c7ffbf4; + *((unsigned long *)&__m128i_result[1]) = 0xffff9727ffff9727; + *((unsigned long *)&__m128i_result[0]) = 0xfffffe79ffffba5f; + __m128i_out = __lsx_vhsubw_w_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000100010; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000100010; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000001; + __m128i_out = __lsx_vhsubw_d_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000006f00001f0a; + *((unsigned long *)&__m128i_op0[0]) = 0x0000958affff995d; + *((unsigned long *)&__m128i_op1[1]) = 0x00000000000000ff; + *((unsigned long *)&__m128i_op1[0]) = 0x0000100c6ffef10c; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffff70; + *((unsigned long *)&__m128i_result[0]) = 0xffffffff9001a47e; + __m128i_out = __lsx_vhsubw_d_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000000000a6; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffff59; + __m128i_out = __lsx_vhsubw_d_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000400000004; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000400000004; + *((unsigned long *)&__m128i_result[1]) = 0xfffffffffffffffc; + *((unsigned long *)&__m128i_result[0]) = 0xfffffffffffffffc; + __m128i_out = __lsx_vhsubw_d_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000100000001; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000100000001; + __m128i_out = __lsx_vhsubw_q_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000100000000; + __m128i_out = __lsx_vhsubw_q_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vhsubw_q_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vhsubw_q_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x002affd600000001; + *((unsigned long *)&__m128i_op1[0]) = 0xcbc2723a4f12a5f8; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x343d8dc5b0ed5a08; + __m128i_out = __lsx_vhsubw_q_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vhsubw_q_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x00000000ffff53d9; + *((unsigned long *)&__m128i_op1[0]) = 0xffff0001ffff9515; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000fffe00006aea; + __m128i_out = __lsx_vhsubw_q_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000455555555; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x000003fe0000141e; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xfffffc01ffffebe2; + __m128i_out = __lsx_vhsubw_q_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vhsubw_q_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x67eb85afb2ebb000; + *((unsigned long *)&__m128i_op0[0]) = 0xc8847ef6ed3f2000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000002000000020; + *((unsigned long *)&__m128i_op1[0]) = 0x0000001f0000001f; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x67eb8590b2ebafe1; + __m128i_out = __lsx_vhsubw_q_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x56a09e662ab46b31; + *((unsigned long *)&__m128i_op1[0]) = 0xb4b8122ef4054bb3; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x4b47edd10bfab44d; + __m128i_out = __lsx_vhsubw_q_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vhsubw-2.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vhsubw-2.c new file mode 100644 index 00000000000..26b51ee1421 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vhsubw-2.c @@ -0,0 +1,353 @@ +/* { dg-do run } */ +/* { dg-options "-mlsx -w -fno-strict-aliasing" } */ +#include "../simd_correctness_check.h" +#include + +int +main () +{ + __m128i __m128i_op0, __m128i_op1, __m128i_op2, __m128i_out, __m128i_result; + __m128 __m128_op0, __m128_op1, __m128_op2, __m128_out, __m128_result; + __m128d __m128d_op0, __m128d_op1, __m128d_op2, __m128d_out, __m128d_result; + + int int_op0, int_op1, int_op2, int_out, int_result, i = 1, fail; + long int long_op0, long_op1, long_op2, lont_out, lont_result; + long int long_int_out, long_int_result; + unsigned int unsigned_int_out, unsigned_int_result; + unsigned long int unsigned_long_int_out, unsigned_long_int_result; + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffff00000001; + *((unsigned long *)&__m128i_op0[0]) = 0xffffff0000010000; + *((unsigned long *)&__m128i_op1[1]) = 0xfe00fe00fe00fd01; + *((unsigned long *)&__m128i_op1[0]) = 0xfe00fffefe0100f6; + *((unsigned long *)&__m128i_result[1]) = 0x00ff00ff0000ffff; + *((unsigned long *)&__m128i_result[0]) = 0x00ff0001ffffff0a; + __m128i_out = __lsx_vhsubw_hu_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000017161515; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000095141311; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_op1[0]) = 0x76f424887fffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000170014; + *((unsigned long *)&__m128i_result[0]) = 0xff0cff78ff96ff14; + __m128i_out = __lsx_vhsubw_hu_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x67eb85afb2ebb000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x67eb85afb2ebb000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xff7cffd6ffc700b0; + __m128i_out = __lsx_vhsubw_hu_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vhsubw_hu_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00ff00ff00ff00ff; + __m128i_out = __lsx_vhsubw_hu_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000ffff0000ffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000ffff0000ffff; + __m128i_out = __lsx_vhsubw_wu_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00ffff0000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x00ffff0000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x7f8000007f800000; + *((unsigned long *)&__m128i_op1[0]) = 0x7f80000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x000000ff00000000; + *((unsigned long *)&__m128i_result[0]) = 0x000000ff00000000; + __m128i_out = __lsx_vhsubw_wu_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000020; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vhsubw_wu_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vhsubw_wu_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0xffff0001ffff0001; + *((unsigned long *)&__m128i_result[0]) = 0xffff0001ffff0001; + __m128i_out = __lsx_vhsubw_wu_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0101010101010101; + *((unsigned long *)&__m128i_op0[0]) = 0x0101010101010101; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000010100000101; + *((unsigned long *)&__m128i_result[0]) = 0x0000010100000101; + __m128i_out = __lsx_vhsubw_wu_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfefeff00fefeff00; + *((unsigned long *)&__m128i_op0[0]) = 0xfefeff00fefeff00; + *((unsigned long *)&__m128i_op1[1]) = 0x8080808080808080; + *((unsigned long *)&__m128i_op1[0]) = 0x8080808080808080; + *((unsigned long *)&__m128i_result[1]) = 0x00007e7e00007e7e; + *((unsigned long *)&__m128i_result[0]) = 0x00007e7e00007e7e; + __m128i_out = __lsx_vhsubw_wu_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xa2e3a36363636363; + *((unsigned long *)&__m128i_op0[0]) = 0xa2e3a36463636363; + *((unsigned long *)&__m128i_op1[1]) = 0x7f8000007f800000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000a2e300006363; + *((unsigned long *)&__m128i_result[0]) = 0x0000a2e300006363; + __m128i_out = __lsx_vhsubw_wu_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vhsubw_du_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x52527d7d52527d7d; + *((unsigned long *)&__m128i_op0[0]) = 0x52527d7d52527d7d; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000052527d7d; + *((unsigned long *)&__m128i_result[0]) = 0x0000000052527d7d; + __m128i_out = __lsx_vhsubw_du_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000002400180004; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000024; + __m128i_out = __lsx_vhsubw_du_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000ffffff02; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vhsubw_du_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffff00000001; + *((unsigned long *)&__m128i_op0[0]) = 0xffffff0000010000; + *((unsigned long *)&__m128i_op1[1]) = 0xabff54f1ffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xa5f7458b000802ff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00000000fff7fc01; + __m128i_out = __lsx_vhsubw_du_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xfffffffffffffffe; + *((unsigned long *)&__m128i_op1[0]) = 0xfffffffffffffffe; + *((unsigned long *)&__m128i_result[1]) = 0xffffffff00000002; + *((unsigned long *)&__m128i_result[0]) = 0xffffffff00000002; + __m128i_out = __lsx_vhsubw_du_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vhsubw_du_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vhsubw_du_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000800000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000800000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vhsubw_du_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000014eb54ab; + *((unsigned long *)&__m128i_op0[0]) = 0x14eb6a002a406a00; + *((unsigned long *)&__m128i_op1[1]) = 0xffff80008a7555aa; + *((unsigned long *)&__m128i_op1[0]) = 0x0a7535006af05cf9; + *((unsigned long *)&__m128i_result[1]) = 0xffffffff758aaa56; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffa9fb0d07; + __m128i_out = __lsx_vhsubw_du_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xffffffff00000000; + __m128i_out = __lsx_vhsubw_qu_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffff01ff01; + *((unsigned long *)&__m128i_op1[1]) = 0x0f180000ffe00000; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vhsubw_qu_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000001; + __m128i_out = __lsx_vhsubw_qu_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000001ca02f854; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000100013fa0; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00000001ca02f854; + __m128i_out = __lsx_vhsubw_qu_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000100013fa0; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000004b01; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffb4ff; + __m128i_out = __lsx_vhsubw_qu_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vhsubw_qu_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vhsubw_qu_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x00001b4a00007808; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffe4b5ffff87f8; + __m128i_out = __lsx_vhsubw_qu_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x3fc03fc000000003; + *((unsigned long *)&__m128i_op0[0]) = 0x7f7f1fd800000004; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x3fc03fc000000004; + __m128i_out = __lsx_vhsubw_qu_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vhsubw_qu_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xc080800000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xc080800000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x7efefefe82010201; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x418181017dfefdff; + __m128i_out = __lsx_vhsubw_qu_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x67eb85afb2ebb000; + *((unsigned long *)&__m128i_op0[0]) = 0xc8847ef6ed3f2000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x67eb85afb2ebb000; + __m128i_out = __lsx_vhsubw_qu_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xff800000ff800000; + *((unsigned long *)&__m128i_op0[0]) = 0xe593c8c4e593c8c4; + *((unsigned long *)&__m128i_op1[1]) = 0x0000ffff0000ffff; + *((unsigned long *)&__m128i_op1[0]) = 0x0000ff8000010f78; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xff7f0080ff7ef088; + __m128i_out = __lsx_vhsubw_qu_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000155; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000000f0000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xfffffffffff10000; + __m128i_out = __lsx_vhsubw_qu_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmsub.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmsub.c new file mode 100644 index 00000000000..47cf33cfdbd --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmsub.c @@ -0,0 +1,461 @@ +/* { dg-do run } */ +/* { dg-options "-mlsx -w -fno-strict-aliasing" } */ +#include "../simd_correctness_check.h" +#include + +int +main () +{ + __m128i __m128i_op0, __m128i_op1, __m128i_op2, __m128i_out, __m128i_result; + __m128 __m128_op0, __m128_op1, __m128_op2, __m128_out, __m128_result; + __m128d __m128d_op0, __m128d_op1, __m128d_op2, __m128d_out, __m128d_result; + + int int_op0, int_op1, int_op2, int_out, int_result, i = 1, fail; + long int long_op0, long_op1, long_op2, lont_out, lont_result; + long int long_int_out, long_int_result; + unsigned int unsigned_int_out, unsigned_int_result; + unsigned long int unsigned_long_int_out, unsigned_long_int_result; + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmsub_h (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xfeffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xfeffffffffff0002; + *((unsigned long *)&__m128i_op2[1]) = 0x54beed87bc3f2be1; + *((unsigned long *)&__m128i_op2[0]) = 0x8024d8f6a494afcb; + *((unsigned long *)&__m128i_result[1]) = 0xa8beed87bc3f2be1; + *((unsigned long *)&__m128i_result[0]) = 0x0024d8f6a494006a; + __m128i_out = __lsx_vmsub_b (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000fc0000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmsub_d (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + unsigned_int_out = __lsx_vpickve2gr_wu (__m128i_op0, 0x3); + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000ffff00000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000ffff0000ffff; + *((unsigned long *)&__m128i_op2[1]) = 0x0000ffff00000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000ffff0000ffff; + *((unsigned long *)&__m128i_result[1]) = 0x0001ffff00000000; + *((unsigned long *)&__m128i_result[0]) = 0x0001ffff0001ffff; + __m128i_out = __lsx_vmsub_w (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0001000100000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmsub_b (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000200010; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0xfffffff0ffe04000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000001fc0000; + __m128i_out = __lsx_vmsub_w (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000200010; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000200010; + __m128i_out = __lsx_vmsub_w (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0400040004000400; + *((unsigned long *)&__m128i_op0[0]) = 0x040004000400040d; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0400040004000400; + *((unsigned long *)&__m128i_result[0]) = 0x040004000400040d; + __m128i_out = __lsx_vmsub_w (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmsub_h (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xb327b9363c99d32e; + *((unsigned long *)&__m128i_op0[0]) = 0xa1e7b475d925730f; + *((unsigned long *)&__m128i_op1[1]) = 0x00000000003f80b0; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000ff800000; + *((unsigned long *)&__m128i_op2[1]) = 0x00007f8000007f80; + *((unsigned long *)&__m128i_op2[0]) = 0x00007f8000007f80; + *((unsigned long *)&__m128i_result[1]) = 0xb327b9363c992b2e; + *((unsigned long *)&__m128i_result[0]) = 0xa1e7b475d925730f; + __m128i_out = __lsx_vmsub_h (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x00ff000000ff0000; + *((unsigned long *)&__m128i_op1[1]) = 0xfffffffffffff800; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00ff000000ff0000; + __m128i_out = __lsx_vmsub_b (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0002000200020002; + *((unsigned long *)&__m128i_op0[0]) = 0x0002000200020002; + *((unsigned long *)&__m128i_op1[1]) = 0x000a000a000a000a; + *((unsigned long *)&__m128i_op1[0]) = 0x000a000a000a000a; + *((unsigned long *)&__m128i_op2[1]) = 0x000000004c7f4c7f; + *((unsigned long *)&__m128i_op2[0]) = 0xe0c0c0c0d1c7d1c6; + *((unsigned long *)&__m128i_result[1]) = 0x061006100613030c; + *((unsigned long *)&__m128i_result[0]) = 0x4d6814ef9c77ce46; + __m128i_out = __lsx_vmsub_d (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x7fff7fff7fff7fff; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x7fff7fff7fff7fff; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x7fff7fff7fff7fff; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x7ffe7ffe7ffe7ffe; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmsub_h (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x000000002bfd9461; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000f00; + *((unsigned long *)&__m128i_op2[0]) = 0x00000000ffffff00; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x000000002bfd9461; + __m128i_out = __lsx_vmsub_d (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x3727f00000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xc7e01fcfe0000000; + *((unsigned long *)&__m128i_op1[1]) = 0x3727112c00000000; + *((unsigned long *)&__m128i_op1[0]) = 0x39201f7120000040; + *((unsigned long *)&__m128i_op2[1]) = 0x00007fff00007fff; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xe5b9012c00000000; + *((unsigned long *)&__m128i_result[0]) = 0xc7e01fcfe0000000; + __m128i_out = __lsx_vmsub_w (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffff00000004; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffff0204; + *((unsigned long *)&__m128i_op1[1]) = 0x0000442900007b4c; + *((unsigned long *)&__m128i_op1[0]) = 0x0000e22b0000efa4; + *((unsigned long *)&__m128i_op2[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000442800007b50; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffff0204; + __m128i_out = __lsx_vmsub_w (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op2[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op2[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xfffffffefffffffe; + __m128i_out = __lsx_vmsub_w (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000000000000002f; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000029; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000003a24; + *((unsigned long *)&__m128i_op2[0]) = 0x003dbe88077c78c1; + *((unsigned long *)&__m128i_result[1]) = 0x000000000000002f; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000029; + __m128i_out = __lsx_vmsub_w (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x7f8000007f800000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x7f8000007f800000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xff0000007f800000; + __m128i_out = __lsx_vmsub_d (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0fff0fff0fff0fff; + *((unsigned long *)&__m128i_op1[0]) = 0x0fff0fff0fff0fff; + *((unsigned long *)&__m128i_op2[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op2[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0fff0fff0fff0fff; + *((unsigned long *)&__m128i_result[0]) = 0x0fff0fff0fff0fff; + __m128i_out = __lsx_vmsub_d (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000003f0000ffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffc3ffff003e; + *((unsigned long *)&__m128i_op2[1]) = 0x0000003f0000ffff; + *((unsigned long *)&__m128i_op2[0]) = 0xffffffc3ffff003e; + *((unsigned long *)&__m128i_result[1]) = 0x0000f07f0000ffff; + *((unsigned long *)&__m128i_result[0]) = 0xfffff177fffff0fc; + __m128i_out = __lsx_vmsub_h (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x7fff7fff7fff7fff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmsub_w (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfffbfffefffc9510; + *((unsigned long *)&__m128i_op0[0]) = 0xfffbfffefffc9510; + *((unsigned long *)&__m128i_op1[1]) = 0x0c0b0a090b0a0908; + *((unsigned long *)&__m128i_op1[0]) = 0x0a09080709080706; + *((unsigned long *)&__m128i_op2[1]) = 0xfffbfffefffc9510; + *((unsigned long *)&__m128i_op2[0]) = 0xfffbfffefffc9510; + *((unsigned long *)&__m128i_result[1]) = 0x29c251319c3a5c90; + *((unsigned long *)&__m128i_result[0]) = 0x62fb9272df7da6b0; + __m128i_out = __lsx_vmsub_d (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmsub_b (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmsub_d (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x8f8f8f8f8f8f8f8f; + *((unsigned long *)&__m128i_op1[0]) = 0x8f8f8f8f8f8f8f8f; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmsub_w (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x8000000080000000; + *((unsigned long *)&__m128i_op0[0]) = 0x8000000080000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op2[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op2[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x800000007fffffff; + *((unsigned long *)&__m128i_result[0]) = 0x800000007fffffff; + __m128i_out = __lsx_vmsub_d (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000010000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000010000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000010000000000; + __m128i_out = __lsx_vmsub_h (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000001400000014; + *((unsigned long *)&__m128i_op0[0]) = 0x0000001400000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000053a4f452; + *((unsigned long *)&__m128i_result[1]) = 0x0000001400000014; + *((unsigned long *)&__m128i_result[0]) = 0x0000001400000000; + __m128i_out = __lsx_vmsub_b (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmsub_d (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00680486ffffffda; + *((unsigned long *)&__m128i_op0[0]) = 0xffff913bfffffffd; + *((unsigned long *)&__m128i_op1[1]) = 0x00680486ffffffda; + *((unsigned long *)&__m128i_op1[0]) = 0xffff913bfffffffd; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x000000003ddc5dac; + *((unsigned long *)&__m128i_result[1]) = 0x00680486ffffffda; + *((unsigned long *)&__m128i_result[0]) = 0xffff913bb9951901; + __m128i_out = __lsx_vmsub_w (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000002000000020; + *((unsigned long *)&__m128i_op2[0]) = 0x0000001f0000001f; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmsub_w (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmsub_b (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmsub_w (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0021b761002c593c; + *((unsigned long *)&__m128i_op0[0]) = 0x002584710016cc56; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000001e03; + *((unsigned long *)&__m128i_result[1]) = 0x0021b761002c593c; + *((unsigned long *)&__m128i_result[0]) = 0x002584710016ea59; + __m128i_out = __lsx_vmsub_h (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000290; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000290; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmsub_h (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000100000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0001000100000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0002000400000001; + *((unsigned long *)&__m128i_result[1]) = 0x0000000100000000; + *((unsigned long *)&__m128i_result[0]) = 0x0003000500000001; + __m128i_out = __lsx_vmsub_w (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000001700000017; + *((unsigned long *)&__m128i_op0[0]) = 0x59f7fd8759f7fd87; + *((unsigned long *)&__m128i_op1[1]) = 0x0000ffae001effae; + *((unsigned long *)&__m128i_op1[0]) = 0x001effae001effae; + *((unsigned long *)&__m128i_op2[1]) = 0x0000001700000017; + *((unsigned long *)&__m128i_op2[0]) = 0x59f7fd8759f7fd87; + *((unsigned long *)&__m128i_result[1]) = 0xfd200ed2fd370775; + *((unsigned long *)&__m128i_result[0]) = 0x96198318780e32c5; + __m128i_out = __lsx_vmsub_d (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0004000400040004; + *((unsigned long *)&__m128i_op0[0]) = 0x0004000400040004; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0004000400040004; + *((unsigned long *)&__m128i_result[0]) = 0x0004000400040004; + __m128i_out = __lsx_vmsub_w (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0xfe3bfb01fe3bfe01; + *((unsigned long *)&__m128i_op2[0]) = 0xfe03fe3ffe01fa21; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmsub_w (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vssub-1.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vssub-1.c new file mode 100644 index 00000000000..fc4cbb4e500 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vssub-1.c @@ -0,0 +1,398 @@ +/* { dg-do run } */ +/* { dg-options "-mlsx -w -fno-strict-aliasing" } */ +#include "../simd_correctness_check.h" +#include + +int +main () +{ + __m128i __m128i_op0, __m128i_op1, __m128i_op2, __m128i_out, __m128i_result; + __m128 __m128_op0, __m128_op1, __m128_op2, __m128_out, __m128_result; + __m128d __m128d_op0, __m128d_op1, __m128d_op2, __m128d_out, __m128d_result; + + int int_op0, int_op1, int_op2, int_out, int_result, i = 1, fail; + long int long_op0, long_op1, long_op2, lont_out, lont_result; + long int long_int_out, long_int_result; + unsigned int unsigned_int_out, unsigned_int_result; + unsigned long int unsigned_long_int_out, unsigned_long_int_result; + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssub_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x00001801f0307f80; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00001801f0307f80; + __m128i_out = __lsx_vssub_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xfffffffff8f8dada; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffff01018888; + *((unsigned long *)&__m128i_result[1]) = 0x0101010108082626; + *((unsigned long *)&__m128i_result[0]) = 0x01010101ffff7878; + __m128i_out = __lsx_vssub_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x00fe000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0xfe80000000000001; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x027e0000000000ff; + __m128i_out = __lsx_vssub_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffb4ff; + *((unsigned long *)&__m128i_op0[0]) = 0xfffffffffff98dea; + *((unsigned long *)&__m128i_op1[1]) = 0x3ff0000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x40f3fa0000000000; + *((unsigned long *)&__m128i_result[1]) = 0xc00fffffffffb4ff; + *((unsigned long *)&__m128i_result[0]) = 0xbf0c05fffff98dea; + __m128i_out = __lsx_vssub_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000000000000002f; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000029; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffff00; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffff00; + *((unsigned long *)&__m128i_result[1]) = 0x010101010101012f; + *((unsigned long *)&__m128i_result[0]) = 0x0101010101010129; + __m128i_out = __lsx_vssub_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x1000100010001000; + *((unsigned long *)&__m128i_op0[0]) = 0x1000100010001000; + *((unsigned long *)&__m128i_op1[1]) = 0xfefefefefefefefe; + *((unsigned long *)&__m128i_op1[0]) = 0xfefefefefefefefe; + *((unsigned long *)&__m128i_result[1]) = 0x1202120212021202; + *((unsigned long *)&__m128i_result[0]) = 0x1202120212021202; + __m128i_out = __lsx_vssub_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0001000100010001; + *((unsigned long *)&__m128i_op1[0]) = 0x0001000100010001; + *((unsigned long *)&__m128i_result[1]) = 0x00ff00ff00ff00ff; + *((unsigned long *)&__m128i_result[0]) = 0x00ff00ff00ff00ff; + __m128i_out = __lsx_vssub_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0fffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x8000800080008000; + *((unsigned long *)&__m128i_op1[0]) = 0x41957fff7fff7fff; + *((unsigned long *)&__m128i_result[1]) = 0x7fff7fff7fff7fff; + *((unsigned long *)&__m128i_result[0]) = 0xbf6b810181018101; + __m128i_out = __lsx_vssub_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xfff8ffa2fffdffb0; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000ff800000; + *((unsigned long *)&__m128i_result[1]) = 0x0108015e01030150; + *((unsigned long *)&__m128i_result[0]) = 0x00000000017f0000; + __m128i_out = __lsx_vssub_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssub_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x007fffff00000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x007fffff00000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssub_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xf436f3f52f4ef4a8; + *((unsigned long *)&__m128i_op1[1]) = 0xff80000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0xff80000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0080000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xf4b6f3f52f4ef4a8; + __m128i_out = __lsx_vssub_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000fe00ff; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffff01ff01; + *((unsigned long *)&__m128i_result[1]) = 0x0001000100010001; + *((unsigned long *)&__m128i_result[0]) = 0x0001000101fd01fe; + __m128i_out = __lsx_vssub_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0040004000400040; + *((unsigned long *)&__m128i_op1[0]) = 0x0040004000400040; + *((unsigned long *)&__m128i_result[1]) = 0xffc0ffc0ffc0ffc0; + *((unsigned long *)&__m128i_result[0]) = 0xffc0ffc0ffc0ffc0; + __m128i_out = __lsx_vssub_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssub_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x7fff010181010102; + *((unsigned long *)&__m128i_op0[0]) = 0x7fffffff81010102; + *((unsigned long *)&__m128i_op1[1]) = 0x003f0000ffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0x003f0000ffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x7fc0010181020103; + *((unsigned long *)&__m128i_result[0]) = 0x7fc0ffff81020103; + __m128i_out = __lsx_vssub_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssub_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0001000100010001; + *((unsigned long *)&__m128i_op0[0]) = 0x0001000100010001; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0001000100010001; + *((unsigned long *)&__m128i_result[0]) = 0x0001000100010001; + __m128i_out = __lsx_vssub_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vssub_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000001e03; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000011e04; + __m128i_out = __lsx_vssub_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x6363636363abdf16; + *((unsigned long *)&__m128i_op0[0]) = 0x41f8e08016161198; + *((unsigned long *)&__m128i_op1[1]) = 0x00000000246d9755; + *((unsigned long *)&__m128i_op1[0]) = 0x000000002427c2ee; + *((unsigned long *)&__m128i_result[1]) = 0x636363633f3e47c1; + *((unsigned long *)&__m128i_result[0]) = 0x41f8e080f1ef4eaa; + __m128i_out = __lsx_vssub_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0001fffe00014b41; + *((unsigned long *)&__m128i_op1[0]) = 0x0001fffe0001ffde; + *((unsigned long *)&__m128i_result[1]) = 0xffff0002ffffb4bf; + *((unsigned long *)&__m128i_result[0]) = 0xffff0002ffff0022; + __m128i_out = __lsx_vssub_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000001fc0000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000002010; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000001fbdff0; + __m128i_out = __lsx_vssub_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssub_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssub_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x03f1e3d28b1a8a1a; + *((unsigned long *)&__m128i_op1[1]) = 0x000000000001d5d4; + *((unsigned long *)&__m128i_op1[0]) = 0x000000150d707009; + *((unsigned long *)&__m128i_result[1]) = 0x00000000fffe2a2c; + *((unsigned long *)&__m128i_result[0]) = 0x03f1e3bd80000000; + __m128i_out = __lsx_vssub_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vssub_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000100000001; + *((unsigned long *)&__m128i_result[0]) = 0x0000000100000001; + __m128i_out = __lsx_vssub_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffd5002affffffff; + *((unsigned long *)&__m128i_op1[0]) = 0x343d8dc6b0ed5a08; + *((unsigned long *)&__m128i_result[1]) = 0x002affd600000001; + *((unsigned long *)&__m128i_result[0]) = 0xcbc2723a4f12a5f8; + __m128i_out = __lsx_vssub_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000100000001; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000100000001; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000100000001; + *((unsigned long *)&__m128i_result[0]) = 0x0000000100000001; + __m128i_out = __lsx_vssub_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffff7ffffffffe; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000fffffffe; + *((unsigned long *)&__m128i_op1[1]) = 0xffffff7ffffffffe; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000fffffffe; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssub_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssub_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000002000000020; + *((unsigned long *)&__m128i_op1[0]) = 0x0000002000000020; + *((unsigned long *)&__m128i_result[1]) = 0xffffffdfffffffe0; + *((unsigned long *)&__m128i_result[0]) = 0xffffffdfffffffe0; + __m128i_out = __lsx_vssub_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000c2f90000bafa; + *((unsigned long *)&__m128i_op1[1]) = 0x0000c2f90000bafa; + *((unsigned long *)&__m128i_op1[0]) = 0x8000c2fa8000c2fa; + *((unsigned long *)&__m128i_result[1]) = 0xffff3d06ffff4506; + *((unsigned long *)&__m128i_result[0]) = 0x7ffffffe7ffff800; + __m128i_out = __lsx_vssub_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfffffff3fffffff3; + *((unsigned long *)&__m128i_op0[0]) = 0xfffffff3fffffff3; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0xfffffff3fffffff4; + *((unsigned long *)&__m128i_result[0]) = 0xfffffff3fffffff4; + __m128i_out = __lsx_vssub_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x7ef8000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x8108000000000000; + __m128i_out = __lsx_vssub_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000063b2ac27; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffaa076aeb; + *((unsigned long *)&__m128i_op1[1]) = 0x00000000ffff53d9; + *((unsigned long *)&__m128i_op1[0]) = 0xffff0001ffff9515; + *((unsigned long *)&__m128i_result[1]) = 0xffffffff63b3584e; + *((unsigned long *)&__m128i_result[0]) = 0x0000fffdaa07d5d6; + __m128i_out = __lsx_vssub_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffff81; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000005; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffff7c; + __m128i_out = __lsx_vssub_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssub_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0xff7cffd6ffc700b0; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x008300290038ff50; + __m128i_out = __lsx_vssub_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000c0dec4d1; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xffffffff3f213b2f; + __m128i_out = __lsx_vssub_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vssub-2.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vssub-2.c new file mode 100644 index 00000000000..0d5987567c1 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vssub-2.c @@ -0,0 +1,408 @@ +/* { dg-do run } */ +/* { dg-options "-mlsx -w -fno-strict-aliasing" } */ +#include "../simd_correctness_check.h" +#include + +int +main () +{ + __m128i __m128i_op0, __m128i_op1, __m128i_op2, __m128i_out, __m128i_result; + __m128 __m128_op0, __m128_op1, __m128_op2, __m128_out, __m128_result; + __m128d __m128d_op0, __m128d_op1, __m128d_op2, __m128d_out, __m128d_result; + + int int_op0, int_op1, int_op2, int_out, int_result, i = 1, fail; + long int long_op0, long_op1, long_op2, lont_out, lont_result; + long int long_int_out, long_int_result; + unsigned int unsigned_int_out, unsigned_int_result; + unsigned long int unsigned_long_int_out, unsigned_long_int_result; + + *((unsigned long *)&__m128i_op0[1]) = 0x7f801fa06451ef11; + *((unsigned long *)&__m128i_op0[0]) = 0x68bcf93435ed25ed; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffb64c; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000003900; + *((unsigned long *)&__m128i_result[0]) = 0x68bcf93435ed25ed; + __m128i_out = __lsx_vssub_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x460f3b393ef4be3a; + *((unsigned long *)&__m128i_result[1]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssub_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x04e00060ffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0x04e00060ffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x04e00060ffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x04e00060ffffffff; + __m128i_out = __lsx_vssub_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x004200a000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x004200a000200001; + *((unsigned long *)&__m128i_op1[1]) = 0x000000000000001c; + *((unsigned long *)&__m128i_op1[0]) = 0x000000000000001c; + *((unsigned long *)&__m128i_result[1]) = 0x004200a000000000; + *((unsigned long *)&__m128i_result[0]) = 0x004200a000200000; + __m128i_out = __lsx_vssub_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0c03e17edd781b11; + *((unsigned long *)&__m128i_op0[0]) = 0x342caf9be5579ebe; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x000000000000f909; + *((unsigned long *)&__m128i_result[1]) = 0x0c03e17edd781b11; + *((unsigned long *)&__m128i_result[0]) = 0x342caf9be55700b5; + __m128i_out = __lsx_vssub_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000200010; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000200010; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssub_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssub_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x11000f2010000e20; + *((unsigned long *)&__m128i_op0[0]) = 0x0f000d200e000c20; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x11000f2010000e20; + *((unsigned long *)&__m128i_result[0]) = 0x0f000d200e000c20; + __m128i_out = __lsx_vssub_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x001ffff0003ffff0; + *((unsigned long *)&__m128i_op0[0]) = 0x000fffefffefffef; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x001ffff0003ffff0; + *((unsigned long *)&__m128i_result[0]) = 0x000fffefffefffef; + __m128i_out = __lsx_vssub_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000014; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000014; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssub_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssub_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssub_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vssub_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssub_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000005; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000005; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x4e3e13368c17f6e6; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000005; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssub_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssub_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x1111311111114111; + *((unsigned long *)&__m128i_op0[0]) = 0x1111311111112111; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000007fff; + *((unsigned long *)&__m128i_result[1]) = 0x1111311111114111; + *((unsigned long *)&__m128i_result[0]) = 0x1111311111110000; + __m128i_out = __lsx_vssub_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfefefefefefefefe; + *((unsigned long *)&__m128i_op0[0]) = 0xfefefefefefefefe; + *((unsigned long *)&__m128i_op1[1]) = 0x0002000200020002; + *((unsigned long *)&__m128i_op1[0]) = 0x0202fe02fd020102; + *((unsigned long *)&__m128i_result[1]) = 0xfefcfefcfefcfefc; + *((unsigned long *)&__m128i_result[0]) = 0xfcfc00fc01fcfdfc; + __m128i_out = __lsx_vssub_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0x00004000ffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssub_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xbfd10d0d7b6b6b73; + *((unsigned long *)&__m128i_op0[0]) = 0xc5c53492f25acbf2; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000f3040705; + *((unsigned long *)&__m128i_result[1]) = 0xbfd10d0d7b6b6b73; + *((unsigned long *)&__m128i_result[0]) = 0xc5c534920000c4ed; + __m128i_out = __lsx_vssub_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssub_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssub_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssub_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000200; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000200; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffff0000; + *((unsigned long *)&__m128i_op1[0]) = 0x00ff000000ff0000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssub_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssub_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00ff00ff00ff00ff; + *((unsigned long *)&__m128i_op0[0]) = 0x00ff00ff000000ff; + *((unsigned long *)&__m128i_op1[1]) = 0x000000ff000000ff; + *((unsigned long *)&__m128i_op1[0]) = 0x000000ff000000ff; + *((unsigned long *)&__m128i_result[1]) = 0x00ff000000ff0000; + *((unsigned long *)&__m128i_result[0]) = 0x00ff000000000000; + __m128i_out = __lsx_vssub_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xc14eef7fc14ea000; + *((unsigned long *)&__m128i_op1[0]) = 0x000ea000010fa101; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssub_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + int_out = __lsx_vpickve2gr_b (__m128i_op0, 0xb); + *((unsigned long *)&__m128i_op0[1]) = 0x000000000000bd3d; + *((unsigned long *)&__m128i_op0[0]) = 0x000000007fff0000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000c7fff000c; + *((unsigned long *)&__m128i_op1[0]) = 0x1000100010001000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x000000006ffef000; + __m128i_out = __lsx_vssub_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffc2ffe700000007; + *((unsigned long *)&__m128i_op0[0]) = 0x0000ffc100010001; + *((unsigned long *)&__m128i_op1[1]) = 0x41dfffff00000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xbde2ffe800000007; + *((unsigned long *)&__m128i_result[0]) = 0x0000ffc100010001; + __m128i_out = __lsx_vssub_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000000f3040705; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x00000000f3040705; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssub_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0xa000308000008002; + *((unsigned long *)&__m128i_op1[0]) = 0x0500847b00000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00000000ffffffff; + __m128i_out = __lsx_vssub_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x4f4f4f4f4f4f4f4f; + *((unsigned long *)&__m128i_op1[0]) = 0x4f4f4f4f4f4f4f4f; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssub_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssub_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssub_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssub_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000ff000000ff00; + *((unsigned long *)&__m128i_op1[1]) = 0x3fffff0000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x3fffff0000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssub_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0x006f0efe258ca851; + *((unsigned long *)&__m128i_op1[1]) = 0x0000006f00001f0a; + *((unsigned long *)&__m128i_op1[0]) = 0x0000958affff995d; + *((unsigned long *)&__m128i_result[1]) = 0xffffff90ffffe0f5; + *((unsigned long *)&__m128i_result[0]) = 0x006e7973258d0ef4; + __m128i_out = __lsx_vssub_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssub_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x00000000ca02f854; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssub_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x6363636363636363; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000d0000000d; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x6363635663636356; + __m128i_out = __lsx_vssub_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssub_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000080; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000080; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssub_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000080; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000080; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssub_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsub.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsub.c new file mode 100644 index 00000000000..f5c82bc74ba --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsub.c @@ -0,0 +1,381 @@ +/* { dg-do run } */ +/* { dg-options "-mlsx -w -fno-strict-aliasing" } */ +#include "../simd_correctness_check.h" +#include + +int +main () +{ + __m128i __m128i_op0, __m128i_op1, __m128i_op2, __m128i_out, __m128i_result; + __m128 __m128_op0, __m128_op1, __m128_op2, __m128_out, __m128_result; + __m128d __m128d_op0, __m128d_op1, __m128d_op2, __m128d_out, __m128d_result; + + int int_op0, int_op1, int_op2, int_out, int_result, i = 1, fail; + long int long_op0, long_op1, long_op2, lont_out, lont_result; + long int long_int_out, long_int_result; + unsigned int unsigned_int_out, unsigned_int_result; + unsigned long int unsigned_long_int_out, unsigned_long_int_result; + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsub_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x000000000000ff02; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00000000000001fe; + __m128i_out = __lsx_vsub_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffe000ffffe000; + *((unsigned long *)&__m128i_op0[0]) = 0xc6ffe000c6fde000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x8080808080808081; + *((unsigned long *)&__m128i_result[1]) = 0xffffe000ffffe000; + *((unsigned long *)&__m128i_result[0]) = 0x467f6080467d607f; + __m128i_out = __lsx_vsub_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000010000; + *((unsigned long *)&__m128i_op0[0]) = 0x00ff00ff00fe00ff; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000100000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000010000; + *((unsigned long *)&__m128i_result[0]) = 0x00ff00fe00fe00ff; + __m128i_out = __lsx_vsub_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsub_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0001000100010001; + *((unsigned long *)&__m128i_op0[0]) = 0x0001000100010001; + *((unsigned long *)&__m128i_op1[1]) = 0x0001000100010001; + *((unsigned long *)&__m128i_op1[0]) = 0x0001000100010001; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsub_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x7fff00007fff0000; + *((unsigned long *)&__m128i_op0[0]) = 0x7fff00007fff0000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x7fff00007fff0000; + *((unsigned long *)&__m128i_result[0]) = 0x7fff00007fff0000; + __m128i_out = __lsx_vsub_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsub_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsub_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000000000ff; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000c0dec4d1; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000040223c2e; + __m128i_out = __lsx_vsub_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfd200ed2fd370775; + *((unsigned long *)&__m128i_op0[0]) = 0x96198318780e32c5; + *((unsigned long *)&__m128i_op1[1]) = 0xffffe65ecc1be5bc; + *((unsigned long *)&__m128i_op1[0]) = 0xffffe65ecc1be5bc; + *((unsigned long *)&__m128i_result[1]) = 0xfe212874311c22b9; + *((unsigned long *)&__m128i_result[0]) = 0x971a9dbaacf34d09; + __m128i_out = __lsx_vsub_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + unsigned_int_out = __lsx_vpickve2gr_wu (__m128i_op0, 0x0); + *((unsigned long *)&__m128i_op0[1]) = 0x4f4f4f4f4f4f4f4f; + *((unsigned long *)&__m128i_op0[0]) = 0x4f4f4f4f4f4f4f4f; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x4f4f4f4f4f4f4f4f; + *((unsigned long *)&__m128i_result[0]) = 0x4f4f4f4f4f4f4f4f; + __m128i_out = __lsx_vsub_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0404038383838404; + *((unsigned long *)&__m128i_op0[0]) = 0x0404038383838404; + *((unsigned long *)&__m128i_op1[1]) = 0xf000e001bf84df83; + *((unsigned long *)&__m128i_op1[0]) = 0xfff8e001ff84e703; + *((unsigned long *)&__m128i_result[1]) = 0x14042382c3ffa481; + *((unsigned long *)&__m128i_result[0]) = 0x040c238283ff9d01; + __m128i_out = __lsx_vsub_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0141010101410101; + *((unsigned long *)&__m128i_op1[0]) = 0x0141010101410101; + *((unsigned long *)&__m128i_result[1]) = 0xfebffefffebffeff; + *((unsigned long *)&__m128i_result[0]) = 0xfebffefffebffeff; + __m128i_out = __lsx_vsub_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x1111111111111111; + *((unsigned long *)&__m128i_op0[0]) = 0x1111111111111111; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x1111111111111111; + *((unsigned long *)&__m128i_result[0]) = 0x1111111111111111; + __m128i_out = __lsx_vsub_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsub_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfffefffefffefffe; + *((unsigned long *)&__m128i_op0[0]) = 0xfffefffefffefffe; + *((unsigned long *)&__m128i_op1[1]) = 0x000700000004fdff; + *((unsigned long *)&__m128i_op1[0]) = 0x000300000000fdff; + *((unsigned long *)&__m128i_result[1]) = 0xfff7fffefffa01ff; + *((unsigned long *)&__m128i_result[0]) = 0xfffbfffefffe01ff; + __m128i_out = __lsx_vsub_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0001000000010000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000cd630000cd63; + *((unsigned long *)&__m128i_result[1]) = 0xffff0000ffff0000; + *((unsigned long *)&__m128i_result[0]) = 0x0000329d0000329d; + __m128i_out = __lsx_vsub_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x08080807f7f7f7f8; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000202020200; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000100; + *((unsigned long *)&__m128i_result[1]) = 0x08080805f5f5f5f8; + *((unsigned long *)&__m128i_result[0]) = 0x000000000000ff00; + __m128i_out = __lsx_vsub_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x00060eb000000006; + *((unsigned long *)&__m128i_op1[0]) = 0x0000075c00000cf0; + *((unsigned long *)&__m128i_result[1]) = 0xfffaf1500000fffa; + *((unsigned long *)&__m128i_result[0]) = 0x0000f8a40000f310; + __m128i_out = __lsx_vsub_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfffffffff100fffc; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000200000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xfffffffdf100fffc; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsub_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsub_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000000007f7f7f7f; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0xfffffffffffffff0; + *((unsigned long *)&__m128i_result[1]) = 0x000000007f7f7f7f; + *((unsigned long *)&__m128i_result[0]) = 0x0000000100000010; + __m128i_out = __lsx_vsub_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsub_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000800000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000800000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000800000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000800000000000; + __m128i_out = __lsx_vsub_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsub_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x00001802041b0013; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_result[0]) = 0x00001802041b0014; + __m128i_out = __lsx_vsub_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xffff000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x000f7d1000000001; + *((unsigned long *)&__m128i_op1[0]) = 0x773324887fffffff; + *((unsigned long *)&__m128i_result[1]) = 0xfff082efffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x88cbdb7780000001; + __m128i_out = __lsx_vsub_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsub_q (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000001f50000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xfffffffffe0b0000; + __m128i_out = __lsx_vsub_q (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000001; + *((unsigned long *)&__m128i_op1[1]) = 0xfff0000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0xfff0000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x000fffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x0010000000000001; + __m128i_out = __lsx_vsub_q (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsub_q (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000800080; + *((unsigned long *)&__m128i_op0[0]) = 0x000000000000000b; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000800080; + *((unsigned long *)&__m128i_result[0]) = 0x000000000000000b; + __m128i_out = __lsx_vsub_q (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsub_q (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffeb; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffeb; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000014; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000015; + __m128i_out = __lsx_vsub_q (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0001000100010001; + *((unsigned long *)&__m128i_op0[0]) = 0x0001000100010001; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0001000100010001; + *((unsigned long *)&__m128i_result[0]) = 0x0001000100010001; + __m128i_out = __lsx_vsub_q (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0007000000050000; + *((unsigned long *)&__m128i_op0[0]) = 0x0003000100010001; + *((unsigned long *)&__m128i_op1[1]) = 0x0000ffff0000ffff; + *((unsigned long *)&__m128i_op1[0]) = 0x0001fffe0001fefc; + *((unsigned long *)&__m128i_result[1]) = 0x0006000100040001; + *((unsigned long *)&__m128i_result[0]) = 0x00010002ffff0105; + __m128i_out = __lsx_vsub_q (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000003fffffffd; + *((unsigned long *)&__m128i_op0[0]) = 0x00000003fffffffd; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x00000003fffffffe; + *((unsigned long *)&__m128i_result[0]) = 0x00000003fffffffd; + __m128i_out = __lsx_vsub_q (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsub_q (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000feff23560000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000fd1654860000; + *((unsigned long *)&__m128i_op1[1]) = 0x6363636363abdf16; + *((unsigned long *)&__m128i_op1[0]) = 0x41f8e08016161198; + *((unsigned long *)&__m128i_result[1]) = 0x9c9d9b9bbfaa20e9; + *((unsigned long *)&__m128i_result[0]) = 0xbe081c963e6fee68; + __m128i_out = __lsx_vsub_q (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsubi.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsubi.c new file mode 100644 index 00000000000..37e0ccf4df7 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsubi.c @@ -0,0 +1,329 @@ +/* { dg-do run } */ +/* { dg-options "-mlsx -w -fno-strict-aliasing" } */ +#include "../simd_correctness_check.h" +#include + +int +main () +{ + __m128i __m128i_op0, __m128i_op1, __m128i_op2, __m128i_out, __m128i_result; + __m128 __m128_op0, __m128_op1, __m128_op2, __m128_out, __m128_result; + __m128d __m128d_op0, __m128d_op1, __m128d_op2, __m128d_out, __m128d_result; + + int int_op0, int_op1, int_op2, int_out, int_result, i = 1, fail; + long int long_op0, long_op1, long_op2, lont_out, lont_result; + long int long_int_out, long_int_result; + unsigned int unsigned_int_out, unsigned_int_result; + unsigned long int unsigned_long_int_out, unsigned_long_int_result; + + *((unsigned long *)&__m128i_op0[1]) = 0xfff489b693120950; + *((unsigned long *)&__m128i_op0[0]) = 0xfffc45a851c40c18; + *((unsigned long *)&__m128i_result[1]) = 0xe0d56a9774f3ea31; + *((unsigned long *)&__m128i_result[0]) = 0xe0dd268932a5edf9; + __m128i_out = __lsx_vsubi_bu (__m128i_op0, 0x1f); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000ffffff88; + *((unsigned long *)&__m128i_result[1]) = 0xe5e5e5e5e5e5e5e5; + *((unsigned long *)&__m128i_result[0]) = 0xe5e5e5e5e4e4e46d; + __m128i_out = __lsx_vsubi_bu (__m128i_op0, 0x1b); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000897957687; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000408; + *((unsigned long *)&__m128i_result[1]) = 0xf7f7f7ff8e8c6d7e; + *((unsigned long *)&__m128i_result[0]) = 0xf7f7f7f7f7f7fbff; + __m128i_out = __lsx_vsubi_bu (__m128i_op0, 0x9); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + int_out = __lsx_vpickve2gr_w (__m128i_op0, 0x1); + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0xe6e6e6e6e6e6e6e6; + *((unsigned long *)&__m128i_result[0]) = 0xe6e6e6e6e6e6e6e6; + __m128i_out = __lsx_vsubi_bu (__m128i_op0, 0x19); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xf8f8f8f8f8f8f8f8; + *((unsigned long *)&__m128i_result[0]) = 0xf8f8f8f8f8f8f8f8; + __m128i_out = __lsx_vsubi_bu (__m128i_op0, 0x8); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x2e34594c3b000000; + *((unsigned long *)&__m128i_result[1]) = 0xe9e9e9e9e9e9e9e9; + *((unsigned long *)&__m128i_result[0]) = 0x171d423524e9e9e9; + __m128i_out = __lsx_vsubi_bu (__m128i_op0, 0x17); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffe2ffe2ffe2ffe2; + *((unsigned long *)&__m128i_result[0]) = 0xffe2ffe2ffe2ffe2; + __m128i_out = __lsx_vsubi_hu (__m128i_op0, 0x1e); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x9795698585057dec; + *((unsigned long *)&__m128i_op0[0]) = 0x87f82867431a1d08; + *((unsigned long *)&__m128i_result[1]) = 0x9780697084f07dd7; + *((unsigned long *)&__m128i_result[0]) = 0x87e3285243051cf3; + __m128i_out = __lsx_vsubi_hu (__m128i_op0, 0x15); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xfffcfffcfffcfffc; + *((unsigned long *)&__m128i_result[0]) = 0xfffcfffcfffcfffc; + __m128i_out = __lsx_vsubi_hu (__m128i_op0, 0x4); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000101; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xfffcfffcfffc00fd; + *((unsigned long *)&__m128i_result[0]) = 0xfffcfffcfffcfffc; + __m128i_out = __lsx_vsubi_hu (__m128i_op0, 0x4); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x371fe00000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x371fe00000000000; + *((unsigned long *)&__m128i_result[1]) = 0x370bdfecffecffec; + *((unsigned long *)&__m128i_result[0]) = 0x370bdfecffecffec; + __m128i_out = __lsx_vsubi_hu (__m128i_op0, 0x14); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000040600000406; + *((unsigned long *)&__m128i_op0[0]) = 0x020202020202fe02; + *((unsigned long *)&__m128i_result[1]) = 0xfff503fbfff503fb; + *((unsigned long *)&__m128i_result[0]) = 0x01f701f701f7fdf7; + __m128i_out = __lsx_vsubi_hu (__m128i_op0, 0xb); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0xfffdfffdfffdfffd; + *((unsigned long *)&__m128i_result[0]) = 0xfffdfffdfffdfffd; + __m128i_out = __lsx_vsubi_hu (__m128i_op0, 0x2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x803e0000803e0000; + *((unsigned long *)&__m128i_op0[0]) = 0x803e0000803e0000; + *((unsigned long *)&__m128i_result[1]) = 0x803bfffd803bfffd; + *((unsigned long *)&__m128i_result[0]) = 0x803bfffd803bfffd; + __m128i_out = __lsx_vsubi_hu (__m128i_op0, 0x3); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xfffdfffdfffdfffd; + *((unsigned long *)&__m128i_result[0]) = 0xfffdfffdfffdfffd; + __m128i_out = __lsx_vsubi_hu (__m128i_op0, 0x3); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffedffedffedffed; + *((unsigned long *)&__m128i_result[0]) = 0xffedffedffedffed; + __m128i_out = __lsx_vsubi_hu (__m128i_op0, 0x13); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0xffe4ffe4ffe4ffe4; + *((unsigned long *)&__m128i_result[0]) = 0xffe4ffe4ffe4ffe4; + __m128i_out = __lsx_vsubi_hu (__m128i_op0, 0x1b); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsubi_wu (__m128i_op0, 0x0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffefffffffef; + *((unsigned long *)&__m128i_result[0]) = 0xffffffefffffffef; + __m128i_out = __lsx_vsubi_wu (__m128i_op0, 0x11); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0xffffffe6ffffffe6; + *((unsigned long *)&__m128i_result[0]) = 0xffffffe6ffffffe6; + __m128i_out = __lsx_vsubi_wu (__m128i_op0, 0x19); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xfffffff1fffffff1; + *((unsigned long *)&__m128i_result[0]) = 0xfffffff1fffffff1; + __m128i_out = __lsx_vsubi_wu (__m128i_op0, 0xf); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0xfffffff6fffffff6; + *((unsigned long *)&__m128i_result[0]) = 0xfffffff6fffffff6; + __m128i_out = __lsx_vsubi_wu (__m128i_op0, 0x9); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffe4ffffffe4; + *((unsigned long *)&__m128i_result[0]) = 0xffffffe4ffffffe4; + __m128i_out = __lsx_vsubi_wu (__m128i_op0, 0x1c); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffe1ffffffe1; + *((unsigned long *)&__m128i_result[0]) = 0xffffffe1ffffffe1; + __m128i_out = __lsx_vsubi_wu (__m128i_op0, 0x1f); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xfffffff1fffffff1; + *((unsigned long *)&__m128i_result[0]) = 0xfffffff1fffffff1; + __m128i_out = __lsx_vsubi_wu (__m128i_op0, 0xf); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xffffab7e71e33848; + *((unsigned long *)&__m128i_result[1]) = 0xffffffe1ffffffe1; + *((unsigned long *)&__m128i_result[0]) = 0xffffab5f71e33829; + __m128i_out = __lsx_vsubi_wu (__m128i_op0, 0x1f); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xa8beed87bc3f2be1; + *((unsigned long *)&__m128i_op0[0]) = 0x0024d8f6a494006a; + *((unsigned long *)&__m128i_result[1]) = 0xa8beed87bc3f2bd3; + *((unsigned long *)&__m128i_result[0]) = 0x0024d8f6a494005c; + __m128i_out = __lsx_vsubi_du (__m128i_op0, 0xe); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffeb; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffeb; + __m128i_out = __lsx_vsubi_du (__m128i_op0, 0x15); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffe1; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffe1; + __m128i_out = __lsx_vsubi_du (__m128i_op0, 0x1f); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xfffffffffffffff7; + *((unsigned long *)&__m128i_result[0]) = 0xfffffffffffffff7; + __m128i_out = __lsx_vsubi_du (__m128i_op0, 0x9); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffe5; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffe5; + __m128i_out = __lsx_vsubi_du (__m128i_op0, 0x1a); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xf2f2e5e5e5e5e5e5; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xf2f2e5e5e5e5e5dc; + *((unsigned long *)&__m128i_result[0]) = 0xfffffffffffffff7; + __m128i_out = __lsx_vsubi_du (__m128i_op0, 0x9); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x3fffff0000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x3fffff0000000000; + *((unsigned long *)&__m128i_result[1]) = 0x3ffffeffffffffe5; + *((unsigned long *)&__m128i_result[0]) = 0x3ffffeffffffffe5; + __m128i_out = __lsx_vsubi_du (__m128i_op0, 0x1b); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000000000000007b; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000070; + *((unsigned long *)&__m128i_result[0]) = 0xfffffffffffffff5; + __m128i_out = __lsx_vsubi_du (__m128i_op0, 0xb); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xfffffffffffffff0; + *((unsigned long *)&__m128i_result[0]) = 0xfffffffffffffff0; + __m128i_out = __lsx_vsubi_du (__m128i_op0, 0x10); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffe6; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffe6; + __m128i_out = __lsx_vsubi_du (__m128i_op0, 0x1a); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0001000100010001; + *((unsigned long *)&__m128i_op0[0]) = 0x0001000100010001; + *((unsigned long *)&__m128i_result[1]) = 0x000100010000fffb; + *((unsigned long *)&__m128i_result[0]) = 0x000100010000fffb; + __m128i_out = __lsx_vsubi_du (__m128i_op0, 0x6); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffeb; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffeb; + __m128i_out = __lsx_vsubi_du (__m128i_op0, 0x15); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xfffffffffffffffa; + *((unsigned long *)&__m128i_result[0]) = 0xfffffffffffffffa; + __m128i_out = __lsx_vsubi_du (__m128i_op0, 0x6); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xfffdfffe80008000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffe2; + *((unsigned long *)&__m128i_result[0]) = 0xfffdfffe80007fe2; + __m128i_out = __lsx_vsubi_du (__m128i_op0, 0x1e); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x001a001a001a001a; + *((unsigned long *)&__m128i_op0[0]) = 0x001a001a001a001a; + *((unsigned long *)&__m128i_result[1]) = 0x001a001a001a000b; + *((unsigned long *)&__m128i_result[0]) = 0x001a001a001a000b; + __m128i_out = __lsx_vsubi_du (__m128i_op0, 0xf); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000000000234545b; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000c0dec4d1; + *((unsigned long *)&__m128i_result[1]) = 0x0000000002345454; + *((unsigned long *)&__m128i_result[0]) = 0x00000000c0dec4ca; + __m128i_out = __lsx_vsubi_du (__m128i_op0, 0x7); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0f8d33000f8d3300; + *((unsigned long *)&__m128i_op0[0]) = 0x0003b80000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0f8d33000f8d32fd; + *((unsigned long *)&__m128i_result[0]) = 0x0003b7fffffffffd; + __m128i_out = __lsx_vsubi_du (__m128i_op0, 0x3); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsubi_du (__m128i_op0, 0x0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsubwev-1.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsubwev-1.c new file mode 100644 index 00000000000..f0d391a09a8 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsubwev-1.c @@ -0,0 +1,326 @@ +/* { dg-do run } */ +/* { dg-options "-mlsx -w -fno-strict-aliasing" } */ +#include "../simd_correctness_check.h" +#include + +int +main () +{ + __m128i __m128i_op0, __m128i_op1, __m128i_op2, __m128i_out, __m128i_result; + __m128 __m128_op0, __m128_op1, __m128_op2, __m128_out, __m128_result; + __m128d __m128d_op0, __m128d_op1, __m128d_op2, __m128d_out, __m128d_result; + + int int_op0, int_op1, int_op2, int_out, int_result, i = 1, fail; + long int long_op0, long_op1, long_op2, lont_out, lont_result; + long int long_int_out, long_int_result; + unsigned int unsigned_int_out, unsigned_int_result; + unsigned long int unsigned_long_int_out, unsigned_long_int_result; + + *((unsigned long *)&__m128i_op0[1]) = 0x43d3e0000013e000; + *((unsigned long *)&__m128i_op0[0]) = 0x43d3e0000013e000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffd3000000130000; + *((unsigned long *)&__m128i_result[0]) = 0xffd3000000130000; + __m128i_out = __lsx_vsubwev_h_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vsubwev_h_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000000ffff53d9; + *((unsigned long *)&__m128i_op0[0]) = 0xffff0001ffff9515; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x000100010000ffda; + *((unsigned long *)&__m128i_result[0]) = 0x0000000200000016; + __m128i_out = __lsx_vsubwev_h_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffbfbfbfc0; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffbfbfbfc0; + *((unsigned long *)&__m128i_op1[1]) = 0x4040404040404040; + *((unsigned long *)&__m128i_op1[0]) = 0x4040404040404040; + *((unsigned long *)&__m128i_result[1]) = 0xffbfffbfff7fff80; + *((unsigned long *)&__m128i_result[0]) = 0xffbfffbfff7fff80; + __m128i_out = __lsx_vsubwev_h_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0001000100010001; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsubwev_h_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000808000020200; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000ff8000020000; + __m128i_out = __lsx_vsubwev_h_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x413e276583869d79; + *((unsigned long *)&__m128i_op0[0]) = 0x7f7f017f9d8726d3; + *((unsigned long *)&__m128i_op1[1]) = 0x7c7cd2eb63637c52; + *((unsigned long *)&__m128i_op1[0]) = 0x82ffd2210127add2; + *((unsigned long *)&__m128i_result[1]) = 0xffc2007aff230027; + *((unsigned long *)&__m128i_result[0]) = 0x0080005eff600001; + __m128i_out = __lsx_vsubwev_h_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffee; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000011ff040; + *((unsigned long *)&__m128i_result[1]) = 0x0001000100010012; + *((unsigned long *)&__m128i_result[0]) = 0x00000000ffe1ffc0; + __m128i_out = __lsx_vsubwev_h_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsubwev_w_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000100000001; + *((unsigned long *)&__m128i_op1[0]) = 0x0000004000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffc000000000; + __m128i_out = __lsx_vsubwev_w_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x000000000000000d; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x000000000000000d; + __m128i_out = __lsx_vsubwev_w_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsubwev_w_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000ffff00; + *((unsigned long *)&__m128i_op1[1]) = 0x00000000000000ff; + *((unsigned long *)&__m128i_op1[0]) = 0x0000100c6ffef10c; + *((unsigned long *)&__m128i_result[1]) = 0x00000000ffffff01; + *((unsigned long *)&__m128i_result[0]) = 0xffffeff400000df4; + __m128i_out = __lsx_vsubwev_w_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000002050320; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000002050320; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000001c88bf0; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000320; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000007730; + __m128i_out = __lsx_vsubwev_w_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsubwev_w_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsubwev_w_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000005; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000005; + __m128i_out = __lsx_vsubwev_w_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsubwev_w_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000001030103; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000100000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000103; + __m128i_out = __lsx_vsubwev_w_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x33eac9fdca42f660; + *((unsigned long *)&__m128i_op0[0]) = 0xaa472d26fe867091; + *((unsigned long *)&__m128i_op1[1]) = 0x33eac9fdca42f660; + *((unsigned long *)&__m128i_op1[0]) = 0xaa472d26fe867091; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsubwev_w_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vsubwev_d_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000208000002080; + *((unsigned long *)&__m128i_op0[0]) = 0x0000208000002080; + *((unsigned long *)&__m128i_op1[1]) = 0x0000208000002080; + *((unsigned long *)&__m128i_op1[0]) = 0x0000208000002080; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsubwev_d_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000004; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000004; + __m128i_out = __lsx_vsubwev_d_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x000000ff0000857a; + *((unsigned long *)&__m128i_op1[0]) = 0x05fafe0101fe000e; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffff7a86; + *((unsigned long *)&__m128i_result[0]) = 0xfffffffffe01fff2; + __m128i_out = __lsx_vsubwev_d_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xf654ad7447e59090; + *((unsigned long *)&__m128i_op1[0]) = 0x27b1b106b8145f50; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffb81a6f70; + *((unsigned long *)&__m128i_result[0]) = 0x0000000047eba0b0; + __m128i_out = __lsx_vsubwev_d_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x00000c01020d8009; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000003004; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00000c01020d5005; + __m128i_out = __lsx_vsubwev_q_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000fe00ff; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffff01ff01; + __m128i_out = __lsx_vsubwev_q_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x000000000000000d; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x000000000000000d; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsubwev_q_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x4f804f804f804f80; + *((unsigned long *)&__m128i_op0[0]) = 0x4f804f804f804f80; + *((unsigned long *)&__m128i_op1[1]) = 0x7fff7fff7fff7fff; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x4f804f804f804f80; + __m128i_out = __lsx_vsubwev_q_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xb9fe3640e4eb1b18; + *((unsigned long *)&__m128i_op0[0]) = 0x800000005b4b1b18; + *((unsigned long *)&__m128i_op1[1]) = 0xffffb9fe00003640; + *((unsigned long *)&__m128i_op1[0]) = 0xffffe4eb00001b18; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x80001b155b4b0000; + __m128i_out = __lsx_vsubwev_q_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000100000008; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000100080000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xfffffffefff80000; + __m128i_out = __lsx_vsubwev_q_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0x3fc03fc000000004; + *((unsigned long *)&__m128i_op1[1]) = 0x3fc03fc000000003; + *((unsigned long *)&__m128i_op1[0]) = 0x7f7f1fd800000004; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xc0411fe800000000; + __m128i_out = __lsx_vsubwev_q_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xff00e400ff00e400; + *((unsigned long *)&__m128i_op0[0]) = 0xff01e41ffff0e440; + *((unsigned long *)&__m128i_op1[1]) = 0xfffffffefffffffe; + *((unsigned long *)&__m128i_op1[0]) = 0xfffffffefffffffe; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xff01e420fff0e442; + __m128i_out = __lsx_vsubwev_q_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsubwev_q_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsubwev-2.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsubwev-2.c new file mode 100644 index 00000000000..3b18bc13cb9 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsubwev-2.c @@ -0,0 +1,417 @@ +/* { dg-do run } */ +/* { dg-options "-mlsx -w -fno-strict-aliasing" } */ +#include "../simd_correctness_check.h" +#include + +int +main () +{ + __m128i __m128i_op0, __m128i_op1, __m128i_op2, __m128i_out, __m128i_result; + __m128 __m128_op0, __m128_op1, __m128_op2, __m128_out, __m128_result; + __m128d __m128d_op0, __m128d_op1, __m128d_op2, __m128d_out, __m128d_result; + + int int_op0, int_op1, int_op2, int_out, int_result, i = 1, fail; + long int long_op0, long_op1, long_op2, lont_out, lont_result; + long int long_int_out, long_int_result; + unsigned int unsigned_int_out, unsigned_int_result; + unsigned long int unsigned_long_int_out, unsigned_long_int_result; + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsubwev_h_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsubwev_h_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x00ff00ff00000083; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000004; + *((unsigned long *)&__m128i_result[1]) = 0xff01ff010000ff7d; + *((unsigned long *)&__m128i_result[0]) = 0x000000000000fffc; + __m128i_out = __lsx_vsubwev_h_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x1000100010001000; + *((unsigned long *)&__m128i_op0[0]) = 0x1000100010001000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_op1[0]) = 0xffff00fc0000ff02; + *((unsigned long *)&__m128i_result[1]) = 0x000000000000ffff; + *((unsigned long *)&__m128i_result[0]) = 0xff01ff040000fffe; + __m128i_out = __lsx_vsubwev_h_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfffffacdb6dbecac; + *((unsigned long *)&__m128i_op0[0]) = 0x1f5533a694f902c0; + *((unsigned long *)&__m128i_op1[1]) = 0x21011f3f193d173b; + *((unsigned long *)&__m128i_op1[0]) = 0xff39ff37ff35ff33; + *((unsigned long *)&__m128i_result[1]) = 0x00fe008e009e0071; + *((unsigned long *)&__m128i_result[0]) = 0x001c006f00c4008d; + __m128i_out = __lsx_vsubwev_h_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x9c9ca19d509ae734; + *((unsigned long *)&__m128i_op0[0]) = 0xd1b09480f2123460; + *((unsigned long *)&__m128i_op1[1]) = 0x9c9c9c9c9c9c9c9c; + *((unsigned long *)&__m128i_op1[0]) = 0x9c9c9c9c9c9c9c9c; + *((unsigned long *)&__m128i_result[1]) = 0x00000001fffeff98; + *((unsigned long *)&__m128i_result[0]) = 0x0014ffe4ff76ffc4; + __m128i_out = __lsx_vsubwev_h_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x34947b4b11684f92; + *((unsigned long *)&__m128i_op1[0]) = 0xee297a731e5c5f86; + *((unsigned long *)&__m128i_result[1]) = 0xff6cffb5ff98ff6e; + *((unsigned long *)&__m128i_result[0]) = 0xffd7ff8dffa4ff7a; + __m128i_out = __lsx_vsubwev_h_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsubwev_h_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfffffffff8f8dada; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffff01018888; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffff3ea5016b; + *((unsigned long *)&__m128i_op1[0]) = 0xfffefffe3f6fb04d; + *((unsigned long *)&__m128i_result[1]) = 0x000000000000d96f; + *((unsigned long *)&__m128i_result[0]) = 0x00000001ffffd83b; + __m128i_out = __lsx_vsubwev_w_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000000f0009d3c; + *((unsigned long *)&__m128i_op0[0]) = 0x000000016fff9d3d; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000bd0; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000000007f0; + *((unsigned long *)&__m128i_result[1]) = 0x000000000000916c; + *((unsigned long *)&__m128i_result[0]) = 0x000000010000954d; + __m128i_out = __lsx_vsubwev_w_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x000100010000fe01; + *((unsigned long *)&__m128i_op1[1]) = 0x000000050000007b; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000500000005; + *((unsigned long *)&__m128i_result[1]) = 0xfffffffbffffff85; + *((unsigned long *)&__m128i_result[0]) = 0xfffffffc0000fdfc; + __m128i_out = __lsx_vsubwev_w_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsubwev_w_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000032; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000032; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsubwev_w_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffff80df00000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xa5c4c774856ba837; + *((unsigned long *)&__m128i_op1[0]) = 0x2a569f8081c3bbe9; + *((unsigned long *)&__m128i_result[1]) = 0xffffb96bffff57c9; + *((unsigned long *)&__m128i_result[0]) = 0xffff6080ffff4417; + __m128i_out = __lsx_vsubwev_w_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000063b2ac27; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffaa076aeb; + *((unsigned long *)&__m128i_result[1]) = 0x00000000ffff53d9; + *((unsigned long *)&__m128i_result[0]) = 0xffff0001ffff9515; + __m128i_out = __lsx_vsubwev_w_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsubwev_w_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000ffff0000ffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000ffff0000ffff; + __m128i_out = __lsx_vsubwev_w_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00060fbf00040fbf; + *((unsigned long *)&__m128i_op0[0]) = 0x00020fbf00000fbf; + *((unsigned long *)&__m128i_op1[1]) = 0x6363636363636363; + *((unsigned long *)&__m128i_op1[0]) = 0x6363636363636363; + *((unsigned long *)&__m128i_result[1]) = 0xffffac5cffffac5c; + *((unsigned long *)&__m128i_result[0]) = 0xffffac5cffffac5c; + __m128i_out = __lsx_vsubwev_w_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x000000000000ffff; + *((unsigned long *)&__m128i_op1[1]) = 0xffaefffbffaefffb; + *((unsigned long *)&__m128i_op1[0]) = 0xffaefffbffaefffb; + *((unsigned long *)&__m128i_result[1]) = 0xffff0005ffff0005; + *((unsigned long *)&__m128i_result[0]) = 0xffff000500000004; + __m128i_out = __lsx_vsubwev_w_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000000a1630000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x00000000a1630000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsubwev_d_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x00000001fffffffe; + *((unsigned long *)&__m128i_op1[0]) = 0x00000001fffffffe; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000001; + __m128i_out = __lsx_vsubwev_d_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000001fd0; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000001fd0; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsubwev_d_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xff7ffffef77fffdd; + *((unsigned long *)&__m128i_op1[0]) = 0xf77edf9cffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000008800022; + *((unsigned long *)&__m128i_result[0]) = 0xffffffff00000001; + __m128i_out = __lsx_vsubwev_d_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffda6f; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffe3d7; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000001; + *((unsigned long *)&__m128i_result[1]) = 0x00000000ffffda6e; + *((unsigned long *)&__m128i_result[0]) = 0x00000000ffffe3d6; + __m128i_out = __lsx_vsubwev_d_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x003fffff00000000; + *((unsigned long *)&__m128i_op1[0]) = 0x003fffff00000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsubwev_d_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x8000807f00000000; + *((unsigned long *)&__m128i_op0[0]) = 0x80006b0080808080; + *((unsigned long *)&__m128i_op1[1]) = 0xffff00011cf0c569; + *((unsigned long *)&__m128i_op1[0]) = 0xc0000002b0995850; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffe30f3a97; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffcfe72830; + __m128i_out = __lsx_vsubwev_d_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsubwev_d_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000000ff9f5c25; + *((unsigned long *)&__m128i_op0[0]) = 0x58fa6b4000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x00000000ff9f5c25; + *((unsigned long *)&__m128i_op1[0]) = 0x58fa6b4000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsubwev_d_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x8080808080808080; + *((unsigned long *)&__m128i_op0[0]) = 0x8080808080808080; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0xcda585aebbb2836a; + *((unsigned long *)&__m128i_result[1]) = 0x0000000080808080; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffc4cdfd16; + __m128i_out = __lsx_vsubwev_d_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + int_out = __lsx_vpickve2gr_w (__m128i_op0, 0x2); + *((unsigned long *)&__m128i_op0[1]) = 0x801dd5cb0004e058; + *((unsigned long *)&__m128i_op0[0]) = 0x77eb15638eeb5fc2; + *((unsigned long *)&__m128i_op1[1]) = 0x000000200000001b; + *((unsigned long *)&__m128i_op1[0]) = 0x0000002000000000; + *((unsigned long *)&__m128i_result[1]) = 0x000000000004e03d; + *((unsigned long *)&__m128i_result[0]) = 0x000000008eeb5fc2; + __m128i_out = __lsx_vsubwev_d_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsubwev_d_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000001; + __m128i_out = __lsx_vsubwev_q_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsubwev_q_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000c0000bd49; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000c7fff000c; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_op1[0]) = 0xfffff00010000fff; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000100c6ffef00d; + __m128i_out = __lsx_vsubwev_q_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000006f00000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000c00000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x000000000000006f; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000001f0a; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000bfffffffe0f6; + __m128i_out = __lsx_vsubwev_q_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfffcfffcfffcfffd; + *((unsigned long *)&__m128i_op0[0]) = 0xfffcfffdfffcfffd; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xfffcfffdfffcfffd; + __m128i_out = __lsx_vsubwev_q_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffff7e00000081; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vsubwev_q_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0a0a0a0a0a0a0a0a; + *((unsigned long *)&__m128i_op0[0]) = 0x0a0a0a0a0a0a0a0a; + *((unsigned long *)&__m128i_op1[1]) = 0xffffb96bffff57c9; + *((unsigned long *)&__m128i_op1[0]) = 0xffff6080ffff4417; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x0a0aa9890a0ac5f3; + __m128i_out = __lsx_vsubwev_q_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x370bdfecffecffec; + *((unsigned long *)&__m128i_op0[0]) = 0x370bdfecffecffec; + *((unsigned long *)&__m128i_op1[1]) = 0x0010001000100010; + *((unsigned long *)&__m128i_op1[0]) = 0x0010001000100010; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x36fbdfdcffdcffdc; + __m128i_out = __lsx_vsubwev_q_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000100000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000100000000; + __m128i_out = __lsx_vsubwev_q_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0001000100010001; + *((unsigned long *)&__m128i_op1[0]) = 0x0001000100010001; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xfffefffefffeffff; + __m128i_out = __lsx_vsubwev_q_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_op0[0]) = 0xffff000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x000000000a752a55; + *((unsigned long *)&__m128i_op1[0]) = 0x0a753500a9fa0d06; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xf589caff5605f2fa; + __m128i_out = __lsx_vsubwev_q_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x087c000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x000000000000087c; + *((unsigned long *)&__m128i_op1[1]) = 0x10f8000100000001; + *((unsigned long *)&__m128i_op1[0]) = 0x00000001000010f8; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xfffffffefffff784; + __m128i_out = __lsx_vsubwev_q_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffff000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0xffff000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x0001000000000000; + __m128i_out = __lsx_vsubwev_q_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsubwod-1.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsubwod-1.c new file mode 100644 index 00000000000..39ebff15487 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsubwod-1.c @@ -0,0 +1,326 @@ +/* { dg-do run } */ +/* { dg-options "-mlsx -w -fno-strict-aliasing" } */ +#include "../simd_correctness_check.h" +#include + +int +main () +{ + __m128i __m128i_op0, __m128i_op1, __m128i_op2, __m128i_out, __m128i_result; + __m128 __m128_op0, __m128_op1, __m128_op2, __m128_out, __m128_result; + __m128d __m128d_op0, __m128d_op1, __m128d_op2, __m128d_out, __m128d_result; + + int int_op0, int_op1, int_op2, int_out, int_result, i = 1, fail; + long int long_op0, long_op1, long_op2, lont_out, lont_result; + long int long_int_out, long_int_result; + unsigned int unsigned_int_out, unsigned_int_result; + unsigned long int unsigned_long_int_out, unsigned_long_int_result; + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsubwod_h_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsubwod_h_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x3ff0000000000001; + *((unsigned long *)&__m128i_op0[0]) = 0x40f3fa0000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0xc485edbcc0000000; + *((unsigned long *)&__m128i_result[1]) = 0x003f000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x007c000d00400000; + __m128i_out = __lsx_vsubwod_h_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x841f000fc28f801f; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x007c0000003e0080; + __m128i_out = __lsx_vsubwod_h_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0001000100010001; + *((unsigned long *)&__m128i_result[0]) = 0x0001000100010001; + __m128i_out = __lsx_vsubwod_h_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000100000001; + *((unsigned long *)&__m128i_result[0]) = 0x0000000100000000; + __m128i_out = __lsx_vsubwod_w_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsubwod_w_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000000017fff9000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000210011084; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000007fff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000001001; + __m128i_out = __lsx_vsubwod_w_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xff80000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xff80000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffff8000000000; + *((unsigned long *)&__m128i_result[0]) = 0xffffff8000000000; + __m128i_out = __lsx_vsubwod_w_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsubwod_w_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfffffffffefefe6a; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000c2bac2c2; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xfffffffffffffefe; + *((unsigned long *)&__m128i_result[0]) = 0x00000000ffffc2ba; + __m128i_out = __lsx_vsubwod_w_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000000ff000000ff; + *((unsigned long *)&__m128i_op0[0]) = 0x0000027f000000fe; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0xfe80000000000001; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000018000000000; + __m128i_out = __lsx_vsubwod_w_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000001f0a; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000ffff7a53; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00000000ffffffff; + __m128i_out = __lsx_vsubwod_w_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x000000ff0000ff86; + *((unsigned long *)&__m128i_op1[1]) = 0xffa6ff91fdd8ef77; + *((unsigned long *)&__m128i_op1[0]) = 0x061202bffb141c38; + *((unsigned long *)&__m128i_result[1]) = 0x0000005a00000228; + *((unsigned long *)&__m128i_result[0]) = 0xfffff9ee000004ec; + __m128i_out = __lsx_vsubwod_w_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000002000; + *((unsigned long *)&__m128i_op0[0]) = 0x000000001fe02000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000002000; + *((unsigned long *)&__m128i_op1[0]) = 0x000000001fe02000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsubwod_w_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsubwod_w_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x30eb020302101b03; + *((unsigned long *)&__m128i_op0[0]) = 0x020310d0c0030220; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000002345454; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000c0dec4ca; + *((unsigned long *)&__m128i_result[1]) = 0x000030ebffffffdc; + *((unsigned long *)&__m128i_result[0]) = 0x00000203ffffff25; + __m128i_out = __lsx_vsubwod_w_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x380fdfdfc0000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xffffc7f100004000; + __m128i_out = __lsx_vsubwod_w_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsubwod_w_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsubwod_d_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsubwod_d_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x00005dcbe7e830c0; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000015d926c7; + *((unsigned long *)&__m128i_op1[0]) = 0x000000000000e41b; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000005dcb; + __m128i_out = __lsx_vsubwod_d_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000014; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000014; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsubwod_d_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00f0008100800080; + *((unsigned long *)&__m128i_op0[0]) = 0x00f000807000009e; + *((unsigned long *)&__m128i_op1[1]) = 0x0003c853c843c87e; + *((unsigned long *)&__m128i_op1[0]) = 0x0003c853c843c87e; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000ec382e; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000ec382d; + __m128i_out = __lsx_vsubwod_d_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfcfcfcfcfcfcfcfd; + *((unsigned long *)&__m128i_op0[0]) = 0xfcfcfcfcfcfc0000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x00009c7c00007176; + *((unsigned long *)&__m128i_result[1]) = 0xfffffffffcfcfcfc; + *((unsigned long *)&__m128i_result[0]) = 0xfffffffffcfc6080; + __m128i_out = __lsx_vsubwod_d_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xc0b4d1a5f8babad3; + *((unsigned long *)&__m128i_op0[0]) = 0xbbc8ecc5f3ced5f3; + *((unsigned long *)&__m128i_op1[1]) = 0xffaefffbffaefffb; + *((unsigned long *)&__m128i_op1[0]) = 0xffaefffbffaefffb; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffc105d1aa; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffbc19ecca; + __m128i_out = __lsx_vsubwod_d_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0001000100010001; + *((unsigned long *)&__m128i_op0[0]) = 0x0001000101fd01fe; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000fe00ff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0001000100010001; + __m128i_out = __lsx_vsubwod_q_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsubwod_q_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfffff0000000ad3d; + *((unsigned long *)&__m128i_op0[0]) = 0xfffff000fffff000; + *((unsigned long *)&__m128i_op1[1]) = 0x1000100010001000; + *((unsigned long *)&__m128i_op1[0]) = 0x1000100010001000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xefffdffff0009d3d; + __m128i_out = __lsx_vsubwod_q_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x000000ff000000ff; + *((unsigned long *)&__m128i_op1[0]) = 0x0000ff0000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffff00ffffff01; + __m128i_out = __lsx_vsubwod_q_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000100010001007c; + *((unsigned long *)&__m128i_op0[0]) = 0x0001000100010001; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x000100010001007c; + __m128i_out = __lsx_vsubwod_q_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x5f675e96e29a5a60; + *((unsigned long *)&__m128i_op0[0]) = 0x7fff7fff7fff7fff; + *((unsigned long *)&__m128i_op1[1]) = 0x00fe000100cf005f; + *((unsigned long *)&__m128i_op1[0]) = 0x7fff7fff7fff7fff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x5e695e95e1cb5a01; + __m128i_out = __lsx_vsubwod_q_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x7efefefe82010201; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsubwod_q_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsubwod_q_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsubwod-2.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsubwod-2.c new file mode 100644 index 00000000000..62837f1ac17 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsubwod-2.c @@ -0,0 +1,308 @@ +/* { dg-do run } */ +/* { dg-options "-mlsx -w -fno-strict-aliasing" } */ +#include "../simd_correctness_check.h" +#include + +int +main () +{ + __m128i __m128i_op0, __m128i_op1, __m128i_op2, __m128i_out, __m128i_result; + __m128 __m128_op0, __m128_op1, __m128_op2, __m128_out, __m128_result; + __m128d __m128d_op0, __m128d_op1, __m128d_op2, __m128d_out, __m128d_result; + + int int_op0, int_op1, int_op2, int_out, int_result, i = 1, fail; + long int long_op0, long_op1, long_op2, lont_out, lont_result; + long int long_int_out, long_int_result; + unsigned int unsigned_int_out, unsigned_int_result; + unsigned long int unsigned_long_int_out, unsigned_long_int_result; + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000010000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsubwod_h_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xfe07e5fefefdddfe; + *((unsigned long *)&__m128i_op1[0]) = 0x00020100fedd0c00; + *((unsigned long *)&__m128i_result[1]) = 0xff02ff1bff02ff23; + *((unsigned long *)&__m128i_result[0]) = 0x0000ffffff02fff4; + __m128i_out = __lsx_vsubwod_h_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsubwod_h_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xfffefff6fff80002; + *((unsigned long *)&__m128i_op1[1]) = 0x82c53a0000000000; + *((unsigned long *)&__m128i_op1[0]) = 0xc72ef153fc02fdf7; + *((unsigned long *)&__m128i_result[1]) = 0x007d00c500ff00ff; + *((unsigned long *)&__m128i_result[0]) = 0x0038000e0003ff03; + __m128i_out = __lsx_vsubwod_h_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0001000100010001; + *((unsigned long *)&__m128i_op0[0]) = 0x0001000100010001; + *((unsigned long *)&__m128i_op1[1]) = 0x000000000000007b; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsubwod_h_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsubwod_h_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsubwod_h_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x7ff0000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x7ff0000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x007f000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x007f000000000000; + __m128i_out = __lsx_vsubwod_h_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsubwod_h_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000040000000400; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsubwod_w_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x8000000000000010; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xffff800000000000; + __m128i_out = __lsx_vsubwod_w_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfc01fd1300000001; + *((unsigned long *)&__m128i_op0[0]) = 0xfe00fd1400010000; + *((unsigned long *)&__m128i_op1[1]) = 0xfc01fd1300000001; + *((unsigned long *)&__m128i_op1[0]) = 0xfe00fd1400010000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsubwod_w_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000fffff800; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x000000000000ffff; + *((unsigned long *)&__m128i_result[0]) = 0x000000000000ffff; + __m128i_out = __lsx_vsubwod_w_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000200000002; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000200000002; + *((unsigned long *)&__m128i_op1[1]) = 0xfe813f00fe813f00; + *((unsigned long *)&__m128i_op1[0]) = 0xfe813f00fe813f00; + *((unsigned long *)&__m128i_result[1]) = 0xffff017fffff017f; + *((unsigned long *)&__m128i_result[0]) = 0xffff017fffff017f; + __m128i_out = __lsx_vsubwod_w_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x9c7c266e71768fa4; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00009c7c00007176; + __m128i_out = __lsx_vsubwod_w_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0001000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0001000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000100000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000100000000; + __m128i_out = __lsx_vsubwod_w_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000800000008; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000800000008; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000008; + *((unsigned long *)&__m128i_result[0]) = 0xffffffff00000009; + __m128i_out = __lsx_vsubwod_d_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsubwod_d_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000897957687; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000408; + *((unsigned long *)&__m128i_op1[1]) = 0x7fff0007e215b122; + *((unsigned long *)&__m128i_op1[0]) = 0x7ffeffff7bfff828; + *((unsigned long *)&__m128i_result[1]) = 0xffffffff80010001; + *((unsigned long *)&__m128i_result[0]) = 0xffffffff80010001; + __m128i_out = __lsx_vsubwod_d_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000af555555555; + *((unsigned long *)&__m128i_op0[0]) = 0x00000af555555555; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000af5; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000af5; + __m128i_out = __lsx_vsubwod_d_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x8000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x8000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x8000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x8000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsubwod_d_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsubwod_d_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x2e34594c3b000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x000000002e34594c; + __m128i_out = __lsx_vsubwod_d_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsubwod_d_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vsubwod_q_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000036280001; + *((unsigned long *)&__m128i_op0[0]) = 0x42a0000042a02001; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000036280001; + __m128i_out = __lsx_vsubwod_q_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xd0b1ffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0x9d519ee8d2d84f1d; + *((unsigned long *)&__m128i_op1[1]) = 0x8644ffff0000ffff; + *((unsigned long *)&__m128i_op1[0]) = 0x0000ffff0000fffe; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x4a6d0000ffff0000; + __m128i_out = __lsx_vsubwod_q_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x82c539ffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xc72df14afbfafdf9; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x7d3ac60000000000; + __m128i_out = __lsx_vsubwod_q_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000010000; + *((unsigned long *)&__m128i_op0[0]) = 0x00ff00ff00fe00ff; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000100000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000010000; + __m128i_out = __lsx_vsubwod_q_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfeffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xfeffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x00000fffffffe000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000102020204000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xfefff00000001fff; + __m128i_out = __lsx_vsubwod_q_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0003000300000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0003000300a10003; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xfffcfffd00000000; + __m128i_out = __lsx_vsubwod_q_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x6363636363636363; + *((unsigned long *)&__m128i_op0[0]) = 0x6363636363636363; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000200000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0002000200000001; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x6363636163636363; + __m128i_out = __lsx_vsubwod_q_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} From patchwork Mon Sep 11 03:44:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: chenxiaolong X-Patchwork-Id: 137878 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ab0a:0:b0:3f2:4152:657d with SMTP id m10csp1858265vqo; Sun, 10 Sep 2023 20:50:55 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFm2GhopXlAT9AebtnH/xggf4sqjiqzTx+D4V5NHFXIZmz0znk7Vy/omR2bmzCPnHcc2nl7 X-Received: by 2002:a17:906:2189:b0:99b:de31:6666 with SMTP id 9-20020a170906218900b0099bde316666mr7033425eju.22.1694404255305; Sun, 10 Sep 2023 20:50:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694404255; cv=none; d=google.com; s=arc-20160816; b=PT7Um3MHsPMzk1w4JYRLMa2H5CEx1YO8qT7QjDyU3cK7MSLq1z/tFD485VAg1gGCBP gPdDgunf0bb818sEZUZRBQNTTtDfiBYkgzRJPpwP4W2u+sL3osolPjqsiwRpIuxgk70o 5FFv4u/rDvAEaKqyh0dcxu3SoWGOZlbnV9Z18Zia5kDHwMct1v8o9uqJY/PpzDor2h54 X6YPAGnIH6ueyKHRKUkhiJSjLLk+1MgjPlmCRmq9PI8F+M6nNcUkiLYh/kMMvhEhQlOt Fw1r97lE4MoQHeJOUVIJuhe24XWR8tmc0tBpNvQzoIyDOn483H5+FPiFqa+9aXnR+A7o H6Wg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dmarc-filter:delivered-to; bh=wuukDGpXUKA4gTkwTpCFKkG0kib5Z5YPxff9U4gluqk=; fh=BpFCyCzVJo4znJIvOjeDfKzcGsF6Q+JgJbJ+1ev/kM4=; b=YlWllQNBYfpTMXVesYjc6l65RbTWiElmjuh5UgL8/zilwVOIt8499h3BWAYKO+v7cJ jUG0XQieak2OalWfGNE5cOqVXZQIi1vpwIOmM052bKvLurw6SwY+HAzBTeQL20nQ6DC6 H3hFC0+YGADUxH4numlRenQaN+mlSj6/Cj67JIDVsS/R/kVWhYtAEen7hR3+p+S6S6Up aWPOadUhoMSaH6Man2Ld646TxXnVOdDYfuUguca025l75xmekQfafxGM4oxm2c0oT2Ly K2Ct09HiPdoVyUQpLCbCTYiiZ+ornL4iMiQTooUEYvWH7ZdqfJlfhrxHbPrw19rotMzk 6jCg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id oz9-20020a170906cd0900b00991cbb3d4a6si91395ejb.115.2023.09.10.20.50.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 Sep 2023 20:50:55 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 865173889E25 for ; Mon, 11 Sep 2023 03:46:55 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by sourceware.org (Postfix) with ESMTP id 034EC3857026 for ; Mon, 11 Sep 2023 03:45:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 034EC3857026 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=loongson.cn Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=loongson.cn Received: from loongson.cn (unknown [10.10.130.252]) by gateway (Coremail) with SMTP id _____8AxDOtpjf5k9UQkAA--.197S3; Mon, 11 Sep 2023 11:45:45 +0800 (CST) Received: from slurm-master.loongson.cn (unknown [10.10.130.252]) by localhost.localdomain (Coremail) with SMTP id AQAAf8Dx_yNXjf5kzKZ2AA--.44820S11; Mon, 11 Sep 2023 11:45:44 +0800 (CST) From: Xiaolong Chen To: gcc-patches@gcc.gnu.org Subject: [PATCH v3 7/9] LoongArch:Add vector arithmetic addition vsadd instruction. Date: Mon, 11 Sep 2023 11:44:37 +0800 Message-Id: <20230911034439.8266-8-chenxiaolong@loongson.cn> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230911034439.8266-1-chenxiaolong@loongson.cn> References: <20230911034439.8266-1-chenxiaolong@loongson.cn> MIME-Version: 1.0 X-CM-TRANSID: AQAAf8Dx_yNXjf5kzKZ2AA--.44820S11 X-CM-SenderInfo: hfkh05xldrz0tqj6z05rqj20fqof0/1tbiAQALBWT9QjYDoAAAsB X-Coremail-Antispam: 1Uk129KBj9fXoWDAFWxKrWUJw43uF13urWUJrc_yoWrWr1rZo WUAa4UZw4rCFZxX3W5Jw13X34fKr1Yk3Zakr1UAwn0ya1DJr4Ivry7ZFsxJF1Utw1ayrW3 Zw13Xr4xJ348Zr1kl-sFpf9Il3svdjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8wcxFpf 9Il3svdxBIdaVrn0xqx4xG64xvF2IEw4CE5I8CrVC2j2Jv73VFW2AGmfu7bjvjm3AaLaJ3 UjIYCTnIWjp_UUUY87kC6x804xWl14x267AKxVWUJVW8JwAFc2x0x2IEx4CE42xK8VAvwI 8IcIk0rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2ocxC64kIII0Yj41l84x0c7CEw4AK67xG Y2AK021l84ACjcxK6xIIjxv20xvE14v26F1j6w1UM28EF7xvwVC0I7IYx2IY6xkF7I0E14 v26r4j6F4UM28EF7xvwVC2z280aVAFwI0_Gr1j6F4UJwA2z4x0Y4vEx4A2jsIEc7CjxVAF wI0_Gr1j6F4UJwAS0I0E0xvYzxvE52x082IY62kv0487Mc804VCY07AIYIkI8VC2zVCFFI 0UMc02F40EFcxC0VAKzVAqx4xG6I80ewAv7VC0I7IYx2IY67AKxVWUtVWrXwAv7VC2z280 aVAFwI0_Gr0_Cr1lOx8S6xCaFVCjc4AY6r1j6r4UM4x0Y48IcxkI7VAKI48JMxAIw28Icx kI7VAKI48JMxC20s026xCaFVCjc4AY6r1j6r4UMI8I3I0E5I8CrVAFwI0_Jr0_Jr4lx2Iq xVCjr7xvwVAFwI0_JrI_JrWlx4CE17CEb7AF67AKxVWUAVWUtwCIc40Y0x0EwIxGrwCI42 IY6xIIjxv20xvE14v26ryj6F1UMIIF0xvE2Ix0cI8IcVCY1x0267AKxVW8JVWxJwCI42IY 6xAIw20EY4v20xvaj40_Jr0_JF4lIxAIcVC2z280aVAFwI0_Gr0_Cr1lIxAIcVC2z280aV CY1x0267AKxVW8JVW8JrUvcSsGvfC2KfnxnUUI43ZEXa7IU84xRDUUUUU== X-Spam-Status: No, score=-12.3 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, KAM_SHORT, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Xiaolong Chen , xuchenghua@loongson.cn, chenglulu@loongson.cn, i@xen0n.name Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1776711636620534910 X-GMAIL-MSGID: 1776711636620534910 gcc/testsuite/ChangeLog: * gcc.target/loongarch/vector/lsx/lsx-vsadd-1.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vsadd-2.c: New test. --- .../loongarch/vector/lsx/lsx-vsadd-1.c | 335 +++++++++++++++++ .../loongarch/vector/lsx/lsx-vsadd-2.c | 345 ++++++++++++++++++ 2 files changed, 680 insertions(+) create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsadd-1.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsadd-2.c diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsadd-1.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsadd-1.c new file mode 100644 index 00000000000..1bc27c983bb --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsadd-1.c @@ -0,0 +1,335 @@ +/* { dg-do run } */ +/* { dg-options "-mlsx -w -fno-strict-aliasing" } */ +#include "../simd_correctness_check.h" +#include + +int +main () +{ + __m128i __m128i_op0, __m128i_op1, __m128i_op2, __m128i_out, __m128i_result; + __m128 __m128_op0, __m128_op1, __m128_op2, __m128_out, __m128_result; + __m128d __m128d_op0, __m128d_op1, __m128d_op2, __m128d_out, __m128d_result; + + int int_op0, int_op1, int_op2, int_out, int_result, i = 1, fail; + long int long_op0, long_op1, long_op2, lont_out, lont_result; + long int long_int_out, long_int_result; + unsigned int unsigned_int_out, unsigned_int_result; + unsigned long int unsigned_long_int_out, unsigned_long_int_result; + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x00000000ffffffff; + __m128i_out = __lsx_vsadd_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xfefefefefefefefe; + __m128i_out = __lsx_vsadd_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffff3c992b2e; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffff730f; + *((unsigned long *)&__m128i_result[1]) = 0xffffffff3c992b2e; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffff730f; + __m128i_out = __lsx_vsadd_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsadd_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsadd_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00007fff00007fff; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x000000002bfd9461; + *((unsigned long *)&__m128i_result[1]) = 0x00007fff00007fff; + *((unsigned long *)&__m128i_result[0]) = 0x000000002bfd9461; + __m128i_out = __lsx_vsadd_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00d3012acc56f9bb; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000001021; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x00d3012acc56f9bb; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000001021; + __m128i_out = __lsx_vsadd_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000001000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000001000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000001000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000001000; + __m128i_out = __lsx_vsadd_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x80808080806b000b; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x80808080806b000b; + __m128i_out = __lsx_vsadd_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffff01ff01; + *((unsigned long *)&__m128i_op1[1]) = 0x3c600000ff800000; + *((unsigned long *)&__m128i_op1[0]) = 0xfffffffffffffffe; + *((unsigned long *)&__m128i_result[1]) = 0x3c5fffffff7fffff; + *((unsigned long *)&__m128i_result[0]) = 0xfffefffeff00feff; + __m128i_out = __lsx_vsadd_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsadd_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x00ff00ff00ff00ff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00ff00ff00ff00ff; + __m128i_out = __lsx_vsadd_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00000000ffffffff; + __m128i_out = __lsx_vsadd_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x3ff0000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x40f3fa0000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x3ff0000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x40f3fa0000000000; + __m128i_out = __lsx_vsadd_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000008a0000008a; + *((unsigned long *)&__m128i_op0[0]) = 0x0000008900000009; + *((unsigned long *)&__m128i_op1[1]) = 0x63637687636316bb; + *((unsigned long *)&__m128i_op1[0]) = 0x6363636363636363; + *((unsigned long *)&__m128i_result[1]) = 0x6363771163631745; + *((unsigned long *)&__m128i_result[0]) = 0x636363ec6363636c; + __m128i_out = __lsx_vsadd_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000004; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000004; + __m128i_out = __lsx_vsadd_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000080000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000080000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000080000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000080000000; + __m128i_out = __lsx_vsadd_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfffffffffefefe6a; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000c2bac2c2; + *((unsigned long *)&__m128i_op1[1]) = 0x00000001fffffffe; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x00000000fefefe68; + *((unsigned long *)&__m128i_result[0]) = 0x00000000c2bac2c2; + __m128i_out = __lsx_vsadd_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x027c027c000027c0; + *((unsigned long *)&__m128i_op1[1]) = 0x001ffff0003ffff0; + *((unsigned long *)&__m128i_op1[0]) = 0x000fffefffefffef; + *((unsigned long *)&__m128i_result[1]) = 0x001ffff0003ffff0; + *((unsigned long *)&__m128i_result[0]) = 0x028c026bfff027af; + __m128i_out = __lsx_vsadd_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0007000000040000; + *((unsigned long *)&__m128i_op0[0]) = 0x0003000000010000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0007000000040000; + *((unsigned long *)&__m128i_result[0]) = 0x0003000000010000; + __m128i_out = __lsx_vsadd_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x3f8000003f800000; + *((unsigned long *)&__m128i_op0[0]) = 0x3f8000003f800000; + *((unsigned long *)&__m128i_op1[1]) = 0x3fffff0000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x3fffff0000000000; + *((unsigned long *)&__m128i_result[1]) = 0x7f7fff003f800000; + *((unsigned long *)&__m128i_result[0]) = 0x7f7fff003f800000; + __m128i_out = __lsx_vsadd_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000820202020; + *((unsigned long *)&__m128i_op0[0]) = 0x00fe01fc0005fff4; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000003a24; + *((unsigned long *)&__m128i_op1[0]) = 0x003dbe88077c78c1; + *((unsigned long *)&__m128i_result[1]) = 0x0000000820205a44; + *((unsigned long *)&__m128i_result[0]) = 0x013bc084078278b5; + __m128i_out = __lsx_vsadd_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000140001; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000140001; + __m128i_out = __lsx_vsadd_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsadd_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x67eb85afb2ebb000; + *((unsigned long *)&__m128i_op0[0]) = 0xc8847ef6ed3f2000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000100000001; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x67eb85b0b2ebb001; + *((unsigned long *)&__m128i_result[0]) = 0xc8847ef6ed3f2000; + __m128i_out = __lsx_vsadd_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsadd_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_op0[0]) = 0xffff000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000014eb54ab; + *((unsigned long *)&__m128i_op1[0]) = 0x14eb6a002a406a00; + *((unsigned long *)&__m128i_result[1]) = 0xffffffff14eb54ab; + *((unsigned long *)&__m128i_result[0]) = 0x14ea6a002a406a00; + __m128i_out = __lsx_vsadd_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000004; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000004; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0xce9035c49ffff570; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000004; + *((unsigned long *)&__m128i_result[0]) = 0xce9035c49ffff574; + __m128i_out = __lsx_vsadd_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000010; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000010; + __m128i_out = __lsx_vadd_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x000000000000000d; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000400; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x000000000000040d; + __m128i_out = __lsx_vadd_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000001300000013; + *((unsigned long *)&__m128i_op0[0]) = 0x0000001300000013; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000001300000013; + *((unsigned long *)&__m128i_result[0]) = 0x0000001300000013; + __m128i_out = __lsx_vadd_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vadd_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000100000100; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000100000100; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000100000100; + *((unsigned long *)&__m128i_result[0]) = 0x00000001000000ff; + __m128i_out = __lsx_vadd_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000300000001; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000100010001; + *((unsigned long *)&__m128i_op1[1]) = 0xfffffffffffffffa; + *((unsigned long *)&__m128i_op1[0]) = 0xfffffffffffffffa; + *((unsigned long *)&__m128i_result[1]) = 0x00000002fffffffb; + *((unsigned long *)&__m128i_result[0]) = 0x000000010000fffb; + __m128i_out = __lsx_vadd_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vadd_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsadd-2.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsadd-2.c new file mode 100644 index 00000000000..67d1899915f --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsadd-2.c @@ -0,0 +1,345 @@ +/* { dg-do run } */ +/* { dg-options "-mlsx -w -fno-strict-aliasing" } */ +#include "../simd_correctness_check.h" +#include + +int +main () +{ + __m128i __m128i_op0, __m128i_op1, __m128i_op2, __m128i_out, __m128i_result; + __m128 __m128_op0, __m128_op1, __m128_op2, __m128_out, __m128_result; + __m128d __m128d_op0, __m128d_op1, __m128d_op2, __m128d_out, __m128d_result; + + int int_op0, int_op1, int_op2, int_out, int_result, i = 1, fail; + long int long_op0, long_op1, long_op2, lont_out, lont_result; + long int long_int_out, long_int_result; + unsigned int unsigned_int_out, unsigned_int_result; + unsigned long int unsigned_long_int_out, unsigned_long_int_result; + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x10f917d72d3d01e4; + *((unsigned long *)&__m128i_op1[0]) = 0x203e16d116de012b; + *((unsigned long *)&__m128i_result[1]) = 0x10f917d72d3d01e4; + *((unsigned long *)&__m128i_result[0]) = 0x203e16d116de012b; + __m128i_out = __lsx_vsadd_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfffebd06fffe820c; + *((unsigned long *)&__m128i_op0[0]) = 0x7fff7ffe7fff3506; + *((unsigned long *)&__m128i_op1[1]) = 0xfffebd06fffe820c; + *((unsigned long *)&__m128i_op1[0]) = 0x7fff7ffe7fff3506; + *((unsigned long *)&__m128i_result[1]) = 0xffffff0cffffff18; + *((unsigned long *)&__m128i_result[0]) = 0xfefffefffeff6a0c; + __m128i_out = __lsx_vsadd_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsadd_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsadd_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x4f804f804f804f80; + *((unsigned long *)&__m128i_op1[0]) = 0x4f804f804f804f80; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vsadd_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfffff60ca7104649; + *((unsigned long *)&__m128i_op0[0]) = 0xfffff790a15db63d; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000001; + *((unsigned long *)&__m128i_result[1]) = 0xfffff60ca710464a; + *((unsigned long *)&__m128i_result[0]) = 0xfffff790a15db63e; + __m128i_out = __lsx_vsadd_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfffffffffffffffe; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffff46; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vsadd_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00fe000100cf005f; + *((unsigned long *)&__m128i_op0[0]) = 0x7fff7fff7fff7fff; + *((unsigned long *)&__m128i_op1[1]) = 0x5f675e96e29a5a60; + *((unsigned long *)&__m128i_op1[0]) = 0x7fff7fff7fff7fff; + *((unsigned long *)&__m128i_result[1]) = 0x5fff5e97e2ff5abf; + *((unsigned long *)&__m128i_result[0]) = 0xfefffefffefffeff; + __m128i_out = __lsx_vsadd_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000001000100010; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0001000100010058; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0001001100110068; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsadd_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x7fffffff7fffffff; + *((unsigned long *)&__m128i_op0[0]) = 0x7fffffff7fffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x7fff010181010102; + *((unsigned long *)&__m128i_op1[0]) = 0x7fffffff81010102; + *((unsigned long *)&__m128i_result[1]) = 0xfeffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xfeffffffffffffff; + __m128i_out = __lsx_vsadd_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000ebd20000714f; + *((unsigned long *)&__m128i_op0[0]) = 0x00012c8a0000a58a; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffb81a6f70; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000d48eaa1a2; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffb81ae0bf; + *((unsigned long *)&__m128i_result[0]) = 0x00012c9748eaffff; + __m128i_out = __lsx_vsadd_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0177fff0fffffff0; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000011ff8bc; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vsadd_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000200; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000200; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000200; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000200; + __m128i_out = __lsx_vsadd_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000001; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000001; + __m128i_out = __lsx_vsadd_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsadd_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsadd_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000d0000000d; + *((unsigned long *)&__m128i_op1[1]) = 0x8006000000040000; + *((unsigned long *)&__m128i_op1[0]) = 0x8002000000000007; + *((unsigned long *)&__m128i_result[1]) = 0x8006000000040000; + *((unsigned long *)&__m128i_result[0]) = 0x8002000d00000014; + __m128i_out = __lsx_vsadd_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000014; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000014; + __m128i_out = __lsx_vsadd_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsadd_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsadd_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + int_out = __lsx_vpickve2gr_h (__m128i_op0, 0x1); + *((unsigned long *)&__m128i_op0[1]) = 0x0000000600007fff; + *((unsigned long *)&__m128i_op0[0]) = 0x00000008ffffa209; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000600007fff; + *((unsigned long *)&__m128i_result[0]) = 0x00000008ffffa209; + __m128i_out = __lsx_vsadd_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x636363633f3e47c1; + *((unsigned long *)&__m128i_op0[0]) = 0x41f8e080f1ef4eaa; + *((unsigned long *)&__m128i_op1[1]) = 0x00000807bf0a1f80; + *((unsigned long *)&__m128i_op1[0]) = 0x00000800ecedee68; + *((unsigned long *)&__m128i_result[1]) = 0x63636b6afe486741; + *((unsigned long *)&__m128i_result[0]) = 0x41f8e880ffffffff; + __m128i_out = __lsx_vsadd_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000ebd20000714f; + *((unsigned long *)&__m128i_op0[0]) = 0x00012c8a0000a58a; + *((unsigned long *)&__m128i_op1[1]) = 0x0000ebd20000714f; + *((unsigned long *)&__m128i_op1[0]) = 0x00012c8a0000a58a; + *((unsigned long *)&__m128i_result[1]) = 0x0000ffff0000e29e; + *((unsigned long *)&__m128i_result[0]) = 0x000259140000ffff; + __m128i_out = __lsx_vsadd_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0xfffffffeffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xfffffffeffffffff; + __m128i_out = __lsx_vsadd_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0c03e17edd781b11; + *((unsigned long *)&__m128i_op0[0]) = 0x342caf9be55700b5; + *((unsigned long *)&__m128i_op1[1]) = 0x00040003ff83ff84; + *((unsigned long *)&__m128i_op1[0]) = 0x00040003ff4dffca; + *((unsigned long *)&__m128i_result[1]) = 0x0c07e181ffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x3430af9effffffff; + __m128i_out = __lsx_vsadd_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000000ffa8ff9f; + *((unsigned long *)&__m128i_op0[0]) = 0x0000ffffffabff99; + *((unsigned long *)&__m128i_op1[1]) = 0x000100000002007d; + *((unsigned long *)&__m128i_op1[0]) = 0x0001000000020001; + *((unsigned long *)&__m128i_result[1]) = 0x00010000ffab001c; + *((unsigned long *)&__m128i_result[0]) = 0x0001ffffffadff9a; + __m128i_out = __lsx_vsadd_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0800080008000800; + *((unsigned long *)&__m128i_op1[0]) = 0x0800080008000800; + *((unsigned long *)&__m128i_result[1]) = 0x0800080008000800; + *((unsigned long *)&__m128i_result[0]) = 0x0800080008000800; + __m128i_out = __lsx_vsadd_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_op0[0]) = 0x76f424887fffffff; + *((unsigned long *)&__m128i_op1[1]) = 0xc110000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0xc00d060000000000; + *((unsigned long *)&__m128i_result[1]) = 0xc110000000000001; + *((unsigned long *)&__m128i_result[0]) = 0xffffffff7fffffff; + __m128i_out = __lsx_vsadd_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000000000000002f; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000029; + *((unsigned long *)&__m128i_op1[1]) = 0xfbfbfb17fbfb38ea; + *((unsigned long *)&__m128i_op1[0]) = 0xfbfb47fbfbfb0404; + *((unsigned long *)&__m128i_result[1]) = 0xfbfbfb17fbfb3919; + *((unsigned long *)&__m128i_result[0]) = 0xfbfb47fbfbfb042d; + __m128i_out = __lsx_vsadd_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x8080808080808081; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x80808080ffffffff; + __m128i_out = __lsx_vsadd_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00123fff00120012; + *((unsigned long *)&__m128i_op0[0]) = 0x0012001200120012; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x000000000005003a; + *((unsigned long *)&__m128i_result[1]) = 0x00123fff00120012; + *((unsigned long *)&__m128i_result[0]) = 0x001200120017004c; + __m128i_out = __lsx_vsadd_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xbfd10d0d7b6b6b73; + *((unsigned long *)&__m128i_op1[0]) = 0xc5c534920000c4ed; + *((unsigned long *)&__m128i_result[1]) = 0xbfd10d0d7b6b6b73; + *((unsigned long *)&__m128i_result[0]) = 0xc5c534920000c4ed; + __m128i_out = __lsx_vsadd_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000aa822a79308f6; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000084d12ce; + *((unsigned long *)&__m128i_op1[1]) = 0x000aa822a79308f6; + *((unsigned long *)&__m128i_op1[0]) = 0x03aa558e1d37b5a1; + *((unsigned long *)&__m128i_result[1]) = 0x00155044ffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x03aa558e2584c86f; + __m128i_out = __lsx_vsadd_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x021b7d24c9678a35; + *((unsigned long *)&__m128i_op0[0]) = 0x030298a6a1030a49; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x021b7d24c9678a35; + *((unsigned long *)&__m128i_result[0]) = 0x030298a6a1030a49; + __m128i_out = __lsx_vsadd_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00007a8000000480; + *((unsigned long *)&__m128i_op0[0]) = 0x00000485000004cc; + *((unsigned long *)&__m128i_op1[1]) = 0x00007a8000000480; + *((unsigned long *)&__m128i_op1[0]) = 0x00000485000004cc; + *((unsigned long *)&__m128i_result[1]) = 0x0000f50000000900; + *((unsigned long *)&__m128i_result[0]) = 0x0000090a00000998; + __m128i_out = __lsx_vsadd_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x004eff6200d2ff76; + *((unsigned long *)&__m128i_op1[0]) = 0xff70002800be00a0; + *((unsigned long *)&__m128i_result[1]) = 0x004eff6200d2ff76; + *((unsigned long *)&__m128i_result[0]) = 0xff70002800be00a0; + __m128i_out = __lsx_vsadd_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} From patchwork Mon Sep 11 03:44:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: chenxiaolong X-Patchwork-Id: 137880 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ab0a:0:b0:3f2:4152:657d with SMTP id m10csp1858570vqo; Sun, 10 Sep 2023 20:52:16 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGxqjHZzyh6w1nfqaYnFE5DYMdOPeBqJy1Xim0N9J+/ywqUlHInKa1av8J+3XmFa+XWuJ54 X-Received: by 2002:aa7:d955:0:b0:52e:3262:e6c9 with SMTP id l21-20020aa7d955000000b0052e3262e6c9mr7484705eds.33.1694404336085; Sun, 10 Sep 2023 20:52:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694404336; cv=none; d=google.com; s=arc-20160816; b=OUMno3LHX3w6vw61sRm8fLU30aiYDOLoDs2y2fBroIKwbK4iX7XbJi1sps+K1dc7Rp GmpiHqmAv5mv8yB2VFXhFSxZXOZEYutxt9RoEVi9Rd7opK3QxPlefjIUVCS877Vuk9/A DuCHlT1w/fT1VwOMRrtffYzv3MZZNng/Pe6vSgjXUpQpiA2xmcAb+Il0tpGbl6MrzDp0 2xNWauqQ1v+2LplMBQaY+y+bBAUOHYo5FjpJtxTyPFSNEBe5t+hansJUy1ztsNw5xM96 9Jf02gjOq06rrA68oIQB1BG1SSLS8nmzEpWR5A72IPB5LsO1EZKwl3xiODGWqvQTkFYx zseA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dmarc-filter:delivered-to; bh=mCSbkz0v0c/J9sXb6jCQcVWRdNq2DPE46zOYnk3pxkc=; fh=BpFCyCzVJo4znJIvOjeDfKzcGsF6Q+JgJbJ+1ev/kM4=; b=d0Maktp4zhEDiYjciWIRKNKODZfRAirQSokNTQ1oolldUYTzG/Muf3gE16wKZfKcRZ JYuqK33ER4aW3xLUh0VDeuuG7X6jsHFtKcsyGTfGyWs+JL0Ga2ftyCYWjvz9ZvmVdmhL Z5vkaTYYg1X2zH6wl8kgZqGt2qbJ9IQPANiPCYQeEcNJUzphnEzQVAiSrOkLLxHdfgHA GXeUVtj0eUhPvxxXL8nSTVxY2b3anaiUFoaz2WIaoMIILw3ypblHuAkirWyHOMbqBm0V nnn5vzRSWcCrq9itv5kZyjYC7QdLLIsdBT2nAazq6XRZlOqZkiOmdxec2pqCi5A+aPUI wDMA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id g2-20020a056402320200b0052f3a73d26fsi3137213eda.263.2023.09.10.20.52.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 Sep 2023 20:52:16 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B56C7385828D for ; Mon, 11 Sep 2023 03:47:32 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by sourceware.org (Postfix) with ESMTP id 12BBF385703A for ; Mon, 11 Sep 2023 03:45:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 12BBF385703A Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=loongson.cn Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=loongson.cn Received: from loongson.cn (unknown [10.10.130.252]) by gateway (Coremail) with SMTP id _____8BxbOprjf5k+EQkAA--.43724S3; Mon, 11 Sep 2023 11:45:47 +0800 (CST) Received: from slurm-master.loongson.cn (unknown [10.10.130.252]) by localhost.localdomain (Coremail) with SMTP id AQAAf8Dx_yNXjf5kzKZ2AA--.44820S12; Mon, 11 Sep 2023 11:45:46 +0800 (CST) From: Xiaolong Chen To: gcc-patches@gcc.gnu.org Subject: [PATCH v3 8/9] LoongArch:Added SX vector arithmetic multiplication instruction. Date: Mon, 11 Sep 2023 11:44:38 +0800 Message-Id: <20230911034439.8266-9-chenxiaolong@loongson.cn> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230911034439.8266-1-chenxiaolong@loongson.cn> References: <20230911034439.8266-1-chenxiaolong@loongson.cn> MIME-Version: 1.0 X-CM-TRANSID: AQAAf8Dx_yNXjf5kzKZ2AA--.44820S12 X-CM-SenderInfo: hfkh05xldrz0tqj6z05rqj20fqof0/1tbiAQALBWT9QjYDogAAsD X-Coremail-Antispam: 1Uk129KBj97XoW8AF4DKw4DZryfJrW8WoXrpr47Gr4fWoWUAa 4UZw4rCFZxX3W5Jw13X343Kr1Yk3Z3Cr17Awn0yw4Dtw4Ivry7ZFsxJF1Utw1ayry3Zw13 Xr4xJ348Zr1kl-sFpf9Il3svdjkaLaAFLSUrUUUUjb8apTn2vfkv8UJUUUU8wcxFpf9Il3 svdxBIdaVrn0xqx4xG64xvF2IEw4CE5I8CrVC2j2Jv73VFW2AGmfu7bjvjm3AaLaJ3UjIY CTnIWjp_UUUY87kC6x804xWl14x267AKxVWUJVW8JwAFc2x0x2IEx4CE42xK8VAvwI8IcI k0rVWrJVCq3wAFIxvE14AKwVWUGVWUXwA2ocxC64kIII0Yj41l84x0c7CEw4AK67xGY2AK 021l84ACjcxK6xIIjxv20xvE14v26F1j6w1UM28EF7xvwVC0I7IYx2IY6xkF7I0E14v26r 4j6F4UM28EF7xvwVC2z280aVAFwI0_Gr1j6F4UJwA2z4x0Y4vEx4A2jsIEc7CjxVAFwI0_ Gr1j6F4UJwAS0I0E0xvYzxvE52x082IY62kv0487Mc804VCY07AIYIkI8VC2zVCFFI0UMc 02F40EFcxC0VAKzVAqx4xG6I80ewAv7VC0I7IYx2IY67AKxVWUtVWrXwAv7VC2z280aVAF wI0_Gr0_Cr1lOx8S6xCaFVCjc4AY6r1j6r4UM4x0Y48IcxkI7VAKI48JMxAIw28IcxkI7V AKI48JMxC20s026xCaFVCjc4AY6r1j6r4UMI8I3I0E5I8CrVAFwI0_Jr0_Jr4lx2IqxVCj r7xvwVAFwI0_JrI_JrWlx4CE17CEb7AF67AKxVWUAVWUtwCIc40Y0x0EwIxGrwCI42IY6x IIjxv20xvE14v26ryj6F1UMIIF0xvE2Ix0cI8IcVCY1x0267AKxVW8JVWxJwCI42IY6xAI w20EY4v20xvaj40_Jr0_JF4lIxAIcVC2z280aVAFwI0_Gr0_Cr1lIxAIcVC2z280aVCY1x 0267AKxVW8JVW8JrUvcSsGvfC2KfnxnUUI43ZEXa7IU8QJ57UUUUU== X-Spam-Status: No, score=-12.4 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, KAM_SHORT, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Xiaolong Chen , xuchenghua@loongson.cn, chenglulu@loongson.cn, i@xen0n.name Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1776711720848434629 X-GMAIL-MSGID: 1776711720848434629 gcc/testsuite/ChangeLog: * gcc.target/loongarch/vector/lsx/lsx-vmuh-1.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vmuh-2.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vmul.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vmulwev-1.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vmulwev-2.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vmulwev-3.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vmulwod-1.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vmulwod-2.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vmulwod-3.c: New test. --- .../loongarch/vector/lsx/lsx-vmuh-1.c | 353 ++++++++++++++ .../loongarch/vector/lsx/lsx-vmuh-2.c | 372 +++++++++++++++ .../loongarch/vector/lsx/lsx-vmul.c | 282 ++++++++++++ .../loongarch/vector/lsx/lsx-vmulwev-1.c | 434 ++++++++++++++++++ .../loongarch/vector/lsx/lsx-vmulwev-2.c | 344 ++++++++++++++ .../loongarch/vector/lsx/lsx-vmulwev-3.c | 245 ++++++++++ .../loongarch/vector/lsx/lsx-vmulwod-1.c | 272 +++++++++++ .../loongarch/vector/lsx/lsx-vmulwod-2.c | 282 ++++++++++++ .../loongarch/vector/lsx/lsx-vmulwod-3.c | 308 +++++++++++++ 9 files changed, 2892 insertions(+) create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmuh-1.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmuh-2.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmul.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmulwev-1.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmulwev-2.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmulwev-3.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmulwod-1.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmulwod-2.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmulwod-3.c diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmuh-1.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmuh-1.c new file mode 100644 index 00000000000..ab650a024a3 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmuh-1.c @@ -0,0 +1,353 @@ +/* { dg-do run } */ +/* { dg-options "-mlsx -w -fno-strict-aliasing" } */ +#include "../simd_correctness_check.h" +#include + +int +main () +{ + __m128i __m128i_op0, __m128i_op1, __m128i_op2, __m128i_out, __m128i_result; + __m128 __m128_op0, __m128_op1, __m128_op2, __m128_out, __m128_result; + __m128d __m128d_op0, __m128d_op1, __m128d_op2, __m128d_out, __m128d_result; + + int int_op0, int_op1, int_op2, int_out, int_result, i = 1, fail; + long int long_op0, long_op1, long_op2, lont_out, lont_result; + long int long_int_out, long_int_result; + unsigned int unsigned_int_out, unsigned_int_result; + unsigned long int unsigned_long_int_out, unsigned_long_int_result; + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmuh_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmuh_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmuh_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x059a35ef139a8e00; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmuh_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmuh_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x8080808080808080; + *((unsigned long *)&__m128i_op0[0]) = 0x8080808080808080; + *((unsigned long *)&__m128i_op1[1]) = 0x8080808080808080; + *((unsigned long *)&__m128i_op1[0]) = 0x8080808080808080; + *((unsigned long *)&__m128i_result[1]) = 0x4040404040404040; + *((unsigned long *)&__m128i_result[0]) = 0x4040404040404040; + __m128i_out = __lsx_vmuh_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmuh_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xc0c00000c0c00000; + *((unsigned long *)&__m128i_op1[0]) = 0xc0c00c01c2cd0009; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmuh_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000800; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x000000000000ffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmuh_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmuh_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmuh_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xc0fffff000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000ffe00000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmuh_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffff0000ac26; + *((unsigned long *)&__m128i_op1[0]) = 0x00ff000000000001; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmuh_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000000ffffff81fe; + *((unsigned long *)&__m128i_op0[0]) = 0xffffff00ffff7e01; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x000000fffe01fd02; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000ffff0000fe86; + __m128i_out = __lsx_vmuh_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x7f7f7f7f7f7f7f7f; + *((unsigned long *)&__m128i_op1[0]) = 0x7f7f7f7f7f7f7f7f; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmuh_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xff8000010f800000; + *((unsigned long *)&__m128i_op1[1]) = 0xff800000ff800000; + *((unsigned long *)&__m128i_op1[0]) = 0xff800000ff800000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00000000fff80000; + __m128i_out = __lsx_vmuh_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmuh_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmuh_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmuh_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xbf3efff536d5169b; + *((unsigned long *)&__m128i_op0[0]) = 0x7ebdfffffddf3f40; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x7fff7fff7fff7fff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x3f5ec0a0feefa0b0; + __m128i_out = __lsx_vmuh_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x7fffffff7ffffffe; + *((unsigned long *)&__m128i_op0[0]) = 0x7fffffff7ffffffe; + *((unsigned long *)&__m128i_op1[1]) = 0x7fffffff7ffffffe; + *((unsigned long *)&__m128i_op1[0]) = 0x7fffffff7ffffffe; + *((unsigned long *)&__m128i_result[1]) = 0x3fffffff3ffffffe; + *((unsigned long *)&__m128i_result[0]) = 0x3fffffff3ffffffe; + __m128i_out = __lsx_vmuh_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x003f0000ffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0x003f0000ffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x7fff0101ffffe000; + *((unsigned long *)&__m128i_op1[0]) = 0x7fffffffa0204000; + *((unsigned long *)&__m128i_result[1]) = 0x001f7fc100000000; + *((unsigned long *)&__m128i_result[0]) = 0x001f7fff00000000; + __m128i_out = __lsx_vmuh_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x000000ff00000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmuh_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmuh_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0001000000010000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000cd630000cd63; + *((unsigned long *)&__m128i_op1[1]) = 0xcd636363cd636363; + *((unsigned long *)&__m128i_op1[0]) = 0xcd636363cd636363; + *((unsigned long *)&__m128i_result[1]) = 0xffffcd63ffffcd63; + *((unsigned long *)&__m128i_result[0]) = 0xffffd765ffffd765; + __m128i_out = __lsx_vmuh_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmuh_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmuh_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x8000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xff7fffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0040000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmuh_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000015516a768038; + *((unsigned long *)&__m128i_op0[0]) = 0xffffff9ed2e1c000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmuh_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x8000000080000000; + *((unsigned long *)&__m128i_op0[0]) = 0x007ffd0001400840; + *((unsigned long *)&__m128i_op1[1]) = 0x8000000080000000; + *((unsigned long *)&__m128i_op1[0]) = 0x007ffd0001400840; + *((unsigned long *)&__m128i_result[1]) = 0x3fffffff80000000; + *((unsigned long *)&__m128i_result[0]) = 0x00003ffd000a4000; + __m128i_out = __lsx_vmuh_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0032000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0032000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x000009c400000000; + __m128i_out = __lsx_vmuh_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0002000200020002; + *((unsigned long *)&__m128i_op0[0]) = 0x0202fe02fd020102; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x000000000202fe02; + __m128i_out = __lsx_vmuh_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0006000000040000; + *((unsigned long *)&__m128i_op0[0]) = 0x0002000000000007; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmuh_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000ffff0000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x6363636363636363; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x000000006362ffff; + __m128i_out = __lsx_vmuh_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffff0000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmuh_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmuh_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_op0[0]) = 0xffff0000ffff0000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_op1[0]) = 0xffff0000ffff0000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_result[0]) = 0x00000000fffe0002; + __m128i_out = __lsx_vmuh_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmuh-2.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmuh-2.c new file mode 100644 index 00000000000..60b6e3503fa --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmuh-2.c @@ -0,0 +1,372 @@ +/* { dg-do run } */ +/* { dg-options "-mlsx -w -fno-strict-aliasing" } */ +#include "../simd_correctness_check.h" +#include + +int +main () +{ + __m128i __m128i_op0, __m128i_op1, __m128i_op2, __m128i_out, __m128i_result; + __m128 __m128_op0, __m128_op1, __m128_op2, __m128_out, __m128_result; + __m128d __m128d_op0, __m128d_op1, __m128d_op2, __m128d_out, __m128d_result; + + int int_op0, int_op1, int_op2, int_out, int_result, i = 1, fail; + long int long_op0, long_op1, long_op2, lont_out, lont_result; + long int long_int_out, long_int_result; + unsigned int unsigned_int_out, unsigned_int_result; + unsigned long int unsigned_long_int_out, unsigned_long_int_result; + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000011; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000011; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000011; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000011; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000001; + __m128i_out = __lsx_vmuh_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmuh_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000000c5ac01015b; + *((unsigned long *)&__m128i_op0[0]) = 0xaaacac88a3a9a96a; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmuh_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000001300000013; + *((unsigned long *)&__m128i_op1[0]) = 0x0000001300000013; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmuh_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmuh_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmuh_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000038003; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000040033; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000080000068; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000014; + __m128i_out = __lsx_vmuh_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x7fffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0x8000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmuh_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmuh_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmuh_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmuh_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x10f881a20ffd02b0; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000ff800000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0ff780a10efc01af; + *((unsigned long *)&__m128i_result[0]) = 0x00000000fe7f0000; + __m128i_out = __lsx_vmuh_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmuh_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmuh_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000000efffffff; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmuh_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmuh_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0001001100110068; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmuh_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x1d8000001d800000; + *((unsigned long *)&__m128i_op0[0]) = 0x1d8000001d800000; + *((unsigned long *)&__m128i_op1[1]) = 0x1d8000001d800000; + *((unsigned long *)&__m128i_op1[0]) = 0x1d8000001d800000; + *((unsigned long *)&__m128i_result[1]) = 0x0366000003660000; + *((unsigned long *)&__m128i_result[0]) = 0x0366000003660000; + __m128i_out = __lsx_vmuh_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xbfd10d0d7b6b6b73; + *((unsigned long *)&__m128i_op1[0]) = 0xc5c534920000c4ed; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmuh_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmuh_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmuh_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmuh_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000800; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmuh_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x7ef400ad21fc7081; + *((unsigned long *)&__m128i_op0[0]) = 0x28bf0351ec69b5f2; + *((unsigned long *)&__m128i_op1[1]) = 0xffffb96bffff57c9; + *((unsigned long *)&__m128i_op1[0]) = 0xffff6080ffff4417; + *((unsigned long *)&__m128i_result[1]) = 0x7ef3ddac21fc5a2c; + *((unsigned long *)&__m128i_result[0]) = 0x28bee9edec690869; + __m128i_out = __lsx_vmuh_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + int_out = __lsx_vpickve2gr_h (__m128i_op0, 0x0); + *((unsigned long *)&__m128i_op0[1]) = 0x0000200000002000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffe000ffdf; + *((unsigned long *)&__m128i_result[1]) = 0x00001fff00001fff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmuh_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000002; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmuh_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000800000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000800000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmuh_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000000000000214f; + *((unsigned long *)&__m128i_op0[0]) = 0xc31b63d846ebc810; + *((unsigned long *)&__m128i_op1[1]) = 0x00ff0000800000ff; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000ffff941d; + *((unsigned long *)&__m128i_result[1]) = 0x00000000000010a7; + *((unsigned long *)&__m128i_result[0]) = 0x0000000046ebaa2c; + __m128i_out = __lsx_vmuh_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x00000000cf4f4f00; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000cf4f4f00; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmuh_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000000000000007c; + *((unsigned long *)&__m128i_op0[0]) = 0x0000005f0003e000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000897957687; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000408; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmuh_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000003397dd140; + *((unsigned long *)&__m128i_op0[0]) = 0x00000004bd7cdd20; + *((unsigned long *)&__m128i_op1[1]) = 0x0016ffb00016ffb0; + *((unsigned long *)&__m128i_op1[0]) = 0x0016ffb00016ffb0; + *((unsigned long *)&__m128i_result[1]) = 0x00000000004a294b; + *((unsigned long *)&__m128i_result[0]) = 0x00000000006d04bc; + __m128i_out = __lsx_vmuh_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfffcfffcfffcfffc; + *((unsigned long *)&__m128i_op0[0]) = 0xfffcfffcfffcfffc; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x007ffe7ffe400000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x007ffd0001400840; + __m128i_out = __lsx_vmuh_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xfffcfffcfffcfffc; + *((unsigned long *)&__m128i_op1[0]) = 0xfffcfffcfffcfffc; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmuh_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0xfffffffffffffffe; + *((unsigned long *)&__m128i_result[0]) = 0xfffffffffffffffe; + __m128i_out = __lsx_vmuh_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffa800000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000158; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000157; + __m128i_out = __lsx_vmuh_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xfffffffffffffffe; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmuh_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmuh_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x001a64b345308091; + *((unsigned long *)&__m128i_op0[0]) = 0x001f2f2cab1c732a; + *((unsigned long *)&__m128i_op1[1]) = 0x1baf8eabd26bc629; + *((unsigned long *)&__m128i_op1[0]) = 0x1c2640b9a8e9fb49; + *((unsigned long *)&__m128i_result[1]) = 0x0002dab8746acf8e; + *((unsigned long *)&__m128i_result[0]) = 0x00036dd1c5c15856; + __m128i_out = __lsx_vmuh_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x3a8000003a800000; + *((unsigned long *)&__m128i_op0[0]) = 0x000ef0000000003b; + *((unsigned long *)&__m128i_op1[1]) = 0x0000ffff0000ffff; + *((unsigned long *)&__m128i_op1[0]) = 0x0000ffff0000ffff; + *((unsigned long *)&__m128i_result[1]) = 0x00003a7fc58074ff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000eeff1100e; + __m128i_out = __lsx_vmuh_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmul.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmul.c new file mode 100644 index 00000000000..8ba6662755b --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmul.c @@ -0,0 +1,282 @@ +/* { dg-do run } */ +/* { dg-options "-mlsx -w -fno-strict-aliasing" } */ +#include "../simd_correctness_check.h" +#include + +int +main () +{ + __m128i __m128i_op0, __m128i_op1, __m128i_op2, __m128i_out, __m128i_result; + __m128 __m128_op0, __m128_op1, __m128_op2, __m128_out, __m128_result; + __m128d __m128d_op0, __m128d_op1, __m128d_op2, __m128d_out, __m128d_result; + + int int_op0, int_op1, int_op2, int_out, int_result, i = 1, fail; + long int long_op0, long_op1, long_op2, lont_out, lont_result; + long int long_int_out, long_int_result; + unsigned int unsigned_int_out, unsigned_int_result; + unsigned long int unsigned_long_int_out, unsigned_long_int_result; + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmul_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x54feed87bc3f2be1; + *((unsigned long *)&__m128i_op0[0]) = 0x8064d8f6a494afcb; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmul_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000001; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmul_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x7fc000007fc00000; + *((unsigned long *)&__m128i_op1[0]) = 0x1e801ffc7fc00000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmul_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfffffe003c1f0077; + *((unsigned long *)&__m128i_op0[0]) = 0xffffff0074230438; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000100000001; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000ff0000000438; + __m128i_out = __lsx_vmul_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + unsigned_int_out = __lsx_vpickve2gr_bu (__m128i_op0, 0x2); + *((unsigned long *)&__m128i_op0[1]) = 0x0000000100000001; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000800800000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000100000001; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000800800000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000100000001; + *((unsigned long *)&__m128i_result[0]) = 0x0000004000000000; + __m128i_out = __lsx_vmul_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0001000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xfff5fff4002ffff5; + *((unsigned long *)&__m128i_op1[1]) = 0xaa858644fb8b3d49; + *((unsigned long *)&__m128i_op1[0]) = 0x18499e2cee2cc251; + *((unsigned long *)&__m128i_result[1]) = 0x8644000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xaed495f03343a685; + __m128i_out = __lsx_vmul_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x7505443065413aed; + *((unsigned long *)&__m128i_op0[0]) = 0x0100d6effefd0498; + *((unsigned long *)&__m128i_op1[1]) = 0x7505443065413aed; + *((unsigned long *)&__m128i_op1[0]) = 0x0100d6effefd0498; + *((unsigned long *)&__m128i_result[1]) = 0xb71289fdfbea3f69; + *((unsigned long *)&__m128i_result[0]) = 0x4e17c2ffb4851a40; + __m128i_out = __lsx_vmul_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfc01fcfefc02fdf7; + *((unsigned long *)&__m128i_op0[0]) = 0xfe00fcfffe01fd01; + *((unsigned long *)&__m128i_op1[1]) = 0xfc01fd1300000001; + *((unsigned long *)&__m128i_op1[0]) = 0xfe00fd1400010000; + *((unsigned long *)&__m128i_result[1]) = 0xc72ef153fc02fdf7; + *((unsigned long *)&__m128i_result[0]) = 0xca31bf15fd010000; + __m128i_out = __lsx_vmul_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000100000001; + *((unsigned long *)&__m128i_result[0]) = 0x0000000100000001; + __m128i_out = __lsx_vmul_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xff00ff00ff00ff00; + *((unsigned long *)&__m128i_op0[0]) = 0xff00ff00ff00ff00; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmul_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmul_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xc000c000c000ff81; + *((unsigned long *)&__m128i_op1[1]) = 0x5d5d5d5d5d5d5d5d; + *((unsigned long *)&__m128i_op1[0]) = 0x5d5d5d5d5d5d0000; + *((unsigned long *)&__m128i_result[1]) = 0xa2a2a2a3a2a2a2a3; + *((unsigned long *)&__m128i_result[0]) = 0xc605c000aedd0000; + __m128i_out = __lsx_vmul_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xacc8c794af2caf01; + *((unsigned long *)&__m128i_op0[0]) = 0xa91e2048938c40f0; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmul_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xeeb1e4f43c3763f3; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffff5a6fe3d7; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000021e79364; + *((unsigned long *)&__m128i_op1[0]) = 0x0000718ea657431b; + *((unsigned long *)&__m128i_result[1]) = 0x000000006ca193ec; + *((unsigned long *)&__m128i_result[0]) = 0x00008e72b5b94cad; + __m128i_out = __lsx_vmul_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x8000000080000000; + *((unsigned long *)&__m128i_op1[0]) = 0x8000000080000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmul_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmul_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffe000ffffe000; + *((unsigned long *)&__m128i_op1[0]) = 0x467f6080467d607f; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmul_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000040; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000040; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000040; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000040; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000001000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000001000; + __m128i_out = __lsx_vmul_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x007f008000ea007f; + *((unsigned long *)&__m128i_op0[0]) = 0x00ff00ff00ff00ff; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0xc000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmul_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0042003e0042002f; + *((unsigned long *)&__m128i_op0[0]) = 0x0001fffc0001fffc; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xfffe0004fffe0004; + __m128i_out = __lsx_vmul_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xc1bdceee242070db; + *((unsigned long *)&__m128i_op0[0]) = 0xe8c7b756d76aa478; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x3f433212dce09025; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmul_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmul_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmul_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xf359f359f359f359; + *((unsigned long *)&__m128i_op0[0]) = 0xf359f359f359f359; + *((unsigned long *)&__m128i_op1[1]) = 0xd3259a2984048c23; + *((unsigned long *)&__m128i_op1[0]) = 0xf9796558e39953fd; + *((unsigned long *)&__m128i_result[1]) = 0x86dd8341b164f12b; + *((unsigned long *)&__m128i_result[0]) = 0x9611c3985b3159f5; + __m128i_out = __lsx_vmul_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x6363636363636363; + *((unsigned long *)&__m128i_op0[0]) = 0xffd27db010d20fbf; + *((unsigned long *)&__m128i_op1[1]) = 0x6363636363636363; + *((unsigned long *)&__m128i_op1[0]) = 0xffd27db010d20fbf; + *((unsigned long *)&__m128i_result[1]) = 0x9727b8499727b849; + *((unsigned long *)&__m128i_result[0]) = 0x12755900b653f081; + __m128i_out = __lsx_vmul_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0303030303030303; + *((unsigned long *)&__m128i_op0[0]) = 0x0303030303030303; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x02f3030303030303; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x06d9090909090909; + __m128i_out = __lsx_vmul_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffff81ffff7f03; + *((unsigned long *)&__m128i_op0[0]) = 0x04ffff8101ff81ff; + *((unsigned long *)&__m128i_op1[1]) = 0x0a0000000a000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0a0000000a000000; + *((unsigned long *)&__m128i_result[1]) = 0x0a0000001e000000; + *((unsigned long *)&__m128i_result[0]) = 0x0a000000f6000000; + __m128i_out = __lsx_vmul_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x317fce80317fce80; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmul_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmulwev-1.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmulwev-1.c new file mode 100644 index 00000000000..8357f4e80f2 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmulwev-1.c @@ -0,0 +1,434 @@ +/* { dg-do run } */ +/* { dg-options "-mlsx -w -fno-strict-aliasing" } */ +#include "../simd_correctness_check.h" +#include + +int +main () +{ + __m128i __m128i_op0, __m128i_op1, __m128i_op2, __m128i_out, __m128i_result; + __m128 __m128_op0, __m128_op1, __m128_op2, __m128_out, __m128_result; + __m128d __m128d_op0, __m128d_op1, __m128d_op2, __m128d_out, __m128d_result; + + int int_op0, int_op1, int_op2, int_out, int_result, i = 1, fail; + long int long_op0, long_op1, long_op2, lont_out, lont_result; + long int long_int_out, long_int_result; + unsigned int unsigned_int_out, unsigned_int_result; + unsigned long int unsigned_long_int_out, unsigned_long_int_result; + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwev_h_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwev_h_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwev_h_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwev_h_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwev_h_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000100000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwev_h_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwev_h_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwev_h_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwev_h_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000158; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwev_h_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x001f7fc100000404; + *((unsigned long *)&__m128i_op0[0]) = 0x000000000002a000; + *((unsigned long *)&__m128i_op1[1]) = 0x7fff0101ffffe000; + *((unsigned long *)&__m128i_op1[0]) = 0x7fffffffa0204000; + *((unsigned long *)&__m128i_result[1]) = 0xffe1ffc100000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000400000; + __m128i_out = __lsx_vmulwev_h_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000009000900; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000009000900; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwev_h_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x30eb022002101b20; + *((unsigned long *)&__m128i_op0[0]) = 0x020310edc003023d; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000000000ff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x000000000000ffc3; + __m128i_out = __lsx_vmulwev_h_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwev_h_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x6363636363636363; + *((unsigned long *)&__m128i_op1[0]) = 0x6363636363636363; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xff9dff9dff9dff9d; + __m128i_out = __lsx_vmulwev_h_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwev_h_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x00000000efffffff; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwev_w_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwev_w_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffe50000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000ff0000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffe020; + *((unsigned long *)&__m128i_op1[0]) = 0x3fc00000010a000b; + *((unsigned long *)&__m128i_result[1]) = 0x00001b0000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwev_w_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000000ff81007c; + *((unsigned long *)&__m128i_op0[0]) = 0xffb7005f0070007c; + *((unsigned long *)&__m128i_op1[1]) = 0x0001000100010001; + *((unsigned long *)&__m128i_op1[0]) = 0x0001000104000800; + *((unsigned long *)&__m128i_result[1]) = 0x000000000000007c; + *((unsigned long *)&__m128i_result[0]) = 0x0000005f0003e000; + __m128i_out = __lsx_vmulwev_w_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x4040404040404040; + *((unsigned long *)&__m128i_op1[0]) = 0x4040404040404040; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xffffbfc0ffffbfc0; + __m128i_out = __lsx_vmulwev_w_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x000000ffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0x000000ffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0xffffff0100000001; + *((unsigned long *)&__m128i_result[0]) = 0xffffff0100000001; + __m128i_out = __lsx_vmulwev_w_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwev_w_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000208000002080; + *((unsigned long *)&__m128i_op1[0]) = 0x0000208000002080; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwev_w_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000004; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwev_w_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000004870ba0; + *((unsigned long *)&__m128i_op1[1]) = 0x478b478b38031779; + *((unsigned long *)&__m128i_op1[0]) = 0x6b769e690fa1e119; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00000000fe98c2a0; + __m128i_out = __lsx_vmulwev_w_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000004000000040; + *((unsigned long *)&__m128i_op0[0]) = 0x00007770ffff9411; + *((unsigned long *)&__m128i_op1[1]) = 0x0000004000000040; + *((unsigned long *)&__m128i_op1[0]) = 0x00007770ffff9411; + *((unsigned long *)&__m128i_result[1]) = 0x0000100000001000; + *((unsigned long *)&__m128i_result[0]) = 0x37b951002d81a921; + __m128i_out = __lsx_vmulwev_w_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x000000e0000000e0; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x000000e0000000e0; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x000000000000c400; + __m128i_out = __lsx_vmulwev_d_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000001; + __m128i_out = __lsx_vmulwev_d_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x7fffffff7fffffff; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0x000000ffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0xffffffff80000001; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwev_d_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffb4ff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffb4ff; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000016; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffb4ff; + *((unsigned long *)&__m128i_result[0]) = 0xfffffffffff98dea; + __m128i_out = __lsx_vmulwev_d_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwev_d_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0006000000040000; + *((unsigned long *)&__m128i_op0[0]) = 0x0002000000000007; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000f80007; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000006c80031; + __m128i_out = __lsx_vmulwev_d_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000005; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwev_d_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0001000101010001; + *((unsigned long *)&__m128i_op0[0]) = 0x0001000100010001; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000100000001; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000100000001; + *((unsigned long *)&__m128i_result[1]) = 0x0000000001010001; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000010001; + __m128i_out = __lsx_vmulwev_d_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000202020200; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000100; + *((unsigned long *)&__m128i_op1[1]) = 0x0808080808080808; + *((unsigned long *)&__m128i_op1[0]) = 0x0004280808080808; + *((unsigned long *)&__m128i_result[1]) = 0x0010203030201000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000808080800; + __m128i_out = __lsx_vmulwev_d_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000b5207f80; + *((unsigned long *)&__m128i_op1[1]) = 0x2000000020000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000200200000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_result[0]) = 0x6a57a30ff0000000; + __m128i_out = __lsx_vmulwev_q_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xfffffffffffffff7; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xfffffff700000009; + __m128i_out = __lsx_vmulwev_q_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0001000100010001; + *((unsigned long *)&__m128i_op0[0]) = 0x0001000104000800; + *((unsigned long *)&__m128i_op1[1]) = 0x8001000180010001; + *((unsigned long *)&__m128i_op1[0]) = 0x8001000184000800; + *((unsigned long *)&__m128i_result[1]) = 0xffff80007e028401; + *((unsigned long *)&__m128i_result[0]) = 0x9a10144000400000; + __m128i_out = __lsx_vmulwev_q_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000bd003d; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwev_q_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000fffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0x0010000000000001; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwev_q_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwev_q_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwev_q_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwev_q_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000077af9450; + *((unsigned long *)&__m128i_op1[1]) = 0x000000400000004c; + *((unsigned long *)&__m128i_op1[0]) = 0x000047404f4f040d; + *((unsigned long *)&__m128i_result[1]) = 0x000000000000214f; + *((unsigned long *)&__m128i_result[0]) = 0xc31b63d846ebc810; + __m128i_out = __lsx_vmulwev_q_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000002000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000002000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwev_q_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmulwev-2.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmulwev-2.c new file mode 100644 index 00000000000..e4afc8247a5 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmulwev-2.c @@ -0,0 +1,344 @@ +/* { dg-do run } */ +/* { dg-options "-mlsx -w -fno-strict-aliasing" } */ +#include "../simd_correctness_check.h" +#include + +int +main () +{ + __m128i __m128i_op0, __m128i_op1, __m128i_op2, __m128i_out, __m128i_result; + __m128 __m128_op0, __m128_op1, __m128_op2, __m128_out, __m128_result; + __m128d __m128d_op0, __m128d_op1, __m128d_op2, __m128d_out, __m128d_result; + + int int_op0, int_op1, int_op2, int_out, int_result, i = 1, fail; + long int long_op0, long_op1, long_op2, lont_out, lont_result; + long int long_int_out, long_int_result; + unsigned int unsigned_int_out, unsigned_int_result; + unsigned long int unsigned_long_int_out, unsigned_long_int_result; + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_result[1]) = 0xfe01fe01fe01fe01; + *((unsigned long *)&__m128i_result[0]) = 0x00000000fe01fe01; + __m128i_out = __lsx_vmulwev_h_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000200020; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwev_h_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwev_h_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x8000000080000000; + *((unsigned long *)&__m128i_op0[0]) = 0x8000000080000000; + *((unsigned long *)&__m128i_op1[1]) = 0x8000000080000000; + *((unsigned long *)&__m128i_op1[0]) = 0x8000000080000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwev_h_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x6a5d5b056f2f4978; + *((unsigned long *)&__m128i_op0[0]) = 0x17483c07141b5971; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0xd4bade5e2e902836; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x345002920f3017d6; + __m128i_out = __lsx_vmulwev_h_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000c0010000a186; + *((unsigned long *)&__m128i_op0[0]) = 0x00067fff0002a207; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffff0002; + *((unsigned long *)&__m128i_result[1]) = 0x000000ff0000857a; + *((unsigned long *)&__m128i_result[0]) = 0x05fafe0101fe000e; + __m128i_out = __lsx_vmulwev_h_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0001000100010001; + *((unsigned long *)&__m128i_op0[0]) = 0x0001000100000001; + *((unsigned long *)&__m128i_op1[1]) = 0x0001000100010001; + *((unsigned long *)&__m128i_op1[0]) = 0xc1f03e1042208410; + *((unsigned long *)&__m128i_result[1]) = 0x0001000100010001; + *((unsigned long *)&__m128i_result[0]) = 0x00f0001000000010; + __m128i_out = __lsx_vmulwev_h_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000000000eefff; + *((unsigned long *)&__m128i_op0[0]) = 0xf8e1a03affffe3e2; + *((unsigned long *)&__m128i_op1[1]) = 0x3a80613fda5dcb4a; + *((unsigned long *)&__m128i_op1[0]) = 0x93f0b81a914c003b; + *((unsigned long *)&__m128i_result[1]) = 0x00000000051649b6; + *((unsigned long *)&__m128i_result[0]) = 0xd2f005e44bb43416; + __m128i_out = __lsx_vmulwev_h_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwev_w_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000001fc0000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwev_w_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x7fffffff7fffffff; + *((unsigned long *)&__m128i_op0[0]) = 0x7fffffff00000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000200000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0001fffe00000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwev_w_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x00000001fffffffe; + *((unsigned long *)&__m128i_op1[0]) = 0x00000001fffffffe; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwev_w_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfffff000f0008d3c; + *((unsigned long *)&__m128i_op0[0]) = 0xfffff0016fff8d3d; + *((unsigned long *)&__m128i_op1[1]) = 0xfffff000f0008d3c; + *((unsigned long *)&__m128i_op1[0]) = 0xfffff0016fff8d3d; + *((unsigned long *)&__m128i_result[1]) = 0xe10000004deb2610; + *((unsigned long *)&__m128i_result[0]) = 0xe101e0014dec4089; + __m128i_out = __lsx_vmulwev_w_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x111110ff11111141; + *((unsigned long *)&__m128i_op1[0]) = 0x11111131111116a6; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwev_w_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwev_w_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwev_w_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0x2028000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwev_w_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0001001100110068; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwev_w_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x67eb85afb2ebb000; + *((unsigned long *)&__m128i_op0[0]) = 0xc8847ef6ed3f2000; + *((unsigned long *)&__m128i_op1[1]) = 0xd400c02000002acf; + *((unsigned long *)&__m128i_op1[0]) = 0xf4000020c4000000; + *((unsigned long *)&__m128i_result[1]) = 0x6453f5e01d6e5000; + *((unsigned long *)&__m128i_result[0]) = 0x000fdec000000000; + __m128i_out = __lsx_vmulwev_w_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xbfd10d0d7b6b6b73; + *((unsigned long *)&__m128i_op1[0]) = 0xc5c534920000c4ed; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwev_w_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000001700000017; + *((unsigned long *)&__m128i_op0[0]) = 0x59f7fd8759f7fd87; + *((unsigned long *)&__m128i_op1[1]) = 0x0000001700000017; + *((unsigned long *)&__m128i_op1[0]) = 0x59f7fd8759f7fd87; + *((unsigned long *)&__m128i_result[1]) = 0x0000021100000211; + *((unsigned long *)&__m128i_result[0]) = 0xfb141d31fb141d31; + __m128i_out = __lsx_vmulwev_w_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x7f800000976801fe; + *((unsigned long *)&__m128i_op1[0]) = 0x837c1ae57f8012ed; + *((unsigned long *)&__m128i_result[1]) = 0x976801fd6897fe02; + *((unsigned long *)&__m128i_result[0]) = 0x7f8012ec807fed13; + __m128i_out = __lsx_vmulwev_d_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000008000000080; + *((unsigned long *)&__m128i_op0[0]) = 0x0080000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0001000100010001; + *((unsigned long *)&__m128i_op1[0]) = 0x000100010001fffe; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000800080; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwev_d_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0002ffff00000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwev_d_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x7ff8000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x7ff8000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwev_d_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0909090900000909; + *((unsigned long *)&__m128i_op1[0]) = 0x0909090909090909; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwev_d_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwev_d_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwev_d_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwev_d_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000100; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwev_d_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x3a80613fda5dcb4a; + *((unsigned long *)&__m128i_op0[0]) = 0x93f0b81a914c003b; + *((unsigned long *)&__m128i_op1[1]) = 0x0000feff23560000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000fd1654860000; + *((unsigned long *)&__m128i_result[1]) = 0x1e242e4d68dc0000; + *((unsigned long *)&__m128i_result[0]) = 0x2ff8fddb7ae20000; + __m128i_out = __lsx_vmulwev_d_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwev_q_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwev_q_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwev_q_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000060000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000060000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwev_q_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x7ff000ff6220c0c1; + *((unsigned long *)&__m128i_op0[0]) = 0xffe8081000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x000000007ff000ff; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwev_q_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmulwev-3.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmulwev-3.c new file mode 100644 index 00000000000..346f0316afb --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmulwev-3.c @@ -0,0 +1,245 @@ +/* { dg-do run } */ +/* { dg-options "-mlsx -w -fno-strict-aliasing" } */ +#include "../simd_correctness_check.h" +#include + +int +main () +{ + __m128i __m128i_op0, __m128i_op1, __m128i_op2, __m128i_out, __m128i_result; + __m128 __m128_op0, __m128_op1, __m128_op2, __m128_out, __m128_result; + __m128d __m128d_op0, __m128d_op1, __m128d_op2, __m128d_out, __m128d_result; + + int int_op0, int_op1, int_op2, int_out, int_result, i = 1, fail; + long int long_op0, long_op1, long_op2, lont_out, lont_result; + long int long_int_out, long_int_result; + unsigned int unsigned_int_out, unsigned_int_result; + unsigned long int unsigned_long_int_out, unsigned_long_int_result; + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwev_h_bu_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000017fda829; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwev_h_bu_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwev_h_bu_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xfffffffffffffffc; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xfffffffffffffffc; + *((unsigned long *)&__m128i_result[1]) = 0xff01ff01ff01ff01; + *((unsigned long *)&__m128i_result[0]) = 0xff01ff01ff01fc10; + __m128i_out = __lsx_vmulwev_h_bu_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0042003e0042002f; + *((unsigned long *)&__m128i_op0[0]) = 0x0001fffc0001fffc; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffbeffc2ffbeffd1; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwev_h_bu_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000003f80; + *((unsigned long *)&__m128i_op1[1]) = 0x0001000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0001000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwev_h_bu_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwev_h_bu_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwev_d_wu_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwev_d_wu_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000080; + *((unsigned long *)&__m128i_op0[0]) = 0x80000000fff80000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000080; + *((unsigned long *)&__m128i_op1[0]) = 0x80000000fff80000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000004000; + *((unsigned long *)&__m128i_result[0]) = 0xfff8004000000000; + __m128i_out = __lsx_vmulwev_d_wu_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffff8607db959f; + *((unsigned long *)&__m128i_op0[0]) = 0xff0cff78ff96ff14; + *((unsigned long *)&__m128i_op1[1]) = 0x0000008a0000008a; + *((unsigned long *)&__m128i_op1[0]) = 0x0000008900000009; + *((unsigned long *)&__m128i_result[1]) = 0x000000043c5ea7b6; + *((unsigned long *)&__m128i_result[0]) = 0x00000008fc4ef7b4; + __m128i_out = __lsx_vmulwev_d_wu_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0xfffffffffffffffe; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffff46; + *((unsigned long *)&__m128i_result[1]) = 0xfffffffe00000002; + *((unsigned long *)&__m128i_result[0]) = 0xffffff46000000ba; + __m128i_out = __lsx_vmulwev_d_wu_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xfffffffffffffffc; + *((unsigned long *)&__m128i_op1[0]) = 0xfffffffffffffffc; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwev_d_wu_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0001000100010001; + *((unsigned long *)&__m128i_op0[0]) = 0x0001000100010001; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwev_d_wu_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xf8f8372f752402ee; + *((unsigned long *)&__m128i_op1[1]) = 0x7fffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffc0000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwev_d_wu_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000100000001; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000100000000; + *((unsigned long *)&__m128i_op1[1]) = 0xfffffffffffffffe; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwev_q_du_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x80044def00000001; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000ff000000ff00; + *((unsigned long *)&__m128i_result[1]) = 0x00007f8449a19084; + *((unsigned long *)&__m128i_result[0]) = 0x49a210000000ff00; + __m128i_out = __lsx_vmulwev_q_du_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwev_q_du_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwev_q_du_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfffcfd000000fb00; + *((unsigned long *)&__m128i_op0[0]) = 0x0001fe00f8000700; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x000000000000ffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_result[0]) = 0xfdfef9ff0efff900; + __m128i_out = __lsx_vmulwev_q_du_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000005; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x7efefefe82010201; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000002; + *((unsigned long *)&__m128i_result[0]) = 0x7afafaf88a050a05; + __m128i_out = __lsx_vmulwev_q_du_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xcda585aebbb2836a; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0xcda585aebbb2836a; + *((unsigned long *)&__m128i_result[1]) = 0xd78cfd70b5f65d76; + *((unsigned long *)&__m128i_result[0]) = 0x5779108fdedda7e4; + __m128i_out = __lsx_vmulwev_q_du_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x67eb85afb2ebb000; + *((unsigned long *)&__m128i_op0[0]) = 0xc8847ef6ed3f2000; + *((unsigned long *)&__m128i_op1[1]) = 0x67eb85afb2ebb000; + *((unsigned long *)&__m128i_op1[0]) = 0xc8847ef6ed3f2000; + *((unsigned long *)&__m128i_result[1]) = 0xd48acbfe13102acf; + *((unsigned long *)&__m128i_result[0]) = 0xf4af70d0c4000000; + __m128i_out = __lsx_vmulwev_q_du_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffe0000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwev_q_du_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x3a8000003a800000; + *((unsigned long *)&__m128i_op0[0]) = 0x000ef0000000003b; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000056; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000ffffff86; + *((unsigned long *)&__m128i_result[1]) = 0x00000000000eefff; + *((unsigned long *)&__m128i_result[0]) = 0xf8e1a03affffe3e2; + __m128i_out = __lsx_vmulwev_q_du_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmulwod-1.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmulwod-1.c new file mode 100644 index 00000000000..6eea49a61b9 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmulwod-1.c @@ -0,0 +1,272 @@ +/* { dg-do run } */ +/* { dg-options "-mlsx -w -fno-strict-aliasing" } */ +#include "../simd_correctness_check.h" +#include + +int +main () +{ + __m128i __m128i_op0, __m128i_op1, __m128i_op2, __m128i_out, __m128i_result; + __m128 __m128_op0, __m128_op1, __m128_op2, __m128_out, __m128_result; + __m128d __m128d_op0, __m128d_op1, __m128d_op2, __m128d_out, __m128d_result; + + int int_op0, int_op1, int_op2, int_out, int_result, i = 1, fail; + long int long_op0, long_op1, long_op2, lont_out, lont_result; + long int long_int_out, long_int_result; + unsigned int unsigned_int_out, unsigned_int_result; + unsigned long int unsigned_long_int_out, unsigned_long_int_result; + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000006; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwod_h_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x0100010000000001; + *((unsigned long *)&__m128i_op1[0]) = 0x0100010000010000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwod_h_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x000000003ddc5dac; + *((unsigned long *)&__m128i_op1[1]) = 0x67157b5100005000; + *((unsigned long *)&__m128i_op1[0]) = 0x387c7e0a133f2000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000004870ba0; + __m128i_out = __lsx_vmulwod_h_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfefe000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xffff000000000155; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000100000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwod_h_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x7fff7fff7fff7fff; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0xffff8001ffff8001; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwod_w_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x7ff0000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x7ff0000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x7ff0000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x7ff0000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x3ff0010000000000; + *((unsigned long *)&__m128i_result[0]) = 0x3ff0010000000000; + __m128i_out = __lsx_vmulwod_w_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwod_w_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x00009c7c00007176; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x00009c7c00007176; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwod_w_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwod_w_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x440ef000440ef000; + *((unsigned long *)&__m128i_op0[0]) = 0x4400000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x3a8000003a800000; + *((unsigned long *)&__m128i_op1[0]) = 0x000ef0000000003b; + *((unsigned long *)&__m128i_result[1]) = 0x0f8d33000f8d3300; + *((unsigned long *)&__m128i_result[0]) = 0x0003b80000000000; + __m128i_out = __lsx_vmulwod_w_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0018001800180018; + *((unsigned long *)&__m128i_op0[0]) = 0x0018001800180018; + *((unsigned long *)&__m128i_op1[1]) = 0x85bd6b0e94d89998; + *((unsigned long *)&__m128i_op1[0]) = 0xd83c8081ffff808f; + *((unsigned long *)&__m128i_result[1]) = 0xfff489b693120950; + *((unsigned long *)&__m128i_result[0]) = 0xfffc45a851c40c18; + __m128i_out = __lsx_vmulwod_d_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwod_d_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffe5; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffe5; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000001; + __m128i_out = __lsx_vmulwod_d_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x3e1f321529232736; + *((unsigned long *)&__m128i_op1[0]) = 0x161d0c373c200826; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwod_d_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x3f8000003f800000; + *((unsigned long *)&__m128i_op0[0]) = 0x3f8000003f800000; + *((unsigned long *)&__m128i_op1[1]) = 0x0001000000010001; + *((unsigned long *)&__m128i_op1[0]) = 0x0001000000010001; + *((unsigned long *)&__m128i_result[1]) = 0x00003f8000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00003f8000000000; + __m128i_out = __lsx_vmulwod_d_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x7fff000000007fff; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwod_d_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000ffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0x0000ffffffdfffdf; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwod_d_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000ffff0000ffff; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x00000000ffffe000; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000c6fde000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwod_d_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x000fef01000f27ca; + *((unsigned long *)&__m128i_op1[1]) = 0x0000010000010101; + *((unsigned long *)&__m128i_op1[0]) = 0x0101000001000100; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00000ffef0010000; + __m128i_out = __lsx_vmulwod_d_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000ffffffe0; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000005452505; + *((unsigned long *)&__m128i_op1[0]) = 0x000000044525043c; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwod_d_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwod_d_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0x3fc03fc000000004; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffc03fc040; + __m128i_out = __lsx_vmulwod_d_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000000000000000a; + *((unsigned long *)&__m128i_op0[0]) = 0x000000000000000a; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwod_d_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x00fe000100cf005f; + *((unsigned long *)&__m128i_op1[0]) = 0x7fff7fff7fff7f00; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwod_d_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000400028000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000004; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwod_d_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xc110000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xc00d060000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x3ff0000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x40f3fa0000000000; + *((unsigned long *)&__m128i_result[1]) = 0xf047ef0000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwod_q_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x00007fff7fff8000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwod_q_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xffff100000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000000f0000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwod_q_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmulwod-2.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmulwod-2.c new file mode 100644 index 00000000000..f3e4e03903f --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmulwod-2.c @@ -0,0 +1,282 @@ +/* { dg-do run } */ +/* { dg-options "-mlsx -w -fno-strict-aliasing" } */ +#include "../simd_correctness_check.h" +#include + +int +main () +{ + __m128i __m128i_op0, __m128i_op1, __m128i_op2, __m128i_out, __m128i_result; + __m128 __m128_op0, __m128_op1, __m128_op2, __m128_out, __m128_result; + __m128d __m128d_op0, __m128d_op1, __m128d_op2, __m128d_out, __m128d_result; + + int int_op0, int_op1, int_op2, int_out, int_result, i = 1, fail; + long int long_op0, long_op1, long_op2, lont_out, lont_result; + long int long_int_out, long_int_result; + unsigned int unsigned_int_out, unsigned_int_result; + unsigned long int unsigned_long_int_out, unsigned_long_int_result; + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x004e005500060031; + *((unsigned long *)&__m128i_op1[0]) = 0xff870068fff5ffb3; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwod_h_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwod_h_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000200010; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwod_h_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwod_h_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfa31dfa21672e711; + *((unsigned long *)&__m128i_op0[0]) = 0x1304db85e468073a; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000001; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwod_h_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000150000; + *((unsigned long *)&__m128i_op0[0]) = 0xfffeffff001effff; + *((unsigned long *)&__m128i_op1[1]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000fffff1a0; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x000000000000f00f; + __m128i_out = __lsx_vmulwod_h_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000080; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwod_h_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + unsigned_int_out = __lsx_vpickve2gr_hu (__m128i_op0, 0x4); + *((unsigned long *)&__m128i_op0[1]) = 0xe2560afe9c001a18; + *((unsigned long *)&__m128i_op0[0]) = 0xe2560afe9c001a18; + *((unsigned long *)&__m128i_op1[1]) = 0x000000ff0000857a; + *((unsigned long *)&__m128i_op1[0]) = 0x05fafe0101fe000e; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000d82; + *((unsigned long *)&__m128i_result[0]) = 0x046a09ec009c0000; + __m128i_out = __lsx_vmulwod_h_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xfe80ffffffffff02; + *((unsigned long *)&__m128i_op1[1]) = 0x7fff7fff7fff7fff; + *((unsigned long *)&__m128i_op1[0]) = 0x7fff7fff00000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x7f3f018000000000; + __m128i_out = __lsx_vmulwod_w_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwod_w_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xf0fd800080000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000a00028004000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwod_w_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwod_w_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000005a00000228; + *((unsigned long *)&__m128i_op0[0]) = 0xfffff9ee000004ec; + *((unsigned long *)&__m128i_op1[1]) = 0xfffffacdb6dbecac; + *((unsigned long *)&__m128i_op1[0]) = 0x1f5533a694f902c0; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x1f54e0ab00000000; + __m128i_out = __lsx_vmulwod_w_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x00e4880080000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0080810080808100; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwod_w_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xff011fb11181d8ea; + *((unsigned long *)&__m128i_op0[0]) = 0x80ff800000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x00fe00fe000200fe; + *((unsigned long *)&__m128i_op1[0]) = 0x00fe00fe000200fe; + *((unsigned long *)&__m128i_result[1]) = 0x00fd02fe00002302; + *((unsigned long *)&__m128i_result[0]) = 0x007ffd0200000000; + __m128i_out = __lsx_vmulwod_w_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xfffe0001fffe0001; + __m128i_out = __lsx_vmulwod_w_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x14ccc6320076a4d2; + *((unsigned long *)&__m128i_op0[0]) = 0x685670d27e00682a; + *((unsigned long *)&__m128i_op1[1]) = 0xfffffffffffffffe; + *((unsigned long *)&__m128i_op1[0]) = 0xfffffffffffffffe; + *((unsigned long *)&__m128i_result[1]) = 0x14ccc631eb3339ce; + *((unsigned long *)&__m128i_result[0]) = 0x685670d197a98f2e; + __m128i_out = __lsx_vmulwod_d_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xf000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwod_d_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x003fffc0ffc0003f; + *((unsigned long *)&__m128i_op0[0]) = 0xffc0ffc0003f003f; + *((unsigned long *)&__m128i_op1[1]) = 0x000000400000004c; + *((unsigned long *)&__m128i_op1[0]) = 0x00007770ffff941d; + *((unsigned long *)&__m128i_result[1]) = 0x000000000ffff000; + *((unsigned long *)&__m128i_result[0]) = 0x000077529b522400; + __m128i_out = __lsx_vmulwod_d_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwod_q_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000001; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwod_q_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000001000000010; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x1111113111111141; + *((unsigned long *)&__m128i_op1[0]) = 0x1111113111111121; + *((unsigned long *)&__m128i_result[1]) = 0x0000000111111312; + *((unsigned long *)&__m128i_result[0]) = 0x2222272111111410; + __m128i_out = __lsx_vmulwod_q_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwod_q_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000001c88bf0; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000001c88bf0; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwod_q_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xfffffff800000003; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffff0015172b; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwod_q_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwod_q_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000800000; + *((unsigned long *)&__m128i_op0[0]) = 0x003fffffff800000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwod_q_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0001000100010001; + *((unsigned long *)&__m128i_op0[0]) = 0x0001000600000001; + *((unsigned long *)&__m128i_op1[1]) = 0x00000000c6c6c6c6; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000c6c6c6c6; + *((unsigned long *)&__m128i_result[1]) = 0x000000000000c6c7; + *((unsigned long *)&__m128i_result[0]) = 0x8d8d8d8d8d8cc6c6; + __m128i_out = __lsx_vmulwod_q_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0a0000000a000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0a0000000a000000; + *((unsigned long *)&__m128i_op1[1]) = 0x7f7f00007f7f7500; + *((unsigned long *)&__m128i_op1[0]) = 0x3b42017f3a7f7f01; + *((unsigned long *)&__m128i_result[1]) = 0x04faf60009f5f092; + *((unsigned long *)&__m128i_result[0]) = 0x04fafa9200000000; + __m128i_out = __lsx_vmulwod_q_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmulwod-3.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmulwod-3.c new file mode 100644 index 00000000000..9f5702e2c9b --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmulwod-3.c @@ -0,0 +1,308 @@ +/* { dg-do run } */ +/* { dg-options "-mlsx -w -fno-strict-aliasing" } */ +#include "../simd_correctness_check.h" +#include + +int +main () +{ + __m128i __m128i_op0, __m128i_op1, __m128i_op2, __m128i_out, __m128i_result; + __m128 __m128_op0, __m128_op1, __m128_op2, __m128_out, __m128_result; + __m128d __m128d_op0, __m128d_op1, __m128d_op2, __m128d_out, __m128d_result; + + int int_op0, int_op1, int_op2, int_out, int_result, i = 1, fail; + long int long_op0, long_op1, long_op2, lont_out, lont_result; + long int long_int_out, long_int_result; + unsigned int unsigned_int_out, unsigned_int_result; + unsigned long int unsigned_long_int_out, unsigned_long_int_result; + + *((unsigned long *)&__m128i_op0[1]) = 0xbf8000000000ffff; + *((unsigned long *)&__m128i_op0[0]) = 0xcf00000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000002; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwod_h_bu_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwod_h_bu_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwod_h_bu_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000000000000ffff; + *((unsigned long *)&__m128i_op0[0]) = 0x0000ff020000fff4; + *((unsigned long *)&__m128i_op1[1]) = 0x7fc000007fc00000; + *((unsigned long *)&__m128i_op1[0]) = 0x1e801ffc7fc00000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00001ee100000000; + __m128i_out = __lsx_vmulwod_h_bu_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000010; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000010; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwod_h_bu_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000001; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwod_h_bu_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwod_h_bu_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x000000007fff7fff; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x3f5ec0a0feefa0b0; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00000000ff02d060; + __m128i_out = __lsx_vmulwod_h_bu_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwod_h_bu_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwod_d_wu_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000001; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000001; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwod_d_wu_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwod_d_wu_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x80000000fff8fff8; + *((unsigned long *)&__m128i_op0[0]) = 0x80000000fff80000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwod_d_wu_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwod_d_wu_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000001000000010; + *((unsigned long *)&__m128i_op0[0]) = 0x0000001000000010; + *((unsigned long *)&__m128i_op1[1]) = 0x0010001000100010; + *((unsigned long *)&__m128i_op1[0]) = 0x0010001000100010; + *((unsigned long *)&__m128i_result[1]) = 0x0000000001000100; + *((unsigned long *)&__m128i_result[0]) = 0x0000000001000100; + __m128i_out = __lsx_vmulwod_d_wu_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000000004a294b; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000006d04bc; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwod_d_wu_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x55aa55aa55aa55ab; + *((unsigned long *)&__m128i_op0[0]) = 0xaa55555655aaaaa8; + *((unsigned long *)&__m128i_op1[1]) = 0x7ef4002d21fc7001; + *((unsigned long *)&__m128i_op1[0]) = 0x28bf02d1ec6a35b2; + *((unsigned long *)&__m128i_result[1]) = 0x2a7b7c9260f90ee2; + *((unsigned long *)&__m128i_result[0]) = 0x1b1c6cdfd57f5736; + __m128i_out = __lsx_vmulwod_d_wu_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x003fffff00000000; + *((unsigned long *)&__m128i_op0[0]) = 0x003fffff00000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwod_d_wu_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000004040504; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000004040504; + *((unsigned long *)&__m128i_op1[1]) = 0x0000010100000101; + *((unsigned long *)&__m128i_op1[0]) = 0x0000010100000101; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwod_d_wu_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x7fff00007fff0000; + *((unsigned long *)&__m128i_op0[0]) = 0x7fff00007fff0000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwod_d_wu_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwod_d_wu_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwod_q_du_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwod_q_du_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000000ff000000ff; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000ffff00000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000ffff0000ffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000feff01; + *((unsigned long *)&__m128i_result[0]) = 0x00feff0100000000; + __m128i_out = __lsx_vmulwod_q_du_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwod_q_du_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0101010202050120; + *((unsigned long *)&__m128i_op0[0]) = 0x0101010102020202; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000000000ff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwod_q_du_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xf51cf8dad6040188; + *((unsigned long *)&__m128i_op0[0]) = 0x0982e2daf234ed87; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x0ae3072529fbfe78; + __m128i_out = __lsx_vmulwod_q_du_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x00000000000007f8; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000000007f8; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwod_q_du_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwod_q_du_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00ff000000ff0000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000005; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwod_q_du_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmulwod_q_du_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x030804010d090107; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x1313131313131313; + *((unsigned long *)&__m128i_op1[0]) = 0x1313131313131313; + *((unsigned long *)&__m128i_result[1]) = 0x0039d21e3229d4e8; + *((unsigned long *)&__m128i_result[0]) = 0x6d339b4f3b439885; + __m128i_out = __lsx_vmulwod_q_du_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} From patchwork Mon Sep 11 03:48:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: chenxiaolong X-Patchwork-Id: 137881 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ab0a:0:b0:3f2:4152:657d with SMTP id m10csp1858763vqo; Sun, 10 Sep 2023 20:53:10 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHnGzGIyUGa2nqRBB7vnFvpICuCDSxk69nZx4C03hY2YLQUEfJUX7lCu9h/dmLc81BgyQ/p X-Received: by 2002:ac2:4ece:0:b0:4fc:3756:754e with SMTP id p14-20020ac24ece000000b004fc3756754emr5768348lfr.56.1694404389829; Sun, 10 Sep 2023 20:53:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694404389; cv=none; d=google.com; s=arc-20160816; b=djumK2o0s2J4KFD1tLrjgSPEutEk/HMJ56CgUaL7n2yB4dESl74PhrwJJBnJbozkrW cr27CPrZFfN0KJFBPXAl+Bfa/0lluf4U8pe1NoP98ZhnmdYm2smH9fkW3Kpch5xKswD2 hFj2DBB0MRSQBtgzHM83OhiirfvIhqb/My1zqRXFji/Av/lZV7CwulFuUx13jzXk335I Qq8Oea0XaP8syjNJk8vJM9heTWMOoLUdgfhUi4Hy5vO6XHyVFiubB4tIpy4lWvhQ7J1W 2KmstXcSyBxt/t1ls3JQGHJJm9xAiWyJj+eioIHs8ZDXd/2Dk7ChMr/loCwgcrmQJL9f lOcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:to:from:dmarc-filter :delivered-to; bh=ENSHk2oVVQnYse22IcvFYunDouvwG1+Z7MV+INEZK/w=; fh=BpFCyCzVJo4znJIvOjeDfKzcGsF6Q+JgJbJ+1ev/kM4=; b=xWH/pF7BC3nD4ro1bS+ZmDgdSf4q/7YJ8EasLmZXFavBZU/N+pmxeIi6Zxvuq9vUrC TzjNQAgoLPbFgcmGKN+ATl70u7vbc9cxwT1CT6JH9bkO1iC6O0Vz04UwFtUzSwTP7jcJ v5WL15ggmwWw1HF6GxFxIgrzbWVLEXei1j0BZJphzeVAEW3nfPsKnl5Mm9W9XalXoMxU FN6KR/nxK5XDixGZeUF9iQ8w4DUXHhe9djKhnEdfu6A7D2gH67Rvcyk+Q0D/TGWM7UhH kd+/tdWYBr0X/wGEVn2ee6gftP0xTv52hbI7YEr489A+fGjrRPr7HmReCXZXWfZldWPL Emaw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id lj24-20020a170906f9d800b009a63cbcf7c5si6115612ejb.933.2023.09.10.20.53.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 Sep 2023 20:53:09 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3444D385DC3A for ; Mon, 11 Sep 2023 03:49:34 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by sourceware.org (Postfix) with ESMTP id 51A3D3858D3C for ; Mon, 11 Sep 2023 03:48:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 51A3D3858D3C Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=loongson.cn Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=loongson.cn Received: from loongson.cn (unknown [10.10.130.252]) by gateway (Coremail) with SMTP id _____8CxyOgOjv5kfkUkAA--.35417S3; Mon, 11 Sep 2023 11:48:30 +0800 (CST) Received: from slurm-master.loongson.cn (unknown [10.10.130.252]) by localhost.localdomain (Coremail) with SMTP id AQAAf8Cx_c4Njv5kmad2AA--.19959S4; Mon, 11 Sep 2023 11:48:29 +0800 (CST) From: Xiaolong Chen To: gcc-patches@gcc.gnu.org Subject: [PATCH v3 9/9] LoongArch:Add SX instructions for vector arithmetic operations other than multiplication, addition, and subtraction. Date: Mon, 11 Sep 2023 11:48:27 +0800 Message-Id: <20230911034827.8644-1-chenxiaolong@loongson.cn> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-CM-TRANSID: AQAAf8Cx_c4Njv5kmad2AA--.19959S4 X-CM-SenderInfo: hfkh05xldrz0tqj6z05rqj20fqof0/1tbiAQALBWT9QjYDqgAAsL X-Coremail-Antispam: 1Uk129KBj9UXoW7XFykWFWxCw4rp5X_Wr4DAFy8pr12vr13Kr Wxua4YyryUtFyaqFWkAr92ya97JF47t3srKw1UGFsxXF13Ca4UAr1DtF9rWFy3tFyrGF4j qr47JwcCm3ZEXasCq-sJn29KB7ZKAUJUUUU8529EdanIXcx71UUUUU7KY7ZEXasCq-sGcS sGvfJ3Ic02F40EFcxC0VAKzVAqx4xG6I80ebIjqfuFe4nvWSU5nxnvy29KBjDU0xBIdaVr nRJUUUk2b4IE77IF4wAFF20E14v26r1j6r4UM7CY07I20VC2zVCF04k26cxKx2IYs7xG6r Wj6s0DM7CIcVAFz4kK6r106r15M28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48ve4kI8wA2 z4x0Y4vE2Ix0cI8IcVAFwI0_Ar0_tr1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI0_Gr0_Cr 1l84ACjcxK6I8E87Iv67AKxVW8Jr0_Cr1UM28EF7xvwVC2z280aVCY1x0267AKxVW8Jr0_ Cr1UM2AIxVAIcxkEcVAq07x20xvEncxIr21l57IF6xkI12xvs2x26I8E6xACxx1l5I8CrV ACY4xI64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r1q6rW5McIj6I8E87Iv67AKxVW8 JVWxJwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IYc2Ij64vIr41l42xK82IYc2Ij64vIr4 1l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2IqxVAqx4xG67AKxVWUJVWUGwC20s026x8GjcxK 67AKxVWUGVWUWwC2zVAF1VAY17CE14v26r126r1DMIIYrxkI7VAKI48JMIIF0xvE2Ix0cI 8IcVAFwI0_Xr0_Ar1lIxAIcVC0I7IYx2IY6xkF7I0E14v26r4j6F4UMIIF0xvE42xK8VAv wI8IcIk0rVWUJVWUCwCI42IY6I8E87Iv67AKxVW8JVWxJwCI42IY6I8E87Iv6xkF7I0E14 v26r4j6r4UJbIYCTnIWIevJa73UjIFyTuYvjxUcHUqUUUUU X-Spam-Status: No, score=-12.5 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, KAM_SHORT, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Xiaolong Chen , xuchenghua@loongson.cn, chenglulu@loongson.cn, i@xen0n.name Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1776711777381538234 X-GMAIL-MSGID: 1776711777381538234 gcc/testsuite/ChangeLog: * gcc.target/loongarch/vector/lsx/lsx-vavg-1.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vavg-2.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vavgr-1.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vavgr-2.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vdiv-1.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vdiv-2.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vexth-1.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vexth-2.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vldi.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vmax-1.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vmax-2.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vmaxi-1.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vmaxi-2.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vmin-1.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vmin-2.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vmini-1.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vmini-2.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vmskgez.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vmskltz.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vmsknz.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vneg.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vsat-1.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vsat-2.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vsigncov.c: New test. --- .../loongarch/vector/lsx/lsx-vavg-1.c | 398 ++++++++++++++++ .../loongarch/vector/lsx/lsx-vavg-2.c | 308 +++++++++++++ .../loongarch/vector/lsx/lsx-vavgr-1.c | 299 ++++++++++++ .../loongarch/vector/lsx/lsx-vavgr-2.c | 317 +++++++++++++ .../loongarch/vector/lsx/lsx-vdiv-1.c | 299 ++++++++++++ .../loongarch/vector/lsx/lsx-vdiv-2.c | 254 ++++++++++ .../loongarch/vector/lsx/lsx-vexth-1.c | 342 ++++++++++++++ .../loongarch/vector/lsx/lsx-vexth-2.c | 182 ++++++++ .../loongarch/vector/lsx/lsx-vldi.c | 61 +++ .../loongarch/vector/lsx/lsx-vmax-1.c | 317 +++++++++++++ .../loongarch/vector/lsx/lsx-vmax-2.c | 362 +++++++++++++++ .../loongarch/vector/lsx/lsx-vmaxi-1.c | 279 +++++++++++ .../loongarch/vector/lsx/lsx-vmaxi-2.c | 223 +++++++++ .../loongarch/vector/lsx/lsx-vmin-1.c | 434 ++++++++++++++++++ .../loongarch/vector/lsx/lsx-vmin-2.c | 344 ++++++++++++++ .../loongarch/vector/lsx/lsx-vmini-1.c | 314 +++++++++++++ .../loongarch/vector/lsx/lsx-vmini-2.c | 216 +++++++++ .../loongarch/vector/lsx/lsx-vmskgez.c | 119 +++++ .../loongarch/vector/lsx/lsx-vmskltz.c | 321 +++++++++++++ .../loongarch/vector/lsx/lsx-vmsknz.c | 104 +++++ .../loongarch/vector/lsx/lsx-vneg.c | 321 +++++++++++++ .../loongarch/vector/lsx/lsx-vsat-1.c | 231 ++++++++++ .../loongarch/vector/lsx/lsx-vsat-2.c | 272 +++++++++++ .../loongarch/vector/lsx/lsx-vsigncov.c | 425 +++++++++++++++++ 24 files changed, 6742 insertions(+) create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vavg-1.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vavg-2.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vavgr-1.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vavgr-2.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vdiv-1.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vdiv-2.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vexth-1.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vexth-2.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vldi.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmax-1.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmax-2.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmaxi-1.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmaxi-2.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmin-1.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmin-2.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmini-1.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmini-2.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmskgez.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmskltz.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmsknz.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vneg.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsat-1.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsat-2.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsigncov.c diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vavg-1.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vavg-1.c new file mode 100644 index 00000000000..2177ca3f6f7 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vavg-1.c @@ -0,0 +1,398 @@ +/* { dg-do run } */ +/* { dg-options "-mlsx -w -fno-strict-aliasing" } */ +#include "../simd_correctness_check.h" +#include + +int +main () +{ + __m128i __m128i_op0, __m128i_op1, __m128i_op2, __m128i_out, __m128i_result; + __m128 __m128_op0, __m128_op1, __m128_op2, __m128_out, __m128_result; + __m128d __m128d_op0, __m128d_op1, __m128d_op2, __m128d_out, __m128d_result; + + int int_op0, int_op1, int_op2, int_out, int_result, i = 1, fail; + long int long_op0, long_op1, long_op2, lont_out, lont_result; + long int long_int_out, long_int_result; + unsigned int unsigned_int_out, unsigned_int_result; + unsigned long int unsigned_long_int_out, unsigned_long_int_result; + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vavg_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfff8fff8fff8fff8; + *((unsigned long *)&__m128i_op0[0]) = 0xfff8fff8fff8fff8; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xfffcfffcfffcfffc; + *((unsigned long *)&__m128i_result[0]) = 0xfffcfffcfffcfffc; + __m128i_out = __lsx_vavg_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vavg_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vavg_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x4050000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x2028000000000000; + __m128i_out = __lsx_vavg_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vavg_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vavg_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vavg_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x67eb85afb2ebb000; + *((unsigned long *)&__m128i_op0[0]) = 0xc8847ef6ed3f2000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000014155445; + *((unsigned long *)&__m128i_result[1]) = 0x33f5c2d7d9f5d800; + *((unsigned long *)&__m128i_result[0]) = 0xe4c23ffb002a3a22; + __m128i_out = __lsx_vavg_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vavg_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vavg_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x007fffff00000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x00000000000f000e; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000000ffffe; + *((unsigned long *)&__m128i_result[1]) = 0x003fffff00070007; + *((unsigned long *)&__m128i_result[0]) = 0x000000000007ffff; + __m128i_out = __lsx_vavg_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vavg_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000040; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000040; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000400028000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000004; + *((unsigned long *)&__m128i_result[1]) = 0x000000020001c020; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000022; + __m128i_out = __lsx_vavg_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x08080807f5f5f5f8; + *((unsigned long *)&__m128i_op1[0]) = 0x000000000000ff00; + *((unsigned long *)&__m128i_result[1]) = 0x04040403fafafafc; + *((unsigned long *)&__m128i_result[0]) = 0x000000000000ff80; + __m128i_out = __lsx_vavg_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x10f8000100000001; + *((unsigned long *)&__m128i_op0[0]) = 0x00000001000010f8; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x087c000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x000000000000087c; + __m128i_out = __lsx_vavg_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vavg_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x5641127843c0d41e; + *((unsigned long *)&__m128i_op0[0]) = 0xfedb27095b6bff95; + *((unsigned long *)&__m128i_op1[1]) = 0xa8beed87bc3f2be1; + *((unsigned long *)&__m128i_op1[0]) = 0x0024d8f6a494006a; + *((unsigned long *)&__m128i_result[1]) = 0xff7fffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xff7fffffffffffff; + __m128i_out = __lsx_vavg_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x000000000000ffff; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffff00007fff; + __m128i_out = __lsx_vavg_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffff80ff0010ff06; + *((unsigned long *)&__m128i_op0[0]) = 0x8000000080000000; + *((unsigned long *)&__m128i_op1[1]) = 0xedfaedfaedfaedfa; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000ffff0000; + *((unsigned long *)&__m128i_result[1]) = 0xf6fd377cf705f680; + *((unsigned long *)&__m128i_result[0]) = 0xc0000000bfff8000; + __m128i_out = __lsx_vavg_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x3ff0000000007fff; + *((unsigned long *)&__m128i_op0[0]) = 0x000000002bfd9461; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000f00; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000ffffff00; + *((unsigned long *)&__m128i_result[1]) = 0x1ff800000000477f; + *((unsigned long *)&__m128i_result[0]) = 0x0000000015fec9b0; + __m128i_out = __lsx_vavg_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000000000000006f; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000037; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vavg_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vavg_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x003fffff00000000; + *((unsigned long *)&__m128i_op0[0]) = 0x003fffff00000000; + *((unsigned long *)&__m128i_op1[1]) = 0x003fffff00000000; + *((unsigned long *)&__m128i_op1[0]) = 0x003fffff00000000; + *((unsigned long *)&__m128i_result[1]) = 0x003fffff00000000; + *((unsigned long *)&__m128i_result[0]) = 0x003fffff00000000; + __m128i_out = __lsx_vavg_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vavg_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0001000100010001; + *((unsigned long *)&__m128i_op0[0]) = 0x0001000100010001; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000800000008000; + *((unsigned long *)&__m128i_result[0]) = 0x0000800000008000; + __m128i_out = __lsx_vavg_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xd6a09e662ab46b31; + *((unsigned long *)&__m128i_op0[0]) = 0x34b8122ef4054bb3; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xeb504f33155a3598; + *((unsigned long *)&__m128i_result[0]) = 0x1a5c0917fa02a5d9; + __m128i_out = __lsx_vavg_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0177fff0fffffff0; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000011ff8bc; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xfffffffefffff784; + *((unsigned long *)&__m128i_result[1]) = 0x00bbfff7fffffff7; + *((unsigned long *)&__m128i_result[0]) = 0xffffffff008ff820; + __m128i_out = __lsx_vavg_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_op0[0]) = 0x00001802041b0014; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00000c01020d8009; + __m128i_out = __lsx_vavg_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000001; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vavg_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x000201000000000b; + *((unsigned long *)&__m128i_op1[1]) = 0x00000000ffff0000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000200000000; + *((unsigned long *)&__m128i_result[1]) = 0x000000007fff8000; + *((unsigned long *)&__m128i_result[0]) = 0x0001008100000005; + __m128i_out = __lsx_vavg_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfc01fd1300000001; + *((unsigned long *)&__m128i_op0[0]) = 0xfe00fd1400010000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000fff7fc01; + *((unsigned long *)&__m128i_result[1]) = 0xfe00fe8980000000; + *((unsigned long *)&__m128i_result[0]) = 0xff007e8a7ffc7e00; + __m128i_out = __lsx_vavg_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000001; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vavg_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vavg_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vavg_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0xfffffffe00000002; + *((unsigned long *)&__m128i_op1[0]) = 0xffffff46000000ba; + *((unsigned long *)&__m128i_result[1]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_result[0]) = 0xffffffa30000005c; + __m128i_out = __lsx_vavg_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000070007; + *((unsigned long *)&__m128i_op0[0]) = 0x000000000007ffff; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000068; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000038003; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000040033; + __m128i_out = __lsx_vavg_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffff0000ac26; + *((unsigned long *)&__m128i_op1[0]) = 0x00ff000000000001; + *((unsigned long *)&__m128i_result[1]) = 0xffffffff80005613; + *((unsigned long *)&__m128i_result[0]) = 0x007f800000000000; + __m128i_out = __lsx_vavg_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000040000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000040000000; + *((unsigned long *)&__m128i_op1[1]) = 0x7f8000007f800000; + *((unsigned long *)&__m128i_op1[0]) = 0x7f8000007f800000; + *((unsigned long *)&__m128i_result[1]) = 0x3fc000005fc00000; + *((unsigned long *)&__m128i_result[0]) = 0x3fc000005fc00000; + __m128i_out = __lsx_vavg_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000020000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000010000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vavg_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000200000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0002000200000001; + *((unsigned long *)&__m128i_result[1]) = 0x0000000100000000; + *((unsigned long *)&__m128i_result[0]) = 0x0001000100000000; + __m128i_out = __lsx_vavg_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_op1[1]) = 0x00000000fffe0001; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffff0001fffe; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffff0000; + *((unsigned long *)&__m128i_result[0]) = 0xffffffff0000ffff; + __m128i_out = __lsx_vavg_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vavg-2.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vavg-2.c new file mode 100644 index 00000000000..1b0d879e480 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vavg-2.c @@ -0,0 +1,308 @@ +/* { dg-do run } */ +/* { dg-options "-mlsx -w -fno-strict-aliasing" } */ +#include "../simd_correctness_check.h" +#include + +int +main () +{ + __m128i __m128i_op0, __m128i_op1, __m128i_op2, __m128i_out, __m128i_result; + __m128 __m128_op0, __m128_op1, __m128_op2, __m128_out, __m128_result; + __m128d __m128d_op0, __m128d_op1, __m128d_op2, __m128d_out, __m128d_result; + + int int_op0, int_op1, int_op2, int_out, int_result, i = 1, fail; + long int long_op0, long_op1, long_op2, lont_out, lont_result; + long int long_int_out, long_int_result; + unsigned int unsigned_int_out, unsigned_int_result; + unsigned long int unsigned_long_int_out, unsigned_long_int_result; + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000100000001; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vavg_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x7f7f7f7f7f7f7f7f; + *((unsigned long *)&__m128i_result[0]) = 0x7f7f7f7f7f7f7f7f; + __m128i_out = __lsx_vavg_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfffffffffffffffe; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0xfffffffffffffffe; + *((unsigned long *)&__m128i_result[0]) = 0x7f7f7f7f7f7f7f7f; + __m128i_out = __lsx_vavg_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x7f7f7f7f7f7f7f7f; + *((unsigned long *)&__m128i_result[0]) = 0x7f7f7f7f7f7f7f7f; + __m128i_out = __lsx_vavg_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000100000001000; + *((unsigned long *)&__m128i_op0[0]) = 0x37b951002d81a921; + *((unsigned long *)&__m128i_op1[1]) = 0x000000400000004c; + *((unsigned long *)&__m128i_op1[0]) = 0x000047404f4f040d; + *((unsigned long *)&__m128i_result[1]) = 0x0000082000000826; + *((unsigned long *)&__m128i_result[0]) = 0x1b5c4c203e685617; + __m128i_out = __lsx_vavg_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00c2758000bccf42; + *((unsigned long *)&__m128i_op0[0]) = 0x00a975be00accf03; + *((unsigned long *)&__m128i_op1[1]) = 0x00c2758000bccf42; + *((unsigned long *)&__m128i_op1[0]) = 0x00a975be00accf03; + *((unsigned long *)&__m128i_result[1]) = 0x00c2758000bccf42; + *((unsigned long *)&__m128i_result[0]) = 0x00a975be00accf03; + __m128i_out = __lsx_vavg_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0100000001000100; + *((unsigned long *)&__m128i_op0[0]) = 0x0100010000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffff732a; + *((unsigned long *)&__m128i_result[1]) = 0x807f7fff807f807f; + *((unsigned long *)&__m128i_result[0]) = 0x807f807f7fff3995; + __m128i_out = __lsx_vavg_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000000007f7f7f7f; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0xfffffffffffffff0; + *((unsigned long *)&__m128i_result[1]) = 0x000000003fbf3fbf; + *((unsigned long *)&__m128i_result[0]) = 0x7fff7fff7fff7ff8; + __m128i_out = __lsx_vavg_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0101010101010101; + *((unsigned long *)&__m128i_op0[0]) = 0x353c8cc4b1ec5b09; + *((unsigned long *)&__m128i_op1[1]) = 0xffff00000000ffff; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x8080008000808080; + *((unsigned long *)&__m128i_result[0]) = 0x1a9e466258f62d84; + __m128i_out = __lsx_vavg_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vavg_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vavg_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000158; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00000000000000ac; + __m128i_out = __lsx_vavg_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x9c9c9c9c00000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000020; + *((unsigned long *)&__m128i_result[1]) = 0x4e4e4e4e00000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000010; + __m128i_out = __lsx_vavg_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000868686868686; + *((unsigned long *)&__m128i_op1[1]) = 0x1e1e1e1e1e1e1e1e; + *((unsigned long *)&__m128i_op1[0]) = 0x1e1e1e1e1e1e1e1e; + *((unsigned long *)&__m128i_result[1]) = 0x0f0f0f0f0f0f0f0f; + *((unsigned long *)&__m128i_result[0]) = 0x0f0f525252525252; + __m128i_out = __lsx_vavg_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000014eb54ab; + *((unsigned long *)&__m128i_op0[0]) = 0x14eb6a002a406a00; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000ffdfdc0d; + *((unsigned long *)&__m128i_result[1]) = 0x000000000a752a55; + *((unsigned long *)&__m128i_result[0]) = 0x0a753500950fa306; + __m128i_out = __lsx_vavg_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfffff00010000fff; + *((unsigned long *)&__m128i_op0[0]) = 0xfffff00010000fff; + *((unsigned long *)&__m128i_op1[1]) = 0xfffff00010000fff; + *((unsigned long *)&__m128i_op1[0]) = 0xfffff00010000fff; + *((unsigned long *)&__m128i_result[1]) = 0xfffff00010000fff; + *((unsigned long *)&__m128i_result[0]) = 0xfffff00010000fff; + __m128i_out = __lsx_vavg_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x00000002ffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x000000017fffffff; + __m128i_out = __lsx_vavg_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0101000100010001; + *((unsigned long *)&__m128i_op1[0]) = 0x0101030100010001; + *((unsigned long *)&__m128i_result[1]) = 0x0080800000008000; + *((unsigned long *)&__m128i_result[0]) = 0x0080818000008000; + __m128i_out = __lsx_vavg_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000400000004; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000400000004; + *((unsigned long *)&__m128i_result[1]) = 0x0000000200000002; + *((unsigned long *)&__m128i_result[0]) = 0x0000000200000002; + __m128i_out = __lsx_vavg_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vavg_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vavg_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vavg_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0017004800c400f9; + *((unsigned long *)&__m128i_op0[0]) = 0x00ed001a00580070; + *((unsigned long *)&__m128i_op1[1]) = 0xffffff7ffffffffe; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000fffffffe; + *((unsigned long *)&__m128i_result[1]) = 0x800b7fe38062007b; + *((unsigned long *)&__m128i_result[0]) = 0x0076800d802c0037; + __m128i_out = __lsx_vavg_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xff80ffa2fff0ff74; + *((unsigned long *)&__m128i_op0[0]) = 0xff76ffd8ffe6ffaa; + *((unsigned long *)&__m128i_op1[1]) = 0xc0b4d1a5f8babad3; + *((unsigned long *)&__m128i_op1[0]) = 0xbbc8ecc5f3ced5f3; + *((unsigned long *)&__m128i_result[1]) = 0xe01ae8a3fc55dd23; + *((unsigned long *)&__m128i_result[0]) = 0xdd9ff64ef9daeace; + __m128i_out = __lsx_vavg_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x000000007fffffff; + __m128i_out = __lsx_vavg_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x3f80000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x3f80000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000ff000000ff00; + *((unsigned long *)&__m128i_result[1]) = 0x1fc0000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x1fc07f8000007f80; + __m128i_out = __lsx_vavg_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vavg_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vavg_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000001; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000043cf26c7; + *((unsigned long *)&__m128i_op1[0]) = 0x0000e31d4cae8636; + *((unsigned long *)&__m128i_result[1]) = 0x0000000021e79364; + *((unsigned long *)&__m128i_result[0]) = 0x0000718ea657431b; + __m128i_out = __lsx_vavg_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xfff0000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0xfff0000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x7ff8000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x7ff8000000000000; + __m128i_out = __lsx_vavg_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vavg_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffff80ffff7e02; + *((unsigned long *)&__m128i_op0[0]) = 0x00feff8000ff80ff; + *((unsigned long *)&__m128i_op1[1]) = 0x0000ffff0000ffff; + *((unsigned long *)&__m128i_op1[0]) = 0xf931fd04f832fe02; + *((unsigned long *)&__m128i_result[1]) = 0x80007fc000003f00; + *((unsigned long *)&__m128i_result[0]) = 0x7d187e427c993f80; + __m128i_out = __lsx_vavg_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vavgr-1.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vavgr-1.c new file mode 100644 index 00000000000..4b726253742 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vavgr-1.c @@ -0,0 +1,299 @@ +/* { dg-do run } */ +/* { dg-options "-mlsx -w -fno-strict-aliasing" } */ +#include "../simd_correctness_check.h" +#include + +int +main () +{ + __m128i __m128i_op0, __m128i_op1, __m128i_op2, __m128i_out, __m128i_result; + __m128 __m128_op0, __m128_op1, __m128_op2, __m128_out, __m128_result; + __m128d __m128d_op0, __m128d_op1, __m128d_op2, __m128d_out, __m128d_result; + + int int_op0, int_op1, int_op2, int_out, int_result, i = 1, fail; + long int long_op0, long_op1, long_op2, lont_out, lont_result; + long int long_int_out, long_int_result; + unsigned int unsigned_int_out, unsigned_int_result; + unsigned long int unsigned_long_int_out, unsigned_long_int_result; + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000800000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0040000000ff00ff; + *((unsigned long *)&__m128i_op1[0]) = 0x0040000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0020000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0020c00000000000; + __m128i_out = __lsx_vavgr_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vavgr_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xb9fe3640e4eb1b18; + *((unsigned long *)&__m128i_op0[0]) = 0x800000005b4b1b18; + *((unsigned long *)&__m128i_op1[1]) = 0xfffd000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xdcfe1b20f2f60e0c; + *((unsigned long *)&__m128i_result[0]) = 0xc00000002e260e0c; + __m128i_out = __lsx_vavgr_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x111110ff11111141; + *((unsigned long *)&__m128i_op0[0]) = 0x1111113111111121; + *((unsigned long *)&__m128i_op1[1]) = 0xfbffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0x7bffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x060808ff08080820; + *((unsigned long *)&__m128i_result[0]) = 0x4608081808080810; + __m128i_out = __lsx_vavgr_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000000ff000000ff; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vavgr_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000010; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000010; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x000000000000fff0; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000008; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vavgr_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000000000000ac26; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffff80000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000060000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x000003000000d613; + *((unsigned long *)&__m128i_result[0]) = 0x00000000c0000000; + __m128i_out = __lsx_vavgr_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vavgr_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffe5; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffe5; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0xfffffffffffffff2; + *((unsigned long *)&__m128i_result[0]) = 0xfffffffffffffff2; + __m128i_out = __lsx_vavgr_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000073; + *((unsigned long *)&__m128i_op0[0]) = 0x000000000000002a; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000100000000; + *((unsigned long *)&__m128i_result[1]) = 0x000000000000003a; + *((unsigned long *)&__m128i_result[0]) = 0x0000000100000015; + __m128i_out = __lsx_vavgr_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000004000; + *((unsigned long *)&__m128i_op1[0]) = 0xfff8004000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000002000; + *((unsigned long *)&__m128i_result[0]) = 0xfffc002000000000; + __m128i_out = __lsx_vavgr_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000002000; + *((unsigned long *)&__m128i_op0[0]) = 0xfffc002000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000002000; + *((unsigned long *)&__m128i_op1[0]) = 0xfffc002000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000002000; + *((unsigned long *)&__m128i_result[0]) = 0xfffc002000000000; + __m128i_out = __lsx_vavgr_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x000000ff00000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x000000ff00000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x000000ff00000000; + __m128i_out = __lsx_vavgr_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x000000007fff0018; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x000000003fff800c; + __m128i_out = __lsx_vavgr_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vavgr_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0280000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x7500000075000000; + *((unsigned long *)&__m128i_op1[0]) = 0x7500000075000000; + *((unsigned long *)&__m128i_result[1]) = 0x3a8000003a800000; + *((unsigned long *)&__m128i_result[0]) = 0x3bc000003a800000; + __m128i_out = __lsx_vavgr_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffff800000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x00007d1800007c99; + *((unsigned long *)&__m128i_op1[1]) = 0x0a0000001e000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0a621b3ebe5e1c02; + *((unsigned long *)&__m128i_result[1]) = 0x04ffc0000f000000; + *((unsigned long *)&__m128i_result[0]) = 0x05314c2bdf2f4c4e; + __m128i_out = __lsx_vavgr_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000002000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000002000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000001000000001; + *((unsigned long *)&__m128i_result[0]) = 0x0000001000000000; + __m128i_out = __lsx_vavgr_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffff80000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vavgr_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x7f8000007f800000; + *((unsigned long *)&__m128i_op1[0]) = 0x7f8000007f800000; + *((unsigned long *)&__m128i_result[1]) = 0x3fc000003fc00000; + *((unsigned long *)&__m128i_result[0]) = 0x3fc000003fc00000; + __m128i_out = __lsx_vavgr_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x7fffffff7fffffff; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x3fffffffc0000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vavgr_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xff00ff00ff00ff00; + *((unsigned long *)&__m128i_op1[0]) = 0xff00ff00ff00ff00; + *((unsigned long *)&__m128i_result[1]) = 0xff807f807f807f80; + *((unsigned long *)&__m128i_result[0]) = 0xff807f807f807f80; + __m128i_out = __lsx_vavgr_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000002; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000002; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000280000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000140001; + __m128i_out = __lsx_vavgr_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfffffffffffffffe; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffff46; + *((unsigned long *)&__m128i_op1[1]) = 0x00fe00fe00fe00fe; + *((unsigned long *)&__m128i_op1[0]) = 0x00fe00fe00fe0045; + *((unsigned long *)&__m128i_result[1]) = 0x007f007f007f007e; + *((unsigned long *)&__m128i_result[0]) = 0x007f007f007effc6; + __m128i_out = __lsx_vavgr_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vavgr_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vavgr_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x67eb85afb2ebb000; + *((unsigned long *)&__m128i_op0[0]) = 0xc8847ef6ed3f2000; + *((unsigned long *)&__m128i_op1[1]) = 0xfffffffffffffffc; + *((unsigned long *)&__m128i_op1[0]) = 0xfffffffffffffffc; + *((unsigned long *)&__m128i_result[1]) = 0x33f5c2d7d975d7fe; + *((unsigned long *)&__m128i_result[0]) = 0xe4423f7b769f8ffe; + __m128i_out = __lsx_vavgr_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vavgr_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000003ff8; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0xff9dff9dff9dff9d; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xffceffceffcf1fcb; + __m128i_out = __lsx_vavgr_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x3a8000003a800000; + *((unsigned long *)&__m128i_op0[0]) = 0x3bc000003a800000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x00fe00fe7fffffff; + *((unsigned long *)&__m128i_result[1]) = 0x1d4000001d400000; + *((unsigned long *)&__m128i_result[0]) = 0x1e5f007f5d400000; + __m128i_out = __lsx_vavgr_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x000000000000ff00; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000800000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000400000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000007f80; + __m128i_out = __lsx_vavgr_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vavgr-2.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vavgr-2.c new file mode 100644 index 00000000000..22908b1ea19 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vavgr-2.c @@ -0,0 +1,317 @@ +/* { dg-do run } */ +/* { dg-options "-mlsx -w -fno-strict-aliasing" } */ +#include "../simd_correctness_check.h" +#include + +int +main () +{ + __m128i __m128i_op0, __m128i_op1, __m128i_op2, __m128i_out, __m128i_result; + __m128 __m128_op0, __m128_op1, __m128_op2, __m128_out, __m128_result; + __m128d __m128d_op0, __m128d_op1, __m128d_op2, __m128d_out, __m128d_result; + + int int_op0, int_op1, int_op2, int_out, int_result, i = 1, fail; + long int long_op0, long_op1, long_op2, lont_out, lont_result; + long int long_int_out, long_int_result; + unsigned int unsigned_int_out, unsigned_int_result; + unsigned long int unsigned_long_int_out, unsigned_long_int_result; + + *((unsigned long *)&__m128i_op0[1]) = 0xfffffffff8f8dada; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffff01018888; + *((unsigned long *)&__m128i_op1[1]) = 0xfffffffff8f8dada; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffff01018888; + *((unsigned long *)&__m128i_result[1]) = 0xfffffffff8f8dada; + *((unsigned long *)&__m128i_result[0]) = 0xffffffff01018888; + __m128i_out = __lsx_vavgr_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x7fffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x4080808080808080; + __m128i_out = __lsx_vavgr_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x7fff7fff7fff7fff; + *((unsigned long *)&__m128i_op0[0]) = 0x000000010000003f; + *((unsigned long *)&__m128i_op1[1]) = 0x7fff7fff7fff7fff; + *((unsigned long *)&__m128i_op1[0]) = 0x000000010000003f; + *((unsigned long *)&__m128i_result[1]) = 0x7fff7fff7fff7fff; + *((unsigned long *)&__m128i_result[0]) = 0x000000010000003f; + __m128i_out = __lsx_vavgr_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vavgr_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000ffffffff0000; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffff00; + *((unsigned long *)&__m128i_op1[1]) = 0x1817161517161514; + *((unsigned long *)&__m128i_op1[0]) = 0x1615141315141312; + *((unsigned long *)&__m128i_result[1]) = 0x0c0c8b8a8b8b0b0a; + *((unsigned long *)&__m128i_result[0]) = 0x8b8a8a898a8a8909; + __m128i_out = __lsx_vavgr_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00003fff00003fff; + *((unsigned long *)&__m128i_op0[0]) = 0x00003fff00003fff; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000208000002080; + *((unsigned long *)&__m128i_result[0]) = 0x0000208000002080; + __m128i_out = __lsx_vavgr_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffd60015; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x80808080806b000b; + __m128i_out = __lsx_vavgr_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x7fff010181010102; + *((unsigned long *)&__m128i_op0[0]) = 0x7fffffff81010102; + *((unsigned long *)&__m128i_op1[1]) = 0x7fff010181010102; + *((unsigned long *)&__m128i_op1[0]) = 0x7fffffff81010102; + *((unsigned long *)&__m128i_result[1]) = 0x7fff010181010102; + *((unsigned long *)&__m128i_result[0]) = 0x7fffffff81010102; + __m128i_out = __lsx_vavgr_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vavgr_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vavgr_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vavgr_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0xc1bdceee242071db; + *((unsigned long *)&__m128i_op1[0]) = 0xe8c7b756d76aa578; + *((unsigned long *)&__m128i_result[1]) = 0xe0dee7779210b8ed; + *((unsigned long *)&__m128i_result[0]) = 0xf463dbabebb5d2bc; + __m128i_out = __lsx_vavgr_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vavgr_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vavgr_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xff80000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xff80000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xff80000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0xff80000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xff80000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xff80000000000000; + __m128i_out = __lsx_vavgr_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vavgr_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vavgr_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000800000008; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x00007fff00007fff; + *((unsigned long *)&__m128i_op1[0]) = 0x000000002bfd9461; + *((unsigned long *)&__m128i_result[1]) = 0x0000400400004004; + *((unsigned long *)&__m128i_result[0]) = 0x0000000015ff4a31; + __m128i_out = __lsx_vavgr_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x2a7b7c9260f90ee2; + *((unsigned long *)&__m128i_op1[0]) = 0x1b1c6cdfd57f5736; + *((unsigned long *)&__m128i_result[1]) = 0x153e3e49307d0771; + *((unsigned long *)&__m128i_result[0]) = 0x0d8e36706ac02b9b; + __m128i_out = __lsx_vavgr_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xdd6156076967d8c9; + *((unsigned long *)&__m128i_op0[0]) = 0x2e3ab5266375e71b; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000400000004; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000400000004; + *((unsigned long *)&__m128i_result[1]) = 0x6eb12b0634b46c67; + *((unsigned long *)&__m128i_result[0]) = 0x171d5a9531bb7390; + __m128i_out = __lsx_vavgr_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vavgr_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000f50000000900; + *((unsigned long *)&__m128i_op0[0]) = 0x0000090900000998; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x00007a8000000480; + *((unsigned long *)&__m128i_result[0]) = 0x00000485000004cc; + __m128i_out = __lsx_vavgr_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00003ff000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000fffc00000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_op1[0]) = 0xfffc001fffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x00001ff800000001; + *((unsigned long *)&__m128i_result[0]) = 0x7ffe800e80000000; + __m128i_out = __lsx_vavgr_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000000ffff53d9; + *((unsigned long *)&__m128i_op0[0]) = 0xff000001ffff9515; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000001; + *((unsigned long *)&__m128i_result[1]) = 0x000000007fffa9ed; + *((unsigned long *)&__m128i_result[0]) = 0x7f8000017fffca8b; + __m128i_out = __lsx_vavgr_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0xfffffffdfffffff8; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x7fffffff7ffffffc; + __m128i_out = __lsx_vavgr_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000001fffeff98; + *((unsigned long *)&__m128i_op0[0]) = 0x0014ffe4ff76ffc4; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x3131313131313131; + *((unsigned long *)&__m128i_result[1]) = 0x000000017fff7fcc; + *((unsigned long *)&__m128i_result[0]) = 0x18a3188b9854187b; + __m128i_out = __lsx_vavgr_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffff0000ffff0000; + *((unsigned long *)&__m128i_op0[0]) = 0xffff000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffff0000ffff0000; + *((unsigned long *)&__m128i_op1[0]) = 0xffff000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffff0000ffff0000; + *((unsigned long *)&__m128i_result[0]) = 0xffff000000000000; + __m128i_out = __lsx_vavgr_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000001c88bf0; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000001c88bf0; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000001c88bf0; + __m128i_out = __lsx_vavgr_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0x807fffff80800000; + *((unsigned long *)&__m128i_op1[1]) = 0x0006000000040000; + *((unsigned long *)&__m128i_op1[0]) = 0x0002000000000007; + *((unsigned long *)&__m128i_result[1]) = 0x8003000000020000; + *((unsigned long *)&__m128i_result[0]) = 0x4040ffffc0400004; + __m128i_out = __lsx_vavgr_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000010000010101; + *((unsigned long *)&__m128i_op0[0]) = 0x0101000001000100; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x8000008000008080; + *((unsigned long *)&__m128i_result[0]) = 0x8080800000800080; + __m128i_out = __lsx_vavgr_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vavgr_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vavgr_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vavgr_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vdiv-1.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vdiv-1.c new file mode 100644 index 00000000000..cb4be04757c --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vdiv-1.c @@ -0,0 +1,299 @@ +/* { dg-do run } */ +/* { dg-options "-mlsx -w -fno-strict-aliasing" } */ +#include "../simd_correctness_check.h" +#include + +int +main () +{ + __m128i __m128i_op0, __m128i_op1, __m128i_op2, __m128i_out, __m128i_result; + __m128 __m128_op0, __m128_op1, __m128_op2, __m128_out, __m128_result; + __m128d __m128d_op0, __m128d_op1, __m128d_op2, __m128d_out, __m128d_result; + + int int_op0, int_op1, int_op2, int_out, int_result, i = 1, fail; + long int long_op0, long_op1, long_op2, lont_out, lont_result; + long int long_int_out, long_int_result; + unsigned int unsigned_int_out, unsigned_int_result; + unsigned long int unsigned_long_int_out, unsigned_long_int_result; + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vdiv_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x3ff0000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x40f3fa0000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffb4ff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffb4ff; + *((unsigned long *)&__m128i_result[1]) = 0xc110000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xc00d060000000000; + __m128i_out = __lsx_vdiv_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0101010101010101; + __m128i_out = __lsx_vdiv_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000020000; + *((unsigned long *)&__m128i_op0[0]) = 0x0101000101010001; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000fe0000; + *((unsigned long *)&__m128i_result[0]) = 0xffff00ffffff00ff; + __m128i_out = __lsx_vdiv_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0101010100000000; + *((unsigned long *)&__m128i_result[0]) = 0x0101010100000000; + __m128i_out = __lsx_vdiv_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0xd3259a2984048c23; + *((unsigned long *)&__m128i_op1[0]) = 0xf9796558e39953fd; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vdiv_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffff9727ffff9727; + *((unsigned long *)&__m128i_op0[0]) = 0xfffffe79ffffba5f; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x010169d9010169d9; + *((unsigned long *)&__m128i_result[0]) = 0x01010287010146a1; + __m128i_out = __lsx_vdiv_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000897957687; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000408; + *((unsigned long *)&__m128i_op1[1]) = 0x80010001b57fc565; + *((unsigned long *)&__m128i_op1[0]) = 0x8001000184000be0; + *((unsigned long *)&__m128i_result[1]) = 0x000000080001fffe; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vdiv_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vdiv_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffff9cf0d77b; + *((unsigned long *)&__m128i_op1[0]) = 0xc1000082b0fb585b; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vdiv_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000000ff000000ff; + *((unsigned long *)&__m128i_op0[0]) = 0x000000ff000000ff; + *((unsigned long *)&__m128i_op1[1]) = 0x33f5c2d7d975d7fe; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000ff010000ff01; + __m128i_out = __lsx_vdiv_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000feff23560000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000fd1654860000; + *((unsigned long *)&__m128i_op1[1]) = 0x6363636363abdf16; + *((unsigned long *)&__m128i_op1[0]) = 0x41f8e08016161198; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000030000; + __m128i_out = __lsx_vdiv_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x4f4f4f4f4f4f4f4f; + *((unsigned long *)&__m128i_op1[0]) = 0x4f4f4f4f4f4f4f4f; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vdiv_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00003ff000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000fffc00000000; + *((unsigned long *)&__m128i_op1[1]) = 0x00001ff800000001; + *((unsigned long *)&__m128i_op1[0]) = 0x7ffe800e80000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000200000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vdiv_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x195f307a5d04acbb; + *((unsigned long *)&__m128i_op0[0]) = 0x6a1a3fbb3c90260e; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0xe6a0cf86a2fb5345; + *((unsigned long *)&__m128i_result[0]) = 0x95e5c045c36fd9f2; + __m128i_out = __lsx_vdiv_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xfffffffffffffffe; + *((unsigned long *)&__m128i_result[1]) = 0x0000000100000001; + *((unsigned long *)&__m128i_result[0]) = 0x0000000100000000; + __m128i_out = __lsx_vdiv_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x4f804f804f804f80; + *((unsigned long *)&__m128i_op1[0]) = 0x4f804f804f804f80; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vdiv_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vdiv_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x000fffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0x0010000000000001; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vdiv_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x370bdfecffecffec; + *((unsigned long *)&__m128i_op1[0]) = 0x370bdfecffecffec; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vdiv_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xa2e3a36363636363; + *((unsigned long *)&__m128i_op0[0]) = 0xa2e3a36463636363; + *((unsigned long *)&__m128i_op1[1]) = 0x7f80000000000007; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000700000007; + *((unsigned long *)&__m128i_result[1]) = 0x000000000e32c50e; + *((unsigned long *)&__m128i_result[0]) = 0xf2b2ce330e32c50e; + __m128i_out = __lsx_vdiv_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0xffffffff00000001; + *((unsigned long *)&__m128i_result[0]) = 0xffffffff00000001; + __m128i_out = __lsx_vdiv_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x52527d7d52527d7d; + *((unsigned long *)&__m128i_op0[0]) = 0x52527d7d52527d7d; + *((unsigned long *)&__m128i_op1[1]) = 0x52527d7d52527d7d; + *((unsigned long *)&__m128i_op1[0]) = 0x52527d7d52527d7d; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000001; + __m128i_out = __lsx_vdiv_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vdiv_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x8000000080000000; + *((unsigned long *)&__m128i_op0[0]) = 0x8000000080000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000001; + *((unsigned long *)&__m128i_result[1]) = 0x8000000080000000; + *((unsigned long *)&__m128i_result[0]) = 0x8000000080000000; + __m128i_out = __lsx_vdiv_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xe93d0bd19ff0c170; + *((unsigned long *)&__m128i_op1[0]) = 0x5237c1bac9eadf55; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vdiv_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x003fffff00000000; + *((unsigned long *)&__m128i_op0[0]) = 0x003fffff00000000; + *((unsigned long *)&__m128i_op1[1]) = 0x00000000003dffc2; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000003dffc2; + *((unsigned long *)&__m128i_result[1]) = 0x00000001084314a6; + *((unsigned long *)&__m128i_result[0]) = 0x00000001084314a6; + __m128i_out = __lsx_vdiv_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x00000ffef0010000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000010000010101; + *((unsigned long *)&__m128i_op1[0]) = 0x0101000001000100; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vdiv_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x4280000042800000; + *((unsigned long *)&__m128i_op1[1]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xbd7fffffbd800000; + __m128i_out = __lsx_vdiv_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000000000ff; + *((unsigned long *)&__m128i_op1[1]) = 0x30eb022002101b20; + *((unsigned long *)&__m128i_op1[0]) = 0x020310edc003023d; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vdiv_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000002000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000002000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x00000000000004ff; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x000000000667ae56; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000020; + __m128i_out = __lsx_vdiv_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vdiv-2.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vdiv-2.c new file mode 100644 index 00000000000..f2bc7df27c8 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vdiv-2.c @@ -0,0 +1,254 @@ +/* { dg-do run } */ +/* { dg-options "-mlsx -w -fno-strict-aliasing" } */ +#include "../simd_correctness_check.h" +#include + +int +main () +{ + __m128i __m128i_op0, __m128i_op1, __m128i_op2, __m128i_out, __m128i_result; + __m128 __m128_op0, __m128_op1, __m128_op2, __m128_out, __m128_result; + __m128d __m128d_op0, __m128d_op1, __m128d_op2, __m128d_out, __m128d_result; + + int int_op0, int_op1, int_op2, int_out, int_result, i = 1, fail; + long int long_op0, long_op1, long_op2, lont_out, lont_result; + long int long_int_out, long_int_result; + unsigned int unsigned_int_out, unsigned_int_result; + unsigned long int unsigned_long_int_out, unsigned_long_int_result; + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000001; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffefffffffef; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffefffffffef; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vdiv_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xe3e3e3e3e3e3e3e3; + *((unsigned long *)&__m128i_op1[1]) = 0xe3e3e3e3e3e3e3e3; + *((unsigned long *)&__m128i_op1[0]) = 0xe3e3e3e3e3e3e3e3; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0101010101010101; + __m128i_out = __lsx_vdiv_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xfffffffffffffffe; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0101010101010101; + __m128i_out = __lsx_vdiv_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0006000000040000; + *((unsigned long *)&__m128i_op0[0]) = 0x0002000000000007; + *((unsigned long *)&__m128i_op1[1]) = 0x31b1777777777776; + *((unsigned long *)&__m128i_op1[0]) = 0x6eee282828282829; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vdiv_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0101010101010101; + *((unsigned long *)&__m128i_result[0]) = 0x0101010101010101; + __m128i_out = __lsx_vdiv_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000010100000101; + *((unsigned long *)&__m128i_op0[0]) = 0x0000010100000101; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vdiv_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0effeffefdffa1e0; + *((unsigned long *)&__m128i_op0[0]) = 0xe6004c5f64284224; + *((unsigned long *)&__m128i_op1[1]) = 0xfeffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xfeffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0001000000010000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vdiv_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x10f917d72d3d01e4; + *((unsigned long *)&__m128i_op1[0]) = 0x203e16d116de012b; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vdiv_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000073; + *((unsigned long *)&__m128i_op0[0]) = 0x000000000000002a; + *((unsigned long *)&__m128i_op1[1]) = 0x00ffffff00ff00ff; + *((unsigned long *)&__m128i_op1[0]) = 0x00ff00ffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vdiv_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000003f200001e01; + *((unsigned long *)&__m128i_op0[0]) = 0x000014bf000019da; + *((unsigned long *)&__m128i_op1[1]) = 0x9c9c99aed5b88fcf; + *((unsigned long *)&__m128i_op1[0]) = 0x7c3650c5f79a61a3; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vdiv_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0002000200020002; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vdiv_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x8080808080808080; + *((unsigned long *)&__m128i_op1[0]) = 0x8080808080800008; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vdiv_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffd700; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffff00; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffff00; + *((unsigned long *)&__m128i_result[1]) = 0x0000000100000001; + *((unsigned long *)&__m128i_result[0]) = 0x0000000100000000; + __m128i_out = __lsx_vdiv_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000ffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0x0000ffffffdfffdf; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vdiv_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x000000000000ff00; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vdiv_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vdiv_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xfffffffffffbfff8; + *((unsigned long *)&__m128i_op1[1]) = 0x0080008000800080; + *((unsigned long *)&__m128i_op1[0]) = 0x0080006b0000000b; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x000001ff1745745c; + __m128i_out = __lsx_vdiv_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0001000100010001; + *((unsigned long *)&__m128i_op1[0]) = 0x0001000100010001; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vdiv_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffff14eb54ab; + *((unsigned long *)&__m128i_op0[0]) = 0x14ea6a002a406a00; + *((unsigned long *)&__m128i_op1[1]) = 0xffff80008a7555aa; + *((unsigned long *)&__m128i_op1[0]) = 0x0a7535006af05cf9; + *((unsigned long *)&__m128i_result[1]) = 0x0000000100000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000200000000; + __m128i_out = __lsx_vdiv_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0141010101410101; + *((unsigned long *)&__m128i_op0[0]) = 0x0141010101410101; + *((unsigned long *)&__m128i_op1[1]) = 0xfebffefffebffeff; + *((unsigned long *)&__m128i_op1[0]) = 0xfebffefffebffeff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vdiv_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x6363797c63996399; + *((unsigned long *)&__m128i_op0[0]) = 0x171f0a1f6376441f; + *((unsigned long *)&__m128i_op1[1]) = 0x6363797c63996399; + *((unsigned long *)&__m128i_op1[0]) = 0x171f0a1f6376441f; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000001; + __m128i_out = __lsx_vdiv_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000036de0000; + *((unsigned long *)&__m128i_op0[0]) = 0x000000003be14000; + *((unsigned long *)&__m128i_op1[1]) = 0x000000000000006f; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000001f0a; + *((unsigned long *)&__m128i_result[1]) = 0x00000000007e8a60; + *((unsigned long *)&__m128i_result[0]) = 0x000000000001edde; + __m128i_out = __lsx_vdiv_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000015d926c7; + *((unsigned long *)&__m128i_op1[0]) = 0x000000000000e41b; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vdiv_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x77c0404a4000403a; + *((unsigned long *)&__m128i_op0[0]) = 0x77c03fd640003fc6; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vdiv_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0042003e0042002f; + *((unsigned long *)&__m128i_op0[0]) = 0x0001fffc0001fffc; + *((unsigned long *)&__m128i_op1[1]) = 0x0042003e0042002f; + *((unsigned long *)&__m128i_op1[0]) = 0x0001fffc0001fffc; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000001; + __m128i_out = __lsx_vdiv_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000000feff2356; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000fd165486; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000007; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000007; + *((unsigned long *)&__m128i_result[1]) = 0x00000000246d9755; + *((unsigned long *)&__m128i_result[0]) = 0x000000002427c2ee; + __m128i_out = __lsx_vdiv_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vexth-1.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vexth-1.c new file mode 100644 index 00000000000..f6390800d82 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vexth-1.c @@ -0,0 +1,342 @@ +/* { dg-do run } */ +/* { dg-options "-mlsx -w -fno-strict-aliasing" } */ +#include "../simd_correctness_check.h" +#include + +int +main () +{ + __m128i __m128i_op0, __m128i_op1, __m128i_op2, __m128i_out, __m128i_result; + __m128 __m128_op0, __m128_op1, __m128_op2, __m128_out, __m128_result; + __m128d __m128d_op0, __m128d_op1, __m128d_op2, __m128d_out, __m128d_result; + + int int_op0, int_op1, int_op2, int_out, int_result, i = 1, fail; + long int long_op0, long_op1, long_op2, lont_out, lont_result; + long int long_int_out, long_int_result; + unsigned int unsigned_int_out, unsigned_int_result; + unsigned long int unsigned_long_int_out, unsigned_long_int_result; + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vexth_h_b (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x7fff000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x007fffff00000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vexth_h_b (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vexth_h_b (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vexth_h_b (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x000000000000f909; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vexth_h_b (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x000000000000ffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vexth_h_b (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffff01ff01; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vexth_h_b (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vexth_h_b (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vexth_h_b (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vexth_h_b (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vexth_h_b (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vexth_h_b (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vexth_h_b (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vexth_h_b (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vexth_h_b (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vexth_h_b (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vexth_h_b (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x1010111105050000; + *((unsigned long *)&__m128i_op0[0]) = 0x4040000041410101; + *((unsigned long *)&__m128i_result[1]) = 0x0010001000110011; + *((unsigned long *)&__m128i_result[0]) = 0x0005000500000000; + __m128i_out = __lsx_vexth_h_b (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000000000003e2; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x000000000003ffe2; + __m128i_out = __lsx_vexth_h_b (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfffffffffffffffe; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xfffffffffffffffe; + __m128i_out = __lsx_vexth_w_h (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x3ff0000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x00003ff000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vexth_w_h (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x03c0000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x03c0038000000380; + *((unsigned long *)&__m128i_result[1]) = 0x000003c000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vexth_w_h (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vexth_w_h (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xb9fe3640e4eb1b18; + *((unsigned long *)&__m128i_op0[0]) = 0x800000005b4b1b18; + *((unsigned long *)&__m128i_result[1]) = 0xffffb9fe00003640; + *((unsigned long *)&__m128i_result[0]) = 0xffffe4eb00001b18; + __m128i_out = __lsx_vexth_w_h (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x370bdfec00130014; + *((unsigned long *)&__m128i_op0[0]) = 0x370bdfec00130014; + *((unsigned long *)&__m128i_result[1]) = 0x0000370bffffdfec; + *((unsigned long *)&__m128i_result[0]) = 0x0000001300000014; + __m128i_out = __lsx_vexth_w_h (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xe500c085c000c005; + *((unsigned long *)&__m128i_op0[0]) = 0xe5c1a185c48004c5; + *((unsigned long *)&__m128i_result[1]) = 0xffffe500ffffc085; + *((unsigned long *)&__m128i_result[0]) = 0xffffc000ffffc005; + __m128i_out = __lsx_vexth_w_h (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vexth_w_h (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vexth_w_h (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000010000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vexth_d_w (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x5c9c9c9ce3636363; + *((unsigned long *)&__m128i_op0[0]) = 0x63635c9e63692363; + *((unsigned long *)&__m128i_result[1]) = 0x000000005c9c9c9c; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffe3636363; + __m128i_out = __lsx_vexth_d_w (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x63b2ac27aa076aeb; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000063b2ac27; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffaa076aeb; + __m128i_out = __lsx_vexth_d_w (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x002a001a001a000b; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x00000000002a001a; + *((unsigned long *)&__m128i_result[0]) = 0x00000000001a000b; + __m128i_out = __lsx_vexth_d_w (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vexth_q_d (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0028280000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x012927ffff272800; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0028280000000000; + __m128i_out = __lsx_vexth_q_d (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000000ff000000ff; + *((unsigned long *)&__m128i_op0[0]) = 0x0000ff0000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x000000ff000000ff; + __m128i_out = __lsx_vexth_q_d (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000005; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000005; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000005; + __m128i_out = __lsx_vexth_q_d (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vexth_q_d (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000020000020; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000020000020; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000020000020; + __m128i_out = __lsx_vexth_q_d (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x000000000000fff0; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vexth_q_d (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vexth_q_d (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfffffffffffffffc; + *((unsigned long *)&__m128i_op0[0]) = 0xfffffffffffffffc; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xfffffffffffffffc; + __m128i_out = __lsx_vexth_q_d (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vexth_q_d (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vexth_q_d (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vexth_q_d (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000080; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000080; + __m128i_out = __lsx_vexth_q_d (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x3a8000003a800000; + *((unsigned long *)&__m128i_op0[0]) = 0x000ef0000000003b; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x3a8000003a800000; + __m128i_out = __lsx_vexth_q_d (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vexth-2.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vexth-2.c new file mode 100644 index 00000000000..6ab217e979e --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vexth-2.c @@ -0,0 +1,182 @@ +/* { dg-do run } */ +/* { dg-options "-mlsx -w -fno-strict-aliasing" } */ +#include "../simd_correctness_check.h" +#include + +int +main () +{ + __m128i __m128i_op0, __m128i_op1, __m128i_op2, __m128i_out, __m128i_result; + __m128 __m128_op0, __m128_op1, __m128_op2, __m128_out, __m128_result; + __m128d __m128d_op0, __m128d_op1, __m128d_op2, __m128d_out, __m128d_result; + + int int_op0, int_op1, int_op2, int_out, int_result, i = 1, fail; + long int long_op0, long_op1, long_op2, lont_out, lont_result; + long int long_int_out, long_int_result; + unsigned int unsigned_int_out, unsigned_int_result; + unsigned long int unsigned_long_int_out, unsigned_long_int_result; + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vexth_hu_bu (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vexth_hu_bu (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vexth_hu_bu (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x4f804f804f804f80; + *((unsigned long *)&__m128i_op0[0]) = 0x4f804f804f804f80; + *((unsigned long *)&__m128i_result[1]) = 0x004f0080004f0080; + *((unsigned long *)&__m128i_result[0]) = 0x004f0080004f0080; + __m128i_out = __lsx_vexth_hu_bu (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vexth_hu_bu (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffff007f00000000; + *((unsigned long *)&__m128i_op0[0]) = 0xffff007f00000000; + *((unsigned long *)&__m128i_result[1]) = 0x00ff00ff0000007f; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vexth_hu_bu (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xfffffffffffffffa; + *((unsigned long *)&__m128i_result[1]) = 0x00ff00ff00ff00ff; + *((unsigned long *)&__m128i_result[0]) = 0x00ff00ff00ff00ff; + __m128i_out = __lsx_vexth_hu_bu (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + int_out = __lsx_vpickve2gr_b (__m128i_op0, 0x5); + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vexth_hu_bu (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x007fffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0x002cffacffacffab; + *((unsigned long *)&__m128i_result[1]) = 0x0000007f00ff00ff; + *((unsigned long *)&__m128i_result[0]) = 0x00ff00ff00ff00ff; + __m128i_out = __lsx_vexth_hu_bu (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000082020201; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000820200000201; + __m128i_out = __lsx_vexth_wu_hu (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0001000100010012; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000fec20704; + *((unsigned long *)&__m128i_result[1]) = 0x0000000100000001; + *((unsigned long *)&__m128i_result[0]) = 0x0000000100000012; + __m128i_out = __lsx_vexth_wu_hu (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x00000000ffffffff; + __m128i_out = __lsx_vexth_du_wu (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x7fffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vexth_du_wu (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vexth_du_wu (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000001000100; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vexth_du_wu (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000001000001; + *((unsigned long *)&__m128i_op0[0]) = 0x0001000100000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000001000001; + __m128i_out = __lsx_vexth_qu_du (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000b5207f80; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vexth_qu_du (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000fff7fc01; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vexth_qu_du (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0002000000020000; + *((unsigned long *)&__m128i_op0[0]) = 0x000001fc00000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0002000000020000; + __m128i_out = __lsx_vexth_qu_du (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000b4a00008808; + *((unsigned long *)&__m128i_op0[0]) = 0x0808080800000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00000b4a00008808; + __m128i_out = __lsx_vexth_qu_du (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vexth_qu_du (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000400080003fff; + *((unsigned long *)&__m128i_op0[0]) = 0x0000bc2000007e10; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000400080003fff; + __m128i_out = __lsx_vexth_qu_du (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vexth_qu_du (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vldi.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vldi.c new file mode 100644 index 00000000000..089500ea9ed --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vldi.c @@ -0,0 +1,61 @@ +/* { dg-do run } */ +/* { dg-options "-mlsx -w -fno-strict-aliasing" } */ +#include "../simd_correctness_check.h" +#include + +int +main () +{ + __m128i __m128i_op0, __m128i_op1, __m128i_op2, __m128i_out, __m128i_result; + __m128 __m128_op0, __m128_op1, __m128_op2, __m128_out, __m128_result; + __m128d __m128d_op0, __m128d_op1, __m128d_op2, __m128d_out, __m128d_result; + + int int_op0, int_op1, int_op2, int_out, int_result, i = 1, fail; + long int long_op0, long_op1, long_op2, lont_out, lont_result; + long int long_int_out, long_int_result; + unsigned int unsigned_int_out, unsigned_int_result; + unsigned long int unsigned_long_int_out, unsigned_long_int_result; + + *((unsigned long *)&__m128i_result[1]) = 0x00a300a300a300a3; + *((unsigned long *)&__m128i_result[0]) = 0x00a300a300a300a3; + __m128i_out = __lsx_vldi (1187); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_result[1]) = 0xfffffffffffffe15; + *((unsigned long *)&__m128i_result[0]) = 0xfffffffffffffe15; + __m128i_out = __lsx_vldi (3605); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_result[1]) = 0xecececececececec; + *((unsigned long *)&__m128i_result[0]) = 0xecececececececec; + __m128i_out = __lsx_vldi (1004); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_result[1]) = 0x00ffff00ff00ff00; + *((unsigned long *)&__m128i_result[0]) = 0x00ffff00ff00ff00; + __m128i_out = __lsx_vldi (-1686); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + unsigned_int_out = __lsx_vpickve2gr_hu (__m128i_op0, 0x3); + *((unsigned long *)&__m128i_result[1]) = 0x004d004d004d004d; + *((unsigned long *)&__m128i_result[0]) = 0x004d004d004d004d; + __m128i_out = __lsx_vldi (1101); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_result[1]) = 0x0a0000000a000000; + *((unsigned long *)&__m128i_result[0]) = 0x0a0000000a000000; + __m128i_out = __lsx_vldi (-3318); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_result[1]) = 0x00ffff00ff00ff00; + *((unsigned long *)&__m128i_result[0]) = 0x00ffff00ff00ff00; + __m128i_out = __lsx_vldi (-1686); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_result[1]) = 0x0a0000000a000000; + *((unsigned long *)&__m128i_result[0]) = 0x0a0000000a000000; + __m128i_out = __lsx_vldi (-3318); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmax-1.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmax-1.c new file mode 100644 index 00000000000..b0e22f955b0 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmax-1.c @@ -0,0 +1,317 @@ +/* { dg-do run } */ +/* { dg-options "-mlsx -w -fno-strict-aliasing" } */ +#include "../simd_correctness_check.h" +#include + +int +main () +{ + __m128i __m128i_op0, __m128i_op1, __m128i_op2, __m128i_out, __m128i_result; + __m128 __m128_op0, __m128_op1, __m128_op2, __m128_out, __m128_result; + __m128d __m128d_op0, __m128d_op1, __m128d_op2, __m128d_out, __m128d_result; + + int int_op0, int_op1, int_op2, int_out, int_result, i = 1, fail; + long int long_op0, long_op1, long_op2, lont_out, lont_result; + long int long_int_out, long_int_result; + unsigned int unsigned_int_out, unsigned_int_result; + unsigned long int unsigned_long_int_out, unsigned_long_int_result; + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000ffff00000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmax_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vmax_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmax_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x7fff7fff7fff7fff; + *((unsigned long *)&__m128i_op0[0]) = 0x000000010000003f; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x7f007f007f007f00; + *((unsigned long *)&__m128i_result[0]) = 0x000000010000003f; + __m128i_out = __lsx_vmax_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000001; + *((unsigned long *)&__m128i_op1[1]) = 0xfffff00010000fff; + *((unsigned long *)&__m128i_op1[0]) = 0xfffff00010000fff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000010000f00; + *((unsigned long *)&__m128i_result[0]) = 0x0000000010000f01; + __m128i_out = __lsx_vmax_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfffcfffcfffcfffd; + *((unsigned long *)&__m128i_op0[0]) = 0xfffcfffdfffcfffd; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmax_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffff80df00000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0010100000100000; + *((unsigned long *)&__m128i_op1[0]) = 0x1000100000101000; + *((unsigned long *)&__m128i_result[1]) = 0x0010100000100000; + *((unsigned long *)&__m128i_result[0]) = 0x1000100000101000; + __m128i_out = __lsx_vmax_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmax_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0040000000ff00ff; + *((unsigned long *)&__m128i_op0[0]) = 0x0040000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0040000000ff00ff; + *((unsigned long *)&__m128i_result[0]) = 0x0040000000000000; + __m128i_out = __lsx_vmax_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmax_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000001000001; + *((unsigned long *)&__m128i_op1[0]) = 0x0001000100000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000001000001; + *((unsigned long *)&__m128i_result[0]) = 0x0001000100000000; + __m128i_out = __lsx_vmax_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmax_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0xb327b9363c992b2e; + *((unsigned long *)&__m128i_op1[0]) = 0xa1e7b475d925730f; + *((unsigned long *)&__m128i_result[1]) = 0xffffffff3c992b2e; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffff730f; + __m128i_out = __lsx_vmax_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x4101010141010100; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000000001ff; + *((unsigned long *)&__m128i_result[1]) = 0x4101010141010100; + *((unsigned long *)&__m128i_result[0]) = 0x00000000000001ff; + __m128i_out = __lsx_vmax_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmax_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmax_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000000003dffc2; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000003dffc2; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x00000000003d0000; + *((unsigned long *)&__m128i_result[0]) = 0x00000000003d0000; + __m128i_out = __lsx_vmax_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmax_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0007001400000014; + *((unsigned long *)&__m128i_op0[0]) = 0x0004001000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x000000000000053a; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x000700140000053a; + *((unsigned long *)&__m128i_result[0]) = 0x0004001000000000; + __m128i_out = __lsx_vmax_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmax_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000034; + *((unsigned long *)&__m128i_op1[1]) = 0xffff80c400000148; + *((unsigned long *)&__m128i_op1[0]) = 0xffff80c1ffffe8de; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000148; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000034; + __m128i_out = __lsx_vmax_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vmax_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0008000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x00ff000000ff0000; + *((unsigned long *)&__m128i_result[1]) = 0x0008000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00ff000000ff0000; + __m128i_out = __lsx_vmax_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000a000a000a000a; + *((unsigned long *)&__m128i_op0[0]) = 0x000a000a000a000a; + *((unsigned long *)&__m128i_op1[1]) = 0x000a000a000a000a; + *((unsigned long *)&__m128i_op1[0]) = 0x000a000a000a000a; + *((unsigned long *)&__m128i_result[1]) = 0x000a000a000a000a; + *((unsigned long *)&__m128i_result[0]) = 0x000a000a000a000a; + __m128i_out = __lsx_vmax_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0xffff0000ffff0000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmax_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000b3a6000067da; + *((unsigned long *)&__m128i_op0[0]) = 0x00004e420000c26a; + *((unsigned long *)&__m128i_op1[1]) = 0xd78cfd70b5f65d76; + *((unsigned long *)&__m128i_op1[0]) = 0x5779108fdedda7e4; + *((unsigned long *)&__m128i_result[1]) = 0x0000b3a6000067da; + *((unsigned long *)&__m128i_result[0]) = 0x5779108f0000c26a; + __m128i_out = __lsx_vmax_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x30eb022002101b20; + *((unsigned long *)&__m128i_op0[0]) = 0x020310edc003023d; + *((unsigned long *)&__m128i_op1[1]) = 0x30eb020302101b03; + *((unsigned long *)&__m128i_op1[0]) = 0x020310d0c0030220; + *((unsigned long *)&__m128i_result[1]) = 0x30eb022002101b20; + *((unsigned long *)&__m128i_result[0]) = 0x020310edc003023d; + __m128i_out = __lsx_vmax_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfe03fe01fe01fe01; + *((unsigned long *)&__m128i_op0[0]) = 0xfe3bfa3ffe3bfb21; + *((unsigned long *)&__m128i_op1[1]) = 0x001d001d001d001d; + *((unsigned long *)&__m128i_op1[0]) = 0x001d001d001d0000; + *((unsigned long *)&__m128i_result[1]) = 0x001d001d001d001d; + *((unsigned long *)&__m128i_result[0]) = 0x001d001d001d0000; + __m128i_out = __lsx_vmax_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000100000155; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0xffff000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000100000155; + __m128i_out = __lsx_vmax_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmax_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmax_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000000051649b6; + *((unsigned long *)&__m128i_op0[0]) = 0xd2f005e44bb43416; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000003e0000003f; + *((unsigned long *)&__m128i_result[1]) = 0x00000000051649b6; + *((unsigned long *)&__m128i_result[0]) = 0x0000003e0000003f; + __m128i_out = __lsx_vmax_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000ebd20000714f; + *((unsigned long *)&__m128i_op1[0]) = 0x00012c8a0000a58a; + *((unsigned long *)&__m128i_result[1]) = 0x0000ebd20000714f; + *((unsigned long *)&__m128i_result[0]) = 0x00012c8a0000a58a; + __m128i_out = __lsx_vmax_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmax-2.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmax-2.c new file mode 100644 index 00000000000..51a9a92e842 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmax-2.c @@ -0,0 +1,362 @@ +/* { dg-do run } */ +/* { dg-options "-mlsx -w -fno-strict-aliasing" } */ +#include "../simd_correctness_check.h" +#include + +int +main () +{ + __m128i __m128i_op0, __m128i_op1, __m128i_op2, __m128i_out, __m128i_result; + __m128 __m128_op0, __m128_op1, __m128_op2, __m128_out, __m128_result; + __m128d __m128d_op0, __m128d_op1, __m128d_op2, __m128d_out, __m128d_result; + + int int_op0, int_op1, int_op2, int_out, int_result, i = 1, fail; + long int long_op0, long_op1, long_op2, lont_out, lont_result; + long int long_int_out, long_int_result; + unsigned int unsigned_int_out, unsigned_int_result; + unsigned long int unsigned_long_int_out, unsigned_long_int_result; + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffff80000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffff80000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmax_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000007f0000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00000000007f0000; + __m128i_out = __lsx_vmax_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmax_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffff0000ffff0000; + *((unsigned long *)&__m128i_op1[0]) = 0xffff000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffff0000ffff0000; + *((unsigned long *)&__m128i_result[0]) = 0xffff000000000000; + __m128i_out = __lsx_vmax_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x77c0404a4000403a; + *((unsigned long *)&__m128i_op0[0]) = 0x77c03fd640003fc6; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000003a0000003a; + *((unsigned long *)&__m128i_result[1]) = 0x77c0404a4000403a; + *((unsigned long *)&__m128i_result[0]) = 0x77c03fd640003fc6; + __m128i_out = __lsx_vmax_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xbafebb00ffd500fe; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xbafebb00ffd500fe; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xbafebb00ffd500fe; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmax_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x52525252adadadad; + *((unsigned long *)&__m128i_op0[0]) = 0x52525252adadadad; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0x5b5b5b5aa4a4a4a6; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x5b5b5b5aadadadad; + __m128i_out = __lsx_vmax_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xfe3bfb01fe3bfe01; + *((unsigned long *)&__m128i_op1[0]) = 0xfe03fe3ffe01fa21; + *((unsigned long *)&__m128i_result[1]) = 0xfe3bfb01fe3bfe01; + *((unsigned long *)&__m128i_result[0]) = 0xfe03fe3ffe01fa21; + __m128i_out = __lsx_vmax_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000f50000007500; + *((unsigned long *)&__m128i_op0[0]) = 0x00007e1600007d98; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000fe00fe; + *((unsigned long *)&__m128i_op1[0]) = 0x00fe00fe00fe00fe; + *((unsigned long *)&__m128i_result[1]) = 0x0000f50000fe75fe; + *((unsigned long *)&__m128i_result[0]) = 0x00fe7efe00fe7dfe; + __m128i_out = __lsx_vmax_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x9c9c9c9c00000000; + *((unsigned long *)&__m128i_op1[1]) = 0x2002040404010420; + *((unsigned long *)&__m128i_op1[0]) = 0x0101010180800101; + *((unsigned long *)&__m128i_result[1]) = 0x2002040404010420; + *((unsigned long *)&__m128i_result[0]) = 0x9c9c9c9c80800101; + __m128i_out = __lsx_vmax_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmax_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xff84fff4ff84fff4; + *((unsigned long *)&__m128i_op0[0]) = 0xfffffffffffffff0; + *((unsigned long *)&__m128i_op1[1]) = 0xff84fff4ff84fff4; + *((unsigned long *)&__m128i_op1[0]) = 0xfffffffffffffff0; + *((unsigned long *)&__m128i_result[1]) = 0xff84fff4ff84fff4; + *((unsigned long *)&__m128i_result[0]) = 0xfffffffffffffff0; + __m128i_out = __lsx_vmax_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffff0000ffff0000; + *((unsigned long *)&__m128i_op0[0]) = 0xffff0000ffff0000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000ffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0x0000ffffffdfffdf; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffdf; + __m128i_out = __lsx_vmax_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0xf001f0010101f002; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vmax_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x14ccc6320076a4d2; + *((unsigned long *)&__m128i_op1[0]) = 0x685670d27e00682a; + *((unsigned long *)&__m128i_result[1]) = 0x14ccc6320076a4d2; + *((unsigned long *)&__m128i_result[0]) = 0x685670d27e00682a; + __m128i_out = __lsx_vmax_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000000000000ff; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000000000ff; + *((unsigned long *)&__m128i_op1[1]) = 0xf6548a1747e59090; + *((unsigned long *)&__m128i_op1[0]) = 0x27b169bbb8145f50; + *((unsigned long *)&__m128i_result[1]) = 0xf6548a1747e59090; + *((unsigned long *)&__m128i_result[0]) = 0x27b169bbb8145f50; + __m128i_out = __lsx_vmax_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmax_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x8000000080000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffff80ff0010ff06; + *((unsigned long *)&__m128i_op1[0]) = 0x00007f01000eff0a; + *((unsigned long *)&__m128i_result[1]) = 0xffff80ff0010ff06; + *((unsigned long *)&__m128i_result[0]) = 0x8000000080000000; + __m128i_out = __lsx_vmax_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmax_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00007fff00007fff; + *((unsigned long *)&__m128i_op0[0]) = 0x000000002bfd9461; + *((unsigned long *)&__m128i_op1[1]) = 0x3ff0000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x3ff0000000007fff; + *((unsigned long *)&__m128i_result[0]) = 0x000000002bfd9461; + __m128i_out = __lsx_vmax_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfffff0000000ad3d; + *((unsigned long *)&__m128i_op0[0]) = 0xfffff000fffff000; + *((unsigned long *)&__m128i_op1[1]) = 0x1000100010001000; + *((unsigned long *)&__m128i_op1[0]) = 0x1000100010001000; + *((unsigned long *)&__m128i_result[1]) = 0xfffff00010001000; + *((unsigned long *)&__m128i_result[0]) = 0xfffff000fffff000; + __m128i_out = __lsx_vmax_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x000000000000001f; + *((unsigned long *)&__m128i_op1[0]) = 0x000000000000001f; + *((unsigned long *)&__m128i_result[1]) = 0x000000000000001f; + *((unsigned long *)&__m128i_result[0]) = 0x000000000000001f; + __m128i_out = __lsx_vmax_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000040; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000040; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000040; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000040; + __m128i_out = __lsx_vmax_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmax_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmax_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmax_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vmax_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmax_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000001; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vmax_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000001; + *((unsigned long *)&__m128i_op1[1]) = 0x7fffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x7fffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000001; + __m128i_out = __lsx_vmax_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xa2a2a2a3a2a2a2a3; + *((unsigned long *)&__m128i_op0[0]) = 0xc605c000aedd0000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xc605c000aedd0000; + __m128i_out = __lsx_vmax_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x09e8e9012fded7fd; + *((unsigned long *)&__m128i_op1[0]) = 0x479f64b03373df61; + *((unsigned long *)&__m128i_result[1]) = 0x09e8e9012fded7fd; + *((unsigned long *)&__m128i_result[0]) = 0x479f64b03373df61; + __m128i_out = __lsx_vmax_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmax_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000005; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000005; + __m128i_out = __lsx_vmax_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmax_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x52525252adadadad; + *((unsigned long *)&__m128i_op1[0]) = 0x52525252adadadad; + *((unsigned long *)&__m128i_result[1]) = 0x52525252adadadad; + *((unsigned long *)&__m128i_result[0]) = 0x52525252adadadad; + __m128i_out = __lsx_vmax_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0808080700000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0808080808080808; + *((unsigned long *)&__m128i_op1[1]) = 0x3fff3fff3fff3fff; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x3fff3fff3fff3fff; + *((unsigned long *)&__m128i_result[0]) = 0x0808080808080808; + __m128i_out = __lsx_vmax_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000202020200; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000100; + *((unsigned long *)&__m128i_result[1]) = 0x0000000202020200; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000100; + __m128i_out = __lsx_vmax_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmaxi-1.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmaxi-1.c new file mode 100644 index 00000000000..7cff1d848b8 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmaxi-1.c @@ -0,0 +1,279 @@ +/* { dg-do run } */ +/* { dg-options "-mlsx -w -fno-strict-aliasing" } */ +#include "../simd_correctness_check.h" +#include + +int +main () +{ + __m128i __m128i_op0, __m128i_op1, __m128i_op2, __m128i_out, __m128i_result; + __m128 __m128_op0, __m128_op1, __m128_op2, __m128_out, __m128_result; + __m128d __m128d_op0, __m128d_op1, __m128d_op2, __m128d_out, __m128d_result; + + int int_op0, int_op1, int_op2, int_out, int_result, i = 1, fail; + long int long_op0, long_op1, long_op2, lont_out, lont_result; + long int long_int_out, long_int_result; + unsigned int unsigned_int_out, unsigned_int_result; + unsigned long int unsigned_long_int_out, unsigned_long_int_result; + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0a0a0a0a0a0a0a0a; + *((unsigned long *)&__m128i_result[0]) = 0x0a0a0a0a0a0a0a0a; + __m128i_out = __lsx_vmaxi_b (__m128i_op0, 10); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmaxi_b (__m128i_op0, -7); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x1000100010001000; + *((unsigned long *)&__m128i_op0[0]) = 0x1000100010001000; + *((unsigned long *)&__m128i_result[1]) = 0x1000100010001000; + *((unsigned long *)&__m128i_result[0]) = 0x1000100010001000; + __m128i_out = __lsx_vmaxi_b (__m128i_op0, -10); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x000000003be14000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x000000003bfb4000; + __m128i_out = __lsx_vmaxi_b (__m128i_op0, -5); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0b0b0b0b0b0b0b0b; + *((unsigned long *)&__m128i_result[0]) = 0x0b0b0b0b0b0b0b0b; + __m128i_out = __lsx_vmaxi_b (__m128i_op0, 11); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x000000007ffffffb; + *((unsigned long *)&__m128i_result[1]) = 0x0101010101010101; + *((unsigned long *)&__m128i_result[0]) = 0x010101017f010101; + __m128i_out = __lsx_vmaxi_b (__m128i_op0, 1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000000000007f8; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000000007f8; + *((unsigned long *)&__m128i_result[1]) = 0x0b0b0b0b0b0b0b0b; + *((unsigned long *)&__m128i_result[0]) = 0x0b0b0b0b0b0b0b0b; + __m128i_out = __lsx_vmaxi_b (__m128i_op0, 11); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x000000000000000c; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x000000000000000c; + __m128i_out = __lsx_vmaxi_b (__m128i_op0, -7); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0001000100010001; + *((unsigned long *)&__m128i_op0[0]) = 0x0001000100010001; + *((unsigned long *)&__m128i_result[1]) = 0x0001000100010001; + *((unsigned long *)&__m128i_result[0]) = 0x0001000100010001; + __m128i_out = __lsx_vmaxi_b (__m128i_op0, 0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0606060606060606; + *((unsigned long *)&__m128i_result[0]) = 0x0606060606060606; + __m128i_out = __lsx_vmaxi_b (__m128i_op0, 6); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0fffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0fffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmaxi_b (__m128i_op0, -16); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmaxi_h (__m128i_op0, -1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmaxi_h (__m128i_op0, -11); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x027c027c000027c0; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x027c027c000027c0; + __m128i_out = __lsx_vmaxi_h (__m128i_op0, -6); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0002000000020000; + *((unsigned long *)&__m128i_op0[0]) = 0x000001fc00000000; + *((unsigned long *)&__m128i_result[1]) = 0x0002000000020000; + *((unsigned long *)&__m128i_result[0]) = 0x000001fc00000000; + __m128i_out = __lsx_vmaxi_h (__m128i_op0, -7); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000fff; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000fff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000fff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000fff; + __m128i_out = __lsx_vmaxi_h (__m128i_op0, -14); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000000007ff000ff; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000a1ff4c; + *((unsigned long *)&__m128i_result[1]) = 0x000300037ff000ff; + *((unsigned long *)&__m128i_result[0]) = 0x0003000300a10003; + __m128i_out = __lsx_vmaxi_h (__m128i_op0, 3); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmaxi_h (__m128i_op0, -2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000002; + *((unsigned long *)&__m128i_result[1]) = 0x000b000b000b000b; + *((unsigned long *)&__m128i_result[0]) = 0x000b000b000b000b; + __m128i_out = __lsx_vmaxi_h (__m128i_op0, 11); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0004000400040004; + *((unsigned long *)&__m128i_result[0]) = 0x0004000400040004; + __m128i_out = __lsx_vmaxi_h (__m128i_op0, 4); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfe07e5fefefdddfe; + *((unsigned long *)&__m128i_op0[0]) = 0x00020100fedd0c00; + *((unsigned long *)&__m128i_result[1]) = 0x0000000b0000000b; + *((unsigned long *)&__m128i_result[0]) = 0x000201000000000b; + __m128i_out = __lsx_vmaxi_w (__m128i_op0, 11); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000001000001; + *((unsigned long *)&__m128i_op0[0]) = 0x0001000100000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000401000001; + *((unsigned long *)&__m128i_result[0]) = 0x0001000100000004; + __m128i_out = __lsx_vmaxi_w (__m128i_op0, 4); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmaxi_w (__m128i_op0, -10); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000000000000006f; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000001f0a; + *((unsigned long *)&__m128i_result[1]) = 0x000000000000006f; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000001f0a; + __m128i_out = __lsx_vmaxi_w (__m128i_op0, -12); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000000000000007b; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x000000050000007b; + *((unsigned long *)&__m128i_result[0]) = 0x0000000500000005; + __m128i_out = __lsx_vmaxi_w (__m128i_op0, 5); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000400000004; + *((unsigned long *)&__m128i_result[0]) = 0x0000000400000004; + __m128i_out = __lsx_vmaxi_w (__m128i_op0, 4); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x001fffff001fffff; + *((unsigned long *)&__m128i_op0[0]) = 0x001fffff001fffff; + *((unsigned long *)&__m128i_result[1]) = 0x001fffff001fffff; + *((unsigned long *)&__m128i_result[0]) = 0x001fffff001fffff; + __m128i_out = __lsx_vmaxi_w (__m128i_op0, -7); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000b0000000b; + *((unsigned long *)&__m128i_result[0]) = 0x0000000b0000000b; + __m128i_out = __lsx_vmaxi_w (__m128i_op0, 11); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000e0000000e; + *((unsigned long *)&__m128i_result[0]) = 0x0000000e0000000e; + __m128i_out = __lsx_vmaxi_w (__m128i_op0, 14); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000020; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000900000020; + *((unsigned long *)&__m128i_result[0]) = 0x0000000900000009; + __m128i_out = __lsx_vmaxi_w (__m128i_op0, 9); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x9c9c9c9c9c9c9c9c; + *((unsigned long *)&__m128i_op0[0]) = 0x9c9c9c9c9c9c9c9c; + *((unsigned long *)&__m128i_result[1]) = 0x0000000600000006; + *((unsigned long *)&__m128i_result[0]) = 0x0000000600000006; + __m128i_out = __lsx_vmaxi_w (__m128i_op0, 6); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x7f80000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x7f80000000000007; + *((unsigned long *)&__m128i_result[0]) = 0x0000000700000007; + __m128i_out = __lsx_vmaxi_w (__m128i_op0, 7); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000002; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000002; + __m128i_out = __lsx_vmaxi_d (__m128i_op0, 2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000007f00; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000001000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000007f00; + *((unsigned long *)&__m128i_result[0]) = 0x0000000001000000; + __m128i_out = __lsx_vmaxi_d (__m128i_op0, -4); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfff489b693120950; + *((unsigned long *)&__m128i_op0[0]) = 0xfffc45a851c40c18; + *((unsigned long *)&__m128i_result[1]) = 0x000000000000000a; + *((unsigned long *)&__m128i_result[0]) = 0x000000000000000a; + __m128i_out = __lsx_vmaxi_d (__m128i_op0, 10); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmaxi_d (__m128i_op0, -5); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x63636b6afe486741; + *((unsigned long *)&__m128i_op0[0]) = 0x41f8e880ffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x63636b6afe486741; + *((unsigned long *)&__m128i_result[0]) = 0x41f8e880ffffffff; + __m128i_out = __lsx_vmaxi_d (__m128i_op0, -2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmaxi-2.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmaxi-2.c new file mode 100644 index 00000000000..b79af2228e8 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmaxi-2.c @@ -0,0 +1,223 @@ +/* { dg-do run } */ +/* { dg-options "-mlsx -w -fno-strict-aliasing" } */ +#include "../simd_correctness_check.h" +#include + +int +main () +{ + __m128i __m128i_op0, __m128i_op1, __m128i_op2, __m128i_out, __m128i_result; + __m128 __m128_op0, __m128_op1, __m128_op2, __m128_out, __m128_result; + __m128d __m128d_op0, __m128d_op1, __m128d_op2, __m128d_out, __m128d_result; + + int int_op0, int_op1, int_op2, int_out, int_result, i = 1, fail; + long int long_op0, long_op1, long_op2, lont_out, lont_result; + long int long_int_out, long_int_result; + unsigned int unsigned_int_out, unsigned_int_result; + unsigned long int unsigned_long_int_out, unsigned_long_int_result; + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000020002; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000020002; + *((unsigned long *)&__m128i_result[1]) = 0x0303030303030303; + *((unsigned long *)&__m128i_result[0]) = 0x0303030303030303; + __m128i_out = __lsx_vmaxi_bu (__m128i_op0, 0x3); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x1111111111111111; + *((unsigned long *)&__m128i_result[0]) = 0x1111111111111111; + __m128i_out = __lsx_vmaxi_bu (__m128i_op0, 0x11); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x1111111111111111; + *((unsigned long *)&__m128i_result[0]) = 0x1111111111111111; + __m128i_out = __lsx_vmaxi_bu (__m128i_op0, 0x11); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0a0a0a0a0a0a0a0a; + *((unsigned long *)&__m128i_result[0]) = 0x0a0a0a0a0a0a0a0a; + __m128i_out = __lsx_vmaxi_bu (__m128i_op0, 0xa); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x0011001100110011; + __m128i_out = __lsx_vmaxi_hu (__m128i_op0, 0x11); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x11000f2010000e20; + *((unsigned long *)&__m128i_op0[0]) = 0x0f000d200e000c20; + *((unsigned long *)&__m128i_result[1]) = 0x11000f2010000e20; + *((unsigned long *)&__m128i_result[0]) = 0x0f000d200e000c20; + __m128i_out = __lsx_vmaxi_hu (__m128i_op0, 0xb); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x001ffff0003ffff0; + *((unsigned long *)&__m128i_op0[0]) = 0x000fffefffefffef; + *((unsigned long *)&__m128i_result[1]) = 0x001ffff0003ffff0; + *((unsigned long *)&__m128i_result[0]) = 0x000fffefffefffef; + __m128i_out = __lsx_vmaxi_hu (__m128i_op0, 0x6); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0005000500050005; + *((unsigned long *)&__m128i_result[0]) = 0x0005000500050005; + __m128i_out = __lsx_vmaxi_hu (__m128i_op0, 0x5); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000020000020; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000020000020; + *((unsigned long *)&__m128i_result[1]) = 0x001d001d20000020; + *((unsigned long *)&__m128i_result[0]) = 0x001d001d20000020; + __m128i_out = __lsx_vmaxi_hu (__m128i_op0, 0x1d); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00003fff00010000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x00123fff00120012; + *((unsigned long *)&__m128i_result[0]) = 0x0012001200120012; + __m128i_out = __lsx_vmaxi_hu (__m128i_op0, 0x12); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x001a001a001a001a; + *((unsigned long *)&__m128i_result[0]) = 0x001a001a001a001a; + __m128i_out = __lsx_vmaxi_hu (__m128i_op0, 0x1a); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x001e001e001e001e; + *((unsigned long *)&__m128i_result[0]) = 0x001e001e001e001e; + __m128i_out = __lsx_vmaxi_hu (__m128i_op0, 0x1e); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x001d001d001d001d; + *((unsigned long *)&__m128i_result[0]) = 0x001d001d001d001d; + __m128i_out = __lsx_vmaxi_hu (__m128i_op0, 0x1d); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000800000008; + *((unsigned long *)&__m128i_result[0]) = 0x0000000800000008; + __m128i_out = __lsx_vmaxi_wu (__m128i_op0, 0x8); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000001600000016; + *((unsigned long *)&__m128i_result[0]) = 0x0000001600000016; + __m128i_out = __lsx_vmaxi_wu (__m128i_op0, 0x16); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vmaxi_wu (__m128i_op0, 0xf); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfffffacdb6dbecac; + *((unsigned long *)&__m128i_op0[0]) = 0x1f5533a694f902c0; + *((unsigned long *)&__m128i_result[1]) = 0xfffffacdb6dbecac; + *((unsigned long *)&__m128i_result[0]) = 0x1f5533a694f902c0; + __m128i_out = __lsx_vmaxi_wu (__m128i_op0, 0xd); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x37c0001000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x37c0001000000000; + *((unsigned long *)&__m128i_result[1]) = 0x37c0001000000001; + *((unsigned long *)&__m128i_result[0]) = 0x37c0001000000001; + __m128i_out = __lsx_vmaxi_wu (__m128i_op0, 0x1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0010001000100010; + *((unsigned long *)&__m128i_op0[0]) = 0x0010001000100010; + *((unsigned long *)&__m128i_result[1]) = 0x0010001000100010; + *((unsigned long *)&__m128i_result[0]) = 0x0010001000100010; + __m128i_out = __lsx_vmaxi_wu (__m128i_op0, 0x1a); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xbf8000000000ffff; + *((unsigned long *)&__m128i_op0[0]) = 0xcf00000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xbf8000000000ffff; + *((unsigned long *)&__m128i_result[0]) = 0xcf00000000000000; + __m128i_out = __lsx_vmaxi_du (__m128i_op0, 0x16); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000011; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000011; + __m128i_out = __lsx_vmaxi_du (__m128i_op0, 0x11); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x000000000000001c; + *((unsigned long *)&__m128i_result[0]) = 0x000000000000001c; + __m128i_out = __lsx_vmaxi_du (__m128i_op0, 0x1c); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x000000000000000d; + *((unsigned long *)&__m128i_result[0]) = 0x000000000000000d; + __m128i_out = __lsx_vmaxi_du (__m128i_op0, 0xd); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x000000000000000b; + *((unsigned long *)&__m128i_result[0]) = 0x000000000000000b; + __m128i_out = __lsx_vmaxi_du (__m128i_op0, 0xb); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x43d3e0000013e000; + *((unsigned long *)&__m128i_op0[0]) = 0x43d3e0000013e000; + *((unsigned long *)&__m128i_result[1]) = 0x43d3e0000013e000; + *((unsigned long *)&__m128i_result[0]) = 0x43d3e0000013e000; + __m128i_out = __lsx_vmaxi_du (__m128i_op0, 0xf); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000100010001007c; + *((unsigned long *)&__m128i_op0[0]) = 0x0001000100010001; + *((unsigned long *)&__m128i_result[1]) = 0x000100010001007c; + *((unsigned long *)&__m128i_result[0]) = 0x0001000100010001; + __m128i_out = __lsx_vmaxi_du (__m128i_op0, 0x1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x000000000000001d; + *((unsigned long *)&__m128i_result[0]) = 0x000000000000001d; + __m128i_out = __lsx_vmaxi_du (__m128i_op0, 0x1d); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x000000000000001b; + *((unsigned long *)&__m128i_result[0]) = 0x000000000000001b; + __m128i_out = __lsx_vmaxi_du (__m128i_op0, 0x1b); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000004; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000004; + __m128i_out = __lsx_vmaxi_du (__m128i_op0, 0x4); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmin-1.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmin-1.c new file mode 100644 index 00000000000..b2a7a35bdbd --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmin-1.c @@ -0,0 +1,434 @@ +/* { dg-do run } */ +/* { dg-options "-mlsx -w -fno-strict-aliasing" } */ +#include "../simd_correctness_check.h" +#include + +int +main () +{ + __m128i __m128i_op0, __m128i_op1, __m128i_op2, __m128i_out, __m128i_result; + __m128 __m128_op0, __m128_op1, __m128_op2, __m128_out, __m128_result; + __m128d __m128d_op0, __m128d_op1, __m128d_op2, __m128d_out, __m128d_result; + + int int_op0, int_op1, int_op2, int_out, int_result, i = 1, fail; + long int long_op0, long_op1, long_op2, lont_out, lont_result; + long int long_int_out, long_int_result; + unsigned int unsigned_int_out, unsigned_int_result; + unsigned long int unsigned_long_int_out, unsigned_long_int_result; + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmin_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000ff000000ff00; + *((unsigned long *)&__m128i_op1[1]) = 0x3fffff0000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x3fffff0000000000; + *((unsigned long *)&__m128i_result[1]) = 0x00ffff0000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00ffff000000ff00; + __m128i_out = __lsx_vmin_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000ff91fffffff5; + *((unsigned long *)&__m128i_op0[0]) = 0xffff00650001ffb0; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_op1[0]) = 0x0000067400002685; + *((unsigned long *)&__m128i_result[1]) = 0x0000ff91fffffff5; + *((unsigned long *)&__m128i_result[0]) = 0xffff00650000ff85; + __m128i_out = __lsx_vmin_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x00000001ca02f854; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000100013fa0; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffcafff8ff; + *((unsigned long *)&__m128i_result[0]) = 0x00000000000000a0; + __m128i_out = __lsx_vmin_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmin_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmin_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x7f8000007f800000; + *((unsigned long *)&__m128i_op0[0]) = 0x7f8000008680f1ff; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0xff80ffffff80ffff; + *((unsigned long *)&__m128i_result[0]) = 0xff80ffff8680f1ff; + __m128i_out = __lsx_vmin_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xff00e400ff00e400; + *((unsigned long *)&__m128i_op0[0]) = 0xff01e41ffff0e440; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0xffffe4ffffffe4ff; + *((unsigned long *)&__m128i_result[0]) = 0xffffe4fffff0e4ff; + __m128i_out = __lsx_vmin_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmin_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000100000000; + *((unsigned long *)&__m128i_op1[1]) = 0x00000000a16316b0; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000063636363; + *((unsigned long *)&__m128i_result[1]) = 0x00000000a1630000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmin_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffc0ff81000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000002000000020; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000600000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffc0ff81000000; + __m128i_out = __lsx_vmin_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000401000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000080000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000080000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmin_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmin_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x7fffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000001; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vmin_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x00fdffffffffff02; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0xfe80000000000001; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xfe80ffffffffff02; + __m128i_out = __lsx_vmin_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xfe80ffffffffff02; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x027e0000000000ff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xfe80ffffffffff02; + __m128i_out = __lsx_vmin_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vmin_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmin_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmin_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmin_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000ffff0000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffe0000000; + *((unsigned long *)&__m128i_result[1]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffe0000000; + __m128i_out = __lsx_vmin_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfff0000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xfff0000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xc0b4d1a5f8babad3; + *((unsigned long *)&__m128i_op1[0]) = 0xbbc8ecc5f3ced5f3; + *((unsigned long *)&__m128i_result[1]) = 0xc0b4d1a5f8babad3; + *((unsigned long *)&__m128i_result[0]) = 0xbbc8ecc5f3ced5f3; + __m128i_out = __lsx_vmin_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfffffffffffbfffc; + *((unsigned long *)&__m128i_op0[0]) = 0xc090380000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xfffffffffffbfffc; + *((unsigned long *)&__m128i_op1[0]) = 0xc090380000000000; + *((unsigned long *)&__m128i_result[1]) = 0xfffffffffffbfffc; + *((unsigned long *)&__m128i_result[0]) = 0xc090380000000000; + __m128i_out = __lsx_vmin_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmin_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000200000000; + *((unsigned long *)&__m128i_op1[1]) = 0x8493941335f5cc0c; + *((unsigned long *)&__m128i_op1[0]) = 0x625a7312befcb21e; + *((unsigned long *)&__m128i_result[1]) = 0x8493941300000000; + *((unsigned long *)&__m128i_result[0]) = 0x00000002befcb21e; + __m128i_out = __lsx_vmin_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vmin_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x000000000000000d; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000078c00000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x000000000000000d; + __m128i_out = __lsx_vmin_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000a000a000a000a; + *((unsigned long *)&__m128i_op0[0]) = 0x000a000a000a000a; + *((unsigned long *)&__m128i_op1[1]) = 0x000a000a000a000a; + *((unsigned long *)&__m128i_op1[0]) = 0x000a000a000a000a; + *((unsigned long *)&__m128i_result[1]) = 0x000a000a000a000a; + *((unsigned long *)&__m128i_result[0]) = 0x000a000a000a000a; + __m128i_out = __lsx_vmin_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmin_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xa2a2a2a3a2a2a2a3; + *((unsigned long *)&__m128i_op0[0]) = 0xc605c000aedd0000; + *((unsigned long *)&__m128i_op1[1]) = 0x5d5d5d5d5d5d5d5d; + *((unsigned long *)&__m128i_op1[0]) = 0x5d5d5d5d5d5d0000; + *((unsigned long *)&__m128i_result[1]) = 0xa2a2a2a3a2a2a2a3; + *((unsigned long *)&__m128i_result[0]) = 0xc605c000aedd0000; + __m128i_out = __lsx_vmin_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x000003000000d613; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000c0000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00000000c0000000; + __m128i_out = __lsx_vmin_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmin_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000000200000001b; + *((unsigned long *)&__m128i_op0[0]) = 0x0000002000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmin_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xff800000ff800000; + *((unsigned long *)&__m128i_op1[0]) = 0xff800000ff800000; + *((unsigned long *)&__m128i_result[1]) = 0xff800000ff800000; + *((unsigned long *)&__m128i_result[0]) = 0xff800000ff800000; + __m128i_out = __lsx_vmin_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000000017fff9000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000210011084; + *((unsigned long *)&__m128i_op1[1]) = 0x000000017fff9000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000210011084; + *((unsigned long *)&__m128i_result[1]) = 0x000000017fff9000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000210011084; + __m128i_out = __lsx_vmin_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000017f0a82; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmin_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x5a5a5a5a5b5a5b5a; + *((unsigned long *)&__m128i_op0[0]) = 0x5a5a5a5a5b5a5b5a; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmin_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x027c027c000027c0; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x027c027c000027c0; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x027c027c000027c0; + __m128i_out = __lsx_vmin_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmin_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vmin_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000010000000100; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmin_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x3e25c8317394dae6; + *((unsigned long *)&__m128i_op0[0]) = 0xcda585aebbb2836a; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xcda585aebbb2836a; + __m128i_out = __lsx_vmin_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x98147a504d145000; + *((unsigned long *)&__m128i_op0[0]) = 0x377b810912c0e000; + *((unsigned long *)&__m128i_op1[1]) = 0x98147a504d145000; + *((unsigned long *)&__m128i_op1[0]) = 0x377b810912c0e000; + *((unsigned long *)&__m128i_result[1]) = 0x98147a504d145000; + *((unsigned long *)&__m128i_result[0]) = 0x377b810912c0e000; + __m128i_out = __lsx_vmin_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000005; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xfcfcfcfcfcfcfcfd; + *((unsigned long *)&__m128i_op1[0]) = 0xfcfcfcfcfcfcfcfd; + *((unsigned long *)&__m128i_result[1]) = 0xfcfcfcfcfcfcfcfd; + *((unsigned long *)&__m128i_result[0]) = 0xfcfcfcfcfcfcfcfd; + __m128i_out = __lsx_vmin_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0xd3259a2984048c23; + *((unsigned long *)&__m128i_op1[0]) = 0xf9796558e39953fd; + *((unsigned long *)&__m128i_result[1]) = 0xd3259a2984048c23; + *((unsigned long *)&__m128i_result[0]) = 0xf9796558e39953fd; + __m128i_out = __lsx_vmin_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffff00ff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffff00ff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vmin_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmin-2.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmin-2.c new file mode 100644 index 00000000000..c90cae75e45 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmin-2.c @@ -0,0 +1,344 @@ +/* { dg-do run } */ +/* { dg-options "-mlsx -w -fno-strict-aliasing" } */ +#include "../simd_correctness_check.h" +#include + +int +main () +{ + __m128i __m128i_op0, __m128i_op1, __m128i_op2, __m128i_out, __m128i_result; + __m128 __m128_op0, __m128_op1, __m128_op2, __m128_out, __m128_result; + __m128d __m128d_op0, __m128d_op1, __m128d_op2, __m128d_out, __m128d_result; + + int int_op0, int_op1, int_op2, int_out, int_result, i = 1, fail; + long int long_op0, long_op1, long_op2, lont_out, lont_result; + long int long_int_out, long_int_result; + unsigned int unsigned_int_out, unsigned_int_result; + unsigned long int unsigned_long_int_out, unsigned_long_int_result; + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmin_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmin_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vmin_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmin_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmin_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000300000001; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000100010001; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmin_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xfffe0004fffe0004; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmin_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xd3259a2984048c23; + *((unsigned long *)&__m128i_op0[0]) = 0xf9796558e39953fd; + *((unsigned long *)&__m128i_op1[1]) = 0xd3259a2984048c23; + *((unsigned long *)&__m128i_op1[0]) = 0xf9796558e39953fd; + *((unsigned long *)&__m128i_result[1]) = 0xd3259a2984048c23; + *((unsigned long *)&__m128i_result[0]) = 0xf9796558e39953fd; + __m128i_out = __lsx_vmin_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xf6548a1747e59090; + *((unsigned long *)&__m128i_op0[0]) = 0x27b169bbb8145f50; + *((unsigned long *)&__m128i_op1[1]) = 0xf6548a1747e59090; + *((unsigned long *)&__m128i_op1[0]) = 0x27b169bbb8145f50; + *((unsigned long *)&__m128i_result[1]) = 0xf6548a1747e59090; + *((unsigned long *)&__m128i_result[0]) = 0x27b169bbb8145f50; + __m128i_out = __lsx_vmin_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x9c9c9c9c9c9c9c9c; + *((unsigned long *)&__m128i_op0[0]) = 0x9c9c9c9c63636363; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x9c9c9c9c00000000; + __m128i_out = __lsx_vmin_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmin_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x2020202020202020; + *((unsigned long *)&__m128i_op0[0]) = 0x2020202020207f7f; + *((unsigned long *)&__m128i_op1[1]) = 0x000000000000003f; + *((unsigned long *)&__m128i_op1[0]) = 0x7f417f417f027e03; + *((unsigned long *)&__m128i_result[1]) = 0x000000000000003f; + *((unsigned long *)&__m128i_result[0]) = 0x2020202020207e03; + __m128i_out = __lsx_vmin_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00008d3200000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x09e8e9012fded7fd; + *((unsigned long *)&__m128i_op1[0]) = 0x479f64b03373df61; + *((unsigned long *)&__m128i_result[1]) = 0x00008d3200000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmin_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0c0b0a090b0a0908; + *((unsigned long *)&__m128i_op0[0]) = 0x0a09080709080706; + *((unsigned long *)&__m128i_op1[1]) = 0x0c0b0a090b0a0908; + *((unsigned long *)&__m128i_op1[0]) = 0x0a09080709080706; + *((unsigned long *)&__m128i_result[1]) = 0x0c0b0a090b0a0908; + *((unsigned long *)&__m128i_result[0]) = 0x0a09080709080706; + __m128i_out = __lsx_vmin_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmin_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xa87745dbd93e4ea1; + *((unsigned long *)&__m128i_op1[0]) = 0xaa49601e26d39860; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmin_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x5252525252525252; + *((unsigned long *)&__m128i_op0[0]) = 0x5252525252525252; + *((unsigned long *)&__m128i_op1[1]) = 0x2006454690d3de87; + *((unsigned long *)&__m128i_op1[0]) = 0x2006454690d3de87; + *((unsigned long *)&__m128i_result[1]) = 0x2006454652525252; + *((unsigned long *)&__m128i_result[0]) = 0x2006454652525252; + __m128i_out = __lsx_vmin_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmin_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000040100; + *((unsigned long *)&__m128i_op0[0]) = 0x0001000100010000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffe000ffff2382; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000040100; + *((unsigned long *)&__m128i_result[0]) = 0x0001000100010000; + __m128i_out = __lsx_vmin_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x03574e3a62407e03; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000001010000; + *((unsigned long *)&__m128i_op1[1]) = 0x7da9b23a624082fd; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000ffff0000; + *((unsigned long *)&__m128i_result[1]) = 0x03574e3a62407e03; + *((unsigned long *)&__m128i_result[0]) = 0x0000000001010000; + __m128i_out = __lsx_vmin_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0505050505050505; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000005050000; + *((unsigned long *)&__m128i_op1[1]) = 0x0028280000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0028280000282800; + *((unsigned long *)&__m128i_result[1]) = 0x0028280000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000282800; + __m128i_out = __lsx_vmin_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmin_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfc01fd13fc02fe0c; + *((unsigned long *)&__m128i_op0[0]) = 0xfe00fd14fe01fd16; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffff00000001; + *((unsigned long *)&__m128i_op1[0]) = 0xffffff0000010000; + *((unsigned long *)&__m128i_result[1]) = 0xfc01fd1300000001; + *((unsigned long *)&__m128i_result[0]) = 0xfe00fd1400010000; + __m128i_out = __lsx_vmin_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000001ca02f854; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000100013fa0; + *((unsigned long *)&__m128i_op1[1]) = 0x2000200020002000; + *((unsigned long *)&__m128i_op1[0]) = 0x2000200020002000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000120002000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000100013fa0; + __m128i_out = __lsx_vmin_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000ffff00000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000014; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmin_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x000000000005003a; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmin_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xcd636363cd636363; + *((unsigned long *)&__m128i_op0[0]) = 0xcd636363cd636363; + *((unsigned long *)&__m128i_op1[1]) = 0x86dd8341b164f12b; + *((unsigned long *)&__m128i_op1[0]) = 0x9611c3985b3159f5; + *((unsigned long *)&__m128i_result[1]) = 0x86dd8341b164f12b; + *((unsigned long *)&__m128i_result[0]) = 0x9611c3985b3159f5; + __m128i_out = __lsx_vmin_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmin_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x3ff0000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmin_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000de0000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000001f0a; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000006f00000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000001f0a; + __m128i_out = __lsx_vmin_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0001000100010001; + *((unsigned long *)&__m128i_op0[0]) = 0x0001000100010001; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmin_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000fea0000fffe; + *((unsigned long *)&__m128i_op0[0]) = 0xff0cff78ff96ff14; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmin_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffff007fff810001; + *((unsigned long *)&__m128i_op0[0]) = 0x000400530050ffa6; + *((unsigned long *)&__m128i_op1[1]) = 0xff7f810100001000; + *((unsigned long *)&__m128i_op1[0]) = 0x001fffc0ffffe001; + *((unsigned long *)&__m128i_result[1]) = 0xff7f810100001000; + *((unsigned long *)&__m128i_result[0]) = 0x000400530050ffa6; + __m128i_out = __lsx_vmin_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmin_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x00007efe7f7f8000; + *((unsigned long *)&__m128i_op1[1]) = 0x00000000b81c8382; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000077af9450; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000077af9450; + __m128i_out = __lsx_vmin_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmin_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmini-1.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmini-1.c new file mode 100644 index 00000000000..772d040c3b2 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmini-1.c @@ -0,0 +1,314 @@ +/* { dg-do run } */ +/* { dg-options "-mlsx -w -fno-strict-aliasing" } */ +#include "../simd_correctness_check.h" +#include + +int +main () +{ + __m128i __m128i_op0, __m128i_op1, __m128i_op2, __m128i_out, __m128i_result; + __m128 __m128_op0, __m128_op1, __m128_op2, __m128_out, __m128_result; + __m128d __m128d_op0, __m128d_op1, __m128d_op2, __m128d_out, __m128d_result; + + int int_op0, int_op1, int_op2, int_out, int_result, i = 1, fail; + long int long_op0, long_op1, long_op2, lont_out, lont_result; + long int long_int_out, long_int_result; + unsigned int unsigned_int_out, unsigned_int_result; + unsigned long int unsigned_long_int_out, unsigned_long_int_result; + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xfffefffefffffffc; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xfffefffefffffffc; + __m128i_out = __lsx_vmini_b (__m128i_op0, 4); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000006f00002f0a; + *((unsigned long *)&__m128i_op0[0]) = 0x0000958aefff895e; + *((unsigned long *)&__m128i_result[1]) = 0xfafafafafafafafa; + *((unsigned long *)&__m128i_result[0]) = 0xfafa958aeffa89fa; + __m128i_out = __lsx_vmini_b (__m128i_op0, -6); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vmini_b (__m128i_op0, 1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000000adadadad; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000adadadad; + *((unsigned long *)&__m128i_result[1]) = 0xfbfbfbfbadadadad; + *((unsigned long *)&__m128i_result[0]) = 0xfbfbfbfbadadadad; + __m128i_out = __lsx_vmini_b (__m128i_op0, -5); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmini_b (__m128i_op0, 12); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000202020200; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000100; + *((unsigned long *)&__m128i_result[1]) = 0x0000000202020200; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000100; + __m128i_out = __lsx_vmini_b (__m128i_op0, 5); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xf1f1f1f1f1f1f1f1; + *((unsigned long *)&__m128i_result[0]) = 0xf1f1f1f1f1f1f1f1; + __m128i_out = __lsx_vmini_b (__m128i_op0, -15); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000f50000007500; + *((unsigned long *)&__m128i_op0[0]) = 0x00007e1600007d98; + *((unsigned long *)&__m128i_result[1]) = 0x0000f50000000900; + *((unsigned long *)&__m128i_result[0]) = 0x0000090900000998; + __m128i_out = __lsx_vmini_b (__m128i_op0, 9); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x10f881a20ffd02b0; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000ff800000; + *((unsigned long *)&__m128i_result[1]) = 0xf1f181a2f1f1f1b0; + *((unsigned long *)&__m128i_result[0]) = 0xf1f1f1f1f180f1f1; + __m128i_out = __lsx_vmini_b (__m128i_op0, -15); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xfff6fff6fff6fff6; + *((unsigned long *)&__m128i_result[0]) = 0xfff6fff6fff6fff6; + __m128i_out = __lsx_vmini_h (__m128i_op0, -10); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x1716151416151413; + *((unsigned long *)&__m128i_op0[0]) = 0x1514131214131211; + *((unsigned long *)&__m128i_result[1]) = 0xfff3fff3fff3fff3; + *((unsigned long *)&__m128i_result[0]) = 0xfff3fff3fff3fff3; + __m128i_out = __lsx_vmini_h (__m128i_op0, -13); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfefefefefefefefe; + *((unsigned long *)&__m128i_op0[0]) = 0xfefefefefefefefe; + *((unsigned long *)&__m128i_result[1]) = 0xfefefefefefefefe; + *((unsigned long *)&__m128i_result[0]) = 0xfefefefefefefefe; + __m128i_out = __lsx_vmini_h (__m128i_op0, 2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmini_h (__m128i_op0, 3); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmini_h (__m128i_op0, 11); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmini_h (__m128i_op0, 3); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xfffffff4fffffff4; + *((unsigned long *)&__m128i_result[0]) = 0xfffffff4fffffff4; + __m128i_out = __lsx_vmini_w (__m128i_op0, -12); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmini_w (__m128i_op0, 1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmini_w (__m128i_op0, 0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0xfffffff3fffffff3; + *((unsigned long *)&__m128i_result[0]) = 0xfffffff3fffffff3; + __m128i_out = __lsx_vmini_w (__m128i_op0, -13); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x001ffff0003ffff0; + *((unsigned long *)&__m128i_op0[0]) = 0x000fffefffefffef; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00000000ffefffef; + __m128i_out = __lsx_vmini_w (__m128i_op0, 0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000800000000; + *((unsigned long *)&__m128i_op0[0]) = 0xff01fe0400000006; + *((unsigned long *)&__m128i_result[1]) = 0x0000000500000000; + *((unsigned long *)&__m128i_result[0]) = 0xff01fe0400000005; + __m128i_out = __lsx_vmini_w (__m128i_op0, 5); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xfffffffafffffffa; + *((unsigned long *)&__m128i_result[0]) = 0xfffffffafffffffa; + __m128i_out = __lsx_vmini_w (__m128i_op0, -6); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x6363636363636363; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000d0000000d; + __m128i_out = __lsx_vmini_w (__m128i_op0, 13); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x8080808080808080; + *((unsigned long *)&__m128i_op0[0]) = 0x8080808080808080; + *((unsigned long *)&__m128i_result[1]) = 0x8080808080808080; + *((unsigned long *)&__m128i_result[0]) = 0x8080808080808080; + __m128i_out = __lsx_vmini_w (__m128i_op0, 8); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x345002920f3017d6; + *((unsigned long *)&__m128i_result[1]) = 0xfffffff7fffffff7; + *((unsigned long *)&__m128i_result[0]) = 0xfffffff7fffffff7; + __m128i_out = __lsx_vmini_w (__m128i_op0, -9); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffff00000000; + __m128i_out = __lsx_vmini_d (__m128i_op0, 1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x03574e3a62407e03; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xfffffffffffffff7; + *((unsigned long *)&__m128i_result[0]) = 0xfffffffffffffff7; + __m128i_out = __lsx_vmini_d (__m128i_op0, -9); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x1000000010000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000100100000; + *((unsigned long *)&__m128i_result[1]) = 0xfffffffffffffff1; + *((unsigned long *)&__m128i_result[0]) = 0xfffffffffffffff1; + __m128i_out = __lsx_vmini_d (__m128i_op0, -15); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000034; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000006; + __m128i_out = __lsx_vmini_d (__m128i_op0, 6); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000100000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000006; + __m128i_out = __lsx_vmini_d (__m128i_op0, 6); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xff84fff4ff84fff4; + *((unsigned long *)&__m128i_op0[0]) = 0x00a6ffceffb60052; + *((unsigned long *)&__m128i_result[1]) = 0xff84fff4ff84fff4; + *((unsigned long *)&__m128i_result[0]) = 0xfffffffffffffff0; + __m128i_out = __lsx_vmini_d (__m128i_op0, -16); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0xfffffffffffffff9; + *((unsigned long *)&__m128i_result[0]) = 0xfffffffffffffff9; + __m128i_out = __lsx_vmini_d (__m128i_op0, -7); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x111110ff11111141; + *((unsigned long *)&__m128i_op0[0]) = 0x1111113111111100; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vmini_d (__m128i_op0, -1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x55aa55c3d5aa55c4; + *((unsigned long *)&__m128i_op0[0]) = 0xaa55556fd5aaaac1; + *((unsigned long *)&__m128i_result[1]) = 0x000000000000000c; + *((unsigned long *)&__m128i_result[0]) = 0xaa55556fd5aaaac1; + __m128i_out = __lsx_vmini_d (__m128i_op0, 12); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmini_d (__m128i_op0, 12); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xfffffffffffffff4; + *((unsigned long *)&__m128i_result[0]) = 0xfffffffffffffff4; + __m128i_out = __lsx_vmini_d (__m128i_op0, -12); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xfffffffffffffffb; + *((unsigned long *)&__m128i_result[0]) = 0xfffffffffffffffb; + __m128i_out = __lsx_vmini_d (__m128i_op0, -5); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfcfcfcdcfcfcfcdc; + *((unsigned long *)&__m128i_op0[0]) = 0xfcfcfcdcfcfcfcdc; + *((unsigned long *)&__m128i_result[1]) = 0xfcfcfcdcfcfcfcdc; + *((unsigned long *)&__m128i_result[0]) = 0xfcfcfcdcfcfcfcdc; + __m128i_out = __lsx_vmini_d (__m128i_op0, 3); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000001030103; + *((unsigned long *)&__m128i_result[1]) = 0xfffffffffffffffc; + *((unsigned long *)&__m128i_result[0]) = 0xfffffffffffffffc; + __m128i_out = __lsx_vmini_d (__m128i_op0, -4); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000085af0000b000; + *((unsigned long *)&__m128i_op0[0]) = 0x00017ea200002000; + *((unsigned long *)&__m128i_result[1]) = 0xfffffffffffffff7; + *((unsigned long *)&__m128i_result[0]) = 0xfffffffffffffff7; + __m128i_out = __lsx_vmini_d (__m128i_op0, -9); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0xfffffffffffffff4; + *((unsigned long *)&__m128i_result[0]) = 0xfffffffffffffff4; + __m128i_out = __lsx_vmini_d (__m128i_op0, -12); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xff00e400ff00e400; + *((unsigned long *)&__m128i_op0[0]) = 0xff01e41ffff0ffff; + *((unsigned long *)&__m128i_result[1]) = 0xff00e400ff00e400; + *((unsigned long *)&__m128i_result[0]) = 0xff01e41ffff0ffff; + __m128i_out = __lsx_vmini_d (__m128i_op0, 14); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmini-2.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmini-2.c new file mode 100644 index 00000000000..6eaae21342c --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmini-2.c @@ -0,0 +1,216 @@ +/* { dg-do run } */ +/* { dg-options "-mlsx -w -fno-strict-aliasing" } */ +#include "../simd_correctness_check.h" +#include + +int +main () +{ + __m128i __m128i_op0, __m128i_op1, __m128i_op2, __m128i_out, __m128i_result; + __m128 __m128_op0, __m128_op1, __m128_op2, __m128_out, __m128_result; + __m128d __m128d_op0, __m128d_op1, __m128d_op2, __m128d_out, __m128d_result; + + int int_op0, int_op1, int_op2, int_out, int_result, i = 1, fail; + long int long_op0, long_op1, long_op2, lont_out, lont_result; + long int long_int_out, long_int_result; + unsigned int unsigned_int_out, unsigned_int_result; + unsigned long int unsigned_long_int_out, unsigned_long_int_result; + + *((unsigned long *)&__m128i_op0[1]) = 0xffff0001ffff0001; + *((unsigned long *)&__m128i_op0[0]) = 0x0000a163000016b0; + *((unsigned long *)&__m128i_result[1]) = 0x0303000103030001; + *((unsigned long *)&__m128i_result[0]) = 0x0000030300000303; + __m128i_out = __lsx_vmini_bu (__m128i_op0, 0x3); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xd8248069ffe78077; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0d0d0d0d0d0d0d0d; + __m128i_out = __lsx_vmini_bu (__m128i_op0, 0xd); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x7da9b23a624082fd; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000ffff0000; + *((unsigned long *)&__m128i_result[1]) = 0x0505050505050505; + *((unsigned long *)&__m128i_result[0]) = 0x0000000005050000; + __m128i_out = __lsx_vmini_bu (__m128i_op0, 0x5); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000001300000013; + *((unsigned long *)&__m128i_op0[0]) = 0x0000001300000013; + *((unsigned long *)&__m128i_result[1]) = 0x0000000e0000000e; + *((unsigned long *)&__m128i_result[0]) = 0x0000000e0000000e; + __m128i_out = __lsx_vmini_bu (__m128i_op0, 0xe); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmini_bu (__m128i_op0, 0xf); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000001fffdfffdff; + *((unsigned long *)&__m128i_op0[0]) = 0x000001fffdfffdff; + *((unsigned long *)&__m128i_result[1]) = 0x0000010101010101; + *((unsigned long *)&__m128i_result[0]) = 0x0000010101010101; + __m128i_out = __lsx_vmini_bu (__m128i_op0, 0x1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000000009c007c00; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000071007600; + *((unsigned long *)&__m128i_result[1]) = 0x0000000009000900; + *((unsigned long *)&__m128i_result[0]) = 0x0000000009000900; + __m128i_out = __lsx_vmini_bu (__m128i_op0, 0x9); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xc0b4d1a5f8babad3; + *((unsigned long *)&__m128i_op0[0]) = 0xbbc8ecc5f3ced5f3; + *((unsigned long *)&__m128i_result[1]) = 0x0303030303030303; + *((unsigned long *)&__m128i_result[0]) = 0x0303030303030303; + __m128i_out = __lsx_vmini_bu (__m128i_op0, 0x3); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xd3220000d3f20000; + *((unsigned long *)&__m128i_op0[0]) = 0x8bff0000a7b80000; + *((unsigned long *)&__m128i_result[1]) = 0x0909000009090000; + *((unsigned long *)&__m128i_result[0]) = 0x0909000009090000; + __m128i_out = __lsx_vmini_bu (__m128i_op0, 0x9); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmini_hu (__m128i_op0, 0xd); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x80000000b57ec564; + *((unsigned long *)&__m128i_op0[0]) = 0x8000000083ff0be0; + *((unsigned long *)&__m128i_result[1]) = 0x0014000000140014; + *((unsigned long *)&__m128i_result[0]) = 0x0014000000140014; + __m128i_out = __lsx_vmini_hu (__m128i_op0, 0x14); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x1000100010001000; + *((unsigned long *)&__m128i_op0[0]) = 0x1000100010001000; + *((unsigned long *)&__m128i_result[1]) = 0x0013001300130013; + *((unsigned long *)&__m128i_result[0]) = 0x0013001300130013; + __m128i_out = __lsx_vmini_hu (__m128i_op0, 0x13); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmini_hu (__m128i_op0, 0x1b); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000005; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000005; + __m128i_out = __lsx_vmini_hu (__m128i_op0, 0x1b); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x02b010f881a281a2; + *((unsigned long *)&__m128i_op0[0]) = 0x27b169bbb8145f50; + *((unsigned long *)&__m128i_result[1]) = 0x0002000200020002; + *((unsigned long *)&__m128i_result[0]) = 0x0002000200020002; + __m128i_out = __lsx_vmini_hu (__m128i_op0, 0x2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmini_du (__m128i_op0, 0x19); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000040004000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0010002000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmini_du (__m128i_op0, 0x0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00ff00ff0000007f; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000004; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmini_du (__m128i_op0, 0x4); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x7ff8000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x7ff8000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000005; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000005; + __m128i_out = __lsx_vmini_du (__m128i_op0, 0x5); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000003fc00ff00; + *((unsigned long *)&__m128i_op0[0]) = 0x00000001fe01fe00; + *((unsigned long *)&__m128i_result[1]) = 0x000000000000000a; + *((unsigned long *)&__m128i_result[0]) = 0x000000000000000a; + __m128i_out = __lsx_vmini_du (__m128i_op0, 0xa); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x7fc000007fc00000; + *((unsigned long *)&__m128i_op0[0]) = 0x7fc000007fc00000; + *((unsigned long *)&__m128i_result[1]) = 0x000000000000000b; + *((unsigned long *)&__m128i_result[0]) = 0x000000000000000b; + __m128i_out = __lsx_vmini_du (__m128i_op0, 0xb); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0001000101010001; + *((unsigned long *)&__m128i_op0[0]) = 0x0001000100010001; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000014; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000014; + __m128i_out = __lsx_vmini_du (__m128i_op0, 0x14); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmini_du (__m128i_op0, 0x18); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfffefffefffefffe; + *((unsigned long *)&__m128i_op0[0]) = 0xfffefffefffefffe; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000005; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000005; + __m128i_out = __lsx_vmini_du (__m128i_op0, 0x5); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmini_du (__m128i_op0, 0x11); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000d3460001518a; + *((unsigned long *)&__m128i_op0[0]) = 0x000084300000e55f; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000016; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000016; + __m128i_out = __lsx_vmini_du (__m128i_op0, 0x16); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmini_du (__m128i_op0, 0x3); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffff2356fe165486; + *((unsigned long *)&__m128i_op0[0]) = 0x5efeb3165bd7653d; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000007; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000007; + __m128i_out = __lsx_vmini_du (__m128i_op0, 0x7); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmskgez.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmskgez.c new file mode 100644 index 00000000000..64a950f8135 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmskgez.c @@ -0,0 +1,119 @@ +/* { dg-do run } */ +/* { dg-options "-mlsx -w -fno-strict-aliasing" } */ +#include "../simd_correctness_check.h" +#include + +int +main () +{ + __m128i __m128i_op0, __m128i_op1, __m128i_op2, __m128i_out, __m128i_result; + __m128 __m128_op0, __m128_op1, __m128_op2, __m128_out, __m128_result; + __m128d __m128d_op0, __m128d_op1, __m128d_op2, __m128d_out, __m128d_result; + + int int_op0, int_op1, int_op2, int_out, int_result, i = 1, fail; + long int long_op0, long_op1, long_op2, lont_out, lont_result; + long int long_int_out, long_int_result; + unsigned int unsigned_int_out, unsigned_int_result; + unsigned long int unsigned_long_int_out, unsigned_long_int_result; + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x000000000000ffff; + __m128i_out = __lsx_vmskgez_b (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0403cfcf01c1595e; + *((unsigned long *)&__m128i_op0[0]) = 0x837cd5db43fc55d4; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x000000000000cb4a; + __m128i_out = __lsx_vmskgez_b (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x000000000000ffff; + __m128i_out = __lsx_vmskgez_b (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x000000000000ffff; + __m128i_out = __lsx_vmskgez_b (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x000000000000ffff; + __m128i_out = __lsx_vmskgez_b (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffff7f01ff01; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x000000000000000d; + __m128i_out = __lsx_vmskgez_b (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x000000000000ffff; + __m128i_out = __lsx_vmskgez_b (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x000000000000ffff; + __m128i_out = __lsx_vmskgez_b (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000100000001; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000100000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x000000000000ffff; + __m128i_out = __lsx_vmskgez_b (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x000000000000ffff; + __m128i_out = __lsx_vmskgez_b (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + int_out = __lsx_vpickve2gr_h (__m128i_op0, 0x2); + *((unsigned long *)&__m128i_op0[1]) = 0x0000010000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x000000000000ffff; + __m128i_out = __lsx_vmskgez_b (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xfe813f00fe813f00; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000033; + __m128i_out = __lsx_vmskgez_b (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000fffe00006aea; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x000000000000ffce; + __m128i_out = __lsx_vmskgez_b (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x8080808080808080; + *((unsigned long *)&__m128i_op0[0]) = 0x8080808080808080; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmskgez_b (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmskltz.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmskltz.c new file mode 100644 index 00000000000..8f743ec2e77 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmskltz.c @@ -0,0 +1,321 @@ +/* { dg-do run } */ +/* { dg-options "-mlsx -w -fno-strict-aliasing" } */ +#include "../simd_correctness_check.h" +#include + +int +main () +{ + __m128i __m128i_op0, __m128i_op1, __m128i_op2, __m128i_out, __m128i_result; + __m128 __m128_op0, __m128_op1, __m128_op2, __m128_out, __m128_result; + __m128d __m128d_op0, __m128d_op1, __m128d_op2, __m128d_out, __m128d_result; + + int int_op0, int_op1, int_op2, int_out, int_result, i = 1, fail; + long int long_op0, long_op1, long_op2, lont_out, lont_result; + long int long_int_out, long_int_result; + unsigned int unsigned_int_out, unsigned_int_result; + unsigned long int unsigned_long_int_out, unsigned_long_int_result; + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000003; + __m128i_out = __lsx_vmskltz_d (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmskltz_d (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmskltz_h (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmskltz_h (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x007fffff00000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmskltz_w (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmskltz_b (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x85bd6b0e94d89998; + *((unsigned long *)&__m128i_op0[0]) = 0xd83c8081ffff8080; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x000000000000000f; + __m128i_out = __lsx_vmskltz_w (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x7505443065413aed; + *((unsigned long *)&__m128i_op0[0]) = 0x0100d6effefd0498; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x000000000000013d; + __m128i_out = __lsx_vmskltz_b (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000f0000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000002; + __m128i_out = __lsx_vmskltz_h (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x000100010001fffd; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000001; + __m128i_out = __lsx_vmskltz_h (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000100010001007c; + *((unsigned long *)&__m128i_op0[0]) = 0x0001000100010001; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmskltz_h (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000010001; + *((unsigned long *)&__m128i_op0[0]) = 0x000000000001007c; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmskltz_d (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x1111113111111141; + *((unsigned long *)&__m128i_op0[0]) = 0x1111113111111121; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmskltz_b (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x9780697084f07dd7; + *((unsigned long *)&__m128i_op0[0]) = 0x87e3285243051cf3; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x000000000000cdc1; + __m128i_out = __lsx_vmskltz_b (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x05d0ae6002e8748e; + *((unsigned long *)&__m128i_op0[0]) = 0xcd1de80217374041; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00000000000065a0; + __m128i_out = __lsx_vmskltz_b (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00d3012acc56f9bb; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000000000a0; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000004b01; + __m128i_out = __lsx_vmskltz_b (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000020; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmskltz_b (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffbfffffffbf; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffbfffffffbf; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x000000000000ffff; + __m128i_out = __lsx_vmskltz_b (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x000000000000ff00; + __m128i_out = __lsx_vmskltz_b (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x21201f1e1d1c1b1a; + *((unsigned long *)&__m128i_op0[0]) = 0x1918171615141312; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmskltz_h (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x000000000000000f; + __m128i_out = __lsx_vmskltz_h (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000000ff08ffff; + *((unsigned long *)&__m128i_op0[0]) = 0xfffffffffffffff0; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000001; + __m128i_out = __lsx_vmskltz_d (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x370bdfecffecffec; + *((unsigned long *)&__m128i_op0[0]) = 0x370bdfecffecffec; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000003f3f; + __m128i_out = __lsx_vmskltz_b (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmskltz_w (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmskltz_w (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmskltz_w (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000080000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000080000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000022; + __m128i_out = __lsx_vmskltz_h (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfffffffffffffffc; + *((unsigned long *)&__m128i_op0[0]) = 0xfffffffffffffffc; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000003; + __m128i_out = __lsx_vmskltz_d (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000008080600; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmskltz_h (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x000000007fff0018; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000004; + __m128i_out = __lsx_vmskltz_b (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x6363636363636363; + *((unsigned long *)&__m128i_op0[0]) = 0x6363636363636363; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmskltz_h (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmskltz_w (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmskltz_b (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmskltz_w (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmskltz_h (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmskltz_w (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000035697d4e; + *((unsigned long *)&__m128i_op0[0]) = 0x000000013ecaadf2; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000001; + __m128i_out = __lsx_vmskltz_h (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000006de1; + *((unsigned long *)&__m128i_op0[0]) = 0x5f9ccf33cf600000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmskltz_d (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmskltz_d (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_op0[0]) = 0x003ffffe00800000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000034; + __m128i_out = __lsx_vmskltz_b (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x4399d3221a29d3f2; + *((unsigned long *)&__m128i_op0[0]) = 0xc3818bffe7b7a7b8; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000001; + __m128i_out = __lsx_vmskltz_d (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x63636b6afe486741; + *((unsigned long *)&__m128i_op0[0]) = 0x41f8e880ffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000027; + __m128i_out = __lsx_vmskltz_h (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmskltz_d (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmsknz.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmsknz.c new file mode 100644 index 00000000000..d547af0d3aa --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmsknz.c @@ -0,0 +1,104 @@ +/* { dg-do run } */ +/* { dg-options "-mlsx -w -fno-strict-aliasing" } */ +#include "../simd_correctness_check.h" +#include + +int +main () +{ + __m128i __m128i_op0, __m128i_op1, __m128i_op2, __m128i_out, __m128i_result; + __m128 __m128_op0, __m128_op1, __m128_op2, __m128_out, __m128_result; + __m128d __m128d_op0, __m128d_op1, __m128d_op2, __m128d_out, __m128d_result; + + int int_op0, int_op1, int_op2, int_out, int_result, i = 1, fail; + long int long_op0, long_op1, long_op2, lont_out, lont_result; + long int long_int_out, long_int_result; + unsigned int unsigned_int_out, unsigned_int_result; + unsigned long int unsigned_long_int_out, unsigned_long_int_result; + + *((unsigned long *)&__m128i_op0[1]) = 0x000000017fff9000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000210011084; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000001e1f; + __m128i_out = __lsx_vmsknz_b (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x9c9c9c9c9c9c9c9c; + *((unsigned long *)&__m128i_op0[0]) = 0x9c9c9c9c63636363; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x000000000000ffff; + __m128i_out = __lsx_vmsknz_b (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x009500b10113009c; + *((unsigned long *)&__m128i_op0[0]) = 0x009500b10113009c; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000005d5d; + __m128i_out = __lsx_vmsknz_b (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfffcfffcfffcfffc; + *((unsigned long *)&__m128i_op0[0]) = 0xfffcfffcfffcfffc; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x000000000000ffff; + __m128i_out = __lsx_vmsknz_b (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmsknz_b (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xfffffffffffff000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00000000000000fe; + __m128i_out = __lsx_vmsknz_b (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000fffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0x0010000000000001; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000007f41; + __m128i_out = __lsx_vmsknz_b (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000ff00ff; + *((unsigned long *)&__m128i_op0[0]) = 0x0014001400140000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000554; + __m128i_out = __lsx_vmsknz_b (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x8080808080808080; + *((unsigned long *)&__m128i_op0[0]) = 0x8080808080808080; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x000000000000ffff; + __m128i_out = __lsx_vmsknz_b (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x202544f490f2de35; + *((unsigned long *)&__m128i_op0[0]) = 0x202544f490f2de35; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x000000000000ffff; + __m128i_out = __lsx_vmsknz_b (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000a74aa8a55ab; + *((unsigned long *)&__m128i_op0[0]) = 0x6adeb5dfcb000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000003ff8; + __m128i_out = __lsx_vmsknz_b (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x317fce80317fce80; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x000000000000ff00; + __m128i_out = __lsx_vmsknz_b (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vneg.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vneg.c new file mode 100644 index 00000000000..9441ba50e35 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vneg.c @@ -0,0 +1,321 @@ +/* { dg-do run } */ +/* { dg-options "-mlsx -w -fno-strict-aliasing" } */ +#include "../simd_correctness_check.h" +#include + +int +main () +{ + __m128i __m128i_op0, __m128i_op1, __m128i_op2, __m128i_out, __m128i_result; + __m128 __m128_op0, __m128_op1, __m128_op2, __m128_out, __m128_result; + __m128d __m128d_op0, __m128d_op1, __m128d_op2, __m128d_out, __m128d_result; + + int int_op0, int_op1, int_op2, int_out, int_result, i = 1, fail; + long int long_op0, long_op1, long_op2, lont_out, lont_result; + long int long_int_out, long_int_result; + unsigned int unsigned_int_out, unsigned_int_result; + unsigned long int unsigned_long_int_out, unsigned_long_int_result; + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000001; + __m128i_out = __lsx_vneg_d (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vneg_d (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000100000001; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xfffffffeffffffff; + __m128i_out = __lsx_vneg_d (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0001000100000004; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xfffefffefffffffc; + __m128i_out = __lsx_vneg_d (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x000000ff000000ff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xffffff00ffffff01; + __m128i_out = __lsx_vneg_d (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vneg_w (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vneg_b (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vneg_h (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x000000000000000d; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x000000000000fff3; + __m128i_out = __lsx_vneg_h (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00ff00ff0000ffff; + *((unsigned long *)&__m128i_op0[0]) = 0x00ff0001ffffff0a; + *((unsigned long *)&__m128i_result[1]) = 0x0001000100000101; + *((unsigned long *)&__m128i_result[0]) = 0x000100ff010101f6; + __m128i_out = __lsx_vneg_b (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0101010101010101; + *((unsigned long *)&__m128i_result[0]) = 0x0101010101010101; + __m128i_out = __lsx_vneg_b (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xff000000ff00ff00; + *((unsigned long *)&__m128i_op0[0]) = 0xff00ff0000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0100000001000100; + *((unsigned long *)&__m128i_result[0]) = 0x0100010000000000; + __m128i_out = __lsx_vneg_b (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vneg_w (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vneg_b (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vneg_h (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x000000000000ff00; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000100; + __m128i_out = __lsx_vneg_h (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000101; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x00000000fffffeff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vneg_w (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vneg_h (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vneg_b (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vneg_h (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfffffbff8888080a; + *((unsigned long *)&__m128i_op0[0]) = 0x080803ff807ff7f9; + *((unsigned long *)&__m128i_result[1]) = 0x010105017878f8f6; + *((unsigned long *)&__m128i_result[0]) = 0xf8f8fd0180810907; + __m128i_out = __lsx_vneg_b (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000080000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000080000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000080000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000080000000; + __m128i_out = __lsx_vneg_b (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vneg_d (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000300000001; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000100010001; + *((unsigned long *)&__m128i_result[1]) = 0xfffffffdffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xfffffffffffeffff; + __m128i_out = __lsx_vneg_w (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vneg_h (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0001000100010001; + *((unsigned long *)&__m128i_result[0]) = 0x0001000100010001; + __m128i_out = __lsx_vneg_h (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x441ba9fcffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0x181b2541ffffffff; + *((unsigned long *)&__m128i_result[1]) = 0xbbe5560400010001; + *((unsigned long *)&__m128i_result[0]) = 0xe7e5dabf00010001; + __m128i_out = __lsx_vneg_h (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000000000060a3db; + *((unsigned long *)&__m128i_op0[0]) = 0xa70594c000000000; + *((unsigned long *)&__m128i_result[1]) = 0x00000000ff9f5c25; + *((unsigned long *)&__m128i_result[0]) = 0x58fa6b4000000000; + __m128i_out = __lsx_vneg_w (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vneg_b (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vneg_w (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00ff00ff00ff00ff; + *((unsigned long *)&__m128i_op0[0]) = 0x00ff00ff00ff00ff; + *((unsigned long *)&__m128i_result[1]) = 0x0001000100010001; + *((unsigned long *)&__m128i_result[0]) = 0x0001000100010001; + __m128i_out = __lsx_vneg_b (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000010000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffff0000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vneg_w (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vneg_d (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000000000000001f; + *((unsigned long *)&__m128i_op0[0]) = 0x000000008000001e; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffe1; + *((unsigned long *)&__m128i_result[0]) = 0xffffffff7fffffe2; + __m128i_out = __lsx_vneg_d (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x67eb85afb2ebb000; + *((unsigned long *)&__m128i_op0[0]) = 0xc8847ef6ed3f2000; + *((unsigned long *)&__m128i_result[1]) = 0x98147a504d145000; + *((unsigned long *)&__m128i_result[0]) = 0x377b810912c0e000; + __m128i_out = __lsx_vneg_d (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vneg_h (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffc00001ff800000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_result[0]) = 0x003ffffe00800000; + __m128i_out = __lsx_vneg_d (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0001000100000000; + __m128i_out = __lsx_vneg_h (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000ffff0000ffff; + *((unsigned long *)&__m128i_op0[0]) = 0x0000ffff0000ffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000100000001; + *((unsigned long *)&__m128i_result[0]) = 0x0000000100000001; + __m128i_out = __lsx_vneg_h (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vneg_d (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vneg_w (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x087c000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x000000000000087c; + *((unsigned long *)&__m128i_result[1]) = 0xf784000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xfffffffffffff784; + __m128i_out = __lsx_vneg_d (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vneg_w (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsat-1.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsat-1.c new file mode 100644 index 00000000000..cd8eefb470c --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsat-1.c @@ -0,0 +1,231 @@ +/* { dg-do run } */ +/* { dg-options "-mlsx -w -fno-strict-aliasing" } */ +#include "../simd_correctness_check.h" +#include + +int +main () +{ + __m128i __m128i_op0, __m128i_op1, __m128i_op2, __m128i_out, __m128i_result; + __m128 __m128_op0, __m128_op1, __m128_op2, __m128_out, __m128_result; + __m128d __m128d_op0, __m128d_op1, __m128d_op2, __m128d_out, __m128d_result; + + int int_op0, int_op1, int_op2, int_out, int_result, i = 1, fail; + long int long_op0, long_op1, long_op2, lont_out, lont_result; + long int long_int_out, long_int_result; + unsigned int unsigned_int_out, unsigned_int_result; + unsigned long int unsigned_long_int_out, unsigned_long_int_result; + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsat_b (__m128i_op0, 0x6); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsat_b (__m128i_op0, 0x0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xc000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xf000000000000000; + __m128i_out = __lsx_vsat_b (__m128i_op0, 0x4); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vsat_b (__m128i_op0, 0x3); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x7fff010181010102; + *((unsigned long *)&__m128i_op0[0]) = 0x7fffffff81010102; + *((unsigned long *)&__m128i_result[1]) = 0x03ff0101fc010102; + *((unsigned long *)&__m128i_result[0]) = 0x03fffffffc010102; + __m128i_out = __lsx_vsat_b (__m128i_op0, 0x2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vsat_b (__m128i_op0, 0x4); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsat_h (__m128i_op0, 0x1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000040400000383; + *((unsigned long *)&__m128i_op0[0]) = 0xffff8383ffff7d0d; + *((unsigned long *)&__m128i_result[1]) = 0x0000040400000383; + *((unsigned long *)&__m128i_result[0]) = 0xffffe000ffff1fff; + __m128i_out = __lsx_vsat_h (__m128i_op0, 0xd); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000100000001; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000100000001; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsat_h (__m128i_op0, 0x6); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfffffffff8f8da00; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffff01018888; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffff00ff00; + *((unsigned long *)&__m128i_result[0]) = 0xffffffff00ffff00; + __m128i_out = __lsx_vsat_h (__m128i_op0, 0x8); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x3f8000003f800001; + *((unsigned long *)&__m128i_op0[0]) = 0x3f8000003f800001; + *((unsigned long *)&__m128i_result[1]) = 0x0001000000010001; + *((unsigned long *)&__m128i_result[0]) = 0x0001000000010001; + __m128i_out = __lsx_vsat_h (__m128i_op0, 0x1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000006f00001f0a; + *((unsigned long *)&__m128i_op0[0]) = 0x0000958affff995d; + *((unsigned long *)&__m128i_result[1]) = 0x0000006f00001f0a; + *((unsigned long *)&__m128i_result[0]) = 0x0000c000ffffc000; + __m128i_out = __lsx_vsat_h (__m128i_op0, 0xe); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x00000000ffffffff; + __m128i_out = __lsx_vsat_h (__m128i_op0, 0xd); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0038d800ff000000; + *((unsigned long *)&__m128i_op0[0]) = 0x00fffe00fffffe00; + *((unsigned long *)&__m128i_result[1]) = 0x0038f000ff000000; + *((unsigned long *)&__m128i_result[0]) = 0x00fffe00fffffe00; + __m128i_out = __lsx_vsat_h (__m128i_op0, 0xc); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsat_h (__m128i_op0, 0xb); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsat_h (__m128i_op0, 0xd); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x7fff00007fff0000; + *((unsigned long *)&__m128i_op0[0]) = 0x7fff00007fff0000; + *((unsigned long *)&__m128i_result[1]) = 0x003f0000003f0000; + *((unsigned long *)&__m128i_result[0]) = 0x003f0000003f0000; + __m128i_out = __lsx_vsat_h (__m128i_op0, 0x6); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0674c886fcba4e98; + *((unsigned long *)&__m128i_op0[0]) = 0xfdce8003090b0906; + *((unsigned long *)&__m128i_result[1]) = 0x003fffc0ffc0003f; + *((unsigned long *)&__m128i_result[0]) = 0xffc0ffc0003f003f; + __m128i_out = __lsx_vsat_h (__m128i_op0, 0x6); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsat_h (__m128i_op0, 0x8); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x04e00060ffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0x04e00060ffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x007fffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x007fffffffffffff; + __m128i_out = __lsx_vsat_w (__m128i_op0, 0x17); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000017f0a82; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x000000000000003f; + __m128i_out = __lsx_vsat_w (__m128i_op0, 0x6); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsat_w (__m128i_op0, 0x1d); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + unsigned_int_out = __lsx_vpickve2gr_wu (__m128i_op0, 0x3); + *((unsigned long *)&__m128i_op0[1]) = 0x8006000080020000; + *((unsigned long *)&__m128i_op0[0]) = 0x8004000080020000; + *((unsigned long *)&__m128i_result[1]) = 0xfffffff8fffffff8; + *((unsigned long *)&__m128i_result[0]) = 0xfffffff8fffffff8; + __m128i_out = __lsx_vsat_w (__m128i_op0, 0x3); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsat_w (__m128i_op0, 0x12); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vsat_w (__m128i_op0, 0x10); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000008; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000008; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsat_w (__m128i_op0, 0x5); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsat_w (__m128i_op0, 0x11); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x6363636363636363; + *((unsigned long *)&__m128i_op0[0]) = 0xffd27db010d20fbf; + *((unsigned long *)&__m128i_result[1]) = 0x0000000f0000000f; + *((unsigned long *)&__m128i_result[0]) = 0xfffffff00000000f; + __m128i_out = __lsx_vsat_w (__m128i_op0, 0x4); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000003ff8; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000003ff8; + __m128i_out = __lsx_vsat_w (__m128i_op0, 0x11); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsat_d (__m128i_op0, 0x35); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsat-2.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsat-2.c new file mode 100644 index 00000000000..31e3919bf83 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsat-2.c @@ -0,0 +1,272 @@ +/* { dg-do run } */ +/* { dg-options "-mlsx -w -fno-strict-aliasing" } */ +#include "../simd_correctness_check.h" +#include + +int +main () +{ + __m128i __m128i_op0, __m128i_op1, __m128i_op2, __m128i_out, __m128i_result; + __m128 __m128_op0, __m128_op1, __m128_op2, __m128_out, __m128_result; + __m128d __m128d_op0, __m128d_op1, __m128d_op2, __m128d_out, __m128d_result; + + int int_op0, int_op1, int_op2, int_out, int_result, i = 1, fail; + long int long_op0, long_op1, long_op2, lont_out, lont_result; + long int long_int_out, long_int_result; + unsigned int unsigned_int_out, unsigned_int_result; + unsigned long int unsigned_long_int_out, unsigned_long_int_result; + + *((unsigned long *)&__m128i_op0[1]) = 0xffff1739ffff48aa; + *((unsigned long *)&__m128i_op0[0]) = 0xffff2896ffff5b88; + *((unsigned long *)&__m128i_result[1]) = 0x3f3f17393f3f3f3f; + *((unsigned long *)&__m128i_result[0]) = 0x3f3f283f3f3f3f3f; + __m128i_out = __lsx_vsat_bu (__m128i_op0, 0x5); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0002000000020000; + *((unsigned long *)&__m128i_op0[0]) = 0x000001fc00000000; + *((unsigned long *)&__m128i_result[1]) = 0x0001000000010000; + *((unsigned long *)&__m128i_result[0]) = 0x0000010100000000; + __m128i_out = __lsx_vsat_bu (__m128i_op0, 0x0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffcc000b000b000b; + *((unsigned long *)&__m128i_op0[0]) = 0x000b000b010a000b; + *((unsigned long *)&__m128i_result[1]) = 0x7f7f000b000b000b; + *((unsigned long *)&__m128i_result[0]) = 0x000b000b010a000b; + __m128i_out = __lsx_vsat_bu (__m128i_op0, 0x6); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000068; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x000000000000001f; + __m128i_out = __lsx_vsat_bu (__m128i_op0, 0x4); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsat_bu (__m128i_op0, 0x4); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffcd63ffffcd63; + *((unsigned long *)&__m128i_op0[0]) = 0xffffd765ffffd765; + *((unsigned long *)&__m128i_result[1]) = 0x1f1f1f1f1f1f1f1f; + *((unsigned long *)&__m128i_result[0]) = 0x1f1f1f1f1f1f1f1f; + __m128i_out = __lsx_vsat_bu (__m128i_op0, 0x4); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsat_bu (__m128i_op0, 0x4); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000000120000000d; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000e0000000e; + *((unsigned long *)&__m128i_result[1]) = 0x0000000100000001; + *((unsigned long *)&__m128i_result[0]) = 0x0000000100000001; + __m128i_out = __lsx_vsat_bu (__m128i_op0, 0x0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xbf8000000000ffff; + *((unsigned long *)&__m128i_op0[0]) = 0xcf00000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x003f00000000003f; + *((unsigned long *)&__m128i_result[0]) = 0x003f000000000000; + __m128i_out = __lsx_vsat_hu (__m128i_op0, 0x5); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000000000007f8; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000000007f8; + *((unsigned long *)&__m128i_result[1]) = 0x00000000000000ff; + *((unsigned long *)&__m128i_result[0]) = 0x00000000000000ff; + __m128i_out = __lsx_vsat_hu (__m128i_op0, 0x7); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsat_hu (__m128i_op0, 0xc); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsat_hu (__m128i_op0, 0xa); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000006de1; + *((unsigned long *)&__m128i_op0[0]) = 0x5f9ccf33cf600000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000007; + *((unsigned long *)&__m128i_result[0]) = 0x0007000700070000; + __m128i_out = __lsx_vsat_hu (__m128i_op0, 0x2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsat_wu (__m128i_op0, 0xb); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000fff7fc01; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x000000000000000f; + __m128i_out = __lsx_vsat_wu (__m128i_op0, 0x3); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsat_wu (__m128i_op0, 0x1d); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsat_wu (__m128i_op0, 0x14); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000003; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000003; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsat_wu (__m128i_op0, 0x3); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000bd3d00000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000bd3d00000000; + __m128i_out = __lsx_vsat_wu (__m128i_op0, 0x19); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsat_wu (__m128i_op0, 0x12); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsat_wu (__m128i_op0, 0x9); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0007000000050000; + *((unsigned long *)&__m128i_op0[0]) = 0x0003000000010000; + *((unsigned long *)&__m128i_result[1]) = 0x00003fff00003fff; + *((unsigned long *)&__m128i_result[0]) = 0x00003fff00003fff; + __m128i_out = __lsx_vsat_wu (__m128i_op0, 0xd); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x001a323b5430048c; + *((unsigned long *)&__m128i_op0[0]) = 0x008f792cab1cb915; + *((unsigned long *)&__m128i_result[1]) = 0x001a323b00ffffff; + *((unsigned long *)&__m128i_result[0]) = 0x008f792c00ffffff; + __m128i_out = __lsx_vsat_wu (__m128i_op0, 0x17); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsat_wu (__m128i_op0, 0xc); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsat_du (__m128i_op0, 0x20); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsat_du (__m128i_op0, 0x25); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x7fffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x7fffffffffffffff; + __m128i_out = __lsx_vsat_du (__m128i_op0, 0x3e); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x6363636389038903; + *((unsigned long *)&__m128i_op0[0]) = 0x6363636389038903; + *((unsigned long *)&__m128i_result[1]) = 0x000000000001ffff; + *((unsigned long *)&__m128i_result[0]) = 0x000000000001ffff; + __m128i_out = __lsx_vsat_du (__m128i_op0, 0x10); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsat_du (__m128i_op0, 0x22); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsat_du (__m128i_op0, 0x36); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x000000001fffffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsat_du (__m128i_op0, 0x1c); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsat_du (__m128i_op0, 0x17); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsat_du (__m128i_op0, 0x7); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0001000101010001; + *((unsigned long *)&__m128i_op0[0]) = 0x0001000100010001; + *((unsigned long *)&__m128i_result[1]) = 0x0001000101010001; + *((unsigned long *)&__m128i_result[0]) = 0x0001000100010001; + __m128i_out = __lsx_vsat_du (__m128i_op0, 0x34); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000202020200; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000100; + *((unsigned long *)&__m128i_result[1]) = 0x000000001fffffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000100; + __m128i_out = __lsx_vsat_du (__m128i_op0, 0x1c); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xa8a74bff9e9e0070; + *((unsigned long *)&__m128i_op0[0]) = 0x9e9e72ff9e9ff9ff; + *((unsigned long *)&__m128i_result[1]) = 0x0000ffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000ffffffffffff; + __m128i_out = __lsx_vsat_du (__m128i_op0, 0x2f); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsigncov.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsigncov.c new file mode 100644 index 00000000000..0fb1bc18f24 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsigncov.c @@ -0,0 +1,425 @@ +/* { dg-do run } */ +/* { dg-options "-mlsx -w -fno-strict-aliasing" } */ +#include "../simd_correctness_check.h" +#include + +int +main () +{ + __m128i __m128i_op0, __m128i_op1, __m128i_op2, __m128i_out, __m128i_result; + __m128 __m128_op0, __m128_op1, __m128_op2, __m128_out, __m128_result; + __m128d __m128d_op0, __m128d_op1, __m128d_op2, __m128d_out, __m128d_result; + + int int_op0, int_op1, int_op2, int_out, int_result, i = 1, fail; + long int long_op0, long_op1, long_op2, lont_out, lont_result; + long int long_int_out, long_int_result; + unsigned int unsigned_int_out, unsigned_int_result; + unsigned long int unsigned_long_int_out, unsigned_long_int_result; + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x00003f803f800100; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsigncov_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000001; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsigncov_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsigncov_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x52527d7d52527d7d; + *((unsigned long *)&__m128i_op1[0]) = 0x52527d7d52527d7d; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsigncov_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x870968c1f56bb3cd; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsigncov_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xf000e001bf84df83; + *((unsigned long *)&__m128i_op0[0]) = 0xfff8e001ff84e703; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000ca354688; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xffffffff35cab978; + __m128i_out = __lsx_vsigncov_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_op1[0]) = 0x6a57a30ff0000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsigncov_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x000000000000000d; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsigncov_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfe00fe00fe00fd01; + *((unsigned long *)&__m128i_op0[0]) = 0xfe00fffefe0100f6; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffff00000001; + *((unsigned long *)&__m128i_op1[0]) = 0xffffff0000010000; + *((unsigned long *)&__m128i_result[1]) = 0x0100010000000001; + *((unsigned long *)&__m128i_result[0]) = 0x0100010000010000; + __m128i_out = __lsx_vsigncov_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsigncov_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000020000000; + *((unsigned long *)&__m128i_op0[0]) = 0x000000183fffffe5; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000400000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000400000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsigncov_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffff3d06ffff4506; + *((unsigned long *)&__m128i_op1[0]) = 0x7ffffffe7ffff800; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsigncov_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x000a000a000a000a; + *((unsigned long *)&__m128i_op1[0]) = 0x000a000a000a000a; + *((unsigned long *)&__m128i_result[1]) = 0xfff6fff6fff6fff6; + *((unsigned long *)&__m128i_result[0]) = 0xfff6fff6fff6fff6; + __m128i_out = __lsx_vsigncov_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsigncov_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x3fffff0000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x3fffff0000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x3f8000003f800000; + *((unsigned long *)&__m128i_op1[0]) = 0x3f8000003f800000; + *((unsigned long *)&__m128i_result[1]) = 0x3f80000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x3f80000000000000; + __m128i_out = __lsx_vsigncov_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfff8fff8fff8fff8; + *((unsigned long *)&__m128i_op0[0]) = 0xfff8fff8fff8fff8; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsigncov_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsigncov_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsigncov_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x52525252525252cb; + *((unsigned long *)&__m128i_op1[0]) = 0x52525252525252cb; + *((unsigned long *)&__m128i_result[1]) = 0xaeaeaeaeaeaeae35; + *((unsigned long *)&__m128i_result[0]) = 0xaeaeaeaeaeaeae35; + __m128i_out = __lsx_vsigncov_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsigncov_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x370bdfecffecffec; + *((unsigned long *)&__m128i_op0[0]) = 0x370bdfecffecffec; + *((unsigned long *)&__m128i_op1[1]) = 0x370bdfecffecffec; + *((unsigned long *)&__m128i_op1[0]) = 0x370bdfecffecffec; + *((unsigned long *)&__m128i_result[1]) = 0x370bdfec00130014; + *((unsigned long *)&__m128i_result[0]) = 0x370bdfec00130014; + __m128i_out = __lsx_vsigncov_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0002020002020200; + *((unsigned long *)&__m128i_op0[0]) = 0x021f3b0205150600; + *((unsigned long *)&__m128i_op1[1]) = 0x0001000300400002; + *((unsigned long *)&__m128i_op1[0]) = 0x000100010040fffb; + *((unsigned long *)&__m128i_result[1]) = 0x0001000300400002; + *((unsigned long *)&__m128i_result[0]) = 0x000100010040fffb; + __m128i_out = __lsx_vsigncov_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsigncov_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000000ff801c9e; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000810000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsigncov_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsigncov_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0080008000800080; + *((unsigned long *)&__m128i_op1[0]) = 0x008003496dea0c61; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsigncov_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsigncov_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsigncov_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0101000100010001; + *((unsigned long *)&__m128i_op0[0]) = 0x0101030100010001; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsigncov_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000400000004; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000400000004; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000400000004; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000400000004; + *((unsigned long *)&__m128i_result[1]) = 0x0000000400000004; + *((unsigned long *)&__m128i_result[0]) = 0x0000000400000004; + __m128i_out = __lsx_vsigncov_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0xfffffffffffffffc; + *((unsigned long *)&__m128i_op1[0]) = 0xfffffffffffffffc; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000004; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000004; + __m128i_out = __lsx_vsigncov_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfffffffffffffffc; + *((unsigned long *)&__m128i_op0[0]) = 0xfffffffffffffffc; + *((unsigned long *)&__m128i_op1[1]) = 0x1ab6021f72496458; + *((unsigned long *)&__m128i_op1[0]) = 0x7750af4954c29940; + *((unsigned long *)&__m128i_result[1]) = 0xe64afee18eb79ca8; + *((unsigned long *)&__m128i_result[0]) = 0x89b051b7ac3e67c0; + __m128i_out = __lsx_vsigncov_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsigncov_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x441ba9fcffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0x181b2541ffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x7fffffff7ffffffe; + *((unsigned long *)&__m128i_op1[0]) = 0x7fffffff7ffffffe; + *((unsigned long *)&__m128i_result[1]) = 0x7fff010181010102; + *((unsigned long *)&__m128i_result[0]) = 0x7fffffff81010102; + __m128i_out = __lsx_vsigncov_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000000045340a6; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000028404044; + *((unsigned long *)&__m128i_op1[1]) = 0x003f0000ffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0x003f0000ffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x00000000ffffffff; + __m128i_out = __lsx_vsigncov_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0010001000000010; + *((unsigned long *)&__m128i_op0[0]) = 0x0010001000100010; + *((unsigned long *)&__m128i_op1[1]) = 0x67eb85afb2ebb000; + *((unsigned long *)&__m128i_op1[0]) = 0xc8847ef6ed3f2000; + *((unsigned long *)&__m128i_result[1]) = 0x67eb85af0000b000; + *((unsigned long *)&__m128i_result[0]) = 0xc8847ef6ed3f2000; + __m128i_out = __lsx_vsigncov_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000100000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000103; + *((unsigned long *)&__m128i_op1[1]) = 0xfffffffffffffffc; + *((unsigned long *)&__m128i_op1[0]) = 0xfffffffffffffffc; + *((unsigned long *)&__m128i_result[1]) = 0xfffffffffffffffc; + *((unsigned long *)&__m128i_result[0]) = 0xfffffffffffffffc; + __m128i_out = __lsx_vsigncov_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfffffffffffffffc; + *((unsigned long *)&__m128i_op0[0]) = 0xfffffffffffffffc; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000100000001; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsigncov_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsigncov_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000034; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_op1[0]) = 0x003ffffe00800000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsigncov_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x004001be00dc008e; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00ffff0100010001; + __m128i_out = __lsx_vsigncov_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xfff9fffefff9ffff; + *((unsigned long *)&__m128i_op1[1]) = 0x04faf60009f5f092; + *((unsigned long *)&__m128i_op1[0]) = 0x04fafa9200000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xfc06066e00000000; + __m128i_out = __lsx_vsigncov_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000fffe0002; + *((unsigned long *)&__m128i_op1[1]) = 0x000000000667ae56; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000020; + *((unsigned long *)&__m128i_result[1]) = 0x000000000667ae56; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000020; + __m128i_out = __lsx_vsigncov_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0002000100020002; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0002000100020002; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0002000100020002; + __m128i_out = __lsx_vsigncov_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0001000100010012; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000ffe1ffc0; + *((unsigned long *)&__m128i_op1[1]) = 0x0001000100010012; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000ffe1ffc0; + *((unsigned long *)&__m128i_result[1]) = 0x0001000100010012; + *((unsigned long *)&__m128i_result[0]) = 0x00000000ffe1ffc0; + __m128i_out = __lsx_vsigncov_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +}