From patchwork Fri May 17 02:40:23 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Schmidt X-Patchwork-Id: 244463 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 CN "localhost", Issuer "www.qmailtoaster.com" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 0F93E2C00A5 for ; Fri, 17 May 2013 12:40:40 +1000 (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=NCR 5+2FoUm83ikZ6a5NqFHEoHB9tA9/jxblY+QSP7ciyRDeAdTH6QQfQ0MMBgA3uNK2 TiFY6wgzMl7cmMMXvStV8RYKvikgmBf7WXp7BxSkNAGVXtiBK6basHmmApABMf9m CSaGEvQGoI+a59snTWEmD2M2tocpdj8RF+WWpM00= 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=URNuyywhZ pCeDT2wtVgLJz6xtzI=; b=NpIoWknGSRMkswuZPLr7akryoBmWnUkb34pER6Di/ naaxr3NaUpr4I8trd4oMPRjeAUcOOoVbuRZtMW7EABxL3eXmbYbxxH0+XSSz8xh+ CG0Ss0ZsGeaciM1+f3OK5mAy4E/W7qolj82/9jCQ35JZ4gjAmKxiKAVw01AyIBj/ 7w= Received: (qmail 16352 invoked by alias); 17 May 2013 02:40:33 -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 16318 invoked by uid 89); 17 May 2013 02:40:27 -0000 X-Spam-SWARE-Status: No, score=-4.9 required=5.0 tests=AWL, BAYES_00, KHOP_RCVD_UNTRUST, MAY_BE_FORGED, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD autolearn=ham version=3.3.1 Received: from e28smtp08.in.ibm.com (HELO e28smtp08.in.ibm.com) (122.248.162.8) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Fri, 17 May 2013 02:40:27 +0000 Received: from /spool/local by e28smtp08.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 17 May 2013 08:03:22 +0530 Received: from d28dlp01.in.ibm.com (9.184.220.126) by e28smtp08.in.ibm.com (192.168.1.138) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 17 May 2013 08:03:21 +0530 Received: from d28relay04.in.ibm.com (d28relay04.in.ibm.com [9.184.220.61]) by d28dlp01.in.ibm.com (Postfix) with ESMTP id 102E8E004F for ; Fri, 17 May 2013 08:12:48 +0530 (IST) Received: from d28av03.in.ibm.com (d28av03.in.ibm.com [9.184.220.65]) by d28relay04.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r4H2eEwx64749710 for ; Fri, 17 May 2013 08:10:15 +0530 Received: from d28av03.in.ibm.com (loopback [127.0.0.1]) by d28av03.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r4H2eJmp027335 for ; Fri, 17 May 2013 12:40:20 +1000 Received: from [9.50.22.106] (dyn9050022106.mts.ibm.com [9.50.22.106] (may be forged)) by d28av03.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id r4H2eHdw027202; Fri, 17 May 2013 12:40:18 +1000 Message-ID: <1368758423.3482.88.camel@gnopaine> Subject: [PATCH, rs6000] Increase MALLOC_ABI_ALIGNMENT for 32-bit PowerPC From: Bill Schmidt To: gcc-patches@gcc.gnu.org Cc: dje.gcc@gmail.com Date: Thu, 16 May 2013 21:40:23 -0500 Mime-Version: 1.0 X-TM-AS-MML: No X-Content-Scanned: Fidelis XPS MAILER x-cbid: 13051702-2000-0000-0000-00000C25D51F This removes two degradations in CPU2006 for 32-bit PowerPC due to lost vectorization opportunities. Previously, GCC treated malloc'd arrays as only guaranteeing 4-byte alignment, even though the glibc implementation guarantees 8-byte alignment. This raises the guarantee to 8 bytes, which is sufficient to permit the missed vectorization opportunities. The guarantee for 64-bit PowerPC should be raised to 16-byte alignment, but doing so currently exposes a latent bug that degrades a 64-bit benchmark. I have therefore not included that change at this time, but added a FIXME recording the information. Bootstrapped and tested on powerpc64-unknown-linux-gnu with no new regressions. Verified that SPEC CPU2006 degradations are fixed with no new degradations. Ok for trunk? Also, do you want any backports? Thanks, Bill 2013-05-16 Bill Schmidt * config/rs6000/rs6000.h (MALLOC_ABI_ALIGNMENT): New #define. Index: gcc/config/rs6000/rs6000.h =================================================================== --- gcc/config/rs6000/rs6000.h (revision 198998) +++ gcc/config/rs6000/rs6000.h (working copy) @@ -2297,6 +2297,13 @@ extern char rs6000_reg_names[][8]; /* register nam /* How to align the given loop. */ #define LOOP_ALIGN(LABEL) rs6000_loop_align(LABEL) +/* Alignment guaranteed by __builtin_malloc. */ +/* FIXME: 128-bit alignment is guaranteed by glibc for TARGET_64BIT. + However, specifying the stronger guarantee currently leads to + a regression in SPEC CPU2006 437.leslie3d. The stronger + guarantee should be implemented here once that's fixed. */ +#define MALLOC_ABI_ALIGNMENT (64) + /* Pick up the return address upon entry to a procedure. Used for dwarf2 unwind information. This also enables the table driven mechanism. */