From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 101996 invoked by alias); 3 Aug 2015 08:31:30 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 101986 invoked by uid 89); 3 Aug 2015 08:31:30 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-oi0-f54.google.com Received: from mail-oi0-f54.google.com (HELO mail-oi0-f54.google.com) (209.85.218.54) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Mon, 03 Aug 2015 08:31:20 +0000 Received: by oig1 with SMTP id 1so32916831oig.0 for ; Mon, 03 Aug 2015 01:31:18 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.202.183.84 with SMTP id h81mr14370645oif.43.1438590677973; Mon, 03 Aug 2015 01:31:17 -0700 (PDT) Received: by 10.60.58.41 with HTTP; Mon, 3 Aug 2015 01:31:17 -0700 (PDT) In-Reply-To: <20150730184107.GA4325@intel.com> References: <20150721214539.GA19891@intel.com> <20150730184107.GA4325@intel.com> Date: Mon, 03 Aug 2015 08:31:00 -0000 Message-ID: Subject: Re: [PATCH] Add __builtin_stack_top to x86 backend From: Uros Bizjak To: "H.J. Lu" Cc: "gcc-patches@gcc.gnu.org" , Segher Boessenkool Content-Type: text/plain; charset=UTF-8 X-SW-Source: 2015-08/txt/msg00027.txt.bz2 On Thu, Jul 30, 2015 at 8:41 PM, H.J. Lu wrote: > On Tue, Jul 21, 2015 at 02:45:39PM -0700, H.J. Lu wrote: >> When __builtin_frame_address is used to retrieve the address of the >> function stack frame, the frame pointer is always kept, which wastes one >> register and 2 instructions. For x86-32, one less register means >> significant negative impact on performance. This patch adds a new >> builtin function, __builtin_ia32_stack_top, to x86 backend. It >> returns the stack address when the function is called. >> >> Any comments, feedbacks? >> > > Although this function is generic, but implementation is target > specific. I submitted a generic patch: > > https://gcc.gnu.org/ml/gcc-patches/2015-07/msg01859.html > > So far there are no interests from other backends. Here is a patch > to implement __builtin_stack_top in x86 backend. We can update x86 > backedn after it is added to middle-end. OK for trunk? I think that the discussion about generic implementation should come to some conclusion first. From the discussion, here was no resolution on which way to go. Uros.