From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 122097 invoked by alias); 12 Nov 2015 22:03:57 -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 122080 invoked by uid 89); 12 Nov 2015 22:03:56 -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-ob0-f181.google.com Received: from mail-ob0-f181.google.com (HELO mail-ob0-f181.google.com) (209.85.214.181) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Thu, 12 Nov 2015 22:03:55 +0000 Received: by obdgf3 with SMTP id gf3so59017090obd.3 for ; Thu, 12 Nov 2015 14:03:53 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.182.108.229 with SMTP id hn5mr10954949obb.75.1447365833828; Thu, 12 Nov 2015 14:03:53 -0800 (PST) Received: by 10.60.138.6 with HTTP; Thu, 12 Nov 2015 14:03:53 -0800 (PST) Date: Thu, 12 Nov 2015 22:03:00 -0000 Message-ID: Subject: Re: [i386] Rotate stack checking loop From: Uros Bizjak To: Eric Botcazou Cc: "gcc-patches@gcc.gnu.org" Content-Type: text/plain; charset=UTF-8 X-SW-Source: 2015-11/txt/msg01608.txt.bz2 Hello! > this patch rotates the loop generated in the prologue to do stack checking > when -fstack-check is specified, thereby saving one branch instruction. It > was initially implemented as a WHILE loop to match the generic implementation > but can be turned into a DO-WHILE loop because the amount of stack to be > checked is known at compile time (since it's the static part of the frame). > > The patch also changes a mov+sub pair into an lea in the common case on Linux, > saving one more instruction in the process. > > Tested on x86/Linux & x86-64/Linux (ix86_adjust_stack_and_probe path) and > x86/Solaris (ix86_emit_probe_stack_range path). OK for the mainline? > > > 2015-11-12 Eric Botcazou > > * config/i386/i386.c (ix86_adjust_stack_and_probe): Adjust and use > an lea instruction when possible. > (output_adjust_stack_and_probe): Rotate the loop and simplify. > (ix86_emit_probe_stack_range): Adjust. > (output_probe_stack_range): Rotate the loop and simplify. OK. Thanks, Uros.