From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com [IPv6:2a00:1450:4864:20::42b]) by sourceware.org (Postfix) with ESMTPS id 73C96386F833 for ; Tue, 21 Jul 2020 18:23:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 73C96386F833 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=mittosystems.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=jozef.l@mittosystems.com Received: by mail-wr1-x42b.google.com with SMTP id q5so22115084wru.6 for ; Tue, 21 Jul 2020 11:23:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mittosystems.com; s=google; h=date:from:to:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to; bh=ji+9u+B2b+48oQQSrYkG/GcYO4APmhSwnnsgIexcVoo=; b=hAmv503Kde55CK9aFLtLUt/UtPuBvZv0xHni00DtRb6mhKVFI1BuF9tAzohQE7SQQK hOG4HJiMPZAVuF4ZGHZ4fbhgiUWspFtAvbusgk4SrnIKrDxYZtg7kJmcBRA4zmKM+LLh ul3PlZyr1DMcns/4UDIA00P90Hc2IsrEHyg0XixAu3DZr+vW68nDQ7FF22wQ81FGh8qF /xYgbou05Jwadg3g7kE07YDyDEJy6OQXap6v8ZQkusPaQ11GpqRkazrM7a9uPgF7NUib TUC3VoEcSOkIq+xvfqcL3Wcf9pHrfi/6cXUg0j1Zi+WKf8gL1JEXXcUQYmmUQyf4UCf3 LGhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:mail-followup-to :references:mime-version:content-disposition:in-reply-to; bh=ji+9u+B2b+48oQQSrYkG/GcYO4APmhSwnnsgIexcVoo=; b=Rov7pZlr+gC9RgwixJXOwzctKa8S91CH8w6D+TNndZMdMgoviBkr3OVLjXCIpPh7UB 4ZnyoXbx+TChRDlkGfcnG5wbyb79c2j1jg7aaTMZ5gOLIF5UAgp81pCOuJuc/z5qMl3J jyv32716NK/Bb4ywmEBZx5nCy8a+uipqj5fA87780DFOmr9ZIXzIvCsTSs9Qm4IeyLfT IB9oXv7OMEe3IrB1XNyiyoWaU2ysa3bi0kzggi30T8i+347DeclFzxvbYW8AhvysIIcb BWpZ5Ji7MTZzlU3JZMqYu+ah67orgneA/RjoPGz6ulrbH0AWx8AejSzmXwW2o29zt/wT 4kIA== X-Gm-Message-State: AOAM533jIfLVIJoz+o/rppexNn3qs0vErRDY6TP/T+UCh24XvA6AaATa JqEP3TgiB4k9IcOmuBySOwaslGa18kQ= X-Google-Smtp-Source: ABdhPJygQcUCt4p46H1qYFi8NGgHK47s0KEf9x7fDYiUCFoAZSz15ipJ0ui1dUHe2cgaiR1v5TeI6Q== X-Received: by 2002:adf:818b:: with SMTP id 11mr1029901wra.141.1595355821289; Tue, 21 Jul 2020 11:23:41 -0700 (PDT) Received: from jozef-acer-manjaro ([2a01:4b00:87fd:900:5e1d:5c99:56da:76e8]) by smtp.gmail.com with ESMTPSA id n18sm9426602wrw.45.2020.07.21.11.23.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Jul 2020 11:23:40 -0700 (PDT) Date: Tue, 21 Jul 2020 19:24:15 +0100 From: Jozef Lawrynowicz To: gcc-patches@gcc.gnu.org Subject: [PATCH 1/3] expr: Allow scalar_int_mode target mode when converting a constant Message-ID: <20200721182415.xekt7zd5eiwqr2my@jozef-acer-manjaro> Mail-Followup-To: gcc-patches@gcc.gnu.org References: <20200721181715.frr5xycz7wvxxkym@jozef-acer-manjaro> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="5jmgoamjny2dbwlx" Content-Disposition: inline In-Reply-To: <20200721181715.frr5xycz7wvxxkym@jozef-acer-manjaro> X-Spam-Status: No, score=-10.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jul 2020 18:23:43 -0000 --5jmgoamjny2dbwlx Content-Type: text/plain; charset=us-ascii Content-Disposition: inline is_int_mode does not allow MODE_PARTIAL_INT modes, so convert_modes was not allowing a constant value to be converted to a MODE_PARTIAL_INT for use as operand 2 in patterns such as ashlpsi3. The constant had to be copied into a register before it could be used, but now can be used directly as an operand without any copying. Successfully regtested on trunk for x86_64-pc-linux-gnu and msp430-elf. Ok to apply? --5jmgoamjny2dbwlx Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="0001-expr-Allow-scalar_int_mode-target-mode-when-converti.patch" >From 485feafad6ef0966ff0e1d2ae383cd2b6dbc5c96 Mon Sep 17 00:00:00 2001 From: Jozef Lawrynowicz Date: Wed, 15 Jul 2020 11:19:16 +0100 Subject: [PATCH 1/3] expr: Allow scalar_int_mode target mode when converting a constant is_int_mode does not allow MODE_PARTIAL_INT modes, so convert_modes was not allowing a constant value to be converted to a MODE_PARTIAL_INT for use as operand 2 in patterns such as ashlpsi3. The constant had to be copied into a register before it could be used, but now can be used directly as an operand without any copying. gcc/ChangeLog: * expr.c (convert_modes): Allow a constant integer to be converted to any scalar int mode. --- gcc/expr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/expr.c b/gcc/expr.c index c7c3e9fd655..5a252f0935f 100644 --- a/gcc/expr.c +++ b/gcc/expr.c @@ -696,7 +696,7 @@ convert_modes (machine_mode mode, machine_mode oldmode, rtx x, int unsignedp) return x; if (CONST_SCALAR_INT_P (x) - && is_int_mode (mode, &int_mode)) + && is_a (mode, &int_mode)) { /* If the caller did not tell us the old mode, then there is not much to do with respect to canonicalization. We have to -- 2.27.0 --5jmgoamjny2dbwlx--