From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1005) id 0C722385841B; Thu, 17 Feb 2022 03:52:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0C722385841B Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Michael Meissner To: gcc-cvs@gcc.gnu.org Subject: [gcc(refs/users/meissner/heads/work078)] Don't do int cmoves for IEEE comparisons. X-Act-Checkin: gcc X-Git-Author: Michael Meissner X-Git-Refname: refs/users/meissner/heads/work078 X-Git-Oldrev: 8dce1b423d3705fd8ba7923f5ffbd0cc8af89239 X-Git-Newrev: c4eee68ab4248600dcfdf23dffdeffcfc2ae5e0a Message-Id: <20220217035225.0C722385841B@sourceware.org> Date: Thu, 17 Feb 2022 03:52:25 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Feb 2022 03:52:25 -0000 https://gcc.gnu.org/g:c4eee68ab4248600dcfdf23dffdeffcfc2ae5e0a commit c4eee68ab4248600dcfdf23dffdeffcfc2ae5e0a Author: Michael Meissner Date: Wed Feb 16 22:52:07 2022 -0500 Don't do int cmoves for IEEE comparisons. Protect int cmove from raising an assertion if it is trying to do an int conditional move where the test involves IEEE comparisons that must be done with a CCFPmode instead of the CCmode normally used for int cmoves. 2022-02-16 Michael Meissner gcc/ PR target/104256 * config/rs6000/rs6000.cc (rs6000_emit_int_cmove): Don't do integer conditional moves if the test involves IEEE comparisons. Diff: --- gcc/config/rs6000/rs6000.cc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/gcc/config/rs6000/rs6000.cc b/gcc/config/rs6000/rs6000.cc index f56cf66313a..10af34fca69 100644 --- a/gcc/config/rs6000/rs6000.cc +++ b/gcc/config/rs6000/rs6000.cc @@ -16181,6 +16181,15 @@ rs6000_emit_int_cmove (rtx dest, rtx op, rtx true_cond, rtx false_cond) if (mode != SImode && (!TARGET_POWERPC64 || mode != DImode)) return false; + /* Don't do int cmoves for IEEE comparisons. The rs6000_generate_compare + function will eventually raise an exception because the mode used is + CCmode (due to this being an int cmove), but you can only do these + comparsions with CCFP mode. */ + enum rtx_code op_code = GET_CODE (op); + if (op_code == ORDERED || op_code == UNORDERED || op_code == UNEQ || op_code == LTGT + || op_code == UNGT || op_code == UNLT || op_code == UNGE || op_code == UNLE) + return false; + /* We still have to do the compare, because isel doesn't do a compare, it just looks at the CRx bits set by a previous compare instruction. */