~ubuntu-branches/debian/squeeze/erlang/squeeze

« back to all changes in this revision

Viewing changes to lib/hipe/ppc/hipe_ppc_ra.erl

  • Committer: Bazaar Package Importer
  • Author(s): Erlang Packagers, Sergei Golovan
  • Date: 2006-12-03 17:07:44 UTC
  • mfrom: (2.1.11 feisty)
  • Revision ID: james.westby@ubuntu.com-20061203170744-rghjwupacqlzs6kv
Tags: 1:11.b.2-4
[ Sergei Golovan ]
Fixed erlang-base and erlang-base-hipe prerm scripts.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
%%% -*- erlang-indent-level: 2 -*-
 
2
%%% $Id$
 
3
 
 
4
-module(hipe_ppc_ra).
 
5
-export([ra/2]).
 
6
 
 
7
ra(Defun0, Options) ->
 
8
  %% hipe_ppc_pp:pp(Defun0),
 
9
  {Defun1, Coloring_fp, SpillIndex}
 
10
    = case proplists:get_bool(inline_fp, Options) of
 
11
        true ->
 
12
          hipe_regalloc_loop:ra_fp(Defun0, Options,
 
13
                                   hipe_coalescing_regalloc,
 
14
                                   hipe_ppc_specific_fp);
 
15
        false ->
 
16
          {Defun0,[],0}
 
17
      end,
 
18
  %% hipe_ppc_pp:pp(Defun1),
 
19
  {Defun2, Coloring}
 
20
    = case proplists:get_value(regalloc, Options, coalescing) of
 
21
        coalescing ->
 
22
          ra(Defun1, SpillIndex, Options, hipe_coalescing_regalloc);
 
23
        optimistic ->
 
24
          ra(Defun1, SpillIndex, Options, hipe_optimistic_regalloc);
 
25
        graph_color ->
 
26
          ra(Defun1, SpillIndex, Options, hipe_graph_coloring_regalloc);
 
27
        linear_scan ->
 
28
          hipe_ppc_ra_ls:ra(Defun1, SpillIndex, Options);
 
29
        naive ->
 
30
          hipe_ppc_ra_naive:ra(Defun1, Coloring_fp, Options);
 
31
        _ ->
 
32
          exit({unknown_regalloc_compiler_option,
 
33
                proplists:get_value(regalloc,Options)})
 
34
      end,
 
35
  %% hipe_ppc_pp:pp(Defun2),
 
36
  hipe_ppc_ra_finalise:finalise(Defun2, Coloring, Coloring_fp).
 
37
 
 
38
ra(Defun, SpillIndex, Options, RegAllocMod) ->
 
39
  hipe_regalloc_loop:ra(Defun, SpillIndex, Options, RegAllocMod, hipe_ppc_specific).