From patchwork Tue Jul 13 03:55:13 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Eric Fisher X-Patchwork-Id: 58702 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 037AEB6F16 for ; Tue, 13 Jul 2010 13:55:44 +1000 (EST) Received: (qmail 7587 invoked by alias); 13 Jul 2010 03:55:41 -0000 Received: (qmail 7578 invoked by uid 22791); 13 Jul 2010 03:55:40 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, TW_SV X-Spam-Check-By: sourceware.org Received: from mail-vw0-f47.google.com (HELO mail-vw0-f47.google.com) (209.85.212.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 13 Jul 2010 03:55:36 +0000 Received: by vws3 with SMTP id 3so5260077vws.20 for ; Mon, 12 Jul 2010 20:55:34 -0700 (PDT) Received: by 10.229.223.201 with SMTP id il9mr8992244qcb.89.1278993334357; Mon, 12 Jul 2010 20:55:34 -0700 (PDT) MIME-Version: 1.0 Received: by 10.229.91.17 with HTTP; Mon, 12 Jul 2010 20:55:13 -0700 (PDT) In-Reply-To: <87r5j8a4m0.fsf@firetop.home> References: <87bpafjsxq.fsf@firetop.home> <87r5j8a4m0.fsf@firetop.home> From: Eric Fisher Date: Tue, 13 Jul 2010 11:55:13 +0800 Message-ID: Subject: Re: [vect] Ask for review and approving the patch about vect and loongson To: Eric Fisher , Richard Guenther , gcc-patches , rdsandiford@googlemail.com Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org 2010/7/13 Richard Sandiford : >>> As far as loongson.patch goes: >>> >>> Index: config/mips/loongson.md >>> =================================================================== >>> --- config/mips/loongson.md     (revision 161865) >>> +++ config/mips/loongson.md     (working copy) >>> @@ -352,6 +352,16 @@ >>>   "pmulh\t%0,%1,%2" >>>   [(set_attr "type" "fmul")]) >>> >>> +;; Standard pattern mulm3 >>> +(define_expand "mul3" >>> +  [(set (match_operand:VH 0 "register_operand" "=f") >>> +        (unspec:VH [(match_operand:VH 1 "register_operand" "f") >>> +                    (match_operand:VH 2 "register_operand" "f")] >>> +                   UNSPEC_LOONGSON_PMULL))] >>> +  "TARGET_HARD_FLOAT && TARGET_LOONGSON_VECTORS" >>> +  "") >>> + >>> + >>>  ;; Multiply signed integers and store low result. >>>  (define_insn "loongson_pmull" >>>   [(set (match_operand:VH 0 "register_operand" "=f") >>> >>> Instead rename loongson_pmull to mul3 and add #defines >>> to mips.c to make CODE_FOR_loongson_pmullh an alias for CODE_FOR_mulhi3, >>> etc.  Grep for CODE_FOR_loongson to see where I mean. >> >> Thanks for the helpful information. I've changed the patch in the attachment. > > Sorry, I forgot to ask you to change the pattern from an UNSPEC to > a MULT at the same time.  The multiplication part is OK with that fixed. Thanks. I've updated the patch in the attachment. BTW, I still don't have svn write access and copyright assignment. :( Regards, Eric Index: config/mips/loongson.md =================================================================== --- config/mips/loongson.md (revision 162065) +++ config/mips/loongson.md (working copy) @@ -31,7 +31,6 @@ UNSPEC_LOONGSON_PMOVMSK UNSPEC_LOONGSON_PMULHU UNSPEC_LOONGSON_PMULH - UNSPEC_LOONGSON_PMULL UNSPEC_LOONGSON_PMULU UNSPEC_LOONGSON_PASUBUB UNSPEC_LOONGSON_BIADD @@ -353,11 +352,10 @@ [(set_attr "type" "fmul")]) ;; Multiply signed integers and store low result. -(define_insn "loongson_pmull" +(define_insn "mul3" [(set (match_operand:VH 0 "register_operand" "=f") - (unspec:VH [(match_operand:VH 1 "register_operand" "f") - (match_operand:VH 2 "register_operand" "f")] - UNSPEC_LOONGSON_PMULL))] + (mult:VH (match_operand:VH 1 "register_operand" "f") + (match_operand:VH 2 "register_operand" "f")))] "TARGET_HARD_FLOAT && TARGET_LOONGSON_VECTORS" "pmull\t%0,%1,%2" [(set_attr "type" "fmul")]) Index: config/mips/mips.c =================================================================== --- config/mips/mips.c (revision 162065) +++ config/mips/mips.c (working copy) @@ -12667,6 +12667,7 @@ AVAIL_NON_MIPS16 (cache, TARGET_CACHE_BU #define CODE_FOR_loongson_pminub CODE_FOR_uminv8qi3 #define CODE_FOR_loongson_pmulhuh CODE_FOR_umulv4hi3_highpart #define CODE_FOR_loongson_pmulhh CODE_FOR_smulv4hi3_highpart +#define CODE_FOR_loongson_pmullh CODE_FOR_mulv4hi3 #define CODE_FOR_loongson_psubw CODE_FOR_subv2si3 #define CODE_FOR_loongson_psubh CODE_FOR_subv4hi3 #define CODE_FOR_loongson_psubb CODE_FOR_subv8qi3