From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Daniel Colascione Newsgroups: gmane.emacs.devel Subject: Re: [Emacs-diffs] trunk r114450: * dispnew.c (clear_glyph_row, copy_row_except_pointers): Date: Tue, 24 Sep 2013 04:43:26 -0700 Message-ID: <52417ADE.70007@dancol.org> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="m5kVrMFrR36wD7RsqPq45mtSUIvT62btV" X-Trace: ger.gmane.org 1380023087 701 80.91.229.3 (24 Sep 2013 11:44:47 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 24 Sep 2013 11:44:47 +0000 (UTC) To: Paul Eggert , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Sep 24 13:44:50 2013 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VOR2w-0007D6-0n for ged-emacs-devel@m.gmane.org; Tue, 24 Sep 2013 13:44:50 +0200 Original-Received: from localhost ([::1]:45000 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VOR2v-00076G-HB for ged-emacs-devel@m.gmane.org; Tue, 24 Sep 2013 07:44:49 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51099) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VOR2n-00075y-Id for emacs-devel@gnu.org; Tue, 24 Sep 2013 07:44:46 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VOR2i-0000hD-6y for emacs-devel@gnu.org; Tue, 24 Sep 2013 07:44:41 -0400 Original-Received: from dancol.org ([2600:3c01::f03c:91ff:fedf:adf3]:60377) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VOR2i-0000gz-0j for emacs-devel@gnu.org; Tue, 24 Sep 2013 07:44:36 -0400 Original-Received: from c-76-22-66-162.hsd1.wa.comcast.net ([76.22.66.162] helo=[192.168.1.52]) by dancol.org with esmtpsa (TLS1.0:DHE_RSA_CAMELLIA_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1VOR2g-0001XG-Ud; Tue, 24 Sep 2013 04:44:35 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 In-Reply-To: X-Enigmail-Version: 1.5.2 X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2600:3c01::f03c:91ff:fedf:adf3 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:163593 Archived-At: This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --m5kVrMFrR36wD7RsqPq45mtSUIvT62btV Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 9/24/13 12:16 AM, Paul Eggert wrote: > ------------------------------------------------------------ > revno: 114450 > revision-id: eggert@cs.ucla.edu-20130924071638-9k6809ka6hbocr2n > parent: dmantipov@yandex.ru-20130924064320-9o1cx41btsnt1voo > committer: Paul Eggert > branch nick: trunk > timestamp: Tue 2013-09-24 00:16:38 -0700 > message: > * dispnew.c (clear_glyph_row, copy_row_except_pointers): > =20 > Prefer signed to unsigned integers where either will do. Why? Signed integers have undefined overflow behavior and sometimes result in less efficient code. If anything, we should prefer unsigned integer types. int with_signed (int arg) { return arg/64; } unsigned with_unsigned (unsigned arg) { return arg/64; } $ gcc-mp-4.7 -O2 -march=3Dcore2 foo.c $ gdb a.out Reading symbols for shared libraries ... done (gdb) disassemble with_signed Dump of assembler code for function with_signed: 0x0000000100000f40 : lea 0x3f(%rdi),%eax 0x0000000100000f43 : test %edi,%edi 0x0000000100000f45 : cmovns %edi,%eax 0x0000000100000f48 : sar $0x6,%eax 0x0000000100000f4b : retq 0x0000000100000f4c : nopl 0x0(%rax) End of assembler dump. (gdb) disassemble with_unsigned Dump of assembler code for function with_unsigned: 0x0000000100000f50 : mov %edi,%eax 0x0000000100000f52 : shr $0x6,%eax 0x0000000100000f55 : retq End of assembler dump. --m5kVrMFrR36wD7RsqPq45mtSUIvT62btV Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.14 (Darwin) iQIcBAEBAgAGBQJSQXrkAAoJEMAaIROpHW7IM4MQAKHCnI00MEVGO2evR9iXyxQp ifo9YmA88+0SQlZ9MuQJrEniBrT6iIIVSAa897mjQIdG0WUpI1/EBgFRdqxp3wv1 uAY2hj2d60k9ZqU7czKWdifg2ugZKAE7bP2/0tIIBjo5tsAWttZ+J5M9RzaxPpfO ROsvSS/T1opPVhs6GW4QPyV1fFLNvgvalxo7fHStGalB651FzaXmlWDZoNAOI7sG jGdR2tTglWOb3c6o/y1NYUqN6Dj9I08SCSgZtaIbjwDCcsVYXD18RSzkMFMv1aAy 7WJzo70SmV+mwKIMV04V2x5B43G3ejVyL7R3pRdZ6CDB8J3JjK4djTwkVWr4pZTv Bj1DQ8cGKUCZPx+EjeHJN1fx8a7d7oV2pmdwnmmjOvTIE6UYXlDLEv/w7oPUdLQo Zb4NmBwfyGPcXeBQuNd5WuBLenSn7VkGdc/mJq0R0PVW3A7bwCPGMqj0rnvv3ZEZ x0v7jYGwTBdlb9lkViJBg3O1tO7iS9NatY/1wgGWRGJ3sJo16xbZPORassGJR2YK y4D+GJijLOccSLMVKYKpHJsozjHK9clIuHM85UlIZuI1ndbSvRuHxs40RpWimxNu f/+pE+FD1G0wEdn3oWdKqGh2xz8YXh8JD/i+YAs2b2p84te220q+AcGZkSnjLZmj TvL/8ROIO+ArBQ5PaYI0 =EcDj -----END PGP SIGNATURE----- --m5kVrMFrR36wD7RsqPq45mtSUIvT62btV--