mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 16:23:55 -06:00
target/hppa: Implement HAVG
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
parent
10c9e58d5c
commit
1b3cb7c874
4 changed files with 22 additions and 0 deletions
|
@ -410,6 +410,20 @@ uint64_t HELPER(hadd_us)(uint64_t r1, uint64_t r2)
|
|||
return ret;
|
||||
}
|
||||
|
||||
uint64_t HELPER(havg)(uint64_t r1, uint64_t r2)
|
||||
{
|
||||
uint64_t ret = 0;
|
||||
|
||||
for (int i = 0; i < 64; i += 16) {
|
||||
int f1 = extract64(r1, i, 16);
|
||||
int f2 = extract64(r2, i, 16);
|
||||
int fr = f1 + f2;
|
||||
|
||||
ret = deposit64(ret, i, 16, (fr >> 1) | (fr & 1));
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
uint64_t HELPER(hsub_ss)(uint64_t r1, uint64_t r2)
|
||||
{
|
||||
uint64_t ret = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue