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

« back to all changes in this revision

Viewing changes to asmcomp/power/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 8499 2007-11-09 15:06:57Z frisch $ *)
 
13
(* $Id: selection.ml 10296 2010-04-22 12:51:06Z xleroy $ *)
14
14
 
15
15
(* Instruction selection for the Power PC processor *)
16
16
 
63
63
      then (Iindexed2, Ctuple[e1; e2])
64
64
      else (Iindexed d, Cop(Cadda, [e1; e2]))
65
65
 
66
 
method select_operation op args =
 
66
method! select_operation op args =
67
67
  match (op, args) with
68
68
  (* Prevent the recognition of (x / cst) and (x % cst) when cst is not
69
69
     a power of 2, which do not correspond to an instruction. *)
70
70
    (Cdivi, [arg; Cconst_int n]) when n = 1 lsl (Misc.log2 n) ->
71
71
      (Iintop_imm(Idiv, n), [arg])
72
 
  | (Cdivi, _) -> 
 
72
  | (Cdivi, _) ->
73
73
      (Iintop Idiv, args)
74
74
  | (Cmodi, [arg; Cconst_int n]) when n = 1 lsl (Misc.log2 n) ->
75
75
      (Iintop_imm(Imod, n), [arg])