Skip to main content

asmkit/x86/features/
CMOV.rs

1use super::super::opcodes::*;
2use crate::core::emitter::*;
3use crate::core::operand::*;
4use crate::x86::assembler::*;
5use crate::x86::operands::*;
6
7/// A dummy operand that represents no register. Here just for simplicity.
8const NOREG: Operand = Operand::new();
9
10/// `CMOVA`.
11///
12/// Supported operand variants:
13///
14/// ```text
15/// +---+----------+
16/// | # | Operands |
17/// +---+----------+
18/// | 1 | Gpd, Gpd |
19/// | 2 | Gpd, Mem |
20/// | 3 | Gpq, Gpq |
21/// | 4 | Gpq, Mem |
22/// | 5 | Gpw, Gpw |
23/// | 6 | Gpw, Mem |
24/// +---+----------+
25/// ```
26pub trait CmovaEmitter<A, B> {
27    fn cmova(&mut self, op0: A, op1: B);
28}
29
30impl<'a> CmovaEmitter<Gpw, Gpw> for Assembler<'a> {
31    fn cmova(&mut self, op0: Gpw, op1: Gpw) {
32        self.emit(
33            CMOVA16RR,
34            op0.as_operand(),
35            op1.as_operand(),
36            &NOREG,
37            &NOREG,
38        );
39    }
40}
41
42impl<'a> CmovaEmitter<Gpw, Mem> for Assembler<'a> {
43    fn cmova(&mut self, op0: Gpw, op1: Mem) {
44        self.emit(
45            CMOVA16RM,
46            op0.as_operand(),
47            op1.as_operand(),
48            &NOREG,
49            &NOREG,
50        );
51    }
52}
53
54impl<'a> CmovaEmitter<Gpd, Gpd> for Assembler<'a> {
55    fn cmova(&mut self, op0: Gpd, op1: Gpd) {
56        self.emit(
57            CMOVA32RR,
58            op0.as_operand(),
59            op1.as_operand(),
60            &NOREG,
61            &NOREG,
62        );
63    }
64}
65
66impl<'a> CmovaEmitter<Gpd, Mem> for Assembler<'a> {
67    fn cmova(&mut self, op0: Gpd, op1: Mem) {
68        self.emit(
69            CMOVA32RM,
70            op0.as_operand(),
71            op1.as_operand(),
72            &NOREG,
73            &NOREG,
74        );
75    }
76}
77
78impl<'a> CmovaEmitter<Gpq, Gpq> for Assembler<'a> {
79    fn cmova(&mut self, op0: Gpq, op1: Gpq) {
80        self.emit(
81            CMOVA64RR,
82            op0.as_operand(),
83            op1.as_operand(),
84            &NOREG,
85            &NOREG,
86        );
87    }
88}
89
90impl<'a> CmovaEmitter<Gpq, Mem> for Assembler<'a> {
91    fn cmova(&mut self, op0: Gpq, op1: Mem) {
92        self.emit(
93            CMOVA64RM,
94            op0.as_operand(),
95            op1.as_operand(),
96            &NOREG,
97            &NOREG,
98        );
99    }
100}
101
102/// `CMOVBE`.
103///
104/// Supported operand variants:
105///
106/// ```text
107/// +---+----------+
108/// | # | Operands |
109/// +---+----------+
110/// | 1 | Gpd, Gpd |
111/// | 2 | Gpd, Mem |
112/// | 3 | Gpq, Gpq |
113/// | 4 | Gpq, Mem |
114/// | 5 | Gpw, Gpw |
115/// | 6 | Gpw, Mem |
116/// +---+----------+
117/// ```
118pub trait CmovbeEmitter<A, B> {
119    fn cmovbe(&mut self, op0: A, op1: B);
120}
121
122impl<'a> CmovbeEmitter<Gpw, Gpw> for Assembler<'a> {
123    fn cmovbe(&mut self, op0: Gpw, op1: Gpw) {
124        self.emit(
125            CMOVBE16RR,
126            op0.as_operand(),
127            op1.as_operand(),
128            &NOREG,
129            &NOREG,
130        );
131    }
132}
133
134impl<'a> CmovbeEmitter<Gpw, Mem> for Assembler<'a> {
135    fn cmovbe(&mut self, op0: Gpw, op1: Mem) {
136        self.emit(
137            CMOVBE16RM,
138            op0.as_operand(),
139            op1.as_operand(),
140            &NOREG,
141            &NOREG,
142        );
143    }
144}
145
146impl<'a> CmovbeEmitter<Gpd, Gpd> for Assembler<'a> {
147    fn cmovbe(&mut self, op0: Gpd, op1: Gpd) {
148        self.emit(
149            CMOVBE32RR,
150            op0.as_operand(),
151            op1.as_operand(),
152            &NOREG,
153            &NOREG,
154        );
155    }
156}
157
158impl<'a> CmovbeEmitter<Gpd, Mem> for Assembler<'a> {
159    fn cmovbe(&mut self, op0: Gpd, op1: Mem) {
160        self.emit(
161            CMOVBE32RM,
162            op0.as_operand(),
163            op1.as_operand(),
164            &NOREG,
165            &NOREG,
166        );
167    }
168}
169
170impl<'a> CmovbeEmitter<Gpq, Gpq> for Assembler<'a> {
171    fn cmovbe(&mut self, op0: Gpq, op1: Gpq) {
172        self.emit(
173            CMOVBE64RR,
174            op0.as_operand(),
175            op1.as_operand(),
176            &NOREG,
177            &NOREG,
178        );
179    }
180}
181
182impl<'a> CmovbeEmitter<Gpq, Mem> for Assembler<'a> {
183    fn cmovbe(&mut self, op0: Gpq, op1: Mem) {
184        self.emit(
185            CMOVBE64RM,
186            op0.as_operand(),
187            op1.as_operand(),
188            &NOREG,
189            &NOREG,
190        );
191    }
192}
193
194/// `CMOVC`.
195///
196/// Supported operand variants:
197///
198/// ```text
199/// +---+----------+
200/// | # | Operands |
201/// +---+----------+
202/// | 1 | Gpd, Gpd |
203/// | 2 | Gpd, Mem |
204/// | 3 | Gpq, Gpq |
205/// | 4 | Gpq, Mem |
206/// | 5 | Gpw, Gpw |
207/// | 6 | Gpw, Mem |
208/// +---+----------+
209/// ```
210pub trait CmovcEmitter<A, B> {
211    fn cmovc(&mut self, op0: A, op1: B);
212}
213
214impl<'a> CmovcEmitter<Gpw, Gpw> for Assembler<'a> {
215    fn cmovc(&mut self, op0: Gpw, op1: Gpw) {
216        self.emit(
217            CMOVC16RR,
218            op0.as_operand(),
219            op1.as_operand(),
220            &NOREG,
221            &NOREG,
222        );
223    }
224}
225
226impl<'a> CmovcEmitter<Gpw, Mem> for Assembler<'a> {
227    fn cmovc(&mut self, op0: Gpw, op1: Mem) {
228        self.emit(
229            CMOVC16RM,
230            op0.as_operand(),
231            op1.as_operand(),
232            &NOREG,
233            &NOREG,
234        );
235    }
236}
237
238impl<'a> CmovcEmitter<Gpd, Gpd> for Assembler<'a> {
239    fn cmovc(&mut self, op0: Gpd, op1: Gpd) {
240        self.emit(
241            CMOVC32RR,
242            op0.as_operand(),
243            op1.as_operand(),
244            &NOREG,
245            &NOREG,
246        );
247    }
248}
249
250impl<'a> CmovcEmitter<Gpd, Mem> for Assembler<'a> {
251    fn cmovc(&mut self, op0: Gpd, op1: Mem) {
252        self.emit(
253            CMOVC32RM,
254            op0.as_operand(),
255            op1.as_operand(),
256            &NOREG,
257            &NOREG,
258        );
259    }
260}
261
262impl<'a> CmovcEmitter<Gpq, Gpq> for Assembler<'a> {
263    fn cmovc(&mut self, op0: Gpq, op1: Gpq) {
264        self.emit(
265            CMOVC64RR,
266            op0.as_operand(),
267            op1.as_operand(),
268            &NOREG,
269            &NOREG,
270        );
271    }
272}
273
274impl<'a> CmovcEmitter<Gpq, Mem> for Assembler<'a> {
275    fn cmovc(&mut self, op0: Gpq, op1: Mem) {
276        self.emit(
277            CMOVC64RM,
278            op0.as_operand(),
279            op1.as_operand(),
280            &NOREG,
281            &NOREG,
282        );
283    }
284}
285
286/// `CMOVG`.
287///
288/// Supported operand variants:
289///
290/// ```text
291/// +---+----------+
292/// | # | Operands |
293/// +---+----------+
294/// | 1 | Gpd, Gpd |
295/// | 2 | Gpd, Mem |
296/// | 3 | Gpq, Gpq |
297/// | 4 | Gpq, Mem |
298/// | 5 | Gpw, Gpw |
299/// | 6 | Gpw, Mem |
300/// +---+----------+
301/// ```
302pub trait CmovgEmitter<A, B> {
303    fn cmovg(&mut self, op0: A, op1: B);
304}
305
306impl<'a> CmovgEmitter<Gpw, Gpw> for Assembler<'a> {
307    fn cmovg(&mut self, op0: Gpw, op1: Gpw) {
308        self.emit(
309            CMOVG16RR,
310            op0.as_operand(),
311            op1.as_operand(),
312            &NOREG,
313            &NOREG,
314        );
315    }
316}
317
318impl<'a> CmovgEmitter<Gpw, Mem> for Assembler<'a> {
319    fn cmovg(&mut self, op0: Gpw, op1: Mem) {
320        self.emit(
321            CMOVG16RM,
322            op0.as_operand(),
323            op1.as_operand(),
324            &NOREG,
325            &NOREG,
326        );
327    }
328}
329
330impl<'a> CmovgEmitter<Gpd, Gpd> for Assembler<'a> {
331    fn cmovg(&mut self, op0: Gpd, op1: Gpd) {
332        self.emit(
333            CMOVG32RR,
334            op0.as_operand(),
335            op1.as_operand(),
336            &NOREG,
337            &NOREG,
338        );
339    }
340}
341
342impl<'a> CmovgEmitter<Gpd, Mem> for Assembler<'a> {
343    fn cmovg(&mut self, op0: Gpd, op1: Mem) {
344        self.emit(
345            CMOVG32RM,
346            op0.as_operand(),
347            op1.as_operand(),
348            &NOREG,
349            &NOREG,
350        );
351    }
352}
353
354impl<'a> CmovgEmitter<Gpq, Gpq> for Assembler<'a> {
355    fn cmovg(&mut self, op0: Gpq, op1: Gpq) {
356        self.emit(
357            CMOVG64RR,
358            op0.as_operand(),
359            op1.as_operand(),
360            &NOREG,
361            &NOREG,
362        );
363    }
364}
365
366impl<'a> CmovgEmitter<Gpq, Mem> for Assembler<'a> {
367    fn cmovg(&mut self, op0: Gpq, op1: Mem) {
368        self.emit(
369            CMOVG64RM,
370            op0.as_operand(),
371            op1.as_operand(),
372            &NOREG,
373            &NOREG,
374        );
375    }
376}
377
378/// `CMOVGE`.
379///
380/// Supported operand variants:
381///
382/// ```text
383/// +---+----------+
384/// | # | Operands |
385/// +---+----------+
386/// | 1 | Gpd, Gpd |
387/// | 2 | Gpd, Mem |
388/// | 3 | Gpq, Gpq |
389/// | 4 | Gpq, Mem |
390/// | 5 | Gpw, Gpw |
391/// | 6 | Gpw, Mem |
392/// +---+----------+
393/// ```
394pub trait CmovgeEmitter<A, B> {
395    fn cmovge(&mut self, op0: A, op1: B);
396}
397
398impl<'a> CmovgeEmitter<Gpw, Gpw> for Assembler<'a> {
399    fn cmovge(&mut self, op0: Gpw, op1: Gpw) {
400        self.emit(
401            CMOVGE16RR,
402            op0.as_operand(),
403            op1.as_operand(),
404            &NOREG,
405            &NOREG,
406        );
407    }
408}
409
410impl<'a> CmovgeEmitter<Gpw, Mem> for Assembler<'a> {
411    fn cmovge(&mut self, op0: Gpw, op1: Mem) {
412        self.emit(
413            CMOVGE16RM,
414            op0.as_operand(),
415            op1.as_operand(),
416            &NOREG,
417            &NOREG,
418        );
419    }
420}
421
422impl<'a> CmovgeEmitter<Gpd, Gpd> for Assembler<'a> {
423    fn cmovge(&mut self, op0: Gpd, op1: Gpd) {
424        self.emit(
425            CMOVGE32RR,
426            op0.as_operand(),
427            op1.as_operand(),
428            &NOREG,
429            &NOREG,
430        );
431    }
432}
433
434impl<'a> CmovgeEmitter<Gpd, Mem> for Assembler<'a> {
435    fn cmovge(&mut self, op0: Gpd, op1: Mem) {
436        self.emit(
437            CMOVGE32RM,
438            op0.as_operand(),
439            op1.as_operand(),
440            &NOREG,
441            &NOREG,
442        );
443    }
444}
445
446impl<'a> CmovgeEmitter<Gpq, Gpq> for Assembler<'a> {
447    fn cmovge(&mut self, op0: Gpq, op1: Gpq) {
448        self.emit(
449            CMOVGE64RR,
450            op0.as_operand(),
451            op1.as_operand(),
452            &NOREG,
453            &NOREG,
454        );
455    }
456}
457
458impl<'a> CmovgeEmitter<Gpq, Mem> for Assembler<'a> {
459    fn cmovge(&mut self, op0: Gpq, op1: Mem) {
460        self.emit(
461            CMOVGE64RM,
462            op0.as_operand(),
463            op1.as_operand(),
464            &NOREG,
465            &NOREG,
466        );
467    }
468}
469
470/// `CMOVL`.
471///
472/// Supported operand variants:
473///
474/// ```text
475/// +---+----------+
476/// | # | Operands |
477/// +---+----------+
478/// | 1 | Gpd, Gpd |
479/// | 2 | Gpd, Mem |
480/// | 3 | Gpq, Gpq |
481/// | 4 | Gpq, Mem |
482/// | 5 | Gpw, Gpw |
483/// | 6 | Gpw, Mem |
484/// +---+----------+
485/// ```
486pub trait CmovlEmitter<A, B> {
487    fn cmovl(&mut self, op0: A, op1: B);
488}
489
490impl<'a> CmovlEmitter<Gpw, Gpw> for Assembler<'a> {
491    fn cmovl(&mut self, op0: Gpw, op1: Gpw) {
492        self.emit(
493            CMOVL16RR,
494            op0.as_operand(),
495            op1.as_operand(),
496            &NOREG,
497            &NOREG,
498        );
499    }
500}
501
502impl<'a> CmovlEmitter<Gpw, Mem> for Assembler<'a> {
503    fn cmovl(&mut self, op0: Gpw, op1: Mem) {
504        self.emit(
505            CMOVL16RM,
506            op0.as_operand(),
507            op1.as_operand(),
508            &NOREG,
509            &NOREG,
510        );
511    }
512}
513
514impl<'a> CmovlEmitter<Gpd, Gpd> for Assembler<'a> {
515    fn cmovl(&mut self, op0: Gpd, op1: Gpd) {
516        self.emit(
517            CMOVL32RR,
518            op0.as_operand(),
519            op1.as_operand(),
520            &NOREG,
521            &NOREG,
522        );
523    }
524}
525
526impl<'a> CmovlEmitter<Gpd, Mem> for Assembler<'a> {
527    fn cmovl(&mut self, op0: Gpd, op1: Mem) {
528        self.emit(
529            CMOVL32RM,
530            op0.as_operand(),
531            op1.as_operand(),
532            &NOREG,
533            &NOREG,
534        );
535    }
536}
537
538impl<'a> CmovlEmitter<Gpq, Gpq> for Assembler<'a> {
539    fn cmovl(&mut self, op0: Gpq, op1: Gpq) {
540        self.emit(
541            CMOVL64RR,
542            op0.as_operand(),
543            op1.as_operand(),
544            &NOREG,
545            &NOREG,
546        );
547    }
548}
549
550impl<'a> CmovlEmitter<Gpq, Mem> for Assembler<'a> {
551    fn cmovl(&mut self, op0: Gpq, op1: Mem) {
552        self.emit(
553            CMOVL64RM,
554            op0.as_operand(),
555            op1.as_operand(),
556            &NOREG,
557            &NOREG,
558        );
559    }
560}
561
562/// `CMOVLE`.
563///
564/// Supported operand variants:
565///
566/// ```text
567/// +---+----------+
568/// | # | Operands |
569/// +---+----------+
570/// | 1 | Gpd, Gpd |
571/// | 2 | Gpd, Mem |
572/// | 3 | Gpq, Gpq |
573/// | 4 | Gpq, Mem |
574/// | 5 | Gpw, Gpw |
575/// | 6 | Gpw, Mem |
576/// +---+----------+
577/// ```
578pub trait CmovleEmitter<A, B> {
579    fn cmovle(&mut self, op0: A, op1: B);
580}
581
582impl<'a> CmovleEmitter<Gpw, Gpw> for Assembler<'a> {
583    fn cmovle(&mut self, op0: Gpw, op1: Gpw) {
584        self.emit(
585            CMOVLE16RR,
586            op0.as_operand(),
587            op1.as_operand(),
588            &NOREG,
589            &NOREG,
590        );
591    }
592}
593
594impl<'a> CmovleEmitter<Gpw, Mem> for Assembler<'a> {
595    fn cmovle(&mut self, op0: Gpw, op1: Mem) {
596        self.emit(
597            CMOVLE16RM,
598            op0.as_operand(),
599            op1.as_operand(),
600            &NOREG,
601            &NOREG,
602        );
603    }
604}
605
606impl<'a> CmovleEmitter<Gpd, Gpd> for Assembler<'a> {
607    fn cmovle(&mut self, op0: Gpd, op1: Gpd) {
608        self.emit(
609            CMOVLE32RR,
610            op0.as_operand(),
611            op1.as_operand(),
612            &NOREG,
613            &NOREG,
614        );
615    }
616}
617
618impl<'a> CmovleEmitter<Gpd, Mem> for Assembler<'a> {
619    fn cmovle(&mut self, op0: Gpd, op1: Mem) {
620        self.emit(
621            CMOVLE32RM,
622            op0.as_operand(),
623            op1.as_operand(),
624            &NOREG,
625            &NOREG,
626        );
627    }
628}
629
630impl<'a> CmovleEmitter<Gpq, Gpq> for Assembler<'a> {
631    fn cmovle(&mut self, op0: Gpq, op1: Gpq) {
632        self.emit(
633            CMOVLE64RR,
634            op0.as_operand(),
635            op1.as_operand(),
636            &NOREG,
637            &NOREG,
638        );
639    }
640}
641
642impl<'a> CmovleEmitter<Gpq, Mem> for Assembler<'a> {
643    fn cmovle(&mut self, op0: Gpq, op1: Mem) {
644        self.emit(
645            CMOVLE64RM,
646            op0.as_operand(),
647            op1.as_operand(),
648            &NOREG,
649            &NOREG,
650        );
651    }
652}
653
654/// `CMOVNC`.
655///
656/// Supported operand variants:
657///
658/// ```text
659/// +---+----------+
660/// | # | Operands |
661/// +---+----------+
662/// | 1 | Gpd, Gpd |
663/// | 2 | Gpd, Mem |
664/// | 3 | Gpq, Gpq |
665/// | 4 | Gpq, Mem |
666/// | 5 | Gpw, Gpw |
667/// | 6 | Gpw, Mem |
668/// +---+----------+
669/// ```
670pub trait CmovncEmitter<A, B> {
671    fn cmovnc(&mut self, op0: A, op1: B);
672}
673
674impl<'a> CmovncEmitter<Gpw, Gpw> for Assembler<'a> {
675    fn cmovnc(&mut self, op0: Gpw, op1: Gpw) {
676        self.emit(
677            CMOVNC16RR,
678            op0.as_operand(),
679            op1.as_operand(),
680            &NOREG,
681            &NOREG,
682        );
683    }
684}
685
686impl<'a> CmovncEmitter<Gpw, Mem> for Assembler<'a> {
687    fn cmovnc(&mut self, op0: Gpw, op1: Mem) {
688        self.emit(
689            CMOVNC16RM,
690            op0.as_operand(),
691            op1.as_operand(),
692            &NOREG,
693            &NOREG,
694        );
695    }
696}
697
698impl<'a> CmovncEmitter<Gpd, Gpd> for Assembler<'a> {
699    fn cmovnc(&mut self, op0: Gpd, op1: Gpd) {
700        self.emit(
701            CMOVNC32RR,
702            op0.as_operand(),
703            op1.as_operand(),
704            &NOREG,
705            &NOREG,
706        );
707    }
708}
709
710impl<'a> CmovncEmitter<Gpd, Mem> for Assembler<'a> {
711    fn cmovnc(&mut self, op0: Gpd, op1: Mem) {
712        self.emit(
713            CMOVNC32RM,
714            op0.as_operand(),
715            op1.as_operand(),
716            &NOREG,
717            &NOREG,
718        );
719    }
720}
721
722impl<'a> CmovncEmitter<Gpq, Gpq> for Assembler<'a> {
723    fn cmovnc(&mut self, op0: Gpq, op1: Gpq) {
724        self.emit(
725            CMOVNC64RR,
726            op0.as_operand(),
727            op1.as_operand(),
728            &NOREG,
729            &NOREG,
730        );
731    }
732}
733
734impl<'a> CmovncEmitter<Gpq, Mem> for Assembler<'a> {
735    fn cmovnc(&mut self, op0: Gpq, op1: Mem) {
736        self.emit(
737            CMOVNC64RM,
738            op0.as_operand(),
739            op1.as_operand(),
740            &NOREG,
741            &NOREG,
742        );
743    }
744}
745
746/// `CMOVNO`.
747///
748/// Supported operand variants:
749///
750/// ```text
751/// +---+----------+
752/// | # | Operands |
753/// +---+----------+
754/// | 1 | Gpd, Gpd |
755/// | 2 | Gpd, Mem |
756/// | 3 | Gpq, Gpq |
757/// | 4 | Gpq, Mem |
758/// | 5 | Gpw, Gpw |
759/// | 6 | Gpw, Mem |
760/// +---+----------+
761/// ```
762pub trait CmovnoEmitter<A, B> {
763    fn cmovno(&mut self, op0: A, op1: B);
764}
765
766impl<'a> CmovnoEmitter<Gpw, Gpw> for Assembler<'a> {
767    fn cmovno(&mut self, op0: Gpw, op1: Gpw) {
768        self.emit(
769            CMOVNO16RR,
770            op0.as_operand(),
771            op1.as_operand(),
772            &NOREG,
773            &NOREG,
774        );
775    }
776}
777
778impl<'a> CmovnoEmitter<Gpw, Mem> for Assembler<'a> {
779    fn cmovno(&mut self, op0: Gpw, op1: Mem) {
780        self.emit(
781            CMOVNO16RM,
782            op0.as_operand(),
783            op1.as_operand(),
784            &NOREG,
785            &NOREG,
786        );
787    }
788}
789
790impl<'a> CmovnoEmitter<Gpd, Gpd> for Assembler<'a> {
791    fn cmovno(&mut self, op0: Gpd, op1: Gpd) {
792        self.emit(
793            CMOVNO32RR,
794            op0.as_operand(),
795            op1.as_operand(),
796            &NOREG,
797            &NOREG,
798        );
799    }
800}
801
802impl<'a> CmovnoEmitter<Gpd, Mem> for Assembler<'a> {
803    fn cmovno(&mut self, op0: Gpd, op1: Mem) {
804        self.emit(
805            CMOVNO32RM,
806            op0.as_operand(),
807            op1.as_operand(),
808            &NOREG,
809            &NOREG,
810        );
811    }
812}
813
814impl<'a> CmovnoEmitter<Gpq, Gpq> for Assembler<'a> {
815    fn cmovno(&mut self, op0: Gpq, op1: Gpq) {
816        self.emit(
817            CMOVNO64RR,
818            op0.as_operand(),
819            op1.as_operand(),
820            &NOREG,
821            &NOREG,
822        );
823    }
824}
825
826impl<'a> CmovnoEmitter<Gpq, Mem> for Assembler<'a> {
827    fn cmovno(&mut self, op0: Gpq, op1: Mem) {
828        self.emit(
829            CMOVNO64RM,
830            op0.as_operand(),
831            op1.as_operand(),
832            &NOREG,
833            &NOREG,
834        );
835    }
836}
837
838/// `CMOVNP`.
839///
840/// Supported operand variants:
841///
842/// ```text
843/// +---+----------+
844/// | # | Operands |
845/// +---+----------+
846/// | 1 | Gpd, Gpd |
847/// | 2 | Gpd, Mem |
848/// | 3 | Gpq, Gpq |
849/// | 4 | Gpq, Mem |
850/// | 5 | Gpw, Gpw |
851/// | 6 | Gpw, Mem |
852/// +---+----------+
853/// ```
854pub trait CmovnpEmitter<A, B> {
855    fn cmovnp(&mut self, op0: A, op1: B);
856}
857
858impl<'a> CmovnpEmitter<Gpw, Gpw> for Assembler<'a> {
859    fn cmovnp(&mut self, op0: Gpw, op1: Gpw) {
860        self.emit(
861            CMOVNP16RR,
862            op0.as_operand(),
863            op1.as_operand(),
864            &NOREG,
865            &NOREG,
866        );
867    }
868}
869
870impl<'a> CmovnpEmitter<Gpw, Mem> for Assembler<'a> {
871    fn cmovnp(&mut self, op0: Gpw, op1: Mem) {
872        self.emit(
873            CMOVNP16RM,
874            op0.as_operand(),
875            op1.as_operand(),
876            &NOREG,
877            &NOREG,
878        );
879    }
880}
881
882impl<'a> CmovnpEmitter<Gpd, Gpd> for Assembler<'a> {
883    fn cmovnp(&mut self, op0: Gpd, op1: Gpd) {
884        self.emit(
885            CMOVNP32RR,
886            op0.as_operand(),
887            op1.as_operand(),
888            &NOREG,
889            &NOREG,
890        );
891    }
892}
893
894impl<'a> CmovnpEmitter<Gpd, Mem> for Assembler<'a> {
895    fn cmovnp(&mut self, op0: Gpd, op1: Mem) {
896        self.emit(
897            CMOVNP32RM,
898            op0.as_operand(),
899            op1.as_operand(),
900            &NOREG,
901            &NOREG,
902        );
903    }
904}
905
906impl<'a> CmovnpEmitter<Gpq, Gpq> for Assembler<'a> {
907    fn cmovnp(&mut self, op0: Gpq, op1: Gpq) {
908        self.emit(
909            CMOVNP64RR,
910            op0.as_operand(),
911            op1.as_operand(),
912            &NOREG,
913            &NOREG,
914        );
915    }
916}
917
918impl<'a> CmovnpEmitter<Gpq, Mem> for Assembler<'a> {
919    fn cmovnp(&mut self, op0: Gpq, op1: Mem) {
920        self.emit(
921            CMOVNP64RM,
922            op0.as_operand(),
923            op1.as_operand(),
924            &NOREG,
925            &NOREG,
926        );
927    }
928}
929
930/// `CMOVNS`.
931///
932/// Supported operand variants:
933///
934/// ```text
935/// +---+----------+
936/// | # | Operands |
937/// +---+----------+
938/// | 1 | Gpd, Gpd |
939/// | 2 | Gpd, Mem |
940/// | 3 | Gpq, Gpq |
941/// | 4 | Gpq, Mem |
942/// | 5 | Gpw, Gpw |
943/// | 6 | Gpw, Mem |
944/// +---+----------+
945/// ```
946pub trait CmovnsEmitter<A, B> {
947    fn cmovns(&mut self, op0: A, op1: B);
948}
949
950impl<'a> CmovnsEmitter<Gpw, Gpw> for Assembler<'a> {
951    fn cmovns(&mut self, op0: Gpw, op1: Gpw) {
952        self.emit(
953            CMOVNS16RR,
954            op0.as_operand(),
955            op1.as_operand(),
956            &NOREG,
957            &NOREG,
958        );
959    }
960}
961
962impl<'a> CmovnsEmitter<Gpw, Mem> for Assembler<'a> {
963    fn cmovns(&mut self, op0: Gpw, op1: Mem) {
964        self.emit(
965            CMOVNS16RM,
966            op0.as_operand(),
967            op1.as_operand(),
968            &NOREG,
969            &NOREG,
970        );
971    }
972}
973
974impl<'a> CmovnsEmitter<Gpd, Gpd> for Assembler<'a> {
975    fn cmovns(&mut self, op0: Gpd, op1: Gpd) {
976        self.emit(
977            CMOVNS32RR,
978            op0.as_operand(),
979            op1.as_operand(),
980            &NOREG,
981            &NOREG,
982        );
983    }
984}
985
986impl<'a> CmovnsEmitter<Gpd, Mem> for Assembler<'a> {
987    fn cmovns(&mut self, op0: Gpd, op1: Mem) {
988        self.emit(
989            CMOVNS32RM,
990            op0.as_operand(),
991            op1.as_operand(),
992            &NOREG,
993            &NOREG,
994        );
995    }
996}
997
998impl<'a> CmovnsEmitter<Gpq, Gpq> for Assembler<'a> {
999    fn cmovns(&mut self, op0: Gpq, op1: Gpq) {
1000        self.emit(
1001            CMOVNS64RR,
1002            op0.as_operand(),
1003            op1.as_operand(),
1004            &NOREG,
1005            &NOREG,
1006        );
1007    }
1008}
1009
1010impl<'a> CmovnsEmitter<Gpq, Mem> for Assembler<'a> {
1011    fn cmovns(&mut self, op0: Gpq, op1: Mem) {
1012        self.emit(
1013            CMOVNS64RM,
1014            op0.as_operand(),
1015            op1.as_operand(),
1016            &NOREG,
1017            &NOREG,
1018        );
1019    }
1020}
1021
1022/// `CMOVNZ`.
1023///
1024/// Supported operand variants:
1025///
1026/// ```text
1027/// +---+----------+
1028/// | # | Operands |
1029/// +---+----------+
1030/// | 1 | Gpd, Gpd |
1031/// | 2 | Gpd, Mem |
1032/// | 3 | Gpq, Gpq |
1033/// | 4 | Gpq, Mem |
1034/// | 5 | Gpw, Gpw |
1035/// | 6 | Gpw, Mem |
1036/// +---+----------+
1037/// ```
1038pub trait CmovnzEmitter<A, B> {
1039    fn cmovnz(&mut self, op0: A, op1: B);
1040}
1041
1042impl<'a> CmovnzEmitter<Gpw, Gpw> for Assembler<'a> {
1043    fn cmovnz(&mut self, op0: Gpw, op1: Gpw) {
1044        self.emit(
1045            CMOVNZ16RR,
1046            op0.as_operand(),
1047            op1.as_operand(),
1048            &NOREG,
1049            &NOREG,
1050        );
1051    }
1052}
1053
1054impl<'a> CmovnzEmitter<Gpw, Mem> for Assembler<'a> {
1055    fn cmovnz(&mut self, op0: Gpw, op1: Mem) {
1056        self.emit(
1057            CMOVNZ16RM,
1058            op0.as_operand(),
1059            op1.as_operand(),
1060            &NOREG,
1061            &NOREG,
1062        );
1063    }
1064}
1065
1066impl<'a> CmovnzEmitter<Gpd, Gpd> for Assembler<'a> {
1067    fn cmovnz(&mut self, op0: Gpd, op1: Gpd) {
1068        self.emit(
1069            CMOVNZ32RR,
1070            op0.as_operand(),
1071            op1.as_operand(),
1072            &NOREG,
1073            &NOREG,
1074        );
1075    }
1076}
1077
1078impl<'a> CmovnzEmitter<Gpd, Mem> for Assembler<'a> {
1079    fn cmovnz(&mut self, op0: Gpd, op1: Mem) {
1080        self.emit(
1081            CMOVNZ32RM,
1082            op0.as_operand(),
1083            op1.as_operand(),
1084            &NOREG,
1085            &NOREG,
1086        );
1087    }
1088}
1089
1090impl<'a> CmovnzEmitter<Gpq, Gpq> for Assembler<'a> {
1091    fn cmovnz(&mut self, op0: Gpq, op1: Gpq) {
1092        self.emit(
1093            CMOVNZ64RR,
1094            op0.as_operand(),
1095            op1.as_operand(),
1096            &NOREG,
1097            &NOREG,
1098        );
1099    }
1100}
1101
1102impl<'a> CmovnzEmitter<Gpq, Mem> for Assembler<'a> {
1103    fn cmovnz(&mut self, op0: Gpq, op1: Mem) {
1104        self.emit(
1105            CMOVNZ64RM,
1106            op0.as_operand(),
1107            op1.as_operand(),
1108            &NOREG,
1109            &NOREG,
1110        );
1111    }
1112}
1113
1114/// `CMOVO`.
1115///
1116/// Supported operand variants:
1117///
1118/// ```text
1119/// +---+----------+
1120/// | # | Operands |
1121/// +---+----------+
1122/// | 1 | Gpd, Gpd |
1123/// | 2 | Gpd, Mem |
1124/// | 3 | Gpq, Gpq |
1125/// | 4 | Gpq, Mem |
1126/// | 5 | Gpw, Gpw |
1127/// | 6 | Gpw, Mem |
1128/// +---+----------+
1129/// ```
1130pub trait CmovoEmitter<A, B> {
1131    fn cmovo(&mut self, op0: A, op1: B);
1132}
1133
1134impl<'a> CmovoEmitter<Gpw, Gpw> for Assembler<'a> {
1135    fn cmovo(&mut self, op0: Gpw, op1: Gpw) {
1136        self.emit(
1137            CMOVO16RR,
1138            op0.as_operand(),
1139            op1.as_operand(),
1140            &NOREG,
1141            &NOREG,
1142        );
1143    }
1144}
1145
1146impl<'a> CmovoEmitter<Gpw, Mem> for Assembler<'a> {
1147    fn cmovo(&mut self, op0: Gpw, op1: Mem) {
1148        self.emit(
1149            CMOVO16RM,
1150            op0.as_operand(),
1151            op1.as_operand(),
1152            &NOREG,
1153            &NOREG,
1154        );
1155    }
1156}
1157
1158impl<'a> CmovoEmitter<Gpd, Gpd> for Assembler<'a> {
1159    fn cmovo(&mut self, op0: Gpd, op1: Gpd) {
1160        self.emit(
1161            CMOVO32RR,
1162            op0.as_operand(),
1163            op1.as_operand(),
1164            &NOREG,
1165            &NOREG,
1166        );
1167    }
1168}
1169
1170impl<'a> CmovoEmitter<Gpd, Mem> for Assembler<'a> {
1171    fn cmovo(&mut self, op0: Gpd, op1: Mem) {
1172        self.emit(
1173            CMOVO32RM,
1174            op0.as_operand(),
1175            op1.as_operand(),
1176            &NOREG,
1177            &NOREG,
1178        );
1179    }
1180}
1181
1182impl<'a> CmovoEmitter<Gpq, Gpq> for Assembler<'a> {
1183    fn cmovo(&mut self, op0: Gpq, op1: Gpq) {
1184        self.emit(
1185            CMOVO64RR,
1186            op0.as_operand(),
1187            op1.as_operand(),
1188            &NOREG,
1189            &NOREG,
1190        );
1191    }
1192}
1193
1194impl<'a> CmovoEmitter<Gpq, Mem> for Assembler<'a> {
1195    fn cmovo(&mut self, op0: Gpq, op1: Mem) {
1196        self.emit(
1197            CMOVO64RM,
1198            op0.as_operand(),
1199            op1.as_operand(),
1200            &NOREG,
1201            &NOREG,
1202        );
1203    }
1204}
1205
1206/// `CMOVP`.
1207///
1208/// Supported operand variants:
1209///
1210/// ```text
1211/// +---+----------+
1212/// | # | Operands |
1213/// +---+----------+
1214/// | 1 | Gpd, Gpd |
1215/// | 2 | Gpd, Mem |
1216/// | 3 | Gpq, Gpq |
1217/// | 4 | Gpq, Mem |
1218/// | 5 | Gpw, Gpw |
1219/// | 6 | Gpw, Mem |
1220/// +---+----------+
1221/// ```
1222pub trait CmovpEmitter<A, B> {
1223    fn cmovp(&mut self, op0: A, op1: B);
1224}
1225
1226impl<'a> CmovpEmitter<Gpw, Gpw> for Assembler<'a> {
1227    fn cmovp(&mut self, op0: Gpw, op1: Gpw) {
1228        self.emit(
1229            CMOVP16RR,
1230            op0.as_operand(),
1231            op1.as_operand(),
1232            &NOREG,
1233            &NOREG,
1234        );
1235    }
1236}
1237
1238impl<'a> CmovpEmitter<Gpw, Mem> for Assembler<'a> {
1239    fn cmovp(&mut self, op0: Gpw, op1: Mem) {
1240        self.emit(
1241            CMOVP16RM,
1242            op0.as_operand(),
1243            op1.as_operand(),
1244            &NOREG,
1245            &NOREG,
1246        );
1247    }
1248}
1249
1250impl<'a> CmovpEmitter<Gpd, Gpd> for Assembler<'a> {
1251    fn cmovp(&mut self, op0: Gpd, op1: Gpd) {
1252        self.emit(
1253            CMOVP32RR,
1254            op0.as_operand(),
1255            op1.as_operand(),
1256            &NOREG,
1257            &NOREG,
1258        );
1259    }
1260}
1261
1262impl<'a> CmovpEmitter<Gpd, Mem> for Assembler<'a> {
1263    fn cmovp(&mut self, op0: Gpd, op1: Mem) {
1264        self.emit(
1265            CMOVP32RM,
1266            op0.as_operand(),
1267            op1.as_operand(),
1268            &NOREG,
1269            &NOREG,
1270        );
1271    }
1272}
1273
1274impl<'a> CmovpEmitter<Gpq, Gpq> for Assembler<'a> {
1275    fn cmovp(&mut self, op0: Gpq, op1: Gpq) {
1276        self.emit(
1277            CMOVP64RR,
1278            op0.as_operand(),
1279            op1.as_operand(),
1280            &NOREG,
1281            &NOREG,
1282        );
1283    }
1284}
1285
1286impl<'a> CmovpEmitter<Gpq, Mem> for Assembler<'a> {
1287    fn cmovp(&mut self, op0: Gpq, op1: Mem) {
1288        self.emit(
1289            CMOVP64RM,
1290            op0.as_operand(),
1291            op1.as_operand(),
1292            &NOREG,
1293            &NOREG,
1294        );
1295    }
1296}
1297
1298/// `CMOVS`.
1299///
1300/// Supported operand variants:
1301///
1302/// ```text
1303/// +---+----------+
1304/// | # | Operands |
1305/// +---+----------+
1306/// | 1 | Gpd, Gpd |
1307/// | 2 | Gpd, Mem |
1308/// | 3 | Gpq, Gpq |
1309/// | 4 | Gpq, Mem |
1310/// | 5 | Gpw, Gpw |
1311/// | 6 | Gpw, Mem |
1312/// +---+----------+
1313/// ```
1314pub trait CmovsEmitter<A, B> {
1315    fn cmovs(&mut self, op0: A, op1: B);
1316}
1317
1318impl<'a> CmovsEmitter<Gpw, Gpw> for Assembler<'a> {
1319    fn cmovs(&mut self, op0: Gpw, op1: Gpw) {
1320        self.emit(
1321            CMOVS16RR,
1322            op0.as_operand(),
1323            op1.as_operand(),
1324            &NOREG,
1325            &NOREG,
1326        );
1327    }
1328}
1329
1330impl<'a> CmovsEmitter<Gpw, Mem> for Assembler<'a> {
1331    fn cmovs(&mut self, op0: Gpw, op1: Mem) {
1332        self.emit(
1333            CMOVS16RM,
1334            op0.as_operand(),
1335            op1.as_operand(),
1336            &NOREG,
1337            &NOREG,
1338        );
1339    }
1340}
1341
1342impl<'a> CmovsEmitter<Gpd, Gpd> for Assembler<'a> {
1343    fn cmovs(&mut self, op0: Gpd, op1: Gpd) {
1344        self.emit(
1345            CMOVS32RR,
1346            op0.as_operand(),
1347            op1.as_operand(),
1348            &NOREG,
1349            &NOREG,
1350        );
1351    }
1352}
1353
1354impl<'a> CmovsEmitter<Gpd, Mem> for Assembler<'a> {
1355    fn cmovs(&mut self, op0: Gpd, op1: Mem) {
1356        self.emit(
1357            CMOVS32RM,
1358            op0.as_operand(),
1359            op1.as_operand(),
1360            &NOREG,
1361            &NOREG,
1362        );
1363    }
1364}
1365
1366impl<'a> CmovsEmitter<Gpq, Gpq> for Assembler<'a> {
1367    fn cmovs(&mut self, op0: Gpq, op1: Gpq) {
1368        self.emit(
1369            CMOVS64RR,
1370            op0.as_operand(),
1371            op1.as_operand(),
1372            &NOREG,
1373            &NOREG,
1374        );
1375    }
1376}
1377
1378impl<'a> CmovsEmitter<Gpq, Mem> for Assembler<'a> {
1379    fn cmovs(&mut self, op0: Gpq, op1: Mem) {
1380        self.emit(
1381            CMOVS64RM,
1382            op0.as_operand(),
1383            op1.as_operand(),
1384            &NOREG,
1385            &NOREG,
1386        );
1387    }
1388}
1389
1390/// `CMOVZ`.
1391///
1392/// Supported operand variants:
1393///
1394/// ```text
1395/// +---+----------+
1396/// | # | Operands |
1397/// +---+----------+
1398/// | 1 | Gpd, Gpd |
1399/// | 2 | Gpd, Mem |
1400/// | 3 | Gpq, Gpq |
1401/// | 4 | Gpq, Mem |
1402/// | 5 | Gpw, Gpw |
1403/// | 6 | Gpw, Mem |
1404/// +---+----------+
1405/// ```
1406pub trait CmovzEmitter<A, B> {
1407    fn cmovz(&mut self, op0: A, op1: B);
1408}
1409
1410impl<'a> CmovzEmitter<Gpw, Gpw> for Assembler<'a> {
1411    fn cmovz(&mut self, op0: Gpw, op1: Gpw) {
1412        self.emit(
1413            CMOVZ16RR,
1414            op0.as_operand(),
1415            op1.as_operand(),
1416            &NOREG,
1417            &NOREG,
1418        );
1419    }
1420}
1421
1422impl<'a> CmovzEmitter<Gpw, Mem> for Assembler<'a> {
1423    fn cmovz(&mut self, op0: Gpw, op1: Mem) {
1424        self.emit(
1425            CMOVZ16RM,
1426            op0.as_operand(),
1427            op1.as_operand(),
1428            &NOREG,
1429            &NOREG,
1430        );
1431    }
1432}
1433
1434impl<'a> CmovzEmitter<Gpd, Gpd> for Assembler<'a> {
1435    fn cmovz(&mut self, op0: Gpd, op1: Gpd) {
1436        self.emit(
1437            CMOVZ32RR,
1438            op0.as_operand(),
1439            op1.as_operand(),
1440            &NOREG,
1441            &NOREG,
1442        );
1443    }
1444}
1445
1446impl<'a> CmovzEmitter<Gpd, Mem> for Assembler<'a> {
1447    fn cmovz(&mut self, op0: Gpd, op1: Mem) {
1448        self.emit(
1449            CMOVZ32RM,
1450            op0.as_operand(),
1451            op1.as_operand(),
1452            &NOREG,
1453            &NOREG,
1454        );
1455    }
1456}
1457
1458impl<'a> CmovzEmitter<Gpq, Gpq> for Assembler<'a> {
1459    fn cmovz(&mut self, op0: Gpq, op1: Gpq) {
1460        self.emit(
1461            CMOVZ64RR,
1462            op0.as_operand(),
1463            op1.as_operand(),
1464            &NOREG,
1465            &NOREG,
1466        );
1467    }
1468}
1469
1470impl<'a> CmovzEmitter<Gpq, Mem> for Assembler<'a> {
1471    fn cmovz(&mut self, op0: Gpq, op1: Mem) {
1472        self.emit(
1473            CMOVZ64RM,
1474            op0.as_operand(),
1475            op1.as_operand(),
1476            &NOREG,
1477            &NOREG,
1478        );
1479    }
1480}
1481
1482/// `CMOVCC`.
1483///
1484/// Supported operand variants:
1485///
1486/// ```text
1487/// +---+----------+
1488/// | # | Operands |
1489/// +---+----------+
1490/// | 1 | Gpd, Gpd |
1491/// | 2 | Gpd, Mem |
1492/// | 3 | Gpq, Gpq |
1493/// | 4 | Gpq, Mem |
1494/// | 5 | Gpw, Gpw |
1495/// | 6 | Gpw, Mem |
1496/// +---+----------+
1497/// ```
1498pub trait CmovccEmitter<A, B> {
1499    fn cmovcc(&mut self, op0: A, op1: B);
1500}
1501
1502impl<'a> CmovccEmitter<Gpw, Gpw> for Assembler<'a> {
1503    fn cmovcc(&mut self, op0: Gpw, op1: Gpw) {
1504        self.emit(
1505            CMOVCC16RR,
1506            op0.as_operand(),
1507            op1.as_operand(),
1508            &NOREG,
1509            &NOREG,
1510        );
1511    }
1512}
1513
1514impl<'a> CmovccEmitter<Gpw, Mem> for Assembler<'a> {
1515    fn cmovcc(&mut self, op0: Gpw, op1: Mem) {
1516        self.emit(
1517            CMOVCC16RM,
1518            op0.as_operand(),
1519            op1.as_operand(),
1520            &NOREG,
1521            &NOREG,
1522        );
1523    }
1524}
1525
1526impl<'a> CmovccEmitter<Gpd, Gpd> for Assembler<'a> {
1527    fn cmovcc(&mut self, op0: Gpd, op1: Gpd) {
1528        self.emit(
1529            CMOVCC32RR,
1530            op0.as_operand(),
1531            op1.as_operand(),
1532            &NOREG,
1533            &NOREG,
1534        );
1535    }
1536}
1537
1538impl<'a> CmovccEmitter<Gpd, Mem> for Assembler<'a> {
1539    fn cmovcc(&mut self, op0: Gpd, op1: Mem) {
1540        self.emit(
1541            CMOVCC32RM,
1542            op0.as_operand(),
1543            op1.as_operand(),
1544            &NOREG,
1545            &NOREG,
1546        );
1547    }
1548}
1549
1550impl<'a> CmovccEmitter<Gpq, Gpq> for Assembler<'a> {
1551    fn cmovcc(&mut self, op0: Gpq, op1: Gpq) {
1552        self.emit(
1553            CMOVCC64RR,
1554            op0.as_operand(),
1555            op1.as_operand(),
1556            &NOREG,
1557            &NOREG,
1558        );
1559    }
1560}
1561
1562impl<'a> CmovccEmitter<Gpq, Mem> for Assembler<'a> {
1563    fn cmovcc(&mut self, op0: Gpq, op1: Mem) {
1564        self.emit(
1565            CMOVCC64RM,
1566            op0.as_operand(),
1567            op1.as_operand(),
1568            &NOREG,
1569            &NOREG,
1570        );
1571    }
1572}
1573
1574impl<'a> Assembler<'a> {
1575    /// `CMOVA`.
1576    ///
1577    /// Supported operand variants:
1578    ///
1579    /// ```text
1580    /// +---+----------+
1581    /// | # | Operands |
1582    /// +---+----------+
1583    /// | 1 | Gpd, Gpd |
1584    /// | 2 | Gpd, Mem |
1585    /// | 3 | Gpq, Gpq |
1586    /// | 4 | Gpq, Mem |
1587    /// | 5 | Gpw, Gpw |
1588    /// | 6 | Gpw, Mem |
1589    /// +---+----------+
1590    /// ```
1591    #[inline]
1592    pub fn cmova<A, B>(&mut self, op0: A, op1: B)
1593    where
1594        Assembler<'a>: CmovaEmitter<A, B>,
1595    {
1596        <Self as CmovaEmitter<A, B>>::cmova(self, op0, op1);
1597    }
1598    /// `CMOVBE`.
1599    ///
1600    /// Supported operand variants:
1601    ///
1602    /// ```text
1603    /// +---+----------+
1604    /// | # | Operands |
1605    /// +---+----------+
1606    /// | 1 | Gpd, Gpd |
1607    /// | 2 | Gpd, Mem |
1608    /// | 3 | Gpq, Gpq |
1609    /// | 4 | Gpq, Mem |
1610    /// | 5 | Gpw, Gpw |
1611    /// | 6 | Gpw, Mem |
1612    /// +---+----------+
1613    /// ```
1614    #[inline]
1615    pub fn cmovbe<A, B>(&mut self, op0: A, op1: B)
1616    where
1617        Assembler<'a>: CmovbeEmitter<A, B>,
1618    {
1619        <Self as CmovbeEmitter<A, B>>::cmovbe(self, op0, op1);
1620    }
1621    /// `CMOVC`.
1622    ///
1623    /// Supported operand variants:
1624    ///
1625    /// ```text
1626    /// +---+----------+
1627    /// | # | Operands |
1628    /// +---+----------+
1629    /// | 1 | Gpd, Gpd |
1630    /// | 2 | Gpd, Mem |
1631    /// | 3 | Gpq, Gpq |
1632    /// | 4 | Gpq, Mem |
1633    /// | 5 | Gpw, Gpw |
1634    /// | 6 | Gpw, Mem |
1635    /// +---+----------+
1636    /// ```
1637    #[inline]
1638    pub fn cmovc<A, B>(&mut self, op0: A, op1: B)
1639    where
1640        Assembler<'a>: CmovcEmitter<A, B>,
1641    {
1642        <Self as CmovcEmitter<A, B>>::cmovc(self, op0, op1);
1643    }
1644    /// `CMOVG`.
1645    ///
1646    /// Supported operand variants:
1647    ///
1648    /// ```text
1649    /// +---+----------+
1650    /// | # | Operands |
1651    /// +---+----------+
1652    /// | 1 | Gpd, Gpd |
1653    /// | 2 | Gpd, Mem |
1654    /// | 3 | Gpq, Gpq |
1655    /// | 4 | Gpq, Mem |
1656    /// | 5 | Gpw, Gpw |
1657    /// | 6 | Gpw, Mem |
1658    /// +---+----------+
1659    /// ```
1660    #[inline]
1661    pub fn cmovg<A, B>(&mut self, op0: A, op1: B)
1662    where
1663        Assembler<'a>: CmovgEmitter<A, B>,
1664    {
1665        <Self as CmovgEmitter<A, B>>::cmovg(self, op0, op1);
1666    }
1667    /// `CMOVGE`.
1668    ///
1669    /// Supported operand variants:
1670    ///
1671    /// ```text
1672    /// +---+----------+
1673    /// | # | Operands |
1674    /// +---+----------+
1675    /// | 1 | Gpd, Gpd |
1676    /// | 2 | Gpd, Mem |
1677    /// | 3 | Gpq, Gpq |
1678    /// | 4 | Gpq, Mem |
1679    /// | 5 | Gpw, Gpw |
1680    /// | 6 | Gpw, Mem |
1681    /// +---+----------+
1682    /// ```
1683    #[inline]
1684    pub fn cmovge<A, B>(&mut self, op0: A, op1: B)
1685    where
1686        Assembler<'a>: CmovgeEmitter<A, B>,
1687    {
1688        <Self as CmovgeEmitter<A, B>>::cmovge(self, op0, op1);
1689    }
1690    /// `CMOVL`.
1691    ///
1692    /// Supported operand variants:
1693    ///
1694    /// ```text
1695    /// +---+----------+
1696    /// | # | Operands |
1697    /// +---+----------+
1698    /// | 1 | Gpd, Gpd |
1699    /// | 2 | Gpd, Mem |
1700    /// | 3 | Gpq, Gpq |
1701    /// | 4 | Gpq, Mem |
1702    /// | 5 | Gpw, Gpw |
1703    /// | 6 | Gpw, Mem |
1704    /// +---+----------+
1705    /// ```
1706    #[inline]
1707    pub fn cmovl<A, B>(&mut self, op0: A, op1: B)
1708    where
1709        Assembler<'a>: CmovlEmitter<A, B>,
1710    {
1711        <Self as CmovlEmitter<A, B>>::cmovl(self, op0, op1);
1712    }
1713    /// `CMOVLE`.
1714    ///
1715    /// Supported operand variants:
1716    ///
1717    /// ```text
1718    /// +---+----------+
1719    /// | # | Operands |
1720    /// +---+----------+
1721    /// | 1 | Gpd, Gpd |
1722    /// | 2 | Gpd, Mem |
1723    /// | 3 | Gpq, Gpq |
1724    /// | 4 | Gpq, Mem |
1725    /// | 5 | Gpw, Gpw |
1726    /// | 6 | Gpw, Mem |
1727    /// +---+----------+
1728    /// ```
1729    #[inline]
1730    pub fn cmovle<A, B>(&mut self, op0: A, op1: B)
1731    where
1732        Assembler<'a>: CmovleEmitter<A, B>,
1733    {
1734        <Self as CmovleEmitter<A, B>>::cmovle(self, op0, op1);
1735    }
1736    /// `CMOVNC`.
1737    ///
1738    /// Supported operand variants:
1739    ///
1740    /// ```text
1741    /// +---+----------+
1742    /// | # | Operands |
1743    /// +---+----------+
1744    /// | 1 | Gpd, Gpd |
1745    /// | 2 | Gpd, Mem |
1746    /// | 3 | Gpq, Gpq |
1747    /// | 4 | Gpq, Mem |
1748    /// | 5 | Gpw, Gpw |
1749    /// | 6 | Gpw, Mem |
1750    /// +---+----------+
1751    /// ```
1752    #[inline]
1753    pub fn cmovnc<A, B>(&mut self, op0: A, op1: B)
1754    where
1755        Assembler<'a>: CmovncEmitter<A, B>,
1756    {
1757        <Self as CmovncEmitter<A, B>>::cmovnc(self, op0, op1);
1758    }
1759    /// `CMOVNO`.
1760    ///
1761    /// Supported operand variants:
1762    ///
1763    /// ```text
1764    /// +---+----------+
1765    /// | # | Operands |
1766    /// +---+----------+
1767    /// | 1 | Gpd, Gpd |
1768    /// | 2 | Gpd, Mem |
1769    /// | 3 | Gpq, Gpq |
1770    /// | 4 | Gpq, Mem |
1771    /// | 5 | Gpw, Gpw |
1772    /// | 6 | Gpw, Mem |
1773    /// +---+----------+
1774    /// ```
1775    #[inline]
1776    pub fn cmovno<A, B>(&mut self, op0: A, op1: B)
1777    where
1778        Assembler<'a>: CmovnoEmitter<A, B>,
1779    {
1780        <Self as CmovnoEmitter<A, B>>::cmovno(self, op0, op1);
1781    }
1782    /// `CMOVNP`.
1783    ///
1784    /// Supported operand variants:
1785    ///
1786    /// ```text
1787    /// +---+----------+
1788    /// | # | Operands |
1789    /// +---+----------+
1790    /// | 1 | Gpd, Gpd |
1791    /// | 2 | Gpd, Mem |
1792    /// | 3 | Gpq, Gpq |
1793    /// | 4 | Gpq, Mem |
1794    /// | 5 | Gpw, Gpw |
1795    /// | 6 | Gpw, Mem |
1796    /// +---+----------+
1797    /// ```
1798    #[inline]
1799    pub fn cmovnp<A, B>(&mut self, op0: A, op1: B)
1800    where
1801        Assembler<'a>: CmovnpEmitter<A, B>,
1802    {
1803        <Self as CmovnpEmitter<A, B>>::cmovnp(self, op0, op1);
1804    }
1805    /// `CMOVNS`.
1806    ///
1807    /// Supported operand variants:
1808    ///
1809    /// ```text
1810    /// +---+----------+
1811    /// | # | Operands |
1812    /// +---+----------+
1813    /// | 1 | Gpd, Gpd |
1814    /// | 2 | Gpd, Mem |
1815    /// | 3 | Gpq, Gpq |
1816    /// | 4 | Gpq, Mem |
1817    /// | 5 | Gpw, Gpw |
1818    /// | 6 | Gpw, Mem |
1819    /// +---+----------+
1820    /// ```
1821    #[inline]
1822    pub fn cmovns<A, B>(&mut self, op0: A, op1: B)
1823    where
1824        Assembler<'a>: CmovnsEmitter<A, B>,
1825    {
1826        <Self as CmovnsEmitter<A, B>>::cmovns(self, op0, op1);
1827    }
1828    /// `CMOVNZ`.
1829    ///
1830    /// Supported operand variants:
1831    ///
1832    /// ```text
1833    /// +---+----------+
1834    /// | # | Operands |
1835    /// +---+----------+
1836    /// | 1 | Gpd, Gpd |
1837    /// | 2 | Gpd, Mem |
1838    /// | 3 | Gpq, Gpq |
1839    /// | 4 | Gpq, Mem |
1840    /// | 5 | Gpw, Gpw |
1841    /// | 6 | Gpw, Mem |
1842    /// +---+----------+
1843    /// ```
1844    #[inline]
1845    pub fn cmovnz<A, B>(&mut self, op0: A, op1: B)
1846    where
1847        Assembler<'a>: CmovnzEmitter<A, B>,
1848    {
1849        <Self as CmovnzEmitter<A, B>>::cmovnz(self, op0, op1);
1850    }
1851    /// `CMOVO`.
1852    ///
1853    /// Supported operand variants:
1854    ///
1855    /// ```text
1856    /// +---+----------+
1857    /// | # | Operands |
1858    /// +---+----------+
1859    /// | 1 | Gpd, Gpd |
1860    /// | 2 | Gpd, Mem |
1861    /// | 3 | Gpq, Gpq |
1862    /// | 4 | Gpq, Mem |
1863    /// | 5 | Gpw, Gpw |
1864    /// | 6 | Gpw, Mem |
1865    /// +---+----------+
1866    /// ```
1867    #[inline]
1868    pub fn cmovo<A, B>(&mut self, op0: A, op1: B)
1869    where
1870        Assembler<'a>: CmovoEmitter<A, B>,
1871    {
1872        <Self as CmovoEmitter<A, B>>::cmovo(self, op0, op1);
1873    }
1874    /// `CMOVP`.
1875    ///
1876    /// Supported operand variants:
1877    ///
1878    /// ```text
1879    /// +---+----------+
1880    /// | # | Operands |
1881    /// +---+----------+
1882    /// | 1 | Gpd, Gpd |
1883    /// | 2 | Gpd, Mem |
1884    /// | 3 | Gpq, Gpq |
1885    /// | 4 | Gpq, Mem |
1886    /// | 5 | Gpw, Gpw |
1887    /// | 6 | Gpw, Mem |
1888    /// +---+----------+
1889    /// ```
1890    #[inline]
1891    pub fn cmovp<A, B>(&mut self, op0: A, op1: B)
1892    where
1893        Assembler<'a>: CmovpEmitter<A, B>,
1894    {
1895        <Self as CmovpEmitter<A, B>>::cmovp(self, op0, op1);
1896    }
1897    /// `CMOVS`.
1898    ///
1899    /// Supported operand variants:
1900    ///
1901    /// ```text
1902    /// +---+----------+
1903    /// | # | Operands |
1904    /// +---+----------+
1905    /// | 1 | Gpd, Gpd |
1906    /// | 2 | Gpd, Mem |
1907    /// | 3 | Gpq, Gpq |
1908    /// | 4 | Gpq, Mem |
1909    /// | 5 | Gpw, Gpw |
1910    /// | 6 | Gpw, Mem |
1911    /// +---+----------+
1912    /// ```
1913    #[inline]
1914    pub fn cmovs<A, B>(&mut self, op0: A, op1: B)
1915    where
1916        Assembler<'a>: CmovsEmitter<A, B>,
1917    {
1918        <Self as CmovsEmitter<A, B>>::cmovs(self, op0, op1);
1919    }
1920    /// `CMOVZ`.
1921    ///
1922    /// Supported operand variants:
1923    ///
1924    /// ```text
1925    /// +---+----------+
1926    /// | # | Operands |
1927    /// +---+----------+
1928    /// | 1 | Gpd, Gpd |
1929    /// | 2 | Gpd, Mem |
1930    /// | 3 | Gpq, Gpq |
1931    /// | 4 | Gpq, Mem |
1932    /// | 5 | Gpw, Gpw |
1933    /// | 6 | Gpw, Mem |
1934    /// +---+----------+
1935    /// ```
1936    #[inline]
1937    pub fn cmovz<A, B>(&mut self, op0: A, op1: B)
1938    where
1939        Assembler<'a>: CmovzEmitter<A, B>,
1940    {
1941        <Self as CmovzEmitter<A, B>>::cmovz(self, op0, op1);
1942    }
1943    /// `CMOVCC`.
1944    ///
1945    /// Supported operand variants:
1946    ///
1947    /// ```text
1948    /// +---+----------+
1949    /// | # | Operands |
1950    /// +---+----------+
1951    /// | 1 | Gpd, Gpd |
1952    /// | 2 | Gpd, Mem |
1953    /// | 3 | Gpq, Gpq |
1954    /// | 4 | Gpq, Mem |
1955    /// | 5 | Gpw, Gpw |
1956    /// | 6 | Gpw, Mem |
1957    /// +---+----------+
1958    /// ```
1959    #[inline]
1960    pub fn cmovcc<A, B>(&mut self, op0: A, op1: B)
1961    where
1962        Assembler<'a>: CmovccEmitter<A, B>,
1963    {
1964        <Self as CmovccEmitter<A, B>>::cmovcc(self, op0, op1);
1965    }
1966}