blob: bd0c10047c3759f0ac811dc67df94323772a680c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
// Copyright (c) 2025 taitep
// SPDX-License-Identifier: BSD-2-Clause
//
// This file is part of TRVE (https://gitea.taitep.se/taitep/trve)
// See LICENSE file in the project root for full license text.
//
use crate::{core::Core, decode::Instruction, exceptions::Exception};
// multiplication
instr_op_r!(mul, u64::wrapping_mul);
// division
instr_op_r!(div, |a, b| match b {
0 => -1,
_ => i64::wrapping_div(a as i64, b as i64),
} as u64);
|