public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [committed] i386: Fix atan2l argument order [PR93743]
@ 2020-02-16 20:41 Uros Bizjak
  0 siblings, 0 replies; only message in thread
From: Uros Bizjak @ 2020-02-16 20:41 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 465 bytes --]

i386: Fix atan2l argument order [PR93743]

Bootstrapped and regression tested on x86_64-linux-gnu {,-m32}.

2020-02-16  Uroš Bizjak  <ubizjak@gmail.com>

    PR target/93743
    * config/i386/i386.md (atan2xf3): Swap operands 1 and 2.
    (atan2<mode>3): Update operand order in the call to gen_atan2xf3.

testsuite/ChangeLog:

2020-02-16  Uroš Bizjak  <ubizjak@gmail.com>

    PR target/93743
    * gcc.target/i386/pr93743.c : New test.

Uros.

[-- Attachment #2: p.diff.txt --]
[-- Type: text/plain, Size: 1001 bytes --]

diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index f14683cd14f..6c57500ae8e 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -15999,10 +15999,10 @@
 
 (define_insn "atan2xf3"
   [(set (match_operand:XF 0 "register_operand" "=f")
-        (unspec:XF [(match_operand:XF 1 "register_operand" "0")
-	            (match_operand:XF 2 "register_operand" "f")]
+        (unspec:XF [(match_operand:XF 2 "register_operand" "0")
+	            (match_operand:XF 1 "register_operand" "f")]
 	           UNSPEC_FPATAN))
-   (clobber (match_scratch:XF 3 "=2"))]
+   (clobber (match_scratch:XF 3 "=1"))]
   "TARGET_USE_FANCY_MATH_387
    && flag_unsafe_math_optimizations"
   "fpatan"
@@ -16026,7 +16026,7 @@
   emit_insn (gen_extend<mode>xf2 (op2, operands[2]));
   emit_insn (gen_extend<mode>xf2 (op1, operands[1]));
 
-  emit_insn (gen_atan2xf3 (op0, op2, op1));
+  emit_insn (gen_atan2xf3 (op0, op1, op2));
   emit_insn (gen_truncxf<mode>2 (operands[0], op0));
   DONE;
 })

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-02-16 20:41 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-16 20:41 [committed] i386: Fix atan2l argument order [PR93743] Uros Bizjak

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).