From 0398a3988608e10f0f5e8bb4f6bec1b1771de98d Mon Sep 17 00:00:00 2001 From: nickc Date: Thu, 21 Nov 2002 16:36:52 +0000 Subject: [PATCH] * config/fr30/fr30.md (movsf_constant_store): Move code to detect 0.0 into fr30.c. * config/fr30/fr30-protos.h (fr30_const_double_is_zero): Prototype. * config/fr30/fr30.c (fr30_const_double_is_zero): New function. Return true if the rtx is 0.0. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@59349 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 9 +++++++++ gcc/config/fr30/fr30-protos.h | 3 ++- gcc/config/fr30/fr30.c | 14 ++++++++++++++ gcc/config/fr30/fr30.md | 11 +++-------- 4 files changed, 28 insertions(+), 9 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5b474d5..302d13d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2002-11-21 Nick Clifton + + * config/fr30/fr30.md (movsf_constant_store): Move code to + detect 0.0 into fr30.c. + * config/fr30/fr30-protos.h (fr30_const_double_is_zero): + Prototype. + * config/fr30/fr30.c (fr30_const_double_is_zero): New + function. Return true if the rtx is 0.0. + 2002-11-21 Jason Thorpe * config/arm/elf.h (ASM_SPEC, LINK_SPEC): Pass -EL diff --git a/gcc/config/fr30/fr30-protos.h b/gcc/config/fr30/fr30-protos.h index e6d3138..4aab88c 100644 --- a/gcc/config/fr30/fr30-protos.h +++ b/gcc/config/fr30/fr30-protos.h @@ -1,5 +1,5 @@ /* Prototypes for fr30.c functions used in the md file & elsewhere. - Copyright (C) 1999, 2000 Free Software Foundation, Inc. + Copyright (C) 1999, 2000, 2002 Free Software Foundation, Inc. This file is part of GNU CC. @@ -39,6 +39,7 @@ extern int low_register_operand PARAMS ((rtx, Mmode)); extern int call_operand PARAMS ((rtx, Mmode)); extern int di_operand PARAMS ((rtx, Mmode)); extern int nonimmediate_di_operand PARAMS ((rtx, Mmode)); +extern int fr30_const_double_is_zero PARAMS ((rtx)); #undef Mmode #endif /* HAVE_MACHINE_MODES */ #endif /* RTX_CODE */ diff --git a/gcc/config/fr30/fr30.c b/gcc/config/fr30/fr30.c index e163f92..d01d6bd 100644 --- a/gcc/config/fr30/fr30.c +++ b/gcc/config/fr30/fr30.c @@ -951,6 +951,20 @@ fr30_check_multiple_regs (operands, num_operands, descending) return 1; } +int +fr30_const_double_is_zero (operand) + rtx operand; +{ + REAL_VALUE_TYPE d; + + if (operand == NULL || GET_CODE (operand) != CONST_DOUBLE) + return 0; + + REAL_VALUE_FROM_CONST_DOUBLE (d, operand); + + return REAL_VALUES_EQUAL (d, dconst0); +} + /*}}}*/ /*{{{ Instruction Output Routines */ diff --git a/gcc/config/fr30/fr30.md b/gcc/config/fr30/fr30.md index b78e99d..b19f655 100644 --- a/gcc/config/fr30/fr30.md +++ b/gcc/config/fr30/fr30.md @@ -1,5 +1,5 @@ ;; FR30 machine description. -;; Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc. +;; Copyright (C) 1998, 1999, 2000, 2002 Free Software Foundation, Inc. ;; Contributed by Cygnus Solutions. ;; This file is part of GNU CC. @@ -571,14 +571,9 @@ const char * ldi_instr; const char * tmp_reg; static char buffer[100]; - REAL_VALUE_TYPE d; - REAL_VALUE_FROM_CONST_DOUBLE (d, operands[1]); - - if (REAL_VALUES_EQUAL (d, dconst0)) - ldi_instr = \"ldi:8\"; - else - ldi_instr = \"ldi:32\"; + ldi_instr = fr30_const_double_is_zero (operands[1]) + ? ldi_instr = \"ldi:8\" : \"ldi:32\"; tmp_reg = reg_names [COMPILER_SCRATCH_REGISTER]; -- 2.7.4