From patchwork Wed May 10 11:46:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Law X-Patchwork-Id: 69044 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id DA1643856DF5 for ; Wed, 10 May 2023 11:47:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DA1643856DF5 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1683719235; bh=FOtQ6H/6jdumibfrh7ST59dOTgDiBLjG98qHVBMpusY=; h=Date:Subject:To:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=jNNkYBxRZxAVayGTCXH4AMmBPEepCdg1/wrmd2oJXgVYdJZkqdYM5G8tY1NBEwaDd iqEXYpz02Xh9R39dqlg0JQOI37N/Jmx//1bQN8HDduHLtqeq52agC1YFmrz4RLqBQR dV37Z0rDn0y/fM+eFevxHR/9sV50Mxstz7OTQW5U= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-pl1-x632.google.com (mail-pl1-x632.google.com [IPv6:2607:f8b0:4864:20::632]) by sourceware.org (Postfix) with ESMTPS id 1CDC53858C66 for ; Wed, 10 May 2023 11:46:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1CDC53858C66 Received: by mail-pl1-x632.google.com with SMTP id d9443c01a7336-1aaf7067647so49489885ad.0 for ; Wed, 10 May 2023 04:46:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683719204; x=1686311204; h=to:subject:from:content-language:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=FOtQ6H/6jdumibfrh7ST59dOTgDiBLjG98qHVBMpusY=; b=ODtL4tgldjjinJC1blAh00EUGoZMi8HaQg2ZYDp0tTvUp6NtufqDvlFQaHfec5wfEY 4OTonIx3RNY7IRJhzoZtMH4Dkigakncz3TKRgDyuMtxrM2oSVswNcfaPLzHy33cQJvYn 84kVYgfRmcTvXws7O16uE+gqmtQkjx2q+RmACUniVBfZgu6+NR+y+8pLQ8TW4uf9vheM 4QcFivoQz9ml7ebuWu0Eby/BcBZf6Gdac/R2DhxuRxaxLq+1FRUS5i3Qu0P+sh1ms2nx nJtDhEbFgBcTMguMImoWHfhWifA5Ir3kBN1MJjCyO5/SmTkjQopkyp6Z9Gx01yYwPNRI GnrQ== X-Gm-Message-State: AC+VfDy5NSr5GsP4CSHxQjGGYtFmia+OICzQ/WJ7zSuMbGgCnYLDEQ6V r5Wd70O1iRNgkvCcd8gg30UydM9IQUs= X-Google-Smtp-Source: ACHHUZ6YXliJP+DpaFpoUW8AZ9NUpBzxS2q6aYgCvyHLdJ/0L315OSIaWnU3iHr4FSa6lqlnijS/bw== X-Received: by 2002:a17:902:db0f:b0:1ac:4163:313 with SMTP id m15-20020a170902db0f00b001ac41630313mr22589462plx.54.1683719204022; Wed, 10 May 2023 04:46:44 -0700 (PDT) Received: from ?IPV6:2607:fb90:46f:50cc:6c7e:5b70:5ae3:c3d5? ([2607:fb90:46f:50cc:6c7e:5b70:5ae3:c3d5]) by smtp.gmail.com with ESMTPSA id e8-20020a17090301c800b001acacff3a70sm1931348plh.125.2023.05.10.04.46.42 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 10 May 2023 04:46:43 -0700 (PDT) Message-ID: <6825e5d6-632e-1cf2-77cc-51e5ef4179ac@gmail.com> Date: Wed, 10 May 2023 05:46:41 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.1 Content-Language: en-US Subject: [committed] Fix a couple constraints on the H8 in preparation for LRA conversion To: "gcc-patches@gcc.gnu.org" X-Spam-Status: No, score=-9.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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-Patchwork-Original-From: Jeff Law via Gcc-patches From: Jeff Law Reply-To: Jeff Law Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" So this is the 2nd patch on the way to LRA for the H8. LRA is more sensitive to getting define_constraint vs define_memory_constraint vs define_special_memory_constraint correct. than reload. The H8 port has the "Q" constraint, which is used to indicate memory addresses that can be used under certain circumstances in various ALU operations. So it should be a memory constraint. Ideally it'd would be a simple memory constraint, but it's used in contexts where MEMs are valid only for certain parts in the H8 family. So it really needs to be a special_memory_constraint. The "Zz" constraint accepts memory, but the forms are limited and can not be reloaded into a register. It seems to be working, but I wouldn't be totally surprised if this got stressed in the right way if it broke. Anyway, this patch fixes "Q" and "Zz" to be special memory constraints. Regression tested with gdbsim and pushed to the trunk. jeff commit 02d79fb228c9f4c7d00dfe09b6ca7ef1392afbec Author: Jeff Law Date: Wed May 10 05:25:12 2023 -0600 Fix a couple constraints on the H8 in preparation for LRA conversion So this is the 2nd patch on the way to LRA for the H8. LRA is more sensitive to getting define_constraint vs define_memory_constraint vs define_special_memory_constraint correct. than reload. The H8 port has the "Q" constraint, which is used to indicate memory addresses that can be used under certain circumstances in various ALU operations. So it should be a memory constraint. Ideally it'd would be a simple memory constraint, but it's used in contexts where MEMs are valid only for certain parts in the H8 family. So it really needs to be a special_memory_constraint. The "Zz" constraint accepts memory, but the forms are limited and can not be reloaded into a register. It seems to be working, but I wouldn't be totally surprised if this got stressed in the right way if it broke. Anyway, this patch fixes "Q" and "Zz" to be special memory constraints. Regression tested with gdbsim and pushed to the trunk. gcc * config/h8300/constraints.md (Q): Make this a special memory constraint. (Zz): Similarly. diff --git a/gcc/config/h8300/constraints.md b/gcc/config/h8300/constraints.md index f1ebce14dad..3aef1205fef 100644 --- a/gcc/config/h8300/constraints.md +++ b/gcc/config/h8300/constraints.md @@ -144,7 +144,7 @@ (define_constraint "G" (match_test "op == CONST0_RTX (SFmode)"))) ;; Extra constraints. -(define_constraint "Q" +(define_special_memory_constraint "Q" "@internal" (and (match_test "TARGET_H8300SX") (match_operand 0 "memory_operand"))) @@ -211,7 +211,7 @@ (define_constraint "Y2" (and (match_code "const_int") (match_test "exact_log2 (ival & 0xff) != -1"))) -(define_constraint "Zz" +(define_special_memory_constraint "Zz" "@internal" (and (match_test "TARGET_H8300SX") (match_code "mem")