Procházet zdrojové kódy

* fixes to get rtl compiled

peter před 22 roky
rodič
revize
c092e24817

+ 6 - 3
compiler/powerpc/cgcpu.pas

@@ -543,7 +543,7 @@ const
 {$q-}
 {$define overflowon}
 {$endif}
-            a_op_const_reg_reg(list,OP_ADD,size,aword(-a),src,dst);
+            a_op_const_reg_reg(list,OP_ADD,size,aword(-longint(a)),src,dst);
 {$ifdef overflowon}
 {$q+}
 {$undef overflowon}
@@ -1639,7 +1639,7 @@ const
            end
          else if ref2.offset <> 0 Then
            if ref2.base.number <> NR_NO then
-             a_op_const_reg_reg(list,OP_ADD,OS_32,ref2.offset,ref2.base,r)
+             a_op_const_reg_reg(list,OP_ADD,OS_32,aword(ref2.offset),ref2.base,r)
            { FixRef makes sure that "(ref.index <> R_NO) and (ref.offset <> 0)" never}
            { occurs, so now only ref.offset has to be loaded                         }
            else
@@ -2337,7 +2337,10 @@ begin
 end.
 {
   $Log$
-  Revision 1.79  2003-04-23 12:35:35  florian
+  Revision 1.80  2003-04-23 22:18:01  peter
+    * fixes to get rtl compiled
+
+  Revision 1.79  2003/04/23 12:35:35  florian
     * fixed several issues with powerpc
     + applied a patch from Jonas for nested function calls (PowerPC only)
     * ...

+ 11 - 8
compiler/powerpc/nppcadd.pas

@@ -68,7 +68,7 @@ interface
     function tppcaddnode.pass_1: tnode;
       begin
         if (nodetype in [equaln,unequaln]) and
-           is_64bitint(left.resulttype.def) then
+           is_64bit(left.resulttype.def) then
           begin
             result := nil;
             firstpass(left);
@@ -127,7 +127,7 @@ interface
               if not cmpop then
                 begin
                   location.register := n.location.register;
-                  if is_64bitint(n.resulttype.def) then
+                  if is_64bit(n.resulttype.def) then
                     location.registerhigh := n.location.registerhigh;
                 end;
             LOC_REFERENCE,LOC_CREFERENCE:
@@ -136,7 +136,7 @@ interface
                 if not cmpop then
                   begin
                     location.register := n.location.register;
-                    if is_64bitint(n.resulttype.def) then
+                    if is_64bit(n.resulttype.def) then
                       location.registerhigh := n.location.registerhigh;
                   end;
               end;
@@ -147,7 +147,7 @@ interface
                     location_force_reg(exprasmlist,n.location,def_cgsize(n.resulttype.def),false);
                     if not cmpop then
                       location.register := n.location.register;
-                      if is_64bitint(n.resulttype.def) then
+                      if is_64bit(n.resulttype.def) then
                         location.registerhigh := n.location.registerhigh;
                   end;
               end;
@@ -172,7 +172,7 @@ interface
               rg.ungetregisterint(exprasmlist,right.location.register)
             else
               rg.ungetregister(exprasmlist,right.location.register);
-            if is_64bitint(right.resulttype.def) then
+            if is_64bit(right.resulttype.def) then
               rg.ungetregisterint(exprasmlist,right.location.registerhigh)
           end;
         if (left.location.loc in [LOC_REGISTER,LOC_FPUREGISTER]) and
@@ -185,7 +185,7 @@ interface
               rg.ungetregisterint(exprasmlist,left.location.register)
             else
               rg.ungetregister(exprasmlist,left.location.register);
-            if is_64bitint(left.resulttype.def) then
+            if is_64bit(left.resulttype.def) then
               rg.ungetregisterint(exprasmlist,left.location.registerhigh)
           end;
       end;
@@ -1320,7 +1320,7 @@ interface
                    exit;
                  end
                { 64bit operations }
-               else if is_64bitint(left.resulttype.def) then
+               else if is_64bit(left.resulttype.def) then
                  begin
                    second_add64bit;
                    exit;
@@ -1479,7 +1479,10 @@ begin
 end.
 {
   $Log$
-  Revision 1.25  2003-04-23 12:35:35  florian
+  Revision 1.26  2003-04-23 22:18:01  peter
+    * fixes to get rtl compiled
+
+  Revision 1.25  2003/04/23 12:35:35  florian
     * fixed several issues with powerpc
     + applied a patch from Jonas for nested function calls (PowerPC only)
     * ...

+ 16 - 1
compiler/powerpc/radirect.pas

@@ -215,6 +215,18 @@ interface
                                                if assigned(sym) and (sym.owner.symtabletype in [globalsymtable,staticsymtable]) then
                                                  begin
                                                    case sym.typ of
+                                                     constsym :
+                                                       begin
+                                                         inc(tconstsym(sym).refs);
+                                                         case tconstsym(sym).consttyp of
+                                                           constint,constchar,constbool :
+                                                             hs:=tostr(tconstsym(sym).value.valueord);
+                                                           constpointer :
+                                                             hs:=tostr(tconstsym(sym).value.valueordptr);
+                                                           else
+                                                             Message(asmr_e_wrong_sym_type);
+                                                         end;
+                                                       end;
                                                      varsym :
                                                        begin
                                                          Message2(asmr_h_direct_global_to_mangled,hs,tvarsym(sym).mangledname);
@@ -318,7 +330,10 @@ initialization
 end.
 {
   $Log$
-  Revision 1.8  2003-03-22 18:00:27  jonas
+  Revision 1.9  2003-04-23 22:18:01  peter
+    * fixes to get rtl compiled
+
+  Revision 1.8  2003/03/22 18:00:27  jonas
     * fixes for new regallocator
 
   Revision 1.7  2003/01/08 18:43:58  daniel