Re: [PATCH v2 46/50] target/hexagon: Split probe_and_commit helper
Philippe Mathieu-Daudé <[email protected]>
| Newsgroups | gmane.comp.emulators.qemu |
|---|---|
| Message-ID | <[email protected]> |
On 30/7/26 05:10, Anton Johansson via qemu development wrote: > Split function into a slowpath such that the faster function can be > translated by helper-to-tcg. > > Signed-off-by: Anton Johansson <[email protected]> > --- > target/hexagon/helper.h | 1 + > target/hexagon/op_helper.c | 17 ++++++++++++++--- > 2 files changed, 15 insertions(+), 3 deletions(-) > > diff --git a/target/hexagon/helper.h b/target/hexagon/helper.h > index 033e5619d6..74d5b7ffe8 100644 > --- a/target/hexagon/helper.h > +++ b/target/hexagon/helper.h > @@ -107,6 +107,7 @@ DEF_HELPER_4(probe_noshuf_load, void, env, i32, int, int) > DEF_HELPER_2(probe_pkt_scalar_store_s0, void, env, int) > DEF_HELPER_2(probe_hvx_stores, void, env, int) > DEF_HELPER_2(probe_pkt_scalar_hvx_stores, void, env, int) > +DEF_HELPER_4(probe_and_commit, void, env, i32, s32, i64) > > #if !defined(CONFIG_USER_ONLY) > DEF_HELPER_3(raise_stack_overflow, void, env, i32, i32) > diff --git a/target/hexagon/op_helper.c b/target/hexagon/op_helper.c > index 1a067cd1ce..c175cecb71 100644 > --- a/target/hexagon/op_helper.c > +++ b/target/hexagon/op_helper.c > @@ -488,7 +488,8 @@ void HELPER(probe_pkt_scalar_hvx_stores)(CPUHexagonState *env, int mask) > } > } > > -#if !defined(CONFIG_HEXAGON_IDEF_PARSER) || defined(CONFIG_HELPER_TO_TCG) > +#if !defined(CONFIG_HEXAGON_IDEF_PARSER) || defined(TARGET_HELPER_TO_TCG) > + > /* > * mem_noshuf > * Section 5.5 of the Hexagon V67 Programmer's Reference Manual > @@ -500,8 +501,18 @@ static void check_noshuf(CPUHexagonState *env, bool pkt_has_scalar_store_s1, > uint32_t slot, target_ulong vaddr, int size, > uintptr_t ra) > { > - if (slot == 0 && pkt_has_scalar_store_s1 && > - ((env->slot_cancelled & (1 << 1)) == 0)) { > + if (slot == 0 && pkt_has_scalar_store_s1) { > + helper_probe_and_commit(env, vaddr, size, ra); > + } > +} > + > +/* > + * > + */ Either fill the comment block, or drop it :) Otherwise: Reviewed-by: Philippe Mathieu-Daudé <[email protected]> > +void HELPER(probe_and_commit)(CPUHexagonState *env, target_ulong vaddr, > + int size, uintptr_t ra) > +{ > + if ((env->slot_cancelled & (1 << 1)) == 0) { > probe_read(env, vaddr, size, MMU_USER_IDX, ra); > commit_store(env, 1, ra); > }