use super::{
wideint::{CompareArgs, DivArgs, MathArgs, MulArgs},
CheckRegId, GMArgs, GTFArgs, Imm12, Imm18, Instruction, RegId,
};
#[doc(inline)]
pub use super::_op::*;
impl GM {
pub fn from_args(ra: RegId, args: GMArgs) -> Self {
Self::new(ra, Imm18::new(args as _))
}
}
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))
}
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))
}
impl WDCM {
pub fn from_args(ra: RegId, rb: RegId, rc: RegId, args: CompareArgs) -> Self {
Self::new(ra, rb, rc, args.to_imm())
}
}
impl WQCM {
pub fn from_args(ra: RegId, rb: RegId, rc: RegId, args: CompareArgs) -> Self {
Self::new(ra, rb, rc, args.to_imm())
}
}
impl WDOP {
pub fn from_args(ra: RegId, rb: RegId, rc: RegId, args: MathArgs) -> Self {
Self::new(ra, rb, rc, args.to_imm())
}
}
impl WQOP {
pub fn from_args(ra: RegId, rb: RegId, rc: RegId, args: MathArgs) -> Self {
Self::new(ra, rb, rc, args.to_imm())
}
}
impl WDML {
pub fn from_args(ra: RegId, rb: RegId, rc: RegId, args: MulArgs) -> Self {
Self::new(ra, rb, rc, args.to_imm())
}
}
impl WQML {
pub fn from_args(ra: RegId, rb: RegId, rc: RegId, args: MulArgs) -> Self {
Self::new(ra, rb, rc, args.to_imm())
}
}
impl WDDV {
pub fn from_args(ra: RegId, rb: RegId, rc: RegId, args: DivArgs) -> Self {
Self::new(ra, rb, rc, args.to_imm())
}
}
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))
}
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))
}
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))
}
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))
}
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))
}
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))
}
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))
}
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))
}