Add the mov/wr opcode.

This commit is contained in:
steve 2007-02-14 05:58:14 +00:00
parent 0137832003
commit 4f74d9df98
4 changed files with 28 additions and 4 deletions

View File

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/ */
#ifdef HAVE_CVS_IDENT #ifdef HAVE_CVS_IDENT
#ident "$Id: codes.h,v 1.81 2007/01/16 05:44:16 steve Exp $" #ident "$Id: codes.h,v 1.82 2007/02/14 05:58:14 steve Exp $"
#endif #endif
@ -100,6 +100,7 @@ extern bool of_MOD(vthread_t thr, vvp_code_t code);
extern bool of_MOD_S(vthread_t thr, vvp_code_t code); extern bool of_MOD_S(vthread_t thr, vvp_code_t code);
extern bool of_MOD_WR(vthread_t thr, vvp_code_t code); extern bool of_MOD_WR(vthread_t thr, vvp_code_t code);
extern bool of_MOV(vthread_t thr, vvp_code_t code); extern bool of_MOV(vthread_t thr, vvp_code_t code);
extern bool of_MOV_WR(vthread_t thr, vvp_code_t code);
extern bool of_MUL(vthread_t thr, vvp_code_t code); extern bool of_MUL(vthread_t thr, vvp_code_t code);
extern bool of_MUL_WR(vthread_t thr, vvp_code_t code); extern bool of_MUL_WR(vthread_t thr, vvp_code_t code);
extern bool of_MULI(vthread_t thr, vvp_code_t code); extern bool of_MULI(vthread_t thr, vvp_code_t code);
@ -184,6 +185,9 @@ extern vvp_code_t codespace_null(void);
/* /*
* $Log: codes.h,v $ * $Log: codes.h,v $
* Revision 1.82 2007/02/14 05:58:14 steve
* Add the mov/wr opcode.
*
* Revision 1.81 2007/01/16 05:44:16 steve * Revision 1.81 2007/01/16 05:44:16 steve
* Major rework of array handling. Memories are replaced with the * Major rework of array handling. Memories are replaced with the
* more general concept of arrays. The NetMemory and NetEMemory * more general concept of arrays. The NetMemory and NetEMemory

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/ */
#ifdef HAVE_CVS_IDENT #ifdef HAVE_CVS_IDENT
#ident "$Id: compile.cc,v 1.227 2007/01/16 05:44:16 steve Exp $" #ident "$Id: compile.cc,v 1.228 2007/02/14 05:58:14 steve Exp $"
#endif #endif
# include "arith.h" # include "arith.h"
@ -145,6 +145,7 @@ const static struct opcode_table_s opcode_table[] = {
{ "%mod/s", of_MOD_S, 3, {OA_BIT1, OA_BIT2, OA_NUMBER} }, { "%mod/s", of_MOD_S, 3, {OA_BIT1, OA_BIT2, OA_NUMBER} },
{ "%mod/wr", of_MOD_WR, 2, {OA_BIT1, OA_BIT2, OA_NONE} }, { "%mod/wr", of_MOD_WR, 2, {OA_BIT1, OA_BIT2, OA_NONE} },
{ "%mov", of_MOV, 3, {OA_BIT1, OA_BIT2, OA_NUMBER} }, { "%mov", of_MOV, 3, {OA_BIT1, OA_BIT2, OA_NUMBER} },
{ "%mov/wr", of_MOV_WR, 2, {OA_BIT1, OA_BIT2, OA_NONE} },
{ "%mul", of_MUL, 3, {OA_BIT1, OA_BIT2, OA_NUMBER} }, { "%mul", of_MUL, 3, {OA_BIT1, OA_BIT2, OA_NUMBER} },
{ "%mul/wr", of_MUL_WR, 2, {OA_BIT1, OA_BIT2, OA_NONE} }, { "%mul/wr", of_MUL_WR, 2, {OA_BIT1, OA_BIT2, OA_NONE} },
{ "%muli", of_MULI, 3, {OA_BIT1, OA_BIT2, OA_NUMBER} }, { "%muli", of_MULI, 3, {OA_BIT1, OA_BIT2, OA_NUMBER} },
@ -1579,6 +1580,9 @@ void compile_param_string(char*label, char*name, char*value)
/* /*
* $Log: compile.cc,v $ * $Log: compile.cc,v $
* Revision 1.228 2007/02/14 05:58:14 steve
* Add the mov/wr opcode.
*
* Revision 1.227 2007/01/16 05:44:16 steve * Revision 1.227 2007/01/16 05:44:16 steve
* Major rework of array handling. Memories are replaced with the * Major rework of array handling. Memories are replaced with the
* more general concept of arrays. The NetMemory and NetEMemory * more general concept of arrays. The NetMemory and NetEMemory

View File

@ -1,7 +1,7 @@
/* /*
* Copyright (c) 2001-2003 Stephen Williams (steve@icarus.com) * Copyright (c) 2001-2003 Stephen Williams (steve@icarus.com)
* *
* $Id: opcodes.txt,v 1.73 2007/01/16 05:44:16 steve Exp $ * $Id: opcodes.txt,v 1.74 2007/02/14 05:58:14 steve Exp $
*/ */
@ -443,6 +443,7 @@ The /s form does signed %.
This opcode is the real-valued modulus of the two real values. This opcode is the real-valued modulus of the two real values.
* %mov <dst>, <src>, <wid> * %mov <dst>, <src>, <wid>
* %mov/wr <dst>, <src>
This instruction copies a vector from one place in register space to This instruction copies a vector from one place in register space to
another. The destination and source vectors are assumed to be the same another. The destination and source vectors are assumed to be the same

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/ */
#ifdef HAVE_CVS_IDENT #ifdef HAVE_CVS_IDENT
#ident "$Id: vthread.cc,v 1.160 2007/02/05 01:08:10 steve Exp $" #ident "$Id: vthread.cc,v 1.161 2007/02/14 05:58:14 steve Exp $"
#endif #endif
# include "config.h" # include "config.h"
@ -2429,6 +2429,18 @@ bool of_MOV(vthread_t thr, vvp_code_t cp)
return true; return true;
} }
/*
* %mov/wr <dst>, <src>
*/
bool of_MOV_WR(vthread_t thr, vvp_code_t cp)
{
unsigned dst = cp->bit_idx[0];
unsigned src = cp->bit_idx[1];
thr->words[dst].w_real = thr->words[src].w_real;
return true;
}
bool of_MUL(vthread_t thr, vvp_code_t cp) bool of_MUL(vthread_t thr, vvp_code_t cp)
{ {
assert(cp->bit_idx[0] >= 4); assert(cp->bit_idx[0] >= 4);
@ -3391,6 +3403,9 @@ bool of_JOIN_UFUNC(vthread_t thr, vvp_code_t cp)
/* /*
* $Log: vthread.cc,v $ * $Log: vthread.cc,v $
* Revision 1.161 2007/02/14 05:58:14 steve
* Add the mov/wr opcode.
*
* Revision 1.160 2007/02/05 01:08:10 steve * Revision 1.160 2007/02/05 01:08:10 steve
* Handle relink of continuous assignment. * Handle relink of continuous assignment.
* *