This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[tree-ssa/f95] fix some clz tests


I failed to notice, testing on Alpha, that we wanted DImode
extractions.  This fixes a number of tests on x86.


r~


        * f95-lang.c (gfc_init_builtin_functions): Add clzll.
        * trans-intrinsic.c (call_builtin_clz): Use it.

Index: f95-lang.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fortran/Attic/f95-lang.c,v
retrieving revision 1.1.2.9
diff -c -p -d -r1.1.2.9 f95-lang.c
*** f95-lang.c	5 Oct 2003 20:58:03 -0000	1.1.2.9
--- f95-lang.c	6 Oct 2003 18:00:12 -0000
*************** gfc_init_builtin_functions (void)
*** 856,861 ****
--- 856,865 ----
    tmp = tree_cons (NULL_TREE, long_integer_type_node, voidchain);
    ftype = build_function_type (integer_type_node, tmp);
    gfc_define_builtin ("__builtin_clzl", ftype, BUILT_IN_CLZL, "clzl");
+ 
+   tmp = tree_cons (NULL_TREE, long_long_integer_type_node, voidchain);
+   ftype = build_function_type (integer_type_node, tmp);
+   gfc_define_builtin ("__builtin_clzll", ftype, BUILT_IN_CLZLL, "clzll");
  }
  
  #undef DEFINE_MATH_BUILTIN
Index: trans-intrinsic.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fortran/Attic/trans-intrinsic.c,v
retrieving revision 1.1.2.11
diff -c -p -d -r1.1.2.11 trans-intrinsic.c
*** trans-intrinsic.c	28 Sep 2003 06:07:42 -0000	1.1.2.11
--- trans-intrinsic.c	6 Oct 2003 18:00:13 -0000
*************** static tree
*** 2254,2264 ****
  call_builtin_clz (tree result_type, tree op0)
  {
    tree fn, parms, call;
  
!   if (TYPE_MODE (TREE_TYPE (op0)) == TYPE_MODE (integer_type_node))
      fn = built_in_decls[BUILT_IN_CLZ];
!   else if (TYPE_MODE (TREE_TYPE (op0)) == TYPE_MODE (long_integer_type_node))
      fn = built_in_decls[BUILT_IN_CLZL];
    else
      abort ();
  
--- 2254,2267 ----
  call_builtin_clz (tree result_type, tree op0)
  {
    tree fn, parms, call;
+   enum machine_mode op0_mode = TYPE_MODE (TREE_TYPE (op0));
  
!   if (op0_mode == TYPE_MODE (integer_type_node))
      fn = built_in_decls[BUILT_IN_CLZ];
!   else if (op0_mode == TYPE_MODE (long_integer_type_node))
      fn = built_in_decls[BUILT_IN_CLZL];
+   else if (op0_mode == TYPE_MODE (long_long_integer_type_node))
+     fn = built_in_decls[BUILT_IN_CLZLL];
    else
      abort ();
  


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]