Browse Source

16bit Thumb is not able to use tst with an immediate value

r28315 introduced an arm optimization which requires
  tst rX, #imm
to work. This is not available on 16bit thumb, I've disabled that
optimization on thumb for now.

git-svn-id: trunk@28360 -
masta 11 years ago
parent
commit
96915b3f0c
1 changed files with 1 additions and 1 deletions
  1. 1 1
      compiler/arm/narmadd.pas

+ 1 - 1
compiler/arm/narmadd.pas

@@ -416,7 +416,7 @@ interface
         if (right.nodetype=ordconstn) and
         if (right.nodetype=ordconstn) and
            (tordconstnode(right).value=0) and
            (tordconstnode(right).value=0) and
            ((nodetype in [equaln,unequaln]) or
            ((nodetype in [equaln,unequaln]) or
-            (is_signed(left.resultdef) and (nodetype = lt_zero_swapped[nf_swapped in Flags]))
+            (not(GenerateThumbCode) and is_signed(left.resultdef) and (nodetype = lt_zero_swapped[nf_swapped in Flags]))
            ) then
            ) then
           begin
           begin
             location_reset(location,LOC_FLAGS,OS_NO);
             location_reset(location,LOC_FLAGS,OS_NO);