1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
use super::{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))
}