Explorar o código

* some range errors fixed

Jonas Maebe %!s(int64=23) %!d(string=hai) anos
pai
achega
f18626a534
Modificáronse 2 ficheiros con 14 adicións e 7 borrados
  1. 7 4
      compiler/powerpc/nppcadd.pas
  2. 7 3
      compiler/powerpc/nppcset.pas

+ 7 - 4
compiler/powerpc/nppcadd.pas

@@ -793,8 +793,8 @@ interface
            case nodetype of
               ltn,gtn,lten,gten:
                 begin
-                   { the comparisaion of the low dword have to be }
-                   {  always unsigned!                            }
+                   { the comparison of the low dword always has }
+                   { to be always unsigned!                     }
                    cg.a_jmp_flags(exprasmlist,getresflags,truelabel);
                    cg.a_jmp_always(exprasmlist,falselabel);
                 end;
@@ -1420,7 +1420,7 @@ interface
                        begin
                          exprasmlist.concat(taicpu.op_reg_reg_const(A_SUBFIC,
                            location.register,right.location.register,
-                           left.location.value));
+                           longint(left.location.value)));
                        end
                      else
                        begin
@@ -1464,7 +1464,10 @@ begin
 end.
 {
   $Log$
-  Revision 1.18  2002-09-08 14:14:49  jonas
+  Revision 1.19  2002-10-21 18:08:05  jonas
+    * some range errors fixed
+
+  Revision 1.18  2002/09/08 14:14:49  jonas
     * more optimizations for 64bit compares
 
   Revision 1.17  2002/09/07 22:15:48  jonas

+ 7 - 3
compiler/powerpc/nppcset.pas

@@ -44,6 +44,7 @@ implementation
       verbose,globals,
       symconst,symdef,defbase,
       paramgr,
+      cpuinfo,
       pass_2,cgcpu,
       ncon,
       cga,tgobj,ncgutil,regvars,rgobj,aasmcpu;
@@ -76,7 +77,7 @@ implementation
             else
               begin
                 tmpreg := cg.get_scratch_reg_int(exprasmlist);
-                cg.a_load_const_reg(exprasmlist,OS_INT,value,tmpreg);
+                cg.a_load_const_reg(exprasmlist,OS_INT,aword(value),tmpreg);
                 exprasmlist.concat(taicpu.op_reg_reg_reg(A_ADD_,hregister,
                   hregister,tmpreg));
                 cg.free_scratch_reg(exprasmlist,tmpreg);
@@ -90,7 +91,7 @@ implementation
            if first and (t^._low>get_min_value(left.resulttype.def)) then
              begin
                cg.a_cmp_const_reg_label(exprasmlist,OS_INT,jmp_lt,
-                 longint(t^._low),hregister,elselabel);
+                 aword(t^._low),hregister,elselabel);
              end;
            if t^._low=t^._high then
              begin
@@ -155,7 +156,10 @@ begin
 end.
 {
   $Log$
-  Revision 1.3  2002-09-09 13:57:45  jonas
+  Revision 1.4  2002-10-21 18:08:05  jonas
+    * some range errors fixed
+
+  Revision 1.3  2002/09/09 13:57:45  jonas
     * small optimization to case genlist() case statements
 
   Revision 1.2  2002/09/08 20:14:33  jonas