Procházet zdrojové kódy

+ make use of SHLX/SHRX on CPUs supporting BMI2

git-svn-id: trunk@26635 -
florian před 11 roky
rodič
revize
7d7bf1d877
1 změnil soubory, kde provedl 13 přidání a 0 odebrání
  1. 13 0
      compiler/x86/cgx86.pas

+ 13 - 0
compiler/x86/cgx86.pas

@@ -1644,6 +1644,19 @@ unit cgx86;
             href.index:=src2;
             list.concat(taicpu.op_ref_reg(A_LEA,TCgSize2OpSize[size],href,dst));
           end
+        else if (op in [OP_SHR,OP_SHL]) and
+          (CPUX86_HAS_BMI2 in cpu_capabilities[current_settings.cputype]) and
+          (size in [OS_32,OS_S32
+{$ifdef x86_64}
+            ,OS_64,OS_S64
+{$endif x86_64}
+          ]) then
+          begin
+            if op=OP_SHL then
+              list.concat(taicpu.op_reg_reg_reg(A_SHLX,TCgSize2OpSize[size],src1,src2,dst))
+            else
+              list.concat(taicpu.op_reg_reg_reg(A_SHRX,TCgSize2OpSize[size],src1,src2,dst));
+          end
         else
           inherited a_op_reg_reg_reg(list,op,size,src1,src2,dst);
       end;