Browse Source

* fixed tcg8086.a_load_reg_reg when doing an unsigned extension in the same superregister; this fixes the taddbool test

git-svn-id: trunk@24466 -
nickysn 12 years ago
parent
commit
502c2ffb94
1 changed files with 4 additions and 2 deletions
  1. 4 2
      compiler/i8086/cgcpu.pas

+ 4 - 2
compiler/i8086/cgcpu.pas

@@ -827,9 +827,10 @@ unit cgcpu;
                 case fromsize of
                   OS_8:
                     begin
-                      list.concat(taicpu.op_const_reg(A_MOV, S_W, 0, reg2));
                       reg2 := makeregsize(list, reg2, OS_8);
                       add_mov(taicpu.op_reg_reg(A_MOV, S_B, reg1, reg2));
+                      setsubreg(reg2,R_SUBH);
+                      list.concat(taicpu.op_const_reg(A_MOV, S_B, 0, reg2));
                     end;
                   OS_S8:
                     begin
@@ -849,9 +850,10 @@ unit cgcpu;
                   OS_8:
                     begin
                       list.concat(taicpu.op_const_reg(A_MOV, S_W, 0, GetNextReg(reg2)));
-                      list.concat(taicpu.op_const_reg(A_MOV, S_W, 0, reg2));
                       reg2 := makeregsize(list, reg2, OS_8);
                       add_mov(taicpu.op_reg_reg(A_MOV, S_B, reg1, reg2));
+                      setsubreg(reg2,R_SUBH);
+                      list.concat(taicpu.op_const_reg(A_MOV, S_B, 0, reg2));
                     end;
                   OS_S8:
                     begin