use super::{
wideint::{
CompareArgs,
DivArgs,
MathArgs,
MulArgs,
},
CheckRegId,
GMArgs,
GTFArgs,
Imm12,
Imm18,
Instruction,
RegId,
};
#[doc(inline)]
pub use super::_op::*;
#[cfg_attr(feature = "typescript", wasm_bindgen::prelude::wasm_bindgen)]
impl GM {
pub fn from_args(ra: RegId, args: GMArgs) -> Self {
Self::new(ra, Imm18::new(args as _))
}
}
#[cfg_attr(feature = "typescript", wasm_bindgen::prelude::wasm_bindgen)]
impl GTF {
pub fn from_args(ra: RegId, rb: RegId, args: GTFArgs) -> Self {
Self::new(ra, rb, Imm12::new(args as _))
}
}
pub fn gm_args<A: CheckRegId>(ra: A, args: GMArgs) -> Instruction {
Instruction::GM(GM::from_args(ra.check(), args))
}
#[cfg(feature = "typescript")]
const _: () = {
use super::*;
#[wasm_bindgen::prelude::wasm_bindgen]
pub fn gm_args(ra: u8, args: GMArgs) -> typescript::Instruction {
Instruction::GM(GM::from_args(ra.check(), args)).into()
}
};
pub fn gtf_args<A: CheckRegId, B: CheckRegId>(
ra: A,
rb: B,
args: GTFArgs,
) -> Instruction {
Instruction::GTF(GTF::from_args(ra.check(), rb.check(), args))
}
#[cfg(feature = "typescript")]
const _: () = {
use super::*;
#[wasm_bindgen::prelude::wasm_bindgen]
pub fn gtf_args(ra: u8, rb: u8, args: GTFArgs) -> typescript::Instruction {
Instruction::GTF(GTF::from_args(ra.check(), rb.check(), args)).into()
}
};
#[cfg_attr(feature = "typescript", wasm_bindgen::prelude::wasm_bindgen)]
impl WDCM {
pub fn from_args(ra: RegId, rb: RegId, rc: RegId, args: CompareArgs) -> Self {
Self::new(ra, rb, rc, args.to_imm())
}
}
#[cfg_attr(feature = "typescript", wasm_bindgen::prelude::wasm_bindgen)]
impl WQCM {
pub fn from_args(ra: RegId, rb: RegId, rc: RegId, args: CompareArgs) -> Self {
Self::new(ra, rb, rc, args.to_imm())
}
}
#[cfg_attr(feature = "typescript", wasm_bindgen::prelude::wasm_bindgen)]
impl WDOP {
pub fn from_args(ra: RegId, rb: RegId, rc: RegId, args: MathArgs) -> Self {
Self::new(ra, rb, rc, args.to_imm())
}
}
#[cfg_attr(feature = "typescript", wasm_bindgen::prelude::wasm_bindgen)]
impl WQOP {
pub fn from_args(ra: RegId, rb: RegId, rc: RegId, args: MathArgs) -> Self {
Self::new(ra, rb, rc, args.to_imm())
}
}
#[cfg_attr(feature = "typescript", wasm_bindgen::prelude::wasm_bindgen)]
impl WDML {
pub fn from_args(ra: RegId, rb: RegId, rc: RegId, args: MulArgs) -> Self {
Self::new(ra, rb, rc, args.to_imm())
}
}
#[cfg_attr(feature = "typescript", wasm_bindgen::prelude::wasm_bindgen)]
impl WQML {
pub fn from_args(ra: RegId, rb: RegId, rc: RegId, args: MulArgs) -> Self {
Self::new(ra, rb, rc, args.to_imm())
}
}
#[cfg_attr(feature = "typescript", wasm_bindgen::prelude::wasm_bindgen)]
impl WDDV {
pub fn from_args(ra: RegId, rb: RegId, rc: RegId, args: DivArgs) -> Self {
Self::new(ra, rb, rc, args.to_imm())
}
}
#[cfg_attr(feature = "typescript", wasm_bindgen::prelude::wasm_bindgen)]
impl WQDV {
pub fn from_args(ra: RegId, rb: RegId, rc: RegId, args: DivArgs) -> Self {
Self::new(ra, rb, rc, args.to_imm())
}
}
pub fn wdcm_args<A: CheckRegId, B: CheckRegId, C: CheckRegId>(
ra: A,
rb: B,
rc: C,
args: CompareArgs,
) -> Instruction {
Instruction::WDCM(WDCM::from_args(ra.check(), rb.check(), rc.check(), args))
}
#[cfg(feature = "typescript")]
const _: () = {
use super::*;
#[wasm_bindgen::prelude::wasm_bindgen]
pub fn wdcm_args(
ra: u8,
rb: u8,
rc: u8,
args: CompareArgs,
) -> typescript::Instruction {
crate::op::wdcm_args(ra, rb, rc, args).into()
}
};
pub fn wqcm_args<A: CheckRegId, B: CheckRegId, C: CheckRegId>(
ra: A,
rb: B,
rc: C,
args: CompareArgs,
) -> Instruction {
Instruction::WQCM(WQCM::from_args(ra.check(), rb.check(), rc.check(), args))
}
#[cfg(feature = "typescript")]
const _: () = {
use super::*;
#[wasm_bindgen::prelude::wasm_bindgen]
pub fn wqcm_args(
ra: u8,
rb: u8,
rc: u8,
args: CompareArgs,
) -> typescript::Instruction {
crate::op::wqcm_args(ra, rb, rc, args).into()
}
};
pub fn wdop_args<A: CheckRegId, B: CheckRegId, C: CheckRegId>(
ra: A,
rb: B,
rc: C,
args: MathArgs,
) -> Instruction {
Instruction::WDOP(WDOP::from_args(ra.check(), rb.check(), rc.check(), args))
}
#[cfg(feature = "typescript")]
const _: () = {
use super::*;
#[wasm_bindgen::prelude::wasm_bindgen]
pub fn wdop_args(ra: u8, rb: u8, rc: u8, args: MathArgs) -> typescript::Instruction {
crate::op::wdop_args(ra, rb, rc, args).into()
}
};
pub fn wqop_args<A: CheckRegId, B: CheckRegId, C: CheckRegId>(
ra: A,
rb: B,
rc: C,
args: MathArgs,
) -> Instruction {
Instruction::WQOP(WQOP::from_args(ra.check(), rb.check(), rc.check(), args))
}
#[cfg(feature = "typescript")]
const _: () = {
use super::*;
#[wasm_bindgen::prelude::wasm_bindgen]
pub fn wqop_args(ra: u8, rb: u8, rc: u8, args: MathArgs) -> typescript::Instruction {
crate::op::wqop_args(ra, rb, rc, args).into()
}
};
pub fn wdml_args<A: CheckRegId, B: CheckRegId, C: CheckRegId>(
ra: A,
rb: B,
rc: C,
args: MulArgs,
) -> Instruction {
Instruction::WDML(WDML::from_args(ra.check(), rb.check(), rc.check(), args))
}
#[cfg(feature = "typescript")]
const _: () = {
use super::*;
#[wasm_bindgen::prelude::wasm_bindgen]
pub fn wdml_args(ra: u8, rb: u8, rc: u8, args: MulArgs) -> typescript::Instruction {
crate::op::wdml_args(ra, rb, rc, args).into()
}
};
pub fn wqml_args<A: CheckRegId, B: CheckRegId, C: CheckRegId>(
ra: A,
rb: B,
rc: C,
args: MulArgs,
) -> Instruction {
Instruction::WQML(WQML::from_args(ra.check(), rb.check(), rc.check(), args))
}
#[cfg(feature = "typescript")]
const _: () = {
use super::*;
#[wasm_bindgen::prelude::wasm_bindgen]
pub fn wqml_args(ra: u8, rb: u8, rc: u8, args: MulArgs) -> typescript::Instruction {
crate::op::wqml_args(ra, rb, rc, args).into()
}
};
pub fn wddv_args<A: CheckRegId, B: CheckRegId, C: CheckRegId>(
ra: A,
rb: B,
rc: C,
args: DivArgs,
) -> Instruction {
Instruction::WDDV(WDDV::from_args(ra.check(), rb.check(), rc.check(), args))
}
#[cfg(feature = "typescript")]
const _: () = {
use super::*;
#[wasm_bindgen::prelude::wasm_bindgen]
pub fn wddv_args(ra: u8, rb: u8, rc: u8, args: DivArgs) -> typescript::Instruction {
crate::op::wddv_args(ra, rb, rc, args).into()
}
};
pub fn wqdv_args<A: CheckRegId, B: CheckRegId, C: CheckRegId>(
ra: A,
rb: B,
rc: C,
args: DivArgs,
) -> Instruction {
Instruction::WQDV(WQDV::from_args(ra.check(), rb.check(), rc.check(), args))
}
#[cfg(feature = "typescript")]
const _: () = {
use super::*;
#[wasm_bindgen::prelude::wasm_bindgen]
pub fn wqdv_args(ra: u8, rb: u8, rc: u8, args: DivArgs) -> typescript::Instruction {
crate::op::wqdv_args(ra, rb, rc, args).into()
}
};