From 0f013a582e89a540c1e72da11d346f599caa3d44 Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Wed, 4 May 2016 15:59:08 -0700 Subject: [PATCH] alpha: Fix iteration count for MINSW4, MINUW4, MAXUW4, MAXSW4 instructions Also properly type the return value for pal_eval_instr() and the arguments to vax_sqrt() and ieee_sqrt(). --- alpha/alpha_cpu.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/alpha/alpha_cpu.c b/alpha/alpha_cpu.c index 7c63dd1b..7d91d9b3 100644 --- a/alpha/alpha_cpu.c +++ b/alpha/alpha_cpu.c @@ -211,8 +211,8 @@ extern t_uint64 op_lds (t_uint64 op); extern t_uint64 op_stf (t_uint64 op); extern t_uint64 op_stg (t_uint64 op); extern t_uint64 op_sts (t_uint64 op); -extern t_uint64 vax_sqrt (uint32 ir, t_bool dp); -extern t_uint64 ieee_sqrt (uint32 ir, t_bool dp); +extern t_uint64 vax_sqrt (uint32 ir, uint32 dp); +extern t_uint64 ieee_sqrt (uint32 ir, uint32 dp); extern void vax_fop (uint32 ir); extern void ieee_fop (uint32 ir); extern t_stat pal_19 (uint32 ir); @@ -222,7 +222,7 @@ extern t_stat pal_1e (uint32 ir); extern t_stat pal_1f (uint32 ir); extern t_uint64 trans_c (t_uint64 va); extern t_stat cpu_show_tlb (FILE *of, UNIT *uptr, int32 val, void *desc); -extern t_stat pal_eval_intr (uint32 flag); +extern uint32 pal_eval_intr (uint32 flag); extern t_stat pal_proc_excp (uint32 type); extern t_stat pal_proc_trap (uint32 type); extern t_stat pal_proc_intr (uint32 type); @@ -1433,7 +1433,7 @@ while (reason == 0) { case 0x39: /* MINSW4 */ if (!(arch_mask & AMASK_MVI)) ABORT (EXC_RSVI); - for (i = 0, res = 0; i < 8; i++) { + for (i = 0, res = 0; i < 4; i++) { s1 = SEXT_W_Q (R[ra] >> (i << 4)); s2 = SEXT_W_Q (rbv >> (i << 4)); res = res | (((s1 <= s2)? R[ra]: rbv) & word_mask[i]); @@ -1451,7 +1451,7 @@ while (reason == 0) { case 0x3B: /* MINUW4 */ if (!(arch_mask & AMASK_MVI)) ABORT (EXC_RSVI); - for (i = 0, res = 0; i < 8; i++) { + for (i = 0, res = 0; i < 4; i++) { s64 = R[ra] & word_mask[i]; t64 = rbv & word_mask[i]; res = res | ((s64 <= t64)? s64: t64); @@ -1469,7 +1469,7 @@ while (reason == 0) { case 0x3D: /* MAXUW4 */ if (!(arch_mask & AMASK_MVI)) ABORT (EXC_RSVI); - for (i = 0, res = 0; i < 8; i++) { + for (i = 0, res = 0; i < 4; i++) { s64 = R[ra] & word_mask[i]; t64 = rbv & word_mask[i]; res = res | ((s64 >= t64)? s64: t64); @@ -1487,7 +1487,7 @@ while (reason == 0) { case 0x3F: /* MAXSW4 */ if (!(arch_mask & AMASK_MVI)) ABORT (EXC_RSVI); - for (i = 0, res = 0; i < 8; i++) { + for (i = 0, res = 0; i < 4; i++) { s1 = SEXT_W_Q (R[ra] >> (i << 4)); s2 = SEXT_W_Q (rbv >> (i << 4)); res = res | (((s1 >= s2)? R[ra]: rbv) & word_mask[i]);