]> gcc.gnu.org Git - gcc.git/commitdiff
(force_to_mode): OP_MODE must be MODE if MODE and mode of X are of different classes.
authorRichard Kenner <kenner@gcc.gnu.org>
Fri, 8 Jul 1994 22:30:49 +0000 (18:30 -0400)
committerRichard Kenner <kenner@gcc.gnu.org>
Fri, 8 Jul 1994 22:30:49 +0000 (18:30 -0400)
(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

gcc/combine.c

index 81f55e9a28a429019c68d43d7fec18b55d4c1b0f..d5b093f0634462504f5038fd4ebc80ba84c69a5c 100644 (file)
@@ -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);
This page took 0.0840379999999999 seconds and 5 git commands to generate.