Bladeren bron

* properly handle constants from -2^32 to -1 on sparc64

git-svn-id: trunk@36546 -
florian 8 jaren geleden
bovenliggende
commit
3ee8e836e9
1 gewijzigde bestanden met toevoegingen van 4 en 4 verwijderingen
  1. 4 4
      compiler/sparc64/cgcpu.pas

+ 4 - 4
compiler/sparc64/cgcpu.pas

@@ -138,7 +138,7 @@ interface
       begin
       begin
         { we don't use the set instruction here because it could be evalutated to two
         { we don't use the set instruction here because it could be evalutated to two
           instructions which would cause problems with the delay slot (FK) }
           instructions which would cause problems with the delay slot (FK) }
-        if (a=0) then
+        if a=0 then
           list.concat(taicpu.op_reg(A_CLR,reg))
           list.concat(taicpu.op_reg(A_CLR,reg))
         else if (a>=simm13lo) and (a<=simm13hi) then
         else if (a>=simm13lo) and (a<=simm13hi) then
           list.concat(taicpu.op_const_reg(A_MOV,a,reg))
           list.concat(taicpu.op_const_reg(A_MOV,a,reg))
@@ -148,11 +148,11 @@ interface
             if (aint(a) and aint($3ff))<>0 then
             if (aint(a) and aint($3ff))<>0 then
               list.concat(taicpu.op_reg_const_reg(A_OR,reg,aint(a) and aint($3ff),reg));
               list.concat(taicpu.op_reg_const_reg(A_OR,reg,aint(a) and aint($3ff),reg));
           end
           end
-        else if (a>=-$80000000) and (a<=-1) then
+        else if (a>=-4294967296) and (a<=-1) then
           begin
           begin
             list.concat(taicpu.op_const_reg(A_SETHI,(not(aint(a)) shr 10) and $3fffff,reg));
             list.concat(taicpu.op_const_reg(A_SETHI,(not(aint(a)) shr 10) and $3fffff,reg));
-            if (aint(a) and aint($3ff))<>0 then
-              list.concat(taicpu.op_reg_const_reg(A_XOR,reg,aint(a) and aint($3ff),reg));
+            if (aint(a) and aint($3ff)) or aint($1c00)<>0 then
+              list.concat(taicpu.op_reg_const_reg(A_XOR,reg,(aint(a) and aint($3ff)) or aint($1c00),reg));
           end
           end
         else
         else
           begin
           begin