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
13
%% XXX: Fix this module for 64-bit support.
14
%% History : * 2002-10-23 Erik Stenman (happi@csd.uu.se):
18
%% $Date: 2003/04/23 11:58:14 $
20
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
23
-module(hipe_rtl_arith).
24
-export([eval_alu/3,eval_alub/4, eval_cond/3]).
26
-define(ARITH_WS,hipe_rtl_arith_32).
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]),
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]),
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]),