From patchwork Sun Jun 4 17:42:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Law X-Patchwork-Id: 1790123 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=OWZfUDs8; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4QZ3xX0Fr5z20Q8 for ; Mon, 5 Jun 2023 03:43:27 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A42BF385842E for ; Sun, 4 Jun 2023 17:43:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A42BF385842E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1685900605; bh=5815lI0H1rVmbMqecw++UmZo77Lc27Oudx/9Uov1e7M=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=OWZfUDs82i/Q4I6MPwnM7/4u1w6WXf6RTC8eS9EsI3j0YFBZnkowIIKSkvxU20tmQ 0ZgQIqhY4reh8zVYHXZV9kZmMsA4SItvmgUItCnTg1mtEXfc++kr05Jr2Sqj6+HHXu yOMNy9tVUrdfYJV/kiD7upBXFVl5ycWWrZ5AM+/k= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-qv1-xf2a.google.com (mail-qv1-xf2a.google.com [IPv6:2607:f8b0:4864:20::f2a]) by sourceware.org (Postfix) with ESMTPS id 0E6043858D32 for ; Sun, 4 Jun 2023 17:43:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0E6043858D32 Received: by mail-qv1-xf2a.google.com with SMTP id 6a1803df08f44-626157a186bso29195346d6.1 for ; Sun, 04 Jun 2023 10:43:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685900583; x=1688492583; h=subject:to:from:content-language:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=5815lI0H1rVmbMqecw++UmZo77Lc27Oudx/9Uov1e7M=; b=O9jetqpu1Dn1bo8W9AKAWBeLAO+/6bKX+vMhZkyCRHnMm1RMit/T6ZBvHQ78CU/7xX 7/RJjX5YrtwER/rjadJELBVSf9XNbVdM7913X+G0GXdRav5wQ563If4Y+H3iVGSdO84y HfJ7KOTp+0lk1+SvkQBI+Hos17NEckQX/pcj2Wz7Ch4Fk8/pVJbsAv1ABmrAB3Hn79WH MWY2QceKYHZjr4TXveQUGiPRn+tjJ/xIoHWMMRUmDxfgc3Hd5UqSoYQr5El+m+yB0q9L r+g5AEOgg5ZdjwwObxpaTmZJVjMomPtpNXWP8uSK2I/sC7BxT1yk9gv9yPoKWaolUQpf qGag== X-Gm-Message-State: AC+VfDycMHNj491MUIWB/vzeP7Qe1dcHJt/SrzfuqXC2QAXI7gGymBN7 OwGnqx7qyLVI7nCKvO/KFIZZg7pWM0s= X-Google-Smtp-Source: ACHHUZ5yhsrNFsATeJqxfrnyofdPW/4hBCgom4KBi9KVJW4ujo6V4jnTdoHQu7DsC1zduZUgiP+McA== X-Received: by 2002:ad4:5941:0:b0:626:2d38:e8e1 with SMTP id eo1-20020ad45941000000b006262d38e8e1mr5153339qvb.10.1685900582809; Sun, 04 Jun 2023 10:43:02 -0700 (PDT) Received: from ?IPV6:2607:fb90:469:b40a:c15c:6a92:5516:c5a5? ([2607:fb90:469:b40a:c15c:6a92:5516:c5a5]) by smtp.gmail.com with ESMTPSA id em1-20020ad44f81000000b006166a48357asm3374257qvb.60.2023.06.04.10.43.00 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 04 Jun 2023 10:43:02 -0700 (PDT) Message-ID: Date: Sun, 4 Jun 2023 11:42:58 -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 To: "gcc-patches@gcc.gnu.org" Subject: [committed] Convert H8 port to LRA X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, KAM_ASCII_DIVIDERS, 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+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" With Vlad's recent LRA fix to the elimination code, the H8 can be converted to LRA. This patch has two changes of note. First, this turns Zz into a standard constraint. This helps reloading for the H8/SX movqi pattern. Second, this drops the whole pattern for the SX bit memory operations. I can't see why those exist to begin with. They should be handled by the standard bit manipulation patterns. If someone wants to try and improve SX bit support, that'd be great and they can do so within the LRA framework :-) Pushed to the trunk... Jeff commit f66e0a94ad7bc18538c8207fc2c86b62e4a51bb2 Author: Jeff Law Date: Sun Jun 4 11:38:55 2023 -0600 Convert H8 port to LRA With Vlad's recent LRA fix to the elimination code, the H8 can be converted to LRA. This patch has two changes of note. First, this turns Zz into a standard constraint. This helps reloading for the H8/SX movqi pattern. Second, this drops the whole pattern for the SX bit memory operations. I can't see why those exist to begin with. They should be handled by the standard bit manipulation patterns. If someone wants to try and improve SX bit support, that'd be great and they can do so within the LRA framework :-) Pushed to the trunk... gcc/ * config/h8300/constraints.md (Zz): Make this a normal constraint. * config/h8300/h8300.cc (TARGET_LRA_P): Remove. * config/h8300/logical.md (H8/SX bit patterns): Remove. diff --git a/gcc/config/h8300/constraints.md b/gcc/config/h8300/constraints.md index 3aef1205fef..3e2526ccbbc 100644 --- a/gcc/config/h8300/constraints.md +++ b/gcc/config/h8300/constraints.md @@ -211,7 +211,7 @@ (define_constraint "Y2" (and (match_code "const_int") (match_test "exact_log2 (ival & 0xff) != -1"))) -(define_special_memory_constraint "Zz" +(define_constraint "Zz" "@internal" (and (match_test "TARGET_H8300SX") (match_code "mem") diff --git a/gcc/config/h8300/h8300.cc b/gcc/config/h8300/h8300.cc index 7412c0535fc..cdf74c1acbd 100644 --- a/gcc/config/h8300/h8300.cc +++ b/gcc/config/h8300/h8300.cc @@ -5625,9 +5625,6 @@ pre_incdec_with_reg (rtx op, unsigned int reg) #undef TARGET_MODES_TIEABLE_P #define TARGET_MODES_TIEABLE_P h8300_modes_tieable_p -#undef TARGET_LRA_P -#define TARGET_LRA_P hook_bool_void_false - #undef TARGET_LEGITIMATE_ADDRESS_P #define TARGET_LEGITIMATE_ADDRESS_P h8300_legitimate_address_p diff --git a/gcc/config/h8300/logical.md b/gcc/config/h8300/logical.md index f07c79e1eac..5df0922ef4e 100644 --- a/gcc/config/h8300/logical.md +++ b/gcc/config/h8300/logical.md @@ -31,28 +31,6 @@ (define_expand "3" ;; AND INSTRUCTIONS ;; ---------------------------------------------------------------------- -(define_insn "bclr_msx" - [(set (match_operand:QHI 0 "bit_register_indirect_operand" "=WU") - (and:QHI (match_operand:QHI 1 "bit_register_indirect_operand" "%0") - (match_operand:QHI 2 "single_zero_operand" "Y0")))] - "TARGET_H8300SX && rtx_equal_p (operands[0], operands[1])" - "bclr\\t%W2,%0" - [(set_attr "length" "8")]) - -(define_split - [(set (match_operand:HI 0 "bit_register_indirect_operand") - (and:HI (match_operand:HI 1 "bit_register_indirect_operand") - (match_operand:HI 2 "single_zero_operand")))] - "TARGET_H8300SX && abs (INTVAL (operands[2])) > 0xff" - [(set (match_dup 0) - (and:QI (match_dup 1) - (match_dup 2)))] - { - operands[0] = adjust_address (operands[0], QImode, 0); - operands[1] = adjust_address (operands[1], QImode, 0); - operands[2] = GEN_INT ((INTVAL (operands[2])) >> 8); - }) - (define_insn_and_split "*andqi3_2" [(set (match_operand:QI 0 "bit_operand" "=U,rQ,r") (and:QI (match_operand:QI 1 "bit_operand" "%0,0,WU") @@ -177,14 +155,6 @@ (define_insn "*andorsi3_shift_8_clobber_flags" ;; OR/XOR INSTRUCTIONS ;; ---------------------------------------------------------------------- -(define_insn "b_msx" - [(set (match_operand:QHI 0 "bit_register_indirect_operand" "=WU") - (ors:QHI (match_operand:QHI 1 "bit_register_indirect_operand" "%0") - (match_operand:QHI 2 "single_one_operand" "Y2")))] - "TARGET_H8300SX && rtx_equal_p (operands[0], operands[1])" - { return == IOR ? "bset\\t%V2,%0" : "bnot\\t%V2,%0"; } - [(set_attr "length" "8")]) - (define_insn_and_split "qi3_1" [(set (match_operand:QI 0 "bit_operand" "=U,rQ") (ors:QI (match_operand:QI 1 "bit_operand" "%0,0")