From patchwork Wed Sep 13 03:31:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: chenxiaolong X-Patchwork-Id: 138585 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9ecd:0:b0:3f2:4152:657d with SMTP id t13csp831578vqx; Tue, 12 Sep 2023 20:38:47 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGGY3Mv8xdlK91xfPB69+Qbd7YVX5Km/66EvyL8x+cfrop2ZkbSHgVEYnf9/X6NfZ+oosiB X-Received: by 2002:adf:f3cc:0:b0:31f:8bef:dedf with SMTP id g12-20020adff3cc000000b0031f8befdedfmr1007697wrp.19.1694576327051; Tue, 12 Sep 2023 20:38:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694576327; cv=none; d=google.com; s=arc-20160816; b=Usb36a+NmJtAM2DMHeeAxTqX54urDuJlurs05EFe7Psh6nI6IlXyENfTOQI496mJ57 y1qVtW5TU1jokMS623DkIy2i9kprtz3uC8xkxY5Fcrv4q5mdZcKrttjJk4wPuU6ClB1A ad6BVaGjGhk14uXPoopPLH6dIYeYfrzGndjrOrIM6+wHFvQedkW7c8wHXqylwJRchJQE /0YyYS/NH0Np+jKOkLaSVayKdepkhChb/St/wFwOwU4QRICFNrxoPK4aAvCvWx4td/QC djabcT8RrWjP54TMvh9skLO+gqTkNkvKDLPPxKtXOsVD1wHX7+od/EUje+WW6ALoQRW6 eg0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dmarc-filter:delivered-to; bh=wuukDGpXUKA4gTkwTpCFKkG0kib5Z5YPxff9U4gluqk=; fh=3pFUYcpS/27XRzOf17GfR86AuNQu+P1CET04YURgCLs=; b=F1er/YZsfr2TJDJCp6px8yep6aJcR2dazp3eGgf3PLkuU5IALFDUpLdtVuWxQm/L+n 88McrCGMdigyCcLQr0x+wDIfpHY/fKQKMmEj1EYMx5Pe6Hxv+TXU8RDwoI5dHRHLHjSk SnNpcBsMef0BjlZ02p85aQJkVnUfN9cP9APDavYVnI61BtymG0kSszFfjvTsCpPKb2aX R0OFX6x/liXUGgOpEnJxL+iPAO9SDhCFl7sIu8pfnYmeyn2W3CgPQfTj5xGoxD6Ogs1X 0K/ys8MGfx48GN21JhXt7sMvamUMfHoEg4MxlUxIA4o2fcB1ematiii44LKQ8mN7x2aw JNrg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id u1-20020a056402064100b00523356aca02si10418873edx.489.2023.09.12.20.38.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Sep 2023 20:38:47 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 4C3A53896C2B for ; Wed, 13 Sep 2023 03:34:21 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from eggs.gnu.org (eggs.gnu.org [IPv6:2001:470:142:3::10]) by sourceware.org (Postfix) with ESMTPS id EBE17385C8B0 for ; Wed, 13 Sep 2023 03:32:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org EBE17385C8B0 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=loongson.cn Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=loongson.cn Received: from mail.loongson.cn ([114.242.206.163]) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qgGbw-00010k-KI for gcc-patches@gcc.gnu.org; Tue, 12 Sep 2023 23:32:23 -0400 Received: from loongson.cn (unknown [10.10.130.252]) by gateway (Coremail) with SMTP id _____8AxDOs+LQFlPTAmAA--.3240S3; Wed, 13 Sep 2023 11:32:14 +0800 (CST) Received: from slurm-master.loongson.cn (unknown [10.10.130.252]) by localhost.localdomain (Coremail) with SMTP id AQAAf8BxrdwqLQFlxQ4CAA--.3491S11; Wed, 13 Sep 2023 11:32:13 +0800 (CST) From: Xiaolong Chen To: gcc-patches@gcc.gnu.org Cc: xry111@xry111.site, i@xen0n.name, xuchenghua@loongson.cn, chenglulu@loongson.cn, Xiaolong Chen Subject: [PATCH v4 07/23] LoongArch: Add tests for SX vector addition vsadd instructions. Date: Wed, 13 Sep 2023 11:31:32 +0800 Message-Id: <20230913033148.5752-8-chenxiaolong@loongson.cn> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230913033148.5752-1-chenxiaolong@loongson.cn> References: <20230913033148.5752-1-chenxiaolong@loongson.cn> MIME-Version: 1.0 X-CM-TRANSID: AQAAf8BxrdwqLQFlxQ4CAA--.3491S11 X-CM-SenderInfo: hfkh05xldrz0tqj6z05rqj20fqof0/1tbiAQANBWUBHCIA9AAAsn X-Coremail-Antispam: 1Uk129KBj9fXoWDAFWxKrWUJw43uF13urWUJrc_yoWrWr1rZo WUAa4UZw4rCFZxX3W5Jw13X34fKr1Yk3Zakr1UAwn0ya1DJr4Ivry7ZFsxJF1Utw1ayrW3 Zw13Xr4xJ348Zr1kl-sFpf9Il3svdjkaLaAFLSUrUUUUjb8apTn2vfkv8UJUUUU8wcxFpf 9Il3svdxBIdaVrn0xqx4xG64xvF2IEw4CE5I8CrVC2j2Jv73VFW2AGmfu7bjvjm3AaLaJ3 UjIYCTnIWjp_UUUY87kC6x804xWl14x267AKxVWUJVW8JwAFc2x0x2IEx4CE42xK8VAvwI 8IcIk0rVWrJVCq3wAFIxvE14AKwVWUGVWUXwA2ocxC64kIII0Yj41l84x0c7CEw4AK67xG Y2AK021l84ACjcxK6xIIjxv20xvE14v26ryj6F1UM28EF7xvwVC0I7IYx2IY6xkF7I0E14 v26r4j6F4UM28EF7xvwVC2z280aVAFwI0_Gr1j6F4UJwA2z4x0Y4vEx4A2jsIEc7CjxVAF wI0_Gr1j6F4UJwAS0I0E0xvYzxvE52x082IY62kv0487Mc804VCY07AIYIkI8VC2zVCFFI 0UMc02F40EFcxC0VAKzVAqx4xG6I80ewAv7VC0I7IYx2IY67AKxVWUtVWrXwAv7VC2z280 aVAFwI0_Gr0_Cr1lOx8S6xCaFVCjc4AY6r1j6r4UM4x0Y48IcxkI7VAKI48JMxAIw28Icx kI7VAKI48JMxC20s026xCaFVCjc4AY6r1j6r4UMI8I3I0E5I8CrVAFwI0_Jr0_Jr4lx2Iq xVCjr7xvwVAFwI0_JrI_JrWlx4CE17CEb7AF67AKxVWUAVWUtwCIc40Y0x0EwIxGrwCI42 IY6xIIjxv20xvE14v26ryj6F1UMIIF0xvE2Ix0cI8IcVCY1x0267AKxVW8JVWxJwCI42IY 6xAIw20EY4v20xvaj40_Jr0_JF4lIxAIcVC2z280aVAFwI0_Gr0_Cr1lIxAIcVC2z280aV CY1x0267AKxVW8JVW8JrUvcSsGvfC2KfnxnUUI43ZEXa7IU8QJ57UUUUU== Received-SPF: pass client-ip=114.242.206.163; envelope-from=chenxiaolong@loongson.cn; helo=mail.loongson.cn X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Status: No, score=-13.6 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, KAM_SHORT, SPF_FAIL, SPF_HELO_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1776892066363797960 X-GMAIL-MSGID: 1776892066363797960 gcc/testsuite/ChangeLog: * gcc.target/loongarch/vector/lsx/lsx-vsadd-1.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vsadd-2.c: New test. --- .../loongarch/vector/lsx/lsx-vsadd-1.c | 335 +++++++++++++++++ .../loongarch/vector/lsx/lsx-vsadd-2.c | 345 ++++++++++++++++++ 2 files changed, 680 insertions(+) create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsadd-1.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsadd-2.c diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsadd-1.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsadd-1.c new file mode 100644 index 00000000000..1bc27c983bb --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsadd-1.c @@ -0,0 +1,335 @@ +/* { dg-do run } */ +/* { dg-options "-mlsx -w -fno-strict-aliasing" } */ +#include "../simd_correctness_check.h" +#include + +int +main () +{ + __m128i __m128i_op0, __m128i_op1, __m128i_op2, __m128i_out, __m128i_result; + __m128 __m128_op0, __m128_op1, __m128_op2, __m128_out, __m128_result; + __m128d __m128d_op0, __m128d_op1, __m128d_op2, __m128d_out, __m128d_result; + + int int_op0, int_op1, int_op2, int_out, int_result, i = 1, fail; + long int long_op0, long_op1, long_op2, lont_out, lont_result; + long int long_int_out, long_int_result; + unsigned int unsigned_int_out, unsigned_int_result; + unsigned long int unsigned_long_int_out, unsigned_long_int_result; + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x00000000ffffffff; + __m128i_out = __lsx_vsadd_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xfefefefefefefefe; + __m128i_out = __lsx_vsadd_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffff3c992b2e; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffff730f; + *((unsigned long *)&__m128i_result[1]) = 0xffffffff3c992b2e; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffff730f; + __m128i_out = __lsx_vsadd_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsadd_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsadd_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00007fff00007fff; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x000000002bfd9461; + *((unsigned long *)&__m128i_result[1]) = 0x00007fff00007fff; + *((unsigned long *)&__m128i_result[0]) = 0x000000002bfd9461; + __m128i_out = __lsx_vsadd_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00d3012acc56f9bb; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000001021; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x00d3012acc56f9bb; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000001021; + __m128i_out = __lsx_vsadd_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000001000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000001000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000001000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000001000; + __m128i_out = __lsx_vsadd_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x80808080806b000b; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x80808080806b000b; + __m128i_out = __lsx_vsadd_b (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffff01ff01; + *((unsigned long *)&__m128i_op1[1]) = 0x3c600000ff800000; + *((unsigned long *)&__m128i_op1[0]) = 0xfffffffffffffffe; + *((unsigned long *)&__m128i_result[1]) = 0x3c5fffffff7fffff; + *((unsigned long *)&__m128i_result[0]) = 0xfffefffeff00feff; + __m128i_out = __lsx_vsadd_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsadd_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x00ff00ff00ff00ff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00ff00ff00ff00ff; + __m128i_out = __lsx_vsadd_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x00000000ffffffff; + __m128i_out = __lsx_vsadd_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x3ff0000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x40f3fa0000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x3ff0000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x40f3fa0000000000; + __m128i_out = __lsx_vsadd_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000008a0000008a; + *((unsigned long *)&__m128i_op0[0]) = 0x0000008900000009; + *((unsigned long *)&__m128i_op1[1]) = 0x63637687636316bb; + *((unsigned long *)&__m128i_op1[0]) = 0x6363636363636363; + *((unsigned long *)&__m128i_result[1]) = 0x6363771163631745; + *((unsigned long *)&__m128i_result[0]) = 0x636363ec6363636c; + __m128i_out = __lsx_vsadd_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000004; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000004; + __m128i_out = __lsx_vsadd_h (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000080000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000080000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000080000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000080000000; + __m128i_out = __lsx_vsadd_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfffffffffefefe6a; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000c2bac2c2; + *((unsigned long *)&__m128i_op1[1]) = 0x00000001fffffffe; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x00000000fefefe68; + *((unsigned long *)&__m128i_result[0]) = 0x00000000c2bac2c2; + __m128i_out = __lsx_vsadd_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x027c027c000027c0; + *((unsigned long *)&__m128i_op1[1]) = 0x001ffff0003ffff0; + *((unsigned long *)&__m128i_op1[0]) = 0x000fffefffefffef; + *((unsigned long *)&__m128i_result[1]) = 0x001ffff0003ffff0; + *((unsigned long *)&__m128i_result[0]) = 0x028c026bfff027af; + __m128i_out = __lsx_vsadd_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0007000000040000; + *((unsigned long *)&__m128i_op0[0]) = 0x0003000000010000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0007000000040000; + *((unsigned long *)&__m128i_result[0]) = 0x0003000000010000; + __m128i_out = __lsx_vsadd_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x3f8000003f800000; + *((unsigned long *)&__m128i_op0[0]) = 0x3f8000003f800000; + *((unsigned long *)&__m128i_op1[1]) = 0x3fffff0000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x3fffff0000000000; + *((unsigned long *)&__m128i_result[1]) = 0x7f7fff003f800000; + *((unsigned long *)&__m128i_result[0]) = 0x7f7fff003f800000; + __m128i_out = __lsx_vsadd_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000820202020; + *((unsigned long *)&__m128i_op0[0]) = 0x00fe01fc0005fff4; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000003a24; + *((unsigned long *)&__m128i_op1[0]) = 0x003dbe88077c78c1; + *((unsigned long *)&__m128i_result[1]) = 0x0000000820205a44; + *((unsigned long *)&__m128i_result[0]) = 0x013bc084078278b5; + __m128i_out = __lsx_vsadd_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000140001; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000140001; + __m128i_out = __lsx_vsadd_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsadd_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x67eb85afb2ebb000; + *((unsigned long *)&__m128i_op0[0]) = 0xc8847ef6ed3f2000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000100000001; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x67eb85b0b2ebb001; + *((unsigned long *)&__m128i_result[0]) = 0xc8847ef6ed3f2000; + __m128i_out = __lsx_vsadd_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsadd_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffff00000000; + *((unsigned long *)&__m128i_op0[0]) = 0xffff000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000014eb54ab; + *((unsigned long *)&__m128i_op1[0]) = 0x14eb6a002a406a00; + *((unsigned long *)&__m128i_result[1]) = 0xffffffff14eb54ab; + *((unsigned long *)&__m128i_result[0]) = 0x14ea6a002a406a00; + __m128i_out = __lsx_vsadd_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000004; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000004; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0xce9035c49ffff570; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000004; + *((unsigned long *)&__m128i_result[0]) = 0xce9035c49ffff574; + __m128i_out = __lsx_vsadd_w (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000010; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000010; + __m128i_out = __lsx_vadd_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x000000000000000d; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000400; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x000000000000040d; + __m128i_out = __lsx_vadd_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000001300000013; + *((unsigned long *)&__m128i_op0[0]) = 0x0000001300000013; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000001300000013; + *((unsigned long *)&__m128i_result[0]) = 0x0000001300000013; + __m128i_out = __lsx_vadd_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vadd_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000100000100; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000100000100; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000100000100; + *((unsigned long *)&__m128i_result[0]) = 0x00000001000000ff; + __m128i_out = __lsx_vadd_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000300000001; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000100010001; + *((unsigned long *)&__m128i_op1[1]) = 0xfffffffffffffffa; + *((unsigned long *)&__m128i_op1[0]) = 0xfffffffffffffffa; + *((unsigned long *)&__m128i_result[1]) = 0x00000002fffffffb; + *((unsigned long *)&__m128i_result[0]) = 0x000000010000fffb; + __m128i_out = __lsx_vadd_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vadd_d (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsadd-2.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsadd-2.c new file mode 100644 index 00000000000..67d1899915f --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vsadd-2.c @@ -0,0 +1,345 @@ +/* { dg-do run } */ +/* { dg-options "-mlsx -w -fno-strict-aliasing" } */ +#include "../simd_correctness_check.h" +#include + +int +main () +{ + __m128i __m128i_op0, __m128i_op1, __m128i_op2, __m128i_out, __m128i_result; + __m128 __m128_op0, __m128_op1, __m128_op2, __m128_out, __m128_result; + __m128d __m128d_op0, __m128d_op1, __m128d_op2, __m128d_out, __m128d_result; + + int int_op0, int_op1, int_op2, int_out, int_result, i = 1, fail; + long int long_op0, long_op1, long_op2, lont_out, lont_result; + long int long_int_out, long_int_result; + unsigned int unsigned_int_out, unsigned_int_result; + unsigned long int unsigned_long_int_out, unsigned_long_int_result; + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x10f917d72d3d01e4; + *((unsigned long *)&__m128i_op1[0]) = 0x203e16d116de012b; + *((unsigned long *)&__m128i_result[1]) = 0x10f917d72d3d01e4; + *((unsigned long *)&__m128i_result[0]) = 0x203e16d116de012b; + __m128i_out = __lsx_vsadd_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfffebd06fffe820c; + *((unsigned long *)&__m128i_op0[0]) = 0x7fff7ffe7fff3506; + *((unsigned long *)&__m128i_op1[1]) = 0xfffebd06fffe820c; + *((unsigned long *)&__m128i_op1[0]) = 0x7fff7ffe7fff3506; + *((unsigned long *)&__m128i_result[1]) = 0xffffff0cffffff18; + *((unsigned long *)&__m128i_result[0]) = 0xfefffefffeff6a0c; + __m128i_out = __lsx_vsadd_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsadd_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsadd_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x4f804f804f804f80; + *((unsigned long *)&__m128i_op1[0]) = 0x4f804f804f804f80; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vsadd_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfffff60ca7104649; + *((unsigned long *)&__m128i_op0[0]) = 0xfffff790a15db63d; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000001; + *((unsigned long *)&__m128i_result[1]) = 0xfffff60ca710464a; + *((unsigned long *)&__m128i_result[0]) = 0xfffff790a15db63e; + __m128i_out = __lsx_vsadd_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xfffffffffffffffe; + *((unsigned long *)&__m128i_op0[0]) = 0xffffffffffffff46; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vsadd_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00fe000100cf005f; + *((unsigned long *)&__m128i_op0[0]) = 0x7fff7fff7fff7fff; + *((unsigned long *)&__m128i_op1[1]) = 0x5f675e96e29a5a60; + *((unsigned long *)&__m128i_op1[0]) = 0x7fff7fff7fff7fff; + *((unsigned long *)&__m128i_result[1]) = 0x5fff5e97e2ff5abf; + *((unsigned long *)&__m128i_result[0]) = 0xfefffefffefffeff; + __m128i_out = __lsx_vsadd_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000001000100010; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0001000100010058; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0001001100110068; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsadd_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x7fffffff7fffffff; + *((unsigned long *)&__m128i_op0[0]) = 0x7fffffff7fffffff; + *((unsigned long *)&__m128i_op1[1]) = 0x7fff010181010102; + *((unsigned long *)&__m128i_op1[0]) = 0x7fffffff81010102; + *((unsigned long *)&__m128i_result[1]) = 0xfeffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xfeffffffffffffff; + __m128i_out = __lsx_vsadd_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000ebd20000714f; + *((unsigned long *)&__m128i_op0[0]) = 0x00012c8a0000a58a; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffb81a6f70; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000d48eaa1a2; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffb81ae0bf; + *((unsigned long *)&__m128i_result[0]) = 0x00012c9748eaffff; + __m128i_out = __lsx_vsadd_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0177fff0fffffff0; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000011ff8bc; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vsadd_bu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000200; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000200; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000200; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000200; + __m128i_out = __lsx_vsadd_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000001; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000001; + __m128i_out = __lsx_vsadd_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsadd_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsadd_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000d0000000d; + *((unsigned long *)&__m128i_op1[1]) = 0x8006000000040000; + *((unsigned long *)&__m128i_op1[0]) = 0x8002000000000007; + *((unsigned long *)&__m128i_result[1]) = 0x8006000000040000; + *((unsigned long *)&__m128i_result[0]) = 0x8002000d00000014; + __m128i_out = __lsx_vsadd_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000014; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000014; + __m128i_out = __lsx_vsadd_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsadd_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vsadd_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + int_out = __lsx_vpickve2gr_h (__m128i_op0, 0x1); + *((unsigned long *)&__m128i_op0[1]) = 0x0000000600007fff; + *((unsigned long *)&__m128i_op0[0]) = 0x00000008ffffa209; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x0000000600007fff; + *((unsigned long *)&__m128i_result[0]) = 0x00000008ffffa209; + __m128i_out = __lsx_vsadd_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x636363633f3e47c1; + *((unsigned long *)&__m128i_op0[0]) = 0x41f8e080f1ef4eaa; + *((unsigned long *)&__m128i_op1[1]) = 0x00000807bf0a1f80; + *((unsigned long *)&__m128i_op1[0]) = 0x00000800ecedee68; + *((unsigned long *)&__m128i_result[1]) = 0x63636b6afe486741; + *((unsigned long *)&__m128i_result[0]) = 0x41f8e880ffffffff; + __m128i_out = __lsx_vsadd_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000ebd20000714f; + *((unsigned long *)&__m128i_op0[0]) = 0x00012c8a0000a58a; + *((unsigned long *)&__m128i_op1[1]) = 0x0000ebd20000714f; + *((unsigned long *)&__m128i_op1[0]) = 0x00012c8a0000a58a; + *((unsigned long *)&__m128i_result[1]) = 0x0000ffff0000e29e; + *((unsigned long *)&__m128i_result[0]) = 0x000259140000ffff; + __m128i_out = __lsx_vsadd_hu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0xfffffffeffffffff; + *((unsigned long *)&__m128i_result[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[0]) = 0xfffffffeffffffff; + __m128i_out = __lsx_vsadd_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0c03e17edd781b11; + *((unsigned long *)&__m128i_op0[0]) = 0x342caf9be55700b5; + *((unsigned long *)&__m128i_op1[1]) = 0x00040003ff83ff84; + *((unsigned long *)&__m128i_op1[0]) = 0x00040003ff4dffca; + *((unsigned long *)&__m128i_result[1]) = 0x0c07e181ffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x3430af9effffffff; + __m128i_out = __lsx_vsadd_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00000000ffa8ff9f; + *((unsigned long *)&__m128i_op0[0]) = 0x0000ffffffabff99; + *((unsigned long *)&__m128i_op1[1]) = 0x000100000002007d; + *((unsigned long *)&__m128i_op1[0]) = 0x0001000000020001; + *((unsigned long *)&__m128i_result[1]) = 0x00010000ffab001c; + *((unsigned long *)&__m128i_result[0]) = 0x0001ffffffadff9a; + __m128i_out = __lsx_vsadd_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x0800080008000800; + *((unsigned long *)&__m128i_op1[0]) = 0x0800080008000800; + *((unsigned long *)&__m128i_result[1]) = 0x0800080008000800; + *((unsigned long *)&__m128i_result[0]) = 0x0800080008000800; + __m128i_out = __lsx_vsadd_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000001; + *((unsigned long *)&__m128i_op0[0]) = 0x76f424887fffffff; + *((unsigned long *)&__m128i_op1[1]) = 0xc110000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0xc00d060000000000; + *((unsigned long *)&__m128i_result[1]) = 0xc110000000000001; + *((unsigned long *)&__m128i_result[0]) = 0xffffffff7fffffff; + __m128i_out = __lsx_vsadd_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000000000000002f; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000029; + *((unsigned long *)&__m128i_op1[1]) = 0xfbfbfb17fbfb38ea; + *((unsigned long *)&__m128i_op1[0]) = 0xfbfb47fbfbfb0404; + *((unsigned long *)&__m128i_result[1]) = 0xfbfbfb17fbfb3919; + *((unsigned long *)&__m128i_result[0]) = 0xfbfb47fbfbfb042d; + __m128i_out = __lsx_vsadd_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x8080808080808081; + *((unsigned long *)&__m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_op1[0]) = 0x00000000ffffffff; + *((unsigned long *)&__m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x80808080ffffffff; + __m128i_out = __lsx_vsadd_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00123fff00120012; + *((unsigned long *)&__m128i_op0[0]) = 0x0012001200120012; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x000000000005003a; + *((unsigned long *)&__m128i_result[1]) = 0x00123fff00120012; + *((unsigned long *)&__m128i_result[0]) = 0x001200120017004c; + __m128i_out = __lsx_vsadd_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0xbfd10d0d7b6b6b73; + *((unsigned long *)&__m128i_op1[0]) = 0xc5c534920000c4ed; + *((unsigned long *)&__m128i_result[1]) = 0xbfd10d0d7b6b6b73; + *((unsigned long *)&__m128i_result[0]) = 0xc5c534920000c4ed; + __m128i_out = __lsx_vsadd_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x000aa822a79308f6; + *((unsigned long *)&__m128i_op0[0]) = 0x00000000084d12ce; + *((unsigned long *)&__m128i_op1[1]) = 0x000aa822a79308f6; + *((unsigned long *)&__m128i_op1[0]) = 0x03aa558e1d37b5a1; + *((unsigned long *)&__m128i_result[1]) = 0x00155044ffffffff; + *((unsigned long *)&__m128i_result[0]) = 0x03aa558e2584c86f; + __m128i_out = __lsx_vsadd_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x021b7d24c9678a35; + *((unsigned long *)&__m128i_op0[0]) = 0x030298a6a1030a49; + *((unsigned long *)&__m128i_op1[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_result[1]) = 0x021b7d24c9678a35; + *((unsigned long *)&__m128i_result[0]) = 0x030298a6a1030a49; + __m128i_out = __lsx_vsadd_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x00007a8000000480; + *((unsigned long *)&__m128i_op0[0]) = 0x00000485000004cc; + *((unsigned long *)&__m128i_op1[1]) = 0x00007a8000000480; + *((unsigned long *)&__m128i_op1[0]) = 0x00000485000004cc; + *((unsigned long *)&__m128i_result[1]) = 0x0000f50000000900; + *((unsigned long *)&__m128i_result[0]) = 0x0000090a00000998; + __m128i_out = __lsx_vsadd_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + *((unsigned long *)&__m128i_op0[1]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op0[0]) = 0x0000000000000000; + *((unsigned long *)&__m128i_op1[1]) = 0x004eff6200d2ff76; + *((unsigned long *)&__m128i_op1[0]) = 0xff70002800be00a0; + *((unsigned long *)&__m128i_result[1]) = 0x004eff6200d2ff76; + *((unsigned long *)&__m128i_result[0]) = 0xff70002800be00a0; + __m128i_out = __lsx_vsadd_wu (__m128i_op0, __m128i_op1); + ASSERTEQ_64 (__LINE__, __m128i_result, __m128i_out); + + return 0; +}