-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
46 changed files
with
70,293 additions
and
65,731 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
// SPDX-FileCopyrightText: 2021 Rot127 <[email protected]> | ||
// SPDX-License-Identifier: LGPL-3.0-only | ||
|
||
// LLVM commit: 96e220e6886868d6663d966ecc396befffc355e7 | ||
// LLVM commit date: 2022-01-05 11:01:52 +0000 (ISO 8601 format) | ||
// Date of code generation: 2022-09-15 21:50:08-04:00 | ||
// LLVM commit: 7cbf1a2591520c2491aa35339f227775f4d3adf6 | ||
// LLVM commit date: 2023-06-10 15:58:16 -0700 (ISO 8601 format) | ||
// Date of code generation: 2023-09-07 18:26:07-05:00 | ||
//======================================== | ||
// The following code is generated. | ||
// Do not edit. Repository of code generator: | ||
|
@@ -316,6 +316,16 @@ static bool set_pkt_il_ops(RZ_INOUT HexPkt *p) { | |
return false; | ||
} | ||
|
||
static void check_for_jumps(const HexPkt *p, RZ_OUT bool *jump_flag) { | ||
rz_return_if_fail(p && jump_flag); | ||
HexILOp *op; | ||
rz_vector_foreach(p->il_ops, op) { | ||
if (op->attr & HEX_IL_INSN_ATTR_BRANCH) { | ||
*jump_flag = true; | ||
} | ||
} | ||
} | ||
|
||
RZ_IPI RzILOpEffect *hex_get_il_op(const ut32 addr) { | ||
static bool might_has_jumped = false; | ||
HexState *state = hexagon_get_state(); | ||
|
@@ -335,30 +345,32 @@ RZ_IPI RzILOpEffect *hex_get_il_op(const ut32 addr) { | |
p->is_valid = true; | ||
hic->pkt_info.first_insn = true; | ||
state->just_init = false; | ||
if (might_has_jumped) { | ||
might_has_jumped = false; | ||
} | ||
might_has_jumped = false; | ||
} | ||
|
||
if (!p->is_valid && !might_has_jumped) { | ||
RZ_LOG_WARN("Attempt to execute invalid packet at 0x%" PFMT32x "\n", addr); | ||
return NULL; | ||
} | ||
|
||
if (!hic->pkt_info.last_insn) { | ||
// Only at the last instruciton we execute all il ops of the packet. | ||
// Only at the last instruction we execute all il ops of the packet. | ||
return NOP(); | ||
} | ||
printf("addr: 0x%x\n", addr); | ||
|
||
if (!rz_vector_empty(p->il_ops)) { | ||
check_for_jumps(p, &might_has_jumped); | ||
return hex_pkt_to_il_seq(p); | ||
} | ||
|
||
if (!set_pkt_il_ops(p)) { | ||
RZ_LOG_WARN("Setting IL ops of packet failed at at 0x%" PFMT32x "\n", addr); | ||
return NULL; | ||
} | ||
|
||
if (!hex_shuffle_insns(p)) { | ||
RZ_LOG_WARN("Instruction shuffle failed.\n"); | ||
RZ_LOG_WARN("Instruction shuffle failed at 0x%" PFMT32x "\n", addr); | ||
return NULL; | ||
} | ||
|
||
|
@@ -382,11 +394,7 @@ RZ_IPI RzILOpEffect *hex_get_il_op(const ut32 addr) { | |
op->get_il_op = (HexILOpGetter)hex_sync_regs; | ||
rz_vector_push(p->il_ops, op); | ||
|
||
rz_vector_foreach(p->il_ops, op) { | ||
if (op->attr & HEX_IL_INSN_ATTR_BRANCH) { | ||
might_has_jumped = true; | ||
} | ||
} | ||
check_for_jumps(p, &might_has_jumped); | ||
|
||
return hex_pkt_to_il_seq(p); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
// SPDX-FileCopyrightText: 2021 Rot127 <[email protected]> | ||
// SPDX-License-Identifier: LGPL-3.0-only | ||
|
||
// LLVM commit: 96e220e6886868d6663d966ecc396befffc355e7 | ||
// LLVM commit date: 2022-01-05 11:01:52 +0000 (ISO 8601 format) | ||
// Date of code generation: 2022-09-16 15:29:15-04:00 | ||
// LLVM commit: 7cbf1a2591520c2491aa35339f227775f4d3adf6 | ||
// LLVM commit date: 2023-06-10 15:58:16 -0700 (ISO 8601 format) | ||
// Date of code generation: 2023-09-07 18:26:07-05:00 | ||
//======================================== | ||
// The following code is generated. | ||
// Do not edit. Repository of code generator: | ||
|
@@ -26,7 +26,6 @@ | |
#define HEX_GET_NPC(pkt) hex_get_npc(pkt) | ||
#define HEX_CLO32(val) hex_clo32(val) | ||
#define HEX_CLZ32(val) hex_clz32(val) | ||
#define HEX_WRITE_PRED(pred, cond) hex_write_pred(pred, cond) | ||
#define HEX_WRITE_GLOBAL(name, val) hex_write_global(name, val) | ||
#define INC(val, size) ADD(val, UN(size, 1)) | ||
#define DEC(val, size) SUB(val, UN(size, 1)) | ||
|
@@ -442,6 +441,7 @@ RzILOpEffect *hex_il_op_j2_call(HexInsnPktBundle *bundle); | |
RzILOpEffect *hex_il_op_j2_callf(HexInsnPktBundle *bundle); | ||
RzILOpEffect *hex_il_op_j2_callr(HexInsnPktBundle *bundle); | ||
RzILOpEffect *hex_il_op_j2_callrf(HexInsnPktBundle *bundle); | ||
RzILOpEffect *hex_il_op_j2_callrh(HexInsnPktBundle *bundle); | ||
RzILOpEffect *hex_il_op_j2_callrt(HexInsnPktBundle *bundle); | ||
RzILOpEffect *hex_il_op_j2_callt(HexInsnPktBundle *bundle); | ||
RzILOpEffect *hex_il_op_j2_jump(HexInsnPktBundle *bundle); | ||
|
@@ -456,6 +456,7 @@ RzILOpEffect *hex_il_op_j2_jumprfnewpt(HexInsnPktBundle *bundle); | |
RzILOpEffect *hex_il_op_j2_jumprfpt(HexInsnPktBundle *bundle); | ||
RzILOpEffect *hex_il_op_j2_jumprgtez(HexInsnPktBundle *bundle); | ||
RzILOpEffect *hex_il_op_j2_jumprgtezpt(HexInsnPktBundle *bundle); | ||
RzILOpEffect *hex_il_op_j2_jumprh(HexInsnPktBundle *bundle); | ||
RzILOpEffect *hex_il_op_j2_jumprltez(HexInsnPktBundle *bundle); | ||
RzILOpEffect *hex_il_op_j2_jumprltezpt(HexInsnPktBundle *bundle); | ||
RzILOpEffect *hex_il_op_j2_jumprnz(HexInsnPktBundle *bundle); | ||
|
@@ -483,6 +484,7 @@ RzILOpEffect *hex_il_op_j2_ploop3si(HexInsnPktBundle *bundle); | |
RzILOpEffect *hex_il_op_j2_ploop3sr(HexInsnPktBundle *bundle); | ||
RzILOpEffect *hex_il_op_j2_trap0(HexInsnPktBundle *bundle); | ||
RzILOpEffect *hex_il_op_j2_trap1(HexInsnPktBundle *bundle); | ||
RzILOpEffect *hex_il_op_j2_unpause(HexInsnPktBundle *bundle); | ||
RzILOpEffect *hex_il_op_j4_cmpeq_f_jumpnv_nt(HexInsnPktBundle *bundle); | ||
RzILOpEffect *hex_il_op_j4_cmpeq_f_jumpnv_t(HexInsnPktBundle *bundle); | ||
RzILOpEffect *hex_il_op_j4_cmpeq_fp0_jump_nt_part0(HexInsnPktBundle *bundle); | ||
|
@@ -1876,6 +1878,7 @@ RzILOpEffect *hex_il_op_v6_vadd_qf16_mix(HexInsnPktBundle *bundle); | |
RzILOpEffect *hex_il_op_v6_vadd_qf32(HexInsnPktBundle *bundle); | ||
RzILOpEffect *hex_il_op_v6_vadd_qf32_mix(HexInsnPktBundle *bundle); | ||
RzILOpEffect *hex_il_op_v6_vadd_sf(HexInsnPktBundle *bundle); | ||
RzILOpEffect *hex_il_op_v6_vadd_sf_bf(HexInsnPktBundle *bundle); | ||
RzILOpEffect *hex_il_op_v6_vadd_sf_hf(HexInsnPktBundle *bundle); | ||
RzILOpEffect *hex_il_op_v6_vadd_sf_sf(HexInsnPktBundle *bundle); | ||
RzILOpEffect *hex_il_op_v6_vaddb(HexInsnPktBundle *bundle); | ||
|
@@ -1976,10 +1979,15 @@ RzILOpEffect *hex_il_op_v6_vcl0w(HexInsnPktBundle *bundle); | |
RzILOpEffect *hex_il_op_v6_vcmov(HexInsnPktBundle *bundle); | ||
RzILOpEffect *hex_il_op_v6_vcombine(HexInsnPktBundle *bundle); | ||
RzILOpEffect *hex_il_op_v6_vcombine_tmp(HexInsnPktBundle *bundle); | ||
RzILOpEffect *hex_il_op_v6_vconv_h_hf(HexInsnPktBundle *bundle); | ||
RzILOpEffect *hex_il_op_v6_vconv_hf_h(HexInsnPktBundle *bundle); | ||
RzILOpEffect *hex_il_op_v6_vconv_hf_qf16(HexInsnPktBundle *bundle); | ||
RzILOpEffect *hex_il_op_v6_vconv_hf_qf32(HexInsnPktBundle *bundle); | ||
RzILOpEffect *hex_il_op_v6_vconv_sf_qf32(HexInsnPktBundle *bundle); | ||
RzILOpEffect *hex_il_op_v6_vconv_sf_w(HexInsnPktBundle *bundle); | ||
RzILOpEffect *hex_il_op_v6_vconv_w_sf(HexInsnPktBundle *bundle); | ||
RzILOpEffect *hex_il_op_v6_vcvt_b_hf(HexInsnPktBundle *bundle); | ||
RzILOpEffect *hex_il_op_v6_vcvt_bf_sf(HexInsnPktBundle *bundle); | ||
RzILOpEffect *hex_il_op_v6_vcvt_h_hf(HexInsnPktBundle *bundle); | ||
RzILOpEffect *hex_il_op_v6_vcvt_hf_b(HexInsnPktBundle *bundle); | ||
RzILOpEffect *hex_il_op_v6_vcvt_hf_h(HexInsnPktBundle *bundle); | ||
|
@@ -2045,6 +2053,10 @@ RzILOpEffect *hex_il_op_v6_vgtb(HexInsnPktBundle *bundle); | |
RzILOpEffect *hex_il_op_v6_vgtb_and(HexInsnPktBundle *bundle); | ||
RzILOpEffect *hex_il_op_v6_vgtb_or(HexInsnPktBundle *bundle); | ||
RzILOpEffect *hex_il_op_v6_vgtb_xor(HexInsnPktBundle *bundle); | ||
RzILOpEffect *hex_il_op_v6_vgtbf(HexInsnPktBundle *bundle); | ||
RzILOpEffect *hex_il_op_v6_vgtbf_and(HexInsnPktBundle *bundle); | ||
RzILOpEffect *hex_il_op_v6_vgtbf_or(HexInsnPktBundle *bundle); | ||
RzILOpEffect *hex_il_op_v6_vgtbf_xor(HexInsnPktBundle *bundle); | ||
RzILOpEffect *hex_il_op_v6_vgth(HexInsnPktBundle *bundle); | ||
RzILOpEffect *hex_il_op_v6_vgth_and(HexInsnPktBundle *bundle); | ||
RzILOpEffect *hex_il_op_v6_vgth_or(HexInsnPktBundle *bundle); | ||
|
@@ -2094,13 +2106,15 @@ RzILOpEffect *hex_il_op_v6_vlutvwh_nm(HexInsnPktBundle *bundle); | |
RzILOpEffect *hex_il_op_v6_vlutvwh_oracc(HexInsnPktBundle *bundle); | ||
RzILOpEffect *hex_il_op_v6_vlutvwh_oracci(HexInsnPktBundle *bundle); | ||
RzILOpEffect *hex_il_op_v6_vlutvwhi(HexInsnPktBundle *bundle); | ||
RzILOpEffect *hex_il_op_v6_vmax_bf(HexInsnPktBundle *bundle); | ||
RzILOpEffect *hex_il_op_v6_vmax_hf(HexInsnPktBundle *bundle); | ||
RzILOpEffect *hex_il_op_v6_vmax_sf(HexInsnPktBundle *bundle); | ||
RzILOpEffect *hex_il_op_v6_vmaxb(HexInsnPktBundle *bundle); | ||
RzILOpEffect *hex_il_op_v6_vmaxh(HexInsnPktBundle *bundle); | ||
RzILOpEffect *hex_il_op_v6_vmaxub(HexInsnPktBundle *bundle); | ||
RzILOpEffect *hex_il_op_v6_vmaxuh(HexInsnPktBundle *bundle); | ||
RzILOpEffect *hex_il_op_v6_vmaxw(HexInsnPktBundle *bundle); | ||
RzILOpEffect *hex_il_op_v6_vmin_bf(HexInsnPktBundle *bundle); | ||
RzILOpEffect *hex_il_op_v6_vmin_hf(HexInsnPktBundle *bundle); | ||
RzILOpEffect *hex_il_op_v6_vmin_sf(HexInsnPktBundle *bundle); | ||
RzILOpEffect *hex_il_op_v6_vminb(HexInsnPktBundle *bundle); | ||
|
@@ -2131,6 +2145,8 @@ RzILOpEffect *hex_il_op_v6_vmpy_qf32_hf(HexInsnPktBundle *bundle); | |
RzILOpEffect *hex_il_op_v6_vmpy_qf32_mix_hf(HexInsnPktBundle *bundle); | ||
RzILOpEffect *hex_il_op_v6_vmpy_qf32_qf16(HexInsnPktBundle *bundle); | ||
RzILOpEffect *hex_il_op_v6_vmpy_qf32_sf(HexInsnPktBundle *bundle); | ||
RzILOpEffect *hex_il_op_v6_vmpy_sf_bf(HexInsnPktBundle *bundle); | ||
RzILOpEffect *hex_il_op_v6_vmpy_sf_bf_acc(HexInsnPktBundle *bundle); | ||
RzILOpEffect *hex_il_op_v6_vmpy_sf_hf(HexInsnPktBundle *bundle); | ||
RzILOpEffect *hex_il_op_v6_vmpy_sf_hf_acc(HexInsnPktBundle *bundle); | ||
RzILOpEffect *hex_il_op_v6_vmpy_sf_sf(HexInsnPktBundle *bundle); | ||
|
@@ -2287,6 +2303,7 @@ RzILOpEffect *hex_il_op_v6_vsub_qf16_mix(HexInsnPktBundle *bundle); | |
RzILOpEffect *hex_il_op_v6_vsub_qf32(HexInsnPktBundle *bundle); | ||
RzILOpEffect *hex_il_op_v6_vsub_qf32_mix(HexInsnPktBundle *bundle); | ||
RzILOpEffect *hex_il_op_v6_vsub_sf(HexInsnPktBundle *bundle); | ||
RzILOpEffect *hex_il_op_v6_vsub_sf_bf(HexInsnPktBundle *bundle); | ||
RzILOpEffect *hex_il_op_v6_vsub_sf_hf(HexInsnPktBundle *bundle); | ||
RzILOpEffect *hex_il_op_v6_vsub_sf_sf(HexInsnPktBundle *bundle); | ||
RzILOpEffect *hex_il_op_v6_vsubb(HexInsnPktBundle *bundle); | ||
|
@@ -2352,6 +2369,7 @@ RzILOpEffect *hex_il_op_v6_zld_pred_ppu(HexInsnPktBundle *bundle); | |
RzILOpEffect *hex_il_op_v6_zextract(HexInsnPktBundle *bundle); | ||
RzILOpEffect *hex_il_op_y2_barrier(HexInsnPktBundle *bundle); | ||
RzILOpEffect *hex_il_op_y2_break(HexInsnPktBundle *bundle); | ||
RzILOpEffect *hex_il_op_y2_crswap0(HexInsnPktBundle *bundle); | ||
RzILOpEffect *hex_il_op_y2_dccleana(HexInsnPktBundle *bundle); | ||
RzILOpEffect *hex_il_op_y2_dccleaninva(HexInsnPktBundle *bundle); | ||
RzILOpEffect *hex_il_op_y2_dcfetchbo(HexInsnPktBundle *bundle); | ||
|
@@ -2363,6 +2381,8 @@ RzILOpEffect *hex_il_op_y2_syncht(HexInsnPktBundle *bundle); | |
RzILOpEffect *hex_il_op_y2_tfrscrr(HexInsnPktBundle *bundle); | ||
RzILOpEffect *hex_il_op_y2_tfrsrcr(HexInsnPktBundle *bundle); | ||
RzILOpEffect *hex_il_op_y2_wait(HexInsnPktBundle *bundle); | ||
RzILOpEffect *hex_il_op_y4_crswap1(HexInsnPktBundle *bundle); | ||
RzILOpEffect *hex_il_op_y4_crswap10(HexInsnPktBundle *bundle); | ||
RzILOpEffect *hex_il_op_y4_l2fetch(HexInsnPktBundle *bundle); | ||
RzILOpEffect *hex_il_op_y4_tfrscpp(HexInsnPktBundle *bundle); | ||
RzILOpEffect *hex_il_op_y4_tfrspcp(HexInsnPktBundle *bundle); | ||
|
@@ -2398,9 +2418,6 @@ RzILOpEffect *hex_il_op_imported_rdd_tlbr_rs(HexInsnPktBundle *bundle); | |
RzILOpEffect *hex_il_op_imported_sd_rs(HexInsnPktBundle *bundle); | ||
RzILOpEffect *hex_il_op_imported_sdd_rss(HexInsnPktBundle *bundle); | ||
RzILOpEffect *hex_il_op_imported_ciad_rs(HexInsnPktBundle *bundle); | ||
RzILOpEffect *hex_il_op_imported_crswap_rx_sgp0(HexInsnPktBundle *bundle); | ||
RzILOpEffect *hex_il_op_imported_crswap_rx_sgp1(HexInsnPktBundle *bundle); | ||
RzILOpEffect *hex_il_op_imported_crswap_rxx_sgp1_0(HexInsnPktBundle *bundle); | ||
RzILOpEffect *hex_il_op_imported_cswi_rs(HexInsnPktBundle *bundle); | ||
RzILOpEffect *hex_il_op_imported_dccleanidx_rs(HexInsnPktBundle *bundle); | ||
RzILOpEffect *hex_il_op_imported_dccleaninvidx_rs(HexInsnPktBundle *bundle); | ||
|
Oops, something went wrong.