From patchwork Mon Jun 11 08:37:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Hua X-Patchwork-Id: 927526 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-479428-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="C2tBRaPt"; dkim-atps=neutral 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 4145zr02dLz9ryk for ; Mon, 11 Jun 2018 18:39:50 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:from:date:message-id:subject:to:cc:content-type; q=dns; s=default; b=NdpcbpNIZl/zSsWi6aGXQOoaieNk3q2JWwMFHzApuEE XVlqoSguj7QIzZzn/DxQcSIVpHdtBY1pfi1BbUGOEsveHjwVTg7eIKcGGpOKEWzg 5JUn82wMdepG0sy7TAo2+TdhWPlQSluFMXQJuyZpfUhnBb3sYePDP36uUEIQ0b3s = 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 :mime-version:from:date:message-id:subject:to:cc:content-type; s=default; bh=ftQrI1FUL102Whf5FmMDvJojdDo=; b=C2tBRaPt5485EN+Vi WPcBtkCW0jeTgVrJLQpZkY0P2LyxZVl41iXUqF/yc84YowBcwv8cRiJ2j5Lr7MHY N/FIz30RFJx/swLkfGe1a+q/Wr31irPr5/NOzcGub5dnpV14XN7TEqh7bjP186H1 gF6mQ1g68Keo/zfpLjTUmlEOQ8= Received: (qmail 16769 invoked by alias); 11 Jun 2018 08:38:39 -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 16386 invoked by uid 89); 11 Jun 2018 08:37:42 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.2 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=mistake, reg-tested, H*r:sk:t133-v6, Hx-languages-length:1600 X-HELO: mail-oi0-f51.google.com Received: from mail-oi0-f51.google.com (HELO mail-oi0-f51.google.com) (209.85.218.51) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 11 Jun 2018 08:37:39 +0000 Received: by mail-oi0-f51.google.com with SMTP id t133-v6so17131315oif.10 for ; Mon, 11 Jun 2018 01:37:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=toQB8kpm25ymA/ym2zis9qJCIE0lw5P3z+w9JfDD++s=; b=fgNVWwKIQuBkwK/sSB/O5nXojvNVBXyAtHZQwty0UAJ1UFmTOzo6t+igbh/kRLIVeY Jw81O/PsdVzvjUTHILLpY69pbT6fslY3LuxDcxxirolKsNW4gdidDKxNWF1oRLejcpjO Gc6JzyfVTkGHsMEgIrPskb4NUTJ7y7xYW0kbdEYYfltzMl6jrQP7Kkbq2K+AEBqIO1Yh 2dLcUIvWzehEbiQyRJg9I0jB1K5mQCwDkWL9+RCRcBbcvH7xCF/BxLs24nXgCUh2qs3S NVIr19UR607owNkVv9ugrVJNyeZ82Ux9KRNP5DUh7490RQ7nnzwKS63Xq917xC36/YAW 4PgQ== X-Gm-Message-State: APt69E1DeIrOuVgFX0HwdMjP25SI/OSRF9anc8M3KChuGHmpLBy04/R6 ixnfWUnbZPAllJYrsqP8HDh4TZedFlo93pAWK2trEw== X-Google-Smtp-Source: ADUXVKJkYJ5odUYPOg8tl9pw+YRhq8yKs/vcwIBbaeUz6EDacUkN6nsA43kbQ5G1pwZRzsWLtKyF5hUlPWfclPOSVOI= X-Received: by 2002:aca:cd4d:: with SMTP id d74-v6mr8537142oig.170.1528706256990; Mon, 11 Jun 2018 01:37:36 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a4a:6b0f:0:0:0:0:0 with HTTP; Mon, 11 Jun 2018 01:37:36 -0700 (PDT) From: Paul Hua Date: Mon, 11 Jun 2018 16:37:36 +0800 Message-ID: Subject: [PATCH, MIPS] Fix pr86067 ICE: scal-to-vec1.c:86:1: error: unrecognizable insn with -march=loongson3a To: gcc-patches Cc: Matthew Fortune X-IsSubscribed: yes Hi: The gcc.c-torture/execute/scal-to-vec1.c trigger a gcc ICE bug. It's a mistake in define_expand vec_setv4hi in loongson.md file. 375 (define_expand "vec_setv4hi" 376 [(set (match_operand:V4HI 0 "register_operand" "=f") 377 (unspec:V4HI [(match_operand:V4HI 1 "register_operand" "f") 378 (match_operand:HI 2 "register_operand" "f") 379 (match_operand:SI 3 "const_0_to_3_operand" "")] 380 UNSPEC_LOONGSON_PINSRH))] 381 "TARGET_HARD_FLOAT && TARGET_LOONGSON_VECTORS" 382 { 383 rtx ext = gen_reg_rtx (SImode); 384 emit_move_insn (ext, gen_lowpart (SImode, operands[1])); 385 operands[1] = ext; 386 }) The line 384 gen_lowpart the operands[1], should be gen_lowpart operands[2], cause the operands[2] are HImode. The attached patch fixed this bug. Bootstrapped and reg-tested on mips64el-unknown-linux-gnu. Ok for commit ? ------------------------------- 2018-03-24 Chenghua Xu PR c/target 86076 * gcc/config/mips/loongson.md (vec_setv4hi): Gen_lowpart for operands[2] instead of operands[1]. diff --git a/gcc/config/mips/loongson.md b/gcc/config/mips/loongson.md index 38912ac..14794d3 100644 --- a/gcc/config/mips/loongson.md +++ b/gcc/config/mips/loongson.md @@ -381,8 +381,8 @@ "TARGET_HARD_FLOAT && TARGET_LOONGSON_VECTORS" { rtx ext = gen_reg_rtx (SImode); - emit_move_insn (ext, gen_lowpart (SImode, operands[1])); - operands[1] = ext; + emit_move_insn (ext, gen_lowpart (SImode, operands[2])); + operands[2] = ext; }) ;; Multiply and add packed integers.