Forráskód Böngészése

* the test $-1,%reg optimization shall be done not only if the cpu type is i386, but for the i386 compiler

git-svn-id: trunk@31474 -
florian 10 éve
szülő
commit
c9b1df2c91
1 módosított fájl, 9 hozzáadás és 8 törlés
  1. 9 8
      compiler/x86/nx86add.pas

+ 9 - 8
compiler/x86/nx86add.pas

@@ -132,14 +132,15 @@ unit nx86add;
                   (right.location.loc=LOC_CONSTANT) and
                   (right.location.value=0) then
                  begin
-                { 'test $-1,%reg' is transformable into 'test $-1,spilltemp' if %reg needs
-                   spilling, while 'test %reg,%reg' still requires loading into register.
-                   If spilling is not necessary, it is changed back into 'test %reg,%reg' by
-                   peephole optimizer (this optimization is currently available only for i386). }
-                   if (target_info.cpu=cpu_i386) then
-                     emit_const_reg(A_TEST,TCGSize2Opsize[opsize],aint(-1),left.location.register)
-                   else  
-                     emit_reg_reg(A_TEST,TCGSize2Opsize[opsize],left.location.register,left.location.register);
+                   { 'test $-1,%reg' is transformable into 'test $-1,spilltemp' if %reg needs
+                      spilling, while 'test %reg,%reg' still requires loading into register.
+                      If spilling is not necessary, it is changed back into 'test %reg,%reg' by
+                      peephole optimizer (this optimization is currently available only for i386). }
+{$ifdef i386}
+                   emit_const_reg(A_TEST,TCGSize2Opsize[opsize],aint(-1),left.location.register)
+{$else i386}
+                   emit_reg_reg(A_TEST,TCGSize2Opsize[opsize],left.location.register,left.location.register);
+{$endif i386}
                  end
                else
                  if (op=A_ADD) and