mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-22 08:09:29 +02:00
* 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:
parent
9ee594aedd
commit
1273e0d7ed
@ -848,12 +848,13 @@ const
|
||||
signed: boolean;
|
||||
|
||||
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 }
|
||||
{ signed is true }
|
||||
{ signed is false }
|
||||
if (cmp_op in [OC_EQ,OC_NE]) and
|
||||
(aword(a) > $ffff) then
|
||||
signed := true;
|
||||
(aword(a) >= $8000) and
|
||||
(aword(a) <= $ffff) then
|
||||
signed := false;
|
||||
if signed then
|
||||
if (a >= low(smallint)) and (a <= high(smallint)) Then
|
||||
list.concat(taicpu.op_reg_reg_const(A_CMPWI,NR_CR0,reg,a))
|
||||
|
Loading…
Reference in New Issue
Block a user