~ubuntu-branches/debian/sid/ocaml/sid

« back to all changes in this revision

Viewing changes to asmcomp/hppa/selection.ml

  • Committer: Bazaar Package Importer
  • Author(s): Stéphane Glondu
  • Date: 2011-04-21 21:35:08 UTC
  • mfrom: (1.1.11 upstream) (12.1.14 sid)
  • Revision ID: james.westby@ubuntu.com-20110421213508-kg34453aqmb0moha
* Fixes related to -output-obj with g++ (in debian/patches):
  - add Declare-primitive-name-table-as-const-char
  - add Avoid-multiple-declarations-in-generated-.c-files-in
  - fix Embed-bytecode-in-C-object-when-using-custom: the closing
    brace for extern "C" { ... } was missing in some cases

Show diffs side-by-side

added added

removed removed

Lines of Context:
10
10
(*                                                                     *)
11
11
(***********************************************************************)
12
12
 
13
 
(* $Id: selection.ml 8768 2008-01-11 16:13:18Z doligez $ *)
 
13
(* $Id: selection.ml 10296 2010-04-22 12:51:06Z xleroy $ *)
14
14
 
15
15
(* Instruction selection for the HPPA processor *)
16
16
 
45
45
  | arg ->
46
46
      (Iindexed 0, arg)
47
47
 
48
 
method select_operation op args =
 
48
method! select_operation op args =
49
49
  match (op, args) with
50
50
  (* Recognize shift-add operations. *)
51
51
    ((Caddi|Cadda),
69
69
     Cand, Cor, Cxor : never *)
70
70
  | (Cmuli, ([arg1; Cconst_int n] as args)) ->
71
71
      let l = Misc.log2 n in
72
 
      if n = 1 lsl l 
 
72
      if n = 1 lsl l
73
73
      then (Iintop_imm(Ilsl, l), [arg1])
74
74
      else (Iintop Imul, args)
75
75
  | (Cmuli, ([Cconst_int n; arg1] as args)) ->
92
92
 
93
93
(* Deal with register constraints *)
94
94
 
95
 
method insert_op_debug op dbg rs rd =
 
95
method! insert_op_debug op dbg rs rd =
96
96
  match op with
97
97
    Iintop(Idiv | Imod) -> (* handled via calls to millicode *)
98
98
      let rs' = [|phys_reg 20; phys_reg 19|] (* %r26, %r25 *)