1995-11-26 06:38:29 -08:00
|
|
|
(***********************************************************************)
|
|
|
|
(* *)
|
1996-04-30 07:53:58 -07:00
|
|
|
(* Objective Caml *)
|
1995-11-26 06:38:29 -08:00
|
|
|
(* *)
|
|
|
|
(* Xavier Leroy, projet Cristal, INRIA Rocquencourt *)
|
|
|
|
(* *)
|
1996-04-30 07:53:58 -07:00
|
|
|
(* Copyright 1996 Institut National de Recherche en Informatique et *)
|
1999-11-17 10:59:06 -08:00
|
|
|
(* en Automatique. All rights reserved. This file is distributed *)
|
|
|
|
(* under the terms of the Q Public License version 1.0. *)
|
1995-11-26 06:38:29 -08:00
|
|
|
(* *)
|
|
|
|
(***********************************************************************)
|
|
|
|
|
|
|
|
(* $Id$ *)
|
|
|
|
|
|
|
|
(* Specific operations for the HP PA-RISC processor *)
|
|
|
|
|
2002-07-22 09:38:07 -07:00
|
|
|
open Misc
|
2000-04-21 01:13:22 -07:00
|
|
|
open Format
|
1995-11-26 06:38:29 -08:00
|
|
|
|
2002-11-29 07:03:37 -08:00
|
|
|
(* Machine-specific command-line options *)
|
|
|
|
|
|
|
|
let command_line_options = []
|
|
|
|
|
|
|
|
(* Specific operations *)
|
|
|
|
|
1995-11-26 06:38:29 -08:00
|
|
|
type specific_operation =
|
|
|
|
Ishift1add
|
|
|
|
| Ishift2add
|
|
|
|
| Ishift3add
|
|
|
|
|
|
|
|
(* Addressing modes *)
|
|
|
|
|
|
|
|
type addressing_mode =
|
|
|
|
Ibased of string * int (* symbol + displ *)
|
|
|
|
| Iindexed of int (* reg + displ *)
|
|
|
|
|
|
|
|
(* Sizes, endianness *)
|
|
|
|
|
1995-12-27 03:04:31 -08:00
|
|
|
let big_endian = true
|
1995-11-26 06:38:29 -08:00
|
|
|
|
|
|
|
let size_addr = 4
|
|
|
|
let size_int = 4
|
|
|
|
let size_float = 8
|
|
|
|
|
|
|
|
(* Operations on addressing modes *)
|
|
|
|
|
|
|
|
let identity_addressing = Iindexed 0
|
|
|
|
|
|
|
|
let offset_addressing addr delta =
|
|
|
|
match addr with
|
|
|
|
Ibased(s, n) -> Ibased(s, n + delta)
|
|
|
|
| Iindexed n -> Iindexed(n + delta)
|
|
|
|
|
|
|
|
let num_args_addressing = function
|
|
|
|
Ibased(s, n) -> 0
|
|
|
|
| Iindexed n -> 1
|
|
|
|
|
|
|
|
(* Printing operations and addressing modes *)
|
|
|
|
|
2000-04-21 01:13:22 -07:00
|
|
|
let print_addressing printreg addr ppf arg =
|
1995-11-26 06:38:29 -08:00
|
|
|
match addr with
|
2000-04-21 01:13:22 -07:00
|
|
|
| Ibased(s, n) ->
|
|
|
|
let idx = if n <> 0 then Printf.sprintf " + %i" n else "" in
|
|
|
|
fprintf ppf "\"%s\"%s" s idx
|
1995-11-26 06:38:29 -08:00
|
|
|
| Iindexed n ->
|
2000-04-21 01:13:22 -07:00
|
|
|
let idx = if n <> 0 then Printf.sprintf " + %i" n else "" in
|
|
|
|
fprintf ppf "%a%s" printreg arg.(0) idx
|
1995-11-26 06:38:29 -08:00
|
|
|
|
2000-04-21 01:13:22 -07:00
|
|
|
let print_specific_operation printreg op ppf arg =
|
1995-11-26 06:38:29 -08:00
|
|
|
match op with
|
2000-04-21 01:13:22 -07:00
|
|
|
| Ishift1add -> fprintf ppf "%a << 1 + %a" printreg arg.(0) printreg arg.(1)
|
|
|
|
| Ishift2add -> fprintf ppf "%a << 2 + %a" printreg arg.(0) printreg arg.(1)
|
|
|
|
| Ishift3add -> fprintf ppf "%a << 3 + %a" printreg arg.(0) printreg arg.(1)
|