forked from ShuriZma/suyu
1
0
Fork 0

vfp: Get rid of warnings

- Unary minus operator applied to unsigned type.
- Unsafe use of bool.
This commit is contained in:
Lioncash 2015-05-14 13:43:22 -04:00
parent 150e700729
commit 773b1ef6bf
2 changed files with 6 additions and 6 deletions

View File

@ -531,7 +531,7 @@ static u32 vfp_double_fsito(ARMul_State* state, int dd, int unused, int dm, u32
LOG_TRACE(Core_ARM11, "In %s\n", __FUNCTION__); LOG_TRACE(Core_ARM11, "In %s\n", __FUNCTION__);
vdm.sign = (m & 0x80000000) >> 16; vdm.sign = (m & 0x80000000) >> 16;
vdm.exponent = 1023 + 63 - 1; vdm.exponent = 1023 + 63 - 1;
vdm.significand = vdm.sign ? -m : m; vdm.significand = vdm.sign ? (~m + 1) : m;
return vfp_double_normaliseround(state, dd, &vdm, fpscr, 0, "fsito"); return vfp_double_normaliseround(state, dd, &vdm, fpscr, 0, "fsito");
} }
@ -669,7 +669,7 @@ static u32 vfp_double_ftosi(ARMul_State* state, int sd, int unused, int dm, u32
exceptions |= FPSCR_IXC; exceptions |= FPSCR_IXC;
if (vdm.sign) if (vdm.sign)
d = -d; d = (~d + 1);
} else { } else {
d = 0; d = 0;
if (vdm.exponent | vdm.significand) { if (vdm.exponent | vdm.significand) {
@ -817,7 +817,7 @@ u32 vfp_double_add(struct vfp_double *vdd, struct vfp_double *vdn,struct vfp_dou
m_sig = vdn->significand - m_sig; m_sig = vdn->significand - m_sig;
if ((s64)m_sig < 0) { if ((s64)m_sig < 0) {
vdd->sign = vfp_sign_negate(vdd->sign); vdd->sign = vfp_sign_negate(vdd->sign);
m_sig = -m_sig; m_sig = (~m_sig + 1);
} else if (m_sig == 0) { } else if (m_sig == 0) {
vdd->sign = (fpscr & FPSCR_RMODE_MASK) == vdd->sign = (fpscr & FPSCR_RMODE_MASK) ==
FPSCR_ROUND_MINUSINF ? 0x8000 : 0; FPSCR_ROUND_MINUSINF ? 0x8000 : 0;

View File

@ -388,7 +388,7 @@ sqrt_invalid:
} else { } else {
u64 term; u64 term;
s64 rem; s64 rem;
vsm.significand <<= !(vsm.exponent & 1); vsm.significand <<= static_cast<u32>((vsm.exponent & 1) == 0);
term = (u64)vsd.significand * vsd.significand; term = (u64)vsd.significand * vsd.significand;
rem = ((u64)vsm.significand << 32) - term; rem = ((u64)vsm.significand << 32) - term;
@ -691,7 +691,7 @@ static u32 vfp_single_ftosi(ARMul_State* state, int sd, int unused, s32 m, u32 f
exceptions |= FPSCR_IXC; exceptions |= FPSCR_IXC;
if (vsm.sign) if (vsm.sign)
d = 0-d; d = (~d + 1);
} else { } else {
d = 0; d = 0;
if (vsm.exponent | vsm.significand) { if (vsm.exponent | vsm.significand) {
@ -843,7 +843,7 @@ vfp_single_add(struct vfp_single *vsd, struct vfp_single *vsn,
m_sig = vsn->significand - m_sig; m_sig = vsn->significand - m_sig;
if ((s32)m_sig < 0) { if ((s32)m_sig < 0) {
vsd->sign = vfp_sign_negate(vsd->sign); vsd->sign = vfp_sign_negate(vsd->sign);
m_sig = 0-m_sig; m_sig = (~m_sig + 1);
} else if (m_sig == 0) { } else if (m_sig == 0) {
vsd->sign = (fpscr & FPSCR_RMODE_MASK) == vsd->sign = (fpscr & FPSCR_RMODE_MASK) ==
FPSCR_ROUND_MINUSINF ? 0x8000 : 0; FPSCR_ROUND_MINUSINF ? 0x8000 : 0;