-
Notifications
You must be signed in to change notification settings - Fork 3
/
aarch64.risu
2912 lines (2359 loc) · 122 KB
/
aarch64.risu
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
###############################################################################
# Copyright (c) 2010 Linaro Limited
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distribution, and is available at
# http://www.eclipse.org/legal/epl-v10.html
#
# Contributors:
# Claudio Fontana - initial implementation
# based on arm.risu by Peter Maydell
###############################################################################
# Input file for risugen defining AArch64 instructions
.mode arm.aarch64
# from ARM DDI 0487A.a ARM Architecture Reference Manual
# XXX NIY: branch, exception generation, system insns
# XXX NIY: PC-related instructions
# XXX NIY: SP-related instructions
# XXX NIY: floating point and SIMD specific insns
# - - - - 1 - 0 - - - - - - - - - - - - - - - Loads and stores
# C3.3 Loads and stores
# C3.3.1 AdvSIMD load/store multiple structures
# C3.3.2 AdvSIMD load/store multiple structures (post-indexed)
# C3.3.3 AdvSIMD load/store single structure
# C3.3.4 AdvSIMD load/store single structure (post-indexed)
#
# C6.3.275 ST1 (multiple structures) - no offset
# 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 5 4 0
# 0 Q 0 0 1 1 0 0 0 0 0 0 0 0 0 0 x x 1 x size Rn Rt
# [L] [ opcode ]
ST1m_1 A64_V 0 Q:1 001100000 00000 0111 size:2 rn:5 rt:5 \
!constraints { $rn != 31; } \
!memory { align(1 << $size); reg($rn); }
ST1m_2 A64_V 0 Q:1 001100000 00000 1010 size:2 rn:5 rt:5 \
!constraints { $rn != 31; } \
!memory { align(1 << $size); reg($rn); }
ST1m_3 A64_V 0 Q:1 001100000 00000 0110 size:2 rn:5 rt:5 \
!constraints { $rn != 31; } \
!memory { align(1 << $size); reg($rn); }
ST1m_4 A64_V 0 Q:1 001100000 00000 0010 size:2 rn:5 rt:5 \
!constraints { $rn != 31; } \
!memory { align(1 << $size); reg($rn); }
# Post-index (reg/immediate)
# 31 30 29 28 27 26 25 24 23 22 21 20 16 15 14 13 12 11 10 9 5 4 0
# 0 Q 0 0 1 1 0 0 1 0 0 Rm x x 1 x size Rn Rt
# [L] [ opcode ]
ST1m_1p A64_V 0 Q:1 001100100 rm:5 0111 size:2 rn:5 rt:5 \
!constraints { $rn != 31 && $rn != $rm; } \
!memory { align(1 << $size); reg($rn); }
ST1m_2p A64_V 0 Q:1 001100100 rm:5 1010 size:2 rn:5 rt:5 \
!constraints { $rn != 31 && $rn != $rm; } \
!memory { align(1 << $size); reg($rn); }
ST1m_3p A64_V 0 Q:1 001100100 rm:5 0110 size:2 rn:5 rt:5 \
!constraints { $rn != 31 && $rn != $rm; } \
!memory { align(1 << $size); reg($rn); }
ST1m_4p A64_V 0 Q:1 001100100 rm:5 0010 size:2 rn:5 rt:5 \
!constraints { $rn != 31 && $rn != $rm; } \
!memory { align(1 << $size); reg($rn); }
# C6.3.276 ST1 (single structure) - no offset
# 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 5 4 0
# 0 Q 0 0 1 1 0 1 0 0 0 0 0 0 0 0 x x 0 S size Rn Rt
# [L][R] [ opc ]
# 8-bit variant (opcode = 000)
# ST1 { <Vt>.B }[<index>], [<Xn|SP>]
# 16-bit variant (opcode = 010, size = x0)
# ST1 { <Vt>.H }[<index>], [<Xn|SP>]
# 32-bit variant (opcode = 100, size = 00)
# ST1 { <Vt>.S }[<index>], [<Xn|SP>]
# 64-bit variant (opcode = 100, S = 0, size = 01)
# ST1 { <Vt>.D }[<index>], [<Xn|SP>]
ST1_B A64_V 0 Q:1 001101000 00000 000 S:1 size:2 rn:5 rt:5 \
!constraints { $rn != 31; } \
!memory { align(1); reg($rn); }
ST1_H A64_V 0 Q:1 001101000 00000 010 S:1 size:2 rn:5 rt:5 \
!constraints { $rn != 31 && !($size & 0x01); } \
!memory { align(2); reg($rn); }
# ReservedValue: break !(size & 0x01) constraint
ST1_H_RES A64_V 0 Q:1 001101000 00000 010 S:1 size:1 1 rn:5 rt:5
ST1_S A64_V 0 Q:1 001101000 00000 100 S:1 00 rn:5 rt:5 \
!constraints { $rn != 31; } \
!memory { align(4); reg($rn); }
ST1_D A64_V 0 Q:1 001101000 00000 100 0 01 rn:5 rt:5 \
!constraints { $rn != 31; } \
!memory { align(8); reg($rn); }
# Post-index (reg/immediate)
# 31 30 29 28 27 26 25 24 23 22 21 20 16 15 14 13 12 11 10 9 5 4 0
# 0 Q 0 0 1 1 0 1 1 0 0 Rm x x 0 S size Rn Rt
# [L][R] opcode
ST1_Bp A64_V 0 Q:1 001101100 rm:5 000 S:1 size:2 rn:5 rt:5 \
!constraints { $rn != 31 && $rn != $rm; } \
!memory { align(1); reg($rn); }
ST1_Hp A64_V 0 Q:1 001101100 rm:5 010 S:1 size:2 rn:5 rt:5 \
!constraints { $rn != 31 && $rn != $rm && !($size & 0x01); } \
!memory { align(2); reg($rn); }
# ReservedValue: break (!size & 0x01) constraint
ST1_Hp_RES A64_V 0 Q:1 001101100 rm:5 010 S:1 size:1 1 rn:5 rt:5
ST1_Sp A64_V 0 Q:1 001101100 rm:5 100 S:1 00 rn:5 rt:5 \
!constraints { $rn != 31 && $rn != $rm; } \
!memory { align(4); reg($rn); }
ST1_Dp A64_V 0 Q:1 001101100 rm:5 100 0 01 rn:5 rt:5 \
!constraints { $rn != 31 && $rn != $rm; } \
!memory { align(8); reg($rn); }
# C6.3.277 ST2 (multiple structures) - no offset
# 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 5 4 0
# 0 Q 0 0 1 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 size Rn Rt
# [L] [ opcode ]
ST2m A64_V 0 Q:1 001100000 00000 1000 size:2 rn:5 rt:5 \
!constraints { $rn != 31 && !($size == 3 && $Q == 0); } \
!memory { align(1 << $size); reg($rn); }
# ReservedValue: break the !($size == 3 && $Q == 0) constraint
ST2m_RES A64_V 0 0 001100000 00000 1000 11 rn:5 rt:5
# Post-index
# 31 30 29 28 27 26 25 24 23 22 21 20 16 15 14 13 12 11 10 9 5 4 0
# 0 Q 0 0 1 1 0 0 1 0 0 Rm 1 0 0 0 size Rn Rt
# [L] [ opcode ]
ST2m_p A64_V 0 Q:1 001100100 rm:5 1000 size:2 rn:5 rt:5 \
!constraints { $rn != 31 && $rn != $rm && !($size == 3 && $Q == 0); } \
!memory { align(1 << $size); reg($rn); }
# ReservedValue: break the !($size == 3 && $Q == 0) constraint
ST2m_p_RES A64_V 0 0 001100100 rm:5 1000 11 rn:5 rt:5
# C6.3.278 ST2 (single structure) - no offset
# 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 5 4 0
# 0 Q 0 0 1 1 0 1 0 0 1 0 0 0 0 0 x x 0 S size Rn Rt
# [L][R] [ opc ]
ST2_B A64_V 0 Q:1 001101001 00000 000 S:1 size:2 rn:5 rt:5 \
!constraints { $rn != 31; } \
!memory { align(1); reg($rn); }
ST2_H A64_V 0 Q:1 001101001 00000 010 S:1 size:2 rn:5 rt:5 \
!constraints { $rn != 31 && !($size & 0x01); } \
!memory { align(2); reg($rn); }
# ReservedValue: break the !($size & 0x01) constraint
ST2_H_RES A64_V 0 Q:1 001101001 00000 010 S:1 size:1 1 rn:5 rt:5
ST2_S A64_V 0 Q:1 001101001 00000 100 S:1 00 rn:5 rt:5 \
!constraints { $rn != 31; } \
!memory { align(4); reg($rn); }
ST2_D A64_V 0 Q:1 001101001 00000 100 0 01 rn:5 rt:5 \
!constraints { $rn != 31; } \
!memory { align(8); reg($rn); }
# Post-index
# 31 30 29 28 27 26 25 24 23 22 21 20 16 15 14 13 12 11 10 9 5 4 0
# 0 Q 0 0 1 1 0 1 1 0 1 Rm x x 0 S size Rn Rt
# [L][R] [ opc ]
ST2_Bp A64_V 0 Q:1 001101101 rm:5 000 S:1 size:2 rn:5 rt:5 \
!constraints { $rn != 31 && $rn != $rm; } \
!memory { align(1); reg($rn); }
ST2_Hp A64_V 0 Q:1 001101101 rm:5 010 S:1 size:2 rn:5 rt:5 \
!constraints { $rn != 31 && $rn != $rm && !($size & 0x01); } \
!memory { align(2); reg($rn); }
# ReservedValue: break the !($size & 0x01) constraint
ST2_Hp_RES A64_V 0 Q:1 001101101 rm:5 010 S:1 size:1 1 rn:5 rt:5
ST2_Sp A64_V 0 Q:1 001101101 rm:5 100 S:1 00 rn:5 rt:5 \
!constraints { $rn != 31 && $rn != $rm; } \
!memory { align(4); reg($rn); }
ST2_Dp A64_V 0 Q:1 001101101 rm:5 100 0 01 rn:5 rt:5 \
!constraints { $rn != 31 && $rn != $rm; } \
!memory { align(8); reg($rn); }
# C6.3.279 ST3 (multiple structures) - no offset
# 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 5 4 0
# 0 Q 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 size Rn Rt
# [L] [ opcode ]
ST3m A64_V 0 Q:1 001100000 00000 0100 size:2 rn:5 rt:5 \
!constraints { $rn != 31 && !($size == 3 && $Q == 0); } \
!memory { align(1 << $size); reg($rn); }
# ReservedValue: break the !($size == 3 && $Q == 0) constraint
ST3m_RES A64_V 0 0 001100000 00000 0100 11 rn:5 rt:5
# Post-index
# 31 30 29 28 27 26 25 24 23 22 21 20 16 15 14 13 12 11 10 9 5 4 0
# 0 Q 0 0 1 1 0 0 1 0 0 Rm 0 1 0 0 size Rn Rt
# [L] [ opcode ]
ST3m_p A64_V 0 Q:1 001100100 rm:5 0100 size:2 rn:5 rt:5 \
!constraints { $rn != 31 && $rm != $rn && !($size == 3 && $Q == 0); } \
!memory { align(1 << $size); reg($rn); }
# ReservedValue: break the !($size == 3 && $Q == 0) constraint
ST3m_p_RES A64_V 0 0 001100100 rm:5 0100 11 rn:5 rt:5
# C6.3.280 ST3 (single structure) - no offset
# 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 5 4 0
# 0 Q 0 0 1 1 0 1 0 0 0 0 0 0 0 0 x x 1 S size Rn Rt
# [L][R] [ opc ]
ST3_B A64_V 0 Q:1 001101000 00000 001 S:1 size:2 rn:5 rt:5 \
!constraints { $rn != 31; } \
!memory { align(1); reg($rn); }
ST3_H A64_V 0 Q:1 001101000 00000 011 S:1 size:2 rn:5 rt:5 \
!constraints { $rn != 31 && !($size & 0x01); } \
!memory { align(2); reg($rn); }
# ReservedValue: break the !($size & 0x01) constraint
ST3_H_RES A64_V 0 Q:1 001101000 00000 011 S:1 size:1 1 rn:5 rt:5
ST3_S A64_V 0 Q:1 001101000 00000 101 S:1 00 rn:5 rt:5 \
!constraints { $rn != 31; } \
!memory { align(4); reg($rn); }
ST3_D A64_V 0 Q:1 001101000 00000 101 0 01 rn:5 rt:5 \
!constraints { $rn != 31; } \
!memory { align(8); reg($rn); }
# Post-index
# 31 30 29 28 27 26 25 24 23 22 21 20 16 15 14 13 12 11 10 9 5 4 0
# 0 Q 0 0 1 1 0 1 1 0 0 Rm x x 1 S size Rn Rt
# [L][R] [ opc ]
ST3_Bp A64_V 0 Q:1 001101100 rm:5 001 S:1 size:2 rn:5 rt:5 \
!constraints { $rn != 31 && $rn != $rm; } \
!memory { align(1); reg($rn); }
ST3_Hp A64_V 0 Q:1 001101100 rm:5 011 S:1 size:2 rn:5 rt:5 \
!constraints { $rn != 31 && $rn != $rm && !($size & 0x01); } \
!memory { align(2); reg($rn); }
# ReservedValue: break the !($size & 0x01) constraint
ST3_Hp_RES A64_V 0 Q:1 001101100 rm:5 011 S:1 size:1 1 rn:5 rt:5
ST3_Sp A64_V 0 Q:1 001101100 rm:5 101 S:1 00 rn:5 rt:5 \
!constraints { $rn != 31 && $rn != $rm; } \
!memory { align(4); reg($rn); }
ST3_Dp A64_V 0 Q:1 001101100 rm:5 101 0 01 rn:5 rt:5 \
!constraints { $rn != 31 && $rn != $rm; } \
!memory { align(8); reg($rn); }
# C6.3.281 ST4 (multiple structures) - no offset
# 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 5 4 0
# 0 Q 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 size Rn Rt
# [L] [ opcode ]
ST4m A64_V 0 Q:1 001100000 00000 0000 size:2 rn:5 rt:5 \
!constraints { $rn != 31 && !($size == 3 && $Q == 0); } \
!memory { align(1 << $size); reg($rn); }
# ReservedValue: break the !($size == 3 && $Q == 0) constraint
ST4m_RES A64_V 0 0 001100000 00000 0000 11 rn:5 rt:5
# Post-index
# 31 30 29 28 27 26 25 24 23 22 21 20 16 15 14 13 12 11 10 9 5 4 0
# 0 Q 0 0 1 1 0 0 1 0 0 Rm 0 0 0 0 size Rn Rt
# [L] [ opcode ]
ST4m_p A64_V 0 Q:1 001100100 rm:5 0000 size:2 rn:5 rt:5 \
!constraints { $rn != 31 && $rm != $rn && !($size == 3 && $Q == 0); } \
!memory { align(1 << $size); reg($rn); }
# ReservedValue: break the !($size == 3 && $Q == 0) constraint
ST4m_p_RES A64_V 0 0 001100100 rm:5 0000 11 rn:5 rt:5
# C6.3.282 ST4 (single structure) - no offset
# 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 5 4 0
# 0 Q 0 0 1 1 0 1 0 0 1 0 0 0 0 0 x x 1 S size Rn Rt
# [L][R] [ opc ]
ST4_B A64_V 0 Q:1 001101001 00000 001 S:1 size:2 rn:5 rt:5 \
!constraints { $rn != 31; } \
!memory { align(1); reg($rn); }
ST4_H A64_V 0 Q:1 001101001 00000 011 S:1 size:2 rn:5 rt:5 \
!constraints { $rn != 31 && !($size & 0x01); } \
!memory { align(2); reg($rn); }
# ReservedValue: break the !($size & 0x01) constraint
ST4_H_RES A64_V 0 Q:1 001101001 00000 011 S:1 size:1 1 rn:5 rt:5
ST4_S A64_V 0 Q:1 001101001 00000 101 S:1 00 rn:5 rt:5 \
!constraints { $rn != 31; } \
!memory { align(4); reg($rn); }
ST4_D A64_V 0 Q:1 001101001 00000 101 0 01 rn:5 rt:5 \
!constraints { $rn != 31; } \
!memory { align(8); reg($rn); }
# Post-index
# 31 30 29 28 27 26 25 24 23 22 21 20 16 15 14 13 12 11 10 9 5 4 0
# 0 Q 0 0 1 1 0 1 1 0 1 Rm x x 1 S size Rn Rt
# [L][R] [ opc ]
ST4_Bp A64_V 0 Q:1 001101101 rm:5 001 S:1 size:2 rn:5 rt:5 \
!constraints { $rn != 31 && $rn != $rm; } \
!memory { align(1); reg($rn); }
ST4_Hp A64_V 0 Q:1 001101101 rm:5 011 S:1 size:2 rn:5 rt:5 \
!constraints { $rn != 31 && $rn != $rm && !($size & 0x01); } \
!memory { align(2); reg($rn); }
# ReservedValue: break the !($size & 0x01) constraint
ST4_Hp_RES A64_V 0 Q:1 001101101 rm:5 011 S:1 size:1 1 rn:5 rt:5
ST4_Sp A64_V 0 Q:1 001101101 rm:5 101 S:1 00 rn:5 rt:5 \
!constraints { $rn != 31 && $rn != $rm; } \
!memory { align(4); reg($rn); }
ST4_Dp A64_V 0 Q:1 001101101 rm:5 101 0 01 rn:5 rt:5 \
!constraints { $rn != 31 && $rn != $rm; } \
!memory { align(8); reg($rn); }
# C6.3.152 LD1 (multiple structures) - no offset
# 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 5 4 0
# 0 Q 0 0 1 1 0 0 0 1 0 0 0 0 0 0 x x 1 x size Rn Rt
# [L] [ opcode ]
LD1m_1 A64_V 0 Q:1 001100010 00000 0111 size:2 rn:5 rt:5 \
!constraints { $rn != 31; } \
!memory { align(1 << $size); reg($rn); }
LD1m_2 A64_V 0 Q:1 001100010 00000 1010 size:2 rn:5 rt:5 \
!constraints { $rn != 31; } \
!memory { align(1 << $size); reg($rn); }
LD1m_3 A64_V 0 Q:1 001100010 00000 0110 size:2 rn:5 rt:5 \
!constraints { $rn != 31; } \
!memory { align(1 << $size); reg($rn); }
LD1m_4 A64_V 0 Q:1 001100010 00000 0010 size:2 rn:5 rt:5 \
!constraints { $rn != 31; } \
!memory { align(1 << $size); reg($rn); }
# Post-index
# 31 30 29 28 27 26 25 24 23 22 21 20 16 15 14 13 12 11 10 9 5 4 0
# 0 Q 0 0 1 1 0 0 1 1 0 Rm x x 1 x size Rn Rt
# [L] [ opcode ]
LD1m_1p A64_V 0 Q:1 001100110 rm:5 0111 size:2 rn:5 rt:5 \
!constraints { $rn != 31 && $rn != $rm; } \
!memory { align(1 << $size); reg($rn); }
LD1m_2p A64_V 0 Q:1 001100110 rm:5 1010 size:2 rn:5 rt:5 \
!constraints { $rn != 31 && $rn != $rm; } \
!memory { align(1 << $size); reg($rn); }
LD1m_3p A64_V 0 Q:1 001100110 rm:5 0110 size:2 rn:5 rt:5 \
!constraints { $rn != 31 && $rn != $rm; } \
!memory { align(1 << $size); reg($rn); }
LD1m_4p A64_V 0 Q:1 001100110 rm:5 0010 size:2 rn:5 rt:5 \
!constraints { $rn != 31 && $rn != $rm; } \
!memory { align(1 << $size); reg($rn); }
# C6.3.153 LD1 (single structure) - no offset
# 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 5 4 0
# 0 Q 0 0 1 1 0 1 0 1 0 0 0 0 0 0 x x 0 S size Rn Rt
# [L][R] [ opc ]
LD1_B A64_V 0 Q:1 001101010 00000 000 S:1 size:2 rn:5 rt:5 \
!constraints { $rn != 31; } \
!memory { align(1); reg($rn); }
LD1_H A64_V 0 Q:1 001101010 00000 010 S:1 size:2 rn:5 rt:5 \
!constraints { $rn != 31 && !($size & 0x01); } \
!memory { align(2); reg($rn); }
# ReservedValue: break the !($size & 0x01) constraint
LD1_H_RES A64_V 0 Q:1 001101010 00000 010 S:1 size:1 1 rn:5 rt:5
LD1_S A64_V 0 Q:1 001101010 00000 100 S:1 00 rn:5 rt:5 \
!constraints { $rn != 31; } \
!memory { align(4); reg($rn); }
LD1_D A64_V 0 Q:1 001101010 00000 100 0 01 rn:5 rt:5 \
!constraints { $rn != 31; } \
!memory { align(8); reg($rn); }
# Post-index
# 31 30 29 28 27 26 25 24 23 22 21 20 16 15 14 13 12 11 10 9 5 4 0
# 0 Q 0 0 1 1 0 1 1 1 0 Rm x x 0 S size Rn Rt
# [L][R] [ opc ]
LD1_Bp A64_V 0 Q:1 001101110 rm:5 000 S:1 size:2 rn:5 rt:5 \
!constraints { $rn != 31 && $rn != $rm; } \
!memory { align(1); reg($rn); }
LD1_Hp A64_V 0 Q:1 001101110 rm:5 010 S:1 size:2 rn:5 rt:5 \
!constraints { $rn != 31 && $rn != $rm && !($size & 0x01); } \
!memory { align(2); reg($rn); }
# ReservedValue: break the !($size & 0x01) constraint
LD1_Hp_RES A64_V 0 Q:1 001101110 rm:5 010 S:1 size:1 1 rn:5 rt:5
LD1_Sp A64_V 0 Q:1 001101110 rm:5 100 S:1 00 rn:5 rt:5 \
!constraints { $rn != 31 && $rn != $rm; } \
!memory { align(4); reg($rn); }
LD1_Dp A64_V 0 Q:1 001101110 rm:5 100 0 01 rn:5 rt:5 \
!constraints { $rn != 31 && $rn != $rm; } \
!memory { align(8); reg($rn); }
# C6.3.154 LD1R - no offset
# 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 5 4 0
# 0 Q 0 0 1 1 0 1 0 1 0 0 0 0 0 0 1 1 0 0 size Rn Rt
# [L][R] [ opc ][S]
LD1R A64_V 0 Q:1 001101010 00000 110 0 size:2 rn:5 rt:5 \
!constraints { $rn != 31; } \
!memory { align(1 << $size); reg($rn); }
# Post-index
# 31 30 29 28 27 26 25 24 23 22 21 20 16 15 14 13 12 11 10 9 5 4 0
# 0 Q 0 0 1 1 0 1 1 1 0 Rm 1 1 0 0 size Rn Rt
# [L][R] [ opc ][S]
LD1R_p A64_V 0 Q:1 001101110 rm:5 110 0 size:2 rn:5 rt:5 \
!constraints { $rn != 31 && $rn != $rm; } \
!memory { align(1 << $size); reg($rn); }
# C6.3.155 LD2 (multiple structures) - no offset
# 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 5 4 0
# 0 Q 0 0 1 1 0 0 0 1 0 0 0 0 0 0 1 0 0 0 size Rn Rt
# [L] [ opcode ]
LD2m A64_V 0 Q:1 001100010 00000 1000 size:2 rn:5 rt:5 \
!constraints { $rn != 31 && !($size == 3 && $Q == 0); } \
!memory { align(1 << $size); reg($rn); }
# ReservedValue: break the !($size == 3 && $Q == 0) constraint
LD2m_RES A64_V 0 0 001100010 00000 1000 11 rn:5 rt:5
# Post-index
# 31 30 29 28 27 26 25 24 23 22 21 20 16 15 14 13 12 11 10 9 5 4 0
# 0 Q 0 0 1 1 0 0 1 1 0 Rm 1 0 0 0 size Rn Rt
# [L] [ opcode ]
LD2m_p A64_V 0 Q:1 001100110 rm:5 1000 size:2 rn:5 rt:5 \
!constraints { $rn != 31 && $rn != $rm && !($size == 3 && $Q == 0); } \
!memory { align(1 << $size); reg($rn); }
# ReservedValue: break the !($size == 3 && $Q == 0) constraint
LD2m_p_RES A64_V 0 0 001100110 rm:5 1000 11 rn:5 rt:5
# C6.3.156 LD2 (single structure) - no offset
# 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 5 4 0
# 0 Q 0 0 1 1 0 1 0 1 1 0 0 0 0 0 x x 0 S size Rn Rt
# [L][R] [ opc ]
LD2_B A64_V 0 Q:1 001101011 00000 000 S:1 size:2 rn:5 rt:5 \
!constraints { $rn != 31; } \
!memory { align(1); reg($rn); }
LD2_H A64_V 0 Q:1 001101011 00000 010 S:1 size:2 rn:5 rt:5 \
!constraints { $rn != 31 && !($size & 0x01); } \
!memory { align(2); reg($rn); }
# ReservedValue: break the !($size & 0x01) constraint
LD2_H_RES A64_V 0 Q:1 001101011 00000 010 S:1 size:1 1 rn:5 rt:5
LD2_S A64_V 0 Q:1 001101011 00000 100 S:1 00 rn:5 rt:5 \
!constraints { $rn != 31; } \
!memory { align(4); reg($rn); }
LD2_D A64_V 0 Q:1 001101011 00000 100 0 01 rn:5 rt:5 \
!constraints { $rn != 31; } \
!memory { align(8); reg($rn); }
# Post-index
# 31 30 29 28 27 26 25 24 23 22 21 20 16 15 14 13 12 11 10 9 5 4 0
# 0 Q 0 0 1 1 0 1 1 1 1 Rm x x 0 S size Rn Rt
# [L][R] [ opc ]
LD2_Bp A64_V 0 Q:1 001101111 rm:5 000 S:1 size:2 rn:5 rt:5 \
!constraints { $rn != 31 && $rn != $rm; } \
!memory { align(1); reg($rn); }
LD2_Hp A64_V 0 Q:1 001101111 rm:5 010 S:1 size:2 rn:5 rt:5 \
!constraints { $rn != 31 && $rn != $rm && !($size & 0x01); } \
!memory { align(2); reg($rn); }
# ReservedValue: break the !($size & 0x01) constraint
LD2_Hp_RES A64_V 0 Q:1 001101111 rm:5 010 S:1 size:1 1 rn:5 rt:5
LD2_Sp A64_V 0 Q:1 001101111 rm:5 100 S:1 00 rn:5 rt:5 \
!constraints { $rn != 31 && $rn != $rm; } \
!memory { align(4); reg($rn); }
LD2_Dp A64_V 0 Q:1 001101111 rm:5 100 0 01 rn:5 rt:5 \
!constraints { $rn != 31 && $rn != $rm; } \
!memory { align(8); reg($rn); }
# C6.3.157 LD2R - no offset
# 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 5 4 0
# 0 Q 0 0 1 1 0 1 0 1 1 0 0 0 0 0 1 1 0 0 size Rn Rt
# [L][R] [ opc ] S
LD2R A64_V 0 Q:1 001101011 00000 110 0 size:2 rn:5 rt:5 \
!constraints { $rn != 31; } \
!memory { align(1 << $size); reg($rn); }
# Post-index
# 31 30 29 28 27 26 25 24 23 22 21 20 16 15 14 13 12 11 10 9 5 4 0
# 0 Q 0 0 1 1 0 1 1 1 1 Rm 1 1 0 0 size Rn Rt
# [L][R] [ opc ] S
LD2R_p A64_V 0 Q:1 001101111 rm:5 110 0 size:2 rn:5 rt:5 \
!constraints { $rn != 31 && $rn != $rm; } \
!memory { align(1 << $size); reg($rn); }
# C6.3.158 LD3 (multiple structures) - no offset
# 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 5 4 0
# 0 Q 0 0 1 1 0 0 0 1 0 0 0 0 0 0 0 1 0 0 size Rn Rt
# [L] [ opcode ]
LD3m A64_V 0 Q:1 001100010 00000 0100 size:2 rn:5 rt:5 \
!constraints { $rn != 31 && !($size == 3 && $Q == 0); } \
!memory { align(1 << $size); reg($rn); }
# ReservedValue: break the !($size == 3 && $Q == 0) constraint
LD3m_RES A64_V 0 0 001100010 00000 0100 11 rn:5 rt:5
# Post-index
# 31 30 29 28 27 26 25 24 23 22 21 20 16 15 14 13 12 11 10 9 5 4 0
# 0 Q 0 0 1 1 0 0 1 1 0 Rm 0 1 0 0 size Rn Rt
# [L] [ opcode ]
LD3m_p A64_V 0 Q:1 001100110 rm:5 0100 size:2 rn:5 rt:5 \
!constraints { $rn != 31 && $rn != $rm && !($size == 3 && $Q == 0); } \
!memory { align(1 << $size); reg($rn); }
# ReservedValue: break the !($size == 3 && $Q == 0) constraint
LD3m_p_RES A64_V 0 0 001100110 rm:5 0100 11 rn:5 rt:5
# C6.3.159 LD3 (single structure) - no offset
# 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 5 4 0
# 0 Q 0 0 1 1 0 1 0 1 0 0 0 0 0 0 x x 1 S size Rn Rt
# [L][R] [ opc ]
LD3_B A64_V 0 Q:1 001101010 00000 001 S:1 size:2 rn:5 rt:5 \
!constraints { $rn != 31; } \
!memory { align(1); reg($rn); }
LD3_H A64_V 0 Q:1 001101010 00000 011 S:1 size:2 rn:5 rt:5 \
!constraints { $rn != 31 && !($size & 0x01); } \
!memory { align(2); reg($rn); }
# ReservedValue: break the !($size & 0x01) constraint
LD3_H_RES A64_V 0 Q:1 001101010 00000 011 S:1 size:1 1 rn:5 rt:5
LD3_S A64_V 0 Q:1 001101010 00000 101 S:1 00 rn:5 rt:5 \
!constraints { $rn != 31; } \
!memory { align(4); reg($rn); }
LD3_D A64_V 0 Q:1 001101010 00000 101 0 01 rn:5 rt:5 \
!constraints { $rn != 31; } \
!memory { align(8); reg($rn); }
# Post-index
# 31 30 29 28 27 26 25 24 23 22 21 20 16 15 14 13 12 11 10 9 5 4 0
# 0 Q 0 0 1 1 0 1 1 1 0 Rm x x 1 S size Rn Rt
# [L][R] [ opc ]
LD3_Bp A64_V 0 Q:1 001101110 rm:5 001 S:1 size:2 rn:5 rt:5 \
!constraints { $rn != 31 && $rn != $rm; } \
!memory { align(1); reg($rn); }
LD3_Hp A64_V 0 Q:1 001101110 rm:5 011 S:1 size:2 rn:5 rt:5 \
!constraints { $rn != 31 && $rn != $rm && !($size & 0x01); } \
!memory { align(2); reg($rn); }
LD3_Hp_RES A64_V 0 Q:1 001101110 rm:5 011 S:1 size:1 1 rn:5 rt:5
LD3_Sp A64_V 0 Q:1 001101110 rm:5 101 S:1 00 rn:5 rt:5 \
!constraints { $rn != 31 && $rn != $rm; } \
!memory { align(4); reg($rn); }
LD3_Dp A64_V 0 Q:1 001101110 rm:5 101 0 01 rn:5 rt:5 \
!constraints { $rn != 31 && $rn != $rm; } \
!memory { align(8); reg($rn); }
# C6.3.160 LD3R - no offset
# 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 5 4 0
# 0 Q 0 0 1 1 0 1 0 1 0 0 0 0 0 0 1 1 1 0 size Rn Rt
# [L][R] [ opc ] S
LD3R A64_V 0 Q:1 001101010 00000 111 0 size:2 rn:5 rt:5 \
!constraints { $rn != 31; } \
!memory { align(1 << $size); reg($rn); }
# Post-index
# 31 30 29 28 27 26 25 24 23 22 21 20 16 15 14 13 12 11 10 9 5 4 0
# 0 Q 0 0 1 1 0 1 1 1 0 Rm 1 1 1 0 size Rn Rt
# [L][R] [ opc ] S
LD3R_p A64_V 0 Q:1 001101110 rm:5 111 0 size:2 rn:5 rt:5 \
!constraints { $rn != 31 && $rn != $rm; } \
!memory { align(1 << $size); reg($rn); }
# C6.3.161 LD4 (multiple structures) - no offset
# 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 5 4 0
# 0 Q 0 0 1 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 size Rn Rt
# [L] [ opcode ]
LD4m A64_V 0 Q:1 001100010 00000 0000 size:2 rn:5 rt:5 \
!constraints { $rn != 31 && !($size == 3 && $Q == 0); } \
!memory { align(1 << $size); reg($rn); }
# ReservedValue: break the !($size == 3 && $Q == 0) constraint
LD4m_RES A64_V 0 0 001100010 00000 0000 11 rn:5 rt:5
# Post-index
# 31 30 29 28 27 26 25 24 23 22 21 20 16 15 14 13 12 11 10 9 5 4 0
# 0 Q 0 0 1 1 0 0 1 1 0 Rm 0 0 0 0 size Rn Rt
# [L] [ opcode ]
LD4m_p A64_V 0 Q:1 001100110 rm:5 0000 size:2 rn:5 rt:5 \
!constraints { $rn != 31 && $rn != $rm && !($size == 3 && $Q == 0); } \
!memory { align(1 << $size); reg($rn); }
# ReservedValue: break the !($size == 3 && $Q == 0) constraint
LD4m_p_RES A64_V 0 0 001100110 rm:5 0000 11 rn:5 rt:5
# C6.3.162 LD4 (single structure) - no offset
# 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 5 4 0
# 0 Q 0 0 1 1 0 1 0 1 1 0 0 0 0 0 x x 1 S size Rn Rt
# [L][R] [ opc ]
LD4_B A64_V 0 Q:1 001101011 00000 001 S:1 size:2 rn:5 rt:5 \
!constraints { $rn != 31; } \
!memory { align(1); reg($rn); }
LD4_H A64_V 0 Q:1 001101011 00000 011 S:1 size:2 rn:5 rt:5 \
!constraints { $rn != 31 && !($size & 0x01); } \
!memory { align(2); reg($rn); }
# ReservedValue: break the !($size & 0x01) constraint
LD4_H_RES A64_V 0 Q:1 001101011 00000 011 S:1 size:1 1 rn:5 rt:5
LD4_S A64_V 0 Q:1 001101011 00000 101 S:1 00 rn:5 rt:5 \
!constraints { $rn != 31; } \
!memory { align(4); reg($rn); }
LD4_D A64_V 0 Q:1 001101011 00000 101 0 01 rn:5 rt:5 \
!constraints { $rn != 31; } \
!memory { align(8); reg($rn); }
# Post-index
# 31 30 29 28 27 26 25 24 23 22 21 20 16 15 14 13 12 11 10 9 5 4 0
# 0 Q 0 0 1 1 0 1 1 1 1 Rm x x 1 S size Rn Rt
# [L][R] [ opc ]
LD4_Bp A64_V 0 Q:1 001101111 rm:5 001 S:1 size:2 rn:5 rt:5 \
!constraints { $rn != 31 && $rn != $rm; } \
!memory { align(1); reg($rn); }
LD4_Hp A64_V 0 Q:1 001101111 rm:5 011 S:1 size:2 rn:5 rt:5 \
!constraints { $rn != 31 && $rn != $rm && !($size & 0x01); } \
!memory { align(2); reg($rn); }
# ReservedValue: break the !($size & 0x01) constraint
LD4_Hp_RES A64_V 0 Q:1 001101111 rm:5 011 S:1 size:1 1 rn:5 rt:5
LD4_Sp A64_V 0 Q:1 001101111 rm:5 101 S:1 00 rn:5 rt:5 \
!constraints { $rn != 31 && $rn != $rm; } \
!memory { align(4); reg($rn); }
LD4_Dp A64_V 0 Q:1 001101111 rm:5 101 0 01 rn:5 rt:5 \
!constraints { $rn != 31 && $rn != $rm; } \
!memory { align(8); reg($rn); }
# C6.3.163 LD4R - no offset
# 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 5 4 0
# 0 Q 0 0 1 1 0 1 0 1 1 0 0 0 0 0 1 1 1 0 size Rn Rt
# [L][R] [ opc ] S
LD4R A64_V 0 Q:1 001101011 00000 111 0 size:2 rn:5 rt:5 \
!constraints { $rn != 31; } \
!memory { align(1 << $size); reg($rn); }
# Post-index
# 31 30 29 28 27 26 25 24 23 22 21 20 16 15 14 13 12 11 10 9 5 4 0
# 0 Q 0 0 1 1 0 1 1 1 1 Rm 1 1 1 0 size Rn Rt
# [L][R] [ opc ] S
LD4R_p A64_V 0 Q:1 001101111 rm:5 111 0 size:2 rn:5 rt:5 \
!constraints { $rn != 31 && $rn != $rm; } \
!memory { align(1 << $size); reg($rn); }
# C3.3.5 Load register (PC-relative literal)
# 31 30 29 28 27 26 25 24 23 5 4 0
# opc 0 1 1 V 0 0 imm19 Rt
#
# XXX claudio NIY: problematic, as we need to reach the memblock
# as a PC-relative immediate offset, and check the
# constraints (whether it fits in immx).
#
# LDR_L A64 opc:2 0110 00 imm:19 rt:5 \
# !constraints { $opc != 0x3; } \
# !memory { pc_adr(); }
# PRFM_L A64 11 0 110 00 imm:19 rt:5
# C3.3.6 Load/store exclusive
# 31 30 29 28 27 26 25 24 23 22 21 20 16 15 14 10 9 5 4 0
# size 0 0 1 0 0 0 o2 L o1 Rs o0 Rt2 Rn Rt
# size o2 L o1 o0
# 00 0 0 0 0 STXRB -
# 00 0 0 0 1 STLXRB -
# 00 1 0 0 1 STLRB -
# 01 0 0 0 0 STXRH -
# 01 0 0 0 1 STLXRH -
# 01 1 0 0 1 STLRH -
# 00 0 1 0 0 LDXRB -
# 00 0 1 0 1 LDAXRB -
# 00 1 1 0 1 LDARB -
# 01 0 1 0 0 LDXRH -
# 01 0 1 0 1 LDAXRH -
# 01 1 1 0 1 LDARH -
# 10 0 0 0 0 STXR 32-bit
# 10 0 0 0 1 STLXR 32-bit
# 10 1 0 0 1 STLR 32-bit
# 10 0 1 0 0 LDXR 32-bit
# 10 0 1 0 1 LDAXR 32-bit
# 10 1 1 0 1 LDAR 32-bit
# 11 0 0 0 0 STXR 64-bit
# 11 0 0 0 1 STLXR 64-bit
# 11 1 0 0 1 STLR 64-bit
# 11 0 1 0 0 LDXR 64-bit
# 11 0 1 0 1 LDAXR 64-bit
# 11 1 1 0 1 LDAR 64-bit
# data is in rt, base address in rn, status written to rs
# XXX note: the rn != rt, rn != rtt constraint is a limitation
# of risu. If rn = rt, the SUB used to normalize the base to a non
# process-dependent value is going to have the opposite effect to
# change the load result to a process-dependent value.
# The Tech. Ref. Manual defines behavior for rn == rt in some
# cases (not with writeback, ... etc), so at some point we should
# find out how to relax some of these constraints to really check
# the whole range of possibilities.
STXRB A64 00 001000 000 rs:5 0 11111 rn:5 rt:5 \
!constraints { $rn != 31 && $rs != $rt && $rs != $rn && $rn != $rt; } \
!memory { align(1); reg($rn); }
STLXRB A64 00 001000 000 rs:5 1 11111 rn:5 rt:5 \
!constraints { $rn != 31 && $rs != $rt && $rs != $rn && $rn != $rt; } \
!memory { align(1); reg($rn); }
STLRB A64 00 001000 100 11111 1 11111 rn:5 rt:5 \
!constraints { $rn != 31 && $rn != $rt; } \
!memory { align(1); reg($rn); }
STXRH A64 01 001000 000 rs:5 0 11111 rn:5 rt:5 \
!constraints { $rn != 31 && $rs != $rt && $rs != $rn && $rn != $rt; } \
!memory { align(2); reg($rn); }
STLXRH A64 01 001000 000 rs:5 1 11111 rn:5 rt:5 \
!constraints { $rn != 31 && $rs != $rt && $rs != $rn && $rn != $rt; } \
!memory { align(2); reg($rn); }
STLRH A64 01 001000 100 11111 1 11111 rn:5 rt:5 \
!constraints { $rn != 31 && $rn != $rt; } \
!memory { align(2); reg($rn); }
LDXRB A64 00 001000 010 11111 0 11111 rn:5 rt:5 \
!constraints { $rn != 31 && $rn != $rt; } \
!memory { align(1); reg($rn); }
LDAXRB A64 00 001000 010 11111 1 11111 rn:5 rt:5 \
!constraints { $rn != 31 && $rn != $rt; } \
!memory { align(1); reg($rn); }
LDARB A64 00 001000 110 11111 1 11111 rn:5 rt:5 \
!constraints { $rn != 31 && $rn != $rt; } \
!memory { align(1); reg($rn); }
LDXRH A64 01 001000 010 11111 0 11111 rn:5 rt:5 \
!constraints { $rn != 31 && $rn != $rt; } \
!memory { align(2); reg($rn); }
LDAXRH A64 01 001000 010 11111 1 11111 rn:5 rt:5 \
!constraints { $rn != 31 && $rn != $rt; } \
!memory { align(2); reg($rn); }
LDARH A64 01 001000 110 11111 1 11111 rn:5 rt:5 \
!constraints { $rn != 31 && $rn != $rt; } \
!memory { align(2); reg($rn); }
STXRW A64 10 001000 000 rs:5 0 11111 rn:5 rt:5 \
!constraints { $rn != 31 && $rs != $rt && $rs != $rn && $rn != $rt; } \
!memory { align(4); reg($rn); }
STLXRW A64 10 001000 000 rs:5 1 11111 rn:5 rt:5 \
!constraints { $rn != 31 && $rs != $rt && $rs != $rn && $rn != $rt; } \
!memory { align(4); reg($rn); }
STLRW A64 10 001000 100 11111 1 11111 rn:5 rt:5 \
!constraints { $rn != 31 && $rn != $rt; } \
!memory { align(4); reg($rn); }
LDXRW A64 10 001000 010 11111 0 11111 rn:5 rt:5 \
!constraints { $rn != 31 && $rn != $rt; } \
!memory { align(4); reg($rn); }
LDAXRW A64 10 001000 010 11111 1 11111 rn:5 rt:5 \
!constraints { $rn != 31 && $rn != $rt; } \
!memory { align(4); reg($rn); }
LDARW A64 10 001000 110 11111 1 11111 rn:5 rt:5 \
!constraints { $rn != 31 && $rn != $rt; } \
!memory { align(4); reg($rn); }
STXR A64 11 001000 000 rs:5 0 11111 rn:5 rt:5 \
!constraints { $rn != 31 && $rs != $rt && $rs != $rn && $rn != $rt; } \
!memory { align(8); reg($rn); }
STLXR A64 11 001000 000 rs:5 1 11111 rn:5 rt:5 \
!constraints { $rn != 31 && $rs != $rt && $rs != $rn && $rn != $rt; } \
!memory { align(8); reg($rn); }
STLR A64 11 001000 100 11111 1 11111 rn:5 rt:5 \
!constraints { $rn != 31 && $rn != $rt; } \
!memory { align(8); reg($rn); }
LDXR A64 11 001000 010 11111 0 11111 rn:5 rt:5 \
!constraints { $rn != 31 && $rn != $rt; } \
!memory { align(8); reg($rn); }
LDAXR A64 11 001000 010 11111 1 11111 rn:5 rt:5 \
!constraints { $rn != 31 && $rn != $rt; } \
!memory { align(8); reg($rn); }
LDAR A64 11 001000 110 11111 1 11111 rn:5 rt:5 \
!constraints { $rn != 31 && $rn != $rt; } \
!memory { align(8); reg($rn); }
# Now with P (pair load/stores):
# 10 0 0 1 0 STXP 32-bit
# 10 0 0 1 1 STLXP 32-bit
# 10 0 1 1 0 LDXP 32-bit
# 10 0 1 1 1 LDAXP 32-bit
# 11 0 0 1 0 STXP 64-bit
# 11 0 0 1 1 STLXP 64-bit
# 11 0 1 1 0 LDXP 64-bit
# 11 0 1 1 1 LDAXP 64-bit
STXPW A64 10 001000 001 rs:5 0 rtt:5 rn:5 rt:5 \
!constraints { $rn != 31 && $rs != $rt && $rs != $rtt && $rs != $rn && $rn != $rt && $rn != $rtt; } \
!memory { align(8); reg($rn); }
STLXPW A64 10 001000 001 rs:5 1 rtt:5 rn:5 rt:5 \
!constraints { $rn != 31 && $rs != $rt && $rs != $rtt && $rs != $rn && $rn != $rt && $rn != $rtt; } \
!memory { align(8); reg($rn); }
LDXPW A64 10 001000 011 11111 0 rtt:5 rn:5 rt:5 \
!constraints { $rn != 31 && $rt != $rtt && $rn != $rt && $rn != $rtt; } \
!memory { align(8); reg($rn); }
LDAXPW A64 10 001000 011 11111 1 rtt:5 rn:5 rt:5 \
!constraints { $rn != 31 && $rt != $rtt && $rn != $rt && $rn != $rtt; } \
!memory { align(8); reg($rn); }
STXP A64 11 001000 001 rs:5 0 rtt:5 rn:5 rt:5 \
!constraints { $rn != 31 && $rs != $rt && $rs != $rtt && $rs != $rn && $rn != $rt && $rn != $rtt; } \
!memory { align(16); reg($rn); }
STLXP A64 11 001000 001 rs:5 1 rtt:5 rn:5 rt:5 \
!constraints { $rn != 31 && $rs != $rt && $rs != $rtt && $rs != $rn && $rn != $rt && $rn != $rtt; } \
!memory { align(16); reg($rn); }
LDXP A64 11 001000 011 11111 0 rtt:5 rn:5 rt:5 \
!constraints { $rn != 31 && $rt != $rtt && $rn != $rt && $rn != $rtt; } \
!memory { align(16); reg($rn); }
LDAXP A64 11 001000 011 11111 1 rtt:5 rn:5 rt:5 \
!constraints { $rn != 31 && $rt != $rtt && $rn != $rt && $rn != $rtt; } \
!memory { align(16); reg($rn); }
# C3.3.7 Load/store no-allocate pair (offset)
# 31 30 29 28 27 26 25 24 23 22 21 15 14 10 9 5 4 0
# opc 1 0 1 V 0 0 0 L simm7 Rt2 Rn Rt
#
# opc V L
# 00 0 0 STNP 32-bit
# 00 0 1 LDNP 32-bit
# 10 0 0 STNP 64-bit
# 10 0 1 LDNP 64-bit
STNPW A64 00 101 0 000 0 imm:7 rtt:5 rn:5 rt:5 \
!constraints { $rn != 31 && $rn != $rt && $rn != $rtt; } \
!memory { align(8); reg_plus_imm($rn, sextract($imm, 7) * 4); }
LDNPW A64 00 101 0 000 1 imm:7 rtt:5 rn:5 rt:5 \
!constraints { $rn != 31 && $rt != $rtt && $rn != $rt && $rn != $rtt; } \
!memory { align(8); reg_plus_imm($rn, sextract($imm, 7) * 4); }
STNP A64 10 101 0 000 0 imm:7 rtt:5 rn:5 rt:5 \
!constraints { $rn != 31 && $rn != $rt && $rn != $rtt; } \
!memory { align(16); reg_plus_imm($rn, sextract($imm, 7) * 8); }
LDNP A64 10 101 0 000 1 imm:7 rtt:5 rn:5 rt:5 \
!constraints { $rn != 31 && $rt != $rtt && $rn != $rt && $rn != $rtt; } \
!memory { align(16); reg_plus_imm($rn, sextract($imm, 7) * 8); }
# SIMD variants
# opc V L
# 00 1 0 SIMD STNP 32-bit
# 00 1 1 SIMD LDNP 32-bit
# 01 1 0 SIMD STNP 64-bit
# 01 1 1 SIMD LDNP 64-bit
# 10 1 0 SIMD STNP 128-bit
# 10 1 1 SIMD LDNP 128-bit
# C6.3.283 STNP (SIMD&FP) C6.3.164 LDNP (SIMD&FP)
# 31 30 29 28 27 26 25 24 23 22 21 15 14 10 9 5 4 0
# opc 1 0 1 1 0 0 0 L imm7 Rt2 Rn Rt
STNPS A64_V 00 10110000 imm:7 rtt:5 rn:5 rt:5 \
!constraints { $rn != 31; } \
!memory { align(8); reg_plus_imm($rn, sextract($imm, 7) * 4); }
LDNPS A64_V 00 10110001 imm:7 rtt:5 rn:5 rt:5 \
!constraints { $rn != 31 && $rt != $rtt; } \
!memory { align(8); reg_plus_imm($rn, sextract($imm, 7) * 4); }
STNPD A64_V 01 10110000 imm:7 rtt:5 rn:5 rt:5 \
!constraints { $rn != 31; } \
!memory { align(16); reg_plus_imm($rn, sextract($imm, 7) * 8); }
LDNPD A64_V 01 10110001 imm:7 rtt:5 rn:5 rt:5 \
!constraints { $rn != 31 && $rt != $rtt; } \
!memory { align(16); reg_plus_imm($rn, sextract($imm, 7) * 8); }
STNPQ A64_V 10 10110000 imm:7 rtt:5 rn:5 rt:5 \
!constraints { $rn != 31; } \
!memory { align(32); reg_plus_imm($rn, sextract($imm, 7) * 16); }
LDNPQ A64_V 10 10110001 imm:7 rtt:5 rn:5 rt:5 \
!constraints { $rn != 31 && $rt != $rtt; } \
!memory { align(32); reg_plus_imm($rn, sextract($imm, 7) * 16); }
# C3.3.8 Load/store register (immediate post-indexed)
# 31 30 29 28 27 26 25 24 23 22 21 20 12 11 10 9 5 4 0
# size 1 1 1 V 0 0 opc 0 imm9 0 1 Rn Rt
# merged with 3.3.12
# C3.3.9 Load/store register (immediate pre-indexed)
# 31 30 29 28 27 26 25 24 23 22 21 20 12 11 10 9 5 4 0
# size 1 1 1 V 0 0 opc 0 imm9 1 1 Rn Rt
# merged with 3.3.12
# C3.3.10 Load/store register (register offset)
# 31 30 29 28 27 26 25 24 23 22 21 20 16 15 13 12 11 10 9 5 4 0
# size 1 1 1 V 0 0 opc 1 Rm option S 1 0 Rn Rt
#