* 16-bit ALU fixes in tcgcasenode.genlinearcmplist

git-svn-id: branches/i8086@23989 -
This commit is contained in:
nickysn 2013-03-24 22:40:27 +00:00
parent 284f1c904a
commit 29c7d38e43

View File

@ -626,7 +626,7 @@ implementation
genitem(t^.less);
if t^._low=t^._high then
begin
{$ifndef cpu64bitalu}
{$ifdef cpu32bitalu}
if def_cgsize(opsize) in [OS_S64,OS_64] then
begin
current_asmdata.getjumplabel(l1);
@ -635,7 +635,26 @@ implementation
cg.a_label(current_asmdata.CurrAsmList,l1);
end
else
{$endif not cpu64bitalu}
{$endif cpu32bitalu}
{$ifdef cpu16bitalu)}
if def_cgsize(opsize) in [OS_S64,OS_64] then
begin
current_asmdata.getjumplabel(l1);
cg.a_cmp_const_reg_label(current_asmdata.CurrAsmList, OS_16, OC_NE, aint(hi(hi(int64(t^._low.svalue)))),GetNextReg(hregister2),l1);
cg.a_cmp_const_reg_label(current_asmdata.CurrAsmList, OS_16, OC_NE, aint(lo(hi(int64(t^._low.svalue)))),hregister2,l1);
cg.a_cmp_const_reg_label(current_asmdata.CurrAsmList, OS_16, OC_NE, aint(hi(lo(int64(t^._low.svalue)))),GetNextReg(hregister),l1);
cg.a_cmp_const_reg_label(current_asmdata.CurrAsmList, OS_16, OC_EQ, aint(lo(lo(int64(t^._low.svalue)))),hregister, blocklabel(t^.blockid));
cg.a_label(current_asmdata.CurrAsmList,l1);
end
else if def_cgsize(opsize) in [OS_S32,OS_32] then
begin
current_asmdata.getjumplabel(l1);
cg.a_cmp_const_reg_label(current_asmdata.CurrAsmList, OS_16, OC_NE, aint(hi(int32(t^._low.svalue))),GetNextReg(hregister),l1);
cg.a_cmp_const_reg_label(current_asmdata.CurrAsmList, OS_16, OC_EQ, aint(lo(int32(t^._low.svalue))),hregister, blocklabel(t^.blockid));
cg.a_label(current_asmdata.CurrAsmList,l1);
end
else
{$endif cpu16bitalu}
begin
hlcg.a_cmp_const_reg_label(current_asmdata.CurrAsmList, opsize, OC_EQ, aint(t^._low.svalue),hregister, blocklabel(t^.blockid));
end;
@ -650,7 +669,7 @@ implementation
{ ELSE-label }
if not lastwasrange or (t^._low-last>1) then
begin
{$ifndef cpu64bitalu}
{$ifdef cpu32bitalu}
if def_cgsize(opsize) in [OS_64,OS_S64] then
begin
current_asmdata.getjumplabel(l1);
@ -663,13 +682,46 @@ implementation
cg.a_label(current_asmdata.CurrAsmList,l1);
end
else
{$endif not cpu64bitalu}
{$endif cpu32bitalu}
{$ifdef cpu16bitalu}
if def_cgsize(opsize) in [OS_64,OS_S64] then
begin
current_asmdata.getjumplabel(l1);
cg.a_cmp_const_reg_label(current_asmdata.CurrAsmList, OS_16, jmp_lt, aint(hi(hi(int64(t^._low.svalue)))),
GetNextReg(hregister2), elselabel);
cg.a_cmp_const_reg_label(current_asmdata.CurrAsmList, OS_16, jmp_gt, aint(hi(hi(int64(t^._low.svalue)))),
GetNextReg(hregister2), l1);
{ the comparison of the low words must be always unsigned! }
cg.a_cmp_const_reg_label(current_asmdata.CurrAsmList, OS_16, OC_B, aint(lo(hi(int64(t^._low.svalue)))),
hregister2, elselabel);
cg.a_cmp_const_reg_label(current_asmdata.CurrAsmList, OS_16, OC_A, aint(lo(hi(int64(t^._low.svalue)))),
hregister2, l1);
cg.a_cmp_const_reg_label(current_asmdata.CurrAsmList, OS_16, OC_B, aint(hi(lo(int64(t^._low.svalue)))),
GetNextReg(hregister), elselabel);
cg.a_cmp_const_reg_label(current_asmdata.CurrAsmList, OS_16, OC_A, aint(hi(lo(int64(t^._low.svalue)))),
GetNextReg(hregister), l1);
cg.a_cmp_const_reg_label(current_asmdata.CurrAsmList, OS_16, OC_B, aint(lo(lo(int64(t^._low.svalue)))), hregister, elselabel);
cg.a_label(current_asmdata.CurrAsmList,l1);
end
else if def_cgsize(opsize) in [OS_32,OS_S32] then
begin
current_asmdata.getjumplabel(l1);
cg.a_cmp_const_reg_label(current_asmdata.CurrAsmList, OS_16, jmp_lt, aint(hi(int32(t^._low.svalue))),
GetNextReg(hregister), elselabel);
cg.a_cmp_const_reg_label(current_asmdata.CurrAsmList, OS_16, jmp_gt, aint(hi(int32(t^._low.svalue))),
GetNextReg(hregister), l1);
{ the comparisation of the low dword must be always unsigned! }
cg.a_cmp_const_reg_label(current_asmdata.CurrAsmList, OS_16, OC_B, aint(lo(int32(t^._low.svalue))), hregister, elselabel);
cg.a_label(current_asmdata.CurrAsmList,l1);
end
else
{$endif cpu16bitalu}
begin
hlcg.a_cmp_const_reg_label(current_asmdata.CurrAsmList, opsize, jmp_lt, aint(t^._low.svalue), hregister,
elselabel);
end;
end;
{$ifndef cpu64bitalu}
{$ifdef cpu32bitalu}
if def_cgsize(opsize) in [OS_S64,OS_64] then
begin
current_asmdata.getjumplabel(l1);
@ -681,7 +733,38 @@ implementation
cg.a_label(current_asmdata.CurrAsmList,l1);
end
else
{$endif not cpu64bitalu}
{$endif cpu32bitalu}
{$ifdef cpu16bitalu}
if def_cgsize(opsize) in [OS_S64,OS_64] then
begin
current_asmdata.getjumplabel(l1);
cg.a_cmp_const_reg_label(current_asmdata.CurrAsmList, OS_16, jmp_lt, aint(hi(hi(int64(t^._high.svalue)))), GetNextReg(hregister2),
blocklabel(t^.blockid));
cg.a_cmp_const_reg_label(current_asmdata.CurrAsmList, OS_16, jmp_gt, aint(hi(hi(int64(t^._high.svalue)))), GetNextReg(hregister2),
l1);
cg.a_cmp_const_reg_label(current_asmdata.CurrAsmList, OS_16, OC_B, aint(lo(hi(int64(t^._high.svalue)))), hregister2,
blocklabel(t^.blockid));
cg.a_cmp_const_reg_label(current_asmdata.CurrAsmList, OS_16, OC_A, aint(lo(hi(int64(t^._high.svalue)))), hregister2,
l1);
cg.a_cmp_const_reg_label(current_asmdata.CurrAsmList, OS_16, OC_B, aint(hi(lo(int64(t^._high.svalue)))), GetNextReg(hregister),
blocklabel(t^.blockid));
cg.a_cmp_const_reg_label(current_asmdata.CurrAsmList, OS_16, OC_A, aint(hi(lo(int64(t^._high.svalue)))), GetNextReg(hregister),
l1);
cg.a_cmp_const_reg_label(current_asmdata.CurrAsmList, OS_16, OC_BE, aint(lo(lo(int64(t^._high.svalue)))), hregister, blocklabel(t^.blockid));
cg.a_label(current_asmdata.CurrAsmList,l1);
end
else if def_cgsize(opsize) in [OS_S32,OS_32] then
begin
current_asmdata.getjumplabel(l1);
cg.a_cmp_const_reg_label(current_asmdata.CurrAsmList, OS_16, jmp_lt, aint(hi(int32(t^._high.svalue))), GetNextReg(hregister),
blocklabel(t^.blockid));
cg.a_cmp_const_reg_label(current_asmdata.CurrAsmList, OS_16, jmp_gt, aint(hi(int32(t^._high.svalue))), GetNextReg(hregister),
l1);
cg.a_cmp_const_reg_label(current_asmdata.CurrAsmList, OS_16, OC_BE, aint(lo(int32(t^._high.svalue))), hregister, blocklabel(t^.blockid));
cg.a_label(current_asmdata.CurrAsmList,l1);
end
else
{$endif cpu16bitalu}
begin
hlcg.a_cmp_const_reg_label(current_asmdata.CurrAsmList, opsize, jmp_le, aint(t^._high.svalue), hregister, blocklabel(t^.blockid));
end;