mirror of
https://github.com/qemu/qemu.git
synced 2024-11-28 22:33:36 +08:00
cris: Move sign extension.
Move it in preparation for further changes. No functional change. Signed-off-by: Edgar E. Iglesias <edgar.iglesias@axis.com>
This commit is contained in:
parent
7de141cb82
commit
1884533c74
@ -227,6 +227,19 @@ static inline void t_gen_mov_preg_TN(DisasContext *dc, int r, TCGv tn)
|
||||
}
|
||||
}
|
||||
|
||||
/* Sign extend at translation time. */
|
||||
static int sign_extend(unsigned int val, unsigned int width)
|
||||
{
|
||||
int sval;
|
||||
|
||||
/* LSL. */
|
||||
val <<= 31 - width;
|
||||
sval = val;
|
||||
/* ASR. */
|
||||
sval >>= 31 - width;
|
||||
return sval;
|
||||
}
|
||||
|
||||
static int cris_fetch(DisasContext *dc, uint32_t addr,
|
||||
unsigned int size, unsigned int sign)
|
||||
{
|
||||
@ -594,19 +607,6 @@ static void gen_goto_tb(DisasContext *dc, int n, target_ulong dest)
|
||||
}
|
||||
}
|
||||
|
||||
/* Sign extend at translation time. */
|
||||
static int sign_extend(unsigned int val, unsigned int width)
|
||||
{
|
||||
int sval;
|
||||
|
||||
/* LSL. */
|
||||
val <<= 31 - width;
|
||||
sval = val;
|
||||
/* ASR. */
|
||||
sval >>= 31 - width;
|
||||
return sval;
|
||||
}
|
||||
|
||||
static inline void cris_clear_x_flag(DisasContext *dc)
|
||||
{
|
||||
if (dc->flagx_known && dc->flags_x)
|
||||
|
Loading…
Reference in New Issue
Block a user