From patchwork Sun Mar 1 21:19:31 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 444884 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]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 292D314015A for ; Mon, 2 Mar 2015 09:43:14 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass reason="1024-bit key; unprotected key" header.d=sourceware.org header.i=@sourceware.org header.b=B/BrgG0b; dkim-adsp=none (unprotected policy); dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:message-id:in-reply-to:references:from:date :subject:to; q=dns; s=default; b=WXGkT+WWknJH6KOUZanQAg39SMI29wJ Uxuq7pdtLxXF6bwXc2r+PZZIPERSX2BAIjnTMPRqIPB6sNVMP+OpIBO+sglz3q4n QzrSfIfIIMMZTO07YQZxVzFOL414GyLF/BAVAvR383i+DpJlPSuQRZujo1HCcasG JJeSjNfZ/R/Q= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:message-id:in-reply-to:references:from:date :subject:to; s=default; bh=kbtpag8/oGJFUSRhb7h0nbn5kRQ=; b=B/Brg G0bdmLdc3IMeAd3WdO5kutG0glyWSoAPzLUsakuXoeDITd5Z8knRE0EVMbDafXSb KBL4tLeBoSoW5tlOzAPflSt/sdShvaK2bikQHV3W4B8dmZuNW4mvPDxf9FxCyj/X uqA8yPsFZerS2nUMDC42Nst0btzQ+C2kaqaIR8= Received: (qmail 90010 invoked by alias); 1 Mar 2015 22:43:08 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 90001 invoked by uid 89); 1 Mar 2015 22:43:08 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.0 required=5.0 tests=AWL, BAYES_00, SPF_HELO_PASS, SPF_PASS, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Message-Id: <8a9dc15454643f23c9309335b8fbbaadddabcd99.1425246936.git.fweimer@redhat.com> In-Reply-To: References: From: Florian Weimer Date: Sun, 1 Mar 2015 22:19:31 +0100 Subject: [PATCH 6/6] vfprintf: Remove label name switching for the jump table To: libc-alpha@sourceware.org Different labels are no longer needed because the tables are now in separate functions. --- stdio-common/vfprintf.c | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/stdio-common/vfprintf.c b/stdio-common/vfprintf.c index 6e840aa..6bf59ff 100644 --- a/stdio-common/vfprintf.c +++ b/stdio-common/vfprintf.c @@ -252,9 +252,12 @@ static const uint8_t jump_table[] = #define NOT_IN_JUMP_RANGE(Ch) ((Ch) < L_(' ') || (Ch) > L_('z')) #define CHAR_CLASS(Ch) (jump_table[(INT_T) (Ch) - L_(' ')]) +#define LABEL(Name) do_##Name #ifdef SHARED /* 'int' is enough and it saves some space on 64 bit systems. */ # define JUMP_TABLE_TYPE const int +# define JUMP_TABLE_BASE_LABEL do_form_unknown +# define REF(Name) &&do_##Name - &&JUMP_TABLE_BASE_LABEL # define JUMP(ChExpr, table) \ do \ { \ @@ -269,6 +272,7 @@ static const uint8_t jump_table[] = while (0) #else # define JUMP_TABLE_TYPE const void *const +# define REF(Name) &&do_##Name # define JUMP(ChExpr, table) \ do \ { \ @@ -1328,13 +1332,6 @@ vfprintf (FILE *s, const CHAR_T *format, va_list ap) /* Process whole format string. */ do { -#ifdef SHARED -# define JUMP_TABLE_BASE_LABEL do_form_unknown -# define REF(Name) &&do_##Name - &&JUMP_TABLE_BASE_LABEL -#else -# define REF(Name) &&do_##Name -#endif -#define LABEL(Name) do_##Name STEP0_3_TABLE; STEP4_TABLE; @@ -1928,16 +1925,6 @@ printf_positional (_IO_FILE *s, const CHAR_T *format, int readonly_format, /* Now walk through all format specifiers and process them. */ for (; (size_t) nspecs_done < nspecs; ++nspecs_done) { -#undef REF -#ifdef SHARED -# undef JUMP_TABLE_BASE_LABEL -# define JUMP_TABLE_BASE_LABEL do2_form_unknown -# define REF(Name) &&do2_##Name - &&JUMP_TABLE_BASE_LABEL -#else -# define REF(Name) &&do2_##Name -#endif -#undef LABEL -#define LABEL(Name) do2_##Name STEP4_TABLE; int is_negative;