diff gcc/config/arm/neon-testgen.ml @ 63:b7f97abdc517 gcc-4.6-20100522

update gcc from gcc-4.5.0 to gcc-4.6
author ryoma <e075725@ie.u-ryukyu.ac.jp>
date Mon, 24 May 2010 12:47:05 +0900
parents 77e2b8dfacca
children f6334be47118
line wrap: on
line diff
--- a/gcc/config/arm/neon-testgen.ml	Fri Feb 12 23:41:23 2010 +0900
+++ b/gcc/config/arm/neon-testgen.ml	Mon May 24 12:47:05 2010 +0900
@@ -1,5 +1,5 @@
 (* Auto-generate ARM Neon intrinsics tests.
-   Copyright (C) 2006, 2007 Free Software Foundation, Inc.
+   Copyright (C) 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
    Contributed by CodeSourcery.
 
    This file is part of GCC.
@@ -58,7 +58,7 @@
 
 (* Emit declarations of local variables that are going to be passed
    to an intrinsic, together with one to take a returned value if needed.  *)
-let emit_automatics chan c_types =
+let emit_automatics chan c_types features =
   let emit () =
     ignore (
       List.fold_left (fun arg_number -> fun (flags, ty) ->
@@ -75,11 +75,17 @@
   in
     match c_types with
       (_, return_ty) :: tys ->
-        if return_ty <> "void" then
-          (* The intrinsic returns a value.  *)
-          (Printf.fprintf chan "  %s out_%s;\n" return_ty return_ty;
-           emit ())
-        else
+        if return_ty <> "void" then begin
+          (* The intrinsic returns a value.  We need to do explict register
+             allocation for vget_low tests or they fail because of copy
+             elimination.  *)
+          ((if List.mem Fixed_return_reg features then
+              Printf.fprintf chan "  register %s out_%s asm (\"d18\");\n"
+                             return_ty return_ty
+            else
+              Printf.fprintf chan "  %s out_%s;\n" return_ty return_ty);
+	   emit ())
+        end else
           (* The intrinsic does not return a value.  *)
           emit ()
     | _ -> assert false
@@ -257,7 +263,7 @@
     (* Emit file and function prologues.  *)
     emit_prologue chan test_name;
     (* Emit local variable declarations.  *)
-    emit_automatics chan c_types;
+    emit_automatics chan c_types features;
     Printf.fprintf chan "\n";
     (* Emit the call to the intrinsic.  *)
     emit_call chan const_valuator c_types name elt_ty;