diff options
author | Edgar E. Iglesias <edgar.iglesias@gmail.com> | 2010-06-16 13:46:15 +0200 |
---|---|---|
committer | Edgar E. Iglesias <edgar.iglesias@gmail.com> | 2010-06-16 13:46:15 +0200 |
commit | 1884533c74aea64f8acac735a30bc8f427de161f (patch) | |
tree | aac12a18000b74ee4ab20151e8efc365ea2d75f2 | |
parent | 7de141cb8232acb046f916b12d38960ebf119bbe (diff) |
cris: Move sign extension.
Move it in preparation for further changes.
No functional change.
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@axis.com>
-rw-r--r-- | target-cris/translate.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/target-cris/translate.c b/target-cris/translate.c index 898aba6490..45c7682706 100644 --- a/target-cris/translate.c +++ b/target-cris/translate.c @@ -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) |