diff --git a/vvp/opcodes.txt b/vvp/opcodes.txt index b8d5dfe5d..981eae565 100644 --- a/vvp/opcodes.txt +++ b/vvp/opcodes.txt @@ -39,19 +39,11 @@ flags. These are used as destinations for operations that return boolean values, for example comparisons. They are also used as inputs for test and branch opcodes. -* %abs/wr , +* %abs/wr This instruction calculates the absolute value of a real value. It uses -the fabs() function in the run-time to do the work. - -* %add , , (XXXX Old version) - -This instruction adds the right vector into the left vector, the -vectors having the width . If any of the bits of either vector -are x or z, the result is x. Otherwise, the result is the arithmetic -sum. - -See also the %sub instruction. +the fabs() function in the run-time to do the work, and manipulates +the top of the real-value stack. * %add * %addi , , @@ -65,7 +57,7 @@ immediate value (See %pushi/vec4). See also the %sub instruction. -* %add/wr , +* %add/wr This is the real valued version of the %add instruction. The arguments are popped from the stack, right operand then left, and the result @@ -492,6 +484,10 @@ the format of the output is: is a string, if string is 0 then the following default message is used: "Procedural tracing.". +* %flag_inv + +This instruct inverts a flag bit. + * %flag_mov , This instruction copies the flag bit from to . diff --git a/vvp/vthread.cc b/vvp/vthread.cc index e1ef90a70..6f80ea15c 100644 --- a/vvp/vthread.cc +++ b/vvp/vthread.cc @@ -726,6 +726,9 @@ vvp_context_item_t vthread_get_rd_context_item(unsigned context_idx) return vvp_get_context_item(running_thread->rd_context, context_idx); } +/* + * %abs/wr + */ bool of_ABS_WR(vthread_t thr, vvp_code_t) { thr->push_real( fabs(thr->pop_real()) ); @@ -849,6 +852,9 @@ bool of_ADDI(vthread_t thr, vvp_code_t cp) return true; } +/* + * %add/wr + */ bool of_ADD_WR(vthread_t thr, vvp_code_t) { double r = thr->pop_real();