~ubuntu-branches/ubuntu/feisty/fpc/feisty

« back to all changes in this revision

Viewing changes to compiler/ncgcon.pas

  • Committer: Bazaar Package Importer
  • Author(s): Torsten Werner
  • Date: 2007-01-27 20:08:50 UTC
  • mfrom: (1.2.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20070127200850-9mrptaqqjsx9nwa7
Tags: 2.0.4-5
* Fixed Build-Depends.
* Add myself to Uploaders in debian/control.
* Make sure that the sources are really patched before building them.
* Build unit 'libc' on powerpc too.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
{
2
 
    $Id: ncgcon.pas,v 1.49 2005/02/14 17:13:06 peter Exp $
3
2
    Copyright (c) 1998-2002 by Florian Klaempfl
4
3
 
5
4
    Generate assembler for constant nodes which are the same for
86
85
         hp1 : tai;
87
86
         lastlabel : tasmlabel;
88
87
         realait : taitype;
 
88
         value_real_sign, hp1_sign: pbyte;
89
89
{$ifdef ARM}
90
90
         hiloswapped : boolean;
91
91
{$endif ARM}
112
112
                         begin
113
113
                            if is_number_float(value_real) and
114
114
                              (
115
 
                               ((realait=ait_real_32bit) and (tai_real_32bit(hp1).value=value_real) and is_number_float(tai_real_32bit(hp1).value)) or
 
115
                               ((realait=ait_real_32bit) and (tai_real_32bit(hp1).value=value_real) and is_number_float(tai_real_32bit(hp1).value) and (get_real_sign(value_real) = get_real_sign(tai_real_32bit(hp1).value))) or
116
116
                               ((realait=ait_real_64bit) and
117
117
{$ifdef ARM}
118
118
                                 ((tai_real_64bit(hp1).formatoptions=fo_hiloswapped)=hiloswapped) and
119
119
{$endif ARM}
120
 
                                 (tai_real_64bit(hp1).value=value_real) and is_number_float(tai_real_64bit(hp1).value)) or
121
 
                               ((realait=ait_real_80bit) and (tai_real_80bit(hp1).value=value_real) and is_number_float(tai_real_80bit(hp1).value)) or
 
120
                                 (tai_real_64bit(hp1).value=value_real) and is_number_float(tai_real_64bit(hp1).value) and (get_real_sign(value_real) = get_real_sign(tai_real_64bit(hp1).value))) or
 
121
                               ((realait=ait_real_80bit) and (tai_real_80bit(hp1).value=value_real) and is_number_float(tai_real_80bit(hp1).value) and (get_real_sign(value_real) = get_real_sign(tai_real_80bit(hp1).value))) or
122
122
{$ifdef cpufloat128}
123
 
                               ((realait=ait_real_128bit) and (tai_real_128bit(hp1).value=value_real) and is_number_float(tai_real_128bit(hp1).value)) or
 
123
                               ((realait=ait_real_128bit) and (tai_real_128bit(hp1).value=value_real) and is_number_float(tai_real_128bit(hp1).value) and (get_real_sign(value_real) = get_real_sign(tai_real_128bit(hp1).value))) or
124
124
{$endif cpufloat128}
125
 
                               ((realait=ait_comp_64bit) and (tai_comp_64bit(hp1).value=value_real) and is_number_float(tai_comp_64bit(hp1).value))
 
125
                               ((realait=ait_comp_64bit) and (tai_comp_64bit(hp1).value=value_real) and is_number_float(tai_comp_64bit(hp1).value) and (get_real_sign(value_real) = get_real_sign(tai_comp_64bit(hp1).value)))
126
126
                              ) then
127
127
                              begin
128
 
                                 { found! }
129
 
                                 lab_real:=lastlabel;
130
 
                                 break;
 
128
                                { found! }
 
129
                                lab_real:=lastlabel;
 
130
                                break;
131
131
                              end;
132
132
                         end;
133
133
                       lastlabel:=nil;
564
564
                                { we use always UTF-16 coding for constants }
565
565
                                { at least for now                          }
566
566
                                { Consts.concat(Tai_const.Create_8bit(2)); }
567
 
                                Consts.concat(Tai_const.Create_aint(-1));
568
 
                                Consts.concat(Tai_const.Create_aint(len));
569
 
                                Consts.concat(Tai_label.Create(l1));
 
567
                                consts.concat(Tai_const.Create_aint(-1));
 
568
                                consts.concat(Tai_const.Create_aint(len*cwidechartype.def.size));
 
569
                                consts.concat(Tai_label.Create(l1));
570
570
                                for i:=0 to len-1 do
571
571
                                  Consts.concat(Tai_const.Create_16bit(pcompilerwidestring(value_str)^.data[i]));
572
572
                                { terminating zero }
624
624
        if tsetdef(resulttype.def).settype=smallset then
625
625
         begin
626
626
           location_reset(location,LOC_CONSTANT,OS_32);
627
 
           location.value:=PAInt(value_set)^;
 
627
           location.value:=pLongint(value_set)^;
628
628
           exit;
629
629
         end;
630
630
        location_reset(location,LOC_CREFERENCE,OS_NO);
749
749
   cnilnode:=tcgnilnode;
750
750
   cguidconstnode:=tcgguidconstnode;
751
751
end.
752
 
{
753
 
  $Log: ncgcon.pas,v $
754
 
  Revision 1.49  2005/02/14 17:13:06  peter
755
 
    * truncate log
756
 
 
757
 
  Revision 1.48  2005/01/31 19:41:01  peter
758
 
    * another guid range check error
759
 
 
760
 
}
761
 
 
762
 
 
763
 
 
764
 
 
765
 
 
766