Browse Source

* fixed bctr(l) problems

Jonas Maebe 23 years ago
parent
commit
fb5b623e30
3 changed files with 23 additions and 8 deletions
  1. 9 3
      compiler/powerpc/agppcgas.pas
  2. 8 2
      compiler/powerpc/agppcmpw.pas
  3. 6 3
      compiler/powerpc/cgcpu.pas

+ 9 - 3
compiler/powerpc/agppcgas.pas

@@ -329,12 +329,15 @@ unit agppcgas;
           { direct BO/BI in op[0] and op[1] not supported, put them in condition! }
           case op of
              A_B,A_BA,A_BL,A_BLA:
-               s:=#9+op2str[op]+#9
+               s:=#9+op2str[op]+#9;
+             A_BCTR,A_BCTRL,A_BLR,A_BLRL:
+               s:=#9+op2str[op]
              else
                s:=cond2str(op,taicpu(hp).condition)+',';
           end;
 
-          s:=s+getopstr_jmp(taicpu(hp).oper[0]);
+          if (taicpu(hp).oper[0].typ <> top_none) then
+            s:=s+getopstr_jmp(taicpu(hp).oper[0]);
         end
       else
         { process operands }
@@ -363,7 +366,10 @@ begin
 end.
 {
   $Log$
-  Revision 1.18  2002-09-08 13:03:26  jonas
+  Revision 1.19  2002-11-07 15:50:23  jonas
+    * fixed bctr(l) problems
+
+  Revision 1.18  2002/09/08 13:03:26  jonas
     * several large offset-related fixes
 
   Revision 1.17  2002/09/01 21:04:48  florian

+ 8 - 2
compiler/powerpc/agppcmpw.pas

@@ -333,12 +333,15 @@ function getreferencestring(var ref : treference) : string;
           case op of
              A_B,A_BA,A_BLA:
                s:=#9+op2str[op]+#9;
+             A_BCTR,A_BCTRL,A_BLR,A_BLRL:  
+               s:=#9+op2str[op];
              A_BL:
                s:=#9+op2str[op]+#9'.';
              else
                s:=cond2str(op,taicpu(hp).condition)+',';
           end;
-          s:=s+getopstr_jmp(taicpu(hp).oper[0]);
+          if (taicpu(hp).oper[0].typ <> top_none) then
+            s:=s+getopstr_jmp(taicpu(hp).oper[0]);
           if op=A_BL then
             s:=s+'[PR]';
         end
@@ -1025,7 +1028,10 @@ initialization
 end.
 {
   $Log$
-  Revision 1.13  2002-11-04 18:24:53  olle
+  Revision 1.14  2002-11-07 15:50:23  jonas
+    * fixed bctr(l) problems
+
+  Revision 1.13  2002/11/04 18:24:53  olle
     * globals are located in TOC and relative r2, instead of absolute
     * symbols which only differs in case are treated as a single symbol
     + tai_const_symbol supported

+ 6 - 3
compiler/powerpc/cgcpu.pas

@@ -257,7 +257,7 @@ const
     procedure tcgppc.a_call_reg(list : taasmoutput;reg: tregister);
       begin
         list.concat(taicpu.op_reg(A_MTCTR,reg));
-        list.concat(taicpu.op_none(A_BCCTRL));
+        list.concat(taicpu.op_none(A_BCTRL));
         if target_info.system=system_powerpc_macos then
           list.concat(taicpu.op_none(A_NOP));
         procinfo.flags:=procinfo.flags or pi_do_call;
@@ -273,7 +273,7 @@ const
         a_load_ref_reg(list,OS_ADDR,ref,tmpreg);
         list.concat(taicpu.op_reg(A_MTCTR,tmpreg));
         free_scratch_reg(list,tmpreg);
-        list.concat(taicpu.op_none(A_BCCTRL));
+        list.concat(taicpu.op_none(A_BCTRL));
         if target_info.system=system_powerpc_macos then
           list.concat(taicpu.op_none(A_NOP));
         procinfo.flags:=procinfo.flags or pi_do_call;
@@ -1924,7 +1924,10 @@ begin
 end.
 {
   $Log$
-  Revision 1.64  2002-11-04 18:24:19  olle
+  Revision 1.65  2002-11-07 15:50:23  jonas
+    * fixed bctr(l) problems
+
+  Revision 1.64  2002/11/04 18:24:19  olle
     * macos: globals are located in TOC and relative r2, instead of absolute
 
   Revision 1.63  2002/10/28 22:24:28  olle