Revision 8f8e3aa4 target-arm/op_helper.c
b/target-arm/op_helper.c | ||
---|---|---|
40 | 40 |
spin_unlock(&global_cpu_lock); |
41 | 41 |
} |
42 | 42 |
|
43 |
void helper_neon_tbl(int rn, int maxindex) |
|
43 |
uint32_t HELPER(neon_tbl)(uint32_t ireg, uint32_t def, |
|
44 |
uint32_t rn, uint32_t maxindex) |
|
44 | 45 |
{ |
45 | 46 |
uint32_t val; |
46 |
uint32_t mask; |
|
47 | 47 |
uint32_t tmp; |
48 | 48 |
int index; |
49 | 49 |
int shift; |
50 | 50 |
uint64_t *table; |
51 | 51 |
table = (uint64_t *)&env->vfp.regs[rn]; |
52 | 52 |
val = 0; |
53 |
mask = 0; |
|
54 | 53 |
for (shift = 0; shift < 32; shift += 8) { |
55 |
index = (T1 >> shift) & 0xff;
|
|
56 |
if (index <= maxindex) {
|
|
54 |
index = (ireg >> shift) & 0xff;
|
|
55 |
if (index < maxindex) { |
|
57 | 56 |
tmp = (table[index >> 3] >> (index & 7)) & 0xff; |
58 | 57 |
val |= tmp << shift; |
59 | 58 |
} else { |
60 |
val |= T0 & (0xff << shift);
|
|
59 |
val |= def & (0xff << shift);
|
|
61 | 60 |
} |
62 | 61 |
} |
63 |
T0 = val;
|
|
62 |
return val;
|
|
64 | 63 |
} |
65 | 64 |
|
66 | 65 |
#if !defined(CONFIG_USER_ONLY) |
Also available in: Unified diff