diff options
author | Richard Stallman <rms@gnu.org> | 1993-05-30 01:13:02 +0000 |
---|---|---|
committer | Richard Stallman <rms@gnu.org> | 1993-05-30 01:13:02 +0000 |
commit | e5c2baa1a691cf1044eab70cc2abc137d40728f0 (patch) | |
tree | 405e938b6561cc221f1bcbe2d61e785b9f8dd02b /gcc | |
parent | ae98fe096541c1e0c7fcf776d267dcbb3f6844b6 (diff) | |
download | gcc-e5c2baa1a691cf1044eab70cc2abc137d40728f0.zip gcc-e5c2baa1a691cf1044eab70cc2abc137d40728f0.tar.gz gcc-e5c2baa1a691cf1044eab70cc2abc137d40728f0.tar.bz2 |
(singlemove_string): Handle SFmode CONST_DOUBLE as a source operand.
From-SVN: r4595
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/config/pa/pa.c | 39 |
1 files changed, 32 insertions, 7 deletions
diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c index 30fcf9a..11c79d4 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"; } |