From patchwork Mon Sep 11 03:44:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: chenxiaolong X-Patchwork-Id: 137878 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ab0a:0:b0:3f2:4152:657d with SMTP id m10csp1858265vqo; Sun, 10 Sep 2023 20:50:55 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFm2GhopXlAT9AebtnH/xggf4sqjiqzTx+D4V5NHFXIZmz0znk7Vy/omR2bmzCPnHcc2nl7 X-Received: by 2002:a17:906:2189:b0:99b:de31:6666 with SMTP id 9-20020a170906218900b0099bde316666mr7033425eju.22.1694404255305; Sun, 10 Sep 2023 20:50:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694404255; cv=none; d=google.com; s=arc-20160816; b=PT7Um3MHsPMzk1w4JYRLMa2H5CEx1YO8qT7QjDyU3cK7MSLq1z/tFD485VAg1gGCBP gPdDgunf0bb818sEZUZRBQNTTtDfiBYkgzRJPpwP4W2u+sL3osolPjqsiwRpIuxgk70o 5FFv4u/rDvAEaKqyh0dcxu3SoWGOZlbnV9Z18Zia5kDHwMct1v8o9uqJY/PpzDor2h54 X6YPAGnIH6ueyKHRKUkhiJSjLLk+1MgjPlmCRmq9PI8F+M6nNcUkiLYh/kMMvhEhQlOt Fw1r97lE4MoQHeJOUVIJuhe24XWR8tmc0tBpNvQzoIyDOn483H5+FPiFqa+9aXnR+A7o H6Wg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dmarc-filter:delivered-to; bh=wuukDGpXUKA4gTkwTpCFKkG0kib5Z5YPxff9U4gluqk=; fh=BpFCyCzVJo4znJIvOjeDfKzcGsF6Q+JgJbJ+1ev/kM4=; b=YlWllQNBYfpTMXVesYjc6l65RbTWiElmjuh5UgL8/zilwVOIt8499h3BWAYKO+v7cJ jUG0XQieak2OalWfGNE5cOqVXZQIi1vpwIOmM052bKvLurw6SwY+HAzBTeQL20nQ6DC6 H3hFC0+YGADUxH4numlRenQaN+mlSj6/Cj67JIDVsS/R/kVWhYtAEen7hR3+p+S6S6Up aWPOadUhoMSaH6Man2Ld646TxXnVOdDYfuUguca025l75xmekQfafxGM4oxm2c0oT2Ly K2Ct09HiPdoVyUQpLCbCTYiiZ+ornL4iMiQTooUEYvWH7ZdqfJlfhrxHbPrw19rotMzk 6jCg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id oz9-20020a170906cd0900b00991cbb3d4a6si91395ejb.115.2023.09.10.20.50.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 Sep 2023 20:50:55 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 865173889E25 for ; Mon, 11 Sep 2023 03:46:55 +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 034EC3857026 for ; Mon, 11 Sep 2023 03:45:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 034EC3857026 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 _____8AxDOtpjf5k9UQkAA--.197S3; Mon, 11 Sep 2023 11:45:45 +0800 (CST) Received: from slurm-master.loongson.cn (unknown [10.10.130.252]) by localhost.localdomain (Coremail) with SMTP id AQAAf8Dx_yNXjf5kzKZ2AA--.44820S11; Mon, 11 Sep 2023 11:45:44 +0800 (CST) From: Xiaolong Chen To: gcc-patches@gcc.gnu.org Subject: [PATCH v3 7/9] LoongArch:Add vector arithmetic addition vsadd instruction. Date: Mon, 11 Sep 2023 11:44:37 +0800 Message-Id: <20230911034439.8266-8-chenxiaolong@loongson.cn> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230911034439.8266-1-chenxiaolong@loongson.cn> References: <20230911034439.8266-1-chenxiaolong@loongson.cn> MIME-Version: 1.0 X-CM-TRANSID: AQAAf8Dx_yNXjf5kzKZ2AA--.44820S11 X-CM-SenderInfo: hfkh05xldrz0tqj6z05rqj20fqof0/1tbiAQALBWT9QjYDoAAAsB X-Coremail-Antispam: 1Uk129KBj9fXoWDAFWxKrWUJw43uF13urWUJrc_yoWrWr1rZo WUAa4UZw4rCFZxX3W5Jw13X34fKr1Yk3Zakr1UAwn0ya1DJr4Ivry7ZFsxJF1Utw1ayrW3 Zw13Xr4xJ348Zr1kl-sFpf9Il3svdjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8wcxFpf 9Il3svdxBIdaVrn0xqx4xG64xvF2IEw4CE5I8CrVC2j2Jv73VFW2AGmfu7bjvjm3AaLaJ3 UjIYCTnIWjp_UUUY87kC6x804xWl14x267AKxVWUJVW8JwAFc2x0x2IEx4CE42xK8VAvwI 8IcIk0rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2ocxC64kIII0Yj41l84x0c7CEw4AK67xG Y2AK021l84ACjcxK6xIIjxv20xvE14v26F1j6w1UM28EF7xvwVC0I7IYx2IY6xkF7I0E14 v26r4j6F4UM28EF7xvwVC2z280aVAFwI0_Gr1j6F4UJwA2z4x0Y4vEx4A2jsIEc7CjxVAF wI0_Gr1j6F4UJwAS0I0E0xvYzxvE52x082IY62kv0487Mc804VCY07AIYIkI8VC2zVCFFI 0UMc02F40EFcxC0VAKzVAqx4xG6I80ewAv7VC0I7IYx2IY67AKxVWUtVWrXwAv7VC2z280 aVAFwI0_Gr0_Cr1lOx8S6xCaFVCjc4AY6r1j6r4UM4x0Y48IcxkI7VAKI48JMxAIw28Icx kI7VAKI48JMxC20s026xCaFVCjc4AY6r1j6r4UMI8I3I0E5I8CrVAFwI0_Jr0_Jr4lx2Iq xVCjr7xvwVAFwI0_JrI_JrWlx4CE17CEb7AF67AKxVWUAVWUtwCIc40Y0x0EwIxGrwCI42 IY6xIIjxv20xvE14v26ryj6F1UMIIF0xvE2Ix0cI8IcVCY1x0267AKxVW8JVWxJwCI42IY 6xAIw20EY4v20xvaj40_Jr0_JF4lIxAIcVC2z280aVAFwI0_Gr0_Cr1lIxAIcVC2z280aV CY1x0267AKxVW8JVW8JrUvcSsGvfC2KfnxnUUI43ZEXa7IU84xRDUUUUU== X-Spam-Status: No, score=-12.3 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: , Cc: Xiaolong Chen , xuchenghua@loongson.cn, chenglulu@loongson.cn, i@xen0n.name Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1776711636620534910 X-GMAIL-MSGID: 1776711636620534910 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; +}