From owner-svn-src-head@freebsd.org Tue May 31 05:08:37 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9E79EB55865 for ; Tue, 31 May 2016 05:08:37 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: from mail-lf0-f68.google.com (mail-lf0-f68.google.com [209.85.215.68]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5400118E5 for ; Tue, 31 May 2016 05:08:37 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: by mail-lf0-f68.google.com with SMTP id h68so8696028lfh.3 for ; Mon, 30 May 2016 22:08:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=WocoCFMQv1T0yYeu22QGPc7uVuoFbJQXMVJW4pkqHng=; b=Ixk5TZ45Fwk73VHYCWl8JetSvjXiTuiMMqY4+v53DmkUxkG0Ui3Ikclw8xcmRrz++K KTMLvJd1JSa7Sfk0uYG4Wxfd7JmpqPp42fL5OEo0NWOm7wbt6mBXX6kP17gzts4TwY/i bT8E4TI0GCxrXjFryM7A3oWj0LP/YN4fACVKb5PZSB8RTGfw0UhEWuVEdVvKUFI0tmdm 01FCqRtCrI6cgwpNtD1Dxz4DfYK58kUgJNX/VqKyaygwav/R/O5LAif5pE5zCIf4Nwix K4tShjWnKEenvozIYErZhqk522RRXtNasmZReaWAKk1MPVbcJmVzfy8rTRELZLG/Xk8+ wYrQ== X-Gm-Message-State: ALyK8tJxlcWZDBW/4WH+W4HAx/A7kO3poGEoqADyZrECYbTp6Q3iOVRx7pPZ1TMLZlDKPw== X-Received: by 10.25.142.196 with SMTP id q187mr2874535lfd.11.1464670206237; Mon, 30 May 2016 21:50:06 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by smtp.gmail.com with ESMTPSA id f129sm5070556lff.10.2016.05.30.21.50.05 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 30 May 2016 21:50:05 -0700 (PDT) Subject: Re: svn commit: r300965 - head/lib/libc/stdlib To: Bruce Evans References: <201605291639.u4TGdSwq032144@repo.freebsd.org> <20160530122100.X924@besplex.bde.org> <5985bdc1-b821-f352-0bc5-c45c600c5318@freebsd.org> <20160531130326.G1052@besplex.bde.org> Cc: Conrad Meyer , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Andrey Chernov Message-ID: Date: Tue, 31 May 2016 07:50:04 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <20160531130326.G1052@besplex.bde.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 May 2016 05:08:37 -0000 On 31.05.2016 6:42, Bruce Evans wrote: > > Er, I already said which types are better -- [u]int_fast32_t here. [u]int_fast32_t have _at_least_ 32 bits. int32_t in the initial PRNG can be changed since does not overflow and involve several calculations, but uint_fast32_t is needed just for two operations: *f += *r; i = (*f >> 1) & 0x7fffffff; We need to assign values from uint32_t to uint_fast32_t (since array size can't be changed), do this single operation fast and store them back into array of uint32_t. I doubt that much gain can comes from it and even pessimization in some cases. Better let compiler do its job here.