diff options
author | Aurelien Jarno <aurelien@aurel32.net> | 2015-07-05 22:39:03 +0200 |
---|---|---|
committer | Aurelien Jarno <aurelien@aurel32.net> | 2015-09-13 23:08:51 +0200 |
commit | be654c83608eaba199ed45444debf2dd46a88fe6 (patch) | |
tree | f28edfc65b7136ff1c660f7a0b98e82a234987ae /arch_init.c | |
parent | 577601616dea10db10a716de1be448f8564076f4 (diff) |
target-sh4: improve shad instruction
The SH4 shad instruction can shift in both direction, depending on the
sign of the shift. This is currently implemented using branches, which
is not really efficient and prevents the optimizer to do its job. In
practice it is often used with a constant loaded in a register just
before.
Simplify the implementation by computing both the value shifted to the
left and to the right, and then selecting the correct one with a
movcond. As with a negative value the shift amount can go up to 32 which
is undefined, we shift the value in two steps.
Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Diffstat (limited to 'arch_init.c')
0 files changed, 0 insertions, 0 deletions