From e598f74891592a67d31985182af24243a2e6ccd5 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Sun, 14 Feb 2021 10:14:39 -0800 Subject: vm/asm: housecleaning: remove deprecated opcodes. Since we have are breaking binary compatibility in the upcoming TXR 252, we might as well take the opportunity to remove deprecated opcodes that the compiler doesn't use. * share/txr/stdlib/asm.tl (op-fin): Opcode removed. (op-pprof): Derive directly from op-end rather than op-fin. (op-movrsi, op-movsmi, op-movrbi, op-movi-pseudo): Opcodes removed. * vm.c (vm_fin, vm_movrsi, vm_movsmi, vm_movrbi): Functions removed. (vm_execute): FIN, MOVRSI, MOVSMI, MOVRBI cases removed. * vmop.h: Regenerated. (vm_op_t): Enum members FIN, MOVRSI, MOVSMI, MOVRBI removed. --- vm.c | 53 ----------------------------------------------------- 1 file changed, 53 deletions(-) (limited to 'vm.c') diff --git a/vm.c b/vm.c index 85db9fa7..3fc03d68 100644 --- a/vm.c +++ b/vm.c @@ -458,12 +458,6 @@ NOINLINE static val vm_end(struct vm *vm, vm_word_t insn) return vm_get(vm->dspl, vm_insn_operand(insn)); } -NOINLINE static val vm_fin(struct vm *vm, vm_word_t insn) -{ - vm->ip--; - return vm_get(vm->dspl, vm_insn_operand(insn)); -} - NOINLINE static void vm_call(struct vm *vm, vm_word_t insn) { unsigned nargs = vm_insn_extra(insn); @@ -674,42 +668,6 @@ NOINLINE static void vm_movrr(struct vm *vm, vm_word_t insn) vm_set(vm->dspl, vm_insn_operand(insn), datum); } -NOINLINE static void vm_movrsi(struct vm *vm, vm_word_t insn) -{ - unsigned dst = vm_insn_operand(insn); - ucnum negmask = ~convert(ucnum, 0x3FF); - ucnum imm = vm_insn_extra(insn); - - if ((imm & TAG_MASK) == NUM && (imm & 0x200)) - imm |= negmask; - - vm_set(vm->dspl, dst, coerce(val, imm)); -} - -NOINLINE static void vm_movsmi(struct vm *vm, vm_word_t insn) -{ - unsigned dst = vm_insn_extra(insn); - ucnum negmask = ~convert(ucnum, 0xFFFF); - ucnum imm = vm_insn_operand(insn); - - if ((imm & TAG_MASK) == NUM && (imm & 0x8000)) - imm |= negmask; - - vm_sm_set(vm->dspl, dst, coerce(val, imm)); -} - -NOINLINE static void vm_movrbi(struct vm *vm, vm_word_t insn) -{ - unsigned dst = vm_insn_operand(insn); - ucnum negmask = ~convert(ucnum, 0xFFFFFFFF); - ucnum imm = vm->code[vm->ip++]; - - if ((imm & TAG_MASK) == NUM && (imm & 0x80000000)) - imm |= negmask; - - vm_set(vm->dspl, dst, coerce(val, imm)); -} - static void vm_jmp(struct vm *vm, vm_word_t insn) { vm->ip = vm_insn_bigop(insn); @@ -1004,8 +962,6 @@ NOINLINE static val vm_execute(struct vm *vm) break; case END: return vm_end(vm, insn); - case FIN: - return vm_fin(vm, insn); case PROF: vm_prof(vm, insn); break; @@ -1030,15 +986,6 @@ NOINLINE static val vm_execute(struct vm *vm) case MOVRR: vm_movrr(vm, insn); break; - case MOVRSI: - vm_movrsi(vm, insn); - break; - case MOVSMI: - vm_movsmi(vm, insn); - break; - case MOVRBI: - vm_movrbi(vm, insn); - break; case JMP: vm_jmp(vm, insn); break; -- cgit v1.2.3