summaryrefslogtreecommitdiff
path: root/gcc/config/rs6000/altivec.md
diff options
context:
space:
mode:
authorirar <irar@138bc75d-0d04-0410-961f-82ee72b054a4>2008-09-07 08:54:00 +0000
committerirar <irar@138bc75d-0d04-0410-961f-82ee72b054a4>2008-09-07 08:54:00 +0000
commit0da87323bb8260728b90f79bfe21dd6d742c547c (patch)
treef05693dc559cf15edd83dca04f265331b78e174e /gcc/config/rs6000/altivec.md
parenta97595e6964930a0b76d1b769410c10b17752de8 (diff)
downloadgcc-0da87323bb8260728b90f79bfe21dd6d742c547c.tar.gz
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
Diffstat (limited to 'gcc/config/rs6000/altivec.md')
-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 e8028edf067..5edd248b722 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"