diff options
author | David Monniaux <david.monniaux@univ-grenoble-alpes.fr> | 2020-09-29 19:35:36 +0200 |
---|---|---|
committer | David Monniaux <david.monniaux@univ-grenoble-alpes.fr> | 2020-09-29 19:35:36 +0200 |
commit | f6b0bfa541f69b4a563ac99a864284939067e994 (patch) | |
tree | 166d9721cd047c24c2d6d1e8294424f8f5b58210 | |
parent | 1f0c8cf821d310e405f3ad6327870fe3321ad6e6 (diff) | |
download | compcert-kvx-f6b0bfa541f69b4a563ac99a864284939067e994.tar.gz compcert-kvx-f6b0bfa541f69b4a563ac99a864284939067e994.zip |
attempt at separating the divisions
-rw-r--r-- | aarch64/OpWeights.ml | 5 | ||||
-rw-r--r-- | scheduling/PrepassSchedulingOracle.ml | 14 |
2 files changed, 18 insertions, 1 deletions
diff --git a/aarch64/OpWeights.ml b/aarch64/OpWeights.ml index d19f34af..01a1a553 100644 --- a/aarch64/OpWeights.ml +++ b/aarch64/OpWeights.ml @@ -298,6 +298,11 @@ let resources_of_op (op : operation) (nargs : int) = [| 1; 1; 1; 0 |] | _ -> [| 1; 1; 0; 0 |] );; +let non_pipelined_resources_of_op (op : operation) (nargs : int) = + match op with + | Odiv | Odivu -> [| 29 |] + | Odivl | Odivlu -> [| 50 |] + | _ -> [| -1 |];; let resources_of_cond (cmp : condition) (nargs : int) = (match cmp with diff --git a/scheduling/PrepassSchedulingOracle.ml b/scheduling/PrepassSchedulingOracle.ml index 7b7b7233..25083bcd 100644 --- a/scheduling/PrepassSchedulingOracle.ml +++ b/scheduling/PrepassSchedulingOracle.ml @@ -25,6 +25,8 @@ let get_simple_dependencies (seqa : (instruction*Regset.t) array) = and last_mem_reads : int list ref = ref [] and last_mem_write : int option ref = ref None and last_branch : int option ref = ref None + and last_non_pipelined_op : int array = Array.make + nr_non_pipelined_units ( -1 ) and latency_constraints : latency_constraint list ref = ref [] in let add_constraint instr_from instr_to latency = assert (instr_from <= instr_to); @@ -119,7 +121,15 @@ let get_simple_dependencies (seqa : (instruction*Regset.t) array) = | Some j -> add_constraint j i 1 in let set_branch i = irreversible_action i; - last_branch := Some i + last_branch := Some i in + let add_non_pipelined_resources i resources = + Array.iter2 + (fun latency last -> + if latency >= 0 && last >= 0 then add_constraint last i latency) + resources last_non_pipelined_op; + Array.iteri (fun rsc latency -> + if latency >= 0 + then last_non_pipelined_op.(rsc) <- i) resources in Array.iteri begin @@ -131,6 +141,8 @@ let get_simple_dependencies (seqa : (instruction*Regset.t) array) = match insn with | Inop _ -> () | Iop(op, inputs, output, _) -> + add_non_pipelined_resources i + (non_pipelined_resources_of_op op (List.length inputs)); (if Op.is_trapping_op op then irreversible_action i); add_input_regs i inputs; add_output_reg i (latency_of_op op (List.length inputs)) output |