From patchwork Mon Jul 5 20:10:32 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Uros Bizjak X-Patchwork-Id: 57929 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 DFF63B6EE8 for ; Tue, 6 Jul 2010 06:10:46 +1000 (EST) Received: (qmail 30755 invoked by alias); 5 Jul 2010 20:10:43 -0000 Received: (qmail 30746 invoked by uid 22791); 5 Jul 2010 20:10:42 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, TW_ZJ, T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: sourceware.org Received: from mail-fx0-f47.google.com (HELO mail-fx0-f47.google.com) (209.85.161.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 05 Jul 2010 20:10:36 +0000 Received: by fxm12 with SMTP id 12so4995616fxm.20 for ; Mon, 05 Jul 2010 13:10:33 -0700 (PDT) Received: by 10.86.36.3 with SMTP id j3mr2544546fgj.34.1278360633804; Mon, 05 Jul 2010 13:10:33 -0700 (PDT) Received: from [93.103.18.160] (93-103-18-160.static.t-2.net [93.103.18.160]) by mx.google.com with ESMTPS id q28sm2586931faa.41.2010.07.05.13.10.33 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 05 Jul 2010 13:10:33 -0700 (PDT) Subject: [PATCH, i386]: Introduce ix86_gen_allocate_stack_worker From: Uros Bizjak To: gcc-patches@gcc.gnu.org Date: Mon, 05 Jul 2010 22:10:32 +0200 Message-ID: <1278360632.2513.13.camel@localhost> Mime-Version: 1.0 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 Hello! 2010-07-05 Uros Bizjak * config/i386/i386.c (ix86_gen_allocate_stack_worker): New. (override_options): Initialize it. (ix86_expand_prologue): Use it. Tested on x86_64-pc-linux-gnu, committed to mainline SVN. Uros. Index: i386.c =================================================================== --- i386.c (revision 161847) +++ i386.c (working copy) @@ -1906,6 +1906,7 @@ static rtx (*ix86_gen_sub3_carry) (rtx, static rtx (*ix86_gen_one_cmpl2) (rtx, rtx); static rtx (*ix86_gen_monitor) (rtx, rtx, rtx); static rtx (*ix86_gen_andsp) (rtx, rtx, rtx); +static rtx (*ix86_gen_allocate_stack_worker) (rtx, rtx); /* Preferred alignment for stack boundary in bits. */ unsigned int ix86_preferred_stack_boundary; @@ -3577,6 +3578,7 @@ override_options (bool main_args_p) ix86_gen_one_cmpl2 = gen_one_cmpldi2; ix86_gen_monitor = gen_sse3_monitor64; ix86_gen_andsp = gen_anddi3; + ix86_gen_allocate_stack_worker = gen_allocate_stack_worker_64; } else { @@ -3588,6 +3590,7 @@ override_options (bool main_args_p) ix86_gen_one_cmpl2 = gen_one_cmplsi2; ix86_gen_monitor = gen_sse3_monitor; ix86_gen_andsp = gen_andsi3; + ix86_gen_allocate_stack_worker = gen_allocate_stack_worker_32; } #ifdef USE_IX86_CLD @@ -8868,11 +8871,7 @@ ix86_expand_prologue (void) emit_move_insn (eax, GEN_INT (allocate)); - if (TARGET_64BIT) - insn = gen_allocate_stack_worker_64 (eax, eax); - else - insn = gen_allocate_stack_worker_32 (eax, eax); - insn = emit_insn (insn); + insn = emit_insn ((*ix86_gen_allocate_stack_worker) (eax, eax)); if (ix86_cfa_state->reg == stack_pointer_rtx) {