浏览代码

* generate shorter code on 8 and 16-bit CPUs in thlcg2ll.location_force_reg,
when converting a LOC_JUMP location to a 64-bit reg location by only setting
the low OS_INT-sized register to 0 or 1 in the false/true label parts and then
initializing the remaining registers (obtainable via GetNextReg()) to 0 in the
common part after the jumps.

git-svn-id: trunk@26314 -

nickysn 11 年之前
父节点
当前提交
9ec84d1259
共有 1 个文件被更改,包括 5 次插入2 次删除
  1. 5 2
      compiler/hlcg2ll.pas

+ 5 - 2
compiler/hlcg2ll.pas

@@ -1058,12 +1058,15 @@ implementation
               LOC_JUMP :
                 begin
                   cg.a_label(list,current_procinfo.CurrTrueLabel);
-                  cg.a_load_const_reg(list,OS_32,1,hregister);
+                  cg.a_load_const_reg(list,OS_INT,1,hregister);
                   current_asmdata.getjumplabel(hl);
                   cg.a_jmp_always(list,hl);
                   cg.a_label(list,current_procinfo.CurrFalseLabel);
-                  cg.a_load_const_reg(list,OS_32,0,hregister);
+                  cg.a_load_const_reg(list,OS_INT,0,hregister);
                   cg.a_label(list,hl);
+{$if defined(cpu8bitalu) or defined(cpu16bitalu)}
+                  cg.a_load_reg_reg(list,OS_INT,OS_32,hregister,hregister);
+{$endif}
                 end;
               else
                 a_load_loc_reg(list,src_size,u32inttype,l,hregister);