This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] Implement vector shift left for Altivec


Hi David,

David Edelsohn <dje@watson.ibm.com> wrote on 21/02/2008 23:08:09:

> Hi, Ira.
>
> Thanks for developing this patch.  Why does altivec.md already implement
> patterns altivec_vrl<VI_char>, altivec_vsl<VI_char>, altivec_vsl,
> lshr<mode>3, and ashr<mode>3, but not ashl<mode>3?

Good question...

> Does Altivec
> vsl{b,h,w} correctly implement the GCC ashlVMM3 semantics?

AFAIU, yes. The only relevant definition that I found is the definition of
ashlm3 here
http://gcc.gnu.org/onlinedocs/gccint/Standard-Names.html#Standard-Names.

>
> Also, the pattern should be placed with the other vsl patterns, not
> breaking the grouping of vsr patterns.

Index: config/rs6000/altivec.md
===================================================================
--- config/rs6000/altivec.md    (revision 132472)
+++ config/rs6000/altivec.md    (working copy)
@@ -1248,6 +1248,14 @@
   "vslo %0,%1,%2"
   [(set_attr "type" "vecperm")])

+(define_insn "ashl<mode>3"
+  [(set (match_operand:VI 0 "register_operand" "=v")
+        (ashift:VI (match_operand:VI 1 "register_operand" "v")
+                   (match_operand:VI 2 "register_operand" "v") ))]
+  "TARGET_ALTIVEC"
+  "vsl<VI_char> %0,%1,%2"
+  [(set_attr "type" "vecsimple")])
+
 (define_insn "lshr<mode>3"
   [(set (match_operand:VI 0 "register_operand" "=v")
         (lshiftrt:VI (match_operand:VI 1 "register_operand" "v"))]

Thanks,
Ira

>
> Thanks, David
>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]