mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 00:03:54 -06:00
target-arm: convert sar, shl and shr helpers to TCG
Now that the movcond TCG op is available, it's possible to replace shl and shr helpers by TCG code. The code generated by TCG is slightly longer than the code generated by GCC for the helper but is still worth it as this avoid all the consequences of using an helper: globals saved back to memory, no possible optimization, call overhead, etc. Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
parent
72485ec4f6
commit
365af80e47
3 changed files with 43 additions and 33 deletions
|
@ -355,30 +355,6 @@ uint32_t HELPER(sbc_cc)(CPUARMState *env, uint32_t a, uint32_t b)
|
|||
|
||||
/* Similarly for variable shift instructions. */
|
||||
|
||||
uint32_t HELPER(shl)(CPUARMState *env, uint32_t x, uint32_t i)
|
||||
{
|
||||
int shift = i & 0xff;
|
||||
if (shift >= 32)
|
||||
return 0;
|
||||
return x << shift;
|
||||
}
|
||||
|
||||
uint32_t HELPER(shr)(CPUARMState *env, uint32_t x, uint32_t i)
|
||||
{
|
||||
int shift = i & 0xff;
|
||||
if (shift >= 32)
|
||||
return 0;
|
||||
return (uint32_t)x >> shift;
|
||||
}
|
||||
|
||||
uint32_t HELPER(sar)(CPUARMState *env, uint32_t x, uint32_t i)
|
||||
{
|
||||
int shift = i & 0xff;
|
||||
if (shift >= 32)
|
||||
shift = 31;
|
||||
return (int32_t)x >> shift;
|
||||
}
|
||||
|
||||
uint32_t HELPER(shl_cc)(CPUARMState *env, uint32_t x, uint32_t i)
|
||||
{
|
||||
int shift = i & 0xff;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue