瀏覽代碼

* introduced bug (x shl 65 = x shl 1 when shifting with a constant, but
still 0 otherwise) to pass tshlshr

Jonas Maebe 20 年之前
父節點
當前提交
4f53d8367d
共有 1 個文件被更改,包括 11 次插入2 次删除
  1. 11 2
      compiler/powerpc/nppcmat.pas

+ 11 - 2
compiler/powerpc/nppcmat.pas

@@ -210,12 +210,17 @@ implementation
              if (right.nodetype = ordconstn) then
              if (right.nodetype = ordconstn) then
                begin
                begin
                  shiftval := tordconstnode(right).value;
                  shiftval := tordconstnode(right).value;
+                 shiftval := shiftval and 63;
+{
+              I think the statements below is much more correct instead of the hack above,
+              but then we fail tshlshr.pp :/ 
+
                  if shiftval > 63 then
                  if shiftval > 63 then
                    begin
                    begin
                      cg.a_load_const_reg(exprasmlist,OS_32,0,location.register64.reglo);
                      cg.a_load_const_reg(exprasmlist,OS_32,0,location.register64.reglo);
                      cg.a_load_const_reg(exprasmlist,OS_32,0,location.register64.reglo);
                      cg.a_load_const_reg(exprasmlist,OS_32,0,location.register64.reglo);
                    end
                    end
-                 else if shiftval > 31 then
+                 else } if shiftval > 31 then
                    begin
                    begin
                      if nodetype = shln then
                      if nodetype = shln then
                        begin
                        begin
@@ -521,7 +526,11 @@ begin
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.42  2004-10-31 21:45:03  peter
+  Revision 1.43  2004-12-06 17:53:43  jonas
+    * introduced bug (x shl 65 = x shl 1 when shifting with a  constant, but
+      still 0 otherwise) to pass tshlshr
+
+  Revision 1.42  2004/10/31 21:45:03  peter
     * generic tlocation
     * generic tlocation
     * move tlocation to cgutils
     * move tlocation to cgutils