-
Notifications
You must be signed in to change notification settings - Fork 0
/
jazz-jit.hpp
1344 lines (938 loc) · 36.1 KB
/
jazz-jit.hpp
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#include <cstdarg>
#include <cstdint>
#include <cstdlib>
namespace jazz_jit
{
static const uintptr_t PAGE_SIZE = 4096;
enum class CondCode
{
Zero,
NonZero,
Equal,
NotEqual,
Greater,
GreaterEq,
Less,
LessEq,
UnsignedGreater,
UnsignedGreaterEq,
UnsignedLess,
UnsignedLessEq,
};
enum class MachineMode
{
Int8,
Int32,
Int64,
Float32,
Float64,
Ptr,
};
enum class Register : int32_t
{
RAX = 0,
RCX = 1,
RDX = 2,
RBX = 3,
RSP = 4,
RBP = 5,
RSI = 6,
RDI = 7,
R8 = 8,
R9 = 9,
R10 = 10,
R11 = 11,
R12 = 12,
R13 = 13,
R14 = 14,
R15 = 15,
RIP = 16,
/// Signals an illegal register.
kNoRegister = -1,
};
enum class XMMRegister : int32_t
{
XMM0 = 0,
XMM1 = 1,
XMM2 = 2,
XMM3 = 3,
XMM4 = 4,
XMM5 = 5,
XMM6 = 6,
XMM7 = 7,
XMM8 = 8,
XMM9 = 9,
XMM10 = 10,
XMM11 = 11,
XMM12 = 12,
XMM13 = 13,
XMM14 = 14,
XMM15 = 15,
kNumberOfXmmRegisters = 16,
kNoXmmRegister = -1,
};
template <typename T>
struct Option
{
};
template <typename T>
struct Vec
{
};
struct f32x4
{
float v1, v2, v3, v4;
};
struct Value
{
enum class Tag
{
Ptr,
Float,
Double,
Int,
F4,
};
struct Ptr_Body
{
const uint8_t *_0;
};
struct Float_Body
{
float _0;
};
struct Double_Body
{
double _0;
};
struct Int_Body
{
int32_t _0;
};
struct F4_Body
{
f32x4 _0;
};
Tag tag;
union {
Ptr_Body ptr;
Float_Body float_;
Double_Body double_;
Int_Body int_;
F4_Body f4;
};
};
struct Entry
{
int32_t disp;
Value value;
};
struct DSeg
{
Vec<Entry> entries;
int32_t size;
};
struct ForwardJump
{
uintptr_t at;
uintptr_t to;
};
struct Assembler
{
Vec<uint8_t> data;
DSeg dseg;
Vec<ForwardJump> jumps;
Vec<Option<uintptr_t>> labels;
};
struct Reg
{
enum class Tag
{
Gpr,
Float
};
struct Gpr_Body
{
Register _0;
};
struct Float_Body
{
XMMRegister _0;
};
Tag tag;
union {
Gpr_Body gpr;
Float_Body fpr;
};
};
struct Mem
{
enum class Tag
{
Local,
Base,
Index,
Offset,
};
struct Local_Body
{
int32_t _0;
};
struct Base_Body
{
Register _0;
int32_t _1;
};
struct Index_Body
{
Register _0;
Register _1;
int32_t _2;
int32_t _3;
};
struct Offset_Body
{
Register _0;
int32_t _1;
int32_t _2;
};
Tag tag;
union {
Local_Body local;
Base_Body base;
Index_Body index;
Offset_Body offset;
};
};
using Label = uintptr_t;
struct Memory
{
const uint8_t *start;
const uint8_t *end;
const uint8_t *pointer;
uintptr_t size;
};
extern "C"
{
void asm_load_int(Assembler *buf, MachineMode mode, long imm,Register dest);
void asm_load_float(Assembler *buf, MachineMode mode, double imm,XMMRegister dest);
void addps(Assembler *buf, XMMRegister dest, XMMRegister src);
void addsd(Assembler *buf, XMMRegister dest, XMMRegister src);
void addss(Assembler *buf, XMMRegister dest, XMMRegister src);
void cmov(Assembler *buf,
uint8_t x64,
Register dest,
Register src,
CondCode cond);
void cvtps2dq(Assembler *buf, XMMRegister dst, XMMRegister src);
void cvtps2dq_mem(Assembler *buf, XMMRegister dst, Mem src);
void cvtsd2ss(Assembler *buf, XMMRegister dest, XMMRegister src);
void cvtsi2sd(Assembler *buf, XMMRegister dest, uint8_t x64, Register src);
void cvtsi2ss(Assembler *buf, XMMRegister dest, uint8_t x64, Register src);
void cvtss2sd(Assembler *buf, XMMRegister dest, XMMRegister src);
void cvttsd2si(Assembler *buf, uint8_t x64, Register dest, XMMRegister src);
void cvttss2si(Assembler *buf, uint8_t x64, Register dest, XMMRegister src);
void divps(Assembler *buf, XMMRegister dest, XMMRegister src);
void divsd(Assembler *buf, XMMRegister dest, XMMRegister src);
void divss(Assembler *buf, XMMRegister dest, XMMRegister src);
void emit(Assembler *buf, uint8_t val);
void emit32(Assembler *buf, uint32_t val);
void emit64(Assembler *buf, uint64_t val);
void emit_add_reg_reg(Assembler *buf,
uint8_t x64,
Register src,
Register dest);
void emit_addq_imm_reg(Assembler *buf, int32_t imm, Register reg);
void emit_and_reg_reg(Assembler *buf,
uint8_t x64,
Register src,
Register dest);
void emit_andb_imm_reg(Assembler *buf, uint8_t imm, Register dest);
void emit_andq_imm_reg(Assembler *buf, int32_t imm, Register reg);
void emit_callq_reg(Assembler *buf, Register dest);
void emit_cdq(Assembler *buf);
void emit_cmp_imm_reg(Assembler *buf,
MachineMode mode,
int32_t imm,
Register reg);
void emit_cmp_mem_imm(Assembler *buf,
MachineMode mode,
Register base,
int32_t disp,
int32_t imm);
void emit_cmp_mem_reg(Assembler *buf,
MachineMode mode,
Register base,
int32_t disp,
Register dest);
void emit_cmp_memindex_reg(Assembler *buf,
MachineMode mode,
Register base,
Register index,
int32_t scale,
int32_t disp,
Register dest);
void emit_cmp_reg_reg(Assembler *buf,
uint8_t x64,
Register src,
Register dest);
void emit_cmpb_imm_reg(Assembler *buf, uint8_t imm, Register dest);
void emit_cqo(Assembler *buf);
void emit_idiv_reg_reg(Assembler *buf, uint8_t x64, Register reg);
void emit_imul_reg_reg(Assembler *buf,
uint8_t x64,
Register src,
Register dest);
void emit_jcc(Assembler *buf, CondCode cond, Label lbl);
void emit_jmp(Assembler *buf, Label lbl);
void emit_jmp_reg(Assembler *buf, Register reg);
void emit_mem(Assembler *buf, Register dest, const Mem *src);
void emit_modrm(Assembler *buf, uint8_t mode, uint8_t reg, uint8_t rm);
void emit_mov_memindex_reg(Assembler *buf,
MachineMode mode,
Register base,
Register index,
int32_t scale,
int32_t disp,
Register dest);
void emit_mov_reg_memindex(Assembler *buf,
MachineMode mode,
Register src,
Register base,
Register index,
int32_t scale,
int32_t disp);
void emit_mov_reg_reg(Assembler *buf,
uint8_t x64,
Register src,
Register dest);
void emit_movb_imm_memq(Assembler *buf,
uint8_t imm,
Register dest,
int32_t disp);
void emit_movb_imm_memscaleq(Assembler *buf,
uint8_t imm,
Register base,
Register index,
uint8_t scale);
void emit_movb_memq_reg(Assembler *buf,
Register src,
int32_t disp,
Register dest);
void emit_movb_reg_memq(Assembler *buf,
Register src,
Register dest,
int32_t disp);
void emit_movb_reg_reg(Assembler *buf, Register src, Register dest);
void emit_movl_ar(Assembler *buf,
Register base,
Register index,
uint8_t scale,
Register dest);
void emit_movl_imm_reg(Assembler *buf, int32_t imm, Register reg);
void emit_movl_memq_reg(Assembler *buf,
Register src,
int32_t disp,
Register dest);
void emit_movl_ra(Assembler *buf,
Register src,
Register base,
Register index,
uint8_t scale);
void emit_movl_reg_memq(Assembler *buf,
Register src,
Register dest,
int32_t disp);
void emit_movq_ar(Assembler *buf,
Register base,
Register index,
uint8_t scale,
Register dest);
void emit_movq_imm64_reg(Assembler *buf, int64_t imm, Register reg);
void emit_movq_imm_reg(Assembler *buf, int32_t imm, Register reg);
void emit_movq_memq_reg(Assembler *buf,
Register src,
int32_t disp,
Register dest);
void emit_movq_ra(Assembler *buf,
Register src,
Register base,
Register index,
uint8_t scale);
void emit_movq_reg_memq(Assembler *buf,
Register src,
Register dest,
int32_t disp);
void emit_movsx(Assembler *buf, Register src, Register dest);
void emit_movzbl_memq_reg(Assembler *buf,
Register src,
int32_t disp,
Register dest);
void emit_movzbl_reg_reg(Assembler *buf, Register src, Register dest);
void emit_movzx_memindex_byte_reg(Assembler *buf,
uint8_t x64,
Register base,
Register index,
int32_t disp,
Register dest);
void emit_neg_reg(Assembler *buf, uint8_t x64, Register reg);
void emit_nop(Assembler *buf);
void emit_not_reg(Assembler *buf, uint8_t x64, Register reg);
void emit_not_reg_byte(Assembler *buf, Register reg);
void emit_op(Assembler *buf, uint8_t opcode);
void emit_or_reg_reg(Assembler *buf,
uint8_t x64,
Register src,
Register dest);
void emit_popq_reg(Assembler *buf, Register reg);
void emit_pushq_reg(Assembler *buf, Register reg);
void emit_retq(Assembler *buf);
void emit_rex(Assembler *buf, uint8_t w, uint8_t r, uint8_t x, uint8_t b);
void emit_rex_mem(Assembler *buf, uint8_t x64, Register dest, const Mem *src);
void emit_setb_reg(Assembler *buf, CondCode op, Register reg);
void emit_setb_reg_parity(Assembler *buf, Register reg, bool parity);
void emit_shl_reg_cl(Assembler *buf, uint8_t x64, Register dest);
void emit_shll_reg(Assembler *buf, uint8_t imm, Register dest);
void emit_shlq_reg(Assembler *buf, uint8_t imm, Register dest);
void emit_shr_reg_cl(Assembler *buf, uint8_t x64, Register dest);
void emit_sib(Assembler *buf, uint8_t scale, uint8_t index, uint8_t base);
void emit_sub_imm_mem(Assembler *buf,
MachineMode mode,
Register base,
uint8_t imm);
void emit_sub_reg_reg(Assembler *buf,
uint8_t x64,
Register src,
Register dest);
void emit_subq_imm_reg(Assembler *buf, int32_t imm, Register reg);
void emit_testl_reg_reg(Assembler *buf, Register op1, Register op2);
void emit_testq_reg_reg(Assembler *buf, Register op1, Register op2);
void emit_xor_reg_reg(Assembler *buf,
uint8_t x64,
Register src,
Register dest);
void emit_xorb_imm_reg(Assembler *buf, uint8_t imm, Register dest);
bool fits_i32(int64_t n);
bool fits_i8(int32_t imm);
Memory get_executable_memory(const Assembler *buf);
void lea(Assembler *buf, Register dest, Mem src);
Reg reg_gpr(Register reg);
Reg reg_fpr(XMMRegister reg);
Mem mem_base(Register reg, int32_t off);
Mem mem_index(Register reg, Register reg2, int32_t v1, int32_t v2);
Mem mem_local(int32_t off);
Mem mem_offset(Register reg, int32_t v1, int32_t v2);
void movaps(Assembler *buf, XMMRegister dest, XMMRegister src);
void movaps_load(Assembler *buf, XMMRegister dest, Mem src);
void movaps_store(Assembler *buf, Mem dest, XMMRegister src);
void movd_freg_reg(Assembler *buf, XMMRegister dest, Register src);
void movd_reg_freg(Assembler *buf, Register dest, XMMRegister src);
void movlps(Assembler *buf, XMMRegister dest, XMMRegister src);
void movq_freg_reg(Assembler *buf, XMMRegister dest, Register src);
void movq_reg_freg(Assembler *buf, Register dest, XMMRegister src);
void movsd(Assembler *buf, XMMRegister dest, XMMRegister src);
void movsd_load(Assembler *buf, XMMRegister dest, Mem mem);
void movsd_store(Assembler *buf, Mem mem, XMMRegister src);
void movss(Assembler *buf, XMMRegister dest, XMMRegister src);
void movss_load(Assembler *buf, XMMRegister dest, Mem mem);
void movss_store(Assembler *buf, Mem mem, XMMRegister src);
void movups(Assembler *buf, XMMRegister dest, XMMRegister src);
void movups_load(Assembler *buf, XMMRegister dest, Mem src);
void movups_store(Assembler *buf, Mem dest, XMMRegister src);
void mulps(Assembler *buf, XMMRegister dest, XMMRegister src);
void mulsd(Assembler *buf, XMMRegister dest, XMMRegister src);
void mulss(Assembler *buf, XMMRegister dest, XMMRegister src);
f32x4 new_f32x4(float v1, float v2, float v3, float v4);
void pabsb(Assembler *buf, XMMRegister dst, XMMRegister src);
void pabsb_mem(Assembler *buf, XMMRegister dst, Mem src);
void pabsd(Assembler *buf, XMMRegister dst, XMMRegister src);
void pabsd_mem(Assembler *buf, XMMRegister dst, Mem src);
void pabsw(Assembler *buf, XMMRegister dst, XMMRegister src);
void pabsw_mem(Assembler *buf, XMMRegister dst, Mem src);
void packssdw(Assembler *buf, XMMRegister dst, XMMRegister src);
void packssdw_mem(Assembler *buf, XMMRegister dst, Mem src);
void packsswb(Assembler *buf, XMMRegister dst, XMMRegister src);
void packsswb_mem(Assembler *buf, XMMRegister dst, Mem src);
void packusdw(Assembler *buf, XMMRegister dst, XMMRegister src);
void packusdw_mem(Assembler *buf, XMMRegister dst, Mem src);
void packuswb(Assembler *buf, XMMRegister dst, XMMRegister src);
void packuswb_mem(Assembler *buf, XMMRegister dst, Mem src);
void paddb(Assembler *buf, XMMRegister dst, XMMRegister src);
void paddb_mem(Assembler *buf, XMMRegister dst, Mem src);
void paddd(Assembler *buf, XMMRegister dst, XMMRegister src);
void paddd_mem(Assembler *buf, XMMRegister dst, Mem src);
void paddsb(Assembler *buf, XMMRegister dst, XMMRegister src);
void paddsb_mem(Assembler *buf, XMMRegister dst, Mem src);
void paddsw(Assembler *buf, XMMRegister dst, XMMRegister src);
void paddsw_mem(Assembler *buf, XMMRegister dst, Mem src);
void paddusb(Assembler *buf, XMMRegister dst, XMMRegister src);
void paddusb_mem(Assembler *buf, XMMRegister dst, Mem src);
void paddusw(Assembler *buf, XMMRegister dst, XMMRegister src);
void paddusw_mem(Assembler *buf, XMMRegister dst, Mem src);
void paddw(Assembler *buf, XMMRegister dst, XMMRegister src);
void paddw_mem(Assembler *buf, XMMRegister dst, Mem src);
void pand(Assembler *buf, XMMRegister dst, XMMRegister src);
void pand_mem(Assembler *buf, XMMRegister dst, Mem src);
void pcmpeqb(Assembler *buf, XMMRegister dst, XMMRegister src);
void pcmpeqb_mem(Assembler *buf, XMMRegister dst, Mem src);
void pcmpeqd(Assembler *buf, XMMRegister dst, XMMRegister src);
void pcmpeqd_mem(Assembler *buf, XMMRegister dst, Mem src);
void pcmpeqw(Assembler *buf, XMMRegister dst, XMMRegister src);
void pcmpeqw_mem(Assembler *buf, XMMRegister dst, Mem src);
void pcmpgtb(Assembler *buf, XMMRegister dst, XMMRegister src);
void pcmpgtb_mem(Assembler *buf, XMMRegister dst, Mem src);
void pcmpgtd(Assembler *buf, XMMRegister dst, XMMRegister src);
void pcmpgtd_mem(Assembler *buf, XMMRegister dst, Mem src);
void pcmpgtw(Assembler *buf, XMMRegister dst, XMMRegister src);
void pcmpgtw_mem(Assembler *buf, XMMRegister dst, Mem src);
void phaddd(Assembler *buf, XMMRegister dst, XMMRegister src);
void phaddd_mem(Assembler *buf, XMMRegister dst, Mem src);
void phaddw(Assembler *buf, XMMRegister dst, XMMRegister src);
void phaddw_mem(Assembler *buf, XMMRegister dst, Mem src);
void pmaxsb(Assembler *buf, XMMRegister dst, XMMRegister src);
void pmaxsb_mem(Assembler *buf, XMMRegister dst, Mem src);
void pmaxsd(Assembler *buf, XMMRegister dst, XMMRegister src);
void pmaxsd_mem(Assembler *buf, XMMRegister dst, Mem src);
void pmaxsw(Assembler *buf, XMMRegister dst, XMMRegister src);
void pmaxsw_mem(Assembler *buf, XMMRegister dst, Mem src);
void pmaxub(Assembler *buf, XMMRegister dst, XMMRegister src);
void pmaxub_mem(Assembler *buf, XMMRegister dst, Mem src);
void pmaxud(Assembler *buf, XMMRegister dst, XMMRegister src);
void pmaxud_mem(Assembler *buf, XMMRegister dst, Mem src);
void pmaxuw(Assembler *buf, XMMRegister dst, XMMRegister src);
void pmaxuw_mem(Assembler *buf, XMMRegister dst, Mem src);
void pminsb(Assembler *buf, XMMRegister dst, XMMRegister src);
void pminsb_mem(Assembler *buf, XMMRegister dst, Mem src);
void pminsd(Assembler *buf, XMMRegister dst, XMMRegister src);
void pminsd_mem(Assembler *buf, XMMRegister dst, Mem src);
void pminsw(Assembler *buf, XMMRegister dst, XMMRegister src);
void pminsw_mem(Assembler *buf, XMMRegister dst, Mem src);
void pminub(Assembler *buf, XMMRegister dst, XMMRegister src);
void pminub_mem(Assembler *buf, XMMRegister dst, Mem src);
void pminud(Assembler *buf, XMMRegister dst, XMMRegister src);
void pminud_mem(Assembler *buf, XMMRegister dst, Mem src);
void pminuw(Assembler *buf, XMMRegister dst, XMMRegister src);
void pminuw_mem(Assembler *buf, XMMRegister dst, Mem src);
void pmovsxbw(Assembler *buf, XMMRegister dst, XMMRegister src);
void pmovsxbw_mem(Assembler *buf, XMMRegister dst, Mem src);
void pmovsxwd(Assembler *buf, XMMRegister dst, XMMRegister src);
void pmovsxwd_mem(Assembler *buf, XMMRegister dst, Mem src);
void pmovzxbw(Assembler *buf, XMMRegister dst, XMMRegister src);
void pmovzxbw_mem(Assembler *buf, XMMRegister dst, Mem src);
void pmovzxwd(Assembler *buf, XMMRegister dst, XMMRegister src);
void pmovzxwd_mem(Assembler *buf, XMMRegister dst, Mem src);
void pmulld(Assembler *buf, XMMRegister dst, XMMRegister src);
void pmulld_mem(Assembler *buf, XMMRegister dst, Mem src);
void pmullw(Assembler *buf, XMMRegister dst, XMMRegister src);
void pmullw_mem(Assembler *buf, XMMRegister dst, Mem src);
void pmuludq(Assembler *buf, XMMRegister dst, XMMRegister src);
void pmuludq_mem(Assembler *buf, XMMRegister dst, Mem src);
void por(Assembler *buf, XMMRegister dst, XMMRegister src);
void por_mem(Assembler *buf, XMMRegister dst, Mem src);
void pshufb(Assembler *buf, XMMRegister dst, XMMRegister src);
void pshufb_mem(Assembler *buf, XMMRegister dst, Mem src);
void psignb(Assembler *buf, XMMRegister dst, XMMRegister src);
void psignb_mem(Assembler *buf, XMMRegister dst, Mem src);
void psignd(Assembler *buf, XMMRegister dst, XMMRegister src);
void psignd_mem(Assembler *buf, XMMRegister dst, Mem src);
void psignw(Assembler *buf, XMMRegister dst, XMMRegister src);
void psignw_mem(Assembler *buf, XMMRegister dst, Mem src);
void pslld(Assembler *buf, XMMRegister dst, XMMRegister src);
void pslld_mem(Assembler *buf, XMMRegister dst, Mem src);
void psllw(Assembler *buf, XMMRegister dst, XMMRegister src);
void psllw_mem(Assembler *buf, XMMRegister dst, Mem src);
void psrad(Assembler *buf, XMMRegister dst, XMMRegister src);
void psrad_mem(Assembler *buf, XMMRegister dst, Mem src);
void psraw(Assembler *buf, XMMRegister dst, XMMRegister src);
void psraw_mem(Assembler *buf, XMMRegister dst, Mem src);
void psrld(Assembler *buf, XMMRegister dst, XMMRegister src);
void psrld_mem(Assembler *buf, XMMRegister dst, Mem src);
void psrlw(Assembler *buf, XMMRegister dst, XMMRegister src);
void psrlw_mem(Assembler *buf, XMMRegister dst, Mem src);
void psubb(Assembler *buf, XMMRegister dst, XMMRegister src);
void psubb_mem(Assembler *buf, XMMRegister dst, Mem src);
void psubd(Assembler *buf, XMMRegister dst, XMMRegister src);
void psubd_mem(Assembler *buf, XMMRegister dst, Mem src);
void psubsb(Assembler *buf, XMMRegister dst, XMMRegister src);
void psubsb_mem(Assembler *buf, XMMRegister dst, Mem src);
void psubsw(Assembler *buf, XMMRegister dst, XMMRegister src);
void psubsw_mem(Assembler *buf, XMMRegister dst, Mem src);
void psubusb(Assembler *buf, XMMRegister dst, XMMRegister src);
void psubusb_mem(Assembler *buf, XMMRegister dst, Mem src);
void psubusw(Assembler *buf, XMMRegister dst, XMMRegister src);
void psubusw_mem(Assembler *buf, XMMRegister dst, Mem src);
void psubw(Assembler *buf, XMMRegister dst, XMMRegister src);
void psubw_mem(Assembler *buf, XMMRegister dst, Mem src);
void ptest(Assembler *buf, XMMRegister dst, XMMRegister src);
void punpckhbw(Assembler *buf, XMMRegister dst, XMMRegister src);
void punpckhbw_mem(Assembler *buf, XMMRegister dst, Mem src);
void punpckhdq(Assembler *buf, XMMRegister dst, XMMRegister src);
void punpckhdq_mem(Assembler *buf, XMMRegister dst, Mem src);
void punpckhqdq(Assembler *buf, XMMRegister dst, XMMRegister src);
void punpckhqdq_mem(Assembler *buf, XMMRegister dst, Mem src);
void punpckhwd(Assembler *buf, XMMRegister dst, XMMRegister src);
void punpckhwd_mem(Assembler *buf, XMMRegister dst, Mem src);
void punpcklbw(Assembler *buf, XMMRegister dst, XMMRegister src);
void punpcklbw_mem(Assembler *buf, XMMRegister dst, Mem src);
void punpckldq(Assembler *buf, XMMRegister dst, XMMRegister src);
void punpckldq_mem(Assembler *buf, XMMRegister dst, Mem src);
void punpcklqdq(Assembler *buf, XMMRegister dst, XMMRegister src);
void punpcklqdq_mem(Assembler *buf, XMMRegister dst, Mem src);
void punpcklwd(Assembler *buf, XMMRegister dst, XMMRegister src);
void punpcklwd_mem(Assembler *buf, XMMRegister dst, Mem src);
void pxor(Assembler *buf, XMMRegister dst, XMMRegister src);
void pxor_mem(Assembler *buf, XMMRegister dst, Mem src);
void sqrtps(Assembler *buf, XMMRegister dest, XMMRegister src);
void sqrtsd(Assembler *buf, XMMRegister dest, XMMRegister src);
void sqrtss(Assembler *buf, XMMRegister dest, XMMRegister src);
void sse_float_freg_freg(Assembler *buf,
bool dbl,
uint8_t op,
XMMRegister dest,
XMMRegister src);
void sse_float_freg_mem(Assembler *buf,
bool dbl,
uint8_t op,
XMMRegister dest,
Mem src);
void sse_float_freg_mem_66(Assembler *buf,
bool dbl,
uint8_t op,
XMMRegister dest,
Mem src);
void sse_float_freg_reg(Assembler *buf,
bool dbl,
uint8_t op,
XMMRegister dest,
uint8_t x64,
Register src);
void sse_float_reg_freg(Assembler *buf,
bool dbl,
uint8_t op,
uint8_t x64,
Register dest,
XMMRegister src);
void sse_packed_freg_freg(Assembler *buf,
uint8_t op,
XMMRegister dest,
XMMRegister src);
void sse_packed_freg_mem(Assembler *buf,
uint8_t op,
XMMRegister dest,
Mem src);
void subps(Assembler *buf, XMMRegister dest, XMMRegister src);
void subsd(Assembler *buf, XMMRegister dest, XMMRegister src);
void subss(Assembler *buf, XMMRegister dest, XMMRegister src);
void testl_reg_mem(Assembler *buf, Register dest, Mem src);
void ucomisd(Assembler *buf, XMMRegister dest, XMMRegister src);
void ucomiss(Assembler *buf, XMMRegister dest, XMMRegister src);
void vcvtps2dq(Assembler *buf,
XMMRegister dst,
XMMRegister src1,
XMMRegister src2);
void vmovaps(Assembler *buf, XMMRegister dst, XMMRegister src);
void vmovaps_mem(Assembler *buf, XMMRegister dst, Mem src);
void vmovd_freg_mem(Assembler *buf, XMMRegister dst, Mem src);
void vmovd_reg_freg(Assembler *buf, Register dst, XMMRegister src);
void vmovq_freg_mem(Assembler *buf, XMMRegister dst, Mem src);
void vmovq_reg_freg(Assembler *buf, Register dst, XMMRegister src);
void vpackssdw(Assembler *buf,
XMMRegister dst,
XMMRegister src1,
XMMRegister src2);
void vpackssdw_mem(Assembler *buf,
XMMRegister dst,
XMMRegister src1,
Mem src2);
void vpacksswb(Assembler *buf,
XMMRegister dst,
XMMRegister src1,
XMMRegister src2);
void vpacksswb_mem(Assembler *buf,
XMMRegister dst,
XMMRegister src1,
Mem src2);
void vpackuswb(Assembler *buf,
XMMRegister dst,
XMMRegister src1,
XMMRegister src2);
void vpackuswb_mem(Assembler *buf,
XMMRegister dst,
XMMRegister src1,
Mem src2);
void vpaddb(Assembler *buf,
XMMRegister dst,
XMMRegister src1,
XMMRegister src2);
void vpaddb_mem(Assembler *buf, XMMRegister dst, XMMRegister src1, Mem src2);
void vpaddd(Assembler *buf,
XMMRegister dst,
XMMRegister src1,
XMMRegister src2);
void vpaddd_mem(Assembler *buf, XMMRegister dst, XMMRegister src1, Mem src2);
void vpaddsb(Assembler *buf,
XMMRegister dst,
XMMRegister src1,
XMMRegister src2);
void vpaddsb_mem(Assembler *buf, XMMRegister dst, XMMRegister src1, Mem src2);