Explorar el Código

* thumb2: Make fillchar smaller, faster and more reliable. Some gas versions remove the "mov r0,r0" making the calculated branch break

git-svn-id: trunk@49098 -
Jeppe Johansen hace 4 años
padre
commit
8b779975aa
Se han modificado 1 ficheros con 19 adiciones y 14 borrados
  1. 19 14
      rtl/arm/thumb2.inc

+ 19 - 14
rtl/arm/thumb2.inc

@@ -158,21 +158,26 @@ asm
         subge   r1,r1,#8
         bge     .LFillchar1
 .LFillchar2:
-        movs r1,r1              // anything left?
-        it eq
-        moveq pc,lr
-        rsb     r1,r1,#7
-        mov     r1,r1,lsl #2
-        add     pc,r1
-        mov     r0,r0
-        strb r2,[r3],#1
-        strb r2,[r3],#1
-        strb r2,[r3],#1
-        strb r2,[r3],#1
-        strb r2,[r3],#1
-        strb r2,[r3],#1
-        strb r2,[r3],#1
+        adr r0, .Ljumptable
+        tbb [r0, r1]
+
+        strb r2,[r3,#6]
+        strb r2,[r3,#5]
+        strb r2,[r3,#4]
+        strb r2,[r3,#3]
+        strb r2,[r3,#2]
+        strb r2,[r3,#1]
+        strb r2,[r3,#0]
         mov pc,lr
+.Ljumptable:
+        .byte 7
+        .byte 6
+        .byte 5
+        .byte 4
+        .byte 3
+        .byte 2
+        .byte 1
+        .byte 0
 end;
 {$endif FPC_SYSTEM_HAS_FILLCHAR}