From f366d8836695f62100f56335b119c42b0b0c0bf0 Mon Sep 17 00:00:00 2001 From: Jason Wright Date: Sun, 13 Jul 2003 07:00:49 +0000 Subject: whoa, gcc wasn't at fault: i_loadstore was missing 5 bits, which was causing the decode to be wrong. --- sys/arch/sparc64/include/instr.h | 3 ++- sys/arch/sparc64/sparc64/emul.c | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/sys/arch/sparc64/include/instr.h b/sys/arch/sparc64/include/instr.h index 7fa30d255f8..6c85fcd25ef 100644 --- a/sys/arch/sparc64/include/instr.h +++ b/sys/arch/sparc64/include/instr.h @@ -1,4 +1,4 @@ -/* $OpenBSD: instr.h,v 1.6 2003/07/10 12:01:41 jason Exp $ */ +/* $OpenBSD: instr.h,v 1.7 2003/07/13 07:00:48 jason Exp $ */ /* $NetBSD: instr.h,v 1.3 2000/01/10 03:53:20 eeh Exp $ */ /* @@ -244,6 +244,7 @@ union instr { u_int :2; /* 11 only */ u_int i_rd:5; /* destination register */ u_int i_op3:6; /* second-level decode (see IOP3_mem) */ + u_int i_rs1:5; /* source register 1 */ u_int i_i:1; /* immediate vs asi */ u_int i_low13:13; /* depend on i bit */ } i_loadstore; diff --git a/sys/arch/sparc64/sparc64/emul.c b/sys/arch/sparc64/sparc64/emul.c index 9d5f8a8cd4e..3d558c1ae7e 100644 --- a/sys/arch/sparc64/sparc64/emul.c +++ b/sys/arch/sparc64/sparc64/emul.c @@ -1,4 +1,4 @@ -/* $OpenBSD: emul.c,v 1.9 2003/07/13 06:30:45 jason Exp $ */ +/* $OpenBSD: emul.c,v 1.10 2003/07/13 07:00:47 jason Exp $ */ /* $NetBSD: emul.c,v 1.8 2001/06/29 23:58:40 eeh Exp $ */ /*- @@ -496,13 +496,13 @@ emul_qf(int32_t insv, struct proc *p, union sigval sv, struct trapframe *tf) if (ins.i_op3.i_op3 == IOP3_STQF || ins.i_op3.i_op3 == IOP3_LDQF) asi = ASI_PRIMARY; - else if (ins.i_int & 0x2000) + else if (ins.i_loadstore.i_i) asi = (tf->tf_tstate & TSTATE_ASI) >> TSTATE_ASI_SHIFT; else asi = ins.i_asi.i_asi; addr = tf->tf_global[ins.i_asi.i_rs1]; - if (ins.i_int & 0x2000) + if (ins.i_loadstore.i_i) addr += SIGN_EXT13(ins.i_simm13.i_simm13); else addr += tf->tf_global[ins.i_asi.i_rs2]; -- cgit v1.2.3