瀏覽代碼

* int64 shl/shr > 63 returns 0

peter 21 年之前
父節點
當前提交
41bf3e473c
共有 1 個文件被更改,包括 12 次插入2 次删除
  1. 12 2
      compiler/i386/n386mat.pas

+ 12 - 2
compiler/i386/n386mat.pas

@@ -230,7 +230,14 @@ implementation
           if (right.nodetype=ordconstn) then
           if (right.nodetype=ordconstn) then
             begin
             begin
               { shrd/shl works only for values <=31 !! }
               { shrd/shl works only for values <=31 !! }
-              if Tordconstnode(right).value>31 then
+              if Tordconstnode(right).value>63 then
+                begin
+                  cg.a_load_const_reg(exprasmlist,OS_32,0,hregisterhigh);
+                  cg.a_load_const_reg(exprasmlist,OS_32,0,hregisterlow);
+                  location.registerlow:=hregisterlow;
+                  location.registerhigh:=hregisterhigh;
+                end
+              else if Tordconstnode(right).value>31 then
                 begin
                 begin
                   if nodetype=shln then
                   if nodetype=shln then
                     begin
                     begin
@@ -572,7 +579,10 @@ begin
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.65  2003-10-10 17:48:14  peter
+  Revision 1.66  2003-12-10 17:28:41  peter
+    * int64 shl/shr > 63 returns 0
+
+  Revision 1.65  2003/10/10 17:48:14  peter
     * old trgobj moved to x86/rgcpu and renamed to trgx86fpu
     * old trgobj moved to x86/rgcpu and renamed to trgx86fpu
     * tregisteralloctor renamed to trgobj
     * tregisteralloctor renamed to trgobj
     * removed rgobj from a lot of units
     * removed rgobj from a lot of units