Hi,
it seems that there are many undocumented IA-32 builtins. This patch starts
small and documents the builtins corresponding to the basic instrinsics which
are declared in ia32intrin.h.
Tested with 'make doc', OK for all active branches?
2017-08-23 Eric Botcazou <ebotca...@adacore.com>
* doc/extend.texi (x86 Built-in Functions): Document basic builtins.
--
Eric Botcazou
Index: doc/extend.texi
===================================================================
--- doc/extend.texi (revision 251141)
+++ doc/extend.texi (working copy)
@@ -19702,14 +19702,51 @@ Similar to @code{__builtin_nans}, except the retur
@findex __builtin_nansq
@end table
-The following built-in function is always available.
+The following built-in function are always available.
@table @code
+@item unsigned long long __builtin_ia32_rdtsc (void)
+Generates the @code{rdtsc} machine instruction.
+
+@item unsigned long long __builtin_ia32_rdtscp (unsigned int *)
+Generates the @code{rdtscp} machine instruction.
+
@item void __builtin_ia32_pause (void)
Generates the @code{pause} machine instruction with a compiler memory
barrier.
+
+@item unsigned long long __builtin_ia32_rdpmc (unsigned int)
+Generates the @code{rdpmc} machine instruction.
+
+@item int __builtin_ia32_bsrsi (int)
+Generates the 32-bit @code{bsr} machine instruction.
+
+@item unsigned char __builtin_ia32_rolqi (unsigned char, int)
+Generates the 8-bit @code{rol} machine instruction.
+
+@item unsigned char __builtin_ia32_rorqi (unsigned char, int)
+Generates the 8-bit @code{ror} machine instruction.
+
+@item unsigned short __builtin_ia32_rolhi (unsigned short, int)
+Generates the 16-bit @code{rol} machine instruction.
+
+@item unsigned short __builtin_ia32_rorhi (unsigned short, int)
+Generates the 16-bit @code{ror} machine instruction.
@end table
+The following built-in function are always available in 64-bit mode.
+
+@table @code
+@item int __builtin_ia32_bsrdi (long long)
+Generates the 64-bit @code{bsr} machine instruction.
+
+@item unsigned long long __builtin_ia32_readeflags_u64 (void)
+Reads the flags register.
+
+@item void __builtin_ia32_writeeflags_u64 (unsigned long long)
+Writes the flags register.
+@end table
+
The following built-in functions are always available and can be used to
check the target platform type.