From patchwork Tue Aug 14 21:34:26 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gary Funck X-Patchwork-Id: 177460 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]) by ozlabs.org (Postfix) with SMTP id 4381C2C0085 for ; Wed, 15 Aug 2012 07:34:49 +1000 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1345584890; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:Date:From:To:Cc:Subject:Message-ID:References: MIME-Version:Content-Type:Content-Disposition:In-Reply-To: User-Agent:Mailing-List:Precedence:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:Sender:Delivered-To; bh=74f71Cw +Sf8vD0zxtp4s/YfiwCc=; b=LZ2vxydglxuH2eM1m+RYZzOt/wPKYRDBfWOM/Ci 2g3gfPE2MbbQG8VB4D7FxFbcE6L2BRV0hJYmzJNlWBmzKQ4g/HsWxZm9PKd0GSoX hva/HVdN8aocVjpKgqU4CpXCFJX0D6JHkC4ZJv2WAkzQuMBJbc6iPJOoBqxAN9Op yh1E= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received:Received:Date:From:To:Cc:Subject:Message-ID:References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To:User-Agent:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=lBSQHJ5hyEFT4Gs42apTCdNMoX9ispx9YZcVSHOV+/LdllXYHtBUWe9YELULoD m3ELWM79MtHPPjPGr8U65VoV2MpAZhw0/46QZjmQG9TyTDkk+kLBz7UqKK6i2PBJ uUJzhTwB8RhGZN/6KM+ONzNg6vQgT7qC8VDwYXxdIjGs0=; Received: (qmail 28733 invoked by alias); 14 Aug 2012 21:34:45 -0000 Received: (qmail 28436 invoked by uid 22791); 14 Aug 2012 21:34:43 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL, BAYES_00, TW_ZJ, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from ns.intrepid.com (HELO mail.intrepid.com) (74.95.8.113) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 14 Aug 2012 21:34:29 +0000 Received: from screamer.local (screamer.local [10.10.1.2]) by mail.intrepid.com (8.14.5/8.14.5) with ESMTP id q7ELYPDd012649 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 14 Aug 2012 14:34:25 -0700 Received: from screamer.local (screamer.local [127.0.0.1]) by screamer.local (8.14.4/8.14.4) with ESMTP id q7ELYRtG030181; Tue, 14 Aug 2012 14:34:27 -0700 Received: (from gary@localhost) by screamer.local (8.14.4/8.14.4/Submit) id q7ELYQJf030180; Tue, 14 Aug 2012 14:34:26 -0700 Date: Tue, 14 Aug 2012 14:34:26 -0700 From: Gary Funck To: "H.J. Lu" Cc: "Joseph S. Myers" , Jakub Jelinek , Gcc Patches , jh@suse.cz Subject: Re: PATCH [x86_64] PR20020 - 128 bit structs not targeted to TImode Message-ID: <20120814213426.GA28966@intrepid.com> References: <20120814042032.GB23649@intrepid.com> <20120814063059.GU1999@tucnak.redhat.com> <20120814161238.GH23649@intrepid.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes 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 Attached, is an updated patch (with change logs). The test cases are now in gcc.target/i386 and the target selection is "dg-require-effective-target int128" only. Verified that the tests correctly detect the presence/lack of TImode support. - Gary Index: gcc/config/i386/i386.h =================================================================== --- gcc/config/i386/i386.h (revision 190398) +++ gcc/config/i386/i386.h (working copy) @@ -1816,6 +1816,10 @@ do { \ #define BRANCH_COST(speed_p, predictable_p) \ (!(speed_p) ? 2 : (predictable_p) ? 0 : ix86_branch_cost) +/* An integer expression for the size in bits of the largest integer machine + mode that should actually be used. We allow pairs of registers. */ +#define MAX_FIXED_MODE_SIZE GET_MODE_BITSIZE (TARGET_64BIT ? TImode : DImode) + /* Define this macro as a C expression which is nonzero if accessing less than a word of memory (i.e. a `char' or a `short') is no faster than accessing a word of memory, i.e., if such access Index: gcc/ChangeLog =================================================================== --- gcc/ChangeLog (revision 190398) +++ gcc/ChangeLog (working copy) @@ -1,3 +1,10 @@ +2012-08-14 Gary Funck + + PR target/20020 + * config/i386/i386.h (MAX_FIXED_MODE_SIZE): Allow use of TImode + for use with appropriately sized structures and unions + on 64-bit (x86) targets. + 2012-08-14 Uros Bizjak * config/i386/i386.md (enabled): Add comment with explanation Index: gcc/testsuite/gcc.target/i386/pr20020-1.c =================================================================== --- gcc/testsuite/gcc.target/i386/pr20020-1.c (revision 0) +++ gcc/testsuite/gcc.target/i386/pr20020-1.c (revision 0) @@ -0,0 +1,23 @@ +/* Check that 128-bit struct's are represented as TImode values. */ +/* { dg-require-effective-target int128 } */ +/* { dg-do compile } */ +/* { dg-options "-O2 -fdump-rtl-expand" } */ + +struct shared_ptr_struct +{ + unsigned long long phase:48; + unsigned short thread:16; + void *addr; +}; +typedef struct shared_ptr_struct sptr_t; + +sptr_t S; + +sptr_t +sptr_result (void) +{ + return S; +} +/* { dg-final { scan-rtl-dump "\\\(set \\\(reg:TI \[0-9\]* \\\[ \\\]\\\)" "expand" } } */ +/* { dg-final { scan-rtl-dump "\\\(set \\\(reg/i:TI 0 ax\\\)" "expand" } } */ +/* { dg-final { cleanup-rtl-dump "expand" } } */ Index: gcc/testsuite/gcc.target/i386/pr20020-2.c =================================================================== --- gcc/testsuite/gcc.target/i386/pr20020-2.c (revision 0) +++ gcc/testsuite/gcc.target/i386/pr20020-2.c (revision 0) @@ -0,0 +1,21 @@ +/* Check that 128-bit struct's are represented as TImode values. */ +/* { dg-require-effective-target int128 } */ +/* { dg-do compile } */ +/* { dg-options "-O2 -fdump-rtl-expand" } */ + +struct shared_ptr_struct +{ + unsigned long long phase:48; + unsigned short thread:16; + void *addr; +}; +typedef struct shared_ptr_struct sptr_t; + +void +copy_sptr (sptr_t *dest, sptr_t src) +{ + *dest = src; +} + +/* { dg-final { scan-rtl-dump "\\\(set \\\(reg:TI \[0-9\]*" "expand" } } */ +/* { dg-final { cleanup-rtl-dump "expand" } } */ Index: gcc/testsuite/gcc.target/i386/pr20020-3.c =================================================================== --- gcc/testsuite/gcc.target/i386/pr20020-3.c (revision 0) +++ gcc/testsuite/gcc.target/i386/pr20020-3.c (revision 0) @@ -0,0 +1,24 @@ +/* Check that 128-bit struct's are represented as TImode values. */ +/* { dg-require-effective-target int128 } */ +/* { dg-do compile } */ +/* { dg-options "-O2 -fdump-rtl-expand" } */ + +struct shared_ptr_struct +{ + unsigned long long phase:48; + unsigned short thread:16; + void *addr; +}; +typedef struct shared_ptr_struct sptr_t; + +sptr_t sptr_1, sptr_2; + +void +copy_sptr (void) +{ + sptr_1 = sptr_2; +} + +/* { dg-final { scan-rtl-dump "\\\(set \\\(reg:TI \[0-9\]*" "expand" } } */ +/* { dg-final { scan-rtl-dump "\\\(set \\\(mem/c:TI" "expand" } } */ +/* { dg-final { cleanup-rtl-dump "expand" } } */ Index: gcc/testsuite/ChangeLog =================================================================== --- gcc/testsuite/ChangeLog (revision 190398) +++ gcc/testsuite/ChangeLog (working copy) @@ -1,3 +1,10 @@ +2012-08-14 Gary Funck + + PR target/20020 + * gcc.target/i386/pr20020-1.c: New. + * gcc.target/i386/pr20020-2.c: New. + * gcc.target/i386/pr20020-3.c: New. + 2012-08-14 Oleg Endo PR target/52933