remove OP_MINUS
This commit is contained in:
parent
a6dbf0067b
commit
b01042505f
|
@ -971,7 +971,6 @@ codegen_call_vm(pic_state *pic, codegen_context *cxt, pic_value proc, size_t len
|
|||
VM(pic->uNILP, OP_NILP)
|
||||
VM(pic->uSYMBOLP, OP_SYMBOLP)
|
||||
VM(pic->uPAIRP, OP_PAIRP)
|
||||
VM(pic->uSUB, OP_MINUS)
|
||||
VM(pic->uNOT, OP_NOT)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -42,7 +42,6 @@ enum pic_opcode {
|
|||
OP_SUB,
|
||||
OP_MUL,
|
||||
OP_DIV,
|
||||
OP_MINUS,
|
||||
OP_EQ,
|
||||
OP_LT,
|
||||
OP_LE,
|
||||
|
@ -185,9 +184,6 @@ pic_dump_code(pic_code c)
|
|||
case OP_DIV:
|
||||
puts("OP_DIV");
|
||||
break;
|
||||
case OP_MINUS:
|
||||
puts("OP_MINUS");
|
||||
break;
|
||||
case OP_EQ:
|
||||
puts("OP_EQ");
|
||||
break;
|
||||
|
|
|
@ -552,7 +552,7 @@ pic_apply(pic_state *pic, struct pic_proc *proc, pic_value args)
|
|||
&&L_OP_JMP, &&L_OP_JMPIF, &&L_OP_NOT, &&L_OP_CALL, &&L_OP_TAILCALL, &&L_OP_RET,
|
||||
&&L_OP_LAMBDA, &&L_OP_CONS, &&L_OP_CAR, &&L_OP_CDR, &&L_OP_NILP,
|
||||
&&L_OP_SYMBOLP, &&L_OP_PAIRP,
|
||||
&&L_OP_ADD, &&L_OP_SUB, &&L_OP_MUL, &&L_OP_DIV, &&L_OP_MINUS,
|
||||
&&L_OP_ADD, &&L_OP_SUB, &&L_OP_MUL, &&L_OP_DIV,
|
||||
&&L_OP_EQ, &&L_OP_LT, &&L_OP_LE, &&L_OP_STOP
|
||||
};
|
||||
#endif
|
||||
|
@ -978,24 +978,6 @@ pic_apply(pic_state *pic, struct pic_proc *proc, pic_value args)
|
|||
DEFINE_ARITH_OP2(OP_DIV, /);
|
||||
#endif
|
||||
|
||||
CASE(OP_MINUS) {
|
||||
pic_value n;
|
||||
n = POP();
|
||||
(void)POP();
|
||||
if (pic_int_p(n)) {
|
||||
PUSH(pic_int_value(-pic_int(n)));
|
||||
}
|
||||
#if PIC_ENABLE_FLOAT
|
||||
else if (pic_float_p(n)) {
|
||||
PUSH(pic_float_value(-pic_float(n)));
|
||||
}
|
||||
#endif
|
||||
else {
|
||||
pic_errorf(pic, "unary - got a non-number operand");
|
||||
}
|
||||
NEXT;
|
||||
}
|
||||
|
||||
#define DEFINE_COMP_OP(opcode, op) \
|
||||
CASE(opcode) { \
|
||||
pic_value a, b; \
|
||||
|
|
Loading…
Reference in New Issue