OSDN Git Service

2003-04-24 H.J. Lu <hjl@gnu.org>
authorhjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 24 Apr 2003 17:23:57 +0000 (17:23 +0000)
committerhjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 24 Apr 2003 17:23:57 +0000 (17:23 +0000)
* config/ia64/ia64.c (ia64_init_builtins): Add si_ftype_pdi_di_di
for __sync_bool_compare_and_swap_di for int return type.

* config/ia64/ia64intrin.h (__sync_bool_compare_and_swap_di):
Change return type to int.
(__sync_bool_compare_and_swap): Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@66042 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/ia64/ia64.c
gcc/config/ia64/ia64intrin.h

index 9c916bb..0de008c 100644 (file)
@@ -1,3 +1,12 @@
+2003-04-24  H.J. Lu <hjl@gnu.org>
+
+       * config/ia64/ia64.c (ia64_init_builtins): Add si_ftype_pdi_di_di
+       for __sync_bool_compare_and_swap_di for int return type.
+
+       * config/ia64/ia64intrin.h (__sync_bool_compare_and_swap_di):
+       Change return type to int.
+       (__sync_bool_compare_and_swap): Likewise.
+
 Thu Apr 24 16:55:26 CEST 2003  Jan Hubicka  <jh@suse.cz>
 
        * cfgbuild.c (make_edges):  Do not use next_nonnote_insn when
index ff290bd..7eb3d2a 100644 (file)
@@ -7730,11 +7730,16 @@ ia64_init_builtins ()
                                psi_type_node, integer_type_node,
                                integer_type_node, NULL_TREE);
 
-  /* __sync_val_compare_and_swap_di, __sync_bool_compare_and_swap_di */
+  /* __sync_val_compare_and_swap_di */
   tree di_ftype_pdi_di_di
     = build_function_type_list (long_integer_type_node,
                                pdi_type_node, long_integer_type_node,
                                long_integer_type_node, NULL_TREE);
+  /* __sync_bool_compare_and_swap_di */
+  tree si_ftype_pdi_di_di
+    = build_function_type_list (integer_type_node,
+                               pdi_type_node, long_integer_type_node,
+                               long_integer_type_node, NULL_TREE);
   /* __sync_synchronize */
   tree void_ftype_void
     = build_function_type (void_type_node, void_list_node);
@@ -7767,7 +7772,7 @@ ia64_init_builtins ()
               IA64_BUILTIN_VAL_COMPARE_AND_SWAP_DI);
   def_builtin ("__sync_bool_compare_and_swap_si", si_ftype_psi_si_si,
               IA64_BUILTIN_BOOL_COMPARE_AND_SWAP_SI);
-  def_builtin ("__sync_bool_compare_and_swap_di", di_ftype_pdi_di_di,
+  def_builtin ("__sync_bool_compare_and_swap_di", si_ftype_pdi_di_di,
               IA64_BUILTIN_BOOL_COMPARE_AND_SWAP_DI);
 
   def_builtin ("__sync_synchronize", void_ftype_void,
index c7bbd33..262dc20 100644 (file)
@@ -19,13 +19,11 @@ extern long __sync_val_compare_and_swap_di (long *, long, long);
     __sync_val_compare_and_swap_di((long *)(PTR),(long)(OLD),(long)(NEW)))
 
 extern int __sync_bool_compare_and_swap_si (int *, int, int);
-extern long __sync_bool_compare_and_swap_di (long *, long, long);
+extern int __sync_bool_compare_and_swap_di (long *, long, long);
 #define __sync_bool_compare_and_swap(PTR, OLD, NEW)                    \
  ((sizeof (*(PTR)) == sizeof(int))                                     \
-  ? (__typeof__(*(PTR)))                                               \
-    __sync_bool_compare_and_swap_si((int *)(PTR),(int)(OLD),(int)(NEW))        \
-  : (__typeof__(*(PTR)))                                               \
-    __sync_bool_compare_and_swap_di((long *)(PTR),(long)(OLD),(long)(NEW)))
+  ? __sync_bool_compare_and_swap_si((int *)(PTR),(int)(OLD),(int)(NEW))        \
+  : __sync_bool_compare_and_swap_di((long *)(PTR),(long)(OLD),(long)(NEW)))
 
 extern void __sync_lock_release_si (int *);
 extern void __sync_lock_release_di (long *);