Просмотр исходного кода

* on 16-bit CPUs remove unnecessary 32-bit conversions of integers, that are
later converted back to 16 bits

git-svn-id: trunk@35679 -

nickysn 8 лет назад
Родитель
Сommit
8033392554
1 измененных файлов с 7 добавлено и 0 удалено
  1. 7 0
      compiler/ncnv.pas

+ 7 - 0
compiler/ncnv.pas

@@ -2868,6 +2868,13 @@ implementation
                     (left.nodetype in [subn,addn,muln,divn,modn,xorn,andn,orn]) and
                     checkremovebiginttypeconvs(left,foundsint,[s8bit,u8bit,s16bit,u16bit,s32bit,u32bit],int64(low(longint)),high(cardinal)) then
                     doremoveinttypeconvs(left,generrordef,not foundsint,s32inttype,u32inttype);
+{$if defined(cpu16bitalu)}
+                  if (resultdef.size <= 2) and
+                    (is_32bitint(left.resultdef) or is_64bitint(left.resultdef)) and
+                    (left.nodetype in [subn,addn,muln,divn,modn,xorn,andn,orn]) and
+                    checkremovebiginttypeconvs(left,foundsint,[s8bit,u8bit,s16bit,u16bit],int64(low(smallint)),high(word)) then
+                    doremoveinttypeconvs(left,generrordef,not foundsint,s16inttype,u16inttype);
+{$endif defined(cpu16bitalu)}
 {$if defined(cpu8bitalu)}
                  if (resultdef.size<left.resultdef.size) and
                   is_integer(left.resultdef) and