From f70c24435de3cac8f04872a9e31fb07bb9550f0e Mon Sep 17 00:00:00 2001 From: micha Date: Sat, 8 Mar 2008 13:02:33 +0000 Subject: [PATCH] * fix int64 result passing on armeb git-svn-id: trunk@10460 - --- compiler/arm/cpubase.pas | 55 ++++++++++++++++++++++++++++++---------- 1 file changed, 42 insertions(+), 13 deletions(-) diff --git a/compiler/arm/cpubase.pas b/compiler/arm/cpubase.pas index 4e5a5978db..c536f8e867 100644 --- a/compiler/arm/cpubase.pas +++ b/compiler/arm/cpubase.pas @@ -300,21 +300,9 @@ unit cpubase; { Results are returned in this register (32-bit values) } NR_FUNCTION_RETURN_REG = NR_R0; RS_FUNCTION_RETURN_REG = RS_R0; - { Low part of 64bit return value } - NR_FUNCTION_RETURN64_LOW_REG = NR_R0; - RS_FUNCTION_RETURN64_LOW_REG = RS_R0; - { High part of 64bit return value } - NR_FUNCTION_RETURN64_HIGH_REG = NR_R1; - RS_FUNCTION_RETURN64_HIGH_REG = RS_R1; { The value returned from a function is available in this register } NR_FUNCTION_RESULT_REG = NR_FUNCTION_RETURN_REG; RS_FUNCTION_RESULT_REG = RS_FUNCTION_RETURN_REG; - { The lowh part of 64bit value returned from a function } - NR_FUNCTION_RESULT64_LOW_REG = NR_FUNCTION_RETURN64_LOW_REG; - RS_FUNCTION_RESULT64_LOW_REG = RS_FUNCTION_RETURN64_LOW_REG; - { The high part of 64bit value returned from a function } - NR_FUNCTION_RESULT64_HIGH_REG = NR_FUNCTION_RETURN64_HIGH_REG; - RS_FUNCTION_RESULT64_HIGH_REG = RS_FUNCTION_RETURN64_HIGH_REG; NR_FPU_RESULT_REG = NR_F0; @@ -325,6 +313,13 @@ unit cpubase; { Offset where the parent framepointer is pushed } PARENT_FRAMEPOINTER_OFFSET = 0; + { Low part of 64bit return value } + function NR_FUNCTION_RESULT64_LOW_REG: tregister; + function RS_FUNCTION_RESULT64_LOW_REG: shortint; + { High part of 64bit return value } + function NR_FUNCTION_RESULT64_HIGH_REG: tregister; + function RS_FUNCTION_RESULT64_HIGH_REG: shortint; + {***************************************************************************** GCC /ABI linking information *****************************************************************************} @@ -379,7 +374,7 @@ unit cpubase; implementation uses - rgBase,verbose; + systems,rgBase,verbose; const @@ -528,4 +523,38 @@ unit cpubase; internalerror(200603251); end; + { Low part of 64bit return value } + function NR_FUNCTION_RESULT64_LOW_REG: tregister; + begin + if target_info.endian=endian_little then + result:=NR_R0 + else + result:=NR_R1; + end; + + function RS_FUNCTION_RESULT64_LOW_REG: shortint; + begin + if target_info.endian=endian_little then + result:=RS_R0 + else + result:=RS_R1; + end; + + { High part of 64bit return value } + function NR_FUNCTION_RESULT64_HIGH_REG: tregister; + begin + if target_info.endian=endian_little then + result:=NR_R1 + else + result:=NR_R0; + end; + + function RS_FUNCTION_RESULT64_HIGH_REG: shortint; + begin + if target_info.endian=endian_little then + result:=RS_R1 + else + result:=RS_R1; + end; + end.