From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16755 invoked by alias); 15 Aug 2012 13:48:50 -0000 Received: (qmail 16732 invoked by uid 22791); 15 Aug 2012 13:48:46 -0000 X-SWARE-Spam-Status: No, hits=-4.3 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,KHOP_THREADED,TW_OV X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 15 Aug 2012 13:48:32 +0000 From: "gary at intrepid dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/20020] x86_64 - 128 bit structs not targeted to TImode Date: Wed, 15 Aug 2012 13:48:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Keywords: ABI, missed-optimization X-Bugzilla-Severity: enhancement X-Bugzilla-Who: gary at intrepid dot com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2012-08/txt/msg00957.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20020 --- Comment #41 from Gary Funck 2012-08-15 13:47:37 UTC --- (In reply to comment #38) > What are the code generation deficiencies you are targeting with this? For > testcase #1 I get > > sptr_result: > .LFB0: > .cfi_startproc > movq S+8(%rip), %rdx > movq S(%rip), %rax > ret > > what would you expect instead? > > I don't think we should change MAX_FIXED_MODE_SIZE, nor make use of > TImode unconditionally. All three test cases were designed simply to make them easy to check via an RTL scan for the presence/use of TImode. I chose three arbitrary small test cases with the only criteria that they used the struct's differently. As far as the motivation for suggesting the change, I noted that several other targets assign 128-bit struct's into TImode values. Therefore, I assumed that there must be some benefit, and that this was an oversight in the x86_64 implementation. In the GUPC implementation of the UPC programming language, a pointer into shared space has three components (virtual-offset,thread,phase). This pointer-to-shared (PTS) can be represented in a "packed" mode, where it uses 64 bits, but gives up some range for each of the fields. The more general form is the "struct" representation which provides full range for the fields and is 128-bits -- as the name implies, the underlying PTS representation manipulated by the compiler is a struct. Note that the packed representation could be a struct also (with bit fields), but back when this project was started code generation for structs and bit-fields wasn't very good; the code quality was better if the compiler hand-crafted the necessary bit field manipulations. Since UPC programs use PTS's frequently, we found that targeting them to TImode containers improved various micro-benchmarks. We noted that other targets like MIPS and PPC did this and assumed it would be a good idea for x86_64 to follow suit. We don't have any hard data on the level of performance improvement, though as Chip noted, some modest space savings were gained in libstdc++. I can re-run some UPC tests, if that helps, but they have a rather specific usage pattern. Maybe something like the SPEC benchmarks would be more compelling, but I don't have access to them.