From patchwork Tue Jul 21 12:54:17 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Georg-Johann Lay X-Patchwork-Id: 498206 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]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id A8569140DF7 for ; Tue, 21 Jul 2015 22:54:50 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=P0ryZukx; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to:cc :from:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=hLPC9/LdFnTVoCtf7Jzq/jOrmhp8cIS0QXht8bONV9Myoac5R2 OCPdo/PCyVJ4gjXlDQEpLYTJcGa517ISOMJKzI6BQMJRvMLX2O4RSfhaVq5RxNBG zseeLvfaFu6R+A8wBsXYHWyVBA2NTZTRRzNBnjQYo8do6WbGCQ20FiPZw= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to:cc :from:subject:message-id:date:mime-version:content-type; s= default; bh=7BO75S1TIyFBIsnUiGCkOf5V01M=; b=P0ryZukxsl9nGhOpPqeD Frt2rIycutG0NwgUAaesBAnUNtyeVg0twdHqNCo1Nz3j1TIw+GkaMJhiIuOy9pwY BAnwsYWP5T6Vb0OIfxF4y36PDfEsWRoBzr2OUWi/GenE9Y8YKCHjEx50AOEqvokZ xzuL2MRtEZSbqCPiX340EdM= Received: (qmail 48364 invoked by alias); 21 Jul 2015 12:54:41 -0000 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 Received: (qmail 47649 invoked by uid 89); 21 Jul 2015 12:54:41 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.1 required=5.0 tests=AWL, BAYES_50, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 X-HELO: mo4-p00-ob.smtp.rzone.de Received: from mo4-p00-ob.smtp.rzone.de (HELO mo4-p00-ob.smtp.rzone.de) (81.169.146.219) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Tue, 21 Jul 2015 12:54:39 +0000 X-RZG-AUTH: :LXoWVUeid/7A29J/hMvvT3ol15ykJcYwTPbBBR62PQx1xqvTHw== X-RZG-CLASS-ID: mo00 Received: from [192.168.0.22] (ip5b43a95f.dynamic.kabel-deutschland.de [91.67.169.95]) by smtp.strato.de (RZmta 37.8 DYNA|AUTH) with ESMTPSA id 605908r6LCsalaZ (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA (curve secp521r1 with 521 ECDH bits, eq. 15360 bits RSA)) (Client did not present a certificate); Tue, 21 Jul 2015 14:54:36 +0200 (CEST) To: GCC Patches Cc: Denis Chertykov From: Georg-Johann Lay Subject: [patch, avr] Fix PR66956: Uses 32->64 widening mul instead of 32-bit mul libcall without MUL. Message-ID: <55AE40F9.10500@gjlay.de> Date: Tue, 21 Jul 2015 14:54:17 +0200 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:38.0) Gecko/20100101 Thunderbird/38.0.1 MIME-Version: 1.0 X-IsSubscribed: yes This works around an assumption in optabs, namely that if a widening-mul insn is available but no mul3 insn, then the widening multiplication insn is preferred over expanding the multiply as a libcall. The problem occurs only if !AVR_HAVE_MUL, so I added that condition to respective mulsidi3 patterns in avr-dimode.md. Ok for trunk, 5-branch and 4_9-branch? PR target/66956 * config/avr/avr-dimode.md (mulsidi3_insn) (mulsidi3): Don't use if !AVR_HAVE_MUL. Index: avr-dimode.md =================================================================== --- avr-dimode.md (revision 226011) +++ avr-dimode.md (working copy) @@ -461,7 +461,8 @@ (define_expand "mulsidi3" (match_operand:SI 2 "general_operand" "") ;; Just to mention the iterator (clobber (any_extend:SI (match_dup 1)))])] - "avr_have_dimode" + "avr_have_dimode + && AVR_HAVE_MUL" { avr_fix_inputs (operands, 1 << 2, regmask (SImode, 22)); emit_move_insn (gen_rtx_REG (SImode, 22), operands[1]); @@ -480,7 +481,8 @@ (define_insn "mulsidi3_insn" (any_extend:DI (reg:SI 22)))) (clobber (reg:HI REG_X)) (clobber (reg:HI REG_Z))] - "avr_have_dimode" + "avr_have_dimode + && AVR_HAVE_MUL" "%~call __mulsidi3" [(set_attr "adjust_len" "call") (set_attr "cc" "clobber")])