diff options
author | Magnus Lång <[email protected]> | 2015-11-20 14:39:48 +0100 |
---|---|---|
committer | Magnus Lång <[email protected]> | 2015-11-27 18:18:38 +0100 |
commit | bac7c55f9a9250f6edb57170530d567df6c92f29 (patch) | |
tree | f44973b5331cb4fd3840ba9d798bd947dc244f6b /lib/hipe/rtl/hipe_rtl_arith_32.erl | |
parent | 148153eb16e873181ff6961f854105a240989265 (diff) | |
download | otp-bac7c55f9a9250f6edb57170530d567df6c92f29.tar.gz otp-bac7c55f9a9250f6edb57170530d567df6c92f29.tar.bz2 otp-bac7c55f9a9250f6edb57170530d567df6c92f29.zip |
hipe: Allow unsigned args in hipe_rtl_arith
hipe_rtl_arith is only used by hipe_rtl_ssa_const_prop, which applies it
to any RTL, including RTL where the intent is to do unsigned math. Since
signed and unsigned operations produce the same 2's complement result,
this change is harmless.
On 32-bit architectures it caused HiPE crashes when compiling code like
<<0:((1 bsl 32)-1)>>, because the size of the field is too large to fit
in a signed integer.
Diffstat (limited to 'lib/hipe/rtl/hipe_rtl_arith_32.erl')
-rw-r--r-- | lib/hipe/rtl/hipe_rtl_arith_32.erl | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/hipe/rtl/hipe_rtl_arith_32.erl b/lib/hipe/rtl/hipe_rtl_arith_32.erl index 572556be1c..d790a8b981 100644 --- a/lib/hipe/rtl/hipe_rtl_arith_32.erl +++ b/lib/hipe/rtl/hipe_rtl_arith_32.erl @@ -24,7 +24,8 @@ %% Filename : hipe_rtl_arith_32.erl %% Module : hipe_rtl_arith_32 %% Purpose : To implement 32-bit RTL-arithmetic -%% Notes : The arithmetic works on 32-bit signed integers. +%% Notes : The arithmetic works on 32-bit signed and unsigned +%% integers. %% The implementation is taken from the implementation %% of arithmetic on SPARC. %% XXX: This code is seldom used, and hence also |