Commit 4901a643 by Richard Henderson Committed by Richard Henderson

emit-rtl.c (gen_lowpart_common): Skip count by HARD_REGNO_NREGS.

* emit-rtl.c (gen_lowpart_common): Skip count by HARD_REGNO_NREGS.
(gen_highpart): Likewise.

From-SVN: r18945
parent 79363e2f
...@@ -3,6 +3,9 @@ Thu Apr 2 01:01:34 1998 Richard Henderson <rth@cygnus.com> ...@@ -3,6 +3,9 @@ Thu Apr 2 01:01:34 1998 Richard Henderson <rth@cygnus.com>
* configure (alpha-*-linuxecoff, alpha-*-linux-gnulibc1): * configure (alpha-*-linuxecoff, alpha-*-linux-gnulibc1):
Run fixincludes. Run fixincludes.
* emit-rtl.c (gen_lowpart_common): Skip count by HARD_REGNO_NREGS.
(gen_highpart): Likewise.
Wed Apr 1 22:26:22 1998 Jeffrey A Law (law@cygnus.com) Wed Apr 1 22:26:22 1998 Jeffrey A Law (law@cygnus.com)
* fold-const.c optimze_bit_field_compare): Initialize rnbitpos, * fold-const.c optimze_bit_field_compare): Initialize rnbitpos,
......
...@@ -652,6 +652,17 @@ gen_lowpart_common (mode, x) ...@@ -652,6 +652,17 @@ gen_lowpart_common (mode, x)
: gen_rtx_SUBREG (mode, SUBREG_REG (x), SUBREG_WORD (x) + word)); : gen_rtx_SUBREG (mode, SUBREG_REG (x), SUBREG_WORD (x) + word));
else if (GET_CODE (x) == REG) else if (GET_CODE (x) == REG)
{ {
/* Let the backend decide how many registers to skip. This is needed
in particular for Sparc64 where fp regs are smaller than a word. */
/* ??? Note that subregs are now ambiguous, in that those against
pseudos are sized by the Word Size, while those against hard
regs are sized by the underlying register size. Better would be
to always interpret the subreg offset parameter as bytes or bits. */
if (WORDS_BIG_ENDIAN && REGNO (x) < FIRST_PSEUDO_REGISTER)
word = (HARD_REGNO_NREGS (REGNO (x), GET_MODE (x))
- HARD_REGNO_NREGS (REGNO (x), mode));
/* If the register is not valid for MODE, return 0. If we don't /* If the register is not valid for MODE, return 0. If we don't
do this, there is no way to fix up the resulting REG later. do this, there is no way to fix up the resulting REG later.
But we do do this if the current REG is not valid for its But we do do this if the current REG is not valid for its
...@@ -1002,17 +1013,16 @@ gen_highpart (mode, x) ...@@ -1002,17 +1013,16 @@ gen_highpart (mode, x)
{ {
int word = 0; int word = 0;
if (! WORDS_BIG_ENDIAN /* Let the backend decide how many registers to skip. This is needed
&& GET_MODE_SIZE (GET_MODE (x)) > UNITS_PER_WORD) in particular for sparc64 where fp regs are smaller than a word. */
word = ((GET_MODE_SIZE (GET_MODE (x)) /* ??? Note that subregs are now ambiguous, in that those against
- MAX (GET_MODE_SIZE (mode), UNITS_PER_WORD)) pseudos are sized by the Word Size, while those against hard
/ UNITS_PER_WORD); regs are sized by the underlying register size. Better would be
to always interpret the subreg offset parameter as bytes or bits. */
/*
* ??? This fails miserably for complex values being passed in registers if (! WORDS_BIG_ENDIAN && REGNO (x) < FIRST_PSEUDO_REGISTER)
* where the sizeof the real and imaginary part are not equal to the word = (HARD_REGNO_NREGS (REGNO (x), GET_MODE (x))
* sizeof SImode. FIXME - HARD_REGNO_NREGS (REGNO (x), mode));
*/
if (REGNO (x) < FIRST_PSEUDO_REGISTER if (REGNO (x) < FIRST_PSEUDO_REGISTER
/* integrate.c can't handle parts of a return value register. */ /* integrate.c can't handle parts of a return value register. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment