diff options
author | Martin Liska <mliska@suse.cz> | 2018-11-27 14:06:48 +0100 |
---|---|---|
committer | Martin Liska <marxin@gcc.gnu.org> | 2018-11-27 13:06:48 +0000 |
commit | facf0354cfdaa555f376311b9d3c8fec79747f09 (patch) | |
tree | 3ef0c2c2a134b5685f82b8144402a410645d79a7 /gcc/gcc.c | |
parent | 2ff5ffb623e17b6bb81532394cb1f42fe7b354c8 (diff) | |
download | gcc-facf0354cfdaa555f376311b9d3c8fec79747f09.zip gcc-facf0354cfdaa555f376311b9d3c8fec79747f09.tar.gz gcc-facf0354cfdaa555f376311b9d3c8fec79747f09.tar.bz2 |
Support simd function declarations via a pre-include.
2018-11-27 Martin Liska <mliska@suse.cz>
* config/gnu-user.h (TARGET_F951_OPTIONS): New.
* gcc.c (find_fortran_preinclude_file): New function
to handle Fortran pre-include.
2018-11-27 Martin Liska <mliska@suse.cz>
* decl.c (gfc_match_gcc_builtin): New function.
* gfortran.h (struct vect_builtin_tuple): New.
(gfc_adjust_builtins): Likewise.
* lang-specs.h (TARGET_F951_OPTIONS): New.
(F951_OPTIONS): Use it.
* lang.opt: Add new option -fpre-include.
* match.h (gfc_match_gcc_builtin): Declare new function.
* parse.c (decode_gcc_attribute): Handle builtin.
(parse_progunit): Call gfc_adjust_builtins.
* scanner.c (gfc_new_file): Load pre-included header file
when provided.
* trans-intrinsic.c (add_simd_flag_for_built_in): New.
(gfc_adjust_builtins): Likewise.
2018-11-27 Martin Liska <mliska@suse.cz>
* gfortran.dg/simd-builtins-1.f90: New test.
* gfortran.dg/simd-builtins-1.h: New test.
* gfortran.dg/simd-builtins-2.f90: New test.
* gfortran.dg/simd-builtins-3.f90: New test.
* gfortran.dg/simd-builtins-3.h: New test.
* gfortran.dg/simd-builtins-4.f: New test.
* gfortran.dg/simd-builtins-4.h: New test.
* gfortran.dg/simd-builtins-5.f: New test.
* gfortran.dg/simd-builtins-6.f90: New test.
From-SVN: r266509
Diffstat (limited to 'gcc/gcc.c')
-rw-r--r-- | gcc/gcc.c | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -408,6 +408,7 @@ static const char *pass_through_libs_spec_func (int, const char **); static const char *replace_extension_spec_func (int, const char **); static const char *greater_than_spec_func (int, const char **); static const char *debug_level_greater_than_spec_func (int, const char **); +static const char *find_fortran_preinclude_file (int, const char **); static char *convert_white_space (char *); /* The Specs Language @@ -1647,6 +1648,7 @@ static const struct spec_function static_spec_functions[] = { "replace-extension", replace_extension_spec_func }, { "gt", greater_than_spec_func }, { "debug-level-gt", debug_level_greater_than_spec_func }, + { "fortran-preinclude-file", find_fortran_preinclude_file}, #ifdef EXTRA_SPEC_FUNCTIONS EXTRA_SPEC_FUNCTIONS #endif @@ -9894,6 +9896,23 @@ debug_level_greater_than_spec_func (int argc, const char **argv) return NULL; } +/* The function takes 2 arguments: OPTION name and file name. + When the FILE is found by find_file, return OPTION=path_to_file. */ + +static const char * +find_fortran_preinclude_file (int argc, const char **argv) +{ + if (argc != 2) + return NULL; + + const char *path = find_a_file (&include_prefixes, argv[1], R_OK, true); + if (path != NULL) + return concat (argv[0], path, NULL); + + return NULL; +} + + /* Insert backslash before spaces in ORIG (usually a file path), to avoid being broken by spec parser. |