-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathisa.yaml
More file actions
7056 lines (6819 loc) · 179 KB
/
isa.yaml
File metadata and controls
7056 lines (6819 loc) · 179 KB
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
# region Options
options:
version:
description: The version of ARM to use
kind: !version
extensions:
description: The extensions to enable
kind: !extensions
av:
description: If true, r0-r3 and r4-11 will display as a1-a4 and v1-v8 respectively
kind: !bool
r9_use:
description: How R9 should be displayed
kind: !enum
- name: r9
description: General purpose register
- name: sb
description: Static base (SB), used for position-independent data
- name: tr
description: TLS register (TR), used for thread-local storage
sl:
description: If true, R10 will display as SL (stack limit)
kind: !bool
fp:
description: If true, R11 will display as FP (frame pointer)
kind: !bool
ip:
description: If true, R12 will display as IP (intra-procedure call scratch register)
kind: !bool
ual:
description: If true, use Unified Assembly Language syntax (UAL), otherwise use divided syntax
kind: !bool
default: true
versions:
- name: v4
thumb: false
- name: v4t
- name: v5t
- name: v5te
- name: v5tej
- name: v6
- name: v6k
extensions:
- vfp_v2
# endregion
# region Types
types:
- name: s
description: Mnemonic suffix, updates status flags when present
kind: !bool
- name: l
description: Mnemonic suffix, specifies a long load/store for LDC/STC instructions
kind: !bool
- name: wb
description: In LDM/STM, write the last accessed address back to the base register
kind: !bool
format: !fmt "!"
- name: user_mode
description: In LDM/STM, access user mode registers while in a privileged mode
kind: !bool
format: !fmt ^
- name: subtract
description: In LDR/STR and similar, subtract the index register from the base register
kind: !bool
format: !fmt "-"
- name: thumb
description: Only used for formatting purposes where Thumb and ARM formattings are different
kind: !bool
write: false
- name: uimm
description: Unsigned immediate
kind: !uint bits(0..32)
- name: simm
description: Signed immediate
kind: !int bits(0..32)
- name: branch_target
description: The direct destination address of a branch instruction
kind: !struct
format: !fmt "#(addr)"
fields:
- name: addr
kind: !uint pc + bits(0..32)
- name: blx_target
description: The destination of a BLX instruction, which can be direct (immediate) or indirect (register)
no_parse: true
kind: !union
bits: 0..28
complete: true
variants:
101x_xxxx_xxxx_xxxx_xxxx_xxxx_xxxx:
name: direct
description: Direct target
data:
name: target
kind: !type [branch_target, ((bits(0..24) << 2) | (bit(24) << 1)).sign_extend(6) + 8]
0001_0010_1111_1111_1111_0011_xxxx:
name: indirect
description: Indirect target
data:
name: rm
kind: !type [reg, bits(0..4)]
uses:
- !always field(rm)
- name: cond
description: Mnemonic suffix, specifies the condition for whether to execute the instruction
kind: !enum
bits: 0..4
default: al
variants:
- name: eq
description: Equal
- name: ne
description: Not equal
- name: hs
description: Unsigned higher or same
- name: lo
description: Unsigned lower
- name: mi
description: Minus/negative
- name: pl
description: Plus/positive
- name: vs
description: Overflow set
- name: vc
description: Overflow clear
- name: hi
description: Unsigned higher
- name: ls
description: Unsigned lower or same
- name: ge
description: Signed greater than or equal
- name: lt
description: Signed less than
- name: gt
description: Signed greater than
- name: le
description: Signed less than or equal
- name: al
description: Always
format: !fmt ""
- name: reg
description: General-purpose register
kind: !enum
bits: 0..4
variants:
- name: r0
format: !if
cond: option(av)
then: !fmt a1
else: !fmt r0
- name: r1
format: !if
cond: option(av)
then: !fmt a2
else: !fmt r1
- name: r2
format: !if
cond: option(av)
then: !fmt a3
else: !fmt r2
- name: r3
format: !if
cond: option(av)
then: !fmt a4
else: !fmt r3
- name: r4
format: !if
cond: option(av)
then: !fmt v1
else: !fmt r4
- name: r5
format: !if
cond: option(av)
then: !fmt v2
else: !fmt r5
- name: r6
format: !if
cond: option(av)
then: !fmt v3
else: !fmt r6
- name: r7
format: !if
cond: option(av)
then: !fmt v4
else: !fmt r7
- name: r8
format: !if
cond: option(av)
then: !fmt v5
else: !fmt r8
- name: r9
description: General-purpose or SB (static base) or TR (TLS register)
format: !match
value: option(r9_use)
option: r9_use
cases:
r9: !if
cond: option(av)
then: !fmt v6
else: !fmt r9
sb: !fmt sb
tr: !fmt tr
- name: r10
description: General-purpose or SL (stack limit)
format: !if
cond: option(sl)
then: !fmt sl
else: !if
cond: option(av)
then: !fmt v7
else: !fmt r10
- name: r11
description: General-purpose or FP (frame pointer)
format: !if
cond: option(fp)
then: !fmt fp
else: !if
cond: option(av)
then: !fmt v8
else: !fmt r11
- name: r12
description: General-purpose or IP (intra-procedure call scratch register)
format: !if
cond: option(ip)
then: !fmt ip
else: !fmt r12
- name: sp
description: Stack pointer
- name: lr
description: Link register
- name: pc
description: Program counter
- name: reg_list
description: List of general-purpose registers, used by LDM/STM
kind: !custom
inner_types: [reg]
- name: status_reg
description: Status register
kind: !enum
bits: 0..1
variants:
- name: cpsr
description: Current program status register
- name: spsr
description: Saved program status register
- name: status_fields
description: Status register with field masks
kind: !struct
format: !fmt (reg)_(f)(x)(s)(c)
fields:
- name: reg
kind: !type [status_reg, bit(22)]
- name: c
description: Control field mask
kind: !bool
bits: 16
- name: x
description: Extension field mask
kind: !bool
bits: 17
- name: s
description: Status field mask
kind: !bool
bits: 18
- name: f
description: Flags field mask
kind: !bool
bits: 19
- name: msr_op2
description: Second operand of the MSR instruction, can be an immediate or a register
kind: !union
bits: 0..32
variants:
xxxx_xx1x_xxxx_xxxx_xxxx_xxxx_xxxx_xxxx:
name: imm
description: Immediate
format: !fmt "#(imm)"
data:
name: imm
kind: !type [uimm, bits(0..8).rotate_right(bits(8..12))]
xxxx_xx0x_xxxx_xxxx_xxxx_xxxx_0000_xxxx:
name: reg
description: Register
illegal: ins() & 0xf00 != 0
data:
name: reg
kind: !type [reg, bits(0..4)]
uses:
- !always field(reg)
- name: shift_op
description: Shift operation
kind: !enum
bits: 0..2
default: lsl
variants:
- name: lsl
description: Logical shift left
- name: lsr
description: Logical shift right
- name: asr
description: Arithmetic shift right
- name: ror
description: Rotate right
- name: coproc
description: Coprocessor
kind: !enum
bits: 0..4
variants:
- name: p0
- name: p1
- name: p2
- name: p3
- name: p4
- name: p5
- name: p6
- name: p7
- name: p8
- name: p9
- name: p10
- name: p11
- name: p12
- name: p13
- name: p14
- name: p15
- name: co_reg
description: Coprocessor register
kind: !enum
bits: 0..4
variants:
- name: c0
- name: c1
- name: c2
- name: c3
- name: c4
- name: c5
- name: c6
- name: c7
- name: c8
- name: c9
- name: c10
- name: c11
- name: c12
- name: c13
- name: c14
- name: c15
- name: op2
description:
Second operand of a data-processing operation, can be an immediate, an immediate-shifted register or a register-shifted
register.
kind: !union
bits: 0..32
variants:
xxxx_xx1x_xxxx_xxxx_xxxx_xxxx_xxxx_xxxx:
name: imm
description: Immediate
format: !fmt "#(imm)"
data:
name: imm
kind: !type [uimm, bits(0..8).rotate_right(bits(8..12) << 1)]
xxxx_xx0x_xxxx_xxxx_xxxx_xxxx_0xx1_xxxx:
name: shift_reg
description: Register shifted by register
data:
name: shift_reg
kind: !type [shift_reg, bits(0..32)]
xxxx_xx0x_xxxx_xxxx_xxxx_xxxx_xxx0_xxxx:
name: shift_imm
description: Register shifted by immediate
data:
name: shift_imm
kind: !type [shift_imm, bits(0..32)]
- name: shift_reg
description: Register shifted by another register
kind: !struct
format: !fmt (rm), (shift_op) (rs)
illegal:
- ins() & 0xf == 0xf # rm == pc
- ins() & 0xf00 == 0xf00 # rs == pc
- ins() & 0xf000 == 0xf000 # rd == pc
- ins() & 0xf0000 == 0xf0000 # rn == pc
fields:
- name: rm
description: Register being shifted
kind: !type [reg, bits(0..4)]
- name: shift_op
description: Shift operation to apply
kind: !type [shift_op, bits(5..7)]
- name: rs
description: Register to shift by
kind: !type [reg, bits(8..12)]
uses:
- !always field(rm)
- !always field(rs)
- name: shift_imm
description: Register shifted by an immediate
kind: !struct
format: !if
cond: field(imm) == 0 && field(shift_op) == enum_variant(shift_op, lsl)
then: !fmt (rm)
else: !if
cond: field(imm) == 0 && field(shift_op) == enum_variant(shift_op, ror)
then: !fmt (rm), rrx
else: !fmt "(rm), (shift_op) #(imm)"
fields:
- name: rm
description: Register being shifted
kind: !type [reg, bits(0..4)]
- name: shift_op
description: Shift operation to apply
kind: !type [shift_op, bits(5..7)]
- name: imm
description: Immediate to shift by
kind: !type [uimm, bits(7..12)]
uses:
- !always field(rm)
- name: op2_shift
description: Second operand of a shift instruction, can be an immediate or a register
kind: !union
bits: 0..32
variants:
xxxx_xxxx_xxxx_xxxx_xxxx_xxxx_xxx0_xxxx:
name: imm
description: Immediate
format: !fmt "#(imm)"
data:
name: imm
kind: !type [uimm, "if bits(7..12) != 0 { bits(7..12) } else { 32 }"]
xxxx_xxxx_xxxx_xxxx_xxxx_xxxx_0xx1_xxxx:
name: reg
description: Register
data:
name: reg
kind: !type [reg, bits(8..12)]
uses:
- !always field(reg)
- name: cps_effect
description: Mnemonic suffix for CPS, specifies whether to enable/disable interrupt bits or just set the processor mode
kind: !union
bits: 0..2
variants:
00:
name: set_mode
description: Set mode
format: !fmt ""
10:
name: ie
description: Interrupt enable
11:
name: id
description: Interrupt disable
- name: aif_flags
description: In a CPS instruction, specifies which interrupt bits to enable or disable
kind: !struct
format: !fmt (a)(i)(f)
fields:
- name: a
description: Imprecise data abort bit
kind: !bool
bits: 2
- name: i
description: IRQ interrupt bit
kind: !bool
bits: 1
- name: f
description: FIQ interrupt bit
kind: !bool
bits: 0
- name: addr_ldc_stc
description: The memory address of an LDC/STC instruction
kind: !union
bits: 0..32
variants:
xxxx_xxx1_xxxx_xxxx_xxxx_xxxx_xxxx_xxxx:
name: pre
description: Pre-indexed
data:
name: addr_ldc_stc_pre
kind: !struct
format: !fmt "[(rn), #(offset)](writeback)"
fields:
- name: rn
description: Base register
kind: !type [reg, bits(16..20)]
- name: offset
kind: !type [simm, (bits(0..8) << 2).negate_if(bit(23) == 0)]
- name: writeback
description: If true, write the last accessed address back to the base register
kind: !type [wb, bit(21)]
defs:
- !if [field(writeback), field(rn)]
uses:
- !always field(rn)
xxxx_xxx0_xx1x_xxxx_xxxx_xxxx_xxxx_xxxx:
name: post
description: Post-indexed
data:
name: addr_ldc_stc_post
kind: !struct
format: !fmt "[(rn)], #(offset)"
fields:
- name: rn
description: Base register
kind: !type [reg, bits(16..20)]
- name: offset
kind: !type [simm, (bits(0..8) << 2).negate_if(bit(23) == 0)]
uses:
- !always field(rn)
xxxx_xxx0_1x0x_xxxx_xxxx_xxxx_xxxx_xxxx:
name: unidx
description: Unindexed
data:
name: addr_ldc_stc_unidx
kind: !struct
format: !fmt "[(rn)], {(option)}"
fields:
- name: rn
description: Base register
kind: !type [reg, bits(16..20)]
- name: option
description: Additional options to the coprocessor
kind: !type [uimm, bits(0..8)]
uses:
- !always field(rn)
- name: ldm_stm_mode
description: Mnemonic suffix for LDM/STM, specifies how to step the base address
kind: !enum
bits: 0..2
default: ia
variants:
- name: da
description: Decrement After
- name: ia
description: Increment After
format: !if
cond: option(ual)
then: !fmt ""
else: !fmt ia
- name: db
description: Decrement Before
- name: ib
description: Increment Before
- name: addr_ldr_str
description: The memory address of an LDR(B)/STR(B)/PLD instruction
kind: !union
bits: 0..32
variants:
xxxx_xxx1_xxxx_xxxx_xxxx_xxxx_xxxx_xxxx:
name: pre
description: Pre-indexed
data:
name: addr_ldr_str_pre
kind: !struct
format: !fmt "[(rn), (offset)](writeback)"
fields:
- name: rn
description: Base register
kind: !type [reg, bits(16..20)]
- name: offset
kind: !type [ldr_str_offset, bits(0..32)]
- name: writeback
description: If true, write the last accessed address back to the base register
kind: !type [wb, bit(21)]
defs:
- !if [field(writeback), field(rn)]
uses:
- !always field(rn)
xxxx_xxx0_xx0x_xxxx_xxxx_xxxx_xxxx_xxxx:
name: post
description: Post-indexed
data:
name: addr_ldr_str_post
kind: !type [addr_ldr_str_post, bits(0..32)]
- name: addr_ldr_str_post
description: A post-indexed memory address for LDR(B)(T)/STR(B)(T)
kind: !struct
format: !fmt "[(rn)], (offset)"
fields:
- name: rn
description: Base register
kind: !type [reg, bits(16..20)]
- name: offset
kind: !type [ldr_str_offset, bits(0..32)]
uses:
- !always field(rn)
- name: ldr_str_offset
description: The offset value in the memory address of a LDR(B)/STR(B) instruction, can be an immediate or a register
kind: !union
bits: 0..32
variants:
xxxx_xx0x_xxxx_xxxx_xxxx_xxxx_xxxx_xxxx:
name: imm
description: Immediate offset
format: !fmt "#(offset)"
data:
name: offset
kind: !type [simm, bits(0..12).negate_if(bit(23) == 0)]
xxxx_xx1x_xxxx_xxxx_xxxx_xxxx_xxx0_xxxx:
name: reg
description: Register offset
data:
name: ldr_str_offset_reg
kind: !struct
format: !if
cond: field(imm) == 0 && field(shift_op) == enum_variant(shift_op, lsl)
then: !fmt (subtract)(rm)
else: !if
cond: field(imm) == 0 && field(shift_op) == enum_variant(shift_op, ror)
then: !fmt (subtract)(rm), rrx
else: !fmt "(subtract)(rm), (shift_op) #(imm)"
fields:
- name: subtract
description: If true, subtract Rm from the base register instead of adding
kind: !type [subtract, bit(23) ^ 1]
- name: rm
description: Index register
kind: !type [reg, bits(0..4)]
- name: shift_op
description: Shift operation to apply to Rm
kind: !type [shift_op, bits(5..7)]
- name: imm
description: Immediate to shift by
kind: !type [uimm, "if bits(5..7) == 1 && bits(7..12) == 0 { 0x20 } else { bits(7..12) }"]
uses:
- !always field(rm)
- name: addr_misc_load
description: The memory address of a miscellaneous load/store instruction
kind: !union
bits: 0..32
variants:
xxxx_xxx1_xxxx_xxxx_xxxx_xxxx_xxxx_xxxx:
name: pre
description: Pre-indexed
data:
name: addr_misc_load_pre
kind: !struct
format: !fmt "[(rn), (offset)](writeback)"
fields:
- name: rn
description: Base register
kind: !type [reg, bits(16..20)]
- name: offset
kind: !type [misc_load_offset, bits(0..32)]
- name: writeback
description: If true, write the last accessed address back to the base register
kind: !type [wb, bit(21)]
defs:
- !if [field(writeback), field(rn)]
uses:
- !always field(rn)
xxxx_xxx0_xx0x_xxxx_xxxx_xxxx_xxxx_xxxx:
name: post
description: Post-indexed
data:
name: addr_misc_load_post
kind: !struct
format: !fmt "[(rn)], (offset)"
fields:
- name: rn
description: Base register
kind: !type [reg, bits(16..20)]
- name: offset
kind: !type [misc_load_offset, bits(0..32)]
uses:
- !always field(rn)
- name: misc_load_offset
description:
The offset value in the memory address of a miscellaneous load/store instruction, can be an immediate or a register
kind: !union
bits: 0..32
variants:
xxxx_000x_x1xx_xxxx_xxxx_xxxx_1xx1_xxxx:
name: imm
description: Immediate offset
format: !fmt "#(offset)"
data:
name: offset
kind: !type [simm, ((bits(8..12) << 4) | bits(0..4)).negate_if(bit(23) == 0)]
xxxx_000x_x0xx_xxxx_xxxx_xxxx_1xx1_xxxx:
name: reg
description: Register offset
illegal: ins() & 0xf00 != 0
data:
name: misc_load_offset_reg
kind: !struct
format: !fmt (subtract)(rm)
fields:
- name: subtract
description: If true, subtract Rm from the base register instead of adding
kind: !type [subtract, bit(23) ^ 1]
- name: rm
description: Index register
kind: !type [reg, bits(0..4)]
uses:
- !always field(rm)
- name: srs_rfe_mode
description: Mnemonic suffix for SRS/RFE, specifies how to step the stack pointer
kind: !enum
bits: 0..2
default: ia
variants:
- name: da
description: Decrement After
- name: ia
description: Increment After
- name: db
description: Decrement Before
- name: ib
description: Increment Before
- name: endianness
description: Used by SETEND, specifies the endianness for data accesses
kind: !enum
bits: 0..1
variants:
- name: le
description: Little-endian
- name: be
description: Big-endian
- name: reg_side
description: Mnemonic suffix, specifies which half of a register to use as an operand
kind: !enum
bits: 0..1
variants:
- name: bottom
description: Bottom halfword
format: !fmt b
- name: top
description: Top halfword
format: !fmt t
- name: swap_rm
description: Mnemonic suffix, when performing two 16x16 bit multiplications, swap the two halfwords of Rm
kind: !bool
bits: 0
format: !fmt x
- name: round
description: Mnemonic suffix, round the multiplication result instead of truncating
kind: !bool
bits: 0
format: !fmt r
- name: round_zero
description: Mnemonic suffix, when converting a floating-point number to an integer, round the result towards zero
kind: !bool
bits: 0
format: !if
cond: option(ual)
then: !fmt r
else: !fmt z
- name: sreg
description: General-purpose register for single-precision floating-point numbers
kind: !enum
bits: 0..5
variants:
- name: s0
- name: s1
- name: s2
- name: s3
- name: s4
- name: s5
- name: s6
- name: s7
- name: s8
- name: s9
- name: s10
- name: s11
- name: s12
- name: s13
- name: s14
- name: s15
- name: s16
- name: s17
- name: s18
- name: s19
- name: s20
- name: s21
- name: s22
- name: s23
- name: s24
- name: s25
- name: s26
- name: s27
- name: s28
- name: s29
- name: s30
- name: s31
- name: dreg
description: General-purpose register for double-precision floating-point numbers
kind: !enum
bits: 0..5
variants:
- name: d0
- name: d1
- name: d2
- name: d3
- name: d4
- name: d5
- name: d6
- name: d7
- name: d8
- name: d9
- name: d10
- name: d11
- name: d12
- name: d13
- name: d14
- name: d15
- name: d16
- name: d17
- name: d18
- name: d19
- name: d20
- name: d21
- name: d22
- name: d23
- name: d24
- name: d25
- name: d26
- name: d27
- name: d28
- name: d29
- name: d30
- name: d31
- name: nan_exc
description: Mnemonic suffix, specifies that a comparison operation should cause an exception if any operand is NaN
kind: !bool
bits: 0
format: !fmt e
- name: vcmp_f32_op2
description: Second operand of a VCMP.F32 instruction, can be zero or a register
kind: !union
bits: 0..6
variants:
xxxx_xxxx_xxxx_xxx1_xxxx_xxxx_xx00_0000:
name: zero
description: Compare with zero
format: !fmt "#0.0"
xxxx_xxxx_xxxx_xxx0_xxxx_xxxx_xxx0_xxxx:
name: reg
description: Compare with register
data:
name: sm
kind: !type [sreg, (bits(0..4) << 1) | bit(5)]
uses:
- !always field(sm)
- name: vcmp_f64_op2
description: Second operand of a VCMP.F64 instruction, can be zero or a register
kind: !union
bits: 0..32
variants:
xxxx_xxxx_xxxx_xxx1_xxxx_xxxx_xx00_0000:
name: zero
description: Compare with zero
format: !fmt "#0.0"
xxxx_xxxx_xxxx_xxx0_xxxx_xxxx_xxx0_xxxx:
name: reg
description: Compare with register
data:
name: dm
kind: !type [dreg, (bit(5) << 4) | bits(0..4)]
uses:
- !always field(dm)
- name: sreg_list
description: List of general-purpose single-precision floation-point registers, used by VLDM/VSTM
kind: !custom
inner_types: [sreg]
- name: dreg_list
description: List of general-purpose double-precision floation-point registers, used by VLDM/VSTM
kind: !custom
inner_types: [dreg]
- name: dreg_index
description: A double-precision floating-point register and index (0 or 1) to move to/from
kind: !struct
format: !if
cond: option(ual)
then: !fmt (dreg)[(index)]
else: !fmt (dreg) # index is decided by the opcode mnemonic (e.g. fmdhr or fmdlr)
fields:
- name: dreg
kind: !type [dreg, (bit(7) << 4) | bits(16..20)]
- name: index
kind: !type [uimm, bit(21)]
- name: fpscr
description: Floating-Point Status and Control Register
no_parse: true
kind: !struct
format: !fmt fpscr
fields: []
- name: vldm_vstm_mode
description: Mnemonic suffix for VLDM/VSTM, specifies how to step the base address
kind: !union
bits: 0..2
variants:
01:
name: ia
description: Increment After
10:
name: db
description: Decrement Before
# endregion
# region Opcodes
opcodes:
- mnemonic: adc
description: Add with Carry
params: { s: s, thumb: thumb, cond: cond, rd: reg, rn: reg, op2: op2 }
format:
opcode: !if
cond: option(ual)
then: !fmt adc(s)(cond)
else: !seq
- !fmt adc(cond)
- !if
cond: "!field(thumb)"
then: !fmt (s)
params: !if
cond: option(ual) || !field(thumb)
then: !fmt (rd), (rn), (op2)
else: !fmt (rd), (op2)
defs:
- !always field(rd)
uses:
- !always field(rn)
arm:
- version: [v4*, v5*, v6*, v7]
pattern: xxxx_00x0_101x_xxxx_xxxx_xxxx_xxxx_xxxx
illegal:
- ins() & 0xf0000000 == 0xf0000000 # illegal cond
params:
s: !bits 20
cond: !bits 28..32
rd: !bits 12..16
rn: !bits 16..20
op2: !bits 0..32
thumb:
- version: [v4t, v5t*, v6*]
pattern: 0100_0001_01xx_xxxx
params:
s: !const 1
thumb: !const 1
rd: !bits 0..3
rn: !bits 0..3
op2: !enum [shift_imm, !struct { rm: !bits 3..6 }]
- mnemonic: add
description: Add
params: { s: s, thumb: thumb, cond: cond, rd: reg, rn: reg, op2: op2 }
format:
opcode: !if
cond: option(ual)
then: !fmt add(s)(cond)
else: !seq
- !fmt add(cond)
- !if
cond: "!field(thumb)"
then: !fmt (s)
params: !if
cond: option(ual) || !field(thumb) || field(rd) != field(rn)
then: !fmt (rd), (rn), (op2)
else: !fmt (rd), (op2)
defs:
- !always field(rd)
uses:
- !always field(rn)
arm:
- version: [v4*, v5t*, v6*]
pattern: xxxx_00x0_100x_xxxx_xxxx_xxxx_xxxx_xxxx
illegal:
- ins() & 0xf0000000 == 0xf0000000 # illegal cond
params:
s: !bits 20
cond: !bits 28..32
rd: !bits 12..16
rn: !bits 16..20
op2: !bits 0..32
thumb:
- version: [v4t, v5t*, v6*]
pattern: 0001_110x_xxxx_xxxx
params:
s: !const 1
thumb: !const 1
rd: !bits 0..3
rn: !bits 3..6
op2: !enum [imm, !bits 6..9]
- version: [v4t, v5t*, v6*]
pattern: 0011_0xxx_xxxx_xxxx
params:
s: !const 1
thumb: !const 1
rd: !bits 8..11
rn: !bits 8..11
op2: !enum [imm, !bits 0..8]
- version: [v4t, v5t*, v6*]
pattern: 0001_100x_xxxx_xxxx
params:
s: !const 1
thumb: !const 1
rd: !bits 0..3
rn: !bits 3..6
op2: !enum [shift_imm, !struct { rm: !bits 6..9 }]