From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20340 invoked by alias); 4 Dec 2018 15:32:51 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 20330 invoked by uid 89); 4 Dec 2018 15:32:50 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 spammy= X-HELO: gate.crashing.org Received: from gate.crashing.org (HELO gate.crashing.org) (63.228.1.57) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 04 Dec 2018 15:32:47 +0000 Received: from gate.crashing.org (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id wB4FWNoJ016617; Tue, 4 Dec 2018 09:32:25 -0600 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id wB4FWKdo016602; Tue, 4 Dec 2018 09:32:20 -0600 Date: Tue, 04 Dec 2018 15:32:00 -0000 From: Segher Boessenkool To: Jakub Jelinek Cc: gcc-patches@gcc.gnu.org Subject: Re: [PATCH] Further rs6000 asm modifier tweaks (PR target/88188) Message-ID: <20181204153219.GD3803@gate.crashing.org> References: <20181204085645.GG12380@tucnak> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181204085645.GG12380@tucnak> User-Agent: Mutt/1.4.2.3i X-IsSubscribed: yes X-SW-Source: 2018-12/txt/msg00208.txt.bz2 Hi Jakub, On Tue, Dec 04, 2018 at 09:56:45AM +0100, Jakub Jelinek wrote: > This patch adds further tweaks discussed in the last PR88188 mail. Thanks for doing this :-) > ccr_bit now returns -1 instead of failing assertions, so that the caller > can decide what to do with it (fail assertion or output_operand_lossage > with some reasonable diagnostics. (And all callers already test for that). > For D and t it now requires CR_REGNO_P, so that it doesn't print completely > meaningless numbers if used with other registers. > And use REG_P macros a little bit. > 2018-12-04 Jakub Jelinek > > PR target/88188 > * config/rs6000/rs6000.c (ccr_bit): Return -1 instead of assertion > failures. > (print_operand): Use REG_P instead of GET_CODE == REG. > : Also check CR_REGNO_P (REGNO (x)). > * config/rs6000/rs6000.md (scc patterns): Assert ccr_bit didn't > return -1. > > * gcc.target/powerpc/pr88188-2.c: New test. > @@ -20754,7 +20765,7 @@ print_operand (FILE *file, rtx x, int co > > case 'D': > /* Like 'J' but get to the GT bit only. */ > - if (!REG_P (x)) > + if (! REG_P (x) || ! CR_REGNO_P (REGNO (x))) No space after ! please. I know surrounding code does it, but how will we ever get rid of that otherwise :-) > @@ -21014,7 +21025,7 @@ print_operand (FILE *file, rtx x, int co > > case 't': > /* Like 'J' but get to the OVERFLOW/UNORDERED bit. */ > - if (!REG_P (x) || GET_MODE (x) != CCmode) > + if (! REG_P (x) || GET_MODE (x) != CCmode || ! CR_REGNO_P (REGNO (x))) Strange that this one uses GET_MODE, all the rest do not. Since you add the CR_REGNO test now, the mode test is obviously superfluous, so you can delete it? Okay for trunk, with or without those extra tweaks. Thanks! Segher