diff options
author | J"orn Rennecke <amylaar@redhat.com> | 2001-01-22 16:58:08 +0000 |
---|---|---|
committer | Joern Rennecke <amylaar@gcc.gnu.org> | 2001-01-22 16:58:08 +0000 |
commit | 44e4159d6030f56e5a0d9d4745e05dcfd8686aba (patch) | |
tree | 6d9cd74e4491229a7900da37a1a8c2d3f520dbe3 /gcc | |
parent | 62e4a758537dd6c82a0a2ce1b0cd75842e41441c (diff) | |
download | gcc-44e4159d6030f56e5a0d9d4745e05dcfd8686aba.zip gcc-44e4159d6030f56e5a0d9d4745e05dcfd8686aba.tar.gz gcc-44e4159d6030f56e5a0d9d4745e05dcfd8686aba.tar.bz2 |
recog.c (validate_replace_rtx_1): In ZERO_EXTEND / SIGN_EXTEND case...
* recog.c (validate_replace_rtx_1): In ZERO_EXTEND / SIGN_EXTEND
case, don't use operand_subword to calculate a SUBREG that is
wider than a word.
* rtl.texi: Comparisons yield 0 or STORE_FLAG_VALUE.
From-SVN: r39183
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/recog.c | 38 | ||||
-rw-r--r-- | gcc/rtl.texi | 12 |
3 files changed, 50 insertions, 8 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 47d9e2e..de41674 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +Mon Jan 22 16:53:06 2001 J"orn Rennecke <amylaar@redhat.com> + + * recog.c (validate_replace_rtx_1): In ZERO_EXTEND / SIGN_EXTEND + case, don't use operand_subword to calculate a SUBREG that is + wider than a word. + + * rtl.texi: Comparisons yield 0 or STORE_FLAG_VALUE. + 2001-01-22 Herman A.J. ten Brugge <Haj.Ten.Brugge@net.HCC.nl> * c4x.c (c4x_valid_rptb_p, c4x_label_ref_used_p): New functions. diff --git a/gcc/recog.c b/gcc/recog.c index 4257d7c..4dab907 100644 --- a/gcc/recog.c +++ b/gcc/recog.c @@ -491,8 +491,42 @@ validate_replace_rtx_1 (loc, from, to, object) /* If there is a subreg involved, crop to the portion of the constant that we are interested in. */ if (GET_CODE (XEXP (x, 0)) == SUBREG) - to = operand_subword (to, SUBREG_WORD (XEXP (x, 0)), - 0, GET_MODE (from)); + { + if (GET_MODE_SIZE (GET_MODE (XEXP (x, 0))) <= UNITS_PER_WORD) + to = operand_subword (to, SUBREG_WORD (XEXP (x, 0)), + 0, GET_MODE (from)); + else if (GET_MODE_CLASS (GET_MODE (from)) == MODE_INT + && (GET_MODE_BITSIZE (GET_MODE (XEXP (x, 0))) + <= HOST_BITS_PER_WIDE_INT)) + { + int i = SUBREG_WORD (XEXP (x, 0)) * BITS_PER_WORD; + HOST_WIDE_INT valh; + unsigned HOST_WIDE_INT vall; + + if (GET_CODE (to) == CONST_INT) + { + vall = INTVAL (to); + valh = (HOST_WIDE_INT) vall < 0 ? ~0 : 0; + } + else + { + vall = CONST_DOUBLE_LOW (to); + valh = CONST_DOUBLE_HIGH (to); + } + + if (WORDS_BIG_ENDIAN) + i = (GET_MODE_BITSIZE (GET_MODE (from)) + - GET_MODE_BITSIZE (GET_MODE (XEXP (x, 0))) - i); + if (i > 0 && i < HOST_BITS_PER_WIDE_INT) + vall = vall >> i | valh << (HOST_BITS_PER_WIDE_INT - i); + else if (i >= HOST_BITS_PER_WIDE_INT) + vall = valh >> (i - HOST_BITS_PER_WIDE_INT); + to = GEN_INT (trunc_int_for_mode (vall, + GET_MODE (XEXP (x, 0)))); + } + else + to = gen_rtx_CLOBBER (GET_MODE (x), const0_rtx); + } /* If the above didn't fail, perform the extension from the mode of the operand (and not the mode of FROM). */ diff --git a/gcc/rtl.texi b/gcc/rtl.texi index 4cb0eb7..6ed90f8 100644 --- a/gcc/rtl.texi +++ b/gcc/rtl.texi @@ -1628,20 +1628,20 @@ point comparisons are distinguished by the machine modes of the operands. @findex eq @cindex equal @item (eq:@var{m} @var{x} @var{y}) -1 if the values represented by @var{x} and @var{y} are equal, -otherwise 0. +@code{STORE_FLAG_VALUE} if the values represented by @var{x} and @var{y} +are equal, otherwise 0. @findex ne @cindex not equal @item (ne:@var{m} @var{x} @var{y}) -1 if the values represented by @var{x} and @var{y} are not equal, -otherwise 0. +@code{STORE_FLAG_VALUE} if the values represented by @var{x} and @var{y} +are not equal, otherwise 0. @findex gt @cindex greater than @item (gt:@var{m} @var{x} @var{y}) -1 if the @var{x} is greater than @var{y}. If they are fixed-point, -the comparison is done in a signed sense. +@code{STORE_FLAG_VALUE} if the @var{x} is greater than @var{y}. If they +are fixed-point, the comparison is done in a signed sense. @findex gtu @cindex greater than |