From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1363) id AA9023858D32; Mon, 27 Feb 2023 21:11:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AA9023858D32 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1677532267; bh=aMjiyW+s4fiMgUkaKmbp+7ginhM5s84BL5RqZhzBaLU=; h=From:To:Subject:Date:From; b=C6JyBfb8Dy0rkGuP6tYMz51WqhUnMicoUvYgAgur9yOn8cho+c/g1oEuUVsTX9+yr SeFZUKKaz2HUEz3piEYchQNthKOk6oep/D5q1B/OmnloihiSJC0N2erGzhqrzvDDBi Mw6kR57ZKCmxxckPq9NQtiNh4rHCzxmXjMVBlIRs= MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="utf-8" From: Uros Bizjak To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-6361] i386: Do not constrain fmod and remainder patterns with flag_finite_math_only [PR108922] X-Act-Checkin: gcc X-Git-Author: Uros Bizjak X-Git-Refname: refs/heads/master X-Git-Oldrev: ab76d71179be6e4e09ee3d5b7e8fa4265717a34c X-Git-Newrev: 8020c9c42349f51f75239b9d35a2be41848a97bd Message-Id: <20230227211107.AA9023858D32@sourceware.org> Date: Mon, 27 Feb 2023 21:11:07 +0000 (GMT) List-Id: https://gcc.gnu.org/g:8020c9c42349f51f75239b9d35a2be41848a97bd commit r13-6361-g8020c9c42349f51f75239b9d35a2be41848a97bd Author: Uros Bizjak Date: Mon Feb 27 22:10:01 2023 +0100 i386: Do not constrain fmod and remainder patterns with flag_finite_math_only [PR108922] According to Intel ISA manual, fprem and fprem1 return NaN when invalid arithmetic exception is generated. This is documented in Table 8-10 of the ISA manual and makes these two instructions fully IEEE compatible. The reverted patch was based on the data from table 3-30 and 3-31 of the Intel ISA manual, where results in case of st(0) being infinity or st(1) being 0 are not specified. 2023-02-27 Uroš Bizjak gcc/ChangeLog: PR target/108922 Revert: * config/i386/i386.md (fmodxf3): Enable for flag_finite_math_only only. (fmod3): Ditto. (fpremxf4_i387): Ditto. (reminderxf3): Ditto. (reminder3): Ditto. (fprem1xf4_i387): Ditto. Diff: --- gcc/config/i386/i386.md | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md index 8ebb12be2c9..ed689b044c3 100644 --- a/gcc/config/i386/i386.md +++ b/gcc/config/i386/i386.md @@ -19527,8 +19527,7 @@ (set (reg:CCFP FPSR_REG) (unspec:CCFP [(match_dup 2) (match_dup 3)] UNSPEC_C2_FLAG))] - "TARGET_USE_FANCY_MATH_387 - && flag_finite_math_only" + "TARGET_USE_FANCY_MATH_387" "fprem" [(set_attr "type" "fpspc") (set_attr "znver1_decode" "vector") @@ -19538,8 +19537,7 @@ [(use (match_operand:XF 0 "register_operand")) (use (match_operand:XF 1 "general_operand")) (use (match_operand:XF 2 "general_operand"))] - "TARGET_USE_FANCY_MATH_387 - && flag_finite_math_only" + "TARGET_USE_FANCY_MATH_387" { rtx_code_label *label = gen_label_rtx (); @@ -19562,8 +19560,7 @@ [(use (match_operand:MODEF 0 "register_operand")) (use (match_operand:MODEF 1 "general_operand")) (use (match_operand:MODEF 2 "general_operand"))] - "TARGET_USE_FANCY_MATH_387 - && flag_finite_math_only" + "TARGET_USE_FANCY_MATH_387" { rtx (*gen_truncxf) (rtx, rtx); @@ -19602,8 +19599,7 @@ (set (reg:CCFP FPSR_REG) (unspec:CCFP [(match_dup 2) (match_dup 3)] UNSPEC_C2_FLAG))] - "TARGET_USE_FANCY_MATH_387 - && flag_finite_math_only" + "TARGET_USE_FANCY_MATH_387" "fprem1" [(set_attr "type" "fpspc") (set_attr "znver1_decode" "vector") @@ -19613,8 +19609,7 @@ [(use (match_operand:XF 0 "register_operand")) (use (match_operand:XF 1 "general_operand")) (use (match_operand:XF 2 "general_operand"))] - "TARGET_USE_FANCY_MATH_387 - && flag_finite_math_only" + "TARGET_USE_FANCY_MATH_387" { rtx_code_label *label = gen_label_rtx (); @@ -19637,8 +19632,7 @@ [(use (match_operand:MODEF 0 "register_operand")) (use (match_operand:MODEF 1 "general_operand")) (use (match_operand:MODEF 2 "general_operand"))] - "TARGET_USE_FANCY_MATH_387 - && flag_finite_math_only" + "TARGET_USE_FANCY_MATH_387" { rtx (*gen_truncxf) (rtx, rtx);