Commit 24092242 by Richard Kenner

(const_method): Do not synthesize long constants with byte or word

operations with TARGET_5200.

From-SVN: r12181
parent 106bee4b
...@@ -1066,20 +1066,26 @@ const_method (constant) ...@@ -1066,20 +1066,26 @@ const_method (constant)
i = INTVAL (constant); i = INTVAL (constant);
if (USE_MOVQ (i)) if (USE_MOVQ (i))
return MOVQ; return MOVQ;
/* if -256 < N < 256 but N is not in range for a moveq
N^ff will be, so use moveq #N^ff, dreg; not.b dreg. */ /* The Coldfire doesn't have byte or word operations. */
if (USE_MOVQ (i ^ 0xff)) /* FIXME: This may not be useful for the m68060 either */
return NOTB; if (!TARGET_5200)
/* Likewise, try with not.w */ {
if (USE_MOVQ (i ^ 0xffff)) /* if -256 < N < 256 but N is not in range for a moveq
return NOTW; N^ff will be, so use moveq #N^ff, dreg; not.b dreg. */
/* This is the only value where neg.w is useful */ if (USE_MOVQ (i ^ 0xff))
if (i == -65408) return NOTB;
return NEGW; /* Likewise, try with not.w */
/* Try also with swap */ if (USE_MOVQ (i ^ 0xffff))
u = i; return NOTW;
if (USE_MOVQ ((u >> 16) | (u << 16))) /* This is the only value where neg.w is useful */
return SWAP; if (i == -65408)
return NEGW;
/* Try also with swap */
u = i;
if (USE_MOVQ ((u >> 16) | (u << 16)))
return SWAP;
}
/* Otherwise, use move.l */ /* Otherwise, use move.l */
return MOVL; return MOVL;
} }
......
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