From: Jim Wilson Date: Sun, 8 Aug 1993 22:10:02 +0000 (-0700) Subject: (reg_or_0_operand): Use fp_zero_operand. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=302484ff4a3f38eedece5cc70d0cce7698689f12;p=gcc.git (reg_or_0_operand): Use fp_zero_operand. (fp_zero_operand): New function. From-SVN: r5113 --- diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c index ae0c45e2d33..6f0f389290d 100644 --- a/gcc/config/sparc/sparc.c +++ b/gcc/config/sparc/sparc.c @@ -96,13 +96,28 @@ reg_or_0_operand (op, mode) { if (op == const0_rtx || register_operand (op, mode)) return 1; - if (GET_CODE (op) == CONST_DOUBLE + if (GET_MODE (op) == DImode && GET_CODE (op) == CONST_DOUBLE && CONST_DOUBLE_HIGH (op) == 0 && CONST_DOUBLE_LOW (op) == 0) return 1; + if (GET_MODE_CLASS (GET_MODE (op)) == MODE_FLOAT + && GET_CODE (op) == CONST_DOUBLE + && fp_zero_operand (op)) + return 1; return 0; } +/* Nonzero if OP is a floating point value with value 0.0. */ +int +fp_zero_operand (op) + rtx op; +{ + REAL_VALUE_TYPE r; + + REAL_VALUE_FROM_CONST_DOUBLE (r, op); + return REAL_VALUES_EQUAL (r, dconst0); +} + /* Nonzero if OP can appear as the dest of a RESTORE insn. */ int restore_operand (op, mode)