浏览代码

* SPARC: simplified and fixed a_load_const_reg method, was generating redundant instructions for constants with non-zero bits 10..12.

git-svn-id: trunk@26318 -
sergei 11 年之前
父节点
当前提交
bf94257310
共有 1 个文件被更改,包括 2 次插入4 次删除
  1. 2 4
      compiler/sparc/cgcpu.pas

+ 2 - 4
compiler/sparc/cgcpu.pas

@@ -415,15 +415,13 @@ implementation
           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))
-        { sethi allows to set the upper 22 bit, so we'll take full advantage of it }
-        else if (aint(a) and aint($1fff))=0 then
-          list.concat(taicpu.op_const_reg(A_SETHI,aint(a) shr 10,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))
         else
         else
           begin
           begin
             list.concat(taicpu.op_const_reg(A_SETHI,aint(a) shr 10,reg));
             list.concat(taicpu.op_const_reg(A_SETHI,aint(a) shr 10,reg));
-            list.concat(taicpu.op_reg_const_reg(A_OR,reg,aint(a) and aint($3ff),reg));
+            if (aint(a) and aint($3ff))<>0 then
+              list.concat(taicpu.op_reg_const_reg(A_OR,reg,aint(a) and aint($3ff),reg));
           end;
           end;
       end;
       end;