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: arch.ml 5304 2002-11-29 15:03:37Z xleroy $ *)
15 (* Specific operations for the Mips processor *)
20 (* Machine-specific command-line options *)
22 let command_line_options = []
24 (* Addressing modes *)
26 type addressing_mode =
27 Ibased of string * int (* symbol + displ *)
28 | Iindexed of int (* reg + displ *)
30 (* Specific operations *)
32 type specific_operation = unit (* none *)
34 (* Sizes, endianness *)
37 match Config.system with
40 | _ -> fatal_error "Arch_mips.big_endian"
46 (* Operations on addressing modes *)
48 let identity_addressing = Iindexed 0
50 let offset_addressing addr delta =
52 Ibased(s, n) -> Ibased(s, n + delta)
53 | Iindexed n -> Iindexed(n + delta)
55 let num_args_addressing = function
59 (* Printing operations and addressing modes *)
61 let print_addressing printreg addr ppf arg =
64 let idx = if n <> 0 then Printf.sprintf " + %i" n else "" in
65 fprintf ppf "\"%s\"%s" s idx
67 let idx = if n <> 0 then Printf.sprintf " + %i" n else "" in
68 fprintf ppf "%a%s" printreg arg.(0) idx
70 let print_specific_operation printreg op ppf arg =
71 fatal_error "Arch_mips.print_specific_operation"