On Mon, 18 May 2026 at 17:16, Torbjörn SVENSSON
<[email protected]> wrote:
>
> The algorithm used for hashing is a simple XOR between the pointer
> and the modifier using the "implementation defined" scheme.
>
> Signed-off-by: Torbjörn SVENSSON <[email protected]>
> ---
> target/arm/cpu-features.h | 6 +++
> target/arm/internals.h | 2 +
> target/arm/tcg/cpu-v7m.c | 2 +-
> target/arm/tcg/m_helper.c | 17 ++++++++
> target/arm/tcg/translate.c | 98
> ++++++++++++++++++++++++++++++++++++++++------
> 5 files changed, 113 insertions(+), 12 deletions(-)
>
> static bool trans_PAC(DisasContext *s, arg_empty *a)
> {
> + arg_rrr arg;
> +
> if (!arm_dc_feature(s, ARM_FEATURE_V8_1M)) {
> return false;
> }
>
> - /* Handle as if PACBTI is disabled. */
> - return true;
> + arg.rd = 0xc; /* R12 */
> + arg.rn = 0xe; /* LR */
> + arg.rm = 0xd; /* SP */
Generally it's better to do this kind of thing in the decode
file rather than the trans function, so that this function
get s passed an arg_rrr with the right values filled in
rather than having to synthesize them.
> + return op_pacg(s, &arg);
> }
thanks
-- PMM