[PATCH] Support simd function declarations via a pre-include. (was: [PATCH][RFC]Overloading intrinsics)

Martin Liška mliska@suse.cz
Wed Nov 14 10:06:00 GMT 2018


Hi.

I'm CCing gcc-patches ML and Jakub, who significantly helped me yesterday. The
idea now is to have a driver search for the math header file. When it exists,
Fortran FE loads the file (via new -fpre-include option).

I can confirm that e.g. roms_r CPU2017 benchmark utilizes couple of simd clones:

$ grep simd *.optimized
analytical.fppized.f90.229t.optimized:  vect__77.555_90 = exp.simdclone.12 (vect__76.554_94);
analytical.fppized.f90.229t.optimized:  vect__322.866_1061 = sin.simdclone.4 (vect__321.865_1062);
bulk_flux.fppized.f90.229t.optimized:  vect__506.784_1887 = pow.simdclone.2 (vect__1057.783_1889, { 1.939999999999999946709294817992486059665679931640625e+0, 1.939999999999999946709294817992486059665679931640625e+0 });
gasdev.fppized.f90.229t.optimized:  vect__66.139_93 = log.simdclone.0 (vect__65.138_94);
lmd_swfrac.fppized.f90.229t.optimized:  vect__84.60_182 = exp.simdclone.0 (vect__83.59_183);
lmd_swfrac.fppized.f90.229t.optimized:  vect__89.69_161 = exp.simdclone.0 (vect__88.68_162);
marxin@marxinbox:~/Programming/cpu2017/benchspec/CPU/554.roms_r/build/build_peak_gcc7-m64.0000> grep simd *.optimized
analytical.fppized.f90.229t.optimized:  vect__77.555_90 = exp.simdclone.12 (vect__76.554_94);
analytical.fppized.f90.229t.optimized:  vect__322.866_1061 = sin.simdclone.4 (vect__321.865_1062);
bulk_flux.fppized.f90.229t.optimized:  vect__506.784_1887 = pow.simdclone.2 (vect__1057.783_1889, { 1.939999999999999946709294817992486059665679931640625e+0, 1.939999999999999946709294817992486059665679931640625e+0 });
gasdev.fppized.f90.229t.optimized:  vect__66.139_93 = log.simdclone.0 (vect__65.138_94);
lmd_swfrac.fppized.f90.229t.optimized:  vect__84.60_182 = exp.simdclone.0 (vect__83.59_183);
lmd_swfrac.fppized.f90.229t.optimized:  vect__89.69_161 = exp.simdclone.0 (vect__88.68_162);

and it also finishes successfully.

Question I have is about default search locations for the header file. On my machine I can
see:
access("/home/marxin/bin/gcc2/lib64/gcc/x86_64-pc-linux-gnu/9.0.0/math-vector-fortran.h", R_OK) = -1 ENOENT (No such file or directory)
access("/home/marxin/bin/gcc2/lib64/gcc/x86_64-pc-linux-gnu/9.0.0/../../../../x86_64-pc-linux-gnu/lib/x86_64-pc-linux-gnu/9.0.0/math-vector-fortran.h", R_OK) = -1 ENOENT (No such file or directory)
access("/home/marxin/bin/gcc2/lib64/gcc/x86_64-pc-linux-gnu/9.0.0/../../../../x86_64-pc-linux-gnu/lib/../lib64/math-vector-fortran.h", R_OK) = -1 ENOENT (No such file or directory)
access("/home/marxin/bin/gcc2/lib64/gcc/x86_64-pc-linux-gnu/9.0.0/../../../x86_64-pc-linux-gnu/9.0.0/math-vector-fortran.h", R_OK) = -1 ENOENT (No such file or directory)
access("/home/marxin/bin/gcc2/lib64/gcc/x86_64-pc-linux-gnu/9.0.0/../../../../lib64/math-vector-fortran.h", R_OK) = -1 ENOENT (No such file or directory)
access("/lib/x86_64-pc-linux-gnu/9.0.0/math-vector-fortran.h", R_OK) = -1 ENOENT (No such file or directory)
access("/lib/../lib64/math-vector-fortran.h", R_OK) = -1 ENOENT (No such file or directory)
access("/usr/lib/x86_64-pc-linux-gnu/9.0.0/math-vector-fortran.h", R_OK) = -1 ENOENT (No such file or directory)
access("/usr/lib/../lib64/math-vector-fortran.h", R_OK) = -1 ENOENT (No such file or directory)
access("/home/marxin/bin/gcc2/lib64/gcc/x86_64-pc-linux-gnu/9.0.0/../../../../x86_64-pc-linux-gnu/lib/math-vector-fortran.h", R_OK) = -1 ENOENT (No such file or directory)
access("/home/marxin/bin/gcc2/lib64/gcc/x86_64-pc-linux-gnu/9.0.0/../../../math-vector-fortran.h", R_OK) = -1 ENOENT (No such file or directory)
access("/lib/math-vector-fortran.h", R_OK) = -1 ENOENT (No such file or directory)
access("/usr/lib/math-vector-fortran.h", R_OK) = -1 ENOENT (No such file or directory)

Aren't these locations desired for libraries, instead of include locations?

Thoughts?
Thanks,
Martin

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Support-simd-function-declarations-via-a-pre-include.patch
Type: text/x-patch
Size: 10977 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20181114/29dad8db/attachment.bin>


More information about the Gcc-patches mailing list