+2002-10-21 Dale Johannesen <dalej@apple.com>
+
+ * config/rs6000/rs6000.c (rs6000_reverse_condition): Handle
+ unsafe math reversals correctly for RTL generation.
+ (output_cbranch): Replace rs6000_reverse_condition call
+ by its former definition.
+
2002-10-21 Jakub Jelinek <jakub@redhat.com>
* config/i386/i386.c (x86_64_sign_extended_value): Add allow_rip
* doc/c-tree.texi: Update description of COND_EXPR tree nodes.
+>>>>>>> 1.15743
2002-10-17 Geoffrey Keating <geoffk@apple.com>
* config/rs6000/rs6000.h (HARD_REGNO_MODE_OK): Allow arbitrary modes
{
/* Reversal of FP compares takes care -- an ordered compare
becomes an unordered compare and vice versa. */
- if (mode == CCFPmode)
+ if (mode == CCFPmode && !flag_unsafe_math_optimizations)
return reverse_condition_maybe_unordered (code);
else
return reverse_condition (code);
reverse_condition_maybe_unordered here always but this
makes the resulting assembler clearer. */
if (really_reversed)
- code = rs6000_reverse_condition (mode, code);
+ {
+ /* Reversal of FP compares takes care -- an ordered compare
+ becomes an unordered compare and vice versa. */
+ if (mode == CCFPmode)
+ code = reverse_condition_maybe_unordered (code);
+ else
+ code = reverse_condition (code);
+ }
if ((TARGET_SPE && TARGET_HARD_FLOAT) && mode == CCFPmode)
{
--- /dev/null
+/* { dg-do run } */
+/* { dg-options "-O2 -ffast-math" } */
+
+int foo ( float* dists, int k)
+{
+if ( ( dists [ 0 ] > 0 ) == ( dists [ 1 ] > 0 ) )
+ return k;
+return 0;
+}
+main() {
+ float dists[16] = { 0., 1., 1., 0., 0., -1., -1., 0.,
+ 1., 1., 1., -1., -1., 1., -1., -1. };
+ if ( foo(&dists[0], 1) +
+ foo(&dists[2], 2) +
+ foo(&dists[4], 4) +
+ foo(&dists[6], 8) +
+ foo(&dists[8], 16) +
+ foo(&dists[10], 32) +
+ foo(&dists[12], 64) +
+ foo(&dists[14], 128)
+ != 156)
+ abort();
+}
\ No newline at end of file