1 (***********************************************************************)
5 (* Xavier Leroy, projet Cristal, INRIA Rocquencourt *)
7 (* Copyright 1996 Institut National de Recherche en Informatique et *)
8 (* en Automatique. All rights reserved. This file is distributed *)
9 (* under the terms of the Q Public License version 1.0. *)
11 (***********************************************************************)
13 (* $Id: scheduling.ml 2553 1999-11-17 18:59:06Z xleroy $ *)
15 (* Instruction scheduling for the HPPA *)
20 class scheduler = object (self)
22 inherit Schedgen.scheduler_generic
24 (* Latencies (in cycles). Roughly based on the ``Mustang'' chips. *)
26 method oper_latency = function
29 | Iconst_float _ -> 2 (* turned into a load *)
30 | Iintop Imul -> 2 (* ends up with a load *)
31 | Iaddf | Isubf | Imulf -> 3
35 (* Issue cycles. Rough approximations. *)
37 method oper_issue_cycles = function
39 | Iconst_symbol _ -> 2
40 | Iload(_, Ibased(_, _)) -> 2
41 | Istore(_, Ibased(_, _)) -> 2
47 | Iintop(Icomp _) -> 2
48 | Iintop(Icheckbound) -> 2
49 | Iintop_imm(Idiv, _) -> 4
50 | Iintop_imm(Imod, _) -> 5
51 | Iintop_imm(Icomp _, _) -> 2
52 | Iintop_imm(Icheckbound, _) -> 2
59 let fundecl f = (new scheduler)#schedule_fundecl f