From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com [IPv6:2a00:1450:4864:20::32d]) by sourceware.org (Postfix) with ESMTPS id 2622C3858414 for ; Wed, 8 Sep 2021 18:39:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2622C3858414 Received: by mail-wm1-x32d.google.com with SMTP id k5-20020a05600c1c8500b002f76c42214bso2338231wms.3 for ; Wed, 08 Sep 2021 11:39:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:user-agent:in-reply-to :references:message-id:mime-version:content-transfer-encoding; bh=a91elxpXbZoO77A4D2sNDnSdpkQnMEh2TEaev7Zx2HE=; b=Ooj4aywnG3hprUZDEoGn1lq7QRYL91rLEGtLQtUpVh1DEYg2VIaiMGUDe4VrnSYQrz tvFpj7Pi669r3oPDr09J8283AYw+rMW3lSkjk5vPpJjpKtaPoYps2jfoK9NDINhO9B83 /s4keI6y3d/3+PTFLjAFEw487An0H0uazMS6GQn9tgOR7KAwfIUK8BtmBGhcn4wWUrUW 596Hiay8itt6cZy9a9COSylz2nRKG5k4nOlt87siyp6fLgi2poFS38CSLeCyUYnR5qsj vSpsXw7RWwx2w7YOvmM5g0U/KR2VhkjpmX/JO9xpsDYvvnB5XwZiJFs593TgqSVVOFp7 TmoA== X-Gm-Message-State: AOAM531TcUbVwYs5SQjM51nmw+ctta+wvD3H1ryNoK1wDNCHYYp6ppO0 cFeEH4Ffhox3B10vpsKq30c= X-Google-Smtp-Source: ABdhPJwtFv1rYpVcMnNvvvrdp01r0vfd6p0hIvjRc2YobgdZuQqPiXca19OpVluxcTu0gulyWn12cw== X-Received: by 2002:a05:600c:4f81:: with SMTP id n1mr5037070wmq.99.1631126374159; Wed, 08 Sep 2021 11:39:34 -0700 (PDT) Received: from [127.0.0.1] (dynamic-077-002-115-055.77.2.pool.telefonica.de. [77.2.115.55]) by smtp.gmail.com with ESMTPSA id e9sm3079090wrd.69.2021.09.08.11.39.33 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 08 Sep 2021 11:39:33 -0700 (PDT) Date: Wed, 08 Sep 2021 20:39:31 +0200 From: Richard Biener To: Segher Boessenkool CC: Michael Meissner , GCC Patches , David Edelsohn , Bill Schmidt , Peter Bergner , Will Schmidt Subject: Re: [PATCH] Fix SFmode subreg of DImode and TImode User-Agent: K-9 Mail for Android In-Reply-To: <20210908170809.GP1583@gate.crashing.org> References: <20210907230730.GM1583@gate.crashing.org> <20210908170809.GP1583@gate.crashing.org> Message-ID: <5DBC1101-9DD6-48F8-BC25-F4DD354B4D74@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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: Wed, 08 Sep 2021 18:39:36 -0000 On September 8, 2021 7:08:09 PM GMT+02:00, Segher Boessenkool wrote: >Hi! > >On Wed, Sep 08, 2021 at 08:42:44AM +0200, Richard Biener wrote: >> On Wed, Sep 8, 2021 at 1:08 AM Segher Boessenkool >> wrote: >> > The core of the problem is that subreg of pseudos has three meanings: >> > -- Paradoxical subregs; >> > -- Actual subregs; >> > -- "bit_cast" thingies: treat the same bits as something else=2E L= ike >> > looking at the bits of a float as its memory image=2E >> > >> > Ignoring paradoxical subregs (as well as subregs of mem, which should >> > have disappeared by now), and subregs of hard registers as well (thos= e >> > have *different* semantics after all), the other two kinds can be mix= ed, >> > and *have to* be mixed, because subregs of subregs are non-canonical= =2E >> > >> > Is there any reason why not to allow this kind of subreg? >>=20 >> In fact the causing rev=2E in question (d2874d905647a1d146dafa60199d440= e837adc4d) >> made all those subregs "valid" in terms of what validate_subreg is veri= fying >> and thus now the few places using validate_subreg to check whether some >> subreg is valid will now happily do float<->int converting subregs=2E > >Like in PR102154: > >error: unrecognizable insn: >(insn 11 10 12 2 (set (reg:SF 118 [ ]) > (subreg:SF (reg:DI 122) 0)) > >This generated valid code before, and now it is not anymore=2E If the >patch was meant to allow *more*, it failed that goal: it allows *less*=2E > >The issue is that we do not allow SF subregs in all cases=2E We do not >store SFmode quantities in IEEE SP format in registers normally, so it >would require expensive extra code to allow such subregs=2E > >Whatever pass made these subregs is wrong, because they do not pass >recog()=2E > >> I do agree that those subregs should be allowed and that the above rev= =2E is >> a strict improvement (given it removes a lot of "but allow special case= X >> because target Y wants it" cases by simply allowing all of them)=2E Bu= t the >> previous code seems to have papered over quite some backend issues=2E > >It is not a good idea to do allow all those things=2E Most backends can >only support a few combinations of them, and everything else results in >*worse* machine code, best case, and more and more complicated (and more >buggy!) backend code=2E > >But that is a code quality issue=2E The current problem is that we have >at least PR102211 and PR102154 (as well as reports elsewhere of bugs on >other targets)=2E Code that used before doesn't anymore, and we have no >clear way out, no recommendation how to fix this and a) keep the same >functionality without huge changes, and b) keep the same machine code >quality=2E > >I do not think something like that can be done=2E That is why I am askin= g >for the patch to be reverted until all of the groundwork for it has been >done=2E That includes making generic testcases that show how such subreg= s >behave, so that we can see in testresults what changes do to existing >targets=2E Heh, I understood your earlier reply that you supported the change in prin= ciple based on the fact that nested subregs are invalid=2E Now, I don't think that validate_subreg is supposed to be the decision mak= er on what a target allows=2E For subregs of hardregs we seem to have a goo= d way of validating, but what do we have for subregs of pseudos? Is it the = passes generating the new unsupported subregs that should do different thin= gs? Should validate_subreg use a target hook to allow those special casings= we removed which all were necessary just for specific targets but appearan= tly did not do any harm for other targets?=20 Can you give advice as to how to address the needs of the HFmode subregs o= n x86 if not by adding another (generic) narrow exception in validate_subre= g?=20 That said, I fail to see a good way forward after now two appearantly fail= ed attempts=2E=20 Btw, I'm fine reverting the patch but then what's the solution here?=20 Richard=2E=20 > >Segher