Browse Source

* always pass the architecture to the arm assembler
* encode pld/ldrd in arm.inc using .long, so it causes no errors with older architectures settings of the assembler

git-svn-id: trunk@29780 -

florian 10 years ago
parent
commit
9eab90d8c4
2 changed files with 21 additions and 9 deletions
  1. 1 2
      compiler/arm/agarmgas.pas
  2. 20 7
      rtl/arm/arm.inc

+ 1 - 2
compiler/arm/agarmgas.pas

@@ -114,8 +114,7 @@ unit agarmgas;
           result:='-march='+cputype_to_gas_march[current_settings.cputype]+' -mthumb -mthumb-interwork '+result
           result:='-march='+cputype_to_gas_march[current_settings.cputype]+' -mthumb -mthumb-interwork '+result
         else if GenerateThumbCode then
         else if GenerateThumbCode then
           result:='-march='+cputype_to_gas_march[current_settings.cputype]+' -mthumb -mthumb-interwork '+result
           result:='-march='+cputype_to_gas_march[current_settings.cputype]+' -mthumb -mthumb-interwork '+result
-        // EDSP instructions in RTL require armv5te at least to not generate error
-        else if current_settings.cputype >= cpu_armv5te then
+        else
           result:='-march='+cputype_to_gas_march[current_settings.cputype]+' '+result;
           result:='-march='+cputype_to_gas_march[current_settings.cputype]+' '+result;
 
 
         if target_info.abi = abi_eabihf then
         if target_info.abi = abi_eabihf then

+ 20 - 7
rtl/arm/arm.inc

@@ -217,7 +217,10 @@ procedure Move(const source;var dest;count:longint);[public, alias: 'FPC_MOVE'];
 procedure Move_pld(const source;var dest;count:longint);assembler;nostackframe;
 procedure Move_pld(const source;var dest;count:longint);assembler;nostackframe;
 {$endif CPUARM_HAS_EDSP}
 {$endif CPUARM_HAS_EDSP}
 asm
 asm
-  pld [r0]
+  // pld [r0]
+  // encode this using .long so the rtl assembles also with instructions sets not supporting pld
+  .long 0xf5d0f000
+
   // count <=0 ?
   // count <=0 ?
   cmp r2,#0
   cmp r2,#0
 {$ifdef CPUARM_HAS_BX}
 {$ifdef CPUARM_HAS_BX}
@@ -237,11 +240,18 @@ asm
   tsteq r1, #3         //    (dest and 3) <> 0 then
   tsteq r1, #3         //    (dest and 3) <> 0 then
   bne   .Lbyteloop     //   DoForwardByteCopy;
   bne   .Lbyteloop     //   DoForwardByteCopy;
 
 
-  pld   [r0,#32]
+  // pld   [r0,#32]
+  // encode this using .long so the rtl assembles also with instructions sets not supporting pld
+  .long 0xf5d0f020
+
 .Ldwordloop:
 .Ldwordloop:
   ldmia r0!, {r3, ip}
   ldmia r0!, {r3, ip}
+
   // preload
   // preload
-  pld   [r0,#64]
+  // pld   [r0,#64]
+  // encode this using .long so the rtl assembles also with instructions sets not supporting pld
+  .long 0xf5d0f040
+
   sub   r2,r2,#8
   sub   r2,r2,#8
   cmp   r2, #8
   cmp   r2, #8
   stmia r1!, {r3, ip}
   stmia r1!, {r3, ip}
@@ -526,11 +536,11 @@ asm
 {$endif}
 {$endif}
   stmfd   sp!, {r1, lr}
   stmfd   sp!, {r1, lr}
   sub     r0, r1, #8
   sub     r0, r1, #8
-{$ifdef CPUARM_HAS_BLX}
+{$if defined(CPUARM_HAS_BX) and not(defined(WINCE))}
   blx     InterLockedDecrement
   blx     InterLockedDecrement
-{$else}
+{$else defined(CPUARM_HAS_BX) and not(defined(WINCE))}
   bl      InterLockedDecrement
   bl      InterLockedDecrement
-{$endif}
+{$endif defined(CPUARM_HAS_BX) and not(defined(WINCE))}
   // InterLockedDecrement is a nice guy and sets the z flag for us
   // InterLockedDecrement is a nice guy and sets the z flag for us
   // if the reference count dropped to 0
   // if the reference count dropped to 0
   ldmnefd sp!, {r1, pc}
   ldmnefd sp!, {r1, pc}
@@ -962,7 +972,10 @@ begin
   in_edsp_test:=true;
   in_edsp_test:=true;
   asm
   asm
     bic r0,sp,#7
     bic r0,sp,#7
-    ldrd r0,r1,[r0]
+
+    // ldrd r0,r1,[r0]
+    // encode this using .long so the rtl assembles also with instructions sets not supporting pld
+    .long 0xe1c000d0
   end;
   end;
   in_edsp_test:=false;
   in_edsp_test:=false;
   if cpu_has_edsp then
   if cpu_has_edsp then