From 807ebc9d6329026e0449c4fd9e63caf927c08ffe Mon Sep 17 00:00:00 2001 From: Johan Bengtsson Date: Mon, 5 Apr 2010 22:59:14 +0200 Subject: Modify pp_arm to decode imm8m constants Improve readability by decoding imm8m constants before printing them. Signed-off-by: Johan Bengtsson --- lib/hipe/arm/hipe_arm_pp.erl | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'lib/hipe/arm') 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}) -> -- cgit v1.2.3