From nobody Sun Feb 8 00:33:21 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1536112493906149.46262404502386; Tue, 4 Sep 2018 18:54:53 -0700 (PDT) Received: from localhost ([::1]:53426 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fxN1w-0000AP-7p for importer@patchew.org; Tue, 04 Sep 2018 21:54:52 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57952) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fxMsE-00067A-Jm for qemu-devel@nongnu.org; Tue, 04 Sep 2018 21:45:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fxMry-0006mn-RY for qemu-devel@nongnu.org; Tue, 04 Sep 2018 21:44:47 -0400 Received: from mail-lf1-x144.google.com ([2a00:1450:4864:20::144]:46506) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fxMrx-0006lH-UI for qemu-devel@nongnu.org; Tue, 04 Sep 2018 21:44:34 -0400 Received: by mail-lf1-x144.google.com with SMTP id e23-v6so4552537lfc.13 for ; Tue, 04 Sep 2018 18:44:33 -0700 (PDT) Received: from octofox.cadence.com (jcmvbkbc-1-pt.tunnel.tserv24.sto1.ipv6.he.net. [2001:470:27:1fa::2]) by smtp.gmail.com with ESMTPSA id g10-v6sm59337lfl.11.2018.09.04.18.44.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Sep 2018 18:44:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=giGHur1swtbXvIb/2ltxZm2i0O3ptqZEmhv16AblXLI=; b=OLGIM3OuQlLpe10opgCOA8KM2tk0nQMN/a+nuBxQvbqd01nGt8mGglGdYRH06T+8u0 rZX7L3K1M3cj4nPfeQ5SmnGwPgquXj9v8lSRA3WILbR5Z5H9RTZ7asZj6shihixfJ/Qj 9YLM3GFPbB1T4ss1pnBHaBVezQGV06qIjkpS7vjBI8ci4s3dtLlxfypqRPu3Mh0U3aoS 1GAAS8KdpJkljTDm1kK2PFuBPDyziAE0s0Sunp9LImJrhWUTce0iyYJKap79iUJaENTR 6NSbzkaS44tN5OYqFgLJkJDg+VGPTP88UGOU3i2J+MtpZdnPpHt9UvxX+5SupIdmASks o0oQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=giGHur1swtbXvIb/2ltxZm2i0O3ptqZEmhv16AblXLI=; b=B1r9j6GXo1frjxQBmPHNebj4CpQe9rRquVeQE82/NihWtuDgkuARp51aUYsDnd60BS NEfrxGoXTtXPjAM90aq6WGhZ94KSOivwND+FH0eOd6A26V4omYg9lBW8I2lLweJxpJV8 ycB8SARFUQVlFgSs+pfQSbSlNDQwWuGZOKV1Zh6casRtOo5TM3CUevBRAqy56DM7/83D 2wJ/AtHzZrGyeMNTK4NPVl0XWe7hkEzFOVBFZQEv0YNOJDpurWJsHgYpZ2o1shH3Vxov lVwviYDis5W739fRD014TFpTUxvkfrQvceH69NL/+1BIXw7eZKLV/nSOUhvPtfVVGz8C UBnw== X-Gm-Message-State: APzg51CLBByyQzvPkykY+jEHYcGfS5En0LHv2IHKM1yTqnVHehkB5ekM EaTF+T5Lw4g5euIPQyZMaFpa81NoDzw= X-Google-Smtp-Source: ANB0VdaiecYSvycCKGKi8sKwIkaLI3BliRFbPQtjAgsZtWFNkAIkvPRyhRPo6OMoScfuxz24Qt9U6g== X-Received: by 2002:a19:c016:: with SMTP id q22-v6mr21545946lff.8.1536111870966; Tue, 04 Sep 2018 18:44:30 -0700 (PDT) From: Max Filippov To: qemu-devel@nongnu.org Date: Tue, 4 Sep 2018 18:43:42 -0700 Message-Id: <20180905014352.970-6-jcmvbkbc@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180905014352.970-1-jcmvbkbc@gmail.com> References: <20180905014352.970-1-jcmvbkbc@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::144 Subject: [Qemu-devel] [PATCH 05/15] target/xtensa: extract test for window overflow exception X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Max Filippov Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDMRC_1 RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" - add ps.callinc to the TB flags, that allows testing all instructions for window overflow statically; - drop gen_window_check* functions; replace them with get_window_check that accepts bitmask of used registers; - add XtensaOpcodeOps::test_overflow that returns bitmask of implicitly used registers; use it for entry and call{,x}{4,8,12}; - drop window overflow test from the entry helper; - drop parameter 0 from translate_[di]cache and use translate_nop for d/i cache opcodes that don't need memory accessibility check; - add bitmask XtensaOpcodeOps::windowed_register_op that marks opcode arguments that refer to windowed registers; - translate windowed_register_op mask to a mask of actually used registers in the disassembly loop; - add check for window overflow right after the check for debug exception; Signed-off-by: Max Filippov --- target/xtensa/cpu.h | 9 + target/xtensa/op_helper.c | 5 - target/xtensa/translate.c | 1462 +++++++++++++++++++++++++++--------------= ---- 3 files changed, 889 insertions(+), 587 deletions(-) diff --git a/target/xtensa/cpu.h b/target/xtensa/cpu.h index 0a0323f3868e..be234958a228 100644 --- a/target/xtensa/cpu.h +++ b/target/xtensa/cpu.h @@ -351,6 +351,9 @@ typedef void (*XtensaOpcodeOp)(DisasContext *dc, const = uint32_t arg[], typedef bool (*XtensaOpcodeBoolTest)(DisasContext *dc, const uint32_t arg[], const uint32_t par[]); +typedef uint32_t (*XtensaOpcodeUintTest)(DisasContext *dc, + const uint32_t arg[], + const uint32_t par[]); =20 enum { XTENSA_OP_ILL =3D 0x1, @@ -374,8 +377,10 @@ typedef struct XtensaOpcodeOps { const char *name; XtensaOpcodeOp translate; XtensaOpcodeBoolTest test_ill; + XtensaOpcodeUintTest test_overflow; const uint32_t *par; uint32_t op_flags; + uint32_t windowed_register_op; } XtensaOpcodeOps; =20 typedef struct XtensaOpcodeTranslators { @@ -686,6 +691,8 @@ static inline int cpu_mmu_index(CPUXtensaState *env, bo= ol ifetch) #define XTENSA_TBFLAG_WINDOW_SHIFT 15 #define XTENSA_TBFLAG_YIELD 0x20000 #define XTENSA_TBFLAG_CWOE 0x40000 +#define XTENSA_TBFLAG_CALLINC_MASK 0x180000 +#define XTENSA_TBFLAG_CALLINC_SHIFT 19 =20 static inline void cpu_get_tb_cpu_state(CPUXtensaState *env, target_ulong = *pc, target_ulong *cs_base, uint32_t *flags) @@ -724,6 +731,8 @@ static inline void cpu_get_tb_cpu_state(CPUXtensaState = *env, target_ulong *pc, uint32_t w =3D ctz32(windowstart | 0x8); =20 *flags |=3D (w << XTENSA_TBFLAG_WINDOW_SHIFT) | XTENSA_TBFLAG_CWOE; + *flags |=3D extract32(env->sregs[PS], PS_CALLINC_SHIFT, + PS_CALLINC_LEN) << XTENSA_TBFLAG_CALLINC_SHIFT; } else { *flags |=3D 3 << XTENSA_TBFLAG_WINDOW_SHIFT; } diff --git a/target/xtensa/op_helper.c b/target/xtensa/op_helper.c index f5520659d8f9..68052851af32 100644 --- a/target/xtensa/op_helper.c +++ b/target/xtensa/op_helper.c @@ -253,12 +253,7 @@ void HELPER(wsr_windowbase)(CPUXtensaState *env, uint3= 2_t v) void HELPER(entry)(CPUXtensaState *env, uint32_t pc, uint32_t s, uint32_t = imm) { int callinc =3D (env->sregs[PS] & PS_CALLINC) >> PS_CALLINC_SHIFT; - uint32_t windowstart =3D xtensa_replicate_windowstart(env) >> - (env->sregs[WINDOW_BASE] + 1); =20 - if (windowstart & ((1 << callinc) - 1)) { - HELPER(window_check)(env, pc, callinc); - } env->regs[(callinc << 2) | (s & 3)] =3D env->regs[s] - imm; xtensa_rotate_window(env, callinc); env->sregs[WINDOW_START] |=3D diff --git a/target/xtensa/translate.c b/target/xtensa/translate.c index 5222c952a1b7..de306bdfd344 100644 --- a/target/xtensa/translate.c +++ b/target/xtensa/translate.c @@ -62,6 +62,7 @@ struct DisasContext { TCGv_i32 sar_m32; =20 unsigned window; + unsigned callinc; bool cwoe; =20 bool debug; @@ -904,11 +905,13 @@ static void gen_waiti(DisasContext *dc, uint32_t imm4) } #endif =20 -static bool gen_window_check1(DisasContext *dc, unsigned r1) +static bool gen_window_check(DisasContext *dc, uint32_t mask) { - if (r1 / 4 > dc->window) { + unsigned r =3D 31 - clz32(mask); + + if (r / 4 > dc->window) { TCGv_i32 pc =3D tcg_const_i32(dc->pc); - TCGv_i32 w =3D tcg_const_i32(r1 / 4); + TCGv_i32 w =3D tcg_const_i32(r / 4); =20 gen_helper_window_check(cpu_env, pc, w); dc->base.is_jmp =3D DISAS_NORETURN; @@ -917,17 +920,6 @@ static bool gen_window_check1(DisasContext *dc, unsign= ed r1) return true; } =20 -static bool gen_window_check2(DisasContext *dc, unsigned r1, unsigned r2) -{ - return gen_window_check1(dc, r1 > r2 ? r1 : r2); -} - -static bool gen_window_check3(DisasContext *dc, unsigned r1, unsigned r2, - unsigned r3) -{ - return gen_window_check2(dc, r1, r2 > r3 ? r2 : r3); -} - static TCGv_i32 gen_mac16_m(TCGv_i32 v, bool hi, bool is_unsigned) { TCGv_i32 m =3D tcg_temp_new_i32(); @@ -960,6 +952,7 @@ static void disas_xtensa_insn(CPUXtensaState *env, Disa= sContext *dc) uint32_t raw_arg[MAX_OPCODE_ARGS]; } slot_prop[MAX_INSN_SLOTS]; uint32_t debug_cause =3D 0; + uint32_t windowed_register =3D 0; =20 if (len =3D=3D XTENSA_UNDEFINED) { qemu_log_mask(LOG_GUEST_ERROR, @@ -1044,6 +1037,19 @@ static void disas_xtensa_insn(CPUXtensaState *env, D= isasContext *dc) if (ops->op_flags & XTENSA_OP_DEBUG_BREAK) { debug_cause |=3D ops->par[0]; } + if (ops->test_overflow) { + windowed_register |=3D ops->test_overflow(dc, arg, ops->par); + } + if (ops->windowed_register_op) { + uint32_t reg_opnd =3D ops->windowed_register_op; + + while (reg_opnd) { + unsigned i =3D ctz32(reg_opnd); + + windowed_register |=3D 1 << arg[i]; + reg_opnd ^=3D 1 << i; + } + } } =20 if ((op_flags & XTENSA_OP_PRIVILEGED) && @@ -1061,6 +1067,10 @@ static void disas_xtensa_insn(CPUXtensaState *env, D= isasContext *dc) return; } =20 + if (windowed_register && !gen_window_check(dc, windowed_register)) { + return; + } + for (slot =3D 0; slot < slots; ++slot) { XtensaOpcodeOps *ops =3D slot_prop[slot].ops; =20 @@ -1112,6 +1122,8 @@ static void xtensa_tr_init_disas_context(DisasContext= Base *dcbase, dc->window =3D ((tb_flags & XTENSA_TBFLAG_WINDOW_MASK) >> XTENSA_TBFLAG_WINDOW_SHIFT); dc->cwoe =3D tb_flags & XTENSA_TBFLAG_CWOE; + dc->callinc =3D ((tb_flags & XTENSA_TBFLAG_CALLINC_MASK) >> + XTENSA_TBFLAG_CALLINC_SHIFT); =20 if (dc->config->isa) { dc->insnbuf =3D xtensa_insnbuf_alloc(dc->config->isa); @@ -1333,43 +1345,35 @@ xtensa_find_opcode_ops(const XtensaOpcodeTranslator= s *t, static void translate_abs(DisasContext *dc, const uint32_t arg[], const uint32_t par[]) { - if (gen_window_check2(dc, arg[0], arg[1])) { - TCGv_i32 zero =3D tcg_const_i32(0); - TCGv_i32 neg =3D tcg_temp_new_i32(); + TCGv_i32 zero =3D tcg_const_i32(0); + TCGv_i32 neg =3D tcg_temp_new_i32(); =20 - tcg_gen_neg_i32(neg, cpu_R[arg[1]]); - tcg_gen_movcond_i32(TCG_COND_GE, cpu_R[arg[0]], - cpu_R[arg[1]], zero, cpu_R[arg[1]], neg); - tcg_temp_free(neg); - tcg_temp_free(zero); - } + tcg_gen_neg_i32(neg, cpu_R[arg[1]]); + tcg_gen_movcond_i32(TCG_COND_GE, cpu_R[arg[0]], + cpu_R[arg[1]], zero, cpu_R[arg[1]], neg); + tcg_temp_free(neg); + tcg_temp_free(zero); } =20 static void translate_add(DisasContext *dc, const uint32_t arg[], const uint32_t par[]) { - if (gen_window_check3(dc, arg[0], arg[1], arg[2])) { - tcg_gen_add_i32(cpu_R[arg[0]], cpu_R[arg[1]], cpu_R[arg[2]]); - } + tcg_gen_add_i32(cpu_R[arg[0]], cpu_R[arg[1]], cpu_R[arg[2]]); } =20 static void translate_addi(DisasContext *dc, const uint32_t arg[], const uint32_t par[]) { - if (gen_window_check2(dc, arg[0], arg[1])) { - tcg_gen_addi_i32(cpu_R[arg[0]], cpu_R[arg[1]], arg[2]); - } + tcg_gen_addi_i32(cpu_R[arg[0]], cpu_R[arg[1]], arg[2]); } =20 static void translate_addx(DisasContext *dc, const uint32_t arg[], const uint32_t par[]) { - if (gen_window_check3(dc, arg[0], arg[1], arg[2])) { - TCGv_i32 tmp =3D tcg_temp_new_i32(); - tcg_gen_shli_i32(tmp, cpu_R[arg[1]], par[0]); - tcg_gen_add_i32(cpu_R[arg[0]], tmp, cpu_R[arg[2]]); - tcg_temp_free(tmp); - } + TCGv_i32 tmp =3D tcg_temp_new_i32(); + tcg_gen_shli_i32(tmp, cpu_R[arg[1]], par[0]); + tcg_gen_add_i32(cpu_R[arg[0]], tmp, cpu_R[arg[2]]); + tcg_temp_free(tmp); } =20 static void translate_all(DisasContext *dc, const uint32_t arg[], @@ -1395,93 +1399,77 @@ static void translate_all(DisasContext *dc, const u= int32_t arg[], static void translate_and(DisasContext *dc, const uint32_t arg[], const uint32_t par[]) { - if (gen_window_check3(dc, arg[0], arg[1], arg[2])) { - tcg_gen_and_i32(cpu_R[arg[0]], cpu_R[arg[1]], cpu_R[arg[2]]); - } + tcg_gen_and_i32(cpu_R[arg[0]], cpu_R[arg[1]], cpu_R[arg[2]]); } =20 static void translate_ball(DisasContext *dc, const uint32_t arg[], const uint32_t par[]) { - if (gen_window_check2(dc, arg[0], arg[1])) { - TCGv_i32 tmp =3D tcg_temp_new_i32(); - tcg_gen_and_i32(tmp, cpu_R[arg[0]], cpu_R[arg[1]]); - gen_brcond(dc, par[0], tmp, cpu_R[arg[1]], arg[2]); - tcg_temp_free(tmp); - } + TCGv_i32 tmp =3D tcg_temp_new_i32(); + tcg_gen_and_i32(tmp, cpu_R[arg[0]], cpu_R[arg[1]]); + gen_brcond(dc, par[0], tmp, cpu_R[arg[1]], arg[2]); + tcg_temp_free(tmp); } =20 static void translate_bany(DisasContext *dc, const uint32_t arg[], const uint32_t par[]) { - if (gen_window_check2(dc, arg[0], arg[1])) { - TCGv_i32 tmp =3D tcg_temp_new_i32(); - tcg_gen_and_i32(tmp, cpu_R[arg[0]], cpu_R[arg[1]]); - gen_brcondi(dc, par[0], tmp, 0, arg[2]); - tcg_temp_free(tmp); - } + TCGv_i32 tmp =3D tcg_temp_new_i32(); + tcg_gen_and_i32(tmp, cpu_R[arg[0]], cpu_R[arg[1]]); + gen_brcondi(dc, par[0], tmp, 0, arg[2]); + tcg_temp_free(tmp); } =20 static void translate_b(DisasContext *dc, const uint32_t arg[], const uint32_t par[]) { - if (gen_window_check2(dc, arg[0], arg[1])) { - gen_brcond(dc, par[0], cpu_R[arg[0]], cpu_R[arg[1]], arg[2]); - } + gen_brcond(dc, par[0], cpu_R[arg[0]], cpu_R[arg[1]], arg[2]); } =20 static void translate_bb(DisasContext *dc, const uint32_t arg[], const uint32_t par[]) { - if (gen_window_check2(dc, arg[0], arg[1])) { #ifdef TARGET_WORDS_BIGENDIAN - TCGv_i32 bit =3D tcg_const_i32(0x80000000u); + TCGv_i32 bit =3D tcg_const_i32(0x80000000u); #else - TCGv_i32 bit =3D tcg_const_i32(0x00000001u); + TCGv_i32 bit =3D tcg_const_i32(0x00000001u); #endif - TCGv_i32 tmp =3D tcg_temp_new_i32(); - tcg_gen_andi_i32(tmp, cpu_R[arg[1]], 0x1f); + TCGv_i32 tmp =3D tcg_temp_new_i32(); + tcg_gen_andi_i32(tmp, cpu_R[arg[1]], 0x1f); #ifdef TARGET_WORDS_BIGENDIAN - tcg_gen_shr_i32(bit, bit, tmp); + tcg_gen_shr_i32(bit, bit, tmp); #else - tcg_gen_shl_i32(bit, bit, tmp); + tcg_gen_shl_i32(bit, bit, tmp); #endif - tcg_gen_and_i32(tmp, cpu_R[arg[0]], bit); - gen_brcondi(dc, par[0], tmp, 0, arg[2]); - tcg_temp_free(tmp); - tcg_temp_free(bit); - } + tcg_gen_and_i32(tmp, cpu_R[arg[0]], bit); + gen_brcondi(dc, par[0], tmp, 0, arg[2]); + tcg_temp_free(tmp); + tcg_temp_free(bit); } =20 static void translate_bbi(DisasContext *dc, const uint32_t arg[], const uint32_t par[]) { - if (gen_window_check1(dc, arg[0])) { - TCGv_i32 tmp =3D tcg_temp_new_i32(); + TCGv_i32 tmp =3D tcg_temp_new_i32(); #ifdef TARGET_WORDS_BIGENDIAN - tcg_gen_andi_i32(tmp, cpu_R[arg[0]], 0x80000000u >> arg[1]); + tcg_gen_andi_i32(tmp, cpu_R[arg[0]], 0x80000000u >> arg[1]); #else - tcg_gen_andi_i32(tmp, cpu_R[arg[0]], 0x00000001u << arg[1]); + tcg_gen_andi_i32(tmp, cpu_R[arg[0]], 0x00000001u << arg[1]); #endif - gen_brcondi(dc, par[0], tmp, 0, arg[2]); - tcg_temp_free(tmp); - } + gen_brcondi(dc, par[0], tmp, 0, arg[2]); + tcg_temp_free(tmp); } =20 static void translate_bi(DisasContext *dc, const uint32_t arg[], const uint32_t par[]) { - if (gen_window_check1(dc, arg[0])) { - gen_brcondi(dc, par[0], cpu_R[arg[0]], arg[1], arg[2]); - } + gen_brcondi(dc, par[0], cpu_R[arg[0]], arg[1], arg[2]); } =20 static void translate_bz(DisasContext *dc, const uint32_t arg[], const uint32_t par[]) { - if (gen_window_check1(dc, arg[0])) { - gen_brcondi(dc, par[0], cpu_R[arg[0]], 0, arg[1]); - } + gen_brcondi(dc, par[0], cpu_R[arg[0]], 0, arg[1]); } =20 enum { @@ -1531,50 +1519,48 @@ static void translate_call0(DisasContext *dc, const= uint32_t arg[], gen_jumpi(dc, arg[0], 0); } =20 +static uint32_t test_overflow_callw(DisasContext *dc, const uint32_t arg[], + const uint32_t par[]) +{ + return 1 << (par[0] * 4); +} + static void translate_callw(DisasContext *dc, const uint32_t arg[], const uint32_t par[]) { - if (gen_window_check1(dc, par[0] << 2)) { - gen_callwi(dc, par[0], arg[0], 0); - } + gen_callwi(dc, par[0], arg[0], 0); } =20 static void translate_callx0(DisasContext *dc, const uint32_t arg[], const uint32_t par[]) { - if (gen_window_check1(dc, arg[0])) { - TCGv_i32 tmp =3D tcg_temp_new_i32(); - tcg_gen_mov_i32(tmp, cpu_R[arg[0]]); - tcg_gen_movi_i32(cpu_R[0], dc->base.pc_next); - gen_jump(dc, tmp); - tcg_temp_free(tmp); - } + TCGv_i32 tmp =3D tcg_temp_new_i32(); + tcg_gen_mov_i32(tmp, cpu_R[arg[0]]); + tcg_gen_movi_i32(cpu_R[0], dc->base.pc_next); + gen_jump(dc, tmp); + tcg_temp_free(tmp); } =20 static void translate_callxw(DisasContext *dc, const uint32_t arg[], const uint32_t par[]) { - if (gen_window_check2(dc, arg[0], par[0] << 2)) { - TCGv_i32 tmp =3D tcg_temp_new_i32(); + TCGv_i32 tmp =3D tcg_temp_new_i32(); =20 - tcg_gen_mov_i32(tmp, cpu_R[arg[0]]); - gen_callw(dc, par[0], tmp); - tcg_temp_free(tmp); - } + tcg_gen_mov_i32(tmp, cpu_R[arg[0]]); + gen_callw(dc, par[0], tmp); + tcg_temp_free(tmp); } =20 static void translate_clamps(DisasContext *dc, const uint32_t arg[], const uint32_t par[]) { - if (gen_window_check2(dc, arg[0], arg[1])) { - TCGv_i32 tmp1 =3D tcg_const_i32(-1u << arg[2]); - TCGv_i32 tmp2 =3D tcg_const_i32((1 << arg[2]) - 1); + TCGv_i32 tmp1 =3D tcg_const_i32(-1u << arg[2]); + TCGv_i32 tmp2 =3D tcg_const_i32((1 << arg[2]) - 1); =20 - tcg_gen_smax_i32(tmp1, tmp1, cpu_R[arg[1]]); - tcg_gen_smin_i32(cpu_R[arg[0]], tmp1, tmp2); - tcg_temp_free(tmp1); - tcg_temp_free(tmp2); - } + tcg_gen_smax_i32(tmp1, tmp1, cpu_R[arg[1]]); + tcg_gen_smin_i32(cpu_R[arg[0]], tmp1, tmp2); + tcg_temp_free(tmp1); + tcg_temp_free(tmp2); } =20 static void translate_clrb_expstate(DisasContext *dc, const uint32_t arg[], @@ -1587,36 +1573,29 @@ static void translate_clrb_expstate(DisasContext *d= c, const uint32_t arg[], static void translate_const16(DisasContext *dc, const uint32_t arg[], const uint32_t par[]) { - if (gen_window_check1(dc, arg[0])) { - TCGv_i32 c =3D tcg_const_i32(arg[1]); + TCGv_i32 c =3D tcg_const_i32(arg[1]); =20 - tcg_gen_deposit_i32(cpu_R[arg[0]], c, cpu_R[arg[0]], 16, 16); - tcg_temp_free(c); - } + tcg_gen_deposit_i32(cpu_R[arg[0]], c, cpu_R[arg[0]], 16, 16); + tcg_temp_free(c); } =20 -/* par[0]: check memory access */ static void translate_dcache(DisasContext *dc, const uint32_t arg[], const uint32_t par[]) { - if (gen_window_check1(dc, arg[0]) && par[0]) { - TCGv_i32 addr =3D tcg_temp_new_i32(); - TCGv_i32 res =3D tcg_temp_new_i32(); + TCGv_i32 addr =3D tcg_temp_new_i32(); + TCGv_i32 res =3D tcg_temp_new_i32(); =20 - tcg_gen_addi_i32(addr, cpu_R[arg[0]], arg[1]); - tcg_gen_qemu_ld8u(res, addr, dc->cring); - tcg_temp_free(addr); - tcg_temp_free(res); - } + tcg_gen_addi_i32(addr, cpu_R[arg[0]], arg[1]); + tcg_gen_qemu_ld8u(res, addr, dc->cring); + tcg_temp_free(addr); + tcg_temp_free(res); } =20 static void translate_depbits(DisasContext *dc, const uint32_t arg[], const uint32_t par[]) { - if (gen_window_check2(dc, arg[0], arg[1])) { - tcg_gen_deposit_i32(cpu_R[arg[1]], cpu_R[arg[1]], cpu_R[arg[0]], - arg[2], arg[3]); - } + tcg_gen_deposit_i32(cpu_R[arg[1]], cpu_R[arg[1]], cpu_R[arg[0]], + arg[2], arg[3]); } =20 static bool test_ill_entry(DisasContext *dc, const uint32_t arg[], @@ -1631,6 +1610,12 @@ static bool test_ill_entry(DisasContext *dc, const u= int32_t arg[], } } =20 +static uint32_t test_overflow_entry(DisasContext *dc, const uint32_t arg[], + const uint32_t par[]) +{ + return 1 << (dc->callinc * 4); +} + static void translate_entry(DisasContext *dc, const uint32_t arg[], const uint32_t par[]) { @@ -1648,45 +1633,38 @@ static void translate_entry(DisasContext *dc, const= uint32_t arg[], static void translate_extui(DisasContext *dc, const uint32_t arg[], const uint32_t par[]) { - if (gen_window_check2(dc, arg[0], arg[1])) { - int maskimm =3D (1 << arg[3]) - 1; + int maskimm =3D (1 << arg[3]) - 1; =20 - TCGv_i32 tmp =3D tcg_temp_new_i32(); - tcg_gen_shri_i32(tmp, cpu_R[arg[1]], arg[2]); - tcg_gen_andi_i32(cpu_R[arg[0]], tmp, maskimm); - tcg_temp_free(tmp); - } + TCGv_i32 tmp =3D tcg_temp_new_i32(); + tcg_gen_shri_i32(tmp, cpu_R[arg[1]], arg[2]); + tcg_gen_andi_i32(cpu_R[arg[0]], tmp, maskimm); + tcg_temp_free(tmp); } =20 -/* par[0]: check memory access */ static void translate_icache(DisasContext *dc, const uint32_t arg[], const uint32_t par[]) { - if (gen_window_check1(dc, arg[0]) && par[0]) { #ifndef CONFIG_USER_ONLY - TCGv_i32 addr =3D tcg_temp_new_i32(); + TCGv_i32 addr =3D tcg_temp_new_i32(); =20 - tcg_gen_movi_i32(cpu_pc, dc->pc); - tcg_gen_addi_i32(addr, cpu_R[arg[0]], arg[1]); - gen_helper_itlb_hit_test(cpu_env, addr); - tcg_temp_free(addr); + tcg_gen_movi_i32(cpu_pc, dc->pc); + tcg_gen_addi_i32(addr, cpu_R[arg[0]], arg[1]); + gen_helper_itlb_hit_test(cpu_env, addr); + tcg_temp_free(addr); #endif - } } =20 static void translate_itlb(DisasContext *dc, const uint32_t arg[], const uint32_t par[]) { - if (gen_window_check1(dc, arg[0])) { #ifndef CONFIG_USER_ONLY - TCGv_i32 dtlb =3D tcg_const_i32(par[0]); + TCGv_i32 dtlb =3D tcg_const_i32(par[0]); =20 - gen_helper_itlb(cpu_env, cpu_R[arg[0]], dtlb); - /* This could change memory mapping, so exit tb */ - gen_jumpi_check_loop_end(dc, -1); - tcg_temp_free(dtlb); + gen_helper_itlb(cpu_env, cpu_R[arg[0]], dtlb); + /* This could change memory mapping, so exit tb */ + gen_jumpi_check_loop_end(dc, -1); + tcg_temp_free(dtlb); #endif - } } =20 static void translate_j(DisasContext *dc, const uint32_t arg[], @@ -1698,87 +1676,77 @@ static void translate_j(DisasContext *dc, const uin= t32_t arg[], static void translate_jx(DisasContext *dc, const uint32_t arg[], const uint32_t par[]) { - if (gen_window_check1(dc, arg[0])) { - gen_jump(dc, cpu_R[arg[0]]); - } + gen_jump(dc, cpu_R[arg[0]]); } =20 static void translate_l32e(DisasContext *dc, const uint32_t arg[], const uint32_t par[]) { - if (gen_window_check2(dc, arg[0], arg[1])) { - TCGv_i32 addr =3D tcg_temp_new_i32(); + TCGv_i32 addr =3D tcg_temp_new_i32(); =20 - tcg_gen_addi_i32(addr, cpu_R[arg[1]], arg[2]); - gen_load_store_alignment(dc, 2, addr, false); - tcg_gen_qemu_ld_tl(cpu_R[arg[0]], addr, dc->ring, MO_TEUL); - tcg_temp_free(addr); - } + tcg_gen_addi_i32(addr, cpu_R[arg[1]], arg[2]); + gen_load_store_alignment(dc, 2, addr, false); + tcg_gen_qemu_ld_tl(cpu_R[arg[0]], addr, dc->ring, MO_TEUL); + tcg_temp_free(addr); } =20 static void translate_ldst(DisasContext *dc, const uint32_t arg[], const uint32_t par[]) { - if (gen_window_check2(dc, arg[0], arg[1])) { - TCGv_i32 addr =3D tcg_temp_new_i32(); + TCGv_i32 addr =3D tcg_temp_new_i32(); =20 - tcg_gen_addi_i32(addr, cpu_R[arg[1]], arg[2]); - if (par[0] & MO_SIZE) { - gen_load_store_alignment(dc, par[0] & MO_SIZE, addr, par[1]); + tcg_gen_addi_i32(addr, cpu_R[arg[1]], arg[2]); + if (par[0] & MO_SIZE) { + gen_load_store_alignment(dc, par[0] & MO_SIZE, addr, par[1]); + } + if (par[2]) { + if (par[1]) { + tcg_gen_mb(TCG_BAR_STRL | TCG_MO_ALL); } - if (par[2]) { - if (par[1]) { - tcg_gen_mb(TCG_BAR_STRL | TCG_MO_ALL); - } - tcg_gen_qemu_st_tl(cpu_R[arg[0]], addr, dc->cring, par[0]); - } else { - tcg_gen_qemu_ld_tl(cpu_R[arg[0]], addr, dc->cring, par[0]); - if (par[1]) { - tcg_gen_mb(TCG_BAR_LDAQ | TCG_MO_ALL); - } + tcg_gen_qemu_st_tl(cpu_R[arg[0]], addr, dc->cring, par[0]); + } else { + tcg_gen_qemu_ld_tl(cpu_R[arg[0]], addr, dc->cring, par[0]); + if (par[1]) { + tcg_gen_mb(TCG_BAR_LDAQ | TCG_MO_ALL); } - tcg_temp_free(addr); } + tcg_temp_free(addr); } =20 static void translate_l32r(DisasContext *dc, const uint32_t arg[], const uint32_t par[]) { - if (gen_window_check1(dc, arg[0])) { - TCGv_i32 tmp; + TCGv_i32 tmp; =20 - if (dc->base.tb->flags & XTENSA_TBFLAG_LITBASE) { - tmp =3D tcg_const_i32(dc->raw_arg[1] - 1); - tcg_gen_add_i32(tmp, cpu_SR[LITBASE], tmp); - } else { - tmp =3D tcg_const_i32(arg[1]); - } - tcg_gen_qemu_ld32u(cpu_R[arg[0]], tmp, dc->cring); - tcg_temp_free(tmp); + if (dc->base.tb->flags & XTENSA_TBFLAG_LITBASE) { + tmp =3D tcg_const_i32(dc->raw_arg[1] - 1); + tcg_gen_add_i32(tmp, cpu_SR[LITBASE], tmp); + } else { + tmp =3D tcg_const_i32(arg[1]); } + tcg_gen_qemu_ld32u(cpu_R[arg[0]], tmp, dc->cring); + tcg_temp_free(tmp); } =20 static void translate_loop(DisasContext *dc, const uint32_t arg[], const uint32_t par[]) { - if (gen_window_check1(dc, arg[0])) { - uint32_t lend =3D arg[1]; - TCGv_i32 tmp =3D tcg_const_i32(lend); - - tcg_gen_subi_i32(cpu_SR[LCOUNT], cpu_R[arg[0]], 1); - tcg_gen_movi_i32(cpu_SR[LBEG], dc->base.pc_next); - gen_helper_wsr_lend(cpu_env, tmp); - tcg_temp_free(tmp); + uint32_t lend =3D arg[1]; + TCGv_i32 tmp =3D tcg_const_i32(lend); =20 - if (par[0] !=3D TCG_COND_NEVER) { - TCGLabel *label =3D gen_new_label(); - tcg_gen_brcondi_i32(par[0], cpu_R[arg[0]], 0, label); - gen_jumpi(dc, lend, 1); - gen_set_label(label); - } + tcg_gen_subi_i32(cpu_SR[LCOUNT], cpu_R[arg[0]], 1); + tcg_gen_movi_i32(cpu_SR[LBEG], dc->base.pc_next); + gen_helper_wsr_lend(cpu_env, tmp); + tcg_temp_free(tmp); =20 - gen_jumpi(dc, dc->base.pc_next, 0); + if (par[0] !=3D TCG_COND_NEVER) { + TCGLabel *label =3D gen_new_label(); + tcg_gen_brcondi_i32(par[0], cpu_R[arg[0]], 0, label); + gen_jumpi(dc, lend, 1); + gen_set_label(label); } + + gen_jumpi(dc, dc->base.pc_next, 0); } =20 enum { @@ -1818,78 +1786,60 @@ static void translate_mac16(DisasContext *dc, const= uint32_t arg[], unsigned half =3D par[2]; uint32_t ld_offset =3D par[3]; unsigned off =3D ld_offset ? 2 : 0; - uint32_t ar[3] =3D {0}; - unsigned n_ar =3D 0; - - if (op !=3D MAC16_NONE) { - if (!is_m1_sr) { - ar[n_ar++] =3D arg[off]; - } - if (!is_m2_sr) { - ar[n_ar++] =3D arg[off + 1]; - } - } + TCGv_i32 vaddr =3D tcg_temp_new_i32(); + TCGv_i32 mem32 =3D tcg_temp_new_i32(); =20 if (ld_offset) { - ar[n_ar++] =3D arg[1]; + tcg_gen_addi_i32(vaddr, cpu_R[arg[1]], ld_offset); + gen_load_store_alignment(dc, 2, vaddr, false); + tcg_gen_qemu_ld32u(mem32, vaddr, dc->cring); } - - if (gen_window_check3(dc, ar[0], ar[1], ar[2])) { - TCGv_i32 vaddr =3D tcg_temp_new_i32(); - TCGv_i32 mem32 =3D tcg_temp_new_i32(); - - if (ld_offset) { - tcg_gen_addi_i32(vaddr, cpu_R[arg[1]], ld_offset); - gen_load_store_alignment(dc, 2, vaddr, false); - tcg_gen_qemu_ld32u(mem32, vaddr, dc->cring); - } - if (op !=3D MAC16_NONE) { - TCGv_i32 m1 =3D gen_mac16_m(is_m1_sr ? - cpu_SR[MR + arg[off]] : - cpu_R[arg[off]], - half & MAC16_HX, op =3D=3D MAC16_UMU= L); - TCGv_i32 m2 =3D gen_mac16_m(is_m2_sr ? - cpu_SR[MR + arg[off + 1]] : - cpu_R[arg[off + 1]], - half & MAC16_XH, op =3D=3D MAC16_UMU= L); - - if (op =3D=3D MAC16_MUL || op =3D=3D MAC16_UMUL) { - tcg_gen_mul_i32(cpu_SR[ACCLO], m1, m2); - if (op =3D=3D MAC16_UMUL) { - tcg_gen_movi_i32(cpu_SR[ACCHI], 0); - } else { - tcg_gen_sari_i32(cpu_SR[ACCHI], cpu_SR[ACCLO], 31); - } + if (op !=3D MAC16_NONE) { + TCGv_i32 m1 =3D gen_mac16_m(is_m1_sr ? + cpu_SR[MR + arg[off]] : + cpu_R[arg[off]], + half & MAC16_HX, op =3D=3D MAC16_UMUL); + TCGv_i32 m2 =3D gen_mac16_m(is_m2_sr ? + cpu_SR[MR + arg[off + 1]] : + cpu_R[arg[off + 1]], + half & MAC16_XH, op =3D=3D MAC16_UMUL); + + if (op =3D=3D MAC16_MUL || op =3D=3D MAC16_UMUL) { + tcg_gen_mul_i32(cpu_SR[ACCLO], m1, m2); + if (op =3D=3D MAC16_UMUL) { + tcg_gen_movi_i32(cpu_SR[ACCHI], 0); } else { - TCGv_i32 lo =3D tcg_temp_new_i32(); - TCGv_i32 hi =3D tcg_temp_new_i32(); - - tcg_gen_mul_i32(lo, m1, m2); - tcg_gen_sari_i32(hi, lo, 31); - if (op =3D=3D MAC16_MULA) { - tcg_gen_add2_i32(cpu_SR[ACCLO], cpu_SR[ACCHI], - cpu_SR[ACCLO], cpu_SR[ACCHI], - lo, hi); - } else { - tcg_gen_sub2_i32(cpu_SR[ACCLO], cpu_SR[ACCHI], - cpu_SR[ACCLO], cpu_SR[ACCHI], - lo, hi); - } - tcg_gen_ext8s_i32(cpu_SR[ACCHI], cpu_SR[ACCHI]); - - tcg_temp_free_i32(lo); - tcg_temp_free_i32(hi); + tcg_gen_sari_i32(cpu_SR[ACCHI], cpu_SR[ACCLO], 31); } - tcg_temp_free(m1); - tcg_temp_free(m2); - } - if (ld_offset) { - tcg_gen_mov_i32(cpu_R[arg[1]], vaddr); - tcg_gen_mov_i32(cpu_SR[MR + arg[0]], mem32); + } else { + TCGv_i32 lo =3D tcg_temp_new_i32(); + TCGv_i32 hi =3D tcg_temp_new_i32(); + + tcg_gen_mul_i32(lo, m1, m2); + tcg_gen_sari_i32(hi, lo, 31); + if (op =3D=3D MAC16_MULA) { + tcg_gen_add2_i32(cpu_SR[ACCLO], cpu_SR[ACCHI], + cpu_SR[ACCLO], cpu_SR[ACCHI], + lo, hi); + } else { + tcg_gen_sub2_i32(cpu_SR[ACCLO], cpu_SR[ACCHI], + cpu_SR[ACCLO], cpu_SR[ACCHI], + lo, hi); + } + tcg_gen_ext8s_i32(cpu_SR[ACCHI], cpu_SR[ACCHI]); + + tcg_temp_free_i32(lo); + tcg_temp_free_i32(hi); } - tcg_temp_free(vaddr); - tcg_temp_free(mem32); + tcg_temp_free(m1); + tcg_temp_free(m2); + } + if (ld_offset) { + tcg_gen_mov_i32(cpu_R[arg[1]], vaddr); + tcg_gen_mov_i32(cpu_SR[MR + arg[0]], mem32); } + tcg_temp_free(vaddr); + tcg_temp_free(mem32); } =20 static void translate_memw(DisasContext *dc, const uint32_t arg[], @@ -1901,139 +1851,113 @@ static void translate_memw(DisasContext *dc, cons= t uint32_t arg[], static void translate_smin(DisasContext *dc, const uint32_t arg[], const uint32_t par[]) { - if (gen_window_check3(dc, arg[0], arg[1], arg[2])) { - tcg_gen_smin_i32(cpu_R[arg[0]], cpu_R[arg[1]], cpu_R[arg[2]]); - } + tcg_gen_smin_i32(cpu_R[arg[0]], cpu_R[arg[1]], cpu_R[arg[2]]); } =20 static void translate_umin(DisasContext *dc, const uint32_t arg[], const uint32_t par[]) { - if (gen_window_check3(dc, arg[0], arg[1], arg[2])) { - tcg_gen_umin_i32(cpu_R[arg[0]], cpu_R[arg[1]], cpu_R[arg[2]]); - } + tcg_gen_umin_i32(cpu_R[arg[0]], cpu_R[arg[1]], cpu_R[arg[2]]); } =20 static void translate_smax(DisasContext *dc, const uint32_t arg[], const uint32_t par[]) { - if (gen_window_check3(dc, arg[0], arg[1], arg[2])) { - tcg_gen_smax_i32(cpu_R[arg[0]], cpu_R[arg[1]], cpu_R[arg[2]]); - } + tcg_gen_smax_i32(cpu_R[arg[0]], cpu_R[arg[1]], cpu_R[arg[2]]); } =20 static void translate_umax(DisasContext *dc, const uint32_t arg[], const uint32_t par[]) { - if (gen_window_check3(dc, arg[0], arg[1], arg[2])) { - tcg_gen_umax_i32(cpu_R[arg[0]], cpu_R[arg[1]], cpu_R[arg[2]]); - } + tcg_gen_umax_i32(cpu_R[arg[0]], cpu_R[arg[1]], cpu_R[arg[2]]); } =20 static void translate_mov(DisasContext *dc, const uint32_t arg[], const uint32_t par[]) { - if (gen_window_check2(dc, arg[0], arg[1])) { - tcg_gen_mov_i32(cpu_R[arg[0]], cpu_R[arg[1]]); - } + tcg_gen_mov_i32(cpu_R[arg[0]], cpu_R[arg[1]]); } =20 static void translate_movcond(DisasContext *dc, const uint32_t arg[], const uint32_t par[]) { - if (gen_window_check3(dc, arg[0], arg[1], arg[2])) { - TCGv_i32 zero =3D tcg_const_i32(0); + TCGv_i32 zero =3D tcg_const_i32(0); =20 - tcg_gen_movcond_i32(par[0], cpu_R[arg[0]], - cpu_R[arg[2]], zero, cpu_R[arg[1]], cpu_R[arg[= 0]]); - tcg_temp_free(zero); - } + tcg_gen_movcond_i32(par[0], cpu_R[arg[0]], + cpu_R[arg[2]], zero, cpu_R[arg[1]], cpu_R[arg[0]]); + tcg_temp_free(zero); } =20 static void translate_movi(DisasContext *dc, const uint32_t arg[], const uint32_t par[]) { - if (gen_window_check1(dc, arg[0])) { - tcg_gen_movi_i32(cpu_R[arg[0]], arg[1]); - } + tcg_gen_movi_i32(cpu_R[arg[0]], arg[1]); } =20 static void translate_movp(DisasContext *dc, const uint32_t arg[], const uint32_t par[]) { - if (gen_window_check2(dc, arg[0], arg[1])) { - TCGv_i32 zero =3D tcg_const_i32(0); - TCGv_i32 tmp =3D tcg_temp_new_i32(); + TCGv_i32 zero =3D tcg_const_i32(0); + TCGv_i32 tmp =3D tcg_temp_new_i32(); =20 - tcg_gen_andi_i32(tmp, cpu_SR[BR], 1 << arg[2]); - tcg_gen_movcond_i32(par[0], - cpu_R[arg[0]], tmp, zero, - cpu_R[arg[1]], cpu_R[arg[0]]); - tcg_temp_free(tmp); - tcg_temp_free(zero); - } + tcg_gen_andi_i32(tmp, cpu_SR[BR], 1 << arg[2]); + tcg_gen_movcond_i32(par[0], + cpu_R[arg[0]], tmp, zero, + cpu_R[arg[1]], cpu_R[arg[0]]); + tcg_temp_free(tmp); + tcg_temp_free(zero); } =20 static void translate_movsp(DisasContext *dc, const uint32_t arg[], const uint32_t par[]) { - if (gen_window_check2(dc, arg[0], arg[1])) { - TCGv_i32 pc =3D tcg_const_i32(dc->pc); - gen_helper_movsp(cpu_env, pc); - tcg_gen_mov_i32(cpu_R[arg[0]], cpu_R[arg[1]]); - tcg_temp_free(pc); - } + TCGv_i32 pc =3D tcg_const_i32(dc->pc); + gen_helper_movsp(cpu_env, pc); + tcg_gen_mov_i32(cpu_R[arg[0]], cpu_R[arg[1]]); + tcg_temp_free(pc); } =20 static void translate_mul16(DisasContext *dc, const uint32_t arg[], const uint32_t par[]) { - if (gen_window_check3(dc, arg[0], arg[1], arg[2])) { - TCGv_i32 v1 =3D tcg_temp_new_i32(); - TCGv_i32 v2 =3D tcg_temp_new_i32(); + TCGv_i32 v1 =3D tcg_temp_new_i32(); + TCGv_i32 v2 =3D tcg_temp_new_i32(); =20 - if (par[0]) { - tcg_gen_ext16s_i32(v1, cpu_R[arg[1]]); - tcg_gen_ext16s_i32(v2, cpu_R[arg[2]]); - } else { - tcg_gen_ext16u_i32(v1, cpu_R[arg[1]]); - tcg_gen_ext16u_i32(v2, cpu_R[arg[2]]); - } - tcg_gen_mul_i32(cpu_R[arg[0]], v1, v2); - tcg_temp_free(v2); - tcg_temp_free(v1); + if (par[0]) { + tcg_gen_ext16s_i32(v1, cpu_R[arg[1]]); + tcg_gen_ext16s_i32(v2, cpu_R[arg[2]]); + } else { + tcg_gen_ext16u_i32(v1, cpu_R[arg[1]]); + tcg_gen_ext16u_i32(v2, cpu_R[arg[2]]); } + tcg_gen_mul_i32(cpu_R[arg[0]], v1, v2); + tcg_temp_free(v2); + tcg_temp_free(v1); } =20 static void translate_mull(DisasContext *dc, const uint32_t arg[], const uint32_t par[]) { - if (gen_window_check3(dc, arg[0], arg[1], arg[2])) { - tcg_gen_mul_i32(cpu_R[arg[0]], cpu_R[arg[1]], cpu_R[arg[2]]); - } + tcg_gen_mul_i32(cpu_R[arg[0]], cpu_R[arg[1]], cpu_R[arg[2]]); } =20 static void translate_mulh(DisasContext *dc, const uint32_t arg[], const uint32_t par[]) { - if (gen_window_check3(dc, arg[0], arg[1], arg[2])) { - TCGv_i32 lo =3D tcg_temp_new(); + TCGv_i32 lo =3D tcg_temp_new(); =20 - if (par[0]) { - tcg_gen_muls2_i32(lo, cpu_R[arg[0]], cpu_R[arg[1]], cpu_R[arg[= 2]]); - } else { - tcg_gen_mulu2_i32(lo, cpu_R[arg[0]], cpu_R[arg[1]], cpu_R[arg[= 2]]); - } - tcg_temp_free(lo); + if (par[0]) { + tcg_gen_muls2_i32(lo, cpu_R[arg[0]], cpu_R[arg[1]], cpu_R[arg[2]]); + } else { + tcg_gen_mulu2_i32(lo, cpu_R[arg[0]], cpu_R[arg[1]], cpu_R[arg[2]]); } + tcg_temp_free(lo); } =20 static void translate_neg(DisasContext *dc, const uint32_t arg[], const uint32_t par[]) { - if (gen_window_check2(dc, arg[0], arg[1])) { - tcg_gen_neg_i32(cpu_R[arg[0]], cpu_R[arg[1]]); - } + tcg_gen_neg_i32(cpu_R[arg[0]], cpu_R[arg[1]]); } =20 static void translate_nop(DisasContext *dc, const uint32_t arg[], @@ -2044,39 +1968,31 @@ static void translate_nop(DisasContext *dc, const u= int32_t arg[], static void translate_nsa(DisasContext *dc, const uint32_t arg[], const uint32_t par[]) { - if (gen_window_check2(dc, arg[0], arg[1])) { - tcg_gen_clrsb_i32(cpu_R[arg[0]], cpu_R[arg[1]]); - } + tcg_gen_clrsb_i32(cpu_R[arg[0]], cpu_R[arg[1]]); } =20 static void translate_nsau(DisasContext *dc, const uint32_t arg[], const uint32_t par[]) { - if (gen_window_check2(dc, arg[0], arg[1])) { - tcg_gen_clzi_i32(cpu_R[arg[0]], cpu_R[arg[1]], 32); - } + tcg_gen_clzi_i32(cpu_R[arg[0]], cpu_R[arg[1]], 32); } =20 static void translate_or(DisasContext *dc, const uint32_t arg[], const uint32_t par[]) { - if (gen_window_check3(dc, arg[0], arg[1], arg[2])) { - tcg_gen_or_i32(cpu_R[arg[0]], cpu_R[arg[1]], cpu_R[arg[2]]); - } + tcg_gen_or_i32(cpu_R[arg[0]], cpu_R[arg[1]], cpu_R[arg[2]]); } =20 static void translate_ptlb(DisasContext *dc, const uint32_t arg[], const uint32_t par[]) { - if (gen_window_check2(dc, arg[0], arg[1])) { #ifndef CONFIG_USER_ONLY - TCGv_i32 dtlb =3D tcg_const_i32(par[0]); + TCGv_i32 dtlb =3D tcg_const_i32(par[0]); =20 - tcg_gen_movi_i32(cpu_pc, dc->pc); - gen_helper_ptlb(cpu_R[arg[0]], cpu_env, cpu_R[arg[1]], dtlb); - tcg_temp_free(dtlb); + tcg_gen_movi_i32(cpu_pc, dc->pc); + gen_helper_ptlb(cpu_R[arg[0]], cpu_env, cpu_R[arg[1]], dtlb); + tcg_temp_free(dtlb); #endif - } } =20 static void gen_zero_check(DisasContext *dc, const uint32_t arg[]) @@ -2091,61 +2007,53 @@ static void gen_zero_check(DisasContext *dc, const = uint32_t arg[]) static void translate_quos(DisasContext *dc, const uint32_t arg[], const uint32_t par[]) { - if (gen_window_check3(dc, arg[0], arg[1], arg[2])) { - TCGLabel *label1 =3D gen_new_label(); - TCGLabel *label2 =3D gen_new_label(); + TCGLabel *label1 =3D gen_new_label(); + TCGLabel *label2 =3D gen_new_label(); =20 - gen_zero_check(dc, arg); + gen_zero_check(dc, arg); =20 - tcg_gen_brcondi_i32(TCG_COND_NE, cpu_R[arg[1]], 0x80000000, - label1); - tcg_gen_brcondi_i32(TCG_COND_NE, cpu_R[arg[2]], 0xffffffff, - label1); - tcg_gen_movi_i32(cpu_R[arg[0]], - par[0] ? 0x80000000 : 0); - tcg_gen_br(label2); - gen_set_label(label1); - if (par[0]) { - tcg_gen_div_i32(cpu_R[arg[0]], - cpu_R[arg[1]], cpu_R[arg[2]]); - } else { - tcg_gen_rem_i32(cpu_R[arg[0]], - cpu_R[arg[1]], cpu_R[arg[2]]); - } - gen_set_label(label2); + tcg_gen_brcondi_i32(TCG_COND_NE, cpu_R[arg[1]], 0x80000000, + label1); + tcg_gen_brcondi_i32(TCG_COND_NE, cpu_R[arg[2]], 0xffffffff, + label1); + tcg_gen_movi_i32(cpu_R[arg[0]], + par[0] ? 0x80000000 : 0); + tcg_gen_br(label2); + gen_set_label(label1); + if (par[0]) { + tcg_gen_div_i32(cpu_R[arg[0]], + cpu_R[arg[1]], cpu_R[arg[2]]); + } else { + tcg_gen_rem_i32(cpu_R[arg[0]], + cpu_R[arg[1]], cpu_R[arg[2]]); } + gen_set_label(label2); } =20 static void translate_quou(DisasContext *dc, const uint32_t arg[], const uint32_t par[]) { - if (gen_window_check3(dc, arg[0], arg[1], arg[2])) { - gen_zero_check(dc, arg); - if (par[0]) { - tcg_gen_divu_i32(cpu_R[arg[0]], - cpu_R[arg[1]], cpu_R[arg[2]]); - } else { - tcg_gen_remu_i32(cpu_R[arg[0]], - cpu_R[arg[1]], cpu_R[arg[2]]); - } + gen_zero_check(dc, arg); + if (par[0]) { + tcg_gen_divu_i32(cpu_R[arg[0]], + cpu_R[arg[1]], cpu_R[arg[2]]); + } else { + tcg_gen_remu_i32(cpu_R[arg[0]], + cpu_R[arg[1]], cpu_R[arg[2]]); } } =20 static void translate_read_impwire(DisasContext *dc, const uint32_t arg[], const uint32_t par[]) { - if (gen_window_check1(dc, arg[0])) { - /* TODO: GPIO32 may be a part of coprocessor */ - tcg_gen_movi_i32(cpu_R[arg[0]], 0); - } + /* TODO: GPIO32 may be a part of coprocessor */ + tcg_gen_movi_i32(cpu_R[arg[0]], 0); } =20 static void translate_rer(DisasContext *dc, const uint32_t arg[], const uint32_t par[]) { - if (gen_window_check2(dc, arg[0], arg[1])) { - gen_helper_rer(cpu_R[arg[0]], cpu_env, cpu_R[arg[1]]); - } + gen_helper_rer(cpu_R[arg[0]], cpu_env, cpu_R[arg[1]]); } =20 static void translate_ret(DisasContext *dc, const uint32_t arg[], @@ -2237,13 +2145,11 @@ static void translate_rotw(DisasContext *dc, const = uint32_t arg[], static void translate_rsil(DisasContext *dc, const uint32_t arg[], const uint32_t par[]) { - if (gen_window_check1(dc, arg[0])) { - tcg_gen_mov_i32(cpu_R[arg[0]], cpu_SR[PS]); - tcg_gen_andi_i32(cpu_SR[PS], cpu_SR[PS], ~PS_INTLEVEL); - tcg_gen_ori_i32(cpu_SR[PS], cpu_SR[PS], arg[1]); - gen_check_interrupts(dc); - gen_jumpi_check_loop_end(dc, 0); - } + tcg_gen_mov_i32(cpu_R[arg[0]], cpu_SR[PS]); + tcg_gen_andi_i32(cpu_SR[PS], cpu_SR[PS], ~PS_INTLEVEL); + tcg_gen_ori_i32(cpu_SR[PS], cpu_SR[PS], arg[1]); + gen_check_interrupts(dc); + gen_jumpi_check_loop_end(dc, 0); } =20 static bool test_ill_rsr(DisasContext *dc, const uint32_t arg[], @@ -2255,10 +2161,8 @@ static bool test_ill_rsr(DisasContext *dc, const uin= t32_t arg[], static void translate_rsr(DisasContext *dc, const uint32_t arg[], const uint32_t par[]) { - if (gen_window_check1(dc, arg[0])) { - if (gen_rsr(dc, cpu_R[arg[0]], par[0])) { - gen_jumpi_check_loop_end(dc, 0); - } + if (gen_rsr(dc, cpu_R[arg[0]], par[0])) { + gen_jumpi_check_loop_end(dc, 0); } } =20 @@ -2271,25 +2175,20 @@ static void translate_rtlb(DisasContext *dc, const = uint32_t arg[], gen_helper_rtlb0, gen_helper_rtlb1, }; + TCGv_i32 dtlb =3D tcg_const_i32(par[0]); =20 - if (gen_window_check2(dc, arg[0], arg[1])) { - TCGv_i32 dtlb =3D tcg_const_i32(par[0]); - - helper[par[1]](cpu_R[arg[0]], cpu_env, cpu_R[arg[1]], dtlb); - tcg_temp_free(dtlb); - } + helper[par[1]](cpu_R[arg[0]], cpu_env, cpu_R[arg[1]], dtlb); + tcg_temp_free(dtlb); #endif } =20 static void translate_rur(DisasContext *dc, const uint32_t arg[], const uint32_t par[]) { - if (gen_window_check1(dc, arg[0])) { - if (uregnames[par[0]].name) { - tcg_gen_mov_i32(cpu_R[arg[0]], cpu_UR[par[0]]); - } else { - qemu_log_mask(LOG_UNIMP, "RUR %d not implemented\n", par[0]); - } + if (uregnames[par[0]].name) { + tcg_gen_mov_i32(cpu_R[arg[0]], cpu_UR[par[0]]); + } else { + qemu_log_mask(LOG_UNIMP, "RUR %d not implemented\n", par[0]); } } =20 @@ -2317,60 +2216,52 @@ static void gen_check_atomctl(DisasContext *dc, TCG= v_i32 addr) static void translate_s32c1i(DisasContext *dc, const uint32_t arg[], const uint32_t par[]) { - if (gen_window_check2(dc, arg[0], arg[1])) { - TCGv_i32 tmp =3D tcg_temp_local_new_i32(); - TCGv_i32 addr =3D tcg_temp_local_new_i32(); + TCGv_i32 tmp =3D tcg_temp_local_new_i32(); + TCGv_i32 addr =3D tcg_temp_local_new_i32(); =20 - tcg_gen_mov_i32(tmp, cpu_R[arg[0]]); - tcg_gen_addi_i32(addr, cpu_R[arg[1]], arg[2]); - gen_load_store_alignment(dc, 2, addr, true); - gen_check_atomctl(dc, addr); - tcg_gen_atomic_cmpxchg_i32(cpu_R[arg[0]], addr, cpu_SR[SCOMPARE1], - tmp, dc->cring, MO_32); - tcg_temp_free(addr); - tcg_temp_free(tmp); - } + tcg_gen_mov_i32(tmp, cpu_R[arg[0]]); + tcg_gen_addi_i32(addr, cpu_R[arg[1]], arg[2]); + gen_load_store_alignment(dc, 2, addr, true); + gen_check_atomctl(dc, addr); + tcg_gen_atomic_cmpxchg_i32(cpu_R[arg[0]], addr, cpu_SR[SCOMPARE1], + tmp, dc->cring, MO_32); + tcg_temp_free(addr); + tcg_temp_free(tmp); } =20 static void translate_s32e(DisasContext *dc, const uint32_t arg[], const uint32_t par[]) { - if (gen_window_check2(dc, arg[0], arg[1])) { - TCGv_i32 addr =3D tcg_temp_new_i32(); + TCGv_i32 addr =3D tcg_temp_new_i32(); =20 - tcg_gen_addi_i32(addr, cpu_R[arg[1]], arg[2]); - gen_load_store_alignment(dc, 2, addr, false); - tcg_gen_qemu_st_tl(cpu_R[arg[0]], addr, dc->ring, MO_TEUL); - tcg_temp_free(addr); - } + tcg_gen_addi_i32(addr, cpu_R[arg[1]], arg[2]); + gen_load_store_alignment(dc, 2, addr, false); + tcg_gen_qemu_st_tl(cpu_R[arg[0]], addr, dc->ring, MO_TEUL); + tcg_temp_free(addr); } =20 static void translate_salt(DisasContext *dc, const uint32_t arg[], const uint32_t par[]) { - if (gen_window_check3(dc, arg[0], arg[1], arg[2])) { - tcg_gen_setcond_i32(par[0], - cpu_R[arg[0]], - cpu_R[arg[1]], cpu_R[arg[2]]); - } + tcg_gen_setcond_i32(par[0], + cpu_R[arg[0]], + cpu_R[arg[1]], cpu_R[arg[2]]); } =20 static void translate_sext(DisasContext *dc, const uint32_t arg[], const uint32_t par[]) { - if (gen_window_check2(dc, arg[0], arg[1])) { - int shift =3D 31 - arg[2]; + int shift =3D 31 - arg[2]; =20 - if (shift =3D=3D 24) { - tcg_gen_ext8s_i32(cpu_R[arg[0]], cpu_R[arg[1]]); - } else if (shift =3D=3D 16) { - tcg_gen_ext16s_i32(cpu_R[arg[0]], cpu_R[arg[1]]); - } else { - TCGv_i32 tmp =3D tcg_temp_new_i32(); - tcg_gen_shli_i32(tmp, cpu_R[arg[1]], shift); - tcg_gen_sari_i32(cpu_R[arg[0]], tmp, shift); - tcg_temp_free(tmp); - } + if (shift =3D=3D 24) { + tcg_gen_ext8s_i32(cpu_R[arg[0]], cpu_R[arg[1]]); + } else if (shift =3D=3D 16) { + tcg_gen_ext16s_i32(cpu_R[arg[0]], cpu_R[arg[1]]); + } else { + TCGv_i32 tmp =3D tcg_temp_new_i32(); + tcg_gen_shli_i32(tmp, cpu_R[arg[1]], shift); + tcg_gen_sari_i32(cpu_R[arg[0]], tmp, shift); + tcg_temp_free(tmp); } } =20 @@ -2414,76 +2305,64 @@ static void translate_simcall(DisasContext *dc, con= st uint32_t arg[], static void translate_sll(DisasContext *dc, const uint32_t arg[], const uint32_t par[]) { - if (gen_window_check2(dc, arg[0], arg[1])) { - if (dc->sar_m32_5bit) { - tcg_gen_shl_i32(cpu_R[arg[0]], cpu_R[arg[1]], dc->sar_m32); - } else { - TCGv_i64 v =3D tcg_temp_new_i64(); - TCGv_i32 s =3D tcg_const_i32(32); - tcg_gen_sub_i32(s, s, cpu_SR[SAR]); - tcg_gen_andi_i32(s, s, 0x3f); - tcg_gen_extu_i32_i64(v, cpu_R[arg[1]]); - gen_shift_reg(shl, s); - tcg_temp_free(s); - } + if (dc->sar_m32_5bit) { + tcg_gen_shl_i32(cpu_R[arg[0]], cpu_R[arg[1]], dc->sar_m32); + } else { + TCGv_i64 v =3D tcg_temp_new_i64(); + TCGv_i32 s =3D tcg_const_i32(32); + tcg_gen_sub_i32(s, s, cpu_SR[SAR]); + tcg_gen_andi_i32(s, s, 0x3f); + tcg_gen_extu_i32_i64(v, cpu_R[arg[1]]); + gen_shift_reg(shl, s); + tcg_temp_free(s); } } =20 static void translate_slli(DisasContext *dc, const uint32_t arg[], const uint32_t par[]) { - if (gen_window_check2(dc, arg[0], arg[1])) { - if (arg[2] =3D=3D 32) { - qemu_log_mask(LOG_GUEST_ERROR, "slli a%d, a%d, 32 is undefined= \n", - arg[0], arg[1]); - } - tcg_gen_shli_i32(cpu_R[arg[0]], cpu_R[arg[1]], arg[2] & 0x1f); + if (arg[2] =3D=3D 32) { + qemu_log_mask(LOG_GUEST_ERROR, "slli a%d, a%d, 32 is undefined\n", + arg[0], arg[1]); } + tcg_gen_shli_i32(cpu_R[arg[0]], cpu_R[arg[1]], arg[2] & 0x1f); } =20 static void translate_sra(DisasContext *dc, const uint32_t arg[], const uint32_t par[]) { - if (gen_window_check2(dc, arg[0], arg[1])) { - if (dc->sar_m32_5bit) { - tcg_gen_sar_i32(cpu_R[arg[0]], cpu_R[arg[1]], cpu_SR[SAR]); - } else { - TCGv_i64 v =3D tcg_temp_new_i64(); - tcg_gen_ext_i32_i64(v, cpu_R[arg[1]]); - gen_shift(sar); - } + if (dc->sar_m32_5bit) { + tcg_gen_sar_i32(cpu_R[arg[0]], cpu_R[arg[1]], cpu_SR[SAR]); + } else { + TCGv_i64 v =3D tcg_temp_new_i64(); + tcg_gen_ext_i32_i64(v, cpu_R[arg[1]]); + gen_shift(sar); } } =20 static void translate_srai(DisasContext *dc, const uint32_t arg[], const uint32_t par[]) { - if (gen_window_check2(dc, arg[0], arg[1])) { - tcg_gen_sari_i32(cpu_R[arg[0]], cpu_R[arg[1]], arg[2]); - } + tcg_gen_sari_i32(cpu_R[arg[0]], cpu_R[arg[1]], arg[2]); } =20 static void translate_src(DisasContext *dc, const uint32_t arg[], const uint32_t par[]) { - if (gen_window_check3(dc, arg[0], arg[1], arg[2])) { - TCGv_i64 v =3D tcg_temp_new_i64(); - tcg_gen_concat_i32_i64(v, cpu_R[arg[2]], cpu_R[arg[1]]); - gen_shift(shr); - } + TCGv_i64 v =3D tcg_temp_new_i64(); + tcg_gen_concat_i32_i64(v, cpu_R[arg[2]], cpu_R[arg[1]]); + gen_shift(shr); } =20 static void translate_srl(DisasContext *dc, const uint32_t arg[], const uint32_t par[]) { - if (gen_window_check2(dc, arg[0], arg[1])) { - if (dc->sar_m32_5bit) { - tcg_gen_shr_i32(cpu_R[arg[0]], cpu_R[arg[1]], cpu_SR[SAR]); - } else { - TCGv_i64 v =3D tcg_temp_new_i64(); - tcg_gen_extu_i32_i64(v, cpu_R[arg[1]]); - gen_shift(shr); - } + if (dc->sar_m32_5bit) { + tcg_gen_shr_i32(cpu_R[arg[0]], cpu_R[arg[1]], cpu_SR[SAR]); + } else { + TCGv_i64 v =3D tcg_temp_new_i64(); + tcg_gen_extu_i32_i64(v, cpu_R[arg[1]]); + gen_shift(shr); } } =20 @@ -2493,31 +2372,25 @@ static void translate_srl(DisasContext *dc, const u= int32_t arg[], static void translate_srli(DisasContext *dc, const uint32_t arg[], const uint32_t par[]) { - if (gen_window_check2(dc, arg[0], arg[1])) { - tcg_gen_shri_i32(cpu_R[arg[0]], cpu_R[arg[1]], arg[2]); - } + tcg_gen_shri_i32(cpu_R[arg[0]], cpu_R[arg[1]], arg[2]); } =20 static void translate_ssa8b(DisasContext *dc, const uint32_t arg[], const uint32_t par[]) { - if (gen_window_check1(dc, arg[0])) { - TCGv_i32 tmp =3D tcg_temp_new_i32(); - tcg_gen_shli_i32(tmp, cpu_R[arg[0]], 3); - gen_left_shift_sar(dc, tmp); - tcg_temp_free(tmp); - } + TCGv_i32 tmp =3D tcg_temp_new_i32(); + tcg_gen_shli_i32(tmp, cpu_R[arg[0]], 3); + gen_left_shift_sar(dc, tmp); + tcg_temp_free(tmp); } =20 static void translate_ssa8l(DisasContext *dc, const uint32_t arg[], const uint32_t par[]) { - if (gen_window_check1(dc, arg[0])) { - TCGv_i32 tmp =3D tcg_temp_new_i32(); - tcg_gen_shli_i32(tmp, cpu_R[arg[0]], 3); - gen_right_shift_sar(dc, tmp); - tcg_temp_free(tmp); - } + TCGv_i32 tmp =3D tcg_temp_new_i32(); + tcg_gen_shli_i32(tmp, cpu_R[arg[0]], 3); + gen_right_shift_sar(dc, tmp); + tcg_temp_free(tmp); } =20 static void translate_ssai(DisasContext *dc, const uint32_t arg[], @@ -2531,36 +2404,28 @@ static void translate_ssai(DisasContext *dc, const = uint32_t arg[], static void translate_ssl(DisasContext *dc, const uint32_t arg[], const uint32_t par[]) { - if (gen_window_check1(dc, arg[0])) { - gen_left_shift_sar(dc, cpu_R[arg[0]]); - } + gen_left_shift_sar(dc, cpu_R[arg[0]]); } =20 static void translate_ssr(DisasContext *dc, const uint32_t arg[], const uint32_t par[]) { - if (gen_window_check1(dc, arg[0])) { - gen_right_shift_sar(dc, cpu_R[arg[0]]); - } + gen_right_shift_sar(dc, cpu_R[arg[0]]); } =20 static void translate_sub(DisasContext *dc, const uint32_t arg[], const uint32_t par[]) { - if (gen_window_check3(dc, arg[0], arg[1], arg[2])) { - tcg_gen_sub_i32(cpu_R[arg[0]], cpu_R[arg[1]], cpu_R[arg[2]]); - } + tcg_gen_sub_i32(cpu_R[arg[0]], cpu_R[arg[1]], cpu_R[arg[2]]); } =20 static void translate_subx(DisasContext *dc, const uint32_t arg[], const uint32_t par[]) { - if (gen_window_check3(dc, arg[0], arg[1], arg[2])) { - TCGv_i32 tmp =3D tcg_temp_new_i32(); - tcg_gen_shli_i32(tmp, cpu_R[arg[1]], par[0]); - tcg_gen_sub_i32(cpu_R[arg[0]], tmp, cpu_R[arg[2]]); - tcg_temp_free(tmp); - } + TCGv_i32 tmp =3D tcg_temp_new_i32(); + tcg_gen_shli_i32(tmp, cpu_R[arg[1]], par[0]); + tcg_gen_sub_i32(cpu_R[arg[0]], tmp, cpu_R[arg[2]]); + tcg_temp_free(tmp); } =20 static void translate_waiti(DisasContext *dc, const uint32_t arg[], @@ -2574,33 +2439,27 @@ static void translate_waiti(DisasContext *dc, const= uint32_t arg[], static void translate_wtlb(DisasContext *dc, const uint32_t arg[], const uint32_t par[]) { - if (gen_window_check2(dc, arg[0], arg[1])) { #ifndef CONFIG_USER_ONLY - TCGv_i32 dtlb =3D tcg_const_i32(par[0]); + TCGv_i32 dtlb =3D tcg_const_i32(par[0]); =20 - gen_helper_wtlb(cpu_env, cpu_R[arg[0]], cpu_R[arg[1]], dtlb); - /* This could change memory mapping, so exit tb */ - gen_jumpi_check_loop_end(dc, -1); - tcg_temp_free(dtlb); + gen_helper_wtlb(cpu_env, cpu_R[arg[0]], cpu_R[arg[1]], dtlb); + /* This could change memory mapping, so exit tb */ + gen_jumpi_check_loop_end(dc, -1); + tcg_temp_free(dtlb); #endif - } } =20 static void translate_wer(DisasContext *dc, const uint32_t arg[], const uint32_t par[]) { - if (gen_window_check2(dc, arg[0], arg[1])) { - gen_helper_wer(cpu_env, cpu_R[arg[0]], cpu_R[arg[1]]); - } + gen_helper_wer(cpu_env, cpu_R[arg[0]], cpu_R[arg[1]]); } =20 static void translate_wrmsk_expstate(DisasContext *dc, const uint32_t arg[= ], const uint32_t par[]) { - if (gen_window_check2(dc, arg[0], arg[1])) { - /* TODO: GPIO32 may be a part of coprocessor */ - tcg_gen_and_i32(cpu_UR[EXPSTATE], cpu_R[arg[0]], cpu_R[arg[1]]); - } + /* TODO: GPIO32 may be a part of coprocessor */ + tcg_gen_and_i32(cpu_UR[EXPSTATE], cpu_R[arg[0]], cpu_R[arg[1]]); } =20 static bool test_ill_wsr(DisasContext *dc, const uint32_t arg[], @@ -2612,29 +2471,23 @@ static bool test_ill_wsr(DisasContext *dc, const ui= nt32_t arg[], static void translate_wsr(DisasContext *dc, const uint32_t arg[], const uint32_t par[]) { - if (gen_window_check1(dc, arg[0])) { - gen_wsr(dc, par[0], cpu_R[arg[0]]); - } + gen_wsr(dc, par[0], cpu_R[arg[0]]); } =20 static void translate_wur(DisasContext *dc, const uint32_t arg[], const uint32_t par[]) { - if (gen_window_check1(dc, arg[0])) { - if (uregnames[par[0]].name) { - gen_wur(par[0], cpu_R[arg[0]]); - } else { - qemu_log_mask(LOG_UNIMP, "WUR %d not implemented\n", par[0]); - } + if (uregnames[par[0]].name) { + gen_wur(par[0], cpu_R[arg[0]]); + } else { + qemu_log_mask(LOG_UNIMP, "WUR %d not implemented\n", par[0]); } } =20 static void translate_xor(DisasContext *dc, const uint32_t arg[], const uint32_t par[]) { - if (gen_window_check3(dc, arg[0], arg[1], arg[2])) { - tcg_gen_xor_i32(cpu_R[arg[0]], cpu_R[arg[1]], cpu_R[arg[2]]); - } + tcg_gen_xor_i32(cpu_R[arg[0]], cpu_R[arg[1]], cpu_R[arg[2]]); } =20 static bool test_ill_xsr(DisasContext *dc, const uint32_t arg[], @@ -2646,17 +2499,15 @@ static bool test_ill_xsr(DisasContext *dc, const ui= nt32_t arg[], static void translate_xsr(DisasContext *dc, const uint32_t arg[], const uint32_t par[]) { - if (gen_window_check1(dc, arg[0])) { - TCGv_i32 tmp =3D tcg_temp_new_i32(); - bool rsr_end, wsr_end; + TCGv_i32 tmp =3D tcg_temp_new_i32(); + bool rsr_end, wsr_end; =20 - tcg_gen_mov_i32(tmp, cpu_R[arg[0]]); - rsr_end =3D gen_rsr(dc, cpu_R[arg[0]], par[0]); - wsr_end =3D gen_wsr(dc, par[0], tmp); - tcg_temp_free(tmp); - if (rsr_end && !wsr_end) { - gen_jumpi_check_loop_end(dc, 0); - } + tcg_gen_mov_i32(tmp, cpu_R[arg[0]]); + rsr_end =3D gen_rsr(dc, cpu_R[arg[0]], par[0]); + wsr_end =3D gen_wsr(dc, par[0], tmp); + tcg_temp_free(tmp); + if (rsr_end && !wsr_end) { + gen_jumpi_check_loop_end(dc, 0); } } =20 @@ -2664,33 +2515,42 @@ static const XtensaOpcodeOps core_ops[] =3D { { .name =3D "abs", .translate =3D translate_abs, + .windowed_register_op =3D 0x3, }, { .name =3D "add", .translate =3D translate_add, + .windowed_register_op =3D 0x7, }, { .name =3D "add.n", .translate =3D translate_add, + .windowed_register_op =3D 0x7, }, { .name =3D "addi", .translate =3D translate_addi, + .windowed_register_op =3D 0x3, }, { .name =3D "addi.n", .translate =3D translate_addi, + .windowed_register_op =3D 0x3, }, { .name =3D "addmi", .translate =3D translate_addi, + .windowed_register_op =3D 0x3, }, { .name =3D "addx2", .translate =3D translate_addx, .par =3D (const uint32_t[]){1}, + .windowed_register_op =3D 0x7, }, { .name =3D "addx4", .translate =3D translate_addx, .par =3D (const uint32_t[]){2}, + .windowed_register_op =3D 0x7, }, { .name =3D "addx8", .translate =3D translate_addx, .par =3D (const uint32_t[]){3}, + .windowed_register_op =3D 0x7, }, { .name =3D "all4", .translate =3D translate_all, @@ -2702,6 +2562,7 @@ static const XtensaOpcodeOps core_ops[] =3D { }, { .name =3D "and", .translate =3D translate_and, + .windowed_register_op =3D 0x7, }, { .name =3D "andb", .translate =3D translate_boolean, @@ -2722,42 +2583,52 @@ static const XtensaOpcodeOps core_ops[] =3D { .name =3D "ball", .translate =3D translate_ball, .par =3D (const uint32_t[]){TCG_COND_EQ}, + .windowed_register_op =3D 0x3, }, { .name =3D "bany", .translate =3D translate_bany, .par =3D (const uint32_t[]){TCG_COND_NE}, + .windowed_register_op =3D 0x3, }, { .name =3D "bbc", .translate =3D translate_bb, .par =3D (const uint32_t[]){TCG_COND_EQ}, + .windowed_register_op =3D 0x3, }, { .name =3D "bbci", .translate =3D translate_bbi, .par =3D (const uint32_t[]){TCG_COND_EQ}, + .windowed_register_op =3D 0x1, }, { .name =3D "bbs", .translate =3D translate_bb, .par =3D (const uint32_t[]){TCG_COND_NE}, + .windowed_register_op =3D 0x3, }, { .name =3D "bbsi", .translate =3D translate_bbi, .par =3D (const uint32_t[]){TCG_COND_NE}, + .windowed_register_op =3D 0x1, }, { .name =3D "beq", .translate =3D translate_b, .par =3D (const uint32_t[]){TCG_COND_EQ}, + .windowed_register_op =3D 0x3, }, { .name =3D "beqi", .translate =3D translate_bi, .par =3D (const uint32_t[]){TCG_COND_EQ}, + .windowed_register_op =3D 0x1, }, { .name =3D "beqz", .translate =3D translate_bz, .par =3D (const uint32_t[]){TCG_COND_EQ}, + .windowed_register_op =3D 0x1, }, { .name =3D "beqz.n", .translate =3D translate_bz, .par =3D (const uint32_t[]){TCG_COND_EQ}, + .windowed_register_op =3D 0x1, }, { .name =3D "bf", .translate =3D translate_bp, @@ -2766,66 +2637,82 @@ static const XtensaOpcodeOps core_ops[] =3D { .name =3D "bge", .translate =3D translate_b, .par =3D (const uint32_t[]){TCG_COND_GE}, + .windowed_register_op =3D 0x3, }, { .name =3D "bgei", .translate =3D translate_bi, .par =3D (const uint32_t[]){TCG_COND_GE}, + .windowed_register_op =3D 0x1, }, { .name =3D "bgeu", .translate =3D translate_b, .par =3D (const uint32_t[]){TCG_COND_GEU}, + .windowed_register_op =3D 0x3, }, { .name =3D "bgeui", .translate =3D translate_bi, .par =3D (const uint32_t[]){TCG_COND_GEU}, + .windowed_register_op =3D 0x1, }, { .name =3D "bgez", .translate =3D translate_bz, .par =3D (const uint32_t[]){TCG_COND_GE}, + .windowed_register_op =3D 0x1, }, { .name =3D "blt", .translate =3D translate_b, .par =3D (const uint32_t[]){TCG_COND_LT}, + .windowed_register_op =3D 0x3, }, { .name =3D "blti", .translate =3D translate_bi, .par =3D (const uint32_t[]){TCG_COND_LT}, + .windowed_register_op =3D 0x1, }, { .name =3D "bltu", .translate =3D translate_b, .par =3D (const uint32_t[]){TCG_COND_LTU}, + .windowed_register_op =3D 0x3, }, { .name =3D "bltui", .translate =3D translate_bi, .par =3D (const uint32_t[]){TCG_COND_LTU}, + .windowed_register_op =3D 0x1, }, { .name =3D "bltz", .translate =3D translate_bz, .par =3D (const uint32_t[]){TCG_COND_LT}, + .windowed_register_op =3D 0x1, }, { .name =3D "bnall", .translate =3D translate_ball, .par =3D (const uint32_t[]){TCG_COND_NE}, + .windowed_register_op =3D 0x3, }, { .name =3D "bne", .translate =3D translate_b, .par =3D (const uint32_t[]){TCG_COND_NE}, + .windowed_register_op =3D 0x3, }, { .name =3D "bnei", .translate =3D translate_bi, .par =3D (const uint32_t[]){TCG_COND_NE}, + .windowed_register_op =3D 0x1, }, { .name =3D "bnez", .translate =3D translate_bz, .par =3D (const uint32_t[]){TCG_COND_NE}, + .windowed_register_op =3D 0x1, }, { .name =3D "bnez.n", .translate =3D translate_bz, .par =3D (const uint32_t[]){TCG_COND_NE}, + .windowed_register_op =3D 0x1, }, { .name =3D "bnone", .translate =3D translate_bany, .par =3D (const uint32_t[]){TCG_COND_EQ}, + .windowed_register_op =3D 0x3, }, { .name =3D "break", .translate =3D translate_nop, @@ -2846,101 +2733,114 @@ static const XtensaOpcodeOps core_ops[] =3D { }, { .name =3D "call12", .translate =3D translate_callw, + .test_overflow =3D test_overflow_callw, .par =3D (const uint32_t[]){3}, }, { .name =3D "call4", .translate =3D translate_callw, + .test_overflow =3D test_overflow_callw, .par =3D (const uint32_t[]){1}, }, { .name =3D "call8", .translate =3D translate_callw, + .test_overflow =3D test_overflow_callw, .par =3D (const uint32_t[]){2}, }, { .name =3D "callx0", .translate =3D translate_callx0, + .windowed_register_op =3D 0x1, }, { .name =3D "callx12", .translate =3D translate_callxw, + .test_overflow =3D test_overflow_callw, .par =3D (const uint32_t[]){3}, + .windowed_register_op =3D 0x1, }, { .name =3D "callx4", .translate =3D translate_callxw, + .test_overflow =3D test_overflow_callw, .par =3D (const uint32_t[]){1}, + .windowed_register_op =3D 0x1, }, { .name =3D "callx8", .translate =3D translate_callxw, + .test_overflow =3D test_overflow_callw, .par =3D (const uint32_t[]){2}, + .windowed_register_op =3D 0x1, }, { .name =3D "clamps", .translate =3D translate_clamps, + .windowed_register_op =3D 0x3, }, { .name =3D "clrb_expstate", .translate =3D translate_clrb_expstate, }, { .name =3D "const16", .translate =3D translate_const16, + .windowed_register_op =3D 0x1, }, { .name =3D "depbits", .translate =3D translate_depbits, + .windowed_register_op =3D 0x3, }, { .name =3D "dhi", .translate =3D translate_dcache, - .par =3D (const uint32_t[]){true}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "dhu", .translate =3D translate_dcache, - .par =3D (const uint32_t[]){true}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "dhwb", .translate =3D translate_dcache, - .par =3D (const uint32_t[]){true}, + .windowed_register_op =3D 0x1, }, { .name =3D "dhwbi", .translate =3D translate_dcache, - .par =3D (const uint32_t[]){true}, + .windowed_register_op =3D 0x1, }, { .name =3D "dii", - .translate =3D translate_dcache, - .par =3D (const uint32_t[]){false}, + .translate =3D translate_nop, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "diu", - .translate =3D translate_dcache, - .par =3D (const uint32_t[]){false}, + .translate =3D translate_nop, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "diwb", - .translate =3D translate_dcache, - .par =3D (const uint32_t[]){false}, + .translate =3D translate_nop, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "diwbi", - .translate =3D translate_dcache, - .par =3D (const uint32_t[]){false}, + .translate =3D translate_nop, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "dpfl", .translate =3D translate_dcache, - .par =3D (const uint32_t[]){true}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "dpfr", - .translate =3D translate_dcache, - .par =3D (const uint32_t[]){false}, + .translate =3D translate_nop, + .windowed_register_op =3D 0x1, }, { .name =3D "dpfro", - .translate =3D translate_dcache, - .par =3D (const uint32_t[]){false}, + .translate =3D translate_nop, + .windowed_register_op =3D 0x1, }, { .name =3D "dpfw", - .translate =3D translate_dcache, - .par =3D (const uint32_t[]){false}, + .translate =3D translate_nop, + .windowed_register_op =3D 0x1, }, { .name =3D "dpfwo", - .translate =3D translate_dcache, - .par =3D (const uint32_t[]){false}, + .translate =3D translate_nop, + .windowed_register_op =3D 0x1, }, { .name =3D "dsync", .translate =3D translate_nop, @@ -2948,6 +2848,7 @@ static const XtensaOpcodeOps core_ops[] =3D { .name =3D "entry", .translate =3D translate_entry, .test_ill =3D test_ill_entry, + .test_overflow =3D test_overflow_entry, }, { .name =3D "esync", .translate =3D translate_nop, @@ -2957,6 +2858,7 @@ static const XtensaOpcodeOps core_ops[] =3D { }, { .name =3D "extui", .translate =3D translate_extui, + .windowed_register_op =3D 0x3, }, { .name =3D "extw", .translate =3D translate_memw, @@ -2971,30 +2873,32 @@ static const XtensaOpcodeOps core_ops[] =3D { .translate =3D translate_itlb, .par =3D (const uint32_t[]){true}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "ihi", .translate =3D translate_icache, - .par =3D (const uint32_t[]){true}, + .windowed_register_op =3D 0x1, }, { .name =3D "ihu", .translate =3D translate_icache, - .par =3D (const uint32_t[]){true}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "iii", - .translate =3D translate_icache, - .par =3D (const uint32_t[]){false}, + .translate =3D translate_nop, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "iitlb", .translate =3D translate_itlb, .par =3D (const uint32_t[]){false}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "iiu", - .translate =3D translate_icache, - .par =3D (const uint32_t[]){false}, + .translate =3D translate_nop, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "ill", .op_flags =3D XTENSA_OP_ILL, @@ -3003,13 +2907,13 @@ static const XtensaOpcodeOps core_ops[] =3D { .op_flags =3D XTENSA_OP_ILL, }, { .name =3D "ipf", - .translate =3D translate_icache, - .par =3D (const uint32_t[]){false}, + .translate =3D translate_nop, + .windowed_register_op =3D 0x1, }, { .name =3D "ipfl", .translate =3D translate_icache, - .par =3D (const uint32_t[]){true}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "isync", .translate =3D translate_nop, @@ -3019,45 +2923,56 @@ static const XtensaOpcodeOps core_ops[] =3D { }, { .name =3D "jx", .translate =3D translate_jx, + .windowed_register_op =3D 0x1, }, { .name =3D "l16si", .translate =3D translate_ldst, .par =3D (const uint32_t[]){MO_TESW, false, false}, + .windowed_register_op =3D 0x3, }, { .name =3D "l16ui", .translate =3D translate_ldst, .par =3D (const uint32_t[]){MO_TEUW, false, false}, + .windowed_register_op =3D 0x3, }, { .name =3D "l32ai", .translate =3D translate_ldst, .par =3D (const uint32_t[]){MO_TEUL, true, false}, + .windowed_register_op =3D 0x3, }, { .name =3D "l32e", .translate =3D translate_l32e, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x3, }, { .name =3D "l32i", .translate =3D translate_ldst, .par =3D (const uint32_t[]){MO_TEUL, false, false}, + .windowed_register_op =3D 0x3, }, { .name =3D "l32i.n", .translate =3D translate_ldst, .par =3D (const uint32_t[]){MO_TEUL, false, false}, + .windowed_register_op =3D 0x3, }, { .name =3D "l32r", .translate =3D translate_l32r, + .windowed_register_op =3D 0x1, }, { .name =3D "l8ui", .translate =3D translate_ldst, .par =3D (const uint32_t[]){MO_UB, false, false}, + .windowed_register_op =3D 0x3, }, { .name =3D "lddec", .translate =3D translate_mac16, .par =3D (const uint32_t[]){MAC16_NONE, 0, 0, -4}, + .windowed_register_op =3D 0x2, }, { .name =3D "ldinc", .translate =3D translate_mac16, .par =3D (const uint32_t[]){MAC16_NONE, 0, 0, 4}, + .windowed_register_op =3D 0x2, }, { .name =3D "ldpte", .op_flags =3D XTENSA_OP_ILL, @@ -3065,116 +2980,146 @@ static const XtensaOpcodeOps core_ops[] =3D { .name =3D "loop", .translate =3D translate_loop, .par =3D (const uint32_t[]){TCG_COND_NEVER}, + .windowed_register_op =3D 0x1, }, { .name =3D "loopgtz", .translate =3D translate_loop, .par =3D (const uint32_t[]){TCG_COND_GT}, + .windowed_register_op =3D 0x1, }, { .name =3D "loopnez", .translate =3D translate_loop, .par =3D (const uint32_t[]){TCG_COND_NE}, + .windowed_register_op =3D 0x1, }, { .name =3D "max", .translate =3D translate_smax, + .windowed_register_op =3D 0x7, }, { .name =3D "maxu", .translate =3D translate_umax, + .windowed_register_op =3D 0x7, }, { .name =3D "memw", .translate =3D translate_memw, }, { .name =3D "min", .translate =3D translate_smin, + .windowed_register_op =3D 0x7, }, { .name =3D "minu", .translate =3D translate_umin, + .windowed_register_op =3D 0x7, }, { .name =3D "mov", .translate =3D translate_mov, + .windowed_register_op =3D 0x3, }, { .name =3D "mov.n", .translate =3D translate_mov, + .windowed_register_op =3D 0x3, }, { .name =3D "moveqz", .translate =3D translate_movcond, .par =3D (const uint32_t[]){TCG_COND_EQ}, + .windowed_register_op =3D 0x7, }, { .name =3D "movf", .translate =3D translate_movp, .par =3D (const uint32_t[]){TCG_COND_EQ}, + .windowed_register_op =3D 0x3, }, { .name =3D "movgez", .translate =3D translate_movcond, .par =3D (const uint32_t[]){TCG_COND_GE}, + .windowed_register_op =3D 0x7, }, { .name =3D "movi", .translate =3D translate_movi, + .windowed_register_op =3D 0x1, }, { .name =3D "movi.n", .translate =3D translate_movi, + .windowed_register_op =3D 0x1, }, { .name =3D "movltz", .translate =3D translate_movcond, .par =3D (const uint32_t[]){TCG_COND_LT}, + .windowed_register_op =3D 0x7, }, { .name =3D "movnez", .translate =3D translate_movcond, .par =3D (const uint32_t[]){TCG_COND_NE}, + .windowed_register_op =3D 0x7, }, { .name =3D "movsp", .translate =3D translate_movsp, + .windowed_register_op =3D 0x3, }, { .name =3D "movt", .translate =3D translate_movp, .par =3D (const uint32_t[]){TCG_COND_NE}, + .windowed_register_op =3D 0x3, }, { .name =3D "mul.aa.hh", .translate =3D translate_mac16, .par =3D (const uint32_t[]){MAC16_MUL, MAC16_AA, MAC16_HH, 0}, + .windowed_register_op =3D 0x3, }, { .name =3D "mul.aa.hl", .translate =3D translate_mac16, .par =3D (const uint32_t[]){MAC16_MUL, MAC16_AA, MAC16_HL, 0}, + .windowed_register_op =3D 0x3, }, { .name =3D "mul.aa.lh", .translate =3D translate_mac16, .par =3D (const uint32_t[]){MAC16_MUL, MAC16_AA, MAC16_LH, 0}, + .windowed_register_op =3D 0x3, }, { .name =3D "mul.aa.ll", .translate =3D translate_mac16, .par =3D (const uint32_t[]){MAC16_MUL, MAC16_AA, MAC16_LL, 0}, + .windowed_register_op =3D 0x3, }, { .name =3D "mul.ad.hh", .translate =3D translate_mac16, .par =3D (const uint32_t[]){MAC16_MUL, MAC16_AD, MAC16_HH, 0}, + .windowed_register_op =3D 0x1, }, { .name =3D "mul.ad.hl", .translate =3D translate_mac16, .par =3D (const uint32_t[]){MAC16_MUL, MAC16_AD, MAC16_HL, 0}, + .windowed_register_op =3D 0x1, }, { .name =3D "mul.ad.lh", .translate =3D translate_mac16, .par =3D (const uint32_t[]){MAC16_MUL, MAC16_AD, MAC16_LH, 0}, + .windowed_register_op =3D 0x1, }, { .name =3D "mul.ad.ll", .translate =3D translate_mac16, .par =3D (const uint32_t[]){MAC16_MUL, MAC16_AD, MAC16_LL, 0}, + .windowed_register_op =3D 0x1, }, { .name =3D "mul.da.hh", .translate =3D translate_mac16, .par =3D (const uint32_t[]){MAC16_MUL, MAC16_DA, MAC16_HH, 0}, + .windowed_register_op =3D 0x2, }, { .name =3D "mul.da.hl", .translate =3D translate_mac16, .par =3D (const uint32_t[]){MAC16_MUL, MAC16_DA, MAC16_HL, 0}, + .windowed_register_op =3D 0x2, }, { .name =3D "mul.da.lh", .translate =3D translate_mac16, .par =3D (const uint32_t[]){MAC16_MUL, MAC16_DA, MAC16_LH, 0}, + .windowed_register_op =3D 0x2, }, { .name =3D "mul.da.ll", .translate =3D translate_mac16, .par =3D (const uint32_t[]){MAC16_MUL, MAC16_DA, MAC16_LL, 0}, + .windowed_register_op =3D 0x2, }, { .name =3D "mul.dd.hh", .translate =3D translate_mac16, @@ -3195,90 +3140,112 @@ static const XtensaOpcodeOps core_ops[] =3D { .name =3D "mul16s", .translate =3D translate_mul16, .par =3D (const uint32_t[]){true}, + .windowed_register_op =3D 0x7, }, { .name =3D "mul16u", .translate =3D translate_mul16, .par =3D (const uint32_t[]){false}, + .windowed_register_op =3D 0x7, }, { .name =3D "mula.aa.hh", .translate =3D translate_mac16, .par =3D (const uint32_t[]){MAC16_MULA, MAC16_AA, MAC16_HH, 0}, + .windowed_register_op =3D 0x3, }, { .name =3D "mula.aa.hl", .translate =3D translate_mac16, .par =3D (const uint32_t[]){MAC16_MULA, MAC16_AA, MAC16_HL, 0}, + .windowed_register_op =3D 0x3, }, { .name =3D "mula.aa.lh", .translate =3D translate_mac16, .par =3D (const uint32_t[]){MAC16_MULA, MAC16_AA, MAC16_LH, 0}, + .windowed_register_op =3D 0x3, }, { .name =3D "mula.aa.ll", .translate =3D translate_mac16, .par =3D (const uint32_t[]){MAC16_MULA, MAC16_AA, MAC16_LL, 0}, + .windowed_register_op =3D 0x3, }, { .name =3D "mula.ad.hh", .translate =3D translate_mac16, .par =3D (const uint32_t[]){MAC16_MULA, MAC16_AD, MAC16_HH, 0}, + .windowed_register_op =3D 0x1, }, { .name =3D "mula.ad.hl", .translate =3D translate_mac16, .par =3D (const uint32_t[]){MAC16_MULA, MAC16_AD, MAC16_HL, 0}, + .windowed_register_op =3D 0x1, }, { .name =3D "mula.ad.lh", .translate =3D translate_mac16, .par =3D (const uint32_t[]){MAC16_MULA, MAC16_AD, MAC16_LH, 0}, + .windowed_register_op =3D 0x1, }, { .name =3D "mula.ad.ll", .translate =3D translate_mac16, .par =3D (const uint32_t[]){MAC16_MULA, MAC16_AD, MAC16_LL, 0}, + .windowed_register_op =3D 0x1, }, { .name =3D "mula.da.hh", .translate =3D translate_mac16, .par =3D (const uint32_t[]){MAC16_MULA, MAC16_DA, MAC16_HH, 0}, + .windowed_register_op =3D 0x2, }, { .name =3D "mula.da.hh.lddec", .translate =3D translate_mac16, .par =3D (const uint32_t[]){MAC16_MULA, MAC16_DA, MAC16_HH, -4}, + .windowed_register_op =3D 0xa, }, { .name =3D "mula.da.hh.ldinc", .translate =3D translate_mac16, .par =3D (const uint32_t[]){MAC16_MULA, MAC16_DA, MAC16_HH, 4}, + .windowed_register_op =3D 0xa, }, { .name =3D "mula.da.hl", .translate =3D translate_mac16, .par =3D (const uint32_t[]){MAC16_MULA, MAC16_DA, MAC16_HL, 0}, + .windowed_register_op =3D 0x2, }, { .name =3D "mula.da.hl.lddec", .translate =3D translate_mac16, .par =3D (const uint32_t[]){MAC16_MULA, MAC16_DA, MAC16_HL, -4}, + .windowed_register_op =3D 0xa, }, { .name =3D "mula.da.hl.ldinc", .translate =3D translate_mac16, .par =3D (const uint32_t[]){MAC16_MULA, MAC16_DA, MAC16_HL, 4}, + .windowed_register_op =3D 0xa, }, { .name =3D "mula.da.lh", .translate =3D translate_mac16, .par =3D (const uint32_t[]){MAC16_MULA, MAC16_DA, MAC16_LH, 0}, + .windowed_register_op =3D 0x2, }, { .name =3D "mula.da.lh.lddec", .translate =3D translate_mac16, .par =3D (const uint32_t[]){MAC16_MULA, MAC16_DA, MAC16_LH, -4}, + .windowed_register_op =3D 0xa, }, { .name =3D "mula.da.lh.ldinc", .translate =3D translate_mac16, .par =3D (const uint32_t[]){MAC16_MULA, MAC16_DA, MAC16_LH, 4}, + .windowed_register_op =3D 0xa, }, { .name =3D "mula.da.ll", .translate =3D translate_mac16, .par =3D (const uint32_t[]){MAC16_MULA, MAC16_DA, MAC16_LL, 0}, + .windowed_register_op =3D 0x2, }, { .name =3D "mula.da.ll.lddec", .translate =3D translate_mac16, .par =3D (const uint32_t[]){MAC16_MULA, MAC16_DA, MAC16_LL, -4}, + .windowed_register_op =3D 0xa, }, { .name =3D "mula.da.ll.ldinc", .translate =3D translate_mac16, .par =3D (const uint32_t[]){MAC16_MULA, MAC16_DA, MAC16_LL, 4}, + .windowed_register_op =3D 0xa, }, { .name =3D "mula.dd.hh", .translate =3D translate_mac16, @@ -3287,10 +3254,12 @@ static const XtensaOpcodeOps core_ops[] =3D { .name =3D "mula.dd.hh.lddec", .translate =3D translate_mac16, .par =3D (const uint32_t[]){MAC16_MULA, MAC16_DD, MAC16_HH, -4}, + .windowed_register_op =3D 0x2, }, { .name =3D "mula.dd.hh.ldinc", .translate =3D translate_mac16, .par =3D (const uint32_t[]){MAC16_MULA, MAC16_DD, MAC16_HH, 4}, + .windowed_register_op =3D 0x2, }, { .name =3D "mula.dd.hl", .translate =3D translate_mac16, @@ -3299,10 +3268,12 @@ static const XtensaOpcodeOps core_ops[] =3D { .name =3D "mula.dd.hl.lddec", .translate =3D translate_mac16, .par =3D (const uint32_t[]){MAC16_MULA, MAC16_DD, MAC16_HL, -4}, + .windowed_register_op =3D 0x2, }, { .name =3D "mula.dd.hl.ldinc", .translate =3D translate_mac16, .par =3D (const uint32_t[]){MAC16_MULA, MAC16_DD, MAC16_HL, 4}, + .windowed_register_op =3D 0x2, }, { .name =3D "mula.dd.lh", .translate =3D translate_mac16, @@ -3311,10 +3282,12 @@ static const XtensaOpcodeOps core_ops[] =3D { .name =3D "mula.dd.lh.lddec", .translate =3D translate_mac16, .par =3D (const uint32_t[]){MAC16_MULA, MAC16_DD, MAC16_LH, -4}, + .windowed_register_op =3D 0x2, }, { .name =3D "mula.dd.lh.ldinc", .translate =3D translate_mac16, .par =3D (const uint32_t[]){MAC16_MULA, MAC16_DD, MAC16_LH, 4}, + .windowed_register_op =3D 0x2, }, { .name =3D "mula.dd.ll", .translate =3D translate_mac16, @@ -3323,61 +3296,76 @@ static const XtensaOpcodeOps core_ops[] =3D { .name =3D "mula.dd.ll.lddec", .translate =3D translate_mac16, .par =3D (const uint32_t[]){MAC16_MULA, MAC16_DD, MAC16_LL, -4}, + .windowed_register_op =3D 0x2, }, { .name =3D "mula.dd.ll.ldinc", .translate =3D translate_mac16, .par =3D (const uint32_t[]){MAC16_MULA, MAC16_DD, MAC16_LL, 4}, + .windowed_register_op =3D 0x2, }, { .name =3D "mull", .translate =3D translate_mull, + .windowed_register_op =3D 0x7, }, { .name =3D "muls.aa.hh", .translate =3D translate_mac16, .par =3D (const uint32_t[]){MAC16_MULS, MAC16_AA, MAC16_HH, 0}, + .windowed_register_op =3D 0x3, }, { .name =3D "muls.aa.hl", .translate =3D translate_mac16, .par =3D (const uint32_t[]){MAC16_MULS, MAC16_AA, MAC16_HL, 0}, + .windowed_register_op =3D 0x3, }, { .name =3D "muls.aa.lh", .translate =3D translate_mac16, .par =3D (const uint32_t[]){MAC16_MULS, MAC16_AA, MAC16_LH, 0}, + .windowed_register_op =3D 0x3, }, { .name =3D "muls.aa.ll", .translate =3D translate_mac16, .par =3D (const uint32_t[]){MAC16_MULS, MAC16_AA, MAC16_LL, 0}, + .windowed_register_op =3D 0x3, }, { .name =3D "muls.ad.hh", .translate =3D translate_mac16, .par =3D (const uint32_t[]){MAC16_MULS, MAC16_AD, MAC16_HH, 0}, + .windowed_register_op =3D 0x1, }, { .name =3D "muls.ad.hl", .translate =3D translate_mac16, .par =3D (const uint32_t[]){MAC16_MULS, MAC16_AD, MAC16_HL, 0}, + .windowed_register_op =3D 0x1, }, { .name =3D "muls.ad.lh", .translate =3D translate_mac16, .par =3D (const uint32_t[]){MAC16_MULS, MAC16_AD, MAC16_LH, 0}, + .windowed_register_op =3D 0x1, }, { .name =3D "muls.ad.ll", .translate =3D translate_mac16, .par =3D (const uint32_t[]){MAC16_MULS, MAC16_AD, MAC16_LL, 0}, + .windowed_register_op =3D 0x1, }, { .name =3D "muls.da.hh", .translate =3D translate_mac16, .par =3D (const uint32_t[]){MAC16_MULS, MAC16_DA, MAC16_HH, 0}, + .windowed_register_op =3D 0x2, }, { .name =3D "muls.da.hl", .translate =3D translate_mac16, .par =3D (const uint32_t[]){MAC16_MULS, MAC16_DA, MAC16_HL, 0}, + .windowed_register_op =3D 0x2, }, { .name =3D "muls.da.lh", .translate =3D translate_mac16, .par =3D (const uint32_t[]){MAC16_MULS, MAC16_DA, MAC16_LH, 0}, + .windowed_register_op =3D 0x2, }, { .name =3D "muls.da.ll", .translate =3D translate_mac16, .par =3D (const uint32_t[]){MAC16_MULS, MAC16_DA, MAC16_LL, 0}, + .windowed_register_op =3D 0x2, }, { .name =3D "muls.dd.hh", .translate =3D translate_mac16, @@ -3398,13 +3386,16 @@ static const XtensaOpcodeOps core_ops[] =3D { .name =3D "mulsh", .translate =3D translate_mulh, .par =3D (const uint32_t[]){true}, + .windowed_register_op =3D 0x7, }, { .name =3D "muluh", .translate =3D translate_mulh, .par =3D (const uint32_t[]){false}, + .windowed_register_op =3D 0x7, }, { .name =3D "neg", .translate =3D translate_neg, + .windowed_register_op =3D 0x3, }, { .name =3D "nop", .translate =3D translate_nop, @@ -3414,12 +3405,15 @@ static const XtensaOpcodeOps core_ops[] =3D { }, { .name =3D "nsa", .translate =3D translate_nsa, + .windowed_register_op =3D 0x3, }, { .name =3D "nsau", .translate =3D translate_nsau, + .windowed_register_op =3D 0x3, }, { .name =3D "or", .translate =3D translate_or, + .windowed_register_op =3D 0x7, }, { .name =3D "orb", .translate =3D translate_boolean, @@ -3433,44 +3427,54 @@ static const XtensaOpcodeOps core_ops[] =3D { .translate =3D translate_ptlb, .par =3D (const uint32_t[]){true}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x3, }, { .name =3D "pitlb", .translate =3D translate_ptlb, .par =3D (const uint32_t[]){false}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x3, }, { .name =3D "quos", .translate =3D translate_quos, .par =3D (const uint32_t[]){true}, + .windowed_register_op =3D 0x7, }, { .name =3D "quou", .translate =3D translate_quou, .par =3D (const uint32_t[]){true}, + .windowed_register_op =3D 0x7, }, { .name =3D "rdtlb0", .translate =3D translate_rtlb, .par =3D (const uint32_t[]){true, 0}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x3, }, { .name =3D "rdtlb1", .translate =3D translate_rtlb, .par =3D (const uint32_t[]){true, 1}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x3, }, { .name =3D "read_impwire", .translate =3D translate_read_impwire, + .windowed_register_op =3D 0x1, }, { .name =3D "rems", .translate =3D translate_quos, .par =3D (const uint32_t[]){false}, + .windowed_register_op =3D 0x7, }, { .name =3D "remu", .translate =3D translate_quou, .par =3D (const uint32_t[]){false}, + .windowed_register_op =3D 0x7, }, { .name =3D "rer", .translate =3D translate_rer, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x3, }, { .name =3D "ret", .translate =3D translate_ret, @@ -3518,11 +3522,13 @@ static const XtensaOpcodeOps core_ops[] =3D { .translate =3D translate_rtlb, .par =3D (const uint32_t[]){false, 0}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x3, }, { .name =3D "ritlb1", .translate =3D translate_rtlb, .par =3D (const uint32_t[]){false, 1}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x3, }, { .name =3D "rotw", .translate =3D translate_rotw, @@ -3531,449 +3537,526 @@ static const XtensaOpcodeOps core_ops[] =3D { .name =3D "rsil", .translate =3D translate_rsil, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "rsr.176", .translate =3D translate_rsr, .test_ill =3D test_ill_rsr, .par =3D (const uint32_t[]){176}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "rsr.208", .translate =3D translate_rsr, .test_ill =3D test_ill_rsr, .par =3D (const uint32_t[]){208}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "rsr.acchi", .translate =3D translate_rsr, .test_ill =3D test_ill_rsr, .par =3D (const uint32_t[]){ACCHI}, + .windowed_register_op =3D 0x1, }, { .name =3D "rsr.acclo", .translate =3D translate_rsr, .test_ill =3D test_ill_rsr, .par =3D (const uint32_t[]){ACCLO}, + .windowed_register_op =3D 0x1, }, { .name =3D "rsr.atomctl", .translate =3D translate_rsr, .test_ill =3D test_ill_rsr, .par =3D (const uint32_t[]){ATOMCTL}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "rsr.br", .translate =3D translate_rsr, .test_ill =3D test_ill_rsr, .par =3D (const uint32_t[]){BR}, + .windowed_register_op =3D 0x1, }, { .name =3D "rsr.cacheattr", .translate =3D translate_rsr, .test_ill =3D test_ill_rsr, .par =3D (const uint32_t[]){CACHEATTR}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "rsr.ccompare0", .translate =3D translate_rsr, .test_ill =3D test_ill_rsr, .par =3D (const uint32_t[]){CCOMPARE}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "rsr.ccompare1", .translate =3D translate_rsr, .test_ill =3D test_ill_rsr, .par =3D (const uint32_t[]){CCOMPARE + 1}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "rsr.ccompare2", .translate =3D translate_rsr, .test_ill =3D test_ill_rsr, .par =3D (const uint32_t[]){CCOMPARE + 2}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "rsr.ccount", .translate =3D translate_rsr, .test_ill =3D test_ill_rsr, .par =3D (const uint32_t[]){CCOUNT}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "rsr.configid0", .translate =3D translate_rsr, .test_ill =3D test_ill_rsr, .par =3D (const uint32_t[]){CONFIGID0}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "rsr.configid1", .translate =3D translate_rsr, .test_ill =3D test_ill_rsr, .par =3D (const uint32_t[]){CONFIGID1}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "rsr.cpenable", .translate =3D translate_rsr, .test_ill =3D test_ill_rsr, .par =3D (const uint32_t[]){CPENABLE}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "rsr.dbreaka0", .translate =3D translate_rsr, .test_ill =3D test_ill_rsr, .par =3D (const uint32_t[]){DBREAKA}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "rsr.dbreaka1", .translate =3D translate_rsr, .test_ill =3D test_ill_rsr, .par =3D (const uint32_t[]){DBREAKA + 1}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "rsr.dbreakc0", .translate =3D translate_rsr, .test_ill =3D test_ill_rsr, .par =3D (const uint32_t[]){DBREAKC}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "rsr.dbreakc1", .translate =3D translate_rsr, .test_ill =3D test_ill_rsr, .par =3D (const uint32_t[]){DBREAKC + 1}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "rsr.ddr", .translate =3D translate_rsr, .test_ill =3D test_ill_rsr, .par =3D (const uint32_t[]){DDR}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "rsr.debugcause", .translate =3D translate_rsr, .test_ill =3D test_ill_rsr, .par =3D (const uint32_t[]){DEBUGCAUSE}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "rsr.depc", .translate =3D translate_rsr, .test_ill =3D test_ill_rsr, .par =3D (const uint32_t[]){DEPC}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "rsr.dtlbcfg", .translate =3D translate_rsr, .test_ill =3D test_ill_rsr, .par =3D (const uint32_t[]){DTLBCFG}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "rsr.epc1", .translate =3D translate_rsr, .test_ill =3D test_ill_rsr, .par =3D (const uint32_t[]){EPC1}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "rsr.epc2", .translate =3D translate_rsr, .test_ill =3D test_ill_rsr, .par =3D (const uint32_t[]){EPC1 + 1}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "rsr.epc3", .translate =3D translate_rsr, .test_ill =3D test_ill_rsr, .par =3D (const uint32_t[]){EPC1 + 2}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "rsr.epc4", .translate =3D translate_rsr, .test_ill =3D test_ill_rsr, .par =3D (const uint32_t[]){EPC1 + 3}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "rsr.epc5", .translate =3D translate_rsr, .test_ill =3D test_ill_rsr, .par =3D (const uint32_t[]){EPC1 + 4}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "rsr.epc6", .translate =3D translate_rsr, .test_ill =3D test_ill_rsr, .par =3D (const uint32_t[]){EPC1 + 5}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "rsr.epc7", .translate =3D translate_rsr, .test_ill =3D test_ill_rsr, .par =3D (const uint32_t[]){EPC1 + 6}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "rsr.eps2", .translate =3D translate_rsr, .test_ill =3D test_ill_rsr, .par =3D (const uint32_t[]){EPS2}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "rsr.eps3", .translate =3D translate_rsr, .test_ill =3D test_ill_rsr, .par =3D (const uint32_t[]){EPS2 + 1}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "rsr.eps4", .translate =3D translate_rsr, .test_ill =3D test_ill_rsr, .par =3D (const uint32_t[]){EPS2 + 2}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "rsr.eps5", .translate =3D translate_rsr, .test_ill =3D test_ill_rsr, .par =3D (const uint32_t[]){EPS2 + 3}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "rsr.eps6", .translate =3D translate_rsr, .test_ill =3D test_ill_rsr, .par =3D (const uint32_t[]){EPS2 + 4}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "rsr.eps7", .translate =3D translate_rsr, .test_ill =3D test_ill_rsr, .par =3D (const uint32_t[]){EPS2 + 5}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "rsr.exccause", .translate =3D translate_rsr, .test_ill =3D test_ill_rsr, .par =3D (const uint32_t[]){EXCCAUSE}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "rsr.excsave1", .translate =3D translate_rsr, .test_ill =3D test_ill_rsr, .par =3D (const uint32_t[]){EXCSAVE1}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "rsr.excsave2", .translate =3D translate_rsr, .test_ill =3D test_ill_rsr, .par =3D (const uint32_t[]){EXCSAVE1 + 1}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "rsr.excsave3", .translate =3D translate_rsr, .test_ill =3D test_ill_rsr, .par =3D (const uint32_t[]){EXCSAVE1 + 2}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "rsr.excsave4", .translate =3D translate_rsr, .test_ill =3D test_ill_rsr, .par =3D (const uint32_t[]){EXCSAVE1 + 3}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "rsr.excsave5", .translate =3D translate_rsr, .test_ill =3D test_ill_rsr, .par =3D (const uint32_t[]){EXCSAVE1 + 4}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "rsr.excsave6", .translate =3D translate_rsr, .test_ill =3D test_ill_rsr, .par =3D (const uint32_t[]){EXCSAVE1 + 5}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "rsr.excsave7", .translate =3D translate_rsr, .test_ill =3D test_ill_rsr, .par =3D (const uint32_t[]){EXCSAVE1 + 6}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "rsr.excvaddr", .translate =3D translate_rsr, .test_ill =3D test_ill_rsr, .par =3D (const uint32_t[]){EXCVADDR}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "rsr.ibreaka0", .translate =3D translate_rsr, .test_ill =3D test_ill_rsr, .par =3D (const uint32_t[]){IBREAKA}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "rsr.ibreaka1", .translate =3D translate_rsr, .test_ill =3D test_ill_rsr, .par =3D (const uint32_t[]){IBREAKA + 1}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "rsr.ibreakenable", .translate =3D translate_rsr, .test_ill =3D test_ill_rsr, .par =3D (const uint32_t[]){IBREAKENABLE}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "rsr.icount", .translate =3D translate_rsr, .test_ill =3D test_ill_rsr, .par =3D (const uint32_t[]){ICOUNT}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "rsr.icountlevel", .translate =3D translate_rsr, .test_ill =3D test_ill_rsr, .par =3D (const uint32_t[]){ICOUNTLEVEL}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "rsr.intclear", .translate =3D translate_rsr, .test_ill =3D test_ill_rsr, .par =3D (const uint32_t[]){INTCLEAR}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "rsr.intenable", .translate =3D translate_rsr, .test_ill =3D test_ill_rsr, .par =3D (const uint32_t[]){INTENABLE}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "rsr.interrupt", .translate =3D translate_rsr, .test_ill =3D test_ill_rsr, .par =3D (const uint32_t[]){INTSET}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "rsr.intset", .translate =3D translate_rsr, .test_ill =3D test_ill_rsr, .par =3D (const uint32_t[]){INTSET}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "rsr.itlbcfg", .translate =3D translate_rsr, .test_ill =3D test_ill_rsr, .par =3D (const uint32_t[]){ITLBCFG}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "rsr.lbeg", .translate =3D translate_rsr, .test_ill =3D test_ill_rsr, .par =3D (const uint32_t[]){LBEG}, + .windowed_register_op =3D 0x1, }, { .name =3D "rsr.lcount", .translate =3D translate_rsr, .test_ill =3D test_ill_rsr, .par =3D (const uint32_t[]){LCOUNT}, + .windowed_register_op =3D 0x1, }, { .name =3D "rsr.lend", .translate =3D translate_rsr, .test_ill =3D test_ill_rsr, .par =3D (const uint32_t[]){LEND}, + .windowed_register_op =3D 0x1, }, { .name =3D "rsr.litbase", .translate =3D translate_rsr, .test_ill =3D test_ill_rsr, .par =3D (const uint32_t[]){LITBASE}, + .windowed_register_op =3D 0x1, }, { .name =3D "rsr.m0", .translate =3D translate_rsr, .test_ill =3D test_ill_rsr, .par =3D (const uint32_t[]){MR}, + .windowed_register_op =3D 0x1, }, { .name =3D "rsr.m1", .translate =3D translate_rsr, .test_ill =3D test_ill_rsr, .par =3D (const uint32_t[]){MR + 1}, + .windowed_register_op =3D 0x1, }, { .name =3D "rsr.m2", .translate =3D translate_rsr, .test_ill =3D test_ill_rsr, .par =3D (const uint32_t[]){MR + 2}, + .windowed_register_op =3D 0x1, }, { .name =3D "rsr.m3", .translate =3D translate_rsr, .test_ill =3D test_ill_rsr, .par =3D (const uint32_t[]){MR + 3}, + .windowed_register_op =3D 0x1, }, { .name =3D "rsr.memctl", .translate =3D translate_rsr, .test_ill =3D test_ill_rsr, .par =3D (const uint32_t[]){MEMCTL}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "rsr.misc0", .translate =3D translate_rsr, .test_ill =3D test_ill_rsr, .par =3D (const uint32_t[]){MISC}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "rsr.misc1", .translate =3D translate_rsr, .test_ill =3D test_ill_rsr, .par =3D (const uint32_t[]){MISC + 1}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "rsr.misc2", .translate =3D translate_rsr, .test_ill =3D test_ill_rsr, .par =3D (const uint32_t[]){MISC + 2}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "rsr.misc3", .translate =3D translate_rsr, .test_ill =3D test_ill_rsr, .par =3D (const uint32_t[]){MISC + 3}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "rsr.prid", .translate =3D translate_rsr, .test_ill =3D test_ill_rsr, .par =3D (const uint32_t[]){PRID}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "rsr.ps", .translate =3D translate_rsr, .test_ill =3D test_ill_rsr, .par =3D (const uint32_t[]){PS}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "rsr.ptevaddr", .translate =3D translate_rsr, .test_ill =3D test_ill_rsr, .par =3D (const uint32_t[]){PTEVADDR}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "rsr.rasid", .translate =3D translate_rsr, .test_ill =3D test_ill_rsr, .par =3D (const uint32_t[]){RASID}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "rsr.sar", .translate =3D translate_rsr, .test_ill =3D test_ill_rsr, .par =3D (const uint32_t[]){SAR}, + .windowed_register_op =3D 0x1, }, { .name =3D "rsr.scompare1", .translate =3D translate_rsr, .test_ill =3D test_ill_rsr, .par =3D (const uint32_t[]){SCOMPARE1}, + .windowed_register_op =3D 0x1, }, { .name =3D "rsr.vecbase", .translate =3D translate_rsr, .test_ill =3D test_ill_rsr, .par =3D (const uint32_t[]){VECBASE}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "rsr.windowbase", .translate =3D translate_rsr, .test_ill =3D test_ill_rsr, .par =3D (const uint32_t[]){WINDOW_BASE}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "rsr.windowstart", .translate =3D translate_rsr, .test_ill =3D test_ill_rsr, .par =3D (const uint32_t[]){WINDOW_START}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "rsync", .translate =3D translate_nop, @@ -3981,63 +4064,78 @@ static const XtensaOpcodeOps core_ops[] =3D { .name =3D "rur.expstate", .translate =3D translate_rur, .par =3D (const uint32_t[]){EXPSTATE}, + .windowed_register_op =3D 0x1, }, { .name =3D "rur.fcr", .translate =3D translate_rur, .par =3D (const uint32_t[]){FCR}, + .windowed_register_op =3D 0x1, }, { .name =3D "rur.fsr", .translate =3D translate_rur, .par =3D (const uint32_t[]){FSR}, + .windowed_register_op =3D 0x1, }, { .name =3D "rur.threadptr", .translate =3D translate_rur, .par =3D (const uint32_t[]){THREADPTR}, + .windowed_register_op =3D 0x1, }, { .name =3D "s16i", .translate =3D translate_ldst, .par =3D (const uint32_t[]){MO_TEUW, false, true}, + .windowed_register_op =3D 0x3, }, { .name =3D "s32c1i", .translate =3D translate_s32c1i, + .windowed_register_op =3D 0x3, }, { .name =3D "s32e", .translate =3D translate_s32e, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x3, }, { .name =3D "s32i", .translate =3D translate_ldst, .par =3D (const uint32_t[]){MO_TEUL, false, true}, + .windowed_register_op =3D 0x3, }, { .name =3D "s32i.n", .translate =3D translate_ldst, .par =3D (const uint32_t[]){MO_TEUL, false, true}, + .windowed_register_op =3D 0x3, }, { .name =3D "s32nb", .translate =3D translate_ldst, .par =3D (const uint32_t[]){MO_TEUL, false, true}, + .windowed_register_op =3D 0x3, }, { .name =3D "s32ri", .translate =3D translate_ldst, .par =3D (const uint32_t[]){MO_TEUL, true, true}, + .windowed_register_op =3D 0x3, }, { .name =3D "s8i", .translate =3D translate_ldst, .par =3D (const uint32_t[]){MO_UB, false, true}, + .windowed_register_op =3D 0x3, }, { .name =3D "salt", .translate =3D translate_salt, .par =3D (const uint32_t[]){TCG_COND_LT}, + .windowed_register_op =3D 0x7, }, { .name =3D "saltu", .translate =3D translate_salt, .par =3D (const uint32_t[]){TCG_COND_LTU}, + .windowed_register_op =3D 0x7, }, { .name =3D "setb_expstate", .translate =3D translate_setb_expstate, }, { .name =3D "sext", .translate =3D translate_sext, + .windowed_register_op =3D 0x3, }, { .name =3D "simcall", .translate =3D translate_simcall, @@ -4046,54 +4144,69 @@ static const XtensaOpcodeOps core_ops[] =3D { }, { .name =3D "sll", .translate =3D translate_sll, + .windowed_register_op =3D 0x3, }, { .name =3D "slli", .translate =3D translate_slli, + .windowed_register_op =3D 0x3, }, { .name =3D "sra", .translate =3D translate_sra, + .windowed_register_op =3D 0x3, }, { .name =3D "srai", .translate =3D translate_srai, + .windowed_register_op =3D 0x3, }, { .name =3D "src", .translate =3D translate_src, + .windowed_register_op =3D 0x7, }, { .name =3D "srl", .translate =3D translate_srl, + .windowed_register_op =3D 0x3, }, { .name =3D "srli", .translate =3D translate_srli, + .windowed_register_op =3D 0x3, }, { .name =3D "ssa8b", .translate =3D translate_ssa8b, + .windowed_register_op =3D 0x1, }, { .name =3D "ssa8l", .translate =3D translate_ssa8l, + .windowed_register_op =3D 0x1, }, { .name =3D "ssai", .translate =3D translate_ssai, }, { .name =3D "ssl", .translate =3D translate_ssl, + .windowed_register_op =3D 0x1, }, { .name =3D "ssr", .translate =3D translate_ssr, + .windowed_register_op =3D 0x1, }, { .name =3D "sub", .translate =3D translate_sub, + .windowed_register_op =3D 0x7, }, { .name =3D "subx2", .translate =3D translate_subx, .par =3D (const uint32_t[]){1}, + .windowed_register_op =3D 0x7, }, { .name =3D "subx4", .translate =3D translate_subx, .par =3D (const uint32_t[]){2}, + .windowed_register_op =3D 0x7, }, { .name =3D "subx8", .translate =3D translate_subx, .par =3D (const uint32_t[]){3}, + .windowed_register_op =3D 0x7, }, { .name =3D "syscall", .op_flags =3D XTENSA_OP_SYSCALL, @@ -4101,18 +4214,22 @@ static const XtensaOpcodeOps core_ops[] =3D { .name =3D "umul.aa.hh", .translate =3D translate_mac16, .par =3D (const uint32_t[]){MAC16_UMUL, MAC16_AA, MAC16_HH, 0}, + .windowed_register_op =3D 0x3, }, { .name =3D "umul.aa.hl", .translate =3D translate_mac16, .par =3D (const uint32_t[]){MAC16_UMUL, MAC16_AA, MAC16_HL, 0}, + .windowed_register_op =3D 0x3, }, { .name =3D "umul.aa.lh", .translate =3D translate_mac16, .par =3D (const uint32_t[]){MAC16_UMUL, MAC16_AA, MAC16_LH, 0}, + .windowed_register_op =3D 0x3, }, { .name =3D "umul.aa.ll", .translate =3D translate_mac16, .par =3D (const uint32_t[]){MAC16_UMUL, MAC16_AA, MAC16_LL, 0}, + .windowed_register_op =3D 0x3, }, { .name =3D "waiti", .translate =3D translate_waiti, @@ -4122,486 +4239,572 @@ static const XtensaOpcodeOps core_ops[] =3D { .translate =3D translate_wtlb, .par =3D (const uint32_t[]){true}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x3, }, { .name =3D "wer", .translate =3D translate_wer, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x3, }, { .name =3D "witlb", .translate =3D translate_wtlb, .par =3D (const uint32_t[]){false}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x3, }, { .name =3D "wrmsk_expstate", .translate =3D translate_wrmsk_expstate, + .windowed_register_op =3D 0x3, }, { .name =3D "wsr.176", .translate =3D translate_wsr, .test_ill =3D test_ill_wsr, .par =3D (const uint32_t[]){176}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "wsr.208", .translate =3D translate_wsr, .test_ill =3D test_ill_wsr, .par =3D (const uint32_t[]){208}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "wsr.acchi", .translate =3D translate_wsr, .test_ill =3D test_ill_wsr, .par =3D (const uint32_t[]){ACCHI}, + .windowed_register_op =3D 0x1, }, { .name =3D "wsr.acclo", .translate =3D translate_wsr, .test_ill =3D test_ill_wsr, .par =3D (const uint32_t[]){ACCLO}, + .windowed_register_op =3D 0x1, }, { .name =3D "wsr.atomctl", .translate =3D translate_wsr, .test_ill =3D test_ill_wsr, .par =3D (const uint32_t[]){ATOMCTL}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "wsr.br", .translate =3D translate_wsr, .test_ill =3D test_ill_wsr, .par =3D (const uint32_t[]){BR}, + .windowed_register_op =3D 0x1, }, { .name =3D "wsr.cacheattr", .translate =3D translate_wsr, .test_ill =3D test_ill_wsr, .par =3D (const uint32_t[]){CACHEATTR}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "wsr.ccompare0", .translate =3D translate_wsr, .test_ill =3D test_ill_wsr, .par =3D (const uint32_t[]){CCOMPARE}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "wsr.ccompare1", .translate =3D translate_wsr, .test_ill =3D test_ill_wsr, .par =3D (const uint32_t[]){CCOMPARE + 1}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "wsr.ccompare2", .translate =3D translate_wsr, .test_ill =3D test_ill_wsr, .par =3D (const uint32_t[]){CCOMPARE + 2}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "wsr.ccount", .translate =3D translate_wsr, .test_ill =3D test_ill_wsr, .par =3D (const uint32_t[]){CCOUNT}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "wsr.configid0", .translate =3D translate_wsr, .test_ill =3D test_ill_wsr, .par =3D (const uint32_t[]){CONFIGID0}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "wsr.configid1", .translate =3D translate_wsr, .test_ill =3D test_ill_wsr, .par =3D (const uint32_t[]){CONFIGID1}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "wsr.cpenable", .translate =3D translate_wsr, .test_ill =3D test_ill_wsr, .par =3D (const uint32_t[]){CPENABLE}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "wsr.dbreaka0", .translate =3D translate_wsr, .test_ill =3D test_ill_wsr, .par =3D (const uint32_t[]){DBREAKA}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "wsr.dbreaka1", .translate =3D translate_wsr, .test_ill =3D test_ill_wsr, .par =3D (const uint32_t[]){DBREAKA + 1}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "wsr.dbreakc0", .translate =3D translate_wsr, .test_ill =3D test_ill_wsr, .par =3D (const uint32_t[]){DBREAKC}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "wsr.dbreakc1", .translate =3D translate_wsr, .test_ill =3D test_ill_wsr, .par =3D (const uint32_t[]){DBREAKC + 1}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "wsr.ddr", .translate =3D translate_wsr, .test_ill =3D test_ill_wsr, .par =3D (const uint32_t[]){DDR}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "wsr.debugcause", .translate =3D translate_wsr, .test_ill =3D test_ill_wsr, .par =3D (const uint32_t[]){DEBUGCAUSE}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "wsr.depc", .translate =3D translate_wsr, .test_ill =3D test_ill_wsr, .par =3D (const uint32_t[]){DEPC}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "wsr.dtlbcfg", .translate =3D translate_wsr, .test_ill =3D test_ill_wsr, .par =3D (const uint32_t[]){DTLBCFG}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "wsr.epc1", .translate =3D translate_wsr, .test_ill =3D test_ill_wsr, .par =3D (const uint32_t[]){EPC1}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "wsr.epc2", .translate =3D translate_wsr, .test_ill =3D test_ill_wsr, .par =3D (const uint32_t[]){EPC1 + 1}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "wsr.epc3", .translate =3D translate_wsr, .test_ill =3D test_ill_wsr, .par =3D (const uint32_t[]){EPC1 + 2}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "wsr.epc4", .translate =3D translate_wsr, .test_ill =3D test_ill_wsr, .par =3D (const uint32_t[]){EPC1 + 3}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "wsr.epc5", .translate =3D translate_wsr, .test_ill =3D test_ill_wsr, .par =3D (const uint32_t[]){EPC1 + 4}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "wsr.epc6", .translate =3D translate_wsr, .test_ill =3D test_ill_wsr, .par =3D (const uint32_t[]){EPC1 + 5}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "wsr.epc7", .translate =3D translate_wsr, .test_ill =3D test_ill_wsr, .par =3D (const uint32_t[]){EPC1 + 6}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "wsr.eps2", .translate =3D translate_wsr, .test_ill =3D test_ill_wsr, .par =3D (const uint32_t[]){EPS2}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "wsr.eps3", .translate =3D translate_wsr, .test_ill =3D test_ill_wsr, .par =3D (const uint32_t[]){EPS2 + 1}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "wsr.eps4", .translate =3D translate_wsr, .test_ill =3D test_ill_wsr, .par =3D (const uint32_t[]){EPS2 + 2}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "wsr.eps5", .translate =3D translate_wsr, .test_ill =3D test_ill_wsr, .par =3D (const uint32_t[]){EPS2 + 3}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "wsr.eps6", .translate =3D translate_wsr, .test_ill =3D test_ill_wsr, .par =3D (const uint32_t[]){EPS2 + 4}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "wsr.eps7", .translate =3D translate_wsr, .test_ill =3D test_ill_wsr, .par =3D (const uint32_t[]){EPS2 + 5}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "wsr.exccause", .translate =3D translate_wsr, .test_ill =3D test_ill_wsr, .par =3D (const uint32_t[]){EXCCAUSE}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "wsr.excsave1", .translate =3D translate_wsr, .test_ill =3D test_ill_wsr, .par =3D (const uint32_t[]){EXCSAVE1}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "wsr.excsave2", .translate =3D translate_wsr, .test_ill =3D test_ill_wsr, .par =3D (const uint32_t[]){EXCSAVE1 + 1}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "wsr.excsave3", .translate =3D translate_wsr, .test_ill =3D test_ill_wsr, .par =3D (const uint32_t[]){EXCSAVE1 + 2}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "wsr.excsave4", .translate =3D translate_wsr, .test_ill =3D test_ill_wsr, .par =3D (const uint32_t[]){EXCSAVE1 + 3}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "wsr.excsave5", .translate =3D translate_wsr, .test_ill =3D test_ill_wsr, .par =3D (const uint32_t[]){EXCSAVE1 + 4}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "wsr.excsave6", .translate =3D translate_wsr, .test_ill =3D test_ill_wsr, .par =3D (const uint32_t[]){EXCSAVE1 + 5}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "wsr.excsave7", .translate =3D translate_wsr, .test_ill =3D test_ill_wsr, .par =3D (const uint32_t[]){EXCSAVE1 + 6}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "wsr.excvaddr", .translate =3D translate_wsr, .test_ill =3D test_ill_wsr, .par =3D (const uint32_t[]){EXCVADDR}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "wsr.ibreaka0", .translate =3D translate_wsr, .test_ill =3D test_ill_wsr, .par =3D (const uint32_t[]){IBREAKA}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "wsr.ibreaka1", .translate =3D translate_wsr, .test_ill =3D test_ill_wsr, .par =3D (const uint32_t[]){IBREAKA + 1}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "wsr.ibreakenable", .translate =3D translate_wsr, .test_ill =3D test_ill_wsr, .par =3D (const uint32_t[]){IBREAKENABLE}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "wsr.icount", .translate =3D translate_wsr, .test_ill =3D test_ill_wsr, .par =3D (const uint32_t[]){ICOUNT}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "wsr.icountlevel", .translate =3D translate_wsr, .test_ill =3D test_ill_wsr, .par =3D (const uint32_t[]){ICOUNTLEVEL}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "wsr.intclear", .translate =3D translate_wsr, .test_ill =3D test_ill_wsr, .par =3D (const uint32_t[]){INTCLEAR}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "wsr.intenable", .translate =3D translate_wsr, .test_ill =3D test_ill_wsr, .par =3D (const uint32_t[]){INTENABLE}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "wsr.interrupt", .translate =3D translate_wsr, .test_ill =3D test_ill_wsr, .par =3D (const uint32_t[]){INTSET}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "wsr.intset", .translate =3D translate_wsr, .test_ill =3D test_ill_wsr, .par =3D (const uint32_t[]){INTSET}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "wsr.itlbcfg", .translate =3D translate_wsr, .test_ill =3D test_ill_wsr, .par =3D (const uint32_t[]){ITLBCFG}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "wsr.lbeg", .translate =3D translate_wsr, .test_ill =3D test_ill_wsr, .par =3D (const uint32_t[]){LBEG}, + .windowed_register_op =3D 0x1, }, { .name =3D "wsr.lcount", .translate =3D translate_wsr, .test_ill =3D test_ill_wsr, .par =3D (const uint32_t[]){LCOUNT}, + .windowed_register_op =3D 0x1, }, { .name =3D "wsr.lend", .translate =3D translate_wsr, .test_ill =3D test_ill_wsr, .par =3D (const uint32_t[]){LEND}, + .windowed_register_op =3D 0x1, }, { .name =3D "wsr.litbase", .translate =3D translate_wsr, .test_ill =3D test_ill_wsr, .par =3D (const uint32_t[]){LITBASE}, + .windowed_register_op =3D 0x1, }, { .name =3D "wsr.m0", .translate =3D translate_wsr, .test_ill =3D test_ill_wsr, .par =3D (const uint32_t[]){MR}, + .windowed_register_op =3D 0x1, }, { .name =3D "wsr.m1", .translate =3D translate_wsr, .test_ill =3D test_ill_wsr, .par =3D (const uint32_t[]){MR + 1}, + .windowed_register_op =3D 0x1, }, { .name =3D "wsr.m2", .translate =3D translate_wsr, .test_ill =3D test_ill_wsr, .par =3D (const uint32_t[]){MR + 2}, + .windowed_register_op =3D 0x1, }, { .name =3D "wsr.m3", .translate =3D translate_wsr, .test_ill =3D test_ill_wsr, .par =3D (const uint32_t[]){MR + 3}, + .windowed_register_op =3D 0x1, }, { .name =3D "wsr.memctl", .translate =3D translate_wsr, .test_ill =3D test_ill_wsr, .par =3D (const uint32_t[]){MEMCTL}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "wsr.misc0", .translate =3D translate_wsr, .test_ill =3D test_ill_wsr, .par =3D (const uint32_t[]){MISC}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "wsr.misc1", .translate =3D translate_wsr, .test_ill =3D test_ill_wsr, .par =3D (const uint32_t[]){MISC + 1}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "wsr.misc2", .translate =3D translate_wsr, .test_ill =3D test_ill_wsr, .par =3D (const uint32_t[]){MISC + 2}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "wsr.misc3", .translate =3D translate_wsr, .test_ill =3D test_ill_wsr, .par =3D (const uint32_t[]){MISC + 3}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "wsr.mmid", .translate =3D translate_wsr, .test_ill =3D test_ill_wsr, .par =3D (const uint32_t[]){MMID}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "wsr.prid", .translate =3D translate_wsr, .test_ill =3D test_ill_wsr, .par =3D (const uint32_t[]){PRID}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "wsr.ps", .translate =3D translate_wsr, .test_ill =3D test_ill_wsr, .par =3D (const uint32_t[]){PS}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "wsr.ptevaddr", .translate =3D translate_wsr, .test_ill =3D test_ill_wsr, .par =3D (const uint32_t[]){PTEVADDR}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "wsr.rasid", .translate =3D translate_wsr, .test_ill =3D test_ill_wsr, .par =3D (const uint32_t[]){RASID}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "wsr.sar", .translate =3D translate_wsr, .test_ill =3D test_ill_wsr, .par =3D (const uint32_t[]){SAR}, + .windowed_register_op =3D 0x1, }, { .name =3D "wsr.scompare1", .translate =3D translate_wsr, .test_ill =3D test_ill_wsr, .par =3D (const uint32_t[]){SCOMPARE1}, + .windowed_register_op =3D 0x1, }, { .name =3D "wsr.vecbase", .translate =3D translate_wsr, .test_ill =3D test_ill_wsr, .par =3D (const uint32_t[]){VECBASE}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "wsr.windowbase", .translate =3D translate_wsr, .test_ill =3D test_ill_wsr, .par =3D (const uint32_t[]){WINDOW_BASE}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "wsr.windowstart", .translate =3D translate_wsr, .test_ill =3D test_ill_wsr, .par =3D (const uint32_t[]){WINDOW_START}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "wur.expstate", .translate =3D translate_wur, .par =3D (const uint32_t[]){EXPSTATE}, + .windowed_register_op =3D 0x1, }, { .name =3D "wur.fcr", .translate =3D translate_wur, .par =3D (const uint32_t[]){FCR}, + .windowed_register_op =3D 0x1, }, { .name =3D "wur.fsr", .translate =3D translate_wur, .par =3D (const uint32_t[]){FSR}, + .windowed_register_op =3D 0x1, }, { .name =3D "wur.threadptr", .translate =3D translate_wur, .par =3D (const uint32_t[]){THREADPTR}, + .windowed_register_op =3D 0x1, }, { .name =3D "xor", .translate =3D translate_xor, + .windowed_register_op =3D 0x7, }, { .name =3D "xorb", .translate =3D translate_boolean, @@ -4612,443 +4815,519 @@ static const XtensaOpcodeOps core_ops[] =3D { .test_ill =3D test_ill_xsr, .par =3D (const uint32_t[]){176}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "xsr.208", .translate =3D translate_xsr, .test_ill =3D test_ill_xsr, .par =3D (const uint32_t[]){208}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "xsr.acchi", .translate =3D translate_xsr, .test_ill =3D test_ill_xsr, .par =3D (const uint32_t[]){ACCHI}, + .windowed_register_op =3D 0x1, }, { .name =3D "xsr.acclo", .translate =3D translate_xsr, .test_ill =3D test_ill_xsr, .par =3D (const uint32_t[]){ACCLO}, + .windowed_register_op =3D 0x1, }, { .name =3D "xsr.atomctl", .translate =3D translate_xsr, .test_ill =3D test_ill_xsr, .par =3D (const uint32_t[]){ATOMCTL}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "xsr.br", .translate =3D translate_xsr, .test_ill =3D test_ill_xsr, .par =3D (const uint32_t[]){BR}, + .windowed_register_op =3D 0x1, }, { .name =3D "xsr.cacheattr", .translate =3D translate_xsr, .test_ill =3D test_ill_xsr, .par =3D (const uint32_t[]){CACHEATTR}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "xsr.ccompare0", .translate =3D translate_xsr, .test_ill =3D test_ill_xsr, .par =3D (const uint32_t[]){CCOMPARE}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "xsr.ccompare1", .translate =3D translate_xsr, .test_ill =3D test_ill_xsr, .par =3D (const uint32_t[]){CCOMPARE + 1}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "xsr.ccompare2", .translate =3D translate_xsr, .test_ill =3D test_ill_xsr, .par =3D (const uint32_t[]){CCOMPARE + 2}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "xsr.ccount", .translate =3D translate_xsr, .test_ill =3D test_ill_xsr, .par =3D (const uint32_t[]){CCOUNT}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "xsr.configid0", .translate =3D translate_xsr, .test_ill =3D test_ill_xsr, .par =3D (const uint32_t[]){CONFIGID0}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "xsr.configid1", .translate =3D translate_xsr, .test_ill =3D test_ill_xsr, .par =3D (const uint32_t[]){CONFIGID1}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "xsr.cpenable", .translate =3D translate_xsr, .test_ill =3D test_ill_xsr, .par =3D (const uint32_t[]){CPENABLE}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "xsr.dbreaka0", .translate =3D translate_xsr, .test_ill =3D test_ill_xsr, .par =3D (const uint32_t[]){DBREAKA}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "xsr.dbreaka1", .translate =3D translate_xsr, .test_ill =3D test_ill_xsr, .par =3D (const uint32_t[]){DBREAKA + 1}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "xsr.dbreakc0", .translate =3D translate_xsr, .test_ill =3D test_ill_xsr, .par =3D (const uint32_t[]){DBREAKC}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "xsr.dbreakc1", .translate =3D translate_xsr, .test_ill =3D test_ill_xsr, .par =3D (const uint32_t[]){DBREAKC + 1}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "xsr.ddr", .translate =3D translate_xsr, .test_ill =3D test_ill_xsr, .par =3D (const uint32_t[]){DDR}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "xsr.debugcause", .translate =3D translate_xsr, .test_ill =3D test_ill_xsr, .par =3D (const uint32_t[]){DEBUGCAUSE}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "xsr.depc", .translate =3D translate_xsr, .test_ill =3D test_ill_xsr, .par =3D (const uint32_t[]){DEPC}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "xsr.dtlbcfg", .translate =3D translate_xsr, .test_ill =3D test_ill_xsr, .par =3D (const uint32_t[]){DTLBCFG}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "xsr.epc1", .translate =3D translate_xsr, .test_ill =3D test_ill_xsr, .par =3D (const uint32_t[]){EPC1}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "xsr.epc2", .translate =3D translate_xsr, .test_ill =3D test_ill_xsr, .par =3D (const uint32_t[]){EPC1 + 1}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "xsr.epc3", .translate =3D translate_xsr, .test_ill =3D test_ill_xsr, .par =3D (const uint32_t[]){EPC1 + 2}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "xsr.epc4", .translate =3D translate_xsr, .test_ill =3D test_ill_xsr, .par =3D (const uint32_t[]){EPC1 + 3}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "xsr.epc5", .translate =3D translate_xsr, .test_ill =3D test_ill_xsr, .par =3D (const uint32_t[]){EPC1 + 4}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "xsr.epc6", .translate =3D translate_xsr, .test_ill =3D test_ill_xsr, .par =3D (const uint32_t[]){EPC1 + 5}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "xsr.epc7", .translate =3D translate_xsr, .test_ill =3D test_ill_xsr, .par =3D (const uint32_t[]){EPC1 + 6}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "xsr.eps2", .translate =3D translate_xsr, .test_ill =3D test_ill_xsr, .par =3D (const uint32_t[]){EPS2}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "xsr.eps3", .translate =3D translate_xsr, .test_ill =3D test_ill_xsr, .par =3D (const uint32_t[]){EPS2 + 1}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "xsr.eps4", .translate =3D translate_xsr, .test_ill =3D test_ill_xsr, .par =3D (const uint32_t[]){EPS2 + 2}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "xsr.eps5", .translate =3D translate_xsr, .test_ill =3D test_ill_xsr, .par =3D (const uint32_t[]){EPS2 + 3}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "xsr.eps6", .translate =3D translate_xsr, .test_ill =3D test_ill_xsr, .par =3D (const uint32_t[]){EPS2 + 4}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "xsr.eps7", .translate =3D translate_xsr, .test_ill =3D test_ill_xsr, .par =3D (const uint32_t[]){EPS2 + 5}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "xsr.exccause", .translate =3D translate_xsr, .test_ill =3D test_ill_xsr, .par =3D (const uint32_t[]){EXCCAUSE}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "xsr.excsave1", .translate =3D translate_xsr, .test_ill =3D test_ill_xsr, .par =3D (const uint32_t[]){EXCSAVE1}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "xsr.excsave2", .translate =3D translate_xsr, .test_ill =3D test_ill_xsr, .par =3D (const uint32_t[]){EXCSAVE1 + 1}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "xsr.excsave3", .translate =3D translate_xsr, .test_ill =3D test_ill_xsr, .par =3D (const uint32_t[]){EXCSAVE1 + 2}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "xsr.excsave4", .translate =3D translate_xsr, .test_ill =3D test_ill_xsr, .par =3D (const uint32_t[]){EXCSAVE1 + 3}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "xsr.excsave5", .translate =3D translate_xsr, .test_ill =3D test_ill_xsr, .par =3D (const uint32_t[]){EXCSAVE1 + 4}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "xsr.excsave6", .translate =3D translate_xsr, .test_ill =3D test_ill_xsr, .par =3D (const uint32_t[]){EXCSAVE1 + 5}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "xsr.excsave7", .translate =3D translate_xsr, .test_ill =3D test_ill_xsr, .par =3D (const uint32_t[]){EXCSAVE1 + 6}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "xsr.excvaddr", .translate =3D translate_xsr, .test_ill =3D test_ill_xsr, .par =3D (const uint32_t[]){EXCVADDR}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "xsr.ibreaka0", .translate =3D translate_xsr, .test_ill =3D test_ill_xsr, .par =3D (const uint32_t[]){IBREAKA}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "xsr.ibreaka1", .translate =3D translate_xsr, .test_ill =3D test_ill_xsr, .par =3D (const uint32_t[]){IBREAKA + 1}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "xsr.ibreakenable", .translate =3D translate_xsr, .test_ill =3D test_ill_xsr, .par =3D (const uint32_t[]){IBREAKENABLE}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "xsr.icount", .translate =3D translate_xsr, .test_ill =3D test_ill_xsr, .par =3D (const uint32_t[]){ICOUNT}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "xsr.icountlevel", .translate =3D translate_xsr, .test_ill =3D test_ill_xsr, .par =3D (const uint32_t[]){ICOUNTLEVEL}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "xsr.intclear", .translate =3D translate_xsr, .test_ill =3D test_ill_xsr, .par =3D (const uint32_t[]){INTCLEAR}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "xsr.intenable", .translate =3D translate_xsr, .test_ill =3D test_ill_xsr, .par =3D (const uint32_t[]){INTENABLE}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "xsr.interrupt", .translate =3D translate_xsr, .test_ill =3D test_ill_xsr, .par =3D (const uint32_t[]){INTSET}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "xsr.intset", .translate =3D translate_xsr, .test_ill =3D test_ill_xsr, .par =3D (const uint32_t[]){INTSET}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "xsr.itlbcfg", .translate =3D translate_xsr, .test_ill =3D test_ill_xsr, .par =3D (const uint32_t[]){ITLBCFG}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "xsr.lbeg", .translate =3D translate_xsr, .test_ill =3D test_ill_xsr, .par =3D (const uint32_t[]){LBEG}, + .windowed_register_op =3D 0x1, }, { .name =3D "xsr.lcount", .translate =3D translate_xsr, .test_ill =3D test_ill_xsr, .par =3D (const uint32_t[]){LCOUNT}, + .windowed_register_op =3D 0x1, }, { .name =3D "xsr.lend", .translate =3D translate_xsr, .test_ill =3D test_ill_xsr, .par =3D (const uint32_t[]){LEND}, + .windowed_register_op =3D 0x1, }, { .name =3D "xsr.litbase", .translate =3D translate_xsr, .test_ill =3D test_ill_xsr, .par =3D (const uint32_t[]){LITBASE}, + .windowed_register_op =3D 0x1, }, { .name =3D "xsr.m0", .translate =3D translate_xsr, .test_ill =3D test_ill_xsr, .par =3D (const uint32_t[]){MR}, + .windowed_register_op =3D 0x1, }, { .name =3D "xsr.m1", .translate =3D translate_xsr, .test_ill =3D test_ill_xsr, .par =3D (const uint32_t[]){MR + 1}, + .windowed_register_op =3D 0x1, }, { .name =3D "xsr.m2", .translate =3D translate_xsr, .test_ill =3D test_ill_xsr, .par =3D (const uint32_t[]){MR + 2}, + .windowed_register_op =3D 0x1, }, { .name =3D "xsr.m3", .translate =3D translate_xsr, .test_ill =3D test_ill_xsr, .par =3D (const uint32_t[]){MR + 3}, + .windowed_register_op =3D 0x1, }, { .name =3D "xsr.memctl", .translate =3D translate_xsr, .test_ill =3D test_ill_xsr, .par =3D (const uint32_t[]){MEMCTL}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "xsr.misc0", .translate =3D translate_xsr, .test_ill =3D test_ill_xsr, .par =3D (const uint32_t[]){MISC}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "xsr.misc1", .translate =3D translate_xsr, .test_ill =3D test_ill_xsr, .par =3D (const uint32_t[]){MISC + 1}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "xsr.misc2", .translate =3D translate_xsr, .test_ill =3D test_ill_xsr, .par =3D (const uint32_t[]){MISC + 2}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "xsr.misc3", .translate =3D translate_xsr, .test_ill =3D test_ill_xsr, .par =3D (const uint32_t[]){MISC + 3}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "xsr.prid", .translate =3D translate_xsr, .test_ill =3D test_ill_xsr, .par =3D (const uint32_t[]){PRID}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "xsr.ps", .translate =3D translate_xsr, .test_ill =3D test_ill_xsr, .par =3D (const uint32_t[]){PS}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "xsr.ptevaddr", .translate =3D translate_xsr, .test_ill =3D test_ill_xsr, .par =3D (const uint32_t[]){PTEVADDR}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "xsr.rasid", .translate =3D translate_xsr, .test_ill =3D test_ill_xsr, .par =3D (const uint32_t[]){RASID}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "xsr.sar", .translate =3D translate_xsr, .test_ill =3D test_ill_xsr, .par =3D (const uint32_t[]){SAR}, + .windowed_register_op =3D 0x1, }, { .name =3D "xsr.scompare1", .translate =3D translate_xsr, .test_ill =3D test_ill_xsr, .par =3D (const uint32_t[]){SCOMPARE1}, + .windowed_register_op =3D 0x1, }, { .name =3D "xsr.vecbase", .translate =3D translate_xsr, .test_ill =3D test_ill_xsr, .par =3D (const uint32_t[]){VECBASE}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "xsr.windowbase", .translate =3D translate_xsr, .test_ill =3D test_ill_xsr, .par =3D (const uint32_t[]){WINDOW_BASE}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, { .name =3D "xsr.windowstart", .translate =3D translate_xsr, .test_ill =3D test_ill_xsr, .par =3D (const uint32_t[]){WINDOW_START}, .op_flags =3D XTENSA_OP_PRIVILEGED, + .windowed_register_op =3D 0x1, }, }; =20 @@ -5110,7 +5389,7 @@ static void translate_compare_s(DisasContext *dc, con= st uint32_t arg[], static void translate_float_s(DisasContext *dc, const uint32_t arg[], const uint32_t par[]) { - if (gen_window_check1(dc, arg[1]) && gen_check_cpenable(dc, 0)) { + if (gen_check_cpenable(dc, 0)) { TCGv_i32 scale =3D tcg_const_i32(-arg[2]); =20 if (par[0]) { @@ -5125,7 +5404,7 @@ static void translate_float_s(DisasContext *dc, const= uint32_t arg[], static void translate_ftoi_s(DisasContext *dc, const uint32_t arg[], const uint32_t par[]) { - if (gen_window_check1(dc, arg[0]) && gen_check_cpenable(dc, 0)) { + if (gen_check_cpenable(dc, 0)) { TCGv_i32 rounding_mode =3D tcg_const_i32(par[0]); TCGv_i32 scale =3D tcg_const_i32(arg[2]); =20 @@ -5144,7 +5423,7 @@ static void translate_ftoi_s(DisasContext *dc, const = uint32_t arg[], static void translate_ldsti(DisasContext *dc, const uint32_t arg[], const uint32_t par[]) { - if (gen_window_check1(dc, arg[1]) && gen_check_cpenable(dc, 0)) { + if (gen_check_cpenable(dc, 0)) { TCGv_i32 addr =3D tcg_temp_new_i32(); =20 tcg_gen_addi_i32(addr, cpu_R[arg[1]], arg[2]); @@ -5164,7 +5443,7 @@ static void translate_ldsti(DisasContext *dc, const u= int32_t arg[], static void translate_ldstx(DisasContext *dc, const uint32_t arg[], const uint32_t par[]) { - if (gen_window_check2(dc, arg[1], arg[2]) && gen_check_cpenable(dc, 0)= ) { + if (gen_check_cpenable(dc, 0)) { TCGv_i32 addr =3D tcg_temp_new_i32(); =20 tcg_gen_add_i32(addr, cpu_R[arg[1]], cpu_R[arg[2]]); @@ -5201,7 +5480,7 @@ static void translate_mov_s(DisasContext *dc, const u= int32_t arg[], static void translate_movcond_s(DisasContext *dc, const uint32_t arg[], const uint32_t par[]) { - if (gen_window_check1(dc, arg[2]) && gen_check_cpenable(dc, 0)) { + if (gen_check_cpenable(dc, 0)) { TCGv_i32 zero =3D tcg_const_i32(0); =20 tcg_gen_movcond_i32(par[0], cpu_FR[arg[0]], @@ -5256,8 +5535,7 @@ static void translate_neg_s(DisasContext *dc, const u= int32_t arg[], static void translate_rfr_s(DisasContext *dc, const uint32_t arg[], const uint32_t par[]) { - if (gen_window_check1(dc, arg[0]) && - gen_check_cpenable(dc, 0)) { + if (gen_check_cpenable(dc, 0)) { tcg_gen_mov_i32(cpu_R[arg[0]], cpu_FR[arg[1]]); } } @@ -5274,8 +5552,7 @@ static void translate_sub_s(DisasContext *dc, const u= int32_t arg[], static void translate_wfr_s(DisasContext *dc, const uint32_t arg[], const uint32_t par[]) { - if (gen_window_check1(dc, arg[1]) && - gen_check_cpenable(dc, 0)) { + if (gen_check_cpenable(dc, 0)) { tcg_gen_mov_i32(cpu_FR[arg[0]], cpu_R[arg[1]]); } } @@ -5291,30 +5568,37 @@ static const XtensaOpcodeOps fpu2000_ops[] =3D { .name =3D "ceil.s", .translate =3D translate_ftoi_s, .par =3D (const uint32_t[]){float_round_up, false}, + .windowed_register_op =3D 0x1, }, { .name =3D "float.s", .translate =3D translate_float_s, .par =3D (const uint32_t[]){false}, + .windowed_register_op =3D 0x2, }, { .name =3D "floor.s", .translate =3D translate_ftoi_s, .par =3D (const uint32_t[]){float_round_down, false}, + .windowed_register_op =3D 0x1, }, { .name =3D "lsi", .translate =3D translate_ldsti, .par =3D (const uint32_t[]){false, false}, + .windowed_register_op =3D 0x2, }, { .name =3D "lsiu", .translate =3D translate_ldsti, .par =3D (const uint32_t[]){false, true}, + .windowed_register_op =3D 0x2, }, { .name =3D "lsx", .translate =3D translate_ldstx, .par =3D (const uint32_t[]){false, false}, + .windowed_register_op =3D 0x6, }, { .name =3D "lsxu", .translate =3D translate_ldstx, .par =3D (const uint32_t[]){false, true}, + .windowed_register_op =3D 0x6, }, { .name =3D "madd.s", .translate =3D translate_madd_s, @@ -5325,6 +5609,7 @@ static const XtensaOpcodeOps fpu2000_ops[] =3D { .name =3D "moveqz.s", .translate =3D translate_movcond_s, .par =3D (const uint32_t[]){TCG_COND_EQ}, + .windowed_register_op =3D 0x4, }, { .name =3D "movf.s", .translate =3D translate_movp_s, @@ -5333,14 +5618,17 @@ static const XtensaOpcodeOps fpu2000_ops[] =3D { .name =3D "movgez.s", .translate =3D translate_movcond_s, .par =3D (const uint32_t[]){TCG_COND_GE}, + .windowed_register_op =3D 0x4, }, { .name =3D "movltz.s", .translate =3D translate_movcond_s, .par =3D (const uint32_t[]){TCG_COND_LT}, + .windowed_register_op =3D 0x4, }, { .name =3D "movnez.s", .translate =3D translate_movcond_s, .par =3D (const uint32_t[]){TCG_COND_NE}, + .windowed_register_op =3D 0x4, }, { .name =3D "movt.s", .translate =3D translate_movp_s, @@ -5369,26 +5657,32 @@ static const XtensaOpcodeOps fpu2000_ops[] =3D { }, { .name =3D "rfr", .translate =3D translate_rfr_s, + .windowed_register_op =3D 0x1, }, { .name =3D "round.s", .translate =3D translate_ftoi_s, .par =3D (const uint32_t[]){float_round_nearest_even, false}, + .windowed_register_op =3D 0x1, }, { .name =3D "ssi", .translate =3D translate_ldsti, .par =3D (const uint32_t[]){true, false}, + .windowed_register_op =3D 0x2, }, { .name =3D "ssiu", .translate =3D translate_ldsti, .par =3D (const uint32_t[]){true, true}, + .windowed_register_op =3D 0x2, }, { .name =3D "ssx", .translate =3D translate_ldstx, .par =3D (const uint32_t[]){true, false}, + .windowed_register_op =3D 0x6, }, { .name =3D "ssxu", .translate =3D translate_ldstx, .par =3D (const uint32_t[]){true, true}, + .windowed_register_op =3D 0x6, }, { .name =3D "sub.s", .translate =3D translate_sub_s, @@ -5396,6 +5690,7 @@ static const XtensaOpcodeOps fpu2000_ops[] =3D { .name =3D "trunc.s", .translate =3D translate_ftoi_s, .par =3D (const uint32_t[]){float_round_to_zero, false}, + .windowed_register_op =3D 0x1, }, { .name =3D "ueq.s", .translate =3D translate_compare_s, @@ -5404,6 +5699,7 @@ static const XtensaOpcodeOps fpu2000_ops[] =3D { .name =3D "ufloat.s", .translate =3D translate_float_s, .par =3D (const uint32_t[]){true}, + .windowed_register_op =3D 0x2, }, { .name =3D "ule.s", .translate =3D translate_compare_s, @@ -5420,9 +5716,11 @@ static const XtensaOpcodeOps fpu2000_ops[] =3D { .name =3D "utrunc.s", .translate =3D translate_ftoi_s, .par =3D (const uint32_t[]){float_round_to_zero, true}, + .windowed_register_op =3D 0x1, }, { .name =3D "wfr", .translate =3D translate_wfr_s, + .windowed_register_op =3D 0x2, }, }; =20 --=20 2.11.0