소스 검색

* 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}
             { We allow this exception for x86, since overloading this would be
               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
                 if ((ref^.base=NR_NO) or (getsupreg(ref^.base)<>RS_EDI)) and
                    ((ref^.index=NR_NO) or (getsupreg(ref^.index)<>RS_EDI)) and
@@ -2704,13 +2698,7 @@ implementation
                   new(ref);
                   ref^:=o.ref^;
 {$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
                       if ((ref^.base=NR_NO) or (getsupreg(ref^.base)<>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;
                if fixed_opcode=A_FWAIT then
                 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
                   writer.AsmWrite(#9#9);
                   case fixed_opcode of