Skip to content

Commit

Permalink
target/arm: Move constant expanders to translate.h
Browse files Browse the repository at this point in the history
Some of the constant expanders defined in translate.c are generically
useful and will be used by the separate C files for VFP and Neon once
they are created; move the expander definitions to translate.h.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20210430132740.10391-2-peter.maydell@linaro.org
  • Loading branch information
pm215 committed May 10, 2021
1 parent eb849d8 commit b5aa664
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 24 deletions.
24 changes: 0 additions & 24 deletions target/arm/translate.c
Expand Up @@ -109,30 +109,6 @@ static void arm_gen_condlabel(DisasContext *s)
}
}

/*
* Constant expanders for the decoders.
*/

static int negate(DisasContext *s, int x)
{
return -x;
}

static int plus_2(DisasContext *s, int x)
{
return x + 2;
}

static int times_2(DisasContext *s, int x)
{
return x * 2;
}

static int times_4(DisasContext *s, int x)
{
return x * 4;
}

/* Flags for the disas_set_da_iss info argument:
* lower bits hold the Rt register number, higher bits are flags.
*/
Expand Down
24 changes: 24 additions & 0 deletions target/arm/translate.h
Expand Up @@ -118,6 +118,30 @@ extern TCGv_i32 cpu_NF, cpu_ZF, cpu_CF, cpu_VF;
extern TCGv_i64 cpu_exclusive_addr;
extern TCGv_i64 cpu_exclusive_val;

/*
* Constant expanders for the decoders.
*/

static inline int negate(DisasContext *s, int x)
{
return -x;
}

static inline int plus_2(DisasContext *s, int x)
{
return x + 2;
}

static inline int times_2(DisasContext *s, int x)
{
return x * 2;
}

static inline int times_4(DisasContext *s, int x)
{
return x * 4;
}

static inline int arm_dc_feature(DisasContext *dc, int feature)
{
return (dc->features & (1ULL << feature)) != 0;
Expand Down

0 comments on commit b5aa664

Please sign in to comment.