From 75df8fb6bb438092b8bbdfd9004bf358fc30890e Mon Sep 17 00:00:00 2001 From: Stephen Williams Date: Wed, 27 Feb 2008 17:01:53 -0800 Subject: [PATCH] Remove index register restrictions on ix/arith instructions. The %ix/ instructions are currently not in use, but even so it is just plain wrong to restrict their register argument to 0-3. --- vvp/opcodes.txt | 3 +-- vvp/vthread.cc | 6 +++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/vvp/opcodes.txt b/vvp/opcodes.txt index b6b6a4c90..f8275e9a8 100644 --- a/vvp/opcodes.txt +++ b/vvp/opcodes.txt @@ -353,8 +353,7 @@ thread bit vector. This instruction adds, subtracts, or multiplies an immediate value to the addressed index register. The index register holds numeric values, -so the is a number. The value selects the index register, -and may be 0, 1, 2 or 3. +so the is a number. The value selects the index register. * %jmp diff --git a/vvp/vthread.cc b/vvp/vthread.cc index d8bde41d0..5915a71bf 100644 --- a/vvp/vthread.cc +++ b/vvp/vthread.cc @@ -1840,19 +1840,19 @@ bool of_INV(vthread_t thr, vvp_code_t cp) bool of_IX_ADD(vthread_t thr, vvp_code_t cp) { - thr->words[cp->bit_idx[0] & 3].w_int += cp->number; + thr->words[cp->bit_idx[0]].w_int += cp->number; return true; } bool of_IX_SUB(vthread_t thr, vvp_code_t cp) { - thr->words[cp->bit_idx[0] & 3].w_int -= cp->number; + thr->words[cp->bit_idx[0]].w_int -= cp->number; return true; } bool of_IX_MUL(vthread_t thr, vvp_code_t cp) { - thr->words[cp->bit_idx[0] & 3].w_int *= cp->number; + thr->words[cp->bit_idx[0]].w_int *= cp->number; return true; }