瀏覽代碼

* fixed rtl to work with the integrated fpc ppc assembler reader

florian 22 年之前
父節點
當前提交
4ff69f3905
共有 7 個文件被更改,包括 272 次插入207 次删除
  1. 10 1
      rtl/inc/systemh.inc
  2. 6 3
      rtl/linux/powerpc/syscall.inc
  3. 23 20
      rtl/powerpc/math.inc
  4. 185 144
      rtl/powerpc/powerpc.inc
  5. 33 30
      rtl/powerpc/set.inc
  6. 7 4
      rtl/powerpc/strlen.inc
  7. 8 5
      rtl/powerpc/strpas.inc

+ 10 - 1
rtl/inc/systemh.inc

@@ -38,6 +38,12 @@
   {$maxfpuregisters 0}
 {$endif CPUI386}
 
+{ the assembler helpers need this }
+{$ifdef POWERPC}
+  {$goto+}
+{$endif POWERPC}
+
+
 { needed for insert,delete,readln }
 {$P+}
 { stack checking always disabled
@@ -693,7 +699,10 @@ const
 
 {
   $Log$
-  Revision 1.77  2003-11-03 09:42:28  marco
+  Revision 1.78  2003-11-15 19:01:27  florian
+    * fixed rtl to work with the integrated fpc ppc assembler reader
+
+  Revision 1.77  2003/11/03 09:42:28  marco
    * Peter's Cardinal<->Longint fixes patch
 
   Revision 1.76  2003/10/17 20:52:12  olle

+ 6 - 3
rtl/linux/powerpc/syscall.inc

@@ -172,9 +172,9 @@ asm
   lwz  r4, 8(r4)
 { Go ! }
   sc
-  bns  Lsyscall_ok
+  bns  .Lsyscall_ok
   neg  r3,r3
-Lsyscall_ok:
+.Lsyscall_ok:
 { Put back the registers... }
   lwz    r8, regs
   stw    r3, 0(r8)
@@ -236,7 +236,10 @@ end;
 
 {
   $Log$
-  Revision 1.7  2003-06-17 16:39:58  jonas
+  Revision 1.8  2003-11-15 19:01:27  florian
+    * fixed rtl to work with the integrated fpc ppc assembler reader
+
+  Revision 1.7  2003/06/17 16:39:58  jonas
     * fixed old syscall handling for ppc
 
   Revision 1.6  2003/05/23 21:58:30  jonas

+ 23 - 20
rtl/powerpc/math.inc

@@ -80,7 +80,7 @@ const
           end;
       asm
         // store d in temp
-        stfd    f1, temp
+        stfd    f1,temp
         // extract sign bit (record in cr0)
         lwz     r3,temp
         rlwinm. r3,r3,1,31,31
@@ -102,12 +102,12 @@ const
         // store
         stfd     f4,temp
         // and load into r4
-        lwz      r3,4+temp
+        lwz      r3,temp+4
         // convert back to float
         lis      r0,0x4330
         stw      r0,temp
         xoris    r0,r3,0x8000
-        stw      r0,4+temp
+        stw      r0,temp+4
         {$ifndef macos}
         lis    r4,longint_to_real_helper@ha
         lfd    f0,longint_to_real_helper@l(r4)
@@ -143,16 +143,16 @@ const
         // next part same as conversion to signed integer word
         fctiwz f4,f4
         stfd   f4,temp
-        lwz    r4,4+temp
+        lwz    r4,temp+4
         // add 2^31 if value was >=2^31
-        blt    cr1, LTruncNoAdd
+        blt    cr1, .LTruncNoAdd
         xoris  r4,r4,0x8000
-LTruncNoAdd:
+.LTruncNoAdd:
         // negate value if it was negative to start with
-        beq    cr0,LTruncPositive
+        beq    cr0,.LTruncPositive
         subfic r4,r4,0
         subfze r3,r3
-LTruncPositive:
+.LTruncPositive:
       end;
 
 
@@ -198,12 +198,12 @@ LTruncPositive:
         // store
         stfd     f4,temp
         // and load into r4
-        lwz      r3,4+temp
+        lwz      r3,temp+4
         // convert back to float
         lis      r0,0x4330
         stw      r0,temp
         xoris    r0,r3,0x8000
-        stw      r0,4+temp
+        stw      r0,temp+4
         {$ifndef macos}
         lis    r4,longint_to_real_helper@ha
         lfd    f0,longint_to_real_helper@l(r4)
@@ -239,16 +239,16 @@ LTruncPositive:
         // next part same as conversion to signed integer word
         fctiw  f4,f4
         stfd   f4,temp
-        lwz    r4,4+temp
+        lwz    r4,temp+4
         // add 2^31 if value was >=2^31
-        blt    cr1, LRoundNoAdd
+        blt    cr1, .LRoundNoAdd
         xoris  r4,r4,0x8000
-LRoundNoAdd:
+.LRoundNoAdd:
         // negate value if it was negative to start with
-        beq    cr0,LRoundPositive
+        beq    cr0,.LRoundPositive
         subfic r4,r4,0
         subfze r3,r3
-LRoundPositive:
+.LRoundPositive:
       end;
 
 
@@ -357,7 +357,7 @@ asm
            lis    r0,0x4330
            stw    r0,temp
            xoris  r3,r3,0x8000
-           stw    r3,4+temp
+           stw    r3,temp+4
            {$ifndef macos}
            lis    r3,longint_to_real_helper@ha
            lfd    f1,longint_to_real_helper@l(r3)
@@ -366,7 +366,7 @@ asm
            lfd    f1,0(r3)
            {$endif}
            lfd    f0,temp
-           stw    r4,4+temp
+           stw    r4,temp+4
            fsub   f0,f0,f1
            {$ifndef macos}
            lis    r4,cardinal_to_real_helper@ha
@@ -400,7 +400,7 @@ var
 asm
            lis    r0,0x4330
            stw    r0,temp
-           stw    r3,4+temp
+           stw    r3,temp+4
            lfd    f0,temp
            {$ifndef macos}
            lis    r3,cardinal_to_real_helper@ha
@@ -409,7 +409,7 @@ asm
            lwz    r3,longint_to_real_helper[TC](r2)
            lfd    f1,0(r3)
            {$endif}
-           stw    r4,4+temp
+           stw    r4,temp+4
            fsub   f0,f0,f1
            lfd    f3,temp
            {$ifndef macos}
@@ -426,7 +426,10 @@ end;
 
 {
   $Log$
-  Revision 1.29  2003-09-04 16:07:31  florian
+  Revision 1.30  2003-11-15 19:01:27  florian
+    * fixed rtl to work with the integrated fpc ppc assembler reader
+
+  Revision 1.29  2003/09/04 16:07:31  florian
     * fixed qword_to_double conversion on powerpc
 
   Revision 1.28  2003/09/03 14:09:37  florian

+ 185 - 144
rtl/powerpc/powerpc.inc

@@ -27,44 +27,82 @@
   load subroutines
 }
 {$ifndef MACOS}
+label
+  _restfpr_14_x,
+  _restfpr_15_x,
+  _restfpr_16_x,
+  _restfpr_17_x,
+  _restfpr_18_x,
+  _restfpr_19_x,
+  _restfpr_20_x,
+  _restfpr_21_x,
+  _restfpr_22_x,
+  _restfpr_23_x,
+  _restfpr_24_x,
+  _restfpr_25_x,
+  _restfpr_26_x,
+  _restfpr_27_x,
+  _restfpr_28_x,
+  _restfpr_29_x,
+  _restfpr_30_x,
+  _restfpr_31_x,
+  _restfpr_14_l,
+  _restfpr_15_l,
+  _restfpr_16_l,
+  _restfpr_17_l,
+  _restfpr_18_l,
+  _restfpr_19_l,
+  _restfpr_20_l,
+  _restfpr_21_l,
+  _restfpr_22_l,
+  _restfpr_23_l,
+  _restfpr_24_l,
+  _restfpr_25_l,
+  _restfpr_26_l,
+  _restfpr_27_l,
+  _restfpr_28_l,
+  _restfpr_29_l,
+  _restfpr_30_l,
+  _restfpr_31_l;
+
 procedure saverestorereg;assembler;
 asm
 { exit }
-.global _restfpr_14_x
+.globl _restfpr_14_x
 _restfpr_14_x:  lfd     f14, -144(r11)
-.global _restfpr_15_x
+.globl _restfpr_15_x
 _restfpr_15_x:  lfd     f15, -136(r11)
-.global _restfpr_16_x
+.globl _restfpr_16_x
 _restfpr_16_x:  lfd     f16, -128(r11)
-.global _restfpr_17_x
+.globl _restfpr_17_x
 _restfpr_17_x:  lfd     f17, -120(r11)
-.global _restfpr_18_x
+.globl _restfpr_18_x
 _restfpr_18_x:  lfd     f18, -112(r11)
-.global _restfpr_19_x
+.globl _restfpr_19_x
 _restfpr_19_x:  lfd     f19, -104(r11)
-.global _restfpr_20_x
+.globl _restfpr_20_x
 _restfpr_20_x:  lfd     f20, -96(r11)
-.global _restfpr_21_x
+.globl _restfpr_21_x
 _restfpr_21_x:  lfd     f21, -88(r11)
-.global _restfpr_22_x
+.globl _restfpr_22_x
 _restfpr_22_x:  lfd     f22, -80(r11)
-.global _restfpr_23_x
+.globl _restfpr_23_x
 _restfpr_23_x:  lfd     f23, -72(r11)
-.global _restfpr_24_x
+.globl _restfpr_24_x
 _restfpr_24_x:  lfd     f24, -64(r11)
-.global _restfpr_25_x
+.globl _restfpr_25_x
 _restfpr_25_x:  lfd     f25, -56(r11)
-.global _restfpr_26_x
+.globl _restfpr_26_x
 _restfpr_26_x:  lfd     f26, -48(r11)
-.global _restfpr_27_x
+.globl _restfpr_27_x
 _restfpr_27_x:  lfd     f27, -40(r11)
-.global _restfpr_28_x
+.globl _restfpr_28_x
 _restfpr_28_x:  lfd     f28, -32(r11)
-.global _restfpr_29_x
+.globl _restfpr_29_x
 _restfpr_29_x:  lfd     f29, -24(r11)
-.global _restfpr_30_x
+.globl _restfpr_30_x
 _restfpr_30_x:  lfd     f30, -16(r11)
-.global _restfpr_31_x
+.globl _restfpr_31_x
 _restfpr_31_x:  lwz     r0, 4(r11)
                 lfd     f31, -8(r11)
                 mtlr    r0
@@ -72,41 +110,41 @@ _restfpr_31_x:  lwz     r0, 4(r11)
                 blr
 
 { exit with restoring lr }
-.global _restfpr_14_l
+.globl _restfpr_14_l
 _restfpr_14_l:  lfd     f14, -144(r11)
-.global _restfpr_15_l
+.globl _restfpr_15_l
 _restfpr_15_l:  lfd     f15, -136(r11)
-.global _restfpr_16_l
+.globl _restfpr_16_l
 _restfpr_16_l:  lfd     f16, -128(r11)
-.global _restfpr_17_l
+.globl _restfpr_17_l
 _restfpr_17_l:  lfd     f17, -120(r11)
-.global _restfpr_18_l
+.globl _restfpr_18_l
 _restfpr_18_l:  lfd     f18, -112(r11)
-.global _restfpr_19_l
+.globl _restfpr_19_l
 _restfpr_19_l:  lfd     f19, -104(r11)
-.global _restfpr_20_l
+.globl _restfpr_20_l
 _restfpr_20_l:  lfd     f20, -96(r11)
-.global _restfpr_21_l
+.globl _restfpr_21_l
 _restfpr_21_l:  lfd     f21, -88(r11)
-.global _restfpr_22_l
+.globl _restfpr_22_l
 _restfpr_22_l:  lfd     f22, -80(r11)
-.global _restfpr_23_l
+.globl _restfpr_23_l
 _restfpr_23_l:  lfd     f23, -72(r11)
-.global _restfpr_24_l
+.globl _restfpr_24_l
 _restfpr_24_l:  lfd     f24, -64(r11)
-.global _restfpr_25_l
+.globl _restfpr_25_l
 _restfpr_25_l:  lfd     f25, -56(r11)
-.global _restfpr_26_l
+.globl _restfpr_26_l
 _restfpr_26_l:  lfd     f26, -48(r11)
-.global _restfpr_27_l
+.globl _restfpr_27_l
 _restfpr_27_l:  lfd     f27, -40(r11)
-.global _restfpr_28_l
+.globl _restfpr_28_l
 _restfpr_28_l:  lfd     f28, -32(r11)
-.global _restfpr_29_l
+.globl _restfpr_29_l
 _restfpr_29_l:  lfd     f29, -24(r11)
-.global _restfpr_30_l
+.globl _restfpr_30_l
 _restfpr_30_l:  lfd     f30, -16(r11)
-.global _restfpr_31_l
+.globl _restfpr_31_l
 _restfpr_31_l:  lwz     r0, 4(r11)
                 lfd     f31, -8(r11)
                 mtlr    r0
@@ -140,7 +178,7 @@ asm
           cmpwi   cr7,r5,63
 
           {  if count <= 0, stop  }
-          ble     cr0,LMoveDone
+          ble     cr0,.LMoveDone
 
           {  load the begin of the source in the data cache }
           dcbt    0,r3
@@ -160,7 +198,7 @@ asm
           addi    r10,r10,1
 
           {  if count < 15, copy everything byte by byte  }
-          blt     cr1,LMoveBytes
+          blt     cr1,.LMoveBytes
 
           {  if no overlap, then source/dest += -1, otherwise they stay }
           {  After the next instruction, r3/r4 + r10 = next position to }
@@ -169,14 +207,14 @@ asm
           add     r4,r4,r6
 
           {  otherwise, guarantee 4 byte alignment for dest for starters  }
-LMove4ByteAlignLoop:
+.LMove4ByteAlignLoop:
           lbzux   r0,r3,r10
           stbux   r0,r4,r10
           {  is dest now 4 aligned?  }
           andi.   r0,r4,3
           subi    r5,r5,1
           {  while not aligned, continue  }
-          bne     cr0,LMove4ByteAlignLoop
+          bne     cr0,.LMove4ByteAlignLoop
 
 {$ifndef ppc603}
           { check for 32 byte alignment }
@@ -215,17 +253,17 @@ LMove4ByteAlignLoop:
           add     r4,r4,r6
 
 {$ifndef ppc603}
-          beq     cr0,LMove32BytesAligned
-L32BytesAlignMoveLoop:
+          beq     cr0,.LMove32BytesAligned
+.L32BytesAlignMoveLoop:
           {  count >= 39 -> align to 8 byte boundary and then use the FPU  }
           {  since we're already at 4 byte alignment, use dword store      }
           subic.  r7,r7,4
           lwzux   r0,r3,r10
           subi    r5,r5,4
           stwux   r0,r4,r10
-          bne     L32BytesAlignMoveLoop
+          bne     .L32BytesAlignMoveLoop
 
-LMove32BytesAligned:
+.LMove32BytesAligned:
           { count div 32 ( >= 1, since count was >=63 }
           srwi    r0,r5,5
           { remainder }
@@ -268,7 +306,7 @@ LMove32BytesAligned:
           neg     r7,r7
           subi    r7,r7,32
 
-LMove32ByteDcbz:
+.LMove32ByteDcbz:
           lfdux   f0,r3,r10
           lfdux   f1,r3,r10
           lfdux   f2,r3,r10
@@ -280,10 +318,10 @@ LMove32ByteDcbz:
           stfdux  f1,r4,r10
           stfdux  f2,r4,r10
           stfdux  f3,r4,r10
-          bdnz    LMove32ByteDcbz
-LMove32ByteLoopDone:
+          bdnz    .LMove32ByteDcbz
+.LMove32ByteLoopDone:
 {$else not ppc603}
-LMove16ByteLoop:
+.LMove16ByteLoop:
           lwzux   r11,r3,r10
           lwzux   r7,r3,r10
           lwzux   r8,r3,r10
@@ -292,11 +330,11 @@ LMove16ByteLoop:
           stwux   r7,r4,r10
           stwux   r8,r4,r10
           stwux   r9,r4,r10
-          bdnz    LMove16ByteLoop
+          bdnz    .LMove16ByteLoop
 {$endif not ppc603}
 
           { cr0*4+eq is true if "count and 31" = 0 }
-          beq     cr0,LMoveDone
+          beq     cr0,.LMoveDone
 
           {  make r10 again -1 or 1, but first adjust source/dest pointers }
           sub     r3,r3,r6
@@ -310,9 +348,9 @@ LMove16ByteLoop:
 {$endif not ppc603}
 
           { cr1 contains whether count <= 11 }
-          ble     cr1,LMoveBytes
+          ble     cr1,.LMoveBytes
 
-LMoveDWords:
+.LMoveDWords:
           mtctr   r0
           andi.   r5,r5,3
           {  r10 * 4  }
@@ -321,26 +359,26 @@ LMoveDWords:
           add     r3,r3,r6
           add     r4,r4,r6
 
-LMoveDWordsLoop:
+.LMoveDWordsLoop:
           lwzux   r0,r3,r10
           stwux   r0,r4,r10
-          bdnz    LMoveDWordsLoop
+          bdnz    .LMoveDWordsLoop
 
-          beq     cr0,LMoveDone
+          beq     cr0,.LMoveDone
           {  make r10 again -1 or 1  }
           sub     r3,r3,r6
           sub     r4,r4,r6
           srawi   r10,r10,2
           srawi   r6,r6,2
-LMoveBytes:
+.LMoveBytes:
           add     r3,r3,r6
           add     r4,r4,r6
           mtctr   r5
-LMoveBytesLoop:
+.LMoveBytesLoop:
           lbzux   r0,r3,r10
           stbux   r0,r4,r10
-          bdnz    LMoveBytesLoop
-LMoveDone:
+          bdnz    .LMoveBytesLoop
+.LMoveDone:
 end;
 
 
@@ -371,12 +409,12 @@ asm
         { setup for aligning x to multiple of 4}
         rlwinm    r10,r3,0,31-2+1,31
         rlwimi    r5,r5,16,0,15
-        ble       cr6,LFillCharDone
+        ble       cr6,.LFillCharDone
         { get the start of the data in the cache (and mark it as "will be }
         { modified")                                                      }
         dcbtst    0,r3
         subfic    r10,r10,4
-        blt       cr7,LFillCharVerySmall
+        blt       cr7,.LFillCharVerySmall
         { just store 4 bytes instead of using a loop to align (there are }
         { plenty of other instructions now to keep the processor busy    }
         { while it handles the (possibly unaligned) store)               }
@@ -385,7 +423,7 @@ asm
         add       r3,r3,r10
         { decrease count with number of bytes already stored }
         sub       r4,r4,r10
-        blt       cr1,LFillCharSmall
+        blt       cr1,.LFillCharSmall
         { if we have to fill with 0 (which happens a lot), we can simply use }
         { dcbz for the most part, which is very fast, so make a special case }
         { for that                                                           }
@@ -398,16 +436,16 @@ asm
         { get number of bytes to store }
         subfic    r10,r10,32
         { if already 32byte aligned, skip align loop }
-        beq       L32ByteAlignLoopDone
+        beq       .L32ByteAlignLoopDone
         { substract from the total count }
         sub       r4,r4,r10
-L32ByteAlignLoop:
+.L32ByteAlignLoop:
         { we were already aligned to 4 byres, so this will count down to }
         { exactly 0                                                      }
         subic.    r10,r10,4
         stwu      r5,4(r3)
-        bne       L32ByteAlignLoop
-L32ByteAlignLoopDone:
+        bne       .L32ByteAlignLoop
+.L32ByteAlignLoopDone:
         { get the amount of 32 byte blocks }
         srwi      r10,r4,5
         { and keep the rest in r4 (recording whether there is any rest) }
@@ -421,14 +459,14 @@ L32ByteAlignLoopDone:
         bne       cr1, LFillCharNoZero
         { make r3 point again to the actual store position }
         addi      r3,r3,4
-LFillCharDCBZLoop:
+.LFillCharDCBZLoop:
         dcbz      0,r3
         addi      r3,r3,32
-        bdnz      LFillCharDCBZLoop
+        bdnz      .LFillCharDCBZLoop
         { if there was no rest, we're finished }
-        beq       LFillCharDone
-        b         LFillCharVerySmall
-LFillCharNoZero:
+        beq       .LFillCharDone
+        b         .LFillCharVerySmall
+.LFillCharNoZero:
 {$ifdef FPC_ABI_AIX}
         stw       r5,0(r1)
         stw       r5,4(r1)
@@ -443,19 +481,19 @@ LFillCharNoZero:
         subi      r3,r3,4
         { load r10 with 8, so that dcbz uses the correct address }
         li        r10, 8
-LFillChar32ByteLoop:
+.LFillChar32ByteLoop:
         dcbz      r3,r10
         stfdu     f0,8(r3)
         stfdu     f0,8(r3)
         stfdu     f0,8(r3)
         stfdu     f0,8(r3)
-        bdnz      LFillChar32ByteLoop
+        bdnz      .LFillChar32ByteLoop
         { if there was no rest, we're finished }
-        beq       LFillCharDone
+        beq       .LFillCharDone
         { make r3 point again to the actual next byte that must be written }
         addi      r3,r3,8
-        b         LFillCharVerySmall
-LFillCharSmall:
+        b         .LFillCharVerySmall
+.LFillCharSmall:
         { when we arrive here, we're already 4 byte aligned }
         { get count div 4 to store dwords }
         srwi      r10,r4,2
@@ -463,20 +501,20 @@ LFillCharSmall:
         subi      r3,r3,4
         mtctr     r10
         rlwinm.   r4,r4,0,31-2+1,31
-LFillCharSmallLoop:
+.LFillCharSmallLoop:
         stwu      r5,4(r3)
-        bdnz      LFillCharSmallLoop
+        bdnz      .LFillCharSmallLoop
         { if nothing left, stop }
-        beq       LFillCharDone
+        beq       .LFillCharDone
         { get ready to store bytes }
         addi      r3,r3,4
-LFillCharVerySmall:
+.LFillCharVerySmall:
         mtctr     r4
         subi      r3,r3,1
-LFillCharVerySmallLoop:
+.LFillCharVerySmallLoop:
         stbu      r5,1(r3)
-        bdnz      LFillCharVerySmallLoop
-LFillCharDone:
+        bdnz      .LFillCharVerySmallLoop
+.LFillCharDone:
 end;
 
 
@@ -492,11 +530,11 @@ asm
                 cmpwi   cr0,r4,0
                 mtctr   r4
                 subi    r3,r3,4
-                ble    LFillDWordEnd    //if count<=0 Then Exit
-LFillDWordLoop:
+                ble    .LFillDWordEnd    //if count<=0 Then Exit
+.LFillDWordLoop:
                 stwu    r5,4(r3)
-                bdnz    LFillDWordLoop
-LFillDWordEnd:
+                bdnz    .LFillDWordLoop
+.LFillDWordEnd:
 end;
 
 
@@ -513,15 +551,15 @@ asm
                 mr      r0,r3
                 { assume not found }
                 li      r3,-1
-                ble     LIndexByteDone
-LIndexByteLoop:
+                ble     .LIndexByteDone
+.LIndexByteLoop:
                 lbzu    r9,1(r10)
                 cmplw   r9,r5
-                bdnzf   cr0*4+eq,LIndexByteLoop
+                bdnzf   cr0*4+eq,.LIndexByteLoop
                 { r3 still contains -1 here }
-                bne     LIndexByteDone
+                bne     .LIndexByteDone
                 sub     r3,r10,r0
-LIndexByteDone:
+.LIndexByteDone:
 end;
 
 
@@ -538,15 +576,15 @@ asm
                 mr      r0,r3
                 { assume not found }
                 li      r3,-1
-                ble     LIndexWordDone
-LIndexWordLoop:
+                ble     .LIndexWordDone
+.LIndexWordLoop:
                 lhzu    r9,2(r10)
                 cmplw   r9,r5
-                bdnzf   cr0*4+eq,LIndexWordLoop
+                bdnzf   cr0*4+eq,.LIndexWordLoop
                 { r3 still contains -1 here }
-                bne     LIndexWordDone
+                bne     .LIndexWordDone
                 sub     r3,r10,r0
-LIndexWordDone:
+.LIndexWordDone:
 end;
 
 
@@ -563,15 +601,15 @@ asm
                 mr      r0,r3
                 { assume not found }
                 li      r3,-1
-                ble     LIndexDWordDone
-LIndexDWordLoop:
+                ble     .LIndexDWordDone
+.LIndexDWordLoop:
                 lwzu    r9,4(r10)
                 cmplw   r9,r5
-                bdnzf   cr0*4+eq, LIndexDWordLoop
+                bdnzf   cr0*4+eq, .LIndexDWordLoop
                 { r3 still contains -1 here }
-                bne     LIndexDWordDone
+                bne     .LIndexDWordDone
                 sub     r3,r10,r0
-LIndexDWordDone:
+.LIndexDWordDone:
 end;
 
 {$define FPC_SYSTEM_HAS_COMPAREBYTE}
@@ -588,16 +626,16 @@ asm
         subi    r11,r3,1
         subi    r4,r4,1
         li      r3,0
-        ble     LCompByteDone
-LCompByteLoop:
+        ble     .LCompByteDone
+.LCompByteLoop:
         { load next chars }
         lbzu    r9,1(r11)
         lbzu    r10,1(r4)
         { calculate difference }
         sub.    r3,r9,r10
         { if chars not equal or at the end, we're ready }
-        bdnzt   cr0*4+eq, LCompByteLoop
-LCompByteDone:
+        bdnzt   cr0*4+eq, .LCompByteLoop
+.LCompByteDone:
 end;
 
 {$define FPC_SYSTEM_HAS_COMPAREWORD}
@@ -614,16 +652,16 @@ asm
         subi    r11,r3,2
         subi    r4,r4,2
         li      r3,0
-        ble     LCompWordDone
-LCompWordLoop:
+        ble     .LCompWordDone
+.LCompWordLoop:
         { load next chars }
         lhzu    r9,2(r11)
         lhzu    r10,2(r4)
         { calculate difference }
         sub.    r3,r9,r10
         { if chars not equal or at the end, we're ready }
-        bdnzt   cr0*4+eq, LCompWordLoop
-LCompWordDone:
+        bdnzt   cr0*4+eq, .LCompWordLoop
+.LCompWordDone:
 end;
 
 
@@ -641,16 +679,16 @@ asm
         subi    r11,r3,4
         subi    r4,r4,4
         li      r3,0
-        ble     LCompDWordDone
-LCompDWordLoop:
+        ble     .LCompDWordDone
+.LCompDWordLoop:
         { load next chars }
         lwzu    r9,4(r11)
         lwzu    r10,4(r4)
         { calculate difference }
         sub.    r3,r9,r10
         { if chars not equal or at the end, we're ready }
-        bdnzt   cr0*4+eq, LCompDWordLoop
-LCompDWordDone:
+        bdnzt   cr0*4+eq, .LCompDWordLoop
+.LCompDWordDone:
 end;
 
 {$define FPC_SYSTEM_HAS_INDEXCHAR0}
@@ -668,16 +706,16 @@ asm
         { assume not found }
         li      r3,-1
         { if yes, do nothing }
-        ble     LIndexChar0Done
-LIndexChar0Loop:
+        ble     .LIndexChar0Done
+.LIndexChar0Loop:
         lbzu    r10,1(r9)
         cmplwi  cr1,r10,0
         cmplw   r10,r5
-        beq     cr1,LIndexChar0Done
-        bdnzf   cr0*4+eq, LIndexChar0Loop
-        bne     LIndexChar0Done
+        beq     cr1,.LIndexChar0Done
+        bdnzf   cr0*4+eq, .LIndexChar0Loop
+        bne     .LIndexChar0Done
         sub     r3,r9,r0
-LIndexChar0Done:
+.LIndexChar0Done:
 end;
 
 
@@ -705,12 +743,12 @@ asm
         { put length in ctr }
         mtctr   r4
         stb     r4,0(r3)
-        beq     LShortStrCopyDone
-LShortStrCopyLoop:
+        beq     .LShortStrCopyDone
+.LShortStrCopyLoop:
         lbzu    r0,1(r5)
         stbu    r0,1(r3)
-        bdnz    LShortStrCopyLoop
-LShortStrCopyDone:
+        bdnz    .LShortStrCopyLoop
+.LShortStrCopyDone:
 end;
 
 
@@ -738,12 +776,12 @@ asm
         { put length in ctr }
         mtctr   r3
         stb     r3,0(r5)
-        beq     LShortStrCopyDone2
-LShortStrCopyLoop2:
+        beq     .LShortStrCopyDone2
+.LShortStrCopyLoop2:
         lbzu    r0,1(r4)
         stbu    r0,1(r5)
-        bdnz    LShortStrCopyLoop2
-LShortStrCopyDone2:
+        bdnz    .LShortStrCopyLoop2
+.LShortStrCopyDone2:
 end;
 
 
@@ -776,15 +814,15 @@ asm
       stb     r10,0(r3)
       { go to last current character of result }
       add     r3,r6,r3
-      
+
       { if nothing to do, exit }
-      beq     LShortStrAppendDone
+      beq     .LShortStrAppendDone
       { and concatenate }
-LShortStrAppendLoop:
+.LShortStrAppendLoop:
       lbzu    r10,1(r5)
       stbu    r10,1(r3)
-      bdnz    LShortStrAppendLoop
-LShortStrAppendDone:
+      bdnz    .LShortStrAppendLoop
+.LShortStrAppendDone:
 end;
 
 (*
@@ -870,16 +908,16 @@ end;
 function get_caller_addr(framebp:pointer):pointer;assembler;
 asm
    cmplwi  r3,0
-   beq     Lcaller_addr_frame_null
+   beq     .Lcaller_addr_frame_null
    lwz r3,0(r3)
    cmplwi  r3,0
-   beq     Lcaller_addr_frame_null
+   beq     .Lcaller_addr_frame_null
 {$ifdef FPC_ABI_AIX}
    lwz r3,8(r3)
 {$else FPC_ABI_AIX}
    lwz r3,4(r3)
 {$endif FPC_ABI_AIX}
-Lcaller_addr_frame_null:
+.Lcaller_addr_frame_null:
 end;
 
 
@@ -887,9 +925,9 @@ end;
 function get_caller_frame(framebp:pointer):pointer;assembler;
 asm
     cmplwi  r3,0
-    beq     Lcaller_frame_null
+    beq     .Lcaller_frame_null
     lwz  r3,0(r3)
-Lcaller_frame_null:
+.Lcaller_frame_null:
 end;
 
 {$define FPC_SYSTEM_HAS_ABS_LONGINT}
@@ -920,7 +958,7 @@ end;
 
 
 {$define FPC_SYSTEM_HAS_SPTR}
-Function Sptr : Longint;assembler;
+Function Sptr : Pointer;assembler;
 asm
         mr    r3,r1
 end;
@@ -944,11 +982,11 @@ function declocked(var l : longint) : boolean;assembler;
 { input:  address of l in r3                                      }
 { output: boolean indicating whether l is zero after decrementing }
 asm
-LDecLockedLoop:
+.LDecLockedLoop:
     lwarx   r10,0,r3
     subi    r10,r10,1
     stwcx.  r10,0,r3
-    bne-    LDecLockedLoop
+    bne-    .LDecLockedLoop
     cntlzw  r3,r10
     srwi    r3,r3,5
 end;
@@ -956,17 +994,20 @@ end;
 {$define FPC_SYSTEM_HAS_INCLOCKED}
 procedure inclocked(var l : longint);assembler;
 asm
-LIncLockedLoop:
+.LIncLockedLoop:
     lwarx   r10,0,r3
     addi    r10,r10,1
     stwcx.  r10,0,r3
-    bne-    LIncLockedLoop
+    bne-    .LIncLockedLoop
 end;
 
 
 {
   $Log$
-  Revision 1.54  2003-09-14 20:33:28  jonas
+  Revision 1.55  2003-11-15 19:01:27  florian
+    * fixed rtl to work with the integrated fpc ppc assembler reader
+
+  Revision 1.54  2003/09/14 20:33:28  jonas
     * renamed sp to r1, gnu as doesn't understand sp
 
   Revision 1.53  2003/09/06 10:44:41  olle

+ 33 - 30
rtl/powerpc/set.inc

@@ -153,9 +153,9 @@ asm
   stfd     f1,8(r3)
   stfd     f2,16(r3)
   stfd     f3,24(r3)
-  
+
   cmplw  cr0,r5,r6
-  bgt    cr0,Lset_range_exit
+  bgt    cr0,.Lset_range_exit
   rlwinm r4,r5,31-3+1,3,31-2  // divide by 8 to get starting and ending byte-
   { load the set the data cache }
   dcbtst r3,r4
@@ -171,21 +171,21 @@ asm
   slw    r10,r10,r5           // shift bitmask to clear bits below lo
   lwzux  r5,r3,r4             // go to starting pos in set and load value
                               //  (lo is not necessary anymore)
-  beq    Lset_range_hi        // if bit lo and hi in same longint, keep
+  beq    .Lset_range_hi       // if bit lo and hi in same longint, keep
                               //  current mask and adjust for hi bit
   subic. r9,r9,4              // bit hi in next longint?
   or     r5,r5,r10            // merge and
   stw    r5,0(r3)             // store current mask
   li     r10,-1               // new mask
   lwzu   r5,4(r3)             // load next longint of set
-  beq    Lset_range_hi        // bit hi in this longint -> go to adjust for hi
+  beq    .Lset_range_hi       // bit hi in this longint -> go to adjust for hi
   subi   r3,r3,4
-Lset_range_loop:
+.Lset_range_loop:
   subic. r9,r9,4
-  stwu   r10,4(r3)             // fill longints in between with full mask
-  bne    Lset_range_loop
+  stwu   r10,4(r3)            // fill longints in between with full mask
+  bne    .Lset_range_loop
   lwzu   r5,4(r3)             // load next value from set
-Lset_range_hi:                // in all cases, r3 here contains the address of
+.Lset_range_hi:               // in all cases, r3 here contains the address of
                               //  the longint which contains the hi bit and r4
                               //  contains this longint
   srw    r9,r10,r6            // r9 := bitmask shl (31 - (hi mod 32)) =
@@ -195,7 +195,7 @@ Lset_range_hi:                // in all cases, r3 here contains the address of
   and    r10,r9,r10           // combine lo and hi bitmasks for this longint
   or     r5,r5,r10            // and combine with existing set
   stw    r5,0(r3)             // store to set
-Lset_range_exit:
+.Lset_range_exit:
 end;
 
 
@@ -216,7 +216,7 @@ asm
 
        // r4 := 32 - r4 (no problem if r4 > 32, the rlwnm next does a mod 32)
        subfic   r4,r4,32
-       // r3 := (r3 shr (r4 mod 32)) and 1  
+       // r3 := (r3 shr (r4 mod 32)) and 1
        rlwnm    r3,r3,r4,31,31
 end;
 
@@ -236,12 +236,12 @@ asm
        subi     r5,r5,4
        subi     r4,r4,4
        subi     r3,r3,4
-   LMADDSETS1:
+   .LMADDSETS1:
       lwzu      r0,4(r4)
       lwzu      r10,4(r5)
       or        r0,r0,r10
       stwu      r0,4(r3)
-      bdnz      LMADDSETS1
+      bdnz      .LMADDSETS1
 end;
 
 
@@ -259,12 +259,12 @@ asm
        subi     r5,r5,4
        subi     r4,r4,4
        subi     r3,r3,4
-   LMMULSETS1:
+   .LMMULSETS1:
       lwzu      r0,4(r4)
       lwzu      r10,4(r5)
       and       r0,r0,r10
       stwu      r0,4(r3)
-      bdnz      LMMULSETS1
+      bdnz      .LMMULSETS1
 end;
 
 
@@ -282,12 +282,12 @@ asm
        subi     r5,r5,4
        subi     r4,r4,4
        subi     r3,r3,4
-   LMSUBSETS1:
+   .LMSUBSETS1:
       lwzu      r0,4(r4)
       lwzu      r10,4(r5)
       andc      r0,r0,r10
       stwu      r0,4(r3)
-      bdnz      LMSUBSETS1
+      bdnz      .LMSUBSETS1
 end;
 
 
@@ -305,12 +305,12 @@ asm
        subi     r5,r5,4
        subi     r4,r4,4
        subi     r3,r3,4
-   LMSYMDIFSETS1:
+   .LMSYMDIFSETS1:
       lwzu      r0,4(r4)
       lwzu      r10,4(r5)
       xor       r0,r0,r10
       stwu      r0,4(r3)
-      bdnz      LMSYMDIFSETS1
+      bdnz      .LMSYMDIFSETS1
 end;
 
 
@@ -325,11 +325,11 @@ asm
        mtctr    r0
        subi     r3,r3,4
        subi     r4,r4,4
-    LMCOMPSETS1:
+    .LMCOMPSETS1:
        lwzu     r0,4(r3)
        lwzu     r10,4(r4)
        sub.     r0,r0,r10
-       bdnzt    cr0*4+eq,LMCOMPSETS1
+       bdnzt    cr0*4+eq,.LMCOMPSETS1
        cntlzw   r3,r0
        srwi.    r3,r3,5
 end;
@@ -346,12 +346,12 @@ asm
        mtctr    r0
        subi     r3,r3,4
        subi     r4,r4,4
-    LMCONTAINSSETS1:
+    .LMCONTAINSSETS1:
        lwzu     r0,4(r3)
        lwzu     r10,4(r4)
        { set1 and not(set2) = 0? }
        andc.    r0,r0,r10
-       bdnzt    cr0*4+eq,LMCONTAINSSETS1
+       bdnzt    cr0*4+eq,.LMCONTAINSSETS1
        cntlzw   r3,r0
        srwi.    r3,r3,5
 end;
@@ -407,13 +407,13 @@ asm
       movl set2,%ebx
       movl dest,%edi
       movl size,%ecx
-  LMADDSETSIZES1:
+  .LMADDSETSIZES1:
       lodsl
       orl (%ebx),%eax
       stosl
       addl $4,%ebx
       decl %ecx
-      jnz LMADDSETSIZES1
+      jnz .LMADDSETSIZES1
 end;
 
 
@@ -427,13 +427,13 @@ asm
          movl set2,%ebx
          movl dest,%edi
          movl size,%ecx
-     LMMULSETSIZES1:
+     .LMMULSETSIZES1:
          lodsl
          andl (%ebx),%eax
          stosl
          addl $4,%ebx
          decl %ecx
-         jnz LMMULSETSIZES1
+         jnz .LMMULSETSIZES1
 end;
 
 
@@ -443,7 +443,7 @@ asm
          movl set2,%ebx
          movl dest,%edi
          movl size,%ecx
-     LMSUBSETSIZES1:
+     .LMSUBSETSIZES1:
          lodsl
          movl (%ebx),%edx
          notl %edx
@@ -451,7 +451,7 @@ asm
          stosl
          addl $4,%ebx
          decl %ecx
-         jnz LMSUBSETSIZES1
+         jnz .LMSUBSETSIZES1
 end;
 
 
@@ -464,7 +464,7 @@ asm
       movl set2,%ebx
       movl dest,%edi
       movl size,%ecx
-  LMSYMDIFSETSIZE1:
+  .LMSYMDIFSETSIZE1:
       lodsl
       movl (%ebx),%edx
       xorl %edx,%eax
@@ -523,7 +523,10 @@ end;
 
 {
   $Log$
-  Revision 1.22  2003-06-14 12:41:08  jonas
+  Revision 1.23  2003-11-15 19:01:27  florian
+    * fixed rtl to work with the integrated fpc ppc assembler reader
+
+  Revision 1.22  2003/06/14 12:41:08  jonas
     * fixed compilation problems (removed unnecessary modified registers
       lists from procedures)
 

+ 7 - 4
rtl/powerpc/strlen.inc

@@ -24,17 +24,20 @@ asm
         { if yes, do nothing }
         beq     LStrLenDone
         subi    r29,r3,1
-LStrLenLoop:
+.LStrLenLoop:
         lbzu    r30,1(r29)
         cmplwi  cr0,r30,0
-        bne     LStrLenLoop
+        bne     .LStrLenLoop
         sub     r3,r29,r3
-LStrLenDone:
+.LStrLenDone:
 end;
 
 {
   $Log$
-  Revision 1.6  2003-06-14 12:41:09  jonas
+  Revision 1.7  2003-11-15 19:01:27  florian
+    * fixed rtl to work with the integrated fpc ppc assembler reader
+
+  Revision 1.6  2003/06/14 12:41:09  jonas
     * fixed compilation problems (removed unnecessary modified registers
       lists from procedures)
 

+ 8 - 5
rtl/powerpc/strpas.inc

@@ -27,16 +27,16 @@ asm
         mtctr   r10
         { at LStrPasDone, we set the length of the result to 255 - r10 - r4 }
         { = 255 - 255 - 0 if the soure = nil -> perfect :)                  }
-        beq     LStrPasDone
+        beq     .LStrPasDone
         { save address for at the end  and use r5 in loop }
         mr      r5,r3
         { no "subi r5,r5,1" because the first byte = length byte }
         subi    r4,r4,1
-LStrPasLoop:
+.LStrPasLoop:
         lbzu    r10,1(r4)
         cmplwi  cr0,r10,0
         stbu    r10,1(r5)
-        bdnzf   cr0*4+eq, LStrPasLoop
+        bdnzf   cr0*4+eq, .LStrPasLoop
 
         { if we stopped because of a terminating #0, decrease the length by 1 }
         cntlzw  r4,r10
@@ -45,7 +45,7 @@ LStrPasLoop:
         { if r10 was zero (-> stopped because of zero byte), then r4 will be 32 }
         { (32 leading zero bits) -> shr 5 = 1, otherwise this will be zero      }
         srwi    r4,r4,5
-LStrPasDone:
+.LStrPasDone:
         subfic  r10,r10,255
         sub     r10,r10,r4
 
@@ -55,7 +55,10 @@ end;
 
 {
   $Log$
-  Revision 1.10  2003-06-14 12:41:09  jonas
+  Revision 1.11  2003-11-15 19:01:27  florian
+    * fixed rtl to work with the integrated fpc ppc assembler reader
+
+  Revision 1.10  2003/06/14 12:41:09  jonas
     * fixed compilation problems (removed unnecessary modified registers
       lists from procedures)