From patchwork Tue Jul 23 10:51:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mihailo Stojanovic X-Patchwork-Id: 1135574 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-505536-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=rt-rk.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="bAlgniT9"; 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 45tFfW6tFzz9s4Y for ; Tue, 23 Jul 2019 20:52:01 +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:from :to:cc:subject:date:message-id; q=dns; s=default; b=mM/eZgcf9ZTV bPk0W3ehuNEI71gFg8L27AebL63ThvIcS5ObWE992wErfq8fyblL8BTJvsGRgOIO x9pHp2eYphRDGyJ6bjYSskKxs2eam0mMjJrD8jxOPKc2W6ccP6UqPLIDcizPaERp zMpTkaOmrsyKXdRjejTHyFHQyOEAL2Y= 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:from :to:cc:subject:date:message-id; s=default; bh=w1N54CM8/F99J+OpVP daOl0OGmo=; b=bAlgniT9g9lbuvBJIdX3qMMNTKy0GD1wHu/NFCLhm49TXbYoXb qnUfy42+CEmyZfSvyCTCQiJ99eW0TSdB3F72V46rxs4QiQWujjwUDMD2ARO7NjqJ /V6uz3T8sMN/yWEeLQn04tjH8lnHWPB4pOIr++w9MQxMCLZtypoVmpCZw= Received: (qmail 49886 invoked by alias); 23 Jul 2019 10:51:54 -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 49878 invoked by uid 89); 23 Jul 2019 10:51:54 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-18.0 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=031 X-HELO: mail.rt-rk.com Received: from mx2.rt-rk.com (HELO mail.rt-rk.com) (89.216.37.149) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 23 Jul 2019 10:51:52 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.rt-rk.com (Postfix) with ESMTP id 47EA81A1F8F; Tue, 23 Jul 2019 12:51:48 +0200 (CEST) Received: from rtrkw790-lin.domain.local (rtrkw790-lin.domain.local [192.168.237.60]) by mail.rt-rk.com (Postfix) with ESMTPSA id 30C981A1E7A; Tue, 23 Jul 2019 12:51:48 +0200 (CEST) From: Mihailo Stojanovic To: gcc-patches@gcc.gnu.org Cc: Matthew Fortune , Mihailo Stojanovic Subject: [PATCH] [MIPS] Add machine mode to get_fcsr pattern operand Date: Tue, 23 Jul 2019 12:51:17 +0200 Message-Id: <1563879077-27095-1-git-send-email-mihailo.stojanovic@rt-rk.com> From: Mihailo Stojanovic Hi, Missing machine mode for the unspec_volatile operand of get_fcsr patterns causes an ICE in simplify_subreg on n64 ABI. This adds the missing machine modes and a new test. Tested on mips64el-mti-linux-gnu. Ok for trunk and possibly backport? Cheers, Mihailo gcc/ * config/mips/mips.md (mips_get_fcsr, *mips_get_fcsr): Use SI machine mode for unspec_volatile operand. * testsuite/gcc.target/mips/get-fcsr-3.c: New test. --- gcc/config/mips/mips.md | 4 ++-- gcc/testsuite/gcc.target/mips/get-fcsr-3.c | 9 +++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 gcc/testsuite/gcc.target/mips/get-fcsr-3.c diff --git a/gcc/config/mips/mips.md b/gcc/config/mips/mips.md index e17b1d5..abc8485e 100644 --- a/gcc/config/mips/mips.md +++ b/gcc/config/mips/mips.md @@ -7588,7 +7588,7 @@ ;; __builtin_mips_get_fcsr: move the FCSR into operand 0. (define_expand "mips_get_fcsr" [(set (match_operand:SI 0 "register_operand") - (unspec_volatile [(const_int 0)] UNSPEC_GET_FCSR))] + (unspec_volatile:SI [(const_int 0)] UNSPEC_GET_FCSR))] "TARGET_HARD_FLOAT_ABI" { if (TARGET_MIPS16) @@ -7600,7 +7600,7 @@ (define_insn "*mips_get_fcsr" [(set (match_operand:SI 0 "register_operand" "=d") - (unspec_volatile [(const_int 0)] UNSPEC_GET_FCSR))] + (unspec_volatile:SI [(const_int 0)] UNSPEC_GET_FCSR))] "TARGET_HARD_FLOAT" "cfc1\t%0,$31") diff --git a/gcc/testsuite/gcc.target/mips/get-fcsr-3.c b/gcc/testsuite/gcc.target/mips/get-fcsr-3.c new file mode 100644 index 0000000..7bb97b6 --- /dev/null +++ b/gcc/testsuite/gcc.target/mips/get-fcsr-3.c @@ -0,0 +1,9 @@ +/* { dg-options "-mabi=64 -mhard-float" } */ + +NOMIPS16 unsigned int +foo (void) +{ + return __builtin_mips_get_fcsr () & 0x1; +} + +/* { dg-final { scan-assembler "cfc1" } } */