From patchwork Wed Sep 13 03:37:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: chenxiaolong X-Patchwork-Id: 138599 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9ecd:0:b0:3f2:4152:657d with SMTP id t13csp834435vqx; Tue, 12 Sep 2023 20:48:37 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF79BOXEmEZWJrhIF0ji0iWvvojyQhi2Rsvy6tw0mR7uEtbIBXVgCSaoOX0v6PC+dzKqx+z X-Received: by 2002:a05:6402:2027:b0:52a:943:9ab5 with SMTP id ay7-20020a056402202700b0052a09439ab5mr1241820edb.31.1694576917233; Tue, 12 Sep 2023 20:48:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694576917; cv=none; d=google.com; s=arc-20160816; b=w7C++RsUXr/ydzNoR9W4lBrv/rgbUv3hugIyXIilBoA7K6UwhNT2gWQsOQzz1/A9LV GZs8TWDCEYFLPoVNxh0v1XO/IWk6xG+vdmrhCG/04rhsVe+DL8uqqFTLK2VsxpvcxTPj 8BDeA5U+hSzKNDqj2QQcI86UQXxsfhV2H/q4MFW8lFDK+aLkJ0nhYuv05TCSKRC0zau2 zLTp1JRSvdTecTZwc/SjUK//ScaSIhxXbu9TvGbY47BLCLWq3KyNWdzBoGv1pusHM4i1 hgA7+27+VyPs+kGCVwvDsWqrIWGWfjPoC10v3THavb39FKanfoPjI07+x7HWUjCCcxy+ L7Ig== 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=ZRvNEkjNCDpIDW5e+EmRpsR9z1I219a6/gZgDwMWiBo=; fh=3pFUYcpS/27XRzOf17GfR86AuNQu+P1CET04YURgCLs=; b=IhQx9JydmDao93wkJLkaTA/WDTbjHbBfebHkPnBkuYl68SD2A1ZeHswaudGcYQnRRU gPoFDH7URszTJNr43IhgEZ96GNvrwotikdXE8RNLJrKQ7PINazV78rmVzlUByutL7ofj 5vm338YPb9NoN1m+L+htgMUNo5+0QBcRk35gmkTS2T/x49vIv+l97M3BShq+znA0DQcZ rdc3+aTAzxX7xlNUeWAMUvjYYzX2PdnO8nmigEpRwRilWrALq52IBw1Ngo5fvTQc1GwY FgaE1e+gzYvfIG0YcaXI9oFRKbGMtWH5kN/qPlMWbJM0gfymLaFrI62L87rsQzNzBqBi SJDw== 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 l4-20020aa7c304000000b0052a234ad7b7si9568684edq.305.2023.09.12.20.48.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Sep 2023 20:48:37 -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 088293893662 for ; Wed, 13 Sep 2023 03:38:15 +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 01409395A060 for ; Wed, 13 Sep 2023 03:37:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 01409395A060 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 _____8CxRuh9LgFlKjEmAA--.20756S3; Wed, 13 Sep 2023 11:37:33 +0800 (CST) Received: from slurm-master.loongson.cn (unknown [10.10.130.252]) by localhost.localdomain (Coremail) with SMTP id AQAAf8DxS9x3LgFlQhACAA--.3563S6; Wed, 13 Sep 2023 11:37:33 +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 22/23] LoongArch: Add tests for SX vector vand/vandi/vandn/vor/vori/vnor/ vnori/vxor/vxori instructions. Date: Wed, 13 Sep 2023 11:37:25 +0800 Message-Id: <20230913033726.6408-3-chenxiaolong@loongson.cn> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230913033726.6408-1-chenxiaolong@loongson.cn> References: <20230913033726.6408-1-chenxiaolong@loongson.cn> MIME-Version: 1.0 X-CM-TRANSID: AQAAf8DxS9x3LgFlQhACAA--.3563S6 X-CM-SenderInfo: hfkh05xldrz0tqj6z05rqj20fqof0/1tbiAQANBWUBHCIBHAAAsO X-Coremail-Antispam: 1Uk129KBj9fXoWDXFW7Zw47Xr47Ww4xuw1fXwc_yoW7Kr48Go WUAa4UZw4rCFZxX3W3tw13X34fKF1Yk3Z3Cr1xAwn0yw4Dtr42vry7ZFsxJF1Utw1ayrW3 Zw1agr4xJ348Ar1kl-sFpf9Il3svdjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8wcxFpf 9Il3svdxBIdaVrn0xqx4xG64xvF2IEw4CE5I8CrVC2j2Jv73VFW2AGmfu7bjvjm3AaLaJ3 UjIYCTnIWjp_UUUYY7kC6x804xWl14x267AKxVWUJVW8JwAFc2x0x2IEx4CE42xK8VAvwI 8IcIk0rVWrJVCq3wAFIxvE14AKwVWUGVWUXwA2ocxC64kIII0Yj41l84x0c7CEw4AK67xG Y2AK021l84ACjcxK6xIIjxv20xvE14v26F1j6w1UM28EF7xvwVC0I7IYx2IY6xkF7I0E14 v26F4j6r4UJwA2z4x0Y4vEx4A2jsIE14v26r4UJVWxJr1l84ACjcxK6I8E87Iv6xkF7I0E 14v26r4UJVWxJr1le2I262IYc4CY6c8Ij28IcVAaY2xG8wAqjxCEc2xF0cIa020Ex4CE44 I27wAqx4xG64xvF2IEw4CE5I8CrVC2j2WlYx0E2Ix0cI8IcVAFwI0_ZF0_GryDMcIj6I8E 87Iv67AKxVWxJVW8Jr1lOx8S6xCaFVCjc4AY6r1j6r4UM4x0Y48IcxkI7VAKI48JMxAIw2 8IcxkI7VAKI48JMxC20s026xCaFVCjc4AY6r1j6r4UMI8I3I0E5I8CrVAFwI0_Jr0_Jr4l x2IqxVCjr7xvwVAFwI0_JrI_JrWlx4CE17CEb7AF67AKxVWUAVWUtwCIc40Y0x0EwIxGrw CI42IY6xIIjxv20xvE14v26F1j6w1UMIIF0xvE2Ix0cI8IcVCY1x0267AKxVWxJVW8Jr1l IxAIcVCF04k26cxKx2IYs7xG6r1j6r1xMIIF0xvEx4A2jsIE14v26F4j6r4UJwCI42IY6I 8E87Iv6xkF7I0E14v26r4j6r4UJbIYCTnIWIevJa73UjIFyTuYvjxU4X_-DUUUU 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: 1776892685816608533 X-GMAIL-MSGID: 1776892685816608533 gcc/testsuite/ChangeLog: * gcc.target/loongarch/vector/lsx/lsx-vand.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vandi.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vandn.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vnor.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vnori.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vor.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vori.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vorn.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vxor.c: New test. * gcc.target/loongarch/vector/lsx/lsx-vxori.c: New test. --- .../loongarch/vector/lsx/lsx-vand.c | 159 ++++++++++++++++ .../loongarch/vector/lsx/lsx-vandi.c | 67 +++++++ .../loongarch/vector/lsx/lsx-vandn.c | 129 +++++++++++++ .../loongarch/vector/lsx/lsx-vnor.c | 109 +++++++++++ .../loongarch/vector/lsx/lsx-vnori.c | 91 ++++++++++ .../gcc.target/loongarch/vector/lsx/lsx-vor.c | 169 ++++++++++++++++++ .../loongarch/vector/lsx/lsx-vori.c | 123 +++++++++++++ .../loongarch/vector/lsx/lsx-vorn.c | 109 +++++++++++ .../loongarch/vector/lsx/lsx-vxor.c | 79 ++++++++ .../loongarch/vector/lsx/lsx-vxori.c | 67 +++++++ 10 files changed, 1102 insertions(+) create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vand.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vandi.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vandn.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vnor.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vnori.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vor.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vori.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vorn.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vxor.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vxori.c diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vand.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vand.c new file mode 100644 index 00000000000..1597749b546 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vand.c @@ -0,0 +1,159 @@ +/* { 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]) = 0x0000000000000000; + *((unsigned long*)& __m128i_op1[0]) = 0x0000000000000000; + *((unsigned long*)& __m128i_result[1]) = 0x0000000000000000; + *((unsigned long*)& __m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vand_v(__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]) = 0x03574e3a62407e03; + *((unsigned long*)& __m128i_op1[0]) = 0x0000000001010000; + *((unsigned long*)& __m128i_result[1]) = 0x03574e3a62407e03; + *((unsigned long*)& __m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vand_v(__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]) = 0x001fffff001fffff; + *((unsigned long*)& __m128i_op1[0]) = 0x001fffff001fffff; + *((unsigned long*)& __m128i_result[1]) = 0x001fffff001fffff; + *((unsigned long*)& __m128i_result[0]) = 0x001fffff001fffff; + __m128i_out = __lsx_vand_v(__m128i_op0,__m128i_op1); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0x00000000003dffc2; + *((unsigned long*)& __m128i_op0[0]) = 0x00000000003dffc2; + *((unsigned long*)& __m128i_op1[1]) = 0x0008000000000000; + *((unsigned long*)& __m128i_op1[0]) = 0x0000000000000000; + *((unsigned long*)& __m128i_result[1]) = 0x0000000000000000; + *((unsigned long*)& __m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vand_v(__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_vand_v(__m128i_op0,__m128i_op1); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0x00000000ffff53d9; + *((unsigned long*)& __m128i_op0[0]) = 0xffff0001ffff9515; + *((unsigned long*)& __m128i_op1[1]) = 0x00000000ffff53d9; + *((unsigned long*)& __m128i_op1[0]) = 0xffff0001ffff9515; + *((unsigned long*)& __m128i_result[1]) = 0x00000000ffff53d9; + *((unsigned long*)& __m128i_result[0]) = 0xffff0001ffff9515; + __m128i_out = __lsx_vand_v(__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_vand_v(__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]) = 0xffffffffffffffff; + *((unsigned long*)& __m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vand_v(__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_vand_v(__m128i_op0,__m128i_op1); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0x67eb85af0000b000; + *((unsigned long*)& __m128i_op0[0]) = 0xc8847ef6ed3f2000; + *((unsigned long*)& __m128i_op1[1]) = 0x67eb85af0000b000; + *((unsigned long*)& __m128i_op1[0]) = 0xc8847ef6ed3f2000; + *((unsigned long*)& __m128i_result[1]) = 0x67eb85af0000b000; + *((unsigned long*)& __m128i_result[0]) = 0xc8847ef6ed3f2000; + __m128i_out = __lsx_vand_v(__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_vand_v(__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]) = 0x0313100003131000; + *((unsigned long*)& __m128i_op1[0]) = 0x0313100003131000; + *((unsigned long*)& __m128i_result[1]) = 0x0000000000000000; + *((unsigned long*)& __m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vand_v(__m128i_op0,__m128i_op1); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0x0000000000000000; + *((unsigned long*)& __m128i_op0[0]) = 0x0000000200000002; + *((unsigned long*)& __m128i_op1[1]) = 0x0007000000050000; + *((unsigned long*)& __m128i_op1[0]) = 0x0003000100010001; + *((unsigned long*)& __m128i_result[1]) = 0x0000000000000000; + *((unsigned long*)& __m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vand_v(__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]) = 0x0a0000000a000000; + *((unsigned long*)& __m128i_op1[0]) = 0x0a0000000a000000; + *((unsigned long*)& __m128i_result[1]) = 0x0000000000000000; + *((unsigned long*)& __m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vand_v(__m128i_op0,__m128i_op1); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vandi.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vandi.c new file mode 100644 index 00000000000..906da69caf7 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vandi.c @@ -0,0 +1,67 @@ +/* { 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_result[1]) = 0x0000000000000000; + *((unsigned long*)& __m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vandi_b(__m128i_op0,0x36); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0x0000000000000800; + *((unsigned long*)& __m128i_op0[0]) = 0x0000000000000000; + *((unsigned long*)& __m128i_result[1]) = 0x0000000000000800; + *((unsigned long*)& __m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vandi_b(__m128i_op0,0x39); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0x0000000000000000; + *((unsigned long*)& __m128i_op0[0]) = 0x0000000000000000; + *((unsigned long*)& __m128i_result[1]) = 0x0000000000000000; + *((unsigned long*)& __m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vandi_b(__m128i_op0,0x27); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0x0000000000000000; + *((unsigned long*)& __m128i_op0[0]) = 0x0000000000000000; + *((unsigned long*)& __m128i_result[1]) = 0x0000000000000000; + *((unsigned long*)& __m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vandi_b(__m128i_op0,0x25); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0x0000000000000000; + *((unsigned long*)& __m128i_op0[0]) = 0x0000000000000000; + *((unsigned long*)& __m128i_result[1]) = 0x0000000000000000; + *((unsigned long*)& __m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vandi_b(__m128i_op0,0xbd); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0x0000a95afc60a5c5; + *((unsigned long*)& __m128i_op0[0]) = 0x0000b6e414157f84; + *((unsigned long*)& __m128i_result[1]) = 0x0000204264602444; + *((unsigned long*)& __m128i_result[0]) = 0x0000266404046604; + __m128i_out = __lsx_vandi_b(__m128i_op0,0x66); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vandn.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vandn.c new file mode 100644 index 00000000000..3ae2d769421 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vandn.c @@ -0,0 +1,129 @@ +/* { 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]) = 0x000000017fff9000; + *((unsigned long*)& __m128i_op1[0]) = 0x0000000210011084; + *((unsigned long*)& __m128i_result[1]) = 0x000000017fff9000; + *((unsigned long*)& __m128i_result[0]) = 0x0000000210011084; + __m128i_out = __lsx_vandn_v(__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_vandn_v(__m128i_op0,__m128i_op1); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0x0000000000000000; + *((unsigned long*)& __m128i_op0[0]) = 0x0000000100000000; + *((unsigned long*)& __m128i_op1[1]) = 0x00000049000000c0; + *((unsigned long*)& __m128i_op1[0]) = 0x00000001ffffff29; + *((unsigned long*)& __m128i_result[1]) = 0x00000049000000c0; + *((unsigned long*)& __m128i_result[0]) = 0x00000000ffffff29; + __m128i_out = __lsx_vandn_v(__m128i_op0,__m128i_op1); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0x010f00000111fffc; + *((unsigned long*)& __m128i_op0[0]) = 0x016700dc0176003a; + *((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_vandn_v(__m128i_op0,__m128i_op1); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0x0003000000010000; + *((unsigned long*)& __m128i_op0[0]) = 0x0002000000010000; + *((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_vandn_v(__m128i_op0,__m128i_op1); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0x8000000000000000; + *((unsigned long*)& __m128i_op0[0]) = 0xfffffffffffff000; + *((unsigned long*)& __m128i_op1[1]) = 0x8000000000000000; + *((unsigned long*)& __m128i_op1[0]) = 0xfffffffffffff000; + *((unsigned long*)& __m128i_result[1]) = 0x0000000000000000; + *((unsigned long*)& __m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vandn_v(__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]) = 0x62cbf96e4acfaf40; + *((unsigned long*)& __m128i_op1[0]) = 0xf0bc9a5278285a4a; + *((unsigned long*)& __m128i_result[1]) = 0x62cbf96e4acfaf40; + *((unsigned long*)& __m128i_result[0]) = 0xf0bc9a5278285a4a; + __m128i_out = __lsx_vandn_v(__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_vandn_v(__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]) = 0xffffffffffffffff; + *((unsigned long*)& __m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vandn_v(__m128i_op0,__m128i_op1); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0x0000000000000000; + *((unsigned long*)& __m128i_op0[0]) = 0xfffe0004fffe0004; + *((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_vandn_v(__m128i_op0,__m128i_op1); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0x0000000000000000; + *((unsigned long*)& __m128i_op0[0]) = 0x9c7c266e71768fa4; + *((unsigned long*)& __m128i_op1[1]) = 0x0000000000000000; + *((unsigned long*)& __m128i_op1[0]) = 0x9c7c266e71768fa4; + *((unsigned long*)& __m128i_result[1]) = 0x0000000000000000; + *((unsigned long*)& __m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vandn_v(__m128i_op0,__m128i_op1); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vnor.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vnor.c new file mode 100644 index 00000000000..a7a3acce933 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vnor.c @@ -0,0 +1,109 @@ +/* { 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]) = 0x00000000fff8fff8; + *((unsigned long*)& __m128i_op0[0]) = 0x00000000fff80000; + *((unsigned long*)& __m128i_op1[1]) = 0x00000000fff8fff8; + *((unsigned long*)& __m128i_op1[0]) = 0x00000000fff80000; + *((unsigned long*)& __m128i_result[1]) = 0xffffffff00070007; + *((unsigned long*)& __m128i_result[0]) = 0xffffffff0007ffff; + __m128i_out = __lsx_vnor_v(__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_vnor_v(__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_vnor_v(__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]) = 0xffffffffffffffff; + *((unsigned long*)& __m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vnor_v(__m128i_op0,__m128i_op1); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0xce23d33e43d9736c; + *((unsigned long*)& __m128i_op0[0]) = 0x63b2ac27aa076aeb; + *((unsigned long*)& __m128i_op1[1]) = 0x0000000000000000; + *((unsigned long*)& __m128i_op1[0]) = 0x0000000000000000; + *((unsigned long*)& __m128i_result[1]) = 0x31dc2cc1bc268c93; + *((unsigned long*)& __m128i_result[0]) = 0x9c4d53d855f89514; + __m128i_out = __lsx_vnor_v(__m128i_op0,__m128i_op1); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0x0000000000000000; + *((unsigned long*)& __m128i_op0[0]) = 0x000000000000000c; + *((unsigned long*)& __m128i_op1[1]) = 0x0000000000000000; + *((unsigned long*)& __m128i_op1[0]) = 0x0000000000000000; + *((unsigned long*)& __m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long*)& __m128i_result[0]) = 0xfffffffffffffff3; + __m128i_out = __lsx_vnor_v(__m128i_op0,__m128i_op1); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0x0000400080003fff; + *((unsigned long*)& __m128i_op0[0]) = 0x0000bc2000007e04; + *((unsigned long*)& __m128i_op1[1]) = 0x0000400080003fff; + *((unsigned long*)& __m128i_op1[0]) = 0x0000bc2000007e04; + *((unsigned long*)& __m128i_result[1]) = 0xffffbfff7fffc000; + *((unsigned long*)& __m128i_result[0]) = 0xffff43dfffff81fb; + __m128i_out = __lsx_vnor_v(__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]) = 0x5252525252525252; + *((unsigned long*)& __m128i_op1[0]) = 0x5252525252525252; + *((unsigned long*)& __m128i_result[1]) = 0xada4808924882588; + *((unsigned long*)& __m128i_result[0]) = 0xacad25090caca5a4; + __m128i_out = __lsx_vnor_v(__m128i_op0,__m128i_op1); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0x0000000000000000; + *((unsigned long*)& __m128i_op0[0]) = 0xfffefffe0000ff18; + *((unsigned long*)& __m128i_op1[1]) = 0xffff000000000000; + *((unsigned long*)& __m128i_op1[0]) = 0x00000000ffffffff; + *((unsigned long*)& __m128i_result[1]) = 0x0000ffffffffffff; + *((unsigned long*)& __m128i_result[0]) = 0x0001000100000000; + __m128i_out = __lsx_vnor_v(__m128i_op0,__m128i_op1); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vnori.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vnori.c new file mode 100644 index 00000000000..a07a02ab212 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vnori.c @@ -0,0 +1,91 @@ +/* { 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]) = 0x00000000ffff0000; + *((unsigned long*)& __m128i_op0[0]) = 0x00000000ffff0000; + *((unsigned long*)& __m128i_result[1]) = 0xcccccccc0000cccc; + *((unsigned long*)& __m128i_result[0]) = 0xcccccccc0000cccc; + __m128i_out = __lsx_vnori_b(__m128i_op0,0x33); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long*)& __m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long*)& __m128i_result[1]) = 0x0000000000000000; + *((unsigned long*)& __m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vnori_b(__m128i_op0,0xa6); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0x0000000000000000; + *((unsigned long*)& __m128i_op0[0]) = 0x3e035e51522f0799; + *((unsigned long*)& __m128i_result[1]) = 0x9292929292929292; + *((unsigned long*)& __m128i_result[0]) = 0x8090808280909002; + __m128i_out = __lsx_vnori_b(__m128i_op0,0x6d); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0x00000000000ffc2f; + *((unsigned long*)& __m128i_op0[0]) = 0x00201df000000000; + *((unsigned long*)& __m128i_result[1]) = 0x3838383838300010; + *((unsigned long*)& __m128i_result[0]) = 0x3818200838383838; + __m128i_out = __lsx_vnori_b(__m128i_op0,0xc7); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0x2020202020202020; + *((unsigned long*)& __m128i_op0[0]) = 0x2020202020207f7f; + *((unsigned long*)& __m128i_result[1]) = 0x5d5d5d5d5d5d5d5d; + *((unsigned long*)& __m128i_result[0]) = 0x5d5d5d5d5d5d0000; + __m128i_out = __lsx_vnori_b(__m128i_op0,0xa2); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0x0000000000000000; + *((unsigned long*)& __m128i_op0[0]) = 0x0000000000000000; + *((unsigned long*)& __m128i_result[1]) = 0x8080808080808080; + *((unsigned long*)& __m128i_result[0]) = 0x8080808080808080; + __m128i_out = __lsx_vnori_b(__m128i_op0,0x7f); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0x8080808080808080; + *((unsigned long*)& __m128i_op0[0]) = 0x8080808080808080; + *((unsigned long*)& __m128i_result[1]) = 0x1313131313131313; + *((unsigned long*)& __m128i_result[0]) = 0x1313131313131313; + __m128i_out = __lsx_vnori_b(__m128i_op0,0xec); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0x0000000000000000; + *((unsigned long*)& __m128i_op0[0]) = 0x0000000000000000; + *((unsigned long*)& __m128i_result[1]) = 0x9d9d9d9d9d9d9d9d; + *((unsigned long*)& __m128i_result[0]) = 0x9d9d9d9d9d9d9d9d; + __m128i_out = __lsx_vnori_b(__m128i_op0,0x62); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0x00f525682ffd27f2; + *((unsigned long*)& __m128i_op0[0]) = 0x00365c60317ff930; + *((unsigned long*)& __m128i_result[1]) = 0xe500c085c000c005; + *((unsigned long*)& __m128i_result[0]) = 0xe5c1a185c48004c5; + __m128i_out = __lsx_vnori_b(__m128i_op0,0x1a); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vor.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vor.c new file mode 100644 index 00000000000..537a1bb3b64 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vor.c @@ -0,0 +1,169 @@ +/* { 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]) = 0xffffffffffffffff; + *((unsigned long*)& __m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long*)& __m128i_op1[1]) = 0x7e44bde9b842ff23; + *((unsigned long*)& __m128i_op1[0]) = 0x00011e80007edff8; + *((unsigned long*)& __m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long*)& __m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vor_v(__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_vor_v(__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]) = 0x0000000000000001; + *((unsigned long*)& __m128i_op1[0]) = 0xfffc001fffffffff; + *((unsigned long*)& __m128i_result[1]) = 0x00000000ffffffff; + *((unsigned long*)& __m128i_result[0]) = 0xfffc001fffffffff; + __m128i_out = __lsx_vor_v(__m128i_op0,__m128i_op1); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0x0000000000000000; + *((unsigned long*)& __m128i_op0[0]) = 0x0000000000200010; + *((unsigned long*)& __m128i_op1[1]) = 0x0000000000000000; + *((unsigned long*)& __m128i_op1[0]) = 0x0000000000200010; + *((unsigned long*)& __m128i_result[1]) = 0x0000000000000000; + *((unsigned long*)& __m128i_result[0]) = 0x0000000000200010; + __m128i_out = __lsx_vor_v(__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_vor_v(__m128i_op0,__m128i_op1); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0x4f804f804f804f80; + *((unsigned long*)& __m128i_op0[0]) = 0x4f804f804f804f80; + *((unsigned long*)& __m128i_op1[1]) = 0x4f804f804f804f80; + *((unsigned long*)& __m128i_op1[0]) = 0x4f804f804f804f80; + *((unsigned long*)& __m128i_result[1]) = 0x4f804f804f804f80; + *((unsigned long*)& __m128i_result[0]) = 0x4f804f804f804f80; + __m128i_out = __lsx_vor_v(__m128i_op0,__m128i_op1); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0x0000000000000000; + *((unsigned long*)& __m128i_op0[0]) = 0x3e035e51522f0799; + *((unsigned long*)& __m128i_op1[1]) = 0x0000000000000000; + *((unsigned long*)& __m128i_op1[0]) = 0x3e035e51522f0799; + *((unsigned long*)& __m128i_result[1]) = 0x0000000000000000; + *((unsigned long*)& __m128i_result[0]) = 0x3e035e51522f0799; + __m128i_out = __lsx_vor_v(__m128i_op0,__m128i_op1); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0xffff0000ffff0000; + *((unsigned long*)& __m128i_op0[0]) = 0xffff000000000000; + *((unsigned long*)& __m128i_op1[1]) = 0xffff0000ffff0000; + *((unsigned long*)& __m128i_op1[0]) = 0xffff000000000000; + *((unsigned long*)& __m128i_result[1]) = 0xffff0000ffff0000; + *((unsigned long*)& __m128i_result[0]) = 0xffff000000000000; + __m128i_out = __lsx_vor_v(__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]) = 0xffffffff00000000; + *((unsigned long*)& __m128i_op1[0]) = 0x0000000000000000; + *((unsigned long*)& __m128i_result[1]) = 0xffffffff00000000; + *((unsigned long*)& __m128i_result[0]) = 0x0000000000000000; + __m128i_out = __lsx_vor_v(__m128i_op0,__m128i_op1); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0xfffb00fdfdf7ffff; + *((unsigned long*)& __m128i_op0[0]) = 0xfff8000000000000; + *((unsigned long*)& __m128i_op1[1]) = 0xfffb00fdfdf7ffff; + *((unsigned long*)& __m128i_op1[0]) = 0xfff8000000000000; + *((unsigned long*)& __m128i_result[1]) = 0xfffb00fdfdf7ffff; + *((unsigned long*)& __m128i_result[0]) = 0xfff8000000000000; + __m128i_out = __lsx_vor_v(__m128i_op0,__m128i_op1); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0xffffffff80005613; + *((unsigned long*)& __m128i_op0[0]) = 0x81000080806b000b; + *((unsigned long*)& __m128i_op1[1]) = 0xffff00011cf0c569; + *((unsigned long*)& __m128i_op1[0]) = 0xc0000002b0995850; + *((unsigned long*)& __m128i_result[1]) = 0xffffffff9cf0d77b; + *((unsigned long*)& __m128i_result[0]) = 0xc1000082b0fb585b; + __m128i_out = __lsx_vor_v(__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]) = 0x0000000000000000; + *((unsigned long*)& __m128i_op1[0]) = 0x80808080806b000b; + *((unsigned long*)& __m128i_result[1]) = 0x0000000000000000; + *((unsigned long*)& __m128i_result[0]) = 0xfffffffffffbfffb; + __m128i_out = __lsx_vor_v(__m128i_op0,__m128i_op1); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0x0001000101010001; + *((unsigned long*)& __m128i_op0[0]) = 0x0001000100010001; + *((unsigned long*)& __m128i_op1[1]) = 0x0000ffff0000ffff; + *((unsigned long*)& __m128i_op1[0]) = 0x0000ffff0000ffff; + *((unsigned long*)& __m128i_result[1]) = 0x0001ffff0101ffff; + *((unsigned long*)& __m128i_result[0]) = 0x0001ffff0001ffff; + __m128i_out = __lsx_vor_v(__m128i_op0,__m128i_op1); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0xffffffffc105d1aa; + *((unsigned long*)& __m128i_op0[0]) = 0xffffffffbc19ecca; + *((unsigned long*)& __m128i_op1[1]) = 0xc0b4d1a5f8babad3; + *((unsigned long*)& __m128i_op1[0]) = 0xbbc8ecc5f3ced5f3; + *((unsigned long*)& __m128i_result[1]) = 0xfffffffff9bffbfb; + *((unsigned long*)& __m128i_result[0]) = 0xffffffffffdffdfb; + __m128i_out = __lsx_vor_v(__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_vor_v(__m128i_op0,__m128i_op1); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vori.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vori.c new file mode 100644 index 00000000000..8a6e035c93b --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vori.c @@ -0,0 +1,123 @@ +/* { 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_result[1]) = 0x8282828282828282; + *((unsigned long*)& __m128i_result[0]) = 0x8282828282828282; + __m128i_out = __lsx_vori_b(__m128i_op0,0x82); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0x7505853d654185f5; + *((unsigned long*)& __m128i_op0[0]) = 0x01010000fefe0101; + *((unsigned long*)& __m128i_result[1]) = 0x7545c57d6541c5f5; + *((unsigned long*)& __m128i_result[0]) = 0x41414040fefe4141; + __m128i_out = __lsx_vori_b(__m128i_op0,0x40); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0x0000c2f90000bafa; + *((unsigned long*)& __m128i_op0[0]) = 0x8000c2fa8000c2fa; + *((unsigned long*)& __m128i_result[1]) = 0x7474f6fd7474fefe; + *((unsigned long*)& __m128i_result[0]) = 0xf474f6fef474f6fe; + __m128i_out = __lsx_vori_b(__m128i_op0,0x74); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0x0000000000000000; + *((unsigned long*)& __m128i_op0[0]) = 0x0000000000000000; + *((unsigned long*)& __m128i_result[1]) = 0x3d3d3d3d3d3d3d3d; + *((unsigned long*)& __m128i_result[0]) = 0x3d3d3d3d3d3d3d3d; + __m128i_out = __lsx_vori_b(__m128i_op0,0x3d); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0xfffffacdb6dbecac; + *((unsigned long*)& __m128i_op0[0]) = 0x1f5533a694f902c0; + *((unsigned long*)& __m128i_result[1]) = 0xfffffadffedbfefe; + *((unsigned long*)& __m128i_result[0]) = 0x5f5f7bfedefb5ada; + __m128i_out = __lsx_vori_b(__m128i_op0,0x5a); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long*)& __m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long*)& __m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long*)& __m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vori_b(__m128i_op0,0x38); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0x0d1202e19235e2bc; + *((unsigned long*)& __m128i_op0[0]) = 0xea38e0f75f6e56d1; + *((unsigned long*)& __m128i_result[1]) = 0x2f3626e7b637e6be; + *((unsigned long*)& __m128i_result[0]) = 0xee3ee6f77f6e76f7; + __m128i_out = __lsx_vori_b(__m128i_op0,0x26); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0x0003c853c843c87e; + *((unsigned long*)& __m128i_op0[0]) = 0x0003c853c843c87e; + *((unsigned long*)& __m128i_result[1]) = 0xd6d7ded7ded7defe; + *((unsigned long*)& __m128i_result[0]) = 0xd6d7ded7ded7defe; + __m128i_out = __lsx_vori_b(__m128i_op0,0xd6); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0x0000000000000000; + *((unsigned long*)& __m128i_op0[0]) = 0xfffe0000fffe0000; + *((unsigned long*)& __m128i_result[1]) = 0x7777777777777777; + *((unsigned long*)& __m128i_result[0]) = 0xffff7777ffff7777; + __m128i_out = __lsx_vori_b(__m128i_op0,0x77); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0xffffffffffffffff; + *((unsigned long*)& __m128i_op0[0]) = 0xffffffffffffffff; + *((unsigned long*)& __m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long*)& __m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vori_b(__m128i_op0,0x55); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0x8000000000000000; + *((unsigned long*)& __m128i_op0[0]) = 0x8000000000000000; + *((unsigned long*)& __m128i_result[1]) = 0xd454545454545454; + *((unsigned long*)& __m128i_result[0]) = 0xd454545454545454; + __m128i_out = __lsx_vori_b(__m128i_op0,0x54); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0x0000000000000000; + *((unsigned long*)& __m128i_op0[0]) = 0x0000000000000000; + *((unsigned long*)& __m128i_result[1]) = 0x4f4f4f4f4f4f4f4f; + *((unsigned long*)& __m128i_result[0]) = 0x4f4f4f4f4f4f4f4f; + __m128i_out = __lsx_vori_b(__m128i_op0,0x4f); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0x0000000000000000; + *((unsigned long*)& __m128i_op0[0]) = 0x0000000000000000; + *((unsigned long*)& __m128i_result[1]) = 0x8a8a8a8a8a8a8a8a; + *((unsigned long*)& __m128i_result[0]) = 0x8a8a8a8a8a8a8a8a; + __m128i_out = __lsx_vori_b(__m128i_op0,0x8a); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vorn.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vorn.c new file mode 100644 index 00000000000..bb59bc312b8 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vorn.c @@ -0,0 +1,109 @@ +/* { 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]) = 0x0001000100010001; + *((unsigned long*)& __m128i_op0[0]) = 0x000100010001fffe; + *((unsigned long*)& __m128i_op1[1]) = 0x0000000000000000; + *((unsigned long*)& __m128i_op1[0]) = 0x0000000000000000; + *((unsigned long*)& __m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long*)& __m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vorn_v(__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]) = 0x00d3012b015700bb; + *((unsigned long*)& __m128i_op1[0]) = 0x00010000ffca0070; + *((unsigned long*)& __m128i_result[1]) = 0xff2cfed4fea8ff44; + *((unsigned long*)& __m128i_result[0]) = 0xfffeffff0035ff8f; + __m128i_out = __lsx_vorn_v(__m128i_op0,__m128i_op1); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0x00fe00fe00fe00fe; + *((unsigned long*)& __m128i_op0[0]) = 0x00fe00fe00fe0045; + *((unsigned long*)& __m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long*)& __m128i_op1[0]) = 0xffffffffffffffff; + *((unsigned long*)& __m128i_result[1]) = 0x00fe00fe00fe00fe; + *((unsigned long*)& __m128i_result[0]) = 0x00fe00fe00fe0045; + __m128i_out = __lsx_vorn_v(__m128i_op0,__m128i_op1); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0x0000010000010101; + *((unsigned long*)& __m128i_op0[0]) = 0x0101000001000100; + *((unsigned long*)& __m128i_op1[1]) = 0x0000010000010101; + *((unsigned long*)& __m128i_op1[0]) = 0x0101000001000100; + *((unsigned long*)& __m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long*)& __m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vorn_v(__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]) = 0xffffffffffffffff; + *((unsigned long*)& __m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vorn_v(__m128i_op0,__m128i_op1); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0x0000000000000000; + *((unsigned long*)& __m128i_op0[0]) = 0x0000000000000002; + *((unsigned long*)& __m128i_op1[1]) = 0x0000000000000000; + *((unsigned long*)& __m128i_op1[0]) = 0x0000000000000002; + *((unsigned long*)& __m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long*)& __m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vorn_v(__m128i_op0,__m128i_op1); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0x33f5c2d7d975d7fe; + *((unsigned long*)& __m128i_op0[0]) = 0xe4423f7b769f8ffe; + *((unsigned long*)& __m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long*)& __m128i_op1[0]) = 0x0000000000000000; + *((unsigned long*)& __m128i_result[1]) = 0x33f5c2d7d975d7fe; + *((unsigned long*)& __m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vorn_v(__m128i_op0,__m128i_op1); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0x00050eb00000fffa; + *((unsigned long*)& __m128i_op0[0]) = 0x0000f8a50000f310; + *((unsigned long*)& __m128i_op1[1]) = 0x0000000000000000; + *((unsigned long*)& __m128i_op1[0]) = 0x0000000000000000; + *((unsigned long*)& __m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long*)& __m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vorn_v(__m128i_op0,__m128i_op1); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0x00bbfff7fffffff7; + *((unsigned long*)& __m128i_op0[0]) = 0xffffffff008ff820; + *((unsigned long*)& __m128i_op1[1]) = 0x0001000100010012; + *((unsigned long*)& __m128i_op1[0]) = 0x00000000ffe1ffc0; + *((unsigned long*)& __m128i_result[1]) = 0xffffffffffffffff; + *((unsigned long*)& __m128i_result[0]) = 0xffffffff009ff83f; + __m128i_out = __lsx_vorn_v(__m128i_op0,__m128i_op1); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vxor.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vxor.c new file mode 100644 index 00000000000..72fa9717489 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vxor.c @@ -0,0 +1,79 @@ +/* { 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]) = 0x0000000000000000; + *((unsigned long*)& __m128i_op1[0]) = 0x00000000f4012ceb; + *((unsigned long*)& __m128i_result[1]) = 0x0000000000000000; + *((unsigned long*)& __m128i_result[0]) = 0x00000000f4012ceb; + __m128i_out = __lsx_vxor_v(__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]) = 0xffffffffffffffff; + *((unsigned long*)& __m128i_result[0]) = 0xffffffffffffffff; + __m128i_out = __lsx_vxor_v(__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_vxor_v(__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]) = 0x0000000000000001; + *((unsigned long*)& __m128i_op1[0]) = 0x0000000000000000; + *((unsigned long*)& __m128i_result[1]) = 0x3ff0000000000001; + *((unsigned long*)& __m128i_result[0]) = 0x40f3fa0000000000; + __m128i_out = __lsx_vxor_v(__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]) = 0x0000000080000068; + *((unsigned long*)& __m128i_result[1]) = 0x0000000000000000; + *((unsigned long*)& __m128i_result[0]) = 0x0000000080000068; + __m128i_out = __lsx_vxor_v(__m128i_op0,__m128i_op1); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0x00000000ffff53d9; + *((unsigned long*)& __m128i_op0[0]) = 0xff000001ffff9515; + *((unsigned long*)& __m128i_op1[1]) = 0xffffffffffffffff; + *((unsigned long*)& __m128i_op1[0]) = 0xffff0001ffff9514; + *((unsigned long*)& __m128i_result[1]) = 0xffffffff0000ac26; + *((unsigned long*)& __m128i_result[0]) = 0x00ff000000000001; + __m128i_out = __lsx_vxor_v(__m128i_op0,__m128i_op1); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + return 0; +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vxori.c b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vxori.c new file mode 100644 index 00000000000..cc823d4ba2e --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vxori.c @@ -0,0 +1,67 @@ +/* { 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_result[1]) = 0x0404040404040404; + *((unsigned long*)& __m128i_result[0]) = 0x0404040404040404; + __m128i_out = __lsx_vxori_b(__m128i_op0,0x4); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0x0000000001000100; + *((unsigned long*)& __m128i_op0[0]) = 0x0000000001000100; + *((unsigned long*)& __m128i_result[1]) = 0x5a5a5a5a5b5a5b5a; + *((unsigned long*)& __m128i_result[0]) = 0x5a5a5a5a5b5a5b5a; + __m128i_out = __lsx_vxori_b(__m128i_op0,0x5a); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0x0000000000000000; + *((unsigned long*)& __m128i_op0[0]) = 0x0000000000000000; + *((unsigned long*)& __m128i_result[1]) = 0xe3e3e3e3e3e3e3e3; + *((unsigned long*)& __m128i_result[0]) = 0xe3e3e3e3e3e3e3e3; + __m128i_out = __lsx_vxori_b(__m128i_op0,0xe3); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0x0000000000000000; + *((unsigned long*)& __m128i_op0[0]) = 0x0020002000200020; + *((unsigned long*)& __m128i_result[1]) = 0x9a9a9a9a9a9a9a9a; + *((unsigned long*)& __m128i_result[0]) = 0x9aba9aba9aba9aba; + __m128i_out = __lsx_vxori_b(__m128i_op0,0x9a); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0x0000000000000000; + *((unsigned long*)& __m128i_op0[0]) = 0x0000000000000000; + *((unsigned long*)& __m128i_result[1]) = 0x9090909090909090; + *((unsigned long*)& __m128i_result[0]) = 0x9090909090909090; + __m128i_out = __lsx_vxori_b(__m128i_op0,0x90); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + *((unsigned long*)& __m128i_op0[1]) = 0x00000000b81c8382; + *((unsigned long*)& __m128i_op0[0]) = 0x0000000077af9450; + *((unsigned long*)& __m128i_result[1]) = 0xf1f1f1f149ed7273; + *((unsigned long*)& __m128i_result[0]) = 0xf1f1f1f1865e65a1; + __m128i_out = __lsx_vxori_b(__m128i_op0,0xf1); + ASSERTEQ_64(__LINE__, __m128i_result, __m128i_out); + + + return 0; +}