From patchwork Tue Apr 4 05:22:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Kewen.Lin" X-Patchwork-Id: 78851 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp2786416vqo; Mon, 3 Apr 2023 22:23:16 -0700 (PDT) X-Google-Smtp-Source: AKy350bnzZXAYpoSro6NB4xCGIwoT3vWA9hcNjyOD3jBUAoxp0uYSFgZEnLdK0Yty3jUSCEu8buy X-Received: by 2002:a17:907:80c9:b0:93f:fbe:c388 with SMTP id io9-20020a17090780c900b0093f0fbec388mr1060181ejc.27.1680585796183; Mon, 03 Apr 2023 22:23:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680585796; cv=none; d=google.com; s=arc-20160816; b=al9piXVApVij5dVAJaF/Yq9RSZxd/vZPBjepH/FDRLCWBw6sQMK9J8TIi3PohcxABZ ZV2g11k5+iGRwCl133vMMK0o+Ne17da/5ta42OiuOdVhOjC3PXc9SV3PlQCjxFwTAdP3 oT3h5GWidkFHXKVAWqs8xP2nLv6LKMONPZjtGqIUmPM6DZuJZWVL6+lpQRQZSWYVFbQQ 9Q/VxUYT2w3kkOcgRsbMxqmu1AMaEDjXFfKg9py3DoxpCgKPXwWFhta0eTyroV8cLHVg Z75HjhmafbS16OoC7EphDSprQxn+oKANL2HZSWhmLvMKcMOxGbYqUa7aCK6H4YgfuqzD /GGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:subject:cc:to:content-language:user-agent :mime-version:date:message-id:dmarc-filter:delivered-to :dkim-signature:dkim-filter; bh=e6QqigWA6B+q7TLCnz2lI2uTHFcz9n6UV3Q6s94saso=; b=j3E91ijOfO3f2voiD68dfolXbniNVCRh6qke1Gfil8GT78dkVXEziRn8o/lbv+AJXz pyTHtP90NtSuo00IpLf2eFuzxosYGAKtQzUej3f3ozkA65AE1Z+Kycj7M1QvWhzClyev lQHXahGeswBYU7AkU4uvTOHWYPPrKDtAcMNCdbmh/lF+R9k/MqX8bmkxwl7rMa9oTNN8 CUUHNWQWba2N8oqlJAcCFQcqZimPdB2ytnas2pchG2mWDgfwoV21eLVODIa2r9qk/5Fm 17H5Fqz//XugxlYlCQROwbGzQEg+9+kTMLZuMO3v4jeubbNk3RZElohaEZevnIR3wriI iQgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=b3HnQ+La; 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"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id t6-20020a1709066bc600b009477edafcb1si133759ejs.882.2023.04.03.22.23.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Apr 2023 22:23:16 -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; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=b3HnQ+La; 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"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 1F5903858C3A for ; Tue, 4 Apr 2023 05:23:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1F5903858C3A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1680585795; bh=e6QqigWA6B+q7TLCnz2lI2uTHFcz9n6UV3Q6s94saso=; h=Date:To:Cc:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=b3HnQ+Labite2Dz5zwHwwgcgL50YpW1vBKeLZ68b9KNWtmjyDq9ETOZDbJdLLvkpU fw8chNw3+ukXUrbC8jLDWZSG+Ll6UDnxgGXXc+akMQO2okNtojAwnNwo6jO/mt+wst kXhFpeTxZJVWqIf8gfPJ3V8MFAhBOLQbFQA3BZJU= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by sourceware.org (Postfix) with ESMTPS id 0CCC83858D1E for ; Tue, 4 Apr 2023 05:22:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0CCC83858D1E Received: from pps.filterd (m0098421.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3344Z6VA007587; Tue, 4 Apr 2023 05:22:30 GMT Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3pr3grwgq6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 04 Apr 2023 05:22:30 +0000 Received: from m0098421.ppops.net (m0098421.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 3345FagX002884; Tue, 4 Apr 2023 05:22:30 GMT Received: from ppma06ams.nl.ibm.com (66.31.33a9.ip4.static.sl-reverse.com [169.51.49.102]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3pr3grwgpu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 04 Apr 2023 05:22:29 +0000 Received: from pps.filterd (ppma06ams.nl.ibm.com [127.0.0.1]) by ppma06ams.nl.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 333MJmen020344; Tue, 4 Apr 2023 05:22:28 GMT Received: from smtprelay07.fra02v.mail.ibm.com ([9.218.2.229]) by ppma06ams.nl.ibm.com (PPS) with ESMTPS id 3ppbvg28bj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 04 Apr 2023 05:22:27 +0000 Received: from smtpav04.fra02v.mail.ibm.com (smtpav04.fra02v.mail.ibm.com [10.20.54.103]) by smtprelay07.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 3345MPnT26608348 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 4 Apr 2023 05:22:25 GMT Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 37D8220043; Tue, 4 Apr 2023 05:22:25 +0000 (GMT) Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C9A0120040; Tue, 4 Apr 2023 05:22:23 +0000 (GMT) Received: from [9.43.232.112] (unknown [9.43.232.112]) by smtpav04.fra02v.mail.ibm.com (Postfix) with ESMTP; Tue, 4 Apr 2023 05:22:23 +0000 (GMT) Message-ID: Date: Tue, 4 Apr 2023 13:22:22 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.6.1 Content-Language: en-US To: GCC Patches Cc: Segher Boessenkool , David Edelsohn , Peter Bergner Subject: [PATCH] testsuite: Adjust powerpc test case pr83677.c for BE [PR108815] X-TM-AS-GCONF: 00 X-Proofpoint-GUID: S8i_tkxODQONU7jgNy1E5fcBma1xF4x1 X-Proofpoint-ORIG-GUID: -GX32-F2PcS1CxbV-iI_s_oAycsZVN7E X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-04-03_19,2023-04-03_03,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 clxscore=1015 spamscore=0 bulkscore=0 phishscore=0 priorityscore=1501 malwarescore=0 impostorscore=0 mlxlogscore=999 lowpriorityscore=0 adultscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2304040046 X-Spam-Status: No, score=-11.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_MSPIKE_H2, 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.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: "Kewen.Lin via Gcc-patches" From: "Kewen.Lin" Reply-To: "Kewen.Lin" Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1762221932137625548?= X-GMAIL-MSGID: =?utf-8?q?1762221932137625548?= Hi, The test case gcc.target/powerpc/pr83677.c was written for LE environment, this patch is to make it work on BE as well. Tested on BE and LE well, I'm going to push this soon if no objections. BR, Kewen ----- PR testsuite/108815 gcc/testsuite/ChangeLog: * gcc.target/powerpc/pr83677.c (v_expand_u8, v_expand_u16, v_load_deinterleave_f32, v_store_interleave_f32): Adjust some code by considering BE. --- gcc/testsuite/gcc.target/powerpc/pr83677.c | 30 +++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) -- 2.39.1 diff --git a/gcc/testsuite/gcc.target/powerpc/pr83677.c b/gcc/testsuite/gcc.target/powerpc/pr83677.c index c1a09687174..8b1caff3f98 100644 --- a/gcc/testsuite/gcc.target/powerpc/pr83677.c +++ b/gcc/testsuite/gcc.target/powerpc/pr83677.c @@ -9,14 +9,24 @@ void v_expand_u8(vector unsigned char* a, vector unsigned short* b0, vector unsigned short* b1) { +#if __LITTLE_ENDIAN__ *b0 = (vector unsigned short)vec_mergeh(*a, vec_splats((unsigned char)0)); *b1 = (vector unsigned short)vec_mergel(*a, vec_splats((unsigned char)0)); +#else + *b0 = (vector unsigned short)vec_mergeh(vec_splats((unsigned char)0), *a); + *b1 = (vector unsigned short)vec_mergel(vec_splats((unsigned char)0), *a); +#endif } void v_expand_u16(vector unsigned short* a, vector unsigned int* b0, vector unsigned int* b1) { +#if __LITTLE_ENDIAN__ *b0 = (vector unsigned int)vec_mergeh(*a, vec_splats((unsigned short)0)); *b1 = (vector unsigned int)vec_mergel(*a, vec_splats((unsigned short)0)); +#else + *b0 = (vector unsigned int)vec_mergeh(vec_splats((unsigned short)0), *a); + *b1 = (vector unsigned int)vec_mergel(vec_splats((unsigned short)0), *a); +#endif } void v_load_deinterleave_u8(unsigned char *ptr, vector unsigned char* a, vector unsigned char* b, vector unsigned char* c) @@ -44,13 +54,23 @@ void v_load_deinterleave_f32(float *ptr, vector float* a, vector float* b, vecto vector float v2 = vec_xl(16, ptr); vector float v3 = vec_xl(32, ptr); +#if __LITTLE_ENDIAN__ + vector float t1 = vec_sld(v3, v2, 8); + vector float t2 = vec_sld(v1, v3, 8); + vector float t3 = vec_sld(v2, v1, 8); +#else + vector float t1 = vec_sld(v2, v3, 8); + vector float t2 = vec_sld(v3, v1, 8); + vector float t3 = vec_sld(v1, v2, 8); +#endif + static const vector unsigned char flp = {0, 1, 2, 3, 12, 13, 14, 15, 16, 17, 18, 19, 28, 29, 30, 31}; - *a = vec_perm(v1, vec_sld(v3, v2, 8), flp); + *a = vec_perm(v1, t1, flp); static const vector unsigned char flp2 = {28, 29, 30, 31, 0, 1, 2, 3, 12, 13, 14, 15, 16, 17, 18, 19}; - *b = vec_perm(v2, vec_sld(v1, v3, 8), flp2); + *b = vec_perm(v2, t2, flp2); - *c = vec_perm(vec_sld(v2, v1, 8), v3, flp); + *c = vec_perm(t3, v3, flp); } void v_store_interleave_f32(float *ptr, vector float a, vector float b, vector float c) @@ -61,7 +81,11 @@ void v_store_interleave_f32(float *ptr, vector float a, vector float b, vector f vec_xst(vec_perm(a, hbc, ahbc), 0, ptr); vector float lab = vec_mergel(a, b); +#if __LITTLE_ENDIAN__ vec_xst(vec_sld(lab, hbc, 8), 16, ptr); +#else + vec_xst(vec_sld(hbc, lab, 8), 16, ptr); +#endif static const vector unsigned char clab = {8, 9, 10, 11, 24, 25, 26, 27, 28, 29, 30, 31, 12, 13, 14, 15}; vec_xst(vec_perm(c, lab, clab), 32, ptr);