From patchwork Mon Oct 28 19:17:29 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Schmidt X-Patchwork-Id: 286635 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 49ACA2C00CD for ; Tue, 29 Oct 2013 06:17:24 +1100 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:subject:from:to:cc:date:content-type :content-transfer-encoding:mime-version; q=dns; s=default; b=Nwd tRVn2UKSl9H4v9dUHUqXbuoT5488IfZARCkfvyBl9xjnQ3yxXKuMBq95HeM9W7V9 Qf4pT6phlwvzGqRNQZTFP25Sgnw1QviCDU7XrOvi/Ucq6Zt/RV77/iuHcXFiEM7h lN6tQ91MwHpQCmOazUruxu8zC3C4Q7gCZUNQHxYc= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:subject:from:to:cc:date:content-type :content-transfer-encoding:mime-version; s=default; bh=OZLUCIf8v ZBhjiKcNmlTbJZS4gg=; b=iNhY0aQKiwhisxzrVql23kjhp0TW5H5HltpyCirsV Vw+RkBv7ZTbYtLoc/MKmQiwcRctXf4kw/NcP5SQTbAUISPXrBChEswumLoBgiC4k eoK1l99Ux821FJY5TXnZCgcsO8rfTvT0iQAC1VSregpmrXCgecq0lDtxOztYsTdw cE= Received: (qmail 2026 invoked by alias); 28 Oct 2013 19:17:16 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 2008 invoked by uid 89); 28 Oct 2013 19:17:14 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-4.3 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: e28smtp07.in.ibm.com Received: from e28smtp07.in.ibm.com (HELO e28smtp07.in.ibm.com) (122.248.162.7) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Mon, 28 Oct 2013 19:17:13 +0000 Received: from /spool/local by e28smtp07.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 29 Oct 2013 00:47:07 +0530 Received: from d28dlp03.in.ibm.com (9.184.220.128) by e28smtp07.in.ibm.com (192.168.1.137) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 29 Oct 2013 00:47:05 +0530 Received: from d28relay02.in.ibm.com (d28relay02.in.ibm.com [9.184.220.59]) by d28dlp03.in.ibm.com (Postfix) with ESMTP id CB5AB1258051 for ; Tue, 29 Oct 2013 00:47:41 +0530 (IST) Received: from d28av03.in.ibm.com (d28av03.in.ibm.com [9.184.220.65]) by d28relay02.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r9SJH1t639387234 for ; Tue, 29 Oct 2013 00:47:01 +0530 Received: from d28av03.in.ibm.com (localhost [127.0.0.1]) by d28av03.in.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id r9SJH34T002886 for ; Tue, 29 Oct 2013 00:47:03 +0530 Received: from [9.49.145.112] (sig-9-49-145-112.mts.ibm.com [9.49.145.112]) by d28av03.in.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id r9SJH15t002808; Tue, 29 Oct 2013 00:47:02 +0530 Message-ID: <1382987849.6275.184.camel@gnopaine> Subject: [PATCH, testsuite/rs6000] Adjust two VMX tests for little endian From: Bill Schmidt To: gcc-patches@gcc.gnu.org Cc: dje.gcc@gmail.com Date: Mon, 28 Oct 2013 14:17:29 -0500 Mime-Version: 1.0 X-TM-AS-MML: No X-Content-Scanned: Fidelis XPS MAILER x-cbid: 13102819-8878-0000-0000-0000097685A9 X-IsSubscribed: yes Hi, These two test cases require source changes when compiled on a little endian target. Verified on powerpc64{,le}-unknown-linux-gnu. Ok to commit? Thanks, Bill 2013-10-28 Bill Schmidt * gcc.dg/vmx/gcc-bug-i.c: Add little endian variant. * gcc.dg/vmx/eg-5.c: Likewise. Index: gcc/testsuite/gcc.dg/vmx/gcc-bug-i.c =================================================================== --- gcc/testsuite/gcc.dg/vmx/gcc-bug-i.c (revision 203979) +++ gcc/testsuite/gcc.dg/vmx/gcc-bug-i.c (working copy) @@ -13,12 +13,27 @@ #define DO_INLINE __attribute__ ((always_inline)) #define DONT_INLINE __attribute__ ((noinline)) +#ifdef __LITTLE_ENDIAN__ +static inline DO_INLINE int inline_me(vector signed short data) +{ + union {vector signed short v; signed short s[8];} u; + signed short x; + unsigned char x1, x2; + + u.v = data; + x = u.s[7]; + x1 = (x >> 8) & 0xff; + x2 = x & 0xff; + return ((x2 << 8) | x1); +} +#else static inline DO_INLINE int inline_me(vector signed short data) { union {vector signed short v; signed short s[8];} u; u.v = data; return u.s[7]; } +#endif static DONT_INLINE int foo(vector signed short data) { Index: gcc/testsuite/gcc.dg/vmx/eg-5.c =================================================================== --- gcc/testsuite/gcc.dg/vmx/eg-5.c (revision 203979) +++ gcc/testsuite/gcc.dg/vmx/eg-5.c (working copy) @@ -7,10 +7,17 @@ matvecmul4 (vector float c0, vector float c1, vect /* Set result to a vector of f32 0's */ vector float result = ((vector float){0.,0.,0.,0.}); +#ifdef __LITTLE_ENDIAN__ + result = vec_madd (c0, vec_splat (v, 3), result); + result = vec_madd (c1, vec_splat (v, 2), result); + result = vec_madd (c2, vec_splat (v, 1), result); + result = vec_madd (c3, vec_splat (v, 0), result); +#else result = vec_madd (c0, vec_splat (v, 0), result); result = vec_madd (c1, vec_splat (v, 1), result); result = vec_madd (c2, vec_splat (v, 2), result); result = vec_madd (c3, vec_splat (v, 3), result); +#endif return result; }