From 0c51108cb8a3fd7290fa5f7fc38706488f69fd27 Mon Sep 17 00:00:00 2001 From: geoffk Date: Sat, 3 May 2003 23:16:56 +0000 Subject: [PATCH] * config/rs6000/rs6000.h (REVERSIBLE_CC_MODE): Define. (REVERSE_CONDITION): Define. * gcc.dg/ppc-fsel-1.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@66442 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 3 +++ gcc/config/rs6000/rs6000.h | 11 +++++++++-- gcc/testsuite/ChangeLog | 4 ++++ gcc/testsuite/gcc.dg/ppc-fsel-1.c | 10 ++++++++++ 4 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 gcc/testsuite/gcc.dg/ppc-fsel-1.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 18b1d9eb7ba..a7a01a6da90 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,8 @@ 2003-05-03 Geoffrey Keating + * config/rs6000/rs6000.h (REVERSIBLE_CC_MODE): Define. + (REVERSE_CONDITION): Define. + * config/rs6000/rs6000.c (scc_comparison_operator): Make equivalent to branch_positive_comparison_operator. (ccr_bit): Check that sCOND conditions are actually a positive bit. diff --git a/gcc/config/rs6000/rs6000.h b/gcc/config/rs6000/rs6000.h index 994f67af8be..6d95b7a5cfc 100644 --- a/gcc/config/rs6000/rs6000.h +++ b/gcc/config/rs6000/rs6000.h @@ -2366,9 +2366,16 @@ do { \ : (((OP) == EQ || (OP) == NE) && GET_RTX_CLASS (GET_CODE (X)) == '<' \ ? CCEQmode : CCmode)) +/* Can the condition code MODE be safely reversed? This is safe in + all cases on this port, because at present it doesn't use the + trapping FP comparisons (fcmpo). */ +#define REVERSIBLE_CC_MODE(MODE) 1 + +/* Given a condition code and a mode, return the inverse condition. */ +#define REVERSE_CONDITION(CODE, MODE) rs6000_reverse_condition (MODE, CODE) + /* Define the information needed to generate branch and scc insns. This is - stored from the compare operation. Note that we can't use "rtx" here - since it hasn't been defined! */ + stored from the compare operation. */ extern GTY(()) rtx rs6000_compare_op0; extern GTY(()) rtx rs6000_compare_op1; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index d041bd5eaa3..1b79f249de9 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2003-05-03 Geoffrey Keating + + * gcc.dg/ppc-fsel-1.c: New test. + 2003-05-03 Zack Weinberg PR c/10604 diff --git a/gcc/testsuite/gcc.dg/ppc-fsel-1.c b/gcc/testsuite/gcc.dg/ppc-fsel-1.c new file mode 100644 index 00000000000..266b8dbd5a5 --- /dev/null +++ b/gcc/testsuite/gcc.dg/ppc-fsel-1.c @@ -0,0 +1,10 @@ +/* { dg-do compile { target powerpc*-*-* } } */ +/* { dg-options "-O -mpowerpc-gfxopt" } */ +/* { dg-final { scan-assembler "fsel" } } */ + +/* Check that fsel can be generated even without -ffast-math. */ + +double foo(double a, double b, double c, double d) +{ + return a < b ? c : d; +} -- 2.11.0