From patchwork Mon Dec 4 17:09:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Law X-Patchwork-Id: 1871634 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=KtAfyx6H; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4SkVX610VTz1yST for ; Tue, 5 Dec 2023 04:09:41 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 8BF37384DEE3 for ; Mon, 4 Dec 2023 17:09:39 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-pf1-x433.google.com (mail-pf1-x433.google.com [IPv6:2607:f8b0:4864:20::433]) by sourceware.org (Postfix) with ESMTPS id 02E5C385843B for ; Mon, 4 Dec 2023 17:09:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 02E5C385843B Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 02E5C385843B Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::433 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701709769; cv=none; b=b+0Xdrnu8Dfsg9E8L/0HjrN5kW0lUruMZf/pBqpP2alSXhjXZI8a1bWSg2uzDGf/Rcd+/isxKtnstIHDem+p5pQJDEYxsNnS0jXrZmk0Yej9Hr6FDJdiCJ7kXmoW+vsCPmlt/W1HRC8RTYfoNrj53MjYw2PsEUv1H0wAzmZV5lM= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701709769; c=relaxed/simple; bh=MPa5uEPwYEi13zdUzX6PR9jVJUh+kvnLdSEKFXGNEtk=; h=DKIM-Signature:Message-ID:Date:MIME-Version:From:Subject:To; b=QBKhZNoueLRlVEiVOH7i27zrrxqEZQv7RnnxoxevTzP7dnNTS4ldm51QpnuHOm4zWGZGP5ny2jryVyqHCtiNjRwu6hXE1tMURsPDNwrjpOGKTSLOktxCotzokmFCSFXNHIcm15EaKarLZnhOfkXgt8ZYeRuxyrTmvs6KPZVploU= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pf1-x433.google.com with SMTP id d2e1a72fcca58-6cb74a527ceso3336437b3a.2 for ; Mon, 04 Dec 2023 09:09:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701709766; x=1702314566; darn=gcc.gnu.org; h=to:subject:from:content-language:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to; bh=Fo+Xqgv5S6aXNRqHtBo0OF0cr2gfYedxRIokyAClF3Q=; b=KtAfyx6HKQCmRX9VEKsERSc6vTaPJsaSZa4amnnzqQDZHCbY1nYG6QeeVDJu+lrSr1 RC/PKfnaX/dChBfdwDq8SySq2i0A896wFAArHIKHDew6HLCvYe4yU7iQLvOjl6bnWkQ0 yN4Q0rZPYVxp+us/YGbe6tbvPn03iKG+6w0tIfauUB+UlDUEw0/HuoxRXuNla8MXg92z 3FlfcVcqS3QD6baAPFM2gbTES9zIsGJmAkKhPD836Y6A8pyrTG5TKN6udL60MrgqZgWe 1uGa9+Ls/aRQlj6LyLIyBvl8A7nJeULDGhVHdVVwMZZl0Okam4x07ISjaNqHENulhmqC vm9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701709766; x=1702314566; 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=Fo+Xqgv5S6aXNRqHtBo0OF0cr2gfYedxRIokyAClF3Q=; b=WTYjEsej5zzKdI7P2WVfGN1WLfzbO1uckF9pVVzx0RdD0HK4NTgn+Kz5gmrkALrsUT /uWs/tHUs4wAkk6q4ALxljfI8ineF6WqRzbe1yxJ9ipHXPs0MJ/kwDDulzYDIzW6ThUl 7vwZoPT8No8ZCqivilgj2Te4UX4TChSrpjkXcqAhitIJ96+qzU3iN/cAeLX/DN+Xz/Ww ou60mfpQZjTbdlgYPGhA9K+C8beWrFO1JgCPrsd8Jyf6S4eEYNxPXaII3G0+gFvJDjdq AlJrTztuQUbl7TuMEG3tSXZq5bD0+w2OwErJdTz63ErTjXFuWiRArIZbO/ObAdFReHbx +FGQ== X-Gm-Message-State: AOJu0YzMSaQILeuxqZzkcOVTE7uXo4GIyjXBj82imjn1kwZuVTYw0hLM ZR5xjFIpLxM5tvb1dw77rdvNqayt1hE= X-Google-Smtp-Source: AGHT+IHDNOLh+DgufZnv0Yrcos2VAWKWhlGCwpnPzTklEydHDHqoyv3pSE72e2TiKUkPsNEDJT0WHw== X-Received: by 2002:a05:6a00:3908:b0:6ce:2732:1df5 with SMTP id fh8-20020a056a00390800b006ce27321df5mr2752011pfb.47.1701709765519; Mon, 04 Dec 2023 09:09:25 -0800 (PST) Received: from [172.31.0.109] ([136.36.130.248]) by smtp.gmail.com with ESMTPSA id s40-20020a056a0017a800b006ce2e77ec4csm4473752pfg.193.2023.12.04.09.09.23 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 04 Dec 2023 09:09:24 -0800 (PST) Message-ID: <2fd89c4a-4a37-45fa-9561-54abd7fcbf8c@gmail.com> Date: Mon, 4 Dec 2023 10:09:19 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US From: Jeff Law Subject: [committed] Fix HImode load mnemonic on microblaze port To: "gcc-patches@gcc.gnu.org" X-Spam-Status: No, score=-8.3 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.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org The tester recently started failing va-arg-22.c on microblaze-linux: gcc.c-torture/execute/va-arg-22.c -O0 (test for excess errors) It was failing with an undefined reference to "r7" at link time. This was ultimately tracked down to a HImode load using (reg+reg) addressing mode, but which used the lhui instruction instead of lhu. The "i" means it's supposed to be (reg+disp) so the assembler tried to interpret "r7" as an immediate/symbol. The port uses %i as an output modifier to select between sh/shi and various other mnemonics for loads/stores. The movhi pattern simply failed to use it for the two cases where it's loading from memory (interestingly enough it was used for stores). Clearly we aren't using reg+reg much for HImode loads as this didn't fix anything else in the testsuite. Installing on the trunk, Jeff commit b544ec681bdc9c48587d2e014f9559674097738a Author: Jeff Law Date: Mon Dec 4 10:06:49 2023 -0700 [committed] Fix HImode load mnemonic on microblaze port The tester recently started failing va-arg-22.c on microblaze-linux: gcc.c-torture/execute/va-arg-22.c -O0 (test for excess errors) It was failing with an undefined reference to "r7" at link time. This was ultimately tracked down to a HImode load using (reg+reg) addressing mode, but which used the lhui instruction instead of lhu. The "i" means it's supposed to be (reg+disp) so the assembler tried to interpret "r7" as an immediate/symbol. The port uses %i as an output modifier to select between sh/shi and various other mnemonics for loads/stores. The movhi pattern simply failed to use it for the two cases where it's loading from memory (interestingly enough it was used for stores). Clearly we aren't using reg+reg much for HImode loads as this didn't fix anything else in the testsuite. gcc/ * config/microblaze/microblaze.md (movhi): Use %i for half-word loads to properly select between lhu/lhui. diff --git a/gcc/config/microblaze/microblaze.md b/gcc/config/microblaze/microblaze.md index 671667b537c..a8ee886d36b 100644 --- a/gcc/config/microblaze/microblaze.md +++ b/gcc/config/microblaze/microblaze.md @@ -1089,8 +1089,8 @@ (define_insn "*movhi_internal2" "@ addik\t%0,r0,%1\t# %X1 addk\t%0,%1,r0 - lhui\t%0,%1 - lhui\t%0,%1 + lhu%i1\t%0,%1 + lhu%i1\t%0,%1 sh%i0\t%z1,%0 sh%i0\t%z1,%0" [(set_attr "type" "arith,move,load,no_delay_load,store,no_delay_store")