From 0da87323bb8260728b90f79bfe21dd6d742c547c Mon Sep 17 00:00:00 2001 From: irar Date: Sun, 7 Sep 2008 08:54:00 +0000 Subject: [PATCH] PR tree-optimization/35642 * config/rs6000/altivec.md (mulv8hi3): Implement. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@140083 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 6 ++++++ gcc/config/rs6000/altivec.md | 22 ++++++++++++++++++++++ gcc/testsuite/ChangeLog | 7 +++++++ gcc/testsuite/lib/target-supports.exp | 3 ++- 4 files changed, 37 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index baa5ec5..5520820 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2008-09-07 Dorit Nuzman + Ira Rosen + + PR tree-optimization/35642 + * config/rs6000/altivec.md (mulv8hi3): Implement. + 2008-09-06 Jeff Law * h8300.h (IRA_COVER_CLASSES): Define. 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" diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index a947f93..0ba477c 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,10 @@ +2008-09-07 Dorit Nuzman + Ira Rosen + + PR tree-optimization/35642 + * lib/target-supports.exp (check_effective_target_vect_short_mult): + Add powerpc. + 2008-09-07 Victor Kaplansky PR testsuite/37334 diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index 925c892..2965064 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -2093,7 +2093,8 @@ proc check_effective_target_vect_short_mult { } { if { [istarget ia64-*-*] || [istarget spu-*-*] || [istarget i?86-*-*] - || [istarget x86_64-*-*] } { + || [istarget x86_64-*-*] + || [istarget powerpc*-*-*] } { set et_vect_short_mult_saved 1 } } -- 2.7.4