-
Notifications
You must be signed in to change notification settings - Fork 0
/
encode.go
12169 lines (11129 loc) · 376 KB
/
encode.go
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
// This file was generated. DO NOT EDIT.
package arm64
import "errors"
var errOverflow = errors.New("overflow")
func encode_perm_undef(imm16 uint32) (ins uint32, err error) {
switch {
case imm16 > 0xffff:
err = errOverflow
default:
// encoding_UDF_only_perm_undef
}
ins |= imm16
return
}
func encode_mortlach_f32f32_prod(Zm, Pm, Pn, Zn, S, ZAda uint32) (ins uint32, err error) {
switch {
case Zm > 0x1f || Pm > 0x7 || Pn > 0x7 || Zn > 0x1f || S > 0x1 || ZAda > 0x3:
err = errOverflow
case S == 0x0:
// encoding_fmopa_za_pp_zz_32
case S == 0x1:
// encoding_fmops_za_pp_zz_32
default:
err = errUnmatched
}
ins |= (Zm << 16) | (Pm << 13) | (Pn << 10) | (Zn << 5) | (S << 4) | ZAda
ins |= 0x80800000
return
}
func encode_mortlach_b16f32_prod(Zm, Pm, Pn, Zn, S, ZAda uint32) (ins uint32, err error) {
switch {
case Zm > 0x1f || Pm > 0x7 || Pn > 0x7 || Zn > 0x1f || S > 0x1 || ZAda > 0x3:
err = errOverflow
case S == 0x0:
// encoding_bfmopa_za32_pp_zz_
case S == 0x1:
// encoding_bfmops_za32_pp_zz_
default:
err = errUnmatched
}
ins |= (Zm << 16) | (Pm << 13) | (Pn << 10) | (Zn << 5) | (S << 4) | ZAda
ins |= 0x81800000
return
}
func encode_mortlach_f16f32_prod(Zm, Pm, Pn, Zn, S, ZAda uint32) (ins uint32, err error) {
switch {
case Zm > 0x1f || Pm > 0x7 || Pn > 0x7 || Zn > 0x1f || S > 0x1 || ZAda > 0x3:
err = errOverflow
case S == 0x0:
// encoding_fmopa_za32_pp_zz_16
case S == 0x1:
// encoding_fmops_za32_pp_zz_16
default:
err = errUnmatched
}
ins |= (Zm << 16) | (Pm << 13) | (Pn << 10) | (Zn << 5) | (S << 4) | ZAda
ins |= 0x81a00000
return
}
func encode_mortlach_i8i32_prod(u0, u1, Zm, Pm, Pn, Zn, S, ZAda uint32) (ins uint32, err error) {
switch {
case u0 > 0x1 || u1 > 0x1 || Zm > 0x1f || Pm > 0x7 || Pn > 0x7 || Zn > 0x1f || S > 0x1 || ZAda > 0x3:
err = errOverflow
case u0 == 0x0 && u1 == 0x0 && S == 0x0:
// encoding_smopa_za_pp_zz_32
case u0 == 0x0 && u1 == 0x0 && S == 0x1:
// encoding_smops_za_pp_zz_32
case u0 == 0x0 && u1 == 0x1 && S == 0x0:
// encoding_sumopa_za_pp_zz_32
case u0 == 0x0 && u1 == 0x1 && S == 0x1:
// encoding_sumops_za_pp_zz_32
case u0 == 0x1 && u1 == 0x0 && S == 0x0:
// encoding_usmopa_za_pp_zz_32
case u0 == 0x1 && u1 == 0x0 && S == 0x1:
// encoding_usmops_za_pp_zz_32
case u0 == 0x1 && u1 == 0x1 && S == 0x0:
// encoding_umopa_za_pp_zz_32
case u0 == 0x1 && u1 == 0x1 && S == 0x1:
// encoding_umops_za_pp_zz_32
default:
err = errUnmatched
}
ins |= (u0 << 24) | (u1 << 21) | (Zm << 16) | (Pm << 13) | (Pn << 10) | (Zn << 5) | (S << 4) | ZAda
ins |= 0xa0800000
return
}
func encode_mortlach_f64f64_prod(Zm, Pm, Pn, Zn, S, ZAda uint32) (ins uint32, err error) {
switch {
case Zm > 0x1f || Pm > 0x7 || Pn > 0x7 || Zn > 0x1f || S > 0x1 || ZAda > 0x7:
err = errOverflow
case S == 0x0:
// encoding_fmopa_za_pp_zz_64
case S == 0x1:
// encoding_fmops_za_pp_zz_64
default:
err = errUnmatched
}
ins |= (Zm << 16) | (Pm << 13) | (Pn << 10) | (Zn << 5) | (S << 4) | ZAda
ins |= 0x80c00000
return
}
func encode_mortlach_i16i64_prod(u0, u1, Zm, Pm, Pn, Zn, S, ZAda uint32) (ins uint32, err error) {
switch {
case u0 > 0x1 || u1 > 0x1 || Zm > 0x1f || Pm > 0x7 || Pn > 0x7 || Zn > 0x1f || S > 0x1 || ZAda > 0x7:
err = errOverflow
case u0 == 0x0 && u1 == 0x0 && S == 0x0:
// encoding_smopa_za_pp_zz_64
case u0 == 0x0 && u1 == 0x0 && S == 0x1:
// encoding_smops_za_pp_zz_64
case u0 == 0x0 && u1 == 0x1 && S == 0x0:
// encoding_sumopa_za_pp_zz_64
case u0 == 0x0 && u1 == 0x1 && S == 0x1:
// encoding_sumops_za_pp_zz_64
case u0 == 0x1 && u1 == 0x0 && S == 0x0:
// encoding_usmopa_za_pp_zz_64
case u0 == 0x1 && u1 == 0x0 && S == 0x1:
// encoding_usmops_za_pp_zz_64
case u0 == 0x1 && u1 == 0x1 && S == 0x0:
// encoding_umopa_za_pp_zz_64
case u0 == 0x1 && u1 == 0x1 && S == 0x1:
// encoding_umops_za_pp_zz_64
default:
err = errUnmatched
}
ins |= (u0 << 24) | (u1 << 21) | (Zm << 16) | (Pm << 13) | (Pn << 10) | (Zn << 5) | (S << 4) | ZAda
ins |= 0xa0c00000
return
}
func encode_mortlach_insert_pred(size, Q, V, Rs, Pg, Zn, opc uint32) (ins uint32, err error) {
switch {
case size > 0x3 || Q > 0x1 || V > 0x1 || Rs > 0x3 || Pg > 0x7 || Zn > 0x1f || opc > 0xf:
err = errOverflow
case (size&0x2) == 0x0 && Q == 0x1:
err = errUnallocated
case size == 0x0 && Q == 0x0:
// encoding_mova_za_p_rz_b
case size == 0x1 && Q == 0x0:
// encoding_mova_za_p_rz_h
case size == 0x2 && Q == 0x0:
// encoding_mova_za_p_rz_w
case size == 0x2 && Q == 0x1:
err = errUnallocated
case size == 0x3 && Q == 0x0:
// encoding_mova_za_p_rz_d
case size == 0x3 && Q == 0x1:
// encoding_mova_za_p_rz_q
default:
err = errUnmatched
}
ins |= (size << 22) | (Q << 16) | (V << 15) | (Rs << 13) | (Pg << 10) | (Zn << 5) | opc
ins |= 0xc0000000
return
}
func encode_mortlach_extract_pred(size, Q, V, Rs, Pg, opc, Zd uint32) (ins uint32, err error) {
switch {
case size > 0x3 || Q > 0x1 || V > 0x1 || Rs > 0x3 || Pg > 0x7 || opc > 0xf || Zd > 0x1f:
err = errOverflow
case (size&0x2) == 0x0 && Q == 0x1:
err = errUnallocated
case size == 0x0 && Q == 0x0:
// encoding_mova_z_p_rza_b
case size == 0x1 && Q == 0x0:
// encoding_mova_z_p_rza_h
case size == 0x2 && Q == 0x0:
// encoding_mova_z_p_rza_w
case size == 0x2 && Q == 0x1:
err = errUnallocated
case size == 0x3 && Q == 0x0:
// encoding_mova_z_p_rza_d
case size == 0x3 && Q == 0x1:
// encoding_mova_z_p_rza_q
default:
err = errUnmatched
}
ins |= (size << 22) | (Q << 16) | (V << 15) | (Rs << 13) | (Pg << 10) | (opc << 5) | Zd
ins |= 0xc0020000
return
}
func encode_mortlach_zero(imm8 uint32) (ins uint32, err error) {
switch {
case imm8 > 0xff:
err = errOverflow
default:
// encoding_zero_za_i_
}
ins |= imm8
ins |= 0xc0080000
return
}
func encode_mortlach_addhv(op, V, Pm, Pn, Zn, opc2 uint32) (ins uint32, err error) {
switch {
case op > 0x1 || V > 0x1 || Pm > 0x7 || Pn > 0x7 || Zn > 0x1f || opc2 > 0x7:
err = errOverflow
case op == 0x0 && (opc2&0x4) == 0x4:
err = errUnallocated
case op == 0x0 && V == 0x0 && (opc2&0x4) == 0x0:
// encoding_addha_za_pp_z_32
case op == 0x0 && V == 0x1 && (opc2&0x4) == 0x0:
// encoding_addva_za_pp_z_32
case op == 0x1 && V == 0x0:
// encoding_addha_za_pp_z_64
case op == 0x1 && V == 0x1:
// encoding_addva_za_pp_z_64
default:
err = errUnmatched
}
ins |= (op << 22) | (V << 16) | (Pm << 13) | (Pn << 10) | (Zn << 5) | opc2
ins |= 0xc0900000
return
}
func encode_mortlach_contig_load(msz, Rm, V, Rs, Pg, Rn, opc uint32) (ins uint32, err error) {
switch {
case msz > 0x3 || Rm > 0x1f || V > 0x1 || Rs > 0x3 || Pg > 0x7 || Rn > 0x1f || opc > 0xf:
err = errOverflow
case msz == 0x0:
// encoding_ld1b_za_p_rrr_
case msz == 0x1:
// encoding_ld1h_za_p_rrr_
case msz == 0x2:
// encoding_ld1w_za_p_rrr_
case msz == 0x3:
// encoding_ld1d_za_p_rrr_
default:
err = errUnmatched
}
ins |= (msz << 22) | (Rm << 16) | (V << 15) | (Rs << 13) | (Pg << 10) | (Rn << 5) | opc
ins |= 0xe0000000
return
}
func encode_mortlach_contig_store(msz, Rm, V, Rs, Pg, Rn, opc uint32) (ins uint32, err error) {
switch {
case msz > 0x3 || Rm > 0x1f || V > 0x1 || Rs > 0x3 || Pg > 0x7 || Rn > 0x1f || opc > 0xf:
err = errOverflow
case msz == 0x0:
// encoding_st1b_za_p_rrr_
case msz == 0x1:
// encoding_st1h_za_p_rrr_
case msz == 0x2:
// encoding_st1w_za_p_rrr_
case msz == 0x3:
// encoding_st1d_za_p_rrr_
default:
err = errUnmatched
}
ins |= (msz << 22) | (Rm << 16) | (V << 15) | (Rs << 13) | (Pg << 10) | (Rn << 5) | opc
ins |= 0xe0200000
return
}
func encode_mortlach_ctxt_ldst(op, Rv, Rn, imm4 uint32) (ins uint32, err error) {
switch {
case op > 0x1 || Rv > 0x3 || Rn > 0x1f || imm4 > 0xf:
err = errOverflow
case op == 0x0:
// encoding_ldr_za_ri_
case op == 0x1:
// encoding_str_za_ri_
default:
err = errUnmatched
}
ins |= (op << 21) | (Rv << 13) | (Rn << 5) | imm4
ins |= 0xe1000000
return
}
func encode_mortlach_contig_qload(Rm, V, Rs, Pg, Rn, ZAt uint32) (ins uint32, err error) {
switch {
case Rm > 0x1f || V > 0x1 || Rs > 0x3 || Pg > 0x7 || Rn > 0x1f || ZAt > 0xf:
err = errOverflow
default:
// encoding_ld1q_za_p_rrr_
}
ins |= (Rm << 16) | (V << 15) | (Rs << 13) | (Pg << 10) | (Rn << 5) | ZAt
ins |= 0xe1c00000
return
}
func encode_mortlach_contig_qstore(Rm, V, Rs, Pg, Rn, ZAt uint32) (ins uint32, err error) {
switch {
case Rm > 0x1f || V > 0x1 || Rs > 0x3 || Pg > 0x7 || Rn > 0x1f || ZAt > 0xf:
err = errOverflow
default:
// encoding_st1q_za_p_rrr_
}
ins |= (Rm << 16) | (V << 15) | (Rs << 13) | (Pg << 10) | (Rn << 5) | ZAt
ins |= 0xe1e00000
return
}
func encode_sve_int_mlas_vvv_pred(size, Zm, op, Pg, Zn, Zda uint32) (ins uint32, err error) {
switch {
case size > 0x3 || Zm > 0x1f || op > 0x1 || Pg > 0x7 || Zn > 0x1f || Zda > 0x1f:
err = errOverflow
case op == 0x0:
// encoding_mla_z_p_zzz_
case op == 0x1:
// encoding_mls_z_p_zzz_
default:
err = errUnmatched
}
ins |= (size << 22) | (Zm << 16) | (op << 13) | (Pg << 10) | (Zn << 5) | Zda
ins |= 0x4004000
return
}
func encode_sve_int_mladdsub_vvv_pred(size, Zm, op, Pg, Za, Zdn uint32) (ins uint32, err error) {
switch {
case size > 0x3 || Zm > 0x1f || op > 0x1 || Pg > 0x7 || Za > 0x1f || Zdn > 0x1f:
err = errOverflow
case op == 0x0:
// encoding_mad_z_p_zzz_
case op == 0x1:
// encoding_msb_z_p_zzz_
default:
err = errUnmatched
}
ins |= (size << 22) | (Zm << 16) | (op << 13) | (Pg << 10) | (Za << 5) | Zdn
ins |= 0x400c000
return
}
func encode_sve_int_bin_pred_arit_0(size, opc, Pg, Zm, Zdn uint32) (ins uint32, err error) {
switch {
case size > 0x3 || opc > 0x7 || Pg > 0x7 || Zm > 0x1f || Zdn > 0x1f:
err = errOverflow
case opc == 0x0:
// encoding_add_z_p_zz_
case opc == 0x1:
// encoding_sub_z_p_zz_
case opc == 0x2:
err = errUnallocated
case opc == 0x3:
// encoding_subr_z_p_zz_
case (opc & 0x4) == 0x4:
err = errUnallocated
default:
err = errUnmatched
}
ins |= (size << 22) | (opc << 16) | (Pg << 10) | (Zm << 5) | Zdn
ins |= 0x4000000
return
}
func encode_sve_int_bin_pred_arit_1(size, opc, U, Pg, Zm, Zdn uint32) (ins uint32, err error) {
switch {
case size > 0x3 || opc > 0x3 || U > 0x1 || Pg > 0x7 || Zm > 0x1f || Zdn > 0x1f:
err = errOverflow
case opc == 0x0 && U == 0x0:
// encoding_smax_z_p_zz_
case opc == 0x0 && U == 0x1:
// encoding_umax_z_p_zz_
case opc == 0x1 && U == 0x0:
// encoding_smin_z_p_zz_
case opc == 0x1 && U == 0x1:
// encoding_umin_z_p_zz_
case opc == 0x2 && U == 0x0:
// encoding_sabd_z_p_zz_
case opc == 0x2 && U == 0x1:
// encoding_uabd_z_p_zz_
case opc == 0x3:
err = errUnallocated
default:
err = errUnmatched
}
ins |= (size << 22) | (opc << 17) | (U << 16) | (Pg << 10) | (Zm << 5) | Zdn
ins |= 0x4080000
return
}
func encode_sve_int_bin_pred_arit_2(size, H, U, Pg, Zm, Zdn uint32) (ins uint32, err error) {
switch {
case size > 0x3 || H > 0x1 || U > 0x1 || Pg > 0x7 || Zm > 0x1f || Zdn > 0x1f:
err = errOverflow
case H == 0x0 && U == 0x0:
// encoding_mul_z_p_zz_
case H == 0x0 && U == 0x1:
err = errUnallocated
case H == 0x1 && U == 0x0:
// encoding_smulh_z_p_zz_
case H == 0x1 && U == 0x1:
// encoding_umulh_z_p_zz_
default:
err = errUnmatched
}
ins |= (size << 22) | (H << 17) | (U << 16) | (Pg << 10) | (Zm << 5) | Zdn
ins |= 0x4100000
return
}
func encode_sve_int_bin_pred_div(size, R, U, Pg, Zm, Zdn uint32) (ins uint32, err error) {
switch {
case size > 0x3 || R > 0x1 || U > 0x1 || Pg > 0x7 || Zm > 0x1f || Zdn > 0x1f:
err = errOverflow
case R == 0x0 && U == 0x0:
// encoding_sdiv_z_p_zz_
case R == 0x0 && U == 0x1:
// encoding_udiv_z_p_zz_
case R == 0x1 && U == 0x0:
// encoding_sdivr_z_p_zz_
case R == 0x1 && U == 0x1:
// encoding_udivr_z_p_zz_
default:
err = errUnmatched
}
ins |= (size << 22) | (R << 17) | (U << 16) | (Pg << 10) | (Zm << 5) | Zdn
ins |= 0x4140000
return
}
func encode_sve_int_bin_pred_log(size, opc, Pg, Zm, Zdn uint32) (ins uint32, err error) {
switch {
case size > 0x3 || opc > 0x7 || Pg > 0x7 || Zm > 0x1f || Zdn > 0x1f:
err = errOverflow
case opc == 0x0:
// encoding_orr_z_p_zz_
case opc == 0x1:
// encoding_eor_z_p_zz_
case opc == 0x2:
// encoding_and_z_p_zz_
case opc == 0x3:
// encoding_bic_z_p_zz_
case (opc & 0x4) == 0x4:
err = errUnallocated
default:
err = errUnmatched
}
ins |= (size << 22) | (opc << 16) | (Pg << 10) | (Zm << 5) | Zdn
ins |= 0x4180000
return
}
func encode_sve_int_reduce_0(size, op, U, Pg, Zn, Vd uint32) (ins uint32, err error) {
switch {
case size > 0x3 || op > 0x1 || U > 0x1 || Pg > 0x7 || Zn > 0x1f || Vd > 0x1f:
err = errOverflow
case op == 0x0 && U == 0x0:
// encoding_saddv_r_p_z_
case op == 0x0 && U == 0x1:
// encoding_uaddv_r_p_z_
case op == 0x1:
err = errUnallocated
default:
err = errUnmatched
}
ins |= (size << 22) | (op << 17) | (U << 16) | (Pg << 10) | (Zn << 5) | Vd
ins |= 0x4002000
return
}
func encode_sve_int_reduce_1(size, op, U, Pg, Zn, Vd uint32) (ins uint32, err error) {
switch {
case size > 0x3 || op > 0x1 || U > 0x1 || Pg > 0x7 || Zn > 0x1f || Vd > 0x1f:
err = errOverflow
case op == 0x0 && U == 0x0:
// encoding_smaxv_r_p_z_
case op == 0x0 && U == 0x1:
// encoding_umaxv_r_p_z_
case op == 0x1 && U == 0x0:
// encoding_sminv_r_p_z_
case op == 0x1 && U == 0x1:
// encoding_uminv_r_p_z_
default:
err = errUnmatched
}
ins |= (size << 22) | (op << 17) | (U << 16) | (Pg << 10) | (Zn << 5) | Vd
ins |= 0x4082000
return
}
func encode_sve_int_movprfx_pred(size, opc, M, Pg, Zn, Zd uint32) (ins uint32, err error) {
switch {
case size > 0x3 || opc > 0x3 || M > 0x1 || Pg > 0x7 || Zn > 0x1f || Zd > 0x1f:
err = errOverflow
case opc == 0x0:
// encoding_movprfx_z_p_z_
case opc == 0x1:
err = errUnallocated
case (opc & 0x2) == 0x2:
err = errUnallocated
default:
err = errUnmatched
}
ins |= (size << 22) | (opc << 17) | (M << 16) | (Pg << 10) | (Zn << 5) | Zd
ins |= 0x4102000
return
}
func encode_sve_int_reduce_2(size, opc, Pg, Zn, Vd uint32) (ins uint32, err error) {
switch {
case size > 0x3 || opc > 0x3 || Pg > 0x7 || Zn > 0x1f || Vd > 0x1f:
err = errOverflow
case opc == 0x0:
// encoding_orv_r_p_z_
case opc == 0x1:
// encoding_eorv_r_p_z_
case opc == 0x2:
// encoding_andv_r_p_z_
case opc == 0x3:
err = errUnallocated
default:
err = errUnmatched
}
ins |= (size << 22) | (opc << 16) | (Pg << 10) | (Zn << 5) | Vd
ins |= 0x4182000
return
}
func encode_sve_int_bin_pred_shift_0(tszh, opc, L, U, Pg, tszl, imm3, Zdn uint32) (ins uint32, err error) {
switch {
case tszh > 0x3 || opc > 0x3 || L > 0x1 || U > 0x1 || Pg > 0x7 || tszl > 0x3 || imm3 > 0x7 || Zdn > 0x1f:
err = errOverflow
case opc == 0x0 && L == 0x0 && U == 0x0:
// encoding_asr_z_p_zi_
case opc == 0x0 && L == 0x0 && U == 0x1:
// encoding_lsr_z_p_zi_
case opc == 0x0 && L == 0x1 && U == 0x0:
err = errUnallocated
case opc == 0x0 && L == 0x1 && U == 0x1:
// encoding_lsl_z_p_zi_
case opc == 0x1 && L == 0x0 && U == 0x0:
// encoding_asrd_z_p_zi_
case opc == 0x1 && L == 0x0 && U == 0x1:
err = errUnallocated
case opc == 0x1 && L == 0x1 && U == 0x0:
// encoding_sqshl_z_p_zi_
case opc == 0x1 && L == 0x1 && U == 0x1:
// encoding_uqshl_z_p_zi_
case opc == 0x2:
err = errUnallocated
case opc == 0x3 && L == 0x0 && U == 0x0:
// encoding_srshr_z_p_zi_
case opc == 0x3 && L == 0x0 && U == 0x1:
// encoding_urshr_z_p_zi_
case opc == 0x3 && L == 0x1 && U == 0x0:
err = errUnallocated
case opc == 0x3 && L == 0x1 && U == 0x1:
// encoding_sqshlu_z_p_zi_
default:
err = errUnmatched
}
ins |= (tszh << 22) | (opc << 18) | (L << 17) | (U << 16) | (Pg << 10) | (tszl << 8) | (imm3 << 5) | Zdn
ins |= 0x4008000
return
}
func encode_sve_int_bin_pred_shift_1(size, R, L, U, Pg, Zm, Zdn uint32) (ins uint32, err error) {
switch {
case size > 0x3 || R > 0x1 || L > 0x1 || U > 0x1 || Pg > 0x7 || Zm > 0x1f || Zdn > 0x1f:
err = errOverflow
case L == 0x1 && U == 0x0:
err = errUnallocated
case R == 0x0 && L == 0x0 && U == 0x0:
// encoding_asr_z_p_zz_
case R == 0x0 && L == 0x0 && U == 0x1:
// encoding_lsr_z_p_zz_
case R == 0x0 && L == 0x1 && U == 0x1:
// encoding_lsl_z_p_zz_
case R == 0x1 && L == 0x0 && U == 0x0:
// encoding_asrr_z_p_zz_
case R == 0x1 && L == 0x0 && U == 0x1:
// encoding_lsrr_z_p_zz_
case R == 0x1 && L == 0x1 && U == 0x1:
// encoding_lslr_z_p_zz_
default:
err = errUnmatched
}
ins |= (size << 22) | (R << 18) | (L << 17) | (U << 16) | (Pg << 10) | (Zm << 5) | Zdn
ins |= 0x4108000
return
}
func encode_sve_int_bin_pred_shift_2(size, R, L, U, Pg, Zm, Zdn uint32) (ins uint32, err error) {
switch {
case size > 0x3 || R > 0x1 || L > 0x1 || U > 0x1 || Pg > 0x7 || Zm > 0x1f || Zdn > 0x1f:
err = errOverflow
case R == 0x0 && L == 0x0 && U == 0x0:
// encoding_asr_z_p_zw_
case R == 0x0 && L == 0x0 && U == 0x1:
// encoding_lsr_z_p_zw_
case R == 0x0 && L == 0x1 && U == 0x0:
err = errUnallocated
case R == 0x0 && L == 0x1 && U == 0x1:
// encoding_lsl_z_p_zw_
case R == 0x1:
err = errUnallocated
default:
err = errUnmatched
}
ins |= (size << 22) | (R << 18) | (L << 17) | (U << 16) | (Pg << 10) | (Zm << 5) | Zdn
ins |= 0x4188000
return
}
func encode_sve_int_un_pred_arit_0(size, opc, Pg, Zn, Zd uint32) (ins uint32, err error) {
switch {
case size > 0x3 || opc > 0x7 || Pg > 0x7 || Zn > 0x1f || Zd > 0x1f:
err = errOverflow
case opc == 0x0:
// encoding_sxtb_z_p_z_
case opc == 0x1:
// encoding_uxtb_z_p_z_
case opc == 0x2:
// encoding_sxth_z_p_z_
case opc == 0x3:
// encoding_uxth_z_p_z_
case opc == 0x4:
// encoding_sxtw_z_p_z_
case opc == 0x5:
// encoding_uxtw_z_p_z_
case opc == 0x6:
// encoding_abs_z_p_z_
case opc == 0x7:
// encoding_neg_z_p_z_
default:
err = errUnmatched
}
ins |= (size << 22) | (opc << 16) | (Pg << 10) | (Zn << 5) | Zd
ins |= 0x410a000
return
}
func encode_sve_int_un_pred_arit_1(size, opc, Pg, Zn, Zd uint32) (ins uint32, err error) {
switch {
case size > 0x3 || opc > 0x7 || Pg > 0x7 || Zn > 0x1f || Zd > 0x1f:
err = errOverflow
case opc == 0x0:
// encoding_cls_z_p_z_
case opc == 0x1:
// encoding_clz_z_p_z_
case opc == 0x2:
// encoding_cnt_z_p_z_
case opc == 0x3:
// encoding_cnot_z_p_z_
case opc == 0x4:
// encoding_fabs_z_p_z_
case opc == 0x5:
// encoding_fneg_z_p_z_
case opc == 0x6:
// encoding_not_z_p_z_
case opc == 0x7:
err = errUnallocated
default:
err = errUnmatched
}
ins |= (size << 22) | (opc << 16) | (Pg << 10) | (Zn << 5) | Zd
ins |= 0x418a000
return
}
func encode_sve_int_bin_cons_arit_0(size, Zm, opc, Zn, Zd uint32) (ins uint32, err error) {
switch {
case size > 0x3 || Zm > 0x1f || opc > 0x7 || Zn > 0x1f || Zd > 0x1f:
err = errOverflow
case opc == 0x0:
// encoding_add_z_zz_
case opc == 0x1:
// encoding_sub_z_zz_
case (opc & 0x6) == 0x2:
err = errUnallocated
case opc == 0x4:
// encoding_sqadd_z_zz_
case opc == 0x5:
// encoding_uqadd_z_zz_
case opc == 0x6:
// encoding_sqsub_z_zz_
case opc == 0x7:
// encoding_uqsub_z_zz_
default:
err = errUnmatched
}
ins |= (size << 22) | (Zm << 16) | (opc << 10) | (Zn << 5) | Zd
ins |= 0x4200000
return
}
func encode_sve_int_bin_cons_log(opc, Zm, Zn, Zd uint32) (ins uint32, err error) {
switch {
case opc > 0x3 || Zm > 0x1f || Zn > 0x1f || Zd > 0x1f:
err = errOverflow
case opc == 0x0:
// encoding_and_z_zz_
case opc == 0x1:
// encoding_orr_z_zz_
case opc == 0x2:
// encoding_eor_z_zz_
case opc == 0x3:
// encoding_bic_z_zz_
default:
err = errUnmatched
}
ins |= (opc << 22) | (Zm << 16) | (Zn << 5) | Zd
ins |= 0x4203000
return
}
func encode_sve_int_rotate_imm(tszh, tszl, imm3, Zm, Zdn uint32) (ins uint32, err error) {
switch {
case tszh > 0x3 || tszl > 0x3 || imm3 > 0x7 || Zm > 0x1f || Zdn > 0x1f:
err = errOverflow
default:
// encoding_xar_z_zzi_
}
ins |= (tszh << 22) | (tszl << 19) | (imm3 << 16) | (Zm << 5) | Zdn
ins |= 0x4203400
return
}
func encode_sve_int_tern_log(opc, Zm, o2, Zk, Zdn uint32) (ins uint32, err error) {
switch {
case opc > 0x3 || Zm > 0x1f || o2 > 0x1 || Zk > 0x1f || Zdn > 0x1f:
err = errOverflow
case opc == 0x0 && o2 == 0x0:
// encoding_eor3_z_zzz_
case opc == 0x0 && o2 == 0x1:
// encoding_bsl_z_zzz_
case opc == 0x1 && o2 == 0x0:
// encoding_bcax_z_zzz_
case opc == 0x1 && o2 == 0x1:
// encoding_bsl1n_z_zzz_
case (opc&0x2) == 0x2 && o2 == 0x0:
err = errUnallocated
case opc == 0x2 && o2 == 0x1:
// encoding_bsl2n_z_zzz_
case opc == 0x3 && o2 == 0x1:
// encoding_nbsl_z_zzz_
default:
err = errUnmatched
}
ins |= (opc << 22) | (Zm << 16) | (o2 << 10) | (Zk << 5) | Zdn
ins |= 0x4203800
return
}
func encode_sve_int_index_ii(size, imm5b, imm5, Zd uint32) (ins uint32, err error) {
switch {
case size > 0x3 || imm5b > 0x1f || imm5 > 0x1f || Zd > 0x1f:
err = errOverflow
default:
// encoding_index_z_ii_
}
ins |= (size << 22) | (imm5b << 16) | (imm5 << 5) | Zd
ins |= 0x4204000
return
}
func encode_sve_int_index_ri(size, imm5, Rn, Zd uint32) (ins uint32, err error) {
switch {
case size > 0x3 || imm5 > 0x1f || Rn > 0x1f || Zd > 0x1f:
err = errOverflow
default:
// encoding_index_z_ri_
}
ins |= (size << 22) | (imm5 << 16) | (Rn << 5) | Zd
ins |= 0x4204400
return
}
func encode_sve_int_index_ir(size, Rm, imm5, Zd uint32) (ins uint32, err error) {
switch {
case size > 0x3 || Rm > 0x1f || imm5 > 0x1f || Zd > 0x1f:
err = errOverflow
default:
// encoding_index_z_ir_
}
ins |= (size << 22) | (Rm << 16) | (imm5 << 5) | Zd
ins |= 0x4204800
return
}
func encode_sve_int_index_rr(size, Rm, Rn, Zd uint32) (ins uint32, err error) {
switch {
case size > 0x3 || Rm > 0x1f || Rn > 0x1f || Zd > 0x1f:
err = errOverflow
default:
// encoding_index_z_rr_
}
ins |= (size << 22) | (Rm << 16) | (Rn << 5) | Zd
ins |= 0x4204c00
return
}
func encode_sve_int_arith_vl(op, Rn, imm6, Rd uint32) (ins uint32, err error) {
switch {
case op > 0x1 || Rn > 0x1f || imm6 > 0x3f || Rd > 0x1f:
err = errOverflow
case op == 0x0:
// encoding_addvl_r_ri_
case op == 0x1:
// encoding_addpl_r_ri_
default:
err = errUnmatched
}
ins |= (op << 22) | (Rn << 16) | (imm6 << 5) | Rd
ins |= 0x4205000
return
}
func encode_sve_int_arith_svl(op, Rn, imm6, Rd uint32) (ins uint32, err error) {
switch {
case op > 0x1 || Rn > 0x1f || imm6 > 0x3f || Rd > 0x1f:
err = errOverflow
case op == 0x0:
// encoding_addsvl_r_ri_
case op == 0x1:
// encoding_addspl_r_ri_
default:
err = errUnmatched
}
ins |= (op << 22) | (Rn << 16) | (imm6 << 5) | Rd
ins |= 0x4205800
return
}
func encode_sve_int_read_vl_a(op, opc2, imm6, Rd uint32) (ins uint32, err error) {
switch {
case op > 0x1 || opc2 > 0x1f || imm6 > 0x3f || Rd > 0x1f:
err = errOverflow
case op == 0x0 && (opc2&0x10) == 0x0:
err = errUnallocated
case op == 0x0 && (opc2&0x18) == 0x10:
err = errUnallocated
case op == 0x0 && (opc2&0x1c) == 0x18:
err = errUnallocated
case op == 0x0 && (opc2&0x1e) == 0x1c:
err = errUnallocated
case op == 0x0 && opc2 == 0x1e:
err = errUnallocated
case op == 0x0 && opc2 == 0x1f:
// encoding_rdvl_r_i_
case op == 0x1:
err = errUnallocated
default:
err = errUnmatched
}
ins |= (op << 22) | (opc2 << 16) | (imm6 << 5) | Rd
ins |= 0x4a05000
return
}
func encode_sve_int_read_svl_a(op, opc2, imm6, Rd uint32) (ins uint32, err error) {
switch {
case op > 0x1 || opc2 > 0x1f || imm6 > 0x3f || Rd > 0x1f:
err = errOverflow
case op == 0x0 && (opc2&0x10) == 0x0:
err = errUnallocated
case op == 0x0 && (opc2&0x18) == 0x10:
err = errUnallocated
case op == 0x0 && (opc2&0x1c) == 0x18:
err = errUnallocated
case op == 0x0 && (opc2&0x1e) == 0x1c:
err = errUnallocated
case op == 0x0 && opc2 == 0x1e:
err = errUnallocated
case op == 0x0 && opc2 == 0x1f:
// encoding_rdsvl_r_i_
case op == 0x1:
err = errUnallocated
default:
err = errUnmatched
}
ins |= (op << 22) | (opc2 << 16) | (imm6 << 5) | Rd
ins |= 0x4a05800
return
}
func encode_sve_int_mul_b(size, Zm, opc, Zn, Zd uint32) (ins uint32, err error) {
switch {
case size > 0x3 || Zm > 0x1f || opc > 0x3 || Zn > 0x1f || Zd > 0x1f:
err = errOverflow
case opc == 0x0:
// encoding_mul_z_zz_
case opc == 0x2:
// encoding_smulh_z_zz_
case opc == 0x3:
// encoding_umulh_z_zz_
case size == 0x0 && opc == 0x1:
// encoding_pmul_z_zz_
case size == 0x1 && opc == 0x1:
err = errUnallocated
case (size&0x2) == 0x2 && opc == 0x1:
err = errUnallocated
default:
err = errUnmatched
}
ins |= (size << 22) | (Zm << 16) | (opc << 10) | (Zn << 5) | Zd
ins |= 0x4206000
return
}
func encode_sve_int_sqdmulh(size, Zm, R, Zn, Zd uint32) (ins uint32, err error) {
switch {
case size > 0x3 || Zm > 0x1f || R > 0x1 || Zn > 0x1f || Zd > 0x1f:
err = errOverflow
case R == 0x0:
// encoding_sqdmulh_z_zz_