From: Uros Bizjak <ubizjak@gmail.com>
To: "gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>
Subject: [PATCH, i386]: Fix PR 81375, unrecognizable insn
Date: Mon, 10 Jul 2017 22:03:00 -0000 [thread overview]
Message-ID: <CAFULd4bQGgfAeJOQtACYtJmCOXsmNcOwCK1YDnC1-oW-e+PgnA@mail.gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 639 bytes --]
Hello!
We have to use TARGET_SSE with TARGET_SSE_MATH in insn constraints.
2017-07-10 Uros Bizjak <ubizjak@gmail.com>
PR target/81375
* config/i386/i386.md (divsf3): Add TARGET_SSE to TARGET_SSE_MATH.
(rcpps): Ditto.
(*rsqrtsf2_sse): Ditto.
(rsqrtsf2): Ditto.
(div<mode>3): Macroize insn from divdf3 and divsf3
using MODEF mode iterator.
testsuite/ChangeLog:
2017-07-10 Uros Bizjak <ubizjak@gmail.com>
PR target/81375
* gcc.target/i386/pr81375.c: New test.
Bootstrapped and regression tested on x86_64-linux-gnu {,-m32}.
Committed to mainline, will be backported to release branches.
Uros.
[-- Attachment #2: p.diff.txt --]
[-- Type: text/plain, Size: 3266 bytes --]
Index: config/i386/i386.md
===================================================================
--- config/i386/i386.md (revision 250102)
+++ config/i386/i386.md (working copy)
@@ -5504,7 +5504,7 @@
(define_expand "floatunsdisf2"
[(use (match_operand:SF 0 "register_operand"))
(use (match_operand:DI 1 "nonimmediate_operand"))]
- "TARGET_64BIT && TARGET_SSE_MATH"
+ "TARGET_64BIT && TARGET_SSE && TARGET_SSE_MATH"
"x86_emit_floatuns (operands); DONE;")
(define_expand "floatunsdidf2"
@@ -7545,21 +7545,15 @@
(match_operand:XF 2 "register_operand")))]
"TARGET_80387")
-(define_expand "divdf3"
- [(set (match_operand:DF 0 "register_operand")
- (div:DF (match_operand:DF 1 "register_operand")
- (match_operand:DF 2 "nonimmediate_operand")))]
- "(TARGET_80387 && X87_ENABLE_ARITH (DFmode))
- || (TARGET_SSE2 && TARGET_SSE_MATH)")
-
-(define_expand "divsf3"
- [(set (match_operand:SF 0 "register_operand")
- (div:SF (match_operand:SF 1 "register_operand")
- (match_operand:SF 2 "nonimmediate_operand")))]
- "(TARGET_80387 && X87_ENABLE_ARITH (SFmode))
- || TARGET_SSE_MATH"
+(define_expand "div<mode>3"
+ [(set (match_operand:MODEF 0 "register_operand")
+ (div:MODEF (match_operand:MODEF 1 "register_operand")
+ (match_operand:MODEF 2 "nonimmediate_operand")))]
+ "(TARGET_80387 && X87_ENABLE_ARITH (<MODE>mode))
+ || (SSE_FLOAT_MODE_P (<MODE>mode) && TARGET_SSE_MATH)"
{
- if (TARGET_SSE_MATH
+ if (<MODE>mode == SFmode
+ && TARGET_SSE && TARGET_SSE_MATH
&& TARGET_RECIP_DIV
&& optimize_insn_for_speed_p ()
&& flag_finite_math_only && !flag_trapping_math
@@ -14050,7 +14044,7 @@
[(set (match_operand:SF 0 "register_operand" "=x")
(unspec:SF [(match_operand:SF 1 "nonimmediate_operand" "xm")]
UNSPEC_RCP))]
- "TARGET_SSE_MATH"
+ "TARGET_SSE && TARGET_SSE_MATH"
"%vrcpss\t{%1, %d0|%d0, %1}"
[(set_attr "type" "sse")
(set_attr "atom_sse_attr" "rcp")
@@ -14352,7 +14346,7 @@
[(set (match_operand:SF 0 "register_operand" "=x")
(unspec:SF [(match_operand:SF 1 "nonimmediate_operand" "xm")]
UNSPEC_RSQRT))]
- "TARGET_SSE_MATH"
+ "TARGET_SSE && TARGET_SSE_MATH"
"%vrsqrtss\t{%1, %d0|%d0, %1}"
[(set_attr "type" "sse")
(set_attr "atom_sse_attr" "rcp")
@@ -14364,7 +14358,7 @@
[(set (match_operand:SF 0 "register_operand")
(unspec:SF [(match_operand:SF 1 "nonimmediate_operand")]
UNSPEC_RSQRT))]
- "TARGET_SSE_MATH"
+ "TARGET_SSE && TARGET_SSE_MATH"
{
ix86_emit_swsqrtsf (operands[0], operands[1], SFmode, 1);
DONE;
@@ -14393,7 +14387,7 @@
|| (SSE_FLOAT_MODE_P (<MODE>mode) && TARGET_SSE_MATH)"
{
if (<MODE>mode == SFmode
- && TARGET_SSE_MATH
+ && TARGET_SSE && TARGET_SSE_MATH
&& TARGET_RECIP_SQRT
&& !optimize_function_for_size_p (cfun)
&& flag_finite_math_only && !flag_trapping_math
Index: testsuite/gcc.target/i386/pr81375.c
===================================================================
--- testsuite/gcc.target/i386/pr81375.c (nonexistent)
+++ testsuite/gcc.target/i386/pr81375.c (working copy)
@@ -0,0 +1,8 @@
+/* PR target/81375 */
+/* { dg-do compile { target ia32 } } */
+/* { dg-options "-mno-80387 -mno-sse -mfpmath=sse" } */
+
+float foo (float a, float b)
+{
+ return a / b;
+}
reply other threads:[~2017-07-10 22:03 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAFULd4bQGgfAeJOQtACYtJmCOXsmNcOwCK1YDnC1-oW-e+PgnA@mail.gmail.com \
--to=ubizjak@gmail.com \
--cc=gcc-patches@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).