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

« back to all changes in this revision

Viewing changes to lib/hipe/rtl/hipe_rtl_arith.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
 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2
 
%% Copyright (c) 2002 by Erik Johansson.  
3
 
%% -*- erlang-indent-level: 2 -*-
4
 
%% ====================================================================
5
 
%%  Filename :  hipe_rtl_arith.erl
6
 
%%  Module   :  hipe_rtl_arith
7
 
%%  Purpose  :  To implement RTL-arithmetic 
8
 
%%  Notes    :  This module is somewhat prepared for 64-bit arithmatic
9
 
%%              but at the moment only 32-bit arithmetic is implemented.
10
 
%%              The wordsize of registers and arithmetic operation is
11
 
%%              dependent on the target. At the moment only 32-bit words
12
 
%%              are supported.
13
 
%%              XXX: Fix this module for 64-bit support.    
14
 
%%  History  :  * 2002-10-23 Erik Stenman (happi@csd.uu.se): 
15
 
%%               Created.
16
 
%%  CVS      :
17
 
%%              $Author: pergu $
18
 
%%              $Date: 2003/04/23 11:58:14 $
19
 
%%              $Revision: 1.3 $
20
 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
21
 
 
22
 
 
23
 
-module(hipe_rtl_arith).
24
 
-export([eval_alu/3,eval_alub/4, eval_cond/3]).
25
 
 
26
 
-define(ARITH_WS,hipe_rtl_arith_32).
27
 
 
28
 
eval_alu(Op, Arg1, Arg2) ->
29
 
 %% io:format("Evaluated alu: ~w ~w ~w = ",[Arg1, Op, Arg2]),
30
 
  Res=?ARITH_WS:eval_alu(Op, Arg1, Arg2),
31
 
 %% io:format("~w~n ",[Res]),
32
 
  Res.
33
 
eval_alub(Op, Cond, Arg1, Arg2) ->
34
 
 %% io:format("Evaluated alub: ~w ~w ~w cond ~w = ",[Arg1, Op, Arg2, Cond]),
35
 
  Res=?ARITH_WS:eval_alub(Op, Cond, Arg1, Arg2),
36
 
 %% io:format("~w~n ",[Res]),
37
 
  Res.
38
 
eval_cond(Cond, Arg1, Arg2) ->
39
 
 %%io:format("Evaluated cond: ~w ~w ~w = ",[Arg1, Cond, Arg2]),
40
 
  Res=?ARITH_WS:eval_cond(Cond, Arg1, Arg2),
41
 
 %%io:format("~w~n ",[Res]),
42
 
  Res.