From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from brown.elm.relay.mailchannels.net (brown.elm.relay.mailchannels.net [23.83.212.23]) by sourceware.org (Postfix) with ESMTPS id CFA153857023 for ; Fri, 13 May 2022 11:51:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org CFA153857023 X-Sender-Id: dreamhost|x-authsender|siddhesh@gotplt.org Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id A76DAC1412; Fri, 13 May 2022 11:51:58 +0000 (UTC) Received: from pdx1-sub0-mail-a307.dreamhost.com (unknown [127.0.0.6]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 4625AC13A5; Fri, 13 May 2022 11:51:58 +0000 (UTC) ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1652442718; a=rsa-sha256; cv=none; b=EbpBbx0NQScwK9zg6YR9r0rVhVr+B2KyKIsogGCyq+H3DQTdORtyUYPKggskrMpwbxJwSM /m9vN2x0YT7QSolxSpQ2Yv/JXepWCYuTfpqika/Z4wHqZa+KCURt7+bRQJBMVMuMZq901q 9IPeub1bAyNQZBq7T9fDQUfA3x2wg4bLSuObsKr0lSSusAOfwwneYQOPginyQoyzV0l/7g //XCkcrwc3f8UHLaQYj0ySmxNkuIZ40tTe8Ay8KURpq1fi0HG98ZJwklddeEsxJMZy8tPV 9aK1Kh6mfxjlXN1JVtbL4ritxVIJHW0WXyhMoU8HN1OzyNDB+MrIeydmlhrpDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=mailchannels.net; s=arc-2022; t=1652442718; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=sSYb2cBRrotG1uqWwNKGIAgCBXCl0UDHmVDidiEuBBs=; b=7pY6QK4DqJB7TemWGv7bcY7W+B0ZxmxSUMHQEL01G/8ajYDZYrK5RZa0NJRpY/9YG0h/3y FaoO7E0RX1UuNYNRrr+U1wmkomW86raculO1wOu/7vNuFWQll52SieESXmEkUbIcDpMMuY XD33G9gXFaBinSBQpa5ObjIyXlStHfYXJy7BMncGVzow8639nc1gJHlFPv+Sq1I/k3xkPp OT07vhwbVNN/iTvTsa/0sibEAy8okqtMk2omd4BdBF10dj9c5d0nR5siq3dQr8phdObQEl wcQzrBMGgIYyHJbu5f+kpW2MlmcLoCn6XP9EAb03sYo7m+j45qCrWeHHbJTOGw== ARC-Authentication-Results: i=1; rspamd-554c8f6c56-98drh; auth=pass smtp.auth=dreamhost smtp.mailfrom=siddhesh@sourceware.org X-Sender-Id: dreamhost|x-authsender|siddhesh@gotplt.org X-MC-Relay: Junk X-MailChannels-SenderId: dreamhost|x-authsender|siddhesh@gotplt.org X-MailChannels-Auth-Id: dreamhost X-Daffy-Blushing: 590faaff35bc5c0b_1652442718545_3524062238 X-MC-Loop-Signature: 1652442718545:883699085 X-MC-Ingress-Time: 1652442718544 Received: from pdx1-sub0-mail-a307.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384) by 100.125.123.55 (trex/6.7.1); Fri, 13 May 2022 11:51:58 +0000 Received: from [192.168.86.152] (unknown [103.199.173.7]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: siddhesh@gotplt.org) by pdx1-sub0-mail-a307.dreamhost.com (Postfix) with ESMTPSA id 4L06SX1rgjz1P7; Fri, 13 May 2022 04:51:55 -0700 (PDT) Message-ID: <07456c63-a1e9-2a1e-bdb1-1f1c438992e0@sourceware.org> Date: Fri, 13 May 2022 17:21:48 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0 Subject: Re: [PATCH v3] wcrtomb: Make behavior POSIX compliant Content-Language: en-US To: Florian Weimer Cc: libc-alpha@sourceware.org, dickey@his.com References: <20220505184348.3357550-3-siddhesh@sourceware.org> <20220512131503.764504-1-siddhesh@sourceware.org> <4ffe566a-8002-b574-daee-d6927b8ceaef@cs.ucla.edu> <02979241-ff47-ef76-0c77-268aca00c4b8@sourceware.org> <87ilq9d5n2.fsf@oldenburg.str.redhat.com> From: Siddhesh Poyarekar In-Reply-To: <87ilq9d5n2.fsf@oldenburg.str.redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1162.0 required=5.0 tests=BAYES_00, BODY_8BITS, JMQ_SPF_NEUTRAL, KAM_DMARC_NONE, KAM_DMARC_STATUS, NICE_REPLY_A, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NEUTRAL, TXREP, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 May 2022 11:52:03 -0000 On 13/05/2022 17:08, Florian Weimer via Libc-alpha wrote: > * Siddhesh Poyarekar: > >> On 13/05/2022 10:58, Paul Eggert wrote: >>> On 5/12/22 21:56, Paul Eggert wrote: >>>> Hope you don't mind my bikeshedding. >>> Better yet, this: >>>   s[0] = buf[0]; >>>   if (2 <= result && result <= 4) >>>     { >>>       s[1] = buf[1]; >>>       memcpy (&s[result - 2], &buf[result - 2], 2); >>>     } >>>   else >>>     memcpy (s, buf, result); >>> On x86-64 with GCC 12.1 -O2 and a glibc-supplied charmap, this is >>> only 9 straight-line instructions, counting the compare insn and the >>> conditional-branch insn that is never taken. >>> >> >> Sorry I missed this one. I tried it and with gcc 11 it seems to >> produce worse code, merging the two memcpys instead of inlining the >> first one. > > Can we please use the simplified code? So just a memcpy call? I could push that and attempt to micro-optimize if there are reports of slowdown due to this. Siddhesh