Commit 64a80f81 authored by Cyril SIX's avatar Cyril SIX
Browse files

Tackling struct passing by value for the future K1C ABI

parent c59a26be
......@@ -18,6 +18,7 @@
type struct_passing_style =
| SP_ref_callee (* by reference, callee takes copy *)
| SP_ref_caller (* by reference, caller takes copy *)
| SP_value32_ref_callee (* by value if <= 32 bits, by ref_callee otherwise *)
| SP_split_args (* by value, as a sequence of ints *)
type struct_return_style =
......@@ -268,8 +269,8 @@ let mppa_k1c =
bigendian = false;
bitfields_msb_first = false; (* TO CHECK *)
supports_unaligned_accesses = true;
struct_passing_style = SP_split_args;
struct_return_style = SR_int1248 }
struct_passing_style = SP_value32_ref_callee;
struct_return_style = SR_int1to4 }
(* Add GCC extensions re: sizeof and alignof *)
......
......@@ -17,6 +17,7 @@
type struct_passing_style =
| SP_ref_callee (* by reference, callee takes copy *)
| SP_ref_caller (* by reference, caller takes copy *)
| SP_value32_ref_callee (* by value if <= 32 bits, by ref_callee otherwise *)
| SP_split_args (* by value, as a sequence of ints *)
type struct_return_style =
......
......@@ -68,6 +68,14 @@ let classify_param env ty =
match !struct_passing_style with
| SP_ref_callee -> Param_unchanged
| SP_ref_caller -> Param_ref_caller
| SP_value32_ref_callee ->
(match sizeof env ty, alignof env ty with
| Some sz, Some al ->
if (sz <= 4) then
Param_flattened ((sz+3)/4, sz, al) (* FIXME - why (sz+3)/4 ? *)
else
Param_unchanged
| _, _ -> failwith "StructPassing.classify_param SP_split_args32_ref_callee")
| SP_split_args ->
match sizeof env ty, alignof env ty with
| Some sz, Some al ->
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment