@@ -731,6 +731,7 @@ autodepend
731731TAS
732732GCC
733733CPP
734+ CFLAGS_VECTOR
734735SUN_STUDIO_CC
735736OBJEXT
736737EXEEXT
@@ -3944,6 +3945,11 @@ else
39443945 fi
39453946fi
39463947
3948+ # set CFLAGS_VECTOR from the environment, if available
3949+ if test "$ac_env_CFLAGS_VECTOR_set" = set; then
3950+ CFLAGS_VECTOR=$ac_env_CFLAGS_VECTOR_value
3951+ fi
3952+
39473953# Some versions of GCC support some additional useful warning flags.
39483954# Check whether they are supported, and add them to CFLAGS if so.
39493955# ICC pretends to be GCC but it's lying; it doesn't support these flags,
@@ -4376,6 +4382,127 @@ if test x"$pgac_cv_prog_cc_cflags__fexcess_precision_standard" = x"yes"; then
43764382 CFLAGS="$CFLAGS -fexcess-precision=standard"
43774383fi
43784384
4385+ # Optimization flags for specific files that benefit from vectorization
4386+ { $as_echo "$as_me:$LINENO: checking whether $CC supports -funroll-loops" >&5
4387+ $as_echo_n "checking whether $CC supports -funroll-loops... " >&6; }
4388+ if test "${pgac_cv_prog_cc_cflags__funroll_loops+set}" = set; then
4389+ $as_echo_n "(cached) " >&6
4390+ else
4391+ pgac_save_CFLAGS=$CFLAGS
4392+ CFLAGS="$pgac_save_CFLAGS -funroll-loops"
4393+ ac_save_c_werror_flag=$ac_c_werror_flag
4394+ ac_c_werror_flag=yes
4395+ cat >conftest.$ac_ext <<_ACEOF
4396+ /* confdefs.h. */
4397+ _ACEOF
4398+ cat confdefs.h >>conftest.$ac_ext
4399+ cat >>conftest.$ac_ext <<_ACEOF
4400+ /* end confdefs.h. */
4401+
4402+ int
4403+ main ()
4404+ {
4405+
4406+ ;
4407+ return 0;
4408+ }
4409+ _ACEOF
4410+ rm -f conftest.$ac_objext
4411+ if { (ac_try="$ac_compile"
4412+ case "(($ac_try" in
4413+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4414+ *) ac_try_echo=$ac_try;;
4415+ esac
4416+ eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
4417+ $as_echo "$ac_try_echo") >&5
4418+ (eval "$ac_compile") 2>conftest.er1
4419+ ac_status=$?
4420+ grep -v '^ *+' conftest.er1 >conftest.err
4421+ rm -f conftest.er1
4422+ cat conftest.err >&5
4423+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
4424+ (exit $ac_status); } && {
4425+ test -z "$ac_c_werror_flag" ||
4426+ test ! -s conftest.err
4427+ } && test -s conftest.$ac_objext; then
4428+ pgac_cv_prog_cc_cflags__funroll_loops=yes
4429+ else
4430+ $as_echo "$as_me: failed program was:" >&5
4431+ sed 's/^/| /' conftest.$ac_ext >&5
4432+
4433+ pgac_cv_prog_cc_cflags__funroll_loops=no
4434+ fi
4435+
4436+ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4437+ ac_c_werror_flag=$ac_save_c_werror_flag
4438+ CFLAGS="$pgac_save_CFLAGS"
4439+ fi
4440+ { $as_echo "$as_me:$LINENO: result: $pgac_cv_prog_cc_cflags__funroll_loops" >&5
4441+ $as_echo "$pgac_cv_prog_cc_cflags__funroll_loops" >&6; }
4442+ if test x"$pgac_cv_prog_cc_cflags__funroll_loops" = x"yes"; then
4443+ CFLAGS_VECTOR="${CFLAGS_VECTOR} -funroll-loops"
4444+ fi
4445+
4446+ { $as_echo "$as_me:$LINENO: checking whether $CC supports -ftree-vectorize" >&5
4447+ $as_echo_n "checking whether $CC supports -ftree-vectorize... " >&6; }
4448+ if test "${pgac_cv_prog_cc_cflags__ftree_vectorize+set}" = set; then
4449+ $as_echo_n "(cached) " >&6
4450+ else
4451+ pgac_save_CFLAGS=$CFLAGS
4452+ CFLAGS="$pgac_save_CFLAGS -ftree-vectorize"
4453+ ac_save_c_werror_flag=$ac_c_werror_flag
4454+ ac_c_werror_flag=yes
4455+ cat >conftest.$ac_ext <<_ACEOF
4456+ /* confdefs.h. */
4457+ _ACEOF
4458+ cat confdefs.h >>conftest.$ac_ext
4459+ cat >>conftest.$ac_ext <<_ACEOF
4460+ /* end confdefs.h. */
4461+
4462+ int
4463+ main ()
4464+ {
4465+
4466+ ;
4467+ return 0;
4468+ }
4469+ _ACEOF
4470+ rm -f conftest.$ac_objext
4471+ if { (ac_try="$ac_compile"
4472+ case "(($ac_try" in
4473+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4474+ *) ac_try_echo=$ac_try;;
4475+ esac
4476+ eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
4477+ $as_echo "$ac_try_echo") >&5
4478+ (eval "$ac_compile") 2>conftest.er1
4479+ ac_status=$?
4480+ grep -v '^ *+' conftest.er1 >conftest.err
4481+ rm -f conftest.er1
4482+ cat conftest.err >&5
4483+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
4484+ (exit $ac_status); } && {
4485+ test -z "$ac_c_werror_flag" ||
4486+ test ! -s conftest.err
4487+ } && test -s conftest.$ac_objext; then
4488+ pgac_cv_prog_cc_cflags__ftree_vectorize=yes
4489+ else
4490+ $as_echo "$as_me: failed program was:" >&5
4491+ sed 's/^/| /' conftest.$ac_ext >&5
4492+
4493+ pgac_cv_prog_cc_cflags__ftree_vectorize=no
4494+ fi
4495+
4496+ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4497+ ac_c_werror_flag=$ac_save_c_werror_flag
4498+ CFLAGS="$pgac_save_CFLAGS"
4499+ fi
4500+ { $as_echo "$as_me:$LINENO: result: $pgac_cv_prog_cc_cflags__ftree_vectorize" >&5
4501+ $as_echo "$pgac_cv_prog_cc_cflags__ftree_vectorize" >&6; }
4502+ if test x"$pgac_cv_prog_cc_cflags__ftree_vectorize" = x"yes"; then
4503+ CFLAGS_VECTOR="${CFLAGS_VECTOR} -ftree-vectorize"
4504+ fi
4505+
43794506elif test "$ICC" = yes; then
43804507 # Intel's compiler has a bug/misoptimization in checking for
43814508 # division by NAN (NaN == 0), -mp1 fixes it, so add it to the CFLAGS.
46274754
46284755fi
46294756
4757+ CFLAGS_VECTOR=$CFLAGS_VECTOR
4758+
4759+
46304760# supply -g if --enable-debug
46314761if test "$enable_debug" = yes && test "$ac_cv_prog_cc_g" = yes; then
46324762 CFLAGS="$CFLAGS -g"
0 commit comments