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: Wed, 09 Nov 2022 15:06:24 +0200 Message-ID: <834jv8uvjj.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> 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="6786"; 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 Wed Nov 09 14:06:49 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 1oskn3-0001cI-Bh for ged-emacs-devel@m.gmane-mx.org; Wed, 09 Nov 2022 14:06:49 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oskmn-0008UX-1d; Wed, 09 Nov 2022 08:06:33 -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 1oskmh-0008Qr-OW for emacs-devel@gnu.org; Wed, 09 Nov 2022 08:06:27 -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 1oskmh-0002ZW-Dg; Wed, 09 Nov 2022 08:06:27 -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=Af6H1pzn0o3zsaOcGCZm3CgCAR6AqEfA/X0IBinfUqk=; b=iib9JilM+tYUZvHBR2PI No8qDNtDZT5BZSCKUKJ5B8Qx+R4W5cqgwhmYCC/+beB0VgUFpffWALiovUcTXztMxwhIPKC4oRvm6 +cSTpBRpnNb47fHvz8RQsU2mWn/1JbBulrLs9UM2tIhWE6N5kM0Occ0ly2OYa8c5N2eVFUvAr/KAl EIBgvMOCr+OLj30GnE4WeL5guw9DwzpTMsOj7HYADjDFDaDpNE88aKJktdPjFMmPM3oyHE5CxFlPu zA9mna7HvhNAa5Yk+njiqPW3W3t5z8kXMUHcynKKTvpKD3XDTQWLmFfT+z9OKE3A2rWZYOdNSwLjj FSdaXwED8asXUg==; 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 1oskmg-0003Iw-Ql; Wed, 09 Nov 2022 08:06:27 -0500 In-Reply-To: <4FB7E922-5E36-4E0C-9681-9EC0E719CC8D@acm.org> (message from Mattias =?utf-8?Q?Engdeg=C3=A5rd?= on Wed, 9 Nov 2022 11:33:09 +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:299409 Archived-At: > From: Mattias EngdegÄrd > Date: Wed, 9 Nov 2022 11:33:09 +0100 > Cc: Yuan Fu , emacs-devel@gnu.org > > 8 nov. 2022 kl. 20.37 skrev Eli Zaretskii : > > >> fast_c_string_match_ignore_case (Lisp_Object regexp, > >> const char *string, ptrdiff_t len) > >> { > >> + return fast_c_string_match (regexp, string, len, true); > >> +} > > > > I'm bothered that this function, which is supposed to be fast, will > > now be slower due to an extra function call. > > 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.