From cbf8434e44ebd6bc05022d1fbe0400267520184f Mon Sep 17 00:00:00 2001 From: Xavier Leroy Date: Fri, 20 Mar 2015 11:25:30 +0100 Subject: Improvements in the StructReturn transformation (ABI conformance for passing composites). - Implement the "1/2/4/8" composite return policy, used by IA32/MacOS X and IA32/BSD. - Move the default passing conventions from Machine.ml to compcert.ini, making it easier to test the various conventions. - More comprehensive interoperability test in regression/interop1.c. --- cparser/Machine.ml | 46 ++++++++++------------------------------------ 1 file changed, 10 insertions(+), 36 deletions(-) (limited to 'cparser/Machine.ml') diff --git a/cparser/Machine.ml b/cparser/Machine.ml index e1f9998f..bd6489fd 100644 --- a/cparser/Machine.ml +++ b/cparser/Machine.ml @@ -44,16 +44,9 @@ type t = { alignof_fun: int option; bigendian: bool; bitfields_msb_first: bool; - supports_unaligned_accesses: bool; - struct_return_as_int: int; - struct_passing_style: struct_passing_style + supports_unaligned_accesses: bool } -and struct_passing_style = - | SP_ref_callee - | SP_ref_caller - | SP_split_args - let ilp32ll64 = { name = "ilp32ll64"; char_signed = false; @@ -83,9 +76,7 @@ let ilp32ll64 = { alignof_fun = None; bigendian = false; bitfields_msb_first = false; - supports_unaligned_accesses = false; - struct_return_as_int = 0; - struct_passing_style = SP_ref_callee + supports_unaligned_accesses = false } let i32lpll64 = { @@ -117,9 +108,7 @@ let i32lpll64 = { alignof_fun = None; bigendian = false; bitfields_msb_first = false; - supports_unaligned_accesses = false; - struct_return_as_int = 0; - struct_passing_style = SP_ref_callee + supports_unaligned_accesses = false } let il32pll64 = { @@ -151,9 +140,7 @@ let il32pll64 = { alignof_fun = None; bigendian = false; bitfields_msb_first = false; - supports_unaligned_accesses = false; - struct_return_as_int = 0; - struct_passing_style = SP_ref_callee + supports_unaligned_accesses = false } (* Canned configurations for some ABIs *) @@ -163,12 +150,10 @@ let x86_32 = char_signed = true; alignof_longlong = 4; alignof_double = 4; sizeof_longdouble = 12; alignof_longdouble = 4; - supports_unaligned_accesses = true; - struct_passing_style = SP_split_args } + supports_unaligned_accesses = true } let x86_32_macosx = - { x86_32 with sizeof_longdouble = 16; alignof_longdouble = 16; - struct_return_as_int = 8 } + { x86_32 with sizeof_longdouble = 16; alignof_longdouble = 16 } let x86_64 = { i32lpll64 with name = "x86_64"; char_signed = true } @@ -183,17 +168,10 @@ let ppc_32_bigendian = { ilp32ll64 with name = "powerpc"; bigendian = true; bitfields_msb_first = true; - supports_unaligned_accesses = true; - struct_return_as_int = 8; - struct_passing_style = SP_ref_caller } - -let ppc_32_bigendian_linux = - { ppc_32_bigendian with struct_return_as_int = 0 } + supports_unaligned_accesses = true } let arm_littleendian = - { ilp32ll64 with name = "arm"; - struct_return_as_int = 4; - struct_passing_style = SP_split_args } + { ilp32ll64 with name = "arm" } (* Add GCC extensions re: sizeof and alignof *) @@ -205,9 +183,7 @@ let gcc_extensions c = let compcert_interpreter c = { c with sizeof_longdouble = 8; alignof_longdouble = 8; - supports_unaligned_accesses = false; - struct_return_as_int = 0; - struct_passing_style = SP_ref_callee } + supports_unaligned_accesses = false } (* Undefined configuration *) @@ -240,9 +216,7 @@ let undef = { alignof_fun = None; bigendian = false; bitfields_msb_first = false; - supports_unaligned_accesses = false; - struct_return_as_int = 0; - struct_passing_style = SP_ref_callee + supports_unaligned_accesses = false } (* The current configuration. Must be initialized before use. *) -- cgit