Revision db166940 target-sparc/op_helper.c

b/target-sparc/op_helper.c
1634 1634
            }
1635 1635
            break;
1636 1636
        }
1637
    case 0x24: // Nucleus quad LDD 128 bit atomic
1638
    case 0x2c: // Nucleus quad LDD 128 bit atomic LE
1639
        //  Only ldda allowed
1640
        raise_exception(TT_ILL_INSN);
1641
        return 0;
1637 1642
    case 0x04: // Nucleus
1638 1643
    case 0x0c: // Nucleus Little Endian (LE)
1639 1644
    case 0x11: // As if user secondary
1640 1645
    case 0x19: // As if user secondary LE
1641
    case 0x24: // Nucleus quad LDD 128 bit atomic
1642
    case 0x2c: // Nucleus quad LDD 128 bit atomic
1643 1646
    case 0x4a: // UPA config
1644 1647
    case 0x81: // Secondary
1645 1648
    case 0x83: // Secondary no-fault
......
1943 1946
            }
1944 1947
        }
1945 1948
        return;
1949
    case 0x24: // Nucleus quad LDD 128 bit atomic
1950
    case 0x2c: // Nucleus quad LDD 128 bit atomic LE
1951
        //  Only ldda allowed
1952
        raise_exception(TT_ILL_INSN);
1953
        return;
1946 1954
    case 0x04: // Nucleus
1947 1955
    case 0x0c: // Nucleus Little Endian (LE)
1948 1956
    case 0x11: // As if user secondary
1949 1957
    case 0x19: // As if user secondary LE
1950
    case 0x24: // Nucleus quad LDD 128 bit atomic
1951
    case 0x2c: // Nucleus quad LDD 128 bit atomic
1952 1958
    case 0x4a: // UPA config
1953 1959
    case 0x81: // Secondary
1954 1960
    case 0x89: // Secondary LE
......
2144 2150
}
2145 2151
#endif /* CONFIG_USER_ONLY */
2146 2152

  
2153
void helper_ldda_asi(target_ulong addr, int asi, int rd)
2154
{
2155
    unsigned int i;
2156

  
2157
    if ((asi < 0x80 && (env->pstate & PS_PRIV) == 0)
2158
        || (asi >= 0x30 && asi < 0x80 && !(env->hpstate & HS_PRIV)))
2159
        raise_exception(TT_PRIV_ACT);
2160

  
2161
    switch (asi) {
2162
    case 0x24: // Nucleus quad LDD 128 bit atomic
2163
    case 0x2c: // Nucleus quad LDD 128 bit atomic LE
2164
        helper_check_align(addr, 0xf);
2165
        if (rd == 0) {
2166
            env->gregs[1] = ldq_kernel(addr + 8);
2167
            if (asi == 0x2c)
2168
                bswap64s(&env->gregs[1]);
2169
        } else if (rd < 8) {
2170
            env->gregs[rd] = ldq_kernel(addr);
2171
            env->gregs[rd + 1] = ldq_kernel(addr + 8);
2172
            if (asi == 0x2c) {
2173
                bswap64s(&env->gregs[rd]);
2174
                bswap64s(&env->gregs[rd + 1]);
2175
            }
2176
        } else {
2177
            env->regwptr[rd] = ldq_kernel(addr);
2178
            env->regwptr[rd + 1] = ldq_kernel(addr + 8);
2179
            if (asi == 0x2c) {
2180
                bswap64s(&env->regwptr[rd]);
2181
                bswap64s(&env->regwptr[rd + 1]);
2182
            }
2183
        }
2184
        break;
2185
    default:
2186
        helper_check_align(addr, 0x3);
2187
        if (rd == 0)
2188
            env->gregs[1] = helper_ld_asi(addr + 4, asi, 4, 0);
2189
        else if (rd < 8) {
2190
            env->gregs[rd] = helper_ld_asi(addr, asi, 4, 0);
2191
            env->gregs[rd + 1] = helper_ld_asi(addr + 4, asi, 4, 0);
2192
        } else {
2193
            env->regwptr[rd] = helper_ld_asi(addr, asi, 4, 0);
2194
            env->regwptr[rd + 1] = helper_ld_asi(addr + 4, asi, 4, 0);
2195
        }
2196
        break;
2197
    }
2198
}
2199

  
2147 2200
void helper_ldf_asi(target_ulong addr, int asi, int size, int rd)
2148 2201
{
2149 2202
    unsigned int i;

Also available in: Unified diff