aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1994-07-08 18:30:49 -0400
committerRichard Kenner <kenner@gcc.gnu.org>1994-07-08 18:30:49 -0400
commit1c75dfa4420861aab38c2ebc5fa469bea22dae04 (patch)
treed4fc35b87f3efc9b59e116cb97bf0fda499f5b04
parenta890174971baeb7df28d7c86251fecd234094fac (diff)
downloadgcc-1c75dfa4420861aab38c2ebc5fa469bea22dae04.zip
gcc-1c75dfa4420861aab38c2ebc5fa469bea22dae04.tar.gz
gcc-1c75dfa4420861aab38c2ebc5fa469bea22dae04.tar.bz2
(force_to_mode): OP_MODE must be MODE if MODE and mode of X are of different classes.
(force_to_mode): OP_MODE must be MODE if MODE and mode of X are of different classes. (nonzero_bits, num_sign_bit_copies): Say nothing known for floating-point modes. From-SVN: r7688
-rw-r--r--gcc/combine.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/gcc/combine.c b/gcc/combine.c
index 81f55e9..d5b093f 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -5608,7 +5608,8 @@ force_to_mode (x, mode, mask, reg, just_select)
/* We want to perform the operation is its present mode unless we know
that the operation is valid in MODE, in which case we do the operation
in MODE. */
- op_mode = ((code_to_optab[(int) code] != 0
+ op_mode = ((GET_MODE_CLASS (mode) == GET_MODE_CLASS (GET_MODE (x))
+ && code_to_optab[(int) code] != 0
&& (code_to_optab[(int) code]->handlers[(int) mode].insn_code
!= CODE_FOR_nothing))
? mode : GET_MODE (x));
@@ -6667,6 +6668,10 @@ nonzero_bits (x, mode)
int mode_width = GET_MODE_BITSIZE (mode);
rtx tem;
+ /* For floating-point values, assume all bits are needed. */
+ if (FLOAT_MODE_P (GET_MODE (x)) || FLOAT_MODE_P (mode))
+ return nonzero;
+
/* If X is wider than MODE, use its mode instead. */
if (GET_MODE_BITSIZE (GET_MODE (x)) > mode_width)
{
@@ -7026,12 +7031,13 @@ num_sign_bit_copies (x, mode)
rtx tem;
/* If we weren't given a mode, use the mode of X. If the mode is still
- VOIDmode, we don't know anything. */
+ VOIDmode, we don't know anything. Likewise if one of the modes is
+ floating-point. */
if (mode == VOIDmode)
mode = GET_MODE (x);
- if (mode == VOIDmode)
+ if (mode == VOIDmode || FLOAT_MODE_P (mode) || FLOAT_MODE_P (GET_MODE (x)))
return 1;
bitwidth = GET_MODE_BITSIZE (mode);