Revision 3018f259

b/target-arm/op_helper.c
56 56
    for (shift = 0; shift < 32; shift += 8) {
57 57
        index = (ireg >> shift) & 0xff;
58 58
        if (index < maxindex) {
59
            tmp = (table[index >> 3] >> (index & 7)) & 0xff;
59
            tmp = (table[index >> 3] >> ((index & 7) << 3)) & 0xff;
60 60
            val |= tmp << shift;
61 61
        } else {
62 62
            val |= def & (0xff << shift);
b/target-arm/translate.c
2807 2807
                        tmp2 = new_tmp();
2808 2808
                        tcg_gen_mov_i32(tmp2, tmp);
2809 2809
                        neon_store_reg(rn, 0, tmp2);
2810
                        neon_store_reg(rn, 0, tmp);
2810
                        neon_store_reg(rn, 1, tmp);
2811 2811
                    } else {
2812 2812
                        /* VMOV */
2813 2813
                        switch (size) {
......
3814 3814
                tmp2 = new_tmp();
3815 3815
                tcg_gen_mov_i32(tmp2, tmp);
3816 3816
                neon_store_reg(rd, 0, tmp2);
3817
                neon_store_reg(rd, 0, tmp);
3817
                neon_store_reg(rd, 1, tmp);
3818 3818
                rd += stride;
3819 3819
            }
3820 3820
            stride = (1 << size) * nregs;
......
5498 5498
                }
5499 5499
            } else if ((insn & (1 << 10)) == 0) {
5500 5500
                /* VTBL, VTBX.  */
5501
                n = (insn >> 5) & 0x18;
5501
                n = ((insn >> 5) & 0x18) + 8;
5502 5502
                if (insn & (1 << 6)) {
5503 5503
                    tmp = neon_load_reg(rd, 0);
5504 5504
                } else {
......
5508 5508
                tmp2 = neon_load_reg(rm, 0);
5509 5509
                gen_helper_neon_tbl(tmp2, tmp2, tmp, tcg_const_i32(rn),
5510 5510
                                    tcg_const_i32(n));
5511
                dead_tmp(tmp);
5511 5512
                if (insn & (1 << 6)) {
5512 5513
                    tmp = neon_load_reg(rd, 1);
5513 5514
                } else {
......
5518 5519
                gen_helper_neon_tbl(tmp3, tmp3, tmp, tcg_const_i32(rn),
5519 5520
                                    tcg_const_i32(n));
5520 5521
                neon_store_reg(rd, 0, tmp2);
5521
                neon_store_reg(rd, 1, tmp2);
5522
                neon_store_reg(rd, 1, tmp3);
5523
                dead_tmp(tmp);
5522 5524
            } else if ((insn & 0x380) == 0) {
5523 5525
                /* VDUP */
5524 5526
                if (insn & (1 << 19)) {

Also available in: Unified diff