* more x86-64 fixes

This commit is contained in:
florian 2004-02-05 19:35:27 +00:00
parent 221090453c
commit 55557eea92
2 changed files with 24 additions and 9 deletions

View File

@ -642,6 +642,7 @@ implementation
genitem(t^.less); genitem(t^.less);
if t^._low=t^._high then if t^._low=t^._high then
begin begin
{$ifndef cpu64bit}
if opsize in [OS_S64,OS_64] then if opsize in [OS_S64,OS_64] then
begin begin
objectlibrary.getlabel(l1); objectlibrary.getlabel(l1);
@ -655,6 +656,7 @@ implementation
cg.a_label(exprasmlist,l1); cg.a_label(exprasmlist,l1);
end end
else else
{$endif cpu64bit}
begin begin
cg.a_cmp_const_reg_label(exprasmlist, opsize, OC_EQ, aword(t^._low),hregister, t^.statement); cg.a_cmp_const_reg_label(exprasmlist, opsize, OC_EQ, aword(t^._low),hregister, t^.statement);
end; end;
@ -669,6 +671,7 @@ implementation
{ ELSE-label } { ELSE-label }
if first or (t^._low-last>1) then if first or (t^._low-last>1) then
begin begin
{$ifndef cpu64bit}
if opsize in [OS_64,OS_S64] then if opsize in [OS_64,OS_S64] then
begin begin
objectlibrary.getlabel(l1); objectlibrary.getlabel(l1);
@ -690,12 +693,13 @@ implementation
cg.a_label(exprasmlist,l1); cg.a_label(exprasmlist,l1);
end end
else else
{$endif cpu64bit}
begin begin
cg.a_cmp_const_reg_label(exprasmlist, opsize, jmp_lt, aword(t^._low), hregister, cg.a_cmp_const_reg_label(exprasmlist, opsize, jmp_lt, aword(t^._low), hregister,
elselabel); elselabel);
end; end;
end; end;
{$ifndef cpu64bit}
if opsize in [OS_S64,OS_64] then if opsize in [OS_S64,OS_64] then
begin begin
objectlibrary.getlabel(l1); objectlibrary.getlabel(l1);
@ -715,6 +719,7 @@ implementation
cg.a_label(exprasmlist,l1); cg.a_label(exprasmlist,l1);
end end
else else
{$endif cpu64bit}
begin begin
cg.a_cmp_const_reg_label(exprasmlist, opsize, jmp_le, aword(t^._high), hregister, t^.statement); cg.a_cmp_const_reg_label(exprasmlist, opsize, jmp_le, aword(t^._high), hregister, t^.statement);
end; end;
@ -850,13 +855,15 @@ implementation
opsize:=def_cgsize(left.resulttype.def); opsize:=def_cgsize(left.resulttype.def);
{ copy the case expression to a register } { copy the case expression to a register }
location_force_reg(exprasmlist,left.location,opsize,false); location_force_reg(exprasmlist,left.location,opsize,false);
{$ifndef cpu64bit}
if opsize in [OS_S64,OS_64] then if opsize in [OS_S64,OS_64] then
begin begin
hregister:=left.location.registerlow; hregister:=left.location.registerlow;
hregister2:=left.location.registerhigh; hregister2:=left.location.registerhigh;
end end
else else
hregister:=left.location.register; {$endif cpu64bit}
hregister:=left.location.register;
if isjump then if isjump then
begin begin
truelabel:=otl; truelabel:=otl;
@ -871,9 +878,11 @@ implementation
load_all_regvars(exprasmlist); load_all_regvars(exprasmlist);
{$endif OLDREGVARS} {$endif OLDREGVARS}
{ now generate the jumps } { now generate the jumps }
{$ifndef cpu64bit}
if opsize in [OS_64,OS_S64] then if opsize in [OS_64,OS_S64] then
genlinearcmplist(nodes) genlinearcmplist(nodes)
else else
{$endif cpu64bit}
begin begin
if cs_optimize in aktglobalswitches then if cs_optimize in aktglobalswitches then
begin begin
@ -1008,7 +1017,10 @@ begin
end. end.
{ {
$Log$ $Log$
Revision 1.57 2004-01-31 23:37:07 florian Revision 1.58 2004-02-05 19:35:27 florian
* more x86-64 fixes
Revision 1.57 2004/01/31 23:37:07 florian
* another improvement to tcginnode.pass_2 * another improvement to tcginnode.pass_2
Revision 1.56 2004/01/31 17:45:17 peter Revision 1.56 2004/01/31 17:45:17 peter

View File

@ -306,7 +306,7 @@ implementation
cg.deallocexplicitregisters(list,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_default)); cg.deallocexplicitregisters(list,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_default));
cg.g_exception_reason_save(list, href); cg.g_exception_reason_save(list, href);
cg.a_cmp_const_reg_label(list,OS_S32,OC_NE,0,NR_FUNCTION_RESULT_REG,exceptlabel); cg.a_cmp_const_reg_label(list,OS_S32,OC_NE,0,cg.makeregsize(NR_FUNCTION_RESULT_REG,OS_S32),exceptlabel);
end; end;
@ -2137,7 +2137,10 @@ implementation
end. end.
{ {
$Log$ $Log$
Revision 1.190 2004-02-05 01:24:08 florian Revision 1.191 2004-02-05 19:35:27 florian
* more x86-64 fixes
Revision 1.190 2004/02/05 01:24:08 florian
* several fixes to compile x86-64 system * several fixes to compile x86-64 system
Revision 1.189 2004/02/04 22:15:15 daniel Revision 1.189 2004/02/04 22:15:15 daniel