Add the %sub/wr instruction.
This commit is contained in:
parent
68de9bf5d2
commit
dd56d9a17c
|
|
@ -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.56 2003/01/26 18:16:22 steve Exp $"
|
||||
#ident "$Id: codes.h,v 1.57 2003/02/06 17:41:47 steve Exp $"
|
||||
#endif
|
||||
|
||||
|
||||
|
|
@ -104,6 +104,7 @@ extern bool of_SET_X0(vthread_t thr, vvp_code_t code);
|
|||
extern bool of_SHIFTL_I0(vthread_t thr, vvp_code_t code);
|
||||
extern bool of_SHIFTR_I0(vthread_t thr, vvp_code_t code);
|
||||
extern bool of_SUB(vthread_t thr, vvp_code_t code);
|
||||
extern bool of_SUB_WR(vthread_t thr, vvp_code_t code);
|
||||
extern bool of_SUBI(vthread_t thr, vvp_code_t code);
|
||||
extern bool of_VPI_CALL(vthread_t thr, vvp_code_t code);
|
||||
extern bool of_WAIT(vthread_t thr, vvp_code_t code);
|
||||
|
|
@ -168,6 +169,9 @@ extern vvp_code_t codespace_index(vvp_cpoint_t ptr);
|
|||
|
||||
/*
|
||||
* $Log: codes.h,v $
|
||||
* Revision 1.57 2003/02/06 17:41:47 steve
|
||||
* Add the %sub/wr instruction.
|
||||
*
|
||||
* Revision 1.56 2003/01/26 18:16:22 steve
|
||||
* Add %cvt/ir and %cvt/ri instructions, and support
|
||||
* real values passed as arguments to VPI tasks.
|
||||
|
|
|
|||
|
|
@ -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.152 2003/02/03 01:09:20 steve Exp $"
|
||||
#ident "$Id: compile.cc,v 1.153 2003/02/06 17:41:47 steve Exp $"
|
||||
#endif
|
||||
|
||||
# include "arith.h"
|
||||
|
|
@ -149,6 +149,7 @@ const static struct opcode_table_s opcode_table[] = {
|
|||
{ "%shiftl/i0", of_SHIFTL_I0, 2, {OA_BIT1,OA_NUMBER, OA_NONE} },
|
||||
{ "%shiftr/i0", of_SHIFTR_I0, 2, {OA_BIT1,OA_NUMBER, OA_NONE} },
|
||||
{ "%sub", of_SUB, 3, {OA_BIT1, OA_BIT2, OA_NUMBER} },
|
||||
{ "%sub/wr", of_SUB_WR, 2, {OA_BIT1, OA_BIT2, OA_NONE} },
|
||||
{ "%subi", of_SUBI, 3, {OA_BIT1, OA_BIT2, OA_NUMBER} },
|
||||
{ "%wait", of_WAIT, 1, {OA_FUNC_PTR, OA_NONE, OA_NONE} },
|
||||
{ "%xnor", of_XNOR, 3, {OA_BIT1, OA_BIT2, OA_NUMBER} },
|
||||
|
|
@ -1519,6 +1520,9 @@ void compile_net(char*label, char*name, int msb, int lsb, bool signed_flag,
|
|||
|
||||
/*
|
||||
* $Log: compile.cc,v $
|
||||
* Revision 1.153 2003/02/06 17:41:47 steve
|
||||
* Add the %sub/wr instruction.
|
||||
*
|
||||
* Revision 1.152 2003/02/03 01:09:20 steve
|
||||
* Allow $display of $simtime.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* Copyright (c) 2001 Stephen Williams (steve@icarus.com)
|
||||
* Copyright (c) 2001-2003 Stephen Williams (steve@icarus.com)
|
||||
*
|
||||
* $Id: opcodes.txt,v 1.47 2003/01/26 18:16:22 steve Exp $
|
||||
* $Id: opcodes.txt,v 1.48 2003/02/06 17:41:47 steve Exp $
|
||||
*/
|
||||
|
||||
|
||||
|
|
@ -33,6 +33,12 @@ See also the %sub instruction.
|
|||
|
||||
* %add/wr <bit-l>, <bit-r>
|
||||
|
||||
This is the real valued version of hte %add instruction. The arguments
|
||||
are word indices of the operands. The right operand is added into the
|
||||
left operand.
|
||||
|
||||
See also the %sub/wr instruction.
|
||||
|
||||
|
||||
* %addi <bit-l>, <imm>, <wid>
|
||||
|
||||
|
|
@ -548,6 +554,14 @@ the <wid> of the left vector. The result replaces the left vector.
|
|||
|
||||
See also the %addi instruction.
|
||||
|
||||
|
||||
* %sub/wr <bit-l>, <bit-r>
|
||||
|
||||
This instruction operates on real values in word registers. The right
|
||||
indexed value is subtracted from the left indexed value, and the
|
||||
result placed in the left index.
|
||||
|
||||
|
||||
* %vpi_call <name> [, ...]
|
||||
|
||||
This instruction makes a call to a system task that was declared using
|
||||
|
|
@ -598,7 +612,7 @@ and leaves the result in the <dst> vector. xor is this:
|
|||
|
||||
|
||||
/*
|
||||
* Copyright (c) 2001 Stephen Williams (steve@icarus.com)
|
||||
* Copyright (c) 2001-2003 Stephen Williams (steve@icarus.com)
|
||||
*
|
||||
* This source code is free software; you can redistribute it
|
||||
* and/or modify it in source code form under the terms of the GNU
|
||||
|
|
|
|||
|
|
@ -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.99 2003/01/27 00:14:37 steve Exp $"
|
||||
#ident "$Id: vthread.cc,v 1.100 2003/02/06 17:41:47 steve Exp $"
|
||||
#endif
|
||||
|
||||
# include "vthread.h"
|
||||
|
|
@ -2417,6 +2417,14 @@ bool of_SUB(vthread_t thr, vvp_code_t cp)
|
|||
return true;
|
||||
}
|
||||
|
||||
bool of_SUB_WR(vthread_t thr, vvp_code_t cp)
|
||||
{
|
||||
double l = thr->words[cp->bit_idx[0]].w_real;
|
||||
double r = thr->words[cp->bit_idx[1]].w_real;
|
||||
thr->words[cp->bit_idx[0]].w_real = l - r;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool of_SUBI(vthread_t thr, vvp_code_t cp)
|
||||
{
|
||||
assert(cp->bit_idx[0] >= 4);
|
||||
|
|
@ -2608,6 +2616,9 @@ bool of_CALL_UFUNC(vthread_t thr, vvp_code_t cp)
|
|||
|
||||
/*
|
||||
* $Log: vthread.cc,v $
|
||||
* Revision 1.100 2003/02/06 17:41:47 steve
|
||||
* Add the %sub/wr instruction.
|
||||
*
|
||||
* Revision 1.99 2003/01/27 00:14:37 steve
|
||||
* Support in various contexts the $realtime
|
||||
* system task.
|
||||
|
|
|
|||
Loading…
Reference in New Issue