Commit 6e37e496 by Uros Bizjak

i386: Fix atan2l argument order [PR93743]

	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:

	PR target/93743
	* gcc.target/i386/pr93743.c : New test.
parent 72700543
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.
2020-02-15 Jason Merrill <jason@redhat.com>
* doc/invoke.texi (C Dialect Options): Add -std=c++20.
......
......@@ -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;
})
......
2020-02-16 Uroš Bizjak <ubizjak@gmail.com>
PR target/93743
* gcc.target/i386/pr93743.c : New test.
2020-02-15 Marek Polacek <polacek@redhat.com>
PR c++/93710 - poor diagnostic for array initializer.
......
/* { dg-do run } */
/* { dg-options "-O2 -ffast-math -mfpmath=387" } */
void
__attribute__((noinline))
test (long double x, long double y)
{
long double ldbl_n = __builtin_atan2l (x, y);
long double ldbl_s = __builtin_atan2l (y, x); // arguments swapped
if (ldbl_n < 1.L || 1.L < ldbl_s)
__builtin_abort ();
double dbl_n = __builtin_atan2 (x, y);
double dbl_s = __builtin_atan2 (y, x); // arguments swapped
if (dbl_n < 1. || 1. < dbl_s)
__builtin_abort ();
}
int
main ()
{
long double x = 0.922766L;
long double y = 0.080466L;
test (x, y);
return 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment