浏览代码

* simplify some code, by using is_x86_parameterized_string_instruction_op

git-svn-id: trunk@37448 -
nickysn 7 年之前
父节点
当前提交
2f28768d2d
共有 2 个文件被更改,包括 3 次插入21 次删除
  1. 2 14
      compiler/aasmtai.pas
  2. 1 7
      compiler/x86/agx86nsm.pas

+ 2 - 14
compiler/aasmtai.pas

@@ -2617,13 +2617,7 @@ implementation
 {$ifdef x86}
 {$ifdef x86}
             { We allow this exception for x86, since overloading this would be
             { We allow this exception for x86, since overloading this would be
               too much of a a speed penalty}
               too much of a a speed penalty}
-            if (opcode=A_MOVS) or
-               (opcode=A_CMPS) or
-               (opcode=A_SCAS) or
-               (opcode=A_LODS) or
-               (opcode=A_STOS) or
-               (opcode=A_INS) or
-               (opcode=A_OUTS) then
+            if is_x86_parameterized_string_instruction_op(opcode) then
               begin
               begin
                 if ((ref^.base=NR_NO) or (getsupreg(ref^.base)<>RS_EDI)) and
                 if ((ref^.base=NR_NO) or (getsupreg(ref^.base)<>RS_EDI)) and
                    ((ref^.index=NR_NO) or (getsupreg(ref^.index)<>RS_EDI)) and
                    ((ref^.index=NR_NO) or (getsupreg(ref^.index)<>RS_EDI)) and
@@ -2704,13 +2698,7 @@ implementation
                   new(ref);
                   new(ref);
                   ref^:=o.ref^;
                   ref^:=o.ref^;
 {$ifdef x86}
 {$ifdef x86}
-                  if (opcode=A_MOVS) or
-                     (opcode=A_CMPS) or
-                     (opcode=A_SCAS) or
-                     (opcode=A_LODS) or
-                     (opcode=A_STOS) or
-                     (opcode=A_INS) or
-                     (opcode=A_OUTS) then
+                  if is_x86_parameterized_string_instruction_op(opcode) then
                     begin
                     begin
                       if ((ref^.base=NR_NO) or (getsupreg(ref^.base)<>RS_EDI)) and
                       if ((ref^.base=NR_NO) or (getsupreg(ref^.base)<>RS_EDI)) and
                          ((ref^.index=NR_NO) or (getsupreg(ref^.index)<>RS_EDI)) and
                          ((ref^.index=NR_NO) or (getsupreg(ref^.index)<>RS_EDI)) and

+ 1 - 7
compiler/x86/agx86nsm.pas

@@ -986,13 +986,7 @@ interface
                     end;
                     end;
                if fixed_opcode=A_FWAIT then
                if fixed_opcode=A_FWAIT then
                 writer.AsmWriteln(#9#9'DB'#9'09bh')
                 writer.AsmWriteln(#9#9'DB'#9'09bh')
-               else if (fixed_opcode=A_MOVS) or
-                       (fixed_opcode=A_CMPS) or
-                       (fixed_opcode=A_SCAS) or
-                       (fixed_opcode=A_LODS) or
-                       (fixed_opcode=A_STOS) or
-                       (fixed_opcode=A_INS) or
-                       (fixed_opcode=A_OUTS) then
+               else if is_x86_parameterized_string_instruction_op(fixed_opcode) then
                 begin
                 begin
                   writer.AsmWrite(#9#9);
                   writer.AsmWrite(#9#9);
                   case fixed_opcode of
                   case fixed_opcode of