Linux-man Archive on lore.kernel.org
 help / color / Atom feed
From: Shawn Landden <shawn@git.icu>
To: linux-man@vger.kernel.org
Cc: Shawn Landden <shawn@git.icu>
Subject: [PATCH] memcmp.3: note about optimization to bcmp in LLVM 9
Date: Sat, 11 Jan 2020 19:02:16 +0400
Message-ID: <20200111150216.5956-1-shawn@git.icu> (raw)

---
 man3/memcmp.3 | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/man3/memcmp.3 b/man3/memcmp.3
index 247eed223..6afca5ea4 100644
--- a/man3/memcmp.3
+++ b/man3/memcmp.3
@@ -84,10 +84,17 @@ because the required CPU time depends on the number of equal bytes.
 Instead, a function that performs comparisons in constant time is required.
 Some operating systems provide such a function (e.g., NetBSD's
 .BR consttime_memequal ()),
 but no such function is specified in POSIX.
 On Linux, it may be necessary to implement such a function oneself.
+.PP
+LLVM 9, released in 2019, and later will optimize a call
+.BR memcmp ()
+to a call to
+.BR bcmp (3)
+if the return value is only checked for equilivence to zero.
+.\" http://releases.llvm.org/9.0.0/docs/ReleaseNotes.html#noteworthy-optimizations
 .SH SEE ALSO
 .BR bcmp (3),
 .BR bstring (3),
 .BR strcasecmp (3),
 .BR strcmp (3),
-- 
2.20.1


             reply index

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-11 15:02 Shawn Landden [this message]
2020-01-11 15:05 ` Shawn Landden

Reply instructions:

You may reply publically to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200111150216.5956-1-shawn@git.icu \
    --to=shawn@git.icu \
    --cc=linux-man@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Linux-man Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-man/0 linux-man/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-man linux-man/ https://lore.kernel.org/linux-man \
		linux-man@vger.kernel.org
	public-inbox-index linux-man

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-man


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git