-----BEGIN PGP SIGNATURE-----

iQIcBAABAgAGBQJa6HF2AAoJEPMMOL0/L748rsIP/RIgW9DGqBYABxWHTrbFg4R7
 Mptu94TIVwlZCCpGH/51am0Oghm1MetgO0JXncYkLL3e7GqYbBB3UlD8hrT0DIIy
 kaYGnIVgczRDjf9RHDockK8vXHtB4VHs2aax1WN8Cf2UGOpH/sOZAKb2kTeKIOWt
 nVa+W0PWF/oObph6NEK2oWXYAf9wyxeQDDJSjn886wuFavGykjms+e5on07U6Vey
 p6Btu4lD4G3YXM5C3aVkVjRlVTJlUOUPzWoMkp4tLHENS+h1vcpjhEd+ZZf1X3CL
 oGJ0tZZ1KsY1oqlUnZSaQLHfF/u9hQKsMLMzMi4Hialha+o4qCQQovWpMBNzNH7j
 bH4EqlAP3yTC8AyXkikdzebDGp1Ic4T+JIPRihdpSS1UT9zN4pQfoV+o1XExJosB
 w/YJMg/aMCHu+Nfy7qhvaLZj6o2bdoVdP1YdSexRrLBYTf2E4QtbKIcdNs6iaYnt
 0qOBVSkXIg7BzvceVMpPWsaY/vk8QQwhqGtJlg/SkmpBw5j8jOBpWrfoUv/vhnA3
 NupoelZEOOagVgZxY+qoaKh4wEt+n37IQPOT2MyFo8jy7ul9kOFYnrIvQbFGOz7i
 Ezi7XoZQpkoqAwh8o1AeqKU+IbUOlYyBuvzJhLDW5oteVtkILzcxHq0AnegIkvfi
 epmMevJrHXvgciic8unl
 =mLWS
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/vivier/tags/m68k-for-2.13-pull-request' into staging

# gpg: Signature made Tue 01 May 2018 14:53:58 BST
# gpg:                using RSA key F30C38BD3F2FBE3C
# gpg: Good signature from "Laurent Vivier <lvivier@redhat.com>"
# gpg:                 aka "Laurent Vivier <laurent@vivier.eu>"
# gpg:                 aka "Laurent Vivier (Red Hat) <lvivier@redhat.com>"
# Primary key fingerprint: CD2F 75DD C8E3 A4DC 2E4F  5173 F30C 38BD 3F2F BE3C

* remotes/vivier/tags/m68k-for-2.13-pull-request:
  hw/m68k/mcf5208: Fix trivial typo in board description
  m68k: remove dead code (Coverity CID1390617)
  m68k: Fix floatx80_lognp1 (Coverity CID1390587)
  m68k: fix subx mem, mem instruction

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
Peter Maydell 2018-05-01 15:26:06 +01:00
commit 26bd8d98c4
3 changed files with 19 additions and 33 deletions

View File

@ -315,7 +315,7 @@ static void mcf5208evb_init(MachineState *machine)
static void mcf5208evb_machine_init(MachineClass *mc)
{
mc->desc = "MCF5206EVB";
mc->desc = "MCF5208EVB";
mc->init = mcf5208evb_init;
mc->is_default = 1;
mc->default_cpu_type = M68K_CPU_TYPE_NAME("m5208");

View File

@ -334,7 +334,8 @@ floatx80 floatx80_lognp1(floatx80 a, float_status *status)
if (aSign && aExp >= one_exp) {
if (aExp == one_exp && aSig == one_sig) {
float_raise(float_flag_divbyzero, status);
packFloatx80(aSign, floatx80_infinity.high, floatx80_infinity.low);
return packFloatx80(aSign, floatx80_infinity.high,
floatx80_infinity.low);
}
float_raise(float_flag_invalid, status);
return floatx80_default_nan(status);
@ -1496,7 +1497,7 @@ floatx80 floatx80_sin(floatx80 a, float_status *status)
int32_t compact, l, n, j;
floatx80 fp0, fp1, fp2, fp3, fp4, fp5, x, invtwopi, twopi1, twopi2;
float32 posneg1, twoto63;
flag adjn, endflag;
flag endflag;
aSig = extractFloatx80Frac(a);
aExp = extractFloatx80Exp(a);
@ -1514,8 +1515,6 @@ floatx80 floatx80_sin(floatx80 a, float_status *status)
return packFloatx80(aSign, 0, 0);
}
adjn = 0;
user_rnd_mode = status->float_rounding_mode;
user_rnd_prec = status->floatx80_rounding_precision;
status->float_rounding_mode = float_round_nearest_even;
@ -1590,14 +1589,8 @@ floatx80 floatx80_sin(floatx80 a, float_status *status)
status->float_rounding_mode = user_rnd_mode;
status->floatx80_rounding_precision = user_rnd_prec;
if (adjn) {
/* COSTINY */
a = floatx80_sub(fp0, float32_to_floatx80(
make_float32(0x00800000), status), status);
} else {
/* SINTINY */
a = floatx80_move(a, status);
}
/* SINTINY */
a = floatx80_move(a, status);
float_raise(float_flag_inexact, status);
return a;
@ -1615,7 +1608,7 @@ floatx80 floatx80_sin(floatx80 a, float_status *status)
status); /* FP0 IS R = (X-Y1)-Y2 */
sincont:
if ((n + adjn) & 1) {
if (n & 1) {
/* COSPOLY */
fp0 = floatx80_mul(fp0, fp0, status); /* FP0 IS S */
fp1 = floatx80_mul(fp0, fp0, status); /* FP1 IS T */
@ -1628,7 +1621,7 @@ floatx80 floatx80_sin(floatx80 a, float_status *status)
xExp = extractFloatx80Exp(fp0);
xSig = extractFloatx80Frac(fp0);
if (((n + adjn) >> 1) & 1) {
if ((n >> 1) & 1) {
xSign ^= 1;
posneg1 = make_float32(0xBF800000); /* -1 */
} else {
@ -1680,7 +1673,7 @@ floatx80 floatx80_sin(floatx80 a, float_status *status)
xExp = extractFloatx80Exp(fp0);
xSig = extractFloatx80Frac(fp0);
xSign ^= ((n + adjn) >> 1) & 1; /* X IS NOW R'= SGN*R */
xSign ^= (n >> 1) & 1; /* X IS NOW R'= SGN*R */
fp0 = floatx80_mul(fp0, fp0, status); /* FP0 IS S */
fp1 = floatx80_mul(fp0, fp0, status); /* FP1 IS T */
@ -1743,7 +1736,7 @@ floatx80 floatx80_cos(floatx80 a, float_status *status)
int32_t compact, l, n, j;
floatx80 fp0, fp1, fp2, fp3, fp4, fp5, x, invtwopi, twopi1, twopi2;
float32 posneg1, twoto63;
flag adjn, endflag;
flag endflag;
aSig = extractFloatx80Frac(a);
aExp = extractFloatx80Exp(a);
@ -1761,8 +1754,6 @@ floatx80 floatx80_cos(floatx80 a, float_status *status)
return packFloatx80(0, one_exp, one_sig);
}
adjn = 1;
user_rnd_mode = status->float_rounding_mode;
user_rnd_prec = status->floatx80_rounding_precision;
status->float_rounding_mode = float_round_nearest_even;
@ -1836,15 +1827,10 @@ floatx80 floatx80_cos(floatx80 a, float_status *status)
status->float_rounding_mode = user_rnd_mode;
status->floatx80_rounding_precision = user_rnd_prec;
if (adjn) {
/* COSTINY */
a = floatx80_sub(fp0, float32_to_floatx80(
make_float32(0x00800000), status),
status);
} else {
/* SINTINY */
a = floatx80_move(a, status);
}
/* COSTINY */
a = floatx80_sub(fp0, float32_to_floatx80(
make_float32(0x00800000), status),
status);
float_raise(float_flag_inexact, status);
return a;
@ -1862,7 +1848,7 @@ floatx80 floatx80_cos(floatx80 a, float_status *status)
status); /* FP0 IS R = (X-Y1)-Y2 */
sincont:
if ((n + adjn) & 1) {
if ((n + 1) & 1) {
/* COSPOLY */
fp0 = floatx80_mul(fp0, fp0, status); /* FP0 IS S */
fp1 = floatx80_mul(fp0, fp0, status); /* FP1 IS T */
@ -1875,7 +1861,7 @@ floatx80 floatx80_cos(floatx80 a, float_status *status)
xExp = extractFloatx80Exp(fp0);
xSig = extractFloatx80Frac(fp0);
if (((n + adjn) >> 1) & 1) {
if (((n + 1) >> 1) & 1) {
xSign ^= 1;
posneg1 = make_float32(0xBF800000); /* -1 */
} else {
@ -1926,7 +1912,7 @@ floatx80 floatx80_cos(floatx80 a, float_status *status)
xExp = extractFloatx80Exp(fp0);
xSig = extractFloatx80Frac(fp0);
xSign ^= ((n + adjn) >> 1) & 1; /* X IS NOW R'= SGN*R */
xSign ^= ((n + 1) >> 1) & 1; /* X IS NOW R'= SGN*R */
fp0 = floatx80_mul(fp0, fp0, status); /* FP0 IS S */
fp1 = floatx80_mul(fp0, fp0, status); /* FP1 IS T */

View File

@ -3166,11 +3166,11 @@ DISAS_INSN(subx_mem)
opsize = insn_opsize(insn);
addr_src = AREG(insn, 0);
tcg_gen_subi_i32(addr_src, addr_src, opsize);
tcg_gen_subi_i32(addr_src, addr_src, opsize_bytes(opsize));
src = gen_load(s, opsize, addr_src, 1, IS_USER(s));
addr_dest = AREG(insn, 9);
tcg_gen_subi_i32(addr_dest, addr_dest, opsize);
tcg_gen_subi_i32(addr_dest, addr_dest, opsize_bytes(opsize));
dest = gen_load(s, opsize, addr_dest, 1, IS_USER(s));
gen_subx(s, src, dest, opsize);