From patchwork Wed Sep 13 03:31:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: chenxiaolong X-Patchwork-Id: 138578 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9ecd:0:b0:3f2:4152:657d with SMTP id t13csp829852vqx; Tue, 12 Sep 2023 20:32:52 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEG3BV+Ywoypj5h5Pbl2qXocnJB5wRqLnAOTPkswQjm+UZ2qG0OZiCyMkB2m5/DdRNKn+n+ X-Received: by 2002:a05:6402:493:b0:525:644f:134b with SMTP id k19-20020a056402049300b00525644f134bmr1064468edv.25.1694575972615; Tue, 12 Sep 2023 20:32:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694575972; cv=none; d=google.com; s=arc-20160816; b=nvo6Y7Wj97DCq652nvrJjejrbY0jxnNao09OoYoU977hYL/6vZmG8CZuuFPdhaR+ip h/jaGwpnNq6Ywr/rs2JSmYvOrloM4rjDamqdtEGCS6M+3aBKt+RtgrdDW0dJwpkUCk8a jYJM8OP50v9ww9v13aXj2vkmiMkgGsGHMcA7QsSqe0g+qClMe/6w14LwzsDI2U6kyZOV vTZzKvSkvhvZ57Nsm4wjNfw1G4OmqFFFLjmtzOp3RcB20LOqvI8bitM44McHEaBlSiai 3k6vfY5orh3gjILjKn0gcSMCROFHnXAu4sDfgYG+2Kc9jpfme6pNp/juP2irkF436R+8 THtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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:cc:to :from:dmarc-filter:delivered-to; bh=R7V73w2jK8oRRkWKth5D455cY8tZTNMUbYiRVEfG9go=; fh=3pFUYcpS/27XRzOf17GfR86AuNQu+P1CET04YURgCLs=; b=CQkSS01DeyEj5IEozHr+hCK21exVMaSiRx7U0VSchxe1SNkRenANU6/Z+83/PP4JvB otUkwyaKXwoRi0jA5D+tfNOkssRI4WoIQTlkosTZmBBCkQkfP6Yvxh6nfR83Z7nGYXD/ VI85pkrQn2AofI/oyjK0PLf/Aknv2kTbW7BTkIDEbKw9sOAw1/3JcWi3IChuBMEjIFX6 zY9EzfOMfZfinRNUrmmEtAbkknB/6gZh2/Vf4arKSr8kkZSBmUQivTxTDalImR7kEVzL a3SNwhECzJL1KGu8bnBgHO6tMtIjQIVWe1y5nWi0YHoQn3h5j3opaeQejMlMrGUK20XJ E++g== 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 a6-20020aa7d746000000b00522205a4d35si9381100eds.103.2023.09.12.20.32.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Sep 2023 20:32:52 -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 67FF9385DC0B for ; Wed, 13 Sep 2023 03:32:27 +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 4B6A93858D3C for ; Wed, 13 Sep 2023 03:32:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4B6A93858D3C 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 _____8CxyOguLQFlJzAmAA--.38406S3; Wed, 13 Sep 2023 11:31:58 +0800 (CST) Received: from slurm-master.loongson.cn (unknown [10.10.130.252]) by localhost.localdomain (Coremail) with SMTP id AQAAf8BxrdwqLQFlxQ4CAA--.3491S5; Wed, 13 Sep 2023 11:31:57 +0800 (CST) From: Xiaolong Chen To: gcc-patches@gcc.gnu.org Cc: xry111@xry111.site, i@xen0n.name, xuchenghua@loongson.cn, chenglulu@loongson.cn, Xiaolong Chen Subject: [PATCH v4 01/23] LoongArch: Add tests of -mstrict-align option. Date: Wed, 13 Sep 2023 11:31:26 +0800 Message-Id: <20230913033148.5752-2-chenxiaolong@loongson.cn> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230913033148.5752-1-chenxiaolong@loongson.cn> References: <20230913033148.5752-1-chenxiaolong@loongson.cn> MIME-Version: 1.0 X-CM-TRANSID: AQAAf8BxrdwqLQFlxQ4CAA--.3491S5 X-CM-SenderInfo: hfkh05xldrz0tqj6z05rqj20fqof0/1tbiAQANBWUBHCIA6AAAs7 X-Coremail-Antispam: 1Uk129KBj9xXoWruw4kJw4fJw13Zw13Gw13Jrc_yoWfJrcEyF y7X3s3Gr4Uua1xCFW0vryUCF9akws3XFySqFWFqFs7XFyDXFs0yFWDJFZrZFyjkr18JFZx Ga9avrnayF9xtosvyTuYvTs0mTUanT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUj1kv1TuYvT s0mT0YCTnIWjqI5I8CrVACY4xI64kE6c02F40Ex7xfYxn0WfASr-VFAUDa7-sFnT9fnUUI cSsGvfJTRUUUb7AYFVCjjxCrM7AC8VAFwI0_Jr0_Gr1l1xkIjI8I6I8E6xAIw20EY4v20x vaj40_Wr0E3s1l1IIY67AEw4v_JrI_Jryl8cAvFVAK0II2c7xJM28CjxkF64kEwVA0rcxS w2x7M28EF7xvwVC0I7IYx2IY67AKxVWUCVW8JwA2z4x0Y4vE2Ix0cI8IcVCY1x0267AKxV W8JVWxJwA2z4x0Y4vEx4A2jsIE14v26r4UJVWxJr1l84ACjcxK6I8E87Iv6xkF7I0E14v2 6r4UJVWxJr1le2I262IYc4CY6c8Ij28IcVAaY2xG8wAqjxCEc2xF0cIa020Ex4CE44I27w Aqx4xG64xvF2IEw4CE5I8CrVC2j2WlYx0E2Ix0cI8IcVAFwI0_JF0_Jw1lYx0Ex4A2jsIE 14v26r1j6r4UMcvjeVCFs4IE7xkEbVWUJVW8JwACjcxG0xvY0x0EwIxGrwCF04k20xvY0x 0EwIxGrwCFx2IqxVCFs4IE7xkEbVWUJVW8JwC20s026c02F40E14v26r1j6r18MI8I3I0E 7480Y4vE14v26r106r1rMI8E67AF67kF1VAFwI0_JF0_Jw1lIxkGc2Ij64vIr41lIxAIcV C0I7IYx2IY67AKxVWUJVWUCwCI42IY6xIIjxv20xvEc7CjxVAFwI0_Jr0_Gr1lIxAIcVCF 04k26cxKx2IYs7xG6r1j6r1xMIIF0xvEx4A2jsIE14v26r1j6r4UMIIF0xvEx4A2jsIEc7 CjxVAFwI0_Jr0_GrUvcSsGvfC2KfnxnUUI43ZEXa7IU8wNVDUUUUU== 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: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1776891695040718541 X-GMAIL-MSGID: 1776891695040718541 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 Wed Sep 13 03:31:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: chenxiaolong X-Patchwork-Id: 138579 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9ecd:0:b0:3f2:4152:657d with SMTP id t13csp830119vqx; Tue, 12 Sep 2023 20:33:41 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFkT18iSAGFGfwKC+XnuW7EiZc0EQVXTh38odfn5idnnFJ9qop9r75n0Rx7l77QL6Uo/bhS X-Received: by 2002:a17:906:9c1:b0:9a2:2635:daa8 with SMTP id r1-20020a17090609c100b009a22635daa8mr1046058eje.56.1694576021271; Tue, 12 Sep 2023 20:33:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694576021; cv=none; d=google.com; s=arc-20160816; b=0Ii5OKr/vm451Pz+/ebcQZvujV9GYIEf5mkPbO6+d2phmMRTZft4mGUMbRj3THNfeT Bs3h4799MFR6jA+IvBJORsW//83ftzlDCiVOwRybSPRKhmM48O2wAFuCRsFQWLSVo+14 JkRnKZFftpZc9DEY3ksAzbP1IxoKS53GkMhegXMSHrzyOb9iVDwMfoFFvoNJ1r6qbK3K Ix812HTxSiIwcCabyGotuWz09hdIX612Mgp5rLsKoeGKtLkd/Ef0gpDUE5XJJKjxVGku dc18BzhK4ezY5v+3qkji7c1nHWz2342d+VdvQuLTl15JJ+Um3bXzg0YzBUdTnkqbnV36 uwEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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:cc:to :from:dmarc-filter:delivered-to; bh=FrgN5TuoS7UONcFDNRlHlCFtqCDnpD/i2+aVlrbe89M=; fh=3pFUYcpS/27XRzOf17GfR86AuNQu+P1CET04YURgCLs=; b=Af2tWfhwvHlcKCZDt83P96eFSyuJCJHb5NkwIx/PMsxiahUObyfcFz5ZDZfpXqufc5 KKUBu/+UPDuKTxmJoOjv9/Vnuo7mVyJsi0QjY2+DnwIKaD/1Nn5mdhEVj8S1aKtd5QnF EIdjRkhhL3Uz+13O3qQdS2udt5itNYeSbQGyk3RZdEUw6ry6fOgcD3x7BoTgoDjrR1+I XDNmE+ZH3+ehonu4QI9g0wp4ERhSdmCb95y2aZjGIRgJou3c0uWZgzvmYpg5h4SNu+Wh c+VmqN8ujv+0kxgxCzZkX/tuOHVnfBhlJHYmkC/I5lx/Qet519w0RJHdEkqij0CSXttK LGxA== 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 si9-20020a170906cec900b009a1f53509a7si10256999ejb.135.2023.09.12.20.33.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Sep 2023 20:33:41 -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 E8B5838319E7 for ; Wed, 13 Sep 2023 03:32:41 +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 6C1E73857C40 for ; Wed, 13 Sep 2023 03:32:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6C1E73857C40 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 1qgGbn-0000zU-7w for gcc-patches@gcc.gnu.org; Tue, 12 Sep 2023 23:32:11 -0400 Received: from loongson.cn (unknown [10.10.130.252]) by gateway (Coremail) with SMTP id _____8Dx_7sxLQFlKjAmAA--.15081S3; Wed, 13 Sep 2023 11:32:01 +0800 (CST) Received: from slurm-master.loongson.cn (unknown [10.10.130.252]) by localhost.localdomain (Coremail) with SMTP id AQAAf8BxrdwqLQFlxQ4CAA--.3491S6; Wed, 13 Sep 2023 11:32:00 +0800 (CST) From: Xiaolong Chen To: gcc-patches@gcc.gnu.org Cc: xry111@xry111.site, i@xen0n.name, xuchenghua@loongson.cn, chenglulu@loongson.cn, Xiaolong Chen Subject: [PATCH v4 02/23] LoongArch: Add testsuite framework for Loongson SX/ASX. Date: Wed, 13 Sep 2023 11:31:27 +0800 Message-Id: <20230913033148.5752-3-chenxiaolong@loongson.cn> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230913033148.5752-1-chenxiaolong@loongson.cn> References: <20230913033148.5752-1-chenxiaolong@loongson.cn> MIME-Version: 1.0 X-CM-TRANSID: AQAAf8BxrdwqLQFlxQ4CAA--.3491S6 X-CM-SenderInfo: hfkh05xldrz0tqj6z05rqj20fqof0/1tbiAQANBWUBHCIA6gAAs5 X-Coremail-Antispam: 1Uk129KBj93XoWxZw4UXrykCr45CFWkXr4DKFX_yoWrJF1kpa y7Zr1a9F4xWa9xWrnrWay5AF45AFn7GFWavFyft3yUCry7t3sFvFn5KrsxXFy3Ja45Ar4F g3Zxuw1UJan8ZabCm3ZEXasCq-sJn29KB7ZKAUJUUUUU529EdanIXcx71UUUUU7KY7ZEXa sCq-sGcSsGvfJ3Ic02F40EFcxC0VAKzVAqx4xG6I80ebIjqfuFe4nvWSU5nxnvy29KBjDU 0xBIdaVrnRJUUUkFb4IE77IF4wAFF20E14v26r1j6r4UM7CY07I20VC2zVCF04k26cxKx2 IYs7xG6rWj6s0DM7CIcVAFz4kK6r106r15M28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48v e4kI8wA2z4x0Y4vE2Ix0cI8IcVAFwI0_Gr0_Xr1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI 0_Gr0_Cr1l84ACjcxK6I8E87Iv67AKxVW8Jr0_Cr1UM28EF7xvwVC2z280aVCY1x0267AK xVW8Jr0_Cr1UM2AIxVAIcxkEcVAq07x20xvEncxIr21l57IF6xkI12xvs2x26I8E6xACxx 1l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r126r1DMcIj6I8E87Iv 67AKxVWUJVW8JwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IYc2Ij64vIr41l42xK82IYc2 Ij64vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2IqxVAqx4xG67AKxVWUJVWUGwC20s02 6x8GjcxK67AKxVWUGVWUWwC2zVAF1VAY17CE14v26r126r1DMIIYrxkI7VAKI48JMIIF0x vE2Ix0cI8IcVAFwI0_JFI_Gr1lIxAIcVC0I7IYx2IY6xkF7I0E14v26r1j6r4UMIIF0xvE 42xK8VAvwI8IcIk0rVWUJVWUCwCI42IY6I8E87Iv67AKxVWUJVW8JwCI42IY6I8E87Iv6x kF7I0E14v26r1j6r4UYxBIdaVFxhVjvjDU0xZFpf9x07j1LvtUUUUU= 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: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1776891745867025799 X-GMAIL-MSGID: 1776891745867025799 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..2cbf9ac6ac1 --- /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 "" +} + +#Initialize `dg'. +dg-init + +#Main loop. +dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/lsx/*.\[cS\]]] \ + "-mlsx" $DEFAULT_CFLAGS +dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/lasx/*.\[cS\]]] \ + "-mlasx" $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 Wed Sep 13 03:31:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: chenxiaolong X-Patchwork-Id: 138580 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9ecd:0:b0:3f2:4152:657d with SMTP id t13csp830180vqx; Tue, 12 Sep 2023 20:33:54 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFK3W81bo5Ma07o9AwRS8AbYbn0ZUUEU95ejsgJdIXEJQC/f7XVwAsgy8/ZqhXH74D/3Ngw X-Received: by 2002:a17:907:908a:b0:9ad:8a96:ad55 with SMTP id ge10-20020a170907908a00b009ad8a96ad55mr3662803ejb.14.1694576033932; Tue, 12 Sep 2023 20:33:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694576033; cv=none; d=google.com; s=arc-20160816; b=PmExtIeUfZEXNcmew7m/eNZ7akpEL2Hm+BF0qEtte6TFS6z7f2UhGUYra+VKhpm5YL +kATG6OPaV0eq6mfYNFt6jZWqp7z5vXgpVemiVT/eayoUsL/k8+ttt8OgdLHQ79ruKqF 6mUkrw/84Xg4FQT6x41CgrG/FForfYX7VA42H6m6RjG+nK180usIGTbxzFQw1Pq+ZMKf OKsohuoZIeukapWEa/pLe+P1gtfphi/AyYFeARF9ExIpeeAQe0g1lEGB2Z5zktLQhROk dJAq0knNsq5W0rSNpMaw4hclTKPTNdxfHDDpvQIS/cpqTY3Hi90vAnkDo48xCoSWx08b Jtkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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:cc:to :from:dmarc-filter:delivered-to; bh=wnETXNFniWvajU6kYiT+ggx76ViOnIyvx6AYqtUqEp4=; fh=3pFUYcpS/27XRzOf17GfR86AuNQu+P1CET04YURgCLs=; b=QVtBEX8oQboxVx/3KFE5sBt1qudOk9UeXSb8FzW+8lMYRsBWvGe3AiND13HHd+mMrz CTOEJl+aGhmmMSSeSYzz5gH2OTl9ZCkrovFNoxfwAuHcyNZZo8/JEDDCX1acmINPwoyQ 7x2oENFXgMYKG0I61BFDOGo4MC/WHyte8shUywQKgxaKSM14jvmt3qjzpQ3fMVOK6wu7 7O0XbdYvi/CkGZoqpt5/8bTjPEyorI8DmAG7dPUOT30kqn2+gZxy85dDrENMbR9/+cq1 Vklpg0VJoiXFVZHspQRsM4t/+U9+2V6O1PKH6Z/MF5aix5LtSXR7/WGl33bYJ7ES28Ko 5GrA== 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 qu15-20020a170907110f00b0099b56bacec3si10132687ejb.955.2023.09.12.20.33.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Sep 2023 20:33:53 -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 582073830B59 for ; Wed, 13 Sep 2023 03:32: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 E2DC33858C2F for ; Wed, 13 Sep 2023 03:32:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E2DC33858C2F 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 _____8BxuOg0LQFlLjAmAA--.38435S3; Wed, 13 Sep 2023 11:32:04 +0800 (CST) Received: from slurm-master.loongson.cn (unknown [10.10.130.252]) by localhost.localdomain (Coremail) with SMTP id AQAAf8BxrdwqLQFlxQ4CAA--.3491S7; Wed, 13 Sep 2023 11:32:03 +0800 (CST) From: Xiaolong Chen To: gcc-patches@gcc.gnu.org Cc: xry111@xry111.site, i@xen0n.name, xuchenghua@loongson.cn, chenglulu@loongson.cn, Xiaolong Chen Subject: [PATCH v4 03/23] LoongArch: Add tests for Loongson SX builtin functions. Date: Wed, 13 Sep 2023 11:31:28 +0800 Message-Id: <20230913033148.5752-4-chenxiaolong@loongson.cn> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230913033148.5752-1-chenxiaolong@loongson.cn> References: <20230913033148.5752-1-chenxiaolong@loongson.cn> MIME-Version: 1.0 X-CM-TRANSID: AQAAf8BxrdwqLQFlxQ4CAA--.3491S7 X-CM-SenderInfo: hfkh05xldrz0tqj6z05rqj20fqof0/1tbiAQANBWUBHCIA7AAAs- X-Coremail-Antispam: 1Uk129KBj9DXoWkGr4xWFy7Cry3tFyrur47WrX_yoW8GF4fZr XEgF42gr4DZF1qyrW2y3yxJ348Xa9xGr1jv34fXa48AF13Jr1Dua1vqw1kur18X3y7JF9x J3Z5WFy7CF4UXFWqgosvyTuYvTs0mTUanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUj1kv1T uYvTs0mT0YCTnIWjqI5I8CrVACY4xI64kE6c02F40Ex7xfYxn0WfASr-VFAUDa7-sFnT9f nUUIcSsGvfJTRUUUb7AYFVCjjxCrM7AC8VAFwI0_Jr0_Gr1l1xkIjI8I6I8E6xAIw20EY4 v20xvaj40_Wr0E3s1l1IIY67AEw4v_Jr0_Jr4l8cAvFVAK0II2c7xJM28CjxkF64kEwVA0 rcxSw2x7M28EF7xvwVC0I7IYx2IY67AKxVW8JVW5JwA2z4x0Y4vE2Ix0cI8IcVCY1x0267 AKxVW8JVWxJwA2z4x0Y4vEx4A2jsIE14v26r4UJVWxJr1l84ACjcxK6I8E87Iv6xkF7I0E 14v26r4UJVWxJr1le2I262IYc4CY6c8Ij28IcVAaY2xG8wAqjxCEc2xF0cIa020Ex4CE44 I27wAqx4xG64xvF2IEw4CE5I8CrVC2j2WlYx0E2Ix0cI8IcVAFwI0_Jw0_WrylYx0Ex4A2 jsIE14v26r4j6F4UMcvjeVCFs4IE7xkEbVWUJVW8JwACjcxG0xvY0x0EwIxGrwCF04k20x vY0x0EwIxGrwCFx2IqxVCFs4IE7xkEbVWUJVW8JwC20s026c02F40E14v26r1j6r18MI8I 3I0E7480Y4vE14v26r106r1rMI8E67AF67kF1VAFwI0_JF0_Jw1lIxkGc2Ij64vIr41lIx AIcVC0I7IYx2IY67AKxVWUCVW8JwCI42IY6xIIjxv20xvEc7CjxVAFwI0_Jr0_Gr1lIxAI cVCF04k26cxKx2IYs7xG6r1j6r1xMIIF0xvEx4A2jsIE14v26r1j6r4UMIIF0xvEx4A2js IEc7CjxVAFwI0_Jr0_GrUvcSsGvfC2KfnxnUUI43ZEXa7IU84xRDUUUUU== X-Spam-Status: No, score=-12.6 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: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1776891759391779138 X-GMAIL-MSGID: 1776891759391779138 gcc/testsuite/ChangeLog: * gcc.target/loongarch/vector/lsx/lsx-builtin.c: New test. --- .../loongarch/vector/lsx/lsx-builtin.c | 1461 +++++++++++++++++ 1 file changed, 1461 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..70f5000b29f --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-builtin.c @@ -0,0 +1,1461 @@ +/* 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 Wed Sep 13 03:31:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: chenxiaolong X-Patchwork-Id: 138581 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9ecd:0:b0:3f2:4152:657d with SMTP id t13csp830921vqx; Tue, 12 Sep 2023 20:36:17 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFOTBU1X1W2iSW/XmlKCbmW/pXWYtB1OIvUkpb2t9xCKbHYdV+SphKtXrc/3bXbpJnJmWGH X-Received: by 2002:a05:6402:b0e:b0:527:237d:3765 with SMTP id bm14-20020a0564020b0e00b00527237d3765mr1136437edb.26.1694576177632; Tue, 12 Sep 2023 20:36:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694576177; cv=none; d=google.com; s=arc-20160816; b=c9vzY/lzja9TeGiEKtv0Jw7UolBYDDuQq8uECsiwd7z62eOvrd06+QJF3v0WDEeKdB Naj3Z8Ae/1ky1Xs8t3K6/Km6mE03abH5B+CTAkPYTqF8GF17+aPlrTrXkpWm+c313HWQ on911jsGuCIryvSh7tEkFl4g2PQ7j7slGdnrZBm7CwgJWlRQxnkZlOHDHa/4juWpBs3L 1KNDi2761kgN2ax15zqeS2RsXuzAZf3WWxIX1a/iUyML+zX0gflZjpIxXoiNoxvE4yz4 wA2sd1vmsq20BhcpTY5irf3YbpgQF9RK7adozQYc1ZU89ko9I3IaOGMYAmseLfTljMYI bjEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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:cc:to :from:dmarc-filter:delivered-to; bh=eaOdaGvwPivkVrf8WBQINX2S2BUbtcKsA+RCac3Vppg=; fh=3pFUYcpS/27XRzOf17GfR86AuNQu+P1CET04YURgCLs=; b=Wbp+yU65sADjjZr2DI2j3dLUtcVgziewDgpF3w5WgpvkemCmhuAkA8BXFZnkrG5tf0 itijdXdASNEKLiRRqazUJ8RM3vS89tZ42D8lyp/qFDgnRNRSN8Pfcqq/mhjUoBrc0qQR S9nzUTkeK6GhVpsVA9B1H7bCKZfujmbSJ2RVDXocaSyM8IjZJNGMWu1mTNwG8AXbtmpV IFu8KtWDGJkfzLa4kgJOAlUUTGf6uKBAl6G5iILKJ6rlatnZ9S9RNqntraVrWen2/fs6 e58Ww8s3woZHYPjnO0TX6G5OgXy3sALVEgQnkmvQMnsOhLVEXUwTN9iCAMicppcP207W aWIw== 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 v2-20020a056402184200b005222a65b38esi8978110edy.66.2023.09.12.20.36.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Sep 2023 20:36:17 -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 30B9D3889E09 for ; Wed, 13 Sep 2023 03:33:23 +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 C2450385842C for ; Wed, 13 Sep 2023 03:32:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C2450385842C 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 _____8CxtPA3LQFlMjAmAA--.9510S3; Wed, 13 Sep 2023 11:32:07 +0800 (CST) Received: from slurm-master.loongson.cn (unknown [10.10.130.252]) by localhost.localdomain (Coremail) with SMTP id AQAAf8BxrdwqLQFlxQ4CAA--.3491S8; Wed, 13 Sep 2023 11:32:06 +0800 (CST) From: Xiaolong Chen To: gcc-patches@gcc.gnu.org Cc: xry111@xry111.site, i@xen0n.name, xuchenghua@loongson.cn, chenglulu@loongson.cn, Xiaolong Chen Subject: [PATCH v4 04/23] LoongArch: Add tests for SX vector floating-point instructions. Date: Wed, 13 Sep 2023 11:31:29 +0800 Message-Id: <20230913033148.5752-5-chenxiaolong@loongson.cn> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230913033148.5752-1-chenxiaolong@loongson.cn> References: <20230913033148.5752-1-chenxiaolong@loongson.cn> MIME-Version: 1.0 X-CM-TRANSID: AQAAf8BxrdwqLQFlxQ4CAA--.3491S8 X-CM-SenderInfo: hfkh05xldrz0tqj6z05rqj20fqof0/1tbiAQANBWUBHCIA7gAAs9 X-Coremail-Antispam: 1Uk129KBj9UXoW7Xw47Zw1rXF18p5X_GFWDXF17pr17Xr13Gr W8AayYyrWUtFy2vF95Ar92yas7Jr17J3sFkw1DKF9xXr47C34UAr4Dt3W7XFy3trn8GF4U tr4UJwcCm3ZEXasCq-sJn29KB7ZKAUJUUUUU529EdanIXcx71UUUUU7KY7ZEXasCq-sGcS sGvfJ3Ic02F40EFcxC0VAKzVAqx4xG6I80ebIjqfuFe4nvWSU5nxnvy29KBjDU0xBIdaVr nRJUUUk2b4IE77IF4wAFF20E14v26r1j6r4UM7CY07I20VC2zVCF04k26cxKx2IYs7xG6r Wj6s0DM7CIcVAFz4kK6r1j6r18M28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48ve4kI8wA2 z4x0Y4vE2Ix0cI8IcVAFwI0_Gr0_Xr1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI0_Gr0_Cr 1l84ACjcxK6I8E87Iv67AKxVW8Jr0_Cr1UM28EF7xvwVC2z280aVCY1x0267AKxVW8Jr0_ Cr1UM2AIxVAIcxkEcVAq07x20xvEncxIr21l57IF6xkI12xvs2x26I8E6xACxx1l5I8CrV ACY4xI64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r1q6rW5McIj6I8E87Iv67AKxVW8 JVWxJwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IYc2Ij64vIr41l42xK82IYc2Ij64vIr4 1l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2IqxVAqx4xG67AKxVWUJVWUGwC20s026x8GjcxK 67AKxVWUGVWUWwC2zVAF1VAY17CE14v26r126r1DMIIYrxkI7VAKI48JMIIF0xvE2Ix0cI 8IcVAFwI0_Gr0_Xr1lIxAIcVC0I7IYx2IY6xkF7I0E14v26r4j6F4UMIIF0xvE42xK8VAv wI8IcIk0rVWUJVWUCwCI42IY6I8E87Iv67AKxVW8JVWxJwCI42IY6I8E87Iv6xkF7I0E14 v26r4j6r4UJbIYCTnIWIevJa73UjIFyTuYvjxU2F4iUUUUU X-Spam-Status: No, score=-12.6 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: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1776891909986735524 X-GMAIL-MSGID: 1776891909986735524 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 Wed Sep 13 03:31:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: chenxiaolong X-Patchwork-Id: 138582 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9ecd:0:b0:3f2:4152:657d with SMTP id t13csp831006vqx; Tue, 12 Sep 2023 20:36:35 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFL/1+FS/bX3gPIgCwg4l2rpnJV+XHbZg0VO8oosJVfwC8A3OBg1SbSORa4kFgWpZayOF6N X-Received: by 2002:a17:907:869e:b0:9a9:9d19:b250 with SMTP id qa30-20020a170907869e00b009a99d19b250mr6082156ejc.17.1694576194793; Tue, 12 Sep 2023 20:36:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694576194; cv=none; d=google.com; s=arc-20160816; b=dPNkajEMexmyMezNVl6idNTKHf9fqHwlxT+jElnGK53d7MaWLcUdi1Sibf162oL5qu gYBpqo9wdafOKjtUeqKWmMeuxIDQfD+szbQQQGMa+rN99qsB5CQGmhu88yVWEDgVd7Nj hGFVXSkG4IVokDM5qZ9WqT+yDmQuCBy6PBP3mArrZhhZ6Hpr1dAW+VjXu4jlUdN6mb6h WvaFf2SYEzf10wgafPJjgCNzbyDLGxaYVJhXtihj2207aokjzDJGqhvr8rBPMEs2Q/xI WYx2IudCfKQ1lEJsRpXV6PTVEocAoT4iz423jgmOS4XTj3UiQ5qoBUwFFBG0y3FwS1Jo 6jPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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:cc:to :from:dmarc-filter:delivered-to; bh=nIReRXveJdFIBKQl/BShY+L7H8D3qOh36YE90Zqe2uU=; fh=3pFUYcpS/27XRzOf17GfR86AuNQu+P1CET04YURgCLs=; b=PbDuQpzk91dSIbA+2hs+oB1SPdXoRovZcfxcWGkJTh3yNuQT89JXHFSInhLmkJF8Cm 460rzBK4UPND2r1hnCKNlmnCAEphg9Mlty+EJE1LdrLhMhCI66Cw89hJg4yAkk3vaJtC dd7GXHO+aGn4KjIghxf0fNuiVokr8lqEW21An/R3YgamS25lQ5GRTlUyjZ7HmXAoHvgD /hnowLhp5ynSM3j42W6Juy65ot8CHoxbi0axXxnKuJyp3ZxlgeRsUpyNGsyu9S/fOMU0 IhN9iKDKfrWl0o462B1kl7TJhmkONxF6aVTV77UiONfAurmQG7dIvydPo8VCXpZCmD0E b5/Q== 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 y17-20020a1709060a9100b0098df1cbe2aesi9071382ejf.1008.2023.09.12.20.36.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Sep 2023 20:36:34 -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 D9D09388A412 for ; Wed, 13 Sep 2023 03:33:27 +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 57508385B527 for ; Wed, 13 Sep 2023 03:32:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 57508385B527 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 1qgGbt-00010C-Cu for gcc-patches@gcc.gnu.org; Tue, 12 Sep 2023 23:32:20 -0400 Received: from loongson.cn (unknown [10.10.130.252]) by gateway (Coremail) with SMTP id _____8Axueo5LQFlNjAmAA--.64288S3; Wed, 13 Sep 2023 11:32:09 +0800 (CST) Received: from slurm-master.loongson.cn (unknown [10.10.130.252]) by localhost.localdomain (Coremail) with SMTP id AQAAf8BxrdwqLQFlxQ4CAA--.3491S9; Wed, 13 Sep 2023 11:32:08 +0800 (CST) From: Xiaolong Chen To: gcc-patches@gcc.gnu.org Cc: xry111@xry111.site, i@xen0n.name, xuchenghua@loongson.cn, chenglulu@loongson.cn, Xiaolong Chen Subject: [PATCH v4 05/23] LoongArch: Add tests for SX vector addition instructions. Date: Wed, 13 Sep 2023 11:31:30 +0800 Message-Id: <20230913033148.5752-6-chenxiaolong@loongson.cn> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230913033148.5752-1-chenxiaolong@loongson.cn> References: <20230913033148.5752-1-chenxiaolong@loongson.cn> MIME-Version: 1.0 X-CM-TRANSID: AQAAf8BxrdwqLQFlxQ4CAA--.3491S9 X-CM-SenderInfo: hfkh05xldrz0tqj6z05rqj20fqof0/1tbiAQANBWUBHCIA8AAAsj X-Coremail-Antispam: 1Uk129KBj97XoW8CF15uF45Gr48ZF45GoXrprW7urWDXoWUAa 4UZw4rCFZxX3W5Jw13Z343Kr1Yk3Z3Cr17Awn0yw4Dtr4Ivry7ZFsxtF1Utw1ayrW3Zw13 Xr4xJ348Ar1kl-sFpf9Il3svdjkaLaAFLSUrUUUUbb8apTn2vfkv8UJUUUU8wcxFpf9Il3 svdxBIdaVrn0xqx4xG64xvF2IEw4CE5I8CrVC2j2Jv73VFW2AGmfu7bjvjm3AaLaJ3UjIY CTnIWjp_UUUY87kC6x804xWl14x267AKxVWUJVW8JwAFc2x0x2IEx4CE42xK8VAvwI8IcI k0rVWrJVCq3wAFIxvE14AKwVWUXVWUAwA2ocxC64kIII0Yj41l84x0c7CEw4AK67xGY2AK 021l84ACjcxK6xIIjxv20xvE14v26ryj6F1UM28EF7xvwVC0I7IYx2IY6xkF7I0E14v26r 4j6F4UM28EF7xvwVC2z280aVAFwI0_Gr1j6F4UJwA2z4x0Y4vEx4A2jsIEc7CjxVAFwI0_ Gr1j6F4UJwAS0I0E0xvYzxvE52x082IY62kv0487Mc804VCY07AIYIkI8VC2zVCFFI0UMc 02F40EFcxC0VAKzVAqx4xG6I80ewAv7VC0I7IYx2IY67AKxVWUtVWrXwAv7VC2z280aVAF wI0_Gr0_Cr1lOx8S6xCaFVCjc4AY6r1j6r4UM4x0Y48IcxkI7VAKI48JMxAIw28IcxkI7V AKI48JMxC20s026xCaFVCjc4AY6r1j6r4UMI8I3I0E5I8CrVAFwI0_Jr0_Jr4lx2IqxVCj r7xvwVAFwI0_JrI_JrWlx4CE17CEb7AF67AKxVWUAVWUtwCIc40Y0x0EwIxGrwCI42IY6x IIjxv20xvE14v26r4j6ryUMIIF0xvE2Ix0cI8IcVCY1x0267AKxVW8JVWxJwCI42IY6xAI w20EY4v20xvaj40_Jr0_JF4lIxAIcVC2z280aVAFwI0_Gr0_Cr1lIxAIcVC2z280aVCY1x 0267AKxVW8JVW8JrUvcSsGvfC2KfnxnUUI43ZEXa7IU8l38UUUUUU== 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.5 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: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1776891928173601326 X-GMAIL-MSGID: 1776891928173601326 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 Wed Sep 13 03:31:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: chenxiaolong X-Patchwork-Id: 138583 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9ecd:0:b0:3f2:4152:657d with SMTP id t13csp831035vqx; Tue, 12 Sep 2023 20:36:41 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEnx78qXsH3tgzZaLCbhRADkf265KaEKeaYE2dG/QMSSK3lWLbTVjkfBhNKh/SYpZH9/jVF X-Received: by 2002:a17:906:1653:b0:9a1:eb67:c0cc with SMTP id n19-20020a170906165300b009a1eb67c0ccmr726854ejd.34.1694576201653; Tue, 12 Sep 2023 20:36:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694576201; cv=none; d=google.com; s=arc-20160816; b=BPIvxiNq5J0Lhin9iIMrO0fmnc+ZqBSvF7i/4tOcs017twcqC2Q+aKcVAFpYEo/S1i W0aReBMaNL+VGqJr3VBt60ioPiRiqMQboYBRZIBFfOcUOkmtBUL+vCD6qTRnZTL3fK1m ol/j3hYHNBNSMJIekL+u6SKRLitAC76pW0ffuSxzek5Q8WXYD/3AmRywiMsTBHvUojuL L+T6SS8P63GFZcoBRKo6DWiAOdgZYFoUeR5spewRauDkjV0qEZXIA5tMhNm4pjpZTg1k lHuYIxLb8/ZEEwQNJkZTT6jlLCp3TWDbRDoHX22VBV5aX63JGZO02O1w4E+EgGtK7QQz zF7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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:cc:to :from:dmarc-filter:delivered-to; bh=9JbRBkczUe3L/blrw63KRrlHd5dO+jo4SUeXRLQ4UR8=; fh=3pFUYcpS/27XRzOf17GfR86AuNQu+P1CET04YURgCLs=; b=UAx1akb9K9qmvpxydqofmr0Lp3qB5N584GCLHJ2WBQZXWZLOOJyuMwN7TmEmZLXp52 HlbjoNm406Nkklg2f9CFFxlQk5dI7eFMX8xeKTNQluXi9pJ7ZPV6Mt3rxKdU4XPiqa8M vgfSKTLq87eIH5a4Ry99dpiR4f8jllHEMEXCw6SFjThFvWX4zU5B9/EPFA+OsStgxkVz Jy71dfKEU6raqsB5aum82HEX8f9Pxg4kmvGqNgdboXNYXnYhmhaJN6zjYS6+jDH8Yq+c oOn+ac+9jWhTmRkZXzgZclbJ6B5D3/3RxyGG/1VzNoOgn4+7KYvm1HMAdzxVO5sj/4hh ZAtg== 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 h20-20020a170906855400b0099d804da2ebsi9204901ejy.503.2023.09.12.20.36.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Sep 2023 20:36:41 -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 B4ED7388456D for ; Wed, 13 Sep 2023 03:33:29 +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 53CDA3855594 for ; Wed, 13 Sep 2023 03:32:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 53CDA3855594 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 1qgGbv-00010c-2I for gcc-patches@gcc.gnu.org; Tue, 12 Sep 2023 23:32:21 -0400 Received: from loongson.cn (unknown [10.10.130.252]) by gateway (Coremail) with SMTP id _____8DxVug8LQFlOTAmAA--.38866S3; Wed, 13 Sep 2023 11:32:12 +0800 (CST) Received: from slurm-master.loongson.cn (unknown [10.10.130.252]) by localhost.localdomain (Coremail) with SMTP id AQAAf8BxrdwqLQFlxQ4CAA--.3491S10; Wed, 13 Sep 2023 11:32:11 +0800 (CST) From: Xiaolong Chen To: gcc-patches@gcc.gnu.org Cc: xry111@xry111.site, i@xen0n.name, xuchenghua@loongson.cn, chenglulu@loongson.cn, Xiaolong Chen Subject: [PATCH v4 06/23] LoongArch: Add tests for SX vector subtraction instructions. Date: Wed, 13 Sep 2023 11:31:31 +0800 Message-Id: <20230913033148.5752-7-chenxiaolong@loongson.cn> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230913033148.5752-1-chenxiaolong@loongson.cn> References: <20230913033148.5752-1-chenxiaolong@loongson.cn> MIME-Version: 1.0 X-CM-TRANSID: AQAAf8BxrdwqLQFlxQ4CAA--.3491S10 X-CM-SenderInfo: hfkh05xldrz0tqj6z05rqj20fqof0/1tbiAQANBWUBHCIA8gAAsh X-Coremail-Antispam: 1Uk129KBj9DXoWkKr1kJFy7Zw4UuFy3Gw1DCFX_yoW8KFy7Cr X_JFnxJFykWF4SvrnrXr1DZr98uw4UXanF9a1UAF1qq3Wktw18Ca45AFyIvr17Jw1DZ3Wr ZFyDZry8Crn8GF1UKosvyTuYvTs0mTUanT9S1TB71UUUUUDqnTZGkaVYY2UrUUUUj1kv1T 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= 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.6 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: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1776891935279392305 X-GMAIL-MSGID: 1776891935279392305 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 Wed Sep 13 03:31:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: chenxiaolong X-Patchwork-Id: 138585 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9ecd:0:b0:3f2:4152:657d with SMTP id t13csp831578vqx; Tue, 12 Sep 2023 20:38:47 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGGY3Mv8xdlK91xfPB69+Qbd7YVX5Km/66EvyL8x+cfrop2ZkbSHgVEYnf9/X6NfZ+oosiB X-Received: by 2002:adf:f3cc:0:b0:31f:8bef:dedf with SMTP id g12-20020adff3cc000000b0031f8befdedfmr1007697wrp.19.1694576327051; Tue, 12 Sep 2023 20:38:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694576327; cv=none; d=google.com; s=arc-20160816; b=Usb36a+NmJtAM2DMHeeAxTqX54urDuJlurs05EFe7Psh6nI6IlXyENfTOQI496mJ57 y1qVtW5TU1jokMS623DkIy2i9kprtz3uC8xkxY5Fcrv4q5mdZcKrttjJk4wPuU6ClB1A ad6BVaGjGhk14uXPoopPLH6dIYeYfrzGndjrOrIM6+wHFvQedkW7c8wHXqylwJRchJQE /0YyYS/NH0Np+jKOkLaSVayKdepkhChb/St/wFwOwU4QRICFNrxoPK4aAvCvWx4td/QC djabcT8RrWjP54TMvh9skLO+gqTkNkvKDLPPxKtXOsVD1wHX7+od/EUje+WW6ALoQRW6 eg0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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:cc:to :from:dmarc-filter:delivered-to; bh=wuukDGpXUKA4gTkwTpCFKkG0kib5Z5YPxff9U4gluqk=; fh=3pFUYcpS/27XRzOf17GfR86AuNQu+P1CET04YURgCLs=; b=F1er/YZsfr2TJDJCp6px8yep6aJcR2dazp3eGgf3PLkuU5IALFDUpLdtVuWxQm/L+n 88McrCGMdigyCcLQr0x+wDIfpHY/fKQKMmEj1EYMx5Pe6Hxv+TXU8RDwoI5dHRHLHjSk SnNpcBsMef0BjlZ02p85aQJkVnUfN9cP9APDavYVnI61BtymG0kSszFfjvTsCpPKb2aX R0OFX6x/liXUGgOpEnJxL+iPAO9SDhCFl7sIu8pfnYmeyn2W3CgPQfTj5xGoxD6Ogs1X 0K/ys8MGfx48GN21JhXt7sMvamUMfHoEg4MxlUxIA4o2fcB1ematiii44LKQ8mN7x2aw JNrg== 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 u1-20020a056402064100b00523356aca02si10418873edx.489.2023.09.12.20.38.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Sep 2023 20:38:47 -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 4C3A53896C2B for ; Wed, 13 Sep 2023 03:34:21 +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 EBE17385C8B0 for ; Wed, 13 Sep 2023 03:32:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org EBE17385C8B0 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 1qgGbw-00010k-KI for gcc-patches@gcc.gnu.org; Tue, 12 Sep 2023 23:32:23 -0400 Received: from loongson.cn (unknown [10.10.130.252]) by gateway (Coremail) with SMTP id _____8AxDOs+LQFlPTAmAA--.3240S3; Wed, 13 Sep 2023 11:32:14 +0800 (CST) Received: from slurm-master.loongson.cn (unknown [10.10.130.252]) by localhost.localdomain (Coremail) with SMTP id AQAAf8BxrdwqLQFlxQ4CAA--.3491S11; Wed, 13 Sep 2023 11:32:13 +0800 (CST) From: Xiaolong Chen To: gcc-patches@gcc.gnu.org Cc: xry111@xry111.site, i@xen0n.name, xuchenghua@loongson.cn, chenglulu@loongson.cn, Xiaolong Chen Subject: [PATCH v4 07/23] LoongArch: Add tests for SX vector addition vsadd instructions. Date: Wed, 13 Sep 2023 11:31:32 +0800 Message-Id: <20230913033148.5752-8-chenxiaolong@loongson.cn> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230913033148.5752-1-chenxiaolong@loongson.cn> References: <20230913033148.5752-1-chenxiaolong@loongson.cn> MIME-Version: 1.0 X-CM-TRANSID: AQAAf8BxrdwqLQFlxQ4CAA--.3491S11 X-CM-SenderInfo: hfkh05xldrz0tqj6z05rqj20fqof0/1tbiAQANBWUBHCIA9AAAsn X-Coremail-Antispam: 1Uk129KBj9fXoWDAFWxKrWUJw43uF13urWUJrc_yoWrWr1rZo WUAa4UZw4rCFZxX3W5Jw13X34fKr1Yk3Zakr1UAwn0ya1DJr4Ivry7ZFsxJF1Utw1ayrW3 Zw13Xr4xJ348Zr1kl-sFpf9Il3svdjkaLaAFLSUrUUUUjb8apTn2vfkv8UJUUUU8wcxFpf 9Il3svdxBIdaVrn0xqx4xG64xvF2IEw4CE5I8CrVC2j2Jv73VFW2AGmfu7bjvjm3AaLaJ3 UjIYCTnIWjp_UUUY87kC6x804xWl14x267AKxVWUJVW8JwAFc2x0x2IEx4CE42xK8VAvwI 8IcIk0rVWrJVCq3wAFIxvE14AKwVWUGVWUXwA2ocxC64kIII0Yj41l84x0c7CEw4AK67xG Y2AK021l84ACjcxK6xIIjxv20xvE14v26ryj6F1UM28EF7xvwVC0I7IYx2IY6xkF7I0E14 v26r4j6F4UM28EF7xvwVC2z280aVAFwI0_Gr1j6F4UJwA2z4x0Y4vEx4A2jsIEc7CjxVAF wI0_Gr1j6F4UJwAS0I0E0xvYzxvE52x082IY62kv0487Mc804VCY07AIYIkI8VC2zVCFFI 0UMc02F40EFcxC0VAKzVAqx4xG6I80ewAv7VC0I7IYx2IY67AKxVWUtVWrXwAv7VC2z280 aVAFwI0_Gr0_Cr1lOx8S6xCaFVCjc4AY6r1j6r4UM4x0Y48IcxkI7VAKI48JMxAIw28Icx kI7VAKI48JMxC20s026xCaFVCjc4AY6r1j6r4UMI8I3I0E5I8CrVAFwI0_Jr0_Jr4lx2Iq xVCjr7xvwVAFwI0_JrI_JrWlx4CE17CEb7AF67AKxVWUAVWUtwCIc40Y0x0EwIxGrwCI42 IY6xIIjxv20xvE14v26ryj6F1UMIIF0xvE2Ix0cI8IcVCY1x0267AKxVW8JVWxJwCI42IY 6xAIw20EY4v20xvaj40_Jr0_JF4lIxAIcVC2z280aVAFwI0_Gr0_Cr1lIxAIcVC2z280aV CY1x0267AKxVW8JVW8JrUvcSsGvfC2KfnxnUUI43ZEXa7IU8QJ57UUUUU== 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.6 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: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1776892066363797960 X-GMAIL-MSGID: 1776892066363797960 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 Wed Sep 13 03:31:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: chenxiaolong X-Patchwork-Id: 138584 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9ecd:0:b0:3f2:4152:657d with SMTP id t13csp831501vqx; Tue, 12 Sep 2023 20:38:32 -0700 (PDT) X-Google-Smtp-Source: AGHT+IETXtYNgaU9Anv1g5itAB2iSTx1QC5kfwMIJo4vbKKDWtEXbhRTnZr7MMEP9coV11JzGa4v X-Received: by 2002:a05:6512:3d1f:b0:4ff:8c9e:eb0d with SMTP id d31-20020a0565123d1f00b004ff8c9eeb0dmr1473252lfv.0.1694576311893; Tue, 12 Sep 2023 20:38:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694576311; cv=none; d=google.com; s=arc-20160816; b=qBHoK2FLGd1dX00oKjzMGk9R0mSkstgSH4DBbWMMSEA3W8BslZwloCzwQ0kv9p512n 9OmHtZRqIeFuwdzdIoiZ/9oT4OhFW8BCWcEXKRNas81GOLRWY42yX9oGM7iTxjz+dkRI mrSBB6nqA6TpSEePtA1Sf34egie6hGlvKn+tOxLLrwzUTy0Lto6MDgy2kC4jy0xAtI2R zFwxR9zyc3f8DAWG8yAgtaO0q7FSlweVtUeEE6wYBfww7KVMe1KjvLTNcCHLttTltjmp 3i+/QKOlpHykUHtFxSgiMvta37g4H9IkzmPNUssYNcVZhIv+fjKTvNmuR40MBiaG9sfo kq7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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:cc:to :from:dmarc-filter:delivered-to; bh=mCSbkz0v0c/J9sXb6jCQcVWRdNq2DPE46zOYnk3pxkc=; fh=3pFUYcpS/27XRzOf17GfR86AuNQu+P1CET04YURgCLs=; b=rRyqWFOokGJPin8SylwLywhRcwDtX5m9QnF4pByp9CIGCAboGOGbFu35HVxThZpREt 72XLPAxTtJ6FBzZzSvO4IO1CuMnySk+x/gA1AmmnSt4dTDmndcrGxWMQ/VawMnj9UIzp rw15Xj4XMqXGi5V8SPnJiNtMH2wV5H8iynZTKEifx86wKGhWox3akeDg8Cjm204QjJm2 xqHbmnrjJqk9fryEi3RrdR2APmwDSUkDixs+Jmza1gceeoMRCnTSXvS9pse29zudsxWf 6nR24LINSGInoK8BWLpe7ub+M61gpH7MMy99pP1gdaWoGenZLLVNu2n8HaKrcSrRl+gs zxDA== 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 z11-20020aa7cf8b000000b0052369c1025bsi9594025edx.459.2023.09.12.20.38.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Sep 2023 20:38:31 -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 971613898382 for ; Wed, 13 Sep 2023 03:34:15 +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 EBC43385B81D for ; Wed, 13 Sep 2023 03:32:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org EBC43385B81D 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 1qgGbz-000112-H8 for gcc-patches@gcc.gnu.org; Tue, 12 Sep 2023 23:32:26 -0400 Received: from loongson.cn (unknown [10.10.130.252]) by gateway (Coremail) with SMTP id _____8BxpPBALQFlQDAmAA--.8581S3; Wed, 13 Sep 2023 11:32:16 +0800 (CST) Received: from slurm-master.loongson.cn (unknown [10.10.130.252]) by localhost.localdomain (Coremail) with SMTP id AQAAf8BxrdwqLQFlxQ4CAA--.3491S12; Wed, 13 Sep 2023 11:32:15 +0800 (CST) From: Xiaolong Chen To: gcc-patches@gcc.gnu.org Cc: xry111@xry111.site, i@xen0n.name, xuchenghua@loongson.cn, chenglulu@loongson.cn, Xiaolong Chen Subject: [PATCH v4 08/23] LoongArch: Add tests for the SX vector multiplication instruction. Date: Wed, 13 Sep 2023 11:31:33 +0800 Message-Id: <20230913033148.5752-9-chenxiaolong@loongson.cn> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230913033148.5752-1-chenxiaolong@loongson.cn> References: <20230913033148.5752-1-chenxiaolong@loongson.cn> MIME-Version: 1.0 X-CM-TRANSID: AQAAf8BxrdwqLQFlxQ4CAA--.3491S12 X-CM-SenderInfo: hfkh05xldrz0tqj6z05rqj20fqof0/1tbiAQANBWUBHCIA9gAAsl X-Coremail-Antispam: 1Uk129KBj97XoW8AF4DKw4DZryfJrW8WoXrpr47Gr4fWoWUAa 4UZw4rCFZxX3W5Jw13X343Kr1Yk3Z3Cr17Awn0yw4Dtw4Ivry7ZFsxJF1Utw1ayry3Zw13 Xr4xJ348Zr1kl-sFpf9Il3svdjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8wcxFpf9Il3 svdxBIdaVrn0xqx4xG64xvF2IEw4CE5I8CrVC2j2Jv73VFW2AGmfu7bjvjm3AaLaJ3UjIY CTnIWjp_UUUY87kC6x804xWl14x267AKxVWUJVW8JwAFc2x0x2IEx4CE42xK8VAvwI8IcI k0rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2ocxC64kIII0Yj41l84x0c7CEw4AK67xGY2AK 021l84ACjcxK6xIIjxv20xvE14v26ryj6F1UM28EF7xvwVC0I7IYx2IY6xkF7I0E14v26r 4j6F4UM28EF7xvwVC2z280aVAFwI0_Gr1j6F4UJwA2z4x0Y4vEx4A2jsIEc7CjxVAFwI0_ Gr1j6F4UJwAS0I0E0xvYzxvE52x082IY62kv0487Mc804VCY07AIYIkI8VC2zVCFFI0UMc 02F40EFcxC0VAKzVAqx4xG6I80ewAv7VC0I7IYx2IY67AKxVWUtVWrXwAv7VC2z280aVAF wI0_Gr0_Cr1lOx8S6xCaFVCjc4AY6r1j6r4UM4x0Y48IcxkI7VAKI48JMxAIw28IcxkI7V AKI48JMxC20s026xCaFVCjc4AY6r1j6r4UMI8I3I0E5I8CrVAFwI0_Jr0_Jr4lx2IqxVCj r7xvwVAFwI0_JrI_JrWlx4CE17CEb7AF67AKxVWUAVWUtwCIc40Y0x0EwIxGrwCI42IY6x IIjxv20xvE14v26ryj6F1UMIIF0xvE2Ix0cI8IcVCY1x0267AKxVW8JVWxJwCI42IY6xAI w20EY4v20xvaj40_Jr0_JF4lIxAIcVC2z280aVAFwI0_Gr0_Cr1lIxAIcVC2z280aVCY1x 0267AKxVW8JVW8JrUvcSsGvfC2KfnxnUUI43ZEXa7IU84xRDUUUUU== 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.6 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: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1776892050960048466 X-GMAIL-MSGID: 1776892050960048466 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 Wed Sep 13 03:34:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: chenxiaolong X-Patchwork-Id: 138586 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9ecd:0:b0:3f2:4152:657d with SMTP id t13csp831865vqx; Tue, 12 Sep 2023 20:39:38 -0700 (PDT) X-Google-Smtp-Source: AGHT+IElcX0s0FGqxZjJbpziUNo6DiGnXihy0WjKJHGZBFs93ADXm2bymlYUvMQesp/4qpRmWQts X-Received: by 2002:a17:906:194:b0:9a1:eedf:cc34 with SMTP id 20-20020a170906019400b009a1eedfcc34mr987347ejb.27.1694576378336; Tue, 12 Sep 2023 20:39:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694576378; cv=none; d=google.com; s=arc-20160816; b=bjRaF/dsdVCOBZ7boUjM1x2iuKjqQ7XZFL1dYYUTW3jRR6GkLx2E6SSdx3HXN+OLU8 XrJwCm/gw5Jvvh4bsWiuz+iHhzH6g7X+4pZ6UNRv03D+Uu7HZjmmVnah4t4c9bMOtTxG l4SLODWGRE3VrYxqa31GMY9epCiLFu4/K+ZGHPBbyfgktmolDCKkV3HOT/Y8n5zuSFCl 0/yHgFhUcPZ2gycEgN2/rECMMzRJq+NVHbeyKNFqkc0Di85MlUAHE6kDYvTb/B8SYKdT dH/1GNkwHI7POaK5yZ+3BUoRxvmNOBfI6AAm1LJNBQ2rjJEG74XGw9cr85CGnqq+FEcR 4HLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dmarc-filter :delivered-to; bh=RpXaw2v1IOoFD2Ken19q0WVUqSCnmOs37DQDQHBmjmQ=; fh=3pFUYcpS/27XRzOf17GfR86AuNQu+P1CET04YURgCLs=; b=tsE1nYmALlpkp17kN7+m3cdHakmA3g2Ir8ayeqtyNRSw0pPyzHXASeVVOv6/oP417B dUorL86jY3mZnPLfF56FsGEfgc2NsZdGvbHaOVSjwXZmtrpwzzRyiqxR57T8tRPC+o22 llXtNByUYE251s1wP7ihaW7+fSJ8iIMl5dI51zjuRvrixlfXgSqWUsAjMbkyV0hndBLl fw96l8liXVVQOyh7GRt7nx2T0itnX6OSo1U7yupYCz7hBVaDAmJEL/yzQTYjufEfQZFx WKgjIHCPoIg3XxG3EJnXAW6Esd1RQH70Siy/GilZAMTgrOa1QiyqnxNrBAkeLIfgs6bJ qBJQ== 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 wf4-20020a170907d68400b009ad869ac76fsi3034584ejc.354.2023.09.12.20.39.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Sep 2023 20:39:38 -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 5EA493882102 for ; Wed, 13 Sep 2023 03:35:27 +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 ACE453858D3C for ; Wed, 13 Sep 2023 03:34:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org ACE453858D3C 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 _____8BxbOrcLQFllDAmAA--.46770S3; Wed, 13 Sep 2023 11:34:52 +0800 (CST) Received: from slurm-master.loongson.cn (unknown [10.10.130.252]) by localhost.localdomain (Coremail) with SMTP id AQAAf8Bx3y_bLQFljQ8CAA--.3473S4; Wed, 13 Sep 2023 11:34:51 +0800 (CST) From: Xiaolong Chen To: gcc-patches@gcc.gnu.org Cc: xry111@xry111.site, i@xen0n.name, xuchenghua@loongson.cn, chenglulu@loongson.cn, Xiaolong Chen Subject: [PATCH v4 09/23] LoongArch: Add tests for SX vector vavg/vavgr instructions. Date: Wed, 13 Sep 2023 11:34:43 +0800 Message-Id: <20230913033443.5912-1-chenxiaolong@loongson.cn> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-CM-TRANSID: AQAAf8Bx3y_bLQFljQ8CAA--.3473S4 X-CM-SenderInfo: hfkh05xldrz0tqj6z05rqj20fqof0/1tbiAQANBWUBHCIA-QAAsu X-Coremail-Antispam: 1Uk129KBj9fXoWDXr1rWr17Cr4rZr15uF4DGFX_yoW3Ar1Duo WUAa4UZw4rCFZxX3W5Jw13Z34fKr1Yk3Z3Cr17Awn0ywsrtw4Ivry7ZFsxJF1Utw1ayrW3 Zw13Xr4xJ348Ar1kl-sFpf9Il3svdjkaLaAFLSUrUUUUjb8apTn2vfkv8UJUUUU8wcxFpf 9Il3svdxBIdaVrn0xqx4xG64xvF2IEw4CE5I8CrVC2j2Jv73VFW2AGmfu7bjvjm3AaLaJ3 UjIYCTnIWjp_UUUY87kC6x804xWl14x267AKxVWUJVW8JwAFc2x0x2IEx4CE42xK8VAvwI 8IcIk0rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2ocxC64kIII0Yj41l84x0c7CEw4AK67xG Y2AK021l84ACjcxK6xIIjxv20xvE14v26ryj6F1UM28EF7xvwVC0I7IYx2IY6xkF7I0E14 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.6 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: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1776892120467751538 X-GMAIL-MSGID: 1776892120467751538 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. --- .../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 ++++++++++++++ 4 files changed, 1322 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 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; +} From patchwork Wed Sep 13 03:35:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: chenxiaolong X-Patchwork-Id: 138592 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9ecd:0:b0:3f2:4152:657d with SMTP id t13csp832961vqx; Tue, 12 Sep 2023 20:43:55 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG+suGlNZNIMiM4CojkELyLB3oxzni+KI2W+f+3o+JxnSxUR6tCvu9+f5EInhVS7BWMkm4O X-Received: by 2002:aa7:c848:0:b0:525:6e47:10f6 with SMTP id g8-20020aa7c848000000b005256e4710f6mr1071388edt.22.1694576635451; Tue, 12 Sep 2023 20:43:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694576635; cv=none; d=google.com; s=arc-20160816; b=ZdUu7VbRPV31ylmiC5XkS6ubNugPfq+nQ/6LJRGqGsOBhzhYVb078Em8vTVd8TcN53 nIjeQu5Q7d0mw/EM/ox0jRRLKEzgDhf4zMUVUi3ejKNhD2LUknjc86oxsE0qksz8HeRy E8SneGWHoQWYpHat3ERKpBdQ7uxxiQx7Qnhjju5owo0H9Ydzg8kDnFBZnFs/4b7K+9dx +G9M2D4afSU6lWG2zlpyIsecKVSILO9ftZUwYk3ChzUi6p7oA0Vj6Pcgguvc4bew2ToI U6cKLSfujGJXAPWdqZx7REncoPFG3SAWhuKxzu42XqBBS/cV47UAmRC+hfCm7xXgDcoA kTBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dmarc-filter :delivered-to; bh=ApEAHx57Lufl2qyOaE04Aiqo25xcI9sNyKv/FI2V8T0=; fh=3pFUYcpS/27XRzOf17GfR86AuNQu+P1CET04YURgCLs=; b=AHGPxEwFijzFVkKnWc7JsXMvLhvAudalmeD7N+96Gqb1zo4cOSECF2RevOJJPeorLg ed0oXYHVrv5XCgMpa/xFzJ8pJ6OP6QWrBR3f/6Ba0TaXMAFs73lD39wiyOZVij0mtsV/ OYT6IElGHgDThIa3hdIdEOiTeXEjKT9LHKIHpZNYs2TzPvglmxIdp5j8KZ+eF0taMUHZ GtiqBtW1VEdCQT2IEaMt6O7yEVmyYo1WvgQIHi6AtXVs9RVG3CVSxzfgvnOb+3/FXhcg hLEwRqu2hhwozFbR8jCVhKvo5RfGSCBtQPp72G2RkXGIVBHuPxRQnNtsWAV1Z7aQzbL2 iGjA== 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 q36-20020a05640224a400b0052fb5edf252si2011737eda.258.2023.09.12.20.43.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Sep 2023 20:43: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 AA5B13882AEC for ; Wed, 13 Sep 2023 03:36:45 +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 3BC3F3857031 for ; Wed, 13 Sep 2023 03:35:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3BC3F3857031 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 1qgGf3-00034m-J4 for gcc-patches@gcc.gnu.org; Tue, 12 Sep 2023 23:35:36 -0400 Received: from loongson.cn (unknown [10.10.130.252]) by gateway (Coremail) with SMTP id _____8DxFej9LQFltDAmAA--.15252S3; Wed, 13 Sep 2023 11:35:25 +0800 (CST) Received: from slurm-master.loongson.cn (unknown [10.10.130.252]) by localhost.localdomain (Coremail) with SMTP id AQAAf8Cx7y_8LQFlvA8CAA--.3484S4; Wed, 13 Sep 2023 11:35:25 +0800 (CST) From: Xiaolong Chen To: gcc-patches@gcc.gnu.org Cc: xry111@xry111.site, i@xen0n.name, xuchenghua@loongson.cn, chenglulu@loongson.cn, Xiaolong Chen Subject: [PATCH v4 10/23] LoongArch: Add tests for SX vector vmax/vmaxi/vmin/vmini instructions. Date: Wed, 13 Sep 2023 11:35:13 +0800 Message-Id: <20230913033522.5983-1-chenxiaolong@loongson.cn> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-CM-TRANSID: AQAAf8Cx7y_8LQFlvA8CAA--.3484S4 X-CM-SenderInfo: hfkh05xldrz0tqj6z05rqj20fqof0/1tbiAQANBWUBHCIBAAAAsS X-Coremail-Antispam: 1Uk129KBj97XoW8Ar1fJrWUKF1UGF17KoXrpr48uw13CoWUAa 4UZw4rCFZxX3W5Jw13X34fKF1Yk3Zakr18Awn0yw4DJr4Ivry7ZFs8JF1Utw1ayrW3Zw13 Wr4xJ348Zr1kl-sFpf9Il3svdjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8wcxFpf9Il3 svdxBIdaVrn0xqx4xG64xvF2IEw4CE5I8CrVC2j2Jv73VFW2AGmfu7bjvjm3AaLaJ3UjIY CTnIWjp_UUUY87kC6x804xWl14x267AKxVWUJVW8JwAFc2x0x2IEx4CE42xK8VAvwI8IcI k0rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2ocxC64kIII0Yj41l84x0c7CEw4AK67xGY2AK 021l84ACjcxK6xIIjxv20xvE14v26ryj6F1UM28EF7xvwVC0I7IYx2IY6xkF7I0E14v26r 4j6F4UM28EF7xvwVC2z280aVAFwI0_Gr1j6F4UJwA2z4x0Y4vEx4A2jsIEc7CjxVAFwI0_ Gr1j6F4UJwAS0I0E0xvYzxvE52x082IY62kv0487Mc804VCY07AIYIkI8VC2zVCFFI0UMc 02F40EFcxC0VAKzVAqx4xG6I80ewAv7VC0I7IYx2IY67AKxVWUtVWrXwAv7VC2z280aVAF wI0_Gr0_Cr1lOx8S6xCaFVCjc4AY6r1j6r4UM4x0Y48IcxkI7VAKI48JMxAIw28IcxkI7V AKI48JMxC20s026xCaFVCjc4AY6r1j6r4UMI8I3I0E5I8CrVAFwI0_Jr0_Jr4lx2IqxVCj r7xvwVAFwI0_JrI_JrWlx4CE17CEb7AF67AKxVWUAVWUtwCIc40Y0x0EwIxGrwCI42IY6x IIjxv20xvE14v26ryj6F1UMIIF0xvE2Ix0cI8IcVCY1x0267AKxVW8JVWxJwCI42IY6xAI w20EY4v20xvaj40_Jr0_JF4lIxAIcVC2z280aVAFwI0_Gr0_Cr1lIxAIcVC2z280aVCY1x 0267AKxVW8JVW8JrUvcSsGvfC2KfnxnUUI43ZEXa7IU84xRDUUUUU== 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: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1776892390126913076 X-GMAIL-MSGID: 1776892390126913076 gcc/testsuite/ChangeLog: * 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. --- .../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 +++++++++ 8 files changed, 2489 insertions(+) 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 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; +} From patchwork Wed Sep 13 03:35:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: chenxiaolong X-Patchwork-Id: 138595 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9ecd:0:b0:3f2:4152:657d with SMTP id t13csp833594vqx; Tue, 12 Sep 2023 20:45:57 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGij81E46XVLjDXnw6skqUoPw85T/qHolB8kWMXYnAFzrfADYDEY/Ib/PKSat2zxV2xjoWT X-Received: by 2002:a05:6512:72:b0:4ff:9efd:8a9e with SMTP id i18-20020a056512007200b004ff9efd8a9emr879777lfo.7.1694576757299; Tue, 12 Sep 2023 20:45:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694576757; cv=none; d=google.com; s=arc-20160816; b=EfXldYwLVYvBWbKOyKXmrwcNhph21vyaLdpeTRMQhPSFnlCOc0wCkA//XIQ+IjWy9O Qb4vsFEYa4XlGei349/Eb0h4c86bOPBg9Bz8/FqAPca9P8lMibXbTl/ZvW4RrTFbdTgv rGkkVax8P2S+0c3YUFKpDXernEI4bek6T0aHpoXEqN05e/bf4lwB9xTHZ9xoCzFE41ak idj+/2KPkcrMtEaeZwyTx9MEYTfilInt6X5i9e5BRDeuYd3lRPQDuWRChCmr32oBrQmC b/N6HJ5b0GJInR4Fgw+q5iTd5/BNk4n16KqdQcyiE+ZIcXcekMWLIjdbj5+iodLkjMFM uXqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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:cc:to :from:dmarc-filter:delivered-to; bh=T+IVFtMiakjgfnviAKbT8888tFogLg8OOi5RVUqpKH0=; fh=3pFUYcpS/27XRzOf17GfR86AuNQu+P1CET04YURgCLs=; b=u428qHRiUQiet6FqnbF7I+Z6MUJVhU/OBwCM11srd7lOX2zJ0A5Dy96IwhOyyPt92A AxLhjKA1CeOZr/rXS5x1UHbwnuKTqrHUKwJjg8GbPzR197mRG0lz0yumVcuSnETjTgmB CI4d4jOiFY7ycDAuSXkdtRU3qcIKiSLafkUQBMsBva3t2ue7uyP7G8fI8Z8LFbTXolt7 JGO08UjrAe+U0b7X+PEplOcv3KXEqiDUUpWOBiU9Q5apf314Q+zveYWKpzqio58B7xzQ Dj6A07VZ45F8lahECFyNgFsfzrqT3Ntcet6iVOlJ6zK+eXi0Pg5f0t1PrMxxr5nQM/bL p8aQ== 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 cy19-20020a0564021c9300b0052f9a8bea3dsi2747935edb.62.2023.09.12.20.45.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Sep 2023 20:45:57 -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 9E1AF3955617 for ; Wed, 13 Sep 2023 03:37:20 +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 B77AD3856244 for ; Wed, 13 Sep 2023 03:35:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B77AD3856244 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 1qgGf5-00036f-L3 for gcc-patches@gcc.gnu.org; Tue, 12 Sep 2023 23:35:38 -0400 Received: from loongson.cn (unknown [10.10.130.252]) by gateway (Coremail) with SMTP id _____8AxjusALgFluTAmAA--.6044S3; Wed, 13 Sep 2023 11:35:28 +0800 (CST) Received: from slurm-master.loongson.cn (unknown [10.10.130.252]) by localhost.localdomain (Coremail) with SMTP id AQAAf8Cx7y_8LQFlvA8CAA--.3484S5; Wed, 13 Sep 2023 11:35:27 +0800 (CST) From: Xiaolong Chen To: gcc-patches@gcc.gnu.org Cc: xry111@xry111.site, i@xen0n.name, xuchenghua@loongson.cn, chenglulu@loongson.cn, Xiaolong Chen Subject: [PATCH v4 11/23] LoongArch: Add tests for SX vector vexth/vextl/vldi/vneg/vsat instructions. Date: Wed, 13 Sep 2023 11:35:14 +0800 Message-Id: <20230913033522.5983-2-chenxiaolong@loongson.cn> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230913033522.5983-1-chenxiaolong@loongson.cn> References: <20230913033522.5983-1-chenxiaolong@loongson.cn> MIME-Version: 1.0 X-CM-TRANSID: AQAAf8Cx7y_8LQFlvA8CAA--.3484S5 X-CM-SenderInfo: hfkh05xldrz0tqj6z05rqj20fqof0/1tbiAQANBWUBHCIBAgAAsQ X-Coremail-Antispam: 1Uk129KBj9xXoWrCF15Cr4UAw18Zry5ZrWrp5X_uryUZFb_JF nxJFykWF4SvrnrXr1DZr98uw43XanF9a1UCF1qq3Wktr18Ca45AF1Ivr17Jw1DZF1rZFyD XrW8Crn8GF1UKosvyTuYvTs0mTUanT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUj1kv1TuYvT s0mT0YCTnIWjqI5I8CrVACY4xI64kE6c02F40Ex7xfYxn0WfASr-VFAUDa7-sFnT9fnUUI cSsGvfJTRUUUb28YFVCjjxCrM7AC8VAFwI0_Jr0_Gr1l1xkIjI8I6I8E6xAIw20EY4v20x vaj40_Wr0E3s1l1IIY67AEw4v_Jr0_Jr4l8cAvFVAK0II2c7xJM28CjxkF64kEwVA0rcxS w2x7M28EF7xvwVC0I7IYx2IY67AKxVW5JVW7JwA2z4x0Y4vE2Ix0cI8IcVCY1x0267AKxV W8JVWxJwA2z4x0Y4vEx4A2jsIE14v26r4UJVWxJr1l84ACjcxK6I8E87Iv6xkF7I0E14v2 6r4UJVWxJr1le2I262IYc4CY6c8Ij28IcVAaY2xG8wAqjxCEc2xF0cIa020Ex4CE44I27w Aqx4xG64xvF2IEw4CE5I8CrVC2j2WlYx0E2Ix0cI8IcVAFwI0_Wrv_ZF1lYx0Ex4A2jsIE 14v26r4j6F4UMcvjeVCFs4IE7xkEbVWUJVW8JwACjcxG0xvY0x0EwIxGrwCF04k20xvY0x 0EwIxGrwCFx2IqxVCFs4IE7xkEbVWUJVW8JwC20s026c02F40E14v26r1j6r18MI8I3I0E 7480Y4vE14v26r106r1rMI8E67AF67kF1VAFwI0_JF0_Jw1lIxkGc2Ij64vIr41lIxAIcV C0I7IYx2IY67AKxVW5JVW7JwCI42IY6xIIjxv20xvEc7CjxVAFwI0_Gr0_Cr1lIxAIcVCF 04k26cxKx2IYs7xG6r1j6r1xMIIF0xvEx4A2jsIE14v26r4j6F4UMIIF0xvEx4A2jsIEc7 CjxVAFwI0_Gr0_Gr1UYxBIdaVFxhVjvjDU0xZFpf9x07jxKsUUUUUU= 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: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1776892517835581436 X-GMAIL-MSGID: 1776892517835581436 gcc/testsuite/ChangeLog: * 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-vextl-1.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vextl-2.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vldi.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. --- .../loongarch/vector/lsx/lsx-vexth-1.c | 342 ++++++++++++++++++ .../loongarch/vector/lsx/lsx-vexth-2.c | 182 ++++++++++ .../loongarch/vector/lsx/lsx-vextl-1.c | 83 +++++ .../loongarch/vector/lsx/lsx-vextl-2.c | 83 +++++ .../loongarch/vector/lsx/lsx-vldi.c | 61 ++++ .../loongarch/vector/lsx/lsx-vneg.c | 321 ++++++++++++++++ .../loongarch/vector/lsx/lsx-vsat-1.c | 231 ++++++++++++ .../loongarch/vector/lsx/lsx-vsat-2.c | 272 ++++++++++++++ 8 files changed, 1575 insertions(+) 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-vextl-1.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vextl-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-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 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-vextl-1.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vextl-1.c new file mode 100644 index 00000000000..99854dbd85e --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vextl-1.c @@ -0,0 +1,83 @@ +/* { 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_vextl_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_vextl_q_d (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000170014; + *((unsigned long *)&__m128i_op0[0]) = 0xff0cff78ff96ff14; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xff0cff78ff96ff14; + __m128i_out = __lsx_vextl_q_d (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffe500ffffc085; + *((unsigned long *)&__m128i_op0[0]) = 0xffffc000ffffc005; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffc000ffffc005; + __m128i_out = __lsx_vextl_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_vextl_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_vextl_q_d (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0001000101010001; + *((unsigned long *)&__m128i_op0[0]) = 0x0001000100010001; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0001000100010001; + __m128i_out = __lsx_vextl_q_d (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000800000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000800000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000800000000000; + __m128i_out = __lsx_vextl_q_d (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x3131313131313131; + *((unsigned long *)&__m128i_op0[0]) = 0x3131313131313131; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x3131313131313131; + __m128i_out = __lsx_vextl_q_d (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vextl-2.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vextl-2.c new file mode 100644 index 00000000000..73bb530c9fc --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vextl-2.c @@ -0,0 +1,83 @@ +/* { 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]) = 0x0000101fffff8b68; + *((unsigned long *)&__m128i_op0[0]) = 0x00000b6fffff8095; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00000b6fffff8095; + __m128i_out = __lsx_vextl_qu_du (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0001000100010001; + *((unsigned long *)&__m128i_op0[0]) = 0x0001000104000800; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0001000104000800; + __m128i_out = __lsx_vextl_qu_du (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000100010000fe7c; + *((unsigned long *)&__m128i_op0[0]) = 0x000100010000fe01; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x000100010000fe01; + __m128i_out = __lsx_vextl_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_vextl_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_vextl_qu_du (__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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xc8847ef6ed3f2000; + __m128i_out = __lsx_vextl_qu_du (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x33f5c2d7d975d7fe; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vextl_qu_du (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000d82; + *((unsigned long *)&__m128i_op0[0]) = 0x046a09ec009c0000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x046a09ec009c0000; + __m128i_out = __lsx_vextl_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_vextl_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-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; +} From patchwork Wed Sep 13 03:35:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: chenxiaolong X-Patchwork-Id: 138589 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9ecd:0:b0:3f2:4152:657d with SMTP id t13csp832385vqx; Tue, 12 Sep 2023 20:41:37 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE2FBp6TXVBpaAahbxaPbSACy7PEaIf25ABh84BjQR51WQOA4zIc1mkKJPHgc1IqEJaOP7I X-Received: by 2002:a17:906:3151:b0:9a2:295a:9bc5 with SMTP id e17-20020a170906315100b009a2295a9bc5mr907639eje.21.1694576496771; Tue, 12 Sep 2023 20:41:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694576496; cv=none; d=google.com; s=arc-20160816; b=HFhVJvVyYjrutvrESuijErUk9tGQplRCawStgvVcuo2eL9H4yCMLCO03ku1ExIaLwj /4M9EaPK9PbcjyEe8ZGI5kKLtFD8fmaWKwrJayGo83eiJtJWjutg9pnC3I+W+6DO3cae eTyHChqQpizhqRnJcD2Z1TXAhDrMXQPjqTmO8gnpgVrt23L7buAfKNKc+rMmm4QcBskh 6RLiOyO3unb9CtsuyKg0VstM4JH12CClODKOPDDCz/buvZtLAERDMMuSR0ou3wpJ5SN7 nYUA5VnYA8oVegrW8++JhZqQOAxOJ3UQq6eJjl893/pDPmRzjWYt5EupmqcaV9gtQDA+ onUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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:cc:to :from:dmarc-filter:delivered-to; bh=RKS1PuicvJoabOGiO2jr0DLi5OZSyYbkXzOwdyEAafI=; fh=3pFUYcpS/27XRzOf17GfR86AuNQu+P1CET04YURgCLs=; b=yZye3t6jgkOb3zunhEf4JPhRd0qA9kK9BwyFfgpa9JQZHMsUrsZ7QniO+sgpeY9hgR 6LIKMEcERxsRmK4PUracn1oWzfGFA2ceUnmRMLn3Uf6hPAfPDY7Tzavi6WtxF59Yj/H6 OZzotFp1irUNl9HT5KD8D7us9LZp5r7nayRdVbwk7VXKt331ojwwMWF8lYu4HzXz5AST vSTwvfpy4BAoTkyuA1WfaIiQYFdZQyUjHiOxKSL7ifEDzA+ld/+BW6wsKo7S7QaDfCA0 9I74gvx9xefeBNAtjQAyEUiN+Kf0cTfgvh6HV8k4tnZsrPgA00tCros1/zwfK3gzIHjh JlnQ== 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 k9-20020a170906054900b009878e79ba85si9998039eja.302.2023.09.12.20.41.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Sep 2023 20:41:36 -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 CBC693853D22 for ; Wed, 13 Sep 2023 03:36:11 +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 B50F83882ADD for ; Wed, 13 Sep 2023 03:35:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B50F83882ADD 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 _____8AxXOoCLgFlvTAmAA--.47126S3; Wed, 13 Sep 2023 11:35:30 +0800 (CST) Received: from slurm-master.loongson.cn (unknown [10.10.130.252]) by localhost.localdomain (Coremail) with SMTP id AQAAf8Cx7y_8LQFlvA8CAA--.3484S6; Wed, 13 Sep 2023 11:35:29 +0800 (CST) From: Xiaolong Chen To: gcc-patches@gcc.gnu.org Cc: xry111@xry111.site, i@xen0n.name, xuchenghua@loongson.cn, chenglulu@loongson.cn, Xiaolong Chen Subject: [PATCH v4 12/23] LoongArch: Add tests for SX vector vabsd/vmskgez/vmskltz/vmsknz/vsigncov instructions. Date: Wed, 13 Sep 2023 11:35:15 +0800 Message-Id: <20230913033522.5983-3-chenxiaolong@loongson.cn> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230913033522.5983-1-chenxiaolong@loongson.cn> References: <20230913033522.5983-1-chenxiaolong@loongson.cn> MIME-Version: 1.0 X-CM-TRANSID: AQAAf8Cx7y_8LQFlvA8CAA--.3484S6 X-CM-SenderInfo: hfkh05xldrz0tqj6z05rqj20fqof0/1tbiAQANBWUBHCIBBAAAsW X-Coremail-Antispam: 1Uk129KBj9UXoWxCw1rGr4xGryUKoXrpFWDXr4rpr12vr13Kr Wxua4YyryDtFyaqFWkAr92ya97JF17t3srKw1DGFsxXF13C34UAr1DtF9rWFy3tFy5GF4j qr47JwcCm3ZEXasCq-sJn29KB7ZKAUJUUUU8529EdanIXcx71UUUUU7KY7ZEXasCq-sGcS sGvfJ3Ic02F40EFcxC0VAKzVAqx4xG6I80ebIjqfuFe4nvWSU5nxnvy29KBjDU0xBIdaVr nRJUUUkIb4IE77IF4wAFF20E14v26r1j6r4UM7CY07I20VC2zVCF04k26cxKx2IYs7xG6r Wj6s0DM7CIcVAFz4kK6r1j6r18M28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48ve4kI8wA2 z4x0Y4vE2Ix0cI8IcVAFwI0_Ar0_tr1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI0_Cr0_Gr 1UM28EF7xvwVC2z280aVAFwI0_Gr1j6F4UJwA2z4x0Y4vEx4A2jsIEc7CjxVAFwI0_Gr1j 6F4UJwAS0I0E0xvYzxvE52x082IY62kv0487Mc804VCY07AIYIkI8VC2zVCFFI0UMc02F4 0EFcxC0VAKzVAqx4xG6I80ewAv7VC0I7IYx2IY67AKxVWrXVW3AwAv7VC2z280aVAFwI0_ Gr0_Cr1lOx8S6xCaFVCjc4AY6r1j6r4UM4x0Y48IcxkI7VAKI48JMxAIw28IcxkI7VAKI4 8JMxC20s026xCaFVCjc4AY6r1j6r4UMI8I3I0E5I8CrVAFwI0_Jr0_Jr4lx2IqxVCjr7xv wVAFwI0_JrI_JrWlx4CE17CEb7AF67AKxVWUAVWUtwCIc40Y0x0EwIxGrwCI42IY6xIIjx v20xvE14v26ryj6F1UMIIF0xvE2Ix0cI8IcVCY1x0267AKxVW8JVWxJwCI42IY6xAIw20E Y4v20xvaj40_Jr0_JF4lIxAIcVC2z280aVAFwI0_Gr0_Cr1lIxAIcVC2z280aVCY1x0267 AKxVW8JVW8JrUvcSsGvfC2KfnxnUUI43ZEXa7IU04v3UUUUUU== X-Spam-Status: No, score=-12.7 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: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1776892245003281939 X-GMAIL-MSGID: 1776892245003281939 gcc/testsuite/ChangeLog: * gcc.target/loongarch/vector/lsx/lsx-vabsd-1.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vabsd-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-vsigncov.c: New test. --- .../loongarch/vector/lsx/lsx-vabsd-1.c | 272 +++++++++++ .../loongarch/vector/lsx/lsx-vabsd-2.c | 398 ++++++++++++++++ .../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-vsigncov.c | 425 ++++++++++++++++++ 6 files changed, 1639 insertions(+) create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vabsd-1.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vabsd-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-vsigncov.c diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vabsd-1.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vabsd-1.c new file mode 100644 index 00000000000..e336581f3b4 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vabsd-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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vabsd_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]) = 0xfda9b23a624082fd; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000ffff0000; + *((unsigned long *)&__m128i_result[1]) = 0x03574e3a62407e03; + *((unsigned long *)&__m128i_result[0]) = 0x0000000001010000; + __m128i_out = __lsx_vabsd_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x8000000080000000; + *((unsigned long *)&__m128i_op0[0]) = 0x7fffffff7fffffff; + *((unsigned long *)&__m128i_op1[1]) = 0xfffd000700000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0014fff500000000; + *((unsigned long *)&__m128i_result[1]) = 0x7f03000780000000; + *((unsigned long *)&__m128i_result[0]) = 0x7f15000a7f010101; + __m128i_out = __lsx_vabsd_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_vabsd_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x7fffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x000000060000000e; + *((unsigned long *)&__m128i_op1[0]) = 0x000000127fffffea; + *((unsigned long *)&__m128i_result[1]) = 0x7f0101070101010f; + *((unsigned long *)&__m128i_result[0]) = 0x000000127f010116; + __m128i_out = __lsx_vabsd_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000000000000000b; + *((unsigned long *)&__m128i_op0[0]) = 0x000000000000000b; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x000000000000000b; + *((unsigned long *)&__m128i_result[0]) = 0x000000000000000b; + __m128i_out = __lsx_vabsd_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]) = 0x67eb85af0000b000; + *((unsigned long *)&__m128i_op1[0]) = 0xc8847ef6ed3f2000; + *((unsigned long *)&__m128i_result[1]) = 0x67157b5100005000; + *((unsigned long *)&__m128i_result[0]) = 0x387c7e0a133f2000; + __m128i_out = __lsx_vabsd_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfff7fffefffa01ff; + *((unsigned long *)&__m128i_op0[0]) = 0xfffbfffefffe01ff; + *((unsigned long *)&__m128i_op1[1]) = 0xfcfcfcfcfcfcfcfd; + *((unsigned long *)&__m128i_op1[0]) = 0xfcfcfcfcfcfcfcfd; + *((unsigned long *)&__m128i_result[1]) = 0x0305030203020502; + *((unsigned long *)&__m128i_result[0]) = 0x0301030203020502; + __m128i_out = __lsx_vabsd_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x4ee376188658d85f; + *((unsigned long *)&__m128i_op0[0]) = 0x5728dcc85ac760d2; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x4e1d76187a58285f; + *((unsigned long *)&__m128i_result[0]) = 0x572824385a39602e; + __m128i_out = __lsx_vabsd_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_vabsd_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]) = 0xf654ad7447e59090; + *((unsigned long *)&__m128i_op1[0]) = 0x27b1b106b8145f50; + *((unsigned long *)&__m128i_result[1]) = 0x0a545374471b7070; + *((unsigned long *)&__m128i_result[0]) = 0x274f4f0648145f50; + __m128i_out = __lsx_vabsd_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_vabsd_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x21f32eafa486fd38; + *((unsigned long *)&__m128i_op0[0]) = 0x407c2ca3d3430357; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x21f32eaf5b7a02c8; + *((unsigned long *)&__m128i_result[0]) = 0x407c2ca32cbd0357; + __m128i_out = __lsx_vabsd_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_vabsd_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x000000003bfb4000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x000000003bfb4000; + __m128i_out = __lsx_vabsd_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]) = 0x0000ffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0x0000ffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000100010001; + *((unsigned long *)&__m128i_result[0]) = 0x0000000100010001; + __m128i_out = __lsx_vabsd_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffdf; + *((unsigned long *)&__m128i_op1[1]) = 0xffff0000ffff0000; + *((unsigned long *)&__m128i_op1[0]) = 0xffff0000ffff0000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000100000001; + *((unsigned long *)&__m128i_result[0]) = 0x0000000100000021; + __m128i_out = __lsx_vabsd_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_vabsd_h (__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]) = 0x000700000004e000; + *((unsigned long *)&__m128i_op1[0]) = 0x0003000000012020; + *((unsigned long *)&__m128i_result[1]) = 0x0038000000051fff; + *((unsigned long *)&__m128i_result[0]) = 0x003c000000022021; + __m128i_out = __lsx_vabsd_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_vabsd_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_vabsd_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x9c9d9b9bbfaa20e9; + *((unsigned long *)&__m128i_op0[0]) = 0xbe081c963e6fee68; + *((unsigned long *)&__m128i_op1[1]) = 0x0000feff23560000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000fd1654860000; + *((unsigned long *)&__m128i_result[1]) = 0x6363636463abdf17; + *((unsigned long *)&__m128i_result[0]) = 0x41f8e08016161198; + __m128i_out = __lsx_vabsd_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]) = 0x0000000000000001; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000001; + __m128i_out = __lsx_vabsd_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000800000000; + *((unsigned long *)&__m128i_op0[0]) = 0xff01fe0400000006; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x000000000005fffa; + *((unsigned long *)&__m128i_result[1]) = 0x0000000800000000; + *((unsigned long *)&__m128i_result[0]) = 0x00fe01fc0005fff4; + __m128i_out = __lsx_vabsd_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]) = 0xfffffffffffffffa; + *((unsigned long *)&__m128i_op1[0]) = 0xfffffffffffffffa; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000005; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000005; + __m128i_out = __lsx_vabsd_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x010003f00000ff00; + *((unsigned long *)&__m128i_op0[0]) = 0x017f03000000ff00; + *((unsigned long *)&__m128i_op1[1]) = 0x010003f00000ff00; + *((unsigned long *)&__m128i_op1[0]) = 0x017f03000000ff00; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vabsd_d (__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]) = 0x000000001fffffff; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x000000001ffffffe; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000001; + __m128i_out = __lsx_vabsd_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000ffac0a000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000ffac0a000000; + __m128i_out = __lsx_vabsd_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-vabsd-2.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vabsd-2.c new file mode 100644 index 00000000000..c1af80e1463 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vabsd-2.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]) = 0xa8beed87bc3f2be1; + *((unsigned long *)&__m128i_op0[0]) = 0x0024d8f6a494006a; + *((unsigned long *)&__m128i_op1[1]) = 0xfeffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xfeffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x5641127843c0d41e; + *((unsigned long *)&__m128i_result[0]) = 0xfedb27095b6bff95; + __m128i_out = __lsx_vabsd_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_vabsd_bu (__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]) = 0x0000000000000000; + __m128i_out = __lsx_vabsd_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x00000383ffff1fff; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000ca354688; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000038335ca2777; + __m128i_out = __lsx_vabsd_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]) = 0x00000000fff8fff8; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000fff80000; + *((unsigned long *)&__m128i_result[1]) = 0x00000000fff8fff8; + *((unsigned long *)&__m128i_result[0]) = 0x00000000fff80000; + __m128i_out = __lsx_vabsd_bu (__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]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0002ffff00000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vabsd_bu (__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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000001fd0; + __m128i_out = __lsx_vabsd_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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000005; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000005; + __m128i_out = __lsx_vabsd_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]) = 0x0000000000000005; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000005; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000005; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000005; + __m128i_out = __lsx_vabsd_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xfffffffffffffff0; + *((unsigned long *)&__m128i_op1[1]) = 0x00000000ff08ffff; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x00000000ff08ffff; + *((unsigned long *)&__m128i_result[0]) = 0xfffffffffffffff0; + __m128i_out = __lsx_vabsd_bu (__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_vabsd_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xfefff00000001fff; + *((unsigned long *)&__m128i_op1[1]) = 0xffe1ffc100000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000400000; + *((unsigned long *)&__m128i_result[1]) = 0xffe1ffc100000000; + *((unsigned long *)&__m128i_result[0]) = 0xfefff00000401fff; + __m128i_out = __lsx_vabsd_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]) = 0xffffffffffffffff; + __m128i_out = __lsx_vabsd_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_vabsd_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]) = 0xff000000ff000000; + *((unsigned long *)&__m128i_op1[0]) = 0xff000000ff000000; + *((unsigned long *)&__m128i_result[1]) = 0xff000000ff000000; + *((unsigned long *)&__m128i_result[0]) = 0xff000000ff000000; + __m128i_out = __lsx_vabsd_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x13f9c5b60028a415; + *((unsigned long *)&__m128i_op0[0]) = 0x545cab1d7e57c415; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x13f9c5b60028a415; + *((unsigned long *)&__m128i_result[0]) = 0x545cab1d81a83bea; + __m128i_out = __lsx_vabsd_hu (__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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vabsd_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_vabsd_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_vabsd_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffcfb799f1; + *((unsigned long *)&__m128i_op0[0]) = 0x0282800002828282; + *((unsigned long *)&__m128i_op1[1]) = 0x5555001400005111; + *((unsigned long *)&__m128i_op1[0]) = 0xffabbeab55110140; + *((unsigned long *)&__m128i_result[1]) = 0xaaaaffebcfb748e0; + *((unsigned long *)&__m128i_result[0]) = 0xfd293eab528e7ebe; + __m128i_out = __lsx_vabsd_wu (__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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vabsd_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x56a09e662ab46b31; + *((unsigned long *)&__m128i_op0[0]) = 0xb4b8122ef4054bb3; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x56a09e662ab46b31; + *((unsigned long *)&__m128i_result[0]) = 0xb4b8122ef4054bb3; + __m128i_out = __lsx_vabsd_wu (__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]) = 0xc39fffff007fffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000fe00fd; + __m128i_out = __lsx_vabsd_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]) = 0x8006000080020000; + *((unsigned long *)&__m128i_op1[0]) = 0x8004000080020000; + *((unsigned long *)&__m128i_result[1]) = 0x8006000080020000; + *((unsigned long *)&__m128i_result[0]) = 0x8004000080020000; + __m128i_out = __lsx_vabsd_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]) = 0x00000001ca02f854; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000100013fa0; + *((unsigned long *)&__m128i_result[1]) = 0x00000001ca02f854; + *((unsigned long *)&__m128i_result[0]) = 0x0000000100013fa0; + __m128i_out = __lsx_vabsd_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_vabsd_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000400000004; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffff0015172b; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xfffffffb00151727; + __m128i_out = __lsx_vabsd_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_vabsd_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_vabsd_wu (__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]) = 0x0000000400000004; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000400000004; + *((unsigned long *)&__m128i_result[1]) = 0xfffffffbfffffff8; + *((unsigned long *)&__m128i_result[0]) = 0xfffffffbfffffff8; + __m128i_out = __lsx_vabsd_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffdc; + *((unsigned long *)&__m128i_op0[0]) = 0xfffffffffffffffc; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000400000004; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000400000004; + *((unsigned long *)&__m128i_result[1]) = 0xfffffffbffffffd8; + *((unsigned long *)&__m128i_result[0]) = 0xfffffffbfffffff8; + __m128i_out = __lsx_vabsd_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_vabsd_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]) = 0x0000000000000003; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000003; + __m128i_out = __lsx_vabsd_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_vabsd_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000006; + *((unsigned long *)&__m128i_op1[1]) = 0x000000490000004d; + *((unsigned long *)&__m128i_op1[0]) = 0x00000001ffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x000000490000004d; + *((unsigned long *)&__m128i_result[0]) = 0x00000001fffffff9; + __m128i_out = __lsx_vabsd_du (__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]) = 0x64b680a2ae3af8c8; + *((unsigned long *)&__m128i_op1[0]) = 0x161c0c363c200824; + *((unsigned long *)&__m128i_result[1]) = 0x23b57fa16d39f7c8; + *((unsigned long *)&__m128i_result[0]) = 0x161c0c363c200824; + __m128i_out = __lsx_vabsd_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x3ff0010000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x3ff0010000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x7ff0000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x7ff0000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x3fffff0000000000; + *((unsigned long *)&__m128i_result[0]) = 0x3fffff0000000000; + __m128i_out = __lsx_vabsd_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]) = 0x1ffffffff8001000; + *((unsigned long *)&__m128i_op1[0]) = 0xf0bd80bd80bd8000; + *((unsigned long *)&__m128i_result[1]) = 0x1ffffffff8001000; + *((unsigned long *)&__m128i_result[0]) = 0xf0bd80bd80bd8000; + __m128i_out = __lsx_vabsd_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffff00; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffff00; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000008; + *((unsigned long *)&__m128i_op1[0]) = 0x0020002000200020; + *((unsigned long *)&__m128i_result[1]) = 0xfffffffffffffef8; + *((unsigned long *)&__m128i_result[0]) = 0xffdfffdfffdffee0; + __m128i_out = __lsx_vabsd_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]) = 0x8080808080808080; + *((unsigned long *)&__m128i_op1[0]) = 0x8080808080808080; + *((unsigned long *)&__m128i_result[1]) = 0x8080808080808080; + *((unsigned long *)&__m128i_result[0]) = 0x8080808080808080; + __m128i_out = __lsx_vabsd_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_vabsd_du (__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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x000000003ddc5dac; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vabsd_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-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-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; +} From patchwork Wed Sep 13 03:35:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: chenxiaolong X-Patchwork-Id: 138588 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9ecd:0:b0:3f2:4152:657d with SMTP id t13csp832381vqx; Tue, 12 Sep 2023 20:41:36 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGP9dBcCQtqO8OmjGimUkbn5JkcZTSpcf71RBRpJ5ONiDGlJ90so44jiqo13ZSr3MTLLO+z X-Received: by 2002:adf:e80a:0:b0:317:4cf8:35f9 with SMTP id o10-20020adfe80a000000b003174cf835f9mr1016555wrm.16.1694576496720; Tue, 12 Sep 2023 20:41:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694576496; cv=none; d=google.com; s=arc-20160816; b=dmFa9ZmPNr/A0BzfLpHehllrLFkDHnlarbE5+3XLBr/GLurMWeFdP+RjZf0NAllBFf N0IOlHmlmM6M3D0uac6aabqdZqNj0TImkg8M5zCJn1xlJux1tRkFirF84txNfyD0EF3+ AU+boBx+ZI0NcVSSxBeNJL/6ygOZa8HZhP/lR+ZaW7vpuW1342F8sZwvzb7geC5GQxlP AvPMZJTLrHywO5OPEJ4CgJgOgcN8zMiEKy/7e/rFuHfZX9YhCH5y+7g/0Z4ONduvWvfS GkxUvd05ozjlopZ3Nn6ok9BIOQB2krUK2ypVOo08f76y4i6SPoh2ZHo3exxlFheeTd7c hVOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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:cc:to :from:dmarc-filter:delivered-to; bh=7qujx8Afhhl3qi++G1E94z46PppaCVK1ERDA1hRQTHU=; fh=3pFUYcpS/27XRzOf17GfR86AuNQu+P1CET04YURgCLs=; b=D6MBWxTJQrP3bsmVqIo1EBIT66S/1pFV8vHDZMh9vglBb639WXYEICJr1vzjb3OLSy aCZh8eFopXXqFJlyPPpnv3xV3PiDHWplsw0yyxcXLbGYyO2nm+QHzSXBIs5hVEeTT+s2 8scUIRSOD8j782Yki8uY0Nl/gYjSx568wai+NvFySvxmK5BCu2d1HOv2/6UXQzvmPLB9 OlcTpB13yKkRkN7Q2Oep4HMrK+i1qwK1d2gwipma0nHlSHDvVl5zRoK6neQ02JdIvCfH Ih78UgaOI070JtkbnFrrv6VMERFDWCMHi+vTYQpycsPm0Sc3oa7SsR2bxcQFRtHWyZkO CP8w== 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 ek8-20020a056402370800b0052f3134cda0si7412928edb.581.2023.09.12.20.41.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Sep 2023 20:41:36 -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 C485D392AC3B for ; Wed, 13 Sep 2023 03:36:11 +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 938F33882AEB for ; Wed, 13 Sep 2023 03:35:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 938F33882AEB 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 _____8DxPOsELgFlxDAmAA--.3148S3; Wed, 13 Sep 2023 11:35:32 +0800 (CST) Received: from slurm-master.loongson.cn (unknown [10.10.130.252]) by localhost.localdomain (Coremail) with SMTP id AQAAf8Cx7y_8LQFlvA8CAA--.3484S7; Wed, 13 Sep 2023 11:35:31 +0800 (CST) From: Xiaolong Chen To: gcc-patches@gcc.gnu.org Cc: xry111@xry111.site, i@xen0n.name, xuchenghua@loongson.cn, chenglulu@loongson.cn, Xiaolong Chen Subject: [PATCH v4 13/23] LoongArch: Add tests for SX vector vdiv/vmod instructions. Date: Wed, 13 Sep 2023 11:35:16 +0800 Message-Id: <20230913033522.5983-4-chenxiaolong@loongson.cn> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230913033522.5983-1-chenxiaolong@loongson.cn> References: <20230913033522.5983-1-chenxiaolong@loongson.cn> MIME-Version: 1.0 X-CM-TRANSID: AQAAf8Cx7y_8LQFlvA8CAA--.3484S7 X-CM-SenderInfo: hfkh05xldrz0tqj6z05rqj20fqof0/1tbiAQANBWUBHCIBBgAAsU X-Coremail-Antispam: 1Uk129KBj9rXoW8Xw4rZF17JrWfuw43GoXrpF48AFW7pr12vr 13KrWxua4YyryUtFyYqFWkAr92yayxJF47t3srKw1DGFsxXF13Ca4UAr1DtF9rWFy3tF95 GF4jqr47JwcCm3ZEXasCq-sJn29KB7ZKAUJUUUU8529EdanIXcx71UUUUU7KY7ZEXasCq- sGcSsGvfJ3Ic02F40EFcxC0VAKzVAqx4xG6I80ebIjqfuFe4nvWSU5nxnvy29KBjDU0xBI daVrnRJUUUkIb4IE77IF4wAFF20E14v26r1j6r4UM7CY07I20VC2zVCF04k26cxKx2IYs7 xG6rWj6s0DM7CIcVAFz4kK6r106r15M28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48ve4kI 8wA2z4x0Y4vE2Ix0cI8IcVAFwI0_Ar0_tr1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI0_Cr 0_Gr1UM28EF7xvwVC2z280aVAFwI0_Gr1j6F4UJwA2z4x0Y4vEx4A2jsIEc7CjxVAFwI0_ Gr1j6F4UJwAS0I0E0xvYzxvE52x082IY62kv0487Mc804VCY07AIYIkI8VC2zVCFFI0UMc 02F40EFcxC0VAKzVAqx4xG6I80ewAv7VC0I7IYx2IY67AKxVWrXVW3AwAv7VC2z280aVAF wI0_Gr0_Cr1lOx8S6xCaFVCjc4AY6r1j6r4UM4x0Y48IcxkI7VAKI48JMxAIw28IcxkI7V AKI48JMxC20s026xCaFVCjc4AY6r1j6r4UMI8I3I0E5I8CrVAFwI0_Jr0_Jr4lx2IqxVCj r7xvwVAFwI0_JrI_JrWlx4CE17CEb7AF67AKxVWUAVWUtwCIc40Y0x0EwIxGrwCI42IY6x IIjxv20xvE14v26ryj6F1UMIIF0xvE2Ix0cI8IcVCY1x0267AKxVW8JVWxJwCI42IY6xAI w20EY4v20xvaj40_Jr0_JF4lIxAIcVC2z280aVAFwI0_Gr0_Cr1lIxAIcVC2z280aVCY1x 0267AKxVW8JVW8JrUvcSsGvfC2KfnxnUUI43ZEXa7IU0HUDJUUUUU== X-Spam-Status: No, score=-12.7 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: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1776892245045458495 X-GMAIL-MSGID: 1776892245045458495 gcc/testsuite/ChangeLog: * 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-vmod-1.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vmod-2.c: New test. --- .../loongarch/vector/lsx/lsx-vdiv-1.c | 299 ++++++++++++++++++ .../loongarch/vector/lsx/lsx-vdiv-2.c | 254 +++++++++++++++ .../loongarch/vector/lsx/lsx-vmod-1.c | 254 +++++++++++++++ .../loongarch/vector/lsx/lsx-vmod-2.c | 254 +++++++++++++++ 4 files changed, 1061 insertions(+) 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-vmod-1.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmod-2.c 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-vmod-1.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmod-1.c new file mode 100644 index 00000000000..5470d40dd69 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmod-1.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]) = 0x82c539ffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xc72df14afbfafdf9; + *((unsigned long *)&__m128i_op1[1]) = 0x82c539ffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xc72df14afbfafdf9; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmod_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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmod_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]) = 0xffffffff994cb09c; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffc3639d96; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmod_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0003c853c843c844; + *((unsigned long *)&__m128i_op0[0]) = 0x0003c853c843c844; + *((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_vmod_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]) = 0x6363636363636363; + *((unsigned long *)&__m128i_op1[0]) = 0x6363636363636363; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmod_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0001808281820102; + *((unsigned long *)&__m128i_op0[0]) = 0x0001808201018081; + *((unsigned long *)&__m128i_op1[1]) = 0x8080808080808080; + *((unsigned long *)&__m128i_op1[0]) = 0x8080808080808080; + *((unsigned long *)&__m128i_result[1]) = 0x0001008281820102; + *((unsigned long *)&__m128i_result[0]) = 0x0001008201010081; + __m128i_out = __lsx_vmod_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0101010240010202; + *((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_vmod_b (__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]) = 0xff00ff00ff00ff00; + *((unsigned long *)&__m128i_op1[0]) = 0xff00ff00ff00ff00; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmod_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_vmod_h (__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]) = 0x0101080408040804; + *((unsigned long *)&__m128i_op1[0]) = 0x0804080407040804; + *((unsigned long *)&__m128i_result[1]) = 0x0001000100010001; + *((unsigned long *)&__m128i_result[0]) = 0x0001000104000800; + __m128i_out = __lsx_vmod_h (__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]) = 0x1202120212021202; + *((unsigned long *)&__m128i_op1[0]) = 0x1202120212021202; + *((unsigned long *)&__m128i_result[1]) = 0x1000100010001000; + *((unsigned long *)&__m128i_result[0]) = 0x1000100010001000; + __m128i_out = __lsx_vmod_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00ff00ff00ff00ff; + *((unsigned long *)&__m128i_op0[0]) = 0x00ff00ff00ff00ff; + *((unsigned long *)&__m128i_op1[1]) = 0xfffffffffffffffa; + *((unsigned long *)&__m128i_op1[0]) = 0xfffffffffffffffa; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000003; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000003; + __m128i_out = __lsx_vmod_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]) = 0xfffffffffffffffc; + *((unsigned long *)&__m128i_op1[0]) = 0xfffffffffffffffc; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmod_h (__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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmod_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]) = 0x0000000100000001; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmod_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x370bdfecffecffec; + *((unsigned long *)&__m128i_op0[0]) = 0x370bdfeca2eb9931; + *((unsigned long *)&__m128i_op1[1]) = 0x370bdfecffecffec; + *((unsigned long *)&__m128i_op1[0]) = 0x370bdfeca2eb9931; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmod_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x805ffffe01001fe0; + *((unsigned long *)&__m128i_op0[0]) = 0x9a49e11102834d70; + *((unsigned long *)&__m128i_op1[1]) = 0x8144ffff01c820a4; + *((unsigned long *)&__m128i_op1[0]) = 0x9b2ee1a4034b4e34; + *((unsigned long *)&__m128i_result[1]) = 0xff1affff01001fe0; + *((unsigned long *)&__m128i_result[0]) = 0xff1aff6d02834d70; + __m128i_out = __lsx_vmod_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x001d001d001d001d; + *((unsigned long *)&__m128i_op0[0]) = 0x001d001d001d0000; + *((unsigned long *)&__m128i_op1[1]) = 0x001d001d001d001d; + *((unsigned long *)&__m128i_op1[0]) = 0x001d001d001d0000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmod_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]) = 0x000a000a000a000a; + *((unsigned long *)&__m128i_op1[0]) = 0x000a000a000a000a; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmod_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]) = 0x4f8000004f800000; + *((unsigned long *)&__m128i_op1[0]) = 0x4f8000004f800000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vmod_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00ffff0000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x00ffff000000ff00; + *((unsigned long *)&__m128i_op1[1]) = 0x03c0000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x03c0038000000380; + *((unsigned long *)&__m128i_result[1]) = 0x00ffff0000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00ffff000000ff00; + __m128i_out = __lsx_vmod_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]) = 0x0000006f00001f0a; + *((unsigned long *)&__m128i_op1[0]) = 0x0000958affff995d; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmod_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x80000000307d0771; + *((unsigned long *)&__m128i_op0[0]) = 0x0d8e36706ac02b9b; + *((unsigned long *)&__m128i_op1[1]) = 0x80000000307d0771; + *((unsigned long *)&__m128i_op1[0]) = 0x0d8e36706ac02b9b; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmod_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x8000000000000000; + *((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_vmod_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]) = 0x413e276583869d79; + *((unsigned long *)&__m128i_op1[0]) = 0x7f7f017f9d8726d3; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmod_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]) = 0x000000000011ffee; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000000dfff2; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmod_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-vmod-2.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmod-2.c new file mode 100644 index 00000000000..8deb04427a0 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmod-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]) = 0x16161616a16316b0; + *((unsigned long *)&__m128i_op0[0]) = 0x6363636363636363; + *((unsigned long *)&__m128i_op1[1]) = 0x16161616a16316b0; + *((unsigned long *)&__m128i_op1[0]) = 0x6363636363636363; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmod_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000001fffffffe; + *((unsigned long *)&__m128i_op0[0]) = 0x00000001fffffffe; + *((unsigned long *)&__m128i_op1[1]) = 0x5a5a5a5a5b5a5b5a; + *((unsigned long *)&__m128i_op1[0]) = 0x5a5a5a5a5b5a5b5a; + *((unsigned long *)&__m128i_result[1]) = 0x00000001494b494a; + *((unsigned long *)&__m128i_result[0]) = 0x00000001494b494a; + __m128i_out = __lsx_vmod_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_vmod_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]) = 0xd70b30c96ea9f4e8; + *((unsigned long *)&__m128i_op1[0]) = 0xa352bfac9269e0aa; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmod_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]) = 0xffffffffffffffeb; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffeb; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmod_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_vmod_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_vmod_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]) = 0x7f801fa06451ef11; + *((unsigned long *)&__m128i_op1[0]) = 0x68bcf93435ed25ed; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmod_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000022666621; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffdd9999da; + *((unsigned long *)&__m128i_op1[1]) = 0x7f7f7f7f00107f04; + *((unsigned long *)&__m128i_op1[0]) = 0x7f0000fd7f0000fd; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000066621; + *((unsigned long *)&__m128i_result[0]) = 0x01ff00085e9900ab; + __m128i_out = __lsx_vmod_hu (__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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xefffdffff0009d3d; + *((unsigned long *)&__m128i_result[1]) = 0x000000000000bd3d; + *((unsigned long *)&__m128i_result[0]) = 0x000000007fff0000; + __m128i_out = __lsx_vmod_hu (__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]) = 0x0000000004870ba0; + __m128i_out = __lsx_vmod_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x2006454690d3de87; + *((unsigned long *)&__m128i_op0[0]) = 0x2006454690d3de87; + *((unsigned long *)&__m128i_op1[1]) = 0x2006454690d3de87; + *((unsigned long *)&__m128i_op1[0]) = 0x2006454690d3de87; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmod_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0002000200020002; + *((unsigned long *)&__m128i_op0[0]) = 0x0002000200020002; + *((unsigned long *)&__m128i_op1[1]) = 0x02b010f881a281a2; + *((unsigned long *)&__m128i_op1[0]) = 0x27b169bbb8145f50; + *((unsigned long *)&__m128i_result[1]) = 0x0002000200020002; + *((unsigned long *)&__m128i_result[0]) = 0x0002000200020002; + __m128i_out = __lsx_vmod_hu (__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]) = 0x0010001000100010; + *((unsigned long *)&__m128i_op1[0]) = 0x0010001000100010; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x000f000000000000; + __m128i_out = __lsx_vmod_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]) = 0x0000000100000001; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000100000001; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmod_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000fffe0000fffe; + *((unsigned long *)&__m128i_op1[1]) = 0xffffff00ffffff00; + *((unsigned long *)&__m128i_op1[0]) = 0xffffff00ffffff00; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000fffe0000fffe; + __m128i_out = __lsx_vmod_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]) = 0x8000000080000000; + *((unsigned long *)&__m128i_op1[0]) = 0x8000000080000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmod_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]) = 0x00ff00ff00ff00ff; + *((unsigned long *)&__m128i_op1[0]) = 0x00ff00ff00ff00ff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmod_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]) = 0x0000000000000200; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000200; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmod_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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmod_du (__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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000ffff0000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmod_du (__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]) = 0xff80ff80ff80ff80; + *((unsigned long *)&__m128i_op1[0]) = 0xff80ff8080008000; + *((unsigned long *)&__m128i_result[1]) = 0x0001000100010001; + *((unsigned long *)&__m128i_result[0]) = 0x0001000101fd01fe; + __m128i_out = __lsx_vmod_du (__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]) = 0xff2cfed4fea8ff44; + *((unsigned long *)&__m128i_op1[0]) = 0xfffeffff0035ff8f; + *((unsigned long *)&__m128i_result[1]) = 0x00d3012acc56f9bb; + *((unsigned long *)&__m128i_result[0]) = 0x00000000000000a0; + __m128i_out = __lsx_vmod_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x37c0001000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x37c0001000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0004000400040004; + *((unsigned long *)&__m128i_op1[0]) = 0x0004000400040004; + *((unsigned long *)&__m128i_result[1]) = 0x0003c853c843c844; + *((unsigned long *)&__m128i_result[0]) = 0x0003c853c843c844; + __m128i_out = __lsx_vmod_du (__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]) = 0xfcfcfcdcfcfcfcdc; + *((unsigned long *)&__m128i_op1[0]) = 0xfcfcfcdcfcfcfcdc; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x000000003ddc5dac; + __m128i_out = __lsx_vmod_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xfffffffefffff784; + *((unsigned long *)&__m128i_op1[1]) = 0x10f8000100000001; + *((unsigned long *)&__m128i_op1[0]) = 0x00000001000010f8; + *((unsigned long *)&__m128i_result[1]) = 0x0177fff0fffffff0; + *((unsigned long *)&__m128i_result[0]) = 0x00000000011ff8bc; + __m128i_out = __lsx_vmod_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} From patchwork Wed Sep 13 03:35:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: chenxiaolong X-Patchwork-Id: 138591 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9ecd:0:b0:3f2:4152:657d with SMTP id t13csp832698vqx; Tue, 12 Sep 2023 20:42:52 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHKvDkcPCO7+8PSnoVYzAMtSsD/4zAZ6ENG6ZlILTlPcJna8Rl4sJpzcm+h5lGx3rJ9C64J X-Received: by 2002:a5d:4e02:0:b0:31a:dc27:e10 with SMTP id p2-20020a5d4e02000000b0031adc270e10mr993641wrt.65.1694576572120; Tue, 12 Sep 2023 20:42:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694576572; cv=none; d=google.com; s=arc-20160816; b=kgkhH9Eq0K1RX8Miui5pagTqcJOyrho/9t4elXgsUL5q7CgOOelIwfmf9Kv8aHfOGl hGuJm/hyFzoFRXQylJGAQ5pmMTo+2VLzXLD4Mq+ulzIij0kSP6+bMFikEztpqwwjiSU/ DA4mPJZyI2NpNuc8prICW3WQXDjnvsXfNGLA0t/V2PUhvEpTtWdHvTPCZAScwr3N/RB2 zrV3yntOpJu6F4iNDaeW3ioAecYpcB8och3GCJ1c4ze7WOocZsOdVKIpP45l3iW+8tEc eSoMstei+drfcbehNjj5axKihxrFeVgaSA7OJZFEt/iqj11IFmxe7lU/nOeoaZKteLmA Xwtw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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:cc:to :from:dmarc-filter:delivered-to; bh=W6UnTHrc336wdizbMc2D55tmaOM17wL7XcsnKNXmbgU=; fh=3pFUYcpS/27XRzOf17GfR86AuNQu+P1CET04YURgCLs=; b=Hvt6Fz41LZuPylQ/QWpObD71oqLy4a1X5EntSlo9g5Qv6f7uDZPh6VPtG1RBjqt3HU mn/QHn5BHcM0+qUuNkaegM6HxaADZUf7dSxCisfGpoiKia6RQBg9fEirgYW370JY+iMV daxYdNpt0aFTzhQpMV3YIFx81jEoiaf3R8xDPxC69HcoOPJhU+nSTyR0DUHJqEK+TwaW wBtori6u8W9lCzauJhBRqkpmGi6e9MDnlIiD6GKBupnsjE0Y/MdI+C69iGdfJ2iEWds0 trt3b+D3sTsfUgQ1uj0RX1r5Z4uBrM12T/uoBNUHVlg9cKrBX1flPsyHOcjs3ILePduf 2wdw== 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 c17-20020aa7d611000000b0052a3c7c9e8dsi9549987edr.659.2023.09.12.20.42.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Sep 2023 20:42:52 -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 A00F2394D8F5 for ; Wed, 13 Sep 2023 03:36:28 +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 AF5F53883023 for ; Wed, 13 Sep 2023 03:35:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org AF5F53883023 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 1qgGfD-00038D-HE for gcc-patches@gcc.gnu.org; Tue, 12 Sep 2023 23:35:45 -0400 Received: from loongson.cn (unknown [10.10.130.252]) by gateway (Coremail) with SMTP id _____8AxTesHLgFlyTAmAA--.3076S3; Wed, 13 Sep 2023 11:35:35 +0800 (CST) Received: from slurm-master.loongson.cn (unknown [10.10.130.252]) by localhost.localdomain (Coremail) with SMTP id AQAAf8Cx7y_8LQFlvA8CAA--.3484S8; Wed, 13 Sep 2023 11:35:33 +0800 (CST) From: Xiaolong Chen To: gcc-patches@gcc.gnu.org Cc: xry111@xry111.site, i@xen0n.name, xuchenghua@loongson.cn, chenglulu@loongson.cn, Xiaolong Chen Subject: [PATCH v4 14/23] LoongArch: Add tests for SX vector vsll/vslli/vsrl/vsrli/vsrln/vsrlni/vsrlr /vsrlri/vslrlrn/vsrlrni instructions. Date: Wed, 13 Sep 2023 11:35:17 +0800 Message-Id: <20230913033522.5983-5-chenxiaolong@loongson.cn> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230913033522.5983-1-chenxiaolong@loongson.cn> References: <20230913033522.5983-1-chenxiaolong@loongson.cn> MIME-Version: 1.0 X-CM-TRANSID: AQAAf8Cx7y_8LQFlvA8CAA--.3484S8 X-CM-SenderInfo: hfkh05xldrz0tqj6z05rqj20fqof0/1tbiAQANBWUBHCIBCAAAsa X-Coremail-Antispam: 1Uk129KBj9DXoWkAw4kZryDZFWkur17tFy3WrX_yoW8tFy7GF g_JFnxtFykWF4SvrnrXr1DZr98uw47XanF9a1UAF1qq3Wktr18Ca45AFyIqr17Jw1DZ3Wr AFyDZry8Crn8GFyUKosvyTuYvTs0mTUanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUj1kv1T uYvTs0mT0YCTnIWjqI5I8CrVACY4xI64kE6c02F40Ex7xfYxn0WfASr-VFAUDa7-sFnT9f nUUIcSsGvfJTRUUUb2xYFVCjjxCrM7AC8VAFwI0_Jr0_Gr1l1xkIjI8I6I8E6xAIw20EY4 v20xvaj40_Wr0E3s1l1IIY67AEw4v_Jr0_Jr4l8cAvFVAK0II2c7xJM28CjxkF64kEwVA0 rcxSw2x7M28EF7xvwVC0I7IYx2IY67AKxVW7JVWDJwA2z4x0Y4vE2Ix0cI8IcVCY1x0267 AKxVWxJVW8Jr1l84ACjcxK6I8E87Iv67AKxVW8Jr0_Cr1UM28EF7xvwVC2z280aVCY1x02 67AKxVW8Jr0_Cr1UM2AIxVAIcxkEcVAq07x20xvEncxIr21l57IF6xkI12xvs2x26I8E6x ACxx1l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26rWY6Fy7McIj6I8E 87Iv67AKxVW8JVWxJwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IYc2Ij64vIr41l42xK82 IYc2Ij64vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2IqxVAqx4xG67AKxVWUJVWUGwC2 0s026x8GjcxK67AKxVWUGVWUWwC2zVAF1VAY17CE14v26r126r1DMIIYrxkI7VAKI48JMI IF0xvE2Ix0cI8IcVAFwI0_Ar0_tr1lIxAIcVC0I7IYx2IY6xkF7I0E14v26r4j6F4UMIIF 0xvE42xK8VAvwI8IcIk0rVWUJVWUCwCI42IY6I8E87Iv67AKxVW8JVWxJwCI42IY6I8E87 Iv6xkF7I0E14v26r4j6r4UJbIYCTnIWIevJa73UjIFyTuYvjxUIwIDUUUUU 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: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1776892323680196071 X-GMAIL-MSGID: 1776892323680196071 gcc/testsuite/ChangeLog: * gcc.target/loongarch/vector/lsx/lsx-vsll.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vslli.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vsllwil-1.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vsllwil-2.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vsrl.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vsrli.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vsrln.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vsrlni.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vsrlr.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vsrlri.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vsrlrn.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vsrlrni.c: New test. --- .../loongarch/vector/lsx/lsx-vsll.c | 254 +++++++ .../loongarch/vector/lsx/lsx-vslli.c | 293 ++++++++ .../loongarch/vector/lsx/lsx-vsllwil-1.c | 244 +++++++ .../loongarch/vector/lsx/lsx-vsllwil-2.c | 189 +++++ .../loongarch/vector/lsx/lsx-vsrl.c | 389 ++++++++++ .../loongarch/vector/lsx/lsx-vsrli.c | 328 +++++++++ .../loongarch/vector/lsx/lsx-vsrln.c | 335 +++++++++ .../loongarch/vector/lsx/lsx-vsrlni.c | 281 +++++++ .../loongarch/vector/lsx/lsx-vsrlr.c | 434 +++++++++++ .../loongarch/vector/lsx/lsx-vsrlri.c | 300 ++++++++ .../loongarch/vector/lsx/lsx-vsrlrn.c | 164 +++++ .../loongarch/vector/lsx/lsx-vsrlrni.c | 686 ++++++++++++++++++ 12 files changed, 3897 insertions(+) create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsll.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vslli.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsllwil-1.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsllwil-2.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsrl.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsrli.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsrln.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsrlni.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsrlr.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsrlri.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsrlrn.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsrlrni.c diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsll.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsll.c new file mode 100644 index 00000000000..7b8ad7d5a44 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsll.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]) = 0x1dcc4255c9d85c05; + *((unsigned long *)&__m128i_op0[0]) = 0x3ab7a3fc47a5c31a; + *((unsigned long *)&__m128i_op1[1]) = 0x1dcc4255c9d85c05; + *((unsigned long *)&__m128i_op1[0]) = 0x3ab7a3fc47a5c31a; + *((unsigned long *)&__m128i_result[1]) = 0xb9884ab93b0b80a0; + *((unsigned long *)&__m128i_result[0]) = 0xf11e970c68000000; + __m128i_out = __lsx_vsll_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0101010101010101; + *((unsigned long *)&__m128i_op0[0]) = 0x0100000100010001; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0101010101010101; + *((unsigned long *)&__m128i_result[0]) = 0x0100000100010001; + __m128i_out = __lsx_vsll_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_vsll_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_vsll_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_vsll_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_vsll_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_vsll_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_vsll_w (__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]) = 0xffffffc0ffffff81; + *((unsigned long *)&__m128i_op1[0]) = 0xffff008000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0060e050007f0160; + *((unsigned long *)&__m128i_result[0]) = 0x0040007fff800000; + __m128i_out = __lsx_vsll_d (__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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000401000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsll_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]) = 0xfffcffff00000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000fffd000a0000; + *((unsigned long *)&__m128i_result[1]) = 0xf000800080000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000a00028004000; + __m128i_out = __lsx_vsll_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x6b9fe3649c9d6363; + *((unsigned long *)&__m128i_op0[0]) = 0x6363bc9e8b696363; + *((unsigned long *)&__m128i_op1[1]) = 0x6b9fe3649c9d6363; + *((unsigned long *)&__m128i_op1[0]) = 0x6363bc9e8b696363; + *((unsigned long *)&__m128i_result[1]) = 0xb9fe3640e4eb1b18; + *((unsigned long *)&__m128i_result[0]) = 0x800000005b4b1b18; + __m128i_out = __lsx_vsll_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0x80001b155b4b0000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffff00006c82; + *((unsigned long *)&__m128i_op1[0]) = 0x00009b140000917b; + *((unsigned long *)&__m128i_result[1]) = 0x80000000fffffffc; + *((unsigned long *)&__m128i_result[0]) = 0xb150000000000000; + __m128i_out = __lsx_vsll_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_vsll_h (__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]) = 0x8000000000008000; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vsll_h (__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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x03f1e3d28b1a8a1a; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x18e2184858682868; + __m128i_out = __lsx_vsll_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_vsll_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_vsll_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000ff02d060; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000ff02d060; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xff02d06000000000; + __m128i_out = __lsx_vsll_d (__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]) = 0x0001000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0001000100010001; + *((unsigned long *)&__m128i_result[0]) = 0x0001000100010001; + __m128i_out = __lsx_vsll_d (__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]) = 0x7fffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x8000000000000000; + __m128i_out = __lsx_vsll_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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsll_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_vsll_w (__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_vsll_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000000200000001c; + *((unsigned long *)&__m128i_op0[0]) = 0x000000200000001c; + *((unsigned long *)&__m128i_op1[1]) = 0x000000200000001c; + *((unsigned long *)&__m128i_op1[0]) = 0x000000200000001c; + *((unsigned long *)&__m128i_result[1]) = 0x00000020000000c0; + *((unsigned long *)&__m128i_result[0]) = 0x00000020000000c0; + __m128i_out = __lsx_vsll_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_vsll_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vslli.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vslli.c new file mode 100644 index 00000000000..7a77e80c081 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vslli.c @@ -0,0 +1,293 @@ +/* { 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_vslli_d (__m128i_op0, 0x35); + 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_vslli_b (__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_vslli_w (__m128i_op0, 0xb); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xaaaaffebcfb748e0; + *((unsigned long *)&__m128i_op0[0]) = 0xfd293eab528e7ebe; + *((unsigned long *)&__m128i_result[1]) = 0xf6e91c0000000000; + *((unsigned long *)&__m128i_result[0]) = 0x51cfd7c000000000; + __m128i_out = __lsx_vslli_d (__m128i_op0, 0x25); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xfffffff0ffe04000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vslli_d (__m128i_op0, 0x3f); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0xfffcfffcfffcfffc; + *((unsigned long *)&__m128i_result[0]) = 0xfffcfffcfffcfffc; + __m128i_out = __lsx_vslli_h (__m128i_op0, 0x2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xc39fffff007fffff; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000fe00fd; + *((unsigned long *)&__m128i_result[1]) = 0x0e7ffffc01fffffc; + *((unsigned long *)&__m128i_result[0]) = 0x0000000003f803f4; + __m128i_out = __lsx_vslli_w (__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_vslli_h (__m128i_op0, 0x0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000080000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000080000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000800000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000800000000000; + __m128i_out = __lsx_vslli_b (__m128i_op0, 0x4); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000001; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000040; + __m128i_out = __lsx_vslli_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_vslli_w (__m128i_op0, 0x19); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x7ff8000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vslli_d (__m128i_op0, 0x3c); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffff00ffff00ff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffff00; + *((unsigned long *)&__m128i_result[1]) = 0xfcfcfc00fcfc00fc; + *((unsigned long *)&__m128i_result[0]) = 0xfcfcfcfcfcfcfc00; + __m128i_out = __lsx_vslli_b (__m128i_op0, 0x2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000000000000007b; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000060; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vslli_b (__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_vslli_d (__m128i_op0, 0x38); + 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_vslli_w (__m128i_op0, 0xe); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x000000000000f00f; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x000000000000f00f; + __m128i_out = __lsx_vslli_b (__m128i_op0, 0x0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000d46cdc13; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000060000000; + __m128i_out = __lsx_vslli_w (__m128i_op0, 0x1d); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x7ff0000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x61608654a2d4f6da; + *((unsigned long *)&__m128i_result[1]) = 0xfee0000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xc2c00ca844a8ecb4; + __m128i_out = __lsx_vslli_b (__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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vslli_h (__m128i_op0, 0x5); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0004000400040004; + *((unsigned long *)&__m128i_op0[0]) = 0x0004000400040004; + *((unsigned long *)&__m128i_result[1]) = 0x0100000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0100000000000000; + __m128i_out = __lsx_vslli_d (__m128i_op0, 0x36); + 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_vslli_w (__m128i_op0, 0x18); + 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_vslli_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_vslli_d (__m128i_op0, 0x18); + 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_vslli_b (__m128i_op0, 0x3); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000002; + *((unsigned long *)&__m128i_op0[0]) = 0x00ff010300ff0103; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000002000; + *((unsigned long *)&__m128i_result[0]) = 0xf0003000f0003000; + __m128i_out = __lsx_vslli_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_vslli_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]) = 0x8000000080000000; + *((unsigned long *)&__m128i_result[0]) = 0x8000000080000000; + __m128i_out = __lsx_vslli_w (__m128i_op0, 0x1f); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffff800fff01; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffff001ffe02; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vslli_d (__m128i_op0, 0x1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xd78cfd70b5f65d76; + *((unsigned long *)&__m128i_op0[0]) = 0x5779108fdedda7e4; + *((unsigned long *)&__m128i_result[1]) = 0x67eb85afb2ebb000; + *((unsigned long *)&__m128i_result[0]) = 0xc8847ef6ed3f2000; + __m128i_out = __lsx_vslli_d (__m128i_op0, 0xb); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfffffff7fffffff7; + *((unsigned long *)&__m128i_op0[0]) = 0xfffffff7fffffff7; + *((unsigned long *)&__m128i_result[1]) = 0xfcfcfcdcfcfcfcdc; + *((unsigned long *)&__m128i_result[0]) = 0xfcfcfcdcfcfcfcdc; + __m128i_out = __lsx_vslli_b (__m128i_op0, 0x2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0x7fffffff7fffffff; + *((unsigned long *)&__m128i_result[1]) = 0xc0c0c0c0c0c0c0c0; + *((unsigned long *)&__m128i_result[0]) = 0xc0c0c0c0c0c0c0c0; + __m128i_out = __lsx_vslli_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_vslli_h (__m128i_op0, 0xb); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xe2560afe9c001a18; + *((unsigned long *)&__m128i_op0[0]) = 0xe2560afe9c001a18; + *((unsigned long *)&__m128i_result[1]) = 0x89582bf870006860; + *((unsigned long *)&__m128i_result[0]) = 0x89582bf870006860; + __m128i_out = __lsx_vslli_w (__m128i_op0, 0x2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x841f000fc28f801f; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x107c003c083c007c; + __m128i_out = __lsx_vslli_b (__m128i_op0, 0x2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffff9727ffff9727; + *((unsigned long *)&__m128i_op0[0]) = 0xfffffe79ffffba5f; + *((unsigned long *)&__m128i_result[1]) = 0xffff972700000000; + *((unsigned long *)&__m128i_result[0]) = 0xffffba5f00000000; + __m128i_out = __lsx_vslli_d (__m128i_op0, 0x20); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x101b0330eb022002; + *((unsigned long *)&__m128i_op0[0]) = 0x030220020310edc0; + *((unsigned long *)&__m128i_result[1]) = 0x0080800080000000; + *((unsigned long *)&__m128i_result[0]) = 0x8000000080008000; + __m128i_out = __lsx_vslli_b (__m128i_op0, 0x7); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x317fce80317fce80; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xf0000000f0000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vslli_h (__m128i_op0, 0xc); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0177fff0fffffff0; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000011ff8bc; + *((unsigned long *)&__m128i_result[1]) = 0x05dfffc3ffffffc0; + *((unsigned long *)&__m128i_result[0]) = 0x00000000047fe2f0; + __m128i_out = __lsx_vslli_d (__m128i_op0, 0x2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsllwil-1.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsllwil-1.c new file mode 100644 index 00000000000..796e88cad57 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsllwil-1.c @@ -0,0 +1,244 @@ +/* { 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]) = 0x0020002000200020; + *((unsigned long *)&__m128i_op0[0]) = 0x0020002000200020; + *((unsigned long *)&__m128i_result[1]) = 0x0000002000000020; + *((unsigned long *)&__m128i_result[0]) = 0x0000002000000020; + __m128i_out = __lsx_vsllwil_h_b (__m128i_op0, 0x0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x000000e0000000e0; + *((unsigned long *)&__m128i_result[1]) = 0x000000000000fc00; + *((unsigned long *)&__m128i_result[0]) = 0x000000000000fc00; + __m128i_out = __lsx_vsllwil_h_b (__m128i_op0, 0x5); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsllwil_h_b (__m128i_op0, 0x1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000001; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000001; + __m128i_out = __lsx_vsllwil_h_b (__m128i_op0, 0x0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000100000001; + *((unsigned long *)&__m128i_op0[0]) = 0xffeb48e03eab7ebe; + *((unsigned long *)&__m128i_result[1]) = 0xffc0fac01200f800; + *((unsigned long *)&__m128i_result[0]) = 0x0f80eac01f80ef80; + __m128i_out = __lsx_vsllwil_h_b (__m128i_op0, 0x6); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000000e7e20468; + *((unsigned long *)&__m128i_op0[0]) = 0xc2fac2fa53e7db29; + *((unsigned long *)&__m128i_result[1]) = 0xff84fff4ff84fff4; + *((unsigned long *)&__m128i_result[0]) = 0x00a6ffceffb60052; + __m128i_out = __lsx_vsllwil_h_b (__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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsllwil_h_b (__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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsllwil_h_b (__m128i_op0, 0x3); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x002e0059003b0000; + *((unsigned long *)&__m128i_result[1]) = 0x0000005c000000b2; + *((unsigned long *)&__m128i_result[0]) = 0x0000007600000000; + __m128i_out = __lsx_vsllwil_h_b (__m128i_op0, 0x1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x2e34594c3b000000; + *((unsigned long *)&__m128i_result[1]) = 0x017001a002c80260; + *((unsigned long *)&__m128i_result[0]) = 0x01d8000000000000; + __m128i_out = __lsx_vsllwil_h_b (__m128i_op0, 0x3); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x4f4f4f4f4f4f4f4f; + *((unsigned long *)&__m128i_op0[0]) = 0x4f4f4f4f4f4f4f4f; + *((unsigned long *)&__m128i_result[1]) = 0x09e009e009e009e0; + *((unsigned long *)&__m128i_result[0]) = 0x09e009e009e009e0; + __m128i_out = __lsx_vsllwil_h_b (__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_vsllwil_w_h (__m128i_op0, 0x7); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000001000001; + *((unsigned long *)&__m128i_op0[0]) = 0x0001000100000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000040000000400; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsllwil_w_h (__m128i_op0, 0xa); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000005050000; + *((unsigned long *)&__m128i_op0[0]) = 0x0505000005050505; + *((unsigned long *)&__m128i_result[1]) = 0x0028280000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0028280000282800; + __m128i_out = __lsx_vsllwil_w_h (__m128i_op0, 0xb); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfffffffffffff800; + *((unsigned long *)&__m128i_op0[0]) = 0x8000000080000000; + *((unsigned long *)&__m128i_result[1]) = 0xffc0000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xffc0000000000000; + __m128i_out = __lsx_vsllwil_w_h (__m128i_op0, 0x7); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0xffffff00ffffff00; + *((unsigned long *)&__m128i_result[0]) = 0xffffff00ffffff00; + __m128i_out = __lsx_vsllwil_w_h (__m128i_op0, 0x8); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xf10cf508f904fd01; + *((unsigned long *)&__m128i_op0[0]) = 0xf10cf508f904fd01; + *((unsigned long *)&__m128i_result[1]) = 0xffffe218ffffea10; + *((unsigned long *)&__m128i_result[0]) = 0xfffff208fffffa02; + __m128i_out = __lsx_vsllwil_w_h (__m128i_op0, 0x1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x21201f1e1d001b1a; + *((unsigned long *)&__m128i_op0[0]) = 0x1918171615141312; + *((unsigned long *)&__m128i_result[1]) = 0x0001918000017160; + *((unsigned long *)&__m128i_result[0]) = 0x0001514000013120; + __m128i_out = __lsx_vsllwil_w_h (__m128i_op0, 0x4); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfffff60ca7104649; + *((unsigned long *)&__m128i_op0[0]) = 0xfffff790a15db63d; + *((unsigned long *)&__m128i_result[1]) = 0xfffffc00ffde4000; + *((unsigned long *)&__m128i_result[0]) = 0xfe857400fed8f400; + __m128i_out = __lsx_vsllwil_w_h (__m128i_op0, 0xa); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x1c6c80007fffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0038d800ff000000; + *((unsigned long *)&__m128i_result[0]) = 0x00fffe00fffffe00; + __m128i_out = __lsx_vsllwil_w_h (__m128i_op0, 0x9); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x7fc000007fc00000; + *((unsigned long *)&__m128i_op0[0]) = 0x7fc000007fc00000; + *((unsigned long *)&__m128i_result[1]) = 0x00ff800000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00ff800000000000; + __m128i_out = __lsx_vsllwil_w_h (__m128i_op0, 0x9); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vsllwil_w_h (__m128i_op0, 0x0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0001fffe00000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000007fff800000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsllwil_d_w (__m128i_op0, 0x16); + 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_vsllwil_d_w (__m128i_op0, 0x1a); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffff80ff0000ffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffff80000000ffff; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffff0000; + *((unsigned long *)&__m128i_result[0]) = 0x000000000001fffe; + __m128i_out = __lsx_vsllwil_d_w (__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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsllwil_d_w (__m128i_op0, 0x1f); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0001000100010001; + *((unsigned long *)&__m128i_op0[0]) = 0x0001000104000800; + *((unsigned long *)&__m128i_result[1]) = 0x0000040004000000; + *((unsigned long *)&__m128i_result[0]) = 0x0010002000000000; + __m128i_out = __lsx_vsllwil_d_w (__m128i_op0, 0x1a); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000000000000007b; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsllwil_d_w (__m128i_op0, 0x1e); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000100000001; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000100000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000020; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsllwil_d_w (__m128i_op0, 0x5); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x000000017fffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000800000; + *((unsigned long *)&__m128i_result[0]) = 0x003fffffff800000; + __m128i_out = __lsx_vsllwil_d_w (__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_vsllwil_d_w (__m128i_op0, 0x11); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x57f160c4a1750eda; + *((unsigned long *)&__m128i_result[1]) = 0x000002bf8b062000; + *((unsigned long *)&__m128i_result[0]) = 0xfffffd0ba876d000; + __m128i_out = __lsx_vsllwil_d_w (__m128i_op0, 0xb); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsllwil-2.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsllwil-2.c new file mode 100644 index 00000000000..5f46293dcd9 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsllwil-2.c @@ -0,0 +1,189 @@ +/* { 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]) = 0x00000000007f7f02; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00003f803f800100; + __m128i_out = __lsx_vsllwil_hu_bu (__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_vsllwil_hu_bu (__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_vsllwil_hu_bu (__m128i_op0, 0x5); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0014000100000000; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x7f807f807f807f80; + __m128i_out = __lsx_vsllwil_hu_bu (__m128i_op0, 0x7); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000001030103; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0020006000200060; + __m128i_out = __lsx_vsllwil_hu_bu (__m128i_op0, 0x5); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0808080808080805; + *((unsigned long *)&__m128i_op0[0]) = 0x0808080808080805; + *((unsigned long *)&__m128i_result[1]) = 0x0020002000200020; + *((unsigned long *)&__m128i_result[0]) = 0x0020002000200014; + __m128i_out = __lsx_vsllwil_hu_bu (__m128i_op0, 0x2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000ffff0000ffff; + *((unsigned long *)&__m128i_op0[0]) = 0x0001fffe0001fffe; + *((unsigned long *)&__m128i_result[1]) = 0x0000000201fe01fc; + *((unsigned long *)&__m128i_result[0]) = 0x0000000201fe01fc; + __m128i_out = __lsx_vsllwil_hu_bu (__m128i_op0, 0x1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xff1affff01001fe0; + *((unsigned long *)&__m128i_op0[0]) = 0xff1aff6d02834d70; + *((unsigned long *)&__m128i_result[1]) = 0x7f800d007f803680; + *((unsigned long *)&__m128i_result[0]) = 0x0100418026803800; + __m128i_out = __lsx_vsllwil_hu_bu (__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_vsllwil_wu_hu (__m128i_op0, 0x4); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x3e2b34ca59fa4c88; + *((unsigned long *)&__m128i_op0[0]) = 0x3b2c8aefd44be966; + *((unsigned long *)&__m128i_result[1]) = 0x0007658000115de0; + *((unsigned long *)&__m128i_result[0]) = 0x001a8960001d2cc0; + __m128i_out = __lsx_vsllwil_wu_hu (__m128i_op0, 0x5); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xffffff000000ff00; + *((unsigned long *)&__m128i_result[1]) = 0x0000ffff0000ff00; + *((unsigned long *)&__m128i_result[0]) = 0x000000000000ff00; + __m128i_out = __lsx_vsllwil_wu_hu (__m128i_op0, 0x0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000040600000406; + *((unsigned long *)&__m128i_op0[0]) = 0x020202020202fe02; + *((unsigned long *)&__m128i_result[1]) = 0x0020200000202000; + *((unsigned long *)&__m128i_result[0]) = 0x002020000fe02000; + __m128i_out = __lsx_vsllwil_wu_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_vsllwil_wu_hu (__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_vsllwil_wu_hu (__m128i_op0, 0x4); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000000001ffffffe; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000001; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000002; + __m128i_out = __lsx_vsllwil_wu_hu (__m128i_op0, 0x1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x3131313131313131; + *((unsigned long *)&__m128i_result[1]) = 0x0313100003131000; + *((unsigned long *)&__m128i_result[0]) = 0x0313100003131000; + __m128i_out = __lsx_vsllwil_wu_hu (__m128i_op0, 0xc); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000900000009; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000900000009; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000090; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000090; + __m128i_out = __lsx_vsllwil_wu_hu (__m128i_op0, 0x4); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000200000002; + *((unsigned long *)&__m128i_op0[0]) = 0x000000020000007d; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000800000; + *((unsigned long *)&__m128i_result[0]) = 0x000000001f400000; + __m128i_out = __lsx_vsllwil_du_wu (__m128i_op0, 0x16); + 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]) = 0x0000000000280000; + __m128i_out = __lsx_vsllwil_du_wu (__m128i_op0, 0x13); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x000fef01000e27ca; + *((unsigned long *)&__m128i_result[1]) = 0x0000001fde020000; + *((unsigned long *)&__m128i_result[0]) = 0x0000001c4f940000; + __m128i_out = __lsx_vsllwil_du_wu (__m128i_op0, 0x11); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x000000ffffffff00; + *((unsigned long *)&__m128i_result[0]) = 0x000000ffffffff00; + __m128i_out = __lsx_vsllwil_du_wu (__m128i_op0, 0x8); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x7fff010181010102; + *((unsigned long *)&__m128i_op0[0]) = 0x7fffffff81010102; + *((unsigned long *)&__m128i_result[1]) = 0x00000fffffffe000; + *((unsigned long *)&__m128i_result[0]) = 0x0000102020204000; + __m128i_out = __lsx_vsllwil_du_wu (__m128i_op0, 0xd); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000800000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000800000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000008000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsllwil_du_wu (__m128i_op0, 0x0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + int_out = __lsx_vpickve2gr_w (__m128i_op0, 0x0); + *((unsigned long *)&__m128i_op0[1]) = 0x8d78336c83652b86; + *((unsigned long *)&__m128i_op0[0]) = 0x39c51f389c0d6112; + *((unsigned long *)&__m128i_result[1]) = 0x00000001ce28f9c0; + *((unsigned long *)&__m128i_result[0]) = 0x00000004e06b0890; + __m128i_out = __lsx_vsllwil_du_wu (__m128i_op0, 0x3); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsrl.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsrl.c new file mode 100644 index 00000000000..f9c7898557f --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsrl.c @@ -0,0 +1,389 @@ +/* { 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]) = 0xffffffefffffffef; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffefffffffef; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffefffffffef; + *((unsigned long *)&__m128i_result[0]) = 0xffffffefffffffef; + __m128i_out = __lsx_vsrl_b (__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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0101010100000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrl_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000005555555554; + *((unsigned long *)&__m128i_op0[0]) = 0x0000005555555554; + *((unsigned long *)&__m128i_op1[1]) = 0x00000001000f000e; + *((unsigned long *)&__m128i_op1[0]) = 0x0000fff1000ffffe; + *((unsigned long *)&__m128i_result[1]) = 0x0000002a55005501; + *((unsigned long *)&__m128i_result[0]) = 0x0000002a55000001; + __m128i_out = __lsx_vsrl_b (__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]) = 0x7f800000fff8fff8; + *((unsigned long *)&__m128i_op1[0]) = 0x7f800000fff80000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000080; + *((unsigned long *)&__m128i_result[0]) = 0x80000000fff80000; + __m128i_out = __lsx_vsrl_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0004000000040000; + *((unsigned long *)&__m128i_op0[0]) = 0x0004000000040000; + *((unsigned long *)&__m128i_op1[1]) = 0xfff6fff6fff6fff6; + *((unsigned long *)&__m128i_op1[0]) = 0xfff6fff6fff6fff6; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrl_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]) = 0x0000750500006541; + *((unsigned long *)&__m128i_op1[0]) = 0x00000100fffffefd; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrl_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x7f8000007f800000; + *((unsigned long *)&__m128i_op0[0]) = 0x7f8000007f800000; + *((unsigned long *)&__m128i_op1[1]) = 0x00f900d7003d00e4; + *((unsigned long *)&__m128i_op1[0]) = 0x003e00d100de002b; + *((unsigned long *)&__m128i_result[1]) = 0x7f4000007f040000; + *((unsigned long *)&__m128i_result[0]) = 0x7f0200007f020000; + __m128i_out = __lsx_vsrl_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffff00; + *((unsigned long *)&__m128i_op0[0]) = 0xfffffffe000000f6; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_result[1]) = 0x01010101ffffff00; + *((unsigned long *)&__m128i_result[0]) = 0x01010101000000f6; + __m128i_out = __lsx_vsrl_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]) = 0x8000000080000000; + *((unsigned long *)&__m128i_op1[0]) = 0x8000000080000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrl_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00ffffff00ff00ff; + *((unsigned long *)&__m128i_op0[0]) = 0x00ff00ffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x00000049000000c0; + *((unsigned long *)&__m128i_op1[0]) = 0x00000001ffffff29; + *((unsigned long *)&__m128i_result[1]) = 0x00ffff7f00ff00ff; + *((unsigned long *)&__m128i_result[0]) = 0x00ff007f0101017f; + __m128i_out = __lsx_vsrl_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffff2900000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000100000001; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000401000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffff2900000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000100000001; + __m128i_out = __lsx_vsrl_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_vsrl_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000001fffffffe; + *((unsigned long *)&__m128i_op0[0]) = 0x00000001fffffffe; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0xc2f9bafac2fac2fa; + *((unsigned long *)&__m128i_result[1]) = 0x00000001fffffffe; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrl_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0101080408040804; + *((unsigned long *)&__m128i_op0[0]) = 0x0804080407040804; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000010a000b; + *((unsigned long *)&__m128i_result[1]) = 0x0101080408040804; + *((unsigned long *)&__m128i_result[0]) = 0x000100810080e081; + __m128i_out = __lsx_vsrl_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]) = 0x4688500046f6a000; + *((unsigned long *)&__m128i_op1[0]) = 0x4f8000004f7fff02; + *((unsigned long *)&__m128i_result[1]) = 0x00ffffff03ffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffff00013fff; + __m128i_out = __lsx_vsrl_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xfffffffffffffffe; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xfffffffffffffffe; + __m128i_out = __lsx_vsrl_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000021ffffffdf; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000100000e60; + *((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_vsrl_d (__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]) = 0x0002000200020002; + *((unsigned long *)&__m128i_op1[0]) = 0x0202fe02fd020102; + *((unsigned long *)&__m128i_result[1]) = 0x0400040004000400; + *((unsigned long *)&__m128i_result[0]) = 0x0400040004000400; + __m128i_out = __lsx_vsrl_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0101fe870101fe87; + *((unsigned long *)&__m128i_op0[0]) = 0x0101fe8700000000; + *((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_vsrl_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_vsrl_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]) = 0x7ff0000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x61608654a2d4f6da; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrl_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000000000000fb01; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000007000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0006000000040000; + *((unsigned long *)&__m128i_op1[0]) = 0x0002000000000007; + *((unsigned long *)&__m128i_result[1]) = 0x000000000000fb01; + *((unsigned long *)&__m128i_result[0]) = 0x00000000000e0000; + __m128i_out = __lsx_vsrl_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000ff0000ff0000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000ff0000ff0000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000ff0000000000; + __m128i_out = __lsx_vsrl_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00ff000100ff00fe; + *((unsigned long *)&__m128i_op0[0]) = 0x00ff003000ff00a0; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x00ff000100ff00fe; + *((unsigned long *)&__m128i_result[0]) = 0x00ff003000ff00a0; + __m128i_out = __lsx_vsrl_w (__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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000100010100; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrl_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000080000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000080000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000080000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000080000000; + __m128i_out = __lsx_vsrl_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffe0000000; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffe0000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffe0000000; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffe0000000; + __m128i_out = __lsx_vsrl_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000ff00ff; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000ff00ff; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000ff00ff; + __m128i_out = __lsx_vsrl_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfffffffefffffffe; + *((unsigned long *)&__m128i_op0[0]) = 0xfffffffe7fffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x000000000001fd02; + *((unsigned long *)&__m128i_result[1]) = 0xfffffffefffffffe; + *((unsigned long *)&__m128i_result[0]) = 0xfffffffe1fffffff; + __m128i_out = __lsx_vsrl_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]) = 0x0000000900000009; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xffffff7fffffff7f; + __m128i_out = __lsx_vsrl_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_vsrl_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_vsrl_d (__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]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrl_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffff800fff01; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x000000007ff000ff; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrl_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_vsrl_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_vsrl_b (__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_vsrl_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_vsrl_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x4399d3221a29d3f2; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x000056f64adb9464; + *((unsigned long *)&__m128i_op1[0]) = 0x29ca096f235819c2; + *((unsigned long *)&__m128i_result[1]) = 0x0000000004399d32; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrl_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000ffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0x0000ffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000ffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000ffffffffffff; + __m128i_out = __lsx_vsrl_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]) = 0x0002000200020002; + *((unsigned long *)&__m128i_op1[0]) = 0x0002000200020002; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrl_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-vsrli.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsrli.c new file mode 100644 index 00000000000..7b5e9a7bfb6 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsrli.c @@ -0,0 +1,328 @@ +/* { 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]) = 0x0001ffff0001ffff; + *((unsigned long *)&__m128i_result[0]) = 0x0001ffff0001ffff; + __m128i_out = __lsx_vsrli_w (__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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrli_h (__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_vsrli_w (__m128i_op0, 0xa); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000020000000002; + *((unsigned long *)&__m128i_op0[0]) = 0x0000010000000100; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000100000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000080000; + __m128i_out = __lsx_vsrli_d (__m128i_op0, 0x15); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000017fda829; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00000000017f0a82; + __m128i_out = __lsx_vsrli_h (__m128i_op0, 0x4); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000001; + *((unsigned long *)&__m128i_result[1]) = 0x03ff03ff03ff03ff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrli_h (__m128i_op0, 0x6); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000400000004000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000400000204010; + *((unsigned long *)&__m128i_result[1]) = 0x0000020000000200; + *((unsigned long *)&__m128i_result[0]) = 0x0000020000010200; + __m128i_out = __lsx_vsrli_b (__m128i_op0, 0x5); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000006; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrli_h (__m128i_op0, 0xa); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000001fffffffe; + *((unsigned long *)&__m128i_op0[0]) = 0x00000001fffffffe; + *((unsigned long *)&__m128i_result[1]) = 0x000000003fffffff; + *((unsigned long *)&__m128i_result[0]) = 0x000000003fffffff; + __m128i_out = __lsx_vsrli_w (__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_vsrli_w (__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_vsrli_d (__m128i_op0, 0x37); + 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_vsrli_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_vsrli_h (__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_vsrli_w (__m128i_op0, 0x1d); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000000000000007b; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrli_d (__m128i_op0, 0x1e); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0020002000200020; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0020002000200020; + __m128i_out = __lsx_vsrli_w (__m128i_op0, 0x0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffefffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffefffff; + *((unsigned long *)&__m128i_result[1]) = 0x0007000700070007; + *((unsigned long *)&__m128i_result[0]) = 0x0007000700070007; + __m128i_out = __lsx_vsrli_h (__m128i_op0, 0xd); + 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]) = 0x000c000c000c000c; + __m128i_out = __lsx_vsrli_h (__m128i_op0, 0xb); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000000003d0000; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000003d0000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000030000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000030000; + __m128i_out = __lsx_vsrli_b (__m128i_op0, 0x4); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000010000; + *((unsigned long *)&__m128i_op0[0]) = 0x00ff00ff00fe00ff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrli_h (__m128i_op0, 0x9); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000001000000010; + *((unsigned long *)&__m128i_op0[0]) = 0x0000001000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000100000001; + *((unsigned long *)&__m128i_result[0]) = 0x0000000100000000; + __m128i_out = __lsx_vsrli_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_vsrli_d (__m128i_op0, 0x3d); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000200000002; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000200000002; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrli_h (__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_vsrli_h (__m128i_op0, 0xd); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0001000100010001; + *((unsigned long *)&__m128i_op0[0]) = 0x0001000100010001; + *((unsigned long *)&__m128i_result[1]) = 0x0000000001000100; + *((unsigned long *)&__m128i_result[0]) = 0x0000000001000100; + __m128i_out = __lsx_vsrli_d (__m128i_op0, 0x18); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0001000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000400000000; + __m128i_out = __lsx_vsrli_w (__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_vsrli_d (__m128i_op0, 0x3a); + 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_vsrli_b (__m128i_op0, 0x5); + 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]) = 0x7fffffff7fffffff; + __m128i_out = __lsx_vsrli_w (__m128i_op0, 0x1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xaa14efac3bb62636; + *((unsigned long *)&__m128i_op0[0]) = 0xd6c22c8353a80d2c; + *((unsigned long *)&__m128i_result[1]) = 0x0002000300000000; + *((unsigned long *)&__m128i_result[0]) = 0x0003000000010000; + __m128i_out = __lsx_vsrli_h (__m128i_op0, 0xe); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x3fff3fff3fff3fff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrli_h (__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_vsrli_b (__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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrli_w (__m128i_op0, 0x5); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0080000700000014; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000fffbffda; + *((unsigned long *)&__m128i_result[1]) = 0x0001000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000001010101; + __m128i_out = __lsx_vsrli_b (__m128i_op0, 0x7); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfffefffefffefffe; + *((unsigned long *)&__m128i_op0[0]) = 0xfffefffefffefffe; + *((unsigned long *)&__m128i_result[1]) = 0x000001fffdfffdff; + *((unsigned long *)&__m128i_result[0]) = 0x000001fffdfffdff; + __m128i_out = __lsx_vsrli_d (__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_vsrli_b (__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_vsrli_w (__m128i_op0, 0xc); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xd3259a2984048c23; + *((unsigned long *)&__m128i_op0[0]) = 0xf9796558e39953fd; + *((unsigned long *)&__m128i_result[1]) = 0x001a64b345308091; + *((unsigned long *)&__m128i_result[0]) = 0x001f2f2cab1c732a; + __m128i_out = __lsx_vsrli_d (__m128i_op0, 0xb); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000290; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000290; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000002; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000002; + __m128i_out = __lsx_vsrli_b (__m128i_op0, 0x6); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x00020000ffff0001; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000003030000; + __m128i_out = __lsx_vsrli_b (__m128i_op0, 0x6); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000002345454; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000c0dec4ca; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000002; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000060006; + __m128i_out = __lsx_vsrli_h (__m128i_op0, 0xd); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000000200000000d; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000200000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000200000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrli_b (__m128i_op0, 0x4); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000000000eefff; + *((unsigned long *)&__m128i_op0[0]) = 0xf8e1a03affffe3e2; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000003e0000003f; + __m128i_out = __lsx_vsrli_w (__m128i_op0, 0x1a); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0fffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrli_d (__m128i_op0, 0x4); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsrln.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsrln.c new file mode 100644 index 00000000000..5a8f4f70aba --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsrln.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]) = 0x0000c77c000047cd; + *((unsigned long *)&__m128i_op1[0]) = 0x0000c0f100006549; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrln_w_d (__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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrln_w_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]) = 0xffffe000ffffe000; + *((unsigned long *)&__m128i_op1[0]) = 0xffffe000ffffe000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vsrln_w_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffdfff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffdfff; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffe00001ffe200; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00000001ffffdfff; + __m128i_out = __lsx_vsrln_w_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffff35cab978; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffff35cab978; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000010035; + __m128i_out = __lsx_vsrln_h_w (__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]) = 0x0000000000000020; + __m128i_out = __lsx_vsrln_w_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_vsrln_w_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]) = 0x8000000080000000; + *((unsigned long *)&__m128i_op1[0]) = 0x8000000080000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrln_h_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]) = 0x80307028ffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0x8040007fffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xffff0101ff010101; + __m128i_out = __lsx_vsrln_b_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_vsrln_w_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]) = 0x0000000000000003; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000003; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrln_w_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]) = 0x0000000001000100; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000001000100; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vsrln_w_d (__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]) = 0x0000000100000001; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000100000001; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x4180418041804180; + __m128i_out = __lsx_vsrln_b_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_vsrln_w_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]) = 0x4f804f804f804f80; + *((unsigned long *)&__m128i_op1[0]) = 0x4f804f804f804f80; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrln_w_d (__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]) = 0x001ffff0003ffff0; + *((unsigned long *)&__m128i_op1[0]) = 0x000fffefffefffef; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00ff00ff00000000; + __m128i_out = __lsx_vsrln_b_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]) = 0xffffffffffffffff; + __m128i_out = __lsx_vsrln_w_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_vsrln_w_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00008bf700017052; + *((unsigned long *)&__m128i_op0[0]) = 0x0000f841000091aa; + *((unsigned long *)&__m128i_op1[1]) = 0xe6d4572c8a5835bc; + *((unsigned long *)&__m128i_op1[0]) = 0xe5017c2ac9ca9fd0; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00000000f8410000; + __m128i_out = __lsx_vsrln_w_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffff0000ffff; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000001010001; + __m128i_out = __lsx_vsrln_b_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000100000001000; + *((unsigned long *)&__m128i_op0[0]) = 0x0ed5ced7e51023e5; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000010000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00001000e51023e5; + __m128i_out = __lsx_vsrln_w_d (__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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000010001; + __m128i_out = __lsx_vsrln_h_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]) = 0x0000000000020002; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000020002; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrln_b_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]) = 0xffffffffffffffff; + __m128i_out = __lsx_vsrln_b_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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrln_h_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_vsrln_b_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000004; + *((unsigned long *)&__m128i_op1[1]) = 0x000000017ffeffff; + *((unsigned long *)&__m128i_op1[0]) = 0x000000017ffeffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrln_h_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_vsrln_h_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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrln_w_d (__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]) = 0xfefeff00fefeff00; + *((unsigned long *)&__m128i_op1[0]) = 0xfefeff00fefeff00; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00c0000000800000; + __m128i_out = __lsx_vsrln_b_h (__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]) = 0x0000000071768fa4; + __m128i_out = __lsx_vsrln_w_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_vsrln_h_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000ffdfdc0d; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x3ff0000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00000000ffdfdc0d; + __m128i_out = __lsx_vsrln_w_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]) = 0x00000000246d9755; + *((unsigned long *)&__m128i_op1[0]) = 0x000000002427c2ee; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrln_h_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_vsrln_b_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-vsrlni.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsrlni.c new file mode 100644 index 00000000000..ca462c83411 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsrlni.c @@ -0,0 +1,281 @@ +/* { 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]) = 0x7fc000007fc00000; + *((unsigned long *)&__m128i_op1[0]) = 0x1e801ffc7fc00000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00003fe00ffe3fe0; + __m128i_out = __lsx_vsrlni_w_d (__m128i_op0, __m128i_op1, 0x11); + 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]) = 0x00ff00ff00000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrlni_b_h (__m128i_op0, __m128i_op1, 0x0); + 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]) = 0x000000000000001f; + __m128i_out = __lsx_vsrlni_d_q (__m128i_op0, __m128i_op1, 0x7b); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000008; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000008; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrlni_w_d (__m128i_op0, __m128i_op1, 0xa); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xc39fffff007fffff; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000fe00fd; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x78c00000ff000000; + *((unsigned long *)&__m128i_result[1]) = 0x61cf003f0000007f; + *((unsigned long *)&__m128i_result[0]) = 0x000000003c607f80; + __m128i_out = __lsx_vsrlni_h_w (__m128i_op0, __m128i_op1, 0x11); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffff7f01ff01; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffff7f01ff01; + *((unsigned long *)&__m128i_result[1]) = 0xfffffffffffffe03; + *((unsigned long *)&__m128i_result[0]) = 0xfffffffffffffe03; + __m128i_out = __lsx_vsrlni_h_w (__m128i_op0, __m128i_op1, 0xf); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffff8001ffff8001; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x7fff7fff7fff7fff; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x001ffff0003ffff0; + *((unsigned long *)&__m128i_result[0]) = 0x000fffefffefffef; + __m128i_out = __lsx_vsrlni_d_q (__m128i_op0, __m128i_op1, 0x4b); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x6363797c63990099; + *((unsigned long *)&__m128i_op0[0]) = 0x171f0a1f6376441f; + *((unsigned long *)&__m128i_op1[1]) = 0x6363797c63990099; + *((unsigned long *)&__m128i_op1[0]) = 0x171f0a1f6376441f; + *((unsigned long *)&__m128i_result[1]) = 0x181e180005021811; + *((unsigned long *)&__m128i_result[0]) = 0x181e180005021811; + __m128i_out = __lsx_vsrlni_b_h (__m128i_op0, __m128i_op1, 0xa); + 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]) = 0x0000ffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00003fff00003fff; + __m128i_out = __lsx_vsrlni_h_w (__m128i_op0, __m128i_op1, 0x12); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xf0fd800080000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000a00028004000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x000f000800000002; + *((unsigned long *)&__m128i_result[0]) = 0x000f000000000000; + __m128i_out = __lsx_vsrlni_h_w (__m128i_op0, __m128i_op1, 0x1c); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrlni_w_d (__m128i_op0, __m128i_op1, 0x7); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xaeaeaeaeaeaeae35; + *((unsigned long *)&__m128i_op0[0]) = 0xaeaeaeaeaeaeae35; + *((unsigned long *)&__m128i_op1[1]) = 0xaeaeaeaeaeaeae35; + *((unsigned long *)&__m128i_op1[0]) = 0xaeaeaeaeaeaeae35; + *((unsigned long *)&__m128i_result[1]) = 0x0000000200000002; + *((unsigned long *)&__m128i_result[0]) = 0x0000000200000002; + __m128i_out = __lsx_vsrlni_w_d (__m128i_op0, __m128i_op1, 0x3e); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrlni_h_w (__m128i_op0, __m128i_op1, 0x1a); + 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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00ff00ff00000000; + __m128i_out = __lsx_vsrlni_b_h (__m128i_op0, __m128i_op1, 0x0); + 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]) = 0x0000000008140c80; + *((unsigned long *)&__m128i_result[1]) = 0x0000000002050320; + *((unsigned long *)&__m128i_result[0]) = 0x0000000002050320; + __m128i_out = __lsx_vsrlni_w_d (__m128i_op0, __m128i_op1, 0x2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000002050320; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000002050320; + *((unsigned long *)&__m128i_op1[1]) = 0x0101010101010101; + *((unsigned long *)&__m128i_op1[0]) = 0x010101017f010101; + *((unsigned long *)&__m128i_result[1]) = 0x0000040600000406; + *((unsigned long *)&__m128i_result[0]) = 0x020202020202fe02; + __m128i_out = __lsx_vsrlni_b_h (__m128i_op0, __m128i_op1, 0x7); + 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]) = 0xe364525335ede000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00000fff00000e36; + __m128i_out = __lsx_vsrlni_w_d (__m128i_op0, __m128i_op1, 0x34); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0x601fbfbeffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xfffb00fdfdf7ffff; + *((unsigned long *)&__m128i_result[0]) = 0xfff8000000000000; + __m128i_out = __lsx_vsrlni_d_q (__m128i_op0, __m128i_op1, 0xd); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrlni_h_w (__m128i_op0, __m128i_op1, 0x16); + 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_vsrlni_h_w (__m128i_op0, __m128i_op1, 0xc); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000455555555; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000008; + __m128i_out = __lsx_vsrlni_d_q (__m128i_op0, __m128i_op1, 0x1f); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrlni_w_d (__m128i_op0, __m128i_op1, 0x1f); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x7c7c000000007176; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000f3040705; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000001f1f; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrlni_d_q (__m128i_op0, __m128i_op1, 0x32); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000001; + *((unsigned long *)&__m128i_op1[1]) = 0x00000000000bffff; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000040001; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrlni_d_q (__m128i_op0, __m128i_op1, 0x6d); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xe4c8b96e2560afe9; + *((unsigned long *)&__m128i_op0[0]) = 0xc001a1867fffa207; + *((unsigned long *)&__m128i_op1[1]) = 0xe4c8b96e2560afe9; + *((unsigned long *)&__m128i_op1[0]) = 0xc001a1867fffa207; + *((unsigned long *)&__m128i_result[1]) = 0xe2560afe9c001a18; + *((unsigned long *)&__m128i_result[0]) = 0xe2560afe9c001a18; + __m128i_out = __lsx_vsrlni_d_q (__m128i_op0, __m128i_op1, 0x24); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000000000042ab41; + *((unsigned long *)&__m128i_op0[0]) = 0xb1b1b1b1b16f0670; + *((unsigned long *)&__m128i_op1[1]) = 0x00000000084d12ce; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000044470000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000202020200; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000100; + __m128i_out = __lsx_vsrlni_b_h (__m128i_op0, __m128i_op1, 0xe); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x020310edc003023d; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x000000080c43b700; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrlni_d_q (__m128i_op0, __m128i_op1, 0x56); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x30eb022002101b20; + *((unsigned long *)&__m128i_op0[0]) = 0x020310edc003023d; + *((unsigned long *)&__m128i_op1[1]) = 0x30eb022002101b20; + *((unsigned long *)&__m128i_op1[0]) = 0x020310edc003023d; + *((unsigned long *)&__m128i_result[1]) = 0x022002101b200203; + *((unsigned long *)&__m128i_result[0]) = 0x022002101b200203; + __m128i_out = __lsx_vsrlni_d_q (__m128i_op0, __m128i_op1, 0x30); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrlni_b_h (__m128i_op0, __m128i_op1, 0x6); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsrlr.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsrlr.c new file mode 100644 index 00000000000..211339bb86a --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsrlr.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]) = 0x0000000000000002; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrlr_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]) = 0x43e092728266beba; + *((unsigned long *)&__m128i_op1[0]) = 0x43d8969cc4afbf2d; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrlr_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_vsrlr_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_vsrlr_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_vsrlr_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x7f8000007f800000; + *((unsigned long *)&__m128i_op0[0]) = 0x7f8000007f800000; + *((unsigned long *)&__m128i_op1[1]) = 0x7fffffff7fffffff; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000100000001; + *((unsigned long *)&__m128i_result[0]) = 0x7f8000007f800000; + __m128i_out = __lsx_vsrlr_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_vsrlr_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]) = 0x0000000000000001; + *((unsigned long *)&__m128i_op1[0]) = 0xfffc001fffffffff; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffff8000; + *((unsigned long *)&__m128i_result[0]) = 0x0010000200020002; + __m128i_out = __lsx_vsrlr_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_vsrlr_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_vsrlr_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_vsrlr_b (__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]) = 0xfffffff0ffe04000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000200010; + __m128i_out = __lsx_vsrlr_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]) = 0x0001000100010001; + *((unsigned long *)&__m128i_op1[0]) = 0x0001000101fd01fe; + *((unsigned long *)&__m128i_result[1]) = 0xff80ff80ff80ff80; + *((unsigned long *)&__m128i_result[0]) = 0xff80ff8080008000; + __m128i_out = __lsx_vsrlr_b (__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]) = 0xfffffffff51cf8da; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffd6040188; + *((unsigned long *)&__m128i_result[1]) = 0x00020002000d0000; + *((unsigned long *)&__m128i_result[0]) = 0x000000020f2300ee; + __m128i_out = __lsx_vsrlr_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00007f8000007f80; + *((unsigned long *)&__m128i_op0[0]) = 0x00007f8000007f80; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffe5; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffe5; + *((unsigned long *)&__m128i_result[1]) = 0x00000000000003fc; + *((unsigned long *)&__m128i_result[0]) = 0x00000000000003fc; + __m128i_out = __lsx_vsrlr_d (__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]) = 0x0000000000000006; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000100000000; + __m128i_out = __lsx_vsrlr_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]) = 0x000a000a000a000a; + *((unsigned long *)&__m128i_op1[0]) = 0x000a000a000a000a; + *((unsigned long *)&__m128i_result[1]) = 0x0040000000400000; + *((unsigned long *)&__m128i_result[0]) = 0x0040000000400000; + __m128i_out = __lsx_vsrlr_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0020808100000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x7fffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000001; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrlr_d (__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]) = 0xffffe218ffffea10; + *((unsigned long *)&__m128i_result[0]) = 0xfffff208fffffa02; + __m128i_out = __lsx_vsrlr_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_vsrlr_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_vsrlr_h (__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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x000000000000f00f; + *((unsigned long *)&__m128i_result[1]) = 0x111110ff11111141; + *((unsigned long *)&__m128i_result[0]) = 0x1111113111111100; + __m128i_out = __lsx_vsrlr_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]) = 0x1f54e0ab00000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrlr_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_vsrlr_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffff0000; + *((unsigned long *)&__m128i_op1[1]) = 0x000000003fbf3fbf; + *((unsigned long *)&__m128i_op1[0]) = 0x7fff7fff7fff7ff8; + *((unsigned long *)&__m128i_result[1]) = 0xffffffff00000002; + *((unsigned long *)&__m128i_result[0]) = 0x0000000200000100; + __m128i_out = __lsx_vsrlr_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x370bdfecffecffec; + *((unsigned long *)&__m128i_op0[0]) = 0x370bdfeca2eb9931; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0x00d3007c014e00bd; + *((unsigned long *)&__m128i_result[1]) = 0x0000000200020002; + *((unsigned long *)&__m128i_result[0]) = 0x06e1000e00030005; + __m128i_out = __lsx_vsrlr_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0202020202020202; + *((unsigned long *)&__m128i_op0[0]) = 0x363d753d50155c0a; + *((unsigned long *)&__m128i_op1[1]) = 0xe500c085c000c005; + *((unsigned long *)&__m128i_op1[0]) = 0xe5c1a185c48004c5; + *((unsigned long *)&__m128i_result[1]) = 0x0002020002020200; + *((unsigned long *)&__m128i_result[0]) = 0x021f3b0205150600; + __m128i_out = __lsx_vsrlr_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffe000ffdf; + *((unsigned long *)&__m128i_op1[1]) = 0x0000200000002000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffe000ffdf; + __m128i_out = __lsx_vsrlr_d (__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]) = 0xffe080f6efc100f7; + *((unsigned long *)&__m128i_op1[0]) = 0xefd32176ffe100f7; + *((unsigned long *)&__m128i_result[1]) = 0x0000040000000200; + *((unsigned long *)&__m128i_result[0]) = 0x0000040000000000; + __m128i_out = __lsx_vsrlr_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_vsrlr_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]) = 0x00000001fffdfe01; + *((unsigned long *)&__m128i_op1[0]) = 0xfffdfe0200000002; + *((unsigned long *)&__m128i_result[1]) = 0x8000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x4000000000000000; + __m128i_out = __lsx_vsrlr_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xd70b30c96ea9f4e8; + *((unsigned long *)&__m128i_op0[0]) = 0xa352bfac9269e0aa; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xd70b30c96ea9f4e8; + *((unsigned long *)&__m128i_result[0]) = 0xa352bfac9269e0aa; + __m128i_out = __lsx_vsrlr_w (__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_vsrlr_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]) = 0x0000000000000158; + __m128i_out = __lsx_vsrlr_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_vsrlr_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_vsrlr_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_vsrlr_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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00009c7c00007176; + __m128i_out = __lsx_vsrlr_b (__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]) = 0x9c9c9c9c9c9c9c9c; + *((unsigned long *)&__m128i_op1[0]) = 0x9c9c9c9c9c9c9c9c; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000010; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000010; + __m128i_out = __lsx_vsrlr_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_vsrlr_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x4399d3221a29d3f2; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x4399d3221a29d3f2; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x084d1a0907151a3d; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrlr_b (__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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0xfff9fffefff9ffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0280000000000000; + __m128i_out = __lsx_vsrlr_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0700f8ff0700f8ff; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0700f8ff0700f8ff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrlr_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]) = 0x0000f50000000900; + *((unsigned long *)&__m128i_op1[0]) = 0x0000090a00000998; + *((unsigned long *)&__m128i_result[1]) = 0x3a8000003a800000; + *((unsigned long *)&__m128i_result[0]) = 0x000ef0000000003b; + __m128i_out = __lsx_vsrlr_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0005847b00011005; + *((unsigned long *)&__m128i_op0[0]) = 0x0005847b00000000; + *((unsigned long *)&__m128i_op1[1]) = 0x00000807bf0a1f80; + *((unsigned long *)&__m128i_op1[0]) = 0x00000800ecedee68; + *((unsigned long *)&__m128i_result[1]) = 0x0005840100000005; + *((unsigned long *)&__m128i_result[0]) = 0x0005847b00000000; + __m128i_out = __lsx_vsrlr_b (__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]) = 0x00250023001c001d; + *((unsigned long *)&__m128i_op1[0]) = 0x309d2f342a5d2b34; + *((unsigned long *)&__m128i_result[1]) = 0x00060eb000000006; + *((unsigned long *)&__m128i_result[0]) = 0x0000075c00000cf0; + __m128i_out = __lsx_vsrlr_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-vsrlri.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsrlri.c new file mode 100644 index 00000000000..2c3a5341645 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsrlri.c @@ -0,0 +1,300 @@ +/* { 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]) = 0x0000ffff00000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000800000000000; + __m128i_out = __lsx_vsrlri_w (__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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrlri_w (__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_vsrlri_w (__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_vsrlri_w (__m128i_op0, 0x1c); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x52527d7d52527d7d; + *((unsigned long *)&__m128i_op0[0]) = 0x52527d7d52527d7d; + *((unsigned long *)&__m128i_result[1]) = 0x0005252800052528; + *((unsigned long *)&__m128i_result[0]) = 0x0005252800052528; + __m128i_out = __lsx_vsrlri_w (__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_vsrlri_d (__m128i_op0, 0x3); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0200020002000200; + *((unsigned long *)&__m128i_result[0]) = 0x0200020002000200; + __m128i_out = __lsx_vsrlri_h (__m128i_op0, 0x7); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xfffc001fffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000200000; + *((unsigned long *)&__m128i_result[0]) = 0x001fff8004000000; + __m128i_out = __lsx_vsrlri_d (__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_vsrlri_w (__m128i_op0, 0x5); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0010001000030000; + *((unsigned long *)&__m128i_op0[0]) = 0x00060001fffe8003; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000200010; + __m128i_out = __lsx_vsrlri_h (__m128i_op0, 0xb); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000078c00000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000078c00000; + __m128i_out = __lsx_vsrlri_h (__m128i_op0, 0x0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x4000400000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000040004000; + __m128i_out = __lsx_vsrlri_h (__m128i_op0, 0x2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x001800390049ffaa; + *((unsigned long *)&__m128i_op0[0]) = 0x0029ff96005cff88; + *((unsigned long *)&__m128i_result[1]) = 0x001800390049ffaa; + *((unsigned long *)&__m128i_result[0]) = 0x0029ff96005cff88; + __m128i_out = __lsx_vsrlri_b (__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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrlri_h (__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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrlri_b (__m128i_op0, 0x0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00007fff00007fff; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000800000008; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrlri_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_vsrlri_d (__m128i_op0, 0x28); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x03c0000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x03c0038000000380; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrlri_h (__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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrlri_d (__m128i_op0, 0x25); + 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_vsrlri_w (__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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrlri_d (__m128i_op0, 0x28); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xa2a2a2a3a2a2a2a3; + *((unsigned long *)&__m128i_op0[0]) = 0xc605c000aedd0000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000005151515; + *((unsigned long *)&__m128i_result[0]) = 0x0000000006302e00; + __m128i_out = __lsx_vsrlri_d (__m128i_op0, 0x25); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x2000200000013fa0; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000013fa0; + *((unsigned long *)&__m128i_result[1]) = 0x0000001000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrlri_w (__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_vsrlri_b (__m128i_op0, 0x6); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffff00; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffff00; + *((unsigned long *)&__m128i_result[1]) = 0x0000000020000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000020000000; + __m128i_out = __lsx_vsrlri_d (__m128i_op0, 0x23); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x370bdfecffecffec; + *((unsigned long *)&__m128i_op0[0]) = 0x370bdfecffecffec; + *((unsigned long *)&__m128i_result[1]) = 0x00000dc300003ffb; + *((unsigned long *)&__m128i_result[0]) = 0x00000dc300003ffb; + __m128i_out = __lsx_vsrlri_w (__m128i_op0, 0x12); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x8080808000000035; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0002000200000000; + __m128i_out = __lsx_vsrlri_h (__m128i_op0, 0xe); + 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]) = 0x00018d8e00018d8e; + __m128i_out = __lsx_vsrlri_w (__m128i_op0, 0xe); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x7f801fe000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x3fc03fc000000004; + *((unsigned long *)&__m128i_result[1]) = 0x00000003fc00ff00; + *((unsigned long *)&__m128i_result[0]) = 0x00000001fe01fe00; + __m128i_out = __lsx_vsrlri_d (__m128i_op0, 0x1d); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0002000200020002; + *((unsigned long *)&__m128i_op0[0]) = 0x0002000200020002; + *((unsigned long *)&__m128i_result[1]) = 0x0002000200020002; + *((unsigned long *)&__m128i_result[0]) = 0x0002000200020002; + __m128i_out = __lsx_vsrlri_b (__m128i_op0, 0x0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x8000800080008000; + *((unsigned long *)&__m128i_result[0]) = 0x8000800080008000; + __m128i_out = __lsx_vsrlri_h (__m128i_op0, 0x1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000158; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrlri_d (__m128i_op0, 0xc); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x045340a628404044; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrlri_w (__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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrlri_w (__m128i_op0, 0x4); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x000000003ddc5dac; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000001030103; + __m128i_out = __lsx_vsrlri_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_vsrlri_h (__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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrlri_h (__m128i_op0, 0x2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x86dd8341b164f12b; + *((unsigned long *)&__m128i_op0[0]) = 0x9611c3985b3159f5; + *((unsigned long *)&__m128i_result[1]) = 0x0021b761002c593c; + *((unsigned long *)&__m128i_result[0]) = 0x002584710016cc56; + __m128i_out = __lsx_vsrlri_w (__m128i_op0, 0xa); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xc0b4d1a5f8babad3; + *((unsigned long *)&__m128i_op0[0]) = 0xbbc8ecc5f3ced5f3; + *((unsigned long *)&__m128i_result[1]) = 0xc0b4d1a5f8babad3; + *((unsigned long *)&__m128i_result[0]) = 0xbbc8ecc5f3ced5f3; + __m128i_out = __lsx_vsrlri_d (__m128i_op0, 0x0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000feff23560000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000fd1654860000; + *((unsigned long *)&__m128i_result[1]) = 0x0000080801030000; + *((unsigned long *)&__m128i_result[0]) = 0x0000080103040000; + __m128i_out = __lsx_vsrlri_b (__m128i_op0, 0x5); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsrlrn.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsrlrn.c new file mode 100644 index 00000000000..c630b426112 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsrlrn.c @@ -0,0 +1,164 @@ +/* { 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_vsrlrn_b_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_vsrlrn_h_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]) = 0x0001ffff00000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0001ffff0001ffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrlrn_b_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000100000001; + *((unsigned long *)&__m128i_op1[1]) = 0x00000000efffffff; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000001; + __m128i_out = __lsx_vsrlrn_w_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000040400000383; + *((unsigned long *)&__m128i_op0[0]) = 0xffffe000ffff1fff; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00000383ffff1fff; + __m128i_out = __lsx_vsrlrn_w_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_vsrlrn_h_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000000000003fc; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000000003fc; + *((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_vsrlrn_b_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]) = 0x7fffffff00000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrlrn_w_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]) = 0xffffffffffffff00; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffff00; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrlrn_b_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_vsrlrn_h_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x002affd600000001; + *((unsigned long *)&__m128i_op0[0]) = 0xcbc2723a4f12a5f8; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xffd60001723aa5f8; + __m128i_out = __lsx_vsrlrn_h_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffe000ffffe000; + *((unsigned long *)&__m128i_op0[0]) = 0x467f6080467d607f; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x8080808080808081; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xe000e0006080b040; + __m128i_out = __lsx_vsrlrn_h_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_vsrlrn_w_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0101010101030101; + *((unsigned long *)&__m128i_op0[0]) = 0x0101010101030101; + *((unsigned long *)&__m128i_op1[1]) = 0x00000000fffa0000; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000fffa0000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0101000101010001; + __m128i_out = __lsx_vsrlrn_b_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]) = 0x6a5d5b056f2f4978; + *((unsigned long *)&__m128i_op1[0]) = 0x17483c07141b5971; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0800010001ff8000; + __m128i_out = __lsx_vsrlrn_h_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]) = 0xff01ff01ac025c87; + *((unsigned long *)&__m128i_op1[0]) = 0xff01ff01ac465ca1; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrlrn_h_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-vsrlrni.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsrlrni.c new file mode 100644 index 00000000000..468a17c1520 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsrlrni.c @@ -0,0 +1,686 @@ +/* { 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]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0xffff8969ffffd7e2; + *((unsigned long *)&__m128i_op1[0]) = 0x0000d688ffffbd95; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xf12dfafc1ad1f7b3; + __m128i_out = __lsx_vsrlrni_h_w (__m128i_op0, __m128i_op1, 0x3); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x4000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrlrni_d_q (__m128i_op0, __m128i_op1, 0x34); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrlrni_w_d (__m128i_op0, __m128i_op1, 0x9); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000002000000020; + *((unsigned long *)&__m128i_op1[1]) = 0x0000200000002000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000200000002000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_result[0]) = 0x0000010000000100; + __m128i_out = __lsx_vsrlrni_d_q (__m128i_op0, __m128i_op1, 0x25); + 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]) = 0x0000000001000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrlrni_d_q (__m128i_op0, __m128i_op1, 0x2f); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000c0002000c0002; + *((unsigned long *)&__m128i_op0[0]) = 0x000400c600700153; + *((unsigned long *)&__m128i_op1[1]) = 0x000c0002000c0002; + *((unsigned long *)&__m128i_op1[0]) = 0x000400c600700153; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrlrni_b_h (__m128i_op0, __m128i_op1, 0xd); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x000000010000007f; + *((unsigned long *)&__m128i_op1[0]) = 0x000000000000fffe; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0800000400000800; + __m128i_out = __lsx_vsrlrni_w_d (__m128i_op0, __m128i_op1, 0x5); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000001515151500; + *((unsigned long *)&__m128i_op1[0]) = 0x0000001515151500; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0001515000015150; + __m128i_out = __lsx_vsrlrni_h_w (__m128i_op0, __m128i_op1, 0x4); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000fdfd0404; + *((unsigned long *)&__m128i_op1[1]) = 0x3fffffff3fffffff; + *((unsigned long *)&__m128i_op1[0]) = 0x3fffffff3fffffff; + *((unsigned long *)&__m128i_result[1]) = 0x000000000000fc08; + *((unsigned long *)&__m128i_result[0]) = 0x8000800080008000; + __m128i_out = __lsx_vsrlrni_b_h (__m128i_op0, __m128i_op1, 0x7); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000000000000fc08; + *((unsigned long *)&__m128i_op0[0]) = 0x8000800080008000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffba420000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000001; + *((unsigned long *)&__m128i_result[1]) = 0x000007e044000400; + *((unsigned long *)&__m128i_result[0]) = 0xfdd2100000000000; + __m128i_out = __lsx_vsrlrni_d_q (__m128i_op0, __m128i_op1, 0x25); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000081e003f3f3f; + *((unsigned long *)&__m128i_op0[0]) = 0x3f3f3f0e00000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000081e003f3f3f; + *((unsigned long *)&__m128i_op1[0]) = 0x3f3f3f0e00000000; + *((unsigned long *)&__m128i_result[1]) = 0x00000103c007e7e8; + *((unsigned long *)&__m128i_result[0]) = 0x00000103c007e7e8; + __m128i_out = __lsx_vsrlrni_d_q (__m128i_op0, __m128i_op1, 0x43); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0202022302023212; + *((unsigned long *)&__m128i_op0[0]) = 0x0202ff3f02022212; + *((unsigned long *)&__m128i_op1[1]) = 0x0000002100003010; + *((unsigned long *)&__m128i_op1[0]) = 0x0000ff3f00002010; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrlrni_d_q (__m128i_op0, __m128i_op1, 0x79); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_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]) = 0x0000000000000000; + __m128i_out = __lsx_vsrlrni_b_h (__m128i_op0, __m128i_op1, 0x8); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrlrni_w_d (__m128i_op0, __m128i_op1, 0x1a); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffff7fff; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xe2bb5ff00e20aceb; + *((unsigned long *)&__m128i_op1[0]) = 0xe2bb5ff00e20aceb; + *((unsigned long *)&__m128i_result[1]) = 0x0100010000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00e3000e00e3000e; + __m128i_out = __lsx_vsrlrni_h_w (__m128i_op0, __m128i_op1, 0x18); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xf58df7841423142a; + *((unsigned long *)&__m128i_op1[0]) = 0x3f7477f8ff4e2152; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x3d3e0505101e4008; + __m128i_out = __lsx_vsrlrni_b_h (__m128i_op0, __m128i_op1, 0xa); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x2bd5d429e34a1efb; + *((unsigned long *)&__m128i_op0[0]) = 0xfc0203fccbedbba7; + *((unsigned long *)&__m128i_op1[1]) = 0xc9f66947f077afd0; + *((unsigned long *)&__m128i_op1[0]) = 0x89fed7c07fdf5d00; + *((unsigned long *)&__m128i_result[1]) = 0x14f1a50ffe65f6de; + *((unsigned long *)&__m128i_result[0]) = 0xa3f83bd8e03fefaf; + __m128i_out = __lsx_vsrlrni_w_d (__m128i_op0, __m128i_op1, 0x9); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrlrni_b_h (__m128i_op0, __m128i_op1, 0x2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x6ed694e00e0355db; + *((unsigned long *)&__m128i_op1[0]) = 0x0000010600000106; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xe00e035606000001; + __m128i_out = __lsx_vsrlrni_w_d (__m128i_op0, __m128i_op1, 0x8); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xe739e7ade77ae725; + *((unsigned long *)&__m128i_op0[0]) = 0xbb9013bd049bc9ec; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x56aca41400000000; + *((unsigned long *)&__m128i_result[1]) = 0x7ade77ae3bd049bd; + *((unsigned long *)&__m128i_result[0]) = 0x0000000041400000; + __m128i_out = __lsx_vsrlrni_w_d (__m128i_op0, __m128i_op1, 0xc); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrlrni_h_w (__m128i_op0, __m128i_op1, 0x12); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x1010101010101010; + *((unsigned long *)&__m128i_op1[0]) = 0x1010101010101010; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x8081808180818081; + __m128i_out = __lsx_vsrlrni_h_w (__m128i_op0, __m128i_op1, 0xd); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000000000006ff; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0037f80000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrlrni_d_q (__m128i_op0, __m128i_op1, 0x15); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrlrni_h_w (__m128i_op0, __m128i_op1, 0x9); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrlrni_d_q (__m128i_op0, __m128i_op1, 0x69); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0020202020202020; + *((unsigned long *)&__m128i_op0[0]) = 0x0080808080c04040; + *((unsigned long *)&__m128i_op1[1]) = 0x0101010101010101; + *((unsigned long *)&__m128i_op1[0]) = 0x0101010001808080; + *((unsigned long *)&__m128i_result[1]) = 0x0000202000008081; + *((unsigned long *)&__m128i_result[0]) = 0x0001010100010101; + __m128i_out = __lsx_vsrlrni_w_d (__m128i_op0, __m128i_op1, 0x28); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfff0000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0010000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x00fff00000001000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrlrni_w_d (__m128i_op0, __m128i_op1, 0x28); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrlrni_d_q (__m128i_op0, __m128i_op1, 0x6b); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x000000adf0000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000001e00; + __m128i_out = __lsx_vsrlrni_b_h (__m128i_op0, __m128i_op1, 0xb); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0040000000400040; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000020002020; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrlrni_b_h (__m128i_op0, __m128i_op1, 0x1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x8080808080808102; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000001; + *((unsigned long *)&__m128i_result[1]) = 0x0000000001010102; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrlrni_h_w (__m128i_op0, __m128i_op1, 0x7); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x001000100010000b; + *((unsigned long *)&__m128i_op0[0]) = 0x03fc03fc03fc03fc; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x04000400ff01ff01; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrlrni_h_w (__m128i_op0, __m128i_op1, 0xa); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrlrni_b_h (__m128i_op0, __m128i_op1, 0xd); + 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]) = 0x1010101010101010; + __m128i_out = __lsx_vsrlrni_b_h (__m128i_op0, __m128i_op1, 0xc); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000fff800000000; + *((unsigned long *)&__m128i_op0[0]) = 0x000000000001ed68; + *((unsigned long *)&__m128i_op1[1]) = 0x1ff6a09e667f3bd8; + *((unsigned long *)&__m128i_op1[0]) = 0xfffffffffffffffe; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000007b5a; + *((unsigned long *)&__m128i_result[0]) = 0x999fcef600000000; + __m128i_out = __lsx_vsrlrni_w_d (__m128i_op0, __m128i_op1, 0x2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffe5c8000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000001; + *((unsigned long *)&__m128i_op1[1]) = 0x91f80badc162a0c4; + *((unsigned long *)&__m128i_op1[0]) = 0x99d1ffff0101ff01; + *((unsigned long *)&__m128i_result[1]) = 0x00ff400000000000; + *((unsigned long *)&__m128i_result[0]) = 0x905d0b06cf0008f8; + __m128i_out = __lsx_vsrlrni_b_h (__m128i_op0, __m128i_op1, 0x5); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0x3802f4fd025800f7; + *((unsigned long *)&__m128i_op1[1]) = 0xc8ff0bffff00ffae; + *((unsigned long *)&__m128i_op1[0]) = 0x91ff40fffff8ff50; + *((unsigned long *)&__m128i_result[1]) = 0x0000200000000700; + *((unsigned long *)&__m128i_result[0]) = 0x0000192000001240; + __m128i_out = __lsx_vsrlrni_w_d (__m128i_op0, __m128i_op1, 0x33); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffff0ffd0ffd; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffff0ffc0001; + *((unsigned long *)&__m128i_op1[1]) = 0xbb7743ca4c78461f; + *((unsigned long *)&__m128i_op1[0]) = 0xd9743eb5fb4deb3a; + *((unsigned long *)&__m128i_result[1]) = 0x003fffffffc3ff44; + *((unsigned long *)&__m128i_result[0]) = 0x002eddd0f2931e12; + __m128i_out = __lsx_vsrlrni_d_q (__m128i_op0, __m128i_op1, 0x4a); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xbb7743ca4c78461f; + *((unsigned long *)&__m128i_op0[0]) = 0xd9743eb5fb4deb3a; + *((unsigned long *)&__m128i_op1[1]) = 0x22445e1ad9c3e4f0; + *((unsigned long *)&__m128i_op1[0]) = 0x1b43e8a30a570a63; + *((unsigned long *)&__m128i_result[1]) = 0x743ca4c843eb5fb5; + *((unsigned long *)&__m128i_result[0]) = 0x45e1ad9c3e8a30a5; + __m128i_out = __lsx_vsrlrni_w_d (__m128i_op0, __m128i_op1, 0x14); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x1204900f62f72565; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x4901725600000000; + __m128i_out = __lsx_vsrlrni_h_w (__m128i_op0, __m128i_op1, 0x4); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrlrni_d_q (__m128i_op0, __m128i_op1, 0x6a); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000400000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrlrni_h_w (__m128i_op0, __m128i_op1, 0x12); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000300000003; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrlrni_w_d (__m128i_op0, __m128i_op1, 0x32); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrlrni_h_w (__m128i_op0, __m128i_op1, 0x19); + 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_vsrlrni_b_h (__m128i_op0, __m128i_op1, 0x2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrlrni_b_h (__m128i_op0, __m128i_op1, 0x8); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x3f3f3f7fbf3fffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrlrni_d_q (__m128i_op0, __m128i_op1, 0x47); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000040804080; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000020100000000; + __m128i_out = __lsx_vsrlrni_h_w (__m128i_op0, __m128i_op1, 0xe); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrlrni_b_h (__m128i_op0, __m128i_op1, 0x0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffe8ffff28fc; + *((unsigned long *)&__m128i_op0[0]) = 0xfffffffffffffffa; + *((unsigned long *)&__m128i_op1[1]) = 0x00007fff0000803e; + *((unsigned long *)&__m128i_op1[0]) = 0x00000006ffff81e1; + *((unsigned long *)&__m128i_result[1]) = 0x0ffffffe8ffff290; + *((unsigned long *)&__m128i_result[0]) = 0x000007fff0000804; + __m128i_out = __lsx_vsrlrni_d_q (__m128i_op0, __m128i_op1, 0x44); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x000418200000008e; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000002100047; + __m128i_out = __lsx_vsrlrni_b_h (__m128i_op0, __m128i_op1, 0x1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x6363636363636362; + *((unsigned long *)&__m128i_op0[0]) = 0x6363636363636362; + *((unsigned long *)&__m128i_op1[1]) = 0x6363636363636362; + *((unsigned long *)&__m128i_op1[0]) = 0x6363636363636362; + *((unsigned long *)&__m128i_result[1]) = 0x0032003200320032; + *((unsigned long *)&__m128i_result[0]) = 0x0032003200320032; + __m128i_out = __lsx_vsrlrni_h_w (__m128i_op0, __m128i_op1, 0x19); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffff01010102; + *((unsigned long *)&__m128i_op0[0]) = 0x7ffdf87f0b0c7f7f; + *((unsigned long *)&__m128i_op1[1]) = 0xf6b3eb63f6b3f6b3; + *((unsigned long *)&__m128i_op1[0]) = 0x363953e42b56432e; + *((unsigned long *)&__m128i_result[1]) = 0x010000010080000b; + *((unsigned long *)&__m128i_result[0]) = 0x00f700f70036002b; + __m128i_out = __lsx_vsrlrni_h_w (__m128i_op0, __m128i_op1, 0x18); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xed67d6c7ed67ed67; + *((unsigned long *)&__m128i_op1[0]) = 0x6c72a7c856ac865c; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000700000003; + __m128i_out = __lsx_vsrlrni_w_d (__m128i_op0, __m128i_op1, 0x3d); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrlrni_w_d (__m128i_op0, __m128i_op1, 0x3); + 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_vsrlrni_d_q (__m128i_op0, __m128i_op1, 0x8); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffff40ff83; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x1010101010101010; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrlrni_b_h (__m128i_op0, __m128i_op1, 0xc); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000003030103; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000003030103; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000006060; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000006060; + __m128i_out = __lsx_vsrlrni_h_w (__m128i_op0, __m128i_op1, 0xb); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x000002408beb26c8; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x000000000000706e; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000028c27; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000070; + __m128i_out = __lsx_vsrlrni_b_h (__m128i_op0, __m128i_op1, 0x8); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x80000b0b80000b0b; + *((unsigned long *)&__m128i_op0[0]) = 0x8000101080001010; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffefefffffeff0; + *((unsigned long *)&__m128i_result[1]) = 0x0061006100020002; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000fe00fe; + __m128i_out = __lsx_vsrlrni_b_h (__m128i_op0, __m128i_op1, 0x3); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000001; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000078087f08; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000078087f08; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000e0fc0000e0fc; + __m128i_out = __lsx_vsrlrni_b_h (__m128i_op0, __m128i_op1, 0x6); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrlrni_w_d (__m128i_op0, __m128i_op1, 0x17); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000000ff0bff76; + *((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]) = 0x0000000000000000; + __m128i_out = __lsx_vsrlrni_d_q (__m128i_op0, __m128i_op1, 0x75); + 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]) = 0x0000000000000000; + __m128i_out = __lsx_vsrlrni_w_d (__m128i_op0, __m128i_op1, 0x33); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000000ff00ff0000; + *((unsigned long *)&__m128i_op0[0]) = 0x000000ff00ffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x8282828282828282; + *((unsigned long *)&__m128i_op1[0]) = 0x0000828282828282; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0008000800000008; + __m128i_out = __lsx_vsrlrni_h_w (__m128i_op0, __m128i_op1, 0x1c); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x00f7000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000005150; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000005150; + *((unsigned long *)&__m128i_result[1]) = 0x00000000000f7000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrlrni_w_d (__m128i_op0, __m128i_op1, 0x24); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x41afddcb1c000000; + *((unsigned long *)&__m128i_op1[1]) = 0xd09e1bd99a2c6eb1; + *((unsigned long *)&__m128i_op1[0]) = 0xe82f7c27bb0778af; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000040002; + *((unsigned long *)&__m128i_result[0]) = 0x000d000a000f000c; + __m128i_out = __lsx_vsrlrni_h_w (__m128i_op0, __m128i_op1, 0x1c); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000000ffff8000; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000ffffdff0; + *((unsigned long *)&__m128i_op1[1]) = 0x8000000080000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0144329880000000; + *((unsigned long *)&__m128i_result[1]) = 0x007fffc0007ffff0; + *((unsigned long *)&__m128i_result[0]) = 0x004000004c400000; + __m128i_out = __lsx_vsrlrni_w_d (__m128i_op0, __m128i_op1, 0x9); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrlrni_h_w (__m128i_op0, __m128i_op1, 0x17); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000001e0000001e; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrlrni_b_h (__m128i_op0, __m128i_op1, 0xd); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xfffafff0fff9ff01; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000200000002; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000200000002; + *((unsigned long *)&__m128i_result[1]) = 0x00000000d800cff8; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrlrni_h_w (__m128i_op0, __m128i_op1, 0x5); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000100000001; + *((unsigned long *)&__m128i_op1[1]) = 0x00000002000007d7; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000300000ff1; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_result[0]) = 0x000007d700000ff1; + __m128i_out = __lsx_vsrlrni_w_d (__m128i_op0, __m128i_op1, 0x0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xff800000ff800000; + *((unsigned long *)&__m128i_op0[0]) = 0x7fc000007fc00000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffff00ffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffff00ffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000ff8; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000001000; + __m128i_out = __lsx_vsrlrni_d_q (__m128i_op0, __m128i_op1, 0x74); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000f08; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000002; + *((unsigned long *)&__m128i_result[0]) = 0x2020202020202020; + __m128i_out = __lsx_vsrlrni_b_h (__m128i_op0, __m128i_op1, 0xb); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} From patchwork Wed Sep 13 03:35:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: chenxiaolong X-Patchwork-Id: 138590 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9ecd:0:b0:3f2:4152:657d with SMTP id t13csp832673vqx; Tue, 12 Sep 2023 20:42:46 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHFY7vr6xdzga3Ji3chgBbVMFGXrdKAyS2MRCtnRucJmYx+UzsSw5bnHT2VwM5VuCEqymq8 X-Received: by 2002:a19:4311:0:b0:500:95f7:c418 with SMTP id q17-20020a194311000000b0050095f7c418mr852200lfa.39.1694576565700; Tue, 12 Sep 2023 20:42:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694576565; cv=none; d=google.com; s=arc-20160816; b=CvHoFG0g/spqqRWBhPccl+XHK+NkzCtJRFeVgFfhtCtTIx3d/nqPHPHp9xyTQsEEKf y2/9ucV8RcmaSLENEfbqi3tbTqfDRKk5ynikLqpjwLjDliOjEEKpMr3P7TrUWRARtMd4 AJvdThrs9L/bDSdj6vuBkB5eKu7QNnZTPFnTUitiPLndKlHHue+8Fcwj140DfKpmgIVr Dh4Ur5lNzkfmWkECgfrnONCOasqTpmU7y+svItbuLMiRxRsL4tpkhVEncDfPEV3ubnhN VSf8CxUDz29C66RLMSiS1bf4SynLJDJKzrffCcyZglCQXcy3DZK7vdaLo0pJLf/d8VA+ H1Jg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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:cc:to :from:dmarc-filter:delivered-to; bh=sw/H4FGKod2V2k9YPH5NPljZs5yO1TOxUuTFTnaG8BQ=; fh=3pFUYcpS/27XRzOf17GfR86AuNQu+P1CET04YURgCLs=; b=EaB1geiw8F6YzMtbRAYbrebF/67PaTk6QDsKjcnxNTwu6C+KFpCUNMBsmzzE4LCiMV RlEkBCcLI1ZdI2ussa3bg3+lRv/3tEgcxU2vx7Dar492Egpg0RIXBTQr1zwVaqBRFrVu ez9JpeJWgTAExV0xt0XUHcPhTXbVt9iPPiw2WPORe6/DlsxWIgJ95xQxrDqn3QZnrPpP vUG18fZJQ56kTm5+vOxCNTE82CFbxluk63eplNNsfVxFXMutifZNDr8kjR3J8w3cyeMW iwIdoOwZZUe5opw7+urkYORrxsJ4aJgOooM9dC7H6bQe+NVkOHYBkN6fvU28i9ca6+wM AiMA== 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 a7-20020a17090680c700b0098874379199si10011862ejx.163.2023.09.12.20.42.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Sep 2023 20:42:45 -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 5935D3947C25 for ; Wed, 13 Sep 2023 03:36:27 +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 308B7382E6B0 for ; Wed, 13 Sep 2023 03:35:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 308B7382E6B0 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 1qgGfE-00039U-Ta for gcc-patches@gcc.gnu.org; Tue, 12 Sep 2023 23:35:47 -0400 Received: from loongson.cn (unknown [10.10.130.252]) by gateway (Coremail) with SMTP id _____8BxY_AJLgFlzzAmAA--.8682S3; Wed, 13 Sep 2023 11:35:37 +0800 (CST) Received: from slurm-master.loongson.cn (unknown [10.10.130.252]) by localhost.localdomain (Coremail) with SMTP id AQAAf8Cx7y_8LQFlvA8CAA--.3484S9; Wed, 13 Sep 2023 11:35:36 +0800 (CST) From: Xiaolong Chen To: gcc-patches@gcc.gnu.org Cc: xry111@xry111.site, i@xen0n.name, xuchenghua@loongson.cn, chenglulu@loongson.cn, Xiaolong Chen Subject: [PATCH v4 15/23] LoongArch: Add tests for SX vector vrotr/vrotri/vsra/vsrai/vsran/vsrani /vsrarn/vsrarni instructions. Date: Wed, 13 Sep 2023 11:35:18 +0800 Message-Id: <20230913033522.5983-6-chenxiaolong@loongson.cn> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230913033522.5983-1-chenxiaolong@loongson.cn> References: <20230913033522.5983-1-chenxiaolong@loongson.cn> MIME-Version: 1.0 X-CM-TRANSID: AQAAf8Cx7y_8LQFlvA8CAA--.3484S9 X-CM-SenderInfo: hfkh05xldrz0tqj6z05rqj20fqof0/1tbiAQANBWUBHCIBCwAAsZ X-Coremail-Antispam: 1Uk129KBj9UXoW7XFWkZw4rKrykp5X_GF1fXr18pr12vr13Kr Wxua4jyryUtFyYqFWkAr92ya97JF17t3srKw1DGFsxXF13Ca4UAr1DtF9rWF13tFy5GF4j qr47JwcCm3ZEXasCq-sJn29KB7ZKAUJUUUUU529EdanIXcx71UUUUU7KY7ZEXasCq-sGcS sGvfJ3Ic02F40EFcxC0VAKzVAqx4xG6I80ebIjqfuFe4nvWSU5nxnvy29KBjDU0xBIdaVr nRJUUUkIb4IE77IF4wAFF20E14v26r1j6r4UM7CY07I20VC2zVCF04k26cxKx2IYs7xG6r Wj6s0DM7CIcVAFz4kK6r1j6r18M28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48ve4kI8wA2 z4x0Y4vE2Ix0cI8IcVAFwI0_Ar0_tr1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI0_Cr0_Gr 1UM28EF7xvwVC2z280aVAFwI0_Gr1j6F4UJwA2z4x0Y4vEx4A2jsIEc7CjxVAFwI0_Gr1j 6F4UJwAS0I0E0xvYzxvE52x082IY62kv0487Mc804VCY07AIYIkI8VC2zVCFFI0UMc02F4 0EFcxC0VAKzVAqx4xG6I80ewAv7VC0I7IYx2IY67AKxVWrXVW3AwAv7VC2z280aVAFwI0_ Gr0_Cr1lOx8S6xCaFVCjc4AY6r1j6r4UM4x0Y48IcxkI7VAKI48JMxAIw28IcxkI7VAKI4 8JMxC20s026xCaFVCjc4AY6r1j6r4UMI8I3I0E5I8CrVAFwI0_Jr0_Jr4lx2IqxVCjr7xv wVAFwI0_JrI_JrWlx4CE17CEb7AF67AKxVWUAVWUtwCIc40Y0x0EwIxGrwCI42IY6xIIjx v20xvE14v26F1j6w1UMIIF0xvE2Ix0cI8IcVCY1x0267AKxVW8JVWxJwCI42IY6xAIw20E Y4v20xvaj40_Jr0_JF4lIxAIcVC2z280aVAFwI0_Gr0_Cr1lIxAIcVC2z280aVCY1x0267 AKxVW8JVW8JrUvcSsGvfC2KfnxnUUI43ZEXa7IU04v3UUUUUU== 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: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1776892316850415914 X-GMAIL-MSGID: 1776892316850415914 gcc/testsuite/ChangeLog: * gcc.target/loongarch/vector/lsx/lsx-vrotr.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vrotri.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vsra.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vsrai.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vsran.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vsrani.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vsrar.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vsrari.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vsrarn.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vsrarni.c: New test. --- .../loongarch/vector/lsx/lsx-vrotr.c | 381 +++++++++++++++++ .../loongarch/vector/lsx/lsx-vrotri.c | 294 +++++++++++++ .../loongarch/vector/lsx/lsx-vsra.c | 344 +++++++++++++++ .../loongarch/vector/lsx/lsx-vsrai.c | 258 ++++++++++++ .../loongarch/vector/lsx/lsx-vsran.c | 290 +++++++++++++ .../loongarch/vector/lsx/lsx-vsrani.c | 246 +++++++++++ .../loongarch/vector/lsx/lsx-vsrar.c | 354 ++++++++++++++++ .../loongarch/vector/lsx/lsx-vsrari.c | 265 ++++++++++++ .../loongarch/vector/lsx/lsx-vsrarn.c | 236 +++++++++++ .../loongarch/vector/lsx/lsx-vsrarni.c | 398 ++++++++++++++++++ 10 files changed, 3066 insertions(+) create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vrotr.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vrotri.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsra.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsrai.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsran.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsrani.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsrar.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsrari.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsrarn.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsrarni.c diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vrotr.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vrotr.c new file mode 100644 index 00000000000..c42440cea26 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vrotr.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]) = 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_vrotr_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_vrotr_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_vrotr_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xfffefffefffffffc; + *((unsigned long *)&__m128i_op1[1]) = 0x2001240128032403; + *((unsigned long *)&__m128i_op1[0]) = 0x288b248c00010401; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xffdfffefffff7ffe; + __m128i_out = __lsx_vrotr_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]) = 0x2700000000002727; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000002727; + *((unsigned long *)&__m128i_op1[1]) = 0x697eba2bedfa9c82; + *((unsigned long *)&__m128i_op1[0]) = 0xd705c77a7025c899; + *((unsigned long *)&__m128i_result[1]) = 0xc9c00000000009c9; + *((unsigned long *)&__m128i_result[0]) = 0x0013938000000000; + __m128i_out = __lsx_vrotr_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x1000000010000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000100100000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x2000000020000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000200200000; + __m128i_out = __lsx_vrotr_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_vrotr_h (__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]) = 0x10f917d72d3d01e4; + *((unsigned long *)&__m128i_result[0]) = 0x203e16d116de012b; + __m128i_out = __lsx_vrotr_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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vrotr_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]) = 0x0000000100000001; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000100000001; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vrotr_h (__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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x9f009f009f009f00; + *((unsigned long *)&__m128i_result[0]) = 0x9f009f009f009f00; + __m128i_out = __lsx_vrotr_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000000004fc04f81; + *((unsigned long *)&__m128i_op0[0]) = 0x000000004fc04f80; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x000000004fc04f81; + *((unsigned long *)&__m128i_result[0]) = 0x000000004fc04f80; + __m128i_out = __lsx_vrotr_d (__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]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000ff000000ff00; + __m128i_out = __lsx_vrotr_h (__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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000006f00001f0a; + *((unsigned long *)&__m128i_result[0]) = 0x0000958affff995d; + __m128i_out = __lsx_vrotr_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000000000000006f; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000001f0a; + *((unsigned long *)&__m128i_op1[1]) = 0x000000000000006f; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000de0000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000001f0a; + __m128i_out = __lsx_vrotr_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffff000100000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x41dfffff00000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffff000200000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vrotr_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfbffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0x7bffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0xfbffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0x7bffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0xf7ffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xf7feffffffffffff; + __m128i_out = __lsx_vrotr_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0ba00ba00ba00ba0; + *((unsigned long *)&__m128i_op0[0]) = 0x0ba00ba00ba011eb; + *((unsigned long *)&__m128i_op1[1]) = 0xf1819b7c0732a6b6; + *((unsigned long *)&__m128i_op1[0]) = 0xffb9917a6e7fffff; + *((unsigned long *)&__m128i_result[1]) = 0x05d0ba0002e8802e; + *((unsigned long *)&__m128i_result[0]) = 0xd005e802174023d6; + __m128i_out = __lsx_vrotr_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_vrotr_w (__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]) = 0x000691a6c843c8fc; + *((unsigned long *)&__m128i_result[0]) = 0x000691a6918691fc; + __m128i_out = __lsx_vrotr_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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vrotr_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_vrotr_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_vrotr_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000003f0000ffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffc3ffff003e; + *((unsigned long *)&__m128i_op1[1]) = 0x00000000003dffc2; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000003dffc2; + *((unsigned long *)&__m128i_result[1]) = 0xc000000fc0003fff; + *((unsigned long *)&__m128i_result[0]) = 0xbffffff0ffffc00f; + __m128i_out = __lsx_vrotr_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_vrotr_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_vrotr_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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vrotr_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfffdfffdfffdfffd; + *((unsigned long *)&__m128i_op0[0]) = 0xfffdfffdfffdfffd; + *((unsigned long *)&__m128i_op1[1]) = 0xfffdfffdfffdfffd; + *((unsigned long *)&__m128i_op1[0]) = 0xfffdfffdfffdfffd; + *((unsigned long *)&__m128i_result[1]) = 0xffefffefffefffef; + *((unsigned long *)&__m128i_result[0]) = 0xffefffefffefffef; + __m128i_out = __lsx_vrotr_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000001010001; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000010001; + *((unsigned long *)&__m128i_op1[1]) = 0x0000ffff0000ffff; + *((unsigned long *)&__m128i_op1[0]) = 0x0000ffff0000ffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000001010002; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000010002; + __m128i_out = __lsx_vrotr_h (__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]) = 0x8080808080808080; + *((unsigned long *)&__m128i_result[0]) = 0x8080808080808080; + __m128i_out = __lsx_vrotr_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x4e3e133738bb47d2; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x9c7c266e71768fa4; + __m128i_out = __lsx_vrotr_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]) = 0x0000000000000008; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vrotr_b (__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]) = 0x0000014414104505; + *((unsigned long *)&__m128i_op1[0]) = 0x1011050040004101; + *((unsigned long *)&__m128i_result[1]) = 0x001a323b5430048c; + *((unsigned long *)&__m128i_result[0]) = 0x008f792cab1cb915; + __m128i_out = __lsx_vrotr_b (__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]) = 0x001a64b345308091; + *((unsigned long *)&__m128i_op1[0]) = 0x001f2f2cab1c732a; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000780c00000; + __m128i_out = __lsx_vrotr_d (__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]) = 0xffffffffffffffff; + __m128i_out = __lsx_vrotr_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_vrotr_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]) = 0x00020000ffff0001; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vrotr_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000b000b000b000b; + *((unsigned long *)&__m128i_op0[0]) = 0x000b000b000b000b; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x000b000b000b000b; + *((unsigned long *)&__m128i_result[0]) = 0x000b000b000b000b; + __m128i_out = __lsx_vrotr_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0005840100000005; + *((unsigned long *)&__m128i_op0[0]) = 0x0005847b00000000; + *((unsigned long *)&__m128i_op1[1]) = 0x636363633f3e47c1; + *((unsigned long *)&__m128i_op1[0]) = 0x41f8e080f1ef4eaa; + *((unsigned long *)&__m128i_result[1]) = 0xa000308000008002; + *((unsigned long *)&__m128i_result[0]) = 0x0500847b00000000; + __m128i_out = __lsx_vrotr_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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vrotr_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-vrotri.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vrotri.c new file mode 100644 index 00000000000..4ae4dbf8b1c --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vrotri.c @@ -0,0 +1,294 @@ +/* { 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_vrotri_h (__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_vrotri_d (__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_vrotri_d (__m128i_op0, 0x16); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000800000008; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000800000008; + *((unsigned long *)&__m128i_result[1]) = 0x0002000000020000; + *((unsigned long *)&__m128i_result[0]) = 0x0002000000020000; + __m128i_out = __lsx_vrotri_w (__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_vrotri_w (__m128i_op0, 0x11); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0d1bffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xd915e98e2d8df4d1; + *((unsigned long *)&__m128i_result[1]) = 0xd0b1ffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x9d519ee8d2d84f1d; + __m128i_out = __lsx_vrotri_b (__m128i_op0, 0x4); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x10f917d72d3d01e4; + *((unsigned long *)&__m128i_op0[0]) = 0x203e16d116de012b; + *((unsigned long *)&__m128i_result[1]) = 0x887c8beb969e00f2; + *((unsigned long *)&__m128i_result[0]) = 0x101f8b680b6f8095; + __m128i_out = __lsx_vrotri_h (__m128i_op0, 0x1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + unsigned_int_out = __lsx_vpickve2gr_wu (__m128i_op0, 0x2); + *((unsigned long *)&__m128i_op0[1]) = 0x8000000080000000; + *((unsigned long *)&__m128i_op0[0]) = 0x8000000080000000; + *((unsigned long *)&__m128i_result[1]) = 0x0800000008000000; + *((unsigned long *)&__m128i_result[0]) = 0x0800000008000000; + __m128i_out = __lsx_vrotri_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_vrotri_b (__m128i_op0, 0x7); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000003; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000c00; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vrotri_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_vrotri_w (__m128i_op0, 0x10); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000000ffffff01; + *((unsigned long *)&__m128i_op0[0]) = 0xffffeff400000df4; + *((unsigned long *)&__m128i_result[1]) = 0x00000000ffff03fe; + *((unsigned long *)&__m128i_result[0]) = 0xffffe9df0000e81b; + __m128i_out = __lsx_vrotri_h (__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_vrotri_w (__m128i_op0, 0x16); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000006f00001f0a; + *((unsigned long *)&__m128i_op0[0]) = 0x0000958affff995d; + *((unsigned long *)&__m128i_result[1]) = 0x000000de00003e14; + *((unsigned long *)&__m128i_result[0]) = 0x00012b15ffff32ba; + __m128i_out = __lsx_vrotri_d (__m128i_op0, 0x3f); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000000000000006f; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x000000000000007b; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vrotri_b (__m128i_op0, 0x5); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0x80001b155b4b0000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x80001b155b4b0000; + __m128i_out = __lsx_vrotri_w (__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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vrotri_w (__m128i_op0, 0x1c); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfffffffffffffffe; + *((unsigned long *)&__m128i_op0[0]) = 0xfffffffffffffffe; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffefffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffefffff; + __m128i_out = __lsx_vrotri_w (__m128i_op0, 0xc); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000001000000010; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000002000000020; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vrotri_b (__m128i_op0, 0x7); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x1111113111111141; + *((unsigned long *)&__m128i_op0[0]) = 0x1111113111111121; + *((unsigned long *)&__m128i_result[1]) = 0x1111311111114111; + *((unsigned long *)&__m128i_result[0]) = 0x1111311111112111; + __m128i_out = __lsx_vrotri_h (__m128i_op0, 0x8); + 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]) = 0xffffffffffffffff; + __m128i_out = __lsx_vrotri_h (__m128i_op0, 0xa); + 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_vrotri_d (__m128i_op0, 0x35); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000001; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0008000000000000; + __m128i_out = __lsx_vrotri_d (__m128i_op0, 0xd); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x000000007fffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xfffffff800000003; + __m128i_out = __lsx_vrotri_d (__m128i_op0, 0x1d); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000003f0000ffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffc3ffff003e; + *((unsigned long *)&__m128i_result[1]) = 0x00001f80007fff80; + *((unsigned long *)&__m128i_result[0]) = 0xffffe1ffff801f7f; + __m128i_out = __lsx_vrotri_w (__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_vrotri_b (__m128i_op0, 0x5); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffff0000ffff0000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xfff0000ffff0000f; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vrotri_d (__m128i_op0, 0x1c); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000ff02d060; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00000000ff02d060; + __m128i_out = __lsx_vrotri_b (__m128i_op0, 0x0); + 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_vrotri_d (__m128i_op0, 0x3f); + 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_vrotri_w (__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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vrotri_b (__m128i_op0, 0x5); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x27b9331b8e77ead9; + *((unsigned long *)&__m128i_op0[0]) = 0x58d6bf1867ace738; + *((unsigned long *)&__m128i_result[1]) = 0xe4cc6c9edfab6639; + *((unsigned long *)&__m128i_result[0]) = 0x5afc6163b39ce19e; + __m128i_out = __lsx_vrotri_w (__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_vrotri_d (__m128i_op0, 0x2c); + 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_vrotri_w (__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_vrotri_d (__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_vrotri_h (__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_vrotri_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_vrotri_d (__m128i_op0, 0x21); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffff000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xffff000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffff000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xffff000000000000; + __m128i_out = __lsx_vrotri_h (__m128i_op0, 0xa); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsra.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsra.c new file mode 100644 index 00000000000..fd7c22a8279 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsra.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_vsra_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_vsra_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_vsra_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_vsra_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x7fc000007fc00000; + *((unsigned long *)&__m128i_op0[0]) = 0x1e801ffc7fc00000; + *((unsigned long *)&__m128i_op1[1]) = 0x00ed0008005e00a2; + *((unsigned long *)&__m128i_op1[0]) = 0x007a007600150077; + *((unsigned long *)&__m128i_result[1]) = 0x0003000000010000; + *((unsigned long *)&__m128i_result[0]) = 0x0007007f03fe0000; + __m128i_out = __lsx_vsra_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_vsra_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]) = 0xffffe001ffffe001; + *((unsigned long *)&__m128i_op1[0]) = 0xffffe001ffffe001; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vsra_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x3fc000003fc00000; + *((unsigned long *)&__m128i_op0[0]) = 0x3fc000003fc00000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x3fc000003fc00000; + *((unsigned long *)&__m128i_result[0]) = 0x3fc000003fc00000; + __m128i_out = __lsx_vsra_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_vsra_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]) = 0x00003ff000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000fffc00000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsra_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x85bd6b0e94d89998; + *((unsigned long *)&__m128i_op0[0]) = 0xd83c8081ffff8080; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x85bd6b0e94d89998; + *((unsigned long *)&__m128i_result[0]) = 0xd83c8081ffff8080; + __m128i_out = __lsx_vsra_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xe0d56a9774f3ea31; + *((unsigned long *)&__m128i_op0[0]) = 0xbddaa86803e33c2a; + *((unsigned long *)&__m128i_op1[1]) = 0xe0d56a9774f3ea31; + *((unsigned long *)&__m128i_op1[0]) = 0xbddaa86803e33c2a; + *((unsigned long *)&__m128i_result[1]) = 0xff0600d50e9ef518; + *((unsigned long *)&__m128i_result[0]) = 0xffefffa8007c000f; + __m128i_out = __lsx_vsra_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]) = 0xaaaaffebcfb748e0; + *((unsigned long *)&__m128i_op1[0]) = 0xfd293eab528e7ebe; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vsra_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]) = 0xfffefff6fff80002; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsra_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_vsra_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]) = 0xe0404041e0404041; + *((unsigned long *)&__m128i_op1[0]) = 0x803f800080000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsra_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x000700ff00000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000040004000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0010002000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x000700ff00000000; + __m128i_out = __lsx_vsra_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_vsra_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000000820000ff81; + *((unsigned long *)&__m128i_op0[0]) = 0x0000ff810000ff81; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x000000820000ff81; + *((unsigned long *)&__m128i_result[0]) = 0x0000ff810000ff81; + __m128i_out = __lsx_vsra_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x800080007f008000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0x0a0aa9890a0ac5f3; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xfffffffffffff000; + __m128i_out = __lsx_vsra_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x01203f1e3d1c3b1a; + *((unsigned long *)&__m128i_op0[0]) = 0x3918371635143312; + *((unsigned long *)&__m128i_op1[1]) = 0x21201f1e1d001b25; + *((unsigned long *)&__m128i_op1[0]) = 0x191817161514131d; + *((unsigned long *)&__m128i_result[1]) = 0x0000000001e8e1d8; + *((unsigned long *)&__m128i_result[0]) = 0x000000e400000001; + __m128i_out = __lsx_vsra_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]) = 0x0008000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsra_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_vsra_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000002; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000080008; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x000000fffe01fd02; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000002; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000040002; + __m128i_out = __lsx_vsra_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]) = 0xff80000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0xff80000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsra_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffc0ff80ff800000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000005; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffc0ff80ff800000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000005; + __m128i_out = __lsx_vsra_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]) = 0x00000c0c00000000; + *((unsigned long *)&__m128i_op1[0]) = 0xfffffffffffffffe; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vsra_w (__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]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_result[0]) = 0xffffffff00000000; + __m128i_out = __lsx_vsra_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_vsra_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000ffac0a000000; + *((unsigned long *)&__m128i_op1[1]) = 0x801d5de0000559e0; + *((unsigned long *)&__m128i_op1[0]) = 0x77eb86788eebafe1; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000ffac00000000; + __m128i_out = __lsx_vsra_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]) = 0xfcfcfcfcfcfcfcfd; + *((unsigned long *)&__m128i_op1[0]) = 0xfcfcfcfcfcfc0000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsra_d (__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]) = 0x5252525252525252; + *((unsigned long *)&__m128i_result[0]) = 0x5252525252525252; + __m128i_out = __lsx_vsra_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]) = 0x2e2b34ca59fa4c88; + *((unsigned long *)&__m128i_op1[0]) = 0x3b2c8aefd44be966; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsra_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000ffff0000ffff; + *((unsigned long *)&__m128i_op0[0]) = 0x0000ffff0000ffff; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0802080408060803; + *((unsigned long *)&__m128i_result[1]) = 0x0000ffff0000ffff; + *((unsigned long *)&__m128i_result[0]) = 0x00001fffe0001fff; + __m128i_out = __lsx_vsra_d (__m128i_op0, __m128i_op1); + 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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x7f8000007f800000; + *((unsigned long *)&__m128i_result[0]) = 0x7f8000007f800000; + __m128i_out = __lsx_vsra_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000000047fe2f0; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000047fe2f0; + *((unsigned long *)&__m128i_op1[1]) = 0x0001000100010012; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000fec20704; + *((unsigned long *)&__m128i_result[1]) = 0x00000000043fe2fc; + *((unsigned long *)&__m128i_result[0]) = 0x00000000001fffff; + __m128i_out = __lsx_vsra_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsrai.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsrai.c new file mode 100644 index 00000000000..2ca4f0b7ace --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsrai.c @@ -0,0 +1,258 @@ +/* { 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_vsrai_d (__m128i_op0, 0x21); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0001ffff00000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0001ffff0001ffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000ffff00000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000ffff0000ffff; + __m128i_out = __lsx_vsrai_b (__m128i_op0, 0x2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000ca354688; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000003; + __m128i_out = __lsx_vsrai_d (__m128i_op0, 0x1e); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000040400000383; + *((unsigned long *)&__m128i_op0[0]) = 0xffffe000ffff1fff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000800000007; + *((unsigned long *)&__m128i_result[0]) = 0xffffffc0ffff003f; + __m128i_out = __lsx_vsrai_h (__m128i_op0, 0x7); + 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]) = 0x0000000000000000; + __m128i_out = __lsx_vsrai_b (__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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrai_d (__m128i_op0, 0x2e); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xf6e91c0000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x51cfd7c000000000; + *((unsigned long *)&__m128i_result[1]) = 0xfffd000700000000; + *((unsigned long *)&__m128i_result[0]) = 0x0014fff500000000; + __m128i_out = __lsx_vsrai_h (__m128i_op0, 0xa); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000200010; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrai_h (__m128i_op0, 0xa); + 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_vsrai_d (__m128i_op0, 0x3c); + 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_vsrai_b (__m128i_op0, 0x0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x3c600000ff800000; + *((unsigned long *)&__m128i_op0[0]) = 0xfffffffffffffffe; + *((unsigned long *)&__m128i_result[1]) = 0x0f180000ffe00000; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vsrai_b (__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_vsrai_d (__m128i_op0, 0x5); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x21f32eaf5b7a02c8; + *((unsigned long *)&__m128i_op0[0]) = 0x407c2ca32cbd0357; + *((unsigned long *)&__m128i_result[1]) = 0x10f917d72d3d01e4; + *((unsigned long *)&__m128i_result[0]) = 0x203e16d116de012b; + __m128i_out = __lsx_vsrai_b (__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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrai_w (__m128i_op0, 0xe); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x7ff0000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x7ff0000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x01ff000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x01ff000000000000; + __m128i_out = __lsx_vsrai_b (__m128i_op0, 0x6); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x1268f057137a0267; + *((unsigned long *)&__m128i_op0[0]) = 0x0048137ef886fae0; + *((unsigned long *)&__m128i_result[1]) = 0x000000490000004d; + *((unsigned long *)&__m128i_result[0]) = 0x00000001ffffffe2; + __m128i_out = __lsx_vsrai_w (__m128i_op0, 0x16); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00ffffff00ff00ff; + *((unsigned long *)&__m128i_op0[0]) = 0x00ff00ffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x00ffffff00ff00ff; + *((unsigned long *)&__m128i_result[0]) = 0x00ff00ffffffffff; + __m128i_out = __lsx_vsrai_b (__m128i_op0, 0x4); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xfe80ffffffffff02; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xfffffffffffffe80; + __m128i_out = __lsx_vsrai_d (__m128i_op0, 0x30); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000001800000039; + *((unsigned long *)&__m128i_op0[0]) = 0x00000049ffffffaa; + *((unsigned long *)&__m128i_result[1]) = 0x000000060000000e; + *((unsigned long *)&__m128i_result[0]) = 0x000000127fffffea; + __m128i_out = __lsx_vsrai_d (__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_vsrai_d (__m128i_op0, 0x28); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0aa077b7054c9554; + *((unsigned long *)&__m128i_op0[0]) = 0x40c7ee1f38e4c4e8; + *((unsigned long *)&__m128i_result[1]) = 0x000000000000ffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000ffff0000ffff; + __m128i_out = __lsx_vsrai_h (__m128i_op0, 0xf); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x000000000000000f; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrai_w (__m128i_op0, 0x16); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0808080808080808; + *((unsigned long *)&__m128i_op0[0]) = 0x0808080808080808; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrai_b (__m128i_op0, 0x5); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0x7fff7fff7fff7fff; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x3fff3fff3fff3fff; + __m128i_out = __lsx_vsrai_b (__m128i_op0, 0x1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x5d7f5d807fea807f; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000002ebf; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrai_d (__m128i_op0, 0x31); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000200000002; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000200000002; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrai_b (__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_vsrai_d (__m128i_op0, 0x31); + 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_vsrai_w (__m128i_op0, 0xf); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000190; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrai_d (__m128i_op0, 0x1b); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0001000100010058; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000001000100010; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrai_d (__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_vsrai_d (__m128i_op0, 0xe); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0001000100010001; + *((unsigned long *)&__m128i_op0[0]) = 0x00f0001000000010; + *((unsigned long *)&__m128i_result[1]) = 0x0001000100010001; + *((unsigned long *)&__m128i_result[0]) = 0x00f0001000000010; + __m128i_out = __lsx_vsrai_h (__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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrai_d (__m128i_op0, 0x3d); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_result[0]) = 0xffffffff00000000; + __m128i_out = __lsx_vsrai_h (__m128i_op0, 0xe); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsran.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsran.c new file mode 100644 index 00000000000..4e7c7ab7e17 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsran.c @@ -0,0 +1,290 @@ +/* { 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_vsran_w_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000001fffffffe; + *((unsigned long *)&__m128i_op0[0]) = 0x00000001fffffffe; + *((unsigned long *)&__m128i_op1[1]) = 0x007fffff00000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000fffe0001fffe; + __m128i_out = __lsx_vsran_b_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0303020102020001; + *((unsigned long *)&__m128i_op0[0]) = 0x0002000000000201; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0xd82480697f678077; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0301020100000004; + __m128i_out = __lsx_vsran_b_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_vsran_w_d (__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]) = 0x000000000000ff02; + __m128i_out = __lsx_vsran_b_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]) = 0x3c5fffffff7fffff; + *((unsigned long *)&__m128i_op1[0]) = 0xfffefffeff00feff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsran_b_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000e0180000e810; + *((unsigned long *)&__m128i_op0[0]) = 0x0000f0080000f800; + *((unsigned long *)&__m128i_op1[1]) = 0x0000e0180000e810; + *((unsigned long *)&__m128i_op1[0]) = 0x0000f0080000f800; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000f0f800; + __m128i_out = __lsx_vsran_h_w (__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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x7fff7fff00000000; + __m128i_out = __lsx_vsran_h_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000100089bde; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000100000001; + *((unsigned long *)&__m128i_op1[1]) = 0x0001000100010001; + *((unsigned long *)&__m128i_op1[0]) = 0x0001000104000800; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x80044def00000001; + __m128i_out = __lsx_vsran_w_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]) = 0x00000100f8100002; + *((unsigned long *)&__m128i_op1[0]) = 0xfff0ff8006f0f950; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000001; + __m128i_out = __lsx_vsran_b_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]) = 0x0000000000001f0a; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000ffff7a53; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsran_h_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]) = 0xfffffffffffffff0; + *((unsigned long *)&__m128i_op1[0]) = 0xfffffffffffffff0; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsran_h_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]) = 0x00000000000000bf; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000000002bb; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x000000000000ffff; + __m128i_out = __lsx_vsran_b_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000021e79364; + *((unsigned long *)&__m128i_op0[0]) = 0x0000718ea657431b; + *((unsigned long *)&__m128i_op1[1]) = 0xfefffffffeffda6f; + *((unsigned long *)&__m128i_op1[0]) = 0xfefffffffeffe3d7; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x000000ff0000ff86; + __m128i_out = __lsx_vsran_b_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x8000000000000001; + *((unsigned long *)&__m128i_op0[0]) = 0x8000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0101fe870101fe87; + *((unsigned long *)&__m128i_op1[0]) = 0x0101fe8700000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsran_b_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]) = 0xffffffffffffffff; + __m128i_out = __lsx_vsran_h_w (__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]) = 0x002affd600000001; + *((unsigned long *)&__m128i_op1[0]) = 0xcbc2723a4f12a5f8; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x8080808000000035; + __m128i_out = __lsx_vsran_w_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_vsran_b_h (__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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsran_w_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000100000100; + *((unsigned long *)&__m128i_op0[0]) = 0x00000001000000ff; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x00ff80ff00ff80ff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000010000000000; + __m128i_out = __lsx_vsran_w_d (__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_vsran_b_h (__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]) = 0x7ff000ff6220c0c1; + *((unsigned long *)&__m128i_op1[0]) = 0xffe8081000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xb110606000000000; + __m128i_out = __lsx_vsran_w_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]) = 0x0000800000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000800000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsran_h_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_vsran_b_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_vsran_h_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0037ffd40083ffe5; + *((unsigned long *)&__m128i_op0[0]) = 0x001e0052001ffff9; + *((unsigned long *)&__m128i_op1[1]) = 0x001effae001effae; + *((unsigned long *)&__m128i_op1[0]) = 0x001effae001effae; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00df020f0078007f; + __m128i_out = __lsx_vsran_h_w (__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]) = 0xffffffffc105d1aa; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffbc19ecca; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xffffe03ff63ff9bf; + __m128i_out = __lsx_vsran_w_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x06d9090909090909; + *((unsigned long *)&__m128i_op1[1]) = 0x0039d21e3229d4e8; + *((unsigned long *)&__m128i_op1[0]) = 0x6d339b4f3b439885; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x000000000db24848; + __m128i_out = __lsx_vsran_h_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffff80000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xfe3bfb01fe3bfe01; + *((unsigned long *)&__m128i_op1[0]) = 0xfe03fe3ffe01fa21; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xffff000000000000; + __m128i_out = __lsx_vsran_h_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_vsran_b_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-vsrani.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsrani.c new file mode 100644 index 00000000000..92988035d8f --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsrani.c @@ -0,0 +1,246 @@ +/* { 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]) = 0x0000000b0000000b; + *((unsigned long *)&__m128i_op0[0]) = 0x000201000000000b; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0005000501800005; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrani_b_h (__m128i_op0, __m128i_op1, 0x1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x438ff81ff81ff820; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x03ff03ff03ff03ff; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000043; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000003; + __m128i_out = __lsx_vsrani_d_q (__m128i_op0, __m128i_op1, 0x78); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000002020202; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrani_d_q (__m128i_op0, __m128i_op1, 0x5b); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000008; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffff00000009; + *((unsigned long *)&__m128i_op1[1]) = 0x697eba2bedfa9c82; + *((unsigned long *)&__m128i_op1[0]) = 0xd705c77a7025c899; + *((unsigned long *)&__m128i_result[1]) = 0x00000000ffff0000; + *((unsigned long *)&__m128i_result[0]) = 0x03fdfffcfefe03fe; + __m128i_out = __lsx_vsrani_b_h (__m128i_op0, __m128i_op1, 0xd); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0100000001000100; + *((unsigned long *)&__m128i_op0[0]) = 0x0100010000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x00ffffff00ff00ff; + *((unsigned long *)&__m128i_op1[0]) = 0x00ff00ffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000010001000000; + *((unsigned long *)&__m128i_result[0]) = 0xffff00ff00ffffff; + __m128i_out = __lsx_vsrani_h_w (__m128i_op0, __m128i_op1, 0x0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrani_b_h (__m128i_op0, __m128i_op1, 0xa); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x40f0001000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x40f0001000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x1e0200001e020000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrani_b_h (__m128i_op0, __m128i_op1, 0x3); + 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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0040004000400040; + __m128i_out = __lsx_vsrani_w_d (__m128i_op0, __m128i_op1, 0x15); + 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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000040000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrani_d_q (__m128i_op0, __m128i_op1, 0xe); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x001ffce00016fb41; + *((unsigned long *)&__m128i_op0[0]) = 0x57cb857100001a46; + *((unsigned long *)&__m128i_op1[1]) = 0xfbffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0x7bffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000150000; + *((unsigned long *)&__m128i_result[0]) = 0xfffeffff001effff; + __m128i_out = __lsx_vsrani_h_w (__m128i_op0, __m128i_op1, 0x1a); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + unsigned_int_out = __lsx_vpickve2gr_wu (__m128i_op0, 0x1); + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x2020202020202020; + *((unsigned long *)&__m128i_op1[0]) = 0x2020202020207fff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x01010101010101ff; + __m128i_out = __lsx_vsrani_b_h (__m128i_op0, __m128i_op1, 0x5); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xfff082f000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x003f000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xffff000000000000; + __m128i_out = __lsx_vsrani_h_w (__m128i_op0, __m128i_op1, 0x17); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrani_h_w (__m128i_op0, __m128i_op1, 0x6); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00005dcbe7e830c0; + *((unsigned long *)&__m128i_op0[0]) = 0x03f21e0114bf19da; + *((unsigned long *)&__m128i_op1[1]) = 0x000003f200001e01; + *((unsigned long *)&__m128i_op1[0]) = 0x000014bf000019da; + *((unsigned long *)&__m128i_result[1]) = 0x0005fe0300010101; + *((unsigned long *)&__m128i_result[0]) = 0x0000000100010001; + __m128i_out = __lsx_vsrani_b_h (__m128i_op0, __m128i_op1, 0xc); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00ff00ff00ff00ff; + *((unsigned long *)&__m128i_op0[0]) = 0x00ff00ff00ff00ff; + *((unsigned long *)&__m128i_op1[1]) = 0x62cbf96e4acfaf40; + *((unsigned long *)&__m128i_op1[0]) = 0xf0bc9a5278285a4a; + *((unsigned long *)&__m128i_result[1]) = 0x00ff00ff00ff00ff; + *((unsigned long *)&__m128i_result[0]) = 0x62cbf96e4acfaf40; + __m128i_out = __lsx_vsrani_d_q (__m128i_op0, __m128i_op1, 0x40); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfffffacdb6dbecac; + *((unsigned long *)&__m128i_op0[0]) = 0x1f5533a694f902c0; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x1f54e0ab00000000; + *((unsigned long *)&__m128i_result[1]) = 0xfffffb6d01f5f94f; + *((unsigned long *)&__m128i_result[0]) = 0x0000000001f50000; + __m128i_out = __lsx_vsrani_h_w (__m128i_op0, __m128i_op1, 0x14); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrani_w_d (__m128i_op0, __m128i_op1, 0x1f); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x808080e280808080; + *((unsigned long *)&__m128i_op1[0]) = 0x8080636380806363; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x8080808080638063; + __m128i_out = __lsx_vsrani_b_h (__m128i_op0, __m128i_op1, 0x8); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x000000000000001d; + *((unsigned long *)&__m128i_op1[0]) = 0x000000000000001d; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrani_d_q (__m128i_op0, __m128i_op1, 0x63); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0f07697100000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000076971000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrani_w_d (__m128i_op0, __m128i_op1, 0x14); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000003020302; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffff81; + *((unsigned long *)&__m128i_result[1]) = 0x00000c0c00000000; + *((unsigned long *)&__m128i_result[0]) = 0xfffffffffffffffe; + __m128i_out = __lsx_vsrani_b_h (__m128i_op0, __m128i_op1, 0x6); + 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]) = 0x0000000000000000; + __m128i_out = __lsx_vsrani_d_q (__m128i_op0, __m128i_op1, 0x58); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfffffffffffffffc; + *((unsigned long *)&__m128i_op0[0]) = 0xfffffffffffffffc; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffff00000000; + __m128i_out = __lsx_vsrani_w_d (__m128i_op0, __m128i_op1, 0x3a); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrani_b_h (__m128i_op0, __m128i_op1, 0xa); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x5847b72626ce61ef; + *((unsigned long *)&__m128i_op0[0]) = 0x110053f401e7cced; + *((unsigned long *)&__m128i_op1[1]) = 0x5847b72626ce61ef; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0005847b00011005; + *((unsigned long *)&__m128i_result[0]) = 0x0005847b00000000; + __m128i_out = __lsx_vsrani_w_d (__m128i_op0, __m128i_op1, 0x2c); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsrar.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsrar.c new file mode 100644 index 00000000000..6a842d9ce3e --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsrar.c @@ -0,0 +1,354 @@ +/* { 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]) = 0xff02ff1bff02ff23; + *((unsigned long *)&__m128i_op1[0]) = 0x0000ffffff02fff4; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrar_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_vsrar_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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffff01ff01; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrar_w (__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_vsrar_b (__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]) = 0xff00ff00ff00ff00; + *((unsigned long *)&__m128i_result[0]) = 0xff00ff00ff00ff00; + __m128i_out = __lsx_vsrar_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]) = 0x0000000000400000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrar_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]) = 0x00000001fffffffe; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffff0000000002; + *((unsigned long *)&__m128i_result[0]) = 0x00000000c2bac2c2; + __m128i_out = __lsx_vsrar_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]) = 0x7fff7fff7fff7fff; + *((unsigned long *)&__m128i_result[0]) = 0x000000010000003f; + __m128i_out = __lsx_vsrar_b (__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]) = 0x00007fff00007fff; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_result[0]) = 0x4f804f804f804f80; + __m128i_out = __lsx_vsrar_d (__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]) = 0x0000000800000008; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000008000000080; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrar_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]) = 0x7ff0000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x7ff0000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrar_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x80010001b57fc565; + *((unsigned long *)&__m128i_op0[0]) = 0x8001000184000be0; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x80010001b57fc565; + *((unsigned long *)&__m128i_result[0]) = 0x8001000184000be0; + __m128i_out = __lsx_vsrar_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]) = 0x0bd80bd80bdfffff; + *((unsigned long *)&__m128i_op1[0]) = 0x0bd80bd80bd80000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrar_b (__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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000006f00001f0a; + *((unsigned long *)&__m128i_result[0]) = 0x0000958affff995d; + __m128i_out = __lsx_vsrar_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_vsrar_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000080000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000080000000000; + __m128i_out = __lsx_vsrar_b (__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]) = 0x00000000000000bf; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000000002bb; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xc0fffff000000000; + __m128i_out = __lsx_vsrar_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffb96bffff57c9; + *((unsigned long *)&__m128i_op0[0]) = 0xffff6080ffff4417; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffb96bffff57c9; + *((unsigned long *)&__m128i_result[0]) = 0xffff6080ffff4417; + __m128i_out = __lsx_vsrar_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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0xfffffffffffffff0; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000001; + __m128i_out = __lsx_vsrar_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffff0000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x3fbf3fbf00007fff; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrar_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000003a0000003a; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000003a0000003a; + __m128i_out = __lsx_vsrar_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_vsrar_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0086000000040000; + *((unsigned long *)&__m128i_op0[0]) = 0x0082000000000007; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000ffff0000; + *((unsigned long *)&__m128i_result[1]) = 0x0086000000040000; + *((unsigned long *)&__m128i_result[0]) = 0x0082000000000007; + __m128i_out = __lsx_vsrar_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_vsrar_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]) = 0xffffe000ffffe000; + *((unsigned long *)&__m128i_op1[0]) = 0x467f6080467d607f; + *((unsigned long *)&__m128i_result[1]) = 0x0000ffff0000ffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrar_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0037ffc8d7ff2800; + *((unsigned long *)&__m128i_op0[0]) = 0xff00000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0101010101010101; + *((unsigned long *)&__m128i_op1[0]) = 0x0101010101010101; + *((unsigned long *)&__m128i_result[1]) = 0x001bffe4ebff9400; + *((unsigned long *)&__m128i_result[0]) = 0xff80000000000000; + __m128i_out = __lsx_vsrar_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x2a29282726252423; + *((unsigned long *)&__m128i_op0[0]) = 0x2221201f1e1d1c1b; + *((unsigned long *)&__m128i_op1[1]) = 0x2a29282726252423; + *((unsigned long *)&__m128i_op1[0]) = 0x2221201f1e1d1c1b; + *((unsigned long *)&__m128i_result[1]) = 0x0000000005452505; + *((unsigned long *)&__m128i_result[0]) = 0x00000004442403e4; + __m128i_out = __lsx_vsrar_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x7fff7fff7fff7fff; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0x7fff7fff7fff7fff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0100010001000100; + __m128i_out = __lsx_vsrar_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + int_out = __lsx_vpickve2gr_w (__m128i_op0, 0x0); + *((unsigned long *)&__m128i_op0[1]) = 0x0000000200000002; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000200000002; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000200000002; + *((unsigned long *)&__m128i_result[0]) = 0x0000000200000002; + __m128i_out = __lsx_vsrar_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffc0ff80ff800000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000005; + *((unsigned long *)&__m128i_op1[1]) = 0x00000c0c00000000; + *((unsigned long *)&__m128i_op1[0]) = 0xfffffffffffffffe; + *((unsigned long *)&__m128i_result[1]) = 0xffc00000ff800000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrar_h (__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]) = 0xffffffffe4866c86; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffe4866c86; + *((unsigned long *)&__m128i_result[1]) = 0x0001000002000000; + *((unsigned long *)&__m128i_result[0]) = 0x0001000002000000; + __m128i_out = __lsx_vsrar_h (__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]) = 0xfffffffffffffffe; + *((unsigned long *)&__m128i_op1[0]) = 0x7f7f7f7f7f7f7f7f; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrar_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_vsrar_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_vsrar_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x8000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x1748c4f9ed1a5870; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x8000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x1748c4f9ed1a5870; + __m128i_out = __lsx_vsrar_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x680485c8b304b019; + *((unsigned long *)&__m128i_op0[0]) = 0xc89d7f0ff90da019; + *((unsigned long *)&__m128i_op1[1]) = 0x680485c8b304b019; + *((unsigned long *)&__m128i_op1[0]) = 0xc89d7f0ff90da019; + *((unsigned long *)&__m128i_result[1]) = 0x00680486ffffffda; + *((unsigned long *)&__m128i_result[0]) = 0xffff913bfffffffd; + __m128i_out = __lsx_vsrar_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]) = 0xcd636363cd636363; + *((unsigned long *)&__m128i_op1[0]) = 0xcd636363cd636363; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrar_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-vsrari.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsrari.c new file mode 100644 index 00000000000..2a353d65acb --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsrari.c @@ -0,0 +1,265 @@ +/* { 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_vsrari_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_vsrari_h (__m128i_op0, 0xd); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x000000000000cb4a; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x000000000000f909; + __m128i_out = __lsx_vsrari_b (__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_vsrari_d (__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_vsrari_b (__m128i_op0, 0x6); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0080000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xf4b6f3f52f4ef4a8; + *((unsigned long *)&__m128i_result[1]) = 0x0001000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xfff5fff4002ffff5; + __m128i_out = __lsx_vsrari_h (__m128i_op0, 0x8); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffc0ff81000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xfffffff0ffe04000; + __m128i_out = __lsx_vsrari_w (__m128i_op0, 0xa); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffe5; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffe5; + *((unsigned long *)&__m128i_result[1]) = 0x00000000000000f3; + *((unsigned long *)&__m128i_result[0]) = 0x00000000000000f3; + __m128i_out = __lsx_vsrari_b (__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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrari_w (__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_vsrari_w (__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_vsrari_w (__m128i_op0, 0xc); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_op0[0]) = 0xfffff00010000fff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000100; + __m128i_out = __lsx_vsrari_w (__m128i_op0, 0x14); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffff000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000958affff995d; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000fdfc0000fd03; + __m128i_out = __lsx_vsrari_b (__m128i_op0, 0x5); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000017161515; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000095141311; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrari_d (__m128i_op0, 0x34); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x21201f1e19181716; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x00000109000000c9; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrari_w (__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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrari_w (__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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrari_b (__m128i_op0, 0x0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x77c0404a4000403a; + *((unsigned long *)&__m128i_op0[0]) = 0x77c03fd640003fc6; + *((unsigned long *)&__m128i_result[1]) = 0x00f0008100800080; + *((unsigned long *)&__m128i_result[0]) = 0x00f0008000800080; + __m128i_out = __lsx_vsrari_h (__m128i_op0, 0x7); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000006c80031; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrari_d (__m128i_op0, 0x3c); + 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_vsrari_b (__m128i_op0, 0x1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000000000a6; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrari_h (__m128i_op0, 0xc); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0001200100012001; + *((unsigned long *)&__m128i_op0[0]) = 0x0001000100010001; + *((unsigned long *)&__m128i_result[1]) = 0x0000080000000800; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrari_b (__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_vsrari_d (__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_vsrari_b (__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_vsrari_b (__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_vsrari_w (__m128i_op0, 0x1); + 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]) = 0x0000000000000000; + __m128i_out = __lsx_vsrari_w (__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_vsrari_w (__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_vsrari_w (__m128i_op0, 0x12); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000202020200; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000100; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000404040; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000020; + __m128i_out = __lsx_vsrari_w (__m128i_op0, 0x3); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x30eb020302101b03; + *((unsigned long *)&__m128i_op0[0]) = 0x020310d0c0030220; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrari_b (__m128i_op0, 0x7); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x004d004d004d004d; + *((unsigned long *)&__m128i_op0[0]) = 0x004d004d004d004d; + *((unsigned long *)&__m128i_result[1]) = 0x0001340134013401; + *((unsigned long *)&__m128i_result[0]) = 0x0001340134013401; + __m128i_out = __lsx_vsrari_d (__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_vsrari_b (__m128i_op0, 0x6); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrari_w (__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_vsrari_h (__m128i_op0, 0x8); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsrarn.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsrarn.c new file mode 100644 index 00000000000..60d47420346 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsrarn.c @@ -0,0 +1,236 @@ +/* { 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]) = 0xffffffefffffffef; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffefffffffef; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xffffffefffffffef; + __m128i_out = __lsx_vsrarn_w_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_vsrarn_b_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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrarn_b_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]) = 0xfffffffffffffff1; + *((unsigned long *)&__m128i_op1[0]) = 0xfffffffffffffff1; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrarn_h_w (__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]) = 0x00000001fffffffe; + *((unsigned long *)&__m128i_op1[0]) = 0x00000001fffffffe; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xff000000fefb0000; + __m128i_out = __lsx_vsrarn_b_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]) = 0x0000000000000200; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000200; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vsrarn_w_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]) = 0xc2f9bafac2fac2fa; + __m128i_out = __lsx_vsrarn_h_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]) = 0xffffffff00000004; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffff0204; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrarn_w_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_vsrarn_b_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]) = 0xfffefffefffefffe; + *((unsigned long *)&__m128i_op1[0]) = 0xfffefffefffefffe; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrarn_w_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x01203f1e3d1c3b1a; + *((unsigned long *)&__m128i_op0[0]) = 0x3918371635143312; + *((unsigned long *)&__m128i_op1[1]) = 0x000000000001d5d4; + *((unsigned long *)&__m128i_op1[0]) = 0x000000150d707009; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x03f1e3d28b1a8a1a; + __m128i_out = __lsx_vsrarn_w_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]) = 0xfffefffefffeffff; + *((unsigned long *)&__m128i_op1[0]) = 0xfffefffefffeffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrarn_w_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_vsrarn_w_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xff7f810100001000; + *((unsigned long *)&__m128i_op0[0]) = 0x001fffc0ffffe001; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000002259662; + *((unsigned long *)&__m128i_op1[0]) = 0xc4dbe60354005d25; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x7f01000000f8ff00; + __m128i_out = __lsx_vsrarn_b_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_vsrarn_b_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_vsrarn_b_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffff6ff4ffff8db8; + *((unsigned long *)&__m128i_op0[0]) = 0xffffbaf4ffffb805; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x9c7c266e71768fa4; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xfff4ffb800ff0080; + __m128i_out = __lsx_vsrarn_b_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000000084d12ce; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000044470000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00004dce00004700; + __m128i_out = __lsx_vsrarn_b_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]) = 0x0b4c600000000002; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrarn_h_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x08080807f5f5f5f8; + *((unsigned long *)&__m128i_op0[0]) = 0x000000000000ff00; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000202020200; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000100; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0202f5f80000ff00; + __m128i_out = __lsx_vsrarn_h_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0d060d060d060d06; + *((unsigned long *)&__m128i_op0[0]) = 0x0d060d060d060d06; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0d060d060d060d06; + __m128i_out = __lsx_vsrarn_h_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_vsrarn_h_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffee; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000011ff040; + *((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_vsrarn_w_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xff01fe03ff01fe03; + *((unsigned long *)&__m128i_op0[0]) = 0xff01fe03ff01fe03; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xff01fe03ff01fe03; + __m128i_out = __lsx_vsrarn_w_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-vsrarni.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsrarni.c new file mode 100644 index 00000000000..3aa23bdc833 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsrarni.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]) = 0x0000000000000004; + *((unsigned long *)&__m128i_op1[1]) = 0x000000000000ffff; + *((unsigned long *)&__m128i_op1[0]) = 0x0000ff020000fff4; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrarni_h_w (__m128i_op0, __m128i_op1, 0x1f); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000000000000ffff; + *((unsigned long *)&__m128i_op0[0]) = 0x0000ff020000fff4; + *((unsigned long *)&__m128i_op1[1]) = 0x7fc0000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x1e801ffc00000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000080007f80800; + *((unsigned long *)&__m128i_result[0]) = 0x0000000001000000; + __m128i_out = __lsx_vsrarni_h_w (__m128i_op0, __m128i_op1, 0x5); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000ff0000ff0000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrarni_d_q (__m128i_op0, __m128i_op1, 0x4b); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000000000001e5; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x5000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrarni_d_q (__m128i_op0, __m128i_op1, 0x4); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0xff80000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0xff8000002f4ef4a8; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x000000000000f4a8; + __m128i_out = __lsx_vsrarni_h_w (__m128i_op0, __m128i_op1, 0x0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00100184017e0032; + *((unsigned long *)&__m128i_op0[0]) = 0x0086018c01360164; + *((unsigned long *)&__m128i_op1[1]) = 0x00000001fffffffe; + *((unsigned long *)&__m128i_op1[0]) = 0xfffffff33c4b1e67; + *((unsigned long *)&__m128i_result[1]) = 0x0000800c0004300c; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrarni_w_d (__m128i_op0, __m128i_op1, 0x25); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000001300000013; + *((unsigned long *)&__m128i_op0[0]) = 0x0000001300000013; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000e0000000e; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000e0000000e; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrarni_b_h (__m128i_op0, __m128i_op1, 0x9); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrarni_d_q (__m128i_op0, __m128i_op1, 0x66); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000800000000; + *((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_vsrarni_h_w (__m128i_op0, __m128i_op1, 0x1a); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000000000000ffff; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000800000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrarni_h_w (__m128i_op0, __m128i_op1, 0x1); + 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]) = 0x0020808100000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrarni_w_d (__m128i_op0, __m128i_op1, 0x29); + 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_vsrarni_d_q (__m128i_op0, __m128i_op1, 0x64); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x00ff00ff00000000; + *((unsigned long *)&__m128i_op1[1]) = 0x001ffff0003ffff0; + *((unsigned long *)&__m128i_op1[0]) = 0x028c026bfff027af; + *((unsigned long *)&__m128i_result[1]) = 0x00000003fc03fc00; + *((unsigned long *)&__m128i_result[0]) = 0xffffc00a3009b000; + __m128i_out = __lsx_vsrarni_d_q (__m128i_op0, __m128i_op1, 0x16); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000000ffa7f8ff81; + *((unsigned long *)&__m128i_op0[0]) = 0x0000003f0080ffc0; + *((unsigned long *)&__m128i_op1[1]) = 0x000000007fff00ff; + *((unsigned long *)&__m128i_op1[0]) = 0x0000a7f87fffff81; + *((unsigned long *)&__m128i_result[1]) = 0x0000ffd400000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000004000000040; + __m128i_out = __lsx_vsrarni_h_w (__m128i_op0, __m128i_op1, 0x19); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x003f800000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x003f800000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x000080003f80ffff; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0002000000020000; + *((unsigned long *)&__m128i_result[0]) = 0x000001fc00000000; + __m128i_out = __lsx_vsrarni_h_w (__m128i_op0, __m128i_op1, 0x15); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffff80010001; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffff80010001; + *((unsigned long *)&__m128i_op1[1]) = 0x0bd80bd80bdfffff; + *((unsigned long *)&__m128i_op1[0]) = 0x0bd80bd80bd80000; + *((unsigned long *)&__m128i_result[1]) = 0x1ffffffff8001000; + *((unsigned long *)&__m128i_result[0]) = 0xf0bd80bd80bd8000; + __m128i_out = __lsx_vsrarni_d_q (__m128i_op0, __m128i_op1, 0x4); + 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]) = 0x0000000000000000; + __m128i_out = __lsx_vsrarni_w_d (__m128i_op0, __m128i_op1, 0x24); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xecec006c00000000; + *((unsigned long *)&__m128i_op0[0]) = 0xecec006c00000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffff007f00000000; + *((unsigned long *)&__m128i_op1[0]) = 0xffff007f00000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrarni_b_h (__m128i_op0, __m128i_op1, 0xe); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x0000001ff85ffdc0; + *((unsigned long *)&__m128i_op1[0]) = 0x0000332ae5d97330; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x1ff85ffe2ae5d973; + __m128i_out = __lsx_vsrarni_w_d (__m128i_op0, __m128i_op1, 0x8); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000000043c5ea7b6; + *((unsigned long *)&__m128i_op0[0]) = 0x00000008fc4ef7b4; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x00000fea0000fffe; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrarni_b_h (__m128i_op0, __m128i_op1, 0xa); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrarni_d_q (__m128i_op0, __m128i_op1, 0x48); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000000dfa6e0c6; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000d46cdc13; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrarni_d_q (__m128i_op0, __m128i_op1, 0x64); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x09e8e9012fded7fd; + *((unsigned long *)&__m128i_op0[0]) = 0x479f64b03373df61; + *((unsigned long *)&__m128i_op1[1]) = 0x04c0044a0400043a; + *((unsigned long *)&__m128i_op1[0]) = 0x04c004d6040004c6; + *((unsigned long *)&__m128i_result[1]) = 0x1d20db00ec967bec; + *((unsigned long *)&__m128i_result[0]) = 0x00890087009b0099; + __m128i_out = __lsx_vsrarni_h_w (__m128i_op0, __m128i_op1, 0x3); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000080800000808; + *((unsigned long *)&__m128i_op1[0]) = 0x0000080800000808; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x8080000180800001; + __m128i_out = __lsx_vsrarni_w_d (__m128i_op0, __m128i_op1, 0xc); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x000000000000003e; + *((unsigned long *)&__m128i_op1[1]) = 0x00fe00fe000200fe; + *((unsigned long *)&__m128i_op1[0]) = 0x00fe00fe000200fe; + *((unsigned long *)&__m128i_result[1]) = 0x000000000000003e; + *((unsigned long *)&__m128i_result[0]) = 0xfefe02fefefe02fe; + __m128i_out = __lsx_vsrarni_b_h (__m128i_op0, __m128i_op1, 0x0); + 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_vsrarni_b_h (__m128i_op0, __m128i_op1, 0xc); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000200000002000; + *((unsigned long *)&__m128i_op0[0]) = 0x1000000010000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000020000; + *((unsigned long *)&__m128i_op1[0]) = 0x0103000201030002; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrarni_w_d (__m128i_op0, __m128i_op1, 0x3f); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrarni_w_d (__m128i_op0, __m128i_op1, 0x26); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000f0000000f; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000f0000000f; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000f0000000f; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000f0000000f; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrarni_h_w (__m128i_op0, __m128i_op1, 0x11); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xfffc000400000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x00003fff00010000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrarni_d_q (__m128i_op0, __m128i_op1, 0x12); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrarni_d_q (__m128i_op0, __m128i_op1, 0x6d); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000ff010000ff01; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrarni_h_w (__m128i_op0, __m128i_op1, 0x19); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrarni_w_d (__m128i_op0, __m128i_op1, 0x5); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrarni_h_w (__m128i_op0, __m128i_op1, 0xf); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xcd636363cd636363; + *((unsigned long *)&__m128i_op0[0]) = 0xcd636363cd636363; + *((unsigned long *)&__m128i_op1[1]) = 0xcd636363cd636363; + *((unsigned long *)&__m128i_op1[0]) = 0xcd636363cd636363; + *((unsigned long *)&__m128i_result[1]) = 0xf359f359f359f359; + *((unsigned long *)&__m128i_result[0]) = 0xf359f359f359f359; + __m128i_out = __lsx_vsrarni_h_w (__m128i_op0, __m128i_op1, 0x12); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000016; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000016; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrarni_b_h (__m128i_op0, __m128i_op1, 0x7); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrarni_w_d (__m128i_op0, __m128i_op1, 0x1b); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((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_vsrarni_h_w (__m128i_op0, __m128i_op1, 0x4); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x01533b5e7489ae24; + *((unsigned long *)&__m128i_op0[0]) = 0xffffab7e71e33848; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xce9135c49ffff570; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrarni_d_q (__m128i_op0, __m128i_op1, 0x23); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000807bf0a1f80; + *((unsigned long *)&__m128i_op0[0]) = 0x00000800ecedee68; + *((unsigned long *)&__m128i_op1[1]) = 0x0005840100000005; + *((unsigned long *)&__m128i_op1[0]) = 0x0005847b00000000; + *((unsigned long *)&__m128i_result[1]) = 0x0001f0a20001cedf; + *((unsigned long *)&__m128i_result[0]) = 0x0058000000580000; + __m128i_out = __lsx_vsrarni_h_w (__m128i_op0, __m128i_op1, 0xc); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffb1fb1000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xf2c97aaa7d8fa270; + *((unsigned long *)&__m128i_op1[0]) = 0x0b73e427f7cfcb88; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsrarni_w_d (__m128i_op0, __m128i_op1, 0x3f); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0a545374471b7070; + *((unsigned long *)&__m128i_op0[0]) = 0x274f4f0648145f50; + *((unsigned long *)&__m128i_op1[1]) = 0x4f4f4f4f4f4f4f4f; + *((unsigned long *)&__m128i_op1[0]) = 0x4f4f4f4f4f4f4f4f; + *((unsigned long *)&__m128i_result[1]) = 0xa8a736e19e9e28bf; + *((unsigned long *)&__m128i_result[0]) = 0x9e9f9e9f9e9f9e9f; + __m128i_out = __lsx_vsrarni_h_w (__m128i_op0, __m128i_op1, 0x7); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} From patchwork Wed Sep 13 03:35:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: chenxiaolong X-Patchwork-Id: 138594 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9ecd:0:b0:3f2:4152:657d with SMTP id t13csp833533vqx; Tue, 12 Sep 2023 20:45:46 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF712lgF40ldtJaHT5yo/W9JgBIqt+F968pbnzc+GliXc4ZDe+MPiTnqnn5dBL8RtrwO738 X-Received: by 2002:a17:907:2ccb:b0:9a2:292d:ea63 with SMTP id hg11-20020a1709072ccb00b009a2292dea63mr824960ejc.37.1694576746535; Tue, 12 Sep 2023 20:45:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694576746; cv=none; d=google.com; s=arc-20160816; b=zBxdBM9cQfy8wwefCTUpwSGB34GUFerr4gZ8XoYn/GeLJv5saoPefKjoFPXenDgVkJ A6WhiT23qmBK0OvuiitUQ5nt0BY4vJ4Rs+HPwOpeZMshCyx+GC6oezq3WuBZ24cN8yV+ 80eV1Qo+QYcAFyit5WFBDTH+LsIOKOetA9ynltBBW/x6bdIKvP/gHrIK1bXedq8m2QAG kbudcuP7EVgIbXh/MaKDInwErmn4KnFMEQOO2resGOU0vQvE3Dczx11trxfeZTNQOGAB NxWsbYCGn13qd/+Hx5mzXtgV1EbEvYJb944eQUvtcL5nXnJKgiS+6nbkMGGkP6mF8TGL mb8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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:cc:to :from:dmarc-filter:delivered-to; bh=QhMO7CVAU6gnxNUZy/C1yGg+zkGMiWiH3Dl8iibKeJA=; fh=3pFUYcpS/27XRzOf17GfR86AuNQu+P1CET04YURgCLs=; b=Ft9e55tEo/L5Sj3yX5iGOtpa9qZ1AGxdzgqVphLTtGXZQe7xxri7NS4Zpy877hB1cg T0L0vcnIbwq/ZDJjDQTlwaZjKZaoDXPLBSOKUuwcA/bEdANLyVwvyBs9Y9nybltUA7JX jLUNb3ThK9obCBIKxtb34SXIJo6tfPrglzOnAPCYdxcV3tzQaF1pEtVUr8NO1GoW9qmK YPslXgFN8dp+80/m4WT8m4hZQ53pB0PnO1yBZrsSY+iTb3F5e5f1xfpqzayRRuc2tqzA oEv1ac8HYput+2lfU2V110OLuSR+RZxjburVsrSIRcORF3nzT8MouGb2lHJK2g9nXBmY uX5A== 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 qc12-20020a170906d8ac00b00988b2dfc3b3si10857185ejb.517.2023.09.12.20.45.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Sep 2023 20:45:46 -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 0F9DA3948A68 for ; Wed, 13 Sep 2023 03:37:17 +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 09837383138B for ; Wed, 13 Sep 2023 03:35:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 09837383138B 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 1qgGfG-0003AB-Jk for gcc-patches@gcc.gnu.org; Tue, 12 Sep 2023 23:35:48 -0400 Received: from loongson.cn (unknown [10.10.130.252]) by gateway (Coremail) with SMTP id _____8AxjusLLgFl1DAmAA--.6046S3; Wed, 13 Sep 2023 11:35:39 +0800 (CST) Received: from slurm-master.loongson.cn (unknown [10.10.130.252]) by localhost.localdomain (Coremail) with SMTP id AQAAf8Cx7y_8LQFlvA8CAA--.3484S10; Wed, 13 Sep 2023 11:35:38 +0800 (CST) From: Xiaolong Chen To: gcc-patches@gcc.gnu.org Cc: xry111@xry111.site, i@xen0n.name, xuchenghua@loongson.cn, chenglulu@loongson.cn, Xiaolong Chen Subject: [PATCH v4 16/23] LoongArch: Add tests for SX vector vssran/vssrani/vssrarn/vssrarni/vssrln /vssrlni/vssrlrn/vssrlrni instructions. Date: Wed, 13 Sep 2023 11:35:19 +0800 Message-Id: <20230913033522.5983-7-chenxiaolong@loongson.cn> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230913033522.5983-1-chenxiaolong@loongson.cn> References: <20230913033522.5983-1-chenxiaolong@loongson.cn> MIME-Version: 1.0 X-CM-TRANSID: AQAAf8Cx7y_8LQFlvA8CAA--.3484S10 X-CM-SenderInfo: hfkh05xldrz0tqj6z05rqj20fqof0/1tbiAQANBWUBHCIBDQAAsf X-Coremail-Antispam: 1Uk129KBj98XoW3Jr45Kr1fWF48WoXrpryrtFyDJoWUAa4UZw 4rCFZxJ3W5Jw13Z34fKr1Yk3Zakr17Awn0yw4Dtw4Ivry7ZFs8JF1Utw1ayry7Zw13Xr4x J348Ar1kl-sFpf9Il3svdjkaLaAFLSUrUUUUbb8apTn2vfkv8UJUUUU8wcxFpf9Il3svdx BIdaVrn0xqx4xG64xvF2IEw4CE5I8CrVC2j2Jv73VFW2AGmfu7bjvjm3AaLaJ3UjIYCTnI Wjp_UUUYn7kC6x804xWl14x267AKxVWUJVW8JwAFc2x0x2IEx4CE42xK8VAvwI8IcIk0rV WrJVCq3wAFIxvE14AKwVWUJVWUGwA2ocxC64kIII0Yj41l84x0c7CEw4AK67xGY2AK021l 84ACjcxK6xIIjxv20xvE14v26F1j6w1UM28EF7xvwVC0I7IYx2IY6xkF7I0E14v26F4j6r 4UJwA2z4x0Y4vEx4A2jsIE14v26r4UJVWxJr1l84ACjcxK6I8E87Iv6xkF7I0E14v26r4U JVWxJr1le2I262IYc4CY6c8Ij28IcVAaY2xG8wAqjxCEc2xF0cIa020Ex4CE44I27wAqx4 xG64xvF2IEw4CE5I8CrVC2j2WlYx0E2Ix0cI8IcVAFwI0_Wrv_ZF1lYx0Ex4A2jsIE14v2 6F4j6r4UJwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IYc2Ij64vIr41l42xK82IYc2Ij64 vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2IqxVAqx4xG67AKxVWUJVWUGwC20s026x8G jcxK67AKxVWUGVWUWwC2zVAF1VAY17CE14v26r126r1DMIIYrxkI7VAKI48JMIIF0xvE2I x0cI8IcVAFwI0_Ar0_tr1lIxAIcVC0I7IYx2IY6xkF7I0E14v26r4j6F4UMIIF0xvE42xK 8VAvwI8IcIk0rVWUJVWUCwCI42IY6I8E87Iv67AKxVW8JVWxJwCI42IY6I8E87Iv6xkF7I 0E14v26r4j6r4UJbIYCTnIWIevJa73UjIFyTuYvjxUcD73DUUUU 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: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1776892506876481948 X-GMAIL-MSGID: 1776892506876481948 gcc/testsuite/ChangeLog: * gcc.target/loongarch/vector/lsx/lsx-vssran.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vssrani.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vssrarn.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vssrarni.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vssrln.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vssrlni.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vssrlrn.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vssrlrni.c: New test. --- .../loongarch/vector/lsx/lsx-vssran.c | 390 ++++++++ .../loongarch/vector/lsx/lsx-vssrani.c | 679 ++++++++++++++ .../loongarch/vector/lsx/lsx-vssrarn.c | 669 ++++++++++++++ .../loongarch/vector/lsx/lsx-vssrarni.c | 848 ++++++++++++++++++ .../loongarch/vector/lsx/lsx-vssrln.c | 543 +++++++++++ .../loongarch/vector/lsx/lsx-vssrlni.c | 668 ++++++++++++++ .../loongarch/vector/lsx/lsx-vssrlrn.c | 470 ++++++++++ .../loongarch/vector/lsx/lsx-vssrlrni.c | 597 ++++++++++++ 8 files changed, 4864 insertions(+) create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vssran.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vssrani.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vssrarn.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vssrarni.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vssrln.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vssrlni.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vssrlrn.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vssrlrni.c diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vssran.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vssran.c new file mode 100644 index 00000000000..e45ca36f088 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vssran.c @@ -0,0 +1,390 @@ +/* { 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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssran_wu_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]) = 0x003f00000000003f; + *((unsigned long *)&__m128i_op1[0]) = 0x003f000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssran_bu_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_vssran_w_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]) = 0x000000017fff9000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000210011084; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssran_b_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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssran_h_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000001000001; + *((unsigned long *)&__m128i_op0[0]) = 0x0001000100000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffc000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x000000007fff0000; + __m128i_out = __lsx_vssran_h_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfffffefffffffeff; + *((unsigned long *)&__m128i_op0[0]) = 0xfffffffffffffcff; + *((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_vssran_b_h (__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]) = 0x8000000080000000; + __m128i_out = __lsx_vssran_w_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_vssran_b_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x02b504f305a5c091; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x02b504f305a5c091; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00000000005602d2; + __m128i_out = __lsx_vssran_h_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000000003f80b0; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000ff800000; + *((unsigned long *)&__m128i_op1[1]) = 0xb327b9363c992b2e; + *((unsigned long *)&__m128i_op1[0]) = 0xa1e7b475d925730f; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x000000000001ff00; + __m128i_out = __lsx_vssran_wu_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]) = 0x0060e050007f0160; + *((unsigned long *)&__m128i_op1[0]) = 0x0040007fff800000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vssran_h_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00ffffff00ff00ff; + *((unsigned long *)&__m128i_op0[0]) = 0x00ff00ffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x1268f057137a0267; + *((unsigned long *)&__m128i_op1[0]) = 0x0048137ef886fae0; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000100000000; + __m128i_out = __lsx_vssran_bu_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_vssran_w_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]) = 0x0141010101410101; + *((unsigned long *)&__m128i_op1[0]) = 0x0141010101410101; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssran_wu_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_vssran_h_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_vssran_w_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]) = 0x75b043c4d17db125; + *((unsigned long *)&__m128i_op1[0]) = 0xeef8227b4f8017b1; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x027c027c000027c0; + __m128i_out = __lsx_vssran_wu_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_vssran_w_d (__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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000006f00000000; + __m128i_out = __lsx_vssran_h_w (__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]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xffffffff00000000; + __m128i_out = __lsx_vssran_w_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]) = 0xffffffff994db09c; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffc7639d96; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssran_wu_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_vssran_w_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_vssran_w_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x4040404040404040; + *((unsigned long *)&__m128i_op0[0]) = 0x4040404040404040; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xffffffff00000000; + __m128i_out = __lsx_vssran_bu_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0fff0fff0fff0fff; + *((unsigned long *)&__m128i_op0[0]) = 0x0fff0fff0fff0fff; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000010; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vssran_bu_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + unsigned_int_out = __lsx_vpickve2gr_bu (__m128i_op0, 0x9); + *((unsigned long *)&__m128i_op0[1]) = 0x8000000080000000; + *((unsigned long *)&__m128i_op0[0]) = 0x7f80000080000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x800080007f008000; + __m128i_out = __lsx_vssran_b_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000695d00009b8f; + *((unsigned long *)&__m128i_op0[0]) = 0x000074f20000d272; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x00001f5400000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00ff000000ff0000; + __m128i_out = __lsx_vssran_bu_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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssran_wu_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00010000fffffffc; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000004; + *((unsigned long *)&__m128i_op1[1]) = 0x00010000fffffffc; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000004; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000ffff00000000; + __m128i_out = __lsx_vssran_b_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x31b1777777777776; + *((unsigned long *)&__m128i_op0[0]) = 0x6eee282828282829; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x000000006362ffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xffffffff00000000; + __m128i_out = __lsx_vssran_wu_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]) = 0x40eff02383e383e4; + *((unsigned long *)&__m128i_op1[0]) = 0x7ff0000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000800000007fff; + __m128i_out = __lsx_vssran_h_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfffb00fdfdf7ffff; + *((unsigned long *)&__m128i_op0[0]) = 0xfff8000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0x7fff7fff7fff7fff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssran_hu_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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssran_bu_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]) = 0x00000c0c00000000; + *((unsigned long *)&__m128i_op1[0]) = 0xfffffffffffffffe; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssran_h_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]) = 0x0000000000000080; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssran_wu_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_vssran_hu_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_vssran_b_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000a74aa8a55ab; + *((unsigned long *)&__m128i_op0[0]) = 0x6adeb5dfcb000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0a7480007fff8000; + __m128i_out = __lsx_vssran_h_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000fe00fe; + *((unsigned long *)&__m128i_op0[0]) = 0x00fe00fe00fe00fe; + *((unsigned long *)&__m128i_op1[1]) = 0x0000f50000007500; + *((unsigned long *)&__m128i_op1[0]) = 0x00007e1600007d98; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00fe00fe7fffffff; + __m128i_out = __lsx_vssran_w_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x4f4f4f4f4f4f0000; + *((unsigned long *)&__m128i_op0[0]) = 0x4f4f4f4f4f4f0000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x7f7f7f007f7f7f00; + __m128i_out = __lsx_vssran_b_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-vssrani.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vssrani.c new file mode 100644 index 00000000000..7ffcecde71a --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vssrani.c @@ -0,0 +1,679 @@ +/* { 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]) = 0x00001802041b0013; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00000000007f7f02; + __m128i_out = __lsx_vssrani_b_h (__m128i_op0, __m128i_op1, 0x3); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xff7fffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xff7fffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xfffffffffff7ffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrani_d_q (__m128i_op0, __m128i_op1, 0x64); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000010000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000007fff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrani_h_w (__m128i_op0, __m128i_op1, 0x0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrani_h_w (__m128i_op0, __m128i_op1, 0x8); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrani_d_q (__m128i_op0, __m128i_op1, 0x47); + 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]) = 0x0004007c00fc0000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00000000ffffffff; + __m128i_out = __lsx_vssrani_wu_d (__m128i_op0, __m128i_op1, 0xd); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xfffefffefffffffc; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vssrani_b_h (__m128i_op0, __m128i_op1, 0xc); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x7f7f7f7f00107f04; + *((unsigned long *)&__m128i_op0[0]) = 0x7f0000fd7f0000fd; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x7fffffff7fffffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrani_w_d (__m128i_op0, __m128i_op1, 0x1d); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00cf01fe01fe01fe; + *((unsigned long *)&__m128i_op0[0]) = 0x000301de01fe01fe; + *((unsigned long *)&__m128i_op1[1]) = 0x3ff0000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0xfffc002000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0f00000000000000; + __m128i_out = __lsx_vssrani_bu_h (__m128i_op0, __m128i_op1, 0xa); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xe31c86e90cda86f7; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x00000000000000e3; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrani_du_q (__m128i_op0, __m128i_op1, 0x38); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xc39fffff007fffff; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000fe00fd; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xfffff0e700000000; + __m128i_out = __lsx_vssrani_w_d (__m128i_op0, __m128i_op1, 0x32); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffff00000001; + *((unsigned long *)&__m128i_op1[0]) = 0xffffff0000010000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrani_hu_w (__m128i_op0, __m128i_op1, 0x12); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x7ff0000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x7ff0000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xfc01fd1300000001; + *((unsigned long *)&__m128i_op1[0]) = 0xfe00fd1400010000; + *((unsigned long *)&__m128i_result[1]) = 0x7f0000007f000000; + *((unsigned long *)&__m128i_result[0]) = 0x8080000180800100; + __m128i_out = __lsx_vssrani_b_h (__m128i_op0, __m128i_op1, 0x0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000fff7fc01; + *((unsigned long *)&__m128i_op1[1]) = 0x82c539ffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xc72df14afbfafdf9; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x8000000000000000; + __m128i_out = __lsx_vssrani_d_q (__m128i_op0, __m128i_op1, 0x23); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrani_hu_w (__m128i_op0, __m128i_op1, 0x16); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000100000000; + *((unsigned long *)&__m128i_op1[1]) = 0x00000000000000c0; + *((unsigned long *)&__m128i_op1[0]) = 0x00000001ffffff29; + *((unsigned long *)&__m128i_result[1]) = 0x0000000020000000; + *((unsigned long *)&__m128i_result[0]) = 0x000000183fffffe5; + __m128i_out = __lsx_vssrani_w_d (__m128i_op0, __m128i_op1, 0x3); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((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]) = 0x00ff000000ff0000; + __m128i_out = __lsx_vssrani_bu_h (__m128i_op0, __m128i_op1, 0x1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000001; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0xffffff0000000000; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vssrani_d_q (__m128i_op0, __m128i_op1, 0x18); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrani_w_d (__m128i_op0, __m128i_op1, 0x2a); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000fefefe6a; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x000000000000fbf9; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrani_b_h (__m128i_op0, __m128i_op1, 0x6); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x00ff00ff00ff00ff; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x00000000000007f8; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrani_du_q (__m128i_op0, __m128i_op1, 0x2d); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0a000a000a000a00; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrani_d_q (__m128i_op0, __m128i_op1, 0x4d); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x7f007f007f007f00; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x7fff7fff7fff7fff; + *((unsigned long *)&__m128i_op1[0]) = 0x000000030000003f; + *((unsigned long *)&__m128i_result[1]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_result[0]) = 0xffffffff0003003f; + __m128i_out = __lsx_vssrani_hu_w (__m128i_op0, __m128i_op1, 0x0); + 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_vssrani_hu_w (__m128i_op0, __m128i_op1, 0xc); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrani_d_q (__m128i_op0, __m128i_op1, 0x4c); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x11000f2010000e20; + *((unsigned long *)&__m128i_op0[0]) = 0x0f000d200e000c20; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x7fffffff7fffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vssrani_w_d (__m128i_op0, __m128i_op1, 0x6); + 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]) = 0x007b01ec007b3a9e; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000001; + __m128i_out = __lsx_vssrani_b_h (__m128i_op0, __m128i_op1, 0xd); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x00000001fff9fff9; + *((unsigned long *)&__m128i_op1[0]) = 0x00000001fff9fffa; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x007ffe7ffe400000; + __m128i_out = __lsx_vssrani_du_q (__m128i_op0, __m128i_op1, 0x2a); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrani_b_h (__m128i_op0, __m128i_op1, 0xd); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xc485edbcc0000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x000000000000c485; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000010000; + __m128i_out = __lsx_vssrani_du_q (__m128i_op0, __m128i_op1, 0x30); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x21011f3f193d173b; + *((unsigned long *)&__m128i_op0[0]) = 0xff39ff37ff35ff33; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000015d926c7; + *((unsigned long *)&__m128i_op1[0]) = 0x000000000000e41b; + *((unsigned long *)&__m128i_result[1]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x00000000000000ff; + __m128i_out = __lsx_vssrani_b_h (__m128i_op0, __m128i_op1, 0xe); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0101010101010101; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x000000007f7f7f7f; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrani_b_h (__m128i_op0, __m128i_op1, 0x0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000c0c0c0c0; + *((unsigned long *)&__m128i_op1[1]) = 0x0014000100000000; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrani_w_d (__m128i_op0, __m128i_op1, 0x35); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000000000000ff; + *((unsigned long *)&__m128i_op0[0]) = 0x00003f80000000ff; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrani_wu_d (__m128i_op0, __m128i_op1, 0xa); + 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_vssrani_d_q (__m128i_op0, __m128i_op1, 0x4c); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffff00000001; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffee00000004; + *((unsigned long *)&__m128i_op1[1]) = 0x3a3a3a3b3a3a3a3a; + *((unsigned long *)&__m128i_op1[0]) = 0x3a3a00003a3a0000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000003a0000003a; + __m128i_out = __lsx_vssrani_wu_d (__m128i_op0, __m128i_op1, 0x38); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000080000068; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000038003; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000040033; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrani_bu_h (__m128i_op0, __m128i_op1, 0xf); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x00001fff00001fff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000007ffc000; + __m128i_out = __lsx_vssrani_du_q (__m128i_op0, __m128i_op1, 0x12); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000ffffffe0; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x000000000000fff0; + __m128i_out = __lsx_vssrani_b_h (__m128i_op0, __m128i_op1, 0x1); + 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]) = 0x0000004000000040; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrani_h_w (__m128i_op0, __m128i_op1, 0x0); + 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_vssrani_w_d (__m128i_op0, __m128i_op1, 0x28); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x00fe000100cf005f; + *((unsigned long *)&__m128i_op1[0]) = 0x7fff7fff7fff7fff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vssrani_du_q (__m128i_op0, __m128i_op1, 0x7); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000005e94; + *((unsigned long *)&__m128i_op0[0]) = 0x00005e96ffffb402; + *((unsigned long *)&__m128i_op1[1]) = 0x00fe000100cf005f; + *((unsigned long *)&__m128i_op1[0]) = 0x7fff7fff7fff7fff; + *((unsigned long *)&__m128i_result[1]) = 0x00000000000000bd; + *((unsigned long *)&__m128i_result[0]) = 0x0001fc0000fffeff; + __m128i_out = __lsx_vssrani_w_d (__m128i_op0, __m128i_op1, 0x27); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrani_w_d (__m128i_op0, __m128i_op1, 0x13); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000002fffffffb; + *((unsigned long *)&__m128i_op0[0]) = 0x000000010000fffb; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x00000000bffffffe; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrani_du_q (__m128i_op0, __m128i_op1, 0x42); + 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]) = 0x0000000000000000; + __m128i_out = __lsx_vssrani_b_h (__m128i_op0, __m128i_op1, 0xa); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffc0ff80ff800000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000004; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffff0000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrani_b_h (__m128i_op0, __m128i_op1, 0xe); + 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_vssrani_du_q (__m128i_op0, __m128i_op1, 0x79); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + int_out = __lsx_vpickve2gr_w (__m128i_op0, 0x0); + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000777777777777; + *((unsigned long *)&__m128i_op1[0]) = 0xffff7777ffff7777; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x000003bbbbbbbbbb; + __m128i_out = __lsx_vssrani_d_q (__m128i_op0, __m128i_op1, 0x45); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrani_h_w (__m128i_op0, __m128i_op1, 0x15); + 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_vssrani_wu_d (__m128i_op0, __m128i_op1, 0x13); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrani_b_h (__m128i_op0, __m128i_op1, 0x6); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0002000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000014; + *((unsigned long *)&__m128i_op1[1]) = 0x0000ffff00000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0010000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0007fff800000000; + __m128i_out = __lsx_vssrani_w_d (__m128i_op0, __m128i_op1, 0x1d); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x6a5d5b056f2f4978; + *((unsigned long *)&__m128i_op1[0]) = 0x17483c07141b5971; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xd4bade5e2e902836; + __m128i_out = __lsx_vssrani_hu_w (__m128i_op0, __m128i_op1, 0xf); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0010001000000010; + *((unsigned long *)&__m128i_op0[0]) = 0x0010001000100010; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x1000000010001000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrani_hu_w (__m128i_op0, __m128i_op1, 0x8); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00680486ffffffda; + *((unsigned long *)&__m128i_op0[0]) = 0xffff913bb9951901; + *((unsigned long *)&__m128i_op1[1]) = 0x67157b5100005000; + *((unsigned long *)&__m128i_op1[0]) = 0x387c7e0a133f2000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000003; + *((unsigned long *)&__m128i_result[0]) = 0x0c0f000a070f0204; + __m128i_out = __lsx_vssrani_bu_h (__m128i_op0, __m128i_op1, 0xb); + 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]) = 0x8000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x8000000000000000; + __m128i_out = __lsx_vssrani_d_q (__m128i_op0, __m128i_op1, 0xb); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + int_out = __lsx_vpickve2gr_b (__m128i_op0, 0xe); + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x9c7c266e3faa293c; + *((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_vssrani_b_h (__m128i_op0, __m128i_op1, 0xb); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrani_du_q (__m128i_op0, __m128i_op1, 0x30); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrani_d_q (__m128i_op0, __m128i_op1, 0x2e); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x86dd8341b164f12b; + *((unsigned long *)&__m128i_op0[0]) = 0x9611c3985b3159f5; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xff86dd83ff9611c3; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrani_w_d (__m128i_op0, __m128i_op1, 0x28); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xd3259a2984048c23; + *((unsigned long *)&__m128i_op0[0]) = 0xf9796558e39953fd; + *((unsigned long *)&__m128i_op1[1]) = 0x1010111105050000; + *((unsigned long *)&__m128i_op1[0]) = 0x4040000041410101; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000808000020200; + __m128i_out = __lsx_vssrani_wu_d (__m128i_op0, __m128i_op1, 0x2d); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x2e2b34ca59fa4c88; + *((unsigned long *)&__m128i_op1[0]) = 0x3b2c8aefd44be966; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x2e34594c3b000000; + __m128i_out = __lsx_vssrani_bu_h (__m128i_op0, __m128i_op1, 0x8); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xff1afffefec0ec85; + *((unsigned long *)&__m128i_op0[0]) = 0xff1aff6d48ce567f; + *((unsigned long *)&__m128i_op1[1]) = 0xffff80c400000148; + *((unsigned long *)&__m128i_op1[0]) = 0xffff80c1ffffe8de; + *((unsigned long *)&__m128i_result[1]) = 0xffe3ffd8ffe30919; + *((unsigned long *)&__m128i_result[0]) = 0xffff0000ffffffff; + __m128i_out = __lsx_vssrani_h_w (__m128i_op0, __m128i_op1, 0x13); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x1313131313131313; + *((unsigned long *)&__m128i_op0[0]) = 0x1313131313131313; + *((unsigned long *)&__m128i_op1[1]) = 0x34947b4b11684f92; + *((unsigned long *)&__m128i_op1[0]) = 0xd73691661e5b68b4; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffff00000000; + __m128i_out = __lsx_vssrani_wu_d (__m128i_op0, __m128i_op1, 0x19); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x084d1a0907151a3d; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x000007d07fffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00000000000000ff; + __m128i_out = __lsx_vssrani_b_h (__m128i_op0, __m128i_op1, 0xf); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0x0000ffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000014eb54ab; + *((unsigned long *)&__m128i_op1[0]) = 0x14eb6a002a406a00; + *((unsigned long *)&__m128i_result[1]) = 0xe0001fffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x7fffffffffffffff; + __m128i_out = __lsx_vssrani_d_q (__m128i_op0, __m128i_op1, 0x3); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x8000000080000000; + *((unsigned long *)&__m128i_op0[0]) = 0x8000000080000000; + *((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_vssrani_d_q (__m128i_op0, __m128i_op1, 0x60); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfffaf1500000fffa; + *((unsigned long *)&__m128i_op0[0]) = 0x0000f8a40000f310; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x00000000000003e2; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrani_wu_d (__m128i_op0, __m128i_op1, 0x26); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrani_h_w (__m128i_op0, __m128i_op1, 0x0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xf654ad7447e59090; + *((unsigned long *)&__m128i_op0[0]) = 0x27b1b106b8145f50; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrani_wu_d (__m128i_op0, __m128i_op1, 0x3f); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfff8ffa2fffdffb0; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000ff800000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrani_du_q (__m128i_op0, __m128i_op1, 0x50); + 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]) = 0xffff000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrani_bu_h (__m128i_op0, __m128i_op1, 0xa); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vssrarn.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vssrarn.c new file mode 100644 index 00000000000..a23ad7cd294 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vssrarn.c @@ -0,0 +1,669 @@ +/* { 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]) = 0xffffffffd24271c4; + *((unsigned long *)&__m128i_op1[0]) = 0x2711bad1e8e309ed; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrarn_w_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000ffff00000000; + *((unsigned long *)&__m128i_op1[1]) = 0xbf8000000000ffff; + *((unsigned long *)&__m128i_op1[0]) = 0xcf00000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrarn_bu_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_vssrarn_h_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_vssrarn_h_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_vssrarn_bu_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000ffff00000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000ffff0000ffff; + *((unsigned long *)&__m128i_op1[1]) = 0x000000017fff9000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000210011084; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x7fffffff7fffffff; + __m128i_out = __lsx_vssrarn_w_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]) = 0x0000000017fda829; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrarn_hu_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x7fff7fff80007fff; + __m128i_out = __lsx_vssrarn_h_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_vssrarn_hu_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffcb410000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xfffeb827ffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000800000008; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000800000008; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x8000000080000000; + __m128i_out = __lsx_vssrarn_w_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]) = 0xc1bdceee242070db; + *((unsigned long *)&__m128i_op1[0]) = 0xe8c7b756d76aa478; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrarn_hu_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfefd7f7f7f7f7f7e; + *((unsigned long *)&__m128i_op0[0]) = 0xdffdbffeba6f5543; + *((unsigned long *)&__m128i_op1[1]) = 0x0080000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0080000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00ffffff000000ff; + __m128i_out = __lsx_vssrarn_bu_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x00ffffff000000ff; + *((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_vssrarn_h_w (__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]) = 0x0000000000002010; + __m128i_out = __lsx_vssrarn_b_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_vssrarn_wu_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_vssrarn_h_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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xff00000000000001; + __m128i_out = __lsx_vssrarn_bu_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]) = 0xc1bdceee242070db; + *((unsigned long *)&__m128i_op1[0]) = 0xe8c7b756d76aa478; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrarn_h_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]) = 0x00000000000000f0; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrarn_h_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_vssrarn_bu_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]) = 0x0000000000000004; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000004; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrarn_b_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]) = 0x4f804f804f804f80; + *((unsigned long *)&__m128i_op1[0]) = 0x4f804f804f804f80; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrarn_h_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000000003fffff00; + *((unsigned long *)&__m128i_op0[0]) = 0x000000003fffff00; + *((unsigned long *)&__m128i_op1[1]) = 0x3f8000003f800000; + *((unsigned long *)&__m128i_op1[0]) = 0x3f8000003f800000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000ff000000ff00; + __m128i_out = __lsx_vssrarn_bu_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000007ae567a3e; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x000700ff00000000; + __m128i_out = __lsx_vssrarn_bu_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0bd80bd80bdfffff; + *((unsigned long *)&__m128i_op0[0]) = 0x0bd80bd80bd80000; + *((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_vssrarn_h_w (__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]) = 0xfffff00010000fff; + *((unsigned long *)&__m128i_op1[0]) = 0xfffff00010000fff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000ffff00; + __m128i_out = __lsx_vssrarn_bu_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x000000000000f00f; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0032000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000007fff; + __m128i_out = __lsx_vssrarn_h_w (__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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000007fff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x7fff7fff7fff0000; + __m128i_out = __lsx_vssrarn_h_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x1111311111114111; + *((unsigned long *)&__m128i_op0[0]) = 0x1111311111110000; + *((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_vssrarn_hu_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x2020202020202020; + *((unsigned long *)&__m128i_op0[0]) = 0x2020202020207fff; + *((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_vssrarn_h_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000000000000003f; + *((unsigned long *)&__m128i_op0[0]) = 0x7f417f417f027e03; + *((unsigned long *)&__m128i_op1[1]) = 0x9780697084f07dd7; + *((unsigned long *)&__m128i_op1[0]) = 0x87e3285243051cf3; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00000000ffffffff; + __m128i_out = __lsx_vssrarn_bu_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000fea8ff44; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000fea8ff44; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000008000; + __m128i_out = __lsx_vssrarn_h_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffbfffffffbf; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffbfffffffbf; + *((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_vssrarn_h_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_vssrarn_w_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_vssrarn_wu_d (__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]) = 0xfff0000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0xfff0000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrarn_hu_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0008000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0008000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrarn_bu_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffff0000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffff00; + __m128i_out = __lsx_vssrarn_b_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x13f9c5b60028a415; + *((unsigned long *)&__m128i_op0[0]) = 0x545cab1d81a83bea; + *((unsigned long *)&__m128i_op1[1]) = 0x13f9c5b60028a415; + *((unsigned long *)&__m128i_op1[0]) = 0x545cab1d81a83bea; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xffffffff0015172b; + __m128i_out = __lsx_vssrarn_wu_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x14ccc631eb3339ce; + *((unsigned long *)&__m128i_op0[0]) = 0x685670d197a98f2e; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000010000; + __m128i_out = __lsx_vssrarn_hu_w (__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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xffff0000ffff0000; + __m128i_out = __lsx_vssrarn_hu_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000e36400015253; + *((unsigned long *)&__m128i_op0[0]) = 0x000035ed0001e000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000e36400015253; + *((unsigned long *)&__m128i_op1[0]) = 0x000035ed0001e000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x1c6c80007fffffff; + __m128i_out = __lsx_vssrarn_w_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000b4a00008808; + *((unsigned long *)&__m128i_op0[0]) = 0x0808080800000000; + *((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_vssrarn_wu_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]) = 0xc2fc0000c3040000; + *((unsigned long *)&__m128i_op1[0]) = 0xc2fc0000c3040000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrarn_b_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000060000000001; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000001; + *((unsigned long *)&__m128i_op1[1]) = 0x0000060000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0600000100000001; + __m128i_out = __lsx_vssrarn_hu_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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrarn_h_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]) = 0x0080008000800080; + *((unsigned long *)&__m128i_op1[0]) = 0x0080006b00000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrarn_bu_h (__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]) = 0x0000000000000005; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000500000000; + __m128i_out = __lsx_vssrarn_w_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_vssrarn_h_w (__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]) = 0x00000000ff0000ff; + __m128i_out = __lsx_vssrarn_bu_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]) = 0xffc0ff80ff800000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000005; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffff00; + __m128i_out = __lsx_vssrarn_b_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000002; + *((unsigned long *)&__m128i_op0[0]) = 0x00ff010300ff0103; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00000002ffffffff; + __m128i_out = __lsx_vssrarn_hu_w (__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]) = 0x00000fffffffe000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000102020204000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x045340a628404044; + __m128i_out = __lsx_vssrarn_wu_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_vssrarn_w_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_vssrarn_w_d (__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]) = 0x0000001400000014; + __m128i_out = __lsx_vssrarn_h_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]) = 0x8080808080808080; + *((unsigned long *)&__m128i_op1[0]) = 0x8080808080808080; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrarn_w_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_vssrarn_b_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]) = 0x0000adad0000adad; + *((unsigned long *)&__m128i_op1[0]) = 0x000052520000adad; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrarn_h_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_vssrarn_b_h (__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]) = 0x9c9c9c9b509be72f; + *((unsigned long *)&__m128i_op1[0]) = 0x3513f2e3a1774d2c; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00000501ffff0005; + __m128i_out = __lsx_vssrarn_bu_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]) = 0x0021b761002c593c; + *((unsigned long *)&__m128i_op1[0]) = 0x002584710016cc56; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrarn_w_d (__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]) = 0x0000000202020200; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000100; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x000000ff0000ffff; + __m128i_out = __lsx_vssrarn_b_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xff800000ff800000; + *((unsigned long *)&__m128i_op0[0]) = 0xff800000ff800000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrarn_hu_w (__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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00020000ffff0001; + __m128i_out = __lsx_vssrarn_hu_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]) = 0x004001be00dc008e; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xffffffff00000000; + __m128i_out = __lsx_vssrarn_w_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x1f3f06d4fcba4e98; + *((unsigned long *)&__m128i_op0[0]) = 0x2e1135681fa8d951; + *((unsigned long *)&__m128i_op1[1]) = 0x4399d3221a29d3f2; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x000007d07fffffff; + __m128i_out = __lsx_vssrarn_w_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + int_out = __lsx_vpickve2gr_w (__m128i_op0, 0x0); + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000008686; + *((unsigned long *)&__m128i_op0[0]) = 0x00008e5680008685; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00007fff7fff8000; + __m128i_out = __lsx_vssrarn_h_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xffffc7f100004000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00000000c7f14000; + __m128i_out = __lsx_vssrarn_h_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x4500000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x4400000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xff000000ff000000; + __m128i_out = __lsx_vssrarn_bu_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]) = 0x8a8a8a8a8a8a8a8a; + *((unsigned long *)&__m128i_op1[0]) = 0x8a8a8a8a8a8a8a8a; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrarn_wu_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_vssrarn_b_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-vssrarni.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vssrarni.c new file mode 100644 index 00000000000..76fac97be50 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vssrarni.c @@ -0,0 +1,848 @@ +/* { 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_vssrarni_du_q (__m128i_op0, __m128i_op1, 0x1b); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0020002000200020; + *((unsigned long *)&__m128i_op0[0]) = 0x0020002000200020; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffff60090958; + *((unsigned long *)&__m128i_op1[0]) = 0x0fa96b88d9944d42; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00001802041b0013; + __m128i_out = __lsx_vssrarni_bu_h (__m128i_op0, __m128i_op1, 0xa); + 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_vssrarni_du_q (__m128i_op0, __m128i_op1, 0x72); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrarni_bu_h (__m128i_op0, __m128i_op1, 0xb); + 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_vssrarni_b_h (__m128i_op0, __m128i_op1, 0xf); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000ffff0000ffff; + *((unsigned long *)&__m128i_op1[0]) = 0x0000ffff0000ffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0200020002000200; + __m128i_out = __lsx_vssrarni_hu_w (__m128i_op0, __m128i_op1, 0x7); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0x7ff8000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrarni_wu_d (__m128i_op0, __m128i_op1, 0x3f); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0101010100000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrarni_h_w (__m128i_op0, __m128i_op1, 0x1e); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000017fda829; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrarni_du_q (__m128i_op0, __m128i_op1, 0x5c); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x0002000000020000; + *((unsigned long *)&__m128i_op1[0]) = 0x0002000000020000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrarni_bu_h (__m128i_op0, __m128i_op1, 0xf); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xda4643d5301c4000; + *((unsigned long *)&__m128i_op0[0]) = 0xc1fc0d3bf55c4000; + *((unsigned long *)&__m128i_op1[1]) = 0x7505853d654185f5; + *((unsigned long *)&__m128i_op1[0]) = 0x01010000fefe0101; + *((unsigned long *)&__m128i_result[1]) = 0x8000000080000000; + *((unsigned long *)&__m128i_result[0]) = 0x7fffffff7fffffff; + __m128i_out = __lsx_vssrarni_w_d (__m128i_op0, __m128i_op1, 0x7); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrarni_wu_d (__m128i_op0, __m128i_op1, 0x8); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_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]) = 0x000000000000ffff; + __m128i_out = __lsx_vssrarni_hu_w (__m128i_op0, __m128i_op1, 0x1); + 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]) = 0x0000000100000001; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrarni_h_w (__m128i_op0, __m128i_op1, 0x1); + 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_vssrarni_hu_w (__m128i_op0, __m128i_op1, 0xf); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrarni_bu_h (__m128i_op0, __m128i_op1, 0x4); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x7f8000007f800000; + *((unsigned long *)&__m128i_op0[0]) = 0x7f8000007f800000; + *((unsigned long *)&__m128i_op1[1]) = 0x00020002000d0000; + *((unsigned long *)&__m128i_op1[0]) = 0x000000020f2300ee; + *((unsigned long *)&__m128i_result[1]) = 0x0400040004000400; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrarni_b_h (__m128i_op0, __m128i_op1, 0xd); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_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_vssrarni_hu_w (__m128i_op0, __m128i_op1, 0xd); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrarni_d_q (__m128i_op0, __m128i_op1, 0x79); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000073; + *((unsigned long *)&__m128i_op0[0]) = 0x000000010000002b; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000400000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrarni_w_d (__m128i_op0, __m128i_op1, 0xa); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x01ff01ff01ff01ff; + *((unsigned long *)&__m128i_op1[0]) = 0x01ff01ff01ff01ff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x7fffffffffffffff; + __m128i_out = __lsx_vssrarni_d_q (__m128i_op0, __m128i_op1, 0x1b); + 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_vssrarni_d_q (__m128i_op0, __m128i_op1, 0x59); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000000000000f0; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x00000000000000f0; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrarni_h_w (__m128i_op0, __m128i_op1, 0x11); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x001800390049ffaa; + *((unsigned long *)&__m128i_op0[0]) = 0x0029ff96005cff88; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x7fffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrarni_d_q (__m128i_op0, __m128i_op1, 0xe); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrarni_hu_w (__m128i_op0, __m128i_op1, 0x4); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x03c0000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x03c0038000000380; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0f0000000f000000; + __m128i_out = __lsx_vssrarni_hu_w (__m128i_op0, __m128i_op1, 0xe); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0bef0b880bd80bd8; + *((unsigned long *)&__m128i_op1[1]) = 0x0bd80bd80bdfffff; + *((unsigned long *)&__m128i_op1[0]) = 0x0bd80bd80bd80000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x000000017b017b01; + __m128i_out = __lsx_vssrarni_d_q (__m128i_op0, __m128i_op1, 0x5b); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfffe0001fffe0001; + *((unsigned long *)&__m128i_op0[0]) = 0xfffe0001fffe0001; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000003; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrarni_h_w (__m128i_op0, __m128i_op1, 0x15); + 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_vssrarni_w_d (__m128i_op0, __m128i_op1, 0xc); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrarni_w_d (__m128i_op0, __m128i_op1, 0x32); + 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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrarni_du_q (__m128i_op0, __m128i_op1, 0x30); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrarni_hu_w (__m128i_op0, __m128i_op1, 0x1f); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0xf0800320fff1fa20; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0032000000000000; + __m128i_out = __lsx_vssrarni_bu_h (__m128i_op0, __m128i_op1, 0x4); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x1111113111111141; + *((unsigned long *)&__m128i_op0[0]) = 0x1111113111111121; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0032000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x00000000ffff0000; + __m128i_out = __lsx_vssrarni_hu_w (__m128i_op0, __m128i_op1, 0x3); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000000000000003f; + *((unsigned long *)&__m128i_op0[0]) = 0x7f417f417f027e03; + *((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_vssrarni_du_q (__m128i_op0, __m128i_op1, 0x60); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000000065a0; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000200000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrarni_w_d (__m128i_op0, __m128i_op1, 0x2e); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x9941d155f43a9d08; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000080000000; + __m128i_out = __lsx_vssrarni_w_d (__m128i_op0, __m128i_op1, 0x11); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0c0c8b8a8b8b0b0a; + *((unsigned long *)&__m128i_op0[0]) = 0x8b8a8a898a8a8909; + *((unsigned long *)&__m128i_op1[1]) = 0x1817161517161514; + *((unsigned long *)&__m128i_op1[0]) = 0x1615141315141312; + *((unsigned long *)&__m128i_result[1]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vssrarni_wu_d (__m128i_op0, __m128i_op1, 0x1b); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0xc0fffff000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00000000ffe00000; + __m128i_out = __lsx_vssrarni_h_w (__m128i_op0, __m128i_op1, 0x19); + 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]) = 0x0000000100000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrarni_hu_w (__m128i_op0, __m128i_op1, 0xe); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_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]) = 0x0000000000000000; + __m128i_out = __lsx_vssrarni_w_d (__m128i_op0, __m128i_op1, 0x29); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000001000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0010001000000010; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000080000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrarni_h_w (__m128i_op0, __m128i_op1, 0x11); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrarni_h_w (__m128i_op0, __m128i_op1, 0x1c); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrarni_du_q (__m128i_op0, __m128i_op1, 0x58); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000100fe000100fe; + *((unsigned long *)&__m128i_op0[0]) = 0x0000ffff0000ffff; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000002000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000002000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000100000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrarni_w_d (__m128i_op0, __m128i_op1, 0x31); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrarni_b_h (__m128i_op0, __m128i_op1, 0x5); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0d1202e19235e2bc; + *((unsigned long *)&__m128i_op0[0]) = 0xea38e0f75f6e56d1; + *((unsigned long *)&__m128i_op1[1]) = 0xffffe500ffffc085; + *((unsigned long *)&__m128i_op1[0]) = 0xffffc000ffffc005; + *((unsigned long *)&__m128i_result[1]) = 0xffff00000000ffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrarni_bu_h (__m128i_op0, __m128i_op1, 0x1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000100000008; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000100080000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrarni_h_w (__m128i_op0, __m128i_op1, 0x1c); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0400400204004002; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000200000002; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000010000000000; + __m128i_out = __lsx_vssrarni_w_d (__m128i_op0, __m128i_op1, 0x32); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffe080f6efc100f7; + *((unsigned long *)&__m128i_op0[0]) = 0xefd32176ffe100f7; + *((unsigned long *)&__m128i_op1[1]) = 0xffe080f6efc100f7; + *((unsigned long *)&__m128i_op1[0]) = 0xefd32176ffe100f7; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrarni_wu_d (__m128i_op0, __m128i_op1, 0x2c); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000005452505; + *((unsigned long *)&__m128i_op0[0]) = 0x00000004442403e4; + *((unsigned long *)&__m128i_op1[1]) = 0x03fc03fc03fc03fc; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x00000b4a00008808; + *((unsigned long *)&__m128i_result[0]) = 0x0808080800000000; + __m128i_out = __lsx_vssrarni_bu_h (__m128i_op0, __m128i_op1, 0x7); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000ffffff01; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrarni_hu_w (__m128i_op0, __m128i_op1, 0x11); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffff0000ffff0000; + *((unsigned long *)&__m128i_op0[0]) = 0x7ff0000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffff0000ffff0000; + *((unsigned long *)&__m128i_op1[0]) = 0x7ff0000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrarni_du_q (__m128i_op0, __m128i_op1, 0x71); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x2ea268972ea2966a; + *((unsigned long *)&__m128i_op0[0]) = 0x4026f4ffbc175bff; + *((unsigned long *)&__m128i_op1[1]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x5d7f5d807fea807f; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrarni_b_h (__m128i_op0, __m128i_op1, 0x7); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfff0fffffff00001; + *((unsigned long *)&__m128i_op0[0]) = 0xfff0fffffff09515; + *((unsigned long *)&__m128i_op1[1]) = 0x00000000ffff53d9; + *((unsigned long *)&__m128i_op1[0]) = 0xffff0001ffff9515; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x000000ff00000000; + __m128i_out = __lsx_vssrarni_bu_h (__m128i_op0, __m128i_op1, 0x3); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000003000000d612; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000bfffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x00000000ffff53d9; + *((unsigned long *)&__m128i_op1[0]) = 0xffff0001ffff9515; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000500000000; + __m128i_out = __lsx_vssrarni_bu_h (__m128i_op0, __m128i_op1, 0xc); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x80808080806b000b; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x00000000c0c0c000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrarni_b_h (__m128i_op0, __m128i_op1, 0x9); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfffffffefffffffe; + *((unsigned long *)&__m128i_op0[0]) = 0xfffffffe1fffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x7fffffff7ffffffb; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000002; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000080008; + __m128i_out = __lsx_vssrarni_hu_w (__m128i_op0, __m128i_op1, 0x1c); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x000000000000000b; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrarni_bu_h (__m128i_op0, __m128i_op1, 0x3); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrarni_du_q (__m128i_op0, __m128i_op1, 0x25); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000005; + *((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_vssrarni_b_h (__m128i_op0, __m128i_op1, 0xb); + 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_vssrarni_bu_h (__m128i_op0, __m128i_op1, 0xe); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x1ab6021f72496458; + *((unsigned long *)&__m128i_op0[0]) = 0x7750af4954c29940; + *((unsigned long *)&__m128i_op1[1]) = 0x1ab6021f72496458; + *((unsigned long *)&__m128i_op1[0]) = 0x7750af4954c29940; + *((unsigned long *)&__m128i_result[1]) = 0x6ad8ffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x6ad8ffffffffffff; + __m128i_out = __lsx_vssrarni_hu_w (__m128i_op0, __m128i_op1, 0xe); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000008; + *((unsigned long *)&__m128i_op0[0]) = 0x0002008300500088; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000008; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000088; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrarni_h_w (__m128i_op0, __m128i_op1, 0x1e); + 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_vssrarni_b_h (__m128i_op0, __m128i_op1, 0x7); + 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_vssrarni_d_q (__m128i_op0, __m128i_op1, 0x12); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrarni_hu_w (__m128i_op0, __m128i_op1, 0x13); + 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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000010000000000; + __m128i_out = __lsx_vssrarni_bu_h (__m128i_op0, __m128i_op1, 0x2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrarni_h_w (__m128i_op0, __m128i_op1, 0x1e); + 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_vssrarni_w_d (__m128i_op0, __m128i_op1, 0x2d); + 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]) = 0x1200091212121212; + *((unsigned long *)&__m128i_result[1]) = 0x0002000200020002; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrarni_hu_w (__m128i_op0, __m128i_op1, 0x1e); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x0000008000000080; + *((unsigned long *)&__m128i_op1[0]) = 0x0000008000000080; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrarni_h_w (__m128i_op0, __m128i_op1, 0x16); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrarni_d_q (__m128i_op0, __m128i_op1, 0x51); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrarni_du_q (__m128i_op0, __m128i_op1, 0x7); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrarni_h_w (__m128i_op0, __m128i_op1, 0x13); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000000c6c6c6c6; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000c6c6c6c6; + *((unsigned long *)&__m128i_op1[1]) = 0x00000001fffeff98; + *((unsigned long *)&__m128i_op1[0]) = 0x0014ffe4ff76ffc4; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrarni_bu_h (__m128i_op0, __m128i_op1, 0xb); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000011; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000016; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000011; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000016; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrarni_bu_h (__m128i_op0, __m128i_op1, 0xc); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrarni_w_d (__m128i_op0, __m128i_op1, 0x2b); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xff86dd83ff9611c3; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000035697d4e; + *((unsigned long *)&__m128i_op1[0]) = 0x000000013ecaadf2; + *((unsigned long *)&__m128i_result[1]) = 0xe280e67f00000000; + *((unsigned long *)&__m128i_result[0]) = 0x00007f7f00007f80; + __m128i_out = __lsx_vssrarni_b_h (__m128i_op0, __m128i_op1, 0x2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xd3259a2984048c23; + *((unsigned long *)&__m128i_op1[0]) = 0xf9796558e39953fd; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x8000000080000000; + __m128i_out = __lsx_vssrarni_w_d (__m128i_op0, __m128i_op1, 0x14); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrarni_bu_h (__m128i_op0, __m128i_op1, 0x2); + 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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrarni_bu_h (__m128i_op0, __m128i_op1, 0xe); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x017001a002c80260; + *((unsigned long *)&__m128i_op0[0]) = 0x01d8000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x2e34594c3b000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x00000000ffffffff; + __m128i_out = __lsx_vssrarni_wu_d (__m128i_op0, __m128i_op1, 0x10); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00060fbf02596848; + *((unsigned long *)&__m128i_op0[0]) = 0x00020fbf04581ec0; + *((unsigned long *)&__m128i_op1[1]) = 0x010169d9010169d9; + *((unsigned long *)&__m128i_op1[0]) = 0x01010287010146a1; + *((unsigned long *)&__m128i_result[1]) = 0x0000000200000000; + *((unsigned long *)&__m128i_result[0]) = 0x0002000200000001; + __m128i_out = __lsx_vssrarni_bu_h (__m128i_op0, __m128i_op1, 0xe); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x5252525252525252; + *((unsigned long *)&__m128i_op0[0]) = 0x5252525252525252; + *((unsigned long *)&__m128i_op1[1]) = 0x004d004d004d004d; + *((unsigned long *)&__m128i_op1[0]) = 0x004d004d004d004d; + *((unsigned long *)&__m128i_result[1]) = 0x7fffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x7fffffffffffffff; + __m128i_out = __lsx_vssrarni_d_q (__m128i_op0, __m128i_op1, 0x13); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x06d9090909090909; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrarni_d_q (__m128i_op0, __m128i_op1, 0x48); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0039d21e3229d4e8; + *((unsigned long *)&__m128i_op0[0]) = 0x6d339b4f3b439885; + *((unsigned long *)&__m128i_op1[1]) = 0xfffffff000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000d00000000; + *((unsigned long *)&__m128i_result[1]) = 0x7fffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffc0000000000000; + __m128i_out = __lsx_vssrarni_d_q (__m128i_op0, __m128i_op1, 0x2e); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000100000001000; + *((unsigned long *)&__m128i_op1[0]) = 0x37b951002d81a921; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000001; + __m128i_out = __lsx_vssrarni_w_d (__m128i_op0, __m128i_op1, 0x3e); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000075dbe982; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000071e48cca; + *((unsigned long *)&__m128i_op1[1]) = 0x0001000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0001000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0ebb7d300e3c9199; + *((unsigned long *)&__m128i_result[0]) = 0x7fffffff7fffffff; + __m128i_out = __lsx_vssrarni_w_d (__m128i_op0, __m128i_op1, 0x3); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000930400008a10; + *((unsigned long *)&__m128i_op0[0]) = 0x00006f9100007337; + *((unsigned long *)&__m128i_op1[1]) = 0x00c2758000bccf42; + *((unsigned long *)&__m128i_op1[0]) = 0x00a975be00accf03; + *((unsigned long *)&__m128i_result[1]) = 0x00250023001c001d; + *((unsigned long *)&__m128i_result[0]) = 0x309d2f342a5d2b34; + __m128i_out = __lsx_vssrarni_hu_w (__m128i_op0, __m128i_op1, 0xa); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xff01ffffe41f0000; + *((unsigned long *)&__m128i_op0[0]) = 0xfff00000ffff0000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000100000155; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x000000000000002b; + __m128i_out = __lsx_vssrarni_bu_h (__m128i_op0, __m128i_op1, 0x3); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xff00e400ff00e400; + *((unsigned long *)&__m128i_op0[0]) = 0xfee1f6f18800ff7f; + *((unsigned long *)&__m128i_op1[1]) = 0xffff000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0xffff000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrarni_hu_w (__m128i_op0, __m128i_op1, 0x9); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vssrln.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vssrln.c new file mode 100644 index 00000000000..ed600c72dcc --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vssrln.c @@ -0,0 +1,543 @@ +/* { 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_vssrln_bu_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_vssrln_b_h (__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]) = 0x8080808000008080; + *((unsigned long *)&__m128i_op1[0]) = 0x8080000080800000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00000000ffff0000; + __m128i_out = __lsx_vssrln_bu_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]) = 0x5ff6a0a40ea8f47c; + *((unsigned long *)&__m128i_op1[0]) = 0x5ff6a0a40e9da42a; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrln_bu_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]) = 0x0000ffff0000ffff; + *((unsigned long *)&__m128i_op1[0]) = 0x0000ffff0000fffe; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrln_h_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000001afffffff7; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000750500006541; + *((unsigned long *)&__m128i_op1[0]) = 0x00000100fffffefd; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x7fffffff00000000; + __m128i_out = __lsx_vssrln_w_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x80000000fff6fc00; + *((unsigned long *)&__m128i_op1[1]) = 0x7f0000007f000000; + *((unsigned long *)&__m128i_op1[0]) = 0x8080000180800100; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00000000ff00ffff; + __m128i_out = __lsx_vssrln_bu_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + int_out = __lsx_vpickve2gr_b (__m128i_op0, 0x7); + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xfffefff6fff80002; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrln_bu_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]) = 0xffffffffffffffe5; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffe5; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0101017f0101017f; + __m128i_out = __lsx_vssrln_b_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00005a5a00005a5a; + *((unsigned long *)&__m128i_op0[0]) = 0x00005b5a00005b5a; + *((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_vssrln_bu_h (__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]) = 0x65b780a2ae3bf8ca; + *((unsigned long *)&__m128i_op1[0]) = 0x161d0c373c200827; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00000000000001ff; + __m128i_out = __lsx_vssrln_h_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]) = 0xf10cf508f904fd01; + *((unsigned long *)&__m128i_op1[0]) = 0xf10cf508f904fd01; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrln_b_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]) = 0xf8f8e018f8f8e810; + *((unsigned long *)&__m128i_op1[0]) = 0xf8f8f008f8f8f800; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrln_h_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_vssrln_w_d (__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]) = 0x00000000ffefffef; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vssrln_hu_w (__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]) = 0x0000000000000f00; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000ffffff00; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x7fffffff00000000; + __m128i_out = __lsx_vssrln_w_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_vssrln_bu_h (__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]) = 0x00000000f0009d3c; + *((unsigned long *)&__m128i_op1[0]) = 0x000000016fff9d3d; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x000c000000060003; + __m128i_out = __lsx_vssrln_h_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_vssrln_h_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000003a24; + *((unsigned long *)&__m128i_op0[0]) = 0x003dbe88077c78c1; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000fffe0001; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00003a247fff7fff; + __m128i_out = __lsx_vssrln_h_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_vssrln_bu_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]) = 0xffffffffffffffff; + __m128i_out = __lsx_vssrln_hu_w (__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]) = 0xfffffffffffffff0; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x3fbf3fbf00007fff; + __m128i_out = __lsx_vssrln_wu_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_vssrln_w_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x00000fff00000e36; + *((unsigned long *)&__m128i_op1[1]) = 0x0000ffff0000ffff; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x000000000fff0e36; + __m128i_out = __lsx_vssrln_hu_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffe000ffdf; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x7fff7fff7fff7fff; + __m128i_out = __lsx_vssrln_h_w (__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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000001; + __m128i_out = __lsx_vssrln_wu_d (__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]) = 0x0101010101010101; + __m128i_out = __lsx_vssrln_bu_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_vssrln_w_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_vssrln_h_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_vssrln_h_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_vssrln_h_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_vssrln_h_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffc0800000; + *((unsigned long *)&__m128i_op1[1]) = 0x000000000000001b; + *((unsigned long *)&__m128i_op1[0]) = 0x000000000000001b; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x000000007fff0018; + __m128i_out = __lsx_vssrln_h_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0001000100010001; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((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_vssrln_wu_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_vssrln_w_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_vssrln_b_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_vssrln_w_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]) = 0xffefffefffefffef; + *((unsigned long *)&__m128i_op1[0]) = 0xffefffefffefffef; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrln_wu_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0080000700000014; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000fffbffda; + *((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_vssrln_w_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_vssrln_h_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_vssrln_h_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_vssrln_wu_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_vssrln_hu_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]) = 0x3e25c8317394dae6; + *((unsigned long *)&__m128i_op1[0]) = 0xcda585aebbb2836a; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrln_hu_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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x000000ac00000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x7fffffff7fffffff; + __m128i_out = __lsx_vssrln_w_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0x9c9c9c9c9c9c9c9c; + *((unsigned long *)&__m128i_op1[1]) = 0x00000000c6c6c6c6; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000c6c6c6c6; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x7f7f7f7f7f7f7f7f; + __m128i_out = __lsx_vssrln_b_h (__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]) = 0xffffffff00000000; + __m128i_out = __lsx_vssrln_bu_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]) = 0x64616462b76106dc; + *((unsigned long *)&__m128i_op1[0]) = 0x64616462b71d06c2; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrln_wu_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00c0c000c0000000; + *((unsigned long *)&__m128i_op0[0]) = 0xc0000000c000c000; + *((unsigned long *)&__m128i_op1[1]) = 0x00c0c000c0000000; + *((unsigned long *)&__m128i_op1[0]) = 0xc0000000c000c000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x7fff7fff7fff7fff; + __m128i_out = __lsx_vssrln_h_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x001e001e001e001e; + *((unsigned long *)&__m128i_op0[0]) = 0x001e001e001e001e; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x7fff7fff7fff7fff; + __m128i_out = __lsx_vssrln_h_w (__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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x000000007fff7fff; + __m128i_out = __lsx_vssrln_h_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x7fffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffc0000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x7fffffff00000001; + __m128i_out = __lsx_vssrln_w_d (__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]) = 0x0000000000000001; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00000000007f7f7f; + __m128i_out = __lsx_vssrln_b_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]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_op1[0]) = 0xffff000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrln_wu_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]) = 0xf589caff5605f2fa; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrln_wu_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000a74aa8a55ab; + *((unsigned long *)&__m128i_op0[0]) = 0x6adeb5dfcb000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x7fffffff7fffffff; + __m128i_out = __lsx_vssrln_w_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x7f8000007f800000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((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_vssrln_wu_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-vssrlni.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vssrlni.c new file mode 100644 index 00000000000..61366814324 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vssrlni.c @@ -0,0 +1,668 @@ +/* { 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]) = 0xffffffff80000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0001ffff00000000; + __m128i_out = __lsx_vssrlni_w_d (__m128i_op0, __m128i_op1, 0x2f); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrlni_du_q (__m128i_op0, __m128i_op1, 0x4f); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrlni_b_h (__m128i_op0, __m128i_op1, 0x8); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x004e005500060031; + *((unsigned long *)&__m128i_op0[0]) = 0xff870068fff5ffb3; + *((unsigned long *)&__m128i_op1[1]) = 0x004e005500060031; + *((unsigned long *)&__m128i_op1[0]) = 0xff870068fff5ffb3; + *((unsigned long *)&__m128i_result[1]) = 0x04e00060ffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x04e00060ffffffff; + __m128i_out = __lsx_vssrlni_hu_w (__m128i_op0, __m128i_op1, 0xc); + 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]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x00000000ffffffff; + __m128i_out = __lsx_vssrlni_wu_d (__m128i_op0, __m128i_op1, 0x10); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x8080808000008080; + *((unsigned long *)&__m128i_op0[0]) = 0x8080000080800000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0001010100010100; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrlni_wu_d (__m128i_op0, __m128i_op1, 0x2f); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000080007f80800; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000001000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00047fff00007fff; + __m128i_out = __lsx_vssrlni_h_w (__m128i_op0, __m128i_op1, 0x9); + 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]) = 0x0000000003fc0003; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrlni_d_q (__m128i_op0, __m128i_op1, 0x56); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000017fda829; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrlni_du_q (__m128i_op0, __m128i_op1, 0x27); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0c03e17edd781b11; + *((unsigned long *)&__m128i_op0[0]) = 0x342caf9bffff1fff; + *((unsigned long *)&__m128i_op1[1]) = 0x0000040000000400; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0c037fff342c7fff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrlni_h_w (__m128i_op0, __m128i_op1, 0x10); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x00000000fff8fff8; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000fff80000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrlni_wu_d (__m128i_op0, __m128i_op1, 0x37); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xfffffffffffffffe; + *((unsigned long *)&__m128i_op1[1]) = 0xfffffffff100fffc; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x7fffffff7fffffff; + *((unsigned long *)&__m128i_result[0]) = 0x7fffffff00000000; + __m128i_out = __lsx_vssrlni_w_d (__m128i_op0, __m128i_op1, 0x21); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfffffffff100fffc; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xfffffffff100fffc; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_result[0]) = 0xffffffff00000000; + __m128i_out = __lsx_vssrlni_bu_h (__m128i_op0, __m128i_op1, 0x1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000020; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrlni_bu_h (__m128i_op0, __m128i_op1, 0xd); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrlni_w_d (__m128i_op0, __m128i_op1, 0x2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000800080; + *((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_vssrlni_w_d (__m128i_op0, __m128i_op1, 0x38); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfffffffffffff800; + *((unsigned long *)&__m128i_op0[0]) = 0x8000000080000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x001fffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrlni_d_q (__m128i_op0, __m128i_op1, 0x4b); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x000a000a000a000a; + *((unsigned long *)&__m128i_op1[0]) = 0x000a000a000a000a; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0a000a000a000a00; + __m128i_out = __lsx_vssrlni_h_w (__m128i_op0, __m128i_op1, 0x8); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xf2f2e5e5e5e5e5dc; + *((unsigned long *)&__m128i_op0[0]) = 0xfffffffffffffff7; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x7fffffff7fffffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrlni_w_d (__m128i_op0, __m128i_op1, 0x16); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrlni_b_h (__m128i_op0, __m128i_op1, 0x5); + 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]) = 0x7fff7fff7fff7fff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrlni_h_w (__m128i_op0, __m128i_op1, 0xd); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrlni_w_d (__m128i_op0, __m128i_op1, 0x3); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000ff000000ff00; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000003fc0; + __m128i_out = __lsx_vssrlni_wu_d (__m128i_op0, __m128i_op1, 0x22); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrlni_du_q (__m128i_op0, __m128i_op1, 0x35); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrlni_b_h (__m128i_op0, __m128i_op1, 0xd); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrlni_hu_w (__m128i_op0, __m128i_op1, 0xd); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x7ff0000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x7ff0000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xfffffffffffffffe; + *((unsigned long *)&__m128i_result[1]) = 0x7fffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x7fffffffffffffff; + __m128i_out = __lsx_vssrlni_d_q (__m128i_op0, __m128i_op1, 0x35); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfffffffffffffffe; + *((unsigned long *)&__m128i_op0[0]) = 0xfffffffffffffffe; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xfffffffffffffffe; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vssrlni_hu_w (__m128i_op0, __m128i_op1, 0x10); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0008000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0101010101010101; + *((unsigned long *)&__m128i_op1[1]) = 0x41dfffff00000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000100000020; + *((unsigned long *)&__m128i_result[0]) = 0x0000083b00000000; + __m128i_out = __lsx_vssrlni_w_d (__m128i_op0, __m128i_op1, 0x33); + 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]) = 0x0000000000000003; + __m128i_out = __lsx_vssrlni_d_q (__m128i_op0, __m128i_op1, 0x7e); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x1ff85ffe2ae5d973; + *((unsigned long *)&__m128i_op1[1]) = 0x403be000ffffe000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x00000000000ffc2f; + *((unsigned long *)&__m128i_result[0]) = 0x00201df000000000; + __m128i_out = __lsx_vssrlni_wu_d (__m128i_op0, __m128i_op1, 0x29); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000005151515; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000006302e00; + *((unsigned long *)&__m128i_op1[1]) = 0x000000000000003f; + *((unsigned long *)&__m128i_op1[0]) = 0x7f417f417f027e03; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000001fd0; + __m128i_out = __lsx_vssrlni_w_d (__m128i_op0, __m128i_op1, 0x32); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000100000001; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000100000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x000000000000ffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrlni_h_w (__m128i_op0, __m128i_op1, 0x1b); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffbfffffffbf; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffbfffffffbf; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00000001ffffff7f; + __m128i_out = __lsx_vssrlni_d_q (__m128i_op0, __m128i_op1, 0x5f); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x000000000202fe02; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000101; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrlni_hu_w (__m128i_op0, __m128i_op1, 0x11); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x01203f1e3d1c3b1a; + *((unsigned long *)&__m128i_op0[0]) = 0x3918371635143312; + *((unsigned long *)&__m128i_op1[1]) = 0x21201f1e1d1c1b1a; + *((unsigned long *)&__m128i_op1[0]) = 0x1918171615141312; + *((unsigned long *)&__m128i_result[1]) = 0x480f7fff7fff7fff; + *((unsigned long *)&__m128i_result[0]) = 0x7fff7fff7fff7fff; + __m128i_out = __lsx_vssrlni_h_w (__m128i_op0, __m128i_op1, 0xa); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x00005dcbe7e830c0; + *((unsigned long *)&__m128i_op1[1]) = 0xfffffacdb6dbecac; + *((unsigned long *)&__m128i_op1[0]) = 0x1f5533a694f902c0; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x000000001fffff59; + __m128i_out = __lsx_vssrlni_du_q (__m128i_op0, __m128i_op1, 0x63); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000007f41; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrlni_h_w (__m128i_op0, __m128i_op1, 0x16); + 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]) = 0x0000000000002000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000002000; + __m128i_out = __lsx_vssrlni_du_q (__m128i_op0, __m128i_op1, 0x39); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x14ccc6320076a4d2; + *((unsigned long *)&__m128i_op0[0]) = 0x685670d27e00682a; + *((unsigned long *)&__m128i_op1[1]) = 0x14ccc6320076a4d2; + *((unsigned long *)&__m128i_op1[0]) = 0x685670d27e00682a; + *((unsigned long *)&__m128i_result[1]) = 0x0001000100000000; + *((unsigned long *)&__m128i_result[0]) = 0x0001000100000000; + __m128i_out = __lsx_vssrlni_bu_h (__m128i_op0, __m128i_op1, 0xf); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xc000000fc0003fff; + *((unsigned long *)&__m128i_op0[0]) = 0xbffffff0ffffc00f; + *((unsigned long *)&__m128i_op1[1]) = 0x0000003f0000ffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffc3ffff003e; + *((unsigned long *)&__m128i_result[1]) = 0x00c0000000bfffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000ffffff; + __m128i_out = __lsx_vssrlni_wu_d (__m128i_op0, __m128i_op1, 0x28); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x800000810000807f; + *((unsigned long *)&__m128i_op0[0]) = 0x808080010080007f; + *((unsigned long *)&__m128i_op1[1]) = 0x800000810000807f; + *((unsigned long *)&__m128i_op1[0]) = 0x808080010080007f; + *((unsigned long *)&__m128i_result[1]) = 0x0000000020000020; + *((unsigned long *)&__m128i_result[0]) = 0x0000000020000020; + __m128i_out = __lsx_vssrlni_du_q (__m128i_op0, __m128i_op1, 0x62); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0400400204004002; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000200000002; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000002002; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrlni_du_q (__m128i_op0, __m128i_op1, 0x6d); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x000000000000ffff; + *((unsigned long *)&__m128i_op1[1]) = 0x2a29282726252423; + *((unsigned long *)&__m128i_op1[0]) = 0x2221201f1e1d1c1b; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vssrlni_du_q (__m128i_op0, __m128i_op1, 0x26); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000002002; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x2a29282726252423; + *((unsigned long *)&__m128i_op1[0]) = 0x2221201f1e1d1c1b; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00a8009800880078; + __m128i_out = __lsx_vssrlni_h_w (__m128i_op0, __m128i_op1, 0x16); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x8000807f00000000; + *((unsigned long *)&__m128i_op1[0]) = 0x80006b0080808080; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x7fff00007fff7fff; + __m128i_out = __lsx_vssrlni_h_w (__m128i_op0, __m128i_op1, 0x3); + 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]) = 0x0000000001010101; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrlni_bu_h (__m128i_op0, __m128i_op1, 0xf); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrlni_w_d (__m128i_op0, __m128i_op1, 0x0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000000000001fe01; + *((unsigned long *)&__m128i_op0[0]) = 0x000000000001fe01; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000f0000000f; + *((unsigned long *)&__m128i_result[0]) = 0x0f0f0f0f00000000; + __m128i_out = __lsx_vssrlni_b_h (__m128i_op0, __m128i_op1, 0xc); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrlni_b_h (__m128i_op0, __m128i_op1, 0xf); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrlni_hu_w (__m128i_op0, __m128i_op1, 0x5); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000002; + *((unsigned long *)&__m128i_op0[0]) = 0x00ff010300ff0103; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0x555500adfffc5cab; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0101010100000100; + __m128i_out = __lsx_vssrlni_bu_h (__m128i_op0, __m128i_op1, 0xf); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000ffff0000ffff; + *((unsigned long *)&__m128i_op0[0]) = 0x0000ffff0000ffff; + *((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_vssrlni_hu_w (__m128i_op0, __m128i_op1, 0x0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x03ff0101fc010102; + *((unsigned long *)&__m128i_op0[0]) = 0x03fffffffc010102; + *((unsigned long *)&__m128i_op1[1]) = 0x7fff010181010102; + *((unsigned long *)&__m128i_op1[0]) = 0x7fffffff81010102; + *((unsigned long *)&__m128i_result[1]) = 0x7fffffff7fffffff; + *((unsigned long *)&__m128i_result[0]) = 0x7fffffff7fffffff; + __m128i_out = __lsx_vssrlni_w_d (__m128i_op0, __m128i_op1, 0x0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x003f0000ffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0x003f0000ffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x000300037ff000ff; + *((unsigned long *)&__m128i_op1[0]) = 0x0003000300a10003; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrlni_wu_d (__m128i_op0, __m128i_op1, 0x3c); + 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]) = 0x0000000007070707; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrlni_bu_h (__m128i_op0, __m128i_op1, 0xd); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrlni_du_q (__m128i_op0, __m128i_op1, 0x45); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfffdfffcfffdfffc; + *((unsigned long *)&__m128i_op0[0]) = 0xfffdfffcfffdfffc; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x7fffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrlni_d_q (__m128i_op0, __m128i_op1, 0x13); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000100; + *((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_vssrlni_bu_h (__m128i_op0, __m128i_op1, 0x1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000053a4f452; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x000000000000053a; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrlni_w_d (__m128i_op0, __m128i_op1, 0x14); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrlni_b_h (__m128i_op0, __m128i_op1, 0xf); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000b3a6000067da; + *((unsigned long *)&__m128i_op1[0]) = 0x00004e420000c26a; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrlni_d_q (__m128i_op0, __m128i_op1, 0x7a); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x67eb85afb2ebb000; + *((unsigned long *)&__m128i_op1[0]) = 0xc8847ef6ed3f2000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x7fffffffffffffff; + __m128i_out = __lsx_vssrlni_d_q (__m128i_op0, __m128i_op1, 0x38); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x7c7c000000007176; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000001; + __m128i_out = __lsx_vssrlni_du_q (__m128i_op0, __m128i_op1, 0x3e); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000000000000c6c7; + *((unsigned long *)&__m128i_op0[0]) = 0x8d8d8d8d8d8cc6c6; + *((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_vssrlni_w_d (__m128i_op0, __m128i_op1, 0x3c); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000aa822a8228222; + *((unsigned long *)&__m128i_op0[0]) = 0x03aa558ec8546eb6; + *((unsigned long *)&__m128i_op1[1]) = 0x001a64b345308091; + *((unsigned long *)&__m128i_op1[0]) = 0x001f2f2cab1c732a; + *((unsigned long *)&__m128i_result[1]) = 0x0155ffff754affff; + *((unsigned long *)&__m128i_result[0]) = 0x034cffff03e5ffff; + __m128i_out = __lsx_vssrlni_hu_w (__m128i_op0, __m128i_op1, 0xb); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xc1bdceee242070dc; + *((unsigned long *)&__m128i_op0[0]) = 0xe907b754d7eaa478; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x7fff7fff7fff7fff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrlni_h_w (__m128i_op0, __m128i_op1, 0x4); + 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]) = 0x0000000000000000; + __m128i_out = __lsx_vssrlni_hu_w (__m128i_op0, __m128i_op1, 0x5); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0002711350a27112; + *((unsigned long *)&__m128i_op0[0]) = 0x00d5701794027113; + *((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_vssrlni_du_q (__m128i_op0, __m128i_op1, 0x6); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000203000010d0; + *((unsigned long *)&__m128i_op0[0]) = 0xffffc00300000220; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000000000ff; + *((unsigned long *)&__m128i_result[1]) = 0x7fffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrlni_d_q (__m128i_op0, __m128i_op1, 0x27); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000f50000000900; + *((unsigned long *)&__m128i_op0[0]) = 0x0000090900000998; + *((unsigned long *)&__m128i_op1[1]) = 0x0000ffff0000ffff; + *((unsigned long *)&__m128i_op1[0]) = 0x0000ffff0000ffff; + *((unsigned long *)&__m128i_result[1]) = 0x7fffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x7fffffffffffffff; + __m128i_out = __lsx_vssrlni_d_q (__m128i_op0, __m128i_op1, 0x20); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000100000001; + *((unsigned long *)&__m128i_op0[0]) = 0x00000001000010f8; + *((unsigned long *)&__m128i_op1[1]) = 0xfff8ffa2fffdffb0; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000ff800000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_result[0]) = 0x0f0f0f0f00000f00; + __m128i_out = __lsx_vssrlni_bu_h (__m128i_op0, __m128i_op1, 0xc); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vssrlrn.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vssrlrn.c new file mode 100644 index 00000000000..ec688bb1231 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vssrlrn.c @@ -0,0 +1,470 @@ +/* { 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_vssrlrn_w_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_vssrlrn_hu_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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0002000200020002; + __m128i_out = __lsx_vssrlrn_h_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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x7fff00007fff7fff; + __m128i_out = __lsx_vssrlrn_h_w (__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]) = 0x00040003ff83ff84; + *((unsigned long *)&__m128i_op1[0]) = 0x00040003ff4dffca; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrlrn_bu_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xfffefffefffffffc; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000002020202; + __m128i_out = __lsx_vssrlrn_b_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_vssrlrn_h_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]) = 0x7f7f7f7f7f7f7f7f; + __m128i_out = __lsx_vssrlrn_b_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfffffffffffffffe; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffbe6ed563; + *((unsigned long *)&__m128i_op1[1]) = 0x0080000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0080000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vssrlrn_bu_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_vssrlrn_wu_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]) = 0x0000000000000008; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000008; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrlrn_wu_d (__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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrlrn_h_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000000000000fbf9; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000001000000010; + *((unsigned long *)&__m128i_op1[0]) = 0x0000001000000010; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000007f00000000; + __m128i_out = __lsx_vssrlrn_b_h (__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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vssrlrn_wu_d (__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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vssrlrn_wu_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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrlrn_w_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000000004fc04f81; + *((unsigned long *)&__m128i_op0[0]) = 0x000000004fc04f80; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00007f7f00007f7f; + __m128i_out = __lsx_vssrlrn_b_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffc1000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000ff0000; + *((unsigned long *)&__m128i_op1[1]) = 0xffc1000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000ff0000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x7fff000000007fff; + __m128i_out = __lsx_vssrlrn_h_w (__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]) = 0xfffff0000000ad3d; + *((unsigned long *)&__m128i_op1[0]) = 0xfffff000fffff000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x000000007fff0000; + __m128i_out = __lsx_vssrlrn_h_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_vssrlrn_h_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xf001f0010101f002; + *((unsigned long *)&__m128i_op1[1]) = 0x1000100010001000; + *((unsigned long *)&__m128i_op1[0]) = 0x1000100010001000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00000000ffffffff; + __m128i_out = __lsx_vssrlrn_hu_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000000dfa6e0c6; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000d46cdc13; + *((unsigned long *)&__m128i_op1[1]) = 0xffff80df00000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00007f7f00007f7f; + __m128i_out = __lsx_vssrlrn_b_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]) = 0xfff0000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0xfff0000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrlrn_hu_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000ffff3fbfffff; + *((unsigned long *)&__m128i_op0[0]) = 0x7fffffff7fffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x3fbf3fbf00007fff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x007f7f7f01027f02; + __m128i_out = __lsx_vssrlrn_b_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]) = 0xfffffffffffffffe; + *((unsigned long *)&__m128i_op1[0]) = 0xfffffffffffffffe; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000400000004; + __m128i_out = __lsx_vssrlrn_wu_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]) = 0xffffffffffff0000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x7fffffff7fffffff; + __m128i_out = __lsx_vssrlrn_w_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]) = 0x00000000ffffffe0; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrlrn_bu_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]) = 0x3f413f4100000000; + *((unsigned long *)&__m128i_op1[0]) = 0x7f801fe000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x7fff7fff7fff7fff; + __m128i_out = __lsx_vssrlrn_h_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000010000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000010000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x00000100000000fc; + *((unsigned long *)&__m128i_op1[0]) = 0x00000100000000fc; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0100000001000000; + __m128i_out = __lsx_vssrlrn_hu_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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vssrlrn_wu_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]) = 0x0c0b0a090b0a0908; + *((unsigned long *)&__m128i_op1[0]) = 0x0a09080709080706; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrlrn_bu_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]) = 0x0000000040a04000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000040a04000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrlrn_b_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_vssrlrn_hu_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_vssrlrn_b_h (__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]) = 0x00003fff00010000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x1200091212121212; + __m128i_out = __lsx_vssrlrn_b_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_vssrlrn_b_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_vssrlrn_h_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_vssrlrn_wu_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]) = 0x0800010001ff8000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrlrn_bu_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]) = 0x2e9028362e902836; + *((unsigned long *)&__m128i_op1[0]) = 0x2e9028362e902836; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrlrn_h_w (__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]) = 0xfffffffffffffffc; + *((unsigned long *)&__m128i_op1[0]) = 0xfffffffffffffffc; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000001000000010; + __m128i_out = __lsx_vssrlrn_wu_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_vssrlrn_hu_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x33f5c2d7d975d7fe; + *((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]) = 0x7fffffff7fffffff; + __m128i_out = __lsx_vssrlrn_w_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_vssrlrn_bu_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]) = 0x00000000084d12ce; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000024170000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrlrn_bu_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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrlrn_w_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]) = 0x0002711350a27112; + *((unsigned long *)&__m128i_op1[0]) = 0x00d5701794027113; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vssrlrn_bu_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x4399d3221a29d3f2; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0674c886fcba4e98; + *((unsigned long *)&__m128i_op1[0]) = 0xfdce8003090b0906; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xffff001a00000000; + __m128i_out = __lsx_vssrlrn_hu_w (__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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000001000000010; + __m128i_out = __lsx_vssrlrn_hu_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0001fffe00014b41; + *((unsigned long *)&__m128i_op0[0]) = 0x0001fffe0001ffde; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0002000100020002; + __m128i_out = __lsx_vssrlrn_bu_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-vssrlrni.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vssrlrni.c new file mode 100644 index 00000000000..02f7ca08b3b --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vssrlrni.c @@ -0,0 +1,597 @@ +/* { 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_vssrlrni_w_d (__m128i_op0, __m128i_op1, 0x3d); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_result[1]) = 0x8080808000008080; + *((unsigned long *)&__m128i_result[0]) = 0x8080000080800000; + __m128i_out = __lsx_vssrlrni_bu_h (__m128i_op0, __m128i_op1, 0x9); + 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]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000080000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000080000000; + __m128i_out = __lsx_vssrlrni_wu_d (__m128i_op0, __m128i_op1, 0x1); + 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]) = 0x0000ffff0000ffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrlrni_bu_h (__m128i_op0, __m128i_op1, 0x4); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0001000100000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x7fff000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrlrni_h_w (__m128i_op0, __m128i_op1, 0x1); + 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]) = 0x0001000100000004; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000007f00; + *((unsigned long *)&__m128i_result[0]) = 0x0000000001000000; + __m128i_out = __lsx_vssrlrni_h_w (__m128i_op0, __m128i_op1, 0x8); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0101010400100203; + *((unsigned long *)&__m128i_op0[0]) = 0x0103010301020109; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000110000001; + *((unsigned long *)&__m128i_op1[0]) = 0x0000007f00000004; + *((unsigned long *)&__m128i_result[1]) = 0x0202000402020202; + *((unsigned long *)&__m128i_result[0]) = 0x0000200000010000; + __m128i_out = __lsx_vssrlrni_b_h (__m128i_op0, __m128i_op1, 0x7); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrlrni_du_q (__m128i_op0, __m128i_op1, 0x56); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrlrni_du_q (__m128i_op0, __m128i_op1, 0x6d); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffff0001ffff8002; + *((unsigned long *)&__m128i_op0[0]) = 0x0010000400020004; + *((unsigned long *)&__m128i_op1[1]) = 0x00000000ffff20ff; + *((unsigned long *)&__m128i_op1[0]) = 0xfffc0020ffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x07fff80000008000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000007ffe001; + __m128i_out = __lsx_vssrlrni_w_d (__m128i_op0, __m128i_op1, 0x25); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrlrni_d_q (__m128i_op0, __m128i_op1, 0x7c); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x03574e3b94f2ca31; + *((unsigned long *)&__m128i_op0[0]) = 0x000000001f807b89; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000005050000; + *((unsigned long *)&__m128i_op1[0]) = 0x0505000005050505; + *((unsigned long *)&__m128i_result[1]) = 0x000d02540000007e; + *((unsigned long *)&__m128i_result[0]) = 0x0000001400140014; + __m128i_out = __lsx_vssrlrni_h_w (__m128i_op0, __m128i_op1, 0x16); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrlrni_du_q (__m128i_op0, __m128i_op1, 0x41); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffff0000ffff0000; + *((unsigned long *)&__m128i_op0[0]) = 0xffff0000ffff0000; + *((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_vssrlrni_du_q (__m128i_op0, __m128i_op1, 0x3b); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x000000000000ffff; + *((unsigned long *)&__m128i_op1[1]) = 0x56a09e662ab46b31; + *((unsigned long *)&__m128i_op1[0]) = 0xb4b8122ef4054bb3; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x02b504f305a5c091; + __m128i_out = __lsx_vssrlrni_w_d (__m128i_op0, __m128i_op1, 0x25); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrlrni_w_d (__m128i_op0, __m128i_op1, 0x37); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000d000d000d000d; + *((unsigned long *)&__m128i_op0[0]) = 0x000d000d000d000d; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000680000006800; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrlrni_w_d (__m128i_op0, __m128i_op1, 0x25); + 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_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrlrni_b_h (__m128i_op0, __m128i_op1, 0xe); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x00005555aaabfffe; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x003fffffff000000; + *((unsigned long *)&__m128i_result[1]) = 0x00000000000000ab; + *((unsigned long *)&__m128i_result[0]) = 0x00000000000000ff; + __m128i_out = __lsx_vssrlrni_h_w (__m128i_op0, __m128i_op1, 0x18); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrlrni_du_q (__m128i_op0, __m128i_op1, 0x43); + 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]) = 0x00ff000000ff0000; + *((unsigned long *)&__m128i_result[1]) = 0x7fff7fff7fff7fff; + *((unsigned long *)&__m128i_result[0]) = 0x000000007fff7fff; + __m128i_out = __lsx_vssrlrni_h_w (__m128i_op0, __m128i_op1, 0x7); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x7fff7fff7fff7fff; + *((unsigned long *)&__m128i_op0[0]) = 0x000000007fff7fff; + *((unsigned long *)&__m128i_op1[1]) = 0xffffff0000000000; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0xffffffff00000080; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vssrlrni_wu_d (__m128i_op0, __m128i_op1, 0x18); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x7fffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000001; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000080000000000; + __m128i_out = __lsx_vssrlrni_wu_d (__m128i_op0, __m128i_op1, 0x34); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x027c027c000027c0; + *((unsigned long *)&__m128i_op1[1]) = 0x000000004f804f81; + *((unsigned long *)&__m128i_op1[0]) = 0x000000004f804f80; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000010000; + *((unsigned long *)&__m128i_result[0]) = 0x0000001400000014; + __m128i_out = __lsx_vssrlrni_h_w (__m128i_op0, __m128i_op1, 0x1a); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000000ff81007c; + *((unsigned long *)&__m128i_op0[0]) = 0xffb7005f0070007c; + *((unsigned long *)&__m128i_op1[1]) = 0xffff80007e028401; + *((unsigned long *)&__m128i_op1[0]) = 0x9a10144000400000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000020; + *((unsigned long *)&__m128i_result[0]) = 0x0000001ffff00010; + __m128i_out = __lsx_vssrlrni_du_q (__m128i_op0, __m128i_op1, 0x5b); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrlrni_wu_d (__m128i_op0, __m128i_op1, 0x29); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000040000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000080000000000; + __m128i_out = __lsx_vssrlrni_hu_w (__m128i_op0, __m128i_op1, 0x7); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffff9cff05; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffff9cfebd; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x000000000000ffff; + *((unsigned long *)&__m128i_result[1]) = 0x7fff7fff7fff7fff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000002; + __m128i_out = __lsx_vssrlrni_h_w (__m128i_op0, __m128i_op1, 0xf); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000002; + *((unsigned long *)&__m128i_op1[1]) = 0xff7ffffef77fffdd; + *((unsigned long *)&__m128i_op1[0]) = 0xf77edf9cffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x7fffffff7fffffff; + __m128i_out = __lsx_vssrlrni_w_d (__m128i_op0, __m128i_op1, 0x1e); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x001fffff001fffff; + *((unsigned long *)&__m128i_op0[0]) = 0x001fffff001fffff; + *((unsigned long *)&__m128i_op1[1]) = 0x21201f1e1d1c1b1a; + *((unsigned long *)&__m128i_op1[0]) = 0x1918171615141312; + *((unsigned long *)&__m128i_result[1]) = 0x10ff10ff10ff10ff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vssrlrni_bu_h (__m128i_op0, __m128i_op1, 0x1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffa6ff91fdd8ef77; + *((unsigned long *)&__m128i_op0[0]) = 0x061202bffb141c38; + *((unsigned long *)&__m128i_op1[1]) = 0x0101010101010101; + *((unsigned long *)&__m128i_op1[0]) = 0x010101fe0101fe87; + *((unsigned long *)&__m128i_result[1]) = 0x0000004000000002; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrlrni_wu_d (__m128i_op0, __m128i_op1, 0x3a); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xffd60001723aa5f8; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x000000007f007f7f; + *((unsigned long *)&__m128i_result[0]) = 0x7f7f7f7f7f7f7f7f; + __m128i_out = __lsx_vssrlrni_b_h (__m128i_op0, __m128i_op1, 0x6); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x808080e280808080; + *((unsigned long *)&__m128i_op0[0]) = 0x8080636380806363; + *((unsigned long *)&__m128i_op1[1]) = 0x808080e280808080; + *((unsigned long *)&__m128i_op1[0]) = 0x8080636380806363; + *((unsigned long *)&__m128i_result[1]) = 0x0004000400040004; + *((unsigned long *)&__m128i_result[0]) = 0x0004000400040004; + __m128i_out = __lsx_vssrlrni_h_w (__m128i_op0, __m128i_op1, 0x1d); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000d0000000d; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000dffff000d; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000070007; + *((unsigned long *)&__m128i_result[0]) = 0x000000000007ffff; + __m128i_out = __lsx_vssrlrni_hu_w (__m128i_op0, __m128i_op1, 0x1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000800c00000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000800000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrlrni_hu_w (__m128i_op0, __m128i_op1, 0x16); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x7fff7fff7fff7fff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x000000007fff7fff; + __m128i_out = __lsx_vssrlrni_h_w (__m128i_op0, __m128i_op1, 0x9); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffff0100ff; + *((unsigned long *)&__m128i_op1[1]) = 0x0607060700000807; + *((unsigned long *)&__m128i_op1[0]) = 0x0707f8f803e8157e; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vssrlrni_du_q (__m128i_op0, __m128i_op1, 0x31); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrlrni_b_h (__m128i_op0, __m128i_op1, 0xd); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrlrni_du_q (__m128i_op0, __m128i_op1, 0x21); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrlrni_b_h (__m128i_op0, __m128i_op1, 0xc); + 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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrlrni_bu_h (__m128i_op0, __m128i_op1, 0x2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xc0808000c0808000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000003020302; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrlrni_h_w (__m128i_op0, __m128i_op1, 0x16); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffc0ff80ff800000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000005; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrlrni_wu_d (__m128i_op0, __m128i_op1, 0x15); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffff0000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffff000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrlrni_bu_h (__m128i_op0, __m128i_op1, 0x4); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrlrni_bu_h (__m128i_op0, __m128i_op1, 0x4); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x7ffffffe00000000; + *((unsigned long *)&__m128i_op1[0]) = 0x7ffffffe00000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vssrlrni_du_q (__m128i_op0, __m128i_op1, 0x3a); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffc0800000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000008080600; + __m128i_out = __lsx_vssrlrni_b_h (__m128i_op0, __m128i_op1, 0xd); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x52525252adadadad; + *((unsigned long *)&__m128i_op0[0]) = 0x52525252adadadad; + *((unsigned long *)&__m128i_op1[1]) = 0x800000007fffffff; + *((unsigned long *)&__m128i_op1[0]) = 0x800000007fffffff; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vssrlrni_hu_w (__m128i_op0, __m128i_op1, 0x6); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x003ef89df07f0000; + *((unsigned long *)&__m128i_op0[0]) = 0x003ec0fc0fbfe001; + *((unsigned long *)&__m128i_op1[1]) = 0x3ff800ff2fe6c00d; + *((unsigned long *)&__m128i_op1[0]) = 0xfff40408ece0e0de; + *((unsigned long *)&__m128i_result[1]) = 0x7fffffff7fffffff; + *((unsigned long *)&__m128i_result[0]) = 0x7fffffff7fffffff; + __m128i_out = __lsx_vssrlrni_w_d (__m128i_op0, __m128i_op1, 0xa); + 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]) = 0x4000400040004000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrlrni_h_w (__m128i_op0, __m128i_op1, 0x12); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrlrni_h_w (__m128i_op0, __m128i_op1, 0x2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000ff960001005b; + *((unsigned long *)&__m128i_op0[0]) = 0x0000ffa500010003; + *((unsigned long *)&__m128i_op1[1]) = 0xffffff7ffffffffe; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000fffffffe; + *((unsigned long *)&__m128i_result[1]) = 0x0000002000000020; + *((unsigned long *)&__m128i_result[0]) = 0x0020000000000000; + __m128i_out = __lsx_vssrlrni_w_d (__m128i_op0, __m128i_op1, 0x2b); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x8000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x1748c4f9ed1a5870; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x7fffffffffffffff; + __m128i_out = __lsx_vssrlrni_d_q (__m128i_op0, __m128i_op1, 0x1c); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffff7ffffffffe; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000fffffffe; + *((unsigned long *)&__m128i_op1[1]) = 0xfcfcfcdcfcfcfcdc; + *((unsigned long *)&__m128i_op1[0]) = 0xfcfcfcdcfcfcfcdc; + *((unsigned long *)&__m128i_result[1]) = 0x0010001000000010; + *((unsigned long *)&__m128i_result[0]) = 0x0010001000100010; + __m128i_out = __lsx_vssrlrni_hu_w (__m128i_op0, __m128i_op1, 0x1c); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000002000000020; + *((unsigned long *)&__m128i_op0[0]) = 0x0000001f0000001f; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x4000000040000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrlrni_du_q (__m128i_op0, __m128i_op1, 0x27); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrlrni_w_d (__m128i_op0, __m128i_op1, 0x28); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrlrni_du_q (__m128i_op0, __m128i_op1, 0x26); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x117d7f7b093d187f; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000034; + *((unsigned long *)&__m128i_op1[1]) = 0xfe1bfefe00011ee1; + *((unsigned long *)&__m128i_op1[0]) = 0xfe1bfe6c03824c60; + *((unsigned long *)&__m128i_result[1]) = 0x7f7f7f7f0000001a; + *((unsigned long *)&__m128i_result[0]) = 0x7f7f017f7f7f7f7f; + __m128i_out = __lsx_vssrlrni_b_h (__m128i_op0, __m128i_op1, 0x1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffff3a81ffff89fd; + *((unsigned long *)&__m128i_op1[0]) = 0xffffb3c3ffff51ba; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0802080408060803; + __m128i_out = __lsx_vssrlrni_b_h (__m128i_op0, __m128i_op1, 0xd); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffff00ffffff00ff; + *((unsigned long *)&__m128i_op0[0]) = 0xffff0000ffff0000; + *((unsigned long *)&__m128i_op1[1]) = 0x00ff00ff00ff00ff; + *((unsigned long *)&__m128i_op1[0]) = 0x00ff000900ffff98; + *((unsigned long *)&__m128i_result[1]) = 0x7fffffff7fffffff; + *((unsigned long *)&__m128i_result[0]) = 0x7fffffff7fffffff; + __m128i_out = __lsx_vssrlrni_w_d (__m128i_op0, __m128i_op1, 0xf); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + unsigned_int_out = __lsx_vpickve2gr_bu (__m128i_op0, 0xc); + *((unsigned long *)&__m128i_op0[1]) = 0x0000000056000056; + *((unsigned long *)&__m128i_op0[0]) = 0x3a8000003a800000; + *((unsigned long *)&__m128i_op1[1]) = 0x00000000efffefff; + *((unsigned long *)&__m128i_op1[0]) = 0xa03aa03ae3e2e3e2; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrlrni_d_q (__m128i_op0, __m128i_op1, 0x75); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000760151; + *((unsigned long *)&__m128i_op0[0]) = 0x003e0021009a009a; + *((unsigned long *)&__m128i_op1[1]) = 0x00000000246d9755; + *((unsigned long *)&__m128i_op1[0]) = 0x0000003e2427c2ee; + *((unsigned long *)&__m128i_result[1]) = 0x00001e5410082727; + *((unsigned long *)&__m128i_result[0]) = 0x00007f7f00107f7f; + __m128i_out = __lsx_vssrlrni_b_h (__m128i_op0, __m128i_op1, 0x2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000000f1384; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x00000000000004ff; + *((unsigned long *)&__m128i_result[0]) = 0x00000000ffffffff; + __m128i_out = __lsx_vssrlrni_bu_h (__m128i_op0, __m128i_op1, 0x2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x10f8000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vssrlrni_h_w (__m128i_op0, __m128i_op1, 0x1e); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} From patchwork Wed Sep 13 03:35:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: chenxiaolong X-Patchwork-Id: 138600 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9ecd:0:b0:3f2:4152:657d with SMTP id t13csp834583vqx; Tue, 12 Sep 2023 20:49:10 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE/mjwD6idNuWkVDaElK9SWkTROlsylqCQ+UqAAnnnklhvOPEUNp+FOzZ+HqXDnxAov6PC9 X-Received: by 2002:a5d:595a:0:b0:31a:e376:6bd6 with SMTP id e26-20020a5d595a000000b0031ae3766bd6mr1130473wri.45.1694576950247; Tue, 12 Sep 2023 20:49:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694576950; cv=none; d=google.com; s=arc-20160816; b=dS42PHcKZuG+0xOKE6omRa5esTFe/YRy96POrzCphP7Kgoyr/A2aym+QWd7wbI1Kn9 7OwYz6bztKbItH4YxX8UySy7syqBId3RqKCFNO6x2TowDVFcs+I7MvLgH/r98FqyIHNW WrYu2UE8BGbVhupXV0XEPFqjEtuA3rHlx1TvY+ldRP9VtOVFp5M8IMfMCegOo86hKoNG xFRqWFOzIuK2SlEijgZbxn4CBOP1ggQZKzk8ZrU49bKPQzsrp+B0K6f8uI2PWkfWzRkM 3b20MVA43l3cWa4NDbZCtZS95kgi6BL3Rt2re5iU+Vj0MnQsf2Tlr2Pe2rpVqCSlgobq KZ5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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:cc:to :from:dmarc-filter:delivered-to; bh=5l4DaTifhJ0ZKKi5vEe8x/vY/ykPpl2FohcvJmCZ4r0=; fh=3pFUYcpS/27XRzOf17GfR86AuNQu+P1CET04YURgCLs=; b=aRGc8BR5kHrXS60WkeZMFreHQquW/0CoLfD1fN55WiBV/6WXf1rexWm/SiWn2G4TXg K4estiUEe0n1mswhMh9NUgPjvmxHrgWumvHWmMYjJshdDikQvXuA6E6OyQki4O2UQ5Mt v1aOljmAJHaGc1Fx8FpgMSnVxyM6kU+yiHWEILADBdd1d88P1YxmkKWbqDdAJRADp4AJ cL6sQ4vg9hvLIUI2l6EMGiSIdU/Xw9e7JHmq9IqF1jke5RZ1K3JbpM29pxSXVStIsqWm dKfMgt7l5agEU3u41cXZPd88rUz87VagiSZ5s2DIrlQo/RqI55bvg84OPpT7Wy+cb+Xp gVjw== 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 p13-20020aa7d30d000000b0052a48a85a1bsi9714696edq.567.2023.09.12.20.49.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Sep 2023 20:49:10 -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 82C88395BC45 for ; Wed, 13 Sep 2023 03:38:24 +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 7FED6382E696 for ; Wed, 13 Sep 2023 03:35:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7FED6382E696 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 1qgGfI-0003Az-Eg for gcc-patches@gcc.gnu.org; Tue, 12 Sep 2023 23:35:50 -0400 Received: from loongson.cn (unknown [10.10.130.252]) by gateway (Coremail) with SMTP id _____8BxpPANLgFl2TAmAA--.8585S3; Wed, 13 Sep 2023 11:35:41 +0800 (CST) Received: from slurm-master.loongson.cn (unknown [10.10.130.252]) by localhost.localdomain (Coremail) with SMTP id AQAAf8Cx7y_8LQFlvA8CAA--.3484S11; Wed, 13 Sep 2023 11:35:41 +0800 (CST) From: Xiaolong Chen To: gcc-patches@gcc.gnu.org Cc: xry111@xry111.site, i@xen0n.name, xuchenghua@loongson.cn, chenglulu@loongson.cn, Xiaolong Chen Subject: [PATCH v4 17/23] LoongArch: Add tests for SX vector vbitclr/vbitclri/vbitrev/vbitrevi/ vbitsel/vbitseli/vbitset/vbitseti/vclo/vclz/vpcnt instructions. Date: Wed, 13 Sep 2023 11:35:20 +0800 Message-Id: <20230913033522.5983-8-chenxiaolong@loongson.cn> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230913033522.5983-1-chenxiaolong@loongson.cn> References: <20230913033522.5983-1-chenxiaolong@loongson.cn> MIME-Version: 1.0 X-CM-TRANSID: AQAAf8Cx7y_8LQFlvA8CAA--.3484S11 X-CM-SenderInfo: hfkh05xldrz0tqj6z05rqj20fqof0/1tbiAQANBWUBHCIBDwAAsd X-Coremail-Antispam: 1Uk129KBj98XoW3Jr45GFyxZF15CoXrpr4xGry8GoWUAa4UZw 4rCFZxX3W5tw13X34fKFyYk3Z3Cr18Awn0yw4DJw4Ivry7ZFs8JF1Utw1ayrW3Zw15Wr4x J348Ar1kl-sFpf9Il3svdjkaLaAFLSUrUUUUjb8apTn2vfkv8UJUUUU8wcxFpf9Il3svdx BIdaVrn0xqx4xG64xvF2IEw4CE5I8CrVC2j2Jv73VFW2AGmfu7bjvjm3AaLaJ3UjIYCTnI Wjp_UUUY57kC6x804xWl14x267AKxVWUJVW8JwAFc2x0x2IEx4CE42xK8VAvwI8IcIk0rV WrJVCq3wAFIxvE14AKwVWUGVWUXwA2ocxC64kIII0Yj41l84x0c7CEw4AK67xGY2AK021l 84ACjcxK6xIIjxv20xvE14v26F1j6w1UM28EF7xvwVC0I7IYx2IY6xkF7I0E14v26F4j6r 4UJwA2z4x0Y4vEx4A2jsIE14v26r4UJVWxJr1l84ACjcxK6I8E87Iv6xkF7I0E14v26r4U JVWxJr1le2I262IYc4CY6c8Ij28IcVAaY2xG8wAqjxCEc2xF0cIa020Ex4CE44I27wAqx4 xG64xvF2IEw4CE5I8CrVC2j2WlYx0E2Ix0cI8IcVAFwI0_Wrv_ZF1lYx0Ex4A2jsIE14v2 6F4j6r4UJwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IYc2Ij64vIr41l42xK82IYc2Ij64 vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2IqxVAqx4xG67AKxVWUJVWUGwC20s026x8G jcxK67AKxVWUGVWUWwC2zVAF1VAY17CE14v26r126r1DMIIYrxkI7VAKI48JMIIF0xvE2I x0cI8IcVAFwI0_Ar0_tr1lIxAIcVC0I7IYx2IY6xkF7I0E14v26F4j6r4UJwCI42IY6xAI w20EY4v20xvaj40_Jr0_JF4lIxAIcVC2z280aVAFwI0_Cr0_Gr1UMIIF0xvEx4A2jsIEc7 CjxVAFwI0_Gr0_Gr1UYxBIdaVFxhVjvjDU0xZFpf9x07jzuWLUUUUU= 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.8 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: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1776892719839520488 X-GMAIL-MSGID: 1776892719839520488 gcc/testsuite/ChangeLog: * gcc.target/loongarch/vector/lsx/lsx-vbitclr.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vbitclri.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vbitrev.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vbitrevi.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vbitsel.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vbitseli.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vbitset.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vbitseti.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vclo.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vclz.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vpcnt.c: New test. --- .../loongarch/vector/lsx/lsx-vbitclr.c | 461 ++++++++++++++++++ .../loongarch/vector/lsx/lsx-vbitclri.c | 279 +++++++++++ .../loongarch/vector/lsx/lsx-vbitrev.c | 407 ++++++++++++++++ .../loongarch/vector/lsx/lsx-vbitrevi.c | 336 +++++++++++++ .../loongarch/vector/lsx/lsx-vbitsel.c | 109 +++++ .../loongarch/vector/lsx/lsx-vbitseli.c | 84 ++++ .../loongarch/vector/lsx/lsx-vbitset.c | 371 ++++++++++++++ .../loongarch/vector/lsx/lsx-vbitseti.c | 279 +++++++++++ .../loongarch/vector/lsx/lsx-vclo.c | 266 ++++++++++ .../loongarch/vector/lsx/lsx-vclz.c | 265 ++++++++++ .../loongarch/vector/lsx/lsx-vpcnt.c | 350 +++++++++++++ 11 files changed, 3207 insertions(+) create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vbitclr.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vbitclri.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vbitrev.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vbitrevi.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vbitsel.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vbitseli.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vbitset.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vbitseti.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vclo.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vclz.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vpcnt.c diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vbitclr.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vbitclr.c new file mode 100644 index 00000000000..411dcaa4034 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vbitclr.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_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vbitclr_d (__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]) = 0x00e0000000e00000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x000000e0000000e0; + __m128i_out = __lsx_vbitclr_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_vbitclr_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]) = 0x0000000000004000; + *((unsigned long *)&__m128i_op1[0]) = 0xfff8004000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vbitclr_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_vbitclr_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x19df307a5d04acbb; + *((unsigned long *)&__m128i_op0[0]) = 0x5ed032b06bde1ab6; + *((unsigned long *)&__m128i_op1[1]) = 0x0080000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0080000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x19de307a5d04acba; + *((unsigned long *)&__m128i_result[0]) = 0x5ed032b06bde1ab6; + __m128i_out = __lsx_vbitclr_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]) = 0x0018001800180018; + *((unsigned long *)&__m128i_op1[0]) = 0x0018001800180018; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vbitclr_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xd8248069ffe78077; + *((unsigned long *)&__m128i_op1[1]) = 0x85bd6b0e94d89998; + *((unsigned long *)&__m128i_op1[0]) = 0xd83c8081ffff808f; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xd82480697f678077; + __m128i_out = __lsx_vbitclr_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000000006597cc3d; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000001; + *((unsigned long *)&__m128i_op1[1]) = 0x7505853d654185f5; + *((unsigned long *)&__m128i_op1[0]) = 0x01010000fefe0101; + *((unsigned long *)&__m128i_result[1]) = 0x000000006595cc1d; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000001; + __m128i_out = __lsx_vbitclr_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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xfffe0000fffe0000; + *((unsigned long *)&__m128i_result[0]) = 0xfffe0000fffe0000; + __m128i_out = __lsx_vbitclr_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_op0[0]) = 0x80000000fff7fc01; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000100000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000080000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x80000000fff6fc00; + __m128i_out = __lsx_vbitclr_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_vbitclr_w (__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]) = 0x00000000fffefffe; + *((unsigned long *)&__m128i_result[0]) = 0x00000000fffef800; + __m128i_out = __lsx_vbitclr_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]) = 0x0000000001000100; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000001000100; + *((unsigned long *)&__m128i_result[1]) = 0xfffffffefffffffe; + *((unsigned long *)&__m128i_result[0]) = 0xfffffffefffffffe; + __m128i_out = __lsx_vbitclr_w (__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]) = 0x0000000100000001; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000100000001; + *((unsigned long *)&__m128i_result[1]) = 0x4101010141010100; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vbitclr_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]) = 0x23b57fa16d39f7c8; + *((unsigned long *)&__m128i_op1[0]) = 0x161c0c363c200824; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vbitclr_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x8000ffff00000000; + *((unsigned long *)&__m128i_op0[0]) = 0x8000ffff00000000; + *((unsigned long *)&__m128i_op1[1]) = 0x3f8000003f800000; + *((unsigned long *)&__m128i_op1[0]) = 0x3f8000003f800000; + *((unsigned long *)&__m128i_result[1]) = 0x0000fefe00000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000fefe00000000; + __m128i_out = __lsx_vbitclr_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]) = 0x1ffffffff8001000; + *((unsigned long *)&__m128i_op1[0]) = 0xf0bd80bd80bd8000; + *((unsigned long *)&__m128i_result[1]) = 0x7fff7ffffffefffe; + *((unsigned long *)&__m128i_result[0]) = 0xdfffdfffdffffffe; + __m128i_out = __lsx_vbitclr_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000037; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000001f0a; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000036; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vbitclr_b (__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]) = 0x000100000001007c; + *((unsigned long *)&__m128i_result[0]) = 0x0001000000010000; + __m128i_out = __lsx_vbitclr_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_vbitclr_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfefa000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xfefa000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vbitclr_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x67b7cf643c9d636a; + *((unsigned long *)&__m128i_op0[0]) = 0x39d70e366f547977; + *((unsigned long *)&__m128i_op1[1]) = 0x0002ffff00000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x66b34f643c9c626a; + *((unsigned long *)&__m128i_result[0]) = 0x38d60e366e547876; + __m128i_out = __lsx_vbitclr_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_vbitclr_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x2020202020202020; + *((unsigned long *)&__m128i_op0[0]) = 0x2020202020207fff; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000007fff; + *((unsigned long *)&__m128i_result[1]) = 0x2020202020202020; + *((unsigned long *)&__m128i_result[0]) = 0x2020202020207f7f; + __m128i_out = __lsx_vbitclr_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_vbitclr_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]) = 0x8080808080808080; + *((unsigned long *)&__m128i_op1[0]) = 0x8080808080808080; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vbitclr_d (__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]) = 0x0000000000000005; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000005; + *((unsigned long *)&__m128i_result[1]) = 0x7ef8000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x7ef8000000000000; + __m128i_out = __lsx_vbitclr_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffff0000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000077f97; + *((unsigned long *)&__m128i_result[1]) = 0xfffffffefffffffe; + *((unsigned long *)&__m128i_result[0]) = 0xfffffffeff7f0000; + __m128i_out = __lsx_vbitclr_w (__m128i_op0, __m128i_op1); + 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_result[1]) = 0x14ccc6320076a4d2; + *((unsigned long *)&__m128i_result[0]) = 0x685670d27e00682a; + __m128i_out = __lsx_vbitclr_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]) = 0x003fffff00000000; + *((unsigned long *)&__m128i_op1[0]) = 0x003fffff00000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vbitclr_d (__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]) = 0x00001b4a00007808; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000001000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000001000; + __m128i_out = __lsx_vbitclr_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0100010001000100; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x000000007fff7fff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000001000100; + __m128i_out = __lsx_vbitclr_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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x5d7f5d007f6a007f; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vbitclr_b (__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]) = 0x00000000fffefffe; + *((unsigned long *)&__m128i_result[0]) = 0x00000000fffefffe; + __m128i_out = __lsx_vbitclr_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_vbitclr_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_vbitclr_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x207fffff22bd04fb; + *((unsigned long *)&__m128i_op0[0]) = 0x207fffff22bd04fb; + *((unsigned long *)&__m128i_op1[1]) = 0x0001000002000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0001000002000000; + *((unsigned long *)&__m128i_result[1]) = 0x207fffff22bd04fa; + *((unsigned long *)&__m128i_result[0]) = 0x207fffff22bd04fa; + __m128i_out = __lsx_vbitclr_d (__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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xfffefffefffefffe; + __m128i_out = __lsx_vbitclr_h (__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]) = 0x0001000101010001; + *((unsigned long *)&__m128i_op1[0]) = 0x0001000100010001; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000014; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000014; + __m128i_out = __lsx_vbitclr_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_vbitclr_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]) = 0x000000000000ffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vbitclr_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_vbitclr_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000100000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0001000100000000; + *((unsigned long *)&__m128i_op1[1]) = 0x6363636363636363; + *((unsigned long *)&__m128i_op1[0]) = 0x6363636363636363; + *((unsigned long *)&__m128i_result[1]) = 0x0000000100000000; + *((unsigned long *)&__m128i_result[0]) = 0x0001000100000000; + __m128i_out = __lsx_vbitclr_b (__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]) = 0x00000000b81c8382; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000077af9450; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00007efe7f7f8000; + __m128i_out = __lsx_vbitclr_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_vbitclr_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]) = 0x0001000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0001000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vbitclr_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000000000667ae56; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000020; + *((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_vbitclr_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_vbitclr_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vbitclri.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vbitclri.c new file mode 100644 index 00000000000..5d7d66e062f --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vbitclri.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]) = 0x0000000000000001; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000001; + __m128i_out = __lsx_vbitclri_h (__m128i_op0, 0xc); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000b0000000b; + *((unsigned long *)&__m128i_op0[0]) = 0x000201000000000b; + *((unsigned long *)&__m128i_result[1]) = 0x0000000b0000000b; + *((unsigned long *)&__m128i_result[0]) = 0x000201000000000b; + __m128i_out = __lsx_vbitclri_d (__m128i_op0, 0x4); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x004200a000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x004200a000200000; + *((unsigned long *)&__m128i_result[1]) = 0x004200a000000000; + *((unsigned long *)&__m128i_result[0]) = 0x004200a000200000; + __m128i_out = __lsx_vbitclri_h (__m128i_op0, 0x4); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x00000000efffffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vbitclri_w (__m128i_op0, 0x1c); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000002ff5; + *((unsigned long *)&__m128i_op0[0]) = 0xc2cf2471e9b7d7a4; + *((unsigned long *)&__m128i_result[1]) = 0x00000000000027f5; + *((unsigned long *)&__m128i_result[0]) = 0xc2cf2471e9b7d7a4; + __m128i_out = __lsx_vbitclri_w (__m128i_op0, 0xb); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x7505443065413aed; + *((unsigned long *)&__m128i_op0[0]) = 0x0100d6effefd0498; + *((unsigned long *)&__m128i_result[1]) = 0x7404443064403aec; + *((unsigned long *)&__m128i_result[0]) = 0x0000d6eefefc0498; + __m128i_out = __lsx_vbitclri_b (__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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vbitclri_d (__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_vbitclri_d (__m128i_op0, 0x36); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x64b680a2ae3af8ca; + *((unsigned long *)&__m128i_op0[0]) = 0x161c0c363c200826; + *((unsigned long *)&__m128i_result[1]) = 0x64b680a2ae3af8c8; + *((unsigned long *)&__m128i_result[0]) = 0x161c0c363c200824; + __m128i_out = __lsx_vbitclri_d (__m128i_op0, 0x1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfffffffffffffffe; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xbfffbfffbfffbffe; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vbitclri_h (__m128i_op0, 0xe); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xff807f807f807f80; + *((unsigned long *)&__m128i_op0[0]) = 0xff807f807f807f80; + *((unsigned long *)&__m128i_result[1]) = 0xfb807b807b807b80; + *((unsigned long *)&__m128i_result[0]) = 0xfb807b807b807b80; + __m128i_out = __lsx_vbitclri_b (__m128i_op0, 0x2); + 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_vbitclri_w (__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_vbitclri_w (__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_vbitclri_h (__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_vbitclri_w (__m128i_op0, 0x0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0xfbffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xfbffffffffffffff; + __m128i_out = __lsx_vbitclri_d (__m128i_op0, 0x3a); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x9941d1d5f4ba9d08; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x9941d155f43a9d08; + __m128i_out = __lsx_vbitclri_h (__m128i_op0, 0x7); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0xffffffbfffffffbf; + *((unsigned long *)&__m128i_result[0]) = 0xffffffbfffffffbf; + __m128i_out = __lsx_vbitclri_w (__m128i_op0, 0x6); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x03f1e3d28b1a8a1a; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x03f1e3d28b1a8a1a; + __m128i_out = __lsx_vbitclri_d (__m128i_op0, 0x5); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffda6f; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffe3d7; + *((unsigned long *)&__m128i_result[1]) = 0xfefffffffeffda6f; + *((unsigned long *)&__m128i_result[0]) = 0xfefffffffeffe3d7; + __m128i_out = __lsx_vbitclri_w (__m128i_op0, 0x18); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000001; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000001; + __m128i_out = __lsx_vbitclri_d (__m128i_op0, 0x26); + 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_vbitclri_d (__m128i_op0, 0x30); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000040; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000040; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000040; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000040; + __m128i_out = __lsx_vbitclri_b (__m128i_op0, 0x4); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x8080808080638063; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x8080808080638063; + __m128i_out = __lsx_vbitclri_h (__m128i_op0, 0x8); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0004000400040004; + *((unsigned long *)&__m128i_op0[0]) = 0x0004000400040004; + *((unsigned long *)&__m128i_result[1]) = 0x0004000400040004; + *((unsigned long *)&__m128i_result[0]) = 0x0004000400040004; + __m128i_out = __lsx_vbitclri_h (__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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vbitclri_w (__m128i_op0, 0x1c); + 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_vbitclri_d (__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_vbitclri_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_vbitclri_w (__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_vbitclri_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_vbitclri_d (__m128i_op0, 0x5); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000800000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vbitclri_w (__m128i_op0, 0x3); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000200008; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000200000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000200008; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000200000; + __m128i_out = __lsx_vbitclri_b (__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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vbitclri_b (__m128i_op0, 0x5); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000200000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0002000200000001; + *((unsigned long *)&__m128i_result[1]) = 0x0000000200000000; + *((unsigned long *)&__m128i_result[0]) = 0x0002000200000001; + __m128i_out = __lsx_vbitclri_b (__m128i_op0, 0x7); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0xdfdfdfdfdfdfdfdf; + *((unsigned long *)&__m128i_result[0]) = 0xdfdfdfdfdfdfdfdf; + __m128i_out = __lsx_vbitclri_b (__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_vbitclri_h (__m128i_op0, 0xb); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vbitrev.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vbitrev.c new file mode 100644 index 00000000000..ba4f4b6dc07 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vbitrev.c @@ -0,0 +1,407 @@ +/* { 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]) = 0x1b71a083b3dec3cd; + *((unsigned long *)&__m128i_op1[0]) = 0x373a13323b4cdbc1; + *((unsigned long *)&__m128i_result[1]) = 0x0802010808400820; + *((unsigned long *)&__m128i_result[0]) = 0x8004080408100802; + __m128i_out = __lsx_vbitrev_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]) = 0x0000800000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000100000001; + *((unsigned long *)&__m128i_result[0]) = 0x0000000100000001; + __m128i_out = __lsx_vbitrev_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]) = 0x0000000000000001; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000001; + __m128i_out = __lsx_vbitrev_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]) = 0x8000800080008000; + *((unsigned long *)&__m128i_result[0]) = 0x8000800080008000; + __m128i_out = __lsx_vbitrev_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000501000002; + *((unsigned long *)&__m128i_op0[0]) = 0x0001000100000008; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000040100; + *((unsigned long *)&__m128i_op1[0]) = 0x0001000100010000; + *((unsigned long *)&__m128i_result[1]) = 0x0101010400100203; + *((unsigned long *)&__m128i_result[0]) = 0x0103010301020109; + __m128i_out = __lsx_vbitrev_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfffffffffffffffe; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffbe6ed563; + *((unsigned long *)&__m128i_op1[1]) = 0xd0b1ffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0x9d519ee8d2d84f1d; + *((unsigned long *)&__m128i_result[1]) = 0xfefd7f7f7f7f7f7e; + *((unsigned long *)&__m128i_result[0]) = 0xdffdbffeba6f5543; + __m128i_out = __lsx_vbitrev_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]) = 0x7da9b23a624082fd; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000ffff0000; + *((unsigned long *)&__m128i_result[1]) = 0x2002040404010420; + *((unsigned long *)&__m128i_result[0]) = 0x0101010180800101; + __m128i_out = __lsx_vbitrev_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000fffe0000ffff; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0001000100010001; + *((unsigned long *)&__m128i_result[0]) = 0x0001ffff0001fffe; + __m128i_out = __lsx_vbitrev_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]) = 0x0e7ffffc01fffffc; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000003f803f4; + *((unsigned long *)&__m128i_result[1]) = 0x1000000010000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000100100000; + __m128i_out = __lsx_vbitrev_w (__m128i_op0, __m128i_op1); + 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_result[1]) = 0x0501050105010501; + *((unsigned long *)&__m128i_result[0]) = 0x050105010501050c; + __m128i_out = __lsx_vbitrev_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]) = 0x0000000000000001; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000001; + __m128i_out = __lsx_vbitrev_d (__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]) = 0x8000000080000000; + *((unsigned long *)&__m128i_op1[0]) = 0x8000000080000000; + *((unsigned long *)&__m128i_result[1]) = 0x0001000100010001; + *((unsigned long *)&__m128i_result[0]) = 0x000100010001fffe; + __m128i_out = __lsx_vbitrev_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfffffffefffffffe; + *((unsigned long *)&__m128i_op0[0]) = 0xfffffffefffffffe; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000007f00000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x7ffffffeffffffff; + __m128i_out = __lsx_vbitrev_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0040000000400000; + *((unsigned long *)&__m128i_op0[0]) = 0x0040000000400000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0141010101410101; + *((unsigned long *)&__m128i_result[0]) = 0x0141010101410101; + __m128i_out = __lsx_vbitrev_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x65b780a3ae3bf8cb; + *((unsigned long *)&__m128i_op0[0]) = 0x161d0c363c200826; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x65b780a2ae3bf8ca; + *((unsigned long *)&__m128i_result[0]) = 0x161d0c373c200827; + __m128i_out = __lsx_vbitrev_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]) = 0xfe01fe01fe01fe01; + *((unsigned long *)&__m128i_result[0]) = 0xfe01fe01fe01fe01; + __m128i_out = __lsx_vbitrev_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]) = 0x0000000100000001; + *((unsigned long *)&__m128i_result[0]) = 0x0000000100000001; + __m128i_out = __lsx_vbitrev_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]) = 0x000000003bfb4000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000100000001; + *((unsigned long *)&__m128i_result[0]) = 0x0000000100000001; + __m128i_out = __lsx_vbitrev_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]) = 0x0001000100010001; + *((unsigned long *)&__m128i_result[0]) = 0x0001000100010001; + __m128i_out = __lsx_vbitrev_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]) = 0x0000000100000001; + *((unsigned long *)&__m128i_result[0]) = 0x0000000100000001; + __m128i_out = __lsx_vbitrev_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]) = 0x0040004000400040; + *((unsigned long *)&__m128i_op1[0]) = 0x0040004000400040; + *((unsigned long *)&__m128i_result[1]) = 0x0101010101010101; + *((unsigned long *)&__m128i_result[0]) = 0x0101010101010101; + __m128i_out = __lsx_vbitrev_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000021ffffffdf; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000100000e60; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x1ff85ffe2ae5d973; + *((unsigned long *)&__m128i_result[1]) = 0x00010020fffeffde; + *((unsigned long *)&__m128i_result[0]) = 0x0100400100200e68; + __m128i_out = __lsx_vbitrev_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]) = 0x00d3012acc56f9bb; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000001021; + *((unsigned long *)&__m128i_result[1]) = 0x0108020410400208; + *((unsigned long *)&__m128i_result[0]) = 0x0101010101010102; + __m128i_out = __lsx_vbitrev_b (__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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0101010101010101; + *((unsigned long *)&__m128i_result[0]) = 0x010101fe0101fe87; + __m128i_out = __lsx_vbitrev_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x343d8dc5b0ed5a08; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0101010101010101; + *((unsigned long *)&__m128i_result[0]) = 0x353c8cc4b1ec5b09; + __m128i_out = __lsx_vbitrev_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0037ffc8d7ff2800; + *((unsigned long *)&__m128i_op0[0]) = 0xff00ff00ffffff00; + *((unsigned long *)&__m128i_op1[1]) = 0x0038d800ff000000; + *((unsigned long *)&__m128i_op1[0]) = 0x00fffe00fffffe00; + *((unsigned long *)&__m128i_result[1]) = 0x0137ffc9d7fe2801; + *((unsigned long *)&__m128i_result[0]) = 0x7f00ff017fffff01; + __m128i_out = __lsx_vbitrev_h (__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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0001200100012001; + *((unsigned long *)&__m128i_result[0]) = 0x0001000100010001; + __m128i_out = __lsx_vbitrev_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]) = 0x0000000000ff00ff; + *((unsigned long *)&__m128i_result[1]) = 0xfffffffefffffffe; + *((unsigned long *)&__m128i_result[0]) = 0xfffffffe7fffffff; + __m128i_out = __lsx_vbitrev_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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0001000100010002; + *((unsigned long *)&__m128i_result[0]) = 0x0001000100010001; + __m128i_out = __lsx_vbitrev_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]) = 0x0000000100000001; + *((unsigned long *)&__m128i_result[0]) = 0x0000000100000001; + __m128i_out = __lsx_vbitrev_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]) = 0xfffffffffffffffc; + *((unsigned long *)&__m128i_result[1]) = 0x8000000080000000; + *((unsigned long *)&__m128i_result[0]) = 0x8000000010000000; + __m128i_out = __lsx_vbitrev_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfffdfffdfffdfffd; + *((unsigned long *)&__m128i_op0[0]) = 0xfffdfffdfffdfffd; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xfffdfffcfffdfffc; + *((unsigned long *)&__m128i_result[0]) = 0xfffdfffcfffdfffc; + __m128i_out = __lsx_vbitrev_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]) = 0x0001000100010001; + *((unsigned long *)&__m128i_result[0]) = 0x0001000100010001; + __m128i_out = __lsx_vbitrev_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0001ffff0101ffff; + *((unsigned long *)&__m128i_op0[0]) = 0x0001ffff0001ffff; + *((unsigned long *)&__m128i_op1[1]) = 0x0001000101010001; + *((unsigned long *)&__m128i_op1[0]) = 0x0001000100010001; + *((unsigned long *)&__m128i_result[1]) = 0x0103fefd0303fefd; + *((unsigned long *)&__m128i_result[0]) = 0x0103fefd0103fefd; + __m128i_out = __lsx_vbitrev_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]) = 0x0000800000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000800000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0001000100010001; + *((unsigned long *)&__m128i_result[0]) = 0x0001000100010001; + __m128i_out = __lsx_vbitrev_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]) = 0x6a5d5b056f2f4978; + *((unsigned long *)&__m128i_op1[0]) = 0x17483c07141b5971; + *((unsigned long *)&__m128i_result[1]) = 0x0000002001000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000008000020000; + __m128i_out = __lsx_vbitrev_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]) = 0xfffefffefffefffe; + *((unsigned long *)&__m128i_result[0]) = 0xfffefffefffefffe; + __m128i_out = __lsx_vbitrev_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]) = 0x00000001ce28f9c0; + *((unsigned long *)&__m128i_op1[0]) = 0x00000004e06b0890; + *((unsigned long *)&__m128i_result[1]) = 0xfefefefdbffefdfe; + *((unsigned long *)&__m128i_result[0]) = 0xfefefeeffef7fefe; + __m128i_out = __lsx_vbitrev_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xff800000ff800000; + *((unsigned long *)&__m128i_op0[0]) = 0xff800000ff800000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_op1[0]) = 0x003ffffe00800000; + *((unsigned long *)&__m128i_result[1]) = 0xff810001ff810002; + *((unsigned long *)&__m128i_result[0]) = 0x7f804000ff810001; + __m128i_out = __lsx_vbitrev_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xff1affff01001fe0; + *((unsigned long *)&__m128i_op0[0]) = 0xff1aff6d02834d70; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000034; + *((unsigned long *)&__m128i_result[1]) = 0xfe1bfefe00011ee1; + *((unsigned long *)&__m128i_result[0]) = 0xfe1bfe6c03824c60; + __m128i_out = __lsx_vbitrev_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x41945926d8000000; + *((unsigned long *)&__m128i_op1[1]) = 0x00001e5410082727; + *((unsigned long *)&__m128i_op1[0]) = 0x00007f7f00107f7f; + *((unsigned long *)&__m128i_result[1]) = 0x0001001001000080; + *((unsigned long *)&__m128i_result[0]) = 0x4195d926d8018000; + __m128i_out = __lsx_vbitrev_h (__m128i_op0, __m128i_op1); + 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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x7f8100017f810001; + *((unsigned long *)&__m128i_result[0]) = 0x7f8100017f810001; + __m128i_out = __lsx_vbitrev_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x545501550001113a; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x8000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xd45501550001113a; + __m128i_out = __lsx_vbitrev_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-vbitrevi.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vbitrevi.c new file mode 100644 index 00000000000..9739182cdd0 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vbitrevi.c @@ -0,0 +1,336 @@ +/* { 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]) = 0x0000000000003004; + *((unsigned long *)&__m128i_result[1]) = 0x0000400000004000; + *((unsigned long *)&__m128i_result[0]) = 0x0000400000007004; + __m128i_out = __lsx_vbitrevi_w (__m128i_op0, 0xe); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0xfeffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xfeffffffffffffff; + __m128i_out = __lsx_vbitrevi_d (__m128i_op0, 0x38); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000100000001; + *((unsigned long *)&__m128i_result[0]) = 0x0000000100000001; + __m128i_out = __lsx_vbitrevi_w (__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]) = 0x4000400040004000; + *((unsigned long *)&__m128i_result[0]) = 0x4000400040004000; + __m128i_out = __lsx_vbitrevi_h (__m128i_op0, 0xe); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000000007fff8000; + *((unsigned long *)&__m128i_op0[0]) = 0x0001008100000005; + *((unsigned long *)&__m128i_result[1]) = 0x0800080077ff8800; + *((unsigned long *)&__m128i_result[0]) = 0x0801088108000805; + __m128i_out = __lsx_vbitrevi_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]) = 0x0202020202020202; + *((unsigned long *)&__m128i_result[0]) = 0x0202020202020202; + __m128i_out = __lsx_vbitrevi_b (__m128i_op0, 0x1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xe86ce7eb5e9ce950; + *((unsigned long *)&__m128i_result[1]) = 0x0404040404040404; + *((unsigned long *)&__m128i_result[0]) = 0xec68e3ef5a98ed54; + __m128i_out = __lsx_vbitrevi_b (__m128i_op0, 0x2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000200010; + *((unsigned long *)&__m128i_result[1]) = 0x0000400000004000; + *((unsigned long *)&__m128i_result[0]) = 0x0000400000204010; + __m128i_out = __lsx_vbitrevi_w (__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]) = 0x0400040004000400; + *((unsigned long *)&__m128i_result[0]) = 0x0400040004000400; + __m128i_out = __lsx_vbitrevi_h (__m128i_op0, 0xa); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000ffffff02; + *((unsigned long *)&__m128i_result[1]) = 0x0400040004000400; + *((unsigned long *)&__m128i_result[0]) = 0x04000400fbfffb02; + __m128i_out = __lsx_vbitrevi_h (__m128i_op0, 0xa); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0010000000100000; + *((unsigned long *)&__m128i_result[0]) = 0x0010000000100000; + __m128i_out = __lsx_vbitrevi_w (__m128i_op0, 0x14); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x000000000000000d; + *((unsigned long *)&__m128i_result[1]) = 0x0400040004000400; + *((unsigned long *)&__m128i_result[0]) = 0x040004000400040d; + __m128i_out = __lsx_vbitrevi_h (__m128i_op0, 0xa); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000000004f804f81; + *((unsigned long *)&__m128i_op0[0]) = 0x000000004f804f80; + *((unsigned long *)&__m128i_result[1]) = 0x000000004fc04f81; + *((unsigned long *)&__m128i_result[0]) = 0x000000004fc04f80; + __m128i_out = __lsx_vbitrevi_d (__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]) = 0x0040004000400040; + *((unsigned long *)&__m128i_result[0]) = 0x0040004000400040; + __m128i_out = __lsx_vbitrevi_h (__m128i_op0, 0x6); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x1010101010101010; + *((unsigned long *)&__m128i_result[0]) = 0xefefefefefefefef; + __m128i_out = __lsx_vbitrevi_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]) = 0x4040404040404040; + *((unsigned long *)&__m128i_result[0]) = 0x4040404040404040; + __m128i_out = __lsx_vbitrevi_b (__m128i_op0, 0x6); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x21201f1e1d1c1b1a; + *((unsigned long *)&__m128i_op0[0]) = 0x1918171615141312; + *((unsigned long *)&__m128i_result[1]) = 0x01203f1e3d1c3b1a; + *((unsigned long *)&__m128i_result[0]) = 0x3918371635143312; + __m128i_out = __lsx_vbitrevi_h (__m128i_op0, 0xd); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x7ff0000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x61608654a2d4f6da; + *((unsigned long *)&__m128i_result[1]) = 0xfff0800080008000; + *((unsigned long *)&__m128i_result[0]) = 0xe160065422d476da; + __m128i_out = __lsx_vbitrevi_h (__m128i_op0, 0xf); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x37c0001000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x37c0001000000000; + *((unsigned long *)&__m128i_result[1]) = 0x77c0401040004000; + *((unsigned long *)&__m128i_result[0]) = 0x77c0401040004000; + __m128i_out = __lsx_vbitrevi_h (__m128i_op0, 0xe); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x77c0404a4000403a; + *((unsigned long *)&__m128i_op0[0]) = 0x77c03fd640003fc6; + *((unsigned long *)&__m128i_result[1]) = 0x75c0404a4200403a; + *((unsigned long *)&__m128i_result[0]) = 0x75c03fd642003fc6; + __m128i_out = __lsx_vbitrevi_w (__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]) = 0x0808080808080808; + *((unsigned long *)&__m128i_result[0]) = 0x0808080808080808; + __m128i_out = __lsx_vbitrevi_b (__m128i_op0, 0x3); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0808080808080808; + *((unsigned long *)&__m128i_op0[0]) = 0x0808080808080808; + *((unsigned long *)&__m128i_result[1]) = 0x0808080808280808; + *((unsigned long *)&__m128i_result[0]) = 0x0808080808280808; + __m128i_out = __lsx_vbitrevi_d (__m128i_op0, 0x15); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_result[1]) = 0xfffffefffffffeff; + *((unsigned long *)&__m128i_result[0]) = 0x00000100fffffeff; + __m128i_out = __lsx_vbitrevi_w (__m128i_op0, 0x8); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000010000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000010000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0404050404040404; + *((unsigned long *)&__m128i_result[0]) = 0x0404050404040404; + __m128i_out = __lsx_vbitrevi_b (__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]) = 0x1000100010001000; + *((unsigned long *)&__m128i_result[0]) = 0x1000100010001000; + __m128i_out = __lsx_vbitrevi_h (__m128i_op0, 0xc); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0xbfbfbfbfbfbfbfbf; + *((unsigned long *)&__m128i_result[0]) = 0xbfbfbfbfbfbfbfbf; + __m128i_out = __lsx_vbitrevi_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]) = 0x0000000040000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000040000000; + __m128i_out = __lsx_vbitrevi_d (__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]) = 0x0000000000020000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000020000; + __m128i_out = __lsx_vbitrevi_d (__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]) = 0x2000200020002000; + *((unsigned long *)&__m128i_result[0]) = 0x2000200020002000; + __m128i_out = __lsx_vbitrevi_h (__m128i_op0, 0xd); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x441ba9fcffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0x181b2541ffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x401fadf8fbfbfbfb; + *((unsigned long *)&__m128i_result[0]) = 0x1c1f2145fbfbfbfb; + __m128i_out = __lsx_vbitrevi_b (__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]) = 0x0000000000000100; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000100; + __m128i_out = __lsx_vbitrevi_d (__m128i_op0, 0x8); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffefff00001000; + *((unsigned long *)&__m128i_result[0]) = 0xffffefff00001000; + __m128i_out = __lsx_vbitrevi_w (__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]) = 0x8080808080808080; + *((unsigned long *)&__m128i_result[0]) = 0x8080808080808080; + __m128i_out = __lsx_vbitrevi_b (__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]) = 0x0000000200000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000200000000; + __m128i_out = __lsx_vbitrevi_d (__m128i_op0, 0x21); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000002000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000002000; + __m128i_out = __lsx_vbitrevi_d (__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]) = 0x0000010000000100; + *((unsigned long *)&__m128i_result[0]) = 0x0000010000000100; + __m128i_out = __lsx_vbitrevi_w (__m128i_op0, 0x8); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xd6a09e662ab46b31; + *((unsigned long *)&__m128i_op0[0]) = 0x34b8122ef4054bb3; + *((unsigned long *)&__m128i_result[1]) = 0xd6e09e262af46b71; + *((unsigned long *)&__m128i_result[0]) = 0x34f8126ef4454bf3; + __m128i_out = __lsx_vbitrevi_h (__m128i_op0, 0x6); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000008; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000200008; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000200000; + __m128i_out = __lsx_vbitrevi_d (__m128i_op0, 0x15); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfefefefdbffefdfe; + *((unsigned long *)&__m128i_op0[0]) = 0xfefefeeffef7feff; + *((unsigned long *)&__m128i_result[1]) = 0xfcfcfcffbdfcfffc; + *((unsigned long *)&__m128i_result[0]) = 0xfcfcfcedfcf5fcfd; + __m128i_out = __lsx_vbitrevi_b (__m128i_op0, 0x1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000555889; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000002580f01; + *((unsigned long *)&__m128i_result[1]) = 0x0010000000455889; + *((unsigned long *)&__m128i_result[0]) = 0x0010000002480f01; + __m128i_out = __lsx_vbitrevi_w (__m128i_op0, 0x14); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00060fbf00040fbf; + *((unsigned long *)&__m128i_op0[0]) = 0x00020fbf00000fbf; + *((unsigned long *)&__m128i_result[1]) = 0x00060fbf02040fbf; + *((unsigned long *)&__m128i_result[0]) = 0x00020fbf02000fbf; + __m128i_out = __lsx_vbitrevi_d (__m128i_op0, 0x19); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000000007fffffff; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x400000003fffffff; + *((unsigned long *)&__m128i_result[0]) = 0x4000000040000000; + __m128i_out = __lsx_vbitrevi_w (__m128i_op0, 0x1e); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x021b7d24c9678a35; + *((unsigned long *)&__m128i_op0[0]) = 0x030298a6a1030a49; + *((unsigned long *)&__m128i_result[1]) = 0x00197f26cb658837; + *((unsigned long *)&__m128i_result[0]) = 0x01009aa4a301084b; + __m128i_out = __lsx_vbitrevi_b (__m128i_op0, 0x1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + int_out = __lsx_vpickve2gr_h (__m128i_op0, 0x3); + *((unsigned long *)&__m128i_op0[1]) = 0x0000c6c60000c6c6; + *((unsigned long *)&__m128i_op0[0]) = 0x8000c6c58000c6b2; + *((unsigned long *)&__m128i_result[1]) = 0x0000c6c40000c6c6; + *((unsigned long *)&__m128i_result[0]) = 0x8000c6c78000c6b2; + __m128i_out = __lsx_vbitrevi_d (__m128i_op0, 0x21); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0xffffff7fffffff7f; + *((unsigned long *)&__m128i_result[0]) = 0xffffff7fffffff7f; + __m128i_out = __lsx_vbitrevi_w (__m128i_op0, 0x7); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vbitsel.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vbitsel.c new file mode 100644 index 00000000000..52ac9939f92 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vbitsel.c @@ -0,0 +1,109 @@ +/* { 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]) = 0x0000000000007fff; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vbitsel_v (__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_vbitsel_v (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000005050000; + *((unsigned long *)&__m128i_op0[0]) = 0x0505000005050505; + *((unsigned long *)&__m128i_op1[1]) = 0x000d02540000007e; + *((unsigned long *)&__m128i_op1[0]) = 0x0000001400140014; + *((unsigned long *)&__m128i_op2[1]) = 0x0505050505050505; + *((unsigned long *)&__m128i_op2[0]) = 0x03574e38e496cbc9; + *((unsigned long *)&__m128i_result[1]) = 0x0005000400000004; + *((unsigned long *)&__m128i_result[0]) = 0x0400001001150404; + __m128i_out = __lsx_vbitsel_v (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + int_out = __lsx_vpickve2gr_w (__m128i_op0, 0x2); + *((unsigned long *)&__m128i_op0[1]) = 0x0080001300000013; + *((unsigned long *)&__m128i_op0[0]) = 0x0080001300000013; + *((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]) = 0x0080001300000013; + *((unsigned long *)&__m128i_result[0]) = 0x0080001300000013; + __m128i_out = __lsx_vbitsel_v (__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]) = 0x43d3e0000013e000; + *((unsigned long *)&__m128i_op2[0]) = 0x43d3e0000013e000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vbitsel_v (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfffe0001fffe0001; + *((unsigned long *)&__m128i_op0[0]) = 0xfffe0001fffe0001; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0xfffe0001fffe0001; + *((unsigned long *)&__m128i_op2[0]) = 0xfffe0001fffe0001; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vbitsel_v (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfffffacdb6dbecac; + *((unsigned long *)&__m128i_op0[0]) = 0x1f5533a694f902c0; + *((unsigned long *)&__m128i_op1[1]) = 0x62cbf96e4acfaf40; + *((unsigned long *)&__m128i_op1[0]) = 0xf0bc9a5278285a4a; + *((unsigned long *)&__m128i_op2[1]) = 0xfffffacdb6dbecac; + *((unsigned long *)&__m128i_op2[0]) = 0x1f5533a694f902c0; + *((unsigned long *)&__m128i_result[1]) = 0x62cbf84c02cbac00; + *((unsigned long *)&__m128i_result[0]) = 0x1014120210280240; + __m128i_out = __lsx_vbitsel_v (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffff59; + *((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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffff59; + __m128i_out = __lsx_vbitsel_v (__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-vbitseli.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vbitseli.c new file mode 100644 index 00000000000..f2d6fb0429c --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vbitseli.c @@ -0,0 +1,84 @@ +/* { 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]) = 0xfffcfffcfffcfffc; + *((unsigned long *)&__m128i_op0[0]) = 0xfffcfffcfffcfffc; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x6664666466646664; + *((unsigned long *)&__m128i_result[0]) = 0x6664666466646664; + __m128i_out = __lsx_vbitseli_b (__m128i_op0, __m128i_op1, 0x66); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xfffffffffffffff7; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffff00000001; + *((unsigned long *)&__m128i_op1[0]) = 0xffffff0000010000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffff00000001; + *((unsigned long *)&__m128i_result[0]) = 0x5d5d5d5d5d5d5d55; + __m128i_out = __lsx_vbitseli_b (__m128i_op0, __m128i_op1, 0x5d); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + int_out = __lsx_vpickve2gr_w (__m128i_op0, 0x2); + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000004; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000004; + *((unsigned long *)&__m128i_result[1]) = 0x5959595959595959; + *((unsigned long *)&__m128i_result[0]) = 0x5959595959595959; + __m128i_out = __lsx_vbitseli_b (__m128i_op0, __m128i_op1, 0x59); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xfffd000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xfffd000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vbitseli_b (__m128i_op0, __m128i_op1, 0x3a); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vbitseli_b (__m128i_op0, __m128i_op1, 0xaa); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0b4c600000000002; + *((unsigned long *)&__m128i_op1[1]) = 0x0808080808080808; + *((unsigned long *)&__m128i_op1[0]) = 0x0808080808080808; + *((unsigned long *)&__m128i_result[1]) = 0x0808080808080808; + *((unsigned long *)&__m128i_result[0]) = 0x0004280808080808; + __m128i_out = __lsx_vbitseli_b (__m128i_op0, __m128i_op1, 0xa4); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000004000000040; + *((unsigned long *)&__m128i_op0[0]) = 0x00007770ffff9411; + *((unsigned long *)&__m128i_op1[1]) = 0x000000400000004c; + *((unsigned long *)&__m128i_op1[0]) = 0x00007770ffff941d; + *((unsigned long *)&__m128i_result[1]) = 0x000000400000004c; + *((unsigned long *)&__m128i_result[0]) = 0x000047404f4f040d; + __m128i_out = __lsx_vbitseli_b (__m128i_op0, __m128i_op1, 0x4f); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vbitset.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vbitset.c new file mode 100644 index 00000000000..e05af675e23 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vbitset.c @@ -0,0 +1,371 @@ +/* { 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]) = 0x0000000000000001; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000001; + __m128i_out = __lsx_vbitset_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]) = 0x0000000000000001; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000001; + __m128i_out = __lsx_vbitset_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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffe001ffffe001; + *((unsigned long *)&__m128i_result[0]) = 0xffffe001ffffe001; + __m128i_out = __lsx_vbitset_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]) = 0x0000038335ca2777; + *((unsigned long *)&__m128i_result[1]) = 0x0000000100000001; + *((unsigned long *)&__m128i_result[0]) = 0x0000000800800000; + __m128i_out = __lsx_vbitset_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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vbitset_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]) = 0x0000000100000001; + *((unsigned long *)&__m128i_result[0]) = 0x0000000100000001; + __m128i_out = __lsx_vbitset_w (__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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xf51df8dbd6050189; + *((unsigned long *)&__m128i_result[0]) = 0x0983e2dbf235ed87; + __m128i_out = __lsx_vbitset_h (__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]) = 0xffffffff00000001; + *((unsigned long *)&__m128i_op1[0]) = 0x5d5d5d5d5d5d5d55; + *((unsigned long *)&__m128i_result[1]) = 0xfc01fcfefc02fdf7; + *((unsigned long *)&__m128i_result[0]) = 0xfe00fcfffe21fd01; + __m128i_out = __lsx_vbitset_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000fff7fc01; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_result[0]) = 0x80000000fff7fc01; + __m128i_out = __lsx_vbitset_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]) = 0xffffffffffffffff; + __m128i_out = __lsx_vbitset_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xfffffffe00000004; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0101010101010101; + *((unsigned long *)&__m128i_result[0]) = 0xffffffff01010105; + __m128i_out = __lsx_vbitset_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]) = 0x00000001c00ffffe; + *((unsigned long *)&__m128i_op1[0]) = 0x00000001fffffffe; + *((unsigned long *)&__m128i_result[1]) = 0x0101010201808040; + *((unsigned long *)&__m128i_result[0]) = 0x0101010280808040; + __m128i_out = __lsx_vbitset_b (__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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x3f8000003f800001; + *((unsigned long *)&__m128i_result[0]) = 0x3f8000003f800001; + __m128i_out = __lsx_vbitset_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]) = 0x00000000010a000b; + *((unsigned long *)&__m128i_result[1]) = 0x0001000100010001; + *((unsigned long *)&__m128i_result[0]) = 0x0001000104000800; + __m128i_out = __lsx_vbitset_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]) = 0x0000000897957687; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000408; + *((unsigned long *)&__m128i_result[1]) = 0x0000010000000080; + *((unsigned long *)&__m128i_result[0]) = 0x0000000100000100; + __m128i_out = __lsx_vbitset_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]) = 0xfffe0001fffe0001; + *((unsigned long *)&__m128i_op1[0]) = 0xfffe0001fffe0001; + *((unsigned long *)&__m128i_result[1]) = 0x0000000200000002; + *((unsigned long *)&__m128i_result[0]) = 0x0000000200000002; + __m128i_out = __lsx_vbitset_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffff994cb09c; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffc3639d96; + *((unsigned long *)&__m128i_op1[1]) = 0x20de27761210386d; + *((unsigned long *)&__m128i_op1[0]) = 0x34632935195a123c; + *((unsigned long *)&__m128i_result[1]) = 0xffffffff994db09c; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffc7639d96; + __m128i_out = __lsx_vbitset_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000000545cab1d; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000081a83bea; + *((unsigned long *)&__m128i_op1[1]) = 0x13f9c5b60028a415; + *((unsigned long *)&__m128i_op1[0]) = 0x545cab1d81a83bea; + *((unsigned long *)&__m128i_result[1]) = 0x00400000547cab1d; + *((unsigned long *)&__m128i_result[0]) = 0x2000000081a83fea; + __m128i_out = __lsx_vbitset_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]) = 0x0000000000038003; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000040033; + *((unsigned long *)&__m128i_result[1]) = 0x0000000100000008; + *((unsigned long *)&__m128i_result[0]) = 0x0000000100080000; + __m128i_out = __lsx_vbitset_w (__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]) = 0x0808080808080808; + *((unsigned long *)&__m128i_op1[0]) = 0x0808080808080808; + *((unsigned long *)&__m128i_result[1]) = 0x0909090909090909; + *((unsigned long *)&__m128i_result[0]) = 0x0909090909090909; + __m128i_out = __lsx_vbitset_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]) = 0x00a600e000a600e0; + *((unsigned long *)&__m128i_op1[0]) = 0x01500178010000f8; + *((unsigned long *)&__m128i_result[1]) = 0x0000000100000001; + *((unsigned long *)&__m128i_result[0]) = 0x0100000001000000; + __m128i_out = __lsx_vbitset_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]) = 0x0101010101010101; + *((unsigned long *)&__m128i_result[0]) = 0x0101010101010101; + __m128i_out = __lsx_vbitset_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]) = 0xfefbff06fffa0004; + *((unsigned long *)&__m128i_op1[0]) = 0xfefeff04fffd0004; + *((unsigned long *)&__m128i_result[1]) = 0x4008804080040110; + *((unsigned long *)&__m128i_result[0]) = 0x4040801080200110; + __m128i_out = __lsx_vbitset_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]) = 0x0101010101010101; + *((unsigned long *)&__m128i_result[0]) = 0x0101010101010101; + __m128i_out = __lsx_vbitset_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]) = 0x0001000100010001; + *((unsigned long *)&__m128i_result[0]) = 0x0001000100010001; + __m128i_out = __lsx_vbitset_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]) = 0x0000000000000001; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000001; + __m128i_out = __lsx_vbitset_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]) = 0x8000000080000000; + *((unsigned long *)&__m128i_op1[0]) = 0x8000000080000000; + *((unsigned long *)&__m128i_result[1]) = 0x8101010181010101; + *((unsigned long *)&__m128i_result[0]) = 0x8101010181010101; + __m128i_out = __lsx_vbitset_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000020000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000020000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0101010101030101; + *((unsigned long *)&__m128i_result[0]) = 0x0101010101030101; + __m128i_out = __lsx_vbitset_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]) = 0x0000000000000001; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000001; + __m128i_out = __lsx_vbitset_d (__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]) = 0x0101010101010101; + *((unsigned long *)&__m128i_result[0]) = 0x0101010101010101; + __m128i_out = __lsx_vbitset_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xd78cfd70b5f65d76; + *((unsigned long *)&__m128i_op0[0]) = 0x5779108fdedda7e4; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xd78cfd70b5f65d77; + *((unsigned long *)&__m128i_result[0]) = 0x5779108fdedda7e5; + __m128i_out = __lsx_vbitset_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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000100000001; + __m128i_out = __lsx_vbitset_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]) = 0x0000000000000008; + *((unsigned long *)&__m128i_op1[0]) = 0x00004a1e00004a1e; + *((unsigned long *)&__m128i_result[1]) = 0x0000000100000100; + *((unsigned long *)&__m128i_result[0]) = 0x4000000040000000; + __m128i_out = __lsx_vbitset_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]) = 0x0007000000050000; + *((unsigned long *)&__m128i_op1[0]) = 0x0003000100010001; + *((unsigned long *)&__m128i_result[1]) = 0x0080000100200001; + *((unsigned long *)&__m128i_result[0]) = 0x0008000200020002; + __m128i_out = __lsx_vbitset_h (__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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0280000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffff81ffff7f03; + *((unsigned long *)&__m128i_result[0]) = 0x04ffff8101ff81ff; + __m128i_out = __lsx_vbitset_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x4480000044800000; + *((unsigned long *)&__m128i_op0[0]) = 0x45c0000044800000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x00fe00fe7fffffff; + *((unsigned long *)&__m128i_result[1]) = 0x4481000144810001; + *((unsigned long *)&__m128i_result[0]) = 0x45c04000c4808000; + __m128i_out = __lsx_vbitset_h (__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]) = 0x3a8100013a810001; + *((unsigned long *)&__m128i_result[0]) = 0x7bc04000ba808000; + __m128i_out = __lsx_vbitset_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]) = 0x0000cecd00004657; + *((unsigned long *)&__m128i_op1[0]) = 0x0000c90000011197; + *((unsigned long *)&__m128i_result[1]) = 0x0000200000800000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000100800000; + __m128i_out = __lsx_vbitset_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x7f8000007f800000; + *((unsigned long *)&__m128i_op0[0]) = 0x7f8000007f800000; + *((unsigned long *)&__m128i_op1[1]) = 0x7f8000007f800000; + *((unsigned long *)&__m128i_op1[0]) = 0x7f8000007f800000; + *((unsigned long *)&__m128i_result[1]) = 0x7f8000017f800001; + *((unsigned long *)&__m128i_result[0]) = 0x7f8000017f800001; + __m128i_out = __lsx_vbitset_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-vbitseti.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vbitseti.c new file mode 100644 index 00000000000..540a724a79b --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vbitseti.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]) = 0x0020002000200020; + *((unsigned long *)&__m128i_result[0]) = 0x0020002000200020; + __m128i_out = __lsx_vbitseti_h (__m128i_op0, 0x5); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000ff00ff; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0040000000ff00ff; + *((unsigned long *)&__m128i_result[0]) = 0x0040000000000000; + __m128i_out = __lsx_vbitseti_d (__m128i_op0, 0x36); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x54beed87bc3f2be1; + *((unsigned long *)&__m128i_op0[0]) = 0x8024d8f6a494afcb; + *((unsigned long *)&__m128i_result[1]) = 0x54feed87bc3f2be1; + *((unsigned long *)&__m128i_result[0]) = 0x8064d8f6a494afcb; + __m128i_out = __lsx_vbitseti_d (__m128i_op0, 0x36); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x000000000000c400; + *((unsigned long *)&__m128i_result[1]) = 0x0010001000100010; + *((unsigned long *)&__m128i_result[0]) = 0x001000100010c410; + __m128i_out = __lsx_vbitseti_h (__m128i_op0, 0x4); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x2e2b34ca59fa4c88; + *((unsigned long *)&__m128i_op0[0]) = 0x3b2c8aefd44be966; + *((unsigned long *)&__m128i_result[1]) = 0x3e2b34ca59fa4c88; + *((unsigned long *)&__m128i_result[0]) = 0x3b2c8aefd44be966; + __m128i_out = __lsx_vbitseti_w (__m128i_op0, 0x1c); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000017fda829; + *((unsigned long *)&__m128i_result[1]) = 0x0040004000400040; + *((unsigned long *)&__m128i_result[0]) = 0x0040004017fda869; + __m128i_out = __lsx_vbitseti_h (__m128i_op0, 0x6); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x800000ff000000ff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x800000ff080000ff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vbitseti_d (__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]) = 0x0001000000010000; + *((unsigned long *)&__m128i_result[0]) = 0x0001000000010000; + __m128i_out = __lsx_vbitseti_w (__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]) = 0x0004000000040000; + *((unsigned long *)&__m128i_result[0]) = 0x0004000000040000; + __m128i_out = __lsx_vbitseti_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_vbitseti_b (__m128i_op0, 0x2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xf51cf8dad6040188; + *((unsigned long *)&__m128i_op0[0]) = 0x0982e2daf234ed87; + *((unsigned long *)&__m128i_result[1]) = 0xf51cf8dad6040188; + *((unsigned long *)&__m128i_result[0]) = 0x0982eadaf234ed87; + __m128i_out = __lsx_vbitseti_d (__m128i_op0, 0x2b); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0002000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0002000000000000; + __m128i_out = __lsx_vbitseti_d (__m128i_op0, 0x31); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000006; + *((unsigned long *)&__m128i_result[1]) = 0x8000000080000000; + *((unsigned long *)&__m128i_result[0]) = 0x8000000080000006; + __m128i_out = __lsx_vbitseti_w (__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]) = 0x0000080000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000080000000000; + __m128i_out = __lsx_vbitseti_d (__m128i_op0, 0x2b); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x7fff7fff7fff7fff; + *((unsigned long *)&__m128i_op0[0]) = 0x000000010000003f; + *((unsigned long *)&__m128i_result[1]) = 0x7fff7fff7fff7fff; + *((unsigned long *)&__m128i_result[0]) = 0x000000030000003f; + __m128i_out = __lsx_vbitseti_w (__m128i_op0, 0x1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xe5e5e5e5e5e5e5e5; + *((unsigned long *)&__m128i_op0[0]) = 0xe5e5e5e5e4e4e46d; + *((unsigned long *)&__m128i_result[1]) = 0xe5e5e5e5e5e5e5e5; + *((unsigned long *)&__m128i_result[0]) = 0xe5e5e5e5e4e4e46d; + __m128i_out = __lsx_vbitseti_w (__m128i_op0, 0x1a); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x7fffffff7fffffff; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x7fffffff7fffffff; + *((unsigned long *)&__m128i_result[0]) = 0x0101010101010101; + __m128i_out = __lsx_vbitseti_b (__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]) = 0x1000100010001000; + *((unsigned long *)&__m128i_result[0]) = 0x1000100010001000; + __m128i_out = __lsx_vbitseti_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]) = 0x0800080008000800; + *((unsigned long *)&__m128i_result[0]) = 0x0800080008000800; + __m128i_out = __lsx_vbitseti_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]) = 0x0100000001000000; + *((unsigned long *)&__m128i_result[0]) = 0x0100000001000000; + __m128i_out = __lsx_vbitseti_w (__m128i_op0, 0x18); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000007fff; + *((unsigned long *)&__m128i_result[1]) = 0x2020202020202020; + *((unsigned long *)&__m128i_result[0]) = 0x2020202020207fff; + __m128i_out = __lsx_vbitseti_b (__m128i_op0, 0x5); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000100000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000100013fa0; + *((unsigned long *)&__m128i_result[1]) = 0x0000000900000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000900013fa0; + __m128i_out = __lsx_vbitseti_d (__m128i_op0, 0x23); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x3ff0000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x40f3fa0000000000; + *((unsigned long *)&__m128i_result[1]) = 0x3ff0008000800080; + *((unsigned long *)&__m128i_result[0]) = 0x40f3fa8000800080; + __m128i_out = __lsx_vbitseti_h (__m128i_op0, 0x7); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000ffff0000ffff; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000ffff0000ffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000040000000000; + __m128i_out = __lsx_vbitseti_d (__m128i_op0, 0x2a); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xc000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0404040404040404; + *((unsigned long *)&__m128i_result[0]) = 0xc404040404040404; + __m128i_out = __lsx_vbitseti_b (__m128i_op0, 0x2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000040804000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000040804000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000040a04000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000040a04000; + __m128i_out = __lsx_vbitseti_d (__m128i_op0, 0x15); + 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_vbitseti_w (__m128i_op0, 0x9); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_op0[0]) = 0x1f81e3779b97f4a8; + *((unsigned long *)&__m128i_result[1]) = 0xffffffff02000000; + *((unsigned long *)&__m128i_result[0]) = 0x1f81e3779b97f4a8; + __m128i_out = __lsx_vbitseti_d (__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]) = 0x0000008000000080; + *((unsigned long *)&__m128i_result[0]) = 0x0000008000000080; + __m128i_out = __lsx_vbitseti_w (__m128i_op0, 0x7); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000001; + *((unsigned long *)&__m128i_result[1]) = 0x0100010001000101; + *((unsigned long *)&__m128i_result[0]) = 0x0100010001000101; + __m128i_out = __lsx_vbitseti_h (__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]) = 0x0808080808080808; + *((unsigned long *)&__m128i_result[0]) = 0x0808080808080808; + __m128i_out = __lsx_vbitseti_b (__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]) = 0x0000000010000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000010000000; + __m128i_out = __lsx_vbitseti_d (__m128i_op0, 0x1c); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0002711250a27112; + *((unsigned long *)&__m128i_op0[0]) = 0x00d2701294027112; + *((unsigned long *)&__m128i_result[1]) = 0x080a791a58aa791a; + *((unsigned long *)&__m128i_result[0]) = 0x08da781a9c0a791a; + __m128i_out = __lsx_vbitseti_b (__m128i_op0, 0x3); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0303030303030303; + *((unsigned long *)&__m128i_op0[0]) = 0x0303030303030303; + *((unsigned long *)&__m128i_result[1]) = 0x1313131313131313; + *((unsigned long *)&__m128i_result[0]) = 0x1313131313131313; + __m128i_out = __lsx_vbitseti_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]) = 0x0001000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0001000000000000; + __m128i_out = __lsx_vbitseti_d (__m128i_op0, 0x30); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000002000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000002000000000; + __m128i_out = __lsx_vbitseti_d (__m128i_op0, 0x25); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfff0000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xfff0000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xfff0008000000080; + *((unsigned long *)&__m128i_result[0]) = 0xfff0008000000080; + __m128i_out = __lsx_vbitseti_w (__m128i_op0, 0x7); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vclo.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vclo.c new file mode 100644 index 00000000000..2c1099a04e6 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vclo.c @@ -0,0 +1,266 @@ +/* { 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]) = 0x0000005555555554; + *((unsigned long *)&__m128i_op0[0]) = 0x0000005555555554; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vclo_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_vclo_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_vclo_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]) = 0x0000000000000040; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000040; + __m128i_out = __lsx_vclo_d (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xe2ecd48adedc7c82; + *((unsigned long *)&__m128i_op0[0]) = 0x25d666472b01d18d; + *((unsigned long *)&__m128i_result[1]) = 0x0303020102020001; + *((unsigned long *)&__m128i_result[0]) = 0x0002000000000201; + __m128i_out = __lsx_vclo_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_vclo_w (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000000fefefe6a; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000c2bac2c2; + *((unsigned long *)&__m128i_result[1]) = 0x0000000007070700; + *((unsigned long *)&__m128i_result[0]) = 0x0000000002010202; + __m128i_out = __lsx_vclo_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_vclo_w (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x3d3d3d3d3d3d3d3d; + *((unsigned long *)&__m128i_op0[0]) = 0x3d3d3d3d3d3d3d3d; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vclo_w (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000000007e8a60; + *((unsigned long *)&__m128i_op0[0]) = 0x000000000001edde; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000003; + __m128i_out = __lsx_vclo_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_vclo_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]) = 0x0000002000000020; + *((unsigned long *)&__m128i_result[0]) = 0x0000002000000020; + __m128i_out = __lsx_vclo_w (__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]) = 0x0000000200000000; + __m128i_out = __lsx_vclo_w (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x7ff0000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x7ff0000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vclo_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_vclo_w (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x000000001fffff59; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vclo_d (__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]) = 0x0010001000100010; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vclo_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]) = 0x0010001000100010; + *((unsigned long *)&__m128i_result[0]) = 0x0010001000100010; + __m128i_out = __lsx_vclo_h (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000000000000aaaa; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vclo_w (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + unsigned_int_out = __lsx_vpickve2gr_wu (__m128i_op0, 0x2); + *((unsigned long *)&__m128i_op0[1]) = 0xffffe500ffffc085; + *((unsigned long *)&__m128i_op0[0]) = 0xffffc000ffffc005; + *((unsigned long *)&__m128i_result[1]) = 0x0000001300000012; + *((unsigned long *)&__m128i_result[0]) = 0x0000001200000012; + __m128i_out = __lsx_vclo_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_vclo_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_vclo_d (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x003fffff00000000; + *((unsigned long *)&__m128i_op0[0]) = 0x003fffff00000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000001000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000001000000000; + __m128i_out = __lsx_vclo_h (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0x7fff7fff7fff7fff; + *((unsigned long *)&__m128i_result[1]) = 0x0010001000100010; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vclo_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_vclo_h (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffc0ff80ff800000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000005; + *((unsigned long *)&__m128i_result[1]) = 0x0000000a00000009; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vclo_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_vclo_w (__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]) = 0x0101010101010101; + *((unsigned long *)&__m128i_result[0]) = 0x0101010101010101; + __m128i_out = __lsx_vclo_b (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000008; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vclo_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_vclo_b (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x413e276583869d79; + *((unsigned long *)&__m128i_op0[0]) = 0x7f7f017f9d8726d3; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000001; + __m128i_out = __lsx_vclo_w (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfffffffffffbfffc; + *((unsigned long *)&__m128i_op0[0]) = 0xc090380000000000; + *((unsigned long *)&__m128i_result[1]) = 0x000000200000000d; + *((unsigned long *)&__m128i_result[0]) = 0x0000000200000000; + __m128i_out = __lsx_vclo_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_vclo_d (__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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vclo_d (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfffffffffffffff4; + *((unsigned long *)&__m128i_op0[0]) = 0xfffffffffffffff4; + *((unsigned long *)&__m128i_result[1]) = 0x000000200000001c; + *((unsigned long *)&__m128i_result[0]) = 0x000000200000001c; + __m128i_out = __lsx_vclo_w (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vclz.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vclz.c new file mode 100644 index 00000000000..12df2c6703c --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vclz.c @@ -0,0 +1,265 @@ +/* { 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]) = 0x0000000000000000; + __m128i_out = __lsx_vclz_h (__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]) = 0x0010001000100010; + *((unsigned long *)&__m128i_result[0]) = 0x0010000800100008; + __m128i_out = __lsx_vclz_h (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000000001fc1a568; + *((unsigned long *)&__m128i_op0[0]) = 0x02693fe0e7beb077; + *((unsigned long *)&__m128i_result[1]) = 0x0010001000030000; + *((unsigned long *)&__m128i_result[0]) = 0x0006000200000000; + __m128i_out = __lsx_vclz_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]) = 0x0000002000000020; + *((unsigned long *)&__m128i_result[0]) = 0x0000002000000020; + __m128i_out = __lsx_vclz_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]) = 0x0010001000100010; + *((unsigned long *)&__m128i_result[0]) = 0x0010001000100010; + __m128i_out = __lsx_vclz_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]) = 0x0000002000000020; + *((unsigned long *)&__m128i_result[0]) = 0x0000002000000020; + __m128i_out = __lsx_vclz_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]) = 0x0000002000000020; + *((unsigned long *)&__m128i_result[0]) = 0x0000002000000020; + __m128i_out = __lsx_vclz_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]) = 0x0000002000000020; + *((unsigned long *)&__m128i_result[0]) = 0x0000002000000020; + __m128i_out = __lsx_vclz_w (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x7f7f000b000b000b; + *((unsigned long *)&__m128i_op0[0]) = 0x000b000b010a000b; + *((unsigned long *)&__m128i_result[1]) = 0x0101080408040804; + *((unsigned long *)&__m128i_result[0]) = 0x0804080407040804; + __m128i_out = __lsx_vclz_b (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x1ffffffff8001000; + *((unsigned long *)&__m128i_op0[0]) = 0xf0bd80bd80bd8000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000003; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vclz_d (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000100010000fe7c; + *((unsigned long *)&__m128i_op0[0]) = 0x000100010000fe01; + *((unsigned long *)&__m128i_result[1]) = 0x000f000f00100000; + *((unsigned long *)&__m128i_result[0]) = 0x000f000f00100000; + __m128i_out = __lsx_vclz_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]) = 0x0808080808080808; + *((unsigned long *)&__m128i_result[0]) = 0x0808080808080808; + __m128i_out = __lsx_vclz_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]) = 0x0808080808080808; + *((unsigned long *)&__m128i_result[0]) = 0x0808080808080808; + __m128i_out = __lsx_vclz_b (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x41dfffff00000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0100000008080808; + *((unsigned long *)&__m128i_result[0]) = 0x0808080808080808; + __m128i_out = __lsx_vclz_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]) = 0x0000000000000040; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000040; + __m128i_out = __lsx_vclz_d (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000040; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000040; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000039; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000039; + __m128i_out = __lsx_vclz_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]) = 0x0000002000000020; + *((unsigned long *)&__m128i_result[0]) = 0x0000002000000020; + __m128i_out = __lsx_vclz_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]) = 0x0010001000100010; + *((unsigned long *)&__m128i_result[0]) = 0x0010001000100010; + __m128i_out = __lsx_vclz_h (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00ff000100ff00fe; + *((unsigned long *)&__m128i_op0[0]) = 0x00ff003000ff00a0; + *((unsigned long *)&__m128i_result[1]) = 0x0008000f00080008; + *((unsigned long *)&__m128i_result[0]) = 0x0008000a00080008; + __m128i_out = __lsx_vclz_h (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfe813f00fe813f00; + *((unsigned long *)&__m128i_op0[0]) = 0xfe813f00fe813f00; + *((unsigned long *)&__m128i_result[1]) = 0x0000000200000002; + *((unsigned long *)&__m128i_result[0]) = 0x0000000200000002; + __m128i_out = __lsx_vclz_h (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000000bffffffe; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000020; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000040; + __m128i_out = __lsx_vclz_d (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000c0c00000000; + *((unsigned long *)&__m128i_op0[0]) = 0xfffffffffffffffe; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000014; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vclz_d (__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]) = 0x0101010101010101; + *((unsigned long *)&__m128i_result[0]) = 0x0101010101010101; + __m128i_out = __lsx_vclz_b (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x687a8373f249bc44; + *((unsigned long *)&__m128i_op0[0]) = 0x7861145d9241a14a; + *((unsigned long *)&__m128i_result[1]) = 0x0101000100010001; + *((unsigned long *)&__m128i_result[0]) = 0x0101030100010001; + __m128i_out = __lsx_vclz_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]) = 0x0000000000000040; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000040; + __m128i_out = __lsx_vclz_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]) = 0x0000002000000020; + *((unsigned long *)&__m128i_result[0]) = 0x0000002000000020; + __m128i_out = __lsx_vclz_w (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000001fffffffe; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0808080700000000; + *((unsigned long *)&__m128i_result[0]) = 0x0808080808080808; + __m128i_out = __lsx_vclz_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]) = 0x0808080808080808; + *((unsigned long *)&__m128i_result[0]) = 0x0808080808080808; + __m128i_out = __lsx_vclz_b (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0001000100010001; + *((unsigned long *)&__m128i_op0[0]) = 0x0001000100010001; + *((unsigned long *)&__m128i_result[1]) = 0x0000000f0000000f; + *((unsigned long *)&__m128i_result[0]) = 0x0000000f0000000f; + __m128i_out = __lsx_vclz_w (__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]) = 0x000000200000001b; + *((unsigned long *)&__m128i_result[0]) = 0x0000002000000000; + __m128i_out = __lsx_vclz_w (__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]) = 0x0808080808080805; + *((unsigned long *)&__m128i_result[0]) = 0x0808080808080805; + __m128i_out = __lsx_vclz_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]) = 0x0010001000100010; + *((unsigned long *)&__m128i_result[0]) = 0x0010001000100010; + __m128i_out = __lsx_vclz_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]) = 0x0808080808080808; + *((unsigned long *)&__m128i_result[0]) = 0x0808080808080808; + __m128i_out = __lsx_vclz_b (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0010001000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0010001000000000; + __m128i_out = __lsx_vclz_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]) = 0x0010001000100010; + *((unsigned long *)&__m128i_result[0]) = 0x0010001000100010; + __m128i_out = __lsx_vclz_h (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vpcnt.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vpcnt.c new file mode 100644 index 00000000000..66982d89f3d --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vpcnt.c @@ -0,0 +1,350 @@ +/* { 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_vpcnt_d (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + unsigned_int_out = __lsx_vpickve2gr_hu (__m128i_op0, 0x7); + *((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_vpcnt_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_vpcnt_h (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0010001000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0010001000100010; + __m128i_out = __lsx_vpcnt_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]) = 0x0010001000100010; + *((unsigned long *)&__m128i_result[0]) = 0x0010001000100010; + __m128i_out = __lsx_vpcnt_h (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfffffffffefefefe; + *((unsigned long *)&__m128i_op0[0]) = 0x000000000000ffff; + *((unsigned long *)&__m128i_result[1]) = 0x000000000000003c; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000010; + __m128i_out = __lsx_vpcnt_d (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x7f8000007f800000; + *((unsigned long *)&__m128i_op0[0]) = 0x7f8000007f800000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000800000008; + *((unsigned long *)&__m128i_result[0]) = 0x0000000800000008; + __m128i_out = __lsx_vpcnt_w (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x7f8000007f800000; + *((unsigned long *)&__m128i_op0[0]) = 0x7f80000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0701000007010000; + *((unsigned long *)&__m128i_result[0]) = 0x0701000000000000; + __m128i_out = __lsx_vpcnt_b (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x807f7f8000ffff00; + *((unsigned long *)&__m128i_op0[0]) = 0x0000ffff00feff00; + *((unsigned long *)&__m128i_result[1]) = 0x0107070100080800; + *((unsigned long *)&__m128i_result[0]) = 0x0000080800070800; + __m128i_out = __lsx_vpcnt_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_vpcnt_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_vpcnt_w (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x5252525252525252; + *((unsigned long *)&__m128i_op0[0]) = 0x5252525252525252; + *((unsigned long *)&__m128i_result[1]) = 0x0303030303030303; + *((unsigned long *)&__m128i_result[0]) = 0x0303030303030303; + __m128i_out = __lsx_vpcnt_b (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000100010; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000100010; + __m128i_out = __lsx_vpcnt_h (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xe0404041e0404041; + *((unsigned long *)&__m128i_op0[0]) = 0x803f800080000000; + *((unsigned long *)&__m128i_result[1]) = 0x000000000000000e; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000009; + __m128i_out = __lsx_vpcnt_d (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0007000000040000; + *((unsigned long *)&__m128i_op0[0]) = 0x0003000000010000; + *((unsigned long *)&__m128i_result[1]) = 0x0003000000010000; + *((unsigned long *)&__m128i_result[0]) = 0x0002000000010000; + __m128i_out = __lsx_vpcnt_h (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x1111111111111111; + *((unsigned long *)&__m128i_op0[0]) = 0x1111111111111111; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000010; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000010; + __m128i_out = __lsx_vpcnt_d (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0ba00ba00ba00ba0; + *((unsigned long *)&__m128i_op0[0]) = 0x0ba00ba00ba011eb; + *((unsigned long *)&__m128i_result[1]) = 0x0000000a0000000a; + *((unsigned long *)&__m128i_result[0]) = 0x0000000a0000000d; + __m128i_out = __lsx_vpcnt_w (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfbfbfb17fbfb38ea; + *((unsigned long *)&__m128i_op0[0]) = 0xfbfb47fbfbfb0404; + *((unsigned long *)&__m128i_result[1]) = 0x000000000000002f; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000029; + __m128i_out = __lsx_vpcnt_d (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xffffbfc0ffffbfc0; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000032; + __m128i_out = __lsx_vpcnt_d (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x21201f1e19181716; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0003000900050007; + *((unsigned long *)&__m128i_result[0]) = 0x0010001000100010; + __m128i_out = __lsx_vpcnt_h (__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]) = 0x0000000000000002; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000002; + __m128i_out = __lsx_vpcnt_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_vpcnt_d (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfff0800080008000; + *((unsigned long *)&__m128i_op0[0]) = 0xe160065422d476da; + *((unsigned long *)&__m128i_result[1]) = 0x0000000d00000002; + *((unsigned long *)&__m128i_result[0]) = 0x0000000b00000010; + __m128i_out = __lsx_vpcnt_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_vpcnt_w (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffff0000ffff0000; + *((unsigned long *)&__m128i_op0[0]) = 0xffff000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000001000000010; + *((unsigned long *)&__m128i_result[0]) = 0x0000001000000000; + __m128i_out = __lsx_vpcnt_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]) = 0x0000000000000040; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000040; + __m128i_out = __lsx_vpcnt_d (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000010100000101; + *((unsigned long *)&__m128i_op0[0]) = 0x0000010100000101; + *((unsigned long *)&__m128i_result[1]) = 0x0000000200000002; + *((unsigned long *)&__m128i_result[0]) = 0x0000000200000002; + __m128i_out = __lsx_vpcnt_w (__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]) = 0x0808080808080808; + __m128i_out = __lsx_vpcnt_b (__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]) = 0x0010001000100010; + __m128i_out = __lsx_vpcnt_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_vpcnt_h (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000020000; + *((unsigned long *)&__m128i_op0[0]) = 0x0103000201030002; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000008; + __m128i_out = __lsx_vpcnt_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]) = 0x000000200000001e; + *((unsigned long *)&__m128i_result[0]) = 0x000000200000001e; + __m128i_out = __lsx_vpcnt_w (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xbbe5560400010001; + *((unsigned long *)&__m128i_op0[0]) = 0xe7e5dabf00010001; + *((unsigned long *)&__m128i_result[1]) = 0x000b000500010001; + *((unsigned long *)&__m128i_result[0]) = 0x000b000c00010001; + __m128i_out = __lsx_vpcnt_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_vpcnt_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]) = 0x0010001000100010; + *((unsigned long *)&__m128i_result[0]) = 0x0010001000100010; + __m128i_out = __lsx_vpcnt_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_vpcnt_b (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0x7fffffff7fffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000002000000020; + *((unsigned long *)&__m128i_result[0]) = 0x0000001f0000001f; + __m128i_out = __lsx_vpcnt_w (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x9c9c9c9c9c9c9c9c; + *((unsigned long *)&__m128i_op0[0]) = 0x9c9c9c9c9c9c9c9c; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000020; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000020; + __m128i_out = __lsx_vpcnt_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_vpcnt_h (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000600007fff; + *((unsigned long *)&__m128i_op0[0]) = 0x00000008ffffa209; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000011; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000016; + __m128i_out = __lsx_vpcnt_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_vpcnt_b (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000467fef81; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000013; + __m128i_out = __lsx_vpcnt_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_vpcnt_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_vpcnt_d (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000000fe03fe01; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000fe01fe01; + *((unsigned long *)&__m128i_result[1]) = 0x0000000007020701; + *((unsigned long *)&__m128i_result[0]) = 0x0000000007010701; + __m128i_out = __lsx_vpcnt_b (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x7f80000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000800000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vpcnt_w (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xf654ad7447e59090; + *((unsigned long *)&__m128i_op0[0]) = 0x27b1b106b8145f50; + *((unsigned long *)&__m128i_result[1]) = 0x000000120000000d; + *((unsigned long *)&__m128i_result[0]) = 0x0000000e0000000e; + __m128i_out = __lsx_vpcnt_w (__m128i_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} From patchwork Wed Sep 13 03:35:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: chenxiaolong X-Patchwork-Id: 138593 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9ecd:0:b0:3f2:4152:657d with SMTP id t13csp833508vqx; Tue, 12 Sep 2023 20:45:40 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEy/Hw0Qa8v0TxA8GK7B0iHxiMphzOx/+WUp7QOst3AfsIjzNm49FvHKrd+ZX3Bv4L35wYd X-Received: by 2002:a05:6512:2343:b0:500:9a45:636 with SMTP id p3-20020a056512234300b005009a450636mr1258987lfu.13.1694576740446; Tue, 12 Sep 2023 20:45:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694576740; cv=none; d=google.com; s=arc-20160816; b=W7MSJ9Xt5v/300zDkYAN+W5GlIcPqzZeac39ccWHOnVOGdstiviu2arUzFNVyS4DY2 R5FaB5Pt4SlA27WK5G3pG/FNUEixR8tjgvvBFtEPmPk/jptmR1MkwKzhDTEnm8Zsvau7 wUD0rY0dxeaDBkMnp844ScN41/W9LwN9xt2ZSyLm0XNlPjYA5OBScl3T0rUcghJPp79f m7nvGChysXkaHweK0XxkKMvFo/VAguvjcwsQRQczj5TTQKtKz++JM+V209pnmArnDod8 MrcDMTsdpO7MufY3fimz1kXgCQpgGj9xBr2KSopAsH99cmtHAzJBIy3Y/mHa0UInEn1Q ikaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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:cc:to :from:dmarc-filter:delivered-to; bh=q6wkl5IRBkUFR8us3wbsxzP+TXH92uQH21uWdO1/h+w=; fh=3pFUYcpS/27XRzOf17GfR86AuNQu+P1CET04YURgCLs=; b=hAmZsdCrUEFF7H8WFAVYWcWFaIcigRyDPPLXx/3AmtvIXmy5eCgyjU9LHhSvKoqtD3 4WoV+oShGN2m9w2juYwNMQcczWzteBKjSLrJglZZz3ikl1ifZCWbVcPI+79mbm8uDnUH PvfEvy9Gq6AY/kVV9MxYXPS/ghQOhS5/lPwkar5TnoE1IcYyjV6CbQoyd86G0tc1HCcK i7nryq9yt3d4s0s5FbuB/O3tj6mTHE2dYvEfGsXoanoYW9ji9aU5815nRGe67yNsB6Ak QNiA0enINk1luZE7KTuw2jD3HqxQHqwYCIYs74X3M2gYw/cJS2hvaeW4XvOItm1c6xx/ YC8g== 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 v13-20020a056402184d00b00525641e460bsi9944283edy.190.2023.09.12.20.45.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Sep 2023 20:45:40 -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 38A3D395B47A for ; Wed, 13 Sep 2023 03:37:15 +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 2C218382C12B for ; Wed, 13 Sep 2023 03:35:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2C218382C12B 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 1qgGfK-0003DA-N3 for gcc-patches@gcc.gnu.org; Tue, 12 Sep 2023 23:35:52 -0400 Received: from loongson.cn (unknown [10.10.130.252]) by gateway (Coremail) with SMTP id _____8Ax1fAQLgFl3jAmAA--.8661S3; Wed, 13 Sep 2023 11:35:44 +0800 (CST) Received: from slurm-master.loongson.cn (unknown [10.10.130.252]) by localhost.localdomain (Coremail) with SMTP id AQAAf8Cx7y_8LQFlvA8CAA--.3484S12; Wed, 13 Sep 2023 11:35:43 +0800 (CST) From: Xiaolong Chen To: gcc-patches@gcc.gnu.org Cc: xry111@xry111.site, i@xen0n.name, xuchenghua@loongson.cn, chenglulu@loongson.cn, Xiaolong Chen Subject: [PATCH v4 18/23] LoongArch: Add tests for SX vector floating point arithmetic instructions. Date: Wed, 13 Sep 2023 11:35:21 +0800 Message-Id: <20230913033522.5983-9-chenxiaolong@loongson.cn> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230913033522.5983-1-chenxiaolong@loongson.cn> References: <20230913033522.5983-1-chenxiaolong@loongson.cn> MIME-Version: 1.0 X-CM-TRANSID: AQAAf8Cx7y_8LQFlvA8CAA--.3484S12 X-CM-SenderInfo: hfkh05xldrz0tqj6z05rqj20fqof0/1tbiAQANBWUBHCIBEQAAsD X-Coremail-Antispam: 1Uk129KBj98XoWxCw1UWr1DKFW3KoXrpr48ZF17CoWUCryUZw 4rG3Z7Z3WrJw13A3sFg3WYk3ZIkr1UJrn0ya1Dt3yavFy8AF1rJF1UtwsrAFy3Zw12qr1x Gw18Jr4kl-sFpf9Il3svdjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8wcxFpf9Il3svdx BIdaVrn0xqx4xG64xvF2IEw4CE5I8CrVC2j2Jv73VFW2AGmfu7bjvjm3AaLaJ3UjIYCTnI Wjp_UUUY57kC6x804xWl14x267AKxVWUJVW8JwAFc2x0x2IEx4CE42xK8VAvwI8IcIk0rV WrJVCq3wAFIxvE14AKwVWUGVWUXwA2ocxC64kIII0Yj41l84x0c7CEw4AK67xGY2AK021l 84ACjcxK6xIIjxv20xvE14v26F1j6w1UM28EF7xvwVC0I7IYx2IY6xkF7I0E14v26F4j6r 4UJwA2z4x0Y4vEx4A2jsIE14v26r4UJVWxJr1l84ACjcxK6I8E87Iv6xkF7I0E14v26r4U JVWxJr1le2I262IYc4CY6c8Ij28IcVAaY2xG8wAqjxCEc2xF0cIa020Ex4CE44I27wAqx4 xG64xvF2IEw4CE5I8CrVC2j2WlYx0E2Ix0cI8IcVAFwI0_Wrv_ZF1lYx0Ex4A2jsIE14v2 6F4j6r4UJwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IYc2Ij64vIr41l42xK82IYc2Ij64 vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2IqxVAqx4xG67AKxVWUJVWUGwC20s026x8G jcxK67AKxVWUGVWUWwC2zVAF1VAY17CE14v26r126r1DMIIYrxkI7VAKI48JMIIF0xvE2I x0cI8IcVAFwI0_Ar0_tr1lIxAIcVC0I7IYx2IY6xkF7I0E14v26F4j6r4UJwCI42IY6xAI w20EY4v20xvaj40_Jr0_JF4lIxAIcVC2z280aVAFwI0_Cr0_Gr1UMIIF0xvEx4A2jsIEc7 CjxVAFwI0_Gr0_Gr1UYxBIdaVFxhVjvjDU0xZFpf9x07jzuWLUUUUU= 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.8 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: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1776892500224795970 X-GMAIL-MSGID: 1776892500224795970 gcc/testsuite/ChangeLog: * gcc.target/loongarch/vector/lsx/lsx-vfadd_d.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vfadd_s.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vfclass_d.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vfclass_s.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vflogb_d.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vflogb_s.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vfmax_d.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vfmax_s.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vfmaxa_d.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vfmaxa_s.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vfsqrt_d.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vfsqrt_s.c: New test. --- .../loongarch/vector/lsx/lsx-vfadd_d.c | 407 +++++++++++++++ .../loongarch/vector/lsx/lsx-vfadd_s.c | 470 ++++++++++++++++++ .../loongarch/vector/lsx/lsx-vfclass_d.c | 83 ++++ .../loongarch/vector/lsx/lsx-vfclass_s.c | 74 +++ .../loongarch/vector/lsx/lsx-vflogb_d.c | 76 +++ .../loongarch/vector/lsx/lsx-vflogb_s.c | 185 +++++++ .../loongarch/vector/lsx/lsx-vfmax_d.c | 200 ++++++++ .../loongarch/vector/lsx/lsx-vfmax_s.c | 335 +++++++++++++ .../loongarch/vector/lsx/lsx-vfmaxa_d.c | 155 ++++++ .../loongarch/vector/lsx/lsx-vfmaxa_s.c | 230 +++++++++ .../loongarch/vector/lsx/lsx-vfsqrt_d.c | 216 ++++++++ .../loongarch/vector/lsx/lsx-vfsqrt_s.c | 372 ++++++++++++++ 12 files changed, 2803 insertions(+) create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfadd_d.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfadd_s.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfclass_d.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfclass_s.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vflogb_d.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vflogb_s.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfmax_d.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfmax_s.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfmaxa_d.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfmaxa_s.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfsqrt_d.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfsqrt_s.c diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfadd_d.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfadd_d.c new file mode 100644 index 00000000000..7ffbd385ee0 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfadd_d.c @@ -0,0 +1,407 @@ +/* { 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 *)&__m128d_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128d_result[0]) = 0xffffffffffffffff; + __m128d_out = __lsx_vfadd_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x00000000fea8ff44; + *((unsigned long *)&__m128d_op1[1]) = 0x2020202020202020; + *((unsigned long *)&__m128d_op1[0]) = 0x2020202020202020; + *((unsigned long *)&__m128d_result[1]) = 0x2020202020202020; + *((unsigned long *)&__m128d_result[0]) = 0x2020202020202020; + __m128d_out = __lsx_vfadd_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x1000100010001000; + *((unsigned long *)&__m128d_op0[0]) = 0x1000100010001000; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[1]) = 0x1000100010001000; + *((unsigned long *)&__m128d_result[0]) = 0x1000100010001000; + __m128d_out = __lsx_vfadd_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[0]) = 0x000000000000000f; + *((unsigned long *)&__m128d_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[0]) = 0x000000000000000f; + __m128d_out = __lsx_vfadd_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_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 *)&__m128d_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000; + __m128d_out = __lsx_vfadd_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000010100fe0101; + *((unsigned long *)&__m128d_op0[0]) = 0xffff0200ffff01ff; + *((unsigned long *)&__m128d_op1[1]) = 0x0000ffffffffffff; + *((unsigned long *)&__m128d_op1[0]) = 0x0000ffffffffffff; + *((unsigned long *)&__m128d_result[1]) = 0x0001010100fe0100; + *((unsigned long *)&__m128d_result[0]) = 0xffff0200ffff01ff; + __m128d_out = __lsx_vfadd_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_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 *)&__m128d_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000; + __m128d_out = __lsx_vfadd_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x7fff0101ffffe000; + *((unsigned long *)&__m128d_op0[0]) = 0x7fffffffa0204000; + *((unsigned long *)&__m128d_op1[1]) = 0x7f370101ff04ffff; + *((unsigned long *)&__m128d_op1[0]) = 0x7f3bffffa0226021; + *((unsigned long *)&__m128d_result[1]) = 0x7fff0101ffffe000; + *((unsigned long *)&__m128d_result[0]) = 0x7fffffffa0204000; + __m128d_out = __lsx_vfadd_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_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 *)&__m128d_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000; + __m128d_out = __lsx_vfadd_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000ebd20000714f; + *((unsigned long *)&__m128d_op0[0]) = 0x00012c8a0000a58a; + *((unsigned long *)&__m128d_op1[1]) = 0xf654ad7447e59090; + *((unsigned long *)&__m128d_op1[0]) = 0x27b1b106b8145f50; + *((unsigned long *)&__m128d_result[1]) = 0xf654ad7447e59090; + *((unsigned long *)&__m128d_result[0]) = 0x27b1b106b8145f50; + __m128d_out = __lsx_vfadd_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_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 *)&__m128d_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000; + __m128d_out = __lsx_vfmul_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_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 *)&__m128d_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000; + __m128d_out = __lsx_vfmul_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[1]) = 0x0000001300000013; + *((unsigned long *)&__m128d_op1[0]) = 0x0000001300000013; + *((unsigned long *)&__m128d_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000; + __m128d_out = __lsx_vfmul_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000100000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x1000100000001000; + *((unsigned long *)&__m128d_op1[1]) = 0x0000100000000000; + *((unsigned long *)&__m128d_op1[0]) = 0x1000100000001000; + *((unsigned long *)&__m128d_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000; + __m128d_out = __lsx_vfmul_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0010001000100010; + *((unsigned long *)&__m128d_op0[0]) = 0x0010001000100010; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000; + __m128d_out = __lsx_vfmul_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_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 *)&__m128d_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000; + __m128d_out = __lsx_vfmul_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[1]) = 0x0000007000000000; + *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000; + __m128d_out = __lsx_vfmul_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x01533b5e7489ae24; + *((unsigned long *)&__m128d_op0[0]) = 0xffffab7e71e33848; + *((unsigned long *)&__m128d_op1[1]) = 0x01533b5e7489ae24; + *((unsigned long *)&__m128d_op1[0]) = 0xffffab7e71e33848; + *((unsigned long *)&__m128d_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[0]) = 0xffffab7e71e33848; + __m128d_out = __lsx_vfmul_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_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 *)&__m128d_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000; + __m128d_out = __lsx_vfmul_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128d_op1[1]) = 0x000000ff000000ff; + *((unsigned long *)&__m128d_op1[0]) = 0x000000ff000000ff; + *((unsigned long *)&__m128d_result[1]) = 0x800000ff000000ff; + *((unsigned long *)&__m128d_result[0]) = 0xffffffffffffffff; + __m128d_out = __lsx_vfsub_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[1]) = 0x00000000fff8fff8; + *((unsigned long *)&__m128d_op1[0]) = 0x00000000fff80000; + *((unsigned long *)&__m128d_result[1]) = 0x80000000fff8fff8; + *((unsigned long *)&__m128d_result[0]) = 0x80000000fff80000; + __m128d_out = __lsx_vfsub_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x00000001fffffffe; + *((unsigned long *)&__m128d_op0[0]) = 0x00000001fffffffe; + *((unsigned long *)&__m128d_op1[1]) = 0xb55ccf30f52a6a68; + *((unsigned long *)&__m128d_op1[0]) = 0x4e0018eceb82c53a; + *((unsigned long *)&__m128d_result[1]) = 0x355ccf30f52a6a68; + *((unsigned long *)&__m128d_result[0]) = 0xce0018eceb82c53a; + __m128d_out = __lsx_vfsub_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0xffffffff00006c82; + *((unsigned long *)&__m128d_op0[0]) = 0x00009b140000917b; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[1]) = 0xffffffff00006c82; + *((unsigned long *)&__m128d_result[0]) = 0x00009b140000917b; + __m128d_out = __lsx_vfsub_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128d_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000100000020; + *((unsigned long *)&__m128d_op1[0]) = 0x0000083b00000000; + *((unsigned long *)&__m128d_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128d_result[0]) = 0xffffffffffffffff; + __m128d_out = __lsx_vfsub_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0xe93d0bd19ff0c170; + *((unsigned long *)&__m128d_op0[0]) = 0x5237c1bac9eadf55; + *((unsigned long *)&__m128d_op1[1]) = 0xe6d4572c8a5835bc; + *((unsigned long *)&__m128d_op1[0]) = 0xe5017c2ac9ca9fd0; + *((unsigned long *)&__m128d_result[1]) = 0xe93d0bd19ff07013; + *((unsigned long *)&__m128d_result[0]) = 0x65017c2ac9ca9fd0; + __m128d_out = __lsx_vfsub_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0xe93d0bd19ff07013; + *((unsigned long *)&__m128d_op0[0]) = 0x65017c2ac9ca9fd0; + *((unsigned long *)&__m128d_op1[1]) = 0x00008bf700017052; + *((unsigned long *)&__m128d_op1[0]) = 0x0000f841000091aa; + *((unsigned long *)&__m128d_result[1]) = 0xe93d0bd19ff07013; + *((unsigned long *)&__m128d_result[0]) = 0x65017c2ac9ca9fd0; + __m128d_out = __lsx_vfsub_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x00000001ca02f854; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[0]) = 0x00000001ca02f854; + *((unsigned long *)&__m128d_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000; + __m128d_out = __lsx_vfsub_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000004000000002; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[1]) = 0x5555410154551515; + *((unsigned long *)&__m128d_op1[0]) = 0x0004455501500540; + *((unsigned long *)&__m128d_result[1]) = 0xd555410154551515; + *((unsigned long *)&__m128d_result[0]) = 0x8004455501500540; + __m128d_out = __lsx_vfsub_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000005; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128d_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[0]) = 0xffffffffffffffff; + __m128d_out = __lsx_vfsub_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x000300037ff000ff; + *((unsigned long *)&__m128d_op0[0]) = 0x0003000300a10003; + *((unsigned long *)&__m128d_op1[1]) = 0x000000007ff000ff; + *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[1]) = 0x0003000300000000; + *((unsigned long *)&__m128d_result[0]) = 0x0003000300a10003; + __m128d_out = __lsx_vfsub_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[1]) = 0x56a09e662ab46b31; + *((unsigned long *)&__m128d_op1[0]) = 0xb4b8122ef4054bb3; + *((unsigned long *)&__m128d_result[1]) = 0xd6a09e662ab46b31; + *((unsigned long *)&__m128d_result[0]) = 0x34b8122ef4054bb3; + __m128d_out = __lsx_vfsub_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[1]) = 0x7ff8000000000000; + *((unsigned long *)&__m128d_result[0]) = 0xffffffffffffffff; + __m128d_out = __lsx_vfdiv_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x7f4000007f040000; + *((unsigned long *)&__m128d_op0[0]) = 0x7f0200007f020000; + *((unsigned long *)&__m128d_op1[1]) = 0xfffffffff8f8dada; + *((unsigned long *)&__m128d_op1[0]) = 0xffffffff01018888; + *((unsigned long *)&__m128d_result[1]) = 0xfffffffff8f8dada; + *((unsigned long *)&__m128d_result[0]) = 0xffffffff01018888; + __m128d_out = __lsx_vfdiv_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x8000000080000000; + *((unsigned long *)&__m128d_op0[0]) = 0x8000000080000000; + *((unsigned long *)&__m128d_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128d_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128d_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128d_result[0]) = 0xffffffffffffffff; + __m128d_out = __lsx_vfdiv_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000100007f01; + *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[0]) = 0x7ff8000000000000; + __m128d_out = __lsx_vfdiv_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0xffffefefffffffff; + *((unsigned long *)&__m128d_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000020; + *((unsigned long *)&__m128d_op1[0]) = 0x0400000000000000; + *((unsigned long *)&__m128d_result[1]) = 0xffffefefffffffff; + *((unsigned long *)&__m128d_result[0]) = 0xffffffffffffffff; + __m128d_out = __lsx_vfdiv_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_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 *)&__m128d_result[1]) = 0x7ff8000000000000; + *((unsigned long *)&__m128d_result[0]) = 0x7ff8000000000000; + __m128d_out = __lsx_vfdiv_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x00000000ff801c9e; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000810000; + *((unsigned long *)&__m128d_op1[1]) = 0x000000000000ffff; + *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[1]) = 0x40eff02383e383e4; + *((unsigned long *)&__m128d_result[0]) = 0x7ff0000000000000; + __m128d_out = __lsx_vfdiv_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128d_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[0]) = 0xc8847ef6ed3f2000; + *((unsigned long *)&__m128d_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128d_result[0]) = 0xffffffffffffffff; + __m128d_out = __lsx_vfdiv_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0001000000010000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000cd630000cd63; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[0]) = 0xffff00000000ffff; + *((unsigned long *)&__m128d_result[1]) = 0x7ff0000000000000; + *((unsigned long *)&__m128d_result[0]) = 0xffff00000000ffff; + __m128d_out = __lsx_vfdiv_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[1]) = 0x000aa822a79308f6; + *((unsigned long *)&__m128d_op1[0]) = 0x03aa558e1d37b5a1; + *((unsigned long *)&__m128d_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000; + __m128d_out = __lsx_vfdiv_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128d_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128d_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128d_result[0]) = 0xffffffffffffffff; + __m128d_out = __lsx_vfdiv_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0xfffffffefffffffe; + *((unsigned long *)&__m128d_op0[0]) = 0xfffffffefffffffe; + *((unsigned long *)&__m128d_op1[1]) = 0xfffefffefffefffe; + *((unsigned long *)&__m128d_op1[0]) = 0xfffefffe011df03e; + *((unsigned long *)&__m128d_result[1]) = 0xfffffffefffffffe; + *((unsigned long *)&__m128d_result[0]) = 0xfffffffefffffffe; + __m128d_out = __lsx_vfdiv_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfadd_s.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfadd_s.c new file mode 100644 index 00000000000..3884302787b --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfadd_s.c @@ -0,0 +1,470 @@ +/* { 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]) = 0x05050505; + *((int *)&__m128_op0[2]) = 0x05050505; + *((int *)&__m128_op0[1]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0x05050000; + *((int *)&__m128_op1[3]) = 0x00000000; + *((int *)&__m128_op1[2]) = 0x00000000; + *((int *)&__m128_op1[1]) = 0x03574e38; + *((int *)&__m128_op1[0]) = 0xe496cbc9; + *((int *)&__m128_result[3]) = 0x05050505; + *((int *)&__m128_result[2]) = 0x05050505; + *((int *)&__m128_result[1]) = 0x03574e38; + *((int *)&__m128_result[0]) = 0xe496cbc9; + __m128_out = __lsx_vfadd_s (__m128_op0, __m128_op1); + 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_op1[3]) = 0x00000000; + *((int *)&__m128_op1[2]) = 0x00000000; + *((int *)&__m128_op1[1]) = 0x00000000; + *((int *)&__m128_op1[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_vfadd_s (__m128_op0, __m128_op1); + 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_op1[3]) = 0x00000000; + *((int *)&__m128_op1[2]) = 0x00000000; + *((int *)&__m128_op1[1]) = 0x00000000; + *((int *)&__m128_op1[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_vfadd_s (__m128_op0, __m128_op1); + 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]) = 0x0000000f; + *((int *)&__m128_op1[3]) = 0x00000000; + *((int *)&__m128_op1[2]) = 0x00000000; + *((int *)&__m128_op1[1]) = 0x00000000; + *((int *)&__m128_op1[0]) = 0x00077f88; + *((int *)&__m128_result[3]) = 0x00000000; + *((int *)&__m128_result[2]) = 0x00000000; + *((int *)&__m128_result[1]) = 0x00000000; + *((int *)&__m128_result[0]) = 0x00077f97; + __m128_out = __lsx_vfadd_s (__m128_op0, __m128_op1); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0x000000ff; + *((int *)&__m128_op0[0]) = 0x000000ff; + *((int *)&__m128_op1[3]) = 0x370bdfec; + *((int *)&__m128_op1[2]) = 0xffecffec; + *((int *)&__m128_op1[1]) = 0x370bdfec; + *((int *)&__m128_op1[0]) = 0xffecffec; + *((int *)&__m128_result[3]) = 0x370bdfec; + *((int *)&__m128_result[2]) = 0xffecffec; + *((int *)&__m128_result[1]) = 0x370bdfec; + *((int *)&__m128_result[0]) = 0xffecffec; + __m128_out = __lsx_vfadd_s (__m128_op0, __m128_op1); + 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; + *((int *)&__m128_op1[3]) = 0x00000000; + *((int *)&__m128_op1[2]) = 0x00000000; + *((int *)&__m128_op1[1]) = 0x0000ff00; + *((int *)&__m128_op1[0]) = 0x00ff0000; + *((int *)&__m128_result[3]) = 0xffffffff; + *((int *)&__m128_result[2]) = 0xffffffff; + *((int *)&__m128_result[1]) = 0xffffffff; + *((int *)&__m128_result[0]) = 0xffffffff; + __m128_out = __lsx_vfadd_s (__m128_op0, __m128_op1); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((int *)&__m128_op0[3]) = 0xffff0000; + *((int *)&__m128_op0[2]) = 0xffff0000; + *((int *)&__m128_op0[1]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0x00000000; + *((int *)&__m128_op1[3]) = 0x40088040; + *((int *)&__m128_op1[2]) = 0x80040110; + *((int *)&__m128_op1[1]) = 0x40408010; + *((int *)&__m128_op1[0]) = 0x80200110; + *((int *)&__m128_result[3]) = 0xffff0000; + *((int *)&__m128_result[2]) = 0xffff0000; + *((int *)&__m128_result[1]) = 0x40408010; + *((int *)&__m128_result[0]) = 0x80200110; + __m128_out = __lsx_vfadd_s (__m128_op0, __m128_op1); + 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_op1[3]) = 0xffffffff; + *((int *)&__m128_op1[2]) = 0xfffffffc; + *((int *)&__m128_op1[1]) = 0xffffffff; + *((int *)&__m128_op1[0]) = 0xfffffffc; + *((int *)&__m128_result[3]) = 0xffffffff; + *((int *)&__m128_result[2]) = 0xfffffffc; + *((int *)&__m128_result[1]) = 0xffffffff; + *((int *)&__m128_result[0]) = 0xfffffffc; + __m128_out = __lsx_vfadd_s (__m128_op0, __m128_op1); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((int *)&__m128_op0[3]) = 0x0000001b; + *((int *)&__m128_op0[2]) = 0x0000001b; + *((int *)&__m128_op0[1]) = 0x0000001b; + *((int *)&__m128_op0[0]) = 0x0000001b; + *((int *)&__m128_op1[3]) = 0x00000000; + *((int *)&__m128_op1[2]) = 0x00000000; + *((int *)&__m128_op1[1]) = 0x00000000; + *((int *)&__m128_op1[0]) = 0x00000000; + *((int *)&__m128_result[3]) = 0x0000001b; + *((int *)&__m128_result[2]) = 0x0000001b; + *((int *)&__m128_result[1]) = 0x0000001b; + *((int *)&__m128_result[0]) = 0x0000001b; + __m128_out = __lsx_vfadd_s (__m128_op0, __m128_op1); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((int *)&__m128_op0[3]) = 0x56411278; + *((int *)&__m128_op0[2]) = 0x43c0d41e; + *((int *)&__m128_op0[1]) = 0x0124d8f6; + *((int *)&__m128_op0[0]) = 0xa494006b; + *((int *)&__m128_op1[3]) = 0xffffffff; + *((int *)&__m128_op1[2]) = 0x00000000; + *((int *)&__m128_op1[1]) = 0x00000000; + *((int *)&__m128_op1[0]) = 0x00000000; + *((int *)&__m128_result[3]) = 0xffffffff; + *((int *)&__m128_result[2]) = 0x00000000; + *((int *)&__m128_result[1]) = 0x00000000; + *((int *)&__m128_result[0]) = 0x80000000; + __m128_out = __lsx_vfmul_s (__m128_op0, __m128_op1); + 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_op1[3]) = 0x05010501; + *((int *)&__m128_op1[2]) = 0x05010501; + *((int *)&__m128_op1[1]) = 0x05010501; + *((int *)&__m128_op1[0]) = 0x0501050c; + *((int *)&__m128_result[3]) = 0x00000000; + *((int *)&__m128_result[2]) = 0x00000000; + *((int *)&__m128_result[1]) = 0x00000000; + *((int *)&__m128_result[0]) = 0x00000000; + __m128_out = __lsx_vfmul_s (__m128_op0, __m128_op1); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((int *)&__m128_op0[3]) = 0x21f32eaf; + *((int *)&__m128_op0[2]) = 0x5b7a02c8; + *((int *)&__m128_op0[1]) = 0x407c2ca3; + *((int *)&__m128_op0[0]) = 0x2cbd0357; + *((int *)&__m128_op1[3]) = 0x00000000; + *((int *)&__m128_op1[2]) = 0x00000000; + *((int *)&__m128_op1[1]) = 0x00000000; + *((int *)&__m128_op1[0]) = 0x00010400; + *((int *)&__m128_result[3]) = 0x00000000; + *((int *)&__m128_result[2]) = 0x00000000; + *((int *)&__m128_result[1]) = 0x00000000; + *((int *)&__m128_result[0]) = 0x00000000; + __m128_out = __lsx_vfmul_s (__m128_op0, __m128_op1); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((int *)&__m128_op0[3]) = 0xfffe0001; + *((int *)&__m128_op0[2]) = 0xfffe0001; + *((int *)&__m128_op0[1]) = 0xfffe0001; + *((int *)&__m128_op0[0]) = 0xfffe0001; + *((int *)&__m128_op1[3]) = 0x00000000; + *((int *)&__m128_op1[2]) = 0x00000000; + *((int *)&__m128_op1[1]) = 0x00000000; + *((int *)&__m128_op1[0]) = 0x00000000; + *((int *)&__m128_result[3]) = 0xfffe0001; + *((int *)&__m128_result[2]) = 0xfffe0001; + *((int *)&__m128_result[1]) = 0xfffe0001; + *((int *)&__m128_result[0]) = 0xfffe0001; + __m128_out = __lsx_vfmul_s (__m128_op0, __m128_op1); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x00002ebf; + *((int *)&__m128_op0[1]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0x00000000; + *((int *)&__m128_op1[3]) = 0x00000000; + *((int *)&__m128_op1[2]) = 0x00000000; + *((int *)&__m128_op1[1]) = 0xffffffff; + *((int *)&__m128_op1[0]) = 0xffffffff; + *((int *)&__m128_result[3]) = 0x00000000; + *((int *)&__m128_result[2]) = 0x00000000; + *((int *)&__m128_result[1]) = 0xffffffff; + *((int *)&__m128_result[0]) = 0xffffffff; + __m128_out = __lsx_vfmul_s (__m128_op0, __m128_op1); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x01000000; + *((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; + *((int *)&__m128_result[3]) = 0x00000000; + *((int *)&__m128_result[2]) = 0x00000000; + *((int *)&__m128_result[1]) = 0x00000000; + *((int *)&__m128_result[0]) = 0x00000000; + __m128_out = __lsx_vfmul_s (__m128_op0, __m128_op1); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((int *)&__m128_op0[3]) = 0x00081f1f; + *((int *)&__m128_op0[2]) = 0x1f1f1f1f; + *((int *)&__m128_op0[1]) = 0x1f1f1f1f; + *((int *)&__m128_op0[0]) = 0x1f1f1f1f; + *((int *)&__m128_op1[3]) = 0x00000000; + *((int *)&__m128_op1[2]) = 0x00000000; + *((int *)&__m128_op1[1]) = 0x00000000; + *((int *)&__m128_op1[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_vfmul_s (__m128_op0, __m128_op1); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((int *)&__m128_op0[3]) = 0x021b7d24; + *((int *)&__m128_op0[2]) = 0x49678a35; + *((int *)&__m128_op0[1]) = 0x030298a6; + *((int *)&__m128_op0[0]) = 0x21030a49; + *((int *)&__m128_op1[3]) = 0x00000000; + *((int *)&__m128_op1[2]) = 0x00000000; + *((int *)&__m128_op1[1]) = 0x00000000; + *((int *)&__m128_op1[0]) = 0x00000002; + *((int *)&__m128_result[3]) = 0x00000000; + *((int *)&__m128_result[2]) = 0x00000000; + *((int *)&__m128_result[1]) = 0x00000000; + *((int *)&__m128_result[0]) = 0x00000000; + __m128_out = __lsx_vfmul_s (__m128_op0, __m128_op1); + 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_op1[3]) = 0x00000000; + *((int *)&__m128_op1[2]) = 0x00000000; + *((int *)&__m128_op1[1]) = 0x00000000; + *((int *)&__m128_op1[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_vfmul_s (__m128_op0, __m128_op1); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((int *)&__m128_op0[3]) = 0xf6548a17; + *((int *)&__m128_op0[2]) = 0x47e59090; + *((int *)&__m128_op0[1]) = 0x27b169bb; + *((int *)&__m128_op0[0]) = 0xb8145f50; + *((int *)&__m128_op1[3]) = 0x004eff62; + *((int *)&__m128_op1[2]) = 0x00d2ff76; + *((int *)&__m128_op1[1]) = 0xff700028; + *((int *)&__m128_op1[0]) = 0x00be00a0; + *((int *)&__m128_result[3]) = 0xb7032c34; + *((int *)&__m128_result[2]) = 0x093d35ab; + *((int *)&__m128_result[1]) = 0xe7a6533b; + *((int *)&__m128_result[0]) = 0x800001b8; + __m128_out = __lsx_vfmul_s (__m128_op0, __m128_op1); + 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_op1[3]) = 0x00000000; + *((int *)&__m128_op1[2]) = 0x00000000; + *((int *)&__m128_op1[1]) = 0x00000000; + *((int *)&__m128_op1[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_vfsub_s (__m128_op0, __m128_op1); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((int *)&__m128_op0[3]) = 0x7fff0101; + *((int *)&__m128_op0[2]) = 0x81010102; + *((int *)&__m128_op0[1]) = 0x7fffffff; + *((int *)&__m128_op0[0]) = 0x81010102; + *((int *)&__m128_op1[3]) = 0x00000fff; + *((int *)&__m128_op1[2]) = 0xffffe000; + *((int *)&__m128_op1[1]) = 0x00001020; + *((int *)&__m128_op1[0]) = 0x20204000; + *((int *)&__m128_result[3]) = 0x7fff0101; + *((int *)&__m128_result[2]) = 0xffffe000; + *((int *)&__m128_result[1]) = 0x7fffffff; + *((int *)&__m128_result[0]) = 0xa0204000; + __m128_out = __lsx_vfsub_s (__m128_op0, __m128_op1); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0xffffffff; + *((int *)&__m128_op0[1]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0xffffffff; + *((int *)&__m128_op1[3]) = 0x00000fff; + *((int *)&__m128_op1[2]) = 0xffffe000; + *((int *)&__m128_op1[1]) = 0x00001020; + *((int *)&__m128_op1[0]) = 0x20204000; + *((int *)&__m128_result[3]) = 0x80000fff; + *((int *)&__m128_result[2]) = 0xffffffff; + *((int *)&__m128_result[1]) = 0x80001020; + *((int *)&__m128_result[0]) = 0xffffffff; + __m128_out = __lsx_vfsub_s (__m128_op0, __m128_op1); + 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_op1[3]) = 0x00000000; + *((int *)&__m128_op1[2]) = 0x00000000; + *((int *)&__m128_op1[1]) = 0x00000000; + *((int *)&__m128_op1[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_vfsub_s (__m128_op0, __m128_op1); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((int *)&__m128_op0[3]) = 0x54feed87; + *((int *)&__m128_op0[2]) = 0xbc3f2be1; + *((int *)&__m128_op0[1]) = 0x8064d8f6; + *((int *)&__m128_op0[0]) = 0xa494afcb; + *((int *)&__m128_op1[3]) = 0x00000000; + *((int *)&__m128_op1[2]) = 0x00000000; + *((int *)&__m128_op1[1]) = 0x00000000; + *((int *)&__m128_op1[0]) = 0x00000000; + *((int *)&__m128_result[3]) = 0x7f800000; + *((int *)&__m128_result[2]) = 0xff800000; + *((int *)&__m128_result[1]) = 0xff800000; + *((int *)&__m128_result[0]) = 0xff800000; + __m128_out = __lsx_vfdiv_s (__m128_op0, __m128_op1); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0xd8248069; + *((int *)&__m128_op0[0]) = 0x7f678077; + *((int *)&__m128_op1[3]) = 0x00000000; + *((int *)&__m128_op1[2]) = 0x00000000; + *((int *)&__m128_op1[1]) = 0xd8248069; + *((int *)&__m128_op1[0]) = 0x7f678077; + *((int *)&__m128_result[3]) = 0x7fc00000; + *((int *)&__m128_result[2]) = 0x7fc00000; + *((int *)&__m128_result[1]) = 0x3f800000; + *((int *)&__m128_result[0]) = 0x3f800000; + __m128_out = __lsx_vfdiv_s (__m128_op0, __m128_op1); + 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_op1[3]) = 0x00000000; + *((int *)&__m128_op1[2]) = 0x00000000; + *((int *)&__m128_op1[1]) = 0x00000000; + *((int *)&__m128_op1[0]) = 0x00000000; + *((int *)&__m128_result[3]) = 0x7fc00000; + *((int *)&__m128_result[2]) = 0x7fc00000; + *((int *)&__m128_result[1]) = 0x7fc00000; + *((int *)&__m128_result[0]) = 0x7fc00000; + __m128_out = __lsx_vfdiv_s (__m128_op0, __m128_op1); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((int *)&__m128_op0[3]) = 0x00070000; + *((int *)&__m128_op0[2]) = 0x00040000; + *((int *)&__m128_op0[1]) = 0x00030000; + *((int *)&__m128_op0[0]) = 0x00010000; + *((int *)&__m128_op1[3]) = 0x00070000; + *((int *)&__m128_op1[2]) = 0x00040000; + *((int *)&__m128_op1[1]) = 0x00030000; + *((int *)&__m128_op1[0]) = 0x00010000; + *((int *)&__m128_result[3]) = 0x3f800000; + *((int *)&__m128_result[2]) = 0x3f800000; + *((int *)&__m128_result[1]) = 0x3f800000; + *((int *)&__m128_result[0]) = 0x3f800000; + __m128_out = __lsx_vfdiv_s (__m128_op0, __m128_op1); + 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_op1[3]) = 0x00010001; + *((int *)&__m128_op1[2]) = 0x0001007c; + *((int *)&__m128_op1[1]) = 0x00010001; + *((int *)&__m128_op1[0]) = 0x00010001; + *((int *)&__m128_result[3]) = 0x00000000; + *((int *)&__m128_result[2]) = 0x00000000; + *((int *)&__m128_result[1]) = 0x00000000; + *((int *)&__m128_result[0]) = 0x00000000; + __m128_out = __lsx_vfdiv_s (__m128_op0, __m128_op1); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((int *)&__m128_op0[3]) = 0x00001fff; + *((int *)&__m128_op0[2]) = 0x00001fff; + *((int *)&__m128_op0[1]) = 0x00000003; + *((int *)&__m128_op0[0]) = 0xfffffffc; + *((int *)&__m128_op1[3]) = 0x00000000; + *((int *)&__m128_op1[2]) = 0x00000000; + *((int *)&__m128_op1[1]) = 0x00000000; + *((int *)&__m128_op1[0]) = 0x00000000; + *((int *)&__m128_result[3]) = 0x7f800000; + *((int *)&__m128_result[2]) = 0x7f800000; + *((int *)&__m128_result[1]) = 0x7f800000; + *((int *)&__m128_result[0]) = 0xfffffffc; + __m128_out = __lsx_vfdiv_s (__m128_op0, __m128_op1); + 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_op1[3]) = 0x00000000; + *((int *)&__m128_op1[2]) = 0x00000000; + *((int *)&__m128_op1[1]) = 0x00000000; + *((int *)&__m128_op1[0]) = 0x00000000; + *((int *)&__m128_result[3]) = 0x7fc00000; + *((int *)&__m128_result[2]) = 0x7fc00000; + *((int *)&__m128_result[1]) = 0x7fc00000; + *((int *)&__m128_result[0]) = 0x7fc00000; + __m128_out = __lsx_vfdiv_s (__m128_op0, __m128_op1); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfclass_d.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfclass_d.c new file mode 100644 index 00000000000..9706d7adca3 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfclass_d.c @@ -0,0 +1,83 @@ +/* { 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]) = 0x0001ffff0001ffff; + *((unsigned long *)&__m128d_op0[0]) = 0x0001ffff0001ffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000100; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000100; + __m128i_out = __lsx_vfclass_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]) = 0x0000000000000200; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000200; + __m128i_out = __lsx_vfclass_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]) = 0x0000000000000200; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000200; + __m128i_out = __lsx_vfclass_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]) = 0x0000000000000002; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000002; + __m128i_out = __lsx_vfclass_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0xff00ff00ff00ff00; + *((unsigned long *)&__m128d_op0[0]) = 0xff00000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000008; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000008; + __m128i_out = __lsx_vfclass_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]) = 0x0000000000000200; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000200; + __m128i_out = __lsx_vfclass_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x14ccc6320176a4d2; + *((unsigned long *)&__m128d_op0[0]) = 0x685670d37e80682a; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000080; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000080; + __m128i_out = __lsx_vfclass_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]) = 0x0000000000000200; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000200; + __m128i_out = __lsx_vfclass_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]) = 0x0000000000000200; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000200; + __m128i_out = __lsx_vfclass_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfclass_s.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfclass_s.c new file mode 100644 index 00000000000..7166f954bd3 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfclass_s.c @@ -0,0 +1,74 @@ +/* { 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]) = 0x7fff8000; + *((int *)&__m128_op0[1]) = 0x00010081; + *((int *)&__m128_op0[0]) = 0x00000005; + *((unsigned long *)&__m128i_result[1]) = 0x0000020000000002; + *((unsigned long *)&__m128i_result[0]) = 0x0000010000000100; + __m128i_out = __lsx_vfclass_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0xfe02fe02; + *((int *)&__m128_op0[2]) = 0xfe02fe02; + *((int *)&__m128_op0[1]) = 0xfe02fe02; + *((int *)&__m128_op0[0]) = 0xfe02fe02; + *((unsigned long *)&__m128i_result[1]) = 0x0000000800000008; + *((unsigned long *)&__m128i_result[0]) = 0x0000000800000008; + __m128i_out = __lsx_vfclass_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x0000000c; + *((int *)&__m128_op0[2]) = 0x7fff000c; + *((int *)&__m128_op0[1]) = 0x10001000; + *((int *)&__m128_op0[0]) = 0x10001000; + *((unsigned long *)&__m128i_result[1]) = 0x0000010000000002; + *((unsigned long *)&__m128i_result[0]) = 0x0000008000000080; + __m128i_out = __lsx_vfclass_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]) = 0x0000020000000200; + *((unsigned long *)&__m128i_result[0]) = 0x0000020000000200; + __m128i_out = __lsx_vfclass_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]) = 0x0000020000000200; + *((unsigned long *)&__m128i_result[0]) = 0x0000020000000200; + __m128i_out = __lsx_vfclass_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x0c0b0a09; + *((int *)&__m128_op0[2]) = 0x0b0a0908; + *((int *)&__m128_op0[1]) = 0x0a090807; + *((int *)&__m128_op0[0]) = 0x09080706; + *((unsigned long *)&__m128i_result[1]) = 0x0000008000000080; + *((unsigned long *)&__m128i_result[0]) = 0x0000008000000080; + __m128i_out = __lsx_vfclass_s (__m128_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vflogb_d.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vflogb_d.c new file mode 100644 index 00000000000..cc36bf13688 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vflogb_d.c @@ -0,0 +1,76 @@ +/* { 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]) = 0x0000000000000002; + *((unsigned long *)&__m128d_result[1]) = 0xfff0000000000000; + *((unsigned long *)&__m128d_result[0]) = 0xc090c40000000000; + __m128d_out = __lsx_vflogb_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]) = 0xfff0000000000000; + *((unsigned long *)&__m128d_result[0]) = 0xfff0000000000000; + __m128d_out = __lsx_vflogb_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]) = 0xfff0000000000000; + *((unsigned long *)&__m128d_result[0]) = 0xfff0000000000000; + __m128d_out = __lsx_vflogb_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]) = 0xfff0000000000000; + *((unsigned long *)&__m128d_result[0]) = 0xfff0000000000000; + __m128d_out = __lsx_vflogb_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]) = 0xfff0000000000000; + *((unsigned long *)&__m128d_result[0]) = 0xfff0000000000000; + __m128d_out = __lsx_vflogb_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]) = 0xfff0000000000000; + *((unsigned long *)&__m128d_result[0]) = 0xfff0000000000000; + __m128d_out = __lsx_vflogb_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]) = 0xfff0000000000000; + *((unsigned long *)&__m128d_result[0]) = 0xfff0000000000000; + __m128d_out = __lsx_vflogb_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0xfffffffffffbfffc; + *((unsigned long *)&__m128d_op0[0]) = 0x0000001000000048; + *((unsigned long *)&__m128d_result[1]) = 0xfffffffffffbfffc; + *((unsigned long *)&__m128d_result[0]) = 0xc090380000000000; + __m128d_out = __lsx_vflogb_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vflogb_s.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vflogb_s.c new file mode 100644 index 00000000000..6245896205c --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vflogb_s.c @@ -0,0 +1,185 @@ +/* { 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]) = 0x00003004; + *((int *)&__m128_result[3]) = 0xff800000; + *((int *)&__m128_result[2]) = 0xff800000; + *((int *)&__m128_result[1]) = 0xff800000; + *((int *)&__m128_result[0]) = 0xc3080000; + __m128_out = __lsx_vflogb_s (__m128_op0); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((int *)&__m128_op0[3]) = 0xffffffff; + *((int *)&__m128_op0[2]) = 0xffffffff; + *((int *)&__m128_op0[1]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0x00000000; + *((int *)&__m128_result[3]) = 0xffffffff; + *((int *)&__m128_result[2]) = 0xffffffff; + *((int *)&__m128_result[1]) = 0xff800000; + *((int *)&__m128_result[0]) = 0xff800000; + __m128_out = __lsx_vflogb_s (__m128_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; + *((int *)&__m128_result[3]) = 0xff800000; + *((int *)&__m128_result[2]) = 0xff800000; + *((int *)&__m128_result[1]) = 0xffffffff; + *((int *)&__m128_result[0]) = 0xffffffff; + __m128_out = __lsx_vflogb_s (__m128_op0); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((int *)&__m128_op0[3]) = 0x01010101; + *((int *)&__m128_op0[2]) = 0x01010101; + *((int *)&__m128_op0[1]) = 0x01010101; + *((int *)&__m128_op0[0]) = 0x01010101; + *((int *)&__m128_result[3]) = 0xc2fa0000; + *((int *)&__m128_result[2]) = 0xc2fa0000; + *((int *)&__m128_result[1]) = 0xc2fa0000; + *((int *)&__m128_result[0]) = 0xc2fa0000; + __m128_out = __lsx_vflogb_s (__m128_op0); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((int *)&__m128_op0[3]) = 0x01ff01ff; + *((int *)&__m128_op0[2]) = 0x01ff01ff; + *((int *)&__m128_op0[1]) = 0x01ff01ff; + *((int *)&__m128_op0[0]) = 0x01ff01ff; + *((int *)&__m128_result[3]) = 0xc2f80000; + *((int *)&__m128_result[2]) = 0xc2f80000; + *((int *)&__m128_result[1]) = 0xc2f80000; + *((int *)&__m128_result[0]) = 0xc2f80000; + __m128_out = __lsx_vflogb_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]) = 0xd46cdc13; + *((int *)&__m128_result[3]) = 0xff800000; + *((int *)&__m128_result[2]) = 0xff800000; + *((int *)&__m128_result[1]) = 0xff800000; + *((int *)&__m128_result[0]) = 0x7fc00000; + __m128_out = __lsx_vflogb_s (__m128_op0); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((int *)&__m128_op0[3]) = 0x00fe00fe; + *((int *)&__m128_op0[2]) = 0x000200fe; + *((int *)&__m128_op0[1]) = 0x00fe00fe; + *((int *)&__m128_op0[0]) = 0x000200fe; + *((int *)&__m128_result[3]) = 0xc2fc0000; + *((int *)&__m128_result[2]) = 0xc3040000; + *((int *)&__m128_result[1]) = 0xc2fc0000; + *((int *)&__m128_result[0]) = 0xc3040000; + __m128_out = __lsx_vflogb_s (__m128_op0); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0x01010101; + *((int *)&__m128_op0[0]) = 0x00000100; + *((int *)&__m128_result[3]) = 0xff800000; + *((int *)&__m128_result[2]) = 0xff800000; + *((int *)&__m128_result[1]) = 0xc2fa0000; + *((int *)&__m128_result[0]) = 0xc30d0000; + __m128_out = __lsx_vflogb_s (__m128_op0); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x00000014; + *((int *)&__m128_op0[1]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0x00000014; + *((int *)&__m128_result[3]) = 0xff800000; + *((int *)&__m128_result[2]) = 0xc3110000; + *((int *)&__m128_result[1]) = 0xff800000; + *((int *)&__m128_result[0]) = 0xc3110000; + __m128_out = __lsx_vflogb_s (__m128_op0); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0x4e3e1337; + *((int *)&__m128_op0[0]) = 0x38bb47d2; + *((int *)&__m128_result[3]) = 0xff800000; + *((int *)&__m128_result[2]) = 0xff800000; + *((int *)&__m128_result[1]) = 0x41e80000; + *((int *)&__m128_result[0]) = 0xc1600000; + __m128_out = __lsx_vflogb_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]) = 0xff800000; + *((int *)&__m128_result[2]) = 0xff800000; + *((int *)&__m128_result[1]) = 0xff800000; + *((int *)&__m128_result[0]) = 0xff800000; + __m128_out = __lsx_vflogb_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]) = 0xff800000; + *((int *)&__m128_result[2]) = 0xff800000; + *((int *)&__m128_result[1]) = 0xff800000; + *((int *)&__m128_result[0]) = 0xff800000; + __m128_out = __lsx_vflogb_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]) = 0xff800000; + *((int *)&__m128_result[2]) = 0xff800000; + *((int *)&__m128_result[1]) = 0xff800000; + *((int *)&__m128_result[0]) = 0xff800000; + __m128_out = __lsx_vflogb_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]) = 0x00003ff8; + *((int *)&__m128_result[3]) = 0xff800000; + *((int *)&__m128_result[2]) = 0xff800000; + *((int *)&__m128_result[1]) = 0xff800000; + *((int *)&__m128_result[0]) = 0xc3080000; + __m128_out = __lsx_vflogb_s (__m128_op0); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((int *)&__m128_op0[3]) = 0xf1f181a2; + *((int *)&__m128_op0[2]) = 0xf1f1f1b0; + *((int *)&__m128_op0[1]) = 0xf1f1f1f1; + *((int *)&__m128_op0[0]) = 0xf180f1f1; + *((int *)&__m128_result[3]) = 0x7fc00000; + *((int *)&__m128_result[2]) = 0x7fc00000; + *((int *)&__m128_result[1]) = 0x7fc00000; + *((int *)&__m128_result[0]) = 0x7fc00000; + __m128_out = __lsx_vflogb_s (__m128_op0); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfmax_d.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfmax_d.c new file mode 100644 index 00000000000..442473fb410 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfmax_d.c @@ -0,0 +1,200 @@ +/* { 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 *)&__m128d_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000; + __m128d_out = __lsx_vfmax_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000010; + *((unsigned long *)&__m128d_op1[1]) = 0x0400040004000400; + *((unsigned long *)&__m128d_op1[0]) = 0x0400040004000400; + *((unsigned long *)&__m128d_result[1]) = 0x0400040004000400; + *((unsigned long *)&__m128d_result[0]) = 0x0400040004000400; + __m128d_out = __lsx_vfmax_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x01ff01ff01ff01ff; + *((unsigned long *)&__m128d_op0[0]) = 0x01ff01ff01ff01ff; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[1]) = 0x01ff01ff01ff01ff; + *((unsigned long *)&__m128d_result[0]) = 0x01ff01ff01ff01ff; + __m128d_out = __lsx_vfmax_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0xfffcfffcfffcfffc; + *((unsigned long *)&__m128d_op0[0]) = 0xfffcfffcfffcfffc; + *((unsigned long *)&__m128d_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128d_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128d_result[1]) = 0xfffcfffcfffcfffc; + *((unsigned long *)&__m128d_result[0]) = 0xfffcfffcfffcfffc; + __m128d_out = __lsx_vfmax_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[0]) = 0x000000000000ffff; + *((unsigned long *)&__m128d_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[0]) = 0x000000000000ffff; + __m128d_out = __lsx_vfmax_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_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 *)&__m128d_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000; + __m128d_out = __lsx_vfmax_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x6363636363636363; + *((unsigned long *)&__m128d_op0[0]) = 0x6363636363636363; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000001; + *((unsigned long *)&__m128d_op1[0]) = 0xfdfef9ff0efff900; + *((unsigned long *)&__m128d_result[1]) = 0x6363636363636363; + *((unsigned long *)&__m128d_result[0]) = 0x6363636363636363; + __m128d_out = __lsx_vfmax_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0xd70b30c96ea9f4e8; + *((unsigned long *)&__m128d_op0[0]) = 0xa352bfac9269e0aa; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000; + __m128d_out = __lsx_vfmax_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x98147a504d145000; + *((unsigned long *)&__m128d_op0[0]) = 0x377b810912c0e000; + *((unsigned long *)&__m128d_op1[1]) = 0xfffffffffffffff7; + *((unsigned long *)&__m128d_op1[0]) = 0xfffffffffffffff7; + *((unsigned long *)&__m128d_result[1]) = 0x98147a504d145000; + *((unsigned long *)&__m128d_result[0]) = 0x377b810912c0e000; + __m128d_out = __lsx_vfmax_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x4399d3221a29d3f2; + *((unsigned long *)&__m128d_op0[0]) = 0xc3818bffe7b7a7b8; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[1]) = 0x4399d3221a29d3f2; + *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000; + __m128d_out = __lsx_vfmax_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x17c64aaef639f093; + *((unsigned long *)&__m128d_op0[0]) = 0xdb8f439722ec502d; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[1]) = 0x17c64aaef639f093; + *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000; + __m128d_out = __lsx_vfmax_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x10f881a20ffd02b0; + *((unsigned long *)&__m128d_op0[0]) = 0x00000000ff800000; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[1]) = 0x10f881a20ffd02b0; + *((unsigned long *)&__m128d_result[0]) = 0x00000000ff800000; + __m128d_out = __lsx_vfmax_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_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 *)&__m128d_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000; + __m128d_out = __lsx_vfmin_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128d_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[0]) = 0xffffffffffffffff; + __m128d_out = __lsx_vfmin_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000006f00001f0a; + *((unsigned long *)&__m128d_op0[0]) = 0x0000c000ffffc000; + *((unsigned long *)&__m128d_op1[1]) = 0x0000006f00001f0a; + *((unsigned long *)&__m128d_op1[0]) = 0x0000958affff995d; + *((unsigned long *)&__m128d_result[1]) = 0x0000006f00001f0a; + *((unsigned long *)&__m128d_result[0]) = 0x0000958affff995d; + __m128d_out = __lsx_vfmin_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_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 *)&__m128d_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000; + __m128d_out = __lsx_vfmin_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_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 *)&__m128d_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000; + __m128d_out = __lsx_vfmin_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128d_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128d_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000; + __m128d_out = __lsx_vfmin_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[1]) = 0x8000000000000000; + *((unsigned long *)&__m128d_op1[0]) = 0x1748c4f9ed1a5870; + *((unsigned long *)&__m128d_result[1]) = 0x8000000000000000; + *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000; + __m128d_out = __lsx_vfmin_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_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 *)&__m128d_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000; + __m128d_out = __lsx_vfmin_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfmax_s.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfmax_s.c new file mode 100644 index 00000000000..876588827ae --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfmax_s.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; + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0x0000ffff; + *((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; + *((int *)&__m128_result[3]) = 0x00000000; + *((int *)&__m128_result[2]) = 0x00000000; + *((int *)&__m128_result[1]) = 0x0000ffff; + *((int *)&__m128_result[0]) = 0x00000000; + __m128_out = __lsx_vfmax_s (__m128_op0, __m128_op1); + 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_op1[3]) = 0xc2409eda; + *((int *)&__m128_op1[2]) = 0xb019323f; + *((int *)&__m128_op1[1]) = 0x460f3b39; + *((int *)&__m128_op1[0]) = 0x3ef4be3a; + *((int *)&__m128_result[3]) = 0x00000000; + *((int *)&__m128_result[2]) = 0x00000000; + *((int *)&__m128_result[1]) = 0x460f3b39; + *((int *)&__m128_result[0]) = 0x3ef4be3a; + __m128_out = __lsx_vfmax_s (__m128_op0, __m128_op1); + ASSERTEQ_32 (__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_op1[3]) = 0x00000000; + *((int *)&__m128_op1[2]) = 0x00000000; + *((int *)&__m128_op1[1]) = 0x00000000; + *((int *)&__m128_op1[0]) = 0x00000000; + *((int *)&__m128_result[3]) = 0x00000000; + *((int *)&__m128_result[2]) = 0x00000001; + *((int *)&__m128_result[1]) = 0x00000000; + *((int *)&__m128_result[0]) = 0x00000001; + __m128_out = __lsx_vfmax_s (__m128_op0, __m128_op1); + 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_op1[3]) = 0xfefd7f7f; + *((int *)&__m128_op1[2]) = 0x7f7f7f7e; + *((int *)&__m128_op1[1]) = 0xdffdbffe; + *((int *)&__m128_op1[0]) = 0xba6f5543; + *((int *)&__m128_result[3]) = 0x00000000; + *((int *)&__m128_result[2]) = 0x7f7f7f7e; + *((int *)&__m128_result[1]) = 0x00000000; + *((int *)&__m128_result[0]) = 0x00000000; + __m128_out = __lsx_vfmax_s (__m128_op0, __m128_op1); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((int *)&__m128_op0[3]) = 0xff84fff4; + *((int *)&__m128_op0[2]) = 0xff84fff4; + *((int *)&__m128_op0[1]) = 0xffffffff; + *((int *)&__m128_op0[0]) = 0xfffffff0; + *((int *)&__m128_op1[3]) = 0xff84fff4; + *((int *)&__m128_op1[2]) = 0xff84fff4; + *((int *)&__m128_op1[1]) = 0xffffffff; + *((int *)&__m128_op1[0]) = 0xfffffff0; + *((int *)&__m128_result[3]) = 0xffc4fff4; + *((int *)&__m128_result[2]) = 0xffc4fff4; + *((int *)&__m128_result[1]) = 0xffffffff; + *((int *)&__m128_result[0]) = 0xfffffff0; + __m128_out = __lsx_vfmax_s (__m128_op0, __m128_op1); + 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_op1[3]) = 0x00007fff; + *((int *)&__m128_op1[2]) = 0x00007fff; + *((int *)&__m128_op1[1]) = 0x00000000; + *((int *)&__m128_op1[0]) = 0x00000000; + *((int *)&__m128_result[3]) = 0x00007fff; + *((int *)&__m128_result[2]) = 0x00007fff; + *((int *)&__m128_result[1]) = 0x00000000; + *((int *)&__m128_result[0]) = 0x00000000; + __m128_out = __lsx_vfmax_s (__m128_op0, __m128_op1); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0xffffffff; + *((int *)&__m128_op0[1]) = 0xffffffff; + *((int *)&__m128_op0[0]) = 0xffffffff; + *((int *)&__m128_op1[3]) = 0xffffffff; + *((int *)&__m128_op1[2]) = 0x00000000; + *((int *)&__m128_op1[1]) = 0x00000000; + *((int *)&__m128_op1[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_vfmax_s (__m128_op0, __m128_op1); + 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_op1[3]) = 0x00000000; + *((int *)&__m128_op1[2]) = 0x00000000; + *((int *)&__m128_op1[1]) = 0x00000000; + *((int *)&__m128_op1[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_vfmax_s (__m128_op0, __m128_op1); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x00000001; + *((int *)&__m128_op0[1]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0x00000000; + *((int *)&__m128_op1[3]) = 0xffffffff; + *((int *)&__m128_op1[2]) = 0xffffffff; + *((int *)&__m128_op1[1]) = 0xffffffff; + *((int *)&__m128_op1[0]) = 0xffffffff; + *((int *)&__m128_result[3]) = 0x00000000; + *((int *)&__m128_result[2]) = 0x00000001; + *((int *)&__m128_result[1]) = 0x00000000; + *((int *)&__m128_result[0]) = 0x00000000; + __m128_out = __lsx_vfmax_s (__m128_op0, __m128_op1); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0x01010001; + *((int *)&__m128_op0[0]) = 0x01010001; + *((int *)&__m128_op1[3]) = 0x00000000; + *((int *)&__m128_op1[2]) = 0x00020000; + *((int *)&__m128_op1[1]) = 0x00000000; + *((int *)&__m128_op1[0]) = 0x00020000; + *((int *)&__m128_result[3]) = 0x00000000; + *((int *)&__m128_result[2]) = 0x00020000; + *((int *)&__m128_result[1]) = 0x01010001; + *((int *)&__m128_result[0]) = 0x01010001; + __m128_out = __lsx_vfmax_s (__m128_op0, __m128_op1); + 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_op1[3]) = 0x00000020; + *((int *)&__m128_op1[2]) = 0x00000020; + *((int *)&__m128_op1[1]) = 0x0000001f; + *((int *)&__m128_op1[0]) = 0x0000001f; + *((int *)&__m128_result[3]) = 0x00000020; + *((int *)&__m128_result[2]) = 0x00000020; + *((int *)&__m128_result[1]) = 0x0000001f; + *((int *)&__m128_result[0]) = 0x0000001f; + __m128_out = __lsx_vfmax_s (__m128_op0, __m128_op1); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0xf3040705; + *((int *)&__m128_op0[1]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0x00000000; + *((int *)&__m128_op1[3]) = 0x00000000; + *((int *)&__m128_op1[2]) = 0xf3040705; + *((int *)&__m128_op1[1]) = 0x00000000; + *((int *)&__m128_op1[0]) = 0x00000000; + *((int *)&__m128_result[3]) = 0x00000000; + *((int *)&__m128_result[2]) = 0xf3040705; + *((int *)&__m128_result[1]) = 0x00000000; + *((int *)&__m128_result[0]) = 0x00000000; + __m128_out = __lsx_vfmax_s (__m128_op0, __m128_op1); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x00000004; + *((int *)&__m128_op0[1]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0x00000004; + *((int *)&__m128_op1[3]) = 0x00000000; + *((int *)&__m128_op1[2]) = 0x00000004; + *((int *)&__m128_op1[1]) = 0x00000000; + *((int *)&__m128_op1[0]) = 0x00000004; + *((int *)&__m128_result[3]) = 0x00000000; + *((int *)&__m128_result[2]) = 0x00000004; + *((int *)&__m128_result[1]) = 0x00000000; + *((int *)&__m128_result[0]) = 0x00000004; + __m128_out = __lsx_vfmax_s (__m128_op0, __m128_op1); + 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_op1[3]) = 0x00000000; + *((int *)&__m128_op1[2]) = 0x00000000; + *((int *)&__m128_op1[1]) = 0x00000000; + *((int *)&__m128_op1[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_vfmax_s (__m128_op0, __m128_op1); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((int *)&__m128_op0[3]) = 0x0000ffff; + *((int *)&__m128_op0[2]) = 0x0000ffff; + *((int *)&__m128_op0[1]) = 0x0000ffff; + *((int *)&__m128_op0[0]) = 0x0000fffe; + *((int *)&__m128_op1[3]) = 0x00000000; + *((int *)&__m128_op1[2]) = 0x00000000; + *((int *)&__m128_op1[1]) = 0x00000000; + *((int *)&__m128_op1[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_vfmin_s (__m128_op0, __m128_op1); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((int *)&__m128_op0[3]) = 0xffffffff; + *((int *)&__m128_op0[2]) = 0xffffffe5; + *((int *)&__m128_op0[1]) = 0xffffffff; + *((int *)&__m128_op0[0]) = 0xffffffe5; + *((int *)&__m128_op1[3]) = 0x00000000; + *((int *)&__m128_op1[2]) = 0x00000000; + *((int *)&__m128_op1[1]) = 0x00000000; + *((int *)&__m128_op1[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_vfmin_s (__m128_op0, __m128_op1); + 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_op1[3]) = 0x00000000; + *((int *)&__m128_op1[2]) = 0x00000000; + *((int *)&__m128_op1[1]) = 0x00000000; + *((int *)&__m128_op1[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_vfmin_s (__m128_op0, __m128_op1); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((int *)&__m128_op0[3]) = 0x13121110; + *((int *)&__m128_op0[2]) = 0x1211100f; + *((int *)&__m128_op0[1]) = 0x11100f0e; + *((int *)&__m128_op0[0]) = 0x100f0e0d; + *((int *)&__m128_op1[3]) = 0x00000000; + *((int *)&__m128_op1[2]) = 0x00000000; + *((int *)&__m128_op1[1]) = 0x00000000; + *((int *)&__m128_op1[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_vfmin_s (__m128_op0, __m128_op1); + 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]) = 0xfffffff3; + *((int *)&__m128_op1[3]) = 0x00000000; + *((int *)&__m128_op1[2]) = 0x00000008; + *((int *)&__m128_op1[1]) = 0x00000000; + *((int *)&__m128_op1[0]) = 0x00000088; + *((int *)&__m128_result[3]) = 0x00000000; + *((int *)&__m128_result[2]) = 0x00000008; + *((int *)&__m128_result[1]) = 0x00000000; + *((int *)&__m128_result[0]) = 0x00000088; + __m128_out = __lsx_vfmin_s (__m128_op0, __m128_op1); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((int *)&__m128_op0[3]) = 0x52525252; + *((int *)&__m128_op0[2]) = 0xadadadad; + *((int *)&__m128_op0[1]) = 0x52525252; + *((int *)&__m128_op0[0]) = 0xadadadad; + *((int *)&__m128_op1[3]) = 0x00000000; + *((int *)&__m128_op1[2]) = 0xffffffff; + *((int *)&__m128_op1[1]) = 0x00000000; + *((int *)&__m128_op1[0]) = 0xffffffff; + *((int *)&__m128_result[3]) = 0x00000000; + *((int *)&__m128_result[2]) = 0xadadadad; + *((int *)&__m128_result[1]) = 0x00000000; + *((int *)&__m128_result[0]) = 0xadadadad; + __m128_out = __lsx_vfmin_s (__m128_op0, __m128_op1); + 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]) = 0x0000ffff; + *((int *)&__m128_op1[3]) = 0x00000000; + *((int *)&__m128_op1[2]) = 0x00000000; + *((int *)&__m128_op1[1]) = 0x00000000; + *((int *)&__m128_op1[0]) = 0x0000ffff; + *((int *)&__m128_result[3]) = 0x00000000; + *((int *)&__m128_result[2]) = 0x00000000; + *((int *)&__m128_result[1]) = 0x00000000; + *((int *)&__m128_result[0]) = 0x0000ffff; + __m128_out = __lsx_vfmin_s (__m128_op0, __m128_op1); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfmaxa_d.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfmaxa_d.c new file mode 100644 index 00000000000..c2766d5c649 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfmaxa_d.c @@ -0,0 +1,155 @@ +/* { 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 *)&__m128d_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[0]) = 0x0000800000000000; + *((unsigned long *)&__m128d_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[0]) = 0x0000800000000000; + __m128d_out = __lsx_vfmaxa_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_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 *)&__m128d_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000; + __m128d_out = __lsx_vfmaxa_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_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 *)&__m128d_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000; + __m128d_out = __lsx_vfmaxa_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x01203f1e3d1c3b1a; + *((unsigned long *)&__m128d_op0[0]) = 0x3918371635143312; + *((unsigned long *)&__m128d_op1[1]) = 0x00000af555555555; + *((unsigned long *)&__m128d_op1[0]) = 0x00000af555555555; + *((unsigned long *)&__m128d_result[1]) = 0x01203f1e3d1c3b1a; + *((unsigned long *)&__m128d_result[0]) = 0x3918371635143312; + __m128d_out = __lsx_vfmaxa_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000010000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000010000000000; + *((unsigned long *)&__m128d_op1[1]) = 0x0000010000000000; + *((unsigned long *)&__m128d_op1[0]) = 0x0000010000000000; + *((unsigned long *)&__m128d_result[1]) = 0x0000010000000000; + *((unsigned long *)&__m128d_result[0]) = 0x0000010000000000; + __m128d_out = __lsx_vfmaxa_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000; + __m128d_out = __lsx_vfmaxa_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_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 *)&__m128d_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000; + __m128d_out = __lsx_vfmaxa_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_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 *)&__m128d_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000; + __m128d_out = __lsx_vfmaxa_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x10f8000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[1]) = 0xfff8ffa2fffdffb0; + *((unsigned long *)&__m128d_op1[0]) = 0x00000000ff800000; + *((unsigned long *)&__m128d_result[1]) = 0x10f8000000000000; + *((unsigned long *)&__m128d_result[0]) = 0x00000000ff800000; + __m128d_out = __lsx_vfmaxa_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000200000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128d_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128d_result[1]) = 0x0000000200000000; + *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000; + __m128d_out = __lsx_vfmina_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000100000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000080000000; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[0]) = 0x80000000fff6fc00; + *((unsigned long *)&__m128d_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[0]) = 0x0000000080000000; + __m128d_out = __lsx_vfmina_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[0]) = 0x0000080000000000; + *((unsigned long *)&__m128d_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000; + __m128d_out = __lsx_vfmina_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000158; + *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000; + __m128d_out = __lsx_vfmina_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[0]) = 0xfffe0004fffe0004; + *((unsigned long *)&__m128d_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000; + __m128d_out = __lsx_vfmina_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0xff800000ff800000; + *((unsigned long *)&__m128d_op0[0]) = 0xff800000ff800000; + *((unsigned long *)&__m128d_op1[1]) = 0x002a001a001a000b; + *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[1]) = 0x002a001a001a000b; + *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000; + __m128d_out = __lsx_vfmina_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfmaxa_s.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfmaxa_s.c new file mode 100644 index 00000000000..5fcdedd3f92 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfmaxa_s.c @@ -0,0 +1,230 @@ +/* { 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; + *((int *)&__m128_op1[3]) = 0x00000000; + *((int *)&__m128_op1[2]) = 0x00000000; + *((int *)&__m128_op1[1]) = 0x00000000; + *((int *)&__m128_op1[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_vfmaxa_s (__m128_op0, __m128_op1); + 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; + *((int *)&__m128_op1[3]) = 0xff800000; + *((int *)&__m128_op1[2]) = 0x00000000; + *((int *)&__m128_op1[1]) = 0xff800000; + *((int *)&__m128_op1[0]) = 0x00000000; + *((int *)&__m128_result[3]) = 0xff800000; + *((int *)&__m128_result[2]) = 0x00000000; + *((int *)&__m128_result[1]) = 0xff800000; + *((int *)&__m128_result[0]) = 0x2f4ef4a8; + __m128_out = __lsx_vfmaxa_s (__m128_op0, __m128_op1); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((int *)&__m128_op0[3]) = 0x00000800; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0x00000800; + *((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; + *((int *)&__m128_result[3]) = 0x00000800; + *((int *)&__m128_result[2]) = 0x00000000; + *((int *)&__m128_result[1]) = 0x00000800; + *((int *)&__m128_result[0]) = 0x00000000; + __m128_out = __lsx_vfmaxa_s (__m128_op0, __m128_op1); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0xc0c0c000; + *((int *)&__m128_op0[1]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0x00000000; + *((int *)&__m128_op1[3]) = 0x00800080; + *((int *)&__m128_op1[2]) = 0x00800080; + *((int *)&__m128_op1[1]) = 0x0080006b; + *((int *)&__m128_op1[0]) = 0x00000000; + *((int *)&__m128_result[3]) = 0x00800080; + *((int *)&__m128_result[2]) = 0xc0c0c000; + *((int *)&__m128_result[1]) = 0x0080006b; + *((int *)&__m128_result[0]) = 0x00000000; + __m128_out = __lsx_vfmaxa_s (__m128_op0, __m128_op1); + 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; + *((int *)&__m128_op1[3]) = 0x00000000; + *((int *)&__m128_op1[2]) = 0x00000000; + *((int *)&__m128_op1[1]) = 0x00000000; + *((int *)&__m128_op1[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_vfmaxa_s (__m128_op0, __m128_op1); + 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_op1[3]) = 0x80000000; + *((int *)&__m128_op1[2]) = 0x00000000; + *((int *)&__m128_op1[1]) = 0x80000000; + *((int *)&__m128_op1[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_vfmaxa_s (__m128_op0, __m128_op1); + 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_op1[3]) = 0x00000000; + *((int *)&__m128_op1[2]) = 0x00000000; + *((int *)&__m128_op1[1]) = 0x00000000; + *((int *)&__m128_op1[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_vfmaxa_s (__m128_op0, __m128_op1); + 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_op1[3]) = 0x00000000; + *((int *)&__m128_op1[2]) = 0x00000000; + *((int *)&__m128_op1[1]) = 0x00000000; + *((int *)&__m128_op1[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_vfmina_s (__m128_op0, __m128_op1); + 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_op1[3]) = 0xffffffff; + *((int *)&__m128_op1[2]) = 0xffffffff; + *((int *)&__m128_op1[1]) = 0xffffffff; + *((int *)&__m128_op1[0]) = 0xffffffff; + *((int *)&__m128_result[3]) = 0x00000000; + *((int *)&__m128_result[2]) = 0x00000000; + *((int *)&__m128_result[1]) = 0x00000000; + *((int *)&__m128_result[0]) = 0x00000000; + __m128_out = __lsx_vfmina_s (__m128_op0, __m128_op1); + 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_op1[3]) = 0x00000000; + *((int *)&__m128_op1[2]) = 0x00000000; + *((int *)&__m128_op1[1]) = 0x00000000; + *((int *)&__m128_op1[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_vfmina_s (__m128_op0, __m128_op1); + 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_op1[3]) = 0xff01ff01; + *((int *)&__m128_op1[2]) = 0x0000ff7d; + *((int *)&__m128_op1[1]) = 0x00000000; + *((int *)&__m128_op1[0]) = 0x0000fffc; + *((int *)&__m128_result[3]) = 0x00000000; + *((int *)&__m128_result[2]) = 0x00000000; + *((int *)&__m128_result[1]) = 0x00000000; + *((int *)&__m128_result[0]) = 0x00000000; + __m128_out = __lsx_vfmina_s (__m128_op0, __m128_op1); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0xdfa6e0c6; + *((int *)&__m128_op0[1]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0xd46cdc13; + *((int *)&__m128_op1[3]) = 0x00000000; + *((int *)&__m128_op1[2]) = 0x00000000; + *((int *)&__m128_op1[1]) = 0x00000000; + *((int *)&__m128_op1[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_vfmina_s (__m128_op0, __m128_op1); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((int *)&__m128_op0[3]) = 0x01010101; + *((int *)&__m128_op0[2]) = 0x01010101; + *((int *)&__m128_op0[1]) = 0x010101fe; + *((int *)&__m128_op0[0]) = 0x0101fe87; + *((int *)&__m128_op1[3]) = 0x00000000; + *((int *)&__m128_op1[2]) = 0x00000000; + *((int *)&__m128_op1[1]) = 0x00000000; + *((int *)&__m128_op1[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_vfmina_s (__m128_op0, __m128_op1); + 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; + *((int *)&__m128_op1[3]) = 0xffff0000; + *((int *)&__m128_op1[2]) = 0xffff0000; + *((int *)&__m128_op1[1]) = 0x00000000; + *((int *)&__m128_op1[0]) = 0x00000000; + *((int *)&__m128_result[3]) = 0xffffffff; + *((int *)&__m128_result[2]) = 0xffffffff; + *((int *)&__m128_result[1]) = 0x00000000; + *((int *)&__m128_result[0]) = 0x00000000; + __m128_out = __lsx_vfmina_s (__m128_op0, __m128_op1); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfsqrt_d.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfsqrt_d.c new file mode 100644 index 00000000000..8a35dfe2494 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfsqrt_d.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 *)&__m128d_op0[1]) = 0xffffffffa486c90f; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000058bcc201; + *((unsigned long *)&__m128d_result[1]) = 0xffffffffa486c90f; + *((unsigned long *)&__m128d_result[0]) = 0x1f52d710bf295626; + __m128d_out = __lsx_vfsqrt_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_vfsqrt_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128d_op0[0]) = 0xffffffffff01ff01; + *((unsigned long *)&__m128d_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128d_result[0]) = 0xffffffffff01ff01; + __m128d_out = __lsx_vfsqrt_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_vfsqrt_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_vfsqrt_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000be00be; + *((unsigned long *)&__m128d_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[0]) = 0x1f1b917c9f3d5e05; + __m128d_out = __lsx_vfsqrt_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000; + __m128d_out = __lsx_vfsqrt_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_vfsqrt_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_vfsqrt_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0xffffffff00000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000001400000000; + *((unsigned long *)&__m128d_result[1]) = 0xffffffff00000000; + *((unsigned long *)&__m128d_result[0]) = 0x1f81e3779b97f4a8; + __m128d_out = __lsx_vfsqrt_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0xff800000ff800000; + *((unsigned long *)&__m128d_op0[0]) = 0xff800000ff800000; + *((unsigned long *)&__m128d_result[1]) = 0x7ff8000000000000; + *((unsigned long *)&__m128d_result[0]) = 0x7ff8000000000000; + __m128d_out = __lsx_vfsqrt_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x001effae001effae; + *((unsigned long *)&__m128d_op0[0]) = 0x001effae001effae; + *((unsigned long *)&__m128d_result[1]) = 0x2006454690d3de87; + *((unsigned long *)&__m128d_result[0]) = 0x2006454690d3de87; + __m128d_out = __lsx_vfsqrt_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0xc0b4d1a5f8babad3; + *((unsigned long *)&__m128d_op0[0]) = 0xbbc8ecc5f3ced5f3; + *((unsigned long *)&__m128d_result[1]) = 0x7ff8000000000000; + *((unsigned long *)&__m128d_result[0]) = 0x7ff8000000000000; + __m128d_out = __lsx_vfsqrt_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128d_op0[0]) = 0xff800000ff800000; + *((unsigned long *)&__m128d_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128d_result[0]) = 0x7ff8000000000000; + __m128d_out = __lsx_vfrsqrt_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0001ffff00000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0001ffff0001ffff; + *((unsigned long *)&__m128d_result[1]) = 0x5ff6a0a40ea8f47c; + *((unsigned long *)&__m128d_result[0]) = 0x5ff6a0a40e9da42a; + __m128d_out = __lsx_vfrsqrt_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x000000000000000f; + *((unsigned long *)&__m128d_result[1]) = 0x7ff0000000000000; + *((unsigned long *)&__m128d_result[0]) = 0x61608654a2d4f6da; + __m128d_out = __lsx_vfrsqrt_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0xffff0000ffff0000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[1]) = 0xffff0000ffff0000; + *((unsigned long *)&__m128d_result[0]) = 0x7ff0000000000000; + __m128d_out = __lsx_vfrsqrt_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x00fe000100cf005f; + *((unsigned long *)&__m128d_op0[0]) = 0x7fff7fff7fff7fff; + *((unsigned long *)&__m128d_result[1]) = 0x5f675e96e29a5a60; + *((unsigned long *)&__m128d_result[0]) = 0x7fff7fff7fff7fff; + __m128d_out = __lsx_vfrsqrt_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]) = 0x7ff0000000000000; + *((unsigned long *)&__m128d_result[0]) = 0x7ff0000000000000; + __m128d_out = __lsx_vfrsqrt_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128d_op0[0]) = 0x7ff8000000000000; + *((unsigned long *)&__m128d_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128d_result[0]) = 0x7ff8000000000000; + __m128d_out = __lsx_vfrecip_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]) = 0x7ff0000000000000; + *((unsigned long *)&__m128d_result[0]) = 0x7ff0000000000000; + __m128d_out = __lsx_vfrecip_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x00003f8000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x00003f8000000000; + *((unsigned long *)&__m128d_result[1]) = 0x7ff0000000000000; + *((unsigned long *)&__m128d_result[0]) = 0x7ff0000000000000; + __m128d_out = __lsx_vfrecip_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]) = 0x7ff0000000000000; + *((unsigned long *)&__m128d_result[0]) = 0x7ff0000000000000; + __m128d_out = __lsx_vfrecip_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]) = 0x7ff0000000000000; + *((unsigned long *)&__m128d_result[0]) = 0x7ff0000000000000; + __m128d_out = __lsx_vfrecip_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_vfrecip_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x00000000fffa0000; + *((unsigned long *)&__m128d_op0[0]) = 0x00000000fffa0000; + *((unsigned long *)&__m128d_result[1]) = 0x7ff0000000000000; + *((unsigned long *)&__m128d_result[0]) = 0x7ff0000000000000; + __m128d_out = __lsx_vfrecip_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0xff800000ff800000; + *((unsigned long *)&__m128d_op0[0]) = 0xe593c8c4e593c8c4; + *((unsigned long *)&__m128d_result[1]) = 0x805ffffe01001fe0; + *((unsigned long *)&__m128d_result[0]) = 0x9a49e11102834d70; + __m128d_out = __lsx_vfrecip_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x5252525252525252; + *((unsigned long *)&__m128d_op0[0]) = 0x5252dcdcdcdcdcdc; + *((unsigned long *)&__m128d_result[1]) = 0x2d8bf1f8fc7e3f20; + *((unsigned long *)&__m128d_result[0]) = 0x2d8b24b936d1b24d; + __m128d_out = __lsx_vfrecip_d (__m128d_op0); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfsqrt_s.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfsqrt_s.c new file mode 100644 index 00000000000..ffd80540bdc --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfsqrt_s.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; + + *((int *)&__m128_op0[3]) = 0xfe07e5fe; + *((int *)&__m128_op0[2]) = 0xfefdddfe; + *((int *)&__m128_op0[1]) = 0x00020100; + *((int *)&__m128_op0[0]) = 0xfedd0c00; + *((int *)&__m128_result[3]) = 0x7fc00000; + *((int *)&__m128_result[2]) = 0x7fc00000; + *((int *)&__m128_result[1]) = 0x1e801ffc; + *((int *)&__m128_result[0]) = 0x7fc00000; + __m128_out = __lsx_vfsqrt_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_vfsqrt_s (__m128_op0); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((int *)&__m128_op0[3]) = 0xff00ff00; + *((int *)&__m128_op0[2]) = 0xff00ff00; + *((int *)&__m128_op0[1]) = 0xff00ff00; + *((int *)&__m128_op0[0]) = 0xff00ff00; + *((int *)&__m128_result[3]) = 0x7fc00000; + *((int *)&__m128_result[2]) = 0x7fc00000; + *((int *)&__m128_result[1]) = 0x7fc00000; + *((int *)&__m128_result[0]) = 0x7fc00000; + __m128_out = __lsx_vfsqrt_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_vfsqrt_s (__m128_op0); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((int *)&__m128_op0[3]) = 0x8c7fc73a; + *((int *)&__m128_op0[2]) = 0x137e54af; + *((int *)&__m128_op0[1]) = 0xbc84cf6f; + *((int *)&__m128_op0[0]) = 0x76208329; + *((int *)&__m128_result[3]) = 0x7fc00000; + *((int *)&__m128_result[2]) = 0x297f29fe; + *((int *)&__m128_result[1]) = 0x7fc00000; + *((int *)&__m128_result[0]) = 0x5acab5a5; + __m128_out = __lsx_vfsqrt_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_vfsqrt_s (__m128_op0); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((int *)&__m128_op0[3]) = 0xffff9727; + *((int *)&__m128_op0[2]) = 0xffff9727; + *((int *)&__m128_op0[1]) = 0xfffffe79; + *((int *)&__m128_op0[0]) = 0xffffba5f; + *((int *)&__m128_result[3]) = 0xffff9727; + *((int *)&__m128_result[2]) = 0xffff9727; + *((int *)&__m128_result[1]) = 0xfffffe79; + *((int *)&__m128_result[0]) = 0xffffba5f; + __m128_out = __lsx_vfsqrt_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_vfsqrt_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]) = 0x7f800000; + *((int *)&__m128_result[2]) = 0x7f800000; + *((int *)&__m128_result[1]) = 0x7f800000; + *((int *)&__m128_result[0]) = 0x7f800000; + __m128_out = __lsx_vfrsqrt_s (__m128_op0); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0xfff8fff8; + *((int *)&__m128_op0[1]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0xfff80000; + *((int *)&__m128_result[3]) = 0x7f800000; + *((int *)&__m128_result[2]) = 0xfff8fff8; + *((int *)&__m128_result[1]) = 0x7f800000; + *((int *)&__m128_result[0]) = 0xfff80000; + __m128_out = __lsx_vfrsqrt_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]) = 0x7f800000; + *((int *)&__m128_result[2]) = 0x7f800000; + *((int *)&__m128_result[1]) = 0x7f800000; + *((int *)&__m128_result[0]) = 0x7f800000; + __m128_out = __lsx_vfrsqrt_s (__m128_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; + *((int *)&__m128_result[3]) = 0xffffffff; + *((int *)&__m128_result[2]) = 0xffffffff; + *((int *)&__m128_result[1]) = 0xffffffff; + *((int *)&__m128_result[0]) = 0xffffffff; + __m128_out = __lsx_vfrsqrt_s (__m128_op0); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0x1f1b917c; + *((int *)&__m128_op0[0]) = 0x9f3d5e05; + *((int *)&__m128_result[3]) = 0x7f800000; + *((int *)&__m128_result[2]) = 0x7f800000; + *((int *)&__m128_result[1]) = 0x4fa432d6; + *((int *)&__m128_result[0]) = 0x7fc00000; + __m128_out = __lsx_vfrsqrt_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]) = 0x7f800000; + *((int *)&__m128_result[2]) = 0x7f800000; + *((int *)&__m128_result[1]) = 0x7f800000; + *((int *)&__m128_result[0]) = 0x7f800000; + __m128_out = __lsx_vfrsqrt_s (__m128_op0); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((int *)&__m128_op0[3]) = 0xffffffff; + *((int *)&__m128_op0[2]) = 0xffffffff; + *((int *)&__m128_op0[1]) = 0x12835580; + *((int *)&__m128_op0[0]) = 0xb880eb98; + *((int *)&__m128_result[3]) = 0xffffffff; + *((int *)&__m128_result[2]) = 0xffffffff; + *((int *)&__m128_result[1]) = 0x55fcbad1; + *((int *)&__m128_result[0]) = 0x7fc00000; + __m128_out = __lsx_vfrsqrt_s (__m128_op0); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((int *)&__m128_op0[3]) = 0x06070607; + *((int *)&__m128_op0[2]) = 0x00000807; + *((int *)&__m128_op0[1]) = 0x0707f8f8; + *((int *)&__m128_op0[0]) = 0x03e8157e; + *((int *)&__m128_result[3]) = 0x5c303f97; + *((int *)&__m128_result[2]) = 0x61ff9049; + *((int *)&__m128_result[1]) = 0x5bafa1dd; + *((int *)&__m128_result[0]) = 0x5d3e1e1d; + __m128_out = __lsx_vfrsqrt_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]) = 0x7f800000; + *((int *)&__m128_result[2]) = 0x7f800000; + *((int *)&__m128_result[1]) = 0x7f800000; + *((int *)&__m128_result[0]) = 0x7f800000; + __m128_out = __lsx_vfrsqrt_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]) = 0x7f800000; + *((int *)&__m128_result[2]) = 0x7f800000; + *((int *)&__m128_result[1]) = 0x7f800000; + *((int *)&__m128_result[0]) = 0x7f800000; + __m128_out = __lsx_vfrsqrt_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]) = 0x7f800000; + *((int *)&__m128_result[2]) = 0x7f800000; + *((int *)&__m128_result[1]) = 0x7f800000; + *((int *)&__m128_result[0]) = 0x7f800000; + __m128_out = __lsx_vfrsqrt_s (__m128_op0); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((int *)&__m128_op0[3]) = 0xfff7fffe; + *((int *)&__m128_op0[2]) = 0xfffa01ff; + *((int *)&__m128_op0[1]) = 0xfffbfffe; + *((int *)&__m128_op0[0]) = 0xfffe01ff; + *((int *)&__m128_result[3]) = 0xfff7fffe; + *((int *)&__m128_result[2]) = 0xfffa01ff; + *((int *)&__m128_result[1]) = 0xfffbfffe; + *((int *)&__m128_result[0]) = 0xfffe01ff; + __m128_out = __lsx_vfrsqrt_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]) = 0x7f800000; + *((int *)&__m128_result[2]) = 0x7f800000; + *((int *)&__m128_result[1]) = 0x7f800000; + *((int *)&__m128_result[0]) = 0x7f800000; + __m128_out = __lsx_vfrsqrt_s (__m128_op0); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((int *)&__m128_op0[3]) = 0x45000000; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0x44000000; + *((int *)&__m128_op0[0]) = 0x00000000; + *((int *)&__m128_result[3]) = 0x3cb504f3; + *((int *)&__m128_result[2]) = 0x7f800000; + *((int *)&__m128_result[1]) = 0x3d3504f3; + *((int *)&__m128_result[0]) = 0x7f800000; + __m128_out = __lsx_vfrsqrt_s (__m128_op0); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0x00020001; + *((int *)&__m128_op0[0]) = 0x00020002; + *((int *)&__m128_result[3]) = 0x7f800000; + *((int *)&__m128_result[2]) = 0x7f800000; + *((int *)&__m128_result[1]) = 0x607fffc0; + *((int *)&__m128_result[0]) = 0x607fff80; + __m128_out = __lsx_vfrsqrt_s (__m128_op0); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((int *)&__m128_op0[3]) = 0x00000002; + *((int *)&__m128_op0[2]) = 0x00000002; + *((int *)&__m128_op0[1]) = 0x00000003; + *((int *)&__m128_op0[0]) = 0x00000003; + *((int *)&__m128_result[3]) = 0x7f800000; + *((int *)&__m128_result[2]) = 0x7f800000; + *((int *)&__m128_result[1]) = 0x7f800000; + *((int *)&__m128_result[0]) = 0x7f800000; + __m128_out = __lsx_vfrecip_s (__m128_op0); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((int *)&__m128_op0[3]) = 0xf6e91c00; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0x51cfd7c0; + *((int *)&__m128_op0[0]) = 0x00000000; + *((int *)&__m128_result[3]) = 0x880c91b8; + *((int *)&__m128_result[2]) = 0x7f800000; + *((int *)&__m128_result[1]) = 0x2d1da85b; + *((int *)&__m128_result[0]) = 0x7f800000; + __m128_out = __lsx_vfrecip_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]) = 0x7f800000; + *((int *)&__m128_result[2]) = 0x7f800000; + *((int *)&__m128_result[1]) = 0x7f800000; + *((int *)&__m128_result[0]) = 0x7f800000; + __m128_out = __lsx_vfrecip_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]) = 0x7f800000; + *((int *)&__m128_result[2]) = 0x7f800000; + *((int *)&__m128_result[1]) = 0x7f800000; + *((int *)&__m128_result[0]) = 0x7f800000; + __m128_out = __lsx_vfrecip_s (__m128_op0); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((int *)&__m128_op0[3]) = 0xfffffffa; + *((int *)&__m128_op0[2]) = 0xfffffffa; + *((int *)&__m128_op0[1]) = 0xfffffffa; + *((int *)&__m128_op0[0]) = 0xfffffffa; + *((int *)&__m128_result[3]) = 0xfffffffa; + *((int *)&__m128_result[2]) = 0xfffffffa; + *((int *)&__m128_result[1]) = 0xfffffffa; + *((int *)&__m128_result[0]) = 0xfffffffa; + __m128_out = __lsx_vfrecip_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]) = 0x7f800000; + *((int *)&__m128_result[2]) = 0x7f800000; + *((int *)&__m128_result[1]) = 0x7f800000; + *((int *)&__m128_result[0]) = 0x7f800000; + __m128_out = __lsx_vfrecip_s (__m128_op0); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((int *)&__m128_op0[3]) = 0xffff0001; + *((int *)&__m128_op0[2]) = 0xffff0001; + *((int *)&__m128_op0[1]) = 0xffff0001; + *((int *)&__m128_op0[0]) = 0xffff0001; + *((int *)&__m128_result[3]) = 0xffff0001; + *((int *)&__m128_result[2]) = 0xffff0001; + *((int *)&__m128_result[1]) = 0xffff0001; + *((int *)&__m128_result[0]) = 0xffff0001; + __m128_out = __lsx_vfrecip_s (__m128_op0); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((int *)&__m128_op0[3]) = 0x0a000000; + *((int *)&__m128_op0[2]) = 0x0a000000; + *((int *)&__m128_op0[1]) = 0x0a000000; + *((int *)&__m128_op0[0]) = 0x0a000000; + *((int *)&__m128_result[3]) = 0x75000000; + *((int *)&__m128_result[2]) = 0x75000000; + *((int *)&__m128_result[1]) = 0x75000000; + *((int *)&__m128_result[0]) = 0x75000000; + __m128_out = __lsx_vfrecip_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]) = 0x7f800000; + *((int *)&__m128_result[2]) = 0x7f800000; + *((int *)&__m128_result[1]) = 0x7f800000; + *((int *)&__m128_result[0]) = 0x7f800000; + __m128_out = __lsx_vfrecip_s (__m128_op0); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + return 0; +} From patchwork Wed Sep 13 03:36:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: chenxiaolong X-Patchwork-Id: 138598 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9ecd:0:b0:3f2:4152:657d with SMTP id t13csp834318vqx; Tue, 12 Sep 2023 20:48:15 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEsNr/OYTRrb5jfEhZDcphlR815PhD3P7NAYGTLvhpJ8pUqLZox0TEA1pbb7Zf+zcN5L9k1 X-Received: by 2002:a17:907:6089:b0:9a1:aaae:8207 with SMTP id ht9-20020a170907608900b009a1aaae8207mr7386158ejc.20.1694576894999; Tue, 12 Sep 2023 20:48:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694576894; cv=none; d=google.com; s=arc-20160816; b=iyDavFUYOqez9/0ZuVFJL5GjizjBDvWXm6vbRVv6gIolwzKx8TlFVaevPdj5kdq0nk WOwrxWCm6w7JLO3AZvyl27LFddO+BLXMQRY9ZQdEv7nGDL4gfYTDS+dWr3MF51gfwgmB MDobp96jtYmyPpT2GnLfz3sX0DB6wyEEOqNhjRG91Y+wdAvVzlbYYnUh2SakI6pl9+DY feETm2UlOy34JGxP4izYI7i96ISoKKbCPJr9yd0fSQ+53DKkwFTHBsOW/ueD7fMcAltO Qri9GNv2ntyTp00K/Q4IF0k9gd26PGxJD9Q/scSk4JyFhBRdWqpMY92QwhxQcxP672ls CHcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dmarc-filter :delivered-to; bh=jP1XYNapInlW8nFFcsOHJKn+hzIzt+lCZOibBOL1MzM=; fh=3pFUYcpS/27XRzOf17GfR86AuNQu+P1CET04YURgCLs=; b=0ydK4KYzkfc5iHoiroeja2671OkhAkxfuzuVVG1bF/pmWvAf8KEE8c2rwunHE0Izgo osTRMkv5tqBleDFOLJIYAV0P4shfiSddFORi9oxItSb5iZyg4VPjqdlVzGCait+qhCbt AIHEI/j+rXSQq2NEZpwNBNb6wQKi2z7AWCV3NWuzWJsRpmBOea/ANPv7Z6Tr194dK4vo ByK7bRSkPlDYJRbsKmwdCuePnO/VV+/IhrO9UKBVodr5J7LQQY3dDlx/kM0lzMa6No9u 6fMvOvS4lz339rSJJr7HhuJpkXAlkhiK60HVkv+9r2y1CFGss+2maJeSiir5KE8eAeYg e2HA== 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 p2-20020a170906838200b009925f1a32f8si9661093ejx.400.2023.09.12.20.48.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Sep 2023 20:48:14 -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 7EEB43986425 for ; Wed, 13 Sep 2023 03:38:09 +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 DF43C386C5AC for ; Wed, 13 Sep 2023 03:36:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org DF43C386C5AC 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 1qgGgI-0003rM-6B for gcc-patches@gcc.gnu.org; Tue, 12 Sep 2023 23:36:53 -0400 Received: from loongson.cn (unknown [10.10.130.252]) by gateway (Coremail) with SMTP id _____8Cx77tJLgFlEzEmAA--.15061S3; Wed, 13 Sep 2023 11:36:41 +0800 (CST) Received: from slurm-master.loongson.cn (unknown [10.10.130.252]) by localhost.localdomain (Coremail) with SMTP id AQAAf8Axm+RHLgFlERACAA--.5948S4; Wed, 13 Sep 2023 11:36:39 +0800 (CST) From: Xiaolong Chen To: gcc-patches@gcc.gnu.org Cc: xry111@xry111.site, i@xen0n.name, xuchenghua@loongson.cn, chenglulu@loongson.cn, Xiaolong Chen Subject: [PATCH v4 19/23] LoongArch: Add tests for SX vector vfrstp/vfrstpi/vseq/vseqi/vsle /vslei/vslt/vslti instructions. Date: Wed, 13 Sep 2023 11:36:37 +0800 Message-Id: <20230913033638.6181-1-chenxiaolong@loongson.cn> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-CM-TRANSID: AQAAf8Axm+RHLgFlERACAA--.5948S4 X-CM-SenderInfo: hfkh05xldrz0tqj6z05rqj20fqof0/1tbiAQANBWUBHCIBFQAAsH X-Coremail-Antispam: 1Uk129KBj93XoWrKrykAF17Jw17XFW5uF1xp5X_Gw1UZrWrpr 12vr13KrWxua4jyryUtFyYqFWkAr92ya97JF47t3srKw1DGFsxXF13Ca4UAr1DtF9rWF13 tr98GF4jqr47JwcCm3ZEXasCq-sJn29KB7ZKAUJUUUUU529EdanIXcx71UUUUU7KY7ZEXa sCq-sGcSsGvfJ3Ic02F40EFcxC0VAKzVAqx4xG6I80ebIjqfuFe4nvWSU5nxnvy29KBjDU 0xBIdaVrnRJUUUkqb4IE77IF4wAFF20E14v26r1j6r4UM7CY07I20VC2zVCF04k26cxKx2 IYs7xG6rWj6s0DM7CIcVAFz4kK6r106r15M28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48v e4kI8wA2z4x0Y4vE2Ix0cI8IcVAFwI0_Ar0_tr1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI 0_Cr0_Gr1UM28EF7xvwVC2z280aVAFwI0_Gr1j6F4UJwA2z4x0Y4vEx4A2jsIEc7CjxVAF wI0_Gr1j6F4UJwAS0I0E0xvYzxvE52x082IY62kv0487Mc804VCY07AIYIkI8VC2zVCFFI 0UMc02F40EFcxC0VAKzVAqx4xG6I80ewAv7VC0I7IYx2IY67AKxVWrXVW3AwAv7VC2z280 aVAFwI0_Cr0_Gr1UMcvjeVCFs4IE7xkEbVWUJVW8JwACjcxG0xvY0x0EwIxGrwCF04k20x vY0x0EwIxGrwCFx2IqxVCFs4IE7xkEbVWUJVW8JwC20s026c02F40E14v26r1j6r18MI8I 3I0E7480Y4vE14v26r106r1rMI8E67AF67kF1VAFwI0_JF0_Jw1lIxkGc2Ij64vIr41lIx AIcVC0I7IYx2IY67AKxVW7JVWDJwCI42IY6xIIjxv20xvEc7CjxVAFwI0_Cr0_Gr1UMIIF 0xvE42xK8VAvwI8IcIk0rVWUJVWUCwCI42IY6I8E87Iv67AKxVWxJVW8Jr1lIxAIcVC2z2 80aVCY1x0267AKxVW8JVW8JrUvcSsGvfC2KfnxnUUI43ZEXa7IU8R6wtUUUUU== 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.8 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: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1776892662181921099 X-GMAIL-MSGID: 1776892662181921099 gcc/testsuite/ChangeLog: * gcc.target/loongarch/vector/lsx/lsx-vfrstp.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vfrstpi.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vseq.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vseqi.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vsle-1.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vsle-2.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vslei-1.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vslei-2.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vslt-1.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vslt-2.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vslti-1.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vslti-2.c: New test. --- .../loongarch/vector/lsx/lsx-vfrstp.c | 218 ++++++++ .../loongarch/vector/lsx/lsx-vfrstpi.c | 209 ++++++++ .../loongarch/vector/lsx/lsx-vseq.c | 470 ++++++++++++++++++ .../loongarch/vector/lsx/lsx-vseqi.c | 328 ++++++++++++ .../loongarch/vector/lsx/lsx-vsle-1.c | 290 +++++++++++ .../loongarch/vector/lsx/lsx-vsle-2.c | 444 +++++++++++++++++ .../loongarch/vector/lsx/lsx-vslei-1.c | 258 ++++++++++ .../loongarch/vector/lsx/lsx-vslei-2.c | 293 +++++++++++ .../loongarch/vector/lsx/lsx-vslt-1.c | 434 ++++++++++++++++ .../loongarch/vector/lsx/lsx-vslt-2.c | 236 +++++++++ .../loongarch/vector/lsx/lsx-vslti-1.c | 328 ++++++++++++ .../loongarch/vector/lsx/lsx-vslti-2.c | 293 +++++++++++ 12 files changed, 3801 insertions(+) create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfrstp.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfrstpi.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vseq.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vseqi.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsle-1.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsle-2.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vslei-1.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vslei-2.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vslt-1.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vslt-2.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vslti-1.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vslti-2.c diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfrstp.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfrstp.c new file mode 100644 index 00000000000..ac0ade8b135 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfrstp.c @@ -0,0 +1,218 @@ +/* { 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]) = 0xfe07e5fefefdddfe; + *((unsigned long *)&__m128i_op0[0]) = 0x00020100fedd0c00; + *((unsigned long *)&__m128i_op1[1]) = 0x0005000501800005; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xfe07e5fefefdddfe; + *((unsigned long *)&__m128i_result[0]) = 0x00020100fedd0008; + __m128i_out = __lsx_vfrstp_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]) = 0x0404038383838404; + *((unsigned long *)&__m128i_op1[0]) = 0x0404038383838404; + *((unsigned long *)&__m128i_op2[1]) = 0x03ff03ff03ff03ff; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000001; + __m128i_out = __lsx_vfrstp_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]) = 0x0000000000200010; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000010; + __m128i_out = __lsx_vfrstp_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]) = 0x0000000000000010; + __m128i_out = __lsx_vfrstp_b (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0e7ffffc01fffffc; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000003f803f4; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0e7ffffc01fffffc; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000003f803f4; + *((unsigned long *)&__m128i_result[1]) = 0x0e7ffffc01fffffc; + *((unsigned long *)&__m128i_result[0]) = 0x0000001003f803f4; + __m128i_out = __lsx_vfrstp_b (__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]) = 0x0000000000000000; + *((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]) = 0x0000000000000010; + __m128i_out = __lsx_vfrstp_b (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000200000002; + *((unsigned long *)&__m128i_op0[0]) = 0x000000020000007d; + *((unsigned long *)&__m128i_op1[1]) = 0x0000746400016388; + *((unsigned long *)&__m128i_op1[0]) = 0x0000586100015567; + *((unsigned long *)&__m128i_op2[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op2[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0800000200000002; + *((unsigned long *)&__m128i_result[0]) = 0x000000020000007d; + __m128i_out = __lsx_vfrstp_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]) = 0xfffffffffffffffe; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000010; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000010; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffff0008; + __m128i_out = __lsx_vfrstp_h (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x7ff0000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x61608654a2d4f6da; + *((unsigned long *)&__m128i_result[1]) = 0x00000000ff08ffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfrstp_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]) = 0x36fbdfdcffdcffdc; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000008140c80; + *((unsigned long *)&__m128i_op2[1]) = 0x1f1f1f1f1f1f1f00; + *((unsigned long *)&__m128i_op2[0]) = 0x1f1f1f27332b9f00; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x36fbdfdcffdc0008; + __m128i_out = __lsx_vfrstp_h (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000000000000aaaa; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x00000000545cab1d; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000081a83bea; + *((unsigned long *)&__m128i_op2[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op2[0]) = 0x00d3007c014e00bd; + *((unsigned long *)&__m128i_result[1]) = 0x000000000000aaaa; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfrstp_b (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x37c0001000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x37c0001000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000003a0000003a; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x37c0001000000000; + *((unsigned long *)&__m128i_result[0]) = 0x37c0001000000008; + __m128i_out = __lsx_vfrstp_h (__m128i_op0, __m128i_op1, __m128i_op2); + 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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x8080808080808080; + *((unsigned long *)&__m128i_result[0]) = 0x8080808080800008; + __m128i_out = __lsx_vfrstp_h (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x1f1f1f1f1f1f1f1f; + *((unsigned long *)&__m128i_op0[0]) = 0x1f1f1f1f1f1f1f1f; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x1f1f1f1f1f1f1f1f; + *((unsigned long *)&__m128i_op2[0]) = 0x1f1f1f1f1f1f1f1f; + *((unsigned long *)&__m128i_result[1]) = 0x00081f1f1f1f1f1f; + *((unsigned long *)&__m128i_result[0]) = 0x1f1f1f1f1f1f1f1f; + __m128i_out = __lsx_vfrstp_h (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000400080003fff; + *((unsigned long *)&__m128i_op0[0]) = 0x0000bc2000007e10; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000400080003fff; + *((unsigned long *)&__m128i_result[0]) = 0x0000bc2000007e04; + __m128i_out = __lsx_vfrstp_b (__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]) = 0xffffffff14eb54ab; + *((unsigned long *)&__m128i_op1[0]) = 0x14ea6a002a406a00; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x00007fff7fff8000; + *((unsigned long *)&__m128i_result[1]) = 0x000000000a752a55; + *((unsigned long *)&__m128i_result[0]) = 0x0a753500950fa306; + __m128i_out = __lsx_vfrstp_b (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x02b010f881a281a2; + *((unsigned long *)&__m128i_op0[0]) = 0x27b169bbb8145f50; + *((unsigned long *)&__m128i_op1[1]) = 0x02b010f881a281a2; + *((unsigned long *)&__m128i_op1[0]) = 0x27b169bbb8145f50; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x02b010f881a281a2; + *((unsigned long *)&__m128i_result[0]) = 0x27b169bbb8140001; + __m128i_out = __lsx_vfrstp_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]) = 0xffff000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0010001000100010; + *((unsigned long *)&__m128i_op1[0]) = 0x0010001000100010; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000155; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xffff100000000000; + __m128i_out = __lsx_vfrstp_b (__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-vfrstpi.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfrstpi.c new file mode 100644 index 00000000000..a2b110f214a --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfrstpi.c @@ -0,0 +1,209 @@ +/* { 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]) = 0x0027002a00030018; + *((unsigned long *)&__m128i_op0[0]) = 0x7f4300177f7a7f59; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0027002a00080018; + *((unsigned long *)&__m128i_result[0]) = 0x7f4300177f7a7f59; + __m128i_out = __lsx_vfrstpi_h (__m128i_op0, __m128i_op1, 0x5); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000100000001; + *((unsigned long *)&__m128i_op0[0]) = 0x0000007f00000004; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000401000001; + *((unsigned long *)&__m128i_op1[0]) = 0x0001000100000004; + *((unsigned long *)&__m128i_result[1]) = 0x0000000110000001; + *((unsigned long *)&__m128i_result[0]) = 0x0000007f00000004; + __m128i_out = __lsx_vfrstpi_b (__m128i_op0, __m128i_op1, 0xb); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000800000000; + __m128i_out = __lsx_vfrstpi_h (__m128i_op0, __m128i_op1, 0x2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x75b043c4d17db125; + *((unsigned long *)&__m128i_op0[0]) = 0xeef8227b4f8017b1; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x027c027c000027c0; + *((unsigned long *)&__m128i_result[1]) = 0x75b043c4007db125; + *((unsigned long *)&__m128i_result[0]) = 0xeef8227b4f8017b1; + __m128i_out = __lsx_vfrstpi_b (__m128i_op0, __m128i_op1, 0xb); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000ff000000ff00; + *((unsigned long *)&__m128i_op1[1]) = 0x03c0000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x03c0038000000380; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000ff000000ff00; + __m128i_out = __lsx_vfrstpi_b (__m128i_op0, __m128i_op1, 0x0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000010a000b; + *((unsigned long *)&__m128i_op1[1]) = 0x00ffff0000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x00ffff000000ff00; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00000000010a000b; + __m128i_out = __lsx_vfrstpi_h (__m128i_op0, __m128i_op1, 0x5); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000009; + *((unsigned long *)&__m128i_op0[0]) = 0x5b35342c979955da; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000009; + *((unsigned long *)&__m128i_result[0]) = 0x5b35342c970455da; + __m128i_out = __lsx_vfrstpi_b (__m128i_op0, __m128i_op1, 0x2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0010000000000000; + __m128i_out = __lsx_vfrstpi_b (__m128i_op0, __m128i_op1, 0x6); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0101010101010101; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0008000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0101010101010101; + __m128i_out = __lsx_vfrstpi_h (__m128i_op0, __m128i_op1, 0x7); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00d3012b015700bb; + *((unsigned long *)&__m128i_op0[0]) = 0x0001002affca0070; + *((unsigned long *)&__m128i_op1[1]) = 0x00000001ca02f854; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000100013fa0; + *((unsigned long *)&__m128i_result[1]) = 0x00d3012b015700bb; + *((unsigned long *)&__m128i_result[0]) = 0x00010000ffca0070; + __m128i_out = __lsx_vfrstpi_b (__m128i_op0, __m128i_op1, 0x4); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000fffe0001; + *((unsigned long *)&__m128i_op1[1]) = 0x00000000000000bf; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000000002bb; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00080000fffe0001; + __m128i_out = __lsx_vfrstpi_h (__m128i_op0, __m128i_op1, 0x3); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000545cffffab1d; + *((unsigned long *)&__m128i_op0[0]) = 0xffff81a800003bea; + *((unsigned long *)&__m128i_op1[1]) = 0x13f9c5b60028a415; + *((unsigned long *)&__m128i_op1[0]) = 0x545cab1d81a83bea; + *((unsigned long *)&__m128i_result[1]) = 0x0000545cffff0001; + *((unsigned long *)&__m128i_result[0]) = 0xffff81a800003bea; + __m128i_out = __lsx_vfrstpi_h (__m128i_op0, __m128i_op1, 0x4); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0008000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfrstpi_h (__m128i_op0, __m128i_op1, 0x7); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000800000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfrstpi_h (__m128i_op0, __m128i_op1, 0x6); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000000000000001b; + *((unsigned long *)&__m128i_op0[0]) = 0x000000000000001b; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x000000000000001b; + *((unsigned long *)&__m128i_result[0]) = 0x000000000000001b; + __m128i_out = __lsx_vfrstpi_b (__m128i_op0, __m128i_op1, 0x3); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0008000000000000; + __m128i_out = __lsx_vfrstpi_h (__m128i_op0, __m128i_op1, 0x3); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x379674c000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffff7ffffffffe; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000fffffffe; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x379674c000000000; + __m128i_out = __lsx_vfrstpi_b (__m128i_op0, __m128i_op1, 0x8); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000800000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfrstpi_h (__m128i_op0, __m128i_op1, 0x6); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x001a001a001a000b; + *((unsigned long *)&__m128i_op0[0]) = 0x001a001a001a000b; + *((unsigned long *)&__m128i_op1[1]) = 0x001a001a001a000b; + *((unsigned long *)&__m128i_op1[0]) = 0x001a001a001a000b; + *((unsigned long *)&__m128i_result[1]) = 0x001a001a001a0008; + *((unsigned long *)&__m128i_result[0]) = 0x001a001a001a000b; + __m128i_out = __lsx_vfrstpi_h (__m128i_op0, __m128i_op1, 0x4); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x02f3030303030303; + *((unsigned long *)&__m128i_op1[1]) = 0x004d004d004d004d; + *((unsigned long *)&__m128i_op1[0]) = 0x004d004d004d004d; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x02f3030303100303; + __m128i_out = __lsx_vfrstpi_b (__m128i_op0, __m128i_op1, 0x2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000000400000004c; + *((unsigned long *)&__m128i_op0[0]) = 0x00007770ffff941d; + *((unsigned long *)&__m128i_op1[1]) = 0x000000400000004c; + *((unsigned long *)&__m128i_op1[0]) = 0x00007770ffff941d; + *((unsigned long *)&__m128i_result[1]) = 0x000000400000004c; + *((unsigned long *)&__m128i_result[0]) = 0x00007770ffff941d; + __m128i_out = __lsx_vfrstpi_h (__m128i_op0, __m128i_op1, 0x5); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vseq.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vseq.c new file mode 100644 index 00000000000..4362941ab14 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vseq.c @@ -0,0 +1,470 @@ +/* { 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]) = 0x0000000000000000; + *((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_vseq_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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vseq_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00ed0008005e00a2; + *((unsigned long *)&__m128i_op0[0]) = 0x007a007600150077; + *((unsigned long *)&__m128i_op1[1]) = 0x00ed0008005e00a2; + *((unsigned long *)&__m128i_op1[0]) = 0x007a007600150077; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vseq_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]) = 0x8000800080008000; + *((unsigned long *)&__m128i_op1[0]) = 0x8000800080008000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vseq_h (__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]) = 0xfff489b693120950; + *((unsigned long *)&__m128i_op1[0]) = 0xfffc45a851c40c18; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vseq_b (__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]) = 0xfda9b23a624082fd; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000ffff0000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vseq_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffff7f800000; + *((unsigned long *)&__m128i_op0[0]) = 0x2d1da85b7f800000; + *((unsigned long *)&__m128i_op1[1]) = 0x7505853d654185f5; + *((unsigned long *)&__m128i_op1[0]) = 0x01010000fefe0101; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vseq_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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vseq_w (__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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vseq_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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vseq_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x1fc000001fc00000; + *((unsigned long *)&__m128i_op0[0]) = 0x1fc000001fc00000; + *((unsigned long *)&__m128i_op1[1]) = 0x0001000000010001; + *((unsigned long *)&__m128i_op1[0]) = 0x0001000000010001; + *((unsigned long *)&__m128i_result[1]) = 0x0000ffff00000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000ffff00000000; + __m128i_out = __lsx_vseq_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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vseq_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_op0[0]) = 0x0000067400002685; + *((unsigned long *)&__m128i_op1[1]) = 0x0000006f00001f0a; + *((unsigned long *)&__m128i_op1[0]) = 0x0000958affff995d; + *((unsigned long *)&__m128i_result[1]) = 0xffff0000ffff0000; + *((unsigned long *)&__m128i_result[0]) = 0xffff000000000000; + __m128i_out = __lsx_vseq_h (__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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vseq_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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vseq_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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vseq_w (__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_vseq_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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vseq_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_vseq_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]) = 0x7fff7fff7fff0000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vseq_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x9795698585057dec; + *((unsigned long *)&__m128i_op0[0]) = 0x87f82867431a1d08; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_op1[0]) = 0x1149a96eb1a08000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vseq_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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vseq_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x21201f1e19181716; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0xfffffacdb6dbecac; + *((unsigned long *)&__m128i_op1[0]) = 0x1f5533a694f902c0; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vseq_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffe1ffffffe1; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffe1ffffffe1; + *((unsigned long *)&__m128i_op1[1]) = 0x8080808080808080; + *((unsigned long *)&__m128i_op1[0]) = 0x8080808080808080; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vseq_b (__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]) = 0x0000000002050320; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000002050320; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vseq_b (__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]) = 0x0202020202020202; + *((unsigned long *)&__m128i_op1[0]) = 0x363d753d50155c0a; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vseq_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_vseq_d (__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]) = 0x0000ffff0000ffff; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vseq_d (__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]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffff0000; + __m128i_out = __lsx_vseq_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000f0000000f; + *((unsigned long *)&__m128i_op0[0]) = 0x0f0f0f0f00000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x000000fffe01fd02; + *((unsigned long *)&__m128i_result[1]) = 0xffffff00ffffff00; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vseq_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffff0000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000005; + *((unsigned long *)&__m128i_result[1]) = 0x000000ffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffff00; + __m128i_out = __lsx_vseq_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]) = 0x8000800080008000; + *((unsigned long *)&__m128i_op1[0]) = 0x8000800080008000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vseq_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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vseq_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000000adadadad; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000adadadad; + *((unsigned long *)&__m128i_op1[1]) = 0x00000000adadadad; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000adadadad; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vseq_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0x5b5b5b5aadadadad; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000052525253; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vseq_b (__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]) = 0xffff00ffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffff00ffffffffff; + __m128i_out = __lsx_vseq_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfcfcfcdcfcfcfcdc; + *((unsigned long *)&__m128i_op0[0]) = 0xfcfcfcdcfcfcfcdc; + *((unsigned long *)&__m128i_op1[1]) = 0x33f5c2d7d9f5d800; + *((unsigned long *)&__m128i_op1[0]) = 0xe4c23ffb002a3a22; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vseq_d (__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]) = 0x0000000004870ba0; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vseq_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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vseq_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]) = 0x00000000084d12ce; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000044470000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_result[0]) = 0xffffffff0000ffff; + __m128i_out = __lsx_vseq_b (__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]) = 0x0000000000404040; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000020; + *((unsigned long *)&__m128i_result[1]) = 0xffffff0000000000; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffff0000; + __m128i_out = __lsx_vseq_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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vseq_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]) = 0x0000005c000000b2; + *((unsigned long *)&__m128i_op1[0]) = 0x0000007600000000; + *((unsigned long *)&__m128i_result[1]) = 0xffff0000ffff0000; + *((unsigned long *)&__m128i_result[0]) = 0xffff0000ffffffff; + __m128i_out = __lsx_vseq_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]) = 0x6363636363636363; + *((unsigned long *)&__m128i_op1[0]) = 0x6363636363636363; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vseq_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000c0dec4d1; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000000000ff; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffff00000000; + __m128i_out = __lsx_vseq_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfffffffffffbfffc; + *((unsigned long *)&__m128i_op0[0]) = 0x0000001000000048; + *((unsigned long *)&__m128i_op1[1]) = 0xfffffffffffeffff; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000016; + *((unsigned long *)&__m128i_result[1]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_result[0]) = 0xffff0000ffff0000; + __m128i_out = __lsx_vseq_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]) = 0x0000f50000000900; + *((unsigned long *)&__m128i_op1[0]) = 0x0000090900000998; + *((unsigned long *)&__m128i_result[1]) = 0xffff00ffffff00ff; + *((unsigned long *)&__m128i_result[0]) = 0xffff0000ffff0000; + __m128i_out = __lsx_vseq_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x7f7f7f007f7f7f00; + *((unsigned long *)&__m128i_op1[1]) = 0xf2c97aaa7d8fa270; + *((unsigned long *)&__m128i_op1[0]) = 0x0b73e427f7cfcb88; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vseq_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]) = 0xff01fe03ff01fe03; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vseq_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]) = 0xffff000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0xffff000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffff000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xffff000000000000; + __m128i_out = __lsx_vseq_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-vseqi.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vseqi.c new file mode 100644 index 00000000000..c16a291de50 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vseqi.c @@ -0,0 +1,328 @@ +/* { 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]) = 0xff800000c3080002; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vseqi_d (__m128i_op0, 7); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xfedb27095b6bff95; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vseqi_h (__m128i_op0, 9); + 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_vseqi_b (__m128i_op0, 13); + 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_vseqi_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_vseqi_d (__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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vseqi_h (__m128i_op0, -7); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0404038383838404; + *((unsigned long *)&__m128i_op0[0]) = 0x0404038383838404; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vseqi_d (__m128i_op0, 15); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000040000000400; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vseqi_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_vseqi_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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vseqi_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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vseqi_w (__m128i_op0, -14); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0010000000100000; + *((unsigned long *)&__m128i_op0[0]) = 0x0010000000100000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vseqi_b (__m128i_op0, -2); + 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]) = 0x0000000000000000; + __m128i_out = __lsx_vseqi_w (__m128i_op0, -14); + 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_vseqi_b (__m128i_op0, 11); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000001000f00fe00; + *((unsigned long *)&__m128i_op0[0]) = 0x0000017fff00fe7f; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vseqi_w (__m128i_op0, 9); + 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_vseqi_d (__m128i_op0, -12); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffff0000ffff0000; + *((unsigned long *)&__m128i_op0[0]) = 0xffff000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vseqi_b (__m128i_op0, 12); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000000000000006f; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000001f0a; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vseqi_b (__m128i_op0, 13); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x007ffd0001400840; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vseqi_h (__m128i_op0, -9); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xff01ff010000ff7d; + *((unsigned long *)&__m128i_op0[0]) = 0x000000000000fffc; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vseqi_b (__m128i_op0, 2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vseqi_d (__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_vseqi_d (__m128i_op0, 5); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffa6ff91fdd8ef77; + *((unsigned long *)&__m128i_op0[0]) = 0x061202bffb141c38; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vseqi_b (__m128i_op0, 13); + 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_vseqi_w (__m128i_op0, -15); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vseqi_d (__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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vseqi_w (__m128i_op0, -15); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vseqi_h (__m128i_op0, -14); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x000fef01000f27ca; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vseqi_w (__m128i_op0, -4); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x2a29282726252423; + *((unsigned long *)&__m128i_op0[0]) = 0x2221201f1e1d1c1b; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vseqi_b (__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_vseqi_w (__m128i_op0, -7); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x00ff80ff00ff80ff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vseqi_b (__m128i_op0, -9); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vseqi_b (__m128i_op0, 0); + 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_vseqi_h (__m128i_op0, -13); + 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_vseqi_h (__m128i_op0, -8); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x9c7c266e71768fa4; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vseqi_h (__m128i_op0, -4); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0313100003131000; + *((unsigned long *)&__m128i_op0[0]) = 0x0313100003131000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vseqi_w (__m128i_op0, -14); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000001a0000000b; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000001; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vseqi_b (__m128i_op0, 15); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000000002a001a; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000001a000b; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vseqi_h (__m128i_op0, -11); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x05f5e2320605e1e2; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vseqi_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_vseqi_d (__m128i_op0, 15); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0d060d060d060d06; + *((unsigned long *)&__m128i_op0[0]) = 0x0d060d060d060d06; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vseqi_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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vseqi_h (__m128i_op0, -14); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffff2356fe165486; + *((unsigned long *)&__m128i_op0[0]) = 0x5efeb3165bd7653d; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vseqi_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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vseqi_h (__m128i_op0, 0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsle-1.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsle-1.c new file mode 100644 index 00000000000..a26eb0a3d1b --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsle-1.c @@ -0,0 +1,290 @@ +/* { 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]) = 0x004200a000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x004200a000200000; + *((unsigned long *)&__m128i_result[1]) = 0xffffff00ffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffff00ffffffff; + __m128i_out = __lsx_vsle_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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vsle_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000000aaaaaaaa; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000aaab555b; + *((unsigned long *)&__m128i_op1[1]) = 0x00000000aaaaaaaa; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000aaab555b; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vsle_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]) = 0x00000000000ed0e0; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000004080; + *((unsigned long *)&__m128i_result[1]) = 0xffffff00ffff00ff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffff00; + __m128i_out = __lsx_vsle_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x004cff8fffde0051; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000001; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000ffffffff0000; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffff00; + __m128i_out = __lsx_vsle_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]) = 0x0000040400000404; + *((unsigned long *)&__m128i_op1[0]) = 0x0000040400000404; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vsle_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00ff00ff00ff00ff; + *((unsigned long *)&__m128i_op0[0]) = 0x00ff00ff00ff00ff; + *((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_vsle_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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vsle_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_vsle_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000000000003e2; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffff00ff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vsle_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_vsle_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffff0000ffff; + *((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_vsle_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]) = 0x0000000501000002; + *((unsigned long *)&__m128i_op1[0]) = 0x0001000100000008; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vsle_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x8000800080008000; + *((unsigned long *)&__m128i_op0[0]) = 0x8000800080008000; + *((unsigned long *)&__m128i_op1[1]) = 0x8000800080008000; + *((unsigned long *)&__m128i_op1[0]) = 0x8000800080008000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vsle_h (__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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffff0000; + __m128i_out = __lsx_vsle_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_vsle_h (__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]) = 0x0400040004000400; + *((unsigned long *)&__m128i_op1[0]) = 0x0400040004000400; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xffff00000000ffff; + __m128i_out = __lsx_vsle_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]) = 0x6b6c4beb636443e3; + *((unsigned long *)&__m128i_op1[0]) = 0x0507070805070708; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vsle_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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vsle_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]) = 0xffefffefffefffef; + *((unsigned long *)&__m128i_op1[0]) = 0xffefffefffefffef; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsle_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]) = 0x000085af0000b000; + *((unsigned long *)&__m128i_op1[0]) = 0x00017ea200002000; + *((unsigned long *)&__m128i_result[1]) = 0xffff0000ffff0000; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vsle_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]) = 0xffffffffff01ff01; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffff00000000; + __m128i_out = __lsx_vsle_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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vsle_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffc0800000; + *((unsigned long *)&__m128i_op1[1]) = 0x000000000000001b; + *((unsigned long *)&__m128i_op1[0]) = 0x000000000000001b; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vsle_w (__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]) = 0x3ff0000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x3ff0000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vsle_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfe3bfb01fe3bfe01; + *((unsigned long *)&__m128i_op0[0]) = 0xfe03fe3ffe01fa21; + *((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_vsle_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0100000001000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0100000001000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0040004000400040; + *((unsigned long *)&__m128i_op1[0]) = 0x0040004000400040; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsle_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]) = 0x0000001f0000001f; + *((unsigned long *)&__m128i_op1[0]) = 0x0000001f0000001f; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vsle_d (__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]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vsle_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]) = 0x000000000005003a; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vsle_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-vsle-2.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsle-2.c new file mode 100644 index 00000000000..15c6cedc2cf --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsle-2.c @@ -0,0 +1,444 @@ +/* { 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]) = 0x0005000400000004; + *((unsigned long *)&__m128i_op0[0]) = 0x0400001001150404; + *((unsigned long *)&__m128i_op1[1]) = 0x0005000400000004; + *((unsigned long *)&__m128i_op1[0]) = 0x0400001001150404; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vsle_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]) = 0x7fc000007fc00000; + *((unsigned long *)&__m128i_op1[0]) = 0x7fc000007fc00000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vsle_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]) = 0x000000490000004d; + *((unsigned long *)&__m128i_op1[0]) = 0x00000001ffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x00ffffff00ff00ff; + *((unsigned long *)&__m128i_result[0]) = 0x00ff00ffffffffff; + __m128i_out = __lsx_vsle_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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vsle_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000020000000200; + *((unsigned long *)&__m128i_op0[0]) = 0x0000020000000200; + *((unsigned long *)&__m128i_op1[1]) = 0x0000020000000200; + *((unsigned long *)&__m128i_op1[0]) = 0x0000020000000200; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vsle_bu (__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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vsle_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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vsle_bu (__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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0280000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000ffff0000ffff; + *((unsigned long *)&__m128i_result[0]) = 0x00ffffff00000000; + __m128i_out = __lsx_vsle_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]) = 0x0000000036280000; + *((unsigned long *)&__m128i_op1[0]) = 0x42a0000042a02000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vsle_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffff80ff0000ffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffff80000000ffff; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000ffff0000; + *((unsigned long *)&__m128i_result[1]) = 0x00000000ffff0000; + *((unsigned long *)&__m128i_result[0]) = 0x00000000ffff0000; + __m128i_out = __lsx_vsle_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xff0600d50e9ef518; + *((unsigned long *)&__m128i_op0[0]) = 0xffefffa8007c000f; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsle_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]) = 0x000000001faea9ec; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsle_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x000000007fffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vsle_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]) = 0x0000000100007f01; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsle_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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vsle_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfbfbfb17fbfb38ea; + *((unsigned long *)&__m128i_op0[0]) = 0xfbfb47fbfbfb0404; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x000000000005fffa; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x000000000000ffff; + __m128i_out = __lsx_vsle_hu (__m128i_op0, __m128i_op1); + 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_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xffff0000ffff0000; + __m128i_out = __lsx_vsle_hu (__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]) = 0xffff0000ffff0000; + *((unsigned long *)&__m128i_result[0]) = 0xffff000000000000; + __m128i_out = __lsx_vsle_hu (__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]) = 0x0000000000040002; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000004; + *((unsigned long *)&__m128i_result[1]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffff0000; + __m128i_out = __lsx_vsle_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000000bffffffe; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xfffffffffffffffa; + *((unsigned long *)&__m128i_op1[0]) = 0xfffffffffffffffa; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffff0000; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vsle_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]) = 0x0001000100010001; + *((unsigned long *)&__m128i_op1[0]) = 0x0001000100010001; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vsle_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000007f7f7f; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_op1[0]) = 0xffff000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffff00000000; + __m128i_out = __lsx_vsle_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]) = 0x00000000011ff040; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vsle_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]) = 0x0010001000100010; + *((unsigned long *)&__m128i_op1[0]) = 0x001000100010c410; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vsle_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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vsle_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]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vsle_wu (__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]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vsle_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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vsle_wu (__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]) = 0xffffffffcafff8ff; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000000000a0; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vsle_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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vsle_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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vsle_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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vsle_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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vsle_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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vsle_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x004d004d004d004d; + *((unsigned long *)&__m128i_op0[0]) = 0x004d004d004d004d; + *((unsigned long *)&__m128i_op1[1]) = 0xc0b4d1a5f8babad3; + *((unsigned long *)&__m128i_op1[0]) = 0xbbc8ecc5f3ced5f3; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vsle_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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vsle_du (__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]) = 0x00000000007f0000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vsle_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]) = 0x7fff7fff7fff7fff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vsle_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000000000ed0e0; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000004080; + *((unsigned long *)&__m128i_op1[1]) = 0x00000000000ed0e0; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000004080; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vsle_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + unsigned_int_out = __lsx_vpickve2gr_bu (__m128i_op0, 0x8); + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((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]) = 0xffffffffffffffff; + __m128i_out = __lsx_vsle_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0003030000000000; + *((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_vsle_du (__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]) = 0x9c9c9c9c9c9c9c9c; + *((unsigned long *)&__m128i_op1[0]) = 0x9c9c9c9c9c9c9c9c; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vsle_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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vsle_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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vsle_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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vsle_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xff00ff00fffbfffc; + *((unsigned long *)&__m128i_op0[0]) = 0xff01ff1100000048; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_op1[0]) = 0xffff0000ffff0000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vsle_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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsle_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-vslei-1.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vslei-1.c new file mode 100644 index 00000000000..0e72a33ddcc --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vslei-1.c @@ -0,0 +1,258 @@ +/* { 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_vslei_b (__m128i_op0, -12); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x11000f2010000e20; + *((unsigned long *)&__m128i_op0[0]) = 0x0f000d200e000c20; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vslei_b (__m128i_op0, -6); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffff0000ffff0000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vslei_b (__m128i_op0, 11); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000200008; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000200000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffff00ffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffff00ffff; + __m128i_out = __lsx_vslei_b (__m128i_op0, 11); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x3a8000003a800000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x00ffffff00ffffff; + __m128i_out = __lsx_vslei_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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vslei_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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vslei_h (__m128i_op0, 6); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vslei_h (__m128i_op0, 10); + 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_vslei_h (__m128i_op0, -14); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000101; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vslei_h (__m128i_op0, -16); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000ffff00008080; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000000000ff; + *((unsigned long *)&__m128i_result[1]) = 0x000000000000ffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vslei_h (__m128i_op0, -4); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x31dc2cc1bc268c93; + *((unsigned long *)&__m128i_op0[0]) = 0x9c4d53d855f89514; + *((unsigned long *)&__m128i_result[1]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffff00000000ffff; + __m128i_out = __lsx_vslei_h (__m128i_op0, 13); + 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]) = 0x0000000000000000; + __m128i_out = __lsx_vslei_h (__m128i_op0, -7); + 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_vslei_h (__m128i_op0, 14); + 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_vslei_h (__m128i_op0, -16); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000200000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0002000200000001; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vslei_h (__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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vslei_h (__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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vslei_w (__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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vslei_w (__m128i_op0, -9); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x3fc000003fc00000; + *((unsigned long *)&__m128i_op0[0]) = 0x3fc000003fc00000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vslei_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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vslei_w (__m128i_op0, 0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffb96bffff57c9; + *((unsigned long *)&__m128i_op0[0]) = 0xffff6080ffff4417; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vslei_w (__m128i_op0, -7); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xd78cfd70b5f65d76; + *((unsigned long *)&__m128i_op0[0]) = 0x5779108fdedda7e4; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x00000000ffffffff; + __m128i_out = __lsx_vslei_w (__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_vslei_w (__m128i_op0, -14); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0x7ff8000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vslei_d (__m128i_op0, 7); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000000001fc1a568; + *((unsigned long *)&__m128i_op0[0]) = 0x02693fe0e7beb077; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vslei_d (__m128i_op0, -6); + 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_vslei_d (__m128i_op0, -4); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00ff000000ff0000; + *((unsigned long *)&__m128i_op0[0]) = 0x00ff000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vslei_d (__m128i_op0, 5); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xf1819b7c0732a6b6; + *((unsigned long *)&__m128i_op0[0]) = 0xffb9917a6e7fffff; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vslei_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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vslei_d (__m128i_op0, 12); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0037ffc8d7ff2800; + *((unsigned long *)&__m128i_op0[0]) = 0xff00ffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vslei_d (__m128i_op0, -9); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vslei_d (__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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vslei_d (__m128i_op0, -14); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xf03ef03ef03ef03e; + *((unsigned long *)&__m128i_op0[0]) = 0xf03ef03ef03ef03e; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vslei_d (__m128i_op0, -9); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vslei-2.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vslei-2.c new file mode 100644 index 00000000000..685a1bb3610 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vslei-2.c @@ -0,0 +1,293 @@ +/* { 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]) = 0x0000000000000000; + __m128i_out = __lsx_vslei_bu (__m128i_op0, 0x7); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xd82480697f678077; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vslei_bu (__m128i_op0, 0x1e); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfff489b693120950; + *((unsigned long *)&__m128i_op0[0]) = 0xfffc45a851c40c18; + *((unsigned long *)&__m128i_result[1]) = 0x000000000000ff00; + *((unsigned long *)&__m128i_result[0]) = 0x000000000000ff00; + __m128i_out = __lsx_vslei_bu (__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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vslei_bu (__m128i_op0, 0x15); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x000000000000000d; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vslei_bu (__m128i_op0, 0x14); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x1268f057137a0267; + *((unsigned long *)&__m128i_op0[0]) = 0x0048137ef886fae0; + *((unsigned long *)&__m128i_result[1]) = 0xff000000ff00ff00; + *((unsigned long *)&__m128i_result[0]) = 0xff00ff0000000000; + __m128i_out = __lsx_vslei_bu (__m128i_op0, 0x14); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000001; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vslei_bu (__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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vslei_bu (__m128i_op0, 0x13); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x7fffffff7fffffff; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vslei_bu (__m128i_op0, 0xe); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x000000000202fe02; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffff00ff; + __m128i_out = __lsx_vslei_bu (__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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vslei_bu (__m128i_op0, 0x1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0001000100000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vslei_bu (__m128i_op0, 0x1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vslei_bu (__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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vslei_hu (__m128i_op0, 0x1d); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000001f0a; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000ffff7a53; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffff0000; + *((unsigned long *)&__m128i_result[0]) = 0xffffffff00000000; + __m128i_out = __lsx_vslei_hu (__m128i_op0, 0xd); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x40f0001000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x40f0001000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000ffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000ffffffffffff; + __m128i_out = __lsx_vslei_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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vslei_hu (__m128i_op0, 0x1d); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000ffff0000ffff; + *((unsigned long *)&__m128i_op0[0]) = 0x0000ffff0000ff00; + *((unsigned long *)&__m128i_result[1]) = 0xffff0000ffff0000; + *((unsigned long *)&__m128i_result[0]) = 0xffff0000ffff0000; + __m128i_out = __lsx_vslei_hu (__m128i_op0, 0xe); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x000000000000000f; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffff0000; + __m128i_out = __lsx_vslei_hu (__m128i_op0, 0x9); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x00001b4a00007808; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffff0000ffff0000; + __m128i_out = __lsx_vslei_hu (__m128i_op0, 0x9); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x7ff0000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x7ff0000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000ffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000ffffffffffff; + __m128i_out = __lsx_vslei_hu (__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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vslei_hu (__m128i_op0, 0xa); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000003900; + *((unsigned long *)&__m128i_op0[0]) = 0x68bcf93435ed25ed; + *((unsigned long *)&__m128i_result[1]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vslei_wu (__m128i_op0, 0xc); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000001000001; + *((unsigned long *)&__m128i_op0[0]) = 0x0001000100000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_result[0]) = 0x00000000ffffffff; + __m128i_out = __lsx_vslei_wu (__m128i_op0, 0x5); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x03574e3a62407e03; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000001010000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xffffffff00000000; + __m128i_out = __lsx_vslei_wu (__m128i_op0, 0x0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000f0000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffff00000000; + __m128i_out = __lsx_vslei_wu (__m128i_op0, 0x1f); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00ff000000ff0000; + *((unsigned long *)&__m128i_op0[0]) = 0x00ff000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00000000ffffffff; + __m128i_out = __lsx_vslei_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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vslei_wu (__m128i_op0, 0xf); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xa2a2a2a3a2a2a2a3; + *((unsigned long *)&__m128i_op0[0]) = 0xc605c000aedd0000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vslei_wu (__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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vslei_wu (__m128i_op0, 0x17); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vslei_wu (__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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vslei_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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vslei_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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vslei_du (__m128i_op0, 0x10); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000000ff00000000; + *((unsigned long *)&__m128i_op0[0]) = 0x000000ff00000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vslei_du (__m128i_op0, 0x1e); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x000000000000ffff; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vslei_du (__m128i_op0, 0xa); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000100000001; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000100000001; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vslei_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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vslei_du (__m128i_op0, 0x1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00250023001c001d; + *((unsigned long *)&__m128i_op0[0]) = 0x309d2f342a5d2b34; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vslei_du (__m128i_op0, 0x13); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vslt-1.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vslt-1.c new file mode 100644 index 00000000000..15c96ccfe0c --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vslt-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]) = 0x0007658000115de0; + *((unsigned long *)&__m128i_op0[0]) = 0x001a8960001d2cc0; + *((unsigned long *)&__m128i_op1[1]) = 0xffc000007fc00000; + *((unsigned long *)&__m128i_op1[0]) = 0x9e801ffc7fc00000; + *((unsigned long *)&__m128i_result[1]) = 0x000000ffff0000ff; + *((unsigned long *)&__m128i_result[0]) = 0x0000ff00ff0000ff; + __m128i_out = __lsx_vslt_b (__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]) = 0x0000000000000384; + *((unsigned long *)&__m128i_op1[0]) = 0xe3f0200004003ffd; + *((unsigned long *)&__m128i_result[1]) = 0x000000000000ff00; + *((unsigned long *)&__m128i_result[0]) = 0x0000ff00ff00ff00; + __m128i_out = __lsx_vslt_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000080000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000000001ff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x000000000000ff00; + __m128i_out = __lsx_vslt_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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vslt_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]) = 0x7f0101070101010f; + *((unsigned long *)&__m128i_op1[0]) = 0x000000127f010116; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x000000ffffffffff; + __m128i_out = __lsx_vslt_b (__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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vslt_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]) = 0x00000ffef0010000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000ff0000ff0000; + __m128i_out = __lsx_vslt_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]) = 0x00000000000000ff; + __m128i_out = __lsx_vslt_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_vslt_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_vslt_b (__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]) = 0x0000000400000004; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000400000004; + *((unsigned long *)&__m128i_result[1]) = 0x000000ff00000000; + *((unsigned long *)&__m128i_result[0]) = 0x000000ff00000000; + __m128i_out = __lsx_vslt_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffff02000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffff000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000ffff00000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vslt_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000000002a001a; + *((unsigned long *)&__m128i_op0[0]) = 0x001a000b00000000; + *((unsigned long *)&__m128i_op1[1]) = 0xff800000ff800000; + *((unsigned long *)&__m128i_op1[0]) = 0xff800000ff800000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vslt_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xffff001a00000000; + *((unsigned long *)&__m128i_op1[1]) = 0x003fffc0ffc0003f; + *((unsigned long *)&__m128i_op1[0]) = 0xffc0ffc0003f003f; + *((unsigned long *)&__m128i_result[1]) = 0x00ff0000000000ff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000ff00ff; + __m128i_out = __lsx_vslt_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]) = 0x0403cfcf01c1595e; + *((unsigned long *)&__m128i_op1[0]) = 0x837cd5db43fc55d4; + *((unsigned long *)&__m128i_result[1]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x00000000ffffffff; + __m128i_out = __lsx_vslt_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_vslt_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0004000000040000; + *((unsigned long *)&__m128i_op0[0]) = 0x0004000000040000; + *((unsigned long *)&__m128i_op1[1]) = 0xfff6fff6fff6fff6; + *((unsigned long *)&__m128i_op1[0]) = 0xfff6fff6fff6fff6; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vslt_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_vslt_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_vslt_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffefefffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0xffffefefffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vslt_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000080000000800; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000080000000800; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vslt_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfcfcfcdcfcfcfcdc; + *((unsigned long *)&__m128i_op0[0]) = 0xfcfcfcdcfcfcfcdc; + *((unsigned long *)&__m128i_op1[1]) = 0x8000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x1748c4f9ed1a5870; + *((unsigned long *)&__m128i_result[1]) = 0x0000ffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffff00000000ffff; + __m128i_out = __lsx_vslt_h (__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_vslt_h (__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]) = 0x00000000084d12ce; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000024170000; + *((unsigned long *)&__m128i_result[1]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x00000000ffff0000; + __m128i_out = __lsx_vslt_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000ffff000086bd; + *((unsigned long *)&__m128i_op0[0]) = 0x0000ca000000c481; + *((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_vslt_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000000000003e2; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x00050eb00000fffa; + *((unsigned long *)&__m128i_op1[0]) = 0x0000f8a50000f310; + *((unsigned long *)&__m128i_result[1]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_result[0]) = 0xffff0000ffff0000; + __m128i_out = __lsx_vslt_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000011f0000f040; + *((unsigned long *)&__m128i_op1[1]) = 0x0177fff0fffffff0; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000011ff8bc; + *((unsigned long *)&__m128i_result[1]) = 0xffff000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00000000ffffffff; + __m128i_out = __lsx_vslt_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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffff000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xffff000000000000; + __m128i_out = __lsx_vslt_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0010001000100010; + *((unsigned long *)&__m128i_op0[0]) = 0x001000100010c410; + *((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_vslt_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]) = 0x800000ff000000ff; + *((unsigned long *)&__m128i_op1[0]) = 0x00ffffff0000ffff; + *((unsigned long *)&__m128i_result[1]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vslt_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xe0404041e0404041; + *((unsigned long *)&__m128i_op0[0]) = 0x803f800080000000; + *((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_vslt_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]) = 0x000000ff000000ff; + *((unsigned long *)&__m128i_op1[0]) = 0x000000ff000000ff; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffff00000000; + __m128i_out = __lsx_vslt_w (__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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vslt_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_vslt_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_vslt_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000008; + *((unsigned long *)&__m128i_op0[0]) = 0x0002008360500088; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000400028000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000004; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vslt_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_vslt_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_vslt_w (__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]) = 0x00000000467fef81; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00000000ffffffff; + __m128i_out = __lsx_vslt_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]) = 0x6363636363636363; + *((unsigned long *)&__m128i_op1[0]) = 0x6363636363636363; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vslt_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]) = 0x9c9c9c9c9c9c9c9c; + *((unsigned long *)&__m128i_op1[0]) = 0x9c9c9c9c63636363; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vslt_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_vslt_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000000003f800000; + *((unsigned long *)&__m128i_op0[0]) = 0x4eede8494f000000; + *((unsigned long *)&__m128i_op1[1]) = 0x1817161517161514; + *((unsigned long *)&__m128i_op1[0]) = 0x1615141315141312; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vslt_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]) = 0x0fff0fff0fff0fff; + *((unsigned long *)&__m128i_op1[0]) = 0x0fff0fff7f800fff; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vslt_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]) = 0x000fffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0x0010000000000001; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vslt_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_vslt_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-vslt-2.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vslt-2.c new file mode 100644 index 00000000000..e8d69f0e9d3 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vslt-2.c @@ -0,0 +1,236 @@ +/* { 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]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0007658000115de0; + *((unsigned long *)&__m128i_op1[0]) = 0x001a8960001d2cc0; + *((unsigned long *)&__m128i_result[1]) = 0x00ffffff00ffffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000ffffff; + __m128i_out = __lsx_vslt_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]) = 0x98147a504d145000; + *((unsigned long *)&__m128i_op1[0]) = 0x377b810912c0e000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffff00; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffff00; + __m128i_out = __lsx_vslt_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]) = 0xfffffffff359f358; + *((unsigned long *)&__m128i_op1[0]) = 0xfffffffff359f358; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffff00ff00; + __m128i_out = __lsx_vslt_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x317fce80317fce80; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000fffe0000fffe; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000ffff0000ffff; + __m128i_out = __lsx_vslt_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0007658000115de0; + *((unsigned long *)&__m128i_op0[0]) = 0x001a8960001d2cc0; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vslt_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_vslt_hu (__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]) = 0x0000000000000001; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vslt_hu (__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]) = 0x0000000000000320; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000007730; + *((unsigned long *)&__m128i_result[1]) = 0x000000000000ffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vslt_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_vslt_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_vslt_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]) = 0x7fff7fff7fff7fff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vslt_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]) = 0x0001000101010001; + *((unsigned long *)&__m128i_op1[0]) = 0x0001000100010001; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vslt_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_vslt_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x4050000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vslt_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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vslt_wu (__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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x6363636163636363; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vslt_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000001000000001; + *((unsigned long *)&__m128i_op0[0]) = 0x0000001000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000002000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000002000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_result[0]) = 0xffffffff00000000; + __m128i_out = __lsx_vslt_wu (__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]) = 0x00000000000145ad; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000300003e6e; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vslt_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x21201f1e19181716; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x00005dcbe7e830c0; + *((unsigned long *)&__m128i_op1[0]) = 0x03f21e0114bf19da; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vslt_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_vslt_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0x7fff7fff7fff7fff; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x5e695e95e1cb5a01; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vslt_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]) = 0x0313100003131000; + *((unsigned long *)&__m128i_op1[0]) = 0x0313100003131000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vslt_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000000000010a7; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000046ebaa2c; + *((unsigned long *)&__m128i_op1[1]) = 0xf1f1f1f149ed7273; + *((unsigned long *)&__m128i_op1[0]) = 0xf1f1f1f1865e65a1; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vslt_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00050eb00000fffa; + *((unsigned long *)&__m128i_op0[0]) = 0x0000f8a50000f310; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vslt_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-vslti-1.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vslti-1.c new file mode 100644 index 00000000000..5bf3ce6e89f --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vslti-1.c @@ -0,0 +1,328 @@ +/* { 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]) = 0x00000001fffffffe; + *((unsigned long *)&__m128i_op0[0]) = 0x00000001fffffffe; + *((unsigned long *)&__m128i_result[1]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x00000000ffffffff; + __m128i_out = __lsx_vslti_b (__m128i_op0, 0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00feff0000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x00feff0000000000; + *((unsigned long *)&__m128i_result[1]) = 0x00ffff0000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00ffff0000000000; + __m128i_out = __lsx_vslti_b (__m128i_op0, 0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffefffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffefffff; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vslti_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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vslti_b (__m128i_op0, 8); + 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_vslti_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_vslti_b (__m128i_op0, -12); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vslti_b (__m128i_op0, -12); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000004; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vslti_h (__m128i_op0, 6); + 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_vslti_h (__m128i_op0, -11); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x807f7f8000ffff00; + *((unsigned long *)&__m128i_op0[0]) = 0x0000ffff00feff00; + *((unsigned long *)&__m128i_result[1]) = 0xffff00000000ffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffff0000ffff; + __m128i_out = __lsx_vslti_h (__m128i_op0, 4); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x195f307a5d04acbb; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x000000000000ffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vslti_h (__m128i_op0, 10); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000800; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffff0000; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vslti_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_vslti_h (__m128i_op0, -11); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x3a3a3a3b3a3a3a3a; + *((unsigned long *)&__m128i_op0[0]) = 0x3a3a00003a3a0000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vslti_h (__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_vslti_h (__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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vslti_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_vslti_h (__m128i_op0, -15); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x00009c7c00007176; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000ffff00000000; + __m128i_out = __lsx_vslti_h (__m128i_op0, -15); + 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_vslti_h (__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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vslti_h (__m128i_op0, 14); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x3ff0000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000ffffffffffff; + __m128i_out = __lsx_vslti_h (__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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vslti_h (__m128i_op0, 15); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x5ff6a0a40ea8f47c; + *((unsigned long *)&__m128i_op0[0]) = 0x5ff6a0a40e9da42a; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vslti_w (__m128i_op0, -11); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x004200a000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x004200a000200001; + *((unsigned long *)&__m128i_result[1]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vslti_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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vslti_w (__m128i_op0, -10); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xd82480697f678077; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xffffffff00000000; + __m128i_out = __lsx_vslti_w (__m128i_op0, -9); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfffffffffffffe15; + *((unsigned long *)&__m128i_op0[0]) = 0xfffffffffffffe15; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vslti_w (__m128i_op0, 1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffff000100000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vslti_w (__m128i_op0, 3); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffc000ffffc005; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vslti_w (__m128i_op0, 6); + 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_vslti_w (__m128i_op0, -10); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000800000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000800000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vslti_w (__m128i_op0, -5); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x9c9c9c9c9c9c9c9c; + *((unsigned long *)&__m128i_op0[0]) = 0x9c9c9c9c9c9c9c9c; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vslti_w (__m128i_op0, 11); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0006000100040001; + *((unsigned long *)&__m128i_op0[0]) = 0x00010002ffff0105; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00000000ffffffff; + __m128i_out = __lsx_vslti_w (__m128i_op0, 15); + 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]) = 0x0000000000000000; + __m128i_out = __lsx_vslti_w (__m128i_op0, 0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xa000308000008002; + *((unsigned long *)&__m128i_op0[0]) = 0x0500847b00000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_result[0]) = 0x00000000ffffffff; + __m128i_out = __lsx_vslti_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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vslti_d (__m128i_op0, -9); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x003fffff00000000; + *((unsigned long *)&__m128i_op0[0]) = 0x003fffff00000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vslti_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_vslti_d (__m128i_op0, -16); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000000005e695e95; + *((unsigned long *)&__m128i_op0[0]) = 0x5e695e96c396b402; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vslti_d (__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_vslti_d (__m128i_op0, -15); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000020000; + *((unsigned long *)&__m128i_op0[0]) = 0x0103000201030002; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vslti_d (__m128i_op0, 7); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000455555555; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vslti_d (__m128i_op0, -11); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000008; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vslti_d (__m128i_op0, 14); + 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]) = 0x0000000000000000; + __m128i_out = __lsx_vslti_d (__m128i_op0, -13); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vslti-2.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vslti-2.c new file mode 100644 index 00000000000..768df528fce --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vslti-2.c @@ -0,0 +1,293 @@ +/* { 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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vslti_bu (__m128i_op0, 0x19); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x003f800000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x003f800000000000; + *((unsigned long *)&__m128i_result[1]) = 0xff0000ffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xff0000ffffffffff; + __m128i_out = __lsx_vslti_bu (__m128i_op0, 0x19); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000008a0000008a; + *((unsigned long *)&__m128i_op0[0]) = 0x0000008900000009; + *((unsigned long *)&__m128i_result[1]) = 0xffffff00ffffff00; + *((unsigned long *)&__m128i_result[0]) = 0xffffff00ffffffff; + __m128i_out = __lsx_vslti_bu (__m128i_op0, 0xa); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vslti_bu (__m128i_op0, 0x18); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x371fe00000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x371fe00000000000; + *((unsigned long *)&__m128i_result[1]) = 0x000000ffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x000000ffffffffff; + __m128i_out = __lsx_vslti_bu (__m128i_op0, 0x8); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xbe8282a0793636d3; + *((unsigned long *)&__m128i_op0[0]) = 0x793636d3793636d3; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vslti_bu (__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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vslti_bu (__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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vslti_bu (__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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vslti_bu (__m128i_op0, 0x1b); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x2e2b34ca59fa4c88; + *((unsigned long *)&__m128i_op0[0]) = 0x3b2c8aefd44be966; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vslti_hu (__m128i_op0, 0x18); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000100000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000080000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffff0000ffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vslti_hu (__m128i_op0, 0xf); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x7505445465593af1; + *((unsigned long *)&__m128i_op0[0]) = 0x0100d6effefd0498; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vslti_hu (__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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vslti_hu (__m128i_op0, 0x18); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00010000ffab001c; + *((unsigned long *)&__m128i_op0[0]) = 0x0001ffffffadff9a; + *((unsigned long *)&__m128i_result[1]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_result[0]) = 0xffff000000000000; + __m128i_out = __lsx_vslti_hu (__m128i_op0, 0xb); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xff7300000ca00430; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000001a00000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vslti_hu (__m128i_op0, 0x0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000000009c83e21a; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000022001818; + *((unsigned long *)&__m128i_result[1]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_result[0]) = 0xffffffff00000000; + __m128i_out = __lsx_vslti_hu (__m128i_op0, 0x6); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x00001802041b0013; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vslti_wu (__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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vslti_wu (__m128i_op0, 0xa); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vslti_wu (__m128i_op0, 0x17); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0007000000050000; + *((unsigned long *)&__m128i_op0[0]) = 0x0003000000010000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vslti_wu (__m128i_op0, 0x14); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000000000000006f; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000001f0a; + *((unsigned long *)&__m128i_result[1]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_result[0]) = 0xffffffff00000000; + __m128i_out = __lsx_vslti_wu (__m128i_op0, 0x16); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000003a24; + *((unsigned long *)&__m128i_op0[0]) = 0x003dbe88077c78c1; + *((unsigned long *)&__m128i_result[1]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vslti_wu (__m128i_op0, 0xa); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0100010001000100; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vslti_wu (__m128i_op0, 0x1a); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x5d7f5d807fea807f; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vslti_wu (__m128i_op0, 0x1e); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x975ca6046e2e4889; + *((unsigned long *)&__m128i_op0[0]) = 0x1748c4f9ed1a5870; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vslti_wu (__m128i_op0, 0xc); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000235600005486; + *((unsigned long *)&__m128i_op0[0]) = 0x0000b31600006544; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vslti_wu (__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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vslti_du (__m128i_op0, 0xf); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x000000000000ffff; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vslti_du (__m128i_op0, 0x5); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000ffff00000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000ffff0000ffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vslti_du (__m128i_op0, 0xb); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000001; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vslti_du (__m128i_op0, 0x1b); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000000007e8a60; + *((unsigned long *)&__m128i_op0[0]) = 0x000000000001edde; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vslti_du (__m128i_op0, 0x19); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0aa077b7054c9554; + *((unsigned long *)&__m128i_op0[0]) = 0x40c7ee1f38e4c4e8; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vslti_du (__m128i_op0, 0x8); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0101010101010101; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vslti_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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vslti_du (__m128i_op0, 0x17); + 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]) = 0xffffffffffffffff; + __m128i_out = __lsx_vslti_du (__m128i_op0, 0x5); + 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]) = 0xffffffffffffffff; + __m128i_out = __lsx_vslti_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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vslti_du (__m128i_op0, 0x1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x6b75948a91407a42; + *((unsigned long *)&__m128i_op0[0]) = 0x0b5471b633e54fde; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vslti_du (__m128i_op0, 0x7); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000feff23560000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000fd1654860000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vslti_du (__m128i_op0, 0x7); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} From patchwork Wed Sep 13 03:37:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: chenxiaolong X-Patchwork-Id: 138604 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9ecd:0:b0:3f2:4152:657d with SMTP id t13csp835143vqx; Tue, 12 Sep 2023 20:51:10 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFozWIZhQ3yEetBw2LLkl0YXRmHnDTGK6xsz4c2abJpoRio2JJq1WqiXHSar6/Nxh9c7NY7 X-Received: by 2002:a17:907:b13:b0:9a2:200:b694 with SMTP id h19-20020a1709070b1300b009a20200b694mr770611ejl.11.1694577069810; Tue, 12 Sep 2023 20:51:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694577069; cv=none; d=google.com; s=arc-20160816; b=n3TsrfRtwWiueYS7FdH+c6HyckBGVT7yKSKKx1RKDbgZ6E4AzfFfvY3UezDSRoJfHj 6I+NjuyMNYAT8n93dULehRBrS5sZxHzLA58MbSQLjZyBwjlIlk6dITb29BX1qIvFSvil Urz1SY1XdnUsZ3GEP29MS6TG1wdVrS/U8uEDJxgQ+P/piIFwNz2jV3LfFAryghvRQ5C+ Ya3zQdBE7/d9aEqGgcs3nmfcMVN1rd+krb9I8v9VoRYuzEuSHiHKfkPqtZzvrMCrS/NG yD2eiAB/d4sPujyoSwSKh6Cik8OqJ3jt+06zk8QxtIFZRXuuiSHc3DerYnkXc9tooHab i2VA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dmarc-filter :delivered-to; bh=dOIKeITAVSQaeadh3xPQwcwjNuh/DJlGGqM0d5krYVw=; fh=3pFUYcpS/27XRzOf17GfR86AuNQu+P1CET04YURgCLs=; b=e86AMzvfUW2nA4PVhnhIVOGP/EnGwjL5/aeC53KsRVJAZWl/0xNQfukRvYG9EGw5dD ePsNRqsiLP1h/04eGWFgvdppZ20dm1RnG+xRnmbcUfNj8T7K1HPaacFGs20met3Cs1kg oC/Te6he0ojbnR7LmAG35BDB+piHljYEco4rACNnMBUYFFHlLNtOMUVKxV5LdLsuGm+8 +AhbCys+ga+8hp+WqDaUtoSu3AU/g4Qf4n1Y6pSa/1GvbaN799my9XyoTEW5/IFwpH6c kieMRrKN7ALRJ0HFiODPcvzYxLKlJh2hEHbaD5QphVXGPY8ba4v8QMR9dxDRjY3dljYb 9YIA== 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 ko18-20020a170907987200b0099cc4c7e050si9832179ejc.237.2023.09.12.20.51.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Sep 2023 20:51: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 C10F338768A9 for ; Wed, 13 Sep 2023 03:39:14 +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 8E9AB3893656 for ; Wed, 13 Sep 2023 03:37:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8E9AB3893656 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 1qgGh2-0003wn-Oj for gcc-patches@gcc.gnu.org; Tue, 12 Sep 2023 23:37:40 -0400 Received: from loongson.cn (unknown [10.10.130.252]) by gateway (Coremail) with SMTP id _____8AxJuh5LgFlJTEmAA--.15145S3; Wed, 13 Sep 2023 11:37:29 +0800 (CST) Received: from slurm-master.loongson.cn (unknown [10.10.130.252]) by localhost.localdomain (Coremail) with SMTP id AQAAf8DxS9x3LgFlQhACAA--.3563S4; Wed, 13 Sep 2023 11:37:28 +0800 (CST) From: Xiaolong Chen To: gcc-patches@gcc.gnu.org Cc: xry111@xry111.site, i@xen0n.name, xuchenghua@loongson.cn, chenglulu@loongson.cn, Xiaolong Chen Subject: [PATCH v4 20/23] LoongArch: Add tests for SX vector vfcmp instructions. Date: Wed, 13 Sep 2023 11:37:23 +0800 Message-Id: <20230913033726.6408-1-chenxiaolong@loongson.cn> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-CM-TRANSID: AQAAf8DxS9x3LgFlQhACAA--.3563S4 X-CM-SenderInfo: hfkh05xldrz0tqj6z05rqj20fqof0/1tbiAQANBWUBHCIBGAAAsK X-Coremail-Antispam: 1Uk129KBj9DXoWktryxXFy7tw43Zr13ZryruFX_yoW5Xry7Zr c_JF45JFy8Wr429r9rXr1DZF90v3y7XanFva1UAF1jq3Z7tw1kZa43GF18Xr17Jw1vyF13 ZFyDA348Cr4kGr18KosvyTuYvTs0mTUanT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUj1kv1T uYvTs0mT0YCTnIWjqI5I8CrVACY4xI64kE6c02F40Ex7xfYxn0WfASr-VFAUDa7-sFnT9f nUUIcSsGvfJTRUUUbc8YFVCjjxCrM7AC8VAFwI0_Jr0_Gr1l1xkIjI8I6I8E6xAIw20EY4 v20xvaj40_Wr0E3s1l1IIY67AEw4v_Jr0_Jr4l8cAvFVAK0II2c7xJM28CjxkF64kEwVA0 rcxSw2x7M28EF7xvwVC0I7IYx2IY67AKxVW7JVWDJwA2z4x0Y4vE2Ix0cI8IcVCY1x0267 AKxVWxJVW8Jr1l84ACjcxK6I8E87Iv67AKxVW8Jr0_Cr1UM28EF7xvwVC2z280aVCY1x02 67AKxVW8Jr0_Cr1UM2AIxVAIcxkEcVAq07x20xvEncxIr21l57IF6xkI12xvs2x26I8E6x ACxx1l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26rWY6Fy7McIj6I8E 87Iv67AKxVWxJVW8Jr1lOx8S6xCaFVCjc4AY6r1j6r4UM4x0Y48IcxkI7VAKI48JMxAIw2 8IcxkI7VAKI48JMxC20s026xCaFVCjc4AY6r1j6r4UMI8I3I0E5I8CrVAFwI0_Jr0_Jr4l x2IqxVCjr7xvwVAFwI0_JrI_JrWlx4CE17CEb7AF67AKxVWUAVWUtwCIc40Y0x0EwIxGrw CI42IY6xIIjxv20xvE14v26F1j6w1UMIIF0xvE2Ix0cI8IcVCY1x0267AKxVWxJVW8Jr1l IxAIcVCF04k26cxKx2IYs7xG6r1j6r1xMIIF0xvEx4A2jsIE14v26F4j6r4UJwCI42IY6I 8E87Iv6xkF7I0E14v26r4j6r4UJbIYCTnIWIevJa73UjIFyTuYvjxUcD73DUUUU 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.8 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: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1776892845416224436 X-GMAIL-MSGID: 1776892845416224436 gcc/testsuite/ChangeLog: * gcc.target/loongarch/vector/lsx/lsx-vfcmp_caf.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vfcmp_ceq.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vfcmp_cle.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vfcmp_clt.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vfcmp_cne.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vfcmp_cor.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vfcmp_cun.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vfcmp_saf.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vfcmp_seq.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vfcmp_sle.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vfcmp_slt.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vfcmp_sne.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vfcmp_sor.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vfcmp_sun.c: New test. --- .../loongarch/vector/lsx/lsx-vfcmp_caf.c | 244 ++++++++ .../loongarch/vector/lsx/lsx-vfcmp_ceq.c | 516 +++++++++++++++++ .../loongarch/vector/lsx/lsx-vfcmp_cle.c | 530 ++++++++++++++++++ .../loongarch/vector/lsx/lsx-vfcmp_clt.c | 476 ++++++++++++++++ .../loongarch/vector/lsx/lsx-vfcmp_cne.c | 378 +++++++++++++ .../loongarch/vector/lsx/lsx-vfcmp_cor.c | 170 ++++++ .../loongarch/vector/lsx/lsx-vfcmp_cun.c | 253 +++++++++ .../loongarch/vector/lsx/lsx-vfcmp_saf.c | 214 +++++++ .../loongarch/vector/lsx/lsx-vfcmp_seq.c | 450 +++++++++++++++ .../loongarch/vector/lsx/lsx-vfcmp_sle.c | 407 ++++++++++++++ .../loongarch/vector/lsx/lsx-vfcmp_slt.c | 512 +++++++++++++++++ .../loongarch/vector/lsx/lsx-vfcmp_sne.c | 398 +++++++++++++ .../loongarch/vector/lsx/lsx-vfcmp_sor.c | 269 +++++++++ .../loongarch/vector/lsx/lsx-vfcmp_sun.c | 335 +++++++++++ 14 files changed, 5152 insertions(+) create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfcmp_caf.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfcmp_ceq.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfcmp_cle.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfcmp_clt.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfcmp_cne.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfcmp_cor.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfcmp_cun.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfcmp_saf.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfcmp_seq.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfcmp_sle.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfcmp_slt.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfcmp_sne.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfcmp_sor.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfcmp_sun.c diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfcmp_caf.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfcmp_caf.c new file mode 100644 index 00000000000..b448c207629 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfcmp_caf.c @@ -0,0 +1,244 @@ +/* { 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]) = 0x01010101; + *((int *)&__m128_op0[0]) = 0x01010101; + *((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_vfcmp_caf_s (__m128_op0, __m128_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x7ef400ad; + *((int *)&__m128_op0[2]) = 0x21fc7081; + *((int *)&__m128_op0[1]) = 0x28bf0351; + *((int *)&__m128_op0[0]) = 0xec69b5f2; + *((int *)&__m128_op1[3]) = 0xff800000; + *((int *)&__m128_op1[2]) = 0xff800000; + *((int *)&__m128_op1[1]) = 0xff800000; + *((int *)&__m128_op1[0]) = 0x7fc00000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_caf_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_vfcmp_caf_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]) = 0x01000100; + *((int *)&__m128_op0[0]) = 0x01000100; + *((int *)&__m128_op1[3]) = 0xffffffff; + *((int *)&__m128_op1[2]) = 0xffffffff; + *((int *)&__m128_op1[1]) = 0x64e464e4; + *((int *)&__m128_op1[0]) = 0x64e464e4; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_caf_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]) = 0xffc0ff80; + *((int *)&__m128_op1[2]) = 0xff800000; + *((int *)&__m128_op1[1]) = 0x00000000; + *((int *)&__m128_op1[0]) = 0x00000005; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_caf_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_vfcmp_caf_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]) = 0xffffffff; + *((int *)&__m128_op0[0]) = 0xc0800000; + *((int *)&__m128_op1[3]) = 0x0000001b; + *((int *)&__m128_op1[2]) = 0x0000001b; + *((int *)&__m128_op1[1]) = 0x0000001b; + *((int *)&__m128_op1[0]) = 0x0000001b; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_caf_s (__m128_op0, __m128_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00000002; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0x00000002; + *((int *)&__m128_op0[0]) = 0x00000000; + *((int *)&__m128_op1[3]) = 0x00000000; + *((int *)&__m128_op1[2]) = 0x00000000; + *((int *)&__m128_op1[1]) = 0x34500292; + *((int *)&__m128_op1[0]) = 0x0f3017d6; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_caf_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]) = 0x00830029; + *((int *)&__m128_op0[0]) = 0x0038ff50; + *((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_vfcmp_caf_s (__m128_op0, __m128_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0xff7fff80; + *((int *)&__m128_op0[2]) = 0xff800001; + *((int *)&__m128_op0[1]) = 0xe593d844; + *((int *)&__m128_op0[0]) = 0xe593c8c4; + *((int *)&__m128_op1[3]) = 0xff800000; + *((int *)&__m128_op1[2]) = 0xff800000; + *((int *)&__m128_op1[1]) = 0xe593c8c4; + *((int *)&__m128_op1[0]) = 0xe593c8c4; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_caf_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]) = 0x8a8a8a8a; + *((int *)&__m128_op1[2]) = 0x8a8a8a8a; + *((int *)&__m128_op1[1]) = 0x8a8a8a8a; + *((int *)&__m128_op1[0]) = 0x8a8a8a8a; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_caf_s (__m128_op0, __m128_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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128d_op1[0]) = 0xffffffffff01ff01; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_caf_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x66b34f643c9c626a; + *((unsigned long *)&__m128d_op0[0]) = 0x38d60e366e547876; + *((unsigned long *)&__m128d_op1[1]) = 0x66b34f643c9c626a; + *((unsigned long *)&__m128d_op1[0]) = 0x38d60e366e547876; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_caf_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_vfcmp_caf_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_vfcmp_caf_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000; + *((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_vfcmp_caf_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0xfcfcfcdcfcfcfcdc; + *((unsigned long *)&__m128d_op0[0]) = 0xfcfcfcdcfcfcfcdc; + *((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_vfcmp_caf_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000005; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000005; + *((unsigned long *)&__m128d_op1[1]) = 0x000700000004fdff; + *((unsigned long *)&__m128d_op1[0]) = 0x000300000000fdff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_caf_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0xf2f444429d96dbe1; + *((unsigned long *)&__m128d_op0[0]) = 0xddd76c75f2f44442; + *((unsigned long *)&__m128d_op1[1]) = 0x0001000100010001; + *((unsigned long *)&__m128d_op1[0]) = 0xc1f03e1042208410; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_caf_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0xffffbfff7fffc000; + *((unsigned long *)&__m128d_op0[0]) = 0xffff43dfffff81fb; + *((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_vfcmp_caf_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-vfcmp_ceq.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfcmp_ceq.c new file mode 100644 index 00000000000..98941b47d8b --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfcmp_ceq.c @@ -0,0 +1,516 @@ +/* { 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; + *((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]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_ceq_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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_ceq_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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_ceq_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]) = 0x00007f00; + *((int *)&__m128_op1[1]) = 0x00000000; + *((int *)&__m128_op1[0]) = 0x01000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_ceq_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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_ceq_s (__m128_op0, __m128_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x08fdc221; + *((int *)&__m128_op0[2]) = 0xbfdb1927; + *((int *)&__m128_op0[1]) = 0x4303c67e; + *((int *)&__m128_op0[0]) = 0x9b7fb213; + *((int *)&__m128_op1[3]) = 0x0000800c; + *((int *)&__m128_op1[2]) = 0x0004300c; + *((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_vfcmp_ceq_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]) = 0x00000001; + *((int *)&__m128_op1[3]) = 0xffffffff; + *((int *)&__m128_op1[2]) = 0xffffffff; + *((int *)&__m128_op1[1]) = 0x00000000; + *((int *)&__m128_op1[0]) = 0x00000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xffffffff00000000; + __m128i_out = __lsx_vfcmp_ceq_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]) = 0x00000800; + *((int *)&__m128_op1[0]) = 0x00000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x00000000ffffffff; + __m128i_out = __lsx_vfcmp_ceq_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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_ceq_s (__m128_op0, __m128_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00007fff; + *((int *)&__m128_op0[2]) = 0x00007fff; + *((int *)&__m128_op0[1]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0x2bfd9461; + *((int *)&__m128_op1[3]) = 0x00000000; + *((int *)&__m128_op1[2]) = 0x00000000; + *((int *)&__m128_op1[1]) = 0x00000000; + *((int *)&__m128_op1[0]) = 0x2bfd9461; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_ceq_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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_ceq_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]) = 0x01000000; + *((int *)&__m128_op0[0]) = 0x01000000; + *((int *)&__m128_op1[3]) = 0xffffffff; + *((int *)&__m128_op1[2]) = 0xffffffff; + *((int *)&__m128_op1[1]) = 0xffffffff; + *((int *)&__m128_op1[0]) = 0xffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_ceq_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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_ceq_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]) = 0xcd636363; + *((int *)&__m128_op1[2]) = 0xcd636363; + *((int *)&__m128_op1[1]) = 0xcd636363; + *((int *)&__m128_op1[0]) = 0xcd636363; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_ceq_s (__m128_op0, __m128_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x007fffff; + *((int *)&__m128_op0[1]) = 0x007fffff; + *((int *)&__m128_op0[0]) = 0xff800000; + *((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]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_ceq_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]) = 0x0000cecd; + *((int *)&__m128_op1[2]) = 0x00004657; + *((int *)&__m128_op1[1]) = 0x0000c900; + *((int *)&__m128_op1[0]) = 0x00011197; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_ceq_s (__m128_op0, __m128_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0xf51df8db; + *((int *)&__m128_op0[2]) = 0xd6050189; + *((int *)&__m128_op0[1]) = 0x0983e2db; + *((int *)&__m128_op0[0]) = 0xf235ed87; + *((int *)&__m128_op1[3]) = 0xffffffff; + *((int *)&__m128_op1[2]) = 0x3ea5016b; + *((int *)&__m128_op1[1]) = 0xfffefffe; + *((int *)&__m128_op1[0]) = 0x3f6fb04d; + *((unsigned long *)&__m128i_result[1]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_result[0]) = 0xffffffff00000000; + __m128i_out = __lsx_vfcmp_cueq_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]) = 0xffffffff; + *((int *)&__m128_op1[2]) = 0xffffffff; + *((int *)&__m128_op1[1]) = 0xffffffff; + *((int *)&__m128_op1[0]) = 0xffffffff; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_cueq_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]) = 0xffa8ff9f; + *((int *)&__m128_op1[1]) = 0x0000ffff; + *((int *)&__m128_op1[0]) = 0xffabff99; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x00000000ffffffff; + __m128i_out = __lsx_vfcmp_cueq_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]) = 0x0000ff00; + *((int *)&__m128_op1[3]) = 0x40404040; + *((int *)&__m128_op1[2]) = 0x40404040; + *((int *)&__m128_op1[1]) = 0x40404040; + *((int *)&__m128_op1[0]) = 0x40404040; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_cueq_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]) = 0x3bcc5098; + *((int *)&__m128_op1[2]) = 0x703fa5f0; + *((int *)&__m128_op1[1]) = 0xab7b3134; + *((int *)&__m128_op1[0]) = 0x9703f605; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_cueq_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]) = 0x000000ff; + *((int *)&__m128_op0[0]) = 0xfe01fd02; + *((int *)&__m128_op1[3]) = 0x00000000; + *((int *)&__m128_op1[2]) = 0x00000000; + *((int *)&__m128_op1[1]) = 0x00000000; + *((int *)&__m128_op1[0]) = 0x0001fe01; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_cueq_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]) = 0x000000ff; + *((int *)&__m128_op0[0]) = 0xfe01fd02; + *((int *)&__m128_op1[3]) = 0x00000001; + *((int *)&__m128_op1[2]) = 0x00000100; + *((int *)&__m128_op1[1]) = 0x00000001; + *((int *)&__m128_op1[0]) = 0x00000100; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_cueq_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]) = 0x00800000; + *((int *)&__m128_op0[0]) = 0x00800000; + *((int *)&__m128_op1[3]) = 0x00000000; + *((int *)&__m128_op1[2]) = 0x00000000; + *((int *)&__m128_op1[1]) = 0x00800000; + *((int *)&__m128_op1[0]) = 0x00800000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_cueq_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]) = 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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_cueq_s (__m128_op0, __m128_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0xc2409edab019323f; + *((unsigned long *)&__m128d_op0[0]) = 0x460f3b393ef4be3a; + *((unsigned long *)&__m128d_op1[1]) = 0x0101010101010101; + *((unsigned long *)&__m128d_op1[0]) = 0x0100000100010001; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_ceq_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x000000ff00000000; + *((unsigned long *)&__m128d_op0[0]) = 0x000000ff00000000; + *((unsigned long *)&__m128d_op1[1]) = 0x00ffff0000000000; + *((unsigned long *)&__m128d_op1[0]) = 0x00ffff0000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_ceq_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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_ceq_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0xffffffbfffffffbf; + *((unsigned long *)&__m128d_op0[0]) = 0xffffffbfffffffbf; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[0]) = 0x000000000000ff00; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_ceq_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]) = 0xfffdfffdfffdfffd; + *((unsigned long *)&__m128d_op1[0]) = 0xfffdfffdfffdfffd; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_ceq_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000014eb54ab; + *((unsigned long *)&__m128d_op0[0]) = 0x14eb6a002a406a00; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000014eb54ab; + *((unsigned long *)&__m128d_op1[0]) = 0x14eb6a002a406a00; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_ceq_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]) = 0xfffffffffffffff4; + *((unsigned long *)&__m128d_op1[0]) = 0xfffffffffffffff4; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_ceq_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000ffff0000ffff; + *((unsigned long *)&__m128d_op0[0]) = 0x0000ffff0000ffff; + *((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_vfcmp_cueq_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]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_cueq_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x00000000ffffffff; + *((unsigned long *)&__m128d_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_cueq_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0100000001000100; + *((unsigned long *)&__m128d_op0[0]) = 0x0100010000000000; + *((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_vfcmp_cueq_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0xffff0000ffff0000; + *((unsigned long *)&__m128d_op0[0]) = 0xffff000000000000; + *((unsigned long *)&__m128d_op1[1]) = 0x0000006f00001f0a; + *((unsigned long *)&__m128d_op1[0]) = 0x0000c000ffffc000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_cueq_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]) = 0x00000000003dffc2; + *((unsigned long *)&__m128d_op1[0]) = 0x00000000003dffc2; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_cueq_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128d_op0[0]) = 0xffffffffe000ffdf; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_cueq_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000010100000101; + *((unsigned long *)&__m128d_op0[0]) = 0x0000010100000101; + *((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_vfcmp_cueq_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x000000000000000b; + *((unsigned long *)&__m128d_op0[0]) = 0x000000000000000b; + *((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_vfcmp_cueq_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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_cueq_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]) = 0xd78cfd70b5f65d77; + *((unsigned long *)&__m128d_op1[0]) = 0x5779108fdedda7e5; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_cueq_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x000000ff0000ffff; + *((unsigned long *)&__m128d_op1[1]) = 0x00000000ffffffff; + *((unsigned long *)&__m128d_op1[0]) = 0x00000000ffff0000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_cueq_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-vfcmp_cle.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfcmp_cle.c new file mode 100644 index 00000000000..409bce0ecda --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfcmp_cle.c @@ -0,0 +1,530 @@ +/* { 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; + *((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]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_cle_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]) = 0x00001802; + *((int *)&__m128_op0[0]) = 0x041b0013; + *((int *)&__m128_op1[3]) = 0xff800000; + *((int *)&__m128_op1[2]) = 0xff800000; + *((int *)&__m128_op1[1]) = 0xff800000; + *((int *)&__m128_op1[0]) = 0xc3080000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_cle_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]) = 0x17fda829; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_cle_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]) = 0x00000404; + *((int *)&__m128_op1[2]) = 0x00000383; + *((int *)&__m128_op1[1]) = 0xffffe000; + *((int *)&__m128_op1[0]) = 0xffff1fff; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_cle_s (__m128_op0, __m128_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x000000fe; + *((int *)&__m128_op0[2]) = 0x808000ff; + *((int *)&__m128_op0[1]) = 0x000000fe; + *((int *)&__m128_op0[0]) = 0x808000fe; + *((int *)&__m128_op1[3]) = 0x00000000; + *((int *)&__m128_op1[2]) = 0x00000000; + *((int *)&__m128_op1[1]) = 0xffffffff; + *((int *)&__m128_op1[0]) = 0xffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_cle_s (__m128_op0, __m128_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00000020; + *((int *)&__m128_op0[2]) = 0x00000020; + *((int *)&__m128_op0[1]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0x00000000; + *((int *)&__m128_op1[3]) = 0x00000000; + *((int *)&__m128_op1[2]) = 0x00000000; + *((int *)&__m128_op1[1]) = 0x0000ffc1; + *((int *)&__m128_op1[0]) = 0x00010001; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_cle_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]) = 0x00000004; + *((int *)&__m128_op0[0]) = 0x00000000; + *((int *)&__m128_op1[3]) = 0x00000000; + *((int *)&__m128_op1[2]) = 0x00000000; + *((int *)&__m128_op1[1]) = 0xffffffff; + *((int *)&__m128_op1[0]) = 0xe0000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_cle_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]) = 0x01010001; + *((int *)&__m128_op1[2]) = 0x00010001; + *((int *)&__m128_op1[1]) = 0x01010301; + *((int *)&__m128_op1[0]) = 0x00010001; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_cle_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]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0x00000001; + *((int *)&__m128_op1[3]) = 0xffffffff; + *((int *)&__m128_op1[2]) = 0xffffffff; + *((int *)&__m128_op1[1]) = 0x00000000; + *((int *)&__m128_op1[0]) = 0x00000001; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_cle_s (__m128_op0, __m128_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0xffffff00; + *((int *)&__m128_op0[1]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0xffffffff; + *((int *)&__m128_op1[3]) = 0x00000001; + *((int *)&__m128_op1[2]) = 0x00000001; + *((int *)&__m128_op1[1]) = 0x00000001; + *((int *)&__m128_op1[0]) = 0x00000001; + *((unsigned long *)&__m128i_result[1]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_result[0]) = 0xffffffff00000000; + __m128i_out = __lsx_vfcmp_cle_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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_cle_s (__m128_op0, __m128_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00000001; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0x00010001; + *((int *)&__m128_op0[0]) = 0x00000000; + *((int *)&__m128_op1[3]) = 0x00060fbf; + *((int *)&__m128_op1[2]) = 0x02040fbf; + *((int *)&__m128_op1[1]) = 0x00020fbf; + *((int *)&__m128_op1[0]) = 0x02000fbf; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_cle_s (__m128_op0, __m128_op1); + 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]) = 0x950fa306; + *((int *)&__m128_op1[3]) = 0x00000000; + *((int *)&__m128_op1[2]) = 0x00000000; + *((int *)&__m128_op1[1]) = 0x380fdfdf; + *((int *)&__m128_op1[0]) = 0xc0000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_result[0]) = 0xffffffff00000000; + __m128i_out = __lsx_vfcmp_cle_s (__m128_op0, __m128_op1); + 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]) = 0x00000000; + *((int *)&__m128_op1[3]) = 0x00000000; + *((int *)&__m128_op1[2]) = 0x00000000; + *((int *)&__m128_op1[1]) = 0xffffffff; + *((int *)&__m128_op1[0]) = 0xffffffff; + *((unsigned long *)&__m128i_result[1]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_cle_s (__m128_op0, __m128_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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_cle_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]) = 0x0000007fff800000; + *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_cle_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000080007f80800; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000001000000; + *((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_vfcmp_cle_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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_cle_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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_cle_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000080800000808; + *((unsigned long *)&__m128d_op0[0]) = 0x0000080800000808; + *((unsigned long *)&__m128d_op1[1]) = 0xffffffff80800001; + *((unsigned long *)&__m128d_op1[0]) = 0xffffffff80800001; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_cle_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]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_cle_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x5f675e96a8d359f5; + *((unsigned long *)&__m128d_op0[0]) = 0x46387f95d9a68001; + *((unsigned long *)&__m128d_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128d_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_cle_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x131211101211100f; + *((unsigned long *)&__m128d_op0[0]) = 0x11100f0e100f0e0d; + *((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_vfcmp_cle_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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_cle_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]) = 0x000000000002a000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_cle_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0xffffffffffff7f8c; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[1]) = 0x98147a504d145000; + *((unsigned long *)&__m128d_op1[0]) = 0x377b810912c0e000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_cle_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x00009c7c00007176; + *((unsigned long *)&__m128d_op1[1]) = 0xfcfcfcfcfcfcfcfd; + *((unsigned long *)&__m128d_op1[0]) = 0xfcfcfcfcfcfc0000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_cle_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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_cle_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]) = 0xfffffffff359f358; + *((unsigned long *)&__m128d_op1[0]) = 0xfffffffff359f358; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_cle_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000003ff8; + *((unsigned long *)&__m128d_op1[1]) = 0x6363636363636363; + *((unsigned long *)&__m128d_op1[0]) = 0x6363636363636363; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_cle_d (__m128d_op0, __m128d_op1); + 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; + *((int *)&__m128_op1[3]) = 0x00000000; + *((int *)&__m128_op1[2]) = 0x00000001; + *((int *)&__m128_op1[1]) = 0x00000000; + *((int *)&__m128_op1[0]) = 0x00000001; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_cule_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]) = 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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_cule_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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_cule_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]) = 0x00000001; + *((int *)&__m128_op1[3]) = 0x00000000; + *((int *)&__m128_op1[2]) = 0x4f804f81; + *((int *)&__m128_op1[1]) = 0x00000000; + *((int *)&__m128_op1[0]) = 0x4f804f80; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_cule_s (__m128_op0, __m128_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x7fff0007; + *((int *)&__m128_op0[2]) = 0xe215b122; + *((int *)&__m128_op0[1]) = 0x7ffeffff; + *((int *)&__m128_op0[0]) = 0x7bfff828; + *((int *)&__m128_op1[3]) = 0x80010009; + *((int *)&__m128_op1[2]) = 0x816ac5de; + *((int *)&__m128_op1[1]) = 0x80010001; + *((int *)&__m128_op1[0]) = 0x84000bd8; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffff00000000; + __m128i_out = __lsx_vfcmp_cule_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]) = 0xfefa0000; + *((int *)&__m128_op1[2]) = 0x00000000; + *((int *)&__m128_op1[1]) = 0x00000000; + *((int *)&__m128_op1[0]) = 0x00000000; + *((unsigned long *)&__m128i_result[1]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_cule_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]) = 0x9c9c9c9c; + *((int *)&__m128_op1[2]) = 0x9c9c9c9c; + *((int *)&__m128_op1[1]) = 0x9c9c9c9c; + *((int *)&__m128_op1[0]) = 0x9c9c9c9c; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_cule_s (__m128_op0, __m128_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x0c0b0a09; + *((int *)&__m128_op0[2]) = 0x0b0a0908; + *((int *)&__m128_op0[1]) = 0x0a090807; + *((int *)&__m128_op0[0]) = 0x09080706; + *((int *)&__m128_op1[3]) = 0x0c0b0a09; + *((int *)&__m128_op1[2]) = 0x0b0a0908; + *((int *)&__m128_op1[1]) = 0x0a090807; + *((int *)&__m128_op1[0]) = 0x09080706; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_cule_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]) = 0x00000020; + *((int *)&__m128_op1[2]) = 0x00000020; + *((int *)&__m128_op1[1]) = 0x0000001f; + *((int *)&__m128_op1[0]) = 0x0000001f; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_cule_s (__m128_op0, __m128_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x7ff80000; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0x7ff80000; + *((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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_cule_s (__m128_op0, __m128_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0xffff80ff0010ff06; + *((unsigned long *)&__m128d_op0[0]) = 0x8000000080000000; + *((unsigned long *)&__m128d_op1[1]) = 0xedfaedfaedfaedfa; + *((unsigned long *)&__m128d_op1[0]) = 0xedfaedfaedfaedfa; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_cule_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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_cule_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]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_cule_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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_cule_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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_cule_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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_cule_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-vfcmp_clt.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfcmp_clt.c new file mode 100644 index 00000000000..39c9cf7a7a2 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfcmp_clt.c @@ -0,0 +1,476 @@ +/* { 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]) = 0x56411278; + *((int *)&__m128_op0[2]) = 0x43c0d41e; + *((int *)&__m128_op0[1]) = 0x0124d8f6; + *((int *)&__m128_op0[0]) = 0xa494006b; + *((int *)&__m128_op1[3]) = 0x7f800000; + *((int *)&__m128_op1[2]) = 0xff800000; + *((int *)&__m128_op1[1]) = 0xff800000; + *((int *)&__m128_op1[0]) = 0xff800000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_clt_s (__m128_op0, __m128_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x84939413; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0x00000002; + *((int *)&__m128_op0[0]) = 0xbefcb21e; + *((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]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_result[0]) = 0x00000000ffffffff; + __m128i_out = __lsx_vfcmp_clt_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]) = 0xffffffff; + *((int *)&__m128_op1[2]) = 0xffffffff; + *((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_vfcmp_clt_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]) = 0xfffefff6; + *((int *)&__m128_op0[0]) = 0xfff80002; + *((int *)&__m128_op1[3]) = 0x000000c5; + *((int *)&__m128_op1[2]) = 0xac01015b; + *((int *)&__m128_op1[1]) = 0xaaacac88; + *((int *)&__m128_op1[0]) = 0xa3a9a96a; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_clt_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]) = 0xffffffff; + *((int *)&__m128_op1[2]) = 0xffffffff; + *((int *)&__m128_op1[1]) = 0xffffffff; + *((int *)&__m128_op1[0]) = 0xffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_clt_s (__m128_op0, __m128_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; + *((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_vfcmp_clt_s (__m128_op0, __m128_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x11000f20; + *((int *)&__m128_op0[2]) = 0x10000e20; + *((int *)&__m128_op0[1]) = 0x0f000d20; + *((int *)&__m128_op0[0]) = 0x0e000c20; + *((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_vfcmp_clt_s (__m128_op0, __m128_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x00000c00; + *((int *)&__m128_op0[1]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0x00000000; + *((int *)&__m128_op1[3]) = 0x00000000; + *((int *)&__m128_op1[2]) = 0x00bd003d; + *((int *)&__m128_op1[1]) = 0x00000000; + *((int *)&__m128_op1[0]) = 0x00000000; + *((unsigned long *)&__m128i_result[1]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_clt_s (__m128_op0, __m128_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x00000005; + *((int *)&__m128_op0[1]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0x00000005; + *((int *)&__m128_op1[3]) = 0xfffefffe; + *((int *)&__m128_op1[2]) = 0xfffefffe; + *((int *)&__m128_op1[1]) = 0xfffefffe; + *((int *)&__m128_op1[0]) = 0xfffefffe; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_clt_s (__m128_op0, __m128_op1); + 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]) = 0xffffffff; + *((int *)&__m128_op1[3]) = 0x00000000; + *((int *)&__m128_op1[2]) = 0xffffffff; + *((int *)&__m128_op1[1]) = 0x00000000; + *((int *)&__m128_op1[0]) = 0xffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_clt_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]) = 0xff800001; + *((int *)&__m128_op0[0]) = 0x0f800000; + *((int *)&__m128_op1[3]) = 0x00000009; + *((int *)&__m128_op1[2]) = 0x00000009; + *((int *)&__m128_op1[1]) = 0xff80000a; + *((int *)&__m128_op1[0]) = 0x0f800009; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x00000000ffffffff; + __m128i_out = __lsx_vfcmp_clt_s (__m128_op0, __m128_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x0000ffff; + *((int *)&__m128_op0[1]) = 0x3b5eae24; + *((int *)&__m128_op0[0]) = 0xab7e3848; + *((int *)&__m128_op1[3]) = 0x00000000; + *((int *)&__m128_op1[2]) = 0x00000000; + *((int *)&__m128_op1[1]) = 0x00000000; + *((int *)&__m128_op1[0]) = 0x00003f80; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00000000ffffffff; + __m128i_out = __lsx_vfcmp_clt_s (__m128_op0, __m128_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x63636363; + *((int *)&__m128_op0[2]) = 0x3f3e47c1; + *((int *)&__m128_op0[1]) = 0x41f8e080; + *((int *)&__m128_op0[0]) = 0xf1ef4eaa; + *((int *)&__m128_op1[3]) = 0x0000cecd; + *((int *)&__m128_op1[2]) = 0x00004657; + *((int *)&__m128_op1[1]) = 0x0000c900; + *((int *)&__m128_op1[0]) = 0x00011197; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00000000ffffffff; + __m128i_out = __lsx_vfcmp_clt_s (__m128_op0, __m128_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x454c2996; + *((int *)&__m128_op0[2]) = 0x0ffe354e; + *((int *)&__m128_op0[1]) = 0x9e063f80; + *((int *)&__m128_op0[0]) = 0x2742ba3e; + *((int *)&__m128_op1[3]) = 0x00000000; + *((int *)&__m128_op1[2]) = 0x00000000; + *((int *)&__m128_op1[1]) = 0x42652524; + *((int *)&__m128_op1[0]) = 0x00000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xffffffff00000000; + __m128i_out = __lsx_vfcmp_cult_s (__m128_op0, __m128_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00070000; + *((int *)&__m128_op0[2]) = 0x00050000; + *((int *)&__m128_op0[1]) = 0x00030000; + *((int *)&__m128_op0[0]) = 0x00010000; + *((int *)&__m128_op1[3]) = 0x00000000; + *((int *)&__m128_op1[2]) = 0xff81007c; + *((int *)&__m128_op1[1]) = 0xffb7005f; + *((int *)&__m128_op1[0]) = 0x0070007c; + *((unsigned long *)&__m128i_result[1]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_cult_s (__m128_op0, __m128_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x0000006f; + *((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_vfcmp_cult_s (__m128_op0, __m128_op1); + 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; + *((int *)&__m128_op1[3]) = 0xfbffffff; + *((int *)&__m128_op1[2]) = 0xffffffff; + *((int *)&__m128_op1[1]) = 0x7bffffff; + *((int *)&__m128_op1[0]) = 0xffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x00000000ffffffff; + __m128i_out = __lsx_vfcmp_cult_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]) = 0x0002a000; + *((int *)&__m128_op1[3]) = 0x00000000; + *((int *)&__m128_op1[2]) = 0x00000000; + *((int *)&__m128_op1[1]) = 0x00000000; + *((int *)&__m128_op1[0]) = 0x0002a000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_cult_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]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_cult_s (__m128_op0, __m128_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0xffffffff; + *((int *)&__m128_op0[2]) = 0xfc606ec5; + *((int *)&__m128_op0[1]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0x14155445; + *((int *)&__m128_op1[3]) = 0x00000000; + *((int *)&__m128_op1[2]) = 0x00000000; + *((int *)&__m128_op1[1]) = 0x00000000; + *((int *)&__m128_op1[0]) = 0x01030103; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_cult_s (__m128_op0, __m128_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00060fbf; + *((int *)&__m128_op0[2]) = 0x02040fbf; + *((int *)&__m128_op0[1]) = 0x00020fbf; + *((int *)&__m128_op0[0]) = 0x02000fbf; + *((int *)&__m128_op1[3]) = 0x63636363; + *((int *)&__m128_op1[2]) = 0x63636363; + *((int *)&__m128_op1[1]) = 0xffd27db0; + *((int *)&__m128_op1[0]) = 0x10d20fbf; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_cult_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]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_cult_s (__m128_op0, __m128_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x7f800000; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0x00000000; + *((int *)&__m128_op1[3]) = 0x00000008; + *((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_vfcmp_cult_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_vfcmp_cult_s (__m128_op0, __m128_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x000000010000003f; + *((unsigned long *)&__m128d_op1[1]) = 0x7fff7fff7fff7fff; + *((unsigned long *)&__m128d_op1[0]) = 0x000000010000003f; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_clt_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000001; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000003; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000036de0000; + *((unsigned long *)&__m128d_op1[0]) = 0x000000003be14000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_clt_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x1111113111111141; + *((unsigned long *)&__m128d_op0[0]) = 0x1111113111111121; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[0]) = 0x0032000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_clt_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000080000000; + *((unsigned long *)&__m128d_op1[1]) = 0xe93d0bd19ff07013; + *((unsigned long *)&__m128d_op1[0]) = 0x65017c2ac9ca9fd0; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_clt_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]) = 0x007f007f007f007e; + *((unsigned long *)&__m128d_op1[0]) = 0x007f007f007effc6; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_clt_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000015800000000; + *((unsigned long *)&__m128d_op0[0]) = 0x00000000ffff0000; + *((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_vfcmp_clt_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x7fff00007fff0000; + *((unsigned long *)&__m128d_op0[0]) = 0x7fff00007fff0000; + *((unsigned long *)&__m128d_op1[1]) = 0x7fff00007fff0000; + *((unsigned long *)&__m128d_op1[0]) = 0x7fff00007fff0000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_clt_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x7f8100017f810001; + *((unsigned long *)&__m128d_op0[0]) = 0x7f8100017f810001; + *((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_vfcmp_clt_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x004200a000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x004200a000200001; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[0]) = 0x7fff00007fff7fff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_cult_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000001; + *((unsigned long *)&__m128d_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128d_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_cult_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]) = 0xff00ff00ff00ff00; + *((unsigned long *)&__m128d_op1[0]) = 0xff00ff00ff00ff00; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_cult_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000100000001; + *((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_vfcmp_cult_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x000000000000001e; + *((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_vfcmp_cult_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000455555555; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000001580000; + *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_cult_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]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_cult_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000002000000020; + *((unsigned long *)&__m128d_op0[0]) = 0x0000001f0000001f; + *((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_vfcmp_cult_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-vfcmp_cne.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfcmp_cne.c new file mode 100644 index 00000000000..c3da43bb499 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfcmp_cne.c @@ -0,0 +1,378 @@ +/* { 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; + *((int *)&__m128_op1[3]) = 0xffffffff; + *((int *)&__m128_op1[2]) = 0xffffffff; + *((int *)&__m128_op1[1]) = 0x7ff80000; + *((int *)&__m128_op1[0]) = 0x00000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_cne_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]) = 0x0bd80bd8; + *((int *)&__m128_op1[2]) = 0x0bdfffff; + *((int *)&__m128_op1[1]) = 0x0bd80bd8; + *((int *)&__m128_op1[0]) = 0x0bd80000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_cne_s (__m128_op0, __m128_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00ff0077; + *((int *)&__m128_op0[2]) = 0x00070077; + *((int *)&__m128_op0[1]) = 0x00e600ef; + *((int *)&__m128_op0[0]) = 0x00ee01de; + *((int *)&__m128_op1[3]) = 0x00000000; + *((int *)&__m128_op1[2]) = 0x00000000; + *((int *)&__m128_op1[1]) = 0x00000000; + *((int *)&__m128_op1[0]) = 0x00007fff; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_cne_s (__m128_op0, __m128_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00100010; + *((int *)&__m128_op0[2]) = 0x00100010; + *((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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_cne_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]) = 0x000000ff; + *((int *)&__m128_op1[0]) = 0xfe01fd02; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_cne_s (__m128_op0, __m128_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0xbf800000; + *((int *)&__m128_op0[2]) = 0x0000ffff; + *((int *)&__m128_op0[1]) = 0xcf000000; + *((int *)&__m128_op0[0]) = 0x00000000; + *((int *)&__m128_op1[3]) = 0x003f0000; + *((int *)&__m128_op1[2]) = 0x0000003f; + *((int *)&__m128_op1[1]) = 0x003f0000; + *((int *)&__m128_op1[0]) = 0x00000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffff00000000; + __m128i_out = __lsx_vfcmp_cune_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_vfcmp_cune_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_vfcmp_cune_s (__m128_op0, __m128_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x01ff01ff; + *((int *)&__m128_op0[2]) = 0x01ff01ff; + *((int *)&__m128_op0[1]) = 0x01ff01ff; + *((int *)&__m128_op0[0]) = 0x01ff01ff; + *((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]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_cune_s (__m128_op0, __m128_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x20202020; + *((int *)&__m128_op0[2]) = 0x20202020; + *((int *)&__m128_op0[1]) = 0x20202020; + *((int *)&__m128_op0[0]) = 0x20207fff; + *((int *)&__m128_op1[3]) = 0x32d3f35e; + *((int *)&__m128_op1[2]) = 0xcd509d13; + *((int *)&__m128_op1[1]) = 0x3e081b3c; + *((int *)&__m128_op1[0]) = 0x93f6b356; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_cune_s (__m128_op0, __m128_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0xffff0000; + *((int *)&__m128_op0[2]) = 0xffff0000; + *((int *)&__m128_op0[1]) = 0x40408010; + *((int *)&__m128_op0[0]) = 0x80200110; + *((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]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_cune_s (__m128_op0, __m128_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x80000000; + *((int *)&__m128_op0[2]) = 0x80000008; + *((int *)&__m128_op0[1]) = 0xa2f54a1e; + *((int *)&__m128_op0[0]) = 0xa2f54a1e; + *((int *)&__m128_op1[3]) = 0x80000000; + *((int *)&__m128_op1[2]) = 0x80000008; + *((int *)&__m128_op1[1]) = 0xa2f54a1e; + *((int *)&__m128_op1[0]) = 0xa2f54a1e; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_cune_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_vfcmp_cune_s (__m128_op0, __m128_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x000000000000fc00; + *((unsigned long *)&__m128d_op0[0]) = 0x000000000000fc00; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000001; + *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000001; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_cne_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0001000100000004; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_cne_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000020302030; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000020302030; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000000100010; + *((unsigned long *)&__m128d_op1[0]) = 0x0000000000100010; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_cne_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_vfcmp_cne_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]) = 0x5d7f5d007f6a007f; + *((unsigned long *)&__m128d_op1[0]) = 0x7fff7fff7fff7f00; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_cne_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]) = 0x7ff000ff6220c0c1; + *((unsigned long *)&__m128d_op1[0]) = 0xffe8081000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_cne_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_vfcmp_cne_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x8000000000000000; + *((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_vfcmp_cne_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]) = 0x0000ffff0000ffff; + *((unsigned long *)&__m128d_op1[0]) = 0x0001fffe0001fffe; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_cne_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x1c083b1f3b1f3b1f; + *((unsigned long *)&__m128d_op0[0]) = 0xf244b948a323ab42; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[0]) = 0x000000000000ffff; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_cne_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x00ff00ff00ff00ff; + *((unsigned long *)&__m128d_op0[0]) = 0x00ff00ff00ff00ff; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_cune_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_vfcmp_cune_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x000100fe000070a1; + *((unsigned long *)&__m128d_op0[0]) = 0x00000115ffffffa1; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_cune_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0xfffffffff8f8da00; + *((unsigned long *)&__m128d_op0[0]) = 0xffffffff01018888; + *((unsigned long *)&__m128d_op1[1]) = 0x000000003ea5016c; + *((unsigned long *)&__m128d_op1[0]) = 0xfffefefd3f7027c5; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_cune_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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128d_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_cune_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0xffff0000ffff0000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128d_op1[0]) = 0xffff0000ffff0000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_cune_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x000000000000ffce; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[0]) = 0x80808080806b000b; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_cune_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_vfcmp_cune_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_vfcmp_cune_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x400000003fffffff; + *((unsigned long *)&__m128d_op0[0]) = 0x4000000040000000; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_cune_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000014eb54ab; + *((unsigned long *)&__m128d_op0[0]) = 0x14eb6a002a406a00; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[0]) = 0x00007fff7fff8000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_cune_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-vfcmp_cor.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfcmp_cor.c new file mode 100644 index 00000000000..5228dbede13 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfcmp_cor.c @@ -0,0 +1,170 @@ +/* { 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; + *((int *)&__m128_op1[3]) = 0x00000000; + *((int *)&__m128_op1[2]) = 0x00000000; + *((int *)&__m128_op1[1]) = 0xffffffff; + *((int *)&__m128_op1[0]) = 0x00000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x00000000ffffffff; + __m128i_out = __lsx_vfcmp_cor_s (__m128_op0, __m128_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0xfffffeff; + *((int *)&__m128_op0[2]) = 0xfffffeff; + *((int *)&__m128_op0[1]) = 0xffffffff; + *((int *)&__m128_op0[0]) = 0xfffffcff; + *((int *)&__m128_op1[3]) = 0xffffffff; + *((int *)&__m128_op1[2]) = 0xffffffff; + *((int *)&__m128_op1[1]) = 0xffffffff; + *((int *)&__m128_op1[0]) = 0xffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_cor_s (__m128_op0, __m128_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00800000; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0xf4b6f3f5; + *((int *)&__m128_op0[0]) = 0x2f4ef4a8; + *((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]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_cor_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]) = 0x08080808; + *((int *)&__m128_op1[2]) = 0x08080808; + *((int *)&__m128_op1[1]) = 0x08080808; + *((int *)&__m128_op1[0]) = 0x08080808; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_cor_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]) = 0x0000ffce; + *((int *)&__m128_op1[3]) = 0xffff0001; + *((int *)&__m128_op1[2]) = 0x1cf0c569; + *((int *)&__m128_op1[1]) = 0xc0000002; + *((int *)&__m128_op1[0]) = 0xb0995850; + *((unsigned long *)&__m128i_result[1]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_cor_s (__m128_op0, __m128_op1); + 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]) = 0x950fa306; + *((int *)&__m128_op1[3]) = 0x00000000; + *((int *)&__m128_op1[2]) = 0x0a752a55; + *((int *)&__m128_op1[1]) = 0x0a753500; + *((int *)&__m128_op1[0]) = 0x950fa306; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_cor_s (__m128_op0, __m128_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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_cor_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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_cor_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x3f8000003f800000; + *((unsigned long *)&__m128d_op0[0]) = 0x3f8000003f800000; + *((unsigned long *)&__m128d_op1[1]) = 0x3f8000003f800000; + *((unsigned long *)&__m128d_op1[0]) = 0x3f8000003f800000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_cor_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000003; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_cor_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000ffffffffffff; + *((unsigned long *)&__m128d_op0[0]) = 0x0000ffffffdfffdf; + *((unsigned long *)&__m128d_op1[1]) = 0x0000ffffffffffff; + *((unsigned long *)&__m128d_op1[0]) = 0x0000ffffffdfffdf; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_cor_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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_cor_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0xd70b30c96ea9f4e8; + *((unsigned long *)&__m128d_op0[0]) = 0xa352bfac9269e0aa; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_cor_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]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000005; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_cor_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-vfcmp_cun.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfcmp_cun.c new file mode 100644 index 00000000000..a2beff53fb4 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfcmp_cun.c @@ -0,0 +1,253 @@ +/* { 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]) = 0x0000ffff; + *((int *)&__m128_op0[2]) = 0x0000ffff; + *((int *)&__m128_op0[1]) = 0x0000ffff; + *((int *)&__m128_op0[0]) = 0x0000fffe; + *((int *)&__m128_op1[3]) = 0x0000ffff; + *((int *)&__m128_op1[2]) = 0x0000ffff; + *((int *)&__m128_op1[1]) = 0x0000ffff; + *((int *)&__m128_op1[0]) = 0x0000fffe; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_cun_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]) = 0x00200010; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_cun_s (__m128_op0, __m128_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x7f800000; + *((int *)&__m128_op0[2]) = 0x7f800000; + *((int *)&__m128_op0[1]) = 0x7f800000; + *((int *)&__m128_op0[0]) = 0x7f800000; + *((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_vfcmp_cun_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]) = 0x0000fffe; + *((int *)&__m128_op0[0]) = 0x0000ffff; + *((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_vfcmp_cun_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]) = 0xffff0008; + *((int *)&__m128_op1[3]) = 0xffc2ffe0; + *((int *)&__m128_op1[2]) = 0x00000000; + *((int *)&__m128_op1[1]) = 0x0000ffc1; + *((int *)&__m128_op1[0]) = 0x00010001; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_cun_s (__m128_op0, __m128_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x00000008; + *((int *)&__m128_op0[1]) = 0x00200020; + *((int *)&__m128_op0[0]) = 0x00200020; + *((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_vfcmp_cun_s (__m128_op0, __m128_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0xfffefffe; + *((int *)&__m128_op0[2]) = 0xfffefffe; + *((int *)&__m128_op0[1]) = 0xfffefffe; + *((int *)&__m128_op0[0]) = 0xfffefffe; + *((int *)&__m128_op1[3]) = 0x00000000; + *((int *)&__m128_op1[2]) = 0x00000000; + *((int *)&__m128_op1[1]) = 0xf001f001; + *((int *)&__m128_op1[0]) = 0x0101f002; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_cun_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]) = 0xffffffff; + *((int *)&__m128_op1[2]) = 0xffffffff; + *((int *)&__m128_op1[1]) = 0xffffffff; + *((int *)&__m128_op1[0]) = 0xffffffff; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_cun_s (__m128_op0, __m128_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0xfeffffff; + *((int *)&__m128_op0[2]) = 0xffffffff; + *((int *)&__m128_op0[1]) = 0xfeffffff; + *((int *)&__m128_op0[0]) = 0xffffffff; + *((int *)&__m128_op1[3]) = 0x00000fff; + *((int *)&__m128_op1[2]) = 0xffffe000; + *((int *)&__m128_op1[1]) = 0x00001020; + *((int *)&__m128_op1[0]) = 0x20204000; + *((unsigned long *)&__m128i_result[1]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x00000000ffffffff; + __m128i_out = __lsx_vfcmp_cun_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]) = 0xffffffff; + *((int *)&__m128_op1[2]) = 0xffffffff; + *((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_vfcmp_cun_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_vfcmp_cun_s (__m128_op0, __m128_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0xfefd7f7f7f7f7f7e; + *((unsigned long *)&__m128d_op0[0]) = 0xdffdbffeba6f5543; + *((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_vfcmp_cun_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0xffff3d06ffff4506; + *((unsigned long *)&__m128d_op0[0]) = 0x7ffffffe7ffff800; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_cun_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]) = 0x000000003bfb4000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_cun_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_vfcmp_cun_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]) = 0xffff0000ffff0000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_cun_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]) = 0x0000000100010100; + *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_cun_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0xffff00011cf0c569; + *((unsigned long *)&__m128d_op0[0]) = 0xc0000002b0995850; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[0]) = 0x80808080806b000b; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_cun_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_vfcmp_cun_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]) = 0x8080808080808080; + *((unsigned long *)&__m128d_op1[0]) = 0x8080808080808080; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_cun_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x00000000084d12ce; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000024170000; + *((unsigned long *)&__m128d_op1[1]) = 0x00000000084d12ce; + *((unsigned long *)&__m128d_op1[0]) = 0x0000000044470000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_cun_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-vfcmp_saf.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfcmp_saf.c new file mode 100644 index 00000000000..bfa4914bee6 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfcmp_saf.c @@ -0,0 +1,214 @@ +/* { 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]) = 0xffffffff; + *((int *)&__m128_op0[2]) = 0x80000000; + *((int *)&__m128_op0[1]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0x00000000; + *((int *)&__m128_op1[3]) = 0x00a300a3; + *((int *)&__m128_op1[2]) = 0x00a300a3; + *((int *)&__m128_op1[1]) = 0x00a300a3; + *((int *)&__m128_op1[0]) = 0x00a300a3; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_saf_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]) = 0xffffffff; + *((int *)&__m128_op1[2]) = 0xffffffff; + *((int *)&__m128_op1[1]) = 0xffffffff; + *((int *)&__m128_op1[0]) = 0xffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_saf_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]) = 0xb8ec43be; + *((int *)&__m128_op1[2]) = 0xfe38e64b; + *((int *)&__m128_op1[1]) = 0x6477d042; + *((int *)&__m128_op1[0]) = 0x343cce24; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_saf_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_vfcmp_saf_s (__m128_op0, __m128_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00000010; + *((int *)&__m128_op0[2]) = 0x00100010; + *((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_vfcmp_saf_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]) = 0x00020000; + *((int *)&__m128_op0[0]) = 0xffff0001; + *((int *)&__m128_op1[3]) = 0x63636363; + *((int *)&__m128_op1[2]) = 0x63636363; + *((int *)&__m128_op1[1]) = 0x63636363; + *((int *)&__m128_op1[0]) = 0x63636363; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_saf_s (__m128_op0, __m128_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x03080401; + *((int *)&__m128_op0[2]) = 0x0d090107; + *((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_vfcmp_saf_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_vfcmp_saf_s (__m128_op0, __m128_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x7ff8000000000000; + *((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_vfcmp_saf_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]) = 0x0a0a0a000a0a0a00; + *((unsigned long *)&__m128d_op1[0]) = 0x0a0a0a0009090900; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_saf_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x00000000ffffff01; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[0]) = 0x00000000000000ff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_saf_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]) = 0x80808080806b000b; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_saf_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_vfcmp_saf_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_vfcmp_saf_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]) = 0x000000007ff000ff; + *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_saf_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[1]) = 0x67157b5100005000; + *((unsigned long *)&__m128d_op1[0]) = 0x387c7e0a133f2000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_saf_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0xf359f359f359f359; + *((unsigned long *)&__m128d_op0[0]) = 0xf359f359f359f359; + *((unsigned long *)&__m128d_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128d_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_saf_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]) = 0x0177fff0fffffff0; + *((unsigned long *)&__m128d_op1[0]) = 0x00000000011ff8bc; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_saf_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-vfcmp_seq.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfcmp_seq.c new file mode 100644 index 00000000000..bc573936dc5 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfcmp_seq.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; + + *((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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_seq_s (__m128_op0, __m128_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0xf2f2e5e5; + *((int *)&__m128_op0[2]) = 0xe5e5e5e5; + *((int *)&__m128_op0[1]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0x00000000; + *((int *)&__m128_op1[3]) = 0xe5e5e5e5; + *((int *)&__m128_op1[2]) = 0xe5e5e5e5; + *((int *)&__m128_op1[1]) = 0xe5e5e5e5; + *((int *)&__m128_op1[0]) = 0xe4e4e46d; + *((unsigned long *)&__m128i_result[1]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_seq_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]) = 0x00800000; + *((int *)&__m128_op1[1]) = 0x00000000; + *((int *)&__m128_op1[0]) = 0x1f400000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_seq_s (__m128_op0, __m128_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x14ccc632; + *((int *)&__m128_op0[2]) = 0x0076a4d2; + *((int *)&__m128_op0[1]) = 0x685670d2; + *((int *)&__m128_op0[0]) = 0x7e00682a; + *((int *)&__m128_op1[3]) = 0x14ccc632; + *((int *)&__m128_op1[2]) = 0x0076a4d2; + *((int *)&__m128_op1[1]) = 0x685670d2; + *((int *)&__m128_op1[0]) = 0x7e00682a; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_seq_s (__m128_op0, __m128_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; + *((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_vfcmp_seq_s (__m128_op0, __m128_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0xc6c6c6c6; + *((int *)&__m128_op0[1]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0xc6c6c6c6; + *((int *)&__m128_op1[3]) = 0x00000000; + *((int *)&__m128_op1[2]) = 0xc6c6c6c6; + *((int *)&__m128_op1[1]) = 0x00000000; + *((int *)&__m128_op1[0]) = 0xc6c6c6c6; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_seq_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]) = 0x00000006; + *((int *)&__m128_op1[2]) = 0x00007fff; + *((int *)&__m128_op1[1]) = 0x00000008; + *((int *)&__m128_op1[0]) = 0xffffa209; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_seq_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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_seq_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]) = 0x00000001; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffff00000000; + __m128i_out = __lsx_vfcmp_sueq_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]) = 0x00fc0000; + *((int *)&__m128_op1[3]) = 0xfe07e5fe; + *((int *)&__m128_op1[2]) = 0xfefdddfe; + *((int *)&__m128_op1[1]) = 0x00020100; + *((int *)&__m128_op1[0]) = 0xfedd0c00; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_sueq_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]) = 0xffffffff; + *((int *)&__m128_op1[2]) = 0xffff0000; + *((int *)&__m128_op1[1]) = 0xffffffff; + *((int *)&__m128_op1[0]) = 0xffffffff; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_sueq_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]) = 0x0000fffd; + *((int *)&__m128_op1[3]) = 0x7fffffff; + *((int *)&__m128_op1[2]) = 0xffffffff; + *((int *)&__m128_op1[1]) = 0x00000000; + *((int *)&__m128_op1[0]) = 0x00000001; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffff00000000; + __m128i_out = __lsx_vfcmp_sueq_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]) = 0x00008000; + *((int *)&__m128_op1[2]) = 0x3f80ffff; + *((int *)&__m128_op1[1]) = 0x00000000; + *((int *)&__m128_op1[0]) = 0x00000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_sueq_s (__m128_op0, __m128_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x370bdfec; + *((int *)&__m128_op0[2]) = 0xffecffec; + *((int *)&__m128_op0[1]) = 0x370bdfec; + *((int *)&__m128_op0[0]) = 0xa2eb9931; + *((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]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_sueq_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]) = 0x00000040; + *((int *)&__m128_op1[1]) = 0x00000000; + *((int *)&__m128_op1[0]) = 0x00000040; + *((unsigned long *)&__m128i_result[1]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_result[0]) = 0xffffffff00000000; + __m128i_out = __lsx_vfcmp_sueq_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]) = 0xc2fc0000; + *((int *)&__m128_op1[2]) = 0xc3040000; + *((int *)&__m128_op1[1]) = 0xc2fc0000; + *((int *)&__m128_op1[0]) = 0xc3040000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_sueq_s (__m128_op0, __m128_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00fe00fe; + *((int *)&__m128_op0[2]) = 0x000200fe; + *((int *)&__m128_op0[1]) = 0x00fe00fe; + *((int *)&__m128_op0[0]) = 0x000200fe; + *((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_vfcmp_sueq_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]) = 0x00000004; + *((int *)&__m128_op1[0]) = 0x55555555; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_sueq_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]) = 0x00000158; + *((int *)&__m128_op1[3]) = 0x00000000; + *((int *)&__m128_op1[2]) = 0x00000000; + *((int *)&__m128_op1[1]) = 0xffffffa8; + *((int *)&__m128_op1[0]) = 0x00000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffff00000000; + __m128i_out = __lsx_vfcmp_sueq_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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_sueq_s (__m128_op0, __m128_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0xf3e6586b; + *((int *)&__m128_op0[2]) = 0x60d7b152; + *((int *)&__m128_op0[1]) = 0xf7077b93; + *((int *)&__m128_op0[0]) = 0x4ac0e000; + *((int *)&__m128_op1[3]) = 0x1498507a; + *((int *)&__m128_op1[2]) = 0x144d0050; + *((int *)&__m128_op1[1]) = 0x7b370981; + *((int *)&__m128_op1[0]) = 0xc01200e0; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_sueq_s (__m128_op0, __m128_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0xffc2007a; + *((int *)&__m128_op0[2]) = 0xff230027; + *((int *)&__m128_op0[1]) = 0x0080005e; + *((int *)&__m128_op0[0]) = 0xff600001; + *((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]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_sueq_s (__m128_op0, __m128_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x000100010001fffd; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_seq_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]) = 0x000000004fc04f81; + *((unsigned long *)&__m128d_op1[0]) = 0x000000004fc04f80; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_seq_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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_seq_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]) = 0x13f9c5b60028a415; + *((unsigned long *)&__m128d_op1[0]) = 0x545cab1d81a83bea; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_seq_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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_seq_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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_sueq_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0xfefd7f7f7f7f7f7e; + *((unsigned long *)&__m128d_op0[0]) = 0xdffdbffeba6f5543; + *((unsigned long *)&__m128d_op1[1]) = 0xfefd7f7f7f7f7f7e; + *((unsigned long *)&__m128d_op1[0]) = 0xdffdbffeba6f5543; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_sueq_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128d_op0[0]) = 0xfffffff700000009; + *((unsigned long *)&__m128d_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128d_op1[0]) = 0xfffffff700000009; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_sueq_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x7f8000007f800000; + *((unsigned long *)&__m128d_op0[0]) = 0x4fa432d67fc00000; + *((unsigned long *)&__m128d_op1[1]) = 0x0141010101410101; + *((unsigned long *)&__m128d_op1[0]) = 0x0141010101410101; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_sueq_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0xfffcffff00000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000fffd000a0000; + *((unsigned long *)&__m128d_op1[1]) = 0xf0fd800080000000; + *((unsigned long *)&__m128d_op1[0]) = 0x0000a00028004000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_sueq_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x00820082ff81ff81; + *((unsigned long *)&__m128d_op0[0]) = 0xff81ff81ff81ff81; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000100000001; + *((unsigned long *)&__m128d_op1[0]) = 0x0000000100000001; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_sueq_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000001000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000120002000; + *((unsigned long *)&__m128d_op1[0]) = 0x0000000100013fa0; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_sueq_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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_sueq_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0007000100040102; + *((unsigned long *)&__m128d_op0[0]) = 0x0003000100010101; + *((unsigned long *)&__m128d_op1[1]) = 0x0007000100040102; + *((unsigned long *)&__m128d_op1[0]) = 0x0003000100010101; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_sueq_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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_sueq_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128d_op0[0]) = 0x9c9c9c9c9c9c9c9c; + *((unsigned long *)&__m128d_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128d_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_sueq_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-vfcmp_sle.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfcmp_sle.c new file mode 100644 index 00000000000..87cb8da7ca6 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfcmp_sle.c @@ -0,0 +1,407 @@ +/* { 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; + *((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]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_sle_s (__m128_op0, __m128_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0xffffffff; + *((int *)&__m128_op0[2]) = 0xffffdfff; + *((int *)&__m128_op0[1]) = 0xffffffff; + *((int *)&__m128_op0[0]) = 0xffffdfff; + *((int *)&__m128_op1[3]) = 0xffffffff; + *((int *)&__m128_op1[2]) = 0xffffffff; + *((int *)&__m128_op1[1]) = 0xffffe000; + *((int *)&__m128_op1[0]) = 0x01ffe200; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_sle_s (__m128_op0, __m128_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00010002; + *((int *)&__m128_op0[2]) = 0x0000fe7d; + *((int *)&__m128_op0[1]) = 0x00010002; + *((int *)&__m128_op0[0]) = 0x0000fe02; + *((int *)&__m128_op1[3]) = 0x00000000; + *((int *)&__m128_op1[2]) = 0x0000007b; + *((int *)&__m128_op1[1]) = 0x00000000; + *((int *)&__m128_op1[0]) = 0x00000001; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_sle_s (__m128_op0, __m128_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x1223dabf; + *((int *)&__m128_op0[2]) = 0x4c3b3549; + *((int *)&__m128_op0[1]) = 0x8e8f8626; + *((int *)&__m128_op0[0]) = 0xf15be124; + *((int *)&__m128_op1[3]) = 0xfffffacd; + *((int *)&__m128_op1[2]) = 0xb6dbecac; + *((int *)&__m128_op1[1]) = 0x1f5533a6; + *((int *)&__m128_op1[0]) = 0x94f902c0; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_sle_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]) = 0xfbffffff; + *((int *)&__m128_op0[0]) = 0x27001517; + *((int *)&__m128_op1[3]) = 0x00000000; + *((int *)&__m128_op1[2]) = 0x00000000; + *((int *)&__m128_op1[1]) = 0x0000ffff; + *((int *)&__m128_op1[0]) = 0x00000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffff00000000; + __m128i_out = __lsx_vfcmp_sle_s (__m128_op0, __m128_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0xffff53d9; + *((int *)&__m128_op0[1]) = 0xffff0001; + *((int *)&__m128_op0[0]) = 0xffff9515; + *((int *)&__m128_op1[3]) = 0xffffffff; + *((int *)&__m128_op1[2]) = 0xffffffff; + *((int *)&__m128_op1[1]) = 0xffffffff; + *((int *)&__m128_op1[0]) = 0xffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_sle_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]) = 0xffffffff; + *((int *)&__m128_op1[2]) = 0xffffffff; + *((int *)&__m128_op1[1]) = 0xffffffff; + *((int *)&__m128_op1[0]) = 0xffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_sle_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]) = 0x00010001; + *((int *)&__m128_op1[2]) = 0x00010001; + *((int *)&__m128_op1[1]) = 0x00010001; + *((int *)&__m128_op1[0]) = 0x00010001; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_sle_s (__m128_op0, __m128_op1); + 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; + *((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]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_sle_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]) = 0x00df020f; + *((int *)&__m128_op0[0]) = 0x0078007f; + *((int *)&__m128_op1[3]) = 0x0037ffd4; + *((int *)&__m128_op1[2]) = 0x0083ffe5; + *((int *)&__m128_op1[1]) = 0x001e0052; + *((int *)&__m128_op1[0]) = 0x001ffff9; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_sle_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]) = 0x00ff00ff; + *((int *)&__m128_op0[0]) = 0x00ff00ff; + *((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_vfcmp_sule_s (__m128_op0, __m128_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x05452505; + *((int *)&__m128_op0[1]) = 0x00000004; + *((int *)&__m128_op0[0]) = 0x442403e4; + *((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]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_sule_s (__m128_op0, __m128_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00000101; + *((int *)&__m128_op0[2]) = 0x00000101; + *((int *)&__m128_op0[1]) = 0x00000101; + *((int *)&__m128_op0[0]) = 0x00000101; + *((int *)&__m128_op1[3]) = 0x00000002; + *((int *)&__m128_op1[2]) = 0x00000002; + *((int *)&__m128_op1[1]) = 0x00000002; + *((int *)&__m128_op1[0]) = 0x00000002; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_sule_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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_sule_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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_sule_s (__m128_op0, __m128_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00010000; + *((int *)&__m128_op0[2]) = 0x00010000; + *((int *)&__m128_op0[1]) = 0x0000cd63; + *((int *)&__m128_op0[0]) = 0x0000cd63; + *((int *)&__m128_op1[3]) = 0xffffcd63; + *((int *)&__m128_op1[2]) = 0xffffcd63; + *((int *)&__m128_op1[1]) = 0xffffd765; + *((int *)&__m128_op1[0]) = 0xffffd765; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_sule_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]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_sule_s (__m128_op0, __m128_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0xffffffff; + *((int *)&__m128_op0[2]) = 0xffff00ff; + *((int *)&__m128_op0[1]) = 0xffffffff; + *((int *)&__m128_op0[0]) = 0xffffffff; + *((int *)&__m128_op1[3]) = 0xffffffff; + *((int *)&__m128_op1[2]) = 0xffff0000; + *((int *)&__m128_op1[1]) = 0xffffffff; + *((int *)&__m128_op1[0]) = 0x0000ffff; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_sule_s (__m128_op0, __m128_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0xffffff0c8000c212; + *((unsigned long *)&__m128d_op0[0]) = 0xfefffeff7f002d06; + *((unsigned long *)&__m128d_op1[1]) = 0x00000001fffffffe; + *((unsigned long *)&__m128d_op1[0]) = 0x00000001fffffffe; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_sle_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x00000001fffffffe; + *((unsigned long *)&__m128d_op0[0]) = 0x00000001fffffffe; + *((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_vfcmp_sle_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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_sle_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x00f0008100800080; + *((unsigned long *)&__m128d_op0[0]) = 0x00f000807000009e; + *((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_vfcmp_sle_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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_sle_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[1]) = 0xffff0000ffff0000; + *((unsigned long *)&__m128d_op1[0]) = 0xfffe00029f9f6061; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_sle_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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_sle_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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_sle_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]) = 0xffffffffc0800000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_sle_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]) = 0x0000c0010000a186; + *((unsigned long *)&__m128d_op1[0]) = 0x00067fff0002a207; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_sle_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0xffffffff80000001; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[1]) = 0x7fffffff7fffffff; + *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_sule_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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_sule_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x3fbf3fbf00007fff; + *((unsigned long *)&__m128d_op1[1]) = 0x000000003fbf3fbf; + *((unsigned long *)&__m128d_op1[0]) = 0x7fff7fff7fff7ff8; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_sule_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]) = 0x00000000013ec13e; + *((unsigned long *)&__m128d_op1[0]) = 0xc03fc03fc0ff00ff; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_sule_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0xffffffff00018d8b; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_sule_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]) = 0x67eb85af0000b000; + *((unsigned long *)&__m128d_op1[0]) = 0xc8847ef6ed3f2000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_sule_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]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_sule_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-vfcmp_slt.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfcmp_slt.c new file mode 100644 index 00000000000..3845e8ec359 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfcmp_slt.c @@ -0,0 +1,512 @@ +/* { 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; + *((int *)&__m128_op1[3]) = 0x0000ffff; + *((int *)&__m128_op1[2]) = 0x00000000; + *((int *)&__m128_op1[1]) = 0x0000ffff; + *((int *)&__m128_op1[0]) = 0x0000ffff; + *((unsigned long *)&__m128i_result[1]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_slt_s (__m128_op0, __m128_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x7f800000; + *((int *)&__m128_op0[2]) = 0x7f800000; + *((int *)&__m128_op0[1]) = 0x7f800000; + *((int *)&__m128_op0[0]) = 0x7f800000; + *((int *)&__m128_op1[3]) = 0x7f800000; + *((int *)&__m128_op1[2]) = 0x7f800000; + *((int *)&__m128_op1[1]) = 0x7f800000; + *((int *)&__m128_op1[0]) = 0x7f800000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_slt_s (__m128_op0, __m128_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00000001; + *((int *)&__m128_op0[2]) = 0x00007f01; + *((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_vfcmp_slt_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]) = 0xffffff02; + *((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_vfcmp_slt_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]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0x00000000; + *((int *)&__m128_op1[3]) = 0x00000000; + *((int *)&__m128_op1[2]) = 0x05452505; + *((int *)&__m128_op1[1]) = 0x00000004; + *((int *)&__m128_op1[0]) = 0x442403e4; + *((unsigned long *)&__m128i_result[1]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_slt_s (__m128_op0, __m128_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x5f675e96; + *((int *)&__m128_op0[2]) = 0xe29a5a60; + *((int *)&__m128_op0[1]) = 0x7fff7fff; + *((int *)&__m128_op0[0]) = 0x7fff7fff; + *((int *)&__m128_op1[3]) = 0x00000000; + *((int *)&__m128_op1[2]) = 0x00000000; + *((int *)&__m128_op1[1]) = 0x5e695e95; + *((int *)&__m128_op1[0]) = 0xe1cb5a01; + *((unsigned long *)&__m128i_result[1]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_slt_s (__m128_op0, __m128_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00800080; + *((int *)&__m128_op0[2]) = 0x00800080; + *((int *)&__m128_op0[1]) = 0x0080006b; + *((int *)&__m128_op0[0]) = 0x0000000b; + *((int *)&__m128_op1[3]) = 0x00000000; + *((int *)&__m128_op1[2]) = 0x00000000; + *((int *)&__m128_op1[1]) = 0x80808080; + *((int *)&__m128_op1[0]) = 0x806b000b; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_slt_s (__m128_op0, __m128_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x7f800000; + *((int *)&__m128_op0[2]) = 0x7f800000; + *((int *)&__m128_op0[1]) = 0x7f800000; + *((int *)&__m128_op0[0]) = 0x7f800000; + *((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_vfcmp_slt_s (__m128_op0, __m128_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0xff800000; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0xff800000; + *((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]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_result[0]) = 0xffffffff00000000; + __m128i_out = __lsx_vfcmp_slt_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]) = 0x00000000; + *((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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_slt_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]) = 0xffffffff; + *((int *)&__m128_op1[2]) = 0xffffffff; + *((int *)&__m128_op1[1]) = 0xffffffff; + *((int *)&__m128_op1[0]) = 0xffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_slt_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]) = 0xfffefffe; + *((int *)&__m128_op0[0]) = 0xfffffffc; + *((int *)&__m128_op1[3]) = 0x00000000; + *((int *)&__m128_op1[2]) = 0x00000000; + *((int *)&__m128_op1[1]) = 0xfffefffe; + *((int *)&__m128_op1[0]) = 0xfffffffc; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_sult_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_vfcmp_sult_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_vfcmp_sult_s (__m128_op0, __m128_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0xffc2ffe7; + *((int *)&__m128_op0[2]) = 0x00000007; + *((int *)&__m128_op0[1]) = 0x0000ffc1; + *((int *)&__m128_op0[0]) = 0x00010001; + *((int *)&__m128_op1[3]) = 0x00000000; + *((int *)&__m128_op1[2]) = 0xffffffff; + *((int *)&__m128_op1[1]) = 0x00000000; + *((int *)&__m128_op1[0]) = 0xfffff1a0; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x00000000ffffffff; + __m128i_out = __lsx_vfcmp_sult_s (__m128_op0, __m128_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x153e3e49; + *((int *)&__m128_op0[2]) = 0x307d0771; + *((int *)&__m128_op0[1]) = 0x0d8e3670; + *((int *)&__m128_op0[0]) = 0x6ac02b9b; + *((int *)&__m128_op1[3]) = 0x55aa55c3; + *((int *)&__m128_op1[2]) = 0xd5aa55c4; + *((int *)&__m128_op1[1]) = 0xaa55556f; + *((int *)&__m128_op1[0]) = 0xd5aaaac1; + *((unsigned long *)&__m128i_result[1]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_sult_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_vfcmp_sult_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]) = 0xffffffff; + *((int *)&__m128_op0[0]) = 0x0015172b; + *((int *)&__m128_op1[3]) = 0xffffffff; + *((int *)&__m128_op1[2]) = 0xfffffffe; + *((int *)&__m128_op1[1]) = 0xffffffff; + *((int *)&__m128_op1[0]) = 0xfffffffe; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_sult_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_vfcmp_sult_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_vfcmp_sult_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]) = 0xffff0000; + *((int *)&__m128_op1[0]) = 0xffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_sult_s (__m128_op0, __m128_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; + *((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_vfcmp_sult_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]) = 0xffffffff; + *((int *)&__m128_op1[2]) = 0x00000000; + *((int *)&__m128_op1[1]) = 0xffffffff; + *((int *)&__m128_op1[0]) = 0x00000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_sult_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]) = 0x86dd8341; + *((int *)&__m128_op1[2]) = 0xb164f12b; + *((int *)&__m128_op1[1]) = 0x9611c398; + *((int *)&__m128_op1[0]) = 0x5b3159f5; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00000000ffffffff; + __m128i_out = __lsx_vfcmp_sult_s (__m128_op0, __m128_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x000000000000001f; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000200000002; + *((unsigned long *)&__m128d_op1[0]) = 0x0000000300000003; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_slt_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_vfcmp_slt_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0xe93d0bd19ff07013; + *((unsigned long *)&__m128d_op0[0]) = 0x65017c2ac9ca9fd0; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_slt_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x00d3012acc56f9bb; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000001021; + *((unsigned long *)&__m128d_op1[1]) = 0xffffffffffffb4ff; + *((unsigned long *)&__m128d_op1[0]) = 0xffffffffffffb4ff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_slt_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x14ccc6320176a4d2; + *((unsigned long *)&__m128d_op0[0]) = 0x685670d37e80682a; + *((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_vfcmp_slt_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]) = 0x003fffff00000000; + *((unsigned long *)&__m128d_op1[0]) = 0x003fffff00000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_slt_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]) = 0x0000001000000010; + *((unsigned long *)&__m128d_op1[0]) = 0x0000001000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_slt_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[1]) = 0x0080000000800000; + *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_slt_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_vfcmp_slt_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x345002920f3017d6; + *((unsigned long *)&__m128d_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128d_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_slt_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0xffffffff00000000; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[0]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_slt_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]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_slt_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_vfcmp_sult_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000001; + *((unsigned long *)&__m128d_op0[0]) = 0xfffffffffffffffe; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_sult_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0xffffff8607db959f; + *((unsigned long *)&__m128d_op0[0]) = 0xff0cff78ff96ff14; + *((unsigned long *)&__m128d_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_sult_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000005; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[0]) = 0x7ef8000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_sult_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x14ccc6320176a4d2; + *((unsigned long *)&__m128d_op0[0]) = 0x685670d37e80682a; + *((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_vfcmp_sult_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0xffff00000000ffff; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[1]) = 0xffffffff00000001; + *((unsigned long *)&__m128d_op1[0]) = 0xffffffee00000004; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_sult_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x80808080806b000b; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_sult_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_vfcmp_sult_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-vfcmp_sne.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfcmp_sne.c new file mode 100644 index 00000000000..964eff79f42 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfcmp_sne.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; + + *((int *)&__m128_op0[3]) = 0x00003fee; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0x00000004; + *((int *)&__m128_op0[0]) = 0x00000000; + *((int *)&__m128_op1[3]) = 0x00000002; + *((int *)&__m128_op1[2]) = 0x00000000; + *((int *)&__m128_op1[1]) = 0x00000000; + *((int *)&__m128_op1[0]) = 0x00000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_result[0]) = 0xffffffff00000000; + __m128i_out = __lsx_vfcmp_sne_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]) = 0x03574e3a; + *((int *)&__m128_op1[2]) = 0x03574e3a; + *((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_vfcmp_sne_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]) = 0x00010400; + *((int *)&__m128_op1[3]) = 0x10f917d7; + *((int *)&__m128_op1[2]) = 0x2d3d01e4; + *((int *)&__m128_op1[1]) = 0x203e16d1; + *((int *)&__m128_op1[0]) = 0x16de012b; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_sne_s (__m128_op0, __m128_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x0000101f; + *((int *)&__m128_op0[2]) = 0xffff8b68; + *((int *)&__m128_op0[1]) = 0x00000b6f; + *((int *)&__m128_op0[0]) = 0xffff8095; + *((int *)&__m128_op1[3]) = 0x10f917d7; + *((int *)&__m128_op1[2]) = 0x2d3d01e4; + *((int *)&__m128_op1[1]) = 0x203e16d1; + *((int *)&__m128_op1[0]) = 0x16de012b; + *((unsigned long *)&__m128i_result[1]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_result[0]) = 0xffffffff00000000; + __m128i_out = __lsx_vfcmp_sne_s (__m128_op0, __m128_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x11000f20; + *((int *)&__m128_op0[2]) = 0x10000e20; + *((int *)&__m128_op0[1]) = 0x0f000d20; + *((int *)&__m128_op0[0]) = 0x0e000c20; + *((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]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_sne_s (__m128_op0, __m128_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00050005; + *((int *)&__m128_op0[2]) = 0x00050005; + *((int *)&__m128_op0[1]) = 0x00050005; + *((int *)&__m128_op0[0]) = 0x00050005; + *((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]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_sne_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]) = 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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_sne_s (__m128_op0, __m128_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x15d926c7; + *((int *)&__m128_op0[1]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0x0000e41b; + *((int *)&__m128_op1[3]) = 0xfffffacd; + *((int *)&__m128_op1[2]) = 0xb6dbecac; + *((int *)&__m128_op1[1]) = 0x1f5533a6; + *((int *)&__m128_op1[0]) = 0x94f902c0; + *((unsigned long *)&__m128i_result[1]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_sne_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]) = 0x04040504; + *((int *)&__m128_op1[1]) = 0x00000000; + *((int *)&__m128_op1[0]) = 0x04040504; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_sne_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]) = 0xffffffff; + *((int *)&__m128_op1[2]) = 0xffffffff; + *((int *)&__m128_op1[1]) = 0xffffffff; + *((int *)&__m128_op1[0]) = 0xffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_sne_s (__m128_op0, __m128_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x0001000c; + *((int *)&__m128_op0[2]) = 0xfffffff2; + *((int *)&__m128_op0[1]) = 0x0001000d; + *((int *)&__m128_op0[0]) = 0xfffffff1; + *((int *)&__m128_op1[3]) = 0xffff8a17; + *((int *)&__m128_op1[2]) = 0xffffc758; + *((int *)&__m128_op1[1]) = 0xffff69bb; + *((int *)&__m128_op1[0]) = 0xffffad3b; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_sne_s (__m128_op0, __m128_op1); + 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]) = 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]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x00000000ffffffff; + __m128i_out = __lsx_vfcmp_sune_s (__m128_op0, __m128_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0xff800000; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0xff800000; + *((int *)&__m128_op0[0]) = 0x00000000; + *((int *)&__m128_op1[3]) = 0xffff1739; + *((int *)&__m128_op1[2]) = 0xffff48aa; + *((int *)&__m128_op1[1]) = 0xffff2896; + *((int *)&__m128_op1[0]) = 0xffff5b88; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_sune_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]) = 0x00000003; + *((int *)&__m128_op0[0]) = 0x0000003f; + *((int *)&__m128_op1[3]) = 0x00000000; + *((int *)&__m128_op1[2]) = 0x00000000; + *((int *)&__m128_op1[1]) = 0x00000003; + *((int *)&__m128_op1[0]) = 0x0000003f; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_sune_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_vfcmp_sune_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_vfcmp_sune_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]) = 0x084d12ce; + *((int *)&__m128_op1[1]) = 0x00000000; + *((int *)&__m128_op1[0]) = 0x24170000; + *((unsigned long *)&__m128i_result[1]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x00000000ffffffff; + __m128i_out = __lsx_vfcmp_sune_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]) = 0xffffffff; + *((int *)&__m128_op1[2]) = 0xffffffff; + *((int *)&__m128_op1[1]) = 0xffffffff; + *((int *)&__m128_op1[0]) = 0xffffffff; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_sune_s (__m128_op0, __m128_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x7474f6fd7474fefe; + *((unsigned long *)&__m128d_op0[0]) = 0xf474f6fef474f6fe; + *((unsigned long *)&__m128d_op1[1]) = 0x00000001fffffffe; + *((unsigned long *)&__m128d_op1[0]) = 0x00000001fffffffe; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_sne_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]) = 0x00000001fffffffe; + *((unsigned long *)&__m128d_op1[0]) = 0x00000001fffffffe; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_sne_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0xffff000000000000; + *((unsigned long *)&__m128d_op1[1]) = 0x1817161517161514; + *((unsigned long *)&__m128d_op1[0]) = 0x1615141315141312; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_sne_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0101fe870101fe87; + *((unsigned long *)&__m128d_op0[0]) = 0x0101fe8700000000; + *((unsigned long *)&__m128d_op1[1]) = 0x62cbf96e4acfaf40; + *((unsigned long *)&__m128d_op1[0]) = 0xf0bc9a5278285a4a; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_sne_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x000000007fffa9ed; + *((unsigned long *)&__m128d_op0[0]) = 0x7f8000017fffca8b; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_sne_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_vfcmp_sne_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x00000000ffff7603; + *((unsigned long *)&__m128d_op1[1]) = 0x7fffffffffffffff; + *((unsigned long *)&__m128d_op1[0]) = 0x7fffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_sne_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_vfcmp_sune_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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_sune_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]) = 0x1111113111111141; + *((unsigned long *)&__m128d_op1[0]) = 0x1111113111111121; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_sune_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x00ff000100ff00fe; + *((unsigned long *)&__m128d_op0[0]) = 0x00ff003000ff00a0; + *((unsigned long *)&__m128d_op1[1]) = 0x000000005e695e95; + *((unsigned long *)&__m128d_op1[0]) = 0x5e695e96c396b402; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_sune_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x00000000ffffffff; + *((unsigned long *)&__m128d_op0[0]) = 0x00000000ffffffff; + *((unsigned long *)&__m128d_op1[1]) = 0x000300037ff000ff; + *((unsigned long *)&__m128d_op1[0]) = 0x0003000300a10003; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_sune_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]) = 0x0001000101010001; + *((unsigned long *)&__m128d_op1[0]) = 0x0001000100010001; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_sune_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x8000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x8000000000000000; + *((unsigned long *)&__m128d_op1[1]) = 0x0000008000000080; + *((unsigned long *)&__m128d_op1[0]) = 0x0000008000000080; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_sune_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x00000000ffffffff; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[0]) = 0x0000000000003ff8; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_sune_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x01533b5e7489ae24; + *((unsigned long *)&__m128d_op0[0]) = 0xffffab7e71e33848; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_sune_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-vfcmp_sor.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfcmp_sor.c new file mode 100644 index 00000000000..ea47baf40df --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfcmp_sor.c @@ -0,0 +1,269 @@ +/* { 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; + *((int *)&__m128_op1[3]) = 0xffffffff; + *((int *)&__m128_op1[2]) = 0xffffffff; + *((int *)&__m128_op1[1]) = 0xffffffff; + *((int *)&__m128_op1[0]) = 0xffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_sor_s (__m128_op0, __m128_op1); + 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]) = 0xffffffff; + *((int *)&__m128_op1[3]) = 0xffffffff; + *((int *)&__m128_op1[2]) = 0xffffffff; + *((int *)&__m128_op1[1]) = 0xffffffff; + *((int *)&__m128_op1[0]) = 0xffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_sor_s (__m128_op0, __m128_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x0000007f; + *((int *)&__m128_op0[2]) = 0x0000007f; + *((int *)&__m128_op0[1]) = 0x0000007f; + *((int *)&__m128_op0[0]) = 0x0000007f; + *((int *)&__m128_op1[3]) = 0x3ff00000; + *((int *)&__m128_op1[2]) = 0x00000000; + *((int *)&__m128_op1[1]) = 0xfffc0020; + *((int *)&__m128_op1[0]) = 0x00000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x00000000ffffffff; + __m128i_out = __lsx_vfcmp_sor_s (__m128_op0, __m128_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x2757de72; + *((int *)&__m128_op0[2]) = 0x33d771a3; + *((int *)&__m128_op0[1]) = 0x166891d5; + *((int *)&__m128_op0[0]) = 0x1e8b7eff; + *((int *)&__m128_op1[3]) = 0x2757de72; + *((int *)&__m128_op1[2]) = 0x33d771a3; + *((int *)&__m128_op1[1]) = 0x166891d5; + *((int *)&__m128_op1[0]) = 0x1e8b7eff; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_sor_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]) = 0x00fe00ff; + *((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]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_sor_s (__m128_op0, __m128_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x00000001; + *((int *)&__m128_op0[1]) = 0xffffffff; + *((int *)&__m128_op0[0]) = 0xfffffffe; + *((int *)&__m128_op1[3]) = 0x00000000; + *((int *)&__m128_op1[2]) = 0x00000000; + *((int *)&__m128_op1[1]) = 0x00000000; + *((int *)&__m128_op1[0]) = 0xffffff02; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_sor_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]) = 0x0000000d; + *((int *)&__m128_op1[3]) = 0xffffffff; + *((int *)&__m128_op1[2]) = 0xfffffe03; + *((int *)&__m128_op1[1]) = 0xffffffff; + *((int *)&__m128_op1[0]) = 0xfffffe03; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_sor_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]) = 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]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_sor_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]) = 0xffffffff; + *((int *)&__m128_op1[2]) = 0xffffffff; + *((int *)&__m128_op1[1]) = 0xffffffff; + *((int *)&__m128_op1[0]) = 0xffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_sor_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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_sor_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]) = 0xbafebb00; + *((int *)&__m128_op1[2]) = 0xffd500fe; + *((int *)&__m128_op1[1]) = 0x00000000; + *((int *)&__m128_op1[0]) = 0x00000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_sor_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]) = 0xbffffffe; + *((int *)&__m128_op1[1]) = 0x00000000; + *((int *)&__m128_op1[0]) = 0x00000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_sor_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]) = 0xffffffff; + *((int *)&__m128_op1[2]) = 0xffffffff; + *((int *)&__m128_op1[1]) = 0xffffffff; + *((int *)&__m128_op1[0]) = 0xffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_sor_s (__m128_op0, __m128_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x80000000; + *((int *)&__m128_op0[2]) = 0x80000000; + *((int *)&__m128_op0[1]) = 0x80000000; + *((int *)&__m128_op0[0]) = 0x80000000; + *((int *)&__m128_op1[3]) = 0x000000ff; + *((int *)&__m128_op1[2]) = 0x0000857a; + *((int *)&__m128_op1[1]) = 0x05fafe01; + *((int *)&__m128_op1[0]) = 0x01fe000e; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_sor_s (__m128_op0, __m128_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x7fff7fff; + *((int *)&__m128_op0[2]) = 0x7fff7fff; + *((int *)&__m128_op0[1]) = 0xbf6b8101; + *((int *)&__m128_op0[0]) = 0x81018101; + *((int *)&__m128_op1[3]) = 0xe3636363; + *((int *)&__m128_op1[2]) = 0x63abdf16; + *((int *)&__m128_op1[1]) = 0x41f8e080; + *((int *)&__m128_op1[0]) = 0x16161198; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_sor_s (__m128_op0, __m128_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000ffff00000000; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_sor_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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_sor_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000005d5d; + *((unsigned long *)&__m128d_op1[1]) = 0x08fdc221bfdb1927; + *((unsigned long *)&__m128d_op1[0]) = 0x4303c67e9b7fb213; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_sor_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x7fffffff7ffffffb; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000002; + *((unsigned long *)&__m128d_op1[0]) = 0x0000000000040002; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_sor_d (__m128d_op0, __m128d_op1); + 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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_sor_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0xfffffff000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000d00000000; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_sor_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-vfcmp_sun.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfcmp_sun.c new file mode 100644 index 00000000000..68cb5a52fbd --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfcmp_sun.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; + + *((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_vfcmp_sun_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_vfcmp_sun_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]) = 0xffffffff; + *((int *)&__m128_op1[2]) = 0xe17fe003; + *((int *)&__m128_op1[1]) = 0xffffffff; + *((int *)&__m128_op1[0]) = 0xffffffff; + *((unsigned long *)&__m128i_result[1]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_sun_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]) = 0xffffffff; + *((int *)&__m128_op1[2]) = 0x0000ffff; + *((int *)&__m128_op1[1]) = 0xffffffff; + *((int *)&__m128_op1[0]) = 0xffffffff; + *((unsigned long *)&__m128i_result[1]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_sun_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]) = 0xffffffff; + *((int *)&__m128_op1[2]) = 0xffffffff; + *((int *)&__m128_op1[1]) = 0xffffffff; + *((int *)&__m128_op1[0]) = 0xffffffff; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_sun_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]) = 0x00190819; + *((int *)&__m128_op1[2]) = 0x00190019; + *((int *)&__m128_op1[1]) = 0x00190819; + *((int *)&__m128_op1[0]) = 0x00190019; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_sun_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]) = 0xfe800000; + *((int *)&__m128_op0[0]) = 0x00000001; + *((int *)&__m128_op1[3]) = 0x7fffffff; + *((int *)&__m128_op1[2]) = 0x82bb9784; + *((int *)&__m128_op1[1]) = 0x7fffffff; + *((int *)&__m128_op1[0]) = 0xc6bb97ac; + *((unsigned long *)&__m128i_result[1]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_result[0]) = 0xffffffff00000000; + __m128i_out = __lsx_vfcmp_sun_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]) = 0x7f3f0180; + *((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_vfcmp_sun_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_vfcmp_sun_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]) = 0xa2321469; + *((int *)&__m128_op0[0]) = 0x7fd03f7f; + *((int *)&__m128_op1[3]) = 0x00000406; + *((int *)&__m128_op1[2]) = 0x00000406; + *((int *)&__m128_op1[1]) = 0x02020202; + *((int *)&__m128_op1[0]) = 0x0202fe02; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00000000ffffffff; + __m128i_out = __lsx_vfcmp_sun_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_vfcmp_sun_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]) = 0xfffffff5; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00000000ffffffff; + __m128i_out = __lsx_vfcmp_sun_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_vfcmp_sun_s (__m128_op0, __m128_op1); + 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; + *((int *)&__m128_op1[3]) = 0x00000000; + *((int *)&__m128_op1[2]) = 0x00000000; + *((int *)&__m128_op1[1]) = 0xfffc0004; + *((int *)&__m128_op1[0]) = 0x00000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xffffffff00000000; + __m128i_out = __lsx_vfcmp_sun_s (__m128_op0, __m128_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x67eb85b0; + *((int *)&__m128_op0[2]) = 0xb2ebb001; + *((int *)&__m128_op0[1]) = 0xc8847ef6; + *((int *)&__m128_op0[0]) = 0xed3f2000; + *((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_vfcmp_sun_s (__m128_op0, __m128_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((int *)&__m128_op0[3]) = 0x0002de46; + *((int *)&__m128_op0[2]) = 0x682de060; + *((int *)&__m128_op0[1]) = 0x09b50da6; + *((int *)&__m128_op0[0]) = 0xe67b8fc0; + *((int *)&__m128_op1[3]) = 0x00000000; + *((int *)&__m128_op1[2]) = 0x084d12ce; + *((int *)&__m128_op1[1]) = 0x00000000; + *((int *)&__m128_op1[0]) = 0x24170000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_sun_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]) = 0x00ffffff; + *((int *)&__m128_op0[0]) = 0x00ffffff; + *((int *)&__m128_op1[3]) = 0x0000feff; + *((int *)&__m128_op1[2]) = 0x23560000; + *((int *)&__m128_op1[1]) = 0x0000fd16; + *((int *)&__m128_op1[0]) = 0x54860000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_sun_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]) = 0xfffffffe; + *((int *)&__m128_op0[0]) = 0xfffff784; + *((int *)&__m128_op1[3]) = 0x0177fff0; + *((int *)&__m128_op1[2]) = 0xfffffff0; + *((int *)&__m128_op1[1]) = 0x00000000; + *((int *)&__m128_op1[0]) = 0x011ff8bc; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_sun_s (__m128_op0, __m128_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0002000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0002000000000000; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000001; + *((unsigned long *)&__m128d_op1[0]) = 0x00ff00ff00ff00fe; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_sun_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]) = 0xffffffffffffffe5; + *((unsigned long *)&__m128d_op1[0]) = 0xffffffffffffffe5; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_sun_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x7fff7fff7fff7fff; + *((unsigned long *)&__m128d_op0[0]) = 0x000000007fff7fff; + *((unsigned long *)&__m128d_op1[1]) = 0xfffffffffffff800; + *((unsigned long *)&__m128d_op1[0]) = 0x00ff000000ff0000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_sun_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]) = 0xfffebd06fffe820c; + *((unsigned long *)&__m128d_op1[0]) = 0x7fff7ffe7fff3506; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_sun_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]) = 0x7ffffffeffffffff; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vfcmp_sun_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x4f804f804f804f80; + *((unsigned long *)&__m128d_op0[0]) = 0x4f804f804f804f80; + *((unsigned long *)&__m128d_op1[1]) = 0x00007fff00007fff; + *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_sun_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x000000000000002f; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000029; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000000003a24; + *((unsigned long *)&__m128d_op1[0]) = 0x003dbe88077c78c1; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_sun_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_vfcmp_sun_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000ffff0000ffff; + *((unsigned long *)&__m128d_op0[0]) = 0x0001fffe0001fefc; + *((unsigned long *)&__m128d_op1[1]) = 0x0007000000050000; + *((unsigned long *)&__m128d_op1[0]) = 0x0003000100010001; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vfcmp_sun_d (__m128d_op0, __m128d_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} From patchwork Wed Sep 13 03:37:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: chenxiaolong X-Patchwork-Id: 138601 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9ecd:0:b0:3f2:4152:657d with SMTP id t13csp834753vqx; Tue, 12 Sep 2023 20:49:41 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGkUnf5ULE6qYlOr7CAO6KdSvqF27x/kHwtweNPw7uDDy/Pd5MCk0n98vjbdBlaAnOwrp2z X-Received: by 2002:a17:906:29e:b0:9a1:f4e8:87b9 with SMTP id 30-20020a170906029e00b009a1f4e887b9mr830538ejf.45.1694576981688; Tue, 12 Sep 2023 20:49:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694576981; cv=none; d=google.com; s=arc-20160816; b=UYsXbtrXTb6RAMqg8eThO/Zm1BsRR49+mKWBZPXYD0xAiesl+QalLeD1HnCruROyAD ZhUPZPeb267bE1XJ3TIbWMV3P2Rsy+kj2MS/uvcOEw9b3EkVQL1ejccOzBS9YhPqXGJi Um/dY/tSX1qFk0zOnl5cY0O0dQ6Vpa1zzTOMhrSOwf/4qyOZ1h5eoW+wSnCoHtl4wOc8 VQnXBEbKoybaXOU9oD0aDxWeaYlQUcZdT0/U9ShtvIW1gsc4+6ewJgNkzOBD69xemRZk Wa5kPl+VsOHk3L/vWaW7T6d1+ZwSbO+xIPMA0mDX1nJZU4bKru8qvX6GO65zkdiWnQcX G1Qw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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:cc:to :from:dmarc-filter:delivered-to; bh=/63z2ViJ4Csc1G3fS0rvLytO0DoJ6oCmBFwjQp9Y2e0=; fh=3pFUYcpS/27XRzOf17GfR86AuNQu+P1CET04YURgCLs=; b=U3QQYXUfSKo5KyVV9nepIXIHJLA6vgkXF070ODKV41eDxTnbST11mLGaADNh75GLgo Kp+sYN1RdYGTSUjW6+8TqQJKciYwJYqoKQaYeTWQ56FzD6OLzgs7/+VXJUiraStiGADG Up1POUjpRQJaptjHKUsOOPTjb6VqqmBECK5ojyCHfQboRAVCYQryfXj2BwRD6qO3rmQh 2kScPE0h8662A49G0DFeQy3h9/0bIhWyJEkAEQvRtyhrU4ZCI0iOXiNEnRJILJpBO7yK Ul98tr0lK5WY1ina+EKe8z2vgtAMuiCykbgBbsGsPUZLmwS2yLqrUP3vqDsKlwvM2YUi zQZg== 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 p2-20020a170906838200b009925f1a32f8si9662548ejx.400.2023.09.12.20.49.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Sep 2023 20:49:41 -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 9675A3895FFC for ; Wed, 13 Sep 2023 03:38:33 +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 50C44395A03A for ; Wed, 13 Sep 2023 03:37:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 50C44395A03A 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 _____8CxyOh7LgFlKDEmAA--.38413S3; Wed, 13 Sep 2023 11:37:31 +0800 (CST) Received: from slurm-master.loongson.cn (unknown [10.10.130.252]) by localhost.localdomain (Coremail) with SMTP id AQAAf8DxS9x3LgFlQhACAA--.3563S5; Wed, 13 Sep 2023 11:37:30 +0800 (CST) From: Xiaolong Chen To: gcc-patches@gcc.gnu.org Cc: xry111@xry111.site, i@xen0n.name, xuchenghua@loongson.cn, chenglulu@loongson.cn, Xiaolong Chen Subject: [PATCH v4 21/23] LoongArch: Add tests for SX vector handling and shuffle instructions. Date: Wed, 13 Sep 2023 11:37:24 +0800 Message-Id: <20230913033726.6408-2-chenxiaolong@loongson.cn> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230913033726.6408-1-chenxiaolong@loongson.cn> References: <20230913033726.6408-1-chenxiaolong@loongson.cn> MIME-Version: 1.0 X-CM-TRANSID: AQAAf8DxS9x3LgFlQhACAA--.3563S5 X-CM-SenderInfo: hfkh05xldrz0tqj6z05rqj20fqof0/1tbiAQANBWUBHCIBGgAAsI X-Coremail-Antispam: 1Uk129KBj9DXoWkur4xJF43JrWxur4fCFW3urX_yoW5AFW8WF c_JFnxJFykWF4Svr9rZr1DZr98uw4UXanF9F4UCF1qq3Wktr18Ca45AFyIvr17Jw1DZ3Wr ZFyDZrW8Crn8GF1UKosvyTuYvTs0mTUanT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUj1kv1T uYvTs0mT0YCTnIWjqI5I8CrVACY4xI64kE6c02F40Ex7xfYxn0WfASr-VFAUDa7-sFnT9f nUUIcSsGvfJTRUUUbc8YFVCjjxCrM7AC8VAFwI0_Jr0_Gr1l1xkIjI8I6I8E6xAIw20EY4 v20xvaj40_Wr0E3s1l1IIY67AEw4v_JrI_Jryl8cAvFVAK0II2c7xJM28CjxkF64kEwVA0 rcxSw2x7M28EF7xvwVC0I7IYx2IY67AKxVW7JVWDJwA2z4x0Y4vE2Ix0cI8IcVCY1x0267 AKxVWxJVW8Jr1l84ACjcxK6I8E87Iv67AKxVW8Jr0_Cr1UM28EF7xvwVC2z280aVCY1x02 67AKxVW8Jr0_Cr1UM2AIxVAIcxkEcVAq07x20xvEncxIr21l57IF6xkI12xvs2x26I8E6x ACxx1l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26rWY6Fy7McIj6I8E 87Iv67AKxVWxJVW8Jr1lOx8S6xCaFVCjc4AY6r1j6r4UM4x0Y48IcxkI7VAKI48JMxAIw2 8IcxkI7VAKI48JMxC20s026xCaFVCjc4AY6r1j6r4UMI8I3I0E5I8CrVAFwI0_Jr0_Jr4l x2IqxVCjr7xvwVAFwI0_JrI_JrWlx4CE17CEb7AF67AKxVWUAVWUtwCIc40Y0x0EwIxGrw CI42IY6xIIjxv20xvE14v26F1j6w1UMIIF0xvE2Ix0cI8IcVCY1x0267AKxVWxJVW8Jr1l IxAIcVCF04k26cxKx2IYs7xG6r1j6r1xMIIF0xvEx4A2jsIE14v26F4j6r4UJwCI42IY6I 8E87Iv6xkF7I0E14v26r4j6r4UJbIYCTnIWIevJa73UjIFyTuYvjxU4E_MDUUUU X-Spam-Status: No, score=-12.7 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: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1776892753201219935 X-GMAIL-MSGID: 1776892753201219935 gcc/testsuite/ChangeLog: * gcc.target/loongarch/vector/lsx/lsx-vbsll.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vbsrl.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vextrins.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vilvh.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vilvl.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vinsgr2vr.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vpackev.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vpackod.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vpickev.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vpickod.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vpickve2gr.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vpremi.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vreplgr2vr.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vreplve.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vreplvei.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vshuf.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vshuf4i.c: New test. --- .../loongarch/vector/lsx/lsx-vbsll.c | 83 +++ .../loongarch/vector/lsx/lsx-vbsrl.c | 55 ++ .../loongarch/vector/lsx/lsx-vextrins.c | 479 +++++++++++++++++ .../loongarch/vector/lsx/lsx-vilvh.c | 353 +++++++++++++ .../loongarch/vector/lsx/lsx-vilvl.c | 327 ++++++++++++ .../loongarch/vector/lsx/lsx-vinsgr2vr.c | 278 ++++++++++ .../loongarch/vector/lsx/lsx-vpackev.c | 452 ++++++++++++++++ .../loongarch/vector/lsx/lsx-vpackod.c | 461 +++++++++++++++++ .../loongarch/vector/lsx/lsx-vpickev.c | 362 +++++++++++++ .../loongarch/vector/lsx/lsx-vpickod.c | 336 ++++++++++++ .../loongarch/vector/lsx/lsx-vpickve2gr.c | 488 ++++++++++++++++++ .../loongarch/vector/lsx/lsx-vpremi.c | 20 + .../loongarch/vector/lsx/lsx-vreplgr2vr.c | 212 ++++++++ .../loongarch/vector/lsx/lsx-vreplve.c | 300 +++++++++++ .../loongarch/vector/lsx/lsx-vreplvei.c | 293 +++++++++++ .../loongarch/vector/lsx/lsx-vshuf.c | 394 ++++++++++++++ .../loongarch/vector/lsx/lsx-vshuf4i.c | 348 +++++++++++++ 17 files changed, 5241 insertions(+) create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vbsll.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vbsrl.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vextrins.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vilvh.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vilvl.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vinsgr2vr.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vpackev.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vpackod.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vpickev.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vpickod.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vpickve2gr.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vpremi.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vreplgr2vr.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vreplve.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vreplvei.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vshuf.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vshuf4i.c diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vbsll.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vbsll.c new file mode 100644 index 00000000000..34246c5518b --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vbsll.c @@ -0,0 +1,83 @@ +/* { 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]) = 0x00ffffff000000ff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xffffff000000ff00; + __m128i_out = __lsx_vbsll_v (__m128i_op0, 0x1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00ff00ff00ff00ff; + *((unsigned long *)&__m128i_op0[0]) = 0x00ff00ff00ff00ff; + *((unsigned long *)&__m128i_result[1]) = 0xff00ff00ff00ff00; + *((unsigned long *)&__m128i_result[0]) = 0xff00000000000000; + __m128i_out = __lsx_vbsll_v (__m128i_op0, 0x17); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000800; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0008000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vbsll_v (__m128i_op0, 0x15); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000a000a000a000a; + *((unsigned long *)&__m128i_op0[0]) = 0x000a000a000a000a; + *((unsigned long *)&__m128i_result[1]) = 0x0a00000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vbsll_v (__m128i_op0, 0xf); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0141010101410101; + *((unsigned long *)&__m128i_op0[0]) = 0x0141010101410101; + *((unsigned long *)&__m128i_result[1]) = 0x4101010141010100; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vbsll_v (__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_vbsll_v (__m128i_op0, 0x2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000001; + *((unsigned long *)&__m128i_result[1]) = 0x0000000100000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vbsll_v (__m128i_op0, 0xc); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vbsll_v (__m128i_op0, 0xb); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000158; + *((unsigned long *)&__m128i_result[1]) = 0x0000000001580000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vbsll_v (__m128i_op0, 0xa); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vbsrl.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vbsrl.c new file mode 100644 index 00000000000..986b7d5667e --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vbsrl.c @@ -0,0 +1,55 @@ +/* { 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]) = 0x0000000401000001; + *((unsigned long *)&__m128i_op0[0]) = 0x0001000100000004; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000040100; + *((unsigned long *)&__m128i_result[0]) = 0x0001000100010000; + __m128i_out = __lsx_vbsrl_v (__m128i_op0, 0x2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000000003fffffff; + *((unsigned long *)&__m128i_op0[0]) = 0x000000003fffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x003fffffff000000; + __m128i_out = __lsx_vbsrl_v (__m128i_op0, 0x5); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0005fe0300010101; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000100010001; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000005; + *((unsigned long *)&__m128i_result[0]) = 0xfe03000101010000; + __m128i_out = __lsx_vbsrl_v (__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_vbsrl_v (__m128i_op0, 0x13); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xd3259a2984048c23; + *((unsigned long *)&__m128i_op0[0]) = 0xf9796558e39953fd; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000d3259a; + __m128i_out = __lsx_vbsrl_v (__m128i_op0, 0xd); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vextrins.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vextrins.c new file mode 100644 index 00000000000..8d4158b5734 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vextrins.c @@ -0,0 +1,479 @@ +/* { 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]) = 0xbf8000000000ffff; + *((unsigned long *)&__m128i_op1[0]) = 0xcf00000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000ffff00000000; + __m128i_out = __lsx_vextrins_w (__m128i_op0, __m128i_op1, 0x92); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vextrins_b (__m128i_op0, __m128i_op1, 0xc2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vextrins_d (__m128i_op0, __m128i_op1, 0x1c); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vextrins_h (__m128i_op0, __m128i_op1, 0x3d); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x0200020002000200; + *((unsigned long *)&__m128i_op1[0]) = 0x0200020002000200; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffff02000200; + __m128i_out = __lsx_vextrins_w (__m128i_op0, __m128i_op1, 0x3); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0c03e17edd781b11; + *((unsigned long *)&__m128i_op0[0]) = 0x342caf9be55700b5; + *((unsigned long *)&__m128i_op1[1]) = 0x0000040400000383; + *((unsigned long *)&__m128i_op1[0]) = 0xffffe000ffff1fff; + *((unsigned long *)&__m128i_result[1]) = 0x0c03e17edd781b11; + *((unsigned long *)&__m128i_result[0]) = 0x342caf9bffff1fff; + __m128i_out = __lsx_vextrins_w (__m128i_op0, __m128i_op1, 0xcc); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vextrins_b (__m128i_op0, __m128i_op1, 0xc6); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000000a16316b0; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000063636363; + *((unsigned long *)&__m128i_op1[1]) = 0x16161616a16316b0; + *((unsigned long *)&__m128i_op1[0]) = 0x6363636363636363; + *((unsigned long *)&__m128i_result[1]) = 0x00000000a16316b0; + *((unsigned long *)&__m128i_result[0]) = 0x16161616a16316b0; + __m128i_out = __lsx_vextrins_d (__m128i_op0, __m128i_op1, 0xa7); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xfff489b693120950; + *((unsigned long *)&__m128i_op1[0]) = 0xfffc45a851c40c18; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xfffc45a851c40c18; + __m128i_out = __lsx_vextrins_d (__m128i_op0, __m128i_op1, 0x48); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vextrins_d (__m128i_op0, __m128i_op1, 0xcc); + 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]) = 0x0000000000000000; + __m128i_out = __lsx_vextrins_d (__m128i_op0, __m128i_op1, 0x41); + 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]) = 0x00000000fefefe6a; + *((unsigned long *)&__m128i_result[0]) = 0x00000000c2bac2c2; + __m128i_out = __lsx_vextrins_w (__m128i_op0, __m128i_op1, 0x7c); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0x7ffffffeffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x4080808080808080; + *((unsigned long *)&__m128i_result[1]) = 0xff80ffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x7ffffffeffffffff; + __m128i_out = __lsx_vextrins_b (__m128i_op0, __m128i_op1, 0xe6); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000a000a000a000a; + *((unsigned long *)&__m128i_op0[0]) = 0x000a000a000a000a; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000a0000000a; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000a00000009; + *((unsigned long *)&__m128i_result[1]) = 0x000a000a0000000a; + *((unsigned long *)&__m128i_result[0]) = 0x000a000a000a000a; + __m128i_out = __lsx_vextrins_w (__m128i_op0, __m128i_op1, 0xaf); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffff80000001; + *((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_vextrins_w (__m128i_op0, __m128i_op1, 0x67); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x004fcfcfd01f9f9f; + *((unsigned long *)&__m128i_op0[0]) = 0x9f4fcfcfcf800000; + *((unsigned long *)&__m128i_op1[1]) = 0x004fcfcfd01f9f9f; + *((unsigned long *)&__m128i_op1[0]) = 0x9f4fcfcfcf800000; + *((unsigned long *)&__m128i_result[1]) = 0x004f1fcfd01f9f9f; + *((unsigned long *)&__m128i_result[0]) = 0x9f4fcfcfcf800000; + __m128i_out = __lsx_vextrins_b (__m128i_op0, __m128i_op1, 0xda); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x75b043c4d17db125; + *((unsigned long *)&__m128i_op0[0]) = 0xeef8227b596117b1; + *((unsigned long *)&__m128i_op1[1]) = 0x4f804f804f804f80; + *((unsigned long *)&__m128i_op1[0]) = 0x4f804f804f804f80; + *((unsigned long *)&__m128i_result[1]) = 0x75b043c4d17db125; + *((unsigned long *)&__m128i_result[0]) = 0xeef8227b4f8017b1; + __m128i_out = __lsx_vextrins_h (__m128i_op0, __m128i_op1, 0x15); + 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]) = 0x000000000de32400; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x027c027c000027c0; + __m128i_out = __lsx_vextrins_h (__m128i_op0, __m128i_op1, 0x77); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x6363797c63996399; + *((unsigned long *)&__m128i_op0[0]) = 0x171f0a1f6376441f; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x6363797c63990099; + *((unsigned long *)&__m128i_result[0]) = 0x171f0a1f6376441f; + __m128i_out = __lsx_vextrins_b (__m128i_op0, __m128i_op1, 0x94); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0bd80bd80bdfffff; + *((unsigned long *)&__m128i_op0[0]) = 0x0bd80bd80bd80000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0bd80bd80bd80000; + __m128i_out = __lsx_vextrins_d (__m128i_op0, __m128i_op1, 0xf9); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x41dfbe1f41e0ffff; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffc2ffe000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000ffc100010001; + *((unsigned long *)&__m128i_result[1]) = 0x41dfbe1f41e0ffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000ffc100010001; + __m128i_out = __lsx_vextrins_d (__m128i_op0, __m128i_op1, 0xec); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xe93d0bd19ff0c170; + *((unsigned long *)&__m128i_op1[0]) = 0x5237c1bac9eadf55; + *((unsigned long *)&__m128i_result[1]) = 0x5237c1baffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vextrins_w (__m128i_op0, __m128i_op1, 0x7d); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffbd994889; + *((unsigned long *)&__m128i_op1[0]) = 0x000000000a092444; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000890000000000; + __m128i_out = __lsx_vextrins_b (__m128i_op0, __m128i_op1, 0x58); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000fea0000fffe; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffff8607db959f; + *((unsigned long *)&__m128i_op1[0]) = 0xff0cff78ff96ff14; + *((unsigned long *)&__m128i_result[1]) = 0x00000fea0000fffe; + *((unsigned long *)&__m128i_result[0]) = 0xff0cff78ff96ff14; + __m128i_out = __lsx_vextrins_d (__m128i_op0, __m128i_op1, 0xc2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x01ef013f01e701f8; + *((unsigned long *)&__m128i_op1[0]) = 0x35bb8d32b2625c00; + *((unsigned long *)&__m128i_result[1]) = 0x00008d3200000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vextrins_h (__m128i_op0, __m128i_op1, 0xea); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x8003000000020000; + *((unsigned long *)&__m128i_op0[0]) = 0x4040ffffc0400004; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x8003000000020000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vextrins_d (__m128i_op0, __m128i_op1, 0x64); + 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]) = 0x00000000ffffffff; + __m128i_out = __lsx_vextrins_w (__m128i_op0, __m128i_op1, 0x1f); + 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]) = 0xffff0000ffff0000; + *((unsigned long *)&__m128i_result[1]) = 0xffff0000ffff0000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vextrins_d (__m128i_op0, __m128i_op1, 0x74); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000000ffff53d9; + *((unsigned long *)&__m128i_op0[0]) = 0xffff0001ffff9515; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x00000000ffff53d9; + *((unsigned long *)&__m128i_result[0]) = 0xff000001ffff9515; + __m128i_out = __lsx_vextrins_b (__m128i_op0, __m128i_op1, 0x67); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_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]) = 0x8000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vextrins_b (__m128i_op0, __m128i_op1, 0xf4); + 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_vextrins_b (__m128i_op0, __m128i_op1, 0xc1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vextrins_w (__m128i_op0, __m128i_op1, 0x71); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vextrins_d (__m128i_op0, __m128i_op1, 0x82); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vextrins_b (__m128i_op0, __m128i_op1, 0xd5); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vextrins_w (__m128i_op0, __m128i_op1, 0xf3); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xbbe5560400010001; + *((unsigned long *)&__m128i_op0[0]) = 0xe7e5dabf00010001; + *((unsigned long *)&__m128i_op1[1]) = 0xbbe5560400010001; + *((unsigned long *)&__m128i_op1[0]) = 0xe7e5dabf00010001; + *((unsigned long *)&__m128i_result[1]) = 0xe7e5560400010001; + *((unsigned long *)&__m128i_result[0]) = 0xe7e5dabf00010001; + __m128i_out = __lsx_vextrins_h (__m128i_op0, __m128i_op1, 0xf3); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000002; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000002; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vextrins_w (__m128i_op0, __m128i_op1, 0x2c); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vextrins_h (__m128i_op0, __m128i_op1, 0x27); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vextrins_w (__m128i_op0, __m128i_op1, 0x5d); + 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]) = 0x0001000100010001; + *((unsigned long *)&__m128i_result[0]) = 0x0001000100010001; + __m128i_out = __lsx_vextrins_w (__m128i_op0, __m128i_op1, 0x24); + 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]) = 0x0001000101010001; + *((unsigned long *)&__m128i_result[0]) = 0x0001000100010001; + __m128i_out = __lsx_vextrins_b (__m128i_op0, __m128i_op1, 0xb6); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x8000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x975ca6046e2e4889; + *((unsigned long *)&__m128i_op1[0]) = 0x1748c4f9ed1a5870; + *((unsigned long *)&__m128i_result[1]) = 0x8000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x1748c4f9ed1a5870; + __m128i_out = __lsx_vextrins_d (__m128i_op0, __m128i_op1, 0x6a); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xfffffffffc606ec5; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000014155445; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vextrins_h (__m128i_op0, __m128i_op1, 0x76); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000024170000; + *((unsigned long *)&__m128i_op1[1]) = 0x000aa822a79308f6; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000084d12ce; + *((unsigned long *)&__m128i_result[1]) = 0x00000000084d12ce; + *((unsigned long *)&__m128i_result[0]) = 0x0000000024170000; + __m128i_out = __lsx_vextrins_d (__m128i_op0, __m128i_op1, 0x32); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x00000000084d12ce; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000024170000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vextrins_h (__m128i_op0, __m128i_op1, 0x56); + 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]) = 0xffffffffffffffff; + __m128i_out = __lsx_vextrins_b (__m128i_op0, __m128i_op1, 0xc5); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000034; + *((unsigned long *)&__m128i_op1[1]) = 0x01017f3c00000148; + *((unsigned long *)&__m128i_op1[0]) = 0x117d7f7b093d187f; + *((unsigned long *)&__m128i_result[1]) = 0x117d7f7b093d187f; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000034; + __m128i_out = __lsx_vextrins_d (__m128i_op0, __m128i_op1, 0x70); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x01533b5e7489ae24; + *((unsigned long *)&__m128i_op0[0]) = 0xe519ab7e71e33848; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x01533b5e7489ae24; + *((unsigned long *)&__m128i_result[0]) = 0xffffab7e71e33848; + __m128i_out = __lsx_vextrins_h (__m128i_op0, __m128i_op1, 0xbc); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffff760386bdae46; + *((unsigned long *)&__m128i_op1[0]) = 0xc1fc7941bc7e00ff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00000000ffff7603; + __m128i_out = __lsx_vextrins_w (__m128i_op0, __m128i_op1, 0xc3); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000ffff0000ffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffff2356fe165486; + *((unsigned long *)&__m128i_op1[1]) = 0x3a8000003a800000; + *((unsigned long *)&__m128i_op1[0]) = 0x000ef0000000003b; + *((unsigned long *)&__m128i_result[1]) = 0x0000003b0000ffff; + *((unsigned long *)&__m128i_result[0]) = 0xffff2356fe165486; + __m128i_out = __lsx_vextrins_w (__m128i_op0, __m128i_op1, 0x70); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vextrins_d (__m128i_op0, __m128i_op1, 0x8a); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vilvh.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vilvh.c new file mode 100644 index 00000000000..aa802b2959e --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vilvh.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]) = 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_vilvh_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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vilvh_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_vilvh_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_vilvh_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]) = 0x007fffff00000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x007fffff00000000; + __m128i_out = __lsx_vilvh_d (__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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x8000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x195f307a5d04acbb; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vilvh_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x8644000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xaed495f03343a685; + *((unsigned long *)&__m128i_op1[1]) = 0xfffffffffffffffe; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffbe6ed563; + *((unsigned long *)&__m128i_result[1]) = 0x8644ffff0000ffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000ffff0000fffe; + __m128i_out = __lsx_vilvh_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_vilvh_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]) = 0xffff0000ffff0000; + *((unsigned long *)&__m128i_result[0]) = 0xffff0000ffff0000; + __m128i_out = __lsx_vilvh_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000e0000000e; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000e0000000e; + *((unsigned long *)&__m128i_op1[1]) = 0x0000001300000013; + *((unsigned long *)&__m128i_op1[0]) = 0x0000001300000013; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000e13; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000e13; + __m128i_out = __lsx_vilvh_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]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x00000000ffffffff; + __m128i_out = __lsx_vilvh_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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x000a000a00000000; + *((unsigned long *)&__m128i_result[0]) = 0x000a000a00000000; + __m128i_out = __lsx_vilvh_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]) = 0xff00ff00ff00ff00; + *((unsigned long *)&__m128i_result[0]) = 0xff00ff00ff00ff00; + __m128i_out = __lsx_vilvh_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]) = 0x4f804f804f804f80; + *((unsigned long *)&__m128i_op1[0]) = 0x4f804f804f804f80; + *((unsigned long *)&__m128i_result[1]) = 0x000000004f804f80; + *((unsigned long *)&__m128i_result[0]) = 0x000000004f804f80; + __m128i_out = __lsx_vilvh_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]) = 0x004f0080004f0080; + *((unsigned long *)&__m128i_result[0]) = 0x004f0080004f0080; + __m128i_out = __lsx_vilvh_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]) = 0x000000ffa7f8ff81; + *((unsigned long *)&__m128i_op1[0]) = 0x0000003f0080ffc0; + *((unsigned long *)&__m128i_result[1]) = 0x000000007fff00ff; + *((unsigned long *)&__m128i_result[0]) = 0x0000a7f87fffff81; + __m128i_out = __lsx_vilvh_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00003f8000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x00003f8000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x8000ffff00000000; + *((unsigned long *)&__m128i_op1[0]) = 0x8000ffff00000000; + *((unsigned long *)&__m128i_result[1]) = 0x000080003f80ffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vilvh_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x2020202020202020; + *((unsigned long *)&__m128i_op0[0]) = 0x202020202020ff20; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x2000200020002000; + *((unsigned long *)&__m128i_result[0]) = 0x2000200020002000; + __m128i_out = __lsx_vilvh_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]) = 0x0008000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vilvh_w (__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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0808ffff0808ffff; + *((unsigned long *)&__m128i_result[0]) = 0x0808ffff0808ffff; + __m128i_out = __lsx_vilvh_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_vilvh_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]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x00000000ffffffff; + __m128i_out = __lsx_vilvh_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0001000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x00ff00ff00ff00ff; + *((unsigned long *)&__m128i_result[0]) = 0x00ff00ff00ff00ff; + __m128i_out = __lsx_vilvh_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_vilvh_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000157; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000158; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vilvh_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0001000100010058; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0001000100010058; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vilvh_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]) = 0x0000ffff0000ffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000ffff0000ffff; + __m128i_out = __lsx_vilvh_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]) = 0x0000000000000200; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000200; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000200; + __m128i_out = __lsx_vilvh_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_vilvh_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]) = 0x0000000000000008; + *((unsigned long *)&__m128i_op1[0]) = 0x0002008360500088; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000008; + __m128i_out = __lsx_vilvh_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_vilvh_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_vilvh_w (__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]) = 0x00000000f3040705; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00000000f3040705; + __m128i_out = __lsx_vilvh_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]) = 0x0000ffff00000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vilvh_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_vilvh_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]) = 0xff00ff00ff00ff00; + *((unsigned long *)&__m128i_result[0]) = 0xff00ff00ff00ff00; + __m128i_out = __lsx_vilvh_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]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_result[0]) = 0xffffffff00000000; + __m128i_out = __lsx_vilvh_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-vilvl.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vilvl.c new file mode 100644 index 00000000000..88c66f220b8 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vilvl.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]) = 0x0000000b0000000b; + *((unsigned long *)&__m128i_op1[0]) = 0x000201000000000b; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x000201000000000b; + __m128i_out = __lsx_vilvl_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_vilvl_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xfffefffefffffffc; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0xfffffefffffffeff; + *((unsigned long *)&__m128i_result[0]) = 0xfffffffffffffcff; + __m128i_out = __lsx_vilvl_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x7404443064403aec; + *((unsigned long *)&__m128i_op0[0]) = 0x0000d6eefefc0498; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffff7f800000; + *((unsigned long *)&__m128i_op1[0]) = 0x2d1da85b7f800000; + *((unsigned long *)&__m128i_result[1]) = 0x002d001dd6a8ee5b; + *((unsigned long *)&__m128i_result[0]) = 0xfe7ffc8004009800; + __m128i_out = __lsx_vilvl_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_vilvl_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]) = 0x0000000000000800; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vilvl_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]) = 0x0010001000100010; + *((unsigned long *)&__m128i_op1[0]) = 0x0010001000100010; + *((unsigned long *)&__m128i_result[1]) = 0x0000001000000010; + *((unsigned long *)&__m128i_result[0]) = 0x0000001000000010; + __m128i_out = __lsx_vilvl_b (__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]) = 0x1000100010001000; + *((unsigned long *)&__m128i_op1[0]) = 0x1000100010001000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000c7fff000c; + *((unsigned long *)&__m128i_result[0]) = 0x1000100010001000; + __m128i_out = __lsx_vilvl_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00ff00ff0000007f; + *((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_vilvl_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000001e8e1d8; + *((unsigned long *)&__m128i_op0[0]) = 0x000000e400000001; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000001e8e1d8; + *((unsigned long *)&__m128i_op1[0]) = 0x000000e400000001; + *((unsigned long *)&__m128i_result[1]) = 0x000000000000e4e4; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000101; + __m128i_out = __lsx_vilvl_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]) = 0x0008000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0008000000000000; + __m128i_out = __lsx_vilvl_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_vilvl_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]) = 0xffffffffffffffff; + __m128i_out = __lsx_vilvl_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]) = 0x00000000ffffffe0; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000ffff0000ffe0; + __m128i_out = __lsx_vilvl_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_vilvl_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]) = 0xbafebb00ffd500fe; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vilvl_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x80808080806b000b; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffff80005613; + *((unsigned long *)&__m128i_op1[0]) = 0x007f800000000000; + *((unsigned long *)&__m128i_result[1]) = 0x8000807f80808000; + *((unsigned long *)&__m128i_result[0]) = 0x80006b0000000b00; + __m128i_out = __lsx_vilvl_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000080808000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x80808080806b000b; + *((unsigned long *)&__m128i_result[1]) = 0x0080008000800080; + *((unsigned long *)&__m128i_result[0]) = 0x0080006b0000000b; + __m128i_out = __lsx_vilvl_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_vilvl_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xc0808000c0808000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xc080800000000000; + *((unsigned long *)&__m128i_result[0]) = 0xc080800000000000; + __m128i_out = __lsx_vilvl_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000002; + *((unsigned long *)&__m128i_op0[0]) = 0x00ff010300ff0103; + *((unsigned long *)&__m128i_op1[1]) = 0x7ff0000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x7ff0000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x007ffff001000300; + *((unsigned long *)&__m128i_result[0]) = 0x0000ff0001000300; + __m128i_out = __lsx_vilvl_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]) = 0x7ffffffe00000000; + *((unsigned long *)&__m128i_op1[0]) = 0x7ffffffe00000000; + *((unsigned long *)&__m128i_result[1]) = 0x007f00ff00ff00fe; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vilvl_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + int_out = __lsx_vpickve2gr_b (__m128i_op0, 0x8); + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vilvl_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0002000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000ff00ff; + *((unsigned long *)&__m128i_op1[0]) = 0x0014001400140000; + *((unsigned long *)&__m128i_result[1]) = 0x0000001400000014; + *((unsigned long *)&__m128i_result[0]) = 0x0000001400000000; + __m128i_out = __lsx_vilvl_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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x000000009c007c00; + *((unsigned long *)&__m128i_result[0]) = 0x0000000071007600; + __m128i_out = __lsx_vilvl_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x9c9c9c9c00000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000020; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000020; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vilvl_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000060002; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000060002; + *((unsigned long *)&__m128i_op1[1]) = 0xe4c8b96e2560afe9; + *((unsigned long *)&__m128i_op1[0]) = 0xc001a1867fffa207; + *((unsigned long *)&__m128i_result[1]) = 0x0000c0010000a186; + *((unsigned long *)&__m128i_result[0]) = 0x00067fff0002a207; + __m128i_out = __lsx_vilvl_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000014414104505; + *((unsigned long *)&__m128i_op0[0]) = 0x1011050040004101; + *((unsigned long *)&__m128i_op1[1]) = 0x0000014414104505; + *((unsigned long *)&__m128i_op1[0]) = 0x1011050040004101; + *((unsigned long *)&__m128i_result[1]) = 0x1010111105050000; + *((unsigned long *)&__m128i_result[0]) = 0x4040000041410101; + __m128i_out = __lsx_vilvl_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_vilvl_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffac5cffffac5c; + *((unsigned long *)&__m128i_op0[0]) = 0xffffac5cffffac5c; + *((unsigned long *)&__m128i_op1[1]) = 0x010169d9010169d9; + *((unsigned long *)&__m128i_op1[0]) = 0x01010287010146a1; + *((unsigned long *)&__m128i_result[1]) = 0xff01ff01ac025c87; + *((unsigned long *)&__m128i_result[0]) = 0xff01ff01ac465ca1; + __m128i_out = __lsx_vilvl_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xff01ff01ac025c87; + *((unsigned long *)&__m128i_op0[0]) = 0xff01ff01ac465ca1; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000004; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xff01ff0100000000; + *((unsigned long *)&__m128i_result[0]) = 0xac465ca100000000; + __m128i_out = __lsx_vilvl_w (__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]) = 0x00000000246d9755; + *((unsigned long *)&__m128i_op1[0]) = 0x000000002427c2ee; + *((unsigned long *)&__m128i_result[1]) = 0xf8e10000a03a0000; + *((unsigned long *)&__m128i_result[0]) = 0xffff2427e3e2c2ee; + __m128i_out = __lsx_vilvl_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffe4ffe4ffe4ffe4; + *((unsigned long *)&__m128i_op0[0]) = 0xffe4ffe4ffe4ffe4; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000011ff040; + *((unsigned long *)&__m128i_result[1]) = 0xff00e400ff00e400; + *((unsigned long *)&__m128i_result[0]) = 0xff01e41ffff0e440; + __m128i_out = __lsx_vilvl_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xff00e400ff00e400; + *((unsigned long *)&__m128i_op0[0]) = 0xff01e41ffff0ffff; + *((unsigned long *)&__m128i_op1[1]) = 0xffff000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0xffff000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xff01ffffe41f0000; + *((unsigned long *)&__m128i_result[0]) = 0xfff00000ffff0000; + __m128i_out = __lsx_vilvl_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-vinsgr2vr.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vinsgr2vr.c new file mode 100644 index 00000000000..2b9dcc0b55b --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vinsgr2vr.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; + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + int_op1 = 0x0000007942652524; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x4265252400000000; + __m128i_out = __lsx_vinsgr2vr_w (__m128i_op0, int_op1, 0x1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + int_op1 = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vinsgr2vr_b (__m128i_op0, int_op1, 0x3); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + int_op1 = 0x0000007942652524; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffff2524ffffffff; + __m128i_out = __lsx_vinsgr2vr_h (__m128i_op0, int_op1, 0x2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000000017fff9000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000210011084; + int_op1 = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x000000017fff9000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000200000000; + __m128i_out = __lsx_vinsgr2vr_w (__m128i_op0, int_op1, 0x0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000ffffffff; + long_op1 = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00000000ffffffff; + __m128i_out = __lsx_vinsgr2vr_d (__m128i_op0, long_op1, 0x1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000ffffffff; + int_op1 = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00000000ffff0000; + __m128i_out = __lsx_vinsgr2vr_h (__m128i_op0, int_op1, 0x0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + int_op1 = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vinsgr2vr_b (__m128i_op0, int_op1, 0xf); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0080000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0080000000000000; + int_op1 = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0080000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0080000000000000; + __m128i_out = __lsx_vinsgr2vr_b (__m128i_op0, int_op1, 0x9); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffff00000001; + *((unsigned long *)&__m128i_op0[0]) = 0x5d5d5d5d5d5d5d55; + int_op1 = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffff00000001; + *((unsigned long *)&__m128i_result[0]) = 0x5d5d5d005d5d5d55; + __m128i_out = __lsx_vinsgr2vr_b (__m128i_op0, int_op1, 0x4); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + int_out = __lsx_vpickve2gr_w (__m128i_op0, 0x1); + *((unsigned long *)&__m128i_op0[1]) = 0x8000000080000000; + *((unsigned long *)&__m128i_op0[0]) = 0x8000000080000000; + int_op1 = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x8000000080000000; + *((unsigned long *)&__m128i_result[0]) = 0x8000000080000000; + __m128i_out = __lsx_vinsgr2vr_h (__m128i_op0, int_op1, 0x2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + unsigned_int_out = __lsx_vpickve2gr_wu (__m128i_op0, 0x2); + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + int_op1 = 0x00000000ffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00000000ffff0000; + __m128i_out = __lsx_vinsgr2vr_h (__m128i_op0, int_op1, 0x1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000004; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + int_op1 = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vinsgr2vr_w (__m128i_op0, int_op1, 0x2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x2020202020202020; + *((unsigned long *)&__m128i_op0[0]) = 0x2020202020202020; + int_op1 = 0x00000000000000ff; + *((unsigned long *)&__m128i_result[1]) = 0x2020202020202020; + *((unsigned long *)&__m128i_result[0]) = 0x202020202020ff20; + __m128i_out = __lsx_vinsgr2vr_b (__m128i_op0, int_op1, 0x1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000800000000; + *((unsigned long *)&__m128i_op0[0]) = 0x00fe01fc0005fff4; + int_op1 = 0x0000000020202020; + *((unsigned long *)&__m128i_result[1]) = 0x0000000820202020; + *((unsigned long *)&__m128i_result[0]) = 0x00fe01fc0005fff4; + __m128i_out = __lsx_vinsgr2vr_w (__m128i_op0, int_op1, 0x2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffbfffffffbf; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffbfffffffbf; + long_op1 = 0x0000000000003a24; + *((unsigned long *)&__m128i_result[1]) = 0xffffffbfffffffbf; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000003a24; + __m128i_out = __lsx_vinsgr2vr_d (__m128i_op0, long_op1, 0x0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x7ef8000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x7ef8000000000000; + int_op1 = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x7ef8000000000000; + __m128i_out = __lsx_vinsgr2vr_w (__m128i_op0, int_op1, 0x3); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0001000100000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0001000100000000; + long_op1 = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0001000100000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vinsgr2vr_d (__m128i_op0, long_op1, 0x0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + int_op1 = 0x00000000000000ff; + *((unsigned long *)&__m128i_result[1]) = 0xffffffff000000ff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vinsgr2vr_w (__m128i_op0, int_op1, 0x2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000001000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000001000; + int_op1 = 0x000000007ff00000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000001000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000001000; + __m128i_out = __lsx_vinsgr2vr_h (__m128i_op0, int_op1, 0x2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + int_op1 = 0x0000000000020006; + *((unsigned long *)&__m128i_result[1]) = 0x0000060000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vinsgr2vr_b (__m128i_op0, int_op1, 0xd); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + int_op1 = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vinsgr2vr_w (__m128i_op0, int_op1, 0x2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + int_op1 = 0x0000000000020006; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000600; + __m128i_out = __lsx_vinsgr2vr_b (__m128i_op0, int_op1, 0x1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000003; + int_op1 = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000003; + __m128i_out = __lsx_vinsgr2vr_b (__m128i_op0, int_op1, 0x2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + int_op1 = 0x00000000000000ff; + *((unsigned long *)&__m128i_result[1]) = 0x000000ff00000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vinsgr2vr_w (__m128i_op0, int_op1, 0x3); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + int_op1 = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vinsgr2vr_w (__m128i_op0, int_op1, 0x1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + int_op1 = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vinsgr2vr_h (__m128i_op0, int_op1, 0x2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000001f1f; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + int_op1 = 0x00000000000000ff; + *((unsigned long *)&__m128i_result[1]) = 0x00ff000000001f1f; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vinsgr2vr_b (__m128i_op0, int_op1, 0xe); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + long_op1 = 0x0000000000000040; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000040; + __m128i_out = __lsx_vinsgr2vr_d (__m128i_op0, long_op1, 0x0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000ffff0000; + int_op1 = 0x00000000000000ff; + *((unsigned long *)&__m128i_result[1]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x000000ffffff0000; + __m128i_out = __lsx_vinsgr2vr_w (__m128i_op0, int_op1, 0x1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + int_op1 = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_result[0]) = 0xffff000000000000; + __m128i_out = __lsx_vinsgr2vr_h (__m128i_op0, int_op1, 0x3); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x04faf60009f5f092; + *((unsigned long *)&__m128i_op0[0]) = 0x04fafa9200000000; + int_op1 = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x04faf600fff5f092; + *((unsigned long *)&__m128i_result[0]) = 0x04fafa9200000000; + __m128i_out = __lsx_vinsgr2vr_b (__m128i_op0, int_op1, 0xb); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + int_op1 = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vinsgr2vr_b (__m128i_op0, int_op1, 0x5); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vpackev.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vpackev.c new file mode 100644 index 00000000000..030e87fd8c5 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vpackev.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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x00001802041b0013; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x00001802041b0013; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vpackev_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]) = 0x0000ffff0000ffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000ffff0000ffff; + __m128i_out = __lsx_vpackev_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_vpackev_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]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x00000000ffffffff; + __m128i_out = __lsx_vpackev_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]) = 0x0000ffff00000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000ffff0000ffff; + *((unsigned long *)&__m128i_result[1]) = 0x000000ff00000000; + *((unsigned long *)&__m128i_result[0]) = 0x000000ff000000ff; + __m128i_out = __lsx_vpackev_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_vpackev_d (__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]) = 0x0080000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0xf4b6f3f52f4ef4a8; + *((unsigned long *)&__m128i_result[1]) = 0xff80000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xf4b6f3f52f4ef4a8; + __m128i_out = __lsx_vpackev_d (__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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x000000000000ffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000ffff0000ffff; + __m128i_out = __lsx_vpackev_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]) = 0x10f917d72d3d01e4; + *((unsigned long *)&__m128i_op1[0]) = 0x203e16d116de012b; + *((unsigned long *)&__m128i_result[1]) = 0x00f900d7003d00e4; + *((unsigned long *)&__m128i_result[0]) = 0x003e00d100de002b; + __m128i_out = __lsx_vpackev_b (__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]) = 0x0000010000000000; + __m128i_out = __lsx_vpackev_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xc2f9bafac2fac2fa; + *((unsigned long *)&__m128i_op1[1]) = 0xbdf077eee7e20468; + *((unsigned long *)&__m128i_op1[0]) = 0xe3b1cc6953e7db29; + *((unsigned long *)&__m128i_result[1]) = 0x00000000e7e20468; + *((unsigned long *)&__m128i_result[0]) = 0xc2fac2fa53e7db29; + __m128i_out = __lsx_vpackev_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_vpackev_d (__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]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_result[0]) = 0xffffffff00000000; + __m128i_out = __lsx_vpackev_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]) = 0xf8f8e018f8f8e810; + *((unsigned long *)&__m128i_op1[0]) = 0xf8f8f008f8f8f800; + *((unsigned long *)&__m128i_result[1]) = 0x0000e0180000e810; + *((unsigned long *)&__m128i_result[0]) = 0x0000f0080000f800; + __m128i_out = __lsx_vpackev_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x1211100f11100f0e; + *((unsigned long *)&__m128i_op0[0]) = 0x100f0e0d0f0e0d0c; + *((unsigned long *)&__m128i_op1[1]) = 0x0000002000000020; + *((unsigned long *)&__m128i_op1[0]) = 0x0000002000000020; + *((unsigned long *)&__m128i_result[1]) = 0x11000f2010000e20; + *((unsigned long *)&__m128i_result[0]) = 0x0f000d200e000c20; + __m128i_out = __lsx_vpackev_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]) = 0xe3e3e3e3e3e3e3e3; + *((unsigned long *)&__m128i_op1[0]) = 0xe3e3e3e3e3e3e3e3; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xe3e3e3e3e3e3e3e3; + __m128i_out = __lsx_vpackev_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]) = 0x7ffe7ffe7ffe7ffe; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x00007ffe00007ffe; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vpackev_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000001c00ffffe; + *((unsigned long *)&__m128i_op0[0]) = 0x00000001fffffffe; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x00007f7f00007f7f; + *((unsigned long *)&__m128i_result[1]) = 0x000001000f00fe00; + *((unsigned long *)&__m128i_result[0]) = 0x0000017fff00fe7f; + __m128i_out = __lsx_vpackev_b (__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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x3f8000003f800000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vpackev_d (__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]) = 0xfffff000f0008d3c; + *((unsigned long *)&__m128i_op1[0]) = 0xfffff0016fff8d3d; + *((unsigned long *)&__m128i_result[1]) = 0x00ff000000003c3c; + *((unsigned long *)&__m128i_result[0]) = 0x00ff0101ffff3d3d; + __m128i_out = __lsx_vpackev_b (__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]) = 0x0000006f00001f0a; + *((unsigned long *)&__m128i_op1[0]) = 0x0000958affff995d; + *((unsigned long *)&__m128i_result[1]) = 0xffff000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000958affff995d; + __m128i_out = __lsx_vpackev_d (__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]) = 0x0001000100010001; + *((unsigned long *)&__m128i_result[0]) = 0x0001000100010001; + __m128i_out = __lsx_vpackev_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_vpackev_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]) = 0x00000001ca02f854; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000100013fa0; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000100013fa0; + __m128i_out = __lsx_vpackev_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffefffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffefffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0xffffefefffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vpackev_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0002fffefffd0001; + *((unsigned long *)&__m128i_op1[1]) = 0x1202120212021202; + *((unsigned long *)&__m128i_op1[0]) = 0x1202120212021202; + *((unsigned long *)&__m128i_result[1]) = 0x0002000200020002; + *((unsigned long *)&__m128i_result[0]) = 0x0202fe02fd020102; + __m128i_out = __lsx_vpackev_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x5a6f5c53ebed3faa; + *((unsigned long *)&__m128i_op0[0]) = 0xa36aca4435b8b8e1; + *((unsigned long *)&__m128i_op1[1]) = 0x5a6f5c53ebed3faa; + *((unsigned long *)&__m128i_op1[0]) = 0xa36aca4435b8b8e1; + *((unsigned long *)&__m128i_result[1]) = 0x5c535c533faa3faa; + *((unsigned long *)&__m128i_result[0]) = 0xca44ca44b8e1b8e1; + __m128i_out = __lsx_vpackev_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0004000400040004; + *((unsigned long *)&__m128i_op0[0]) = 0x0004000400040004; + *((unsigned long *)&__m128i_op1[1]) = 0x77c0404a4000403a; + *((unsigned long *)&__m128i_op1[0]) = 0x77c03fd640003fc6; + *((unsigned long *)&__m128i_result[1]) = 0x04c0044a0400043a; + *((unsigned long *)&__m128i_result[0]) = 0x04c004d6040004c6; + __m128i_out = __lsx_vpackev_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x000000006362ffff; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000d0000000d; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000dffff000d; + __m128i_out = __lsx_vpackev_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000010000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000002002; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000010000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vpackev_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xc000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vpackev_w (__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]) = 0x0000000200000002; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000200000002; + *((unsigned long *)&__m128i_result[1]) = 0x0002000200020002; + *((unsigned long *)&__m128i_result[0]) = 0x0002000200020002; + __m128i_out = __lsx_vpackev_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]) = 0x0000208000002080; + *((unsigned long *)&__m128i_op1[0]) = 0x0000208000002080; + *((unsigned long *)&__m128i_result[1]) = 0x2080208020802080; + *((unsigned long *)&__m128i_result[0]) = 0x2080208020802080; + __m128i_out = __lsx_vpackev_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]) = 0x000000000000000b; + *((unsigned long *)&__m128i_op1[0]) = 0x000000000000000b; + *((unsigned long *)&__m128i_result[1]) = 0x000000000000000b; + *((unsigned long *)&__m128i_result[0]) = 0x000000000000000b; + __m128i_out = __lsx_vpackev_h (__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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x00000000001b0000; + *((unsigned long *)&__m128i_result[0]) = 0x00000000001b0000; + __m128i_out = __lsx_vpackev_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]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x00000000ffffffff; + __m128i_out = __lsx_vpackev_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_vpackev_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000000000000053a; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xfff9000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0xfffc000400000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xfffc000400000000; + __m128i_out = __lsx_vpackev_d (__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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000002000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000001f00000000; + __m128i_out = __lsx_vpackev_w (__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]) = 0xff800000ff800000; + *((unsigned long *)&__m128i_op1[0]) = 0xff800000ff800000; + *((unsigned long *)&__m128i_result[1]) = 0x8080000080800000; + *((unsigned long *)&__m128i_result[0]) = 0x9380c4009380c400; + __m128i_out = __lsx_vpackev_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffc2007aff230027; + *((unsigned long *)&__m128i_op0[0]) = 0x0080005eff600001; + *((unsigned long *)&__m128i_op1[1]) = 0x01017f3c00000148; + *((unsigned long *)&__m128i_op1[0]) = 0x117d7f7b093d187f; + *((unsigned long *)&__m128i_result[1]) = 0xff23002700000148; + *((unsigned long *)&__m128i_result[0]) = 0xff600001093d187f; + __m128i_out = __lsx_vpackev_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]) = 0xffff0000ffff0000; + *((unsigned long *)&__m128i_result[0]) = 0xffff0000ffff0000; + __m128i_out = __lsx_vpackev_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]) = 0x0002711250a27112; + *((unsigned long *)&__m128i_op1[0]) = 0x00d2701294027112; + *((unsigned long *)&__m128i_result[1]) = 0xffff7112ffff7112; + *((unsigned long *)&__m128i_result[0]) = 0xffff7012ffff7112; + __m128i_out = __lsx_vpackev_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]) = 0x30eb020302101b03; + *((unsigned long *)&__m128i_op1[0]) = 0x020310d0c0030220; + *((unsigned long *)&__m128i_result[1]) = 0x020310d0c0030220; + *((unsigned long *)&__m128i_result[0]) = 0x020310d0c0030220; + __m128i_out = __lsx_vpackev_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_vpackev_d (__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]) = 0x00000000000eefff; + *((unsigned long *)&__m128i_op1[0]) = 0xf8e1a03affffe3e2; + *((unsigned long *)&__m128i_result[1]) = 0x00000000efffefff; + *((unsigned long *)&__m128i_result[0]) = 0xa03aa03ae3e2e3e2; + __m128i_out = __lsx_vpackev_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]) = 0x02b010f881a281a2; + *((unsigned long *)&__m128i_op1[0]) = 0x27b169bbb8140001; + *((unsigned long *)&__m128i_result[1]) = 0x000010f8000081a2; + *((unsigned long *)&__m128i_result[0]) = 0x000069bb00000001; + __m128i_out = __lsx_vpackev_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_vpackev_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-vpackod.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vpackod.c new file mode 100644 index 00000000000..783eedae1a1 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vpackod.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_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vpackod_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]) = 0x000201000000000b; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000020100; + __m128i_out = __lsx_vpackod_w (__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]) = 0x3ff0000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0xfffc002000000000; + *((unsigned long *)&__m128i_result[1]) = 0x00003ff000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000fffc00000000; + __m128i_out = __lsx_vpackod_h (__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]) = 0x03574e3a62407e03; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000001010000; + *((unsigned long *)&__m128i_result[1]) = 0x03574e3a03574e3a; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vpackod_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]) = 0x0000000000000020; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vpackod_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]) = 0x00000000000001fe; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vpackod_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_vpackod_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]) = 0x00000001fffffffe; + *((unsigned long *)&__m128i_op1[0]) = 0x00000001fffffffe; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000001; + __m128i_out = __lsx_vpackod_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000000000000003a; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000100000015; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vpackod_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]) = 0x0000ffff0000ffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000ffff0000ffff; + __m128i_out = __lsx_vpackod_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_vpackod_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_vpackod_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xe0404041e0404041; + *((unsigned long *)&__m128i_op0[0]) = 0xe0404041e0404041; + *((unsigned long *)&__m128i_op1[1]) = 0x803f800080000000; + *((unsigned long *)&__m128i_op1[0]) = 0xe0404041c0404040; + *((unsigned long *)&__m128i_result[1]) = 0xe0404041e0404041; + *((unsigned long *)&__m128i_result[0]) = 0x803f800080000000; + __m128i_out = __lsx_vpackod_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_vpackod_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]) = 0xfe80000000000001; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00fe000000000000; + __m128i_out = __lsx_vpackod_b (__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]) = 0xff80000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xfe80ff80ffff0000; + __m128i_out = __lsx_vpackod_h (__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]) = 0x11000f2000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0f000d2000000000; + __m128i_out = __lsx_vpackod_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]) = 0x4f8000004f800000; + *((unsigned long *)&__m128i_op1[0]) = 0x4f8000004f800000; + *((unsigned long *)&__m128i_result[1]) = 0x4f804f804f804f80; + *((unsigned long *)&__m128i_result[0]) = 0x4f804f804f804f80; + __m128i_out = __lsx_vpackod_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000006f00001f0a; + *((unsigned long *)&__m128i_op0[0]) = 0x0000c000ffffc000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000006f00000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000c00000000000; + __m128i_out = __lsx_vpackod_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x40f0001000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x40f0001000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xfffcfffcfffcfffc; + *((unsigned long *)&__m128i_op1[0]) = 0xfffcfffcfffcfffc; + *((unsigned long *)&__m128i_result[1]) = 0x40f0001000000000; + *((unsigned long *)&__m128i_result[0]) = 0xfffcfffcfffcfffc; + __m128i_out = __lsx_vpackod_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_vpackod_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_vpackod_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]) = 0xffffffffffffffff; + __m128i_out = __lsx_vpackod_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000002000000020; + *((unsigned long *)&__m128i_op0[0]) = 0x2222272011111410; + *((unsigned long *)&__m128i_op1[1]) = 0x0000002000000020; + *((unsigned long *)&__m128i_op1[0]) = 0x2222272011111410; + *((unsigned long *)&__m128i_result[1]) = 0x0000002000000020; + *((unsigned long *)&__m128i_result[0]) = 0x0000002000000020; + __m128i_out = __lsx_vpackod_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000ffff0000ffff; + *((unsigned long *)&__m128i_op0[0]) = 0x0000ffff0000ff00; + *((unsigned long *)&__m128i_op1[1]) = 0xfffffffffffffef8; + *((unsigned long *)&__m128i_op1[0]) = 0xffdfffdfffdffee0; + *((unsigned long *)&__m128i_result[1]) = 0x0000ffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000ffffffdfffdf; + __m128i_out = __lsx_vpackod_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]) = 0x0010100000100000; + *((unsigned long *)&__m128i_op1[0]) = 0x1000100000101000; + *((unsigned long *)&__m128i_result[1]) = 0x0000001000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0010001000000010; + __m128i_out = __lsx_vpackod_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x21201f1e19181716; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x01203f1e3d1c3b1a; + *((unsigned long *)&__m128i_op1[0]) = 0x3918371635143312; + *((unsigned long *)&__m128i_result[1]) = 0x21011f3f193d173b; + *((unsigned long *)&__m128i_result[0]) = 0xff39ff37ff35ff33; + __m128i_out = __lsx_vpackod_b (__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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffff0000; + *((unsigned long *)&__m128i_result[1]) = 0x0000ffff3fbfffff; + *((unsigned long *)&__m128i_result[0]) = 0x7fffffff7fffffff; + __m128i_out = __lsx_vpackod_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]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_result[0]) = 0xffffffff00000000; + __m128i_out = __lsx_vpackod_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]) = 0xffffffff80806362; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000ff00ff; + *((unsigned long *)&__m128i_result[1]) = 0x0000ffff00008080; + *((unsigned long *)&__m128i_result[0]) = 0x00000000000000ff; + __m128i_out = __lsx_vpackod_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000100000000fc; + *((unsigned long *)&__m128i_op0[0]) = 0x00000100000000fc; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000010000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000010000000000; + __m128i_out = __lsx_vpackod_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]) = 0x0404050404040404; + *((unsigned long *)&__m128i_op1[0]) = 0x0404050404040404; + *((unsigned long *)&__m128i_result[1]) = 0x0000000004040504; + *((unsigned long *)&__m128i_result[0]) = 0x0000000004040504; + __m128i_out = __lsx_vpackod_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x8000807f80808000; + *((unsigned long *)&__m128i_op0[0]) = 0x80006b0000000b00; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x80808080806b000b; + *((unsigned long *)&__m128i_result[1]) = 0x8000807f00000000; + *((unsigned long *)&__m128i_result[0]) = 0x80006b0080808080; + __m128i_out = __lsx_vpackod_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000400000004000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffff0000; + *((unsigned long *)&__m128i_result[1]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x00004000ffffffff; + __m128i_out = __lsx_vpackod_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]) = 0x0001000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0001000100000000; + *((unsigned long *)&__m128i_result[0]) = 0x0001000100010000; + __m128i_out = __lsx_vpackod_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000002; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000080008; + *((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_vpackod_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]) = 0xffff0000ffff0000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x00ff000000ff0000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vpackod_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_vpackod_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000001400000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffff000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vpackod_h (__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_vpackod_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_vpackod_d (__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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xfffefffe00000000; + *((unsigned long *)&__m128i_result[0]) = 0xfffefffe00000000; + __m128i_out = __lsx_vpackod_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]) = 0xcd636363cd636363; + *((unsigned long *)&__m128i_op1[0]) = 0xcd636363cd636363; + *((unsigned long *)&__m128i_result[1]) = 0x00cd006300cd0063; + *((unsigned long *)&__m128i_result[0]) = 0x00cd006300cd0063; + __m128i_out = __lsx_vpackod_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000aa822a79308f6; + *((unsigned long *)&__m128i_op0[0]) = 0x03aa558e1d37b5a1; + *((unsigned long *)&__m128i_op1[1]) = 0x00000000084d12ce; + *((unsigned long *)&__m128i_op1[0]) = 0x0000ff80fd820000; + *((unsigned long *)&__m128i_result[1]) = 0x000aa822a79308f6; + *((unsigned long *)&__m128i_result[0]) = 0x00000000084d12ce; + __m128i_out = __lsx_vpackod_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]) = 0x2e34594c3b000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x002e0059003b0000; + __m128i_out = __lsx_vpackod_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x001e001e001e001e; + *((unsigned long *)&__m128i_op0[0]) = 0x001e001e001e001e; + *((unsigned long *)&__m128i_op1[1]) = 0xffaeffaeffaeffae; + *((unsigned long *)&__m128i_op1[0]) = 0xffaeffaeffaeffae; + *((unsigned long *)&__m128i_result[1]) = 0x001effae001effae; + *((unsigned long *)&__m128i_result[0]) = 0x001effae001effae; + __m128i_out = __lsx_vpackod_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000440efffff000; + *((unsigned long *)&__m128i_op0[0]) = 0x000000000000003b; + *((unsigned long *)&__m128i_op1[1]) = 0x0000440efffff000; + *((unsigned long *)&__m128i_op1[0]) = 0x000000000000003b; + *((unsigned long *)&__m128i_result[1]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vpackod_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000ffff0000ffff; + *((unsigned long *)&__m128i_op0[0]) = 0x0000ffff0000ffff; + *((unsigned long *)&__m128i_op1[1]) = 0xffff2356fe165486; + *((unsigned long *)&__m128i_op1[0]) = 0x5efeb3165bd7653d; + *((unsigned long *)&__m128i_result[1]) = 0x0000ffff0000ffff; + *((unsigned long *)&__m128i_result[0]) = 0xffff2356fe165486; + __m128i_out = __lsx_vpackod_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000cecd00004657; + *((unsigned long *)&__m128i_op0[0]) = 0x0000c90000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x00019d9a00008cae; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000100000000; + __m128i_out = __lsx_vpackod_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-vpickev.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vpickev.c new file mode 100644 index 00000000000..58591f1bb16 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vpickev.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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vpickev_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]) = 0xc2409edab019323f; + *((unsigned long *)&__m128i_op1[0]) = 0x460f3b393ef4be3a; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x460f3b393ef4be3a; + __m128i_out = __lsx_vpickev_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]) = 0x0004007c00fc0000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000fc0000; + __m128i_out = __lsx_vpickev_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_vpickev_d (__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]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x00000000ffffffff; + __m128i_out = __lsx_vpickev_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xfffefffefffefffe; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_result[1]) = 0xfffffffffefefefe; + *((unsigned long *)&__m128i_result[0]) = 0x000000000000ffff; + __m128i_out = __lsx_vpickev_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xedfaedfaedfaedfa; + *((unsigned long *)&__m128i_op0[0]) = 0xedfaedfaedfaedfa; + *((unsigned long *)&__m128i_op1[1]) = 0x00000000ffff0000; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000ffff0000; + *((unsigned long *)&__m128i_result[1]) = 0xedfaedfaedfaedfa; + *((unsigned long *)&__m128i_result[0]) = 0x00000000ffff0000; + __m128i_out = __lsx_vpickev_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]) = 0xffffffffffffffff; + __m128i_out = __lsx_vpickev_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x4811fda96793b23a; + *((unsigned long *)&__m128i_op0[0]) = 0x8f10624016be82fd; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_result[1]) = 0xfda9b23a624082fd; + *((unsigned long *)&__m128i_result[0]) = 0x00000000ffff0000; + __m128i_out = __lsx_vpickev_h (__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]) = 0xaaaaffebcfb748e0; + *((unsigned long *)&__m128i_op1[0]) = 0xfd293eab528e7ebe; + *((unsigned long *)&__m128i_result[1]) = 0x0000000100000001; + *((unsigned long *)&__m128i_result[0]) = 0xffeb48e03eab7ebe; + __m128i_out = __lsx_vpickev_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_vpickev_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]) = 0xfffffffffffffff7; + *((unsigned long *)&__m128i_op1[0]) = 0xfffffffffffffff7; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xfffffffffffffff7; + __m128i_out = __lsx_vpickev_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_vpickev_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_vpickev_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_vpickev_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_op0[0]) = 0xfffff00010000fff; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_op1[0]) = 0xfffff00010000fff; + *((unsigned long *)&__m128i_result[1]) = 0xfffff00010000fff; + *((unsigned long *)&__m128i_result[0]) = 0xfffff00010000fff; + __m128i_out = __lsx_vpickev_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]) = 0x0000000100000001; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000100000001; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000100000001; + __m128i_out = __lsx_vpickev_d (__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]) = 0x0000000100013fa0; + *((unsigned long *)&__m128i_result[1]) = 0x2000200000013fa0; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000013fa0; + __m128i_out = __lsx_vpickev_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000f7d1000000001; + *((unsigned long *)&__m128i_op0[0]) = 0x773324887fffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000017161515; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000095141311; + *((unsigned long *)&__m128i_result[1]) = 0x000000017fffffff; + *((unsigned long *)&__m128i_result[0]) = 0x1716151595141311; + __m128i_out = __lsx_vpickev_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x4040404040404040; + *((unsigned long *)&__m128i_op0[0]) = 0x4040404040404040; + *((unsigned long *)&__m128i_op1[1]) = 0x4040404040404040; + *((unsigned long *)&__m128i_op1[0]) = 0x4040404040404040; + *((unsigned long *)&__m128i_result[1]) = 0x4040404040404040; + *((unsigned long *)&__m128i_result[0]) = 0x4040404040404040; + __m128i_out = __lsx_vpickev_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000000dfa6e0c6; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000d46cdc13; + *((unsigned long *)&__m128i_op1[1]) = 0x7ef400ad21fc7081; + *((unsigned long *)&__m128i_op1[0]) = 0x28bf0351ec69b5f2; + *((unsigned long *)&__m128i_result[1]) = 0xdfa6e0c6d46cdc13; + *((unsigned long *)&__m128i_result[0]) = 0x21fc7081ec69b5f2; + __m128i_out = __lsx_vpickev_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_vpickev_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x04c0044a0400043a; + *((unsigned long *)&__m128i_op0[0]) = 0x04c004d6040004c6; + *((unsigned long *)&__m128i_op1[1]) = 0x0004000400040004; + *((unsigned long *)&__m128i_op1[0]) = 0x0004000400040004; + *((unsigned long *)&__m128i_result[1]) = 0x044a043a04d604c6; + *((unsigned long *)&__m128i_result[0]) = 0x0004000400040004; + __m128i_out = __lsx_vpickev_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x00001b4a00007808; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x00001b4a00007808; + *((unsigned long *)&__m128i_result[1]) = 0x00001b4a00007808; + *((unsigned long *)&__m128i_result[0]) = 0x00001b4a00007808; + __m128i_out = __lsx_vpickev_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x3fc03fc000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x7f801fe000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000ffff00010001; + *((unsigned long *)&__m128i_op1[0]) = 0x3fc03fc000000004; + *((unsigned long *)&__m128i_result[1]) = 0x7f801fe000000000; + *((unsigned long *)&__m128i_result[0]) = 0x3fc03fc000000004; + __m128i_out = __lsx_vpickev_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]) = 0x0000010000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000010000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vpickev_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]) = 0xffffffffffff0000; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xffff0000ffffffff; + __m128i_out = __lsx_vpickev_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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vpickev_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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vpickev_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_vpickev_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_vpickev_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_vpickev_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]) = 0x0000000001000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vpickev_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000000ffffff00; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000100000001; + *((unsigned long *)&__m128i_op1[0]) = 0x000103030102ffff; + *((unsigned long *)&__m128i_result[1]) = 0xffffff00ffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x000000010102ffff; + __m128i_out = __lsx_vpickev_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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x020310edc003023d; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vpickev_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]) = 0x01533b5e7489ae24; + *((unsigned long *)&__m128i_op1[0]) = 0xffffab7e71e33848; + *((unsigned long *)&__m128i_result[1]) = 0x000000000000ffff; + *((unsigned long *)&__m128i_result[0]) = 0x3b5eae24ab7e3848; + __m128i_out = __lsx_vpickev_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000000009c83e21a; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000022001818; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000e21a00001818; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vpickev_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]) = 0x4f4f4f4f4f4f4f4f; + __m128i_out = __lsx_vpickev_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-vpickod.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vpickod.c new file mode 100644 index 00000000000..74269e319b6 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vpickod.c @@ -0,0 +1,336 @@ +/* { 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_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vpickod_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000401000001; + *((unsigned long *)&__m128i_op0[0]) = 0x0001000100000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000001000001; + *((unsigned long *)&__m128i_op1[0]) = 0xffffe000ffff1fff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000401000001; + *((unsigned long *)&__m128i_result[0]) = 0x0000000001000001; + __m128i_out = __lsx_vpickod_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfff6fff6fff6fff6; + *((unsigned long *)&__m128i_op0[0]) = 0xfff6fff6fff6fff6; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0xf436f3f52f4ef4a8; + *((unsigned long *)&__m128i_result[1]) = 0xfff6fff6fff6fff6; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vpickod_d (__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]) = 0x0080000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0xf4b6f3f52f4ef4a8; + *((unsigned long *)&__m128i_result[1]) = 0x0080000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0080000000000000; + __m128i_out = __lsx_vpickod_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_vpickod_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfffffffff51cf8da; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffd6040188; + *((unsigned long *)&__m128i_op1[1]) = 0x0000101fffff8b68; + *((unsigned long *)&__m128i_op1[0]) = 0x00000b6fffff8095; + *((unsigned long *)&__m128i_result[1]) = 0xfffff51cffffd604; + *((unsigned long *)&__m128i_result[0]) = 0x0000ffff0000ffff; + __m128i_out = __lsx_vpickod_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + unsigned_int_out = __lsx_vpickve2gr_bu (__m128i_op0, 0xa); + *((unsigned long *)&__m128i_op0[1]) = 0xffffff0cffffff18; + *((unsigned long *)&__m128i_op0[0]) = 0xfefffefffeff6a0c; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0xc2f9bafac2fac2fa; + *((unsigned long *)&__m128i_result[1]) = 0xfffffffffefefe6a; + *((unsigned long *)&__m128i_result[0]) = 0x00000000c2bac2c2; + __m128i_out = __lsx_vpickod_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]) = 0x11000f2010000e20; + *((unsigned long *)&__m128i_op1[0]) = 0x0f000d200e000c20; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x11000f200f000d20; + __m128i_out = __lsx_vpickod_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000805; + *((unsigned long *)&__m128i_op0[0]) = 0x978d95ac768d8784; + *((unsigned long *)&__m128i_op1[1]) = 0x0001000100010001; + *((unsigned long *)&__m128i_op1[0]) = 0x0001000104000800; + *((unsigned long *)&__m128i_result[1]) = 0x0000000897957687; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000408; + __m128i_out = __lsx_vpickod_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]) = 0x0000000000000003; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vpickod_h (__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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000ffffffff0001; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vpickod_h (__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]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vpickod_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_vpickod_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000000ca02f854; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x00000000ca02f854; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000ca0200000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000ca0200000000; + __m128i_out = __lsx_vpickod_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000000c6c6ee22; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000c6c62e8a; + *((unsigned long *)&__m128i_op1[1]) = 0x00000000c6c6ee22; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000c6c62e8a; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vpickod_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x21201f1e1d001b1a; + *((unsigned long *)&__m128i_op0[0]) = 0x1918171615141312; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x21201f1e19181716; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vpickod_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x00ff00ff00000000; + *((unsigned long *)&__m128i_op1[1]) = 0x000000ff000000ff; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x000000ff000000ff; + __m128i_out = __lsx_vpickod_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]) = 0x0006000000040000; + *((unsigned long *)&__m128i_op1[0]) = 0x0002000000000007; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0006000000040000; + __m128i_out = __lsx_vpickod_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]) = 0x6363636363636363; + *((unsigned long *)&__m128i_op1[0]) = 0x6363636363636363; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x6363636363636363; + __m128i_out = __lsx_vpickod_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000020000020; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000020000020; + *((unsigned long *)&__m128i_op1[1]) = 0x000000000000ffff; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000200000002000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vpickod_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x7f801fe000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x3fc03fc000000004; + *((unsigned long *)&__m128i_op1[1]) = 0x3fc03fc000000003; + *((unsigned long *)&__m128i_op1[0]) = 0x7f7f1fd800000004; + *((unsigned long *)&__m128i_result[1]) = 0x7f1f00003f3f0000; + *((unsigned long *)&__m128i_result[0]) = 0x3f3f00007f1f0000; + __m128i_out = __lsx_vpickod_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xff9f017f1fa0b199; + *((unsigned long *)&__m128i_op0[0]) = 0x1197817fd839ea3e; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000033; + *((unsigned long *)&__m128i_result[1]) = 0xff011fb11181d8ea; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vpickod_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]) = 0x0000000080808000; + __m128i_out = __lsx_vpickod_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]) = 0x0001000100010001; + *((unsigned long *)&__m128i_result[0]) = 0x0001000100010001; + __m128i_out = __lsx_vpickod_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_vpickod_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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffff0000ffff0000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vpickod_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xfffefffefffefffe; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x00000000fffefffe; + *((unsigned long *)&__m128i_result[0]) = 0xffffffff00000000; + __m128i_out = __lsx_vpickod_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]) = 0x0000000000000080; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vpickod_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]) = 0x000000003ddc5dac; + *((unsigned long *)&__m128i_result[1]) = 0x67ebb2ebc884ed3f; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000003ddc; + __m128i_out = __lsx_vpickod_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_vpickod_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_vpickod_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_vpickod_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000000000003e2; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x00000000000003e2; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vpickod_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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000010000; + __m128i_out = __lsx_vpickod_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_vpickod_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-vpickve2gr.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vpickve2gr.c new file mode 100644 index 00000000000..acca2bee9fa --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vpickve2gr.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]) = 0x0000000000000001; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000001; + unsigned_int_result = 0x0000000000000000; + unsigned_int_out = __lsx_vpickve2gr_hu (__m128i_op0, 0x7); + ASSERTEQ_int (__LINE__, unsigned_int_result, unsigned_int_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000ffffffff; + int_out = __lsx_vpickve2gr_b (__m128i_op0, 0x4); + int_result = 0x0000000000000000; + ASSERTEQ_int (__LINE__, int_result, int_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + long_int_result = 0x0000000000000000; + long_int_out = __lsx_vpickve2gr_d (__m128i_op0, 0x0); + ASSERTEQ_int (__LINE__, long_int_result, long_int_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + unsigned_int_result = 0x0000000000000000; + unsigned_int_out = __lsx_vpickve2gr_wu (__m128i_op0, 0x3); + ASSERTEQ_int (__LINE__, unsigned_int_result, unsigned_int_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000ff0000ff0000; + *((unsigned long *)&__m128i_op0[0]) = 0x01fc020000fe0100; + unsigned_int_result = 0x0000000000000000; + unsigned_int_out = __lsx_vpickve2gr_hu (__m128i_op0, 0x7); + ASSERTEQ_int (__LINE__, unsigned_int_result, unsigned_int_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + unsigned_int_result = 0x0000000000000000; + unsigned_long_int_out = __lsx_vpickve2gr_du (__m128i_op0, 0x1); + ASSERTEQ_int (__LINE__, unsigned_int_result, unsigned_int_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000000463fd2902d; + *((unsigned long *)&__m128i_op0[0]) = 0x5ccd54bbfcac806c; + unsigned_int_result = 0x00000000000000ac; + unsigned_int_out = __lsx_vpickve2gr_bu (__m128i_op0, 0x2); + ASSERTEQ_int (__LINE__, unsigned_int_result, unsigned_int_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x697eba2bedfa9c82; + *((unsigned long *)&__m128i_op0[0]) = 0xd705c77a7025c899; + unsigned_int_result = 0x000000000000edfa; + unsigned_int_out = __lsx_vpickve2gr_hu (__m128i_op0, 0x5); + ASSERTEQ_int (__LINE__, unsigned_int_result, unsigned_int_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0400040004000400; + *((unsigned long *)&__m128i_op0[0]) = 0x0400040004000400; + unsigned_int_result = 0x0000000000000400; + unsigned_int_out = __lsx_vpickve2gr_hu (__m128i_op0, 0x5); + ASSERTEQ_int (__LINE__, unsigned_int_result, unsigned_int_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + unsigned_int_result = 0x0000000000000000; + unsigned_int_out = __lsx_vpickve2gr_wu (__m128i_op0, 0x3); + ASSERTEQ_int (__LINE__, unsigned_int_result, unsigned_int_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x000000007d3ac600; + int_result = 0x0000000000000000; + int_out = __lsx_vpickve2gr_b (__m128i_op0, 0x7); + ASSERTEQ_int (__LINE__, int_result, int_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + int_result = 0x0000000000000000; + int_out = __lsx_vpickve2gr_w (__m128i_op0, 0x2); + ASSERTEQ_int (__LINE__, int_result, int_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x1dffbfff00000001; + *((unsigned long *)&__m128i_op0[0]) = 0x0200400000000001; + unsigned_int_result = 0x0000000000000001; + unsigned_int_out = __lsx_vpickve2gr_wu (__m128i_op0, 0x2); + ASSERTEQ_int (__LINE__, unsigned_int_result, unsigned_int_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000000003fffffff; + *((unsigned long *)&__m128i_op0[0]) = 0x000000003fffffff; + int_result = 0x0000000000000000; + int_out = __lsx_vpickve2gr_w (__m128i_op0, 0x1); + ASSERTEQ_int (__LINE__, int_result, int_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000000490000004d; + *((unsigned long *)&__m128i_op0[0]) = 0x00000001ffffffff; + long_int_result = 0x00000001ffffffff; + long_int_out = __lsx_vpickve2gr_d (__m128i_op0, 0x0); + ASSERTEQ_int (__LINE__, long_int_result, long_int_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xff84fff4ff84fff4; + *((unsigned long *)&__m128i_op0[0]) = 0x00a6ffceffb60052; + unsigned_int_result = 0x0000000000000084; + unsigned_int_out = __lsx_vpickve2gr_bu (__m128i_op0, 0xa); + ASSERTEQ_int (__LINE__, unsigned_int_result, unsigned_int_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + long_int_result = 0x0000000000000000; + long_int_out = __lsx_vpickve2gr_d (__m128i_op0, 0x1); + ASSERTEQ_int (__LINE__, long_int_result, long_int_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x7fffffff7fffffff; + *((unsigned long *)&__m128i_op0[0]) = 0x0101010101010101; + int_result = 0x00000000ffffffff; + int_out = __lsx_vpickve2gr_b (__m128i_op0, 0xc); + ASSERTEQ_int (__LINE__, int_result, int_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + unsigned_int_result = 0x00000000ffffffff; + unsigned_int_out = __lsx_vpickve2gr_wu (__m128i_op0, 0x2); + ASSERTEQ_int (__LINE__, unsigned_int_result, unsigned_int_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + long_int_result = 0xffffffffffffffff; + long_int_out = __lsx_vpickve2gr_d (__m128i_op0, 0x1); + ASSERTEQ_int (__LINE__, long_int_result, long_int_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + int_result = 0x0000000000000000; + int_out = __lsx_vpickve2gr_w (__m128i_op0, 0x2); + ASSERTEQ_int (__LINE__, int_result, int_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + long_int_result = 0x0000000000000000; + long_int_out = __lsx_vpickve2gr_d (__m128i_op0, 0x0); + ASSERTEQ_int (__LINE__, long_int_result, long_int_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + unsigned_int_result = 0x0000000000000000; + unsigned_int_out = __lsx_vpickve2gr_wu (__m128i_op0, 0x3); + ASSERTEQ_int (__LINE__, unsigned_int_result, unsigned_int_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x3f8000003f800000; + *((unsigned long *)&__m128i_op0[0]) = 0x3f8000003f800000; + unsigned_long_int_result = 0x3f8000003f800000; + unsigned_long_int_out = __lsx_vpickve2gr_du (__m128i_op0, 0x0); + ASSERTEQ_int (__LINE__, unsigned_long_int_result, unsigned_long_int_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0bd80bd80bd80bd8; + *((unsigned long *)&__m128i_op0[0]) = 0x0bd80bd80bd80bd8; + unsigned_long_int_result = 0x0bd80bd80bd80bd8; + unsigned_long_int_out = __lsx_vpickve2gr_du (__m128i_op0, 0x0); + ASSERTEQ_int (__LINE__, unsigned_long_int_result, unsigned_long_int_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + unsigned_int_result = 0x0000000000000000; + unsigned_int_out = __lsx_vpickve2gr_bu (__m128i_op0, 0x8); + ASSERTEQ_int (__LINE__, unsigned_int_result, unsigned_int_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000c0000bd49; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000c7fff000c; + int_result = 0x0000000000000000; + int_out = __lsx_vpickve2gr_b (__m128i_op0, 0xb); + ASSERTEQ_int (__LINE__, int_result, int_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000000000000ff; + *((unsigned long *)&__m128i_op0[0]) = 0x0000100c6ffef10c; + unsigned_int_result = 0x00000000000000ff; + unsigned_int_out = __lsx_vpickve2gr_wu (__m128i_op0, 0x2); + ASSERTEQ_int (__LINE__, unsigned_int_result, unsigned_int_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x2020202020202020; + *((unsigned long *)&__m128i_op0[0]) = 0x2020202020207f7f; + unsigned_int_result = 0x0000000020202020; + unsigned_int_out = __lsx_vpickve2gr_wu (__m128i_op0, 0x1); + ASSERTEQ_int (__LINE__, unsigned_int_result, unsigned_int_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000003a24; + *((unsigned long *)&__m128i_op0[0]) = 0x003dbe88077c78c1; + int_result = 0x0000000000003a24; + int_out = __lsx_vpickve2gr_w (__m128i_op0, 0x2); + ASSERTEQ_int (__LINE__, int_result, int_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + int_result = 0x00000000ffffffff; + int_out = __lsx_vpickve2gr_w (__m128i_op0, 0x1); + ASSERTEQ_int (__LINE__, int_result, int_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + unsigned_int_result = 0x00000000000000ff; + unsigned_int_out = __lsx_vpickve2gr_bu (__m128i_op0, 0x9); + ASSERTEQ_int (__LINE__, unsigned_int_result, unsigned_int_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0002000200000000; + unsigned_int_result = 0x0000000000000000; + unsigned_int_out = __lsx_vpickve2gr_wu (__m128i_op0, 0x2); + ASSERTEQ_int (__LINE__, unsigned_int_result, unsigned_int_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + unsigned_int_result = 0x0000000000000000; + unsigned_int_out = __lsx_vpickve2gr_bu (__m128i_op0, 0xb); + ASSERTEQ_int (__LINE__, unsigned_int_result, unsigned_int_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + int_result = 0x0000000000000000; + int_out = __lsx_vpickve2gr_h (__m128i_op0, 0x0); + ASSERTEQ_int (__LINE__, int_result, int_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffe080f6efc100f7; + *((unsigned long *)&__m128i_op0[0]) = 0xefd32176ffe100f7; + int_result = 0x0000000000002176; + int_out = __lsx_vpickve2gr_h (__m128i_op0, 0x2); + ASSERTEQ_int (__LINE__, int_result, int_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + long_int_result = 0x0000000000000000; + long_int_out = __lsx_vpickve2gr_d (__m128i_op0, 0x1); + ASSERTEQ_int (__LINE__, long_int_result, long_int_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + unsigned_long_int_result = 0x0000000000000000; + unsigned_long_int_out = __lsx_vpickve2gr_du (__m128i_op0, 0x0); + ASSERTEQ_int (__LINE__, unsigned_long_int_result, unsigned_long_int_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000200000002; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000200000002; + int_result = 0x0000000000000002; + int_out = __lsx_vpickve2gr_w (__m128i_op0, 0x0); + ASSERTEQ_int (__LINE__, int_result, int_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + unsigned_long_int_result = 0x0000000000000000; + unsigned_long_int_out = __lsx_vpickve2gr_du (__m128i_op0, 0x0); + ASSERTEQ_int (__LINE__, unsigned_long_int_result, unsigned_long_int_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00ff00ff00ff00ff; + *((unsigned long *)&__m128i_op0[0]) = 0x00ff00ff00ff00ff; + int_result = 0x0000000000000000; + int_out = __lsx_vpickve2gr_b (__m128i_op0, 0x5); + ASSERTEQ_int (__LINE__, int_result, int_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffc0ff80ff800000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000005; + unsigned_int_result = 0x0000000000000000; + unsigned_int_out = __lsx_vpickve2gr_hu (__m128i_op0, 0x3); + ASSERTEQ_int (__LINE__, unsigned_int_result, unsigned_int_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x80008000ec82ab51; + *((unsigned long *)&__m128i_op0[0]) = 0x8000800089e08000; + int_result = 0x0000000089e08000; + int_out = __lsx_vpickve2gr_w (__m128i_op0, 0x0); + ASSERTEQ_int (__LINE__, int_result, int_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + int_result = 0x00000000ffffffff; + int_out = __lsx_vpickve2gr_h (__m128i_op0, 0x2); + ASSERTEQ_int (__LINE__, int_result, int_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x6453f5e01d6e5000; + *((unsigned long *)&__m128i_op0[0]) = 0x000fdec000000000; + int_result = 0x000000001d6e5000; + int_out = __lsx_vpickve2gr_w (__m128i_op0, 0x2); + ASSERTEQ_int (__LINE__, int_result, int_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x6453f5e01d6e5000; + *((unsigned long *)&__m128i_op0[0]) = 0x000fdec000000000; + int_result = 0x0000000001d6e5000; + int_out = __lsx_vpickve2gr_w (__m128i_op0, 0x2); + ASSERTEQ_int (__LINE__, int_result, int_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x00009c7c00007176; + int_result = 0x0000000000000000; + int_out = __lsx_vpickve2gr_b (__m128i_op0, 0xe); + ASSERTEQ_int (__LINE__, int_result, int_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + int_result = 0x00000000ffffffff; + int_out = __lsx_vpickve2gr_w (__m128i_op0, 0x3); + ASSERTEQ_int (__LINE__, int_result, int_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x8d78336c83652b86; + *((unsigned long *)&__m128i_op0[0]) = 0x39c51f389c0d6112; + int_result = 0x000000009c0d6112; + int_out = __lsx_vpickve2gr_w (__m128i_op0, 0x0); + ASSERTEQ_int (__LINE__, int_result, int_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000000ff0000857a; + *((unsigned long *)&__m128i_op0[0]) = 0x05fafe0101fe000e; + unsigned_int_result = 0x000000000000857a; + unsigned_int_out = __lsx_vpickve2gr_hu (__m128i_op0, 0x4); + ASSERTEQ_int (__LINE__, unsigned_int_result, unsigned_int_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + int_result = 0x0000000000000000; + int_out = __lsx_vpickve2gr_h (__m128i_op0, 0x1); + ASSERTEQ_int (__LINE__, int_result, int_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x021b7d2449678a35; + *((unsigned long *)&__m128i_op0[0]) = 0x030298a621030a49; + int_result = 0x00000000ffff8a35; + int_out = __lsx_vpickve2gr_h (__m128i_op0, 0x4); + ASSERTEQ_int (__LINE__, int_result, int_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x001effae001effae; + *((unsigned long *)&__m128i_op0[0]) = 0x001effae001effae; + unsigned_int_result = 0x000000000000001e; + unsigned_int_out = __lsx_vpickve2gr_hu (__m128i_op0, 0x3); + ASSERTEQ_int (__LINE__, unsigned_int_result, unsigned_int_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x00009c7c00007176; + int_result = 0x0000000000000000; + int_out = __lsx_vpickve2gr_b (__m128i_op0, 0xe); + ASSERTEQ_int (__LINE__, int_result, int_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + int_result = 0x00000000ffffffff; + int_out = __lsx_vpickve2gr_w (__m128i_op0, 0x3); + ASSERTEQ_int (__LINE__, int_result, int_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x8d78336c83652b86; + *((unsigned long *)&__m128i_op0[0]) = 0x39c51f389c0d6112; + int_result = 0x000000009c0d6112; + int_out = __lsx_vpickve2gr_w (__m128i_op0, 0x0); + ASSERTEQ_int (__LINE__, int_result, int_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000000ff0000857a; + *((unsigned long *)&__m128i_op0[0]) = 0x05fafe0101fe000e; + unsigned_int_result = 0x000000000000857a; + unsigned_int_out = __lsx_vpickve2gr_hu (__m128i_op0, 0x4); + ASSERTEQ_int (__LINE__, unsigned_int_result, unsigned_int_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + int_result = 0x0000000000000000; + int_out = __lsx_vpickve2gr_h (__m128i_op0, 0x1); + ASSERTEQ_int (__LINE__, int_result, int_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x021b7d2449678a35; + *((unsigned long *)&__m128i_op0[0]) = 0x030298a621030a49; + int_result = 0x00000000ffff8a35; + int_out = __lsx_vpickve2gr_h (__m128i_op0, 0x4); + ASSERTEQ_int (__LINE__, int_result, int_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x001effae001effae; + *((unsigned long *)&__m128i_op0[0]) = 0x001effae001effae; + unsigned_int_result = 0x000000000000001e; + unsigned_int_out = __lsx_vpickve2gr_hu (__m128i_op0, 0x3); + ASSERTEQ_int (__LINE__, unsigned_int_result, unsigned_int_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + int_result = 0x0000000000000000; + int_out = __lsx_vpickve2gr_b (__m128i_op0, 0x8); + ASSERTEQ_int (__LINE__, int_result, int_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + unsigned_int_result = 0x000000000000001e; + unsigned_long_int_out = __lsx_vpickve2gr_du (__m128i_op0, 0x1); + ASSERTEQ_int (__LINE__, unsigned_int_result, unsigned_int_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + unsigned_int_result = 0x0000000000000000; + unsigned_int_out = __lsx_vpickve2gr_hu (__m128i_op0, 0x5); + ASSERTEQ_int (__LINE__, unsigned_int_result, unsigned_int_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x000000003ddc5dac; + long_int_result = 0x000000003ddc5dac; + long_int_out = __lsx_vpickve2gr_d (__m128i_op0, 0x0); + ASSERTEQ_int (__LINE__, long_int_result, long_int_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x6453f5e01d6e5000; + *((unsigned long *)&__m128i_op0[0]) = 0x000fdec000000000; + int_result = 0x000000001d6e5000; + int_out = __lsx_vpickve2gr_w (__m128i_op0, 0x2); + ASSERTEQ_int (__LINE__, int_result, int_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x00009c7c00007176; + int_result = 0x0000000000000000; + int_out = __lsx_vpickve2gr_b (__m128i_op0, 0xe); + ASSERTEQ_int (__LINE__, int_result, int_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + int_result = 0x00000000ffffffff; + int_out = __lsx_vpickve2gr_w (__m128i_op0, 0x3); + ASSERTEQ_int (__LINE__, int_result, int_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x8d78336c83652b86; + *((unsigned long *)&__m128i_op0[0]) = 0x39c51f389c0d6112; + int_result = 0x000000009c0d6112; + int_out = __lsx_vpickve2gr_w (__m128i_op0, 0x0); + ASSERTEQ_int (__LINE__, int_result, int_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000000ff0000857a; + *((unsigned long *)&__m128i_op0[0]) = 0x05fafe0101fe000e; + unsigned_int_result = 0x000000000000857a; + unsigned_int_out = __lsx_vpickve2gr_hu (__m128i_op0, 0x4); + ASSERTEQ_int (__LINE__, unsigned_int_result, unsigned_int_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + int_result = 0x0000000000000000; + int_out = __lsx_vpickve2gr_h (__m128i_op0, 0x1); + ASSERTEQ_int (__LINE__, int_out, int_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x021b7d2449678a35; + *((unsigned long *)&__m128i_op0[0]) = 0x030298a621030a49; + int_result = 0x00000000ffff8a35; + int_out = __lsx_vpickve2gr_h (__m128i_op0, 0x4); + ASSERTEQ_int (__LINE__, int_result, int_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x001effae001effae; + *((unsigned long *)&__m128i_op0[0]) = 0x001effae001effae; + unsigned_int_result = 0x000000000000001e; + unsigned_int_out = __lsx_vpickve2gr_hu (__m128i_op0, 0x3); + ASSERTEQ_int (__LINE__, unsigned_int_result, unsigned_int_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0674c8868a74fc80; + *((unsigned long *)&__m128i_op0[0]) = 0xfdce8003090b0906; + int_result = 0x00000000090b0906; + int_out = __lsx_vpickve2gr_w (__m128i_op0, 0x0); + ASSERTEQ_int (__LINE__, int_result, int_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + int_result = 0x0000000000000000; + int_out = __lsx_vpickve2gr_h (__m128i_op0, 0x3); + ASSERTEQ_int (__LINE__, int_result, int_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000feff23560000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000fd1654860000; + unsigned_int_result = 0x00000000000000ff; + unsigned_int_out = __lsx_vpickve2gr_bu (__m128i_op0, 0xc); + ASSERTEQ_int (__LINE__, unsigned_int_result, unsigned_int_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + unsigned_long_int_result = 0x0000000000000000; + unsigned_long_int_out = __lsx_vpickve2gr_du (__m128i_op0, 0x0); + ASSERTEQ_int (__LINE__, unsigned_long_int_result, unsigned_long_int_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x4f4f00004f4f0000; + *((unsigned long *)&__m128i_op0[0]) = 0x4f4f00004f4f0000; + unsigned_int_result = 0x000000004f4f0000; + unsigned_int_out = __lsx_vpickve2gr_wu (__m128i_op0, 0x0); + ASSERTEQ_int (__LINE__, unsigned_int_result, unsigned_int_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000000120000000d; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000e0000000e; + unsigned_long_int_result = 0x0000000e0000000e; + unsigned_long_int_out = __lsx_vpickve2gr_du (__m128i_op0, 0x0); + ASSERTEQ_int (__LINE__, unsigned_long_int_result, unsigned_long_int_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vpremi.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vpremi.c new file mode 100644 index 00000000000..ef0ad676eb0 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vpremi.c @@ -0,0 +1,20 @@ +/* { 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; + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vreplgr2vr.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vreplgr2vr.c new file mode 100644 index 00000000000..a5f02b1b115 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vreplgr2vr.c @@ -0,0 +1,212 @@ +/* { 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_op0 = 0x0000000059815d00; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vreplgr2vr_b (int_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + int_op0 = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vreplgr2vr_b (int_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + int_op0 = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vreplgr2vr_h (int_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + int_op0 = 0x0000000000000400; + *((unsigned long *)&__m128i_result[1]) = 0x0400040004000400; + *((unsigned long *)&__m128i_result[0]) = 0x0400040004000400; + __m128i_out = __lsx_vreplgr2vr_h (int_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + int_op0 = 0x0000000000000400; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vreplgr2vr_b (int_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + long_op0 = 0x0000000000000400; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000400; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000400; + __m128i_out = __lsx_vreplgr2vr_d (long_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + int_op0 = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vreplgr2vr_w (int_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + int_op0 = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vreplgr2vr_b (int_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + long_op0 = 0x3f8000003f800000; + *((unsigned long *)&__m128i_result[1]) = 0x3f8000003f800000; + *((unsigned long *)&__m128i_result[0]) = 0x3f8000003f800000; + __m128i_out = __lsx_vreplgr2vr_d (long_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + int_op0 = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vreplgr2vr_b (int_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + int_op0 = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vreplgr2vr_b (int_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + long_op0 = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vreplgr2vr_d (long_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + int_op0 = 0x0000000020202020; + *((unsigned long *)&__m128i_result[1]) = 0x2020202020202020; + *((unsigned long *)&__m128i_result[0]) = 0x2020202020202020; + __m128i_out = __lsx_vreplgr2vr_b (int_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + int_op0 = 0x00000000000000ff; + *((unsigned long *)&__m128i_result[1]) = 0x000000ff000000ff; + *((unsigned long *)&__m128i_result[0]) = 0x000000ff000000ff; + __m128i_out = __lsx_vreplgr2vr_w (int_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + int_op0 = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vreplgr2vr_w (int_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + int_op0 = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vreplgr2vr_b (int_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + int_op0 = 0x00000000ffffffff; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vreplgr2vr_b (int_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + int_op0 = 0x00000000ffffffff; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vreplgr2vr_h (int_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + int_op0 = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vreplgr2vr_w (int_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + int_op0 = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vreplgr2vr_h (int_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + long_op0 = 0x000000007ff00000; + *((unsigned long *)&__m128i_result[1]) = 0x000000007ff00000; + *((unsigned long *)&__m128i_result[0]) = 0x000000007ff00000; + __m128i_out = __lsx_vreplgr2vr_d (long_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + int_op0 = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vreplgr2vr_h (int_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + int_op0 = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vreplgr2vr_b (int_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + long_op0 = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vreplgr2vr_d (long_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + int_op0 = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vreplgr2vr_b (int_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + int_op0 = 0x00000000000000ff; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vreplgr2vr_b (int_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + int_op0 = 0x00000000000000ff; + *((unsigned long *)&__m128i_result[1]) = 0x00ff00ff00ff00ff; + *((unsigned long *)&__m128i_result[0]) = 0x00ff00ff00ff00ff; + __m128i_out = __lsx_vreplgr2vr_h (int_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + int_op0 = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vreplgr2vr_w (int_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + int_op0 = 0x000000000000001e; + *((unsigned long *)&__m128i_result[1]) = 0x1e1e1e1e1e1e1e1e; + *((unsigned long *)&__m128i_result[0]) = 0x1e1e1e1e1e1e1e1e; + __m128i_out = __lsx_vreplgr2vr_b (int_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + int_op0 = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vreplgr2vr_w (int_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + int_op0 = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vreplgr2vr_h (int_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + int_op0 = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vreplgr2vr_b (int_op0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vreplve.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vreplve.c new file mode 100644 index 00000000000..463adb48e9e --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vreplve.c @@ -0,0 +1,300 @@ +/* { 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; + int_op1 = 0x00000045eef14fe8; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vreplve_w (__m128i_op0, int_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000080000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000080000000; + int_op1 = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vreplve_b (__m128i_op0, int_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + int_op1 = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vreplve_b (__m128i_op0, int_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + int_op1 = 0x00000000000000ac; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vreplve_d (__m128i_op0, int_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000100000001; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + int_op1 = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vreplve_b (__m128i_op0, int_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x78c00000ff000000; + int_op1 = 0x0000000000000400; + *((unsigned long *)&__m128i_result[1]) = 0xff000000ff000000; + *((unsigned long *)&__m128i_result[0]) = 0xff000000ff000000; + __m128i_out = __lsx_vreplve_w (__m128i_op0, int_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + int_op1 = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vreplve_w (__m128i_op0, int_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x803f800080000000; + *((unsigned long *)&__m128i_op0[0]) = 0xe0404041c0404040; + int_op1 = 0x0000000000000001; + *((unsigned long *)&__m128i_result[1]) = 0xe0404041e0404041; + *((unsigned long *)&__m128i_result[0]) = 0xe0404041e0404041; + __m128i_out = __lsx_vreplve_w (__m128i_op0, int_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + int_op1 = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vreplve_b (__m128i_op0, int_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000ffffffff0001; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + int_op1 = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vreplve_h (__m128i_op0, int_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0001000100010001; + *((unsigned long *)&__m128i_op0[0]) = 0x0001000100010001; + int_op1 = 0x3f8000003f800000; + *((unsigned long *)&__m128i_result[1]) = 0x0001000100010001; + *((unsigned long *)&__m128i_result[0]) = 0x0001000100010001; + __m128i_out = __lsx_vreplve_w (__m128i_op0, int_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + int_op1 = 0x0000000000020006; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vreplve_b (__m128i_op0, int_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + int_op1 = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vreplve_h (__m128i_op0, int_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffb4ff; + int_op1 = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffb4ff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffb4ff; + __m128i_out = __lsx_vreplve_d (__m128i_op0, int_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + int_op1 = 0x0000000020202020; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vreplve_d (__m128i_op0, int_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + int_op1 = 0x000000007ff00000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vreplve_d (__m128i_op0, int_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + int_op1 = 0x0000000000020006; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vreplve_h (__m128i_op0, int_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + int_op1 = 0x00000000000000ff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vreplve_w (__m128i_op0, int_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfffffffffffffff4; + *((unsigned long *)&__m128i_op0[0]) = 0xfffffffffffffff4; + int_op1 = 0x00000000000000ff; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vreplve_b (__m128i_op0, int_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + int_op1 = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vreplve_w (__m128i_op0, int_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00ffff00ff00ff00; + *((unsigned long *)&__m128i_op0[0]) = 0x00ffff00ff00ff00; + int_op1 = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xff00ff00ff00ff00; + *((unsigned long *)&__m128i_result[0]) = 0xff00ff00ff00ff00; + __m128i_out = __lsx_vreplve_w (__m128i_op0, int_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x8000000080000000; + *((unsigned long *)&__m128i_op0[0]) = 0x8000000080000000; + int_op1 = 0x00000000000000ff; + *((unsigned long *)&__m128i_result[1]) = 0x8080808080808080; + *((unsigned long *)&__m128i_result[0]) = 0x8080808080808080; + __m128i_out = __lsx_vreplve_b (__m128i_op0, int_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x7ff0000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x7ff0000000000000; + int_op1 = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vreplve_w (__m128i_op0, int_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + int_op1 = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vreplve_w (__m128i_op0, int_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + int_op1 = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vreplve_w (__m128i_op0, int_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000000000000001b; + *((unsigned long *)&__m128i_op0[0]) = 0x000000000000001b; + int_op1 = 0xffffffff89e08000; + *((unsigned long *)&__m128i_result[1]) = 0x0000001b0000001b; + *((unsigned long *)&__m128i_result[0]) = 0x0000001b0000001b; + __m128i_out = __lsx_vreplve_w (__m128i_op0, int_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + int_op1 = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vreplve_h (__m128i_op0, int_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + int_op1 = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vreplve_b (__m128i_op0, int_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfefefefdbffefdfe; + *((unsigned long *)&__m128i_op0[0]) = 0xfefefeeffef7fefe; + int_op1 = 0xffffffff9c0d6112; + *((unsigned long *)&__m128i_result[1]) = 0xbffefdfebffefdfe; + *((unsigned long *)&__m128i_result[0]) = 0xbffefdfebffefdfe; + __m128i_out = __lsx_vreplve_w (__m128i_op0, int_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xff800000ff800000; + *((unsigned long *)&__m128i_op0[0]) = 0xff800000ff800000; + int_op1 = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xff800000ff800000; + *((unsigned long *)&__m128i_result[0]) = 0xff800000ff800000; + __m128i_out = __lsx_vreplve_w (__m128i_op0, int_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x6363636363636363; + *((unsigned long *)&__m128i_op0[0]) = 0xffd27db010d20fbf; + int_op1 = 0x0000000000000040; + *((unsigned long *)&__m128i_result[1]) = 0x0fbf0fbf0fbf0fbf; + *((unsigned long *)&__m128i_result[0]) = 0x0fbf0fbf0fbf0fbf; + __m128i_out = __lsx_vreplve_h (__m128i_op0, int_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + int_op1 = 0x00000000090b0906; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vreplve_b (__m128i_op0, int_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + int_op1 = 0xffffffffffff8a35; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vreplve_d (__m128i_op0, int_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x05dfffc3ffffffc0; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000047fe2f0; + int_op1 = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x00000000047fe2f0; + *((unsigned long *)&__m128i_result[0]) = 0x00000000047fe2f0; + __m128i_out = __lsx_vreplve_d (__m128i_op0, int_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfffefffefffefffe; + *((unsigned long *)&__m128i_op0[0]) = 0xfffefffe011df03e; + int_op1 = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xf03ef03ef03ef03e; + *((unsigned long *)&__m128i_result[0]) = 0xf03ef03ef03ef03e; + __m128i_out = __lsx_vreplve_h (__m128i_op0, int_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vreplvei.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vreplvei.c new file mode 100644 index 00000000000..a81be76f12b --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vreplvei.c @@ -0,0 +1,293 @@ +/* { 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_vreplvei_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_vreplvei_w (__m128i_op0, 0x0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000055555501; + *((unsigned long *)&__m128i_op0[0]) = 0x0000005555555554; + *((unsigned long *)&__m128i_result[1]) = 0x0000005555555554; + *((unsigned long *)&__m128i_result[0]) = 0x0000005555555554; + __m128i_out = __lsx_vreplvei_d (__m128i_op0, 0x0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000036280000; + *((unsigned long *)&__m128i_op0[0]) = 0x42a0000042a02000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vreplvei_h (__m128i_op0, 0x6); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x697eba2bedfa9c82; + *((unsigned long *)&__m128i_op0[0]) = 0xd705c77a7025c899; + *((unsigned long *)&__m128i_result[1]) = 0xedfaedfaedfaedfa; + *((unsigned long *)&__m128i_result[0]) = 0xedfaedfaedfaedfa; + __m128i_out = __lsx_vreplvei_h (__m128i_op0, 0x5); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000200000002; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000300000003; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vreplvei_h (__m128i_op0, 0x1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000000a0a08000; + *((unsigned long *)&__m128i_op0[0]) = 0x5350a08000000000; + *((unsigned long *)&__m128i_result[1]) = 0x8000800080008000; + *((unsigned long *)&__m128i_result[0]) = 0x8000800080008000; + __m128i_out = __lsx_vreplvei_h (__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_vreplvei_w (__m128i_op0, 0x0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x80010009816ac5de; + *((unsigned long *)&__m128i_op0[0]) = 0x8001000184000bd8; + *((unsigned long *)&__m128i_result[1]) = 0x0bd80bd80bd80bd8; + *((unsigned long *)&__m128i_result[0]) = 0x0bd80bd80bd80bd8; + __m128i_out = __lsx_vreplvei_h (__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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vreplvei_h (__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_vreplvei_b (__m128i_op0, 0x9); + 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_vreplvei_b (__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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vreplvei_h (__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_vreplvei_h (__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_vreplvei_h (__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_vreplvei_d (__m128i_op0, 0x1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_op0[0]) = 0x1149a96eb1a08000; + *((unsigned long *)&__m128i_result[1]) = 0xb1a08000b1a08000; + *((unsigned long *)&__m128i_result[0]) = 0xb1a08000b1a08000; + __m128i_out = __lsx_vreplvei_w (__m128i_op0, 0x0); + 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_vreplvei_h (__m128i_op0, 0x3); + 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_vreplvei_h (__m128i_op0, 0x6); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0808080808080808; + *((unsigned long *)&__m128i_op0[0]) = 0x0808080808080808; + *((unsigned long *)&__m128i_result[1]) = 0x0808080808080808; + *((unsigned long *)&__m128i_result[0]) = 0x0808080808080808; + __m128i_out = __lsx_vreplvei_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_vreplvei_d (__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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vreplvei_w (__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_vreplvei_w (__m128i_op0, 0x3); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffcc9a989a; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vreplvei_b (__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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vreplvei_w (__m128i_op0, 0x1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000000adadadad; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000adadadad; + *((unsigned long *)&__m128i_result[1]) = 0xadadadadadadadad; + *((unsigned long *)&__m128i_result[0]) = 0xadadadadadadadad; + __m128i_out = __lsx_vreplvei_w (__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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vreplvei_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_vreplvei_d (__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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vreplvei_w (__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]) = 0x8080808080808080; + *((unsigned long *)&__m128i_result[0]) = 0x8080808080808080; + __m128i_out = __lsx_vreplvei_w (__m128i_op0, 0x1); + 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]) = 0xffffffffffffffff; + __m128i_out = __lsx_vreplvei_b (__m128i_op0, 0xb); + 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]) = 0xffffffffffffffff; + __m128i_out = __lsx_vreplvei_w (__m128i_op0, 0x3); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x3131313131313131; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vreplvei_d (__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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vreplvei_h (__m128i_op0, 0x2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000000000a752a55; + *((unsigned long *)&__m128i_op0[0]) = 0x0a753500a9fa0d06; + *((unsigned long *)&__m128i_result[1]) = 0x0d060d060d060d06; + *((unsigned long *)&__m128i_result[0]) = 0x0d060d060d060d06; + __m128i_out = __lsx_vreplvei_h (__m128i_op0, 0x0); + 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_vreplvei_b (__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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vreplvei_w (__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_vreplvei_h (__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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vreplvei_h (__m128i_op0, 0x4); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vshuf.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vshuf.c new file mode 100644 index 00000000000..4e7fcc02b12 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vshuf.c @@ -0,0 +1,394 @@ +/* { 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]) = 0x0000000100000001; + *((unsigned long *)&__m128i_op0[0]) = 0x0000007f00000004; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000401000001; + *((unsigned long *)&__m128i_op1[0]) = 0x0001000100000004; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x00000000007f0000; + *((unsigned long *)&__m128i_result[1]) = 0x0404040404040404; + *((unsigned long *)&__m128i_result[0]) = 0x0404040404000404; + __m128i_out = __lsx_vshuf_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]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vshuf_b (__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]) = 0x000000ff000000ff; + *((unsigned long *)&__m128i_op1[0]) = 0x000000ff000000ff; + *((unsigned long *)&__m128i_op2[1]) = 0x000000000000002f; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000029; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffff00; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffff00; + __m128i_out = __lsx_vshuf_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]) = 0x7efefefe82010201; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x418181017dfefdff; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000005; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffff81; + __m128i_out = __lsx_vshuf_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]) = 0x52525252adadadad; + *((unsigned long *)&__m128i_op1[0]) = 0x52525252adadadad; + *((unsigned long *)&__m128i_op2[1]) = 0x800000007fffffff; + *((unsigned long *)&__m128i_op2[0]) = 0x800000007fffffff; + *((unsigned long *)&__m128i_result[1]) = 0x00adadad00000000; + *((unsigned long *)&__m128i_result[0]) = 0x00adadad00000000; + __m128i_out = __lsx_vshuf_b (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000005; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000005; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000005; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vshuf_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]) = 0xbfd10d0d7b6b6b73; + *((unsigned long *)&__m128i_op1[0]) = 0xc5c534920000c4ed; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xedededededededed; + *((unsigned long *)&__m128i_result[0]) = 0xedededededededed; + __m128i_out = __lsx_vshuf_b (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000202020200; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000100; + *((unsigned long *)&__m128i_op1[1]) = 0x04040403fafafafc; + *((unsigned long *)&__m128i_op1[0]) = 0x000000000000ff80; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x8080808080808080; + *((unsigned long *)&__m128i_result[0]) = 0x8080808080808080; + __m128i_out = __lsx_vshuf_b (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xff800000ff800000; + *((unsigned long *)&__m128i_op0[0]) = 0xff800000ff800000; + *((unsigned long *)&__m128i_op1[1]) = 0xff800000ff800000; + *((unsigned long *)&__m128i_op1[0]) = 0xff800000ff800000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000001a0000000b; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000001; + *((unsigned long *)&__m128i_result[1]) = 0x00000080000000ff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vshuf_b (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xff6cffb5ff98ff6e; + *((unsigned long *)&__m128i_op0[0]) = 0xffd7ff8dffa4ff7a; + *((unsigned long *)&__m128i_op1[1]) = 0x34947b4b11684f92; + *((unsigned long *)&__m128i_op1[0]) = 0xee297a731e5c5f86; + *((unsigned long *)&__m128i_op2[1]) = 0x7fffffffffffffff; + *((unsigned long *)&__m128i_op2[0]) = 0xffc0000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000868686868686; + __m128i_out = __lsx_vshuf_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]) = 0x000000000000000d; + *((unsigned long *)&__m128i_result[1]) = 0x000d000d000d000d; + *((unsigned long *)&__m128i_result[0]) = 0x000d000d000d000d; + __m128i_out = __lsx_vshuf_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]) = 0x7fffffffffffffff; + *((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_vshuf_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]) = 0x000000002bfd9461; + *((unsigned long *)&__m128i_op2[1]) = 0x00007fff00007fff; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vshuf_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_vshuf_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]) = 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_vshuf_h (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000300037ff000ff; + *((unsigned long *)&__m128i_op0[0]) = 0x0003000300a10003; + *((unsigned long *)&__m128i_op1[1]) = 0x000300037ff000ff; + *((unsigned long *)&__m128i_op1[0]) = 0x0003000300a10003; + *((unsigned long *)&__m128i_op2[1]) = 0x000000007ff000ff; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vshuf_h (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0909000009090000; + *((unsigned long *)&__m128i_op0[0]) = 0x0909000009090000; + *((unsigned long *)&__m128i_op1[1]) = 0x0909000009090000; + *((unsigned long *)&__m128i_op1[0]) = 0x0909000009090000; + *((unsigned long *)&__m128i_op2[1]) = 0x002a05a2f059094a; + *((unsigned long *)&__m128i_op2[0]) = 0x05ad3ba576eae048; + *((unsigned long *)&__m128i_result[1]) = 0x0909e0480909e048; + *((unsigned long *)&__m128i_result[0]) = 0x0909e0480909e048; + __m128i_out = __lsx_vshuf_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_vshuf_h (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000000000000c0; + *((unsigned long *)&__m128i_op0[0]) = 0x00000001ffffff29; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x00000000000000c0; + *((unsigned long *)&__m128i_op2[0]) = 0x00000001ffffff29; + *((unsigned long *)&__m128i_result[1]) = 0xffffff2900000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000100000001; + __m128i_out = __lsx_vshuf_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_vshuf_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]) = 0x00000000000000ff; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x1f54e0ab00000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0101010101010101; + *((unsigned long *)&__m128i_op2[0]) = 0x010101fe0101fe87; + *((unsigned long *)&__m128i_result[1]) = 0x0101fe870101fe87; + *((unsigned long *)&__m128i_result[0]) = 0x0101fe8700000000; + __m128i_out = __lsx_vshuf_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_vshuf_w (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000007fff; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000020000020; + *((unsigned long *)&__m128i_op2[0]) = 0x0000000020000020; + *((unsigned long *)&__m128i_result[1]) = 0x2000002000000000; + *((unsigned long *)&__m128i_result[0]) = 0x2000002020000020; + __m128i_out = __lsx_vshuf_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_vshuf_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]) = 0x0000000004870ba0; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000001000000010; + *((unsigned long *)&__m128i_op2[1]) = 0x8000000100000000; + *((unsigned long *)&__m128i_op2[0]) = 0x8000000000000103; + *((unsigned long *)&__m128i_result[1]) = 0x0000010300000103; + *((unsigned long *)&__m128i_result[0]) = 0x0000010300000000; + __m128i_out = __lsx_vshuf_w (__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]) = 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]) = 0xffffffff00000000; + __m128i_out = __lsx_vshuf_w (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xada4808924882588; + *((unsigned long *)&__m128i_op0[0]) = 0xacad25090caca5a4; + *((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_vshuf_w (__m128i_op0, __m128i_op1, __m128i_op2); + 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_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vshuf_d (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xdfa6e0c6d46cdc13; + *((unsigned long *)&__m128i_op0[0]) = 0x21fc7081ec69b5f2; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x000000002c002400; + *((unsigned long *)&__m128i_op2[1]) = 0xffffb96bffff57c9; + *((unsigned long *)&__m128i_op2[0]) = 0xffff6080ffff4417; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vshuf_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]) = 0x0001000100000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op2[0]) = 0xffffffff0015172b; + *((unsigned long *)&__m128i_result[1]) = 0xffffffff0015172b; + *((unsigned long *)&__m128i_result[0]) = 0xffffffff0015172b; + __m128i_out = __lsx_vshuf_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]) = 0x0000000000002000; + *((unsigned long *)&__m128i_op1[0]) = 0xf0003000f0003000; + *((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_vshuf_d (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x021b7d2449678a35; + *((unsigned long *)&__m128i_op0[0]) = 0x030298a621030a49; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x7fff7fff7fff7fff; + *((unsigned long *)&__m128i_op2[1]) = 0x021b7d24c9678a35; + *((unsigned long *)&__m128i_op2[0]) = 0x030298a6a1030a49; + *((unsigned long *)&__m128i_result[1]) = 0x021b7d24c9678a35; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vshuf_d (__m128i_op0, __m128i_op1, __m128i_op2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x7f7f00007f7f0000; + *((unsigned long *)&__m128i_op0[0]) = 0x7f7f80807f7f8080; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000fffe0000fffe; + *((unsigned long *)&__m128i_op2[1]) = 0x7f8000007f800000; + *((unsigned long *)&__m128i_op2[0]) = 0x7f8000007f800000; + *((unsigned long *)&__m128i_result[1]) = 0x7f8000007f800000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vshuf_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]) = 0xfffffffffff10000; + *((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_vshuf_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-vshuf4i.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vshuf4i.c new file mode 100644 index 00000000000..cd441b841a9 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vshuf4i.c @@ -0,0 +1,348 @@ +/* { 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]) = 0x0000000000000003; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000030000; + __m128i_out = __lsx_vshuf4i_b (__m128i_op0, 0xc9); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0004007c00fc0000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x047c0404fc00fcfc; + __m128i_out = __lsx_vshuf4i_b (__m128i_op0, 0x8a); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x007fffff00000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xff00ff7f00000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vshuf4i_b (__m128i_op0, 0x32); + 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_vshuf4i_b (__m128i_op0, 0x85); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfffffffff51cf8da; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffd6040188; + *((unsigned long *)&__m128i_result[1]) = 0xfffffffff8f8dada; + *((unsigned long *)&__m128i_result[0]) = 0xffffffff01018888; + __m128i_out = __lsx_vshuf4i_b (__m128i_op0, 0x50); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x007d00c50177ac5b; + *((unsigned long *)&__m128i_op0[0]) = 0xac82aa88a972a36a; + *((unsigned long *)&__m128i_result[1]) = 0x000000c5ac01015b; + *((unsigned long *)&__m128i_result[0]) = 0xaaacac88a3a9a96a; + __m128i_out = __lsx_vshuf4i_b (__m128i_op0, 0x7c); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000a0000000a; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000a00000009; + *((unsigned long *)&__m128i_result[1]) = 0x0a0a0a000a0a0a00; + *((unsigned long *)&__m128i_result[0]) = 0x0a0a0a0009090900; + __m128i_out = __lsx_vshuf4i_b (__m128i_op0, 0x2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000001; + *((unsigned long *)&__m128i_result[1]) = 0x0000000001000100; + *((unsigned long *)&__m128i_result[0]) = 0x0000000001000100; + __m128i_out = __lsx_vshuf4i_b (__m128i_op0, 0x12); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00003f8000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x00003f8000000000; + *((unsigned long *)&__m128i_result[1]) = 0x003f800000000000; + *((unsigned long *)&__m128i_result[0]) = 0x003f800000000000; + __m128i_out = __lsx_vshuf4i_b (__m128i_op0, 0xd2); + 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_vshuf4i_b (__m128i_op0, 0x6c); + 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_vshuf4i_b (__m128i_op0, 0x81); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000dffff000d; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000ffffff; + __m128i_out = __lsx_vshuf4i_b (__m128i_op0, 0x6b); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x5f675e96e29a5a60; + *((unsigned long *)&__m128i_op0[0]) = 0x7fff7fff7fff7fff; + *((unsigned long *)&__m128i_result[1]) = 0x965f5e9660e25a60; + *((unsigned long *)&__m128i_result[0]) = 0xff7f7fffff7f7fff; + __m128i_out = __lsx_vshuf4i_b (__m128i_op0, 0x34); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x131211101211100f; + *((unsigned long *)&__m128i_op0[0]) = 0x11100f0e100f0e0d; + *((unsigned long *)&__m128i_result[1]) = 0x13101213120f1112; + *((unsigned long *)&__m128i_result[0]) = 0x110e1011100d0f10; + __m128i_out = __lsx_vshuf4i_b (__m128i_op0, 0xcb); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000001000110; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000431f851f; + *((unsigned long *)&__m128i_result[1]) = 0x0000000001011010; + *((unsigned long *)&__m128i_result[0]) = 0x0000000043431f1f; + __m128i_out = __lsx_vshuf4i_b (__m128i_op0, 0xf0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xc0b4d1a5f8babad3; + *((unsigned long *)&__m128i_op0[0]) = 0xbbc8ecc5f3ced5f3; + *((unsigned long *)&__m128i_result[1]) = 0xd1c0c0a5baf8f8d3; + *((unsigned long *)&__m128i_result[0]) = 0xecbbbbc5d5f3f3f3; + __m128i_out = __lsx_vshuf4i_b (__m128i_op0, 0x7c); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000004; + *((unsigned long *)&__m128i_op0[0]) = 0x00000454ffff9573; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000004; + *((unsigned long *)&__m128i_result[0]) = 0x00000454ffff9573; + __m128i_out = __lsx_vshuf4i_b (__m128i_op0, 0xa4); + 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_vshuf4i_h (__m128i_op0, 0xf3); + 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_vshuf4i_h (__m128i_op0, 0x2c); + 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_vshuf4i_h (__m128i_op0, 0xd2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x003f000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x007c000d00400000; + *((unsigned long *)&__m128i_result[1]) = 0x0000003f00000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000007c00000040; + __m128i_out = __lsx_vshuf4i_h (__m128i_op0, 0x31); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffff00000000ffff; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000ffff00000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vshuf4i_h (__m128i_op0, 0xb9); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x7ffffffe00000000; + *((unsigned long *)&__m128i_op0[0]) = 0x7ffffffe00000000; + *((unsigned long *)&__m128i_result[1]) = 0x7fff00007fff0000; + *((unsigned long *)&__m128i_result[0]) = 0x7fff00007fff0000; + __m128i_out = __lsx_vshuf4i_h (__m128i_op0, 0xcd); + 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]) = 0xffff00000000ffff; + __m128i_out = __lsx_vshuf4i_h (__m128i_op0, 0x93); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000007f7f7f; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x007f007f00007f7f; + __m128i_out = __lsx_vshuf4i_h (__m128i_op0, 0x58); + 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_vshuf4i_w (__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]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vshuf4i_w (__m128i_op0, 0x13); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000010; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000010; + *((unsigned long *)&__m128i_result[1]) = 0x0000001000000010; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vshuf4i_w (__m128i_op0, 0x5); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000080808000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000080808000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vshuf4i_w (__m128i_op0, 0x8b); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfffdfffdfffdfffd; + *((unsigned long *)&__m128i_op0[0]) = 0xfffdfffdfffdfffd; + *((unsigned long *)&__m128i_result[1]) = 0xfffdfffdfffdfffd; + *((unsigned long *)&__m128i_result[0]) = 0xfffdfffdfffdfffd; + __m128i_out = __lsx_vshuf4i_w (__m128i_op0, 0x7e); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfefefefdbffefdfe; + *((unsigned long *)&__m128i_op0[0]) = 0xfefefeeffef7fefe; + *((unsigned long *)&__m128i_result[1]) = 0xfef7fefebffefdfe; + *((unsigned long *)&__m128i_result[0]) = 0xfefefefdfefefeef; + __m128i_out = __lsx_vshuf4i_w (__m128i_op0, 0x2d); + 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]) = 0x001a000b00000000; + __m128i_out = __lsx_vshuf4i_w (__m128i_op0, 0x78); + 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_vshuf4i_w (__m128i_op0, 0x98); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000010f8000081a2; + *((unsigned long *)&__m128i_op0[0]) = 0x000069bb00000001; + *((unsigned long *)&__m128i_result[1]) = 0x0000000100000001; + *((unsigned long *)&__m128i_result[0]) = 0x00000001000010f8; + __m128i_out = __lsx_vshuf4i_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_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vshuf4i_d (__m128i_op0, __m128i_op1, 0x44); + 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]) = 0x00000000fffff800; + *((unsigned long *)&__m128i_result[1]) = 0x00000000fffff800; + *((unsigned long *)&__m128i_result[0]) = 0x00000000fffff800; + __m128i_out = __lsx_vshuf4i_d (__m128i_op0, __m128i_op1, 0x8a); + 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_result[1]) = 0x000000000000006f; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vshuf4i_d (__m128i_op0, __m128i_op1, 0x36); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000000ffffda6e; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000ffffe3d6; + *((unsigned long *)&__m128i_op1[1]) = 0xeeb1e4f4bc3763f3; + *((unsigned long *)&__m128i_op1[0]) = 0x6f5edf5ada6fe3d7; + *((unsigned long *)&__m128i_result[1]) = 0x00000000ffffe3d6; + *((unsigned long *)&__m128i_result[0]) = 0xeeb1e4f4bc3763f3; + __m128i_out = __lsx_vshuf4i_d (__m128i_op0, __m128i_op1, 0x23); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000100200001; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000100200001; + *((unsigned long *)&__m128i_op1[1]) = 0x00001fff00001fff; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vshuf4i_d (__m128i_op0, __m128i_op1, 0x3a); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xce23d33e43d9736c; + *((unsigned long *)&__m128i_op1[0]) = 0x63b2ac27aa076aeb; + *((unsigned long *)&__m128i_result[1]) = 0x63b2ac27aa076aeb; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vshuf4i_d (__m128i_op0, __m128i_op1, 0xc8); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_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]) = 0x0000000000000158; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vshuf4i_d (__m128i_op0, __m128i_op1, 0xc9); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vshuf4i_d (__m128i_op0, __m128i_op1, 0xbf); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x801d5de0000559e0; + *((unsigned long *)&__m128i_op0[0]) = 0x77eb86788eebaf00; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vshuf4i_d (__m128i_op0, __m128i_op1, 0x2e); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x89582bf870006860; + *((unsigned long *)&__m128i_op1[0]) = 0x89582bf870006860; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vshuf4i_d (__m128i_op0, __m128i_op1, 0x94); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} From patchwork Wed Sep 13 03:37:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: chenxiaolong X-Patchwork-Id: 138599 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9ecd:0:b0:3f2:4152:657d with SMTP id t13csp834435vqx; Tue, 12 Sep 2023 20:48:37 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF79BOXEmEZWJrhIF0ji0iWvvojyQhi2Rsvy6tw0mR7uEtbIBXVgCSaoOX0v6PC+dzKqx+z X-Received: by 2002:a05:6402:2027:b0:52a:943:9ab5 with SMTP id ay7-20020a056402202700b0052a09439ab5mr1241820edb.31.1694576917233; Tue, 12 Sep 2023 20:48:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694576917; cv=none; d=google.com; s=arc-20160816; b=w7C++RsUXr/ydzNoR9W4lBrv/rgbUv3hugIyXIilBoA7K6UwhNT2gWQsOQzz1/A9LV GZs8TWDCEYFLPoVNxh0v1XO/IWk6xG+vdmrhCG/04rhsVe+DL8uqqFTLK2VsxpvcxTPj 8BDeA5U+hSzKNDqj2QQcI86UQXxsfhV2H/q4MFW8lFDK+aLkJ0nhYuv05TCSKRC0zau2 zLTp1JRSvdTecTZwc/SjUK//ScaSIhxXbu9TvGbY47BLCLWq3KyNWdzBoGv1pusHM4i1 hgA7+27+VyPs+kGCVwvDsWqrIWGWfjPoC10v3THavb39FKanfoPjI07+x7HWUjCCcxy+ L7Ig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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:cc:to :from:dmarc-filter:delivered-to; bh=ZRvNEkjNCDpIDW5e+EmRpsR9z1I219a6/gZgDwMWiBo=; fh=3pFUYcpS/27XRzOf17GfR86AuNQu+P1CET04YURgCLs=; b=IhQx9JydmDao93wkJLkaTA/WDTbjHbBfebHkPnBkuYl68SD2A1ZeHswaudGcYQnRRU gPoFDH7URszTJNr43IhgEZ96GNvrwotikdXE8RNLJrKQ7PINazV78rmVzlUByutL7ofj 5vm338YPb9NoN1m+L+htgMUNo5+0QBcRk35gmkTS2T/x49vIv+l97M3BShq+znA0DQcZ rdc3+aTAzxX7xlNUeWAMUvjYYzX2PdnO8nmigEpRwRilWrALq52IBw1Ngo5fvTQc1GwY FgaE1e+gzYvfIG0YcaXI9oFRKbGMtWH5kN/qPlMWbJM0gfymLaFrI62L87rsQzNzBqBi SJDw== 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 l4-20020aa7c304000000b0052a234ad7b7si9568684edq.305.2023.09.12.20.48.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Sep 2023 20:48:37 -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 088293893662 for ; Wed, 13 Sep 2023 03:38:15 +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 01409395A060 for ; Wed, 13 Sep 2023 03:37:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 01409395A060 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 _____8CxRuh9LgFlKjEmAA--.20756S3; Wed, 13 Sep 2023 11:37:33 +0800 (CST) Received: from slurm-master.loongson.cn (unknown [10.10.130.252]) by localhost.localdomain (Coremail) with SMTP id AQAAf8DxS9x3LgFlQhACAA--.3563S6; Wed, 13 Sep 2023 11:37:33 +0800 (CST) From: Xiaolong Chen To: gcc-patches@gcc.gnu.org Cc: xry111@xry111.site, i@xen0n.name, xuchenghua@loongson.cn, chenglulu@loongson.cn, Xiaolong Chen Subject: [PATCH v4 22/23] LoongArch: Add tests for SX vector vand/vandi/vandn/vor/vori/vnor/ vnori/vxor/vxori instructions. Date: Wed, 13 Sep 2023 11:37:25 +0800 Message-Id: <20230913033726.6408-3-chenxiaolong@loongson.cn> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230913033726.6408-1-chenxiaolong@loongson.cn> References: <20230913033726.6408-1-chenxiaolong@loongson.cn> MIME-Version: 1.0 X-CM-TRANSID: AQAAf8DxS9x3LgFlQhACAA--.3563S6 X-CM-SenderInfo: hfkh05xldrz0tqj6z05rqj20fqof0/1tbiAQANBWUBHCIBHAAAsO X-Coremail-Antispam: 1Uk129KBj9fXoWDXFW7Zw47Xr47Ww4xuw1fXwc_yoW7Kr48Go WUAa4UZw4rCFZxX3W3tw13X34fKF1Yk3Z3Cr1xAwn0yw4Dtr42vry7ZFsxJF1Utw1ayrW3 Zw1agr4xJ348Ar1kl-sFpf9Il3svdjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8wcxFpf 9Il3svdxBIdaVrn0xqx4xG64xvF2IEw4CE5I8CrVC2j2Jv73VFW2AGmfu7bjvjm3AaLaJ3 UjIYCTnIWjp_UUUYY7kC6x804xWl14x267AKxVWUJVW8JwAFc2x0x2IEx4CE42xK8VAvwI 8IcIk0rVWrJVCq3wAFIxvE14AKwVWUGVWUXwA2ocxC64kIII0Yj41l84x0c7CEw4AK67xG Y2AK021l84ACjcxK6xIIjxv20xvE14v26F1j6w1UM28EF7xvwVC0I7IYx2IY6xkF7I0E14 v26F4j6r4UJwA2z4x0Y4vEx4A2jsIE14v26r4UJVWxJr1l84ACjcxK6I8E87Iv6xkF7I0E 14v26r4UJVWxJr1le2I262IYc4CY6c8Ij28IcVAaY2xG8wAqjxCEc2xF0cIa020Ex4CE44 I27wAqx4xG64xvF2IEw4CE5I8CrVC2j2WlYx0E2Ix0cI8IcVAFwI0_ZF0_GryDMcIj6I8E 87Iv67AKxVWxJVW8Jr1lOx8S6xCaFVCjc4AY6r1j6r4UM4x0Y48IcxkI7VAKI48JMxAIw2 8IcxkI7VAKI48JMxC20s026xCaFVCjc4AY6r1j6r4UMI8I3I0E5I8CrVAFwI0_Jr0_Jr4l x2IqxVCjr7xvwVAFwI0_JrI_JrWlx4CE17CEb7AF67AKxVWUAVWUtwCIc40Y0x0EwIxGrw CI42IY6xIIjxv20xvE14v26F1j6w1UMIIF0xvE2Ix0cI8IcVCY1x0267AKxVWxJVW8Jr1l IxAIcVCF04k26cxKx2IYs7xG6r1j6r1xMIIF0xvEx4A2jsIE14v26F4j6r4UJwCI42IY6I 8E87Iv6xkF7I0E14v26r4j6r4UJbIYCTnIWIevJa73UjIFyTuYvjxU4X_-DUUUU X-Spam-Status: No, score=-12.7 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: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1776892685816608533 X-GMAIL-MSGID: 1776892685816608533 gcc/testsuite/ChangeLog: * gcc.target/loongarch/vector/lsx/lsx-vand.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vandi.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vandn.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vnor.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vnori.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vor.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vori.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vorn.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vxor.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vxori.c: New test. --- .../loongarch/vector/lsx/lsx-vand.c | 159 ++++++++++++++++ .../loongarch/vector/lsx/lsx-vandi.c | 67 +++++++ .../loongarch/vector/lsx/lsx-vandn.c | 129 +++++++++++++ .../loongarch/vector/lsx/lsx-vnor.c | 109 +++++++++++ .../loongarch/vector/lsx/lsx-vnori.c | 91 ++++++++++ .../gcc.target/loongarch/vector/lsx/lsx-vor.c | 169 ++++++++++++++++++ .../loongarch/vector/lsx/lsx-vori.c | 123 +++++++++++++ .../loongarch/vector/lsx/lsx-vorn.c | 109 +++++++++++ .../loongarch/vector/lsx/lsx-vxor.c | 79 ++++++++ .../loongarch/vector/lsx/lsx-vxori.c | 67 +++++++ 10 files changed, 1102 insertions(+) create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vand.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vandi.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vandn.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vnor.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vnori.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vor.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vori.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vorn.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vxor.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vxori.c diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vand.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vand.c new file mode 100644 index 00000000000..1597749b546 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vand.c @@ -0,0 +1,159 @@ +/* { 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_vand_v(__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]) = 0x03574e3a62407e03; + *((unsigned long*)& __m128i_op1[0]) = 0x0000000001010000; + *((unsigned long*)& __m128i_result[1]) = 0x03574e3a62407e03; + *((unsigned long*)& __m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vand_v(__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]) = 0x001fffff001fffff; + *((unsigned long*)& __m128i_op1[0]) = 0x001fffff001fffff; + *((unsigned long*)& __m128i_result[1]) = 0x001fffff001fffff; + *((unsigned long*)& __m128i_result[0]) = 0x001fffff001fffff; + __m128i_out = __lsx_vand_v(__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]) = 0x0008000000000000; + *((unsigned long*)& __m128i_op1[0]) = 0x0000000000000000; + *((unsigned long*)& __m128i_result[1]) = 0x0000000000000000; + *((unsigned long*)& __m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vand_v(__m128i_op0,__m128i_op1); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0x0000000000000000; + *((unsigned long*)& __m128i_op0[0]) = 0x0000000000000000; + *((unsigned long*)& __m128i_op1[1]) = 0x0000000000000000; + *((unsigned long*)& __m128i_op1[0]) = 0x0000000000000000; + *((unsigned long*)& __m128i_result[1]) = 0x0000000000000000; + *((unsigned long*)& __m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vand_v(__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]) = 0x00000000ffff53d9; + *((unsigned long*)& __m128i_op1[0]) = 0xffff0001ffff9515; + *((unsigned long*)& __m128i_result[1]) = 0x00000000ffff53d9; + *((unsigned long*)& __m128i_result[0]) = 0xffff0001ffff9515; + __m128i_out = __lsx_vand_v(__m128i_op0,__m128i_op1); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0x0000000000000000; + *((unsigned long*)& __m128i_op0[0]) = 0x0000000000000000; + *((unsigned long*)& __m128i_op1[1]) = 0x0000000000000000; + *((unsigned long*)& __m128i_op1[0]) = 0x0000000000000000; + *((unsigned long*)& __m128i_result[1]) = 0x0000000000000000; + *((unsigned long*)& __m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vand_v(__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_vand_v(__m128i_op0,__m128i_op1); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0x0000000000000000; + *((unsigned long*)& __m128i_op0[0]) = 0x0000000000000000; + *((unsigned long*)& __m128i_op1[1]) = 0x0000000000000000; + *((unsigned long*)& __m128i_op1[0]) = 0x0000000000000000; + *((unsigned long*)& __m128i_result[1]) = 0x0000000000000000; + *((unsigned long*)& __m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vand_v(__m128i_op0,__m128i_op1); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0x67eb85af0000b000; + *((unsigned long*)& __m128i_op0[0]) = 0xc8847ef6ed3f2000; + *((unsigned long*)& __m128i_op1[1]) = 0x67eb85af0000b000; + *((unsigned long*)& __m128i_op1[0]) = 0xc8847ef6ed3f2000; + *((unsigned long*)& __m128i_result[1]) = 0x67eb85af0000b000; + *((unsigned long*)& __m128i_result[0]) = 0xc8847ef6ed3f2000; + __m128i_out = __lsx_vand_v(__m128i_op0,__m128i_op1); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0x0000000000000000; + *((unsigned long*)& __m128i_op0[0]) = 0x0000000000000000; + *((unsigned long*)& __m128i_op1[1]) = 0x0000000000000000; + *((unsigned long*)& __m128i_op1[0]) = 0x0000000000000000; + *((unsigned long*)& __m128i_result[1]) = 0x0000000000000000; + *((unsigned long*)& __m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vand_v(__m128i_op0,__m128i_op1); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0x0000000000000000; + *((unsigned long*)& __m128i_op0[0]) = 0x0000000000000000; + *((unsigned long*)& __m128i_op1[1]) = 0x0313100003131000; + *((unsigned long*)& __m128i_op1[0]) = 0x0313100003131000; + *((unsigned long*)& __m128i_result[1]) = 0x0000000000000000; + *((unsigned long*)& __m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vand_v(__m128i_op0,__m128i_op1); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0x0000000000000000; + *((unsigned long*)& __m128i_op0[0]) = 0x0000000200000002; + *((unsigned long*)& __m128i_op1[1]) = 0x0007000000050000; + *((unsigned long*)& __m128i_op1[0]) = 0x0003000100010001; + *((unsigned long*)& __m128i_result[1]) = 0x0000000000000000; + *((unsigned long*)& __m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vand_v(__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]) = 0x0a0000000a000000; + *((unsigned long*)& __m128i_op1[0]) = 0x0a0000000a000000; + *((unsigned long*)& __m128i_result[1]) = 0x0000000000000000; + *((unsigned long*)& __m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vand_v(__m128i_op0,__m128i_op1); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vandi.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vandi.c new file mode 100644 index 00000000000..906da69caf7 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vandi.c @@ -0,0 +1,67 @@ +/* { 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_vandi_b(__m128i_op0,0x36); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0x0000000000000800; + *((unsigned long*)& __m128i_op0[0]) = 0x0000000000000000; + *((unsigned long*)& __m128i_result[1]) = 0x0000000000000800; + *((unsigned long*)& __m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vandi_b(__m128i_op0,0x39); + 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_vandi_b(__m128i_op0,0x27); + 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_vandi_b(__m128i_op0,0x25); + 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_vandi_b(__m128i_op0,0xbd); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0x0000a95afc60a5c5; + *((unsigned long*)& __m128i_op0[0]) = 0x0000b6e414157f84; + *((unsigned long*)& __m128i_result[1]) = 0x0000204264602444; + *((unsigned long*)& __m128i_result[0]) = 0x0000266404046604; + __m128i_out = __lsx_vandi_b(__m128i_op0,0x66); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vandn.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vandn.c new file mode 100644 index 00000000000..3ae2d769421 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vandn.c @@ -0,0 +1,129 @@ +/* { 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]) = 0x000000017fff9000; + *((unsigned long*)& __m128i_op1[0]) = 0x0000000210011084; + *((unsigned long*)& __m128i_result[1]) = 0x000000017fff9000; + *((unsigned long*)& __m128i_result[0]) = 0x0000000210011084; + __m128i_out = __lsx_vandn_v(__m128i_op0,__m128i_op1); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0x0000000000000000; + *((unsigned long*)& __m128i_op0[0]) = 0x0000000000000000; + *((unsigned long*)& __m128i_op1[1]) = 0x0000000000000000; + *((unsigned long*)& __m128i_op1[0]) = 0x0000000000000000; + *((unsigned long*)& __m128i_result[1]) = 0x0000000000000000; + *((unsigned long*)& __m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vandn_v(__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]) = 0x00000049000000c0; + *((unsigned long*)& __m128i_op1[0]) = 0x00000001ffffff29; + *((unsigned long*)& __m128i_result[1]) = 0x00000049000000c0; + *((unsigned long*)& __m128i_result[0]) = 0x00000000ffffff29; + __m128i_out = __lsx_vandn_v(__m128i_op0,__m128i_op1); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0x010f00000111fffc; + *((unsigned long*)& __m128i_op0[0]) = 0x016700dc0176003a; + *((unsigned long*)& __m128i_op1[1]) = 0x0000000000000000; + *((unsigned long*)& __m128i_op1[0]) = 0x0000000000000000; + *((unsigned long*)& __m128i_result[1]) = 0x0000000000000000; + *((unsigned long*)& __m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vandn_v(__m128i_op0,__m128i_op1); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0x0003000000010000; + *((unsigned long*)& __m128i_op0[0]) = 0x0002000000010000; + *((unsigned long*)& __m128i_op1[1]) = 0x0000000000000000; + *((unsigned long*)& __m128i_op1[0]) = 0x0000000000000000; + *((unsigned long*)& __m128i_result[1]) = 0x0000000000000000; + *((unsigned long*)& __m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vandn_v(__m128i_op0,__m128i_op1); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0x8000000000000000; + *((unsigned long*)& __m128i_op0[0]) = 0xfffffffffffff000; + *((unsigned long*)& __m128i_op1[1]) = 0x8000000000000000; + *((unsigned long*)& __m128i_op1[0]) = 0xfffffffffffff000; + *((unsigned long*)& __m128i_result[1]) = 0x0000000000000000; + *((unsigned long*)& __m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vandn_v(__m128i_op0,__m128i_op1); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0x0000000000000000; + *((unsigned long*)& __m128i_op0[0]) = 0x0000000000000000; + *((unsigned long*)& __m128i_op1[1]) = 0x62cbf96e4acfaf40; + *((unsigned long*)& __m128i_op1[0]) = 0xf0bc9a5278285a4a; + *((unsigned long*)& __m128i_result[1]) = 0x62cbf96e4acfaf40; + *((unsigned long*)& __m128i_result[0]) = 0xf0bc9a5278285a4a; + __m128i_out = __lsx_vandn_v(__m128i_op0,__m128i_op1); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0x0000000000000000; + *((unsigned long*)& __m128i_op0[0]) = 0x0000000000000000; + *((unsigned long*)& __m128i_op1[1]) = 0x0000000000000000; + *((unsigned long*)& __m128i_op1[0]) = 0x0000000000000000; + *((unsigned long*)& __m128i_result[1]) = 0x0000000000000000; + *((unsigned long*)& __m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vandn_v(__m128i_op0,__m128i_op1); + 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_vandn_v(__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]) = 0xffffffffffffffff; + *((unsigned long*)& __m128i_op1[0]) = 0x0000000000000000; + *((unsigned long*)& __m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long*)& __m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vandn_v(__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]) = 0x9c7c266e71768fa4; + *((unsigned long*)& __m128i_result[1]) = 0x0000000000000000; + *((unsigned long*)& __m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vandn_v(__m128i_op0,__m128i_op1); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vnor.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vnor.c new file mode 100644 index 00000000000..a7a3acce933 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vnor.c @@ -0,0 +1,109 @@ +/* { 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]) = 0x00000000fff8fff8; + *((unsigned long*)& __m128i_op1[0]) = 0x00000000fff80000; + *((unsigned long*)& __m128i_result[1]) = 0xffffffff00070007; + *((unsigned long*)& __m128i_result[0]) = 0xffffffff0007ffff; + __m128i_out = __lsx_vnor_v(__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_vnor_v(__m128i_op0,__m128i_op1); + 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_vnor_v(__m128i_op0,__m128i_op1); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0x0000000000000000; + *((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]) = 0xffffffffffffffff; + __m128i_out = __lsx_vnor_v(__m128i_op0,__m128i_op1); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0xce23d33e43d9736c; + *((unsigned long*)& __m128i_op0[0]) = 0x63b2ac27aa076aeb; + *((unsigned long*)& __m128i_op1[1]) = 0x0000000000000000; + *((unsigned long*)& __m128i_op1[0]) = 0x0000000000000000; + *((unsigned long*)& __m128i_result[1]) = 0x31dc2cc1bc268c93; + *((unsigned long*)& __m128i_result[0]) = 0x9c4d53d855f89514; + __m128i_out = __lsx_vnor_v(__m128i_op0,__m128i_op1); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0x0000000000000000; + *((unsigned long*)& __m128i_op0[0]) = 0x000000000000000c; + *((unsigned long*)& __m128i_op1[1]) = 0x0000000000000000; + *((unsigned long*)& __m128i_op1[0]) = 0x0000000000000000; + *((unsigned long*)& __m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long*)& __m128i_result[0]) = 0xfffffffffffffff3; + __m128i_out = __lsx_vnor_v(__m128i_op0,__m128i_op1); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0x0000400080003fff; + *((unsigned long*)& __m128i_op0[0]) = 0x0000bc2000007e04; + *((unsigned long*)& __m128i_op1[1]) = 0x0000400080003fff; + *((unsigned long*)& __m128i_op1[0]) = 0x0000bc2000007e04; + *((unsigned long*)& __m128i_result[1]) = 0xffffbfff7fffc000; + *((unsigned long*)& __m128i_result[0]) = 0xffff43dfffff81fb; + __m128i_out = __lsx_vnor_v(__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]) = 0x5252525252525252; + *((unsigned long*)& __m128i_op1[0]) = 0x5252525252525252; + *((unsigned long*)& __m128i_result[1]) = 0xada4808924882588; + *((unsigned long*)& __m128i_result[0]) = 0xacad25090caca5a4; + __m128i_out = __lsx_vnor_v(__m128i_op0,__m128i_op1); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0x0000000000000000; + *((unsigned long*)& __m128i_op0[0]) = 0xfffefffe0000ff18; + *((unsigned long*)& __m128i_op1[1]) = 0xffff000000000000; + *((unsigned long*)& __m128i_op1[0]) = 0x00000000ffffffff; + *((unsigned long*)& __m128i_result[1]) = 0x0000ffffffffffff; + *((unsigned long*)& __m128i_result[0]) = 0x0001000100000000; + __m128i_out = __lsx_vnor_v(__m128i_op0,__m128i_op1); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vnori.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vnori.c new file mode 100644 index 00000000000..a07a02ab212 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vnori.c @@ -0,0 +1,91 @@ +/* { 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]) = 0x00000000ffff0000; + *((unsigned long*)& __m128i_op0[0]) = 0x00000000ffff0000; + *((unsigned long*)& __m128i_result[1]) = 0xcccccccc0000cccc; + *((unsigned long*)& __m128i_result[0]) = 0xcccccccc0000cccc; + __m128i_out = __lsx_vnori_b(__m128i_op0,0x33); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long*)& __m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long*)& __m128i_result[1]) = 0x0000000000000000; + *((unsigned long*)& __m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vnori_b(__m128i_op0,0xa6); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0x0000000000000000; + *((unsigned long*)& __m128i_op0[0]) = 0x3e035e51522f0799; + *((unsigned long*)& __m128i_result[1]) = 0x9292929292929292; + *((unsigned long*)& __m128i_result[0]) = 0x8090808280909002; + __m128i_out = __lsx_vnori_b(__m128i_op0,0x6d); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0x00000000000ffc2f; + *((unsigned long*)& __m128i_op0[0]) = 0x00201df000000000; + *((unsigned long*)& __m128i_result[1]) = 0x3838383838300010; + *((unsigned long*)& __m128i_result[0]) = 0x3818200838383838; + __m128i_out = __lsx_vnori_b(__m128i_op0,0xc7); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0x2020202020202020; + *((unsigned long*)& __m128i_op0[0]) = 0x2020202020207f7f; + *((unsigned long*)& __m128i_result[1]) = 0x5d5d5d5d5d5d5d5d; + *((unsigned long*)& __m128i_result[0]) = 0x5d5d5d5d5d5d0000; + __m128i_out = __lsx_vnori_b(__m128i_op0,0xa2); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0x0000000000000000; + *((unsigned long*)& __m128i_op0[0]) = 0x0000000000000000; + *((unsigned long*)& __m128i_result[1]) = 0x8080808080808080; + *((unsigned long*)& __m128i_result[0]) = 0x8080808080808080; + __m128i_out = __lsx_vnori_b(__m128i_op0,0x7f); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0x8080808080808080; + *((unsigned long*)& __m128i_op0[0]) = 0x8080808080808080; + *((unsigned long*)& __m128i_result[1]) = 0x1313131313131313; + *((unsigned long*)& __m128i_result[0]) = 0x1313131313131313; + __m128i_out = __lsx_vnori_b(__m128i_op0,0xec); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0x0000000000000000; + *((unsigned long*)& __m128i_op0[0]) = 0x0000000000000000; + *((unsigned long*)& __m128i_result[1]) = 0x9d9d9d9d9d9d9d9d; + *((unsigned long*)& __m128i_result[0]) = 0x9d9d9d9d9d9d9d9d; + __m128i_out = __lsx_vnori_b(__m128i_op0,0x62); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0x00f525682ffd27f2; + *((unsigned long*)& __m128i_op0[0]) = 0x00365c60317ff930; + *((unsigned long*)& __m128i_result[1]) = 0xe500c085c000c005; + *((unsigned long*)& __m128i_result[0]) = 0xe5c1a185c48004c5; + __m128i_out = __lsx_vnori_b(__m128i_op0,0x1a); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vor.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vor.c new file mode 100644 index 00000000000..537a1bb3b64 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vor.c @@ -0,0 +1,169 @@ +/* { 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_op1[1]) = 0x7e44bde9b842ff23; + *((unsigned long*)& __m128i_op1[0]) = 0x00011e80007edff8; + *((unsigned long*)& __m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long*)& __m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vor_v(__m128i_op0,__m128i_op1); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0x0000000000000000; + *((unsigned long*)& __m128i_op0[0]) = 0x0000000000000000; + *((unsigned long*)& __m128i_op1[1]) = 0x0000000000000000; + *((unsigned long*)& __m128i_op1[0]) = 0x0000000000000000; + *((unsigned long*)& __m128i_result[1]) = 0x0000000000000000; + *((unsigned long*)& __m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vor_v(__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]) = 0x0000000000000001; + *((unsigned long*)& __m128i_op1[0]) = 0xfffc001fffffffff; + *((unsigned long*)& __m128i_result[1]) = 0x00000000ffffffff; + *((unsigned long*)& __m128i_result[0]) = 0xfffc001fffffffff; + __m128i_out = __lsx_vor_v(__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]) = 0x0000000000200010; + __m128i_out = __lsx_vor_v(__m128i_op0,__m128i_op1); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0x0000000000000000; + *((unsigned long*)& __m128i_op0[0]) = 0x0000000000000000; + *((unsigned long*)& __m128i_op1[1]) = 0x0000000000000000; + *((unsigned long*)& __m128i_op1[0]) = 0x0000000000000000; + *((unsigned long*)& __m128i_result[1]) = 0x0000000000000000; + *((unsigned long*)& __m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vor_v(__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]) = 0x4f804f804f804f80; + *((unsigned long*)& __m128i_op1[0]) = 0x4f804f804f804f80; + *((unsigned long*)& __m128i_result[1]) = 0x4f804f804f804f80; + *((unsigned long*)& __m128i_result[0]) = 0x4f804f804f804f80; + __m128i_out = __lsx_vor_v(__m128i_op0,__m128i_op1); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0x0000000000000000; + *((unsigned long*)& __m128i_op0[0]) = 0x3e035e51522f0799; + *((unsigned long*)& __m128i_op1[1]) = 0x0000000000000000; + *((unsigned long*)& __m128i_op1[0]) = 0x3e035e51522f0799; + *((unsigned long*)& __m128i_result[1]) = 0x0000000000000000; + *((unsigned long*)& __m128i_result[0]) = 0x3e035e51522f0799; + __m128i_out = __lsx_vor_v(__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_vor_v(__m128i_op0,__m128i_op1); + 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_result[1]) = 0xffffffff00000000; + *((unsigned long*)& __m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vor_v(__m128i_op0,__m128i_op1); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0xfffb00fdfdf7ffff; + *((unsigned long*)& __m128i_op0[0]) = 0xfff8000000000000; + *((unsigned long*)& __m128i_op1[1]) = 0xfffb00fdfdf7ffff; + *((unsigned long*)& __m128i_op1[0]) = 0xfff8000000000000; + *((unsigned long*)& __m128i_result[1]) = 0xfffb00fdfdf7ffff; + *((unsigned long*)& __m128i_result[0]) = 0xfff8000000000000; + __m128i_out = __lsx_vor_v(__m128i_op0,__m128i_op1); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0xffffffff80005613; + *((unsigned long*)& __m128i_op0[0]) = 0x81000080806b000b; + *((unsigned long*)& __m128i_op1[1]) = 0xffff00011cf0c569; + *((unsigned long*)& __m128i_op1[0]) = 0xc0000002b0995850; + *((unsigned long*)& __m128i_result[1]) = 0xffffffff9cf0d77b; + *((unsigned long*)& __m128i_result[0]) = 0xc1000082b0fb585b; + __m128i_out = __lsx_vor_v(__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]) = 0x0000000000000000; + *((unsigned long*)& __m128i_op1[0]) = 0x80808080806b000b; + *((unsigned long*)& __m128i_result[1]) = 0x0000000000000000; + *((unsigned long*)& __m128i_result[0]) = 0xfffffffffffbfffb; + __m128i_out = __lsx_vor_v(__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]) = 0x0000ffff0000ffff; + *((unsigned long*)& __m128i_op1[0]) = 0x0000ffff0000ffff; + *((unsigned long*)& __m128i_result[1]) = 0x0001ffff0101ffff; + *((unsigned long*)& __m128i_result[0]) = 0x0001ffff0001ffff; + __m128i_out = __lsx_vor_v(__m128i_op0,__m128i_op1); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0xffffffffc105d1aa; + *((unsigned long*)& __m128i_op0[0]) = 0xffffffffbc19ecca; + *((unsigned long*)& __m128i_op1[1]) = 0xc0b4d1a5f8babad3; + *((unsigned long*)& __m128i_op1[0]) = 0xbbc8ecc5f3ced5f3; + *((unsigned long*)& __m128i_result[1]) = 0xfffffffff9bffbfb; + *((unsigned long*)& __m128i_result[0]) = 0xffffffffffdffdfb; + __m128i_out = __lsx_vor_v(__m128i_op0,__m128i_op1); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0x0000000000000000; + *((unsigned long*)& __m128i_op0[0]) = 0x0000000000000000; + *((unsigned long*)& __m128i_op1[1]) = 0x0000000000000000; + *((unsigned long*)& __m128i_op1[0]) = 0x0000000000000000; + *((unsigned long*)& __m128i_result[1]) = 0x0000000000000000; + *((unsigned long*)& __m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vor_v(__m128i_op0,__m128i_op1); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vori.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vori.c new file mode 100644 index 00000000000..8a6e035c93b --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vori.c @@ -0,0 +1,123 @@ +/* { 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]) = 0x8282828282828282; + *((unsigned long*)& __m128i_result[0]) = 0x8282828282828282; + __m128i_out = __lsx_vori_b(__m128i_op0,0x82); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0x7505853d654185f5; + *((unsigned long*)& __m128i_op0[0]) = 0x01010000fefe0101; + *((unsigned long*)& __m128i_result[1]) = 0x7545c57d6541c5f5; + *((unsigned long*)& __m128i_result[0]) = 0x41414040fefe4141; + __m128i_out = __lsx_vori_b(__m128i_op0,0x40); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0x0000c2f90000bafa; + *((unsigned long*)& __m128i_op0[0]) = 0x8000c2fa8000c2fa; + *((unsigned long*)& __m128i_result[1]) = 0x7474f6fd7474fefe; + *((unsigned long*)& __m128i_result[0]) = 0xf474f6fef474f6fe; + __m128i_out = __lsx_vori_b(__m128i_op0,0x74); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0x0000000000000000; + *((unsigned long*)& __m128i_op0[0]) = 0x0000000000000000; + *((unsigned long*)& __m128i_result[1]) = 0x3d3d3d3d3d3d3d3d; + *((unsigned long*)& __m128i_result[0]) = 0x3d3d3d3d3d3d3d3d; + __m128i_out = __lsx_vori_b(__m128i_op0,0x3d); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0xfffffacdb6dbecac; + *((unsigned long*)& __m128i_op0[0]) = 0x1f5533a694f902c0; + *((unsigned long*)& __m128i_result[1]) = 0xfffffadffedbfefe; + *((unsigned long*)& __m128i_result[0]) = 0x5f5f7bfedefb5ada; + __m128i_out = __lsx_vori_b(__m128i_op0,0x5a); + 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_vori_b(__m128i_op0,0x38); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0x0d1202e19235e2bc; + *((unsigned long*)& __m128i_op0[0]) = 0xea38e0f75f6e56d1; + *((unsigned long*)& __m128i_result[1]) = 0x2f3626e7b637e6be; + *((unsigned long*)& __m128i_result[0]) = 0xee3ee6f77f6e76f7; + __m128i_out = __lsx_vori_b(__m128i_op0,0x26); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0x0003c853c843c87e; + *((unsigned long*)& __m128i_op0[0]) = 0x0003c853c843c87e; + *((unsigned long*)& __m128i_result[1]) = 0xd6d7ded7ded7defe; + *((unsigned long*)& __m128i_result[0]) = 0xd6d7ded7ded7defe; + __m128i_out = __lsx_vori_b(__m128i_op0,0xd6); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0x0000000000000000; + *((unsigned long*)& __m128i_op0[0]) = 0xfffe0000fffe0000; + *((unsigned long*)& __m128i_result[1]) = 0x7777777777777777; + *((unsigned long*)& __m128i_result[0]) = 0xffff7777ffff7777; + __m128i_out = __lsx_vori_b(__m128i_op0,0x77); + 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_vori_b(__m128i_op0,0x55); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0x8000000000000000; + *((unsigned long*)& __m128i_op0[0]) = 0x8000000000000000; + *((unsigned long*)& __m128i_result[1]) = 0xd454545454545454; + *((unsigned long*)& __m128i_result[0]) = 0xd454545454545454; + __m128i_out = __lsx_vori_b(__m128i_op0,0x54); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0x0000000000000000; + *((unsigned long*)& __m128i_op0[0]) = 0x0000000000000000; + *((unsigned long*)& __m128i_result[1]) = 0x4f4f4f4f4f4f4f4f; + *((unsigned long*)& __m128i_result[0]) = 0x4f4f4f4f4f4f4f4f; + __m128i_out = __lsx_vori_b(__m128i_op0,0x4f); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0x0000000000000000; + *((unsigned long*)& __m128i_op0[0]) = 0x0000000000000000; + *((unsigned long*)& __m128i_result[1]) = 0x8a8a8a8a8a8a8a8a; + *((unsigned long*)& __m128i_result[0]) = 0x8a8a8a8a8a8a8a8a; + __m128i_out = __lsx_vori_b(__m128i_op0,0x8a); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vorn.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vorn.c new file mode 100644 index 00000000000..bb59bc312b8 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vorn.c @@ -0,0 +1,109 @@ +/* { 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]) = 0x0001000100010001; + *((unsigned long*)& __m128i_op0[0]) = 0x000100010001fffe; + *((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_vorn_v(__m128i_op0,__m128i_op1); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0x0000000000000000; + *((unsigned long*)& __m128i_op0[0]) = 0x0000000000000000; + *((unsigned long*)& __m128i_op1[1]) = 0x00d3012b015700bb; + *((unsigned long*)& __m128i_op1[0]) = 0x00010000ffca0070; + *((unsigned long*)& __m128i_result[1]) = 0xff2cfed4fea8ff44; + *((unsigned long*)& __m128i_result[0]) = 0xfffeffff0035ff8f; + __m128i_out = __lsx_vorn_v(__m128i_op0,__m128i_op1); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0x00fe00fe00fe00fe; + *((unsigned long*)& __m128i_op0[0]) = 0x00fe00fe00fe0045; + *((unsigned long*)& __m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long*)& __m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long*)& __m128i_result[1]) = 0x00fe00fe00fe00fe; + *((unsigned long*)& __m128i_result[0]) = 0x00fe00fe00fe0045; + __m128i_out = __lsx_vorn_v(__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]) = 0x0000010000010101; + *((unsigned long*)& __m128i_op1[0]) = 0x0101000001000100; + *((unsigned long*)& __m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long*)& __m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vorn_v(__m128i_op0,__m128i_op1); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0x0000000000000000; + *((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]) = 0xffffffffffffffff; + __m128i_out = __lsx_vorn_v(__m128i_op0,__m128i_op1); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0x0000000000000000; + *((unsigned long*)& __m128i_op0[0]) = 0x0000000000000002; + *((unsigned long*)& __m128i_op1[1]) = 0x0000000000000000; + *((unsigned long*)& __m128i_op1[0]) = 0x0000000000000002; + *((unsigned long*)& __m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long*)& __m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vorn_v(__m128i_op0,__m128i_op1); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0x33f5c2d7d975d7fe; + *((unsigned long*)& __m128i_op0[0]) = 0xe4423f7b769f8ffe; + *((unsigned long*)& __m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long*)& __m128i_op1[0]) = 0x0000000000000000; + *((unsigned long*)& __m128i_result[1]) = 0x33f5c2d7d975d7fe; + *((unsigned long*)& __m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vorn_v(__m128i_op0,__m128i_op1); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0x00050eb00000fffa; + *((unsigned long*)& __m128i_op0[0]) = 0x0000f8a50000f310; + *((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_vorn_v(__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]) = 0x0001000100010012; + *((unsigned long*)& __m128i_op1[0]) = 0x00000000ffe1ffc0; + *((unsigned long*)& __m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long*)& __m128i_result[0]) = 0xffffffff009ff83f; + __m128i_out = __lsx_vorn_v(__m128i_op0,__m128i_op1); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vxor.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vxor.c new file mode 100644 index 00000000000..72fa9717489 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vxor.c @@ -0,0 +1,79 @@ +/* { 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]) = 0x00000000f4012ceb; + *((unsigned long*)& __m128i_result[1]) = 0x0000000000000000; + *((unsigned long*)& __m128i_result[0]) = 0x00000000f4012ceb; + __m128i_out = __lsx_vxor_v(__m128i_op0,__m128i_op1); + 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_vxor_v(__m128i_op0,__m128i_op1); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0x0000000000000000; + *((unsigned long*)& __m128i_op0[0]) = 0x0000000000000000; + *((unsigned long*)& __m128i_op1[1]) = 0x0000000000000000; + *((unsigned long*)& __m128i_op1[0]) = 0x0000000000000000; + *((unsigned long*)& __m128i_result[1]) = 0x0000000000000000; + *((unsigned long*)& __m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vxor_v(__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]) = 0x0000000000000001; + *((unsigned long*)& __m128i_op1[0]) = 0x0000000000000000; + *((unsigned long*)& __m128i_result[1]) = 0x3ff0000000000001; + *((unsigned long*)& __m128i_result[0]) = 0x40f3fa0000000000; + __m128i_out = __lsx_vxor_v(__m128i_op0,__m128i_op1); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0x0000000000000000; + *((unsigned long*)& __m128i_op0[0]) = 0x0000000000000000; + *((unsigned long*)& __m128i_op1[1]) = 0x0000000000000000; + *((unsigned long*)& __m128i_op1[0]) = 0x0000000080000068; + *((unsigned long*)& __m128i_result[1]) = 0x0000000000000000; + *((unsigned long*)& __m128i_result[0]) = 0x0000000080000068; + __m128i_out = __lsx_vxor_v(__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]) = 0xffffffffffffffff; + *((unsigned long*)& __m128i_op1[0]) = 0xffff0001ffff9514; + *((unsigned long*)& __m128i_result[1]) = 0xffffffff0000ac26; + *((unsigned long*)& __m128i_result[0]) = 0x00ff000000000001; + __m128i_out = __lsx_vxor_v(__m128i_op0,__m128i_op1); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vxori.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vxori.c new file mode 100644 index 00000000000..cc823d4ba2e --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vxori.c @@ -0,0 +1,67 @@ +/* { 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]) = 0x0404040404040404; + *((unsigned long*)& __m128i_result[0]) = 0x0404040404040404; + __m128i_out = __lsx_vxori_b(__m128i_op0,0x4); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0x0000000001000100; + *((unsigned long*)& __m128i_op0[0]) = 0x0000000001000100; + *((unsigned long*)& __m128i_result[1]) = 0x5a5a5a5a5b5a5b5a; + *((unsigned long*)& __m128i_result[0]) = 0x5a5a5a5a5b5a5b5a; + __m128i_out = __lsx_vxori_b(__m128i_op0,0x5a); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0x0000000000000000; + *((unsigned long*)& __m128i_op0[0]) = 0x0000000000000000; + *((unsigned long*)& __m128i_result[1]) = 0xe3e3e3e3e3e3e3e3; + *((unsigned long*)& __m128i_result[0]) = 0xe3e3e3e3e3e3e3e3; + __m128i_out = __lsx_vxori_b(__m128i_op0,0xe3); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0x0000000000000000; + *((unsigned long*)& __m128i_op0[0]) = 0x0020002000200020; + *((unsigned long*)& __m128i_result[1]) = 0x9a9a9a9a9a9a9a9a; + *((unsigned long*)& __m128i_result[0]) = 0x9aba9aba9aba9aba; + __m128i_out = __lsx_vxori_b(__m128i_op0,0x9a); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0x0000000000000000; + *((unsigned long*)& __m128i_op0[0]) = 0x0000000000000000; + *((unsigned long*)& __m128i_result[1]) = 0x9090909090909090; + *((unsigned long*)& __m128i_result[0]) = 0x9090909090909090; + __m128i_out = __lsx_vxori_b(__m128i_op0,0x90); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0x00000000b81c8382; + *((unsigned long*)& __m128i_op0[0]) = 0x0000000077af9450; + *((unsigned long*)& __m128i_result[1]) = 0xf1f1f1f149ed7273; + *((unsigned long*)& __m128i_result[0]) = 0xf1f1f1f1865e65a1; + __m128i_out = __lsx_vxori_b(__m128i_op0,0xf1); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + return 0; +} From patchwork Wed Sep 13 03:37:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: chenxiaolong X-Patchwork-Id: 138602 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9ecd:0:b0:3f2:4152:657d with SMTP id t13csp834960vqx; Tue, 12 Sep 2023 20:50:29 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHbpsBtJNR1bDK3r8IYfMvg3AYGTDP5mNvEps1NUbQw6bSzIK6mybEOJVGt/LD+NCELnBtq X-Received: by 2002:a17:907:2da3:b0:9a1:8993:9532 with SMTP id gt35-20020a1709072da300b009a189939532mr6620414ejc.30.1694577028881; Tue, 12 Sep 2023 20:50:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694577028; cv=none; d=google.com; s=arc-20160816; b=GF6kpHnbzhUCSxgieiMAAz/ssCy9O5jA5hTjE3tqg7sMPzh4Hfz+D99HfAfz0fGMeK 1rn1fW6Q6ME/TtHf6thFp+BltDDVNAEQ5jebNcXe9QRzyMUiM74ksjO2yEalzaRe8CQA EGPuxTcF8wTxU/vMWhEGFvmT/2ReLiHLdwe6GBRB4fnS18CE1Vis/7h9T2ihOKJU/mF4 2YS88/JzzH1WS2lxTBIUK06bgrsFLG0aQ9ox4fI0YGOqYb4MXj3fzQzQGuVS92BU5yeN 5etnI1ZYU/KRvfDE/NCimcs8lks4hFiDbfXQ1WDA5p1IMhYVjTekm6aQZltrzAdX/ILk xbJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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:cc:to :from:dmarc-filter:delivered-to; bh=g8nRpZ9dPsFfTxFi6og7PedKQdmgGNwwbomnOpd4Z0c=; fh=3pFUYcpS/27XRzOf17GfR86AuNQu+P1CET04YURgCLs=; b=lru91yiBPjOPnGvYeiffNafA9GdlWZgjQ2LUhNDv0aobxm+92qlCfWRqDNyZoogPOx vTopqEJwSHsQ8Z05NY02sIOkW8amD0dMpDPE3cTuO/rkTZya0zjJMUEQnLBJyjVf6baq 1fBMZfZ5f/qFlFjaWuRTAQbxZ2Y+PXVNPmjHppkvJCtDqoVk0FkhXxneHSkEJPR3eS/f i08D8S8Rq9JrDHHqw6sve15HAbtr30XgO8vLasO5ffGG1dKTKgUTMnYdylIivmwtJzYg 2gtxkMoP3PfFbU/3GGzNMb/KXLRJHxOpddBYKLBOi1mWdgHlfcSK8PKVy60/1/EQxXYW hTyQ== 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 cw13-20020a170906c78d00b0099bd6dd9362si8806278ejb.907.2023.09.12.20.50.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Sep 2023 20:50:28 -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 168DB3854810 for ; Wed, 13 Sep 2023 03:38:50 +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 705163893679 for ; Wed, 13 Sep 2023 03:37:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 705163893679 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 1qgGh9-0003xL-Ja for gcc-patches@gcc.gnu.org; Tue, 12 Sep 2023 23:37:45 -0400 Received: from loongson.cn (unknown [10.10.130.252]) by gateway (Coremail) with SMTP id _____8CxNvGBLgFlLTEmAA--.8316S3; Wed, 13 Sep 2023 11:37:37 +0800 (CST) Received: from slurm-master.loongson.cn (unknown [10.10.130.252]) by localhost.localdomain (Coremail) with SMTP id AQAAf8DxS9x3LgFlQhACAA--.3563S7; Wed, 13 Sep 2023 11:37:35 +0800 (CST) From: Xiaolong Chen To: gcc-patches@gcc.gnu.org Cc: xry111@xry111.site, i@xen0n.name, xuchenghua@loongson.cn, chenglulu@loongson.cn, Xiaolong Chen Subject: [PATCH v4 23/23] LoongArch: Add tests for SX vector vfmadd/vfnmadd/vld/vst instructions. Date: Wed, 13 Sep 2023 11:37:26 +0800 Message-Id: <20230913033726.6408-4-chenxiaolong@loongson.cn> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230913033726.6408-1-chenxiaolong@loongson.cn> References: <20230913033726.6408-1-chenxiaolong@loongson.cn> MIME-Version: 1.0 X-CM-TRANSID: AQAAf8DxS9x3LgFlQhACAA--.3563S7 X-CM-SenderInfo: hfkh05xldrz0tqj6z05rqj20fqof0/1tbiAQANBWUBHCIBHgAAsM X-Coremail-Antispam: 1Uk129KBj9fXoWDZr18Zw45ur1kJw17tw4xuFX_yoWxuFWUZo WUCryUZr4rG3Z7Z3W5Jw13CasFgF1Yk3ZIkr1UJrn0ya1Dt3yavFy8AF15JF1UKwsrAFy3 Zw12qr1xGw48Jr4kl-sFpf9Il3svdjkaLaAFLSUrUUUUjb8apTn2vfkv8UJUUUU8wcxFpf 9Il3svdxBIdaVrn0xqx4xG64xvF2IEw4CE5I8CrVC2j2Jv73VFW2AGmfu7bjvjm3AaLaJ3 UjIYCTnIWjp_UUUYY7kC6x804xWl14x267AKxVWUJVW8JwAFc2x0x2IEx4CE42xK8VAvwI 8IcIk0rVWrJVCq3wAFIxvE14AKwVWUGVWUXwA2ocxC64kIII0Yj41l84x0c7CEw4AK67xG Y2AK021l84ACjcxK6xIIjxv20xvE14v26F1j6w1UM28EF7xvwVC0I7IYx2IY6xkF7I0E14 v26F4j6r4UJwA2z4x0Y4vEx4A2jsIE14v26r4UJVWxJr1l84ACjcxK6I8E87Iv6xkF7I0E 14v26r4UJVWxJr1le2I262IYc4CY6c8Ij28IcVAaY2xG8wAqjxCEc2xF0cIa020Ex4CE44 I27wAqx4xG64xvF2IEw4CE5I8CrVC2j2WlYx0E2Ix0cI8IcVAFwI0_ZF0_GryDMcIj6I8E 87Iv67AKxVWxJVW8Jr1lOx8S6xCaFVCjc4AY6r1j6r4UM4x0Y48IcxkI7VAKI48JMxAIw2 8IcxkI7VAKI48JMxC20s026xCaFVCjc4AY6r1j6r4UMI8I3I0E5I8CrVAFwI0_Jr0_Jr4l x2IqxVCjr7xvwVAFwI0_JrI_JrWlx4CE17CEb7AF67AKxVWUAVWUtwCIc40Y0x0EwIxGrw CI42IY6xIIjxv20xvE14v26F1j6w1UMIIF0xvE2Ix0cI8IcVCY1x0267AKxVWxJVW8Jr1l IxAIcVCF04k26cxKx2IYs7xG6r1j6r1xMIIF0xvEx4A2jsIE14v26F4j6r4UJwCI42IY6I 8E87Iv6xkF7I0E14v26r4j6r4UJbIYCTnIWIevJa73UjIFyTuYvjxU4X_-DUUUU 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.8 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: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1776892802376806848 X-GMAIL-MSGID: 1776892802376806848 gcc/testsuite/ChangeLog: * gcc.target/loongarch/vector/lsx/lsx-vfmadd_d.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vfmadd_s.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vfnmadd_d.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vfnmadd_s.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vld.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vst.c: New test. --- .../loongarch/vector/lsx/lsx-vfmadd_d.c | 251 ++++++++++++ .../loongarch/vector/lsx/lsx-vfmadd_s.c | 381 ++++++++++++++++++ .../loongarch/vector/lsx/lsx-vfnmadd_d.c | 196 +++++++++ .../loongarch/vector/lsx/lsx-vfnmadd_s.c | 381 ++++++++++++++++++ .../gcc.target/loongarch/vector/lsx/lsx-vld.c | 62 +++ .../gcc.target/loongarch/vector/lsx/lsx-vst.c | 70 ++++ 6 files changed, 1341 insertions(+) create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfmadd_d.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfmadd_s.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfnmadd_d.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfnmadd_s.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vld.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vst.c diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfmadd_d.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfmadd_d.c new file mode 100644 index 00000000000..c5de1ac7ae9 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfmadd_d.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 *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[1]) = 0x8a228acac14e440a; + *((unsigned long *)&__m128d_op1[0]) = 0xc77c47cdc0f16549; + *((unsigned long *)&__m128d_op2[1]) = 0xffffffffd24271c4; + *((unsigned long *)&__m128d_op2[0]) = 0x2711bad1e8e309ed; + *((unsigned long *)&__m128d_result[1]) = 0xffffffffd24271c4; + *((unsigned long *)&__m128d_result[0]) = 0x2711bad1e8e309ed; + __m128d_out = __lsx_vfmadd_d (__m128d_op0, __m128d_op1, __m128d_op2); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128d_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128d_op2[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128d_op2[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128d_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128d_result[0]) = 0xffffffffffffffff; + __m128d_out = __lsx_vfmadd_d (__m128d_op0, __m128d_op1, __m128d_op2); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000040400000383; + *((unsigned long *)&__m128d_op0[0]) = 0xffffe000ffff1fff; + *((unsigned long *)&__m128d_op1[1]) = 0x0000040400000383; + *((unsigned long *)&__m128d_op1[0]) = 0xffffe000ffff1fff; + *((unsigned long *)&__m128d_op2[1]) = 0x0000000001000001; + *((unsigned long *)&__m128d_op2[0]) = 0x0001000100000000; + *((unsigned long *)&__m128d_result[1]) = 0x0000000001000001; + *((unsigned long *)&__m128d_result[0]) = 0xffffe000ffff1fff; + __m128d_out = __lsx_vfmadd_d (__m128d_op0, __m128d_op1, __m128d_op2); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[1]) = 0x00000000003f80b0; + *((unsigned long *)&__m128d_op1[0]) = 0x00000000ff800000; + *((unsigned long *)&__m128d_op2[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128d_op2[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128d_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128d_result[0]) = 0xffffffffffffffff; + __m128d_out = __lsx_vfmadd_d (__m128d_op0, __m128d_op1, __m128d_op2); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0080200000000000; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000000401000; + *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op2[1]) = 0x0000080000000000; + *((unsigned long *)&__m128d_op2[0]) = 0x0000080000000000; + *((unsigned long *)&__m128d_result[1]) = 0x0000080000000000; + *((unsigned long *)&__m128d_result[0]) = 0x0000080000000000; + __m128d_out = __lsx_vfmadd_d (__m128d_op0, __m128d_op1, __m128d_op2); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_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 *)&__m128d_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000; + __m128d_out = __lsx_vfmadd_d (__m128d_op0, __m128d_op1, __m128d_op2); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[0]) = 0x000000000000001e; + *((unsigned long *)&__m128d_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000; + __m128d_out = __lsx_vfmadd_d (__m128d_op0, __m128d_op1, __m128d_op2); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128d_op0[0]) = 0x7fff7fff7fff7fff; + *((unsigned long *)&__m128d_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128d_op1[0]) = 0x3fff3fff3fff3fff; + *((unsigned long *)&__m128d_op2[1]) = 0xfffb00fdfdf7ffff; + *((unsigned long *)&__m128d_op2[0]) = 0xfff8000000000000; + *((unsigned long *)&__m128d_result[1]) = 0xfffb00fdfdf7ffff; + *((unsigned long *)&__m128d_result[0]) = 0xfff8000000000000; + __m128d_out = __lsx_vfmadd_d (__m128d_op0, __m128d_op1, __m128d_op2); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x8000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x8000000000000000; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op2[1]) = 0x0000000009000900; + *((unsigned long *)&__m128d_op2[0]) = 0x0000000009000900; + *((unsigned long *)&__m128d_result[1]) = 0x0000000009000900; + *((unsigned long *)&__m128d_result[0]) = 0x0000000009000900; + __m128d_out = __lsx_vfmadd_d (__m128d_op0, __m128d_op1, __m128d_op2); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000200000002; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[0]) = 0x0000000200000002; + *((unsigned long *)&__m128d_op2[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128d_op2[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128d_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128d_result[0]) = 0xffffffffffffffff; + __m128d_out = __lsx_vfmadd_d (__m128d_op0, __m128d_op1, __m128d_op2); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x9c83e21a22001818; + *((unsigned long *)&__m128d_op0[0]) = 0xdd3b8b02563b2d7b; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[0]) = 0x7f7f7f007f7f7f00; + *((unsigned long *)&__m128d_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op2[0]) = 0x7f7f7f007f7f7f00; + *((unsigned long *)&__m128d_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[0]) = 0xfff0000000000000; + __m128d_out = __lsx_vfmadd_d (__m128d_op0, __m128d_op1, __m128d_op2); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0xff00e400ff00e400; + *((unsigned long *)&__m128d_op0[0]) = 0xff01e41ffff0ffff; + *((unsigned long *)&__m128d_op1[1]) = 0x5555000054100000; + *((unsigned long *)&__m128d_op1[0]) = 0x5555000154100155; + *((unsigned long *)&__m128d_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[1]) = 0xfff0000000000000; + *((unsigned long *)&__m128d_result[0]) = 0xfff0000000000000; + __m128d_out = __lsx_vfmadd_d (__m128d_op0, __m128d_op1, __m128d_op2); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000010; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op2[0]) = 0x0000000000000010; + *((unsigned long *)&__m128d_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[0]) = 0x8000000000000010; + __m128d_out = __lsx_vfmsub_d (__m128d_op0, __m128d_op1, __m128d_op2); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0xfc01fcfefc02fdf7; + *((unsigned long *)&__m128d_op0[0]) = 0xfe00fcfffe01fd01; + *((unsigned long *)&__m128d_op1[1]) = 0xfc01fd1300000001; + *((unsigned long *)&__m128d_op1[0]) = 0xfe00fd1400010000; + *((unsigned long *)&__m128d_op2[1]) = 0xfc01fcfefc02fdf7; + *((unsigned long *)&__m128d_op2[0]) = 0xfe00fcfffe01fd01; + *((unsigned long *)&__m128d_result[1]) = 0x7ff0000000000000; + *((unsigned long *)&__m128d_result[0]) = 0x7ff0000000000000; + __m128d_out = __lsx_vfmsub_d (__m128d_op0, __m128d_op1, __m128d_op2); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[0]) = 0x0000bd3d00000000; + *((unsigned long *)&__m128d_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000; + __m128d_out = __lsx_vfmsub_d (__m128d_op0, __m128d_op1, __m128d_op2); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128d_op1[1]) = 0x0038d800ff000000; + *((unsigned long *)&__m128d_op1[0]) = 0x00fffe00fffffe00; + *((unsigned long *)&__m128d_op2[1]) = 0x8000008000008080; + *((unsigned long *)&__m128d_op2[0]) = 0x8080800000800080; + *((unsigned long *)&__m128d_result[1]) = 0x0000008000008080; + *((unsigned long *)&__m128d_result[0]) = 0xffffffffffffffff; + __m128d_out = __lsx_vfmsub_d (__m128d_op0, __m128d_op1, __m128d_op2); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_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 *)&__m128d_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000; + __m128d_out = __lsx_vfmsub_d (__m128d_op0, __m128d_op1, __m128d_op2); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[0]) = 0x00ff80ff00ff80ff; + *((unsigned long *)&__m128d_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op2[0]) = 0x0000000900000009; + *((unsigned long *)&__m128d_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[0]) = 0xffffffffffffffff; + __m128d_out = __lsx_vfmsub_d (__m128d_op0, __m128d_op1, __m128d_op2); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x000000007ff000ff; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000; + __m128d_out = __lsx_vfmsub_d (__m128d_op0, __m128d_op1, __m128d_op2); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0xffffff7ffffffffe; + *((unsigned long *)&__m128d_op0[0]) = 0x00000000fffffffe; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[1]) = 0xffffff7ffffffffe; + *((unsigned long *)&__m128d_result[0]) = 0x0000000000000000; + __m128d_out = __lsx_vfmsub_d (__m128d_op0, __m128d_op1, __m128d_op2); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[1]) = 0x67eb85afb2ebb000; + *((unsigned long *)&__m128d_op1[0]) = 0xc8847ef6ed3f2000; + *((unsigned long *)&__m128d_op2[1]) = 0x0000000100000000; + *((unsigned long *)&__m128d_op2[0]) = 0x0000000000000103; + *((unsigned long *)&__m128d_result[1]) = 0x8000000100000000; + *((unsigned long *)&__m128d_result[0]) = 0x8000000000000103; + __m128d_out = __lsx_vfmsub_d (__m128d_op0, __m128d_op1, __m128d_op2); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfmadd_s.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfmadd_s.c new file mode 100644 index 00000000000..6b85e87bdce --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfmadd_s.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; + + *((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; + *((int *)&__m128_op2[3]) = 0x00000000; + *((int *)&__m128_op2[2]) = 0x00000000; + *((int *)&__m128_op2[1]) = 0x00000002; + *((int *)&__m128_op2[0]) = 0x00000000; + *((int *)&__m128_result[3]) = 0x00000000; + *((int *)&__m128_result[2]) = 0x00000000; + *((int *)&__m128_result[1]) = 0x00000002; + *((int *)&__m128_result[0]) = 0x00000000; + __m128_out = __lsx_vfmadd_s (__m128_op0, __m128_op1, __m128_op2); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((int *)&__m128_op0[3]) = 0x0028e0a1; + *((int *)&__m128_op0[2]) = 0xa000a041; + *((int *)&__m128_op0[1]) = 0x01000041; + *((int *)&__m128_op0[0]) = 0x00010001; + *((int *)&__m128_op1[3]) = 0x00000000; + *((int *)&__m128_op1[2]) = 0x01000001; + *((int *)&__m128_op1[1]) = 0x00010001; + *((int *)&__m128_op1[0]) = 0x00000000; + *((int *)&__m128_op2[3]) = 0x00000000; + *((int *)&__m128_op2[2]) = 0x01000001; + *((int *)&__m128_op2[1]) = 0xffffe000; + *((int *)&__m128_op2[0]) = 0xffff1fff; + *((int *)&__m128_result[3]) = 0x00000000; + *((int *)&__m128_result[2]) = 0x01000001; + *((int *)&__m128_result[1]) = 0xffffe000; + *((int *)&__m128_result[0]) = 0xffff1fff; + __m128_out = __lsx_vfmadd_s (__m128_op0, __m128_op1, __m128_op2); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((int *)&__m128_op0[3]) = 0x7f800000; + *((int *)&__m128_op0[2]) = 0x7f800000; + *((int *)&__m128_op0[1]) = 0x7f800000; + *((int *)&__m128_op0[0]) = 0x7f800000; + *((int *)&__m128_op1[3]) = 0x00000002; + *((int *)&__m128_op1[2]) = 0x00000002; + *((int *)&__m128_op1[1]) = 0x00000003; + *((int *)&__m128_op1[0]) = 0x00000003; + *((int *)&__m128_op2[3]) = 0x3fc00000; + *((int *)&__m128_op2[2]) = 0x3fc00000; + *((int *)&__m128_op2[1]) = 0x3fc00000; + *((int *)&__m128_op2[0]) = 0x3fc00000; + *((int *)&__m128_result[3]) = 0x7f800000; + *((int *)&__m128_result[2]) = 0x7f800000; + *((int *)&__m128_result[1]) = 0x7f800000; + *((int *)&__m128_result[0]) = 0x7f800000; + __m128_out = __lsx_vfmadd_s (__m128_op0, __m128_op1, __m128_op2); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((int *)&__m128_op0[3]) = 0xc1bdceee; + *((int *)&__m128_op0[2]) = 0x242070db; + *((int *)&__m128_op0[1]) = 0xe8c7b756; + *((int *)&__m128_op0[0]) = 0xd76aa478; + *((int *)&__m128_op1[3]) = 0x00000000; + *((int *)&__m128_op1[2]) = 0x00000000; + *((int *)&__m128_op1[1]) = 0x00000000; + *((int *)&__m128_op1[0]) = 0x00000000; + *((int *)&__m128_op2[3]) = 0x00000000; + *((int *)&__m128_op2[2]) = 0x00000000; + *((int *)&__m128_op2[1]) = 0x00000000; + *((int *)&__m128_op2[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_vfmadd_s (__m128_op0, __m128_op1, __m128_op2); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((int *)&__m128_op0[3]) = 0x7f400000; + *((int *)&__m128_op0[2]) = 0x7f040000; + *((int *)&__m128_op0[1]) = 0x7f020000; + *((int *)&__m128_op0[0]) = 0x7f020000; + *((int *)&__m128_op1[3]) = 0xffffffff; + *((int *)&__m128_op1[2]) = 0x0014002c; + *((int *)&__m128_op1[1]) = 0xfffefffe; + *((int *)&__m128_op1[0]) = 0x003b0013; + *((int *)&__m128_op2[3]) = 0x00000000; + *((int *)&__m128_op2[2]) = 0x00000000; + *((int *)&__m128_op2[1]) = 0x00000000; + *((int *)&__m128_op2[0]) = 0x00000000; + *((int *)&__m128_result[3]) = 0xffffffff; + *((int *)&__m128_result[2]) = 0x3ea5016b; + *((int *)&__m128_result[1]) = 0xfffefffe; + *((int *)&__m128_result[0]) = 0x3f6fb04d; + __m128_out = __lsx_vfmadd_s (__m128_op0, __m128_op1, __m128_op2); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((int *)&__m128_op0[3]) = 0x004f0080; + *((int *)&__m128_op0[2]) = 0x004f0080; + *((int *)&__m128_op0[1]) = 0x004f0080; + *((int *)&__m128_op0[0]) = 0x004f0080; + *((int *)&__m128_op1[3]) = 0x00000000; + *((int *)&__m128_op1[2]) = 0x00000000; + *((int *)&__m128_op1[1]) = 0x00000000; + *((int *)&__m128_op1[0]) = 0x00000000; + *((int *)&__m128_op2[3]) = 0x7fff7fff; + *((int *)&__m128_op2[2]) = 0x7fff7fff; + *((int *)&__m128_op2[1]) = 0x00000000; + *((int *)&__m128_op2[0]) = 0x00000000; + *((int *)&__m128_result[3]) = 0x7fff7fff; + *((int *)&__m128_result[2]) = 0x7fff7fff; + *((int *)&__m128_result[1]) = 0x00000000; + *((int *)&__m128_result[0]) = 0x00000000; + __m128_out = __lsx_vfmadd_s (__m128_op0, __m128_op1, __m128_op2); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((int *)&__m128_op0[3]) = 0x3d3d3d3d; + *((int *)&__m128_op0[2]) = 0x3d3d3d3d; + *((int *)&__m128_op0[1]) = 0x3d3d3d3d; + *((int *)&__m128_op0[0]) = 0x3d3d3d3d; + *((int *)&__m128_op1[3]) = 0x00000000; + *((int *)&__m128_op1[2]) = 0x00000000; + *((int *)&__m128_op1[1]) = 0x00100000; + *((int *)&__m128_op1[0]) = 0x00000000; + *((int *)&__m128_op2[3]) = 0x00000000; + *((int *)&__m128_op2[2]) = 0x00000000; + *((int *)&__m128_op2[1]) = 0x00000000; + *((int *)&__m128_op2[0]) = 0x00000000; + *((int *)&__m128_result[3]) = 0x00000000; + *((int *)&__m128_result[2]) = 0x00000000; + *((int *)&__m128_result[1]) = 0x0000bd3d; + *((int *)&__m128_result[0]) = 0x00000000; + __m128_out = __lsx_vfmadd_s (__m128_op0, __m128_op1, __m128_op2); + 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_op1[3]) = 0x00050005; + *((int *)&__m128_op1[2]) = 0x00050005; + *((int *)&__m128_op1[1]) = 0x00050005; + *((int *)&__m128_op1[0]) = 0x00050005; + *((int *)&__m128_op2[3]) = 0x00000000; + *((int *)&__m128_op2[2]) = 0x00000000; + *((int *)&__m128_op2[1]) = 0x00000000; + *((int *)&__m128_op2[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_vfmadd_s (__m128_op0, __m128_op1, __m128_op2); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((int *)&__m128_op0[3]) = 0xe500c085; + *((int *)&__m128_op0[2]) = 0xc000c005; + *((int *)&__m128_op0[1]) = 0xe5c1a185; + *((int *)&__m128_op0[0]) = 0xc48004c5; + *((int *)&__m128_op1[3]) = 0xffffffff; + *((int *)&__m128_op1[2]) = 0xffffffff; + *((int *)&__m128_op1[1]) = 0xffffc000; + *((int *)&__m128_op1[0]) = 0xffffc005; + *((int *)&__m128_op2[3]) = 0xff550025; + *((int *)&__m128_op2[2]) = 0x002a004b; + *((int *)&__m128_op2[1]) = 0x00590013; + *((int *)&__m128_op2[0]) = 0x005cffca; + *((int *)&__m128_result[3]) = 0xffffffff; + *((int *)&__m128_result[2]) = 0xffffffff; + *((int *)&__m128_result[1]) = 0xffffc000; + *((int *)&__m128_result[0]) = 0xffffc005; + __m128_out = __lsx_vfmadd_s (__m128_op0, __m128_op1, __m128_op2); + 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_op1[3]) = 0x00fe0001; + *((int *)&__m128_op1[2]) = 0x00cf005f; + *((int *)&__m128_op1[1]) = 0x7fff7fff; + *((int *)&__m128_op1[0]) = 0x7fff7f00; + *((int *)&__m128_op2[3]) = 0x5d7f5d00; + *((int *)&__m128_op2[2]) = 0x7f6a007f; + *((int *)&__m128_op2[1]) = 0x00000000; + *((int *)&__m128_op2[0]) = 0x00000000; + *((int *)&__m128_result[3]) = 0x5d7f5d00; + *((int *)&__m128_result[2]) = 0x7f6a007f; + *((int *)&__m128_result[1]) = 0x7fff7fff; + *((int *)&__m128_result[0]) = 0x7fff7f00; + __m128_out = __lsx_vfmadd_s (__m128_op0, __m128_op1, __m128_op2); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((int *)&__m128_op0[3]) = 0x00680486; + *((int *)&__m128_op0[2]) = 0xffffffda; + *((int *)&__m128_op0[1]) = 0xffff913b; + *((int *)&__m128_op0[0]) = 0xb9951901; + *((int *)&__m128_op1[3]) = 0x00000000; + *((int *)&__m128_op1[2]) = 0x00000000; + *((int *)&__m128_op1[1]) = 0x00000000; + *((int *)&__m128_op1[0]) = 0x01030103; + *((int *)&__m128_op2[3]) = 0x00000000; + *((int *)&__m128_op2[2]) = 0x00000000; + *((int *)&__m128_op2[1]) = 0x00200060; + *((int *)&__m128_op2[0]) = 0x00200060; + *((int *)&__m128_result[3]) = 0x00000000; + *((int *)&__m128_result[2]) = 0xffffffda; + *((int *)&__m128_result[1]) = 0xffff913b; + *((int *)&__m128_result[0]) = 0x001fed4d; + __m128_out = __lsx_vfmadd_s (__m128_op0, __m128_op1, __m128_op2); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((int *)&__m128_op0[3]) = 0x001a001a; + *((int *)&__m128_op0[2]) = 0x001a0008; + *((int *)&__m128_op0[1]) = 0x001a001a; + *((int *)&__m128_op0[0]) = 0x001a000b; + *((int *)&__m128_op1[3]) = 0xffffffff; + *((int *)&__m128_op1[2]) = 0xffffffff; + *((int *)&__m128_op1[1]) = 0xff800001; + *((int *)&__m128_op1[0]) = 0x0f800000; + *((int *)&__m128_op2[3]) = 0xff800000; + *((int *)&__m128_op2[2]) = 0xff800000; + *((int *)&__m128_op2[1]) = 0xff800000; + *((int *)&__m128_op2[0]) = 0xff800000; + *((int *)&__m128_result[3]) = 0xffffffff; + *((int *)&__m128_result[2]) = 0xffffffff; + *((int *)&__m128_result[1]) = 0xffc00001; + *((int *)&__m128_result[0]) = 0xff800000; + __m128_out = __lsx_vfmadd_s (__m128_op0, __m128_op1, __m128_op2); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((int *)&__m128_op0[3]) = 0xfe3bfb01; + *((int *)&__m128_op0[2]) = 0xfe3bfe01; + *((int *)&__m128_op0[1]) = 0xfe03fe3f; + *((int *)&__m128_op0[0]) = 0xfe01fa21; + *((int *)&__m128_op1[3]) = 0xfe3bfb01; + *((int *)&__m128_op1[2]) = 0xfe3bfe01; + *((int *)&__m128_op1[1]) = 0xfe03fe3f; + *((int *)&__m128_op1[0]) = 0xfe01fa21; + *((int *)&__m128_op2[3]) = 0x00000000; + *((int *)&__m128_op2[2]) = 0x00000000; + *((int *)&__m128_op2[1]) = 0x00000000; + *((int *)&__m128_op2[0]) = 0x00000000; + *((int *)&__m128_result[3]) = 0x7f800000; + *((int *)&__m128_result[2]) = 0x7f800000; + *((int *)&__m128_result[1]) = 0x7f800000; + *((int *)&__m128_result[0]) = 0x7f800000; + __m128_out = __lsx_vfmadd_s (__m128_op0, __m128_op1, __m128_op2); + 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_op1[3]) = 0x00000000; + *((int *)&__m128_op1[2]) = 0x00000000; + *((int *)&__m128_op1[1]) = 0x00000000; + *((int *)&__m128_op1[0]) = 0x00000000; + *((int *)&__m128_op2[3]) = 0x00000000; + *((int *)&__m128_op2[2]) = 0x00000000; + *((int *)&__m128_op2[1]) = 0x00000000; + *((int *)&__m128_op2[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_vfmsub_s (__m128_op0, __m128_op1, __m128_op2); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((int *)&__m128_op0[3]) = 0xffffe001; + *((int *)&__m128_op0[2]) = 0xffffe001; + *((int *)&__m128_op0[1]) = 0xffffe001; + *((int *)&__m128_op0[0]) = 0xffffe001; + *((int *)&__m128_op1[3]) = 0xffffffff; + *((int *)&__m128_op1[2]) = 0xffffffff; + *((int *)&__m128_op1[1]) = 0xffffe000; + *((int *)&__m128_op1[0]) = 0x01ffe200; + *((int *)&__m128_op2[3]) = 0x04040383; + *((int *)&__m128_op2[2]) = 0x83838404; + *((int *)&__m128_op2[1]) = 0x04040383; + *((int *)&__m128_op2[0]) = 0x83838404; + *((int *)&__m128_result[3]) = 0xffffe001; + *((int *)&__m128_result[2]) = 0xffffe001; + *((int *)&__m128_result[1]) = 0xffffe001; + *((int *)&__m128_result[0]) = 0xffffe001; + __m128_out = __lsx_vfmsub_s (__m128_op0, __m128_op1, __m128_op2); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((int *)&__m128_op0[3]) = 0x18171615; + *((int *)&__m128_op0[2]) = 0x17161514; + *((int *)&__m128_op0[1]) = 0x16151413; + *((int *)&__m128_op0[0]) = 0x151d3756; + *((int *)&__m128_op1[3]) = 0x00000000; + *((int *)&__m128_op1[2]) = 0x00000000; + *((int *)&__m128_op1[1]) = 0x39412488; + *((int *)&__m128_op1[0]) = 0x80000000; + *((int *)&__m128_op2[3]) = 0x3ff00000; + *((int *)&__m128_op2[2]) = 0x00000000; + *((int *)&__m128_op2[1]) = 0x40f3fa00; + *((int *)&__m128_op2[0]) = 0x00000000; + *((int *)&__m128_result[3]) = 0xbff00000; + *((int *)&__m128_result[2]) = 0x00000000; + *((int *)&__m128_result[1]) = 0xc0f3fa00; + *((int *)&__m128_result[0]) = 0x80000000; + __m128_out = __lsx_vfmsub_s (__m128_op0, __m128_op1, __m128_op2); + 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_op1[3]) = 0x00000000; + *((int *)&__m128_op1[2]) = 0x00000000; + *((int *)&__m128_op1[1]) = 0x00000000; + *((int *)&__m128_op1[0]) = 0x00000005; + *((int *)&__m128_op2[3]) = 0x00000000; + *((int *)&__m128_op2[2]) = 0x00000000; + *((int *)&__m128_op2[1]) = 0x00000000; + *((int *)&__m128_op2[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_vfmsub_s (__m128_op0, __m128_op1, __m128_op2); + 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]) = 0x3ddc5dac; + *((int *)&__m128_op1[3]) = 0xffffffff; + *((int *)&__m128_op1[2]) = 0xffffffff; + *((int *)&__m128_op1[1]) = 0x00000000; + *((int *)&__m128_op1[0]) = 0x00000000; + *((int *)&__m128_op2[3]) = 0x00000000; + *((int *)&__m128_op2[2]) = 0x00000000; + *((int *)&__m128_op2[1]) = 0x00000000; + *((int *)&__m128_op2[0]) = 0x00000000; + *((int *)&__m128_result[3]) = 0xffffffff; + *((int *)&__m128_result[2]) = 0xffffffff; + *((int *)&__m128_result[1]) = 0x00000000; + *((int *)&__m128_result[0]) = 0x00000000; + __m128_out = __lsx_vfmsub_s (__m128_op0, __m128_op1, __m128_op2); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((int *)&__m128_op0[3]) = 0x63636b6a; + *((int *)&__m128_op0[2]) = 0xfe486741; + *((int *)&__m128_op0[1]) = 0x41f8e880; + *((int *)&__m128_op0[0]) = 0xffffffff; + *((int *)&__m128_op1[3]) = 0xe3636363; + *((int *)&__m128_op1[2]) = 0x63abdf16; + *((int *)&__m128_op1[1]) = 0x41f8e080; + *((int *)&__m128_op1[0]) = 0x16161198; + *((int *)&__m128_op2[3]) = 0x00c27580; + *((int *)&__m128_op2[2]) = 0x00bccf42; + *((int *)&__m128_op2[1]) = 0x00a975be; + *((int *)&__m128_op2[0]) = 0x00accf03; + *((int *)&__m128_result[3]) = 0xff800000; + *((int *)&__m128_result[2]) = 0xff800000; + *((int *)&__m128_result[1]) = 0x4471fb84; + *((int *)&__m128_result[0]) = 0xffffffff; + __m128_out = __lsx_vfmsub_s (__m128_op0, __m128_op1, __m128_op2); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfnmadd_d.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfnmadd_d.c new file mode 100644 index 00000000000..96b14aad6c4 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfnmadd_d.c @@ -0,0 +1,196 @@ +/* { 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]) = 0xef0179a47c793879; + *((unsigned long *)&__m128d_op0[0]) = 0x9f9e7e3e9ea3ff41; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op2[1]) = 0x7fc000007fc00000; + *((unsigned long *)&__m128d_op2[0]) = 0x1e801ffc7fc00000; + *((unsigned long *)&__m128d_result[1]) = 0xffc000007fc00000; + *((unsigned long *)&__m128d_result[0]) = 0x9e801ffc7fc00000; + __m128d_out = __lsx_vfnmadd_d (__m128d_op0, __m128d_op1, __m128d_op2); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[1]) = 0x3f8000003f800000; + *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op2[1]) = 0x0000ffff00000000; + *((unsigned long *)&__m128d_op2[0]) = 0x0000ffff00000000; + *((unsigned long *)&__m128d_result[1]) = 0x8000ffff00000000; + *((unsigned long *)&__m128d_result[0]) = 0x8000ffff00000000; + __m128d_out = __lsx_vfnmadd_d (__m128d_op0, __m128d_op1, __m128d_op2); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0xffffffbfffffffbf; + *((unsigned long *)&__m128d_op0[0]) = 0xffffffbfffffffbf; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000008800022; + *((unsigned long *)&__m128d_op1[0]) = 0xffffffff00000001; + *((unsigned long *)&__m128d_op2[1]) = 0xb8ec43befe38e64b; + *((unsigned long *)&__m128d_op2[0]) = 0x6477d042343cce24; + *((unsigned long *)&__m128d_result[1]) = 0xffffffbfffffffbf; + *((unsigned long *)&__m128d_result[0]) = 0xffffffbfffffffbf; + __m128d_out = __lsx_vfnmadd_d (__m128d_op0, __m128d_op1, __m128d_op2); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0xfffffffffffff000; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[0]) = 0x0000000060000000; + *((unsigned long *)&__m128d_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[1]) = 0x8000000000000000; + *((unsigned long *)&__m128d_result[0]) = 0xfffffffffffff000; + __m128d_out = __lsx_vfnmadd_d (__m128d_op0, __m128d_op1, __m128d_op2); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0xfffffffafffffffa; + *((unsigned long *)&__m128d_op0[0]) = 0xfffffffafffffffa; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op2[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128d_op2[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128d_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128d_result[0]) = 0xffffffffffffffff; + __m128d_out = __lsx_vfnmadd_d (__m128d_op0, __m128d_op1, __m128d_op2); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[1]) = 0xf8f8f8f8f8f8f8f8; + *((unsigned long *)&__m128d_op1[0]) = 0xf8f8f8f8f8f8f8f8; + *((unsigned long *)&__m128d_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[1]) = 0x8000000000000000; + *((unsigned long *)&__m128d_result[0]) = 0x8000000000000000; + __m128d_out = __lsx_vfnmadd_d (__m128d_op0, __m128d_op1, __m128d_op2); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_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 *)&__m128d_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[1]) = 0x8000000000000000; + *((unsigned long *)&__m128d_result[0]) = 0x8000000000000000; + __m128d_out = __lsx_vfnmadd_d (__m128d_op0, __m128d_op1, __m128d_op2); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[1]) = 0x0000008000000080; + *((unsigned long *)&__m128d_op1[0]) = 0x0000008000000080; + *((unsigned long *)&__m128d_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[1]) = 0x8000000000000000; + *((unsigned long *)&__m128d_result[0]) = 0x8000000000000000; + __m128d_out = __lsx_vfnmadd_d (__m128d_op0, __m128d_op1, __m128d_op2); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0xff80ffa2fff0ff74; + *((unsigned long *)&__m128d_op0[0]) = 0xff76ffd8ffe6ffaa; + *((unsigned long *)&__m128d_op1[1]) = 0xff80ffa2fff0ff74; + *((unsigned long *)&__m128d_op1[0]) = 0xff76ffd8ffe6ffaa; + *((unsigned long *)&__m128d_op2[1]) = 0x0303030303030303; + *((unsigned long *)&__m128d_op2[0]) = 0x0303030303030303; + *((unsigned long *)&__m128d_result[1]) = 0xfff0000000000000; + *((unsigned long *)&__m128d_result[0]) = 0xfff0000000000000; + __m128d_out = __lsx_vfnmadd_d (__m128d_op0, __m128d_op1, __m128d_op2); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0xffffffff00000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[1]) = 0xffffffff00000000; + *((unsigned long *)&__m128d_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[1]) = 0xffffffff00000000; + *((unsigned long *)&__m128d_result[0]) = 0x8000000000000000; + __m128d_out = __lsx_vfnmsub_d (__m128d_op0, __m128d_op1, __m128d_op2); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000ffff0000ffff; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[1]) = 0x0001ffff00000000; + *((unsigned long *)&__m128d_op1[0]) = 0x0001ffff0001ffff; + *((unsigned long *)&__m128d_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[1]) = 0x8000000000000000; + *((unsigned long *)&__m128d_result[0]) = 0x8000000000000000; + __m128d_out = __lsx_vfnmsub_d (__m128d_op0, __m128d_op1, __m128d_op2); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000001; + *((unsigned long *)&__m128d_op0[0]) = 0xfffffffffffffffe; + *((unsigned long *)&__m128d_op1[1]) = 0xff800000ff800000; + *((unsigned long *)&__m128d_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128d_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[1]) = 0x3c600000ff800000; + *((unsigned long *)&__m128d_result[0]) = 0xfffffffffffffffe; + __m128d_out = __lsx_vfnmsub_d (__m128d_op0, __m128d_op1, __m128d_op2); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x000000000000000d; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[0]) = 0x000000000000000d; + *((unsigned long *)&__m128d_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op2[0]) = 0x00000000b5207f80; + *((unsigned long *)&__m128d_result[1]) = 0x8000000000000000; + *((unsigned long *)&__m128d_result[0]) = 0x00000000b5207f80; + __m128d_out = __lsx_vfnmsub_d (__m128d_op0, __m128d_op1, __m128d_op2); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_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 *)&__m128d_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op2[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128d_result[1]) = 0x8000000000000000; + *((unsigned long *)&__m128d_result[0]) = 0xffffffffffffffff; + __m128d_out = __lsx_vfnmsub_d (__m128d_op0, __m128d_op1, __m128d_op2); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000009000900; + *((unsigned long *)&__m128d_op1[0]) = 0x0000000009000900; + *((unsigned long *)&__m128d_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op2[0]) = 0x0000000000000000; + *((unsigned long *)&__m128d_result[1]) = 0x8000000000000000; + *((unsigned long *)&__m128d_result[0]) = 0x8000000000000000; + __m128d_out = __lsx_vfnmsub_d (__m128d_op0, __m128d_op1, __m128d_op2); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + *((unsigned long *)&__m128d_op0[1]) = 0x00c2758000bccf42; + *((unsigned long *)&__m128d_op0[0]) = 0x00a975be00accf03; + *((unsigned long *)&__m128d_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op1[0]) = 0x00000000ffffffff; + *((unsigned long *)&__m128d_op2[1]) = 0x0000000000000000; + *((unsigned long *)&__m128d_op2[0]) = 0x00000000ffffffff; + *((unsigned long *)&__m128d_result[1]) = 0x8000000000000000; + *((unsigned long *)&__m128d_result[0]) = 0x00000000ffffffff; + __m128d_out = __lsx_vfnmsub_d (__m128d_op0, __m128d_op1, __m128d_op2); + ASSERTEQ_64 (__LINE__, __m128d_result, __m128d_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfnmadd_s.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfnmadd_s.c new file mode 100644 index 00000000000..bf8414b492c --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfnmadd_s.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; + + *((int *)&__m128_op0[3]) = 0xffffffff; + *((int *)&__m128_op0[2]) = 0xffffffff; + *((int *)&__m128_op0[1]) = 0xfffffffe; + *((int *)&__m128_op0[0]) = 0xbe6ed565; + *((int *)&__m128_op1[3]) = 0x195f307a; + *((int *)&__m128_op1[2]) = 0x5d04acbb; + *((int *)&__m128_op1[1]) = 0x6a1a3fbb; + *((int *)&__m128_op1[0]) = 0x3c90260e; + *((int *)&__m128_op2[3]) = 0xffffffff; + *((int *)&__m128_op2[2]) = 0xffffffff; + *((int *)&__m128_op2[1]) = 0xfffffffe; + *((int *)&__m128_op2[0]) = 0xbe6ed565; + *((int *)&__m128_result[3]) = 0xffffffff; + *((int *)&__m128_result[2]) = 0xffffffff; + *((int *)&__m128_result[1]) = 0xfffffffe; + *((int *)&__m128_result[0]) = 0x3e730941; + __m128_out = __lsx_vfnmadd_s (__m128_op0, __m128_op1, __m128_op2); + 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]) = 0xff01ff01; + *((int *)&__m128_op1[3]) = 0x00000000; + *((int *)&__m128_op1[2]) = 0x00000000; + *((int *)&__m128_op1[1]) = 0x00000000; + *((int *)&__m128_op1[0]) = 0x00000000; + *((int *)&__m128_op2[3]) = 0xffffffff; + *((int *)&__m128_op2[2]) = 0xffffffff; + *((int *)&__m128_op2[1]) = 0xffffffff; + *((int *)&__m128_op2[0]) = 0xff01ff01; + *((int *)&__m128_result[3]) = 0xffffffff; + *((int *)&__m128_result[2]) = 0xffffffff; + *((int *)&__m128_result[1]) = 0xffffffff; + *((int *)&__m128_result[0]) = 0x7f01ff01; + __m128_out = __lsx_vfnmadd_s (__m128_op0, __m128_op1, __m128_op2); + 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_op1[3]) = 0x00000000; + *((int *)&__m128_op1[2]) = 0xffffffff; + *((int *)&__m128_op1[1]) = 0x00000000; + *((int *)&__m128_op1[0]) = 0xffffffff; + *((int *)&__m128_op2[3]) = 0x00307028; + *((int *)&__m128_op2[2]) = 0x003f80b0; + *((int *)&__m128_op2[1]) = 0x0040007f; + *((int *)&__m128_op2[0]) = 0xff800000; + *((int *)&__m128_result[3]) = 0x80307028; + *((int *)&__m128_result[2]) = 0xffffffff; + *((int *)&__m128_result[1]) = 0x8040007f; + *((int *)&__m128_result[0]) = 0xffffffff; + __m128_out = __lsx_vfnmadd_s (__m128_op0, __m128_op1, __m128_op2); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((int *)&__m128_op0[3]) = 0x00000049; + *((int *)&__m128_op0[2]) = 0x0000004d; + *((int *)&__m128_op0[1]) = 0x00000001; + *((int *)&__m128_op0[0]) = 0xffffffff; + *((int *)&__m128_op1[3]) = 0x00000000; + *((int *)&__m128_op1[2]) = 0x00000000; + *((int *)&__m128_op1[1]) = 0x00000001; + *((int *)&__m128_op1[0]) = 0x00000000; + *((int *)&__m128_op2[3]) = 0x00000000; + *((int *)&__m128_op2[2]) = 0x00000000; + *((int *)&__m128_op2[1]) = 0x00000001; + *((int *)&__m128_op2[0]) = 0x00000000; + *((int *)&__m128_result[3]) = 0x80000000; + *((int *)&__m128_result[2]) = 0x80000000; + *((int *)&__m128_result[1]) = 0x80000001; + *((int *)&__m128_result[0]) = 0xffffffff; + __m128_out = __lsx_vfnmadd_s (__m128_op0, __m128_op1, __m128_op2); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((int *)&__m128_op0[3]) = 0xffffffff; + *((int *)&__m128_op0[2]) = 0xffff0000; + *((int *)&__m128_op0[1]) = 0x00ff0000; + *((int *)&__m128_op0[0]) = 0x00ff0000; + *((int *)&__m128_op1[3]) = 0x00000000; + *((int *)&__m128_op1[2]) = 0x00000800; + *((int *)&__m128_op1[1]) = 0x00000000; + *((int *)&__m128_op1[0]) = 0x00000000; + *((int *)&__m128_op2[3]) = 0xffffffff; + *((int *)&__m128_op2[2]) = 0xfffff800; + *((int *)&__m128_op2[1]) = 0x00000000; + *((int *)&__m128_op2[0]) = 0x00000000; + *((int *)&__m128_result[3]) = 0xffffffff; + *((int *)&__m128_result[2]) = 0xfffff800; + *((int *)&__m128_result[1]) = 0x80000000; + *((int *)&__m128_result[0]) = 0x80000000; + __m128_out = __lsx_vfnmadd_s (__m128_op0, __m128_op1, __m128_op2); + 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_op1[3]) = 0x00000000; + *((int *)&__m128_op1[2]) = 0x00000000; + *((int *)&__m128_op1[1]) = 0x00000000; + *((int *)&__m128_op1[0]) = 0x00000000; + *((int *)&__m128_op2[3]) = 0x00000000; + *((int *)&__m128_op2[2]) = 0x00000000; + *((int *)&__m128_op2[1]) = 0x00000000; + *((int *)&__m128_op2[0]) = 0x00000000; + *((int *)&__m128_result[3]) = 0x80000000; + *((int *)&__m128_result[2]) = 0x80000000; + *((int *)&__m128_result[1]) = 0x80000000; + *((int *)&__m128_result[0]) = 0x80000000; + __m128_out = __lsx_vfnmadd_s (__m128_op0, __m128_op1, __m128_op2); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((int *)&__m128_op0[3]) = 0x00030000; + *((int *)&__m128_op0[2]) = 0x00010000; + *((int *)&__m128_op0[1]) = 0x00020000; + *((int *)&__m128_op0[0]) = 0x00010000; + *((int *)&__m128_op1[3]) = 0x3f800000; + *((int *)&__m128_op1[2]) = 0x3f800000; + *((int *)&__m128_op1[1]) = 0x3f800000; + *((int *)&__m128_op1[0]) = 0x3f800000; + *((int *)&__m128_op2[3]) = 0x00030000; + *((int *)&__m128_op2[2]) = 0x00010000; + *((int *)&__m128_op2[1]) = 0x00020000; + *((int *)&__m128_op2[0]) = 0x00010000; + *((int *)&__m128_result[3]) = 0x80060000; + *((int *)&__m128_result[2]) = 0x80020000; + *((int *)&__m128_result[1]) = 0x80040000; + *((int *)&__m128_result[0]) = 0x80020000; + __m128_out = __lsx_vfnmadd_s (__m128_op0, __m128_op1, __m128_op2); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((int *)&__m128_op0[3]) = 0x00000008; + *((int *)&__m128_op0[2]) = 0x97957687; + *((int *)&__m128_op0[1]) = 0x00000000; + *((int *)&__m128_op0[0]) = 0x00000408; + *((int *)&__m128_op1[3]) = 0x00000008; + *((int *)&__m128_op1[2]) = 0x97957687; + *((int *)&__m128_op1[1]) = 0x00000000; + *((int *)&__m128_op1[0]) = 0x00000408; + *((int *)&__m128_op2[3]) = 0x00010001; + *((int *)&__m128_op2[2]) = 0x00010001; + *((int *)&__m128_op2[1]) = 0x00010001; + *((int *)&__m128_op2[0]) = 0x04000800; + *((int *)&__m128_result[3]) = 0x80010001; + *((int *)&__m128_result[2]) = 0x80010001; + *((int *)&__m128_result[1]) = 0x80010001; + *((int *)&__m128_result[0]) = 0x84000800; + __m128_out = __lsx_vfnmadd_s (__m128_op0, __m128_op1, __m128_op2); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((int *)&__m128_op0[3]) = 0xffc2ffe7; + *((int *)&__m128_op0[2]) = 0x00000007; + *((int *)&__m128_op0[1]) = 0x0000ffc1; + *((int *)&__m128_op0[0]) = 0x00010001; + *((int *)&__m128_op1[3]) = 0xffc2ffe7; + *((int *)&__m128_op1[2]) = 0x00000007; + *((int *)&__m128_op1[1]) = 0x0000ffc1; + *((int *)&__m128_op1[0]) = 0x00010001; + *((int *)&__m128_op2[3]) = 0x00000000; + *((int *)&__m128_op2[2]) = 0x000ffc2f; + *((int *)&__m128_op2[1]) = 0x00201df0; + *((int *)&__m128_op2[0]) = 0x00000000; + *((int *)&__m128_result[3]) = 0xffc2ffe7; + *((int *)&__m128_result[2]) = 0x800ffc2f; + *((int *)&__m128_result[1]) = 0x80201df0; + *((int *)&__m128_result[0]) = 0x80000000; + __m128_out = __lsx_vfnmadd_s (__m128_op0, __m128_op1, __m128_op2); + 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_op1[3]) = 0x00000000; + *((int *)&__m128_op1[2]) = 0x00000000; + *((int *)&__m128_op1[1]) = 0x00000000; + *((int *)&__m128_op1[0]) = 0x00000000; + *((int *)&__m128_op2[3]) = 0x00000000; + *((int *)&__m128_op2[2]) = 0x00000000; + *((int *)&__m128_op2[1]) = 0x00000000; + *((int *)&__m128_op2[0]) = 0x00000000; + *((int *)&__m128_result[3]) = 0x80000000; + *((int *)&__m128_result[2]) = 0x80000000; + *((int *)&__m128_result[1]) = 0x80000000; + *((int *)&__m128_result[0]) = 0x80000000; + __m128_out = __lsx_vfnmadd_s (__m128_op0, __m128_op1, __m128_op2); + 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]) = 0x00000005; + *((int *)&__m128_op1[3]) = 0x00000000; + *((int *)&__m128_op1[2]) = 0x00000000; + *((int *)&__m128_op1[1]) = 0x00000000; + *((int *)&__m128_op1[0]) = 0x00000000; + *((int *)&__m128_op2[3]) = 0x00000000; + *((int *)&__m128_op2[2]) = 0x00000000; + *((int *)&__m128_op2[1]) = 0x00000000; + *((int *)&__m128_op2[0]) = 0x00000000; + *((int *)&__m128_result[3]) = 0x80000000; + *((int *)&__m128_result[2]) = 0x80000000; + *((int *)&__m128_result[1]) = 0x80000000; + *((int *)&__m128_result[0]) = 0x80000000; + __m128_out = __lsx_vfnmadd_s (__m128_op0, __m128_op1, __m128_op2); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((int *)&__m128_op0[3]) = 0x80808080; + *((int *)&__m128_op0[2]) = 0x80808080; + *((int *)&__m128_op0[1]) = 0x80808080; + *((int *)&__m128_op0[0]) = 0x80800008; + *((int *)&__m128_op1[3]) = 0x00000000; + *((int *)&__m128_op1[2]) = 0x00000000; + *((int *)&__m128_op1[1]) = 0x00000000; + *((int *)&__m128_op1[0]) = 0x00000000; + *((int *)&__m128_op2[3]) = 0x00000000; + *((int *)&__m128_op2[2]) = 0x00000000; + *((int *)&__m128_op2[1]) = 0x00000000; + *((int *)&__m128_op2[0]) = 0x00000000; + *((int *)&__m128_result[3]) = 0x80000000; + *((int *)&__m128_result[2]) = 0x80000000; + *((int *)&__m128_result[1]) = 0x80000000; + *((int *)&__m128_result[0]) = 0x80000000; + __m128_out = __lsx_vfnmadd_s (__m128_op0, __m128_op1, __m128_op2); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((int *)&__m128_op0[3]) = 0x00000000; + *((int *)&__m128_op0[2]) = 0x00000000; + *((int *)&__m128_op0[1]) = 0x31313131; + *((int *)&__m128_op0[0]) = 0x31313131; + *((int *)&__m128_op1[3]) = 0x00000000; + *((int *)&__m128_op1[2]) = 0x00000000; + *((int *)&__m128_op1[1]) = 0x31313131; + *((int *)&__m128_op1[0]) = 0x31313131; + *((int *)&__m128_op2[3]) = 0x00000000; + *((int *)&__m128_op2[2]) = 0x00000008; + *((int *)&__m128_op2[1]) = 0x00000000; + *((int *)&__m128_op2[0]) = 0x00000000; + *((int *)&__m128_result[3]) = 0x80000000; + *((int *)&__m128_result[2]) = 0x80000008; + *((int *)&__m128_result[1]) = 0xa2f54a1e; + *((int *)&__m128_result[0]) = 0xa2f54a1e; + __m128_out = __lsx_vfnmadd_s (__m128_op0, __m128_op1, __m128_op2); + 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_op1[3]) = 0x00000000; + *((int *)&__m128_op1[2]) = 0x00000000; + *((int *)&__m128_op1[1]) = 0x00000000; + *((int *)&__m128_op1[0]) = 0x00000000; + *((int *)&__m128_op2[3]) = 0x00000000; + *((int *)&__m128_op2[2]) = 0x00000000; + *((int *)&__m128_op2[1]) = 0x00000000; + *((int *)&__m128_op2[0]) = 0x00000000; + *((int *)&__m128_result[3]) = 0x80000000; + *((int *)&__m128_result[2]) = 0x80000000; + *((int *)&__m128_result[1]) = 0x80000000; + *((int *)&__m128_result[0]) = 0x80000000; + __m128_out = __lsx_vfnmadd_s (__m128_op0, __m128_op1, __m128_op2); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + *((int *)&__m128_op0[3]) = 0xa486c90f; + *((int *)&__m128_op0[2]) = 0x157ca12e; + *((int *)&__m128_op0[1]) = 0x58bcc201; + *((int *)&__m128_op0[0]) = 0x2e635d65; + *((int *)&__m128_op1[3]) = 0x6d564875; + *((int *)&__m128_op1[2]) = 0xf8760005; + *((int *)&__m128_op1[1]) = 0x8dc5a4d1; + *((int *)&__m128_op1[0]) = 0x79ffa22f; + *((int *)&__m128_op2[3]) = 0xffffffff; + *((int *)&__m128_op2[2]) = 0xd2436487; + *((int *)&__m128_op2[1]) = 0x0fa96b88; + *((int *)&__m128_op2[0]) = 0x5f94ab13; + *((int *)&__m128_result[3]) = 0xffffffff; + *((int *)&__m128_result[2]) = 0xd24271c4; + *((int *)&__m128_result[1]) = 0x2711bad1; + *((int *)&__m128_result[0]) = 0xe8e309ed; + __m128_out = __lsx_vfnmsub_s (__m128_op0, __m128_op1, __m128_op2); + 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_op1[3]) = 0x00000000; + *((int *)&__m128_op1[2]) = 0x00000000; + *((int *)&__m128_op1[1]) = 0x00000000; + *((int *)&__m128_op1[0]) = 0x00000000; + *((int *)&__m128_op2[3]) = 0x00000000; + *((int *)&__m128_op2[2]) = 0x00000000; + *((int *)&__m128_op2[1]) = 0x00000000; + *((int *)&__m128_op2[0]) = 0x00000000; + *((int *)&__m128_result[3]) = 0x80000000; + *((int *)&__m128_result[2]) = 0x80000000; + *((int *)&__m128_result[1]) = 0x80000000; + *((int *)&__m128_result[0]) = 0x80000000; + __m128_out = __lsx_vfnmsub_s (__m128_op0, __m128_op1, __m128_op2); + 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_op1[3]) = 0x00000000; + *((int *)&__m128_op1[2]) = 0x00000000; + *((int *)&__m128_op1[1]) = 0x00000000; + *((int *)&__m128_op1[0]) = 0x00000000; + *((int *)&__m128_op2[3]) = 0x00000000; + *((int *)&__m128_op2[2]) = 0x00000000; + *((int *)&__m128_op2[1]) = 0x007ffd00; + *((int *)&__m128_op2[0]) = 0x01400840; + *((int *)&__m128_result[3]) = 0x80000000; + *((int *)&__m128_result[2]) = 0x80000000; + *((int *)&__m128_result[1]) = 0x007ffd00; + *((int *)&__m128_result[0]) = 0x01400840; + __m128_out = __lsx_vfnmsub_s (__m128_op0, __m128_op1, __m128_op2); + 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_op1[3]) = 0x00000000; + *((int *)&__m128_op1[2]) = 0x00000000; + *((int *)&__m128_op1[1]) = 0x00000000; + *((int *)&__m128_op1[0]) = 0x00000000; + *((int *)&__m128_op2[3]) = 0x00000000; + *((int *)&__m128_op2[2]) = 0x00000000; + *((int *)&__m128_op2[1]) = 0x7f800000; + *((int *)&__m128_op2[0]) = 0x00000000; + *((int *)&__m128_result[3]) = 0x80000000; + *((int *)&__m128_result[2]) = 0x80000000; + *((int *)&__m128_result[1]) = 0x7f800000; + *((int *)&__m128_result[0]) = 0x80000000; + __m128_out = __lsx_vfnmsub_s (__m128_op0, __m128_op1, __m128_op2); + 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_op1[3]) = 0x00000000; + *((int *)&__m128_op1[2]) = 0x00000000; + *((int *)&__m128_op1[1]) = 0x00000000; + *((int *)&__m128_op1[0]) = 0x00000000; + *((int *)&__m128_op2[3]) = 0xcd636363; + *((int *)&__m128_op2[2]) = 0xcd636363; + *((int *)&__m128_op2[1]) = 0xcd636363; + *((int *)&__m128_op2[0]) = 0xcd636363; + *((int *)&__m128_result[3]) = 0xcd636363; + *((int *)&__m128_result[2]) = 0xcd636363; + *((int *)&__m128_result[1]) = 0xcd636363; + *((int *)&__m128_result[0]) = 0xcd636363; + __m128_out = __lsx_vfnmsub_s (__m128_op0, __m128_op1, __m128_op2); + ASSERTEQ_32 (__LINE__, __m128_result, __m128_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vld.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vld.c new file mode 100644 index 00000000000..7cd9abb7c69 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vld.c @@ -0,0 +1,62 @@ +/* { 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]) = 0x1dcc4255c9d85c05; + *((unsigned long *)&__m128i_op0[0]) = 0x3ab7a3fc47a5c31a; + *((unsigned long *)&__m128i_result[1]) = 0x1dcc4255c9d85c05; + *((unsigned long *)&__m128i_result[0]) = 0x3ab7a3fc47a5c31a; + __m128i_out = __lsx_vld ((unsigned long *)&__m128i_op0, 0x0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x1dcc4255c9d85c05; + *((unsigned long *)&__m128i_op0[0]) = 0x3ab7a3fc47a5c31a; + *((unsigned long *)&__m128i_result[1]) = 0x1dcc4255c9d85c05; + *((unsigned long *)&__m128i_result[0]) = 0x3ab7a3fc47a5c31a; + __m128i_out = __lsx_vldx ((unsigned long *)&__m128i_op0, 0x0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x1dcc4255c9d85c05; + *((unsigned long *)&__m128i_op0[0]) = 0x3ab7a3fc47a5c31a; + *((unsigned long *)&__m128i_result[1]) = 0xc3c3c3c3c3c3c3c3; + *((unsigned long *)&__m128i_result[0]) = 0xc3c3c3c3c3c3c3c3; + __m128i_out = __lsx_vldrepl_b ((unsigned long *)&__m128i_op0, 0x1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x1dcc4255c9d85c05; + *((unsigned long *)&__m128i_op0[0]) = 0x3ab7a3fc47a5c31a; + *((unsigned long *)&__m128i_result[1]) = 0xc31ac31ac31ac31a; + *((unsigned long *)&__m128i_result[0]) = 0xc31ac31ac31ac31a; + __m128i_out = __lsx_vldrepl_h ((unsigned long *)&__m128i_op0, 0x0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x1dcc4255c9d85c05; + *((unsigned long *)&__m128i_op0[0]) = 0x3ab7a3fc47a5c31a; + *((unsigned long *)&__m128i_result[1]) = 0x47a5c31a47a5c31a; + *((unsigned long *)&__m128i_result[0]) = 0x47a5c31a47a5c31a; + __m128i_out = __lsx_vldrepl_w ((unsigned long *)&__m128i_op0, 0x0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x1dcc4255c9d85c05; + *((unsigned long *)&__m128i_op0[0]) = 0x3ab7a3fc47a5c31a; + *((unsigned long *)&__m128i_result[1]) = 0x3ab7a3fc47a5c31a; + *((unsigned long *)&__m128i_result[0]) = 0x3ab7a3fc47a5c31a; + __m128i_out = __lsx_vldrepl_d ((unsigned long *)&__m128i_op0, 0x0); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vst.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vst.c new file mode 100644 index 00000000000..8afdffa508a --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vst.c @@ -0,0 +1,70 @@ +/* { 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]) = 0x1dcc4255c9d85c05; + *((unsigned long *)&__m128i_op0[0]) = 0x3ab7a3fc47a5c31a; + *((unsigned long *)&__m128i_result[1]) = 0x0; + *((unsigned long *)&__m128i_result[0]) = 0x0; + __lsx_vst (__m128i_op0, (unsigned long *)&__m128i_result, 0x0); + ASSERTEQ_64 (__LINE__, __m128i_op0, __m128i_result); + + *((unsigned long *)&__m128i_op0[1]) = 0x1dcc4255c9d85c05; + *((unsigned long *)&__m128i_op0[0]) = 0x3ab7a3fc47a5c31a; + *((unsigned long *)&__m128i_result[1]) = 0x0; + *((unsigned long *)&__m128i_result[0]) = 0x0; + __lsx_vstx (__m128i_op0, (unsigned long *)&__m128i_result, 0x0); + ASSERTEQ_64 (__LINE__, __m128i_op0, __m128i_result); + + *((unsigned long *)&__m128i_op0[1]) = 0x1dcc4255c9d85c05; + *((unsigned long *)&__m128i_op0[0]) = 0x3ab7a3fc47a5c31a; + *((unsigned long *)&__m128i_result[1]) = 0x0; + *((unsigned long *)&__m128i_result[0]) = 0x05; + *((unsigned long *)&__m128i_out[1]) = 0x0; + *((unsigned long *)&__m128i_out[0]) = 0x0; + __lsx_vstelm_b (__m128i_op0, (unsigned long *)&__m128i_out, 0x0, 0x8); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x1dcc4255c9d85c05; + *((unsigned long *)&__m128i_op0[0]) = 0x3ab7a3fc47a5c31a; + *((unsigned long *)&__m128i_result[1]) = 0x0; + *((unsigned long *)&__m128i_result[0]) = 0x5c05; + *((unsigned long *)&__m128i_out[1]) = 0x0; + *((unsigned long *)&__m128i_out[0]) = 0x0; + __lsx_vstelm_h (__m128i_op0, (unsigned long *)&__m128i_out, 0x0, 0x4); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x1dcc4255c9d85c05; + *((unsigned long *)&__m128i_op0[0]) = 0x3ab7a3fc47a5c31a; + *((unsigned long *)&__m128i_result[1]) = 0x0; + *((unsigned long *)&__m128i_result[0]) = 0xc9d85c05; + *((unsigned long *)&__m128i_out[1]) = 0x0; + *((unsigned long *)&__m128i_out[0]) = 0x0; + __lsx_vstelm_w (__m128i_op0, (unsigned long *)&__m128i_out, 0x0, 0x2); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x1dcc4255c9d85c05; + *((unsigned long *)&__m128i_op0[0]) = 0x3ab7a3fc47a5c31a; + *((unsigned long *)&__m128i_result[1]) = 0x0; + *((unsigned long *)&__m128i_result[0]) = 0x1dcc4255c9d85c05; + *((unsigned long *)&__m128i_out[1]) = 0x0; + *((unsigned long *)&__m128i_out[0]) = 0x0; + __lsx_vstelm_d (__m128i_op0, (unsigned long *)&__m128i_out, 0x0, 0x1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +}