mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 15:53:54 -06:00
tcg: Add clz and ctz opcodes
Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Signed-off-by: Richard Henderson <rth@twiddle.net>
This commit is contained in:
parent
17280ff4a5
commit
0e28d0063b
17 changed files with 266 additions and 0 deletions
|
@ -101,6 +101,26 @@ int64_t HELPER(mulsh_i64)(int64_t arg1, int64_t arg2)
|
|||
return h;
|
||||
}
|
||||
|
||||
uint32_t HELPER(clz_i32)(uint32_t arg, uint32_t zero_val)
|
||||
{
|
||||
return arg ? clz32(arg) : zero_val;
|
||||
}
|
||||
|
||||
uint32_t HELPER(ctz_i32)(uint32_t arg, uint32_t zero_val)
|
||||
{
|
||||
return arg ? ctz32(arg) : zero_val;
|
||||
}
|
||||
|
||||
uint64_t HELPER(clz_i64)(uint64_t arg, uint64_t zero_val)
|
||||
{
|
||||
return arg ? clz64(arg) : zero_val;
|
||||
}
|
||||
|
||||
uint64_t HELPER(ctz_i64)(uint64_t arg, uint64_t zero_val)
|
||||
{
|
||||
return arg ? ctz64(arg) : zero_val;
|
||||
}
|
||||
|
||||
void HELPER(exit_atomic)(CPUArchState *env)
|
||||
{
|
||||
cpu_loop_exit_atomic(ENV_GET_CPU(env), GETPC());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue