aboutsummaryrefslogtreecommitdiffstats
path: root/cparser/Machine.ml
diff options
context:
space:
mode:
authorXavier Leroy <xavier.leroy@inria.fr>2015-03-20 11:25:30 +0100
committerXavier Leroy <xavier.leroy@inria.fr>2015-03-20 11:25:30 +0100
commitcbf8434e44ebd6bc05022d1fbe0400267520184f (patch)
treea73d9d6d0601935cf514698cdc393d131df7a341 /cparser/Machine.ml
parent42e397bd80389c7e7259f962415769b06561bb5d (diff)
downloadcompcert-kvx-cbf8434e44ebd6bc05022d1fbe0400267520184f.tar.gz
compcert-kvx-cbf8434e44ebd6bc05022d1fbe0400267520184f.zip
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.
Diffstat (limited to 'cparser/Machine.ml')
-rw-r--r--cparser/Machine.ml46
1 files changed, 10 insertions, 36 deletions
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. *)