From 4f74d9df984bbbc456ae690b492bc4b8c21e34f8 Mon Sep 17 00:00:00 2001 From: steve Date: Wed, 14 Feb 2007 05:58:14 +0000 Subject: [PATCH] Add the mov/wr opcode. --- vvp/codes.h | 6 +++++- vvp/compile.cc | 6 +++++- vvp/opcodes.txt | 3 ++- vvp/vthread.cc | 17 ++++++++++++++++- 4 files changed, 28 insertions(+), 4 deletions(-) diff --git a/vvp/codes.h b/vvp/codes.h index 8025f72fb..cee56afb0 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.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 @@ -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_WR(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_WR(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 $ + * 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 * Major rework of array handling. Memories are replaced with the * more general concept of arrays. The NetMemory and NetEMemory diff --git a/vvp/compile.cc b/vvp/compile.cc index 3eebd28d8..ef4b91f55 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.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 # 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/wr", of_MOD_WR, 2, {OA_BIT1, OA_BIT2, OA_NONE} }, { "%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/wr", of_MUL_WR, 2, {OA_BIT1, OA_BIT2, OA_NONE} }, { "%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 $ + * 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 * Major rework of array handling. Memories are replaced with the * more general concept of arrays. The NetMemory and NetEMemory diff --git a/vvp/opcodes.txt b/vvp/opcodes.txt index 1fc8945e1..c1a802875 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.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. * %mov , , +* %mov/wr , This instruction copies a vector from one place in register space to another. The destination and source vectors are assumed to be the same diff --git a/vvp/vthread.cc b/vvp/vthread.cc index 49b7dec10..a717f32fb 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.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 # include "config.h" @@ -2429,6 +2429,18 @@ bool of_MOV(vthread_t thr, vvp_code_t cp) return true; } +/* +* %mov/wr , +*/ +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) { 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 $ + * 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 * Handle relink of continuous assignment. *