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:
Edgar E. Iglesias 2010-06-16 13:46:15 +02:00
parent 7de141cb82
commit 1884533c74

View File

@ -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)