From e5c2baa1a691cf1044eab70cc2abc137d40728f0 Mon Sep 17 00:00:00 2001 From: Richard Stallman Date: Sun, 30 May 1993 01:13:02 +0000 Subject: [PATCH] (singlemove_string): Handle SFmode CONST_DOUBLE as a source operand. From-SVN: r4595 --- gcc/config/pa/pa.c | 39 ++++++++++++++++++++++++++++++++------- 1 file changed, 32 insertions(+), 7 deletions(-) diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c index 30fcf9a3e8d..11c79d45177 100644 --- a/gcc/config/pa/pa.c +++ b/gcc/config/pa/pa.c @@ -891,7 +891,11 @@ read_only_operand (operand) /* Return the best assembler insn template - for moving operands[1] into operands[0] as a fullword. */ + for moving operands[1] into operands[0] as a fullword. + + For CONST_DOUBLE and CONST_INT we should also check for + other values we can load directly via zdepi, ldil, etc. + ??? Do this for 2.5. */ char * singlemove_string (operands) @@ -899,13 +903,34 @@ singlemove_string (operands) { if (GET_CODE (operands[0]) == MEM) return "stw %r1,%0"; - if (GET_CODE (operands[1]) == MEM) + else if (GET_CODE (operands[1]) == MEM) return "ldw %1,%0"; - if (GET_CODE (operands[1]) == CONST_INT) - if (INT_14_BITS (operands[1])) - return (INTVAL (operands[1]) == 0 ? "copy 0,%0" : "ldi %1,%0"); - else - return "ldil L'%1,%0\n\tldo R'%1(%0),%0"; + else if (GET_CODE (operands[1]) == CONST_DOUBLE + && GET_MODE (operands[1]) == SFmode) + { + int i; + union real_extract u; + union float_extract { float f; int i; } v; + + bcopy (&CONST_DOUBLE_LOW (operands[1]), &u, sizeof u); + v.f = REAL_VALUE_TRUNCATE (SFmode, u.d); + i = v.i; + + operands[1] = gen_rtx (CONST_INT, VOIDmode, i); + + if (INT_14_BITS (operands[1])) + return (INTVAL (operands[1]) == 0 ? "copy 0,%0" : "ldi %1,%0"); + else + return "ldil L'%1,%0\n\tldo R'%1(%0),%0"; + } + + else if (GET_CODE (operands[1]) == CONST_INT) + { + if (INT_14_BITS (operands[1])) + return (INTVAL (operands[1]) == 0 ? "copy 0,%0" : "ldi %1,%0"); + else + return "ldil L'%1,%0\n\tldo R'%1(%0),%0"; + } return "copy %1,%0"; } -- 2.30.2