Revision 0ba365f4
b/target-mips/dsp_helper.c | ||
---|---|---|
19 | 19 |
|
20 | 20 |
#include "cpu.h" |
21 | 21 |
#include "helper.h" |
22 |
#include "qemu/bitops.h" |
|
22 | 23 |
|
23 | 24 |
/* As the byte ordering doesn't matter, i.e. all columns are treated |
24 | 25 |
identically, these unions can be used directly. */ |
... | ... | |
90 | 91 |
dspc = env->active_tc.DSPControl; |
91 | 92 |
#ifndef TARGET_MIPS64 |
92 | 93 |
dspc = dspc & 0xFFFFFFC0; |
93 |
dspc |= pos;
|
|
94 |
dspc |= (pos & 0x3F);
|
|
94 | 95 |
#else |
95 | 96 |
dspc = dspc & 0xFFFFFF80; |
96 |
dspc |= pos;
|
|
97 |
dspc |= (pos & 0x7F);
|
|
97 | 98 |
#endif |
98 | 99 |
env->active_tc.DSPControl = dspc; |
99 | 100 |
} |
... | ... | |
3439 | 3440 |
if (sub >= -1) { |
3440 | 3441 |
acc = ((uint64_t)env->active_tc.HI[ac] << 32) | |
3441 | 3442 |
((uint64_t)env->active_tc.LO[ac] & MIPSDSP_LLO); |
3442 |
temp = (acc >> (start_pos - size)) & |
|
3443 |
(((uint32_t)0x01 << (size + 1)) - 1); |
|
3443 |
temp = extract64(acc, start_pos - size, size + 1); |
|
3444 | 3444 |
|
3445 |
set_DSPControl_pos(start_pos - (size + 1), env);
|
|
3445 |
set_DSPControl_pos(sub, env);
|
|
3446 | 3446 |
set_DSPControl_efi(0, env); |
3447 | 3447 |
} else { |
3448 | 3448 |
set_DSPControl_efi(1, env); |
b/tests/tcg/mips/mips32-dsp/extpdp.c | ||
---|---|---|
42 | 42 |
efi = (dsp >> 14) & 0x01; |
43 | 43 |
assert(efi == 1); |
44 | 44 |
|
45 |
|
|
46 |
ach = 0; |
|
47 |
acl = 0; |
|
48 |
dsp = 0; |
|
49 |
result = 0; |
|
50 |
|
|
51 |
__asm |
|
52 |
("wrdsp %1\n\t" |
|
53 |
"mthi %2, $ac1\n\t" |
|
54 |
"mtlo %3, $ac1\n\t" |
|
55 |
"extpdp %0, $ac1, 0x00\n\t" |
|
56 |
"rddsp %1\n\t" |
|
57 |
: "=r"(rt), "+r"(dsp) |
|
58 |
: "r"(ach), "r"(acl) |
|
59 |
); |
|
60 |
assert(dsp == 0x3F); |
|
61 |
assert(result == rt); |
|
62 |
|
|
45 | 63 |
return 0; |
46 | 64 |
} |
Also available in: Unified diff