On 7/7/20 8:43 AM, Wei Wu wrote:
>  static int32_t operand_imm20(rv_inst inst)
>  {
> -    return (((int64_t)inst << 32) >> 44) << 12;
> +    return ((int64_t)inst << 32) >> 44;
>  }

There's no point in casting to int64_t, for one.  But it would be better to use
sextract32(inst, 12, 20).


r~

Reply via email to