void helper_cache(CPUMIPSState *env, target_ulong addr, uint32_t op)
{
#ifndef CONFIG_USER_ONLY
+ uint32_t cache_operation = extract32(op, 2, 3);
target_ulong index = addr & 0x1fffffff;
- if (op == 9) {
- /* Index Store Tag */
+
+ switch (cache_operation) {
+ case 0b010: /* Index Store Tag */
memory_region_dispatch_write(env->itc_tag, index, env->CP0_TagLo,
MO_64, MEMTXATTRS_UNSPECIFIED);
- } else if (op == 5) {
- /* Index Load Tag */
+ break;
+ case 0b001: /* Index Load Tag */
memory_region_dispatch_read(env->itc_tag, index, &env->CP0_TagLo,
MO_64, MEMTXATTRS_UNSPECIFIED);
+ break;
+ default:
+ break;
}
#endif
}