From patchwork Sun Feb 8 11:04:26 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?T25kxZllaiBCw61sa2E=?= X-Patchwork-Id: 437693 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 4DBCD140129 for ; Sun, 8 Feb 2015 22:04:57 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:subject:message-id:mime-version :content-type; q=dns; s=default; b=FbP0HTkNeVCGEiNL3GHUjc11/jRfg rRNHHD0D9yAk/HmNxTroFlGE/aElQsuq8BHWQv83CgN6AerwTJVjT8aI8DQVHAbR s9JlSoyARWcyS7livKhPPfPRpcXg1jTDx/XjfqvM6vFMb4+7+0UqhwAjkjS1yM3K F0pj6PVDhT2lx0= 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:date:from:to:subject:message-id:mime-version :content-type; s=default; bh=f0/gzIC6+KGnhsCUk8qYESNcfso=; b=sut o4swD9L7q4iTxfhJ4Z+mvp4VEcF8r++sTc9FANqyci/6JRSSRzZMFsnr2VFHJSix N/2mAlFlHoEpbSM7uFOn9OomFjNIm7oZsB23Ufb72wZxnI7lhg9FYIGYtOKeYt6T gCsWyy2cnVRk89gCxv4Wew2YlMOHPfE8UiUk8YT8= Received: (qmail 5757 invoked by alias); 8 Feb 2015 11:04:37 -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 5748 invoked by uid 89); 8 Feb 2015 11:04:36 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.7 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, SPF_NEUTRAL autolearn=no version=3.3.2 X-HELO: popelka.ms.mff.cuni.cz Date: Sun, 8 Feb 2015 12:04:26 +0100 From: =?utf-8?B?T25kxZllaiBCw61sa2E=?= To: libc-alpha@sourceware.org Subject: [RFC][BZ #17943] Use long for int_fast8_t Message-ID: <20150208110426.GA28729@domone> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) Hi, as in bugzilla entry what is rationale of using char as int_fast8_t? It is definitely slower with division, following code is 25% slower on haswell with char than when you use long. There is question what about other architectures and atomic operations, are byte ones better than int? int main () { int i; char x = 32; for (i=0; i<1000000000; i++) x = 11 * x + 5 + x / 3; return x; } * sysdeps/generic/stdint.h: Use long int for int_fast8_t diff --git a/sysdeps/generic/stdint.h b/sysdeps/generic/stdint.h index 5c9f0ff..c6dda3b 100644 --- a/sysdeps/generic/stdint.h +++ b/sysdeps/generic/stdint.h @@ -87,12 +87,13 @@ typedef unsigned long long int uint_least64_t; /* Fast types. */ /* Signed. */ -typedef signed char int_fast8_t; #if __WORDSIZE == 64 +typedef long int int_fast8_t; typedef long int int_fast16_t; typedef long int int_fast32_t; typedef long int int_fast64_t; #else +typedef int int_fast8_t; typedef int int_fast16_t; typedef int int_fast32_t; __extension__