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; +}