OSDN Git Service

2005-04-02 Daniel Berlin <dberlin@dberlin.org>
[pf3gnuchains/gcc-fork.git] / gcc / rtlhooks.c
index 49d4cfe..dbe9593 100644 (file)
@@ -1,5 +1,5 @@
 /* Generic hooks for the RTL middle-end.
-   Copyright (C) 2004 Free Software Foundation, Inc.
+   Copyright (C) 2004, 2005 Free Software Foundation, Inc.
 
 This file is part of GCC.
 
@@ -79,6 +79,19 @@ gen_lowpart_general (enum machine_mode mode, rtx x)
     }
 }
 
+/* Similar to gen_lowpart, but cannot emit any instruction via
+   copy_to_reg or force_reg.  Mainly used in simplify-rtx.c.  */
+rtx
+gen_lowpart_no_emit_general (enum machine_mode mode, rtx x)
+{
+  rtx result = gen_lowpart_common (mode, x);
+  if (result)
+    return result;
+  if (mode != GET_MODE (x) && GET_MODE (x) != VOIDmode)
+    return gen_lowpart_SUBREG (mode, x);
+  return x;
+}
+
 rtx
 reg_num_sign_bit_copies_general (rtx x ATTRIBUTE_UNUSED,
                                 enum machine_mode mode ATTRIBUTE_UNUSED,