about summary refs log tree commit diff
path: root/sysdeps/x86_64/multiarch/memcmp-avx2-movbe-rtm.S
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2021-03-05 07:26:42 -0800
committerH.J. Lu <hjl.tools@gmail.com>2022-01-27 12:47:19 -0800
commit5f59aaddc9be84a6ce8c71cab90ee08dbbd72af5 (patch)
tree49bd6c60949e027f9f1b38436f7fb4ba0e569b73 /sysdeps/x86_64/multiarch/memcmp-avx2-movbe-rtm.S
parentd584356fe8417790d20f024c5233c2d35a615ea2 (diff)
downloadglibc-5f59aaddc9be84a6ce8c71cab90ee08dbbd72af5.tar.gz
glibc-5f59aaddc9be84a6ce8c71cab90ee08dbbd72af5.tar.xz
glibc-5f59aaddc9be84a6ce8c71cab90ee08dbbd72af5.zip
x86-64: Add AVX optimized string/memory functions for RTM
Since VZEROUPPER triggers RTM abort while VZEROALL won't, select AVX
optimized string/memory functions with

	xtest
	jz	1f
	vzeroall
	ret
1:
	vzeroupper
	ret

at function exit on processors with usable RTM, but without 256-bit EVEX
instructions to avoid VZEROUPPER inside a transactionally executing RTM
region.

(cherry picked from commit 7ebba91361badf7531d4e75050627a88d424872f)
Diffstat (limited to 'sysdeps/x86_64/multiarch/memcmp-avx2-movbe-rtm.S')
-rw-r--r--sysdeps/x86_64/multiarch/memcmp-avx2-movbe-rtm.S12
1 files changed, 12 insertions, 0 deletions
diff --git a/sysdeps/x86_64/multiarch/memcmp-avx2-movbe-rtm.S b/sysdeps/x86_64/multiarch/memcmp-avx2-movbe-rtm.S
new file mode 100644
index 0000000000..cf4eff5d4a
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/memcmp-avx2-movbe-rtm.S
@@ -0,0 +1,12 @@
+#ifndef MEMCMP
+# define MEMCMP __memcmp_avx2_movbe_rtm
+#endif
+
+#define ZERO_UPPER_VEC_REGISTERS_RETURN \
+  ZERO_UPPER_VEC_REGISTERS_RETURN_XTEST
+
+#define VZEROUPPER_RETURN jmp	 L(return_vzeroupper)
+
+#define SECTION(p) p##.avx.rtm
+
+#include "memcmp-avx2-movbe.S"