From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Matching regex case-sensitively in C strings? Date: Thu, 10 Nov 2022 13:18:56 +0200 Message-ID: <83wn83qcpr.fsf@gnu.org> References: <218795BA-107D-4A86-9ACF-0A44BD2EC3D2@gmail.com> <83edufyoad.fsf@gnu.org> <580E87E6-DCFD-42AE-807A-339BBB3878C2@acm.org> <5711A9D3-7BCB-44AE-8911-5E039FF5FBB8@gmail.com> <838rklxmnm.fsf@gnu.org> <4FB7E922-5E36-4E0C-9681-9EC0E719CC8D@acm.org> <834jv8uvjj.fsf@gnu.org> <481B14DE-D209-4B5B-A517-0F721E7C5854@acm.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25977"; mail-complaints-to="usenet@ciao.gmane.io" Cc: casouri@gmail.com, emacs-devel@gnu.org To: Mattias =?utf-8?Q?Engdeg=C3=A5rd?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Nov 10 12:19:29 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ot5ai-0006Wj-Jo for ged-emacs-devel@m.gmane-mx.org; Thu, 10 Nov 2022 12:19:28 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ot5aZ-0000tW-Gg; Thu, 10 Nov 2022 06:19:19 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ot5aD-0000sI-Mj for emacs-devel@gnu.org; Thu, 10 Nov 2022 06:18:59 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ot5aD-0004m9-05; Thu, 10 Nov 2022 06:18:57 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=bdD67yBKRzbyHJICHrIbhXoGFaootOaXdy5HyOJ5xyc=; b=co0urJ0vnT3Q9Le9GarE ACPapVi/L0bfEADI5ivaZM91GZf9PebP9BTKOiJXA5CGdezE16rjrDx3+dUFXwkbMCOTLW3jCy/oB uiHwTtqjy2DUTyxoeexmpUpq4IXcY8OG72W/bqY92AN6AE0C/tpRT7NKV8ddvYUAySrJ4qnMC82xB FI0irZpJmyiObvgZqeYcmk1NK5wwzrnWpAcmir5a56LGt6eHzIyaCQc79LLbbooryYqFfEHTXeUlg ljpQnjciNzV9kDwVt8YXgxXL0wNQ09YU0mYFLsLYc9o9vb3Wj6HDXwJ6fXw13IOdbKceGJRTdxlmc KHs+8g6NsHKFAw==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ot5aB-0003EM-SE; Thu, 10 Nov 2022 06:18:56 -0500 In-Reply-To: <481B14DE-D209-4B5B-A517-0F721E7C5854@acm.org> (message from Mattias =?utf-8?Q?Engdeg=C3=A5rd?= on Thu, 10 Nov 2022 10:52:40 +0100) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:299478 Archived-At: > From: Mattias EngdegÄrd > Date: Thu, 10 Nov 2022 10:52:40 +0100 > Cc: casouri@gmail.com, emacs-devel@gnu.org > > 9 nov. 2022 kl. 14.06 skrev Eli Zaretskii : > > >> You are right to worry about it, but there is actually no need for > >> concern here: it's a tail call (and the extra argument is last) so > >> it should compile to an unconditional jump (and setting a register). > > > > That's not what I see here, even with -O2. > > Trying to read your mind, are you using 32-bit x86? Even that shouldn't be disastrous; it's just some stack manipulation. Hardly noticeable given that it's a regexp match that comes next. I agree that the effect is probably minuscule, but it's still there. And on some architectures it could be more than that. Why not have two separate functions for these two jobs? The code is short, and some duplication is not an issue in this case.