aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorOlivier Hainque <hainque@adacore.com>2008-05-23 16:33:46 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2008-05-23 16:33:46 +0200
commit2e1c9cb46039a3a7053e5fdbe808d14eaa6ff032 (patch)
treee9bee70f966063770eecf8d78dcc0f79e0b9c449 /gcc
parentbfc157d52c26ce692eaf52c4cdbbf4b148198c9e (diff)
downloadgcc-2e1c9cb46039a3a7053e5fdbe808d14eaa6ff032.zip
gcc-2e1c9cb46039a3a7053e5fdbe808d14eaa6ff032.tar.gz
gcc-2e1c9cb46039a3a7053e5fdbe808d14eaa6ff032.tar.bz2
gnat_ugn.texi (Calling Conventions): Document that the Intrinsic convention also allows access to named compiler...
2008-05-23 Olivier Hainque <hainque@adacore.com> * gnat_ugn.texi (Calling Conventions): Document that the Intrinsic convention also allows access to named compiler built-in subprograms such as the GCC __builtin family. From-SVN: r135812
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/gnat_ugn.texi26
1 files changed, 22 insertions, 4 deletions
diff --git a/gcc/ada/gnat_ugn.texi b/gcc/ada/gnat_ugn.texi
index a14afde..ed5cec7 100644
--- a/gcc/ada/gnat_ugn.texi
+++ b/gcc/ada/gnat_ugn.texi
@@ -2855,9 +2855,8 @@ This applies to an intrinsic operation, as defined in the Ada
Reference Manual. If a pragma Import (Intrinsic) applies to a subprogram,
this means that the body of the subprogram is provided by the compiler itself,
usually by means of an efficient code sequence, and that the user does not
-supply an explicit body for it. In an application program, the pragma can
-only be applied to the following two sets of names, which the GNAT compiler
-recognizes.
+supply an explicit body for it. In an application program, the pragma may
+be applied to the following sets of names:
@itemize @bullet
@item
@@ -2868,7 +2867,9 @@ first one must be a signed integer type or a modular type with a binary
modulus, and the second parameter must be of type Natural.
The return type must be the same as the type of the first argument. The size
of this type can only be 8, 16, 32, or 64.
-@item binary arithmetic operators: ``+'', ``-'', ``*'', ``/''
+
+@item
+Binary arithmetic operators: ``+'', ``-'', ``*'', ``/''
The corresponding operator declaration must have parameters and result type
that have the same root numeric type (for example, all three are long_float
types). This simplifies the definition of operations that use type checking
@@ -2888,7 +2889,24 @@ This common idiom is often programmed with a generic definition and an
explicit body. The pragma makes it simpler to introduce such declarations.
It incurs no overhead in compilation time or code size, because it is
implemented as a single machine instruction.
+
+@item
+General subprogram entities, to bind an Ada subprogram declaration to
+a compiler builtin by name with back-ends where such interfaces are
+available. A typical example is the set of ``__builtin'' functions
+exposed by the GCC back-end, as in the following example:
+
+@smallexample @c ada
+ function builtin_sqrt (F : Float) return Float;
+ pragma Import (Intrinsic, builtin_sqrt, "__builtin_sqrtf");
+@end smallexample
+
+Most of the GCC builtins are accessible this way, and as for other
+import conventions (e.g. C), it is the user's responsibility to ensure
+that the Ada subprogram profile matches the underlying builtin
+expectations.
@end itemize
+
@noindent
@ifset unw