* fixes cardinal in reg -> real on x86-64, resolves #8225

git-svn-id: trunk@6588 -
This commit is contained in:
florian 2007-02-21 16:53:57 +00:00
parent 9a37c04131
commit 05e0a804cc
3 changed files with 28 additions and 3 deletions

1
.gitattributes vendored
View File

@ -8050,6 +8050,7 @@ tests/webtbs/tw8199.pp svneol=native#text/plain
tests/webtbs/tw8222.pp svneol=native#text/plain
tests/webtbs/tw8222a.pp svneol=native#text/plain
tests/webtbs/tw8222b.pp svneol=native#text/plain
tests/webtbs/tw8225.pp -text
tests/webtbs/tw8229.pp svneol=native#text/plain
tests/webtbs/tw8232.pp svneol=native#text/plain
tests/webtbs/tw8258.pp svneol=native#text/plain

View File

@ -241,16 +241,18 @@ implementation
{ Get sign bit }
if (left.location.loc=LOC_REGISTER) then
emit_const_reg(A_BT,S_Q,63,left.location.register)
begin
emit_const_reg(A_BT,S_Q,63,left.location.register);
current_asmdata.CurrAsmList.concat(taicpu.op_reg_reg(op,S_Q,left.location.register,location.register));
end
else
begin
inc(left.location.reference.offset,4);
emit_const_ref(A_BT,S_L,31,left.location.reference);
dec(left.location.reference.offset,4);
current_asmdata.CurrAsmList.concat(taicpu.op_ref_reg(op,S_Q,left.location.reference,location.register));
end;
current_asmdata.CurrAsmList.concat(taicpu.op_ref_reg(op,S_Q,left.location.reference,location.register));
cg.a_jmp_flags(current_asmdata.CurrAsmList,F_NC,l2);
current_asmdata.asmlists[al_typedconsts].concat(Tai_label.Create(l1));
reference_reset_symbol(href,l1,0);

22
tests/webtbs/tw8225.pp Normal file
View File

@ -0,0 +1,22 @@
program test;
const
factor : double = 1.0;
function CheckLongint(count,wcount:longint):double;
begin
result:=(count+wcount)*factor;
end;
function CheckCardinal(count,wcount:cardinal):double;
begin
result:=(count+wcount)*factor;
end;
begin
writeln('LONGINT: ',CheckLongint(3,1));
writeln('CARDINAL: ',CheckCardinal(3,1));
end.