浏览代码

* handling of negative constants in TCGSparc64.a_load_const_reg
* create a cg128 for sparc64

git-svn-id: trunk@36519 -

florian 8 年之前
父节点
当前提交
fd698a22f4
共有 1 个文件被更改,包括 4 次插入5 次删除
  1. 4 5
      compiler/sparc64/cgcpu.pas

+ 4 - 5
compiler/sparc64/cgcpu.pas

@@ -148,14 +148,12 @@ 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>=-$80000000) and (a<=-1) then
           begin
           begin
-            list.concat(taicpu.op_const_reg(A_SETHI,aint(a) shr 10,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
             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;
-}
+              list.concat(taicpu.op_reg_const_reg(A_XOR,reg,aint(a) and aint($3ff),reg));
+          end
         else
         else
           begin
           begin
             hreg:=getintregister(list,OS_64);
             hreg:=getintregister(list,OS_64);
@@ -178,6 +176,7 @@ interface
           TCgSparc64(cg).use_unlimited_pic_mode:=true
           TCgSparc64(cg).use_unlimited_pic_mode:=true
         else
         else
           TCgSparc64(cg).use_unlimited_pic_mode:=false;
           TCgSparc64(cg).use_unlimited_pic_mode:=false;
+        cg128:=tcg128.create;
       end;
       end;
 
 
 end.
 end.