vvp: Remove unused `%cmp/ws` and `%cmp/wu` instructions
The `%cmp/ws` and `%cmp/wu` instructions compare two index registers. They are currently unused. Since the index registers are not used for data there is not really a need to compare them. Values can be compared before loading them into an index register. So remove these two instructions. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
This commit is contained in:
parent
781089662c
commit
86cc6e6159
|
|
@ -129,8 +129,6 @@ static const struct opcode_table_s opcode_table[] = {
|
|||
{ "%cmp/we", of_CMPWE, 0, {OA_NONE, OA_NONE, OA_NONE} },
|
||||
{ "%cmp/wne", of_CMPWNE, 0, {OA_NONE, OA_NONE, OA_NONE} },
|
||||
{ "%cmp/wr", of_CMPWR, 0, {OA_NONE, OA_NONE, OA_NONE} },
|
||||
{ "%cmp/ws", of_CMPWS, 2, {OA_BIT1, OA_BIT2, OA_NONE} },
|
||||
{ "%cmp/wu", of_CMPWU, 2, {OA_BIT1, OA_BIT2, OA_NONE} },
|
||||
{ "%cmp/x", of_CMPX, 0, {OA_NONE, OA_NONE, OA_NONE} },
|
||||
{ "%cmp/z", of_CMPZ, 0, {OA_NONE, OA_NONE, OA_NONE} },
|
||||
{ "%cmpi/e", of_CMPIE, 3, {OA_BIT1, OA_BIT2, OA_NUMBER} },
|
||||
|
|
|
|||
|
|
@ -341,11 +341,6 @@ values from the real-value stack and writes the comparison result to
|
|||
bits 4/5. The expressions (a < b) and (a==b) are calculated, with (b)
|
||||
popped from the stack first, then (a).
|
||||
|
||||
* %cmp/ws <bit-l>, <bit-r>
|
||||
* %cmp/wu <bit-l>, <bit-r>
|
||||
|
||||
[compare signed/unsigned integer words.]
|
||||
|
||||
* %cmp/z
|
||||
* %cmp/x
|
||||
|
||||
|
|
|
|||
|
|
@ -2245,34 +2245,6 @@ bool of_CMPWR(vthread_t thr, vvp_code_t)
|
|||
return true;
|
||||
}
|
||||
|
||||
bool of_CMPWS(vthread_t thr, vvp_code_t cp)
|
||||
{
|
||||
int64_t l = thr->words[cp->bit_idx[0]].w_int;
|
||||
int64_t r = thr->words[cp->bit_idx[1]].w_int;
|
||||
|
||||
vvp_bit4_t eq = (l == r)? BIT4_1 : BIT4_0;
|
||||
vvp_bit4_t lt = (l < r)? BIT4_1 : BIT4_0;
|
||||
|
||||
thr->flags[4] = eq;
|
||||
thr->flags[5] = lt;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool of_CMPWU(vthread_t thr, vvp_code_t cp)
|
||||
{
|
||||
uint64_t l = thr->words[cp->bit_idx[0]].w_uint;
|
||||
uint64_t r = thr->words[cp->bit_idx[1]].w_uint;
|
||||
|
||||
vvp_bit4_t eq = (l == r)? BIT4_1 : BIT4_0;
|
||||
vvp_bit4_t lt = (l < r)? BIT4_1 : BIT4_0;
|
||||
|
||||
thr->flags[4] = eq;
|
||||
thr->flags[5] = lt;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
* %cmp/z
|
||||
*/
|
||||
|
|
|
|||
Loading…
Reference in New Issue