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