From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.devel Subject: Re: VIRT_ADDR_VARIES Date: Sun, 06 Nov 2011 17:50:59 -0800 Organization: UCLA Computer Science Department Message-ID: <4EB73983.1060000@cs.ucla.edu> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1320630669 12326 80.91.229.12 (7 Nov 2011 01:51:09 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 7 Nov 2011 01:51:09 +0000 (UTC) Cc: emacs-devel@gnu.org To: Andreas Schwab Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Nov 07 02:51:05 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RNEMa-0006v1-Li for ged-emacs-devel@m.gmane.org; Mon, 07 Nov 2011 02:51:04 +0100 Original-Received: from localhost ([::1]:41828 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RNEMZ-0000zm-Fh for ged-emacs-devel@m.gmane.org; Sun, 06 Nov 2011 20:51:03 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:49697) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RNEMW-0000zG-Dp for emacs-devel@gnu.org; Sun, 06 Nov 2011 20:51:01 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RNEMV-0002Cs-Da for emacs-devel@gnu.org; Sun, 06 Nov 2011 20:51:00 -0500 Original-Received: from smtp.cs.ucla.edu ([131.179.128.62]:58912) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RNEMV-0002Cg-2U for emacs-devel@gnu.org; Sun, 06 Nov 2011 20:50:59 -0500 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id C92FD39E800A; Sun, 6 Nov 2011 17:50:57 -0800 (PST) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Original-Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id iyFpRu95x0g2; Sun, 6 Nov 2011 17:50:57 -0800 (PST) Original-Received: from [192.168.1.10] (pool-71-189-109-235.lsanca.fios.verizon.net [71.189.109.235]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 7104039E8007; Sun, 6 Nov 2011 17:50:57 -0800 (PST) User-Agent: Mozilla/5.0 (X11; Linux i686; rv:7.0.1) Gecko/20110929 Thunderbird/7.0.1 In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 131.179.128.62 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:145917 Archived-At: On 11/06/11 09:18, Andreas Schwab wrote: > Is there any reason not to define VIRT_ADDR_VARIES? I expect the main reason is performance. For example, on x86-64 with GCC 4.6.2 -O2, the function: int pure (Lisp_Object obj) { return PURE_P (obj); } has 8 instructions (not counting the 'ret') if VIRT_ADDR_VARIES is defined, and 4 instructions if it is not defined. The key difference is that VIRT_ADDRESS_VARIES generates this: cmpq $pure+1000000, %rdi jge .L2 xorl %eax, %eax cmpq $pure, %rdi setge %al .L2: rep (where the "1000000" is a function of PURESIZE), whereas omitting VIRT_ADDRESS_VARIES generates this: cmpq $my_edata, %rdi setl %al > The only difference > it makes is that the bounds of the pure array are checked accurately True, but for Emacs it shouldn't matter whether PURE_P checks accurately or loosely -- either way Emacs should operate correctly.