aboutsummaryrefslogtreecommitdiffstats
path: root/driver/Driver.ml
diff options
context:
space:
mode:
authorXavier Leroy <xavier.leroy@inria.fr>2015-03-14 10:31:02 +0100
committerXavier Leroy <xavier.leroy@inria.fr>2015-03-14 10:31:02 +0100
commit67e8b783c7e794d995675a332f118533e6a9b14a (patch)
treed9e86638612cacd929580f280e71a070f1f71a00 /driver/Driver.ml
parent6f3ac9e1cef476ef0c5eaf7875af24543f66128a (diff)
downloadcompcert-67e8b783c7e794d995675a332f118533e6a9b14a.tar.gz
compcert-67e8b783c7e794d995675a332f118533e6a9b14a.zip
Improve performance and configurability for the StructReturn pass.
configure: special ABI value for IA32/MacOSX and PowerPC/Linux cparser/Machine: special config for PowerPC/Linux cparser/StructReturn: generate better code for return-as-int driver/Clflags, driver/Driver: add options -fstruct-return=<convention> and -fstruct-passing=<convention> to simplify testing
Diffstat (limited to 'driver/Driver.ml')
-rw-r--r--driver/Driver.ml30
1 files changed, 27 insertions, 3 deletions
diff --git a/driver/Driver.ml b/driver/Driver.ml
index 31d5096b..1af66f2c 100644
--- a/driver/Driver.ml
+++ b/driver/Driver.ml
@@ -386,6 +386,10 @@ Language support options (use -fno-<opt> to turn off -f<opt>) :
-fbitfields Emulate bit fields in structs [off]
-flongdouble Treat 'long double' as 'double' [off]
-fstruct-return Emulate returning structs and unions by value [off]
+ -fstruct-return=<convention>
+ Set the calling conventions used to return structs by value
+ -fstruct-passing=<convention>
+ Set the calling conventions used to pass structs by value
-fvararg-calls Support calls to variable-argument functions [on]
-funprototyped Support calls to old-style functions without prototypes [on]
-fpacked-structs Emulate packed structs [off]
@@ -527,7 +531,25 @@ let cmdline_actions =
Exact "-quiet", Self (fun _ -> Interp.trace := 0);
Exact "-trace", Self (fun _ -> Interp.trace := 2);
Exact "-random", Self (fun _ -> Interp.mode := Interp.Random);
- Exact "-all", Self (fun _ -> Interp.mode := Interp.All)
+ Exact "-all", Self (fun _ -> Interp.mode := Interp.All);
+(* Special -f options *)
+ Exact "-fstruct-passing=ref-callee",
+ Self (fun _ -> option_fstruct_passing_style := Some Machine.SP_ref_callee);
+ Exact "-fstruct-passing=ref-caller",
+ Self (fun _ -> option_fstruct_return := true;
+ option_fstruct_passing_style := Some Machine.SP_ref_caller);
+ Exact "-fstruct-passing=ints",
+ Self (fun _ -> option_fstruct_return := true;
+ option_fstruct_passing_style := Some Machine.SP_split_args);
+ Exact "-fstruct-return=ref",
+ Self (fun _ -> option_fstruct_return := true;
+ option_fstruct_return_style := Some 0);
+ Exact "-fstruct-return=int4",
+ Self (fun _ -> option_fstruct_return := true;
+ option_fstruct_return_style := Some 4);
+ Exact "-fstruct-return=int8",
+ Self (fun _ -> option_fstruct_return := true;
+ option_fstruct_return_style := Some 8)
]
(* -f options: come in -f and -fno- variants *)
(* Language support options *)
@@ -582,9 +604,11 @@ let _ =
Printexc.record_backtrace true;
Machine.config :=
begin match Configuration.arch with
- | "powerpc" -> Machine.ppc_32_bigendian
+ | "powerpc" -> if Configuration.abi = "linux"
+ then Machine.ppc_32_bigendian_linux
+ else Machine.ppc_32_bigendian
| "arm" -> Machine.arm_littleendian
- | "ia32" -> if Configuration.system = "macosx"
+ | "ia32" -> if Configuration.abi = "macosx"
then Machine.x86_32_macosx
else Machine.x86_32
| _ -> assert false