aboutsummaryrefslogtreecommitdiffstats
path: root/cparser/StructPassing.ml
diff options
context:
space:
mode:
authorCyril SIX <cyril.six@kalray.eu>2019-10-14 11:17:45 +0200
committerCyril SIX <cyril.six@kalray.eu>2019-10-14 11:17:45 +0200
commit64a80f81297fb20c4f952d4b36cd0ae5d5da8f1e (patch)
treee41b0c4494181ee83e03d5909382cd29ade9516c /cparser/StructPassing.ml
parentc59a26be1b4ae5c0ecf963d0ff2436dc73e72123 (diff)
downloadcompcert-kvx-64a80f81297fb20c4f952d4b36cd0ae5d5da8f1e.tar.gz
compcert-kvx-64a80f81297fb20c4f952d4b36cd0ae5d5da8f1e.zip
Tackling struct passing by value for the future K1C ABI
Diffstat (limited to 'cparser/StructPassing.ml')
-rw-r--r--cparser/StructPassing.ml8
1 files changed, 8 insertions, 0 deletions
diff --git a/cparser/StructPassing.ml b/cparser/StructPassing.ml
index 060a4848..7bd72808 100644
--- a/cparser/StructPassing.ml
+++ b/cparser/StructPassing.ml
@@ -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 ->