Commit 8d6b2775 by Kazu Hirata Committed by Kazu Hirata

combine.c (simplify_set): Don't move a subreg in SET_SRC to SET_DEST if...

	* combine.c (simplify_set): Don't move a subreg in SET_SRC to
	SET_DEST if WORD_REGISTER_OPERATIONS is not defined.

From-SVN: r67388
parent bf46042b
2003-06-03 Kazu Hirata <kazu@cs.umass.edu>
* combine.c (simplify_set): Don't move a subreg in SET_SRC to
SET_DEST if WORD_REGISTER_OPERATIONS is not defined.
2003-06-03 Nathanael Nerode <neroden@gcc.gnu.org> 2003-06-03 Nathanael Nerode <neroden@gcc.gnu.org>
* config/i386/x86-64.h: Remove two target-independent comments; * config/i386/x86-64.h: Remove two target-independent comments;
......
...@@ -5238,17 +5238,18 @@ simplify_set (x) ...@@ -5238,17 +5238,18 @@ simplify_set (x)
SUBST (SET_SRC (x), src); SUBST (SET_SRC (x), src);
} }
#ifdef WORD_REGISTER_OPERATIONS
/* If we have (set x (subreg:m1 (op:m2 ...) 0)) with OP being some operation, /* If we have (set x (subreg:m1 (op:m2 ...) 0)) with OP being some operation,
and X being a REG or (subreg (reg)), we may be able to convert this to and X being a REG or (subreg (reg)), we may be able to convert this to
(set (subreg:m2 x) (op)). (set (subreg:m2 x) (op)).
We can always do this if M1 is narrower than M2 because that means that On a machine where WORD_REGISTER_OPERATIONS is defined, this
we only care about the low bits of the result. transformation is safe as long as M1 and M2 have the same number
of words.
However, on machines without WORD_REGISTER_OPERATIONS defined, we cannot However, on a machine without WORD_REGISTER_OPERATIONS defined,
perform a narrower operation than requested since the high-order bits will we cannot apply this transformation because it would create a
be undefined. On machine where it is defined, this transformation is safe paradoxical subreg in SET_DEST. */
as long as M1 and M2 have the same number of words. */
if (GET_CODE (src) == SUBREG && subreg_lowpart_p (src) if (GET_CODE (src) == SUBREG && subreg_lowpart_p (src)
&& GET_RTX_CLASS (GET_CODE (SUBREG_REG (src))) != 'o' && GET_RTX_CLASS (GET_CODE (SUBREG_REG (src))) != 'o'
...@@ -5256,10 +5257,6 @@ simplify_set (x) ...@@ -5256,10 +5257,6 @@ simplify_set (x)
/ UNITS_PER_WORD) / UNITS_PER_WORD)
== ((GET_MODE_SIZE (GET_MODE (SUBREG_REG (src))) == ((GET_MODE_SIZE (GET_MODE (SUBREG_REG (src)))
+ (UNITS_PER_WORD - 1)) / UNITS_PER_WORD)) + (UNITS_PER_WORD - 1)) / UNITS_PER_WORD))
#ifndef WORD_REGISTER_OPERATIONS
&& (GET_MODE_SIZE (GET_MODE (src))
< GET_MODE_SIZE (GET_MODE (SUBREG_REG (src))))
#endif
#ifdef CANNOT_CHANGE_MODE_CLASS #ifdef CANNOT_CHANGE_MODE_CLASS
&& ! (GET_CODE (dest) == REG && REGNO (dest) < FIRST_PSEUDO_REGISTER && ! (GET_CODE (dest) == REG && REGNO (dest) < FIRST_PSEUDO_REGISTER
&& REG_CANNOT_CHANGE_MODE_P (REGNO (dest), && REG_CANNOT_CHANGE_MODE_P (REGNO (dest),
...@@ -5277,6 +5274,7 @@ simplify_set (x) ...@@ -5277,6 +5274,7 @@ simplify_set (x)
src = SET_SRC (x), dest = SET_DEST (x); src = SET_SRC (x), dest = SET_DEST (x);
} }
#endif
#ifdef HAVE_cc0 #ifdef HAVE_cc0
/* If we have (set (cc0) (subreg ...)), we try to remove the subreg /* If we have (set (cc0) (subreg ...)), we try to remove the subreg
......
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