* generate signed comparisons for immediate equality comparisons if

possible, because those can be optimized better by the peephole
    optimizer

git-svn-id: trunk@2235 -
This commit is contained in:
Jonas Maebe 2006-01-08 19:54:58 +00:00
parent 9ee594aedd
commit 1273e0d7ed

View File

@ -848,12 +848,13 @@ const
signed: boolean; signed: boolean;
begin begin
signed := cmp_op in [OC_GT,OC_LT,OC_GTE,OC_LTE]; signed := cmp_op in [OC_GT,OC_LT,OC_GTE,OC_LTE,OC_EQ,OC_NE];
{ in the following case, we generate more efficient code when } { in the following case, we generate more efficient code when }
{ signed is true } { signed is false }
if (cmp_op in [OC_EQ,OC_NE]) and if (cmp_op in [OC_EQ,OC_NE]) and
(aword(a) > $ffff) then (aword(a) >= $8000) and
signed := true; (aword(a) <= $ffff) then
signed := false;
if signed then if signed then
if (a >= low(smallint)) and (a <= high(smallint)) Then if (a >= low(smallint)) and (a <= high(smallint)) Then
list.concat(taicpu.op_reg_reg_const(A_CMPWI,NR_CR0,reg,a)) list.concat(taicpu.op_reg_reg_const(A_CMPWI,NR_CR0,reg,a))