* base compiler patches to improve C parameter passing compatibility on powerpc64/linux

git-svn-id: trunk@1983 -
This commit is contained in:
tom_at_work 2005-12-18 22:07:24 +00:00
parent f9722ad6a5
commit b53ee04f98
2 changed files with 20 additions and 3 deletions

View File

@ -1282,8 +1282,14 @@ implementation
href : treference;
begin
case paraloc.loc of
LOC_REGISTER :
cg.a_load_reg_ref(list,paraloc.size,paraloc.size,paraloc.register,ref);
LOC_REGISTER :
begin
{$IFDEF CPUPOWERPC64}
if (paraloc.shiftval <> 0) then
cg.a_op_const_reg_reg(list, OP_SHL, OS_INT, paraloc.shiftval, paraloc.register, paraloc.register);
{$ENDIF CPUPOWERPC64}
cg.a_load_reg_ref(list,paraloc.size,paraloc.size,paraloc.register,ref);
end;
LOC_MMREGISTER :
cg.a_loadmm_reg_ref(list,paraloc.size,paraloc.size,paraloc.register,ref,mms_movescalar);
LOC_FPUREGISTER :

View File

@ -46,7 +46,18 @@ unit parabase;
LOC_MMREGISTER,
LOC_CMMREGISTER,
LOC_REGISTER,
LOC_CREGISTER : (register : tregister);
LOC_CREGISTER : (
{ The number of bits the value in the register must be shifted to the left before
it can be stored to memory in the function prolog.
This is used for passing OS_NO memory blocks less than register size and of "odd"
(3, 5, 6, 7) size on big endian machines, so that small memory blocks passed via
registers are properly aligned.
E.g. the value $5544433 is passed in bits 40-63 of the register (others are zero),
but they should actually be stored in the first bits of the stack location reserved
for this value. So they have to be shifted left by this amount of bits before. }
{$IFDEF CPUPOWERPC64}shiftval : byte;{$ENDIF CPUPOWERPC64}
register : tregister);
end;
TCGPara = object