From patchwork Wed Sep 13 03:35:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: chenxiaolong X-Patchwork-Id: 138588 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9ecd:0:b0:3f2:4152:657d with SMTP id t13csp832381vqx; Tue, 12 Sep 2023 20:41:36 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGP9dBcCQtqO8OmjGimUkbn5JkcZTSpcf71RBRpJ5ONiDGlJ90so44jiqo13ZSr3MTLLO+z X-Received: by 2002:adf:e80a:0:b0:317:4cf8:35f9 with SMTP id o10-20020adfe80a000000b003174cf835f9mr1016555wrm.16.1694576496720; Tue, 12 Sep 2023 20:41:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694576496; cv=none; d=google.com; s=arc-20160816; b=dmFa9ZmPNr/A0BzfLpHehllrLFkDHnlarbE5+3XLBr/GLurMWeFdP+RjZf0NAllBFf N0IOlHmlmM6M3D0uac6aabqdZqNj0TImkg8M5zCJn1xlJux1tRkFirF84txNfyD0EF3+ AU+boBx+ZI0NcVSSxBeNJL/6ygOZa8HZhP/lR+ZaW7vpuW1342F8sZwvzb7geC5GQxlP AvPMZJTLrHywO5OPEJ4CgJgOgcN8zMiEKy/7e/rFuHfZX9YhCH5y+7g/0Z4ONduvWvfS GkxUvd05ozjlopZ3Nn6ok9BIOQB2krUK2ypVOo08f76y4i6SPoh2ZHo3exxlFheeTd7c hVOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dmarc-filter:delivered-to; bh=7qujx8Afhhl3qi++G1E94z46PppaCVK1ERDA1hRQTHU=; fh=3pFUYcpS/27XRzOf17GfR86AuNQu+P1CET04YURgCLs=; b=D6MBWxTJQrP3bsmVqIo1EBIT66S/1pFV8vHDZMh9vglBb639WXYEICJr1vzjb3OLSy aCZh8eFopXXqFJlyPPpnv3xV3PiDHWplsw0yyxcXLbGYyO2nm+QHzSXBIs5hVEeTT+s2 8scUIRSOD8j782Yki8uY0Nl/gYjSx568wai+NvFySvxmK5BCu2d1HOv2/6UXQzvmPLB9 OlcTpB13yKkRkN7Q2Oep4HMrK+i1qwK1d2gwipma0nHlSHDvVl5zRoK6neQ02JdIvCfH Ih78UgaOI070JtkbnFrrv6VMERFDWCMHi+vTYQpycsPm0Sc3oa7SsR2bxcQFRtHWyZkO CP8w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id ek8-20020a056402370800b0052f3134cda0si7412928edb.581.2023.09.12.20.41.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Sep 2023 20:41:36 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C485D392AC3B for ; Wed, 13 Sep 2023 03:36:11 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by sourceware.org (Postfix) with ESMTP id 938F33882AEB for ; Wed, 13 Sep 2023 03:35:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 938F33882AEB Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=loongson.cn Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=loongson.cn Received: from loongson.cn (unknown [10.10.130.252]) by gateway (Coremail) with SMTP id _____8DxPOsELgFlxDAmAA--.3148S3; Wed, 13 Sep 2023 11:35:32 +0800 (CST) Received: from slurm-master.loongson.cn (unknown [10.10.130.252]) by localhost.localdomain (Coremail) with SMTP id AQAAf8Cx7y_8LQFlvA8CAA--.3484S7; Wed, 13 Sep 2023 11:35:31 +0800 (CST) From: Xiaolong Chen To: gcc-patches@gcc.gnu.org Cc: xry111@xry111.site, i@xen0n.name, xuchenghua@loongson.cn, chenglulu@loongson.cn, Xiaolong Chen Subject: [PATCH v4 13/23] LoongArch: Add tests for SX vector vdiv/vmod instructions. Date: Wed, 13 Sep 2023 11:35:16 +0800 Message-Id: <20230913033522.5983-4-chenxiaolong@loongson.cn> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230913033522.5983-1-chenxiaolong@loongson.cn> References: <20230913033522.5983-1-chenxiaolong@loongson.cn> MIME-Version: 1.0 X-CM-TRANSID: AQAAf8Cx7y_8LQFlvA8CAA--.3484S7 X-CM-SenderInfo: hfkh05xldrz0tqj6z05rqj20fqof0/1tbiAQANBWUBHCIBBgAAsU X-Coremail-Antispam: 1Uk129KBj9rXoW8Xw4rZF17JrWfuw43GoXrpF48AFW7pr12vr 13KrWxua4YyryUtFyYqFWkAr92yayxJF47t3srKw1DGFsxXF13Ca4UAr1DtF9rWFy3tF95 GF4jqr47JwcCm3ZEXasCq-sJn29KB7ZKAUJUUUU8529EdanIXcx71UUUUU7KY7ZEXasCq- sGcSsGvfJ3Ic02F40EFcxC0VAKzVAqx4xG6I80ebIjqfuFe4nvWSU5nxnvy29KBjDU0xBI daVrnRJUUUkIb4IE77IF4wAFF20E14v26r1j6r4UM7CY07I20VC2zVCF04k26cxKx2IYs7 xG6rWj6s0DM7CIcVAFz4kK6r106r15M28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48ve4kI 8wA2z4x0Y4vE2Ix0cI8IcVAFwI0_Ar0_tr1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI0_Cr 0_Gr1UM28EF7xvwVC2z280aVAFwI0_Gr1j6F4UJwA2z4x0Y4vEx4A2jsIEc7CjxVAFwI0_ Gr1j6F4UJwAS0I0E0xvYzxvE52x082IY62kv0487Mc804VCY07AIYIkI8VC2zVCFFI0UMc 02F40EFcxC0VAKzVAqx4xG6I80ewAv7VC0I7IYx2IY67AKxVWrXVW3AwAv7VC2z280aVAF wI0_Gr0_Cr1lOx8S6xCaFVCjc4AY6r1j6r4UM4x0Y48IcxkI7VAKI48JMxAIw28IcxkI7V AKI48JMxC20s026xCaFVCjc4AY6r1j6r4UMI8I3I0E5I8CrVAFwI0_Jr0_Jr4lx2IqxVCj r7xvwVAFwI0_JrI_JrWlx4CE17CEb7AF67AKxVWUAVWUtwCIc40Y0x0EwIxGrwCI42IY6x IIjxv20xvE14v26ryj6F1UMIIF0xvE2Ix0cI8IcVCY1x0267AKxVW8JVWxJwCI42IY6xAI w20EY4v20xvaj40_Jr0_JF4lIxAIcVC2z280aVAFwI0_Gr0_Cr1lIxAIcVC2z280aVCY1x 0267AKxVW8JVW8JrUvcSsGvfC2KfnxnUUI43ZEXa7IU0HUDJUUUUU== X-Spam-Status: No, score=-12.7 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, KAM_SHORT, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1776892245045458495 X-GMAIL-MSGID: 1776892245045458495 gcc/testsuite/ChangeLog: * gcc.target/loongarch/vector/lsx/lsx-vdiv-1.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vdiv-2.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vmod-1.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vmod-2.c: New test. --- .../loongarch/vector/lsx/lsx-vdiv-1.c | 299 ++++++++++++++++++ .../loongarch/vector/lsx/lsx-vdiv-2.c | 254 +++++++++++++++ .../loongarch/vector/lsx/lsx-vmod-1.c | 254 +++++++++++++++ .../loongarch/vector/lsx/lsx-vmod-2.c | 254 +++++++++++++++ 4 files changed, 1061 insertions(+) create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vdiv-1.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vdiv-2.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmod-1.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmod-2.c diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vdiv-1.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vdiv-1.c new file mode 100644 index 00000000000..cb4be04757c --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vdiv-1.c @@ -0,0 +1,299 @@ +/* { dg-do run } */ +/* { dg-options "-mlsx -w -fno-strict-aliasing" } */ +#include "../simd_correctness_check.h" +#include + +int +main () +{ + __m128i __m128i_op0, __m128i_op1, __m128i_op2, __m128i_out, __m128i_result; + __m128 __m128_op0, __m128_op1, __m128_op2, __m128_out, __m128_result; + __m128d __m128d_op0, __m128d_op1, __m128d_op2, __m128d_out, __m128d_result; + + int int_op0, int_op1, int_op2, int_out, int_result, i = 1, fail; + long int long_op0, long_op1, long_op2, lont_out, lont_result; + long int long_int_out, long_int_result; + unsigned int unsigned_int_out, unsigned_int_result; + unsigned long int unsigned_long_int_out, unsigned_long_int_result; + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vdiv_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x3ff0000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x40f3fa0000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffb4ff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffb4ff; + *((unsigned long *)&__m128i_result[1]) = 0xc110000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xc00d060000000000; + __m128i_out = __lsx_vdiv_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0101010101010101; + __m128i_out = __lsx_vdiv_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000020000; + *((unsigned long *)&__m128i_op0[0]) = 0x0101000101010001; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000fe0000; + *((unsigned long *)&__m128i_result[0]) = 0xffff00ffffff00ff; + __m128i_out = __lsx_vdiv_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0101010100000000; + *((unsigned long *)&__m128i_result[0]) = 0x0101010100000000; + __m128i_out = __lsx_vdiv_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0xd3259a2984048c23; + *((unsigned long *)&__m128i_op1[0]) = 0xf9796558e39953fd; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vdiv_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffff9727ffff9727; + *((unsigned long *)&__m128i_op0[0]) = 0xfffffe79ffffba5f; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x010169d9010169d9; + *((unsigned long *)&__m128i_result[0]) = 0x01010287010146a1; + __m128i_out = __lsx_vdiv_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000897957687; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000408; + *((unsigned long *)&__m128i_op1[1]) = 0x80010001b57fc565; + *((unsigned long *)&__m128i_op1[0]) = 0x8001000184000be0; + *((unsigned long *)&__m128i_result[1]) = 0x000000080001fffe; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vdiv_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vdiv_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffff9cf0d77b; + *((unsigned long *)&__m128i_op1[0]) = 0xc1000082b0fb585b; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vdiv_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000000ff000000ff; + *((unsigned long *)&__m128i_op0[0]) = 0x000000ff000000ff; + *((unsigned long *)&__m128i_op1[1]) = 0x33f5c2d7d975d7fe; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000ff010000ff01; + __m128i_out = __lsx_vdiv_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000feff23560000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000fd1654860000; + *((unsigned long *)&__m128i_op1[1]) = 0x6363636363abdf16; + *((unsigned long *)&__m128i_op1[0]) = 0x41f8e08016161198; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000030000; + __m128i_out = __lsx_vdiv_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x4f4f4f4f4f4f4f4f; + *((unsigned long *)&__m128i_op1[0]) = 0x4f4f4f4f4f4f4f4f; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vdiv_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00003ff000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000fffc00000000; + *((unsigned long *)&__m128i_op1[1]) = 0x00001ff800000001; + *((unsigned long *)&__m128i_op1[0]) = 0x7ffe800e80000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000200000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vdiv_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x195f307a5d04acbb; + *((unsigned long *)&__m128i_op0[0]) = 0x6a1a3fbb3c90260e; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0xe6a0cf86a2fb5345; + *((unsigned long *)&__m128i_result[0]) = 0x95e5c045c36fd9f2; + __m128i_out = __lsx_vdiv_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xfffffffffffffffe; + *((unsigned long *)&__m128i_result[1]) = 0x0000000100000001; + *((unsigned long *)&__m128i_result[0]) = 0x0000000100000000; + __m128i_out = __lsx_vdiv_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x4f804f804f804f80; + *((unsigned long *)&__m128i_op1[0]) = 0x4f804f804f804f80; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vdiv_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vdiv_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x000fffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0x0010000000000001; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vdiv_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x370bdfecffecffec; + *((unsigned long *)&__m128i_op1[0]) = 0x370bdfecffecffec; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vdiv_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xa2e3a36363636363; + *((unsigned long *)&__m128i_op0[0]) = 0xa2e3a36463636363; + *((unsigned long *)&__m128i_op1[1]) = 0x7f80000000000007; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000700000007; + *((unsigned long *)&__m128i_result[1]) = 0x000000000e32c50e; + *((unsigned long *)&__m128i_result[0]) = 0xf2b2ce330e32c50e; + __m128i_out = __lsx_vdiv_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0xffffffff00000001; + *((unsigned long *)&__m128i_result[0]) = 0xffffffff00000001; + __m128i_out = __lsx_vdiv_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x52527d7d52527d7d; + *((unsigned long *)&__m128i_op0[0]) = 0x52527d7d52527d7d; + *((unsigned long *)&__m128i_op1[1]) = 0x52527d7d52527d7d; + *((unsigned long *)&__m128i_op1[0]) = 0x52527d7d52527d7d; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000001; + __m128i_out = __lsx_vdiv_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vdiv_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x8000000080000000; + *((unsigned long *)&__m128i_op0[0]) = 0x8000000080000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000001; + *((unsigned long *)&__m128i_result[1]) = 0x8000000080000000; + *((unsigned long *)&__m128i_result[0]) = 0x8000000080000000; + __m128i_out = __lsx_vdiv_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xe93d0bd19ff0c170; + *((unsigned long *)&__m128i_op1[0]) = 0x5237c1bac9eadf55; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vdiv_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x003fffff00000000; + *((unsigned long *)&__m128i_op0[0]) = 0x003fffff00000000; + *((unsigned long *)&__m128i_op1[1]) = 0x00000000003dffc2; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000003dffc2; + *((unsigned long *)&__m128i_result[1]) = 0x00000001084314a6; + *((unsigned long *)&__m128i_result[0]) = 0x00000001084314a6; + __m128i_out = __lsx_vdiv_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x00000ffef0010000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000010000010101; + *((unsigned long *)&__m128i_op1[0]) = 0x0101000001000100; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vdiv_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x4280000042800000; + *((unsigned long *)&__m128i_op1[1]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xbd7fffffbd800000; + __m128i_out = __lsx_vdiv_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000000000ff; + *((unsigned long *)&__m128i_op1[1]) = 0x30eb022002101b20; + *((unsigned long *)&__m128i_op1[0]) = 0x020310edc003023d; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vdiv_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000002000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000002000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x00000000000004ff; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x000000000667ae56; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000020; + __m128i_out = __lsx_vdiv_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vdiv-2.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vdiv-2.c new file mode 100644 index 00000000000..f2bc7df27c8 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vdiv-2.c @@ -0,0 +1,254 @@ +/* { dg-do run } */ +/* { dg-options "-mlsx -w -fno-strict-aliasing" } */ +#include "../simd_correctness_check.h" +#include + +int +main () +{ + __m128i __m128i_op0, __m128i_op1, __m128i_op2, __m128i_out, __m128i_result; + __m128 __m128_op0, __m128_op1, __m128_op2, __m128_out, __m128_result; + __m128d __m128d_op0, __m128d_op1, __m128d_op2, __m128d_out, __m128d_result; + + int int_op0, int_op1, int_op2, int_out, int_result, i = 1, fail; + long int long_op0, long_op1, long_op2, lont_out, lont_result; + long int long_int_out, long_int_result; + unsigned int unsigned_int_out, unsigned_int_result; + unsigned long int unsigned_long_int_out, unsigned_long_int_result; + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000001; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffefffffffef; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffefffffffef; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vdiv_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xe3e3e3e3e3e3e3e3; + *((unsigned long *)&__m128i_op1[1]) = 0xe3e3e3e3e3e3e3e3; + *((unsigned long *)&__m128i_op1[0]) = 0xe3e3e3e3e3e3e3e3; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0101010101010101; + __m128i_out = __lsx_vdiv_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xfffffffffffffffe; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0101010101010101; + __m128i_out = __lsx_vdiv_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0006000000040000; + *((unsigned long *)&__m128i_op0[0]) = 0x0002000000000007; + *((unsigned long *)&__m128i_op1[1]) = 0x31b1777777777776; + *((unsigned long *)&__m128i_op1[0]) = 0x6eee282828282829; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vdiv_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0101010101010101; + *((unsigned long *)&__m128i_result[0]) = 0x0101010101010101; + __m128i_out = __lsx_vdiv_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000010100000101; + *((unsigned long *)&__m128i_op0[0]) = 0x0000010100000101; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vdiv_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0effeffefdffa1e0; + *((unsigned long *)&__m128i_op0[0]) = 0xe6004c5f64284224; + *((unsigned long *)&__m128i_op1[1]) = 0xfeffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xfeffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0001000000010000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vdiv_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x10f917d72d3d01e4; + *((unsigned long *)&__m128i_op1[0]) = 0x203e16d116de012b; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vdiv_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000073; + *((unsigned long *)&__m128i_op0[0]) = 0x000000000000002a; + *((unsigned long *)&__m128i_op1[1]) = 0x00ffffff00ff00ff; + *((unsigned long *)&__m128i_op1[0]) = 0x00ff00ffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vdiv_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000003f200001e01; + *((unsigned long *)&__m128i_op0[0]) = 0x000014bf000019da; + *((unsigned long *)&__m128i_op1[1]) = 0x9c9c99aed5b88fcf; + *((unsigned long *)&__m128i_op1[0]) = 0x7c3650c5f79a61a3; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vdiv_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0002000200020002; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vdiv_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x8080808080808080; + *((unsigned long *)&__m128i_op1[0]) = 0x8080808080800008; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vdiv_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffd700; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffff00; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffff00; + *((unsigned long *)&__m128i_result[1]) = 0x0000000100000001; + *((unsigned long *)&__m128i_result[0]) = 0x0000000100000000; + __m128i_out = __lsx_vdiv_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000ffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0x0000ffffffdfffdf; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vdiv_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x000000000000ff00; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vdiv_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vdiv_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xfffffffffffbfff8; + *((unsigned long *)&__m128i_op1[1]) = 0x0080008000800080; + *((unsigned long *)&__m128i_op1[0]) = 0x0080006b0000000b; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x000001ff1745745c; + __m128i_out = __lsx_vdiv_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0001000100010001; + *((unsigned long *)&__m128i_op1[0]) = 0x0001000100010001; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vdiv_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffff14eb54ab; + *((unsigned long *)&__m128i_op0[0]) = 0x14ea6a002a406a00; + *((unsigned long *)&__m128i_op1[1]) = 0xffff80008a7555aa; + *((unsigned long *)&__m128i_op1[0]) = 0x0a7535006af05cf9; + *((unsigned long *)&__m128i_result[1]) = 0x0000000100000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000200000000; + __m128i_out = __lsx_vdiv_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0141010101410101; + *((unsigned long *)&__m128i_op0[0]) = 0x0141010101410101; + *((unsigned long *)&__m128i_op1[1]) = 0xfebffefffebffeff; + *((unsigned long *)&__m128i_op1[0]) = 0xfebffefffebffeff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vdiv_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x6363797c63996399; + *((unsigned long *)&__m128i_op0[0]) = 0x171f0a1f6376441f; + *((unsigned long *)&__m128i_op1[1]) = 0x6363797c63996399; + *((unsigned long *)&__m128i_op1[0]) = 0x171f0a1f6376441f; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000001; + __m128i_out = __lsx_vdiv_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000036de0000; + *((unsigned long *)&__m128i_op0[0]) = 0x000000003be14000; + *((unsigned long *)&__m128i_op1[1]) = 0x000000000000006f; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000001f0a; + *((unsigned long *)&__m128i_result[1]) = 0x00000000007e8a60; + *((unsigned long *)&__m128i_result[0]) = 0x000000000001edde; + __m128i_out = __lsx_vdiv_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000015d926c7; + *((unsigned long *)&__m128i_op1[0]) = 0x000000000000e41b; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vdiv_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x77c0404a4000403a; + *((unsigned long *)&__m128i_op0[0]) = 0x77c03fd640003fc6; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vdiv_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0042003e0042002f; + *((unsigned long *)&__m128i_op0[0]) = 0x0001fffc0001fffc; + *((unsigned long *)&__m128i_op1[1]) = 0x0042003e0042002f; + *((unsigned long *)&__m128i_op1[0]) = 0x0001fffc0001fffc; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000001; + __m128i_out = __lsx_vdiv_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000000feff2356; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000fd165486; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000007; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000007; + *((unsigned long *)&__m128i_result[1]) = 0x00000000246d9755; + *((unsigned long *)&__m128i_result[0]) = 0x000000002427c2ee; + __m128i_out = __lsx_vdiv_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmod-1.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmod-1.c new file mode 100644 index 00000000000..5470d40dd69 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmod-1.c @@ -0,0 +1,254 @@ +/* { dg-do run } */ +/* { dg-options "-mlsx -w -fno-strict-aliasing" } */ +#include "../simd_correctness_check.h" +#include + +int +main () +{ + __m128i __m128i_op0, __m128i_op1, __m128i_op2, __m128i_out, __m128i_result; + __m128 __m128_op0, __m128_op1, __m128_op2, __m128_out, __m128_result; + __m128d __m128d_op0, __m128d_op1, __m128d_op2, __m128d_out, __m128d_result; + + int int_op0, int_op1, int_op2, int_out, int_result, i = 1, fail; + long int long_op0, long_op1, long_op2, lont_out, lont_result; + long int long_int_out, long_int_result; + unsigned int unsigned_int_out, unsigned_int_result; + unsigned long int unsigned_long_int_out, unsigned_long_int_result; + + *((unsigned long *)&__m128i_op0[1]) = 0x82c539ffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xc72df14afbfafdf9; + *((unsigned long *)&__m128i_op1[1]) = 0x82c539ffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xc72df14afbfafdf9; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmod_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmod_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffff994cb09c; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffc3639d96; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmod_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0003c853c843c844; + *((unsigned long *)&__m128i_op0[0]) = 0x0003c853c843c844; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmod_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x6363636363636363; + *((unsigned long *)&__m128i_op1[1]) = 0x6363636363636363; + *((unsigned long *)&__m128i_op1[0]) = 0x6363636363636363; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmod_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0001808281820102; + *((unsigned long *)&__m128i_op0[0]) = 0x0001808201018081; + *((unsigned long *)&__m128i_op1[1]) = 0x8080808080808080; + *((unsigned long *)&__m128i_op1[0]) = 0x8080808080808080; + *((unsigned long *)&__m128i_result[1]) = 0x0001008281820102; + *((unsigned long *)&__m128i_result[0]) = 0x0001008201010081; + __m128i_out = __lsx_vmod_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0101010240010202; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmod_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xff00ff00ff00ff00; + *((unsigned long *)&__m128i_op0[0]) = 0xff00ff00ff00ff00; + *((unsigned long *)&__m128i_op1[1]) = 0xff00ff00ff00ff00; + *((unsigned long *)&__m128i_op1[0]) = 0xff00ff00ff00ff00; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmod_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmod_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0001000100010001; + *((unsigned long *)&__m128i_op0[0]) = 0x0001000104000800; + *((unsigned long *)&__m128i_op1[1]) = 0x0101080408040804; + *((unsigned long *)&__m128i_op1[0]) = 0x0804080407040804; + *((unsigned long *)&__m128i_result[1]) = 0x0001000100010001; + *((unsigned long *)&__m128i_result[0]) = 0x0001000104000800; + __m128i_out = __lsx_vmod_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x1000100010001000; + *((unsigned long *)&__m128i_op0[0]) = 0x1000100010001000; + *((unsigned long *)&__m128i_op1[1]) = 0x1202120212021202; + *((unsigned long *)&__m128i_op1[0]) = 0x1202120212021202; + *((unsigned long *)&__m128i_result[1]) = 0x1000100010001000; + *((unsigned long *)&__m128i_result[0]) = 0x1000100010001000; + __m128i_out = __lsx_vmod_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00ff00ff00ff00ff; + *((unsigned long *)&__m128i_op0[0]) = 0x00ff00ff00ff00ff; + *((unsigned long *)&__m128i_op1[1]) = 0xfffffffffffffffa; + *((unsigned long *)&__m128i_op1[0]) = 0xfffffffffffffffa; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000003; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000003; + __m128i_out = __lsx_vmod_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xfffffffffffffffc; + *((unsigned long *)&__m128i_op1[0]) = 0xfffffffffffffffc; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmod_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xf6548a1747e59090; + *((unsigned long *)&__m128i_op0[0]) = 0x27b169bbb8145f50; + *((unsigned long *)&__m128i_op1[1]) = 0xf6548a1747e59090; + *((unsigned long *)&__m128i_op1[0]) = 0x27b169bbb8145f50; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmod_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000100000001; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000100000001; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmod_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x370bdfecffecffec; + *((unsigned long *)&__m128i_op0[0]) = 0x370bdfeca2eb9931; + *((unsigned long *)&__m128i_op1[1]) = 0x370bdfecffecffec; + *((unsigned long *)&__m128i_op1[0]) = 0x370bdfeca2eb9931; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmod_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x805ffffe01001fe0; + *((unsigned long *)&__m128i_op0[0]) = 0x9a49e11102834d70; + *((unsigned long *)&__m128i_op1[1]) = 0x8144ffff01c820a4; + *((unsigned long *)&__m128i_op1[0]) = 0x9b2ee1a4034b4e34; + *((unsigned long *)&__m128i_result[1]) = 0xff1affff01001fe0; + *((unsigned long *)&__m128i_result[0]) = 0xff1aff6d02834d70; + __m128i_out = __lsx_vmod_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x001d001d001d001d; + *((unsigned long *)&__m128i_op0[0]) = 0x001d001d001d0000; + *((unsigned long *)&__m128i_op1[1]) = 0x001d001d001d001d; + *((unsigned long *)&__m128i_op1[0]) = 0x001d001d001d0000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmod_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x000a000a000a000a; + *((unsigned long *)&__m128i_op1[0]) = 0x000a000a000a000a; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmod_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x4f8000004f800000; + *((unsigned long *)&__m128i_op1[0]) = 0x4f8000004f800000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vmod_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00ffff0000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x00ffff000000ff00; + *((unsigned long *)&__m128i_op1[1]) = 0x03c0000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x03c0038000000380; + *((unsigned long *)&__m128i_result[1]) = 0x00ffff0000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00ffff000000ff00; + __m128i_out = __lsx_vmod_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000006f00001f0a; + *((unsigned long *)&__m128i_op1[0]) = 0x0000958affff995d; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmod_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x80000000307d0771; + *((unsigned long *)&__m128i_op0[0]) = 0x0d8e36706ac02b9b; + *((unsigned long *)&__m128i_op1[1]) = 0x80000000307d0771; + *((unsigned long *)&__m128i_op1[0]) = 0x0d8e36706ac02b9b; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmod_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x8000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000800000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000800000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmod_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x413e276583869d79; + *((unsigned long *)&__m128i_op1[0]) = 0x7f7f017f9d8726d3; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmod_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x000000000011ffee; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000000dfff2; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmod_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmod-2.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmod-2.c new file mode 100644 index 00000000000..8deb04427a0 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vmod-2.c @@ -0,0 +1,254 @@ +/* { dg-do run } */ +/* { dg-options "-mlsx -w -fno-strict-aliasing" } */ +#include "../simd_correctness_check.h" +#include + +int +main () +{ + __m128i __m128i_op0, __m128i_op1, __m128i_op2, __m128i_out, __m128i_result; + __m128 __m128_op0, __m128_op1, __m128_op2, __m128_out, __m128_result; + __m128d __m128d_op0, __m128d_op1, __m128d_op2, __m128d_out, __m128d_result; + + int int_op0, int_op1, int_op2, int_out, int_result, i = 1, fail; + long int long_op0, long_op1, long_op2, lont_out, lont_result; + long int long_int_out, long_int_result; + unsigned int unsigned_int_out, unsigned_int_result; + unsigned long int unsigned_long_int_out, unsigned_long_int_result; + + *((unsigned long *)&__m128i_op0[1]) = 0x16161616a16316b0; + *((unsigned long *)&__m128i_op0[0]) = 0x6363636363636363; + *((unsigned long *)&__m128i_op1[1]) = 0x16161616a16316b0; + *((unsigned long *)&__m128i_op1[0]) = 0x6363636363636363; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmod_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000001fffffffe; + *((unsigned long *)&__m128i_op0[0]) = 0x00000001fffffffe; + *((unsigned long *)&__m128i_op1[1]) = 0x5a5a5a5a5b5a5b5a; + *((unsigned long *)&__m128i_op1[0]) = 0x5a5a5a5a5b5a5b5a; + *((unsigned long *)&__m128i_result[1]) = 0x00000001494b494a; + *((unsigned long *)&__m128i_result[0]) = 0x00000001494b494a; + __m128i_out = __lsx_vmod_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmod_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xd70b30c96ea9f4e8; + *((unsigned long *)&__m128i_op1[0]) = 0xa352bfac9269e0aa; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmod_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffeb; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffeb; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmod_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmod_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmod_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x7f801fa06451ef11; + *((unsigned long *)&__m128i_op1[0]) = 0x68bcf93435ed25ed; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmod_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000022666621; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffdd9999da; + *((unsigned long *)&__m128i_op1[1]) = 0x7f7f7f7f00107f04; + *((unsigned long *)&__m128i_op1[0]) = 0x7f0000fd7f0000fd; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000066621; + *((unsigned long *)&__m128i_result[0]) = 0x01ff00085e9900ab; + __m128i_out = __lsx_vmod_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000000000000bd3d; + *((unsigned long *)&__m128i_op0[0]) = 0x000000007fff0000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xefffdffff0009d3d; + *((unsigned long *)&__m128i_result[1]) = 0x000000000000bd3d; + *((unsigned long *)&__m128i_result[0]) = 0x000000007fff0000; + __m128i_out = __lsx_vmod_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000004870ba0; + *((unsigned long *)&__m128i_op1[1]) = 0x478b478b38031779; + *((unsigned long *)&__m128i_op1[0]) = 0x6b769e690fa1e119; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000004870ba0; + __m128i_out = __lsx_vmod_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x2006454690d3de87; + *((unsigned long *)&__m128i_op0[0]) = 0x2006454690d3de87; + *((unsigned long *)&__m128i_op1[1]) = 0x2006454690d3de87; + *((unsigned long *)&__m128i_op1[0]) = 0x2006454690d3de87; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmod_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0002000200020002; + *((unsigned long *)&__m128i_op0[0]) = 0x0002000200020002; + *((unsigned long *)&__m128i_op1[1]) = 0x02b010f881a281a2; + *((unsigned long *)&__m128i_op1[0]) = 0x27b169bbb8145f50; + *((unsigned long *)&__m128i_result[1]) = 0x0002000200020002; + *((unsigned long *)&__m128i_result[0]) = 0x0002000200020002; + __m128i_out = __lsx_vmod_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xffff100000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0010001000100010; + *((unsigned long *)&__m128i_op1[0]) = 0x0010001000100010; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x000f000000000000; + __m128i_out = __lsx_vmod_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000100000001; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000100000001; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmod_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000fffe0000fffe; + *((unsigned long *)&__m128i_op1[1]) = 0xffffff00ffffff00; + *((unsigned long *)&__m128i_op1[0]) = 0xffffff00ffffff00; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000fffe0000fffe; + __m128i_out = __lsx_vmod_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x8000000080000000; + *((unsigned long *)&__m128i_op1[0]) = 0x8000000080000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmod_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x00ff00ff00ff00ff; + *((unsigned long *)&__m128i_op1[0]) = 0x00ff00ff00ff00ff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmod_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000200; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000200; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmod_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmod_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000ffff0000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vmod_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0001000100010001; + *((unsigned long *)&__m128i_op0[0]) = 0x0001000101fd01fe; + *((unsigned long *)&__m128i_op1[1]) = 0xff80ff80ff80ff80; + *((unsigned long *)&__m128i_op1[0]) = 0xff80ff8080008000; + *((unsigned long *)&__m128i_result[1]) = 0x0001000100010001; + *((unsigned long *)&__m128i_result[0]) = 0x0001000101fd01fe; + __m128i_out = __lsx_vmod_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffcafff8ff; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000000000a0; + *((unsigned long *)&__m128i_op1[1]) = 0xff2cfed4fea8ff44; + *((unsigned long *)&__m128i_op1[0]) = 0xfffeffff0035ff8f; + *((unsigned long *)&__m128i_result[1]) = 0x00d3012acc56f9bb; + *((unsigned long *)&__m128i_result[0]) = 0x00000000000000a0; + __m128i_out = __lsx_vmod_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x37c0001000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x37c0001000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0004000400040004; + *((unsigned long *)&__m128i_op1[0]) = 0x0004000400040004; + *((unsigned long *)&__m128i_result[1]) = 0x0003c853c843c844; + *((unsigned long *)&__m128i_result[0]) = 0x0003c853c843c844; + __m128i_out = __lsx_vmod_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x000000003ddc5dac; + *((unsigned long *)&__m128i_op1[1]) = 0xfcfcfcdcfcfcfcdc; + *((unsigned long *)&__m128i_op1[0]) = 0xfcfcfcdcfcfcfcdc; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x000000003ddc5dac; + __m128i_out = __lsx_vmod_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xfffffffefffff784; + *((unsigned long *)&__m128i_op1[1]) = 0x10f8000100000001; + *((unsigned long *)&__m128i_op1[0]) = 0x00000001000010f8; + *((unsigned long *)&__m128i_result[1]) = 0x0177fff0fffffff0; + *((unsigned long *)&__m128i_result[0]) = 0x00000000011ff8bc; + __m128i_out = __lsx_vmod_du (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +}