diff --git a/vvp/codes.h b/vvp/codes.h index 0b79f7035..0428cb634 100644 --- a/vvp/codes.h +++ b/vvp/codes.h @@ -19,7 +19,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #ifdef HAVE_CVS_IDENT -#ident "$Id: codes.h,v 1.75 2005/09/14 02:50:07 steve Exp $" +#ident "$Id: codes.h,v 1.76 2005/09/17 04:01:01 steve Exp $" #endif @@ -91,6 +91,7 @@ extern bool of_LOAD_NX(vthread_t thr, vvp_code_t code); extern bool of_LOAD_VEC(vthread_t thr, vvp_code_t code); extern bool of_LOAD_WR(vthread_t thr, vvp_code_t code); extern bool of_LOAD_X(vthread_t thr, vvp_code_t code); +extern bool of_LOAD_XP(vthread_t thr, vvp_code_t code); extern bool of_LOADI_WR(vthread_t thr, vvp_code_t code); extern bool of_MOD(vthread_t thr, vvp_code_t code); extern bool of_MOD_S(vthread_t thr, vvp_code_t code); @@ -177,6 +178,9 @@ extern vvp_code_t codespace_null(void); /* * $Log: codes.h,v $ + * Revision 1.76 2005/09/17 04:01:01 steve + * Add the load/v.p instruction. + * * Revision 1.75 2005/09/14 02:50:07 steve * Add word integer compares. * diff --git a/vvp/compile.cc b/vvp/compile.cc index 9e12e3d1d..747a75df6 100644 --- a/vvp/compile.cc +++ b/vvp/compile.cc @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #ifdef HAVE_CVS_IDENT -#ident "$Id: compile.cc,v 1.211 2005/09/14 02:50:07 steve Exp $" +#ident "$Id: compile.cc,v 1.212 2005/09/17 04:01:01 steve Exp $" #endif # include "arith.h" @@ -135,6 +135,7 @@ const static struct opcode_table_s opcode_table[] = { { "%load/v", of_LOAD_VEC,3, {OA_BIT1, OA_FUNC_PTR, OA_BIT2} }, { "%load/wr",of_LOAD_WR,2, {OA_BIT1, OA_VPI_PTR, OA_BIT2} }, { "%load/x", of_LOAD_X, 3, {OA_BIT1, OA_FUNC_PTR, OA_BIT2} }, + { "%load/x.p",of_LOAD_XP, 3,{OA_BIT1, OA_FUNC_PTR, OA_BIT2} }, { "%loadi/wr",of_LOADI_WR,3,{OA_BIT1, OA_NUMBER, OA_BIT2} }, { "%mod", of_MOD, 3, {OA_BIT1, OA_BIT2, OA_NUMBER} }, { "%mod/s", of_MOD_S, 3, {OA_BIT1, OA_BIT2, OA_NUMBER} }, @@ -1480,6 +1481,9 @@ void compile_param_string(char*label, char*name, char*str, char*value) /* * $Log: compile.cc,v $ + * Revision 1.212 2005/09/17 04:01:01 steve + * Add the load/v.p instruction. + * * Revision 1.211 2005/09/14 02:50:07 steve * Add word integer compares. * diff --git a/vvp/opcodes.txt b/vvp/opcodes.txt index 0333fb044..a93334a81 100644 --- a/vvp/opcodes.txt +++ b/vvp/opcodes.txt @@ -1,7 +1,7 @@ /* * Copyright (c) 2001-2003 Stephen Williams (steve@icarus.com) * - * $Id: opcodes.txt,v 1.66 2005/09/14 02:50:07 steve Exp $ + * $Id: opcodes.txt,v 1.67 2005/09/17 04:01:02 steve Exp $ */ @@ -390,6 +390,7 @@ This instruction reads a real value from the vpi-like object to a word register. * %load/x , , +* %load/x.p , , This is an indexed load. It uses the contents of the specified index register to select a bit from a vectur functor at . The @@ -397,6 +398,9 @@ bit is pulled from the indexed bit of the addressed functor and loaded into the destination thread bit. If the indexed value is beyond the width of the vector, then the result is X. +The %load/x.p is the same, but when the operation is done, it +increments the specified index register. This provides a basic +auto-increment feature. * %loadi/wr , , diff --git a/vvp/vthread.cc b/vvp/vthread.cc index 716f1e0e1..131e94b5f 100644 --- a/vvp/vthread.cc +++ b/vvp/vthread.cc @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #ifdef HAVE_CVS_IDENT -#ident "$Id: vthread.cc,v 1.146 2005/09/14 02:50:07 steve Exp $" +#ident "$Id: vthread.cc,v 1.147 2005/09/17 04:01:02 steve Exp $" #endif # include "config.h" @@ -1941,6 +1941,18 @@ bool of_LOAD_X(vthread_t thr, vvp_code_t cp) return true; } +bool of_LOAD_XP(vthread_t thr, vvp_code_t cp) +{ + // First do the normal handling of the %load/x + of_LOAD_X(thr, cp); + + // Now do the post-increment + unsigned index_idx = cp->bit_idx[1]; + thr->words[index_idx].w_int += 1; + + return true; +} + bool of_LOADI_WR(vthread_t thr, vvp_code_t cp) { unsigned idx = cp->bit_idx[0]; @@ -3175,6 +3187,9 @@ bool of_JOIN_UFUNC(vthread_t thr, vvp_code_t cp) /* * $Log: vthread.cc,v $ + * Revision 1.147 2005/09/17 04:01:02 steve + * Add the load/v.p instruction. + * * Revision 1.146 2005/09/14 02:50:07 steve * Add word integer compares. *