33 #include "libiberty.h"
38 int debug_dump =
FALSE;
154 if (qualifiers[0] == qualifiers[1]
170 if (qualifiers[0] == qualifiers[1]
350 {{
"eq",
"none"}, 0x0},
351 {{
"ne",
"any"}, 0x1},
352 {{
"cs",
"hs",
"nlast"}, 0x2},
353 {{
"cc",
"lo",
"ul",
"last"}, 0x3},
354 {{
"mi",
"first"}, 0x4},
355 {{
"pl",
"nfrst"}, 0x5},
358 {{
"hi",
"pmore"}, 0x8},
359 {{
"ls",
"plast"}, 0x9},
360 {{
"ge",
"tcont"}, 0xa},
361 {{
"lt",
"tstop"}, 0xb},
423 if (extend_p ==
TRUE)
479 #define B(op,l,t) (((op) << 3) | (((l) - 1) << 1) | (t))
482 {
"pldl1keep",
B(0, 1, 0) },
483 {
"pldl1strm",
B(0, 1, 1) },
484 {
"pldl2keep",
B(0, 2, 0) },
485 {
"pldl2strm",
B(0, 2, 1) },
486 {
"pldl3keep",
B(0, 3, 0) },
487 {
"pldl3strm",
B(0, 3, 1) },
490 {
"plil1keep",
B(1, 1, 0) },
491 {
"plil1strm",
B(1, 1, 1) },
492 {
"plil2keep",
B(1, 2, 0) },
493 {
"plil2strm",
B(1, 2, 1) },
494 {
"plil3keep",
B(1, 3, 0) },
495 {
"plil3strm",
B(1, 3, 1) },
498 {
"pstl1keep",
B(2, 1, 0) },
499 {
"pstl1strm",
B(2, 1, 1) },
500 {
"pstl2keep",
B(2, 2, 0) },
501 {
"pstl2strm",
B(2, 2, 1) },
502 {
"pstl3keep",
B(2, 3, 0) },
503 {
"pstl3strm",
B(2, 3, 1) },
522 return (
value >= low &&
value <= high) ? 1 : 0;
529 return (
value % align) == 0;
646 return qseq_list[0][
idx];
651 if (qseq_list[
i][known_idx] == known_qlf)
661 return qseq_list[saved_i][
idx];
740 {0, 0, 0,
"retrieving", 0},
802 aarch64_verbose (
const char *
str, ...)
829 aarch64_verbose (
"dump_match_qualifiers:");
831 curr[
i] = opnd[
i].qualifier;
832 dump_qualifier_sequence (curr);
833 aarch64_verbose (
"against");
834 dump_qualifier_sequence (qualifier);
891 if (stop_at < 0 || stop_at >= num_opnds)
892 stop_at = num_opnds - 1;
898 qualifiers = *qualifiers_list;
906 dump_match_qualifiers (inst->
operands, qualifiers);
919 for (j = 0; j < num_opnds && j <= stop_at; ++j, ++qualifiers)
957 qualifiers = *qualifiers_list;
962 dump_qualifier_sequence (qualifiers);
965 for (j = 0; j <= stop_at; ++j, ++qualifiers)
966 ret[j] = *qualifiers;
1003 for (
i = 0;
i < nops; ++
i)
1009 if (update_p ==
TRUE)
1015 "update %s with %s for operand %d",
1068 if (shift_amount !=
NULL)
1069 *shift_amount = amount;
1095 #define TOTAL_IMM_NB 5334
1111 if (imm1->
imm < imm2->
imm)
1113 if (imm1->
imm > imm2->
imm)
1129 return (is64 << 12) | (
r << 6) |
s;
1141 for (log_e = 1; log_e <= 6; log_e++)
1148 mask = 0xffffffffffffffffull;
1154 mask = (1ull <<
e) - 1;
1161 s_mask = ((1u << (5 - log_e)) - 1) << (log_e + 1);
1163 for (
s = 0;
s <
e - 1;
s++)
1164 for (
r = 0;
r <
e;
r++)
1167 imm = (1ull << (
s + 1)) - 1;
1226 upper = (
uint64_t) -1 << (esize * 4) << (esize * 4);
1232 for (
i = esize * 8;
i < 64;
i *= 2)
1239 if (imm_encoding ==
NULL)
1261 for (
i = 0;
i < 8;
i++)
1263 byte = (
imm >> (8 *
i)) & 0xff;
1266 else if (
byte != 0x00)
1279 if (mismatch_detail ==
NULL)
1290 if (mismatch_detail ==
NULL)
1297 int idx,
int lower_bound,
int upper_bound,
1300 if (mismatch_detail ==
NULL)
1303 mismatch_detail->
data[0] = lower_bound;
1304 mismatch_detail->
data[1] = upper_bound;
1309 int idx,
int lower_bound,
int upper_bound)
1311 if (mismatch_detail ==
NULL)
1314 _(
"immediate value"));
1319 int idx,
int lower_bound,
int upper_bound)
1321 if (mismatch_detail ==
NULL)
1324 _(
"immediate offset"));
1329 int idx,
int lower_bound,
int upper_bound)
1331 if (mismatch_detail ==
NULL)
1334 _(
"register number"));
1339 int idx,
int lower_bound,
int upper_bound)
1341 if (mismatch_detail ==
NULL)
1344 _(
"register element index"));
1349 int idx,
int lower_bound,
int upper_bound)
1351 if (mismatch_detail ==
NULL)
1361 int idx,
int lower_bound,
int upper_bound)
1363 if (mismatch_detail ==
NULL)
1373 if (mismatch_detail ==
NULL)
1376 mismatch_detail->
data[0] = alignment;
1383 if (mismatch_detail ==
NULL)
1386 mismatch_detail->
data[0] = expected_num;
1393 if (mismatch_detail ==
NULL)
1436 if (opnds[
idx - 1].
reg.regno % 2 != 0)
1439 _(
"reg pair must start from even reg"));
1442 if (opnds[
idx].
reg.regno != opnds[
idx - 1].
reg.regno + 1)
1445 _(
"reg pair must be contiguous"));
1456 if (opnds[1].present
1462 if (!opnds[1].present
1476 _(
"stack pointer register expected"));
1499 ?
_(
"z0-z15 expected")
1500 :
_(
"z0-z7 expected"));
1526 _(
"invalid register list"));
1537 if (opnd->
reg.regno >= 8
1547 && (opnds[
idx].
cond->value & 0xe) == 0xe)
1563 if (opnd->
addr.writeback == 1)
1566 _(
"unexpected address writeback"));
1571 if (opnd->
addr.writeback == 1 && opnd->
addr.preind != 1)
1574 _(
"unexpected address writeback"));
1582 if (opnd->
addr.writeback == 0)
1585 _(
"address writeback expected"));
1632 _(
"negative or unaligned offset expected"));
1652 if (opnd->
addr.offset.is_reg)
1659 _(
"invalid register offset"));
1672 num_bytes = (is_ld1r ? 1 : prev->
reglist.num_regs)
1675 num_bytes = prev->
reglist.num_regs
1678 if ((
int) num_bytes != opnd->
addr.offset.imm)
1681 _(
"invalid post-increment amount"));
1697 _(
"invalid shift amount"));
1710 _(
"invalid extend/shift operator"));
1756 _(
"immediate out of range"));
1778 _(
"invalid addressing mode"));
1784 min_value, max_value);
1797 goto sve_imm_offset_vl;
1802 goto sve_imm_offset_vl;
1820 _(
"invalid addressing mode"));
1826 min_value, max_value);
1839 goto sve_imm_offset;
1859 && opnd->
addr.offset.regno == 31)
1862 _(
"index register xzr is not allowed"));
1870 _(
"invalid addressing mode"));
1884 goto sve_rr_operand;
1892 goto sve_imm_offset;
1904 _(
"invalid addressing mode"));
1911 goto sve_zz_operand;
1915 goto sve_zz_operand;
1984 _(
"invalid shift operator"));
1990 _(
"shift amount must be 0 or 12"));
1996 _(
"immediate out of range"));
2006 _(
"invalid shift operator"));
2013 _(
"shift amount must be a multiple of 16"));
2022 if (opnd->
imm.value < 0)
2025 _(
"negative immediate value not allowed"));
2031 _(
"immediate out of range"));
2050 _(
"immediate out of range"));
2058 _(
"immediate out of range"));
2101 (1 << (
size - 1)) - 1);
2129 _(
"immediate out of range"));
2137 if (opnd->
imm.value != 0)
2140 _(
"immediate zero expected"));
2148 if (opnd->
imm.value != 0
2149 && opnd->
imm.value != 90
2150 && opnd->
imm.value != 180
2151 && opnd->
imm.value != 270)
2154 _(
"rotate expected to be 0, 90, 180 or 270"));
2161 if (opnd->
imm.value != 90 && opnd->
imm.value != 270)
2164 _(
"rotate expected to be 90 or 270"));
2175 _(
"invalid shift amount"));
2208 _(
"invalid shift operator"));
2216 _(
"invalid shift operator"));
2224 _(
"shift is not permitted"));
2249 _(
"invalid value for immediate"));
2274 _(
"shift amount must be 0 or 16"));
2282 _(
"invalid shift operator"));
2292 if (opnd->
imm.is_fp == 0)
2295 _(
"floating-point immediate expected"));
2305 _(
"immediate out of range"));
2311 _(
"invalid shift operator"));
2322 uvalue = opnd->
imm.value;
2329 _(
"no shift amount allowed for"
2330 " 8-bit constants"));
2339 _(
"shift amount must be 0 or 8"));
2342 if (
shift == 0 && (uvalue & 0xff) == 0)
2345 uvalue = (
int64_t) uvalue / 256;
2349 if ((uvalue &
mask) != uvalue && (uvalue | ~
mask) != uvalue)
2352 _(
"immediate too big for element size"));
2355 uvalue = (uvalue - min_value) &
mask;
2359 _(
"invalid arithmetic immediate"));
2370 if (opnd->
imm.value != 0x3f000000 && opnd->
imm.value != 0x3f800000)
2373 _(
"floating-point value must be 0.5 or 1.0"));
2380 if (opnd->
imm.value != 0x3f000000 && opnd->
imm.value != 0x40000000)
2383 _(
"floating-point value must be 0.5 or 2.0"));
2390 if (opnd->
imm.value != 0 && opnd->
imm.value != 0x3f800000)
2393 _(
"floating-point value must be 0.0 or 1.0"));
2405 _(
"immediate out of range"));
2418 _(
"immediate out of range"));
2424 _(
"invalid replicated MOV immediate"));
2476 && opnds[1].
imm.value > 1)
2539 _(
"extend operator expected"));
2552 _(
"missing extend operator"));
2558 _(
"'LSL' operator not allowed"));
2590 _(
"shift operator expected"));
2597 _(
"'ROR' operator not allowed"));
2647 if (mismatch_detail)
2650 mismatch_detail->
index =
i;
2668 DEBUG_TRACE (
"FAIL on operand qualifier matching");
2669 if (mismatch_detail)
2675 mismatch_detail->
index = -1;
2693 inst->
opcode, mismatch_detail) == 0)
2748 #define BANK(R, FOR31) \
2749 { R (0), R (1), R (2), R (3), R (4), R (5), R (6), R (7), \
2750 R (8), R (9), R (10), R (11), R (12), R (13), R (14), R (15), \
2751 R (16), R (17), R (18), R (19), R (20), R (21), R (22), R (23), \
2752 R (24), R (25), R (26), R (27), R (28), R (29), R (30), FOR31 }
2758 #define R32(X) "w" #X
2759 #define R64(X) "x" #X
2770 #define ZS(X) "z" #X ".s"
2771 #define ZD(X) "z" #X ".d"
2781 static inline const char *
2784 const int has_zr = sp_reg_p ? 0 : 1;
2786 return int_reg[has_zr][is_64][regno];
2791 static inline const char *
2794 const int has_zr = sp_reg_p ? 0 : 1;
2795 return int_reg[has_zr][1][regno];
2801 static inline const char *
2822 static inline const char *
2862 uint32_t imm8_7, imm8_6_0, imm8_6, imm8_6_repl4;
2864 imm8_7 = (imm8 >> 7) & 0x01;
2865 imm8_6_0 = imm8 & 0x7f;
2866 imm8_6 = imm8_6_0 >> 6;
2867 imm8_6_repl4 = (imm8_6 << 3) | (imm8_6 << 2)
2868 | (imm8_6 << 1) | imm8_6;
2871 imm = (imm8_7 << (63-32))
2872 | ((imm8_6 ^ 1) << (62-32))
2873 | (imm8_6_repl4 << (58-32)) | (imm8_6 << (57-32))
2874 | (imm8_6 << (56-32)) | (imm8_6 << (55-32))
2875 | (imm8_6_0 << (48-32));
2880 imm = (imm8_7 << 31)
2881 | ((imm8_6 ^ 1) << 30)
2882 | (imm8_6_repl4 << 26)
2901 const int num_regs = opnd->
reglist.num_regs;
2902 const int first_reg = opnd->
reglist.first_regno;
2903 const int last_reg = (first_reg + num_regs - 1) & 0x1f;
2908 assert (num_regs >= 1 && num_regs <= 4);
2920 if (num_regs > 2 && last_reg > first_reg)
2922 prefix, last_reg, qlf_name, tb);
2925 const int reg0 = first_reg;
2926 const int reg1 = (first_reg + 1) & 0x1f;
2927 const int reg2 = (first_reg + 2) & 0x1f;
2928 const int reg3 = (first_reg + 3) & 0x1f;
2937 prefix, reg1, qlf_name, tb);
2942 prefix, reg2, qlf_name, tb);
2961 if (opnd->
addr.writeback)
2963 if (opnd->
addr.preind)
2974 base, opnd->
addr.offset.imm);
2976 else if (opnd->
addr.offset.imm)
2989 const char *base,
const char *
offset)
3001 print_amount_p =
FALSE;
3005 print_extend_p =
FALSE;
3012 snprintf (tb,
sizeof (tb),
", %s #%" PRIi64, shift_name,
3016 snprintf (tb,
sizeof (tb),
", %s", shift_name);
3041 unsigned int i, num_conds;
3279 c.i = opnd->
imm.value;
3288 enum_value = opnd->
imm.value;
3301 enum_value = opnd->
imm.value;
3309 size_t len = strlen (
buf);
3317 enum_value = opnd->
imm.value;
3330 int imm32 = opnd->
imm.value;
3414 && (opnd->
imm.value ==
3427 size_t len = strlen (
buf);
3473 if (opnd->
addr.offset.is_reg)
3554 if (opnd->
addr.offset.imm)
3586 *notes =
_(
"reading from a write-only register.");
3588 *notes =
_(
"writing to a read-only register.");
3647 #define CPENC(op0,op1,crn,crm,op2) \
3648 ((((op0) << 19) | ((op1) << 16) | ((crn) << 12) | ((crm) << 8) | ((op2) << 5)) >> 5)
3650 #define CPEN_(op1,crm,op2) CPENC(3,(op1),4,(crm),(op2))
3652 #define CPENS(op1,crn,crm,op2) CPENC(1,(op1),(crn),(crm),(op2))
3675 {
"spsr_el1",
CPEN_(0,
C0,0), 0 },
3677 {
"elr_el1",
CPEN_(0,
C0,1), 0 },
3679 {
"sp_el0",
CPEN_(0,
C1,0), 0 },
3680 {
"spsel",
CPEN_(0,
C2,0), 0 },
3688 {
"dspsr_el0",
CPEN_(3,
C5,0), 0 },
3689 {
"dlr_el0",
CPEN_(3,
C5,1), 0 },
3690 {
"spsr_el2",
CPEN_(4,
C0,0), 0 },
3691 {
"elr_el2",
CPEN_(4,
C0,1), 0 },
3692 {
"sp_el1",
CPEN_(4,
C1,0), 0 },
3693 {
"spsr_irq",
CPEN_(4,
C3,0), 0 },
3694 {
"spsr_abt",
CPEN_(4,
C3,1), 0 },
3695 {
"spsr_und",
CPEN_(4,
C3,2), 0 },
3696 {
"spsr_fiq",
CPEN_(4,
C3,3), 0 },
3697 {
"spsr_el3",
CPEN_(6,
C0,0), 0 },
3698 {
"elr_el3",
CPEN_(6,
C0,1), 0 },
3699 {
"sp_el2",
CPEN_(6,
C1,0), 0 },
3740 {
"csselr_el1",
CPENC(3,2,
C0,
C0,0), 0 },
3742 {
"vmpidr_el2",
CPENC(3,4,
C0,
C0,5), 0 },
3801 {
"fpexc32_el2",
CPENC(3,4,
C5,
C3,0), 0 },
3837 {
"contextidr_el1",
CPENC(3,0,
C13,
C0,1), 0 },
3845 {
"teecr32_el1",
CPENC(2,2,
C0,
C0,0), 0 },
3865 {
"cnthp_tval_el2",
CPENC(3,4,
C14,
C2,0), 0 },
3867 {
"cnthp_cval_el2",
CPENC(3,4,
C14,
C2,2), 0 },
3868 {
"cntps_tval_el1",
CPENC(3,7,
C14,
C2,0), 0 },
3870 {
"cntps_cval_el1",
CPENC(3,7,
C14,
C2,2), 0 },
3874 {
"dacr32_el2",
CPENC(3,4,
C3,
C0,0), 0 },
3875 {
"ifsr32_el2",
CPENC(3,4,
C5,
C0,1), 0 },
3876 {
"teehbr32_el1",
CPENC(2,2,
C1,
C0,0), 0 },
3877 {
"sder32_el3",
CPENC(3,6,
C1,
C1,1), 0 },
3878 {
"mdscr_el1",
CPENC(2,0,
C0,
C2, 2), 0 },
3880 {
"mdccint_el1",
CPENC(2,0,
C0,
C2, 0), 0 },
3881 {
"dbgdtr_el0",
CPENC(2,3,
C0,
C4, 0), 0 },
3884 {
"osdtrrx_el1",
CPENC(2,0,
C0,
C0, 2), 0 },
3885 {
"osdtrtx_el1",
CPENC(2,0,
C0,
C3, 2), 0 },
3886 {
"oseccr_el1",
CPENC(2,0,
C0,
C6, 2), 0 },
3887 {
"dbgvcr32_el2",
CPENC(2,4,
C0,
C7, 0), 0 },
3888 {
"dbgbvr0_el1",
CPENC(2,0,
C0,
C0, 4), 0 },
3889 {
"dbgbvr1_el1",
CPENC(2,0,
C0,
C1, 4), 0 },
3890 {
"dbgbvr2_el1",
CPENC(2,0,
C0,
C2, 4), 0 },
3891 {
"dbgbvr3_el1",
CPENC(2,0,
C0,
C3, 4), 0 },
3892 {
"dbgbvr4_el1",
CPENC(2,0,
C0,
C4, 4), 0 },
3893 {
"dbgbvr5_el1",
CPENC(2,0,
C0,
C5, 4), 0 },
3894 {
"dbgbvr6_el1",
CPENC(2,0,
C0,
C6, 4), 0 },
3895 {
"dbgbvr7_el1",
CPENC(2,0,
C0,
C7, 4), 0 },
3896 {
"dbgbvr8_el1",
CPENC(2,0,
C0,
C8, 4), 0 },
3897 {
"dbgbvr9_el1",
CPENC(2,0,
C0,
C9, 4), 0 },
3904 {
"dbgbcr0_el1",
CPENC(2,0,
C0,
C0, 5), 0 },
3905 {
"dbgbcr1_el1",
CPENC(2,0,
C0,
C1, 5), 0 },
3906 {
"dbgbcr2_el1",
CPENC(2,0,
C0,
C2, 5), 0 },
3907 {
"dbgbcr3_el1",
CPENC(2,0,
C0,
C3, 5), 0 },
3908 {
"dbgbcr4_el1",
CPENC(2,0,
C0,
C4, 5), 0 },
3909 {
"dbgbcr5_el1",
CPENC(2,0,
C0,
C5, 5), 0 },
3910 {
"dbgbcr6_el1",
CPENC(2,0,
C0,
C6, 5), 0 },
3911 {
"dbgbcr7_el1",
CPENC(2,0,
C0,
C7, 5), 0 },
3912 {
"dbgbcr8_el1",
CPENC(2,0,
C0,
C8, 5), 0 },
3913 {
"dbgbcr9_el1",
CPENC(2,0,
C0,
C9, 5), 0 },
3920 {
"dbgwvr0_el1",
CPENC(2,0,
C0,
C0, 6), 0 },
3921 {
"dbgwvr1_el1",
CPENC(2,0,
C0,
C1, 6), 0 },
3922 {
"dbgwvr2_el1",
CPENC(2,0,
C0,
C2, 6), 0 },
3923 {
"dbgwvr3_el1",
CPENC(2,0,
C0,
C3, 6), 0 },
3924 {
"dbgwvr4_el1",
CPENC(2,0,
C0,
C4, 6), 0 },
3925 {
"dbgwvr5_el1",
CPENC(2,0,
C0,
C5, 6), 0 },
3926 {
"dbgwvr6_el1",
CPENC(2,0,
C0,
C6, 6), 0 },
3927 {
"dbgwvr7_el1",
CPENC(2,0,
C0,
C7, 6), 0 },
3928 {
"dbgwvr8_el1",
CPENC(2,0,
C0,
C8, 6), 0 },
3929 {
"dbgwvr9_el1",
CPENC(2,0,
C0,
C9, 6), 0 },
3936 {
"dbgwcr0_el1",
CPENC(2,0,
C0,
C0, 7), 0 },
3937 {
"dbgwcr1_el1",
CPENC(2,0,
C0,
C1, 7), 0 },
3938 {
"dbgwcr2_el1",
CPENC(2,0,
C0,
C2, 7), 0 },
3939 {
"dbgwcr3_el1",
CPENC(2,0,
C0,
C3, 7), 0 },
3940 {
"dbgwcr4_el1",
CPENC(2,0,
C0,
C4, 7), 0 },
3941 {
"dbgwcr5_el1",
CPENC(2,0,
C0,
C5, 7), 0 },
3942 {
"dbgwcr6_el1",
CPENC(2,0,
C0,
C6, 7), 0 },
3943 {
"dbgwcr7_el1",
CPENC(2,0,
C0,
C7, 7), 0 },
3944 {
"dbgwcr8_el1",
CPENC(2,0,
C0,
C8, 7), 0 },
3945 {
"dbgwcr9_el1",
CPENC(2,0,
C0,
C9, 7), 0 },
3955 {
"osdlr_el1",
CPENC(2,0,
C1,
C3, 4), 0 },
3956 {
"dbgprcr_el1",
CPENC(2,0,
C1,
C4, 4), 0 },
3957 {
"dbgclaimset_el1",
CPENC(2,0,
C7,
C8, 6), 0 },
3958 {
"dbgclaimclr_el1",
CPENC(2,0,
C7,
C9, 6), 0 },
3974 {
"pmcntenset_el0",
CPENC(3,3,
C9,
C12, 1), 0 },
3975 {
"pmcntenclr_el0",
CPENC(3,3,
C9,
C12, 2), 0 },
3982 {
"pmxevtyper_el0",
CPENC(3,3,
C9,
C13, 1), 0 },
3983 {
"pmxevcntr_el0",
CPENC(3,3,
C9,
C13, 2), 0 },
3984 {
"pmuserenr_el0",
CPENC(3,3,
C9,
C14, 0), 0 },
3985 {
"pmintenset_el1",
CPENC(3,0,
C9,
C14, 1), 0 },
3986 {
"pmintenclr_el1",
CPENC(3,0,
C9,
C14, 2), 0 },
3988 {
"pmevcntr0_el0",
CPENC(3,3,
C14,
C8, 0), 0 },
3989 {
"pmevcntr1_el0",
CPENC(3,3,
C14,
C8, 1), 0 },
3990 {
"pmevcntr2_el0",
CPENC(3,3,
C14,
C8, 2), 0 },
3991 {
"pmevcntr3_el0",
CPENC(3,3,
C14,
C8, 3), 0 },
3992 {
"pmevcntr4_el0",
CPENC(3,3,
C14,
C8, 4), 0 },
3993 {
"pmevcntr5_el0",
CPENC(3,3,
C14,
C8, 5), 0 },
3994 {
"pmevcntr6_el0",
CPENC(3,3,
C14,
C8, 6), 0 },
3995 {
"pmevcntr7_el0",
CPENC(3,3,
C14,
C8, 7), 0 },
3996 {
"pmevcntr8_el0",
CPENC(3,3,
C14,
C9, 0), 0 },
3997 {
"pmevcntr9_el0",
CPENC(3,3,
C14,
C9, 1), 0 },
3998 {
"pmevcntr10_el0",
CPENC(3,3,
C14,
C9, 2), 0 },
3999 {
"pmevcntr11_el0",
CPENC(3,3,
C14,
C9, 3), 0 },
4000 {
"pmevcntr12_el0",
CPENC(3,3,
C14,
C9, 4), 0 },
4001 {
"pmevcntr13_el0",
CPENC(3,3,
C14,
C9, 5), 0 },
4002 {
"pmevcntr14_el0",
CPENC(3,3,
C14,
C9, 6), 0 },
4003 {
"pmevcntr15_el0",
CPENC(3,3,
C14,
C9, 7), 0 },
4063 { 0,
CPENC(0,0,0,0,0), 0 },
4283 {
"spsel", 0x05, 0 },
4284 {
"daifset", 0x1e, 0 },
4285 {
"daifclr", 0x1f, 0 },
4289 { 0,
CPENC(0,0,0,0,0), 0 },
4300 if (
reg->value == 0x04
4305 if (
reg->value == 0x03
4310 if (
reg->value == 0x1a
4322 { 0,
CPENS(0,0,0,0), 0 }
4336 { 0,
CPENS(0,0,0,0), 0 }
4355 { 0,
CPENS(0,0,0,0), 0 }
4441 { 0,
CPENS(0,0,0,0), 0 }
4488 #define BIT(INSN,BT) (((INSN) >> (BT)) & 1)
4489 #define BITS(INSN,HI,LO) (((INSN) >> (LO)) & ((1 << (((HI) - (LO)) + 1)) - 1))
4495 int t =
BITS (insn, 4, 0);
4496 int n =
BITS (insn, 9, 5);
4497 int t2 =
BITS (insn, 14, 10);
4502 if ((t ==
n || t2 ==
n) &&
n != 31)
4526 if ((uvalue & ~upper) != uvalue && (uvalue | upper) != uvalue)
4538 if ((svalue & 0xff) == 0)
4540 return svalue < -128 || svalue >= 128;
4545 #define VERIFIER(x) verify_##x
const struct aarch64_operand aarch64_operands[]
bfd_boolean aarch64_sve_dupm_mov_immediate_p(uint64_t uvalue, int esize)
#define CPENC(op0, op1, crn, crm, op2)
static void set_imm_out_of_range_error(aarch64_operand_error *mismatch_detail, int idx, int lower_bound, int upper_bound)
void aarch64_print_operand(char *buf, size_t size, bfd_vma pc, const aarch64_opcode *opcode, const aarch64_opnd_info *opnds, int idx, int *pcrel_p, bfd_vma *address, char **notes ATTRIBUTE_UNUSED)
struct operand_qualifier_data aarch64_opnd_qualifiers[]
const aarch64_field fields[]
static void set_multiplier_out_of_range_error(aarch64_operand_error *mismatch_detail, int idx, int lower_bound, int upper_bound)
static int get_upper_bound(aarch64_opnd_qualifier_t qualifier)
const aarch64_opcode * aarch64_replace_opcode(aarch64_inst *inst, const aarch64_opcode *opcode)
const aarch64_sys_ins_reg aarch64_sys_regs_ic[]
static bfd_boolean vector_qualifier_p(enum aarch64_opnd_qualifier qualifier)
unsigned char aarch64_get_qualifier_esize(aarch64_opnd_qualifier_t qualifier)
bfd_boolean aarch64_pstatefield_supported_p(const aarch64_feature_set features, const aarch64_sys_reg *reg)
static simd_imm_encoding simd_immediates[TOTAL_IMM_NB]
const aarch64_sys_ins_reg aarch64_sys_regs_at[]
const aarch64_cond aarch64_conds[16]
static void set_other_error(aarch64_operand_error *mismatch_detail, int idx, const char *error)
bfd_boolean aarch64_sys_reg_deprecated_p(const aarch64_sys_reg *reg)
const aarch64_sys_reg aarch64_sys_regs[]
const struct aarch64_name_value_pair aarch64_prfops[32]
const char *const aarch64_sve_pattern_array[32]
enum aarch64_operand_class aarch64_get_operand_class(enum aarch64_opnd type)
static int operand_also_qualified_p(const struct aarch64_opnd_info *operand, aarch64_opnd_qualifier_t target)
static void set_syntax_error(aarch64_operand_error *mismatch_detail, int idx, const char *error)
aarch64_insn aarch64_get_qualifier_standard_value(aarch64_opnd_qualifier_t qualifier)
aarch64_insn aarch64_get_operand_modifier_value(enum aarch64_modifier_kind kind)
bfd_boolean aarch64_sys_ins_reg_supported_p(const aarch64_feature_set features, const aarch64_sys_ins_reg *reg)
int aarch64_num_of_operands(const aarch64_opcode *opcode)
static bfd_boolean fp_qualifier_p(enum aarch64_opnd_qualifier qualifier)
static void set_reg_list_error(aarch64_operand_error *mismatch_detail, int idx, int expected_num)
const aarch64_sys_reg aarch64_pstatefields[]
static void set_regno_out_of_range_error(aarch64_operand_error *mismatch_detail, int idx, int lower_bound, int upper_bound)
const aarch64_sys_ins_reg aarch64_sys_regs_dc[]
static bfd_boolean qualifier_value_in_range_constraint_p(aarch64_opnd_qualifier_t qualifier)
#define CPENS(op1, crn, crm, op2)
static int match_operands_qualifier(aarch64_inst *inst, bfd_boolean update_p)
static void print_register_offset_address(char *buf, size_t size, const aarch64_opnd_info *opnd, const char *base, const char *offset)
int aarch64_stack_pointer_p(const aarch64_opnd_info *operand)
static void set_error(aarch64_operand_error *mismatch_detail, enum aarch64_operand_error_kind kind, int idx, const char *error)
static const char * get_int_reg_name(int regno, aarch64_opnd_qualifier_t qualifier, int sp_reg_p)
static int value_aligned_p(int64_t value, int align)
static bfd_boolean aarch64_shift_operator_p(enum aarch64_modifier_kind kind)
bfd_boolean aarch64_wide_constant_p(int64_t value, int is32, unsigned int *shift_amount)
static const char significant_operand_index[]
static int value_fit_unsigned_field_p(int64_t value, unsigned width)
static void build_immediate_table(void)
static enum data_pattern get_data_pattern(const aarch64_opnd_qualifier_seq_t qualifiers)
const aarch64_sys_ins_reg aarch64_sys_regs_tlbi[]
#define BITS(INSN, HI, LO)
const struct aarch64_name_value_pair aarch64_operand_modifiers[]
int aarch64_shrink_expanded_imm8(uint64_t imm)
static bfd_boolean verify_ldpsw(const struct aarch64_opcode *opcode ATTRIBUTE_UNUSED, const aarch64_insn insn)
static int encode_immediate_bitfield(int is64, uint32_t s, uint32_t r)
bfd_boolean aarch64_sys_reg_supported_p(const aarch64_feature_set features, const aarch64_sys_reg *reg)
static const char * get_offset_int_reg_name(const aarch64_opnd_info *opnd)
aarch64_opnd_qualifier_t aarch64_get_expected_qualifier(const aarch64_opnd_qualifier_seq_t *qseq_list, int idx, const aarch64_opnd_qualifier_t known_qlf, int known_idx)
static bfd_boolean operand_variant_qualifier_p(aarch64_opnd_qualifier_t qualifier)
int aarch64_operand_index(const enum aarch64_opnd *operands, enum aarch64_opnd operand)
int aarch64_match_operands_constraint(aarch64_inst *inst, aarch64_operand_error *mismatch_detail)
static int operand_general_constraint_met_p(const aarch64_opnd_info *opnds, int idx, enum aarch64_opnd type, const aarch64_opcode *opcode, aarch64_operand_error *mismatch_detail)
enum aarch64_modifier_kind aarch64_get_operand_modifier_from_value(aarch64_insn value, bfd_boolean extend_p)
static void set_sft_amount_out_of_range_error(aarch64_operand_error *mismatch_detail, int idx, int lower_bound, int upper_bound)
bfd_boolean aarch64_sys_ins_reg_has_xt(const aarch64_sys_ins_reg *sys_ins_reg)
static const char * get_64bit_int_reg_name(int regno, int sp_reg_p)
static int simd_imm_encoding_cmp(const void *i1, const void *i2)
static void set_offset_out_of_range_error(aarch64_operand_error *mismatch_detail, int idx, int lower_bound, int upper_bound)
static const char * int_reg[2][2][32]
const char *const aarch64_sve_prfop_array[16]
enum aarch64_modifier_kind aarch64_get_operand_modifier(const struct aarch64_name_value_pair *desc)
bfd_boolean aarch64_extend_operator_p(enum aarch64_modifier_kind kind)
static int value_fit_signed_field_p(int64_t value, unsigned width)
const struct aarch64_name_value_pair aarch64_hint_options[]
const aarch64_cond * get_inverted_cond(const aarch64_cond *cond)
const char * aarch64_get_qualifier_name(aarch64_opnd_qualifier_t qualifier)
int aarch64_find_best_match(const aarch64_inst *inst, const aarch64_opnd_qualifier_seq_t *qualifiers_list, int stop_at, aarch64_opnd_qualifier_t *ret)
static const char * get_addr_sve_reg_name(int regno, aarch64_opnd_qualifier_t qualifier)
static int value_in_range_p(int64_t value, int low, int high)
#define CPEN_(op1, crm, op2)
const char * aarch64_get_operand_name(enum aarch64_opnd type)
bfd_boolean aarch64_logical_immediate_p(uint64_t value, int esize, aarch64_insn *encoding)
static void set_out_of_range_error(aarch64_operand_error *mismatch_detail, int idx, int lower_bound, int upper_bound, const char *error)
static void set_elem_idx_out_of_range_error(aarch64_operand_error *mismatch_detail, int idx, int lower_bound, int upper_bound)
const aarch64_cond * get_cond_from_value(aarch64_insn value)
unsigned char aarch64_get_qualifier_nelem(aarch64_opnd_qualifier_t qualifier)
static void print_immediate_offset_address(char *buf, size_t size, const aarch64_opnd_info *opnd, const char *base)
static const char * sve_reg[2][32]
static void print_register_list(char *buf, size_t size, const aarch64_opnd_info *opnd, const char *prefix)
int aarch64_select_operand_for_sizeq_field_coding(const aarch64_opcode *opcode)
int aarch64_zero_register_p(const aarch64_opnd_info *operand)
static void set_unaligned_error(aarch64_operand_error *mismatch_detail, int idx, int alignment)
const struct aarch64_name_value_pair aarch64_barrier_options[16]
const char * aarch64_get_operand_desc(enum aarch64_opnd type)
static int get_lower_bound(aarch64_opnd_qualifier_t qualifier)
static uint64_t expand_fp_imm(int size, uint32_t imm8)
static bfd_boolean operand_maybe_stack_pointer(const aarch64_operand *operand)
static unsigned int get_logsz(unsigned int size)
static unsigned int get_operand_specific_data(const aarch64_operand *operand)
static const aarch64_operand * get_operand_from_code(enum aarch64_opnd code)
static unsigned get_operand_fields_width(const aarch64_operand *operand)
static bfd_boolean operand_need_shift_by_two(const aarch64_operand *operand)
#define DEBUG_TRACE(M,...)
#define DEBUG_TRACE_IF(C, M,...)
unsigned char aarch64_opnd_qualifier_t
#define AARCH64_MAX_QLF_SEQ_NUM
static bfd_boolean optional_operand_p(const aarch64_opcode *opcode, unsigned int idx)
@ AARCH64_OPND_CLASS_MODIFIED_REG
@ AARCH64_OPND_CLASS_SYSTEM
@ AARCH64_OPND_CLASS_INT_REG
@ AARCH64_OPND_CLASS_IMMEDIATE
@ AARCH64_OPND_CLASS_SVE_REG
@ AARCH64_OPND_CLASS_ADDRESS
@ AARCH64_OPND_CLASS_COND
@ AARCH64_OPND_CLASS_SIMD_REGLIST
@ AARCH64_OPND_CLASS_PRED_REG
@ AARCH64_OPND_CLASS_SIMD_ELEMENT
static unsigned int get_opcode_dependent_value(const aarch64_opcode *opcode)
#define AARCH64_FEATURE_PAN
static aarch64_insn get_optional_operand_default_value(const aarch64_opcode *opcode)
static bfd_boolean empty_qualifier_sequence_p(const aarch64_opnd_qualifier_t *qualifiers)
aarch64_opnd_qualifier_t aarch64_opnd_qualifier_seq_t[AARCH64_MAX_OPND_NUM]
#define AARCH64_MAX_OPND_NUM
#define AARCH64_FEATURE_V8_2
aarch64_operand_error_kind
@ AARCH64_OPDE_OUT_OF_RANGE
@ AARCH64_OPDE_INVALID_VARIANT
@ AARCH64_OPDE_UNTIED_OPERAND
@ AARCH64_OPDE_SYNTAX_ERROR
@ AARCH64_OPDE_OTHER_ERROR
@ AARCH64_OPND_ADDR_SIMM10
@ AARCH64_OPND_SVE_UIMM8_53
@ AARCH64_OPND_SVE_ADDR_ZI_U5
@ AARCH64_OPND_SVE_ADDR_RI_S4x16
@ AARCH64_OPND_SVE_Pg4_16
@ AARCH64_OPND_SVE_IMM_ROT1
@ AARCH64_OPND_SVE_ADDR_RX_LSL2
@ AARCH64_OPND_SVE_SHRIMM_PRED
@ AARCH64_OPND_SVE_ADDR_RI_U6x2
@ AARCH64_OPND_SVE_ADDR_RI_S4x4xVL
@ AARCH64_OPND_ADDR_SIMM9_2
@ AARCH64_OPND_SVE_ADDR_RR_LSL3
@ AARCH64_OPND_SVE_Zm3_22_INDEX
@ AARCH64_OPND_SVE_ADDR_RR_LSL2
@ AARCH64_OPND_SIMD_FPIMM
@ AARCH64_OPND_SVE_SHRIMM_UNPRED
@ AARCH64_OPND_SVE_ADDR_ZZ_LSL
@ AARCH64_OPND_SVE_ADDR_RZ_XTW3_14
@ AARCH64_OPND_BARRIER_PSB
@ AARCH64_OPND_SVE_Zm3_INDEX
@ AARCH64_OPND_SVE_ADDR_RZ_XTW1_22
@ AARCH64_OPND_SVE_ADDR_RZ_XTW_14
@ AARCH64_OPND_ADDR_UIMM12
@ AARCH64_OPND_SVE_SHLIMM_PRED
@ AARCH64_OPND_SVE_ADDR_RX_LSL3
@ AARCH64_OPND_ADDR_SIMM9
@ AARCH64_OPND_PSTATEFIELD
@ AARCH64_OPND_SVE_ADDR_RZ_LSL3
@ AARCH64_OPND_SVE_ADDR_RI_S4x3xVL
@ AARCH64_OPND_SVE_ADDR_RX_LSL1
@ AARCH64_OPND_SVE_ADDR_RR
@ AARCH64_OPND_SVE_LIMM_MOV
@ AARCH64_OPND_SVE_I1_HALF_ONE
@ AARCH64_OPND_ADDR_PCREL26
@ AARCH64_OPND_SVE_Pg4_10
@ AARCH64_OPND_SIMD_IMM_SFT
@ AARCH64_OPND_ADDR_PCREL19
@ AARCH64_OPND_SVE_ADDR_RI_S9xVL
@ AARCH64_OPND_BARRIER_ISB
@ AARCH64_OPND_SIMD_ADDR_SIMPLE
@ AARCH64_OPND_SVE_ADDR_RI_S6xVL
@ AARCH64_OPND_SVE_ADDR_RZ_XTW2_22
@ AARCH64_OPND_SVE_ADDR_RZ_XTW1_14
@ AARCH64_OPND_SVE_ADDR_RI_U6
@ AARCH64_OPND_SVE_SIMM5B
@ AARCH64_OPND_SVE_ADDR_RI_U6x8
@ AARCH64_OPND_SVE_PATTERN
@ AARCH64_OPND_SVE_ADDR_RZ_LSL2
@ AARCH64_OPND_SVE_FPIMM8
@ AARCH64_OPND_SVE_ADDR_RX
@ AARCH64_OPND_ADDR_SIMM7
@ AARCH64_OPND_SVE_ADDR_RZ_LSL1
@ AARCH64_OPND_ADDR_PCREL21
@ AARCH64_OPND_ADDR_REGOFF
@ AARCH64_OPND_SVE_ADDR_RI_S4xVL
@ AARCH64_OPND_SVE_ADDR_RZ
@ AARCH64_OPND_ADDR_OFFSET
@ AARCH64_OPND_SVE_I1_HALF_TWO
@ AARCH64_OPND_SVE_ADDR_RI_S4x2xVL
@ AARCH64_OPND_SVE_Zm4_INDEX
@ AARCH64_OPND_SVE_I1_ZERO_ONE
@ AARCH64_OPND_SVE_PATTERN_SCALED
@ AARCH64_OPND_SVE_ADDR_ZI_U5x8
@ AARCH64_OPND_SVE_ADDR_RZ_XTW_22
@ AARCH64_OPND_SVE_SHLIMM_UNPRED
@ AARCH64_OPND_SIMD_ADDR_POST
@ AARCH64_OPND_SVE_ADDR_ZI_U5x4
@ AARCH64_OPND_SVE_IMM_ROT2
@ AARCH64_OPND_SVE_ADDR_ZZ_UXTW
@ AARCH64_OPND_SVE_Zn_INDEX
@ AARCH64_OPND_SVE_ADDR_RR_LSL1
@ AARCH64_OPND_SVE_ADDR_ZZ_SXTW
@ AARCH64_OPND_ADDR_PCREL14
@ AARCH64_OPND_SVE_ADDR_R
@ AARCH64_OPND_SVE_ADDR_RZ_XTW3_22
@ AARCH64_OPND_ADDR_SIMPLE
@ AARCH64_OPND_SVE_ADDR_RI_U6x4
@ AARCH64_OPND_SYSREG_TLBI
@ AARCH64_OPND_SVE_ADDR_ZI_U5x2
@ AARCH64_OPND_SVE_ADDR_RZ_XTW2_14
@ AARCH64_OPND_SVE_INV_LIMM
unsigned long long aarch64_feature_set
#define AARCH64_FEATURE_V8_3
#define AARCH64_FEATURE_SVE
#define AARCH64_PCREL_OFFSET
#define AARCH64_FEATURE_PROFILE
#define AARCH64_FEATURE_V8_4
#define AARCH64_FEATURE_RAS
#define AARCH64_CPU_HAS_FEATURE(CPU, FEAT)
#define AARCH64_FEATURE_V8_1
static RZ_NULLABLE RzILOpBitVector * shift(RzILOpBitVector *val, RZ_NULLABLE RzILOpBool **carry_out, arm_shifter type, RZ_OWN RzILOpBitVector *dist)
_Use_decl_annotations_ int __cdecl printf(const char *const _Format,...)
static const struct @646 features[]
unsigned short prefix[65536]
RZ_API const KEY_TYPE bool * found
static static fork const void static count static fd const char const char static newpath char char char static envp time_t static t const char static mode static whence const char static dir time_t static t unsigned static seconds const char struct utimbuf static buf static inc static sig const char static mode static oldfd struct tms static buf static getgid static geteuid const char static filename static arg static mask struct ustat static ubuf static getppid static setsid static egid sigset_t static set struct timeval struct timezone static tz fd_set fd_set fd_set struct timeval static timeout const char char static bufsiz const char static swapflags void static offset const char static length static mode static who const char struct statfs static buf unsigned unsigned num
assert(limit<=UINT32_MAX/2)
BFD_HOST_U_64_BIT bfd_vma
void qsort(void *a, size_t n, size_t es, int(*cmp)(const void *, const void *))
static struct sockaddr static addrlen static backlog const void static flags void flags
#define cond(bop, top, mask, flags)
aarch64_opnd_info operands[AARCH64_MAX_OPND_NUM]
const aarch64_opcode * opcode
aarch64_opnd_qualifier_seq_t qualifiers_list[AARCH64_MAX_QLF_SEQ_NUM]
enum aarch64_insn_class iclass
unsigned char tied_operand
enum aarch64_opnd operands[AARCH64_MAX_OPND_NUM]
enum aarch64_operand_error_kind kind
enum aarch64_operand_class op_class
const aarch64_cond * cond
aarch64_opnd_qualifier_t qualifier
struct aarch64_opnd_info::@37 shifter
struct aarch64_opnd_info::@35::@43 sysreg
struct aarch64_opnd_info::@35::@42 addr
const struct aarch64_name_value_pair * prfop
unsigned operator_present
const struct aarch64_name_value_pair * barrier
struct aarch64_opnd_info::@35::@39 reglane
enum aarch64_modifier_kind kind
struct aarch64_opnd_info::@35::@38 reg
const aarch64_sys_ins_reg * sysins_op
struct aarch64_opnd_info::@35::@41 imm
struct aarch64_opnd_info::@35::@40 reglist
const struct aarch64_name_value_pair * hint_option
enum operand_qualifier_kind kind
void error(const char *msg)
if(dbg->bits==RZ_SYS_BITS_64)