aboutsummaryrefslogtreecommitdiffstats
path: root/kvx/OpWeights.ml
diff options
context:
space:
mode:
authorDavid Monniaux <david.monniaux@univ-grenoble-alpes.fr>2020-10-22 13:49:17 +0200
committerDavid Monniaux <david.monniaux@univ-grenoble-alpes.fr>2020-10-22 13:49:17 +0200
commitb05085c08cfa6799934e9ef4154a99293c283d03 (patch)
treee8727663dc0bd06caecb297f2bc9938bff9a0f4b /kvx/OpWeights.ml
parent3486eb50d289456b79de168e1ab410306305cf2c (diff)
downloadcompcert-kvx-b05085c08cfa6799934e9ef4154a99293c283d03.tar.gz
compcert-kvx-b05085c08cfa6799934e9ef4154a99293c283d03.zip
new OpWeights
Diffstat (limited to 'kvx/OpWeights.ml')
-rw-r--r--kvx/OpWeights.ml24
1 files changed, 24 insertions, 0 deletions
diff --git a/kvx/OpWeights.ml b/kvx/OpWeights.ml
index 9614fd92..23c2e5d3 100644
--- a/kvx/OpWeights.ml
+++ b/kvx/OpWeights.ml
@@ -1,5 +1,9 @@
open Op;;
open PostpassSchedulingOracle;;
+open PrepassSchedulingOracleDeps;;
+
+module KV3 =
+ struct
let resource_bounds = PostpassSchedulingOracle.resource_bounds;;
let nr_non_pipelined_units = 0;;
@@ -89,3 +93,23 @@ let resources_of_store chunk addressing nargs =
let resources_of_call _ _ = resource_bounds;;
let resources_of_builtin _ = resource_bounds;;
+ end;;
+
+let get_opweights () : opweights =
+ match !Clflags.option_mtune with
+ | "kv3" | "" ->
+ {
+ pipelined_resource_bounds = KV3.resource_bounds;
+ nr_non_pipelined_units = KV3.nr_non_pipelined_units;
+ latency_of_op = KV3.latency_of_op;
+ resources_of_op = KV3.resources_of_op;
+ non_pipelined_resources_of_op = KV3.non_pipelined_resources_of_op;
+ latency_of_load = KV3.latency_of_load;
+ resources_of_load = KV3.resources_of_load;
+ resources_of_store = KV3.resources_of_store;
+ resources_of_cond = KV3.resources_of_cond;
+ latency_of_call = KV3.latency_of_call;
+ resources_of_call = KV3.resources_of_call;
+ resources_of_builtin = KV3.resources_of_builtin
+ }
+ | xxx -> failwith (Printf.sprintf "unknown -mtune: %s" xxx);;