Browse Source

* use a yield mnemonic on power7+

florian 2 weeks ago
parent
commit
7348f674ce
3 changed files with 8 additions and 3 deletions
  1. 2 1
      compiler/powerpc64/cpubase.pas
  2. 2 1
      compiler/powerpc64/itcpugas.pas
  3. 4 1
      compiler/ppcgen/ngppcinl.pas

+ 2 - 1
compiler/powerpc64/cpubase.pas

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

+ 2 - 1
compiler/powerpc64/itcpugas.pas

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

+ 4 - 1
compiler/ppcgen/ngppcinl.pas

@@ -102,7 +102,10 @@ implementation
        begin
          case inlinenumber of
            in_ppc_yield:
-             current_asmdata.CurrAsmList.concat(taicpu.op_reg_reg_reg(A_OR,NR_R27,NR_R27,NR_R27));
+             if current_settings.cputype >= cpu_power7 then
+               current_asmdata.CurrAsmList.concat(taicpu.op_none(A_YIELD))
+             else
+               current_asmdata.CurrAsmList.concat(taicpu.op_reg_reg_reg(A_OR,NR_R27,NR_R27,NR_R27));
            else
              inherited pass_generate_code_cpu;
          end;