On Mon, 21 Oct 2019 at 14:29, Alex Bennée <alex.ben...@linaro.org> wrote:
>
> We document this in docs/devel/load-stores.rst so lets follow it. The
> 32 bit and 64 bit access functions have historically not included the
> sign so we leave those as is.
>
> The few places that use signed code loads are fixed up to do the
> casting themselves.
>
> Fixes: 282dffc8
> Signed-off-by: Alex Bennée <alex.ben...@linaro.org>


> diff --git a/target/cris/translate.c b/target/cris/translate.c
> index e752bd06093..f7d3b3e4fdc 100644
> --- a/target/cris/translate.c
> +++ b/target/cris/translate.c
> @@ -231,7 +231,7 @@ static int cris_fetch(CPUCRISState *env, DisasContext 
> *dc, uint32_t addr,
>      case 2:
>      {
>          if (sign) {
> -            r = cpu_ldsw_code(env, addr);
> +            r = (int16_t) cpu_lduw_code(env, addr);
>          } else {
>              r = cpu_lduw_code(env, addr);
>          }

Why not provide the cpu_ldsw_code() that returns an int16_t ?

thanks
-- PMM

Reply via email to