1 (**************************************************************************)
2 (* *)
3 (* OCaml *)
4 (* *)
5 (* Xavier Leroy, projet Gallium, INRIA Rocquencourt *)
6 (* *)
7 (* Copyright 2014 Institut National de Recherche en Informatique et *)
8 (* en Automatique. *)
9 (* *)
10 (* All rights reserved. This file is distributed under the terms of *)
11 (* the GNU Lesser General Public License version 2.1, with the *)
12 (* special exception on linking described in the file LICENSE. *)
13 (* *)
14 (**************************************************************************)
15
16 (* CSE for the AMD64 *)
17
18 open Arch
19 open Mach
20 open CSEgen
21
22 class cse = object
23
24 inherit cse_generic as super
25
26 method! class_of_operation op =
27 match op with
28 | Ispecific spec ->
29 begin match spec with
30 | Ilea _ | Isextend32 | Izextend32 -> Op_pure
31 | Istore_int(_, _, is_asg) -> Op_store is_asg
32 | Ioffset_loc(_, _) -> Op_store true
33 | Ifloatarithmem _ | Ifloatsqrtf _ -> Op_load
34 | Ibswap _ | Isqrtf -> super#class_of_operation op
35 end
36 | _ -> super#class_of_operation op
37
38 end
39
40 let fundecl f =
41 (new cse)#fundecl f
42