From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Robert Pluim Newsgroups: gmane.emacs.devel Subject: Re: Matching regex case-sensitively in C strings? Date: Thu, 10 Nov 2022 12:35:56 +0100 Message-ID: <87tu37dotf.fsf@gmail.com> 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> <83wn83qcpr.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34482"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Mattias =?utf-8?Q?Engdeg=C3=A5rd?= , casouri@gmail.com, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Nov 10 12:36:52 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 1ot5rY-0008mH-1L for ged-emacs-devel@m.gmane-mx.org; Thu, 10 Nov 2022 12:36:52 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ot5qq-0007gN-Hl; Thu, 10 Nov 2022 06:36:08 -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 1ot5qp-0007g1-2x for emacs-devel@gnu.org; Thu, 10 Nov 2022 06:36:07 -0500 Original-Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ot5qn-0007ca-72; Thu, 10 Nov 2022 06:36:06 -0500 Original-Received: by mail-wm1-x331.google.com with SMTP id p13-20020a05600c468d00b003cf8859ed1bso949207wmo.1; Thu, 10 Nov 2022 03:36:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date :gmane-reply-to-list:references:in-reply-to:subject:cc:to:from:from :to:cc:subject:date:message-id:reply-to; bh=zxxRRv3r5RxbPHy6SGhrPr3bs9eXpzfboQVFNQ0jNfk=; b=XqJltwDIivT6FNKVJWpcFNj5vJEFyeiLVV43ALCBsTmAFDXkPapMlGsLY5DLRwYlEA YdzXXJTE7xuWsPGziwvrt9tExADIB58o/TPxgwuAHWHQDpka/MLrpiL9MHV5IHM2VdTF NcAW2xS9wvfzy/WZOaX3I3ebMV/MBlh5ci3DgqVQ7yX9Wcz3Xkc6nkcCx6j+2UCtXRrM KU5RkmxDH0trBN8mAbDcOiufi95re/k1/yix+GjqxxkFPw7mHqD3v/+LwQH/WMTrDT4/ EPZf2xn8rEcl6GRua1xsdlEuHmMdUECEyS397MAJzl2HY51UgpSwairxEeEelRCZasux fjyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date :gmane-reply-to-list:references:in-reply-to:subject:cc:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=zxxRRv3r5RxbPHy6SGhrPr3bs9eXpzfboQVFNQ0jNfk=; b=2Me5kHprrSxH6CzWiBJ3ykwaRwoqcqVuBGXxqSj91HhuZKkRS/FohqrbMtjmyqP1KL 7WGT6M2paLCvOUqdVyeYuGb090ZJnuM7caa1xM145aHg2RgJZMY8jBo/dKMXM71e+3h5 SEo9V+lnOtzuAcL9CV97Rv3XKhGl3vdhv11ndFKiOsQ1jjwqFiCWfvftlzea09sup2RU uLDajzNcJMMVzJphmXXESccuFQj85rHrAkknwlBSWkHSHccMFNwVn5m3ahi+boKtjXM2 QDMkIzS9zK7vyzUSCWSDWgIbMZaNqveZ/6sERNL3julXpPyNBRHOBKQGm3SgbcW6xdgH OOMw== X-Gm-Message-State: ACrzQf0t5qikBtXYj3uXzvZvUyeu08Eq9+uyq2s/24CZJ4hqayeiYGKH kLiZDkVgrd/eOz8NZ898PQCvQQiD/LU= X-Google-Smtp-Source: AMsMyM7hgYZEA/T8Spx+CNdyCSjXmoLorBNP3sr0g1J+VtmtHjVvVxHcxhK6qWsg6PULTORSHneblw== X-Received: by 2002:a05:600c:33a5:b0:3cf:6fd1:d94b with SMTP id o37-20020a05600c33a500b003cf6fd1d94bmr39815957wmp.52.1668080158222; Thu, 10 Nov 2022 03:35:58 -0800 (PST) Original-Received: from rltb ([82.66.8.55]) by smtp.gmail.com with ESMTPSA id u6-20020a05600c19c600b003b497138093sm5352428wmq.47.2022.11.10.03.35.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Nov 2022 03:35:57 -0800 (PST) In-Reply-To: <83wn83qcpr.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 10 Nov 2022 13:18:56 +0200") Gmane-Reply-To-List: yes Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=rpluim@gmail.com; helo=mail-wm1-x331.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, FREEMAIL_REPLY=1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action 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:299480 Archived-At: >>>>> On Thu, 10 Nov 2022 13:18:56 +0200, Eli Zaretskii said: >> From: Mattias Engdeg=C3=A5rd >> Date: Thu, 10 Nov 2022 10:52:40 +0100 >> Cc: casouri@gmail.com, emacs-devel@gnu.org >>=20 >> 9 nov. 2022 kl. 14.06 skrev Eli Zaretskii : >>=20 >> >> 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 registe= r). >> >=20 >> > That's not what I see here, even with -O2. >>=20 >> 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. Eli> I agree that the effect is probably minuscule, but it's still ther= e. Eli> And on some architectures it could be more than that. Eli> Why not have two separate functions for these two jobs? The code = is Eli> short, and some duplication is not an issue in this case. Or one generic function and two #defines that pass in the appropriate canonicalize table value. Robert --=20