Mercurial > hg > CbC > CbC_gcc
comparison 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 |
comparison
equal
deleted
inserted
replaced
56:3c8a44c06a95 | 63:b7f97abdc517 |
---|---|
1 (* Auto-generate ARM Neon intrinsics tests. | 1 (* Auto-generate ARM Neon intrinsics tests. |
2 Copyright (C) 2006, 2007 Free Software Foundation, Inc. | 2 Copyright (C) 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. |
3 Contributed by CodeSourcery. | 3 Contributed by CodeSourcery. |
4 | 4 |
5 This file is part of GCC. | 5 This file is part of GCC. |
6 | 6 |
7 GCC is free software; you can redistribute it and/or modify it under | 7 GCC is free software; you can redistribute it and/or modify it under |
56 Printf.fprintf chan "\n#include \"arm_neon.h\"\n\n"; | 56 Printf.fprintf chan "\n#include \"arm_neon.h\"\n\n"; |
57 Printf.fprintf chan "void test_%s (void)\n{\n" test_name | 57 Printf.fprintf chan "void test_%s (void)\n{\n" test_name |
58 | 58 |
59 (* Emit declarations of local variables that are going to be passed | 59 (* Emit declarations of local variables that are going to be passed |
60 to an intrinsic, together with one to take a returned value if needed. *) | 60 to an intrinsic, together with one to take a returned value if needed. *) |
61 let emit_automatics chan c_types = | 61 let emit_automatics chan c_types features = |
62 let emit () = | 62 let emit () = |
63 ignore ( | 63 ignore ( |
64 List.fold_left (fun arg_number -> fun (flags, ty) -> | 64 List.fold_left (fun arg_number -> fun (flags, ty) -> |
65 let pointer_bit = | 65 let pointer_bit = |
66 if List.mem Pointer flags then "*" else "" | 66 if List.mem Pointer flags then "*" else "" |
73 arg_number + 1) | 73 arg_number + 1) |
74 0 (List.tl c_types)) | 74 0 (List.tl c_types)) |
75 in | 75 in |
76 match c_types with | 76 match c_types with |
77 (_, return_ty) :: tys -> | 77 (_, return_ty) :: tys -> |
78 if return_ty <> "void" then | 78 if return_ty <> "void" then begin |
79 (* The intrinsic returns a value. *) | 79 (* The intrinsic returns a value. We need to do explict register |
80 (Printf.fprintf chan " %s out_%s;\n" return_ty return_ty; | 80 allocation for vget_low tests or they fail because of copy |
81 emit ()) | 81 elimination. *) |
82 else | 82 ((if List.mem Fixed_return_reg features then |
83 Printf.fprintf chan " register %s out_%s asm (\"d18\");\n" | |
84 return_ty return_ty | |
85 else | |
86 Printf.fprintf chan " %s out_%s;\n" return_ty return_ty); | |
87 emit ()) | |
88 end else | |
83 (* The intrinsic does not return a value. *) | 89 (* The intrinsic does not return a value. *) |
84 emit () | 90 emit () |
85 | _ -> assert false | 91 | _ -> assert false |
86 | 92 |
87 (* Emit code to call an intrinsic. *) | 93 (* Emit code to call an intrinsic. *) |
255 (analyze_all_shapes features shape analyze_shape) | 261 (analyze_all_shapes features shape analyze_shape) |
256 in | 262 in |
257 (* Emit file and function prologues. *) | 263 (* Emit file and function prologues. *) |
258 emit_prologue chan test_name; | 264 emit_prologue chan test_name; |
259 (* Emit local variable declarations. *) | 265 (* Emit local variable declarations. *) |
260 emit_automatics chan c_types; | 266 emit_automatics chan c_types features; |
261 Printf.fprintf chan "\n"; | 267 Printf.fprintf chan "\n"; |
262 (* Emit the call to the intrinsic. *) | 268 (* Emit the call to the intrinsic. *) |
263 emit_call chan const_valuator c_types name elt_ty; | 269 emit_call chan const_valuator c_types name elt_ty; |
264 (* Emit the function epilogue and the DejaGNU scan-assembler directives. *) | 270 (* Emit the function epilogue and the DejaGNU scan-assembler directives. *) |
265 emit_epilogue chan features regexps; | 271 emit_epilogue chan features regexps; |