Pārlūkot izejas kodu

* fixed generated code for compare instructions

mazen 22 gadi atpakaļ
vecāks
revīzija
5d902c46cb
1 mainītis faili ar 11 papildinājumiem un 6 dzēšanām
  1. 11 6
      compiler/sparc/ncpuadd.pas

+ 11 - 6
compiler/sparc/ncpuadd.pas

@@ -424,7 +424,7 @@ procedure TSparcAddNode.emit_compare(unsigned:boolean);
     if(right.location.loc=LOC_CONSTANT)
     if(right.location.loc=LOC_CONSTANT)
     then
     then
       begin
       begin
-{$ifdef dummy}
+{$ifdef ExtDebug}
         if (right.location.size in [OS_64,OS_S64]) and (hi(right.location.valueqword)<>0) and ((hi(right.location.valueqword)<>$ffffffff) or unsigned)
         if (right.location.size in [OS_64,OS_S64]) and (hi(right.location.valueqword)<>0) and ((hi(right.location.valueqword)<>$ffffffff) or unsigned)
         then
         then
           internalerror(2002080301);
           internalerror(2002080301);
@@ -457,9 +457,7 @@ procedure TSparcAddNode.emit_compare(unsigned:boolean);
         useconst := false;
         useconst := false;
         location.loc := LOC_FLAGS;
         location.loc := LOC_FLAGS;
         location.resflags:=getresflags(False);
         location.resflags:=getresflags(False);
-        if not unsigned
-        then
-          op:=A_CMP;
+        op:=A_CMP;
         if (right.location.loc = LOC_CONSTANT)
         if (right.location.loc = LOC_CONSTANT)
         then
         then
           if useconst
           if useconst
@@ -1131,7 +1129,11 @@ procedures }
         then
         then
           location_force_reg(exprasmlist,right.location,opsize_2_cgsize[opsize],false);
           location_force_reg(exprasmlist,right.location,opsize_2_cgsize[opsize],false);
         left_must_be_reg(OpSize,false);
         left_must_be_reg(OpSize,false);
-        emit_generic_code(op,opsize,unsigned,extra_not,mboverflow);
+        if not cmpOp
+        then
+          emit_generic_code(op,opsize,unsigned,extra_not,mboverflow)
+        else
+          emit_compare(unsigned);
         location_freetemp(exprasmlist,right.location);
         location_freetemp(exprasmlist,right.location);
         location_release(exprasmlist,right.location);
         location_release(exprasmlist,right.location);
         if cmpop and(left.location.loc<>LOC_CREGISTER)
         if cmpop and(left.location.loc<>LOC_CREGISTER)
@@ -1179,7 +1181,10 @@ begin
 end.
 end.
 {
 {
     $Log$
     $Log$
-    Revision 1.12  2003-05-06 21:37:58  mazen
+    Revision 1.13  2003-05-07 15:05:37  mazen
+    * fixed generated code for compare instructions
+
+    Revision 1.12  2003/05/06 21:37:58  mazen
     * adding emit_compare trying fixing compare bugs
     * adding emit_compare trying fixing compare bugs
 
 
     Revision 1.11  2003/03/10 21:59:54  mazen
     Revision 1.11  2003/03/10 21:59:54  mazen