Hi, Add support for some of the vector multiply (sp,dp) operations in the gimple folding. I missed these during an earlier pass that added the other (mule, mulo) multiply operations. This change is covered by the existing testcases for vector folding (gcc.target/powerpc/fold-vec-mul-*.c). Bootstrapped and tested on powerpc64le-unknown-linux-gnu, and powerpc-unknown-linux, (p7,p8le,p8be) with no regressions. Is this OK for trunk? [gcc] 2017-05-10 Will Schmidt <will_schm...@vnet.ibm.com> * config/rs6000/rs6000.c (rs6000_gimple_fold_builtin): Add handling for early GIMPLE expansion of vector multiplies.
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index a1b58e2..c4e03b4 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -16860,6 +16860,17 @@ rs6000_gimple_fold_builtin (gimple_stmt_iterator *gsi) gsi_replace (gsi, g, true); return true; } + case VSX_BUILTIN_XVMULSP: + case VSX_BUILTIN_XVMULDP: + { + arg0 = gimple_call_arg (stmt, 0); + arg1 = gimple_call_arg (stmt, 1); + lhs = gimple_call_lhs (stmt); + gimple *g = gimple_build_assign (lhs, MULT_EXPR, arg0, arg1); + gimple_set_location (g, gimple_location (stmt)); + gsi_replace (gsi, g, true); + return true; + } /* Even element flavors of vec_mul (signed). */ case ALTIVEC_BUILTIN_VMULESB: case ALTIVEC_BUILTIN_VMULESH: