~ubuntu-branches/ubuntu/dapper/fpc/dapper

« back to all changes in this revision

Viewing changes to compiler/ncgflw.pas

  • Committer: Bazaar Package Importer
  • Author(s): Carlos Laviola
  • Date: 2005-05-30 11:59:10 UTC
  • mfrom: (1.2.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20050530115910-x5pbzm4qqta4i94h
Tags: 2.0.0-2
debian/fp-compiler.postinst.in: forgot to reapply the patch that
correctly creates the slave link to pc(1).  (Closes: #310907)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
{
2
 
    $Id: ncgflw.pas,v 1.95 2004/03/29 14:43:47 peter Exp $
 
2
    $Id: ncgflw.pas,v 1.104 2005/02/14 17:13:06 peter Exp $
3
3
    Copyright (c) 1998-2002 by Florian Klaempfl
4
4
 
5
5
    Generate assembler for nodes that influence the flow which are
79
79
          procedure pass_2;override;
80
80
       end;
81
81
 
82
 
 
83
 
 
84
82
implementation
85
83
 
86
84
    uses
87
85
      verbose,globals,systems,globtype,
88
86
      symconst,symdef,symsym,aasmbase,aasmtai,aasmcpu,defutil,
89
 
      procinfo,cgbase,pass_2,
 
87
      procinfo,cgbase,pass_2,parabase,
90
88
      cpubase,cpuinfo,
91
89
      nld,ncon,
92
90
      ncgutil,
93
91
      tgobj,paramgr,
94
92
      regvars,
95
93
      cgutils,cgobj
96
 
{$ifndef cpu64bit}
97
 
      ,cg64f32
98
 
{$endif cpu64bit}
99
94
      ;
100
95
 
101
96
{*****************************************************************************
334
329
      var
335
330
         l3,oldclabel,oldblabel : tasmlabel;
336
331
         temptovalue : boolean;
337
 
         hs : byte;
338
332
         temp1 : treference;
339
333
         hop : topcg;
340
334
         hcond : topcmp;
353
347
         objectlibrary.getlabel(l3);
354
348
 
355
349
         { only calculate reference }
356
 
         secondpass(t2);
357
 
         hs := t2.resulttype.def.size;
358
 
         opsize := def_cgsize(t2.resulttype.def);
 
350
         opsize := def_cgsize(left.resulttype.def);
 
351
         count_var_is_signed:=is_signed(left.resulttype.def);
359
352
 
360
353
         { first set the to value
361
354
           because the count var can be in the expression !! }
362
355
         do_loopvar_at_end:=lnf_dont_mind_loopvar_on_exit in loopflags;
363
356
 
364
 
         secondpass(right);
 
357
         secondpass(t1);
365
358
         { calculate pointer value and check if changeable and if so }
366
359
         { load into temporary variable                       }
367
 
         if right.nodetype<>ordconstn then
 
360
         if t1.nodetype<>ordconstn then
368
361
           begin
369
362
              do_loopvar_at_end:=false;
370
 
              tg.GetTemp(exprasmlist,hs,tt_normal,temp1);
 
363
              tg.GetTemp(exprasmlist,t1.resulttype.def.size,tt_normal,temp1);
371
364
              temptovalue:=true;
372
 
              if (right.location.loc=LOC_REGISTER) or
373
 
                 (right.location.loc=LOC_CREGISTER) then
374
 
                begin
375
 
                   cg.a_load_reg_ref(exprasmlist,opsize,opsize,right.location.register,temp1);
376
 
                   cg.ungetregister(exprasmlist,right.location.register);
377
 
                 end
378
 
              else
379
 
                cg.g_concatcopy(exprasmlist,right.location.reference,temp1,
380
 
                  hs,true,false);
 
365
              cg.a_load_loc_ref(exprasmlist,opsize,t1.location,temp1);
 
366
              location_freetemp(exprasmlist,t1.location);
381
367
           end
382
368
         else
383
369
           temptovalue:=false;
384
370
 
385
371
         { produce start assignment }
386
372
         secondpass(left);
387
 
         count_var_is_signed:=is_signed(t2.resulttype.def);
 
373
         secondpass(right);
 
374
         case left.location.loc of
 
375
           LOC_REFERENCE,
 
376
           LOC_CREFERENCE :
 
377
             cg.a_load_loc_ref(exprasmlist,left.location.size,right.location,left.location.reference);
 
378
           LOC_REGISTER,
 
379
           LOC_CREGISTER :
 
380
             cg.a_load_loc_reg(exprasmlist,left.location.size,right.location,left.location.register);
 
381
           else
 
382
             internalerror(200501311);
 
383
         end;
388
384
 
389
385
         if lnf_backward in loopflags then
390
386
           if count_var_is_signed then
404
400
         if temptovalue then
405
401
           begin
406
402
             cg.a_cmp_ref_loc_label(exprasmlist,opsize,hcond,
407
 
               temp1,t2.location,aktbreaklabel);
 
403
               temp1,left.location,aktbreaklabel);
408
404
           end
409
405
         else
410
406
           begin
411
407
             if lnf_testatbegin in loopflags then
412
408
               begin
413
409
                 cg.a_cmp_const_loc_label(exprasmlist,opsize,hcond,
414
 
                   aword(tordconstnode(right).value),
415
 
                   t2.location,aktbreaklabel);
 
410
                   tordconstnode(t1).value,
 
411
                   left.location,aktbreaklabel);
416
412
               end;
417
413
           end;
418
414
 
425
421
                hop:=OP_ADD
426
422
              else
427
423
                hop:=OP_SUB;
428
 
              cg.a_op_const_loc(exprasmlist,hop,1,t2.location);
 
424
              cg.a_op_const_loc(exprasmlist,hop,1,left.location);
429
425
            end;
430
426
 
 
427
         { align loop target }
431
428
         if not(cs_littlesize in aktglobalswitches) then
432
 
            { align loop target }
433
429
            exprasmList.concat(Tai_align.Create(aktalignment.loopalign));
434
430
         cg.a_label(exprasmlist,l3);
435
431
 
442
438
                hop:=OP_SUB
443
439
              else
444
440
                hop:=OP_ADD;
445
 
              cg.a_op_const_loc(exprasmlist,hop,1,t2.location);
 
441
              cg.a_op_const_loc(exprasmlist,hop,1,left.location);
446
442
            end;
447
443
 
448
 
         { help register must not be in instruction block }
449
 
         if assigned(t1) then
 
444
         if assigned(t2) then
450
445
           begin
451
 
             secondpass(t1);
 
446
             secondpass(t2);
452
447
{$ifdef OLDREGVARS}
453
448
             load_all_regvars(exprasmlist);
454
449
{$endif OLDREGVARS}
463
458
                hop:=OP_SUB
464
459
              else
465
460
                hop:=OP_ADD;
466
 
              cg.a_op_const_loc(exprasmlist,hop,1,t2.location);
 
461
              cg.a_op_const_loc(exprasmlist,hop,1,left.location);
467
462
            end;
468
463
 
469
464
         cg.a_label(exprasmlist,aktcontinuelabel);
499
494
         if temptovalue then
500
495
           begin
501
496
             cg.a_cmp_ref_loc_label(exprasmlist,opsize,hcond,temp1,
502
 
               t2.location,l3);
 
497
               left.location,l3);
503
498
             tg.ungetiftemp(exprasmlist,temp1);
504
499
           end
505
500
         else
506
501
           begin
507
 
             cmp_const:=Tordconstnode(right).value;
 
502
             cmp_const:=Tordconstnode(t1).value;
508
503
             if do_loopvar_at_end then
509
504
               begin
510
505
                 {Watch out for wrap around 255 -> 0.}
609
604
                     begin
610
605
                       if lnf_backward in loopflags then
611
606
                         begin
612
 
                           if integer(cmp_const)=high(integer) then
 
607
                           if integer(cmp_const)=high(smallint) then
613
608
                             begin
614
609
                               hcond:=OC_NE;
615
 
                               cmp_const:=low(integer);
 
610
                               cmp_const:=low(smallint);
616
611
                             end
617
612
                         end
618
613
                       else
619
614
                         begin
620
 
                           if integer(cmp_const)=low(integer) then
 
615
                           if integer(cmp_const)=low(smallint) then
621
616
                             begin
622
617
                               hcond:=OC_NE;
623
 
                               cmp_const:=high(integer);
 
618
                               cmp_const:=high(smallint);
624
619
                             end
625
620
                         end
626
621
                     end;
668
663
               end;
669
664
 
670
665
             cg.a_cmp_const_loc_label(exprasmlist,opsize,hcond,
671
 
               cmp_const,t2.location,l3);
 
666
               cmp_const,left.location,l3);
672
667
           end;
673
668
 
674
669
         { this is the break label: }
780
775
      var
781
776
         a : tasmlabel;
782
777
         href2: treference;
783
 
         paraloc1,paraloc2,paraloc3 : tparalocation;
 
778
         paraloc1,paraloc2,paraloc3 : tcgpara;
784
779
      begin
785
 
         paraloc1:=paramanager.getintparaloc(pocall_default,1);
786
 
         paraloc2:=paramanager.getintparaloc(pocall_default,2);
787
 
         paraloc3:=paramanager.getintparaloc(pocall_default,3);
 
780
         paraloc1.init;
 
781
         paraloc2.init;
 
782
         paraloc3.init;
 
783
         paramanager.getintparaloc(pocall_default,1,paraloc1);
 
784
         paramanager.getintparaloc(pocall_default,2,paraloc2);
 
785
         paramanager.getintparaloc(pocall_default,3,paraloc3);
788
786
         location_reset(location,LOC_VOID,OS_NO);
789
787
 
790
788
         if assigned(left) then
805
803
                begin
806
804
                  paramanager.allocparaloc(exprasmlist,paraloc3);
807
805
                  if assigned(frametree) then
808
 
                    begin
809
 
                      location_release(exprasmlist,frametree.location);
810
 
                      cg.a_param_loc(exprasmlist,frametree.location,paraloc3)
811
 
                    end
 
806
                    cg.a_param_loc(exprasmlist,frametree.location,paraloc3)
812
807
                  else
813
808
                    cg.a_param_const(exprasmlist,OS_INT,0,paraloc3);
814
809
                  { push address }
815
 
                  location_release(exprasmlist,right.location);
816
810
                  paramanager.allocparaloc(exprasmlist,paraloc2);
817
811
                  cg.a_param_loc(exprasmlist,right.location,paraloc2);
818
812
                end
832
826
                   else
833
827
                     cg.a_param_const(exprasmlist,OS_INT,0,paraloc2);
834
828
                end;
835
 
              location_release(exprasmlist,left.location);
836
829
              paramanager.allocparaloc(exprasmlist,paraloc1);
837
830
              cg.a_param_loc(exprasmlist,left.location,paraloc1);
838
831
              paramanager.freeparaloc(exprasmlist,paraloc1);
839
832
              paramanager.freeparaloc(exprasmlist,paraloc2);
840
833
              paramanager.freeparaloc(exprasmlist,paraloc3);
841
 
              cg.allocexplicitregisters(exprasmlist,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_default));
 
834
              cg.alloccpuregisters(exprasmlist,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_default));
842
835
              cg.a_call_name(exprasmlist,'FPC_RAISEEXCEPTION');
843
 
              cg.deallocexplicitregisters(exprasmlist,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_default));
 
836
              cg.dealloccpuregisters(exprasmlist,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_default));
844
837
           end
845
838
         else
846
839
           begin
847
 
              cg.allocexplicitregisters(exprasmlist,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_default));
 
840
              cg.alloccpuregisters(exprasmlist,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_default));
848
841
              cg.a_call_name(exprasmlist,'FPC_POPADDRSTACK');
849
842
              cg.a_call_name(exprasmlist,'FPC_RERAISE');
850
 
              cg.deallocexplicitregisters(exprasmlist,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_default));
 
843
              cg.dealloccpuregisters(exprasmlist,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_default));
851
844
           end;
 
845
         paraloc1.done;
 
846
         paraloc2.done;
 
847
         paraloc3.done;
852
848
       end;
853
849
 
854
850
 
864
860
    { in the except block                                    }
865
861
    procedure cleanupobjectstack;
866
862
      var
867
 
        paraloc1 : tparalocation;
 
863
        paraloc1 : tcgpara;
868
864
      begin
869
 
         cg.allocexplicitregisters(exprasmlist,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_default));
 
865
         cg.alloccpuregisters(exprasmlist,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_default));
870
866
         cg.a_call_name(exprasmlist,'FPC_POPOBJECTSTACK');
871
 
         cg.deallocexplicitregisters(exprasmlist,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_default));
872
 
         paraloc1:=paramanager.getintparaloc(pocall_default,1);
 
867
         cg.dealloccpuregisters(exprasmlist,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_default));
 
868
         paraloc1.init;
 
869
         paramanager.getintparaloc(pocall_default,1,paraloc1);
873
870
         paramanager.allocparaloc(exprasmlist,paraloc1);
874
871
         cg.a_param_reg(exprasmlist,OS_ADDR,NR_FUNCTION_RESULT_REG,paraloc1);
875
872
         paramanager.freeparaloc(exprasmlist,paraloc1);
876
 
         cg.allocexplicitregisters(exprasmlist,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_default));
 
873
         cg.alloccpuregisters(exprasmlist,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_default));
877
874
         cg.a_call_name(exprasmlist,'FPC_DESTROYEXCEPTION');
878
 
         cg.deallocexplicitregisters(exprasmlist,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_default));
 
875
         cg.dealloccpuregisters(exprasmlist,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_default));
 
876
         paraloc1.done;
879
877
      end;
880
878
 
881
879
 
899
897
         exceptflowcontrol : tflowcontrol;
900
898
         destroytemps,
901
899
         excepttemps : texceptiontemps;
902
 
         paraloc1 : tparalocation;
 
900
         paraloc1 : tcgpara;
903
901
      label
904
902
         errorexit;
905
903
      begin
908
906
         oldflowcontrol:=flowcontrol;
909
907
         flowcontrol:=[];
910
908
         { this can be called recursivly }
 
909
         oldaktbreaklabel:=nil;
 
910
         oldaktcontinuelabel:=nil;
911
911
         oldendexceptlabel:=endexceptlabel;
912
912
 
913
913
         { save the old labels for control flow statements }
935
935
         objectlibrary.getlabel(lastonlabel);
936
936
 
937
937
         get_exception_temps(exprasmlist,excepttemps);
938
 
         new_exception(exprasmlist,excepttemps,1,exceptlabel);
 
938
         new_exception(exprasmlist,excepttemps,exceptlabel);
939
939
 
940
940
         { try block }
941
941
         { set control flow labels for the try block }
979
979
              { FPC_CATCHES must be called with
980
980
                'default handler' flag (=-1)
981
981
              }
982
 
              paraloc1:=paramanager.getintparaloc(pocall_default,1);
 
982
              paraloc1.init;
 
983
              paramanager.getintparaloc(pocall_default,1,paraloc1);
983
984
              paramanager.allocparaloc(exprasmlist,paraloc1);
984
 
              cg.a_param_const(exprasmlist,OS_ADDR,aword(-1),paraloc1);
 
985
              cg.a_param_const(exprasmlist,OS_ADDR,-1,paraloc1);
985
986
              paramanager.freeparaloc(exprasmlist,paraloc1);
986
 
              cg.allocexplicitregisters(exprasmlist,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_default));
 
987
              cg.alloccpuregisters(exprasmlist,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_default));
987
988
              cg.a_call_name(exprasmlist,'FPC_CATCHES');
988
 
              cg.deallocexplicitregisters(exprasmlist,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_default));
 
989
              cg.dealloccpuregisters(exprasmlist,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_default));
 
990
              paraloc1.done;
989
991
 
990
992
              { the destruction of the exception object must be also }
991
993
              { guarded by an exception frame                        }
993
995
              objectlibrary.getlabel(doobjectdestroyandreraise);
994
996
 
995
997
              get_exception_temps(exprasmlist,destroytemps);
996
 
              new_exception(exprasmlist,destroytemps,1,doobjectdestroyandreraise);
 
998
              new_exception(exprasmlist,destroytemps,doobjectdestroyandreraise);
997
999
 
998
1000
              { here we don't have to reset flowcontrol           }
999
1001
              { the default and on flowcontrols are handled equal }
1004
1006
 
1005
1007
              free_exception(exprasmlist,destroytemps,0,doobjectdestroy,false);
1006
1008
 
1007
 
              cg.allocexplicitregisters(exprasmlist,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_default));
 
1009
              cg.alloccpuregisters(exprasmlist,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_default));
1008
1010
              cg.a_call_name(exprasmlist,'FPC_POPSECONDOBJECTSTACK');
1009
 
              cg.deallocexplicitregisters(exprasmlist,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_default));
 
1011
              cg.dealloccpuregisters(exprasmlist,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_default));
1010
1012
 
1011
 
              paraloc1:=paramanager.getintparaloc(pocall_default,1);
 
1013
              paraloc1.init;
 
1014
              paramanager.getintparaloc(pocall_default,1,paraloc1);
1012
1015
              paramanager.allocparaloc(exprasmlist,paraloc1);
1013
1016
              cg.a_param_reg(exprasmlist, OS_ADDR, NR_FUNCTION_RESULT_REG, paraloc1);
1014
1017
              paramanager.freeparaloc(exprasmlist,paraloc1);
1015
 
              cg.allocexplicitregisters(exprasmlist,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_default));
 
1018
              cg.alloccpuregisters(exprasmlist,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_default));
1016
1019
              cg.a_call_name(exprasmlist,'FPC_DESTROYEXCEPTION');
1017
 
              cg.deallocexplicitregisters(exprasmlist,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_default));
 
1020
              cg.dealloccpuregisters(exprasmlist,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_default));
 
1021
              paraloc1.done;
1018
1022
              { we don't need to restore esi here because reraise never }
1019
1023
              { returns                                                 }
1020
1024
              cg.a_call_name(exprasmlist,'FPC_RERAISE');
1036
1040
              cg.a_label(exprasmlist,exitexceptlabel);
1037
1041
              { we must also destroy the address frame which guards }
1038
1042
              { exception object                                    }
1039
 
              cg.allocexplicitregisters(exprasmlist,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_default));
 
1043
              cg.alloccpuregisters(exprasmlist,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_default));
1040
1044
              cg.a_call_name(exprasmlist,'FPC_POPADDRSTACK');
1041
 
              cg.deallocexplicitregisters(exprasmlist,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_default));
 
1045
              cg.dealloccpuregisters(exprasmlist,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_default));
1042
1046
              cg.g_exception_reason_load(exprasmlist,excepttemps.reasonbuf);
1043
1047
              cleanupobjectstack;
1044
1048
              cg.a_jmp_always(exprasmlist,oldaktexitlabel);
1049
1053
              cg.a_label(exprasmlist,breakexceptlabel);
1050
1054
              { we must also destroy the address frame which guards }
1051
1055
              { exception object                                    }
1052
 
              cg.allocexplicitregisters(exprasmlist,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_default));
 
1056
              cg.alloccpuregisters(exprasmlist,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_default));
1053
1057
              cg.a_call_name(exprasmlist,'FPC_POPADDRSTACK');
1054
 
              cg.deallocexplicitregisters(exprasmlist,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_default));
 
1058
              cg.dealloccpuregisters(exprasmlist,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_default));
1055
1059
              cg.g_exception_reason_load(exprasmlist,excepttemps.reasonbuf);
1056
1060
              cleanupobjectstack;
1057
1061
              cg.a_jmp_always(exprasmlist,oldaktbreaklabel);
1062
1066
              cg.a_label(exprasmlist,continueexceptlabel);
1063
1067
              { we must also destroy the address frame which guards }
1064
1068
              { exception object                                    }
1065
 
              cg.allocexplicitregisters(exprasmlist,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_default));
 
1069
              cg.alloccpuregisters(exprasmlist,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_default));
1066
1070
              cg.a_call_name(exprasmlist,'FPC_POPADDRSTACK');
1067
 
              cg.deallocexplicitregisters(exprasmlist,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_default));
 
1071
              cg.dealloccpuregisters(exprasmlist,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_default));
1068
1072
              cg.g_exception_reason_load(exprasmlist,excepttemps.reasonbuf);
1069
1073
              cleanupobjectstack;
1070
1074
              cg.a_jmp_always(exprasmlist,oldaktcontinuelabel);
1074
1078
           begin
1075
1079
              { do some magic for exit in the try block }
1076
1080
              cg.a_label(exprasmlist,exittrylabel);
1077
 
              cg.allocexplicitregisters(exprasmlist,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_default));
 
1081
              cg.alloccpuregisters(exprasmlist,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_default));
1078
1082
              cg.a_call_name(exprasmlist,'FPC_POPADDRSTACK');
1079
 
              cg.deallocexplicitregisters(exprasmlist,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_default));
 
1083
              cg.dealloccpuregisters(exprasmlist,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_default));
1080
1084
              cg.g_exception_reason_load(exprasmlist,excepttemps.reasonbuf);
1081
1085
              cg.a_jmp_always(exprasmlist,oldaktexitlabel);
1082
1086
           end;
1084
1088
         if fc_break in tryflowcontrol then
1085
1089
           begin
1086
1090
              cg.a_label(exprasmlist,breaktrylabel);
1087
 
              cg.allocexplicitregisters(exprasmlist,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_default));
 
1091
              cg.alloccpuregisters(exprasmlist,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_default));
1088
1092
              cg.a_call_name(exprasmlist,'FPC_POPADDRSTACK');
1089
 
              cg.deallocexplicitregisters(exprasmlist,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_default));
 
1093
              cg.dealloccpuregisters(exprasmlist,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_default));
1090
1094
              cg.g_exception_reason_load(exprasmlist,excepttemps.reasonbuf);
1091
1095
              cg.a_jmp_always(exprasmlist,oldaktbreaklabel);
1092
1096
           end;
1094
1098
         if fc_continue in tryflowcontrol then
1095
1099
           begin
1096
1100
              cg.a_label(exprasmlist,continuetrylabel);
1097
 
              cg.allocexplicitregisters(exprasmlist,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_default));
 
1101
              cg.alloccpuregisters(exprasmlist,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_default));
1098
1102
              cg.a_call_name(exprasmlist,'FPC_POPADDRSTACK');
1099
 
              cg.deallocexplicitregisters(exprasmlist,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_default));
 
1103
              cg.dealloccpuregisters(exprasmlist,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_default));
1100
1104
              cg.g_exception_reason_load(exprasmlist,excepttemps.reasonbuf);
1101
1105
              cg.a_jmp_always(exprasmlist,oldaktcontinuelabel);
1102
1106
           end;
1136
1140
         excepttemps : texceptiontemps;
1137
1141
         exceptref,
1138
1142
         href2: treference;
1139
 
         paraloc1 : tparalocation;
 
1143
         paraloc1 : tcgpara;
1140
1144
      begin
 
1145
         paraloc1.init;
1141
1146
         location_reset(location,LOC_VOID,OS_NO);
1142
1147
 
1143
1148
         oldflowcontrol:=flowcontrol;
1146
1151
 
1147
1152
         { send the vmt parameter }
1148
1153
         reference_reset_symbol(href2,objectlibrary.newasmsymbol(excepttype.vmt_mangledname,AB_EXTERNAL,AT_DATA),0);
1149
 
         paraloc1:=paramanager.getintparaloc(pocall_default,1);
 
1154
         paramanager.getintparaloc(pocall_default,1,paraloc1);
1150
1155
         paramanager.allocparaloc(exprasmlist,paraloc1);
1151
1156
         cg.a_paramaddr_ref(exprasmlist,href2,paraloc1);
1152
1157
         paramanager.freeparaloc(exprasmlist,paraloc1);
1153
 
         cg.allocexplicitregisters(exprasmlist,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_default));
 
1158
         cg.alloccpuregisters(exprasmlist,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_default));
1154
1159
         cg.a_call_name(exprasmlist,'FPC_CATCHES');
1155
 
         cg.deallocexplicitregisters(exprasmlist,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_default));
 
1160
         cg.dealloccpuregisters(exprasmlist,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_default));
1156
1161
 
1157
1162
         { is it this catch? No. go to next onlabel }
1158
1163
         cg.a_cmp_const_reg_label(exprasmlist,OS_ADDR,OC_EQ,0,NR_FUNCTION_RESULT_REG,nextonlabel);
1160
1165
         { what a hack ! }
1161
1166
         if assigned(exceptsymtable) then
1162
1167
           begin
1163
 
             tvarsym(exceptsymtable.symindex.first).localloc.loc:=LOC_REFERENCE;
1164
 
             tg.GetLocal(exprasmlist,POINTER_SIZE,voidpointertype.def,
1165
 
                tvarsym(exceptsymtable.symindex.first).localloc.reference);
1166
 
             reference_reset_base(href2,tvarsym(exceptsymtable.symindex.first).localloc.reference.index,
1167
 
                tvarsym(exceptsymtable.symindex.first).localloc.reference.offset);
1168
 
             cg.a_load_reg_ref(exprasmlist,OS_ADDR,OS_ADDR,NR_FUNCTION_RESULT_REG,href2);
 
1168
             tlocalvarsym(exceptsymtable.symindex.first).localloc.loc:=LOC_REFERENCE;
 
1169
             tlocalvarsym(exceptsymtable.symindex.first).localloc.size:=OS_ADDR;
 
1170
             tg.GetLocal(exprasmlist,sizeof(aint),voidpointertype.def,
 
1171
                tlocalvarsym(exceptsymtable.symindex.first).localloc.reference);
 
1172
             cg.a_load_reg_ref(exprasmlist,OS_ADDR,OS_ADDR,NR_FUNCTION_RESULT_REG,tlocalvarsym(exceptsymtable.symindex.first).localloc.reference);
1169
1173
           end
1170
1174
         else
1171
1175
           begin
1172
 
             tg.GetTemp(exprasmlist,POINTER_SIZE,tt_normal,exceptref);
 
1176
             tg.GetTemp(exprasmlist,sizeof(aint),tt_normal,exceptref);
1173
1177
             cg.a_load_reg_ref(exprasmlist,OS_ADDR,OS_ADDR,NR_FUNCTION_RESULT_REG,exceptref);
1174
1178
           end;
1175
1179
 
1176
 
 
1177
 
         { in the case that another exception is risen }
1178
 
         { we've to destroy the old one                }
 
1180
         { in the case that another exception is risen
 
1181
           we've to destroy the old one                }
1179
1182
         objectlibrary.getlabel(doobjectdestroyandreraise);
1180
1183
 
1181
1184
         { call setjmp, and jump to finally label on non-zero result }
1182
1185
         get_exception_temps(exprasmlist,excepttemps);
1183
 
         new_exception(exprasmlist,excepttemps,1,doobjectdestroyandreraise);
 
1186
         new_exception(exprasmlist,excepttemps,doobjectdestroyandreraise);
1184
1187
 
 
1188
         oldaktbreaklabel:=nil;
 
1189
         oldaktcontinuelabel:=nil;
1185
1190
         if assigned(right) then
1186
1191
           begin
1187
1192
              oldaktexitlabel:=current_procinfo.aktexitlabel;
1204
1209
 
1205
1210
         free_exception(exprasmlist,excepttemps,0,doobjectdestroy,false);
1206
1211
 
1207
 
         cg.allocexplicitregisters(exprasmlist,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_default));
 
1212
         cg.alloccpuregisters(exprasmlist,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_default));
1208
1213
         cg.a_call_name(exprasmlist,'FPC_POPSECONDOBJECTSTACK');
1209
 
         cg.deallocexplicitregisters(exprasmlist,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_default));
1210
 
         paraloc1:=paramanager.getintparaloc(pocall_default,1);
 
1214
         cg.dealloccpuregisters(exprasmlist,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_default));
 
1215
         paramanager.getintparaloc(pocall_default,1,paraloc1);
1211
1216
         paramanager.allocparaloc(exprasmlist,paraloc1);
1212
1217
         cg.a_param_reg(exprasmlist, OS_ADDR, NR_FUNCTION_RESULT_REG, paraloc1);
1213
1218
         paramanager.freeparaloc(exprasmlist,paraloc1);
1214
 
         cg.allocexplicitregisters(exprasmlist,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_default));
 
1219
         cg.alloccpuregisters(exprasmlist,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_default));
1215
1220
         cg.a_call_name(exprasmlist,'FPC_DESTROYEXCEPTION');
1216
 
         cg.deallocexplicitregisters(exprasmlist,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_default));
 
1221
         cg.dealloccpuregisters(exprasmlist,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_default));
1217
1222
         { we don't need to restore esi here because reraise never }
1218
1223
         { returns                                                 }
1219
1224
         cg.a_call_name(exprasmlist,'FPC_RERAISE');
1223
1228
         { clear some stuff }
1224
1229
         if assigned(exceptsymtable) then
1225
1230
           begin
1226
 
             tg.UngetLocal(exprasmlist,tvarsym(exceptsymtable.symindex.first).localloc.reference);
1227
 
             tvarsym(exceptsymtable.symindex.first).localloc.loc:=LOC_INVALID;
 
1231
             tg.UngetLocal(exprasmlist,tlocalvarsym(exceptsymtable.symindex.first).localloc.reference);
 
1232
             tlocalvarsym(exceptsymtable.symindex.first).localloc.loc:=LOC_INVALID;
1228
1233
           end
1229
1234
         else
1230
1235
           tg.Ungettemp(exprasmlist,exceptref);
1265
1270
         unget_exception_temps(exprasmlist,excepttemps);
1266
1271
         cg.a_label(exprasmlist,nextonlabel);
1267
1272
         flowcontrol:=oldflowcontrol+flowcontrol;
 
1273
         paraloc1.done;
 
1274
 
1268
1275
         { next on node }
1269
1276
         if assigned(left) then
1270
1277
           secondpass(left);
1326
1333
 
1327
1334
         { call setjmp, and jump to finally label on non-zero result }
1328
1335
         get_exception_temps(exprasmlist,excepttemps);
1329
 
         new_exception(exprasmlist,excepttemps,1,finallylabel);
 
1336
         new_exception(exprasmlist,excepttemps,finallylabel);
1330
1337
 
1331
1338
         { try code }
1332
1339
         if assigned(left) then
1443
1450
end.
1444
1451
{
1445
1452
  $Log: ncgflw.pas,v $
1446
 
  Revision 1.95  2004/03/29 14:43:47  peter
1447
 
    * cleaner temp get/unget for exceptions
1448
 
 
1449
 
  Revision 1.94  2004/03/02 00:36:33  olle
1450
 
    * big transformation of Tai_[const_]Symbol.Create[data]name*
1451
 
 
1452
 
  Revision 1.93  2004/02/27 10:21:05  florian
1453
 
    * top_symbol killed
1454
 
    + refaddr to treference added
1455
 
    + refsymbol to treference added
1456
 
    * top_local stuff moved to an extra record to save memory
1457
 
    + aint introduced
1458
 
    * tppufile.get/putint64/aint implemented
1459
 
 
1460
 
  Revision 1.92  2004/02/12 15:54:03  peter
1461
 
    * make extcycle is working again
1462
 
 
1463
 
  Revision 1.91  2004/02/05 18:28:37  peter
1464
 
    * x86_64 fixes for opsize
1465
 
 
1466
 
  Revision 1.90  2004/01/31 17:45:17  peter
1467
 
    * Change several $ifdef i386 to x86
1468
 
    * Change several OS_32 to OS_INT/OS_ADDR
1469
 
 
1470
 
  Revision 1.89  2004/01/12 22:11:38  peter
1471
 
    * use localalign info for alignment for locals and temps
1472
 
    * sparc fpu flags branching added
1473
 
    * moved powerpc copy_valye_openarray to generic
1474
 
 
1475
 
  Revision 1.88  2004/01/01 17:23:16  florian
1476
 
    * fixed wrong temp. usage in generic exception handling
1477
 
 
1478
 
  Revision 1.87  2003/12/06 01:15:22  florian
1479
 
    * reverted Peter's alloctemp patch; hopefully properly
1480
 
 
1481
 
  Revision 1.86  2003/12/03 23:13:20  peter
1482
 
    * delayed paraloc allocation, a_param_*() gets extra parameter
1483
 
      if it needs to allocate temp or real paralocation
1484
 
    * optimized/simplified int-real loading
1485
 
 
1486
 
  Revision 1.85  2003/10/17 14:38:32  peter
1487
 
    * 64k registers supported
1488
 
    * fixed some memory leaks
1489
 
 
1490
 
  Revision 1.84  2003/10/10 17:48:13  peter
1491
 
    * old trgobj moved to x86/rgcpu and renamed to trgx86fpu
1492
 
    * tregisteralloctor renamed to trgobj
1493
 
    * removed rgobj from a lot of units
1494
 
    * moved location_* and reference_* to cgobj
1495
 
    * first things for mmx register allocation
1496
 
 
1497
 
  Revision 1.83  2003/10/09 21:31:37  daniel
1498
 
    * Register allocator splitted, ans abstract now
1499
 
 
1500
 
  Revision 1.82  2003/10/01 20:34:48  peter
1501
 
    * procinfo unit contains tprocinfo
1502
 
    * cginfo renamed to cgbase
1503
 
    * moved cgmessage to verbose
1504
 
    * fixed ppc and sparc compiles
1505
 
 
1506
 
  Revision 1.81  2003/09/23 17:56:05  peter
1507
 
    * locals and paras are allocated in the code generation
1508
 
    * tvarsym.localloc contains the location of para/local when
1509
 
      generating code for the current procedure
1510
 
 
1511
 
  Revision 1.80  2003/09/10 08:31:47  marco
1512
 
   * Patch from Peter for paraloc
1513
 
 
1514
 
  Revision 1.79  2003/09/07 22:09:35  peter
1515
 
    * preparations for different default calling conventions
1516
 
    * various RA fixes
1517
 
 
1518
 
  Revision 1.78  2003/09/03 15:55:00  peter
1519
 
    * NEWRA branch merged
1520
 
 
1521
 
  Revision 1.77  2003/09/03 11:18:36  florian
1522
 
    * fixed arm concatcopy
1523
 
    + arm support in the common compiler sources added
1524
 
    * moved some generic cg code around
1525
 
    + tfputype added
1526
 
    * ...
1527
 
 
1528
 
  Revision 1.76.2.4  2003/09/02 17:48:28  peter
1529
 
    * first process all parameters for raise before pushing the values
1530
 
 
1531
 
  Revision 1.76.2.3  2003/08/31 21:07:44  daniel
1532
 
    * callparatemp ripped
1533
 
 
1534
 
  Revision 1.76.2.2  2003/08/29 17:28:59  peter
1535
 
    * next batch of updates
1536
 
 
1537
 
  Revision 1.76.2.1  2003/08/27 20:23:55  peter
1538
 
    * remove old ra code
1539
 
 
1540
 
  Revision 1.76  2003/08/24 21:38:43  olle
1541
 
    * made FPC_RAISEEXCEPTION compatible with MacOS
1542
 
 
1543
 
  Revision 1.75  2003/08/10 17:25:23  peter
1544
 
    * fixed some reported bugs
1545
 
 
1546
 
  Revision 1.74  2003/08/09 18:56:54  daniel
1547
 
    * cs_regalloc renamed to cs_regvars to avoid confusion with register
1548
 
      allocator
1549
 
    * Some preventive changes to i386 spillinh code
1550
 
 
1551
 
  Revision 1.73  2003/07/23 11:01:14  jonas
1552
 
    * several rg.allocexplicitregistersint/rg.deallocexplicitregistersint
1553
 
      pairs round calls to helpers
1554
 
 
1555
 
  Revision 1.72  2003/06/13 21:19:30  peter
1556
 
    * current_procdef removed, use current_procinfo.procdef instead
1557
 
 
1558
 
  Revision 1.71  2003/06/09 14:38:52  jonas
1559
 
    * fixed for callparatemp
1560
 
 
1561
 
  Revision 1.70  2003/06/09 12:23:30  peter
1562
 
    * init/final of procedure data splitted from genentrycode
1563
 
    * use asmnode getposition to insert final at the correct position
1564
 
      als for the implicit try...finally
1565
 
 
1566
 
  Revision 1.69  2003/06/07 18:57:04  jonas
1567
 
    + added freeintparaloc
1568
 
    * ppc get/freeintparaloc now check whether the parameter regs are
1569
 
      properly allocated/deallocated (and get an extra list para)
1570
 
    * ppc a_call_* now internalerrors if pi_do_call is not yet set
1571
 
    * fixed lot of missing pi_do_call's
1572
 
 
1573
 
  Revision 1.68  2003/06/03 21:11:09  peter
1574
 
    * cg.a_load_* get a from and to size specifier
1575
 
    * makeregsize only accepts newregister
1576
 
    * i386 uses generic tcgnotnode,tcgunaryminus
1577
 
 
1578
 
  Revision 1.67  2003/06/01 21:38:06  peter
1579
 
    * getregisterfpu size parameter added
1580
 
    * op_const_reg size parameter added
1581
 
    * sparc updates
1582
 
 
1583
 
  Revision 1.66  2003/05/30 23:57:08  peter
1584
 
    * more sparc cleanup
1585
 
    * accumulator removed, splitted in function_return_reg (called) and
1586
 
      function_result_reg (caller)
1587
 
 
1588
 
  Revision 1.65  2003/05/30 18:55:21  jonas
1589
 
    * fixed several regvar related bugs for non-i386. make cycle with -Or now
1590
 
      works for ppc
1591
 
 
1592
 
  Revision 1.64  2003/05/26 21:17:17  peter
1593
 
    * procinlinenode removed
1594
 
    * aktexit2label removed, fast exit removed
1595
 
    + tcallnode.inlined_pass_2 added
1596
 
 
1597
 
  Revision 1.63  2003/05/23 14:27:35  peter
1598
 
    * remove some unit dependencies
1599
 
    * current_procinfo changes to store more info
1600
 
 
1601
 
  Revision 1.62  2003/05/17 13:30:08  jonas
1602
 
    * changed tt_persistant to tt_persistent :)
1603
 
    * tempcreatenode now doesn't accept a boolean anymore for persistent
1604
 
      temps, but a ttemptype, so you can also create ansistring temps etc
1605
 
 
1606
 
  Revision 1.61  2003/05/16 14:33:31  peter
1607
 
    * regvar fixes
1608
 
 
1609
 
  Revision 1.60  2003/05/13 19:14:41  peter
1610
 
    * failn removed
1611
 
    * inherited result code check moven to pexpr
1612
 
 
1613
 
  Revision 1.59  2003/05/11 21:37:03  peter
1614
 
    * moved implicit exception frame from ncgutil to psub
1615
 
    * constructor/destructor helpers moved from cobj/ncgutil to psub
1616
 
 
1617
 
  Revision 1.58  2003/04/30 15:45:35  florian
1618
 
    * merged more x86-64/i386 code
1619
 
 
1620
 
  Revision 1.57  2003/04/29 07:29:14  michael
1621
 
  + Patch from peter to fix wrong pushing of ansistring function results in open array
1622
 
 
1623
 
  Revision 1.56  2003/04/27 11:21:33  peter
1624
 
    * aktprocdef renamed to current_procinfo.procdef
1625
 
    * procinfo renamed to current_procinfo
1626
 
    * procinfo will now be stored in current_module so it can be
1627
 
      cleaned up properly
1628
 
    * gen_main_procsym changed to create_main_proc and release_main_proc
1629
 
      to also generate a tprocinfo structure
1630
 
    * fixed unit implicit initfinal
1631
 
 
1632
 
  Revision 1.55  2003/04/22 23:50:22  peter
1633
 
    * firstpass uses expectloc
1634
 
    * checks if there are differences between the expectloc and
1635
 
      location.loc from secondpass in EXTDEBUG
1636
 
 
1637
 
  Revision 1.54  2003/04/17 07:50:24  daniel
1638
 
    * Some work on interference graph construction
1639
 
 
1640
 
  Revision 1.53  2003/04/06 21:11:23  olle
1641
 
    * changed newasmsymbol to newasmsymboldata for data symbols
1642
 
 
1643
 
  Revision 1.52  2003/03/28 19:16:56  peter
1644
 
    * generic constructor working for i386
1645
 
    * remove fixed self register
1646
 
    * esi added as address register for i386
1647
 
 
1648
 
  Revision 1.51  2003/02/19 22:00:14  daniel
1649
 
    * Code generator converted to new register notation
1650
 
    - Horribily outdated todo.txt removed
1651
 
 
1652
 
  Revision 1.50  2003/02/15 22:17:38  carl
1653
 
   * bugfix of FPU emulation code
1654
 
 
1655
 
  Revision 1.49  2003/01/08 18:43:56  daniel
1656
 
   * Tregister changed into a record
1657
 
 
1658
 
  Revision 1.48  2003/01/03 09:51:58  daniel
1659
 
    * Compiler now cycles with var_notification
1660
 
 
1661
 
  Revision 1.47  2003/01/02 15:29:25  daniel
1662
 
    * Some debugging on for loop optimization
1663
 
 
1664
 
  Revision 1.46  2002/12/31 09:55:58  daniel
1665
 
   + Notification implementation complete
1666
 
   + Add for loop code optimization using notifications
1667
 
     results in 1.5-1.9% speed improvement in nestloop benchmark
1668
 
     Optimization incomplete, compiler does not cycle yet with
1669
 
     notifications enabled.
1670
 
 
1671
 
  Revision 1.45  2002/11/28 11:17:01  florian
1672
 
    * loop node flags from node flags splitted
1673
 
 
1674
 
  Revision 1.44  2002/11/25 17:43:17  peter
1675
 
    * splitted defbase in defutil,symutil,defcmp
1676
 
    * merged isconvertable and is_equal into compare_defs(_ext)
1677
 
    * made operator search faster by walking the list only once
1678
 
 
1679
 
  Revision 1.43  2002/09/30 07:00:45  florian
1680
 
    * fixes to common code to get the alpha compiler compiled applied
1681
 
 
1682
 
  Revision 1.42  2002/09/07 15:25:02  peter
1683
 
    * old logs removed and tabs fixed
1684
 
 
1685
 
  Revision 1.41  2002/09/01 18:47:00  peter
1686
 
    * assignn check in exitnode changed to use a separate boolean as the
1687
 
      assignn can be changed to a calln
1688
 
 
1689
 
  Revision 1.40  2002/09/01 14:41:47  peter
1690
 
    * increase refcount in exit(arg) for arg
1691
 
 
1692
 
  Revision 1.39  2002/08/24 18:41:52  peter
1693
 
    * fixed wrong label in jump of except block (was also in n386flw wrong)
1694
 
    * fixed wrong pushing of raise parameters
1695
 
    * fixed wrong compare in finally
1696
 
 
1697
 
  Revision 1.38  2002/08/23 16:14:48  peter
1698
 
    * tempgen cleanup
1699
 
    * tt_noreuse temp type added that will be used in genentrycode
1700
 
 
1701
 
  Revision 1.37  2002/08/19 19:36:43  peter
1702
 
    * More fixes for cross unit inlining, all tnodes are now implemented
1703
 
    * Moved pocall_internconst to po_internconst because it is not a
1704
 
      calling type at all and it conflicted when inlining of these small
1705
 
      functions was requested
1706
 
 
1707
 
  Revision 1.36  2002/08/15 15:15:55  carl
1708
 
    * jmpbuf size allocation for exceptions is now cpu specific (as it should)
1709
 
    * more generic nodes for maths
1710
 
    * several fixes for better m68k support
1711
 
 
1712
 
  Revision 1.35  2002/08/13 18:01:52  carl
1713
 
    * rename swatoperands to swapoperands
1714
 
    + m68k first compilable version (still needs a lot of testing):
1715
 
        assembler generator, system information , inline
1716
 
        assembler reader.
1717
 
 
1718
 
  Revision 1.34  2002/08/11 14:32:26  peter
1719
 
    * renamed current_library to objectlibrary
1720
 
 
1721
 
  Revision 1.33  2002/08/11 13:24:11  peter
1722
 
    * saving of asmsymbols in ppu supported
1723
 
    * asmsymbollist global is removed and moved into a new class
1724
 
      tasmlibrarydata that will hold the info of a .a file which
1725
 
      corresponds with a single module. Added librarydata to tmodule
1726
 
      to keep the library info stored for the module. In the future the
1727
 
      objectfiles will also be stored to the tasmlibrarydata class
1728
 
    * all getlabel/newasmsymbol and friends are moved to the new class
1729
 
 
1730
 
  Revision 1.32  2002/08/09 19:10:59  carl
1731
 
    * fixed generic exception management
1732
 
 
1733
 
  Revision 1.31  2002/08/04 19:06:41  carl
1734
 
    + added generic exception support (still does not work!)
1735
 
    + more documentation
1736
 
 
1737
 
  Revision 1.30  2002/07/27 19:53:51  jonas
1738
 
    + generic implementation of tcg.g_flags2ref()
1739
 
    * tcg.flags2xxx() now also needs a size parameter
1740
 
 
1741
 
  Revision 1.29  2002/07/25 17:56:29  carl
1742
 
    + FPURESULTREG -> FPU_RESULT_REG
1743
 
 
1744
 
  Revision 1.28  2002/07/21 06:58:49  daniel
1745
 
  * Changed booleans into flags
1746
 
 
1747
 
  Revision 1.27  2002/07/20 12:54:53  daniel
1748
 
  * Optimized the code generated for for nodes. The shootout/nestloop benchmark
1749
 
    now runs 5% faster on my computer.
1750
 
 
1751
 
  Revision 1.26  2002/07/20 11:57:54  florian
1752
 
    * types.pas renamed to defbase.pas because D6 contains a types
1753
 
      unit so this would conflicts if D6 programms are compiled
1754
 
    + Willamette/SSE2 instructions to assembler added
1755
 
 
1756
 
  Revision 1.25  2002/07/20 11:15:51  daniel
1757
 
  * The for node does a check if the first comparision can be skipped. I moved
1758
 
    the check from the second pass to the resulttype pass. The advantage is
1759
 
    that the state tracker can now decide to skip the first comparision too.
1760
 
 
1761
 
  Revision 1.24  2002/07/20 08:14:24  daniel
1762
 
  * Loops should not be aligned when optimizing for size
1763
 
 
1764
 
  Revision 1.23  2002/07/19 11:41:35  daniel
1765
 
  * State tracker work
1766
 
  * The whilen and repeatn are now completely unified into whilerepeatn. This
1767
 
    allows the state tracker to change while nodes automatically into
1768
 
    repeat nodes.
1769
 
  * Resulttypepass improvements to the notn. 'not not a' is optimized away and
1770
 
    'not(a>b)' is optimized into 'a<=b'.
1771
 
  * Resulttypepass improvements to the whilerepeatn. 'while not a' is optimized
1772
 
    by removing the notn and later switchting the true and falselabels. The
1773
 
    same is done with 'repeat until not a'.
1774
 
 
1775
 
  Revision 1.22  2002/07/04 20:43:01  florian
1776
 
    * first x86-64 patches
 
1453
  Revision 1.104  2005/02/14 17:13:06  peter
 
1454
    * truncate log
 
1455
 
 
1456
  Revision 1.103  2005/01/31 16:16:21  peter
 
1457
    * for-node cleanup, checking for uninitialzed from and to values
 
1458
      is now supported
1777
1459
 
1778
1460
}