aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/rs6000
diff options
context:
space:
mode:
authorDorit Nuzman <dorit@il.ibm.com>2008-09-07 08:54:00 +0000
committerIra Rosen <irar@gcc.gnu.org>2008-09-07 08:54:00 +0000
commitcc54af2085468f38cb4ce0b7f8a644a17ac9dd20 (patch)
treef05693dc559cf15edd83dca04f265331b78e174e /gcc/config/rs6000
parentc0cf64a28761cb9014cc03f064159af02c5b12aa (diff)
downloadgcc-cc54af2085468f38cb4ce0b7f8a644a17ac9dd20.zip
gcc-cc54af2085468f38cb4ce0b7f8a644a17ac9dd20.tar.gz
gcc-cc54af2085468f38cb4ce0b7f8a644a17ac9dd20.tar.bz2
re PR tree-optimization/35642 (short * short multiplication not vectorized on Power)
PR tree-optimization/35642 * config/rs6000/altivec.md (mulv8hi3): Implement. Co-Authored-By: Ira Rosen <irar@il.ibm.com> From-SVN: r140083
Diffstat (limited to 'gcc/config/rs6000')
-rw-r--r--gcc/config/rs6000/altivec.md22
1 files changed, 22 insertions, 0 deletions
diff --git a/gcc/config/rs6000/altivec.md b/gcc/config/rs6000/altivec.md
index e8028ed..5edd248 100644
--- a/gcc/config/rs6000/altivec.md
+++ b/gcc/config/rs6000/altivec.md
@@ -647,6 +647,28 @@
DONE;
}")
+(define_expand "mulv8hi3"
+ [(use (match_operand:V8HI 0 "register_operand" ""))
+ (use (match_operand:V8HI 1 "register_operand" ""))
+ (use (match_operand:V8HI 2 "register_operand" ""))]
+ "TARGET_ALTIVEC"
+ "
+{
+ rtx odd = gen_reg_rtx (V4SImode);
+ rtx even = gen_reg_rtx (V4SImode);
+ rtx high = gen_reg_rtx (V4SImode);
+ rtx low = gen_reg_rtx (V4SImode);
+
+ emit_insn (gen_altivec_vmulesh (even, operands[1], operands[2]));
+ emit_insn (gen_altivec_vmulosh (odd, operands[1], operands[2]));
+
+ emit_insn (gen_altivec_vmrghw (high, even, odd));
+ emit_insn (gen_altivec_vmrglw (low, even, odd));
+
+ emit_insn (gen_altivec_vpkuwum (operands[0], high, low));
+
+ DONE;
+}")
;; Fused multiply subtract
(define_insn "altivec_vnmsubfp"