aboutsummaryrefslogtreecommitdiffstats
path: root/lib/hipe/arm/hipe_arm_pp.erl
diff options
context:
space:
mode:
authorJohan Bengtsson <[email protected]>2010-04-05 22:59:14 +0200
committerBjörn Gustavsson <[email protected]>2010-04-07 11:14:27 +0200
commit807ebc9d6329026e0449c4fd9e63caf927c08ffe (patch)
treef24eb77b97c057734c270b99701e09d710bc79b1 /lib/hipe/arm/hipe_arm_pp.erl
parent1b6a7c949bcf51e2d537de5cb89cbb6231abbf49 (diff)
downloadotp-807ebc9d6329026e0449c4fd9e63caf927c08ffe.tar.gz
otp-807ebc9d6329026e0449c4fd9e63caf927c08ffe.tar.bz2
otp-807ebc9d6329026e0449c4fd9e63caf927c08ffe.zip
Modify pp_arm to decode imm8m constants
Improve readability by decoding imm8m constants before printing them. Signed-off-by: Johan Bengtsson <[email protected]>
Diffstat (limited to 'lib/hipe/arm/hipe_arm_pp.erl')
-rw-r--r--lib/hipe/arm/hipe_arm_pp.erl7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/hipe/arm/hipe_arm_pp.erl b/lib/hipe/arm/hipe_arm_pp.erl
index 7ce8421994..cad56bf16d 100644
--- a/lib/hipe/arm/hipe_arm_pp.erl
+++ b/lib/hipe/arm/hipe_arm_pp.erl
@@ -246,6 +246,11 @@ stop_suffix(StOp) ->
'strb' -> "b"
end.
+imm8m_decode(Value, 0) ->
+ Value;
+imm8m_decode(Value, Rot) ->
+ (Value bsr (2 * Rot)) bor (Value bsl (2 * (16 - Rot))).
+
pp_temp(Dev, Temp=#arm_temp{reg=Reg, type=Type}) ->
case hipe_arm:temp_is_precoloured(Temp) of
true ->
@@ -292,7 +297,7 @@ pp_am1(Dev, Am1) ->
io:format(Dev, "#~w", [Imm5])
end;
{Imm8,Imm4} ->
- io:format(Dev, "#~w, 2*~w", [Imm8,Imm4])
+ io:format(Dev, "#~s", [to_hex(imm8m_decode(Imm8, Imm4))])
end.
pp_am2(Dev, #am2{src=Src,sign=Sign,offset=Am2Offset}) ->