提交 30a0d72f 编写于 作者: S Stefan Weil 提交者: Bastian Koppelmann

target-tricore: Fix two helper functions (clang warnings)

clang report:

target-tricore/op_helper.c:1247:24: warning:
  taking the absolute value of unsigned type 'uint32_t' (aka 'unsigned int')
  has no effect [-Wabsolute-value]
target-tricore/op_helper.c:1248:25: warning:
  taking the absolute value of unsigned type 'uint32_t' (aka 'unsigned int')
  has no effect [-Wabsolute-value]
target-tricore/op_helper.c:1249:19: warning:
  taking the absolute value of unsigned type 'uint32_t' (aka 'unsigned int')
  has no effect [-Wabsolute-value]
target-tricore/op_helper.c:1297:24: warning:
  taking the absolute value of unsigned type 'uint32_t' (aka 'unsigned int')
  has no effect [-Wabsolute-value]
target-tricore/op_helper.c:1298:25: warning:
  taking the absolute value of unsigned type 'uint32_t' (aka 'unsigned int')
  has no effect [-Wabsolute-value]
target-tricore/op_helper.c:1299:19: warning:
  taking the absolute value of unsigned type 'uint32_t' (aka 'unsigned int')
  has no effect [-Wabsolute-value]

Fix also the divisor which was taken from the wrong register
(thanks to Peter Maydell for this hint).

Cc: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
Signed-off-by: NStefan Weil <sw@weilnetz.de>
Message-Id: <1425739412-8144-1-git-send-email-sw@weilnetz.de>
Signed-off-by: NBastian Koppelmann <kbastian@mail.uni-paderborn.de>
上级 362ca922
......@@ -1953,9 +1953,9 @@ uint64_t helper_dvinit_b_13(CPUTriCoreState *env, uint32_t r1, uint32_t r2)
quotient_sign = 1;
}
abs_sig_dividend = abs(r1) >> 7;
abs_base_dividend = abs(r1) & 0x7f;
abs_divisor = abs(r1);
abs_sig_dividend = abs((int32_t)r1) >> 7;
abs_base_dividend = abs((int32_t)r1) & 0x7f;
abs_divisor = abs((int32_t)r2);
/* calc overflow */
env->PSW_USB_V = 0;
if ((quotient_sign) && (abs_divisor)) {
......@@ -2003,9 +2003,9 @@ uint64_t helper_dvinit_h_13(CPUTriCoreState *env, uint32_t r1, uint32_t r2)
quotient_sign = 1;
}
abs_sig_dividend = abs(r1) >> 7;
abs_base_dividend = abs(r1) & 0x7f;
abs_divisor = abs(r1);
abs_sig_dividend = abs((int32_t)r1) >> 7;
abs_base_dividend = abs((int32_t)r1) & 0x7f;
abs_divisor = abs((int32_t)r2);
/* calc overflow */
env->PSW_USB_V = 0;
if ((quotient_sign) && (abs_divisor)) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册