1use super::{
5 wideint::{
6 CompareArgs,
7 DivArgs,
8 MathArgs,
9 MulArgs,
10 },
11 CheckRegId,
12 GMArgs,
13 GTFArgs,
14 Imm12,
15 Imm18,
16 Instruction,
17 RegId,
18};
19
20#[doc(inline)]
24pub use super::_op::*;
25
26#[cfg_attr(feature = "typescript", wasm_bindgen::prelude::wasm_bindgen)]
27impl GM {
28 pub fn from_args(ra: RegId, args: GMArgs) -> Self {
30 Self::new(ra, Imm18::new(args as _))
31 }
32}
33
34#[cfg_attr(feature = "typescript", wasm_bindgen::prelude::wasm_bindgen)]
35impl GTF {
36 pub fn from_args(ra: RegId, rb: RegId, args: GTFArgs) -> Self {
38 Self::new(ra, rb, Imm12::new(args as _))
39 }
40}
41
42pub fn gm_args<A: CheckRegId>(ra: A, args: GMArgs) -> Instruction {
44 Instruction::GM(GM::from_args(ra.check(), args))
45}
46
47#[cfg(feature = "typescript")]
48const _: () = {
49 use super::*;
50
51 #[wasm_bindgen::prelude::wasm_bindgen]
52 pub fn gm_args(ra: u8, args: GMArgs) -> typescript::Instruction {
54 Instruction::GM(GM::from_args(ra.check(), args)).into()
55 }
56};
57
58pub fn gtf_args<A: CheckRegId, B: CheckRegId>(
60 ra: A,
61 rb: B,
62 args: GTFArgs,
63) -> Instruction {
64 Instruction::GTF(GTF::from_args(ra.check(), rb.check(), args))
65}
66
67#[cfg(feature = "typescript")]
68const _: () = {
69 use super::*;
70
71 #[wasm_bindgen::prelude::wasm_bindgen]
72 pub fn gtf_args(ra: u8, rb: u8, args: GTFArgs) -> typescript::Instruction {
74 Instruction::GTF(GTF::from_args(ra.check(), rb.check(), args)).into()
75 }
76};
77
78#[cfg_attr(feature = "typescript", wasm_bindgen::prelude::wasm_bindgen)]
79impl WDCM {
80 pub fn from_args(ra: RegId, rb: RegId, rc: RegId, args: CompareArgs) -> Self {
82 Self::new(ra, rb, rc, args.to_imm())
83 }
84}
85
86#[cfg_attr(feature = "typescript", wasm_bindgen::prelude::wasm_bindgen)]
87impl WQCM {
88 pub fn from_args(ra: RegId, rb: RegId, rc: RegId, args: CompareArgs) -> Self {
90 Self::new(ra, rb, rc, args.to_imm())
91 }
92}
93
94#[cfg_attr(feature = "typescript", wasm_bindgen::prelude::wasm_bindgen)]
95impl WDOP {
96 pub fn from_args(ra: RegId, rb: RegId, rc: RegId, args: MathArgs) -> Self {
98 Self::new(ra, rb, rc, args.to_imm())
99 }
100}
101
102#[cfg_attr(feature = "typescript", wasm_bindgen::prelude::wasm_bindgen)]
103impl WQOP {
104 pub fn from_args(ra: RegId, rb: RegId, rc: RegId, args: MathArgs) -> Self {
106 Self::new(ra, rb, rc, args.to_imm())
107 }
108}
109
110#[cfg_attr(feature = "typescript", wasm_bindgen::prelude::wasm_bindgen)]
111impl WDML {
112 pub fn from_args(ra: RegId, rb: RegId, rc: RegId, args: MulArgs) -> Self {
114 Self::new(ra, rb, rc, args.to_imm())
115 }
116}
117
118#[cfg_attr(feature = "typescript", wasm_bindgen::prelude::wasm_bindgen)]
119impl WQML {
120 pub fn from_args(ra: RegId, rb: RegId, rc: RegId, args: MulArgs) -> Self {
122 Self::new(ra, rb, rc, args.to_imm())
123 }
124}
125
126#[cfg_attr(feature = "typescript", wasm_bindgen::prelude::wasm_bindgen)]
127impl WDDV {
128 pub fn from_args(ra: RegId, rb: RegId, rc: RegId, args: DivArgs) -> Self {
130 Self::new(ra, rb, rc, args.to_imm())
131 }
132}
133
134#[cfg_attr(feature = "typescript", wasm_bindgen::prelude::wasm_bindgen)]
135impl WQDV {
136 pub fn from_args(ra: RegId, rb: RegId, rc: RegId, args: DivArgs) -> Self {
138 Self::new(ra, rb, rc, args.to_imm())
139 }
140}
141
142pub fn wdcm_args<A: CheckRegId, B: CheckRegId, C: CheckRegId>(
144 ra: A,
145 rb: B,
146 rc: C,
147 args: CompareArgs,
148) -> Instruction {
149 Instruction::WDCM(WDCM::from_args(ra.check(), rb.check(), rc.check(), args))
150}
151
152#[cfg(feature = "typescript")]
153const _: () = {
154 use super::*;
155
156 #[wasm_bindgen::prelude::wasm_bindgen]
157 pub fn wdcm_args(
159 ra: u8,
160 rb: u8,
161 rc: u8,
162 args: CompareArgs,
163 ) -> typescript::Instruction {
164 crate::op::wdcm_args(ra, rb, rc, args).into()
165 }
166};
167
168pub fn wqcm_args<A: CheckRegId, B: CheckRegId, C: CheckRegId>(
170 ra: A,
171 rb: B,
172 rc: C,
173 args: CompareArgs,
174) -> Instruction {
175 Instruction::WQCM(WQCM::from_args(ra.check(), rb.check(), rc.check(), args))
176}
177
178#[cfg(feature = "typescript")]
179const _: () = {
180 use super::*;
181
182 #[wasm_bindgen::prelude::wasm_bindgen]
183 pub fn wqcm_args(
185 ra: u8,
186 rb: u8,
187 rc: u8,
188 args: CompareArgs,
189 ) -> typescript::Instruction {
190 crate::op::wqcm_args(ra, rb, rc, args).into()
191 }
192};
193
194pub fn wdop_args<A: CheckRegId, B: CheckRegId, C: CheckRegId>(
196 ra: A,
197 rb: B,
198 rc: C,
199 args: MathArgs,
200) -> Instruction {
201 Instruction::WDOP(WDOP::from_args(ra.check(), rb.check(), rc.check(), args))
202}
203
204#[cfg(feature = "typescript")]
205const _: () = {
206 use super::*;
207
208 #[wasm_bindgen::prelude::wasm_bindgen]
209 pub fn wdop_args(ra: u8, rb: u8, rc: u8, args: MathArgs) -> typescript::Instruction {
211 crate::op::wdop_args(ra, rb, rc, args).into()
212 }
213};
214
215pub fn wqop_args<A: CheckRegId, B: CheckRegId, C: CheckRegId>(
217 ra: A,
218 rb: B,
219 rc: C,
220 args: MathArgs,
221) -> Instruction {
222 Instruction::WQOP(WQOP::from_args(ra.check(), rb.check(), rc.check(), args))
223}
224
225#[cfg(feature = "typescript")]
226const _: () = {
227 use super::*;
228
229 #[wasm_bindgen::prelude::wasm_bindgen]
230 pub fn wqop_args(ra: u8, rb: u8, rc: u8, args: MathArgs) -> typescript::Instruction {
232 crate::op::wqop_args(ra, rb, rc, args).into()
233 }
234};
235
236pub fn wdml_args<A: CheckRegId, B: CheckRegId, C: CheckRegId>(
238 ra: A,
239 rb: B,
240 rc: C,
241 args: MulArgs,
242) -> Instruction {
243 Instruction::WDML(WDML::from_args(ra.check(), rb.check(), rc.check(), args))
244}
245
246#[cfg(feature = "typescript")]
247const _: () = {
248 use super::*;
249
250 #[wasm_bindgen::prelude::wasm_bindgen]
251 pub fn wdml_args(ra: u8, rb: u8, rc: u8, args: MulArgs) -> typescript::Instruction {
253 crate::op::wdml_args(ra, rb, rc, args).into()
254 }
255};
256
257pub fn wqml_args<A: CheckRegId, B: CheckRegId, C: CheckRegId>(
259 ra: A,
260 rb: B,
261 rc: C,
262 args: MulArgs,
263) -> Instruction {
264 Instruction::WQML(WQML::from_args(ra.check(), rb.check(), rc.check(), args))
265}
266
267#[cfg(feature = "typescript")]
268const _: () = {
269 use super::*;
270
271 #[wasm_bindgen::prelude::wasm_bindgen]
272 pub fn wqml_args(ra: u8, rb: u8, rc: u8, args: MulArgs) -> typescript::Instruction {
274 crate::op::wqml_args(ra, rb, rc, args).into()
275 }
276};
277
278pub fn wddv_args<A: CheckRegId, B: CheckRegId, C: CheckRegId>(
280 ra: A,
281 rb: B,
282 rc: C,
283 args: DivArgs,
284) -> Instruction {
285 Instruction::WDDV(WDDV::from_args(ra.check(), rb.check(), rc.check(), args))
286}
287
288#[cfg(feature = "typescript")]
289const _: () = {
290 use super::*;
291
292 #[wasm_bindgen::prelude::wasm_bindgen]
293 pub fn wddv_args(ra: u8, rb: u8, rc: u8, args: DivArgs) -> typescript::Instruction {
295 crate::op::wddv_args(ra, rb, rc, args).into()
296 }
297};
298
299pub fn wqdv_args<A: CheckRegId, B: CheckRegId, C: CheckRegId>(
301 ra: A,
302 rb: B,
303 rc: C,
304 args: DivArgs,
305) -> Instruction {
306 Instruction::WQDV(WQDV::from_args(ra.check(), rb.check(), rc.check(), args))
307}
308
309#[cfg(feature = "typescript")]
310const _: () = {
311 use super::*;
312
313 #[wasm_bindgen::prelude::wasm_bindgen]
314 pub fn wqdv_args(ra: u8, rb: u8, rc: u8, args: DivArgs) -> typescript::Instruction {
316 crate::op::wqdv_args(ra, rb, rc, args).into()
317 }
318};