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: Ondrej Bilka X-Patchwork-Id: 4970 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__