浏览代码

* fixed shifts

Jonas Maebe 22 年之前
父节点
当前提交
b993c4e2db
共有 2 个文件被更改,包括 15 次插入9 次删除
  1. 7 2
      compiler/powerpc/cgcpu.pas
  2. 8 7
      compiler/powerpc/nppcmat.pas

+ 7 - 2
compiler/powerpc/cgcpu.pas

@@ -680,7 +680,9 @@ const
             begin
               if (a and 31) <> 0 Then
                 list.concat(taicpu.op_reg_reg_const(
-                  TOpCG2AsmOpConstLo[Op],dst,src,a and 31));
+                  TOpCG2AsmOpConstLo[Op],dst,src,a and 31))
+              else
+                a_load_reg_reg(list,size,size,src,dst);
               if (a shr 5) <> 0 then
                 internalError(68991);
             end
@@ -2367,7 +2369,10 @@ begin
 end.
 {
   $Log$
-  Revision 1.87  2003-05-11 11:07:33  jonas
+  Revision 1.88  2003-05-11 11:45:08  jonas
+    * fixed shifts
+
+  Revision 1.87  2003/05/11 11:07:33  jonas
     * fixed optimizations in a_op_const_reg_reg()
 
   Revision 1.86  2003/04/27 11:21:36  peter

+ 8 - 7
compiler/powerpc/nppcmat.pas

@@ -207,16 +207,14 @@ implementation
                    begin
                      if nodetype = shln then
                        begin
-                         if (shiftval and 31) <> 0 then
-                           cg.a_op_const_reg_reg(exprasmlist,OP_SHL,OS_32,
-                             shiftval and 31,hregisterlow,location.registerhigh);
+                         cg.a_op_const_reg_reg(exprasmlist,OP_SHL,OS_32,
+                           shiftval and 31,hregisterlow,location.registerhigh);
                          cg.a_load_const_reg(exprasmlist,OS_32,0,location.registerlow);
                        end
                      else
                        begin
-                         if (shiftval and 31) <> 0 then
-                           cg.a_op_const_reg_reg(exprasmlist,OP_SHR,OS_32,
-                             shiftval and 31,hregisterhigh,location.registerlow);
+                         cg.a_op_const_reg_reg(exprasmlist,OP_SHR,OS_32,
+                           shiftval and 31,hregisterhigh,location.registerlow);
                          cg.a_load_const_reg(exprasmlist,OS_32,0,location.registerhigh);
                        end;
                    end
@@ -512,7 +510,10 @@ begin
 end.
 {
   $Log$
-  Revision 1.25  2003-04-24 12:57:32  florian
+  Revision 1.26  2003-05-11 11:45:08  jonas
+    * fixed shifts
+
+  Revision 1.25  2003/04/24 12:57:32  florian
     * fixed not node
 
   Revision 1.24  2003/03/11 21:46:24  jonas