Commit 57dadce2 by Eric Christopher

emit-rtl.c (gen_lowpart_common): Do not assume that SFmode and DFmode are…

emit-rtl.c (gen_lowpart_common): Do not assume that SFmode and DFmode are UNITS_PER_WORD and 2*UNITS_PER_WORD.

2001-06-19  Eric Christopher <echristo@redhat.com>

	* emit-rtl.c (gen_lowpart_common): Do not assume that SFmode
	and DFmode are UNITS_PER_WORD and 2*UNITS_PER_WORD.  Use
	GET_MODE_BITSIZE instead of GET_MODE_SIZE/UNITS_PER_WORD.

From-SVN: r43454
parent beec1ac5
2001-06-19 Eric Christopher <echristo@redhat.com>
* emit-rtl.c (gen_lowpart_common): Do not assume that SFmode
and DFmode are UNITS_PER_WORD and 2*UNITS_PER_WORD. Use
GET_MODE_BITSIZE instead of GET_MODE_SIZE/UNITS_PER_WORD.
Tue Jun 19 01:52:27 2001 J"orn Rennecke <amylaar@redhat.com> Tue Jun 19 01:52:27 2001 J"orn Rennecke <amylaar@redhat.com>
* sh.c (output_branch): Delete bogus code. * sh.c (output_branch): Delete bogus code.
......
...@@ -900,9 +900,11 @@ gen_lowpart_common (mode, x) ...@@ -900,9 +900,11 @@ gen_lowpart_common (mode, x)
FP and integer operands. This simplifies reload because it FP and integer operands. This simplifies reload because it
doesn't have to deal with constructs like (subreg:DI doesn't have to deal with constructs like (subreg:DI
(const_double:SF ...)) or (subreg:DF (const_int ...)). */ (const_double:SF ...)) or (subreg:DF (const_int ...)). */
/* Single-precision floats are always 32-bits and double-precision
floats are always 64-bits. */
else if (GET_MODE_CLASS (mode) == MODE_FLOAT else if (GET_MODE_CLASS (mode) == MODE_FLOAT
&& GET_MODE_SIZE (mode) == UNITS_PER_WORD && GET_MODE_BITSIZE (mode) == 32
&& GET_CODE (x) == CONST_INT) && GET_CODE (x) == CONST_INT)
{ {
REAL_VALUE_TYPE r; REAL_VALUE_TYPE r;
...@@ -913,7 +915,7 @@ gen_lowpart_common (mode, x) ...@@ -913,7 +915,7 @@ gen_lowpart_common (mode, x)
return CONST_DOUBLE_FROM_REAL_VALUE (r, mode); return CONST_DOUBLE_FROM_REAL_VALUE (r, mode);
} }
else if (GET_MODE_CLASS (mode) == MODE_FLOAT else if (GET_MODE_CLASS (mode) == MODE_FLOAT
&& GET_MODE_SIZE (mode) == 2 * UNITS_PER_WORD && GET_MODE_BITSIZE (mode) == 64
&& (GET_CODE (x) == CONST_INT || GET_CODE (x) == CONST_DOUBLE) && (GET_CODE (x) == CONST_INT || GET_CODE (x) == CONST_DOUBLE)
&& GET_MODE (x) == VOIDmode) && GET_MODE (x) == VOIDmode)
{ {
...@@ -952,20 +954,20 @@ gen_lowpart_common (mode, x) ...@@ -952,20 +954,20 @@ gen_lowpart_common (mode, x)
int endian = WORDS_BIG_ENDIAN ? 1 : 0; int endian = WORDS_BIG_ENDIAN ? 1 : 0;
REAL_VALUE_FROM_CONST_DOUBLE (r, x); REAL_VALUE_FROM_CONST_DOUBLE (r, x);
switch (GET_MODE_SIZE (GET_MODE (x)) / UNITS_PER_WORD) switch (GET_MODE_BITSIZE (GET_MODE (x)))
{ {
case 1: case 32:
REAL_VALUE_TO_TARGET_SINGLE (r, i[endian]); REAL_VALUE_TO_TARGET_SINGLE (r, i[endian]);
i[1 - endian] = 0; i[1 - endian] = 0;
break; break;
case 2: case 64:
REAL_VALUE_TO_TARGET_DOUBLE (r, i); REAL_VALUE_TO_TARGET_DOUBLE (r, i);
break; break;
case 3: case 96:
REAL_VALUE_TO_TARGET_LONG_DOUBLE (r, i + endian); REAL_VALUE_TO_TARGET_LONG_DOUBLE (r, i + endian);
i[3-3*endian] = 0; i[3-3*endian] = 0;
break; break;
case 4: case 128:
REAL_VALUE_TO_TARGET_LONG_DOUBLE (r, i); REAL_VALUE_TO_TARGET_LONG_DOUBLE (r, i);
break; break;
default: default:
...@@ -986,15 +988,15 @@ gen_lowpart_common (mode, x) ...@@ -986,15 +988,15 @@ gen_lowpart_common (mode, x)
for (c = 0; c < 4; c++) for (c = 0; c < 4; c++)
i[c] &= ~ (0L); i[c] &= ~ (0L);
switch (GET_MODE_SIZE (GET_MODE (x)) / UNITS_PER_WORD) switch (GET_MODE_BITSIZE (GET_MODE (x)))
{ {
case 1: case 32:
case 2: case 64:
return immed_double_const (((unsigned long) i[endian]) | return immed_double_const (((unsigned long) i[endian]) |
(((HOST_WIDE_INT) i[1-endian]) << 32), (((HOST_WIDE_INT) i[1-endian]) << 32),
0, mode); 0, mode);
case 3: case 96:
case 4: case 128:
return immed_double_const (((unsigned long) i[endian*3]) | return immed_double_const (((unsigned long) i[endian*3]) |
(((HOST_WIDE_INT) i[1+endian]) << 32), (((HOST_WIDE_INT) i[1+endian]) << 32),
((unsigned long) i[2-endian]) | ((unsigned long) i[2-endian]) |
......
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