Browse Source

* more readable code

florian 3 months ago
parent
commit
32a19eb5b3
1 changed files with 4 additions and 10 deletions
  1. 4 10
      compiler/armgen/aoptarm.pas

+ 4 - 10
compiler/armgen/aoptarm.pas

@@ -2028,12 +2028,8 @@ Implementation
           { If p.opcode = A_STR, then ThisReg will be NR_NO }
           { If p.opcode = A_STR, then ThisReg will be NR_NO }
           if (
           if (
 {$ifdef ARM}
 {$ifdef ARM}
-              (p_second.typ = ait_instruction) and
-              (taicpu(p_second).condition = taicpu(p).condition) and
-              (
-                (taicpu(p_second).opcode = A_MOV) or
-                (taicpu(p_second).opcode = A_MOVW)
-              )
+              MatchInstruction(p_second, A_MOV, [taicpu(p).condition], []) or
+              MatchInstruction(p_second, A_MOVW, [taicpu(p).condition], [])
 {$endif ARM}
 {$endif ARM}
 {$ifdef AARCH64}
 {$ifdef AARCH64}
               MatchInstruction(p, A_MOVZ, []) or
               MatchInstruction(p, A_MOVZ, []) or
@@ -2073,11 +2069,9 @@ Implementation
             (
             (
               (
               (
 {$ifdef ARM}
 {$ifdef ARM}
-                (p_second.typ = ait_instruction) and
-                (taicpu(p_second).condition = taicpu(p).condition) and
                 (
                 (
-                  (taicpu(p_second).opcode = A_MOV) or
-                  (taicpu(p_second).opcode = A_MOVW)
+                  MatchInstruction(p_second, A_MOV, [taicpu(p).condition], []) or
+                  MatchInstruction(p_second, A_MOVW, [taicpu(p).condition], [])
                 ) and
                 ) and
 {$endif ARM}
 {$endif ARM}
 {$ifdef AARCH64}
 {$ifdef AARCH64}