Browse Source

* behavior -Oa optimized

florian 24 years ago
parent
commit
cfd15b7127
4 changed files with 36 additions and 17 deletions
  1. 6 1
      compiler/i386/n386cal.pas
  2. 20 2
      compiler/i386/n386flw.pas
  3. 5 2
      compiler/i386/popt386.pas
  4. 5 12
      compiler/t_go32v2.pas

+ 6 - 1
compiler/i386/n386cal.pas

@@ -390,6 +390,7 @@ implementation
 {$endif GDB}
 {$endif GDB}
              end;
              end;
           end;
           end;
+         {
          if pop_allowed and (cs_align in aktglobalswitches) then
          if pop_allowed and (cs_align in aktglobalswitches) then
            begin
            begin
               pop_esp:=true;
               pop_esp:=true;
@@ -410,6 +411,7 @@ implementation
               emit_reg(A_PUSH,S_L,R_EDI);
               emit_reg(A_PUSH,S_L,R_EDI);
            end
            end
          else
          else
+         }
            pop_esp:=false;
            pop_esp:=false;
          if (resulttype<>pdef(voiddef)) and
          if (resulttype<>pdef(voiddef)) and
             ret_in_param(resulttype) then
             ret_in_param(resulttype) then
@@ -1585,7 +1587,10 @@ begin
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.17  2001-01-08 21:46:46  peter
+  Revision 1.18  2001-01-27 21:29:35  florian
+     * behavior -Oa optimized
+
+  Revision 1.17  2001/01/08 21:46:46  peter
     * don't push high value for open array with cdecl;external;
     * don't push high value for open array with cdecl;external;
 
 
   Revision 1.16  2000/12/25 00:07:32  peter
   Revision 1.16  2000/12/25 00:07:32  peter

+ 20 - 2
compiler/i386/n386flw.pas

@@ -119,6 +119,16 @@ implementation
          if nodetype=whilen then
          if nodetype=whilen then
            emitjmp(C_None,lcont);
            emitjmp(C_None,lcont);
 
 
+
+         { align loop target }
+         if not(cs_littlesize in aktglobalswitches) then
+           begin
+              if (cs_align in aktglobalswitches) then
+                exprasmList.concat(Tai_align.Create_op(16,$90))
+              else
+                exprasmList.concat(Tai_align.Create_op(4,$90))
+           end;
+
          emitlab(lloop);
          emitlab(lloop);
 
 
          aktcontinuelabel:=lcont;
          aktcontinuelabel:=lcont;
@@ -346,7 +356,12 @@ implementation
 
 
          { align loop target }
          { align loop target }
          if not(cs_littlesize in aktglobalswitches) then
          if not(cs_littlesize in aktglobalswitches) then
-           exprasmList.concat(Tai_align.Create_op(4,$90));
+           begin
+              if (cs_align in aktglobalswitches) then
+                exprasmList.concat(Tai_align.Create_op(16,$90))
+              else
+                exprasmList.concat(Tai_align.Create_op(4,$90))
+           end;
 
 
          emitlab(l3);
          emitlab(l3);
 
 
@@ -1381,7 +1396,10 @@ begin
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.7  2001-01-06 23:35:05  jonas
+  Revision 1.8  2001-01-27 21:29:35  florian
+     * behavior -Oa optimized
+
+  Revision 1.7  2001/01/06 23:35:05  jonas
     * fixed webbug 1323
     * fixed webbug 1323
 
 
   Revision 1.6  2001/01/05 17:36:58  florian
   Revision 1.6  2001/01/05 17:36:58  florian

+ 5 - 2
compiler/i386/popt386.pas

@@ -1644,7 +1644,7 @@ Procedure PeepHoleOptPass2(AsmL: TAAsmOutput; BlockStart, BlockEnd: Tai);
          (Taicpu(p).opcode=A_MOV) and
          (Taicpu(p).opcode=A_MOV) and
          (Taicpu(p).opsize in [S_L,S_W]) and
          (Taicpu(p).opsize in [S_L,S_W]) and
          (Taicpu(p).oper[0].typ in [top_reg,top_ref]) and
          (Taicpu(p).oper[0].typ in [top_reg,top_ref]) and
-         (Taicpu(p).oper[1].typ in [top_reg,top_ref]);
+         (Taicpu(p).oper[1].typ in [top_reg]);
     end;
     end;
 {$endif USECMOV}
 {$endif USECMOV}
 
 
@@ -2001,7 +2001,10 @@ End.
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.8  2001-01-10 10:29:36  jonas
+  Revision 1.9  2001-01-27 21:29:35  florian
+     * behavior -Oa optimized
+
+  Revision 1.8  2001/01/10 10:29:36  jonas
     * really fixed problems with -Op2 opts (merged)
     * really fixed problems with -Op2 opts (merged)
 
 
   Revision 1.7  2001/01/07 15:49:49  jonas
   Revision 1.7  2001/01/07 15:49:49  jonas

+ 5 - 12
compiler/t_go32v2.pas

@@ -66,14 +66,10 @@ procedure TLinkerGo32v2.SetDefaultInfo;
 begin
 begin
   with Info do
   with Info do
    begin
    begin
-{$ifdef OPTALIGN}
       if cs_align in aktglobalswitches then
       if cs_align in aktglobalswitches then
         ExeCmd[1]:='ld $SCRIPT $OPT $STRIP -o $EXE'
         ExeCmd[1]:='ld $SCRIPT $OPT $STRIP -o $EXE'
       else
       else
         ExeCmd[1]:='ld -oformat coff-go32-exe $OPT $STRIP -o $EXE @$RES'
         ExeCmd[1]:='ld -oformat coff-go32-exe $OPT $STRIP -o $EXE @$RES'
-{$else OPTALIGN}
-      ExeCmd[1]:='ld -oformat coff-go32-exe $OPT $STRIP -o $EXE @$RES';
-{$endif OPTALIGN}
    end;
    end;
 end;
 end;
 
 
@@ -295,15 +291,11 @@ begin
   if (cs_link_strip in aktglobalswitches) then
   if (cs_link_strip in aktglobalswitches) then
    StripStr:='-s';
    StripStr:='-s';
 
 
-{$ifdef OPTALIGN}
   if cs_align in aktglobalswitches then
   if cs_align in aktglobalswitches then
     WriteScript(false)
     WriteScript(false)
   else
   else
+    { Write used files and libraries }
     WriteResponseFile(false);
     WriteResponseFile(false);
-{$else OPTALIGN}
-{ Write used files and libraries }
-  WriteResponseFile(false);
-{$endif OPTALIGN}
 
 
 { Call linker }
 { Call linker }
   SplitBinCmd(Info.ExeCmd[1],binstr,cmdstr);
   SplitBinCmd(Info.ExeCmd[1],binstr,cmdstr);
@@ -311,9 +303,7 @@ begin
   Replace(cmdstr,'$OPT',Info.ExtraOptions);
   Replace(cmdstr,'$OPT',Info.ExtraOptions);
   Replace(cmdstr,'$RES',outputexedir+Info.ResName);
   Replace(cmdstr,'$RES',outputexedir+Info.ResName);
   Replace(cmdstr,'$STRIP',StripStr);
   Replace(cmdstr,'$STRIP',StripStr);
-{$ifdef OPTALIGN}
   Replace(cmdstr,'$SCRIPT','--script='+outputexedir+Info.ResName);
   Replace(cmdstr,'$SCRIPT','--script='+outputexedir+Info.ResName);
-{$endif OPTALIGN}
   success:=DoExec(FindUtil(BinStr),cmdstr,true,false);
   success:=DoExec(FindUtil(BinStr),cmdstr,true,false);
 
 
 { Remove ReponseFile }
 { Remove ReponseFile }
@@ -429,7 +419,10 @@ end;
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.6  2000-12-25 00:07:30  peter
+  Revision 1.7  2001-01-27 21:29:35  florian
+     * behavior -Oa optimized
+
+  Revision 1.6  2000/12/25 00:07:30  peter
     + new tlinkedlist class (merge of old tstringqueue,tcontainer and
     + new tlinkedlist class (merge of old tstringqueue,tcontainer and
       tlinkedlist objects)
       tlinkedlist objects)