소스 검색

* generate sub instead of add from lea if appropriate

git-svn-id: trunk@25902 -
florian 12 년 전
부모
커밋
5eb578a44c
1개의 변경된 파일10개의 추가작업 그리고 2개의 파일을 삭제
  1. 10 2
      compiler/i386/popt386.pas

+ 10 - 2
compiler/i386/popt386.pas

@@ -1055,8 +1055,16 @@ begin
                                   end
                                 else
                                   begin
-                                    taicpu(p).opcode := A_ADD;
-                                    taicpu(p).loadConst(0,l);
+                                    if (l<0) and (l<>$80000000) then
+                                      begin
+                                        taicpu(p).opcode := A_SUB;
+                                        taicpu(p).loadConst(0,-l);
+                                      end
+                                    else
+                                      begin
+                                        taicpu(p).opcode := A_ADD;
+                                        taicpu(p).loadConst(0,l);
+                                      end;
                                   end;
                               end;
                     end;