Explorar o código

Add .force_thumb pseudo-directive support forarm reader

git-svn-id: trunk@49271 -
pierre %!s(int64=4) %!d(string=hai) anos
pai
achega
f1d30a5bc6
Modificáronse 3 ficheiros con 16 adicións e 1 borrados
  1. 2 1
      compiler/aasmtai.pas
  2. 6 0
      compiler/arm/raarmgas.pas
  3. 8 0
      compiler/assemble.pas

+ 2 - 1
compiler/aasmtai.pas

@@ -402,7 +402,7 @@ interface
         { supported by recent clang-based assemblers for data-in-code  }
         asd_data_region, asd_end_data_region,
         { ARM }
-        asd_thumb_func,asd_code,
+        asd_thumb_func,asd_code,asd_force_thumb,
         { restricts the assembler only to those instructions, which are
           available on the specified CPU; this represents directives such as
           NASM's 'CPU 686' or MASM/TASM's '.686p'. Might not be supported by
@@ -452,6 +452,7 @@ interface
         { ARM }
         'thumb_func',
         'code',
+	'force_thumb',
         'cpu',
         { for the OMF object format }
         'omf_line',

+ 6 - 0
compiler/arm/raarmgas.pas

@@ -151,6 +151,7 @@ Unit raarmgas;
     function tarmattreader.is_targetdirective(const s: string): boolean;
       begin
         case s of
+          '.force_thumb',
           '.thumb_func',
           '.code',
           '.thumb_set':
@@ -1464,6 +1465,11 @@ Unit raarmgas;
             begin
               consume(AS_TARGET_DIRECTIVE);
               curList.concat(tai_directive.create(asd_thumb_func,''));
+            end;
+          '.force_thumb':
+            begin
+              consume(AS_TARGET_DIRECTIVE);
+              curList.concat(tai_directive.create(asd_force_thumb,''));
             end
           else
             inherited HandleTargetDirective;

+ 8 - 0
compiler/assemble.pas

@@ -1719,6 +1719,11 @@ Implementation
 {$ifdef ARM}
                    asd_thumb_func:
                      ObjData.ThumbFunc:=true;
+                   asd_force_thumb:
+                     begin
+                       ObjData.ThumbFunc:=true;
+                       Code16:=true;
+                     end;
                    asd_code:
                      begin
                        { ai_directive(hp).name can be only 16 or 32, this is checked by the reader }
@@ -1924,6 +1929,9 @@ Implementation
                    asd_thumb_func:
                      { ignore for now, but should be added}
                      ;
+                   asd_force_thumb:
+                     { ignore for now, but should be added}
+                     ;
                    asd_code:
                      { ignore for now, but should be added}
                      ;