浏览代码

+ added lwsync instruction to the compiler
* fixed compilation of ReadDependencyBarrier

git-svn-id: trunk@8243 -

Jonas Maebe 18 年之前
父节点
当前提交
98ad33a0c7
共有 4 个文件被更改,包括 10 次插入3 次删除
  1. 3 0
      compiler/options.pas
  2. 2 1
      compiler/powerpc64/cpubase.pas
  3. 2 1
      compiler/powerpc64/itcpugas.pas
  4. 3 1
      rtl/powerpc64/powerpc64.inc

+ 3 - 0
compiler/options.pas

@@ -2046,6 +2046,9 @@ begin
 {$ifdef SUPPORT_UNALIGNED}
 {$ifdef SUPPORT_UNALIGNED}
   def_system_macro('FPC_SUPPORTS_UNALIGNED');
   def_system_macro('FPC_SUPPORTS_UNALIGNED');
 {$endif SUPPORT_UNALIGNED}
 {$endif SUPPORT_UNALIGNED}
+{$ifdef powerpc64}
+  def_system_macro('FPC_HAS_LWSYNC');
+{$endif}
 
 
 {$if defined(x86) or defined(arm)}
 {$if defined(x86) or defined(arm)}
   def_system_macro('INTERNAL_BACKTRACE');
   def_system_macro('INTERNAL_BACKTRACE');

+ 2 - 1
compiler/powerpc64/cpubase.pas

@@ -103,7 +103,8 @@ type
     A_MULLDO, A_MULLDO_, A_MULHDU, A_MULHDU_,
     A_MULLDO, A_MULLDO_, A_MULHDU, A_MULHDU_,
     A_MFXER,
     A_MFXER,
     A_FCTID, A_FCTID_, A_FCTIDZ, A_FCTIDZ_,
     A_FCTID, A_FCTID_, A_FCTIDZ, A_FCTIDZ_,
-    A_EXTRDI, A_EXTRDI_, A_INSRDI, A_INSRDI_);
+    A_EXTRDI, A_EXTRDI_, A_INSRDI, A_INSRDI_,
+    A_LWSYNC);
 
 
   {# This should define the array of instructions as string }
   {# This should define the array of instructions as string }
   op2strtable = array[tasmop] of string[8];
   op2strtable = array[tasmop] of string[8];

+ 2 - 1
compiler/powerpc64/itcpugas.pas

@@ -93,7 +93,8 @@ const
     'mulldo', 'mulldo.', 'mulhdu', 'mulhdu.',
     'mulldo', 'mulldo.', 'mulhdu', 'mulhdu.',
     'mfxer',
     'mfxer',
     'fctid', 'fctid.', 'fctidz', 'fctidz.',
     'fctid', 'fctid.', 'fctidz', 'fctidz.',
-    'extrdi', 'extrdi.', 'insrdi', 'insrdi.');
+    'extrdi', 'extrdi.', 'insrdi', 'insrdi.',
+    'lwsync');
 
 
 function gas_regnum_search(const s: string): Tregister;
 function gas_regnum_search(const s: string): Tregister;
 function gas_regname(r: Tregister): string;
 function gas_regname(r: Tregister): string;

+ 3 - 1
rtl/powerpc64/powerpc64.inc

@@ -842,11 +842,13 @@ end;
 
 
 procedure ReadBarrier;assembler;nostackframe;{$ifdef SYSTEMINLINE}inline;{$endif}
 procedure ReadBarrier;assembler;nostackframe;{$ifdef SYSTEMINLINE}inline;{$endif}
 asm
 asm
+{$ifdef FPC_HAS_LWSYNC}
   lwsync
   lwsync
+{$endif}
 end;
 end;
 
 
 procedure ReadDependencyBarrier;{$ifdef SYSTEMINLINE}inline;{$endif}
 procedure ReadDependencyBarrier;{$ifdef SYSTEMINLINE}inline;{$endif}
-asm
+begin
   { reads imply barrier on earlier reads depended on }
   { reads imply barrier on earlier reads depended on }
 end;
 end;