OSDN Git Service

no xfail
[pf3gnuchains/gcc-fork.git] / gcc / builtins.def
index a6f4f51..7b58bef 100644 (file)
@@ -2,22 +2,22 @@
    builtins used in the GNU compiler.
    Copyright (C) 2000, 2001 Free Software Foundation, Inc.
 
-This file is part of GNU CC.
+This file is part of GCC.
 
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 2, or (at your option) any later
+version.
 
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+for more details.
 
 You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING.  If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA.  */
+along with GCC; see the file COPYING.  If not, write to the Free
+Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+02111-1307, USA.  */
 
 /* Before including this file, you should define a macro:
 
@@ -70,9 +70,18 @@ Boston, MA 02111-1307, USA.  */
   DEF_BUILTIN (ENUM, NAME, BUILT_IN_NORMAL, TYPE, TYPE,        \
               false, true, false)
 
+/* Like DEF_FALLBACK_BUILTIN, except that the function is not one that
+   is specified by ANSI/ISO C.  So, when we're being fully conformant
+   we ignore the version of these builtins that does not begin with
+   __builtin.  */
+#undef DEF_EXT_FALLBACK_BUILTIN
+#define DEF_EXT_FALLBACK_BUILTIN(ENUM, NAME, TYPE)     \
+  DEF_BUILTIN (ENUM, NAME, BUILT_IN_NORMAL, TYPE, TYPE,        \
+              false, true, true)
+
 /* A library builtin (like __builtin_strchr) is a builtin equivalent
    of an ANSI/ISO standard library function.  In addition to the
-   `__builtin' version, we will create a an ordinary version (e.g,
+   `__builtin' version, we will create an ordinary version (e.g,
    `strchr') as well.  If we cannot compute the answer using the
    builtin function, we will fall back to the standard library
    version. */
@@ -111,6 +120,15 @@ Boston, MA 02111-1307, USA.  */
   DEF_BUILTIN (ENUM, NAME, BUILT_IN_FRONTEND, TYPE, TYPE,      \
               true, true, false)
 
+/* Like DEF_FRONT_END_LIB_BUILTIN, except that the function is not one
+   that is specified by ANSI/ISO C.  So, when we're being fully
+   conformant we ignore the version of these builtins that does not
+   begin with __builtin.  */
+#undef DEF_EXT_FRONT_END_LIB_BUILTIN                   
+#define DEF_EXT_FRONT_END_LIB_BUILTIN(ENUM, NAME, TYPE)                \
+  DEF_BUILTIN (ENUM, NAME, BUILT_IN_FRONTEND, TYPE, TYPE,      \
+              true, true, true)
+
 /* A built-in that is not currently used.  */
 #undef DEF_UNUSED_BUILTIN                                      
 #define DEF_UNUSED_BUILTIN(X)                                  \
@@ -263,8 +281,8 @@ DEF_LIB_BUILTIN(BUILT_IN_STRRCHR,
                "__builtin_strrchr",
                BT_FN_STRING_CONST_STRING_INT)
 
-DEF_LIB_BUILTIN(BUILT_IN_FSQRT,
-               "__builtin_fsqrt",
+DEF_LIB_BUILTIN(BUILT_IN_SQRT,
+               "__builtin_sqrt",
                BT_FN_DOUBLE_DOUBLE)
 DEF_LIB_BUILTIN(BUILT_IN_SIN,
                "__builtin_sin",
@@ -280,7 +298,7 @@ DEF_LIB_BUILTIN(BUILT_IN_SINF,
                BT_FN_FLOAT_FLOAT)
 DEF_LIB_BUILTIN(BUILT_IN_COSF,
                "__builtin_cosf",
-               BT_FN_LONG_DOUBLE_LONG_DOUBLE)
+               BT_FN_FLOAT_FLOAT)
 DEF_LIB_BUILTIN(BUILT_IN_SQRTL,
                "__builtin_sqrtl",
                BT_FN_LONG_DOUBLE_LONG_DOUBLE)
@@ -336,6 +354,9 @@ DEF_GCC_BUILTIN(BUILT_IN_LONGJMP,
 DEF_GCC_BUILTIN(BUILT_IN_TRAP,
                "__builtin_trap",
                BT_FN_VOID)
+DEF_GCC_BUILTIN(BUILT_IN_PREFETCH,
+               "__builtin_prefetch",
+               BT_FN_VOID_PTR_VAR)
 
 /* Stdio builtins.  */
 DEF_FALLBACK_BUILTIN(BUILT_IN_PUTCHAR,
@@ -367,6 +388,37 @@ DEF_FRONT_END_LIB_BUILTIN(BUILT_IN_FPRINTF,
                         "__builtin_fprintf",
                         BT_FN_INT_PTR_CONST_STRING_VAR)
 
+/* Stdio unlocked builtins.  */
+
+DEF_EXT_FALLBACK_BUILTIN(BUILT_IN_PUTCHAR_UNLOCKED,
+                        "__builtin_putchar_unlocked",
+                        BT_FN_INT_INT)
+DEF_EXT_FALLBACK_BUILTIN(BUILT_IN_PUTS_UNLOCKED,
+                        "__builtin_puts_unlocked",
+                        BT_FN_INT_CONST_STRING)
+DEF_EXT_FRONT_END_LIB_BUILTIN(BUILT_IN_PRINTF_UNLOCKED,
+                             "__builtin_printf_unlocked",
+                             BT_FN_INT_CONST_STRING_VAR)
+DEF_EXT_FALLBACK_BUILTIN(BUILT_IN_FPUTC_UNLOCKED,
+                        "__builtin_fputc_unlocked",
+                        BT_FN_INT_INT_PTR)
+/* Declare the __builtin_ style with arguments and the regular style
+   without them.  We rely on stdio.h to supply the arguments for the
+   regular style declaration since we had to use void* instead of
+   FILE* in the __builtin_ prototype supplied here.  */
+DEF_BUILTIN (BUILT_IN_FPUTS_UNLOCKED,
+            "__builtin_fputs_unlocked",
+            BUILT_IN_NORMAL,
+            BT_FN_INT_CONST_STRING_PTR,
+            BT_FN_INT_VAR,
+            true, true, true)
+DEF_EXT_FALLBACK_BUILTIN(BUILT_IN_FWRITE_UNLOCKED,
+                        "__builtin_fwrite_unlocked",
+                        BT_FN_SIZE_CONST_PTR_SIZE_SIZE_PTR)
+DEF_EXT_FRONT_END_LIB_BUILTIN(BUILT_IN_FPRINTF_UNLOCKED,
+                             "__builtin_fprintf_unlocked",
+                             BT_FN_INT_PTR_CONST_STRING_VAR)
+
   /* ISO C99 floating point unordered comparisons.  */
 DEF_GCC_BUILTIN(BUILT_IN_ISGREATER, 
                "__builtin_isgreater",