2011-09-06 03:55:25 +04:00
|
|
|
/*
|
|
|
|
* Xtensa ISA:
|
|
|
|
* http://www.tensilica.com/products/literature-docs/documentation/xtensa-isa-databook.htm
|
|
|
|
*
|
|
|
|
* Copyright (c) 2011, Max Filippov, Open Source and Linux Lab.
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions are met:
|
|
|
|
* * Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
* * Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
|
|
|
* * Neither the name of the Open Source and Linux Lab nor the
|
|
|
|
* names of its contributors may be used to endorse or promote products
|
|
|
|
* derived from this software without specific prior written permission.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
|
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
|
|
|
|
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
|
|
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
|
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
|
|
|
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
|
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
*/
|
|
|
|
|
2016-01-26 21:17:21 +03:00
|
|
|
#include "qemu/osdep.h"
|
2011-09-06 03:55:25 +04:00
|
|
|
|
|
|
|
#include "cpu.h"
|
2012-12-17 21:19:49 +04:00
|
|
|
#include "exec/exec-all.h"
|
2012-10-24 13:12:21 +04:00
|
|
|
#include "disas/disas.h"
|
2020-01-01 14:23:00 +03:00
|
|
|
#include "tcg/tcg-op.h"
|
2012-12-17 21:20:00 +04:00
|
|
|
#include "qemu/log.h"
|
2019-04-17 22:18:02 +03:00
|
|
|
#include "qemu/qemu-print.h"
|
2014-03-28 22:42:10 +04:00
|
|
|
#include "exec/cpu_ldst.h"
|
2019-05-13 16:43:57 +03:00
|
|
|
#include "hw/semihosting/semihost.h"
|
2017-07-14 11:21:37 +03:00
|
|
|
#include "exec/translator.h"
|
2011-09-06 03:55:25 +04:00
|
|
|
|
2014-04-08 09:31:41 +04:00
|
|
|
#include "exec/helper-proto.h"
|
|
|
|
#include "exec/helper-gen.h"
|
2011-09-06 03:55:27 +04:00
|
|
|
|
2014-05-30 16:12:25 +04:00
|
|
|
#include "trace-tcg.h"
|
2016-01-07 16:55:28 +03:00
|
|
|
#include "exec/log.h"
|
2014-05-30 16:12:25 +04:00
|
|
|
|
|
|
|
|
2018-01-12 16:08:48 +03:00
|
|
|
struct DisasContext {
|
2018-05-12 20:57:22 +03:00
|
|
|
DisasContextBase base;
|
2011-09-06 03:55:27 +04:00
|
|
|
const XtensaConfig *config;
|
|
|
|
uint32_t pc;
|
2011-09-06 03:55:40 +04:00
|
|
|
int cring;
|
|
|
|
int ring;
|
2018-10-04 01:59:11 +03:00
|
|
|
uint32_t lbeg_off;
|
2011-09-06 03:55:44 +04:00
|
|
|
uint32_t lend;
|
2011-09-06 03:55:35 +04:00
|
|
|
|
|
|
|
bool sar_5bit;
|
|
|
|
bool sar_m32_5bit;
|
|
|
|
bool sar_m32_allocated;
|
|
|
|
TCGv_i32 sar_m32;
|
2011-09-06 03:55:48 +04:00
|
|
|
|
2014-10-30 18:07:47 +03:00
|
|
|
unsigned window;
|
2018-08-29 20:37:29 +03:00
|
|
|
unsigned callinc;
|
2018-08-28 07:43:43 +03:00
|
|
|
bool cwoe;
|
2012-01-13 09:21:32 +04:00
|
|
|
|
|
|
|
bool debug;
|
2012-01-15 05:40:50 +04:00
|
|
|
bool icount;
|
|
|
|
TCGv_i32 next_icount;
|
2012-09-19 04:23:59 +04:00
|
|
|
|
|
|
|
unsigned cpenable;
|
2017-11-04 04:29:27 +03:00
|
|
|
|
2019-01-31 01:48:22 +03:00
|
|
|
uint32_t op_flags;
|
2020-04-07 06:59:54 +03:00
|
|
|
xtensa_insnbuf_word insnbuf[MAX_INSNBUF_LENGTH];
|
|
|
|
xtensa_insnbuf_word slotbuf[MAX_INSNBUF_LENGTH];
|
2018-01-12 16:08:48 +03:00
|
|
|
};
|
2011-09-06 03:55:27 +04:00
|
|
|
|
|
|
|
static TCGv_i32 cpu_pc;
|
|
|
|
static TCGv_i32 cpu_R[16];
|
2012-09-19 04:23:54 +04:00
|
|
|
static TCGv_i32 cpu_FR[16];
|
2020-07-01 05:27:02 +03:00
|
|
|
static TCGv_i64 cpu_FRD[16];
|
2019-02-12 06:16:14 +03:00
|
|
|
static TCGv_i32 cpu_MR[4];
|
2019-02-15 00:27:50 +03:00
|
|
|
static TCGv_i32 cpu_BR[16];
|
|
|
|
static TCGv_i32 cpu_BR4[4];
|
|
|
|
static TCGv_i32 cpu_BR8[2];
|
2011-09-06 03:55:33 +04:00
|
|
|
static TCGv_i32 cpu_SR[256];
|
|
|
|
static TCGv_i32 cpu_UR[256];
|
2019-01-31 01:56:29 +03:00
|
|
|
static TCGv_i32 cpu_windowbase_next;
|
2019-04-19 02:37:00 +03:00
|
|
|
static TCGv_i32 cpu_exclusive_addr;
|
|
|
|
static TCGv_i32 cpu_exclusive_val;
|
2011-09-06 03:55:27 +04:00
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
static GHashTable *xtensa_regfile_table;
|
|
|
|
|
2012-12-17 21:19:49 +04:00
|
|
|
#include "exec/gen-icount.h"
|
2011-09-06 03:55:25 +04:00
|
|
|
|
2019-03-19 03:10:38 +03:00
|
|
|
static char *sr_name[256];
|
|
|
|
static char *ur_name[256];
|
2012-12-05 07:15:22 +04:00
|
|
|
|
2019-03-19 03:10:38 +03:00
|
|
|
void xtensa_collect_sr_names(const XtensaConfig *config)
|
|
|
|
{
|
|
|
|
xtensa_isa isa = config->isa;
|
|
|
|
int n = xtensa_isa_num_sysregs(isa);
|
|
|
|
int i;
|
2012-12-05 07:15:23 +04:00
|
|
|
|
2019-03-19 03:10:38 +03:00
|
|
|
for (i = 0; i < n; ++i) {
|
|
|
|
int sr = xtensa_sysreg_number(isa, i);
|
|
|
|
|
|
|
|
if (sr >= 0 && sr < 256) {
|
|
|
|
const char *name = xtensa_sysreg_name(isa, i);
|
|
|
|
char **pname =
|
|
|
|
(xtensa_sysreg_is_user(isa, i) ? ur_name : sr_name) + sr;
|
|
|
|
|
|
|
|
if (*pname) {
|
|
|
|
if (strstr(*pname, name) == NULL) {
|
|
|
|
char *new_name =
|
|
|
|
malloc(strlen(*pname) + strlen(name) + 2);
|
|
|
|
|
|
|
|
strcpy(new_name, *pname);
|
|
|
|
strcat(new_name, "/");
|
|
|
|
strcat(new_name, name);
|
|
|
|
free(*pname);
|
|
|
|
*pname = new_name;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
*pname = strdup(name);
|
|
|
|
}
|
|
|
|
}
|
2012-12-05 07:15:22 +04:00
|
|
|
}
|
2019-03-19 03:10:38 +03:00
|
|
|
}
|
2011-09-06 03:55:33 +04:00
|
|
|
|
2011-09-06 03:55:25 +04:00
|
|
|
void xtensa_translate_init(void)
|
|
|
|
{
|
2011-09-06 03:55:27 +04:00
|
|
|
static const char * const regnames[] = {
|
|
|
|
"ar0", "ar1", "ar2", "ar3",
|
|
|
|
"ar4", "ar5", "ar6", "ar7",
|
|
|
|
"ar8", "ar9", "ar10", "ar11",
|
|
|
|
"ar12", "ar13", "ar14", "ar15",
|
|
|
|
};
|
2012-09-19 04:23:54 +04:00
|
|
|
static const char * const fregnames[] = {
|
|
|
|
"f0", "f1", "f2", "f3",
|
|
|
|
"f4", "f5", "f6", "f7",
|
|
|
|
"f8", "f9", "f10", "f11",
|
|
|
|
"f12", "f13", "f14", "f15",
|
|
|
|
};
|
2019-02-12 06:16:14 +03:00
|
|
|
static const char * const mregnames[] = {
|
|
|
|
"m0", "m1", "m2", "m3",
|
|
|
|
};
|
2019-02-15 00:27:50 +03:00
|
|
|
static const char * const bregnames[] = {
|
|
|
|
"b0", "b1", "b2", "b3",
|
|
|
|
"b4", "b5", "b6", "b7",
|
|
|
|
"b8", "b9", "b10", "b11",
|
|
|
|
"b12", "b13", "b14", "b15",
|
|
|
|
};
|
2011-09-06 03:55:27 +04:00
|
|
|
int i;
|
|
|
|
|
2013-09-18 23:53:09 +04:00
|
|
|
cpu_pc = tcg_global_mem_new_i32(cpu_env,
|
2012-03-14 04:38:23 +04:00
|
|
|
offsetof(CPUXtensaState, pc), "pc");
|
2011-09-06 03:55:27 +04:00
|
|
|
|
|
|
|
for (i = 0; i < 16; i++) {
|
2013-09-18 23:53:09 +04:00
|
|
|
cpu_R[i] = tcg_global_mem_new_i32(cpu_env,
|
2019-02-12 06:16:14 +03:00
|
|
|
offsetof(CPUXtensaState, regs[i]),
|
|
|
|
regnames[i]);
|
2011-09-06 03:55:27 +04:00
|
|
|
}
|
2011-09-06 03:55:33 +04:00
|
|
|
|
2012-09-19 04:23:54 +04:00
|
|
|
for (i = 0; i < 16; i++) {
|
2013-09-18 23:53:09 +04:00
|
|
|
cpu_FR[i] = tcg_global_mem_new_i32(cpu_env,
|
2019-02-12 06:16:14 +03:00
|
|
|
offsetof(CPUXtensaState,
|
|
|
|
fregs[i].f32[FP_F32_LOW]),
|
|
|
|
fregnames[i]);
|
|
|
|
}
|
|
|
|
|
2020-07-01 05:27:02 +03:00
|
|
|
for (i = 0; i < 16; i++) {
|
|
|
|
cpu_FRD[i] = tcg_global_mem_new_i64(cpu_env,
|
|
|
|
offsetof(CPUXtensaState,
|
|
|
|
fregs[i].f64),
|
|
|
|
fregnames[i]);
|
|
|
|
}
|
|
|
|
|
2019-02-12 06:16:14 +03:00
|
|
|
for (i = 0; i < 4; i++) {
|
|
|
|
cpu_MR[i] = tcg_global_mem_new_i32(cpu_env,
|
|
|
|
offsetof(CPUXtensaState,
|
|
|
|
sregs[MR + i]),
|
|
|
|
mregnames[i]);
|
2012-09-19 04:23:54 +04:00
|
|
|
}
|
|
|
|
|
2019-02-15 00:27:50 +03:00
|
|
|
for (i = 0; i < 16; i++) {
|
|
|
|
cpu_BR[i] = tcg_global_mem_new_i32(cpu_env,
|
|
|
|
offsetof(CPUXtensaState,
|
|
|
|
sregs[BR]),
|
|
|
|
bregnames[i]);
|
|
|
|
if (i % 4 == 0) {
|
|
|
|
cpu_BR4[i / 4] = tcg_global_mem_new_i32(cpu_env,
|
|
|
|
offsetof(CPUXtensaState,
|
|
|
|
sregs[BR]),
|
|
|
|
bregnames[i]);
|
|
|
|
}
|
|
|
|
if (i % 8 == 0) {
|
|
|
|
cpu_BR8[i / 8] = tcg_global_mem_new_i32(cpu_env,
|
|
|
|
offsetof(CPUXtensaState,
|
|
|
|
sregs[BR]),
|
|
|
|
bregnames[i]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-09-06 03:55:33 +04:00
|
|
|
for (i = 0; i < 256; ++i) {
|
2019-03-19 03:10:38 +03:00
|
|
|
if (sr_name[i]) {
|
2013-09-18 23:53:09 +04:00
|
|
|
cpu_SR[i] = tcg_global_mem_new_i32(cpu_env,
|
2019-03-19 03:10:38 +03:00
|
|
|
offsetof(CPUXtensaState,
|
|
|
|
sregs[i]),
|
|
|
|
sr_name[i]);
|
2011-09-06 03:55:33 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
for (i = 0; i < 256; ++i) {
|
2019-03-19 03:10:38 +03:00
|
|
|
if (ur_name[i]) {
|
2013-09-18 23:53:09 +04:00
|
|
|
cpu_UR[i] = tcg_global_mem_new_i32(cpu_env,
|
2019-03-19 03:10:38 +03:00
|
|
|
offsetof(CPUXtensaState,
|
|
|
|
uregs[i]),
|
|
|
|
ur_name[i]);
|
2011-09-06 03:55:33 +04:00
|
|
|
}
|
|
|
|
}
|
2019-01-31 01:56:29 +03:00
|
|
|
|
|
|
|
cpu_windowbase_next =
|
|
|
|
tcg_global_mem_new_i32(cpu_env,
|
|
|
|
offsetof(CPUXtensaState, windowbase_next),
|
|
|
|
"windowbase_next");
|
2019-04-19 02:37:00 +03:00
|
|
|
cpu_exclusive_addr =
|
|
|
|
tcg_global_mem_new_i32(cpu_env,
|
|
|
|
offsetof(CPUXtensaState, exclusive_addr),
|
|
|
|
"exclusive_addr");
|
|
|
|
cpu_exclusive_val =
|
|
|
|
tcg_global_mem_new_i32(cpu_env,
|
|
|
|
offsetof(CPUXtensaState, exclusive_val),
|
|
|
|
"exclusive_val");
|
2011-09-06 03:55:27 +04:00
|
|
|
}
|
|
|
|
|
2020-06-28 12:53:32 +03:00
|
|
|
void **xtensa_get_regfile_by_name(const char *name, int entries, int bits)
|
2019-02-12 05:53:19 +03:00
|
|
|
{
|
2020-06-28 12:53:32 +03:00
|
|
|
char *geometry_name;
|
|
|
|
void **res;
|
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
if (xtensa_regfile_table == NULL) {
|
|
|
|
xtensa_regfile_table = g_hash_table_new(g_str_hash, g_str_equal);
|
2020-06-28 12:53:32 +03:00
|
|
|
/*
|
|
|
|
* AR is special. Xtensa translator uses it as a current register
|
|
|
|
* window, but configuration overlays represent it as a complete
|
|
|
|
* physical register file.
|
|
|
|
*/
|
2019-02-12 05:53:19 +03:00
|
|
|
g_hash_table_insert(xtensa_regfile_table,
|
2020-06-28 12:53:32 +03:00
|
|
|
(void *)"AR 16x32", (void *)cpu_R);
|
2019-02-12 06:16:14 +03:00
|
|
|
g_hash_table_insert(xtensa_regfile_table,
|
2020-06-28 12:53:32 +03:00
|
|
|
(void *)"AR 32x32", (void *)cpu_R);
|
2019-02-12 05:53:19 +03:00
|
|
|
g_hash_table_insert(xtensa_regfile_table,
|
2020-06-28 12:53:32 +03:00
|
|
|
(void *)"AR 64x32", (void *)cpu_R);
|
|
|
|
|
2019-02-15 00:27:50 +03:00
|
|
|
g_hash_table_insert(xtensa_regfile_table,
|
2020-06-28 12:53:32 +03:00
|
|
|
(void *)"MR 4x32", (void *)cpu_MR);
|
|
|
|
|
2019-02-15 00:27:50 +03:00
|
|
|
g_hash_table_insert(xtensa_regfile_table,
|
2020-06-28 12:53:32 +03:00
|
|
|
(void *)"FR 16x32", (void *)cpu_FR);
|
2020-07-01 05:27:02 +03:00
|
|
|
g_hash_table_insert(xtensa_regfile_table,
|
|
|
|
(void *)"FR 16x64", (void *)cpu_FRD);
|
2020-06-28 12:53:32 +03:00
|
|
|
|
2019-02-15 00:27:50 +03:00
|
|
|
g_hash_table_insert(xtensa_regfile_table,
|
2020-06-28 12:53:32 +03:00
|
|
|
(void *)"BR 16x1", (void *)cpu_BR);
|
|
|
|
g_hash_table_insert(xtensa_regfile_table,
|
|
|
|
(void *)"BR4 4x4", (void *)cpu_BR4);
|
|
|
|
g_hash_table_insert(xtensa_regfile_table,
|
|
|
|
(void *)"BR8 2x8", (void *)cpu_BR8);
|
2019-02-12 05:53:19 +03:00
|
|
|
}
|
2020-06-28 12:53:32 +03:00
|
|
|
|
|
|
|
geometry_name = g_strdup_printf("%s %dx%d", name, entries, bits);
|
|
|
|
res = (void **)g_hash_table_lookup(xtensa_regfile_table, geometry_name);
|
|
|
|
g_free(geometry_name);
|
|
|
|
return res;
|
2019-02-12 05:53:19 +03:00
|
|
|
}
|
|
|
|
|
2011-09-06 03:55:27 +04:00
|
|
|
static inline bool option_enabled(DisasContext *dc, int opt)
|
|
|
|
{
|
|
|
|
return xtensa_option_enabled(dc->config, opt);
|
|
|
|
}
|
|
|
|
|
2011-09-06 03:55:35 +04:00
|
|
|
static void init_sar_tracker(DisasContext *dc)
|
|
|
|
{
|
|
|
|
dc->sar_5bit = false;
|
|
|
|
dc->sar_m32_5bit = false;
|
|
|
|
dc->sar_m32_allocated = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void reset_sar_tracker(DisasContext *dc)
|
|
|
|
{
|
|
|
|
if (dc->sar_m32_allocated) {
|
|
|
|
tcg_temp_free(dc->sar_m32);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void gen_right_shift_sar(DisasContext *dc, TCGv_i32 sa)
|
|
|
|
{
|
|
|
|
tcg_gen_andi_i32(cpu_SR[SAR], sa, 0x1f);
|
|
|
|
if (dc->sar_m32_5bit) {
|
|
|
|
tcg_gen_discard_i32(dc->sar_m32);
|
|
|
|
}
|
|
|
|
dc->sar_5bit = true;
|
|
|
|
dc->sar_m32_5bit = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void gen_left_shift_sar(DisasContext *dc, TCGv_i32 sa)
|
|
|
|
{
|
|
|
|
TCGv_i32 tmp = tcg_const_i32(32);
|
|
|
|
if (!dc->sar_m32_allocated) {
|
|
|
|
dc->sar_m32 = tcg_temp_local_new_i32();
|
|
|
|
dc->sar_m32_allocated = true;
|
|
|
|
}
|
|
|
|
tcg_gen_andi_i32(dc->sar_m32, sa, 0x1f);
|
|
|
|
tcg_gen_sub_i32(cpu_SR[SAR], tmp, dc->sar_m32);
|
|
|
|
dc->sar_5bit = false;
|
|
|
|
dc->sar_m32_5bit = true;
|
|
|
|
tcg_temp_free(tmp);
|
|
|
|
}
|
|
|
|
|
2011-09-06 03:55:48 +04:00
|
|
|
static void gen_exception(DisasContext *dc, int excp)
|
2011-09-06 03:55:27 +04:00
|
|
|
{
|
|
|
|
TCGv_i32 tmp = tcg_const_i32(excp);
|
2012-06-10 11:33:12 +04:00
|
|
|
gen_helper_exception(cpu_env, tmp);
|
2011-09-06 03:55:27 +04:00
|
|
|
tcg_temp_free(tmp);
|
|
|
|
}
|
|
|
|
|
2011-09-06 03:55:41 +04:00
|
|
|
static void gen_exception_cause(DisasContext *dc, uint32_t cause)
|
|
|
|
{
|
|
|
|
TCGv_i32 tpc = tcg_const_i32(dc->pc);
|
|
|
|
TCGv_i32 tcause = tcg_const_i32(cause);
|
2012-06-10 11:33:12 +04:00
|
|
|
gen_helper_exception_cause(cpu_env, tpc, tcause);
|
2011-09-06 03:55:41 +04:00
|
|
|
tcg_temp_free(tpc);
|
|
|
|
tcg_temp_free(tcause);
|
2011-10-25 18:24:09 +04:00
|
|
|
if (cause == ILLEGAL_INSTRUCTION_CAUSE ||
|
|
|
|
cause == SYSCALL_CAUSE) {
|
2018-05-12 20:57:22 +03:00
|
|
|
dc->base.is_jmp = DISAS_NORETURN;
|
2011-10-25 18:24:09 +04:00
|
|
|
}
|
2011-09-06 03:55:41 +04:00
|
|
|
}
|
|
|
|
|
2011-09-06 03:55:46 +04:00
|
|
|
static void gen_exception_cause_vaddr(DisasContext *dc, uint32_t cause,
|
|
|
|
TCGv_i32 vaddr)
|
|
|
|
{
|
|
|
|
TCGv_i32 tpc = tcg_const_i32(dc->pc);
|
|
|
|
TCGv_i32 tcause = tcg_const_i32(cause);
|
2012-06-10 11:33:12 +04:00
|
|
|
gen_helper_exception_cause_vaddr(cpu_env, tpc, tcause, vaddr);
|
2011-09-06 03:55:46 +04:00
|
|
|
tcg_temp_free(tpc);
|
|
|
|
tcg_temp_free(tcause);
|
|
|
|
}
|
|
|
|
|
2012-01-13 09:21:32 +04:00
|
|
|
static void gen_debug_exception(DisasContext *dc, uint32_t cause)
|
|
|
|
{
|
|
|
|
TCGv_i32 tpc = tcg_const_i32(dc->pc);
|
|
|
|
TCGv_i32 tcause = tcg_const_i32(cause);
|
2012-06-10 11:33:12 +04:00
|
|
|
gen_helper_debug_exception(cpu_env, tpc, tcause);
|
2012-01-13 09:21:32 +04:00
|
|
|
tcg_temp_free(tpc);
|
|
|
|
tcg_temp_free(tcause);
|
|
|
|
if (cause & (DEBUGCAUSE_IB | DEBUGCAUSE_BI | DEBUGCAUSE_BN)) {
|
2018-05-12 20:57:22 +03:00
|
|
|
dc->base.is_jmp = DISAS_NORETURN;
|
2012-01-13 09:21:32 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-11-08 19:00:55 +03:00
|
|
|
static bool gen_check_privilege(DisasContext *dc)
|
2011-09-06 03:55:41 +04:00
|
|
|
{
|
2017-01-25 21:54:11 +03:00
|
|
|
#ifndef CONFIG_USER_ONLY
|
|
|
|
if (!dc->cring) {
|
|
|
|
return true;
|
2011-09-06 03:55:41 +04:00
|
|
|
}
|
2017-01-25 21:54:11 +03:00
|
|
|
#endif
|
|
|
|
gen_exception_cause(dc, PRIVILEGED_CAUSE);
|
2018-05-12 20:57:22 +03:00
|
|
|
dc->base.is_jmp = DISAS_NORETURN;
|
2017-01-25 21:54:11 +03:00
|
|
|
return false;
|
2011-09-06 03:55:41 +04:00
|
|
|
}
|
|
|
|
|
2018-08-31 23:57:08 +03:00
|
|
|
static bool gen_check_cpenable(DisasContext *dc, uint32_t cp_mask)
|
2012-09-19 04:23:59 +04:00
|
|
|
{
|
2018-08-31 23:57:08 +03:00
|
|
|
cp_mask &= ~dc->cpenable;
|
|
|
|
|
|
|
|
if (option_enabled(dc, XTENSA_OPTION_COPROCESSOR) && cp_mask) {
|
|
|
|
gen_exception_cause(dc, COPROCESSOR0_DISABLED + ctz32(cp_mask));
|
2018-05-12 20:57:22 +03:00
|
|
|
dc->base.is_jmp = DISAS_NORETURN;
|
2014-11-08 19:00:55 +03:00
|
|
|
return false;
|
2012-09-19 04:23:59 +04:00
|
|
|
}
|
2014-11-08 19:00:55 +03:00
|
|
|
return true;
|
2012-09-19 04:23:59 +04:00
|
|
|
}
|
|
|
|
|
2019-01-31 01:48:22 +03:00
|
|
|
static int gen_postprocess(DisasContext *dc, int slot);
|
|
|
|
|
2011-09-06 03:55:27 +04:00
|
|
|
static void gen_jump_slot(DisasContext *dc, TCGv dest, int slot)
|
|
|
|
{
|
|
|
|
tcg_gen_mov_i32(cpu_pc, dest);
|
2012-01-15 05:40:50 +04:00
|
|
|
if (dc->icount) {
|
|
|
|
tcg_gen_mov_i32(cpu_SR[ICOUNT], dc->next_icount);
|
|
|
|
}
|
2018-05-12 20:57:22 +03:00
|
|
|
if (dc->base.singlestep_enabled) {
|
2011-09-06 03:55:48 +04:00
|
|
|
gen_exception(dc, EXCP_DEBUG);
|
2011-09-06 03:55:27 +04:00
|
|
|
} else {
|
2019-01-31 01:48:22 +03:00
|
|
|
if (dc->op_flags & XTENSA_OP_POSTPROCESS) {
|
|
|
|
slot = gen_postprocess(dc, slot);
|
|
|
|
}
|
2011-09-06 03:55:27 +04:00
|
|
|
if (slot >= 0) {
|
|
|
|
tcg_gen_goto_tb(slot);
|
2018-05-12 20:57:22 +03:00
|
|
|
tcg_gen_exit_tb(dc->base.tb, slot);
|
2011-09-06 03:55:27 +04:00
|
|
|
} else {
|
2018-05-31 04:06:23 +03:00
|
|
|
tcg_gen_exit_tb(NULL, 0);
|
2011-09-06 03:55:27 +04:00
|
|
|
}
|
|
|
|
}
|
2018-05-12 20:57:22 +03:00
|
|
|
dc->base.is_jmp = DISAS_NORETURN;
|
2011-09-06 03:55:27 +04:00
|
|
|
}
|
|
|
|
|
2011-09-06 03:55:28 +04:00
|
|
|
static void gen_jump(DisasContext *dc, TCGv dest)
|
|
|
|
{
|
|
|
|
gen_jump_slot(dc, dest, -1);
|
|
|
|
}
|
|
|
|
|
2019-02-11 13:00:06 +03:00
|
|
|
static int adjust_jump_slot(DisasContext *dc, uint32_t dest, int slot)
|
2011-09-06 03:55:27 +04:00
|
|
|
{
|
2018-05-12 20:57:22 +03:00
|
|
|
if (((dc->base.pc_first ^ dest) & TARGET_PAGE_MASK) != 0) {
|
2019-02-11 13:00:06 +03:00
|
|
|
return -1;
|
|
|
|
} else {
|
|
|
|
return slot;
|
2011-09-06 03:55:27 +04:00
|
|
|
}
|
2019-02-11 13:00:06 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
static void gen_jumpi(DisasContext *dc, uint32_t dest, int slot)
|
|
|
|
{
|
|
|
|
TCGv_i32 tmp = tcg_const_i32(dest);
|
|
|
|
gen_jump_slot(dc, tmp, adjust_jump_slot(dc, dest, slot));
|
2011-09-06 03:55:27 +04:00
|
|
|
tcg_temp_free(tmp);
|
|
|
|
}
|
|
|
|
|
2011-09-06 03:55:43 +04:00
|
|
|
static void gen_callw_slot(DisasContext *dc, int callinc, TCGv_i32 dest,
|
|
|
|
int slot)
|
|
|
|
{
|
|
|
|
TCGv_i32 tcallinc = tcg_const_i32(callinc);
|
|
|
|
|
|
|
|
tcg_gen_deposit_i32(cpu_SR[PS], cpu_SR[PS],
|
|
|
|
tcallinc, PS_CALLINC_SHIFT, PS_CALLINC_LEN);
|
|
|
|
tcg_temp_free(tcallinc);
|
|
|
|
tcg_gen_movi_i32(cpu_R[callinc << 2],
|
2018-05-12 20:57:22 +03:00
|
|
|
(callinc << 30) | (dc->base.pc_next & 0x3fffffff));
|
2011-09-06 03:55:43 +04:00
|
|
|
gen_jump_slot(dc, dest, slot);
|
|
|
|
}
|
|
|
|
|
2011-09-06 03:55:44 +04:00
|
|
|
static bool gen_check_loop_end(DisasContext *dc, int slot)
|
|
|
|
{
|
2018-10-04 01:59:11 +03:00
|
|
|
if (dc->base.pc_next == dc->lend) {
|
2015-02-13 23:51:55 +03:00
|
|
|
TCGLabel *label = gen_new_label();
|
2011-09-06 03:55:44 +04:00
|
|
|
|
|
|
|
tcg_gen_brcondi_i32(TCG_COND_EQ, cpu_SR[LCOUNT], 0, label);
|
|
|
|
tcg_gen_subi_i32(cpu_SR[LCOUNT], cpu_SR[LCOUNT], 1);
|
2018-10-04 01:59:11 +03:00
|
|
|
if (dc->lbeg_off) {
|
|
|
|
gen_jumpi(dc, dc->base.pc_next - dc->lbeg_off, slot);
|
|
|
|
} else {
|
|
|
|
gen_jump(dc, cpu_SR[LBEG]);
|
|
|
|
}
|
2011-09-06 03:55:44 +04:00
|
|
|
gen_set_label(label);
|
2018-05-12 20:57:22 +03:00
|
|
|
gen_jumpi(dc, dc->base.pc_next, -1);
|
2011-09-06 03:55:44 +04:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void gen_jumpi_check_loop_end(DisasContext *dc, int slot)
|
|
|
|
{
|
|
|
|
if (!gen_check_loop_end(dc, slot)) {
|
2018-05-12 20:57:22 +03:00
|
|
|
gen_jumpi(dc, dc->base.pc_next, slot);
|
2011-09-06 03:55:44 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-09-06 03:55:31 +04:00
|
|
|
static void gen_brcond(DisasContext *dc, TCGCond cond,
|
2017-11-04 05:44:46 +03:00
|
|
|
TCGv_i32 t0, TCGv_i32 t1, uint32_t addr)
|
2011-09-06 03:55:31 +04:00
|
|
|
{
|
2015-02-13 23:51:55 +03:00
|
|
|
TCGLabel *label = gen_new_label();
|
2011-09-06 03:55:31 +04:00
|
|
|
|
|
|
|
tcg_gen_brcond_i32(cond, t0, t1, label);
|
2011-09-06 03:55:44 +04:00
|
|
|
gen_jumpi_check_loop_end(dc, 0);
|
2011-09-06 03:55:31 +04:00
|
|
|
gen_set_label(label);
|
2017-11-04 05:44:46 +03:00
|
|
|
gen_jumpi(dc, addr, 1);
|
2011-09-06 03:55:31 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
static void gen_brcondi(DisasContext *dc, TCGCond cond,
|
2017-11-04 05:44:46 +03:00
|
|
|
TCGv_i32 t0, uint32_t t1, uint32_t addr)
|
2011-09-06 03:55:31 +04:00
|
|
|
{
|
|
|
|
TCGv_i32 tmp = tcg_const_i32(t1);
|
2017-11-04 05:44:46 +03:00
|
|
|
gen_brcond(dc, cond, t0, tmp, addr);
|
2011-09-06 03:55:31 +04:00
|
|
|
tcg_temp_free(tmp);
|
|
|
|
}
|
|
|
|
|
2020-05-05 00:08:40 +03:00
|
|
|
static uint32_t test_exceptions_sr(DisasContext *dc, const OpcodeArg arg[],
|
|
|
|
const uint32_t par[])
|
2011-09-06 03:55:48 +04:00
|
|
|
{
|
2020-05-05 00:08:40 +03:00
|
|
|
return xtensa_option_enabled(dc->config, par[1]) ? 0 : XTENSA_OP_ILL;
|
2011-09-06 03:55:48 +04:00
|
|
|
}
|
|
|
|
|
2020-05-05 00:08:40 +03:00
|
|
|
static uint32_t test_exceptions_ccompare(DisasContext *dc,
|
|
|
|
const OpcodeArg arg[],
|
|
|
|
const uint32_t par[])
|
2011-09-06 03:55:48 +04:00
|
|
|
{
|
2019-03-19 03:10:38 +03:00
|
|
|
unsigned n = par[0] - CCOMPARE;
|
2011-09-06 03:55:48 +04:00
|
|
|
|
2020-05-05 00:08:40 +03:00
|
|
|
if (n >= dc->config->nccompare) {
|
|
|
|
return XTENSA_OP_ILL;
|
|
|
|
}
|
|
|
|
return test_exceptions_sr(dc, arg, par);
|
2011-09-06 03:55:48 +04:00
|
|
|
}
|
|
|
|
|
2020-05-05 00:08:40 +03:00
|
|
|
static uint32_t test_exceptions_dbreak(DisasContext *dc, const OpcodeArg arg[],
|
|
|
|
const uint32_t par[])
|
2011-09-06 03:55:40 +04:00
|
|
|
{
|
2019-03-19 03:10:38 +03:00
|
|
|
unsigned n = MAX_NDBREAK;
|
2011-09-06 03:55:40 +04:00
|
|
|
|
2019-03-19 03:10:38 +03:00
|
|
|
if (par[0] >= DBREAKA && par[0] < DBREAKA + MAX_NDBREAK) {
|
|
|
|
n = par[0] - DBREAKA;
|
2013-07-22 08:02:43 +04:00
|
|
|
}
|
2019-03-19 03:10:38 +03:00
|
|
|
if (par[0] >= DBREAKC && par[0] < DBREAKC + MAX_NDBREAK) {
|
|
|
|
n = par[0] - DBREAKC;
|
2013-07-22 08:02:43 +04:00
|
|
|
}
|
2020-05-05 00:08:40 +03:00
|
|
|
if (n >= dc->config->ndbreak) {
|
|
|
|
return XTENSA_OP_ILL;
|
|
|
|
}
|
|
|
|
return test_exceptions_sr(dc, arg, par);
|
2011-09-06 03:55:40 +04:00
|
|
|
}
|
|
|
|
|
2020-05-05 00:08:40 +03:00
|
|
|
static uint32_t test_exceptions_ibreak(DisasContext *dc, const OpcodeArg arg[],
|
|
|
|
const uint32_t par[])
|
2012-01-15 05:40:50 +04:00
|
|
|
{
|
2019-03-19 03:10:38 +03:00
|
|
|
unsigned n = par[0] - IBREAKA;
|
2012-01-15 05:40:50 +04:00
|
|
|
|
2020-05-05 00:08:40 +03:00
|
|
|
if (n >= dc->config->nibreak) {
|
|
|
|
return XTENSA_OP_ILL;
|
|
|
|
}
|
|
|
|
return test_exceptions_sr(dc, arg, par);
|
2012-01-15 05:40:50 +04:00
|
|
|
}
|
|
|
|
|
2020-05-05 00:08:40 +03:00
|
|
|
static uint32_t test_exceptions_hpi(DisasContext *dc, const OpcodeArg arg[],
|
|
|
|
const uint32_t par[])
|
2011-09-06 03:55:48 +04:00
|
|
|
{
|
2019-03-19 03:10:38 +03:00
|
|
|
unsigned n = MAX_NLEVEL + 1;
|
2013-09-04 04:57:49 +04:00
|
|
|
|
2019-03-19 03:10:38 +03:00
|
|
|
if (par[0] >= EXCSAVE1 && par[0] < EXCSAVE1 + MAX_NLEVEL) {
|
|
|
|
n = par[0] - EXCSAVE1 + 1;
|
2011-09-06 03:55:48 +04:00
|
|
|
}
|
2019-03-19 03:10:38 +03:00
|
|
|
if (par[0] >= EPC1 && par[0] < EPC1 + MAX_NLEVEL) {
|
|
|
|
n = par[0] - EPC1 + 1;
|
2011-09-06 03:55:34 +04:00
|
|
|
}
|
2019-03-19 03:10:38 +03:00
|
|
|
if (par[0] >= EPS2 && par[0] < EPS2 + MAX_NLEVEL - 1) {
|
|
|
|
n = par[0] - EPS2 + 2;
|
2012-09-19 04:23:54 +04:00
|
|
|
}
|
2020-05-05 00:08:40 +03:00
|
|
|
if (n > dc->config->nlevel) {
|
|
|
|
return XTENSA_OP_ILL;
|
|
|
|
}
|
|
|
|
return test_exceptions_sr(dc, arg, par);
|
2012-09-19 04:23:54 +04:00
|
|
|
}
|
|
|
|
|
2011-09-06 03:55:46 +04:00
|
|
|
static void gen_load_store_alignment(DisasContext *dc, int shift,
|
|
|
|
TCGv_i32 addr, bool no_hw_alignment)
|
|
|
|
{
|
|
|
|
if (!option_enabled(dc, XTENSA_OPTION_UNALIGNED_EXCEPTION)) {
|
|
|
|
tcg_gen_andi_i32(addr, addr, ~0 << shift);
|
|
|
|
} else if (option_enabled(dc, XTENSA_OPTION_HW_ALIGNMENT) &&
|
|
|
|
no_hw_alignment) {
|
2015-02-13 23:51:55 +03:00
|
|
|
TCGLabel *label = gen_new_label();
|
2011-09-06 03:55:46 +04:00
|
|
|
TCGv_i32 tmp = tcg_temp_new_i32();
|
|
|
|
tcg_gen_andi_i32(tmp, addr, ~(~0 << shift));
|
|
|
|
tcg_gen_brcondi_i32(TCG_COND_EQ, tmp, 0, label);
|
|
|
|
gen_exception_cause_vaddr(dc, LOAD_STORE_ALIGNMENT_CAUSE, addr);
|
|
|
|
gen_set_label(label);
|
|
|
|
tcg_temp_free(tmp);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-01-25 21:54:11 +03:00
|
|
|
#ifndef CONFIG_USER_ONLY
|
2011-09-06 03:55:48 +04:00
|
|
|
static void gen_waiti(DisasContext *dc, uint32_t imm4)
|
|
|
|
{
|
2018-05-12 20:57:22 +03:00
|
|
|
TCGv_i32 pc = tcg_const_i32(dc->base.pc_next);
|
2011-09-06 03:55:48 +04:00
|
|
|
TCGv_i32 intlevel = tcg_const_i32(imm4);
|
2013-07-22 08:02:43 +04:00
|
|
|
|
2018-05-12 20:57:22 +03:00
|
|
|
if (tb_cflags(dc->base.tb) & CF_USE_ICOUNT) {
|
2013-07-22 08:02:43 +04:00
|
|
|
gen_io_start();
|
|
|
|
}
|
2012-06-10 11:33:12 +04:00
|
|
|
gen_helper_waiti(cpu_env, pc, intlevel);
|
2011-09-06 03:55:48 +04:00
|
|
|
tcg_temp_free(pc);
|
|
|
|
tcg_temp_free(intlevel);
|
|
|
|
}
|
2017-01-25 21:54:11 +03:00
|
|
|
#endif
|
2011-09-06 03:55:48 +04:00
|
|
|
|
2018-08-29 20:37:29 +03:00
|
|
|
static bool gen_window_check(DisasContext *dc, uint32_t mask)
|
2011-09-06 03:55:49 +04:00
|
|
|
{
|
2018-08-29 20:37:29 +03:00
|
|
|
unsigned r = 31 - clz32(mask);
|
|
|
|
|
|
|
|
if (r / 4 > dc->window) {
|
2014-10-30 18:07:47 +03:00
|
|
|
TCGv_i32 pc = tcg_const_i32(dc->pc);
|
2018-08-29 20:37:29 +03:00
|
|
|
TCGv_i32 w = tcg_const_i32(r / 4);
|
2013-07-21 12:55:46 +04:00
|
|
|
|
2014-10-30 18:07:47 +03:00
|
|
|
gen_helper_window_check(cpu_env, pc, w);
|
2018-05-12 20:57:22 +03:00
|
|
|
dc->base.is_jmp = DISAS_NORETURN;
|
2014-11-08 19:00:55 +03:00
|
|
|
return false;
|
2011-09-06 03:55:49 +04:00
|
|
|
}
|
2014-11-08 19:00:55 +03:00
|
|
|
return true;
|
2011-09-06 03:55:49 +04:00
|
|
|
}
|
|
|
|
|
2011-10-10 06:25:40 +04:00
|
|
|
static TCGv_i32 gen_mac16_m(TCGv_i32 v, bool hi, bool is_unsigned)
|
|
|
|
{
|
|
|
|
TCGv_i32 m = tcg_temp_new_i32();
|
|
|
|
|
|
|
|
if (hi) {
|
|
|
|
(is_unsigned ? tcg_gen_shri_i32 : tcg_gen_sari_i32)(m, v, 16);
|
|
|
|
} else {
|
|
|
|
(is_unsigned ? tcg_gen_ext16u_i32 : tcg_gen_ext16s_i32)(m, v);
|
|
|
|
}
|
|
|
|
return m;
|
|
|
|
}
|
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
static void gen_zero_check(DisasContext *dc, const OpcodeArg arg[])
|
2018-09-01 07:26:54 +03:00
|
|
|
{
|
|
|
|
TCGLabel *label = gen_new_label();
|
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
tcg_gen_brcondi_i32(TCG_COND_NE, arg[2].in, 0, label);
|
2018-09-01 07:26:54 +03:00
|
|
|
gen_exception_cause(dc, INTEGER_DIVIDE_BY_ZERO_CAUSE);
|
|
|
|
gen_set_label(label);
|
|
|
|
}
|
|
|
|
|
2017-11-04 05:44:46 +03:00
|
|
|
static inline unsigned xtensa_op0_insn_len(DisasContext *dc, uint8_t op0)
|
2014-12-14 07:50:55 +03:00
|
|
|
{
|
2017-11-04 05:44:46 +03:00
|
|
|
return xtensa_isa_length_from_chars(dc->config->isa, &op0);
|
2014-12-14 07:50:55 +03:00
|
|
|
}
|
|
|
|
|
2019-01-31 01:48:22 +03:00
|
|
|
static int gen_postprocess(DisasContext *dc, int slot)
|
|
|
|
{
|
|
|
|
uint32_t op_flags = dc->op_flags;
|
|
|
|
|
2019-03-19 03:10:38 +03:00
|
|
|
#ifndef CONFIG_USER_ONLY
|
2019-01-31 01:48:22 +03:00
|
|
|
if (op_flags & XTENSA_OP_CHECK_INTERRUPTS) {
|
2019-03-19 03:10:38 +03:00
|
|
|
if (tb_cflags(dc->base.tb) & CF_USE_ICOUNT) {
|
|
|
|
gen_io_start();
|
|
|
|
}
|
|
|
|
gen_helper_check_interrupts(cpu_env);
|
2019-01-31 01:48:22 +03:00
|
|
|
}
|
2019-03-19 03:10:38 +03:00
|
|
|
#endif
|
2019-01-31 01:56:29 +03:00
|
|
|
if (op_flags & XTENSA_OP_SYNC_REGISTER_WINDOW) {
|
|
|
|
gen_helper_sync_windowbase(cpu_env);
|
|
|
|
}
|
2019-01-31 01:48:22 +03:00
|
|
|
if (op_flags & XTENSA_OP_EXIT_TB_M1) {
|
|
|
|
slot = -1;
|
|
|
|
}
|
|
|
|
return slot;
|
|
|
|
}
|
|
|
|
|
2019-02-13 06:10:24 +03:00
|
|
|
struct opcode_arg_copy {
|
|
|
|
uint32_t resource;
|
|
|
|
void *temp;
|
|
|
|
OpcodeArg *arg;
|
|
|
|
};
|
|
|
|
|
2019-01-30 06:21:10 +03:00
|
|
|
struct opcode_arg_info {
|
|
|
|
uint32_t resource;
|
|
|
|
int index;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct slot_prop {
|
|
|
|
XtensaOpcodeOps *ops;
|
2019-02-12 05:53:19 +03:00
|
|
|
OpcodeArg arg[MAX_OPCODE_ARGS];
|
2019-01-30 06:21:10 +03:00
|
|
|
struct opcode_arg_info in[MAX_OPCODE_ARGS];
|
|
|
|
struct opcode_arg_info out[MAX_OPCODE_ARGS];
|
|
|
|
unsigned n_in;
|
|
|
|
unsigned n_out;
|
|
|
|
uint32_t op_flags;
|
|
|
|
};
|
|
|
|
|
|
|
|
enum resource_type {
|
|
|
|
RES_REGFILE,
|
|
|
|
RES_STATE,
|
|
|
|
RES_MAX,
|
|
|
|
};
|
|
|
|
|
|
|
|
static uint32_t encode_resource(enum resource_type r, unsigned g, unsigned n)
|
|
|
|
{
|
|
|
|
assert(r < RES_MAX && g < 256 && n < 65536);
|
|
|
|
return (r << 24) | (g << 16) | n;
|
|
|
|
}
|
|
|
|
|
2019-02-13 06:10:24 +03:00
|
|
|
static enum resource_type get_resource_type(uint32_t resource)
|
|
|
|
{
|
|
|
|
return resource >> 24;
|
|
|
|
}
|
|
|
|
|
2019-01-30 06:21:10 +03:00
|
|
|
/*
|
|
|
|
* a depends on b if b must be executed before a,
|
|
|
|
* because a's side effects will destroy b's inputs.
|
|
|
|
*/
|
|
|
|
static bool op_depends_on(const struct slot_prop *a,
|
|
|
|
const struct slot_prop *b)
|
|
|
|
{
|
|
|
|
unsigned i = 0;
|
|
|
|
unsigned j = 0;
|
|
|
|
|
|
|
|
if (a->op_flags & XTENSA_OP_CONTROL_FLOW) {
|
|
|
|
return true;
|
|
|
|
}
|
2019-02-14 04:36:30 +03:00
|
|
|
if ((a->op_flags & XTENSA_OP_LOAD_STORE) <
|
|
|
|
(b->op_flags & XTENSA_OP_LOAD_STORE)) {
|
|
|
|
return true;
|
|
|
|
}
|
2019-01-30 06:21:10 +03:00
|
|
|
while (i < a->n_out && j < b->n_in) {
|
|
|
|
if (a->out[i].resource < b->in[j].resource) {
|
|
|
|
++i;
|
|
|
|
} else if (a->out[i].resource > b->in[j].resource) {
|
|
|
|
++j;
|
|
|
|
} else {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2019-02-13 06:10:24 +03:00
|
|
|
/*
|
|
|
|
* Try to break a dependency on b, append temporary register copy records
|
|
|
|
* to the end of copy and update n_copy in case of success.
|
|
|
|
* This is not always possible: e.g. control flow must always be the last,
|
|
|
|
* load/store must be first and state dependencies are not supported yet.
|
|
|
|
*/
|
|
|
|
static bool break_dependency(struct slot_prop *a,
|
|
|
|
struct slot_prop *b,
|
|
|
|
struct opcode_arg_copy *copy,
|
|
|
|
unsigned *n_copy)
|
|
|
|
{
|
|
|
|
unsigned i = 0;
|
|
|
|
unsigned j = 0;
|
|
|
|
unsigned n = *n_copy;
|
|
|
|
bool rv = false;
|
|
|
|
|
|
|
|
if (a->op_flags & XTENSA_OP_CONTROL_FLOW) {
|
|
|
|
return false;
|
|
|
|
}
|
2019-02-14 04:36:30 +03:00
|
|
|
if ((a->op_flags & XTENSA_OP_LOAD_STORE) <
|
|
|
|
(b->op_flags & XTENSA_OP_LOAD_STORE)) {
|
|
|
|
return false;
|
|
|
|
}
|
2019-02-13 06:10:24 +03:00
|
|
|
while (i < a->n_out && j < b->n_in) {
|
|
|
|
if (a->out[i].resource < b->in[j].resource) {
|
|
|
|
++i;
|
|
|
|
} else if (a->out[i].resource > b->in[j].resource) {
|
|
|
|
++j;
|
|
|
|
} else {
|
|
|
|
int index = b->in[j].index;
|
|
|
|
|
|
|
|
if (get_resource_type(a->out[i].resource) != RES_REGFILE ||
|
|
|
|
index < 0) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
copy[n].resource = b->in[j].resource;
|
|
|
|
copy[n].arg = b->arg + index;
|
|
|
|
++n;
|
|
|
|
++j;
|
|
|
|
rv = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
*n_copy = n;
|
|
|
|
return rv;
|
|
|
|
}
|
|
|
|
|
2019-01-30 06:21:10 +03:00
|
|
|
/*
|
|
|
|
* Calculate evaluation order for slot opcodes.
|
|
|
|
* Build opcode order graph and output its nodes in topological sort order.
|
|
|
|
* An edge a -> b in the graph means that opcode a must be followed by
|
|
|
|
* opcode b.
|
|
|
|
*/
|
|
|
|
static bool tsort(struct slot_prop *slot,
|
|
|
|
struct slot_prop *sorted[],
|
2019-02-13 06:10:24 +03:00
|
|
|
unsigned n,
|
|
|
|
struct opcode_arg_copy *copy,
|
|
|
|
unsigned *n_copy)
|
2019-01-30 06:21:10 +03:00
|
|
|
{
|
|
|
|
struct tsnode {
|
|
|
|
unsigned n_in_edge;
|
|
|
|
unsigned n_out_edge;
|
|
|
|
unsigned out_edge[MAX_INSN_SLOTS];
|
|
|
|
} node[MAX_INSN_SLOTS];
|
|
|
|
|
|
|
|
unsigned in[MAX_INSN_SLOTS];
|
|
|
|
unsigned i, j;
|
|
|
|
unsigned n_in = 0;
|
|
|
|
unsigned n_out = 0;
|
|
|
|
unsigned n_edge = 0;
|
2019-02-13 06:10:24 +03:00
|
|
|
unsigned in_idx = 0;
|
|
|
|
unsigned node_idx = 0;
|
2019-01-30 06:21:10 +03:00
|
|
|
|
|
|
|
for (i = 0; i < n; ++i) {
|
|
|
|
node[i].n_in_edge = 0;
|
|
|
|
node[i].n_out_edge = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
for (i = 0; i < n; ++i) {
|
|
|
|
unsigned n_out_edge = 0;
|
|
|
|
|
|
|
|
for (j = 0; j < n; ++j) {
|
|
|
|
if (i != j && op_depends_on(slot + j, slot + i)) {
|
|
|
|
node[i].out_edge[n_out_edge] = j;
|
|
|
|
++node[j].n_in_edge;
|
|
|
|
++n_out_edge;
|
|
|
|
++n_edge;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
node[i].n_out_edge = n_out_edge;
|
|
|
|
}
|
|
|
|
|
|
|
|
for (i = 0; i < n; ++i) {
|
|
|
|
if (!node[i].n_in_edge) {
|
|
|
|
in[n_in] = i;
|
|
|
|
++n_in;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-02-13 06:10:24 +03:00
|
|
|
again:
|
|
|
|
for (; in_idx < n_in; ++in_idx) {
|
2019-01-30 06:21:10 +03:00
|
|
|
i = in[in_idx];
|
|
|
|
sorted[n_out] = slot + i;
|
|
|
|
++n_out;
|
|
|
|
for (j = 0; j < node[i].n_out_edge; ++j) {
|
|
|
|
--n_edge;
|
|
|
|
if (--node[node[i].out_edge[j]].n_in_edge == 0) {
|
|
|
|
in[n_in] = node[i].out_edge[j];
|
|
|
|
++n_in;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2019-02-13 06:10:24 +03:00
|
|
|
if (n_edge) {
|
|
|
|
for (; node_idx < n; ++node_idx) {
|
|
|
|
struct tsnode *cnode = node + node_idx;
|
|
|
|
|
|
|
|
if (cnode->n_in_edge) {
|
|
|
|
for (j = 0; j < cnode->n_out_edge; ++j) {
|
|
|
|
unsigned k = cnode->out_edge[j];
|
|
|
|
|
|
|
|
if (break_dependency(slot + k, slot + node_idx,
|
|
|
|
copy, n_copy) &&
|
|
|
|
--node[k].n_in_edge == 0) {
|
|
|
|
in[n_in] = k;
|
|
|
|
++n_in;
|
|
|
|
--n_edge;
|
|
|
|
cnode->out_edge[j] =
|
|
|
|
cnode->out_edge[cnode->n_out_edge - 1];
|
|
|
|
--cnode->n_out_edge;
|
|
|
|
goto again;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2019-01-30 06:21:10 +03:00
|
|
|
return n_edge == 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void opcode_add_resource(struct slot_prop *op,
|
|
|
|
uint32_t resource, char direction,
|
|
|
|
int index)
|
|
|
|
{
|
|
|
|
switch (direction) {
|
|
|
|
case 'm':
|
|
|
|
case 'i':
|
|
|
|
assert(op->n_in < ARRAY_SIZE(op->in));
|
|
|
|
op->in[op->n_in].resource = resource;
|
|
|
|
op->in[op->n_in].index = index;
|
|
|
|
++op->n_in;
|
|
|
|
/* fall through */
|
|
|
|
case 'o':
|
|
|
|
if (direction == 'm' || direction == 'o') {
|
|
|
|
assert(op->n_out < ARRAY_SIZE(op->out));
|
|
|
|
op->out[op->n_out].resource = resource;
|
|
|
|
op->out[op->n_out].index = index;
|
|
|
|
++op->n_out;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
g_assert_not_reached();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static int resource_compare(const void *a, const void *b)
|
|
|
|
{
|
|
|
|
const struct opcode_arg_info *pa = a;
|
|
|
|
const struct opcode_arg_info *pb = b;
|
|
|
|
|
|
|
|
return pa->resource < pb->resource ?
|
|
|
|
-1 : (pa->resource > pb->resource ? 1 : 0);
|
|
|
|
}
|
|
|
|
|
2019-02-13 06:10:24 +03:00
|
|
|
static int arg_copy_compare(const void *a, const void *b)
|
|
|
|
{
|
|
|
|
const struct opcode_arg_copy *pa = a;
|
|
|
|
const struct opcode_arg_copy *pb = b;
|
|
|
|
|
|
|
|
return pa->resource < pb->resource ?
|
|
|
|
-1 : (pa->resource > pb->resource ? 1 : 0);
|
|
|
|
}
|
|
|
|
|
2012-09-08 17:09:07 +04:00
|
|
|
static void disas_xtensa_insn(CPUXtensaState *env, DisasContext *dc)
|
2011-09-06 03:55:27 +04:00
|
|
|
{
|
2017-11-04 05:44:46 +03:00
|
|
|
xtensa_isa isa = dc->config->isa;
|
2018-12-08 05:16:31 +03:00
|
|
|
unsigned char b[MAX_INSN_LENGTH] = {translator_ldub(env, dc->pc)};
|
2017-11-04 05:44:46 +03:00
|
|
|
unsigned len = xtensa_op0_insn_len(dc, b[0]);
|
|
|
|
xtensa_format fmt;
|
2018-01-18 21:08:49 +03:00
|
|
|
int slot, slots;
|
2017-11-04 05:44:46 +03:00
|
|
|
unsigned i;
|
2018-08-28 07:43:43 +03:00
|
|
|
uint32_t op_flags = 0;
|
2019-01-30 06:21:10 +03:00
|
|
|
struct slot_prop slot_prop[MAX_INSN_SLOTS];
|
|
|
|
struct slot_prop *ordered[MAX_INSN_SLOTS];
|
2019-02-13 06:10:24 +03:00
|
|
|
struct opcode_arg_copy arg_copy[MAX_INSN_SLOTS * MAX_OPCODE_ARGS];
|
|
|
|
unsigned n_arg_copy = 0;
|
2018-08-29 00:52:27 +03:00
|
|
|
uint32_t debug_cause = 0;
|
2018-08-29 20:37:29 +03:00
|
|
|
uint32_t windowed_register = 0;
|
2018-08-31 23:57:08 +03:00
|
|
|
uint32_t coprocessor = 0;
|
2014-12-14 07:50:55 +03:00
|
|
|
|
2017-11-04 05:44:46 +03:00
|
|
|
if (len == XTENSA_UNDEFINED) {
|
|
|
|
qemu_log_mask(LOG_GUEST_ERROR,
|
|
|
|
"unknown instruction length (pc = %08x)\n",
|
|
|
|
dc->pc);
|
|
|
|
gen_exception_cause(dc, ILLEGAL_INSTRUCTION_CAUSE);
|
|
|
|
return;
|
2011-09-06 03:55:27 +04:00
|
|
|
}
|
|
|
|
|
2018-05-12 20:57:22 +03:00
|
|
|
dc->base.pc_next = dc->pc + len;
|
2017-11-04 05:44:46 +03:00
|
|
|
for (i = 1; i < len; ++i) {
|
2018-12-08 05:16:31 +03:00
|
|
|
b[i] = translator_ldub(env, dc->pc + i);
|
2017-11-04 05:44:46 +03:00
|
|
|
}
|
|
|
|
xtensa_insnbuf_from_chars(isa, dc->insnbuf, b, len);
|
|
|
|
fmt = xtensa_format_decode(isa, dc->insnbuf);
|
|
|
|
if (fmt == XTENSA_UNDEFINED) {
|
|
|
|
qemu_log_mask(LOG_GUEST_ERROR,
|
|
|
|
"unrecognized instruction format (pc = %08x)\n",
|
|
|
|
dc->pc);
|
|
|
|
gen_exception_cause(dc, ILLEGAL_INSTRUCTION_CAUSE);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
slots = xtensa_format_num_slots(isa, fmt);
|
|
|
|
for (slot = 0; slot < slots; ++slot) {
|
|
|
|
xtensa_opcode opc;
|
2018-01-18 21:08:49 +03:00
|
|
|
int opnd, vopnd, opnds;
|
2019-02-12 05:53:19 +03:00
|
|
|
OpcodeArg *arg = slot_prop[slot].arg;
|
2017-11-04 05:44:46 +03:00
|
|
|
XtensaOpcodeOps *ops;
|
|
|
|
|
|
|
|
xtensa_format_get_slot(isa, fmt, slot, dc->insnbuf, dc->slotbuf);
|
|
|
|
opc = xtensa_opcode_decode(isa, fmt, slot, dc->slotbuf);
|
|
|
|
if (opc == XTENSA_UNDEFINED) {
|
|
|
|
qemu_log_mask(LOG_GUEST_ERROR,
|
|
|
|
"unrecognized opcode in slot %d (pc = %08x)\n",
|
|
|
|
slot, dc->pc);
|
|
|
|
gen_exception_cause(dc, ILLEGAL_INSTRUCTION_CAUSE);
|
|
|
|
return;
|
2011-09-06 03:55:27 +04:00
|
|
|
}
|
2017-11-04 05:44:46 +03:00
|
|
|
opnds = xtensa_opcode_num_operands(isa, opc);
|
2011-09-06 03:55:31 +04:00
|
|
|
|
2017-11-04 05:44:46 +03:00
|
|
|
for (opnd = vopnd = 0; opnd < opnds; ++opnd) {
|
2019-02-12 05:53:19 +03:00
|
|
|
void **register_file = NULL;
|
2020-01-25 11:53:39 +03:00
|
|
|
xtensa_regfile rf;
|
2019-02-10 05:30:00 +03:00
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
if (xtensa_operand_is_register(isa, opc, opnd)) {
|
2020-01-25 11:53:39 +03:00
|
|
|
rf = xtensa_operand_regfile(isa, opc, opnd);
|
2019-02-12 05:53:19 +03:00
|
|
|
register_file = dc->config->regfile[rf];
|
|
|
|
|
|
|
|
if (rf == dc->config->a_regfile) {
|
|
|
|
uint32_t v;
|
|
|
|
|
|
|
|
xtensa_operand_get_field(isa, opc, opnd, fmt, slot,
|
|
|
|
dc->slotbuf, &v);
|
|
|
|
xtensa_operand_decode(isa, opc, opnd, &v);
|
|
|
|
windowed_register |= 1u << v;
|
|
|
|
}
|
2019-02-10 05:30:00 +03:00
|
|
|
}
|
2017-11-04 05:44:46 +03:00
|
|
|
if (xtensa_operand_is_visible(isa, opc, opnd)) {
|
|
|
|
uint32_t v;
|
2011-09-06 03:55:27 +04:00
|
|
|
|
2017-11-04 05:44:46 +03:00
|
|
|
xtensa_operand_get_field(isa, opc, opnd, fmt, slot,
|
|
|
|
dc->slotbuf, &v);
|
|
|
|
xtensa_operand_decode(isa, opc, opnd, &v);
|
2019-02-12 05:53:19 +03:00
|
|
|
arg[vopnd].raw_imm = v;
|
2017-11-04 05:44:46 +03:00
|
|
|
if (xtensa_operand_is_PCrelative(isa, opc, opnd)) {
|
|
|
|
xtensa_operand_undo_reloc(isa, opc, opnd, &v, dc->pc);
|
2011-09-06 03:55:31 +04:00
|
|
|
}
|
2019-02-12 05:53:19 +03:00
|
|
|
arg[vopnd].imm = v;
|
|
|
|
if (register_file) {
|
|
|
|
arg[vopnd].in = register_file[v];
|
|
|
|
arg[vopnd].out = register_file[v];
|
2020-01-25 11:53:39 +03:00
|
|
|
arg[vopnd].num_bits = xtensa_regfile_num_bits(isa, rf);
|
|
|
|
} else {
|
|
|
|
arg[vopnd].num_bits = 32;
|
2019-02-12 05:53:19 +03:00
|
|
|
}
|
2017-11-04 05:44:46 +03:00
|
|
|
++vopnd;
|
2011-09-06 03:55:31 +04:00
|
|
|
}
|
|
|
|
}
|
2017-11-04 05:44:46 +03:00
|
|
|
ops = dc->config->opcode_ops[opc];
|
2018-08-28 07:43:43 +03:00
|
|
|
slot_prop[slot].ops = ops;
|
|
|
|
|
2017-11-04 05:44:46 +03:00
|
|
|
if (ops) {
|
2018-08-28 07:43:43 +03:00
|
|
|
op_flags |= ops->op_flags;
|
2020-05-05 00:08:40 +03:00
|
|
|
if (ops->test_exceptions) {
|
|
|
|
op_flags |= ops->test_exceptions(dc, arg, ops->par);
|
|
|
|
}
|
2017-11-04 05:44:46 +03:00
|
|
|
} else {
|
2018-08-28 07:43:43 +03:00
|
|
|
qemu_log_mask(LOG_UNIMP,
|
2017-11-04 05:44:46 +03:00
|
|
|
"unimplemented opcode '%s' in slot %d (pc = %08x)\n",
|
|
|
|
xtensa_opcode_name(isa, opc), slot, dc->pc);
|
2018-08-28 07:43:43 +03:00
|
|
|
op_flags |= XTENSA_OP_ILL;
|
|
|
|
}
|
2020-05-05 00:08:40 +03:00
|
|
|
if (op_flags & XTENSA_OP_ILL) {
|
2017-11-04 05:44:46 +03:00
|
|
|
gen_exception_cause(dc, ILLEGAL_INSTRUCTION_CAUSE);
|
|
|
|
return;
|
2011-09-06 03:55:28 +04:00
|
|
|
}
|
2020-05-05 00:08:40 +03:00
|
|
|
if (op_flags & XTENSA_OP_DEBUG_BREAK) {
|
2018-08-29 00:52:27 +03:00
|
|
|
debug_cause |= ops->par[0];
|
|
|
|
}
|
2018-08-29 20:37:29 +03:00
|
|
|
if (ops->test_overflow) {
|
|
|
|
windowed_register |= ops->test_overflow(dc, arg, ops->par);
|
|
|
|
}
|
2018-08-31 23:57:08 +03:00
|
|
|
coprocessor |= ops->coprocessor;
|
2019-01-30 06:21:10 +03:00
|
|
|
|
|
|
|
if (slots > 1) {
|
|
|
|
slot_prop[slot].n_in = 0;
|
|
|
|
slot_prop[slot].n_out = 0;
|
2019-02-14 04:36:30 +03:00
|
|
|
slot_prop[slot].op_flags = ops->op_flags & XTENSA_OP_LOAD_STORE;
|
2019-01-30 06:21:10 +03:00
|
|
|
|
|
|
|
opnds = xtensa_opcode_num_operands(isa, opc);
|
|
|
|
|
|
|
|
for (opnd = vopnd = 0; opnd < opnds; ++opnd) {
|
|
|
|
bool visible = xtensa_operand_is_visible(isa, opc, opnd);
|
|
|
|
|
|
|
|
if (xtensa_operand_is_register(isa, opc, opnd)) {
|
|
|
|
xtensa_regfile rf = xtensa_operand_regfile(isa, opc, opnd);
|
|
|
|
uint32_t v = 0;
|
|
|
|
|
|
|
|
xtensa_operand_get_field(isa, opc, opnd, fmt, slot,
|
|
|
|
dc->slotbuf, &v);
|
|
|
|
xtensa_operand_decode(isa, opc, opnd, &v);
|
|
|
|
opcode_add_resource(slot_prop + slot,
|
|
|
|
encode_resource(RES_REGFILE, rf, v),
|
|
|
|
xtensa_operand_inout(isa, opc, opnd),
|
|
|
|
visible ? vopnd : -1);
|
|
|
|
}
|
|
|
|
if (visible) {
|
|
|
|
++vopnd;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
opnds = xtensa_opcode_num_stateOperands(isa, opc);
|
|
|
|
|
|
|
|
for (opnd = 0; opnd < opnds; ++opnd) {
|
|
|
|
xtensa_state state = xtensa_stateOperand_state(isa, opc, opnd);
|
|
|
|
|
|
|
|
opcode_add_resource(slot_prop + slot,
|
|
|
|
encode_resource(RES_STATE, 0, state),
|
|
|
|
xtensa_stateOperand_inout(isa, opc, opnd),
|
|
|
|
-1);
|
|
|
|
}
|
|
|
|
if (xtensa_opcode_is_branch(isa, opc) ||
|
|
|
|
xtensa_opcode_is_jump(isa, opc) ||
|
|
|
|
xtensa_opcode_is_loop(isa, opc) ||
|
|
|
|
xtensa_opcode_is_call(isa, opc)) {
|
|
|
|
slot_prop[slot].op_flags |= XTENSA_OP_CONTROL_FLOW;
|
|
|
|
}
|
|
|
|
|
|
|
|
qsort(slot_prop[slot].in, slot_prop[slot].n_in,
|
|
|
|
sizeof(slot_prop[slot].in[0]), resource_compare);
|
|
|
|
qsort(slot_prop[slot].out, slot_prop[slot].n_out,
|
|
|
|
sizeof(slot_prop[slot].out[0]), resource_compare);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (slots > 1) {
|
2019-02-13 06:10:24 +03:00
|
|
|
if (!tsort(slot_prop, ordered, slots, arg_copy, &n_arg_copy)) {
|
2019-01-30 06:21:10 +03:00
|
|
|
qemu_log_mask(LOG_UNIMP,
|
|
|
|
"Circular resource dependencies (pc = %08x)\n",
|
|
|
|
dc->pc);
|
|
|
|
gen_exception_cause(dc, ILLEGAL_INSTRUCTION_CAUSE);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
ordered[0] = slot_prop + 0;
|
2011-09-06 03:55:27 +04:00
|
|
|
}
|
2018-08-28 07:43:43 +03:00
|
|
|
|
2018-08-28 08:17:50 +03:00
|
|
|
if ((op_flags & XTENSA_OP_PRIVILEGED) &&
|
|
|
|
!gen_check_privilege(dc)) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2018-08-28 08:18:48 +03:00
|
|
|
if (op_flags & XTENSA_OP_SYSCALL) {
|
|
|
|
gen_exception_cause(dc, SYSCALL_CAUSE);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2018-08-29 00:52:27 +03:00
|
|
|
if ((op_flags & XTENSA_OP_DEBUG_BREAK) && dc->debug) {
|
|
|
|
gen_debug_exception(dc, debug_cause);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2018-08-29 20:37:29 +03:00
|
|
|
if (windowed_register && !gen_window_check(dc, windowed_register)) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2018-08-31 03:55:33 +03:00
|
|
|
if (op_flags & XTENSA_OP_UNDERFLOW) {
|
|
|
|
TCGv_i32 tmp = tcg_const_i32(dc->pc);
|
|
|
|
|
|
|
|
gen_helper_test_underflow_retw(cpu_env, tmp);
|
|
|
|
tcg_temp_free(tmp);
|
|
|
|
}
|
|
|
|
|
2018-08-31 04:21:22 +03:00
|
|
|
if (op_flags & XTENSA_OP_ALLOCA) {
|
|
|
|
TCGv_i32 tmp = tcg_const_i32(dc->pc);
|
|
|
|
|
|
|
|
gen_helper_movsp(cpu_env, tmp);
|
|
|
|
tcg_temp_free(tmp);
|
|
|
|
}
|
|
|
|
|
2018-08-31 23:57:08 +03:00
|
|
|
if (coprocessor && !gen_check_cpenable(dc, coprocessor)) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2019-02-13 06:10:24 +03:00
|
|
|
if (n_arg_copy) {
|
|
|
|
uint32_t resource;
|
|
|
|
void *temp;
|
|
|
|
unsigned j;
|
|
|
|
|
|
|
|
qsort(arg_copy, n_arg_copy, sizeof(*arg_copy), arg_copy_compare);
|
|
|
|
for (i = j = 0; i < n_arg_copy; ++i) {
|
|
|
|
if (i == 0 || arg_copy[i].resource != resource) {
|
|
|
|
resource = arg_copy[i].resource;
|
2020-01-25 11:53:39 +03:00
|
|
|
if (arg_copy[i].arg->num_bits <= 32) {
|
|
|
|
temp = tcg_temp_local_new_i32();
|
|
|
|
tcg_gen_mov_i32(temp, arg_copy[i].arg->in);
|
|
|
|
} else if (arg_copy[i].arg->num_bits <= 64) {
|
|
|
|
temp = tcg_temp_local_new_i64();
|
|
|
|
tcg_gen_mov_i64(temp, arg_copy[i].arg->in);
|
|
|
|
} else {
|
|
|
|
g_assert_not_reached();
|
|
|
|
}
|
2019-02-13 06:10:24 +03:00
|
|
|
arg_copy[i].temp = temp;
|
|
|
|
|
|
|
|
if (i != j) {
|
|
|
|
arg_copy[j] = arg_copy[i];
|
|
|
|
}
|
|
|
|
++j;
|
|
|
|
}
|
|
|
|
arg_copy[i].arg->in = temp;
|
|
|
|
}
|
|
|
|
n_arg_copy = j;
|
|
|
|
}
|
|
|
|
|
2018-09-01 07:26:54 +03:00
|
|
|
if (op_flags & XTENSA_OP_DIVIDE_BY_ZERO) {
|
|
|
|
for (slot = 0; slot < slots; ++slot) {
|
|
|
|
if (slot_prop[slot].ops->op_flags & XTENSA_OP_DIVIDE_BY_ZERO) {
|
|
|
|
gen_zero_check(dc, slot_prop[slot].arg);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-01-31 01:48:22 +03:00
|
|
|
dc->op_flags = op_flags;
|
|
|
|
|
2018-08-28 07:43:43 +03:00
|
|
|
for (slot = 0; slot < slots; ++slot) {
|
2019-01-30 06:21:10 +03:00
|
|
|
struct slot_prop *pslot = ordered[slot];
|
|
|
|
XtensaOpcodeOps *ops = pslot->ops;
|
2018-08-28 07:43:43 +03:00
|
|
|
|
2019-01-30 06:21:10 +03:00
|
|
|
ops->translate(dc, pslot->arg, ops->par);
|
2018-08-28 07:43:43 +03:00
|
|
|
}
|
2018-09-01 10:47:55 +03:00
|
|
|
|
2019-02-13 06:10:24 +03:00
|
|
|
for (i = 0; i < n_arg_copy; ++i) {
|
2020-01-25 11:53:39 +03:00
|
|
|
if (arg_copy[i].arg->num_bits <= 32) {
|
|
|
|
tcg_temp_free_i32(arg_copy[i].temp);
|
|
|
|
} else if (arg_copy[i].arg->num_bits <= 64) {
|
|
|
|
tcg_temp_free_i64(arg_copy[i].temp);
|
|
|
|
} else {
|
|
|
|
g_assert_not_reached();
|
|
|
|
}
|
2019-02-13 06:10:24 +03:00
|
|
|
}
|
|
|
|
|
2018-09-01 10:47:55 +03:00
|
|
|
if (dc->base.is_jmp == DISAS_NEXT) {
|
2019-01-31 01:48:22 +03:00
|
|
|
gen_postprocess(dc, 0);
|
|
|
|
dc->op_flags = 0;
|
2018-09-01 10:47:55 +03:00
|
|
|
if (op_flags & XTENSA_OP_EXIT_TB_M1) {
|
|
|
|
/* Change in mmu index, memory mapping or tb->flags; exit tb */
|
|
|
|
gen_jumpi_check_loop_end(dc, -1);
|
2018-09-01 10:47:55 +03:00
|
|
|
} else if (op_flags & XTENSA_OP_EXIT_TB_0) {
|
|
|
|
gen_jumpi_check_loop_end(dc, 0);
|
2019-01-31 01:48:22 +03:00
|
|
|
} else {
|
|
|
|
gen_check_loop_end(dc, 0);
|
2018-09-01 10:47:55 +03:00
|
|
|
}
|
|
|
|
}
|
2018-05-12 20:57:22 +03:00
|
|
|
dc->pc = dc->base.pc_next;
|
2011-09-06 03:55:27 +04:00
|
|
|
}
|
|
|
|
|
2014-12-14 07:50:55 +03:00
|
|
|
static inline unsigned xtensa_insn_len(CPUXtensaState *env, DisasContext *dc)
|
|
|
|
{
|
|
|
|
uint8_t b0 = cpu_ldub_code(env, dc->pc);
|
2017-11-04 05:44:46 +03:00
|
|
|
return xtensa_op0_insn_len(dc, b0);
|
2014-12-14 07:50:55 +03:00
|
|
|
}
|
|
|
|
|
2012-03-14 04:38:23 +04:00
|
|
|
static void gen_ibreak_check(CPUXtensaState *env, DisasContext *dc)
|
2012-01-13 09:21:32 +04:00
|
|
|
{
|
|
|
|
unsigned i;
|
|
|
|
|
|
|
|
for (i = 0; i < dc->config->nibreak; ++i) {
|
|
|
|
if ((env->sregs[IBREAKENABLE] & (1 << i)) &&
|
|
|
|
env->sregs[IBREAKA + i] == dc->pc) {
|
|
|
|
gen_debug_exception(dc, DEBUGCAUSE_IB);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-05-12 20:57:24 +03:00
|
|
|
static void xtensa_tr_init_disas_context(DisasContextBase *dcbase,
|
|
|
|
CPUState *cpu)
|
2011-09-06 03:55:27 +04:00
|
|
|
{
|
2018-05-12 20:57:24 +03:00
|
|
|
DisasContext *dc = container_of(dcbase, DisasContext, base);
|
|
|
|
CPUXtensaState *env = cpu->env_ptr;
|
|
|
|
uint32_t tb_flags = dc->base.tb->flags;
|
2011-09-06 03:55:27 +04:00
|
|
|
|
2018-05-12 20:57:23 +03:00
|
|
|
dc->config = env->config;
|
2018-05-12 20:57:24 +03:00
|
|
|
dc->pc = dc->base.pc_first;
|
|
|
|
dc->ring = tb_flags & XTENSA_TBFLAG_RING_MASK;
|
|
|
|
dc->cring = (tb_flags & XTENSA_TBFLAG_EXCM) ? 0 : dc->ring;
|
2018-10-04 01:59:11 +03:00
|
|
|
dc->lbeg_off = (dc->base.tb->cs_base & XTENSA_CSBASE_LBEG_OFF_MASK) >>
|
|
|
|
XTENSA_CSBASE_LBEG_OFF_SHIFT;
|
|
|
|
dc->lend = (dc->base.tb->cs_base & XTENSA_CSBASE_LEND_MASK) +
|
|
|
|
(dc->base.pc_first & TARGET_PAGE_MASK);
|
2018-05-12 20:57:24 +03:00
|
|
|
dc->debug = tb_flags & XTENSA_TBFLAG_DEBUG;
|
|
|
|
dc->icount = tb_flags & XTENSA_TBFLAG_ICOUNT;
|
|
|
|
dc->cpenable = (tb_flags & XTENSA_TBFLAG_CPENABLE_MASK) >>
|
2012-09-19 04:23:59 +04:00
|
|
|
XTENSA_TBFLAG_CPENABLE_SHIFT;
|
2018-05-12 20:57:24 +03:00
|
|
|
dc->window = ((tb_flags & XTENSA_TBFLAG_WINDOW_MASK) >>
|
2014-10-30 18:07:47 +03:00
|
|
|
XTENSA_TBFLAG_WINDOW_SHIFT);
|
2018-08-28 07:43:43 +03:00
|
|
|
dc->cwoe = tb_flags & XTENSA_TBFLAG_CWOE;
|
2018-08-29 20:37:29 +03:00
|
|
|
dc->callinc = ((tb_flags & XTENSA_TBFLAG_CALLINC_MASK) >>
|
|
|
|
XTENSA_TBFLAG_CALLINC_SHIFT);
|
2018-05-12 20:57:23 +03:00
|
|
|
init_sar_tracker(dc);
|
2018-05-12 20:57:24 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
static void xtensa_tr_tb_start(DisasContextBase *dcbase, CPUState *cpu)
|
|
|
|
{
|
|
|
|
DisasContext *dc = container_of(dcbase, DisasContext, base);
|
|
|
|
|
2018-05-12 20:57:23 +03:00
|
|
|
if (dc->icount) {
|
|
|
|
dc->next_icount = tcg_temp_local_new_i32();
|
2012-01-15 05:40:50 +04:00
|
|
|
}
|
2018-05-12 20:57:24 +03:00
|
|
|
}
|
2011-09-06 03:55:35 +04:00
|
|
|
|
2018-05-12 20:57:24 +03:00
|
|
|
static void xtensa_tr_insn_start(DisasContextBase *dcbase, CPUState *cpu)
|
|
|
|
{
|
|
|
|
tcg_gen_insn_start(dcbase->pc_next);
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool xtensa_tr_breakpoint_check(DisasContextBase *dcbase, CPUState *cpu,
|
|
|
|
const CPUBreakpoint *bp)
|
|
|
|
{
|
|
|
|
DisasContext *dc = container_of(dcbase, DisasContext, base);
|
|
|
|
|
|
|
|
tcg_gen_movi_i32(cpu_pc, dc->base.pc_next);
|
|
|
|
gen_exception(dc, EXCP_DEBUG);
|
|
|
|
dc->base.is_jmp = DISAS_NORETURN;
|
|
|
|
/* The address covered by the breakpoint must be included in
|
|
|
|
[tb->pc, tb->pc + tb->size) in order to for it to be
|
|
|
|
properly cleared -- thus we increment the PC here so that
|
|
|
|
the logic setting tb->size below does the right thing. */
|
|
|
|
dc->base.pc_next += 2;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void xtensa_tr_translate_insn(DisasContextBase *dcbase, CPUState *cpu)
|
|
|
|
{
|
|
|
|
DisasContext *dc = container_of(dcbase, DisasContext, base);
|
|
|
|
CPUXtensaState *env = cpu->env_ptr;
|
|
|
|
target_ulong page_start;
|
2011-09-06 03:55:27 +04:00
|
|
|
|
2018-05-12 20:57:24 +03:00
|
|
|
/* These two conditions only apply to the first insn in the TB,
|
|
|
|
but this is the first TranslateOps hook that allows exiting. */
|
|
|
|
if ((tb_cflags(dc->base.tb) & CF_USE_ICOUNT)
|
|
|
|
&& (dc->base.tb->flags & XTENSA_TBFLAG_YIELD)) {
|
2018-05-12 20:57:23 +03:00
|
|
|
gen_exception(dc, EXCP_YIELD);
|
|
|
|
dc->base.is_jmp = DISAS_NORETURN;
|
2018-05-12 20:57:24 +03:00
|
|
|
return;
|
2013-07-22 08:02:43 +04:00
|
|
|
}
|
2018-05-12 20:57:24 +03:00
|
|
|
if (dc->base.tb->flags & XTENSA_TBFLAG_EXCEPTION) {
|
2018-05-12 20:57:23 +03:00
|
|
|
gen_exception(dc, EXCP_DEBUG);
|
|
|
|
dc->base.is_jmp = DISAS_NORETURN;
|
2018-05-12 20:57:24 +03:00
|
|
|
return;
|
2011-09-06 03:55:41 +04:00
|
|
|
}
|
|
|
|
|
2018-05-12 20:57:24 +03:00
|
|
|
if (dc->icount) {
|
|
|
|
TCGLabel *label = gen_new_label();
|
2011-09-06 03:55:27 +04:00
|
|
|
|
2018-05-12 20:57:24 +03:00
|
|
|
tcg_gen_addi_i32(dc->next_icount, cpu_SR[ICOUNT], 1);
|
|
|
|
tcg_gen_brcondi_i32(TCG_COND_NE, dc->next_icount, 0, label);
|
|
|
|
tcg_gen_mov_i32(dc->next_icount, cpu_SR[ICOUNT]);
|
|
|
|
if (dc->debug) {
|
|
|
|
gen_debug_exception(dc, DEBUGCAUSE_IC);
|
2015-09-18 01:58:10 +03:00
|
|
|
}
|
2018-05-12 20:57:24 +03:00
|
|
|
gen_set_label(label);
|
|
|
|
}
|
2015-09-18 01:58:10 +03:00
|
|
|
|
2018-05-12 20:57:24 +03:00
|
|
|
if (dc->debug) {
|
|
|
|
gen_ibreak_check(env, dc);
|
|
|
|
}
|
2011-09-06 03:55:48 +04:00
|
|
|
|
2018-05-12 20:57:24 +03:00
|
|
|
disas_xtensa_insn(env, dc);
|
2012-01-15 05:40:50 +04:00
|
|
|
|
2018-05-12 20:57:24 +03:00
|
|
|
if (dc->icount) {
|
|
|
|
tcg_gen_mov_i32(cpu_SR[ICOUNT], dc->next_icount);
|
|
|
|
}
|
2012-01-15 05:40:50 +04:00
|
|
|
|
2018-05-12 20:57:24 +03:00
|
|
|
/* End the TB if the next insn will cross into the next page. */
|
|
|
|
page_start = dc->base.pc_first & TARGET_PAGE_MASK;
|
|
|
|
if (dc->base.is_jmp == DISAS_NEXT &&
|
|
|
|
(dc->pc - page_start >= TARGET_PAGE_SIZE ||
|
|
|
|
dc->pc - page_start + xtensa_insn_len(env, dc) > TARGET_PAGE_SIZE)) {
|
|
|
|
dc->base.is_jmp = DISAS_TOO_MANY;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void xtensa_tr_tb_stop(DisasContextBase *dcbase, CPUState *cpu)
|
|
|
|
{
|
|
|
|
DisasContext *dc = container_of(dcbase, DisasContext, base);
|
2012-01-13 09:21:32 +04:00
|
|
|
|
2018-05-12 20:57:23 +03:00
|
|
|
reset_sar_tracker(dc);
|
2018-05-12 20:57:24 +03:00
|
|
|
if (dc->icount) {
|
|
|
|
tcg_temp_free(dc->next_icount);
|
2011-09-06 03:55:48 +04:00
|
|
|
}
|
|
|
|
|
2018-05-12 20:57:24 +03:00
|
|
|
switch (dc->base.is_jmp) {
|
|
|
|
case DISAS_NORETURN:
|
|
|
|
break;
|
|
|
|
case DISAS_TOO_MANY:
|
|
|
|
if (dc->base.singlestep_enabled) {
|
|
|
|
tcg_gen_movi_i32(cpu_pc, dc->pc);
|
|
|
|
gen_exception(dc, EXCP_DEBUG);
|
|
|
|
} else {
|
|
|
|
gen_jumpi(dc, dc->pc, 0);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
g_assert_not_reached();
|
2013-08-17 12:30:57 +04:00
|
|
|
}
|
2018-05-12 20:57:24 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
static void xtensa_tr_disas_log(const DisasContextBase *dcbase, CPUState *cpu)
|
|
|
|
{
|
|
|
|
qemu_log("IN: %s\n", lookup_symbol(dcbase->pc_first));
|
|
|
|
log_target_disas(cpu, dcbase->pc_first, dcbase->tb->size);
|
|
|
|
}
|
|
|
|
|
|
|
|
static const TranslatorOps xtensa_translator_ops = {
|
|
|
|
.init_disas_context = xtensa_tr_init_disas_context,
|
|
|
|
.tb_start = xtensa_tr_tb_start,
|
|
|
|
.insn_start = xtensa_tr_insn_start,
|
|
|
|
.breakpoint_check = xtensa_tr_breakpoint_check,
|
|
|
|
.translate_insn = xtensa_tr_translate_insn,
|
|
|
|
.tb_stop = xtensa_tr_tb_stop,
|
|
|
|
.disas_log = xtensa_tr_disas_log,
|
|
|
|
};
|
|
|
|
|
2019-04-16 09:54:54 +03:00
|
|
|
void gen_intermediate_code(CPUState *cpu, TranslationBlock *tb, int max_insns)
|
2018-05-12 20:57:24 +03:00
|
|
|
{
|
|
|
|
DisasContext dc = {};
|
2019-04-16 09:54:54 +03:00
|
|
|
translator_loop(&xtensa_translator_ops, &dc.base, cpu, tb, max_insns);
|
2011-09-06 03:55:25 +04:00
|
|
|
}
|
|
|
|
|
2019-04-17 22:18:02 +03:00
|
|
|
void xtensa_cpu_dump_state(CPUState *cs, FILE *f, int flags)
|
2011-09-06 03:55:25 +04:00
|
|
|
{
|
2013-05-27 03:33:50 +04:00
|
|
|
XtensaCPU *cpu = XTENSA_CPU(cs);
|
|
|
|
CPUXtensaState *env = &cpu->env;
|
2019-03-19 03:10:38 +03:00
|
|
|
xtensa_isa isa = env->config->isa;
|
2011-09-06 03:55:33 +04:00
|
|
|
int i, j;
|
|
|
|
|
2019-04-17 22:18:02 +03:00
|
|
|
qemu_fprintf(f, "PC=%08x\n\n", env->pc);
|
2011-09-06 03:55:33 +04:00
|
|
|
|
2019-03-19 03:10:38 +03:00
|
|
|
for (i = j = 0; i < xtensa_isa_num_sysregs(isa); ++i) {
|
|
|
|
const uint32_t *reg =
|
|
|
|
xtensa_sysreg_is_user(isa, i) ? env->uregs : env->sregs;
|
|
|
|
int regno = xtensa_sysreg_number(isa, i);
|
2011-09-06 03:55:33 +04:00
|
|
|
|
2019-03-19 03:10:38 +03:00
|
|
|
if (regno >= 0) {
|
|
|
|
qemu_fprintf(f, "%12s=%08x%c",
|
|
|
|
xtensa_sysreg_name(isa, i),
|
|
|
|
reg[regno],
|
2019-04-17 22:18:02 +03:00
|
|
|
(j++ % 4) == 3 ? '\n' : ' ');
|
2011-09-06 03:55:33 +04:00
|
|
|
}
|
|
|
|
}
|
2011-09-06 03:55:25 +04:00
|
|
|
|
2019-04-17 22:18:02 +03:00
|
|
|
qemu_fprintf(f, (j % 4) == 0 ? "\n" : "\n\n");
|
2011-09-06 03:55:25 +04:00
|
|
|
|
|
|
|
for (i = 0; i < 16; ++i) {
|
2019-04-17 22:18:02 +03:00
|
|
|
qemu_fprintf(f, " A%02d=%08x%c",
|
|
|
|
i, env->regs[i], (i % 4) == 3 ? '\n' : ' ');
|
2011-09-06 03:55:25 +04:00
|
|
|
}
|
2011-09-06 03:55:43 +04:00
|
|
|
|
2018-02-28 22:48:04 +03:00
|
|
|
xtensa_sync_phys_from_window(env);
|
2019-04-17 22:18:02 +03:00
|
|
|
qemu_fprintf(f, "\n");
|
2011-09-06 03:55:43 +04:00
|
|
|
|
|
|
|
for (i = 0; i < env->config->nareg; ++i) {
|
2019-04-17 22:18:02 +03:00
|
|
|
qemu_fprintf(f, "AR%02d=%08x ", i, env->phys_regs[i]);
|
2018-02-05 00:22:46 +03:00
|
|
|
if (i % 4 == 3) {
|
|
|
|
bool ws = (env->sregs[WINDOW_START] & (1 << (i / 4))) != 0;
|
|
|
|
bool cw = env->sregs[WINDOW_BASE] == i / 4;
|
|
|
|
|
2019-04-17 22:18:02 +03:00
|
|
|
qemu_fprintf(f, "%c%c\n", ws ? '<' : ' ', cw ? '=' : ' ');
|
2018-02-05 00:22:46 +03:00
|
|
|
}
|
2011-09-06 03:55:43 +04:00
|
|
|
}
|
2012-09-19 04:23:54 +04:00
|
|
|
|
2018-05-11 06:46:23 +03:00
|
|
|
if ((flags & CPU_DUMP_FPU) &&
|
|
|
|
xtensa_option_enabled(env->config, XTENSA_OPTION_FP_COPROCESSOR)) {
|
2019-04-17 22:18:02 +03:00
|
|
|
qemu_fprintf(f, "\n");
|
2012-09-19 04:23:54 +04:00
|
|
|
|
|
|
|
for (i = 0; i < 16; ++i) {
|
2020-07-01 05:27:02 +03:00
|
|
|
qemu_fprintf(f, "F%02d=%08x (%-+15.8e)%c", i,
|
2019-04-17 22:18:02 +03:00
|
|
|
float32_val(env->fregs[i].f32[FP_F32_LOW]),
|
|
|
|
*(float *)(env->fregs[i].f32 + FP_F32_LOW),
|
|
|
|
(i % 2) == 1 ? '\n' : ' ');
|
2012-09-19 04:23:54 +04:00
|
|
|
}
|
|
|
|
}
|
2020-07-01 05:27:02 +03:00
|
|
|
|
|
|
|
if ((flags & CPU_DUMP_FPU) &&
|
|
|
|
xtensa_option_enabled(env->config, XTENSA_OPTION_DFP_COPROCESSOR) &&
|
|
|
|
!xtensa_option_enabled(env->config, XTENSA_OPTION_DFPU_SINGLE_ONLY)) {
|
|
|
|
qemu_fprintf(f, "\n");
|
|
|
|
|
|
|
|
for (i = 0; i < 16; ++i) {
|
|
|
|
qemu_fprintf(f, "F%02d=%016"PRIx64" (%-+24.16le)%c", i,
|
|
|
|
float64_val(env->fregs[i].f64),
|
|
|
|
*(double *)(&env->fregs[i].f64),
|
|
|
|
(i % 2) == 1 ? '\n' : ' ');
|
|
|
|
}
|
|
|
|
}
|
2011-09-06 03:55:25 +04:00
|
|
|
}
|
|
|
|
|
2015-09-02 01:51:12 +03:00
|
|
|
void restore_state_to_opc(CPUXtensaState *env, TranslationBlock *tb,
|
|
|
|
target_ulong *data)
|
2011-09-06 03:55:25 +04:00
|
|
|
{
|
2015-09-02 01:51:12 +03:00
|
|
|
env->pc = data[0];
|
2011-09-06 03:55:25 +04:00
|
|
|
}
|
2017-11-04 04:29:27 +03:00
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
static void translate_abs(DisasContext *dc, const OpcodeArg arg[],
|
2017-11-04 04:29:27 +03:00
|
|
|
const uint32_t par[])
|
|
|
|
{
|
2019-04-18 03:01:23 +03:00
|
|
|
tcg_gen_abs_i32(arg[0].out, arg[1].in);
|
2017-11-04 04:29:27 +03:00
|
|
|
}
|
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
static void translate_add(DisasContext *dc, const OpcodeArg arg[],
|
2017-11-04 04:29:27 +03:00
|
|
|
const uint32_t par[])
|
|
|
|
{
|
2019-02-12 05:53:19 +03:00
|
|
|
tcg_gen_add_i32(arg[0].out, arg[1].in, arg[2].in);
|
2017-11-04 04:29:27 +03:00
|
|
|
}
|
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
static void translate_addi(DisasContext *dc, const OpcodeArg arg[],
|
2017-11-04 04:29:27 +03:00
|
|
|
const uint32_t par[])
|
|
|
|
{
|
2019-02-12 05:53:19 +03:00
|
|
|
tcg_gen_addi_i32(arg[0].out, arg[1].in, arg[2].imm);
|
2017-11-04 04:29:27 +03:00
|
|
|
}
|
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
static void translate_addx(DisasContext *dc, const OpcodeArg arg[],
|
2017-11-04 04:29:27 +03:00
|
|
|
const uint32_t par[])
|
|
|
|
{
|
2018-08-29 20:37:29 +03:00
|
|
|
TCGv_i32 tmp = tcg_temp_new_i32();
|
2019-02-12 05:53:19 +03:00
|
|
|
tcg_gen_shli_i32(tmp, arg[1].in, par[0]);
|
|
|
|
tcg_gen_add_i32(arg[0].out, tmp, arg[2].in);
|
2018-08-29 20:37:29 +03:00
|
|
|
tcg_temp_free(tmp);
|
2017-11-04 04:29:27 +03:00
|
|
|
}
|
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
static void translate_all(DisasContext *dc, const OpcodeArg arg[],
|
2017-11-04 04:29:27 +03:00
|
|
|
const uint32_t par[])
|
|
|
|
{
|
|
|
|
uint32_t shift = par[1];
|
2019-02-12 05:53:19 +03:00
|
|
|
TCGv_i32 mask = tcg_const_i32(((1 << shift) - 1) << arg[1].imm);
|
2017-11-04 04:29:27 +03:00
|
|
|
TCGv_i32 tmp = tcg_temp_new_i32();
|
|
|
|
|
2019-02-15 00:27:50 +03:00
|
|
|
tcg_gen_and_i32(tmp, arg[1].in, mask);
|
2017-11-04 04:29:27 +03:00
|
|
|
if (par[0]) {
|
2019-02-12 05:53:19 +03:00
|
|
|
tcg_gen_addi_i32(tmp, tmp, 1 << arg[1].imm);
|
2017-11-04 04:29:27 +03:00
|
|
|
} else {
|
|
|
|
tcg_gen_add_i32(tmp, tmp, mask);
|
|
|
|
}
|
2019-02-12 05:53:19 +03:00
|
|
|
tcg_gen_shri_i32(tmp, tmp, arg[1].imm + shift);
|
2019-02-15 00:27:50 +03:00
|
|
|
tcg_gen_deposit_i32(arg[0].out, arg[0].out,
|
2019-02-12 05:53:19 +03:00
|
|
|
tmp, arg[0].imm, 1);
|
2017-11-04 04:29:27 +03:00
|
|
|
tcg_temp_free(mask);
|
|
|
|
tcg_temp_free(tmp);
|
|
|
|
}
|
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
static void translate_and(DisasContext *dc, const OpcodeArg arg[],
|
2017-11-04 04:29:27 +03:00
|
|
|
const uint32_t par[])
|
|
|
|
{
|
2019-02-12 05:53:19 +03:00
|
|
|
tcg_gen_and_i32(arg[0].out, arg[1].in, arg[2].in);
|
2017-11-04 04:29:27 +03:00
|
|
|
}
|
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
static void translate_ball(DisasContext *dc, const OpcodeArg arg[],
|
2017-11-04 04:29:27 +03:00
|
|
|
const uint32_t par[])
|
|
|
|
{
|
2018-08-29 20:37:29 +03:00
|
|
|
TCGv_i32 tmp = tcg_temp_new_i32();
|
2019-02-12 05:53:19 +03:00
|
|
|
tcg_gen_and_i32(tmp, arg[0].in, arg[1].in);
|
|
|
|
gen_brcond(dc, par[0], tmp, arg[1].in, arg[2].imm);
|
2018-08-29 20:37:29 +03:00
|
|
|
tcg_temp_free(tmp);
|
2017-11-04 04:29:27 +03:00
|
|
|
}
|
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
static void translate_bany(DisasContext *dc, const OpcodeArg arg[],
|
2017-11-04 04:29:27 +03:00
|
|
|
const uint32_t par[])
|
|
|
|
{
|
2018-08-29 20:37:29 +03:00
|
|
|
TCGv_i32 tmp = tcg_temp_new_i32();
|
2019-02-12 05:53:19 +03:00
|
|
|
tcg_gen_and_i32(tmp, arg[0].in, arg[1].in);
|
|
|
|
gen_brcondi(dc, par[0], tmp, 0, arg[2].imm);
|
2018-08-29 20:37:29 +03:00
|
|
|
tcg_temp_free(tmp);
|
2017-11-04 04:29:27 +03:00
|
|
|
}
|
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
static void translate_b(DisasContext *dc, const OpcodeArg arg[],
|
2017-11-04 04:29:27 +03:00
|
|
|
const uint32_t par[])
|
|
|
|
{
|
2019-02-12 05:53:19 +03:00
|
|
|
gen_brcond(dc, par[0], arg[0].in, arg[1].in, arg[2].imm);
|
2017-11-04 04:29:27 +03:00
|
|
|
}
|
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
static void translate_bb(DisasContext *dc, const OpcodeArg arg[],
|
2017-11-04 04:29:27 +03:00
|
|
|
const uint32_t par[])
|
|
|
|
{
|
|
|
|
#ifdef TARGET_WORDS_BIGENDIAN
|
2018-08-29 20:37:29 +03:00
|
|
|
TCGv_i32 bit = tcg_const_i32(0x80000000u);
|
2017-11-04 04:29:27 +03:00
|
|
|
#else
|
2018-08-29 20:37:29 +03:00
|
|
|
TCGv_i32 bit = tcg_const_i32(0x00000001u);
|
2017-11-04 04:29:27 +03:00
|
|
|
#endif
|
2018-08-29 20:37:29 +03:00
|
|
|
TCGv_i32 tmp = tcg_temp_new_i32();
|
2019-02-12 05:53:19 +03:00
|
|
|
tcg_gen_andi_i32(tmp, arg[1].in, 0x1f);
|
2017-11-04 04:29:27 +03:00
|
|
|
#ifdef TARGET_WORDS_BIGENDIAN
|
2018-08-29 20:37:29 +03:00
|
|
|
tcg_gen_shr_i32(bit, bit, tmp);
|
2017-11-04 04:29:27 +03:00
|
|
|
#else
|
2018-08-29 20:37:29 +03:00
|
|
|
tcg_gen_shl_i32(bit, bit, tmp);
|
2017-11-04 04:29:27 +03:00
|
|
|
#endif
|
2019-02-12 05:53:19 +03:00
|
|
|
tcg_gen_and_i32(tmp, arg[0].in, bit);
|
|
|
|
gen_brcondi(dc, par[0], tmp, 0, arg[2].imm);
|
2018-08-29 20:37:29 +03:00
|
|
|
tcg_temp_free(tmp);
|
|
|
|
tcg_temp_free(bit);
|
2017-11-04 04:29:27 +03:00
|
|
|
}
|
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
static void translate_bbi(DisasContext *dc, const OpcodeArg arg[],
|
2017-11-04 04:29:27 +03:00
|
|
|
const uint32_t par[])
|
|
|
|
{
|
2018-08-29 20:37:29 +03:00
|
|
|
TCGv_i32 tmp = tcg_temp_new_i32();
|
2017-11-04 04:29:27 +03:00
|
|
|
#ifdef TARGET_WORDS_BIGENDIAN
|
2019-02-12 05:53:19 +03:00
|
|
|
tcg_gen_andi_i32(tmp, arg[0].in, 0x80000000u >> arg[1].imm);
|
2017-11-04 04:29:27 +03:00
|
|
|
#else
|
2019-02-12 05:53:19 +03:00
|
|
|
tcg_gen_andi_i32(tmp, arg[0].in, 0x00000001u << arg[1].imm);
|
2017-11-04 04:29:27 +03:00
|
|
|
#endif
|
2019-02-12 05:53:19 +03:00
|
|
|
gen_brcondi(dc, par[0], tmp, 0, arg[2].imm);
|
2018-08-29 20:37:29 +03:00
|
|
|
tcg_temp_free(tmp);
|
2017-11-04 04:29:27 +03:00
|
|
|
}
|
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
static void translate_bi(DisasContext *dc, const OpcodeArg arg[],
|
2017-11-04 04:29:27 +03:00
|
|
|
const uint32_t par[])
|
|
|
|
{
|
2019-02-12 05:53:19 +03:00
|
|
|
gen_brcondi(dc, par[0], arg[0].in, arg[1].imm, arg[2].imm);
|
2017-11-04 04:29:27 +03:00
|
|
|
}
|
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
static void translate_bz(DisasContext *dc, const OpcodeArg arg[],
|
2017-11-04 04:29:27 +03:00
|
|
|
const uint32_t par[])
|
|
|
|
{
|
2019-02-12 05:53:19 +03:00
|
|
|
gen_brcondi(dc, par[0], arg[0].in, 0, arg[1].imm);
|
2017-11-04 04:29:27 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
enum {
|
|
|
|
BOOLEAN_AND,
|
|
|
|
BOOLEAN_ANDC,
|
|
|
|
BOOLEAN_OR,
|
|
|
|
BOOLEAN_ORC,
|
|
|
|
BOOLEAN_XOR,
|
|
|
|
};
|
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
static void translate_boolean(DisasContext *dc, const OpcodeArg arg[],
|
2017-11-04 04:29:27 +03:00
|
|
|
const uint32_t par[])
|
|
|
|
{
|
|
|
|
static void (* const op[])(TCGv_i32, TCGv_i32, TCGv_i32) = {
|
|
|
|
[BOOLEAN_AND] = tcg_gen_and_i32,
|
|
|
|
[BOOLEAN_ANDC] = tcg_gen_andc_i32,
|
|
|
|
[BOOLEAN_OR] = tcg_gen_or_i32,
|
|
|
|
[BOOLEAN_ORC] = tcg_gen_orc_i32,
|
|
|
|
[BOOLEAN_XOR] = tcg_gen_xor_i32,
|
|
|
|
};
|
|
|
|
|
|
|
|
TCGv_i32 tmp1 = tcg_temp_new_i32();
|
|
|
|
TCGv_i32 tmp2 = tcg_temp_new_i32();
|
|
|
|
|
2019-02-15 00:27:50 +03:00
|
|
|
tcg_gen_shri_i32(tmp1, arg[1].in, arg[1].imm);
|
|
|
|
tcg_gen_shri_i32(tmp2, arg[2].in, arg[2].imm);
|
2017-11-04 04:29:27 +03:00
|
|
|
op[par[0]](tmp1, tmp1, tmp2);
|
2019-02-15 00:27:50 +03:00
|
|
|
tcg_gen_deposit_i32(arg[0].out, arg[0].out, tmp1, arg[0].imm, 1);
|
2017-11-04 04:29:27 +03:00
|
|
|
tcg_temp_free(tmp1);
|
|
|
|
tcg_temp_free(tmp2);
|
|
|
|
}
|
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
static void translate_bp(DisasContext *dc, const OpcodeArg arg[],
|
2017-11-04 04:29:27 +03:00
|
|
|
const uint32_t par[])
|
|
|
|
{
|
|
|
|
TCGv_i32 tmp = tcg_temp_new_i32();
|
|
|
|
|
2019-02-15 00:27:50 +03:00
|
|
|
tcg_gen_andi_i32(tmp, arg[0].in, 1 << arg[0].imm);
|
2019-02-12 05:53:19 +03:00
|
|
|
gen_brcondi(dc, par[0], tmp, 0, arg[1].imm);
|
2017-11-04 04:29:27 +03:00
|
|
|
tcg_temp_free(tmp);
|
|
|
|
}
|
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
static void translate_call0(DisasContext *dc, const OpcodeArg arg[],
|
2017-11-04 04:29:27 +03:00
|
|
|
const uint32_t par[])
|
|
|
|
{
|
2018-05-12 20:57:22 +03:00
|
|
|
tcg_gen_movi_i32(cpu_R[0], dc->base.pc_next);
|
2019-02-12 05:53:19 +03:00
|
|
|
gen_jumpi(dc, arg[0].imm, 0);
|
2017-11-04 04:29:27 +03:00
|
|
|
}
|
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
static void translate_callw(DisasContext *dc, const OpcodeArg arg[],
|
2017-11-04 04:29:27 +03:00
|
|
|
const uint32_t par[])
|
|
|
|
{
|
2019-02-12 05:53:19 +03:00
|
|
|
TCGv_i32 tmp = tcg_const_i32(arg[0].imm);
|
|
|
|
gen_callw_slot(dc, par[0], tmp, adjust_jump_slot(dc, arg[0].imm, 0));
|
2019-02-11 13:00:06 +03:00
|
|
|
tcg_temp_free(tmp);
|
2017-11-04 04:29:27 +03:00
|
|
|
}
|
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
static void translate_callx0(DisasContext *dc, const OpcodeArg arg[],
|
2017-11-04 04:29:27 +03:00
|
|
|
const uint32_t par[])
|
|
|
|
{
|
2018-08-29 20:37:29 +03:00
|
|
|
TCGv_i32 tmp = tcg_temp_new_i32();
|
2019-02-12 05:53:19 +03:00
|
|
|
tcg_gen_mov_i32(tmp, arg[0].in);
|
2018-08-29 20:37:29 +03:00
|
|
|
tcg_gen_movi_i32(cpu_R[0], dc->base.pc_next);
|
|
|
|
gen_jump(dc, tmp);
|
|
|
|
tcg_temp_free(tmp);
|
2017-11-04 04:29:27 +03:00
|
|
|
}
|
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
static void translate_callxw(DisasContext *dc, const OpcodeArg arg[],
|
2017-11-04 04:29:27 +03:00
|
|
|
const uint32_t par[])
|
|
|
|
{
|
2018-08-29 20:37:29 +03:00
|
|
|
TCGv_i32 tmp = tcg_temp_new_i32();
|
2017-11-04 04:29:27 +03:00
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
tcg_gen_mov_i32(tmp, arg[0].in);
|
2019-02-11 13:00:06 +03:00
|
|
|
gen_callw_slot(dc, par[0], tmp, -1);
|
2018-08-29 20:37:29 +03:00
|
|
|
tcg_temp_free(tmp);
|
2017-11-04 04:29:27 +03:00
|
|
|
}
|
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
static void translate_clamps(DisasContext *dc, const OpcodeArg arg[],
|
2017-11-04 04:29:27 +03:00
|
|
|
const uint32_t par[])
|
|
|
|
{
|
2019-02-12 05:53:19 +03:00
|
|
|
TCGv_i32 tmp1 = tcg_const_i32(-1u << arg[2].imm);
|
|
|
|
TCGv_i32 tmp2 = tcg_const_i32((1 << arg[2].imm) - 1);
|
2017-11-04 04:29:27 +03:00
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
tcg_gen_smax_i32(tmp1, tmp1, arg[1].in);
|
|
|
|
tcg_gen_smin_i32(arg[0].out, tmp1, tmp2);
|
2018-08-29 20:37:29 +03:00
|
|
|
tcg_temp_free(tmp1);
|
|
|
|
tcg_temp_free(tmp2);
|
2017-11-04 04:29:27 +03:00
|
|
|
}
|
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
static void translate_clrb_expstate(DisasContext *dc, const OpcodeArg arg[],
|
2017-02-18 03:21:36 +03:00
|
|
|
const uint32_t par[])
|
|
|
|
{
|
|
|
|
/* TODO: GPIO32 may be a part of coprocessor */
|
2019-02-12 05:53:19 +03:00
|
|
|
tcg_gen_andi_i32(cpu_UR[EXPSTATE], cpu_UR[EXPSTATE], ~(1u << arg[0].imm));
|
2017-02-18 03:21:36 +03:00
|
|
|
}
|
|
|
|
|
2019-04-19 02:37:00 +03:00
|
|
|
static void translate_clrex(DisasContext *dc, const OpcodeArg arg[],
|
|
|
|
const uint32_t par[])
|
|
|
|
{
|
|
|
|
tcg_gen_movi_i32(cpu_exclusive_addr, -1);
|
|
|
|
}
|
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
static void translate_const16(DisasContext *dc, const OpcodeArg arg[],
|
2017-11-03 01:05:56 +03:00
|
|
|
const uint32_t par[])
|
|
|
|
{
|
2019-02-12 05:53:19 +03:00
|
|
|
TCGv_i32 c = tcg_const_i32(arg[1].imm);
|
2017-11-03 01:05:56 +03:00
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
tcg_gen_deposit_i32(arg[0].out, c, arg[0].in, 16, 16);
|
2018-08-29 20:37:29 +03:00
|
|
|
tcg_temp_free(c);
|
2017-11-03 01:05:56 +03:00
|
|
|
}
|
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
static void translate_dcache(DisasContext *dc, const OpcodeArg arg[],
|
2017-11-04 04:29:27 +03:00
|
|
|
const uint32_t par[])
|
|
|
|
{
|
2018-08-29 20:37:29 +03:00
|
|
|
TCGv_i32 addr = tcg_temp_new_i32();
|
|
|
|
TCGv_i32 res = tcg_temp_new_i32();
|
2017-11-04 04:29:27 +03:00
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
tcg_gen_addi_i32(addr, arg[0].in, arg[1].imm);
|
2018-08-29 20:37:29 +03:00
|
|
|
tcg_gen_qemu_ld8u(res, addr, dc->cring);
|
|
|
|
tcg_temp_free(addr);
|
|
|
|
tcg_temp_free(res);
|
2017-11-04 04:29:27 +03:00
|
|
|
}
|
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
static void translate_depbits(DisasContext *dc, const OpcodeArg arg[],
|
2017-11-04 04:29:27 +03:00
|
|
|
const uint32_t par[])
|
|
|
|
{
|
2019-02-12 05:53:19 +03:00
|
|
|
tcg_gen_deposit_i32(arg[1].out, arg[1].in, arg[0].in,
|
|
|
|
arg[2].imm, arg[3].imm);
|
2017-11-04 04:29:27 +03:00
|
|
|
}
|
|
|
|
|
2019-04-15 00:02:17 +03:00
|
|
|
static void translate_diwbuip(DisasContext *dc, const OpcodeArg arg[],
|
|
|
|
const uint32_t par[])
|
|
|
|
{
|
|
|
|
tcg_gen_addi_i32(arg[0].out, arg[0].in, dc->config->dcache_line_bytes);
|
|
|
|
}
|
|
|
|
|
2020-05-05 00:08:40 +03:00
|
|
|
static uint32_t test_exceptions_entry(DisasContext *dc, const OpcodeArg arg[],
|
|
|
|
const uint32_t par[])
|
2018-08-28 07:43:43 +03:00
|
|
|
{
|
2019-02-12 05:53:19 +03:00
|
|
|
if (arg[0].imm > 3 || !dc->cwoe) {
|
2018-08-28 07:43:43 +03:00
|
|
|
qemu_log_mask(LOG_GUEST_ERROR,
|
|
|
|
"Illegal entry instruction(pc = %08x)\n", dc->pc);
|
2020-05-05 00:08:40 +03:00
|
|
|
return XTENSA_OP_ILL;
|
2018-08-28 07:43:43 +03:00
|
|
|
} else {
|
2020-05-05 00:08:40 +03:00
|
|
|
return 0;
|
2018-08-28 07:43:43 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
static uint32_t test_overflow_entry(DisasContext *dc, const OpcodeArg arg[],
|
2018-08-29 20:37:29 +03:00
|
|
|
const uint32_t par[])
|
|
|
|
{
|
|
|
|
return 1 << (dc->callinc * 4);
|
|
|
|
}
|
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
static void translate_entry(DisasContext *dc, const OpcodeArg arg[],
|
2017-11-04 04:29:27 +03:00
|
|
|
const uint32_t par[])
|
|
|
|
{
|
|
|
|
TCGv_i32 pc = tcg_const_i32(dc->pc);
|
2019-02-12 05:53:19 +03:00
|
|
|
TCGv_i32 s = tcg_const_i32(arg[0].imm);
|
|
|
|
TCGv_i32 imm = tcg_const_i32(arg[1].imm);
|
2017-11-04 04:29:27 +03:00
|
|
|
gen_helper_entry(cpu_env, pc, s, imm);
|
|
|
|
tcg_temp_free(imm);
|
|
|
|
tcg_temp_free(s);
|
|
|
|
tcg_temp_free(pc);
|
|
|
|
}
|
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
static void translate_extui(DisasContext *dc, const OpcodeArg arg[],
|
2017-11-04 04:29:27 +03:00
|
|
|
const uint32_t par[])
|
|
|
|
{
|
2019-02-12 05:53:19 +03:00
|
|
|
int maskimm = (1 << arg[3].imm) - 1;
|
2017-11-04 04:29:27 +03:00
|
|
|
|
2018-08-29 20:37:29 +03:00
|
|
|
TCGv_i32 tmp = tcg_temp_new_i32();
|
2019-02-12 05:53:19 +03:00
|
|
|
tcg_gen_shri_i32(tmp, arg[1].in, arg[2].imm);
|
|
|
|
tcg_gen_andi_i32(arg[0].out, tmp, maskimm);
|
2018-08-29 20:37:29 +03:00
|
|
|
tcg_temp_free(tmp);
|
2017-11-04 04:29:27 +03:00
|
|
|
}
|
|
|
|
|
2019-04-19 02:37:00 +03:00
|
|
|
static void translate_getex(DisasContext *dc, const OpcodeArg arg[],
|
|
|
|
const uint32_t par[])
|
|
|
|
{
|
|
|
|
TCGv_i32 tmp = tcg_temp_new_i32();
|
|
|
|
|
|
|
|
tcg_gen_extract_i32(tmp, cpu_SR[ATOMCTL], 8, 1);
|
|
|
|
tcg_gen_deposit_i32(cpu_SR[ATOMCTL], cpu_SR[ATOMCTL], arg[0].in, 8, 1);
|
|
|
|
tcg_gen_mov_i32(arg[0].out, tmp);
|
|
|
|
tcg_temp_free(tmp);
|
|
|
|
}
|
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
static void translate_icache(DisasContext *dc, const OpcodeArg arg[],
|
2017-11-04 04:29:27 +03:00
|
|
|
const uint32_t par[])
|
|
|
|
{
|
2017-01-25 21:54:11 +03:00
|
|
|
#ifndef CONFIG_USER_ONLY
|
2018-08-29 20:37:29 +03:00
|
|
|
TCGv_i32 addr = tcg_temp_new_i32();
|
2017-11-04 04:29:27 +03:00
|
|
|
|
2018-08-29 20:37:29 +03:00
|
|
|
tcg_gen_movi_i32(cpu_pc, dc->pc);
|
2019-02-12 05:53:19 +03:00
|
|
|
tcg_gen_addi_i32(addr, arg[0].in, arg[1].imm);
|
2018-08-29 20:37:29 +03:00
|
|
|
gen_helper_itlb_hit_test(cpu_env, addr);
|
|
|
|
tcg_temp_free(addr);
|
2017-01-25 21:54:11 +03:00
|
|
|
#endif
|
2017-11-04 04:29:27 +03:00
|
|
|
}
|
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
static void translate_itlb(DisasContext *dc, const OpcodeArg arg[],
|
2017-11-04 04:29:27 +03:00
|
|
|
const uint32_t par[])
|
|
|
|
{
|
2017-01-25 21:54:11 +03:00
|
|
|
#ifndef CONFIG_USER_ONLY
|
2018-08-29 20:37:29 +03:00
|
|
|
TCGv_i32 dtlb = tcg_const_i32(par[0]);
|
2017-11-04 04:29:27 +03:00
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
gen_helper_itlb(cpu_env, arg[0].in, dtlb);
|
2018-08-29 20:37:29 +03:00
|
|
|
tcg_temp_free(dtlb);
|
2017-01-25 21:54:11 +03:00
|
|
|
#endif
|
2017-11-04 04:29:27 +03:00
|
|
|
}
|
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
static void translate_j(DisasContext *dc, const OpcodeArg arg[],
|
2017-11-04 04:29:27 +03:00
|
|
|
const uint32_t par[])
|
|
|
|
{
|
2019-02-12 05:53:19 +03:00
|
|
|
gen_jumpi(dc, arg[0].imm, 0);
|
2017-11-04 04:29:27 +03:00
|
|
|
}
|
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
static void translate_jx(DisasContext *dc, const OpcodeArg arg[],
|
2017-11-04 04:29:27 +03:00
|
|
|
const uint32_t par[])
|
|
|
|
{
|
2019-02-12 05:53:19 +03:00
|
|
|
gen_jump(dc, arg[0].in);
|
2017-11-04 04:29:27 +03:00
|
|
|
}
|
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
static void translate_l32e(DisasContext *dc, const OpcodeArg arg[],
|
2017-11-04 04:29:27 +03:00
|
|
|
const uint32_t par[])
|
|
|
|
{
|
2018-08-29 20:37:29 +03:00
|
|
|
TCGv_i32 addr = tcg_temp_new_i32();
|
2017-11-04 04:29:27 +03:00
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
tcg_gen_addi_i32(addr, arg[1].in, arg[2].imm);
|
2018-08-29 20:37:29 +03:00
|
|
|
gen_load_store_alignment(dc, 2, addr, false);
|
2019-02-12 05:53:19 +03:00
|
|
|
tcg_gen_qemu_ld_tl(arg[0].out, addr, dc->ring, MO_TEUL);
|
2018-08-29 20:37:29 +03:00
|
|
|
tcg_temp_free(addr);
|
2017-11-04 04:29:27 +03:00
|
|
|
}
|
|
|
|
|
2019-04-19 02:37:00 +03:00
|
|
|
#ifdef CONFIG_USER_ONLY
|
|
|
|
static void gen_check_exclusive(DisasContext *dc, TCGv_i32 addr, bool is_write)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
#else
|
|
|
|
static void gen_check_exclusive(DisasContext *dc, TCGv_i32 addr, bool is_write)
|
|
|
|
{
|
|
|
|
if (!option_enabled(dc, XTENSA_OPTION_MPU)) {
|
|
|
|
TCGv_i32 tpc = tcg_const_i32(dc->pc);
|
|
|
|
TCGv_i32 write = tcg_const_i32(is_write);
|
|
|
|
|
|
|
|
gen_helper_check_exclusive(cpu_env, tpc, addr, write);
|
|
|
|
tcg_temp_free(tpc);
|
|
|
|
tcg_temp_free(write);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
static void translate_l32ex(DisasContext *dc, const OpcodeArg arg[],
|
|
|
|
const uint32_t par[])
|
|
|
|
{
|
|
|
|
TCGv_i32 addr = tcg_temp_new_i32();
|
|
|
|
|
|
|
|
tcg_gen_mov_i32(addr, arg[1].in);
|
|
|
|
gen_load_store_alignment(dc, 2, addr, true);
|
|
|
|
gen_check_exclusive(dc, addr, false);
|
|
|
|
tcg_gen_qemu_ld_i32(arg[0].out, addr, dc->ring, MO_TEUL);
|
|
|
|
tcg_gen_mov_i32(cpu_exclusive_addr, addr);
|
|
|
|
tcg_gen_mov_i32(cpu_exclusive_val, arg[0].out);
|
|
|
|
tcg_temp_free(addr);
|
|
|
|
}
|
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
static void translate_ldst(DisasContext *dc, const OpcodeArg arg[],
|
2017-11-04 04:29:27 +03:00
|
|
|
const uint32_t par[])
|
|
|
|
{
|
2018-08-29 20:37:29 +03:00
|
|
|
TCGv_i32 addr = tcg_temp_new_i32();
|
2017-11-04 04:29:27 +03:00
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
tcg_gen_addi_i32(addr, arg[1].in, arg[2].imm);
|
2018-08-29 20:37:29 +03:00
|
|
|
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);
|
2017-11-04 04:29:27 +03:00
|
|
|
}
|
2019-02-12 05:53:19 +03:00
|
|
|
tcg_gen_qemu_st_tl(arg[0].in, addr, dc->cring, par[0]);
|
2018-08-29 20:37:29 +03:00
|
|
|
} else {
|
2019-02-12 05:53:19 +03:00
|
|
|
tcg_gen_qemu_ld_tl(arg[0].out, addr, dc->cring, par[0]);
|
2018-08-29 20:37:29 +03:00
|
|
|
if (par[1]) {
|
|
|
|
tcg_gen_mb(TCG_BAR_LDAQ | TCG_MO_ALL);
|
2017-11-04 04:29:27 +03:00
|
|
|
}
|
|
|
|
}
|
2018-08-29 20:37:29 +03:00
|
|
|
tcg_temp_free(addr);
|
2017-11-04 04:29:27 +03:00
|
|
|
}
|
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
static void translate_l32r(DisasContext *dc, const OpcodeArg arg[],
|
2017-11-04 04:29:27 +03:00
|
|
|
const uint32_t par[])
|
|
|
|
{
|
2018-08-29 20:37:29 +03:00
|
|
|
TCGv_i32 tmp;
|
2017-11-04 04:29:27 +03:00
|
|
|
|
2018-08-29 20:37:29 +03:00
|
|
|
if (dc->base.tb->flags & XTENSA_TBFLAG_LITBASE) {
|
2019-02-12 05:53:19 +03:00
|
|
|
tmp = tcg_const_i32(arg[1].raw_imm - 1);
|
2018-08-29 20:37:29 +03:00
|
|
|
tcg_gen_add_i32(tmp, cpu_SR[LITBASE], tmp);
|
|
|
|
} else {
|
2019-02-12 05:53:19 +03:00
|
|
|
tmp = tcg_const_i32(arg[1].imm);
|
2017-11-04 04:29:27 +03:00
|
|
|
}
|
2019-02-12 05:53:19 +03:00
|
|
|
tcg_gen_qemu_ld32u(arg[0].out, tmp, dc->cring);
|
2018-08-29 20:37:29 +03:00
|
|
|
tcg_temp_free(tmp);
|
2017-11-04 04:29:27 +03:00
|
|
|
}
|
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
static void translate_loop(DisasContext *dc, const OpcodeArg arg[],
|
2017-11-04 04:29:27 +03:00
|
|
|
const uint32_t par[])
|
|
|
|
{
|
2019-02-12 05:53:19 +03:00
|
|
|
uint32_t lend = arg[1].imm;
|
2017-11-04 04:29:27 +03:00
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
tcg_gen_subi_i32(cpu_SR[LCOUNT], arg[0].in, 1);
|
2018-08-29 20:37:29 +03:00
|
|
|
tcg_gen_movi_i32(cpu_SR[LBEG], dc->base.pc_next);
|
2018-10-04 01:59:11 +03:00
|
|
|
tcg_gen_movi_i32(cpu_SR[LEND], lend);
|
2017-11-04 04:29:27 +03:00
|
|
|
|
2018-08-29 20:37:29 +03:00
|
|
|
if (par[0] != TCG_COND_NEVER) {
|
|
|
|
TCGLabel *label = gen_new_label();
|
2019-02-12 05:53:19 +03:00
|
|
|
tcg_gen_brcondi_i32(par[0], arg[0].in, 0, label);
|
2018-08-29 20:37:29 +03:00
|
|
|
gen_jumpi(dc, lend, 1);
|
|
|
|
gen_set_label(label);
|
2017-11-04 04:29:27 +03:00
|
|
|
}
|
2018-08-29 20:37:29 +03:00
|
|
|
|
|
|
|
gen_jumpi(dc, dc->base.pc_next, 0);
|
2017-11-04 04:29:27 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
enum {
|
|
|
|
MAC16_UMUL,
|
|
|
|
MAC16_MUL,
|
|
|
|
MAC16_MULA,
|
|
|
|
MAC16_MULS,
|
|
|
|
MAC16_NONE,
|
|
|
|
};
|
|
|
|
|
|
|
|
enum {
|
|
|
|
MAC16_LL,
|
|
|
|
MAC16_HL,
|
|
|
|
MAC16_LH,
|
|
|
|
MAC16_HH,
|
|
|
|
|
|
|
|
MAC16_HX = 0x1,
|
|
|
|
MAC16_XH = 0x2,
|
|
|
|
};
|
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
static void translate_mac16(DisasContext *dc, const OpcodeArg arg[],
|
2017-11-04 04:29:27 +03:00
|
|
|
const uint32_t par[])
|
|
|
|
{
|
|
|
|
int op = par[0];
|
2019-02-12 06:16:14 +03:00
|
|
|
unsigned half = par[1];
|
|
|
|
uint32_t ld_offset = par[2];
|
2017-11-04 04:29:27 +03:00
|
|
|
unsigned off = ld_offset ? 2 : 0;
|
2018-08-29 20:37:29 +03:00
|
|
|
TCGv_i32 vaddr = tcg_temp_new_i32();
|
|
|
|
TCGv_i32 mem32 = tcg_temp_new_i32();
|
2017-11-04 04:29:27 +03:00
|
|
|
|
|
|
|
if (ld_offset) {
|
2019-02-12 05:53:19 +03:00
|
|
|
tcg_gen_addi_i32(vaddr, arg[1].in, ld_offset);
|
2018-08-29 20:37:29 +03:00
|
|
|
gen_load_store_alignment(dc, 2, vaddr, false);
|
|
|
|
tcg_gen_qemu_ld32u(mem32, vaddr, dc->cring);
|
2017-11-04 04:29:27 +03:00
|
|
|
}
|
2018-08-29 20:37:29 +03:00
|
|
|
if (op != MAC16_NONE) {
|
2019-02-12 06:16:14 +03:00
|
|
|
TCGv_i32 m1 = gen_mac16_m(arg[off].in,
|
2018-08-29 20:37:29 +03:00
|
|
|
half & MAC16_HX, op == MAC16_UMUL);
|
2019-02-12 06:16:14 +03:00
|
|
|
TCGv_i32 m2 = gen_mac16_m(arg[off + 1].in,
|
2018-08-29 20:37:29 +03:00
|
|
|
half & MAC16_XH, op == MAC16_UMUL);
|
|
|
|
|
|
|
|
if (op == MAC16_MUL || op == MAC16_UMUL) {
|
|
|
|
tcg_gen_mul_i32(cpu_SR[ACCLO], m1, m2);
|
|
|
|
if (op == MAC16_UMUL) {
|
|
|
|
tcg_gen_movi_i32(cpu_SR[ACCHI], 0);
|
2017-11-04 04:29:27 +03:00
|
|
|
} else {
|
2018-08-29 20:37:29 +03:00
|
|
|
tcg_gen_sari_i32(cpu_SR[ACCHI], cpu_SR[ACCLO], 31);
|
2017-11-04 04:29:27 +03:00
|
|
|
}
|
2018-08-29 20:37:29 +03:00
|
|
|
} else {
|
|
|
|
TCGv_i32 lo = tcg_temp_new_i32();
|
|
|
|
TCGv_i32 hi = tcg_temp_new_i32();
|
|
|
|
|
|
|
|
tcg_gen_mul_i32(lo, m1, m2);
|
|
|
|
tcg_gen_sari_i32(hi, lo, 31);
|
|
|
|
if (op == 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);
|
2017-11-04 04:29:27 +03:00
|
|
|
}
|
2018-08-29 20:37:29 +03:00
|
|
|
tcg_temp_free(m1);
|
|
|
|
tcg_temp_free(m2);
|
|
|
|
}
|
|
|
|
if (ld_offset) {
|
2019-02-12 05:53:19 +03:00
|
|
|
tcg_gen_mov_i32(arg[1].out, vaddr);
|
|
|
|
tcg_gen_mov_i32(cpu_SR[MR + arg[0].imm], mem32);
|
2017-11-04 04:29:27 +03:00
|
|
|
}
|
2018-08-29 20:37:29 +03:00
|
|
|
tcg_temp_free(vaddr);
|
|
|
|
tcg_temp_free(mem32);
|
2017-11-04 04:29:27 +03:00
|
|
|
}
|
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
static void translate_memw(DisasContext *dc, const OpcodeArg arg[],
|
2017-03-07 04:17:43 +03:00
|
|
|
const uint32_t par[])
|
|
|
|
{
|
|
|
|
tcg_gen_mb(TCG_BAR_SC | TCG_MO_ALL);
|
|
|
|
}
|
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
static void translate_smin(DisasContext *dc, const OpcodeArg arg[],
|
2018-05-10 20:10:57 +03:00
|
|
|
const uint32_t par[])
|
2017-11-04 04:29:27 +03:00
|
|
|
{
|
2019-02-12 05:53:19 +03:00
|
|
|
tcg_gen_smin_i32(arg[0].out, arg[1].in, arg[2].in);
|
2018-05-10 20:10:57 +03:00
|
|
|
}
|
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
static void translate_umin(DisasContext *dc, const OpcodeArg arg[],
|
2018-05-10 20:10:57 +03:00
|
|
|
const uint32_t par[])
|
|
|
|
{
|
2019-02-12 05:53:19 +03:00
|
|
|
tcg_gen_umin_i32(arg[0].out, arg[1].in, arg[2].in);
|
2018-05-10 20:10:57 +03:00
|
|
|
}
|
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
static void translate_smax(DisasContext *dc, const OpcodeArg arg[],
|
2018-05-10 20:10:57 +03:00
|
|
|
const uint32_t par[])
|
|
|
|
{
|
2019-02-12 05:53:19 +03:00
|
|
|
tcg_gen_smax_i32(arg[0].out, arg[1].in, arg[2].in);
|
2018-05-10 20:10:57 +03:00
|
|
|
}
|
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
static void translate_umax(DisasContext *dc, const OpcodeArg arg[],
|
2018-05-10 20:10:57 +03:00
|
|
|
const uint32_t par[])
|
|
|
|
{
|
2019-02-12 05:53:19 +03:00
|
|
|
tcg_gen_umax_i32(arg[0].out, arg[1].in, arg[2].in);
|
2017-11-04 04:29:27 +03:00
|
|
|
}
|
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
static void translate_mov(DisasContext *dc, const OpcodeArg arg[],
|
2017-11-04 04:29:27 +03:00
|
|
|
const uint32_t par[])
|
|
|
|
{
|
2019-02-12 05:53:19 +03:00
|
|
|
tcg_gen_mov_i32(arg[0].out, arg[1].in);
|
2017-11-04 04:29:27 +03:00
|
|
|
}
|
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
static void translate_movcond(DisasContext *dc, const OpcodeArg arg[],
|
2017-11-04 04:29:27 +03:00
|
|
|
const uint32_t par[])
|
|
|
|
{
|
2018-08-29 20:37:29 +03:00
|
|
|
TCGv_i32 zero = tcg_const_i32(0);
|
2017-11-04 04:29:27 +03:00
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
tcg_gen_movcond_i32(par[0], arg[0].out,
|
|
|
|
arg[2].in, zero, arg[1].in, arg[0].in);
|
2018-08-29 20:37:29 +03:00
|
|
|
tcg_temp_free(zero);
|
2017-11-04 04:29:27 +03:00
|
|
|
}
|
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
static void translate_movi(DisasContext *dc, const OpcodeArg arg[],
|
2017-11-04 04:29:27 +03:00
|
|
|
const uint32_t par[])
|
|
|
|
{
|
2019-02-12 05:53:19 +03:00
|
|
|
tcg_gen_movi_i32(arg[0].out, arg[1].imm);
|
2017-11-04 04:29:27 +03:00
|
|
|
}
|
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
static void translate_movp(DisasContext *dc, const OpcodeArg arg[],
|
2017-11-04 04:29:27 +03:00
|
|
|
const uint32_t par[])
|
|
|
|
{
|
2018-08-29 20:37:29 +03:00
|
|
|
TCGv_i32 zero = tcg_const_i32(0);
|
|
|
|
TCGv_i32 tmp = tcg_temp_new_i32();
|
2017-11-04 04:29:27 +03:00
|
|
|
|
2019-02-15 00:27:50 +03:00
|
|
|
tcg_gen_andi_i32(tmp, arg[2].in, 1 << arg[2].imm);
|
2018-08-29 20:37:29 +03:00
|
|
|
tcg_gen_movcond_i32(par[0],
|
2019-02-12 05:53:19 +03:00
|
|
|
arg[0].out, tmp, zero,
|
|
|
|
arg[1].in, arg[0].in);
|
2018-08-29 20:37:29 +03:00
|
|
|
tcg_temp_free(tmp);
|
|
|
|
tcg_temp_free(zero);
|
2017-11-04 04:29:27 +03:00
|
|
|
}
|
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
static void translate_movsp(DisasContext *dc, const OpcodeArg arg[],
|
2017-11-04 04:29:27 +03:00
|
|
|
const uint32_t par[])
|
|
|
|
{
|
2019-02-12 05:53:19 +03:00
|
|
|
tcg_gen_mov_i32(arg[0].out, arg[1].in);
|
2017-11-04 04:29:27 +03:00
|
|
|
}
|
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
static void translate_mul16(DisasContext *dc, const OpcodeArg arg[],
|
2017-11-04 04:29:27 +03:00
|
|
|
const uint32_t par[])
|
|
|
|
{
|
2018-08-29 20:37:29 +03:00
|
|
|
TCGv_i32 v1 = tcg_temp_new_i32();
|
|
|
|
TCGv_i32 v2 = tcg_temp_new_i32();
|
2017-11-04 04:29:27 +03:00
|
|
|
|
2018-08-29 20:37:29 +03:00
|
|
|
if (par[0]) {
|
2019-02-12 05:53:19 +03:00
|
|
|
tcg_gen_ext16s_i32(v1, arg[1].in);
|
|
|
|
tcg_gen_ext16s_i32(v2, arg[2].in);
|
2018-08-29 20:37:29 +03:00
|
|
|
} else {
|
2019-02-12 05:53:19 +03:00
|
|
|
tcg_gen_ext16u_i32(v1, arg[1].in);
|
|
|
|
tcg_gen_ext16u_i32(v2, arg[2].in);
|
2017-11-04 04:29:27 +03:00
|
|
|
}
|
2019-02-12 05:53:19 +03:00
|
|
|
tcg_gen_mul_i32(arg[0].out, v1, v2);
|
2018-08-29 20:37:29 +03:00
|
|
|
tcg_temp_free(v2);
|
|
|
|
tcg_temp_free(v1);
|
2017-11-04 04:29:27 +03:00
|
|
|
}
|
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
static void translate_mull(DisasContext *dc, const OpcodeArg arg[],
|
2017-11-04 04:29:27 +03:00
|
|
|
const uint32_t par[])
|
|
|
|
{
|
2019-02-12 05:53:19 +03:00
|
|
|
tcg_gen_mul_i32(arg[0].out, arg[1].in, arg[2].in);
|
2017-11-04 04:29:27 +03:00
|
|
|
}
|
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
static void translate_mulh(DisasContext *dc, const OpcodeArg arg[],
|
2017-11-04 04:29:27 +03:00
|
|
|
const uint32_t par[])
|
|
|
|
{
|
2018-08-29 20:37:29 +03:00
|
|
|
TCGv_i32 lo = tcg_temp_new();
|
2017-11-04 04:29:27 +03:00
|
|
|
|
2018-08-29 20:37:29 +03:00
|
|
|
if (par[0]) {
|
2019-02-12 05:53:19 +03:00
|
|
|
tcg_gen_muls2_i32(lo, arg[0].out, arg[1].in, arg[2].in);
|
2018-08-29 20:37:29 +03:00
|
|
|
} else {
|
2019-02-12 05:53:19 +03:00
|
|
|
tcg_gen_mulu2_i32(lo, arg[0].out, arg[1].in, arg[2].in);
|
2017-11-04 04:29:27 +03:00
|
|
|
}
|
2018-08-29 20:37:29 +03:00
|
|
|
tcg_temp_free(lo);
|
2017-11-04 04:29:27 +03:00
|
|
|
}
|
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
static void translate_neg(DisasContext *dc, const OpcodeArg arg[],
|
2017-11-04 04:29:27 +03:00
|
|
|
const uint32_t par[])
|
|
|
|
{
|
2019-02-12 05:53:19 +03:00
|
|
|
tcg_gen_neg_i32(arg[0].out, arg[1].in);
|
2017-11-04 04:29:27 +03:00
|
|
|
}
|
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
static void translate_nop(DisasContext *dc, const OpcodeArg arg[],
|
2017-11-04 04:29:27 +03:00
|
|
|
const uint32_t par[])
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
static void translate_nsa(DisasContext *dc, const OpcodeArg arg[],
|
2017-11-04 04:29:27 +03:00
|
|
|
const uint32_t par[])
|
|
|
|
{
|
2019-02-12 05:53:19 +03:00
|
|
|
tcg_gen_clrsb_i32(arg[0].out, arg[1].in);
|
2017-11-04 04:29:27 +03:00
|
|
|
}
|
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
static void translate_nsau(DisasContext *dc, const OpcodeArg arg[],
|
2017-11-04 04:29:27 +03:00
|
|
|
const uint32_t par[])
|
|
|
|
{
|
2019-02-12 05:53:19 +03:00
|
|
|
tcg_gen_clzi_i32(arg[0].out, arg[1].in, 32);
|
2017-11-04 04:29:27 +03:00
|
|
|
}
|
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
static void translate_or(DisasContext *dc, const OpcodeArg arg[],
|
2017-11-04 04:29:27 +03:00
|
|
|
const uint32_t par[])
|
|
|
|
{
|
2019-02-12 05:53:19 +03:00
|
|
|
tcg_gen_or_i32(arg[0].out, arg[1].in, arg[2].in);
|
2017-11-04 04:29:27 +03:00
|
|
|
}
|
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
static void translate_ptlb(DisasContext *dc, const OpcodeArg arg[],
|
2017-11-04 04:29:27 +03:00
|
|
|
const uint32_t par[])
|
|
|
|
{
|
2017-01-25 21:54:11 +03:00
|
|
|
#ifndef CONFIG_USER_ONLY
|
2018-08-29 20:37:29 +03:00
|
|
|
TCGv_i32 dtlb = tcg_const_i32(par[0]);
|
2017-11-04 04:29:27 +03:00
|
|
|
|
2018-08-29 20:37:29 +03:00
|
|
|
tcg_gen_movi_i32(cpu_pc, dc->pc);
|
2019-02-12 05:53:19 +03:00
|
|
|
gen_helper_ptlb(arg[0].out, cpu_env, arg[1].in, dtlb);
|
2018-08-29 20:37:29 +03:00
|
|
|
tcg_temp_free(dtlb);
|
2017-01-25 21:54:11 +03:00
|
|
|
#endif
|
2017-11-04 04:29:27 +03:00
|
|
|
}
|
|
|
|
|
2019-03-13 22:40:38 +03:00
|
|
|
static void translate_pptlb(DisasContext *dc, const OpcodeArg arg[],
|
|
|
|
const uint32_t par[])
|
|
|
|
{
|
|
|
|
#ifndef CONFIG_USER_ONLY
|
|
|
|
tcg_gen_movi_i32(cpu_pc, dc->pc);
|
|
|
|
gen_helper_pptlb(arg[0].out, cpu_env, arg[1].in);
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
static void translate_quos(DisasContext *dc, const OpcodeArg arg[],
|
2017-11-04 04:29:27 +03:00
|
|
|
const uint32_t par[])
|
|
|
|
{
|
2018-08-29 20:37:29 +03:00
|
|
|
TCGLabel *label1 = gen_new_label();
|
|
|
|
TCGLabel *label2 = gen_new_label();
|
2017-11-04 04:29:27 +03:00
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
tcg_gen_brcondi_i32(TCG_COND_NE, arg[1].in, 0x80000000,
|
2018-08-29 20:37:29 +03:00
|
|
|
label1);
|
2019-02-12 05:53:19 +03:00
|
|
|
tcg_gen_brcondi_i32(TCG_COND_NE, arg[2].in, 0xffffffff,
|
2018-08-29 20:37:29 +03:00
|
|
|
label1);
|
2019-02-12 05:53:19 +03:00
|
|
|
tcg_gen_movi_i32(arg[0].out,
|
2018-08-29 20:37:29 +03:00
|
|
|
par[0] ? 0x80000000 : 0);
|
|
|
|
tcg_gen_br(label2);
|
|
|
|
gen_set_label(label1);
|
|
|
|
if (par[0]) {
|
2019-02-12 05:53:19 +03:00
|
|
|
tcg_gen_div_i32(arg[0].out,
|
|
|
|
arg[1].in, arg[2].in);
|
2018-08-29 20:37:29 +03:00
|
|
|
} else {
|
2019-02-12 05:53:19 +03:00
|
|
|
tcg_gen_rem_i32(arg[0].out,
|
|
|
|
arg[1].in, arg[2].in);
|
2017-11-04 04:29:27 +03:00
|
|
|
}
|
2018-08-29 20:37:29 +03:00
|
|
|
gen_set_label(label2);
|
2017-11-04 04:29:27 +03:00
|
|
|
}
|
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
static void translate_quou(DisasContext *dc, const OpcodeArg arg[],
|
2017-11-04 04:29:27 +03:00
|
|
|
const uint32_t par[])
|
|
|
|
{
|
2019-02-12 05:53:19 +03:00
|
|
|
tcg_gen_divu_i32(arg[0].out,
|
|
|
|
arg[1].in, arg[2].in);
|
2017-11-04 04:29:27 +03:00
|
|
|
}
|
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
static void translate_read_impwire(DisasContext *dc, const OpcodeArg arg[],
|
2017-02-18 03:21:36 +03:00
|
|
|
const uint32_t par[])
|
|
|
|
{
|
2018-08-29 20:37:29 +03:00
|
|
|
/* TODO: GPIO32 may be a part of coprocessor */
|
2019-02-12 05:53:19 +03:00
|
|
|
tcg_gen_movi_i32(arg[0].out, 0);
|
2017-02-18 03:21:36 +03:00
|
|
|
}
|
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
static void translate_remu(DisasContext *dc, const OpcodeArg arg[],
|
2018-09-01 07:26:54 +03:00
|
|
|
const uint32_t par[])
|
|
|
|
{
|
2019-02-12 05:53:19 +03:00
|
|
|
tcg_gen_remu_i32(arg[0].out,
|
|
|
|
arg[1].in, arg[2].in);
|
2018-09-01 07:26:54 +03:00
|
|
|
}
|
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
static void translate_rer(DisasContext *dc, const OpcodeArg arg[],
|
2017-11-04 04:29:27 +03:00
|
|
|
const uint32_t par[])
|
|
|
|
{
|
2019-02-12 05:53:19 +03:00
|
|
|
gen_helper_rer(arg[0].out, cpu_env, arg[1].in);
|
2017-11-04 04:29:27 +03:00
|
|
|
}
|
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
static void translate_ret(DisasContext *dc, const OpcodeArg arg[],
|
2017-11-04 04:29:27 +03:00
|
|
|
const uint32_t par[])
|
|
|
|
{
|
|
|
|
gen_jump(dc, cpu_R[0]);
|
|
|
|
}
|
|
|
|
|
2020-05-05 00:08:40 +03:00
|
|
|
static uint32_t test_exceptions_retw(DisasContext *dc, const OpcodeArg arg[],
|
|
|
|
const uint32_t par[])
|
2018-08-28 07:43:43 +03:00
|
|
|
{
|
|
|
|
if (!dc->cwoe) {
|
|
|
|
qemu_log_mask(LOG_GUEST_ERROR,
|
|
|
|
"Illegal retw instruction(pc = %08x)\n", dc->pc);
|
2020-05-05 00:08:40 +03:00
|
|
|
return XTENSA_OP_ILL;
|
2018-08-28 07:43:43 +03:00
|
|
|
} else {
|
|
|
|
TCGv_i32 tmp = tcg_const_i32(dc->pc);
|
|
|
|
|
|
|
|
gen_helper_test_ill_retw(cpu_env, tmp);
|
|
|
|
tcg_temp_free(tmp);
|
2020-05-05 00:08:40 +03:00
|
|
|
return 0;
|
2018-08-28 07:43:43 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
static void translate_retw(DisasContext *dc, const OpcodeArg arg[],
|
2017-11-04 04:29:27 +03:00
|
|
|
const uint32_t par[])
|
|
|
|
{
|
2019-02-11 23:22:29 +03:00
|
|
|
TCGv_i32 tmp = tcg_const_i32(1);
|
|
|
|
tcg_gen_shl_i32(tmp, tmp, cpu_SR[WINDOW_BASE]);
|
|
|
|
tcg_gen_andc_i32(cpu_SR[WINDOW_START],
|
|
|
|
cpu_SR[WINDOW_START], tmp);
|
|
|
|
tcg_gen_movi_i32(tmp, dc->pc);
|
|
|
|
tcg_gen_deposit_i32(tmp, tmp, cpu_R[0], 0, 30);
|
|
|
|
gen_helper_retw(cpu_env, cpu_R[0]);
|
2017-11-04 04:29:27 +03:00
|
|
|
gen_jump(dc, tmp);
|
|
|
|
tcg_temp_free(tmp);
|
|
|
|
}
|
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
static void translate_rfde(DisasContext *dc, const OpcodeArg arg[],
|
2017-11-04 04:29:27 +03:00
|
|
|
const uint32_t par[])
|
|
|
|
{
|
2018-08-28 08:17:50 +03:00
|
|
|
gen_jump(dc, cpu_SR[dc->config->ndepc ? DEPC : EPC1]);
|
2017-11-04 04:29:27 +03:00
|
|
|
}
|
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
static void translate_rfe(DisasContext *dc, const OpcodeArg arg[],
|
2017-11-04 04:29:27 +03:00
|
|
|
const uint32_t par[])
|
|
|
|
{
|
2018-08-28 08:17:50 +03:00
|
|
|
tcg_gen_andi_i32(cpu_SR[PS], cpu_SR[PS], ~PS_EXCM);
|
|
|
|
gen_jump(dc, cpu_SR[EPC1]);
|
2017-11-04 04:29:27 +03:00
|
|
|
}
|
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
static void translate_rfi(DisasContext *dc, const OpcodeArg arg[],
|
2017-11-04 04:29:27 +03:00
|
|
|
const uint32_t par[])
|
|
|
|
{
|
2019-02-12 05:53:19 +03:00
|
|
|
tcg_gen_mov_i32(cpu_SR[PS], cpu_SR[EPS2 + arg[0].imm - 2]);
|
|
|
|
gen_jump(dc, cpu_SR[EPC1 + arg[0].imm - 1]);
|
2017-11-04 04:29:27 +03:00
|
|
|
}
|
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
static void translate_rfw(DisasContext *dc, const OpcodeArg arg[],
|
2017-11-04 04:29:27 +03:00
|
|
|
const uint32_t par[])
|
|
|
|
{
|
2018-08-28 08:17:50 +03:00
|
|
|
TCGv_i32 tmp = tcg_const_i32(1);
|
2017-11-04 04:29:27 +03:00
|
|
|
|
2018-08-28 08:17:50 +03:00
|
|
|
tcg_gen_andi_i32(cpu_SR[PS], cpu_SR[PS], ~PS_EXCM);
|
|
|
|
tcg_gen_shl_i32(tmp, tmp, cpu_SR[WINDOW_BASE]);
|
2017-11-04 04:29:27 +03:00
|
|
|
|
2018-08-28 08:17:50 +03:00
|
|
|
if (par[0]) {
|
|
|
|
tcg_gen_andc_i32(cpu_SR[WINDOW_START],
|
|
|
|
cpu_SR[WINDOW_START], tmp);
|
|
|
|
} else {
|
|
|
|
tcg_gen_or_i32(cpu_SR[WINDOW_START],
|
|
|
|
cpu_SR[WINDOW_START], tmp);
|
|
|
|
}
|
2017-11-04 04:29:27 +03:00
|
|
|
|
2018-09-02 12:07:30 +03:00
|
|
|
tcg_temp_free(tmp);
|
2018-08-28 08:17:50 +03:00
|
|
|
gen_helper_restore_owb(cpu_env);
|
|
|
|
gen_jump(dc, cpu_SR[EPC1]);
|
2017-11-04 04:29:27 +03:00
|
|
|
}
|
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
static void translate_rotw(DisasContext *dc, const OpcodeArg arg[],
|
2017-11-04 04:29:27 +03:00
|
|
|
const uint32_t par[])
|
|
|
|
{
|
2019-02-12 05:53:19 +03:00
|
|
|
tcg_gen_addi_i32(cpu_windowbase_next, cpu_SR[WINDOW_BASE], arg[0].imm);
|
2017-11-04 04:29:27 +03:00
|
|
|
}
|
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
static void translate_rsil(DisasContext *dc, const OpcodeArg arg[],
|
2017-11-04 04:29:27 +03:00
|
|
|
const uint32_t par[])
|
|
|
|
{
|
2019-02-12 05:53:19 +03:00
|
|
|
tcg_gen_mov_i32(arg[0].out, cpu_SR[PS]);
|
2018-08-29 20:37:29 +03:00
|
|
|
tcg_gen_andi_i32(cpu_SR[PS], cpu_SR[PS], ~PS_INTLEVEL);
|
2019-02-12 05:53:19 +03:00
|
|
|
tcg_gen_ori_i32(cpu_SR[PS], cpu_SR[PS], arg[1].imm);
|
2017-11-04 04:29:27 +03:00
|
|
|
}
|
|
|
|
|
2019-03-19 03:10:38 +03:00
|
|
|
static void translate_rsr(DisasContext *dc, const OpcodeArg arg[],
|
|
|
|
const uint32_t par[])
|
2018-08-28 07:43:43 +03:00
|
|
|
{
|
2020-04-29 01:59:08 +03:00
|
|
|
if (sr_name[par[0]]) {
|
|
|
|
tcg_gen_mov_i32(arg[0].out, cpu_SR[par[0]]);
|
|
|
|
} else {
|
|
|
|
tcg_gen_movi_i32(arg[0].out, 0);
|
|
|
|
}
|
2018-08-28 07:43:43 +03:00
|
|
|
}
|
|
|
|
|
2019-03-19 03:10:38 +03:00
|
|
|
static void translate_rsr_ccount(DisasContext *dc, const OpcodeArg arg[],
|
|
|
|
const uint32_t par[])
|
|
|
|
{
|
|
|
|
#ifndef CONFIG_USER_ONLY
|
|
|
|
if (tb_cflags(dc->base.tb) & CF_USE_ICOUNT) {
|
|
|
|
gen_io_start();
|
|
|
|
}
|
|
|
|
gen_helper_update_ccount(cpu_env);
|
|
|
|
tcg_gen_mov_i32(arg[0].out, cpu_SR[par[0]]);
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
static void translate_rsr_ptevaddr(DisasContext *dc, const OpcodeArg arg[],
|
|
|
|
const uint32_t par[])
|
2017-11-04 04:29:27 +03:00
|
|
|
{
|
2019-03-19 03:10:38 +03:00
|
|
|
#ifndef CONFIG_USER_ONLY
|
|
|
|
TCGv_i32 tmp = tcg_temp_new_i32();
|
|
|
|
|
|
|
|
tcg_gen_shri_i32(tmp, cpu_SR[EXCVADDR], 10);
|
|
|
|
tcg_gen_or_i32(tmp, tmp, cpu_SR[PTEVADDR]);
|
|
|
|
tcg_gen_andi_i32(arg[0].out, tmp, 0xfffffffc);
|
|
|
|
tcg_temp_free(tmp);
|
|
|
|
#endif
|
2017-11-04 04:29:27 +03:00
|
|
|
}
|
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
static void translate_rtlb(DisasContext *dc, const OpcodeArg arg[],
|
2017-11-04 04:29:27 +03:00
|
|
|
const uint32_t par[])
|
|
|
|
{
|
2018-08-28 08:17:50 +03:00
|
|
|
#ifndef CONFIG_USER_ONLY
|
2017-11-04 04:29:27 +03:00
|
|
|
static void (* const helper[])(TCGv_i32 r, TCGv_env env, TCGv_i32 a1,
|
|
|
|
TCGv_i32 a2) = {
|
|
|
|
gen_helper_rtlb0,
|
|
|
|
gen_helper_rtlb1,
|
|
|
|
};
|
2018-08-29 20:37:29 +03:00
|
|
|
TCGv_i32 dtlb = tcg_const_i32(par[0]);
|
2017-11-04 04:29:27 +03:00
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
helper[par[1]](arg[0].out, cpu_env, arg[1].in, dtlb);
|
2018-08-29 20:37:29 +03:00
|
|
|
tcg_temp_free(dtlb);
|
2018-08-28 08:17:50 +03:00
|
|
|
#endif
|
2017-11-04 04:29:27 +03:00
|
|
|
}
|
|
|
|
|
2019-03-13 22:40:38 +03:00
|
|
|
static void translate_rptlb0(DisasContext *dc, const OpcodeArg arg[],
|
|
|
|
const uint32_t par[])
|
2017-11-04 04:29:27 +03:00
|
|
|
{
|
2019-03-13 22:40:38 +03:00
|
|
|
#ifndef CONFIG_USER_ONLY
|
|
|
|
gen_helper_rptlb0(arg[0].out, cpu_env, arg[1].in);
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
static void translate_rptlb1(DisasContext *dc, const OpcodeArg arg[],
|
|
|
|
const uint32_t par[])
|
|
|
|
{
|
|
|
|
#ifndef CONFIG_USER_ONLY
|
|
|
|
gen_helper_rptlb1(arg[0].out, cpu_env, arg[1].in);
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
static void translate_rur(DisasContext *dc, const OpcodeArg arg[],
|
2017-11-04 04:29:27 +03:00
|
|
|
const uint32_t par[])
|
|
|
|
{
|
2019-03-19 03:10:38 +03:00
|
|
|
tcg_gen_mov_i32(arg[0].out, cpu_UR[par[0]]);
|
2017-11-04 04:29:27 +03:00
|
|
|
}
|
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
static void translate_setb_expstate(DisasContext *dc, const OpcodeArg arg[],
|
2017-02-18 03:21:36 +03:00
|
|
|
const uint32_t par[])
|
|
|
|
{
|
|
|
|
/* TODO: GPIO32 may be a part of coprocessor */
|
2019-02-12 05:53:19 +03:00
|
|
|
tcg_gen_ori_i32(cpu_UR[EXPSTATE], cpu_UR[EXPSTATE], 1u << arg[0].imm);
|
2017-02-18 03:21:36 +03:00
|
|
|
}
|
|
|
|
|
2017-03-07 04:17:43 +03:00
|
|
|
#ifdef CONFIG_USER_ONLY
|
|
|
|
static void gen_check_atomctl(DisasContext *dc, TCGv_i32 addr)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
#else
|
|
|
|
static void gen_check_atomctl(DisasContext *dc, TCGv_i32 addr)
|
|
|
|
{
|
|
|
|
TCGv_i32 tpc = tcg_const_i32(dc->pc);
|
|
|
|
|
|
|
|
gen_helper_check_atomctl(cpu_env, tpc, addr);
|
|
|
|
tcg_temp_free(tpc);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
static void translate_s32c1i(DisasContext *dc, const OpcodeArg arg[],
|
2017-11-04 04:29:27 +03:00
|
|
|
const uint32_t par[])
|
|
|
|
{
|
2018-08-29 20:37:29 +03:00
|
|
|
TCGv_i32 tmp = tcg_temp_local_new_i32();
|
|
|
|
TCGv_i32 addr = tcg_temp_local_new_i32();
|
2017-11-04 04:29:27 +03:00
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
tcg_gen_mov_i32(tmp, arg[0].in);
|
|
|
|
tcg_gen_addi_i32(addr, arg[1].in, arg[2].imm);
|
2018-08-29 20:37:29 +03:00
|
|
|
gen_load_store_alignment(dc, 2, addr, true);
|
|
|
|
gen_check_atomctl(dc, addr);
|
2019-02-12 05:53:19 +03:00
|
|
|
tcg_gen_atomic_cmpxchg_i32(arg[0].out, addr, cpu_SR[SCOMPARE1],
|
2018-08-29 20:37:29 +03:00
|
|
|
tmp, dc->cring, MO_TEUL);
|
|
|
|
tcg_temp_free(addr);
|
|
|
|
tcg_temp_free(tmp);
|
2017-11-04 04:29:27 +03:00
|
|
|
}
|
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
static void translate_s32e(DisasContext *dc, const OpcodeArg arg[],
|
2017-11-04 04:29:27 +03:00
|
|
|
const uint32_t par[])
|
|
|
|
{
|
2018-08-29 20:37:29 +03:00
|
|
|
TCGv_i32 addr = tcg_temp_new_i32();
|
2017-11-04 04:29:27 +03:00
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
tcg_gen_addi_i32(addr, arg[1].in, arg[2].imm);
|
2018-08-29 20:37:29 +03:00
|
|
|
gen_load_store_alignment(dc, 2, addr, false);
|
2019-02-12 05:53:19 +03:00
|
|
|
tcg_gen_qemu_st_tl(arg[0].in, addr, dc->ring, MO_TEUL);
|
2018-08-29 20:37:29 +03:00
|
|
|
tcg_temp_free(addr);
|
2017-11-04 04:29:27 +03:00
|
|
|
}
|
|
|
|
|
2019-04-19 02:37:00 +03:00
|
|
|
static void translate_s32ex(DisasContext *dc, const OpcodeArg arg[],
|
|
|
|
const uint32_t par[])
|
|
|
|
{
|
|
|
|
TCGv_i32 prev = tcg_temp_new_i32();
|
|
|
|
TCGv_i32 addr = tcg_temp_local_new_i32();
|
|
|
|
TCGv_i32 res = tcg_temp_local_new_i32();
|
|
|
|
TCGLabel *label = gen_new_label();
|
|
|
|
|
|
|
|
tcg_gen_movi_i32(res, 0);
|
|
|
|
tcg_gen_mov_i32(addr, arg[1].in);
|
|
|
|
gen_load_store_alignment(dc, 2, addr, true);
|
|
|
|
tcg_gen_brcond_i32(TCG_COND_NE, addr, cpu_exclusive_addr, label);
|
|
|
|
gen_check_exclusive(dc, addr, true);
|
|
|
|
tcg_gen_atomic_cmpxchg_i32(prev, cpu_exclusive_addr, cpu_exclusive_val,
|
|
|
|
arg[0].in, dc->cring, MO_TEUL);
|
|
|
|
tcg_gen_setcond_i32(TCG_COND_EQ, res, prev, cpu_exclusive_val);
|
|
|
|
tcg_gen_movcond_i32(TCG_COND_EQ, cpu_exclusive_val,
|
|
|
|
prev, cpu_exclusive_val, prev, cpu_exclusive_val);
|
|
|
|
tcg_gen_movi_i32(cpu_exclusive_addr, -1);
|
|
|
|
gen_set_label(label);
|
|
|
|
tcg_gen_extract_i32(arg[0].out, cpu_SR[ATOMCTL], 8, 1);
|
|
|
|
tcg_gen_deposit_i32(cpu_SR[ATOMCTL], cpu_SR[ATOMCTL], res, 8, 1);
|
|
|
|
tcg_temp_free(prev);
|
|
|
|
tcg_temp_free(addr);
|
|
|
|
tcg_temp_free(res);
|
|
|
|
}
|
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
static void translate_salt(DisasContext *dc, const OpcodeArg arg[],
|
2017-02-18 03:39:30 +03:00
|
|
|
const uint32_t par[])
|
|
|
|
{
|
2018-08-29 20:37:29 +03:00
|
|
|
tcg_gen_setcond_i32(par[0],
|
2019-02-12 05:53:19 +03:00
|
|
|
arg[0].out,
|
|
|
|
arg[1].in, arg[2].in);
|
2017-02-18 03:39:30 +03:00
|
|
|
}
|
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
static void translate_sext(DisasContext *dc, const OpcodeArg arg[],
|
2017-11-04 04:29:27 +03:00
|
|
|
const uint32_t par[])
|
|
|
|
{
|
2019-02-12 05:53:19 +03:00
|
|
|
int shift = 31 - arg[2].imm;
|
2017-11-04 04:29:27 +03:00
|
|
|
|
2018-08-29 20:37:29 +03:00
|
|
|
if (shift == 24) {
|
2019-02-12 05:53:19 +03:00
|
|
|
tcg_gen_ext8s_i32(arg[0].out, arg[1].in);
|
2018-08-29 20:37:29 +03:00
|
|
|
} else if (shift == 16) {
|
2019-02-12 05:53:19 +03:00
|
|
|
tcg_gen_ext16s_i32(arg[0].out, arg[1].in);
|
2018-08-29 20:37:29 +03:00
|
|
|
} else {
|
|
|
|
TCGv_i32 tmp = tcg_temp_new_i32();
|
2019-02-12 05:53:19 +03:00
|
|
|
tcg_gen_shli_i32(tmp, arg[1].in, shift);
|
|
|
|
tcg_gen_sari_i32(arg[0].out, tmp, shift);
|
2018-08-29 20:37:29 +03:00
|
|
|
tcg_temp_free(tmp);
|
2017-11-04 04:29:27 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-05-05 00:08:40 +03:00
|
|
|
static uint32_t test_exceptions_simcall(DisasContext *dc,
|
|
|
|
const OpcodeArg arg[],
|
|
|
|
const uint32_t par[])
|
2018-08-28 07:43:43 +03:00
|
|
|
{
|
|
|
|
#ifdef CONFIG_USER_ONLY
|
|
|
|
bool ill = true;
|
|
|
|
#else
|
2020-05-04 15:15:14 +03:00
|
|
|
/* Between RE.2 and RE.3 simcall opcode's become nop for the hardware. */
|
|
|
|
bool ill = dc->config->hw_version <= 250002 && !semihosting_enabled();
|
2018-08-28 07:43:43 +03:00
|
|
|
#endif
|
2020-05-04 15:15:14 +03:00
|
|
|
if (ill || !semihosting_enabled()) {
|
2018-08-28 07:43:43 +03:00
|
|
|
qemu_log_mask(LOG_GUEST_ERROR, "SIMCALL but semihosting is disabled\n");
|
|
|
|
}
|
2020-05-05 00:08:40 +03:00
|
|
|
return ill ? XTENSA_OP_ILL : 0;
|
2018-08-28 07:43:43 +03:00
|
|
|
}
|
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
static void translate_simcall(DisasContext *dc, const OpcodeArg arg[],
|
2017-11-04 04:29:27 +03:00
|
|
|
const uint32_t par[])
|
|
|
|
{
|
2017-01-25 21:54:11 +03:00
|
|
|
#ifndef CONFIG_USER_ONLY
|
2020-05-04 15:15:14 +03:00
|
|
|
if (semihosting_enabled()) {
|
|
|
|
gen_helper_simcall(cpu_env);
|
|
|
|
}
|
2018-08-28 07:43:43 +03:00
|
|
|
#endif
|
2017-11-04 04:29:27 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Note: 64 bit ops are used here solely because SAR values
|
|
|
|
* have range 0..63
|
|
|
|
*/
|
|
|
|
#define gen_shift_reg(cmd, reg) do { \
|
|
|
|
TCGv_i64 tmp = tcg_temp_new_i64(); \
|
|
|
|
tcg_gen_extu_i32_i64(tmp, reg); \
|
|
|
|
tcg_gen_##cmd##_i64(v, v, tmp); \
|
2019-02-12 05:53:19 +03:00
|
|
|
tcg_gen_extrl_i64_i32(arg[0].out, v); \
|
2017-11-04 04:29:27 +03:00
|
|
|
tcg_temp_free_i64(v); \
|
|
|
|
tcg_temp_free_i64(tmp); \
|
|
|
|
} while (0)
|
|
|
|
|
|
|
|
#define gen_shift(cmd) gen_shift_reg(cmd, cpu_SR[SAR])
|
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
static void translate_sll(DisasContext *dc, const OpcodeArg arg[],
|
2017-11-04 04:29:27 +03:00
|
|
|
const uint32_t par[])
|
|
|
|
{
|
2018-08-29 20:37:29 +03:00
|
|
|
if (dc->sar_m32_5bit) {
|
2019-02-12 05:53:19 +03:00
|
|
|
tcg_gen_shl_i32(arg[0].out, arg[1].in, dc->sar_m32);
|
2018-08-29 20:37:29 +03:00
|
|
|
} else {
|
|
|
|
TCGv_i64 v = tcg_temp_new_i64();
|
|
|
|
TCGv_i32 s = tcg_const_i32(32);
|
|
|
|
tcg_gen_sub_i32(s, s, cpu_SR[SAR]);
|
|
|
|
tcg_gen_andi_i32(s, s, 0x3f);
|
2019-02-12 05:53:19 +03:00
|
|
|
tcg_gen_extu_i32_i64(v, arg[1].in);
|
2018-08-29 20:37:29 +03:00
|
|
|
gen_shift_reg(shl, s);
|
|
|
|
tcg_temp_free(s);
|
2017-11-04 04:29:27 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
static void translate_slli(DisasContext *dc, const OpcodeArg arg[],
|
2017-11-04 04:29:27 +03:00
|
|
|
const uint32_t par[])
|
|
|
|
{
|
2019-02-12 05:53:19 +03:00
|
|
|
if (arg[2].imm == 32) {
|
2018-08-29 20:37:29 +03:00
|
|
|
qemu_log_mask(LOG_GUEST_ERROR, "slli a%d, a%d, 32 is undefined\n",
|
2019-02-12 05:53:19 +03:00
|
|
|
arg[0].imm, arg[1].imm);
|
2017-11-04 04:29:27 +03:00
|
|
|
}
|
2019-02-12 05:53:19 +03:00
|
|
|
tcg_gen_shli_i32(arg[0].out, arg[1].in, arg[2].imm & 0x1f);
|
2017-11-04 04:29:27 +03:00
|
|
|
}
|
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
static void translate_sra(DisasContext *dc, const OpcodeArg arg[],
|
2017-11-04 04:29:27 +03:00
|
|
|
const uint32_t par[])
|
|
|
|
{
|
2018-08-29 20:37:29 +03:00
|
|
|
if (dc->sar_m32_5bit) {
|
2019-02-12 05:53:19 +03:00
|
|
|
tcg_gen_sar_i32(arg[0].out, arg[1].in, cpu_SR[SAR]);
|
2018-08-29 20:37:29 +03:00
|
|
|
} else {
|
|
|
|
TCGv_i64 v = tcg_temp_new_i64();
|
2019-02-12 05:53:19 +03:00
|
|
|
tcg_gen_ext_i32_i64(v, arg[1].in);
|
2018-08-29 20:37:29 +03:00
|
|
|
gen_shift(sar);
|
2017-11-04 04:29:27 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
static void translate_srai(DisasContext *dc, const OpcodeArg arg[],
|
2017-11-04 04:29:27 +03:00
|
|
|
const uint32_t par[])
|
|
|
|
{
|
2019-02-12 05:53:19 +03:00
|
|
|
tcg_gen_sari_i32(arg[0].out, arg[1].in, arg[2].imm);
|
2017-11-04 04:29:27 +03:00
|
|
|
}
|
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
static void translate_src(DisasContext *dc, const OpcodeArg arg[],
|
2017-11-04 04:29:27 +03:00
|
|
|
const uint32_t par[])
|
|
|
|
{
|
2018-08-29 20:37:29 +03:00
|
|
|
TCGv_i64 v = tcg_temp_new_i64();
|
2019-02-12 05:53:19 +03:00
|
|
|
tcg_gen_concat_i32_i64(v, arg[2].in, arg[1].in);
|
2018-08-29 20:37:29 +03:00
|
|
|
gen_shift(shr);
|
2017-11-04 04:29:27 +03:00
|
|
|
}
|
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
static void translate_srl(DisasContext *dc, const OpcodeArg arg[],
|
2017-11-04 04:29:27 +03:00
|
|
|
const uint32_t par[])
|
|
|
|
{
|
2018-08-29 20:37:29 +03:00
|
|
|
if (dc->sar_m32_5bit) {
|
2019-02-12 05:53:19 +03:00
|
|
|
tcg_gen_shr_i32(arg[0].out, arg[1].in, cpu_SR[SAR]);
|
2018-08-29 20:37:29 +03:00
|
|
|
} else {
|
|
|
|
TCGv_i64 v = tcg_temp_new_i64();
|
2019-02-12 05:53:19 +03:00
|
|
|
tcg_gen_extu_i32_i64(v, arg[1].in);
|
2018-08-29 20:37:29 +03:00
|
|
|
gen_shift(shr);
|
2017-11-04 04:29:27 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#undef gen_shift
|
|
|
|
#undef gen_shift_reg
|
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
static void translate_srli(DisasContext *dc, const OpcodeArg arg[],
|
2017-11-04 04:29:27 +03:00
|
|
|
const uint32_t par[])
|
|
|
|
{
|
2019-02-12 05:53:19 +03:00
|
|
|
tcg_gen_shri_i32(arg[0].out, arg[1].in, arg[2].imm);
|
2017-11-04 04:29:27 +03:00
|
|
|
}
|
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
static void translate_ssa8b(DisasContext *dc, const OpcodeArg arg[],
|
2017-11-04 04:29:27 +03:00
|
|
|
const uint32_t par[])
|
|
|
|
{
|
2018-08-29 20:37:29 +03:00
|
|
|
TCGv_i32 tmp = tcg_temp_new_i32();
|
2019-02-12 05:53:19 +03:00
|
|
|
tcg_gen_shli_i32(tmp, arg[0].in, 3);
|
2018-08-29 20:37:29 +03:00
|
|
|
gen_left_shift_sar(dc, tmp);
|
|
|
|
tcg_temp_free(tmp);
|
2017-11-04 04:29:27 +03:00
|
|
|
}
|
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
static void translate_ssa8l(DisasContext *dc, const OpcodeArg arg[],
|
2017-11-04 04:29:27 +03:00
|
|
|
const uint32_t par[])
|
|
|
|
{
|
2018-08-29 20:37:29 +03:00
|
|
|
TCGv_i32 tmp = tcg_temp_new_i32();
|
2019-02-12 05:53:19 +03:00
|
|
|
tcg_gen_shli_i32(tmp, arg[0].in, 3);
|
2018-08-29 20:37:29 +03:00
|
|
|
gen_right_shift_sar(dc, tmp);
|
|
|
|
tcg_temp_free(tmp);
|
2017-11-04 04:29:27 +03:00
|
|
|
}
|
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
static void translate_ssai(DisasContext *dc, const OpcodeArg arg[],
|
2017-11-04 04:29:27 +03:00
|
|
|
const uint32_t par[])
|
|
|
|
{
|
2019-02-12 05:53:19 +03:00
|
|
|
TCGv_i32 tmp = tcg_const_i32(arg[0].imm);
|
2017-11-04 04:29:27 +03:00
|
|
|
gen_right_shift_sar(dc, tmp);
|
|
|
|
tcg_temp_free(tmp);
|
|
|
|
}
|
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
static void translate_ssl(DisasContext *dc, const OpcodeArg arg[],
|
2017-11-04 04:29:27 +03:00
|
|
|
const uint32_t par[])
|
|
|
|
{
|
2019-02-12 05:53:19 +03:00
|
|
|
gen_left_shift_sar(dc, arg[0].in);
|
2017-11-04 04:29:27 +03:00
|
|
|
}
|
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
static void translate_ssr(DisasContext *dc, const OpcodeArg arg[],
|
2017-11-04 04:29:27 +03:00
|
|
|
const uint32_t par[])
|
|
|
|
{
|
2019-02-12 05:53:19 +03:00
|
|
|
gen_right_shift_sar(dc, arg[0].in);
|
2017-11-04 04:29:27 +03:00
|
|
|
}
|
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
static void translate_sub(DisasContext *dc, const OpcodeArg arg[],
|
2017-11-04 04:29:27 +03:00
|
|
|
const uint32_t par[])
|
|
|
|
{
|
2019-02-12 05:53:19 +03:00
|
|
|
tcg_gen_sub_i32(arg[0].out, arg[1].in, arg[2].in);
|
2017-11-04 04:29:27 +03:00
|
|
|
}
|
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
static void translate_subx(DisasContext *dc, const OpcodeArg arg[],
|
2017-11-04 04:29:27 +03:00
|
|
|
const uint32_t par[])
|
|
|
|
{
|
2018-08-29 20:37:29 +03:00
|
|
|
TCGv_i32 tmp = tcg_temp_new_i32();
|
2019-02-12 05:53:19 +03:00
|
|
|
tcg_gen_shli_i32(tmp, arg[1].in, par[0]);
|
|
|
|
tcg_gen_sub_i32(arg[0].out, tmp, arg[2].in);
|
2018-08-29 20:37:29 +03:00
|
|
|
tcg_temp_free(tmp);
|
2017-11-04 04:29:27 +03:00
|
|
|
}
|
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
static void translate_waiti(DisasContext *dc, const OpcodeArg arg[],
|
2017-11-04 04:29:27 +03:00
|
|
|
const uint32_t par[])
|
|
|
|
{
|
2017-01-25 21:54:11 +03:00
|
|
|
#ifndef CONFIG_USER_ONLY
|
2019-02-12 05:53:19 +03:00
|
|
|
gen_waiti(dc, arg[0].imm);
|
2017-01-25 21:54:11 +03:00
|
|
|
#endif
|
2017-11-04 04:29:27 +03:00
|
|
|
}
|
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
static void translate_wtlb(DisasContext *dc, const OpcodeArg arg[],
|
2017-11-04 04:29:27 +03:00
|
|
|
const uint32_t par[])
|
|
|
|
{
|
2017-01-25 21:54:11 +03:00
|
|
|
#ifndef CONFIG_USER_ONLY
|
2018-08-29 20:37:29 +03:00
|
|
|
TCGv_i32 dtlb = tcg_const_i32(par[0]);
|
2017-11-04 04:29:27 +03:00
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
gen_helper_wtlb(cpu_env, arg[0].in, arg[1].in, dtlb);
|
2018-08-29 20:37:29 +03:00
|
|
|
tcg_temp_free(dtlb);
|
2017-01-25 21:54:11 +03:00
|
|
|
#endif
|
2017-11-04 04:29:27 +03:00
|
|
|
}
|
|
|
|
|
2019-03-13 22:40:38 +03:00
|
|
|
static void translate_wptlb(DisasContext *dc, const OpcodeArg arg[],
|
|
|
|
const uint32_t par[])
|
|
|
|
{
|
|
|
|
#ifndef CONFIG_USER_ONLY
|
|
|
|
gen_helper_wptlb(cpu_env, arg[0].in, arg[1].in);
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
static void translate_wer(DisasContext *dc, const OpcodeArg arg[],
|
2017-11-04 04:29:27 +03:00
|
|
|
const uint32_t par[])
|
|
|
|
{
|
2019-02-12 05:53:19 +03:00
|
|
|
gen_helper_wer(cpu_env, arg[0].in, arg[1].in);
|
2017-11-04 04:29:27 +03:00
|
|
|
}
|
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
static void translate_wrmsk_expstate(DisasContext *dc, const OpcodeArg arg[],
|
2017-02-18 03:21:36 +03:00
|
|
|
const uint32_t par[])
|
|
|
|
{
|
2018-08-29 20:37:29 +03:00
|
|
|
/* TODO: GPIO32 may be a part of coprocessor */
|
2019-02-12 05:53:19 +03:00
|
|
|
tcg_gen_and_i32(cpu_UR[EXPSTATE], arg[0].in, arg[1].in);
|
2017-02-18 03:21:36 +03:00
|
|
|
}
|
|
|
|
|
2019-03-19 03:10:38 +03:00
|
|
|
static void translate_wsr(DisasContext *dc, const OpcodeArg arg[],
|
|
|
|
const uint32_t par[])
|
2018-08-28 07:43:43 +03:00
|
|
|
{
|
2020-04-29 01:59:08 +03:00
|
|
|
if (sr_name[par[0]]) {
|
|
|
|
tcg_gen_mov_i32(cpu_SR[par[0]], arg[0].in);
|
|
|
|
}
|
2018-08-28 07:43:43 +03:00
|
|
|
}
|
|
|
|
|
2019-03-19 03:10:38 +03:00
|
|
|
static void translate_wsr_mask(DisasContext *dc, const OpcodeArg arg[],
|
|
|
|
const uint32_t par[])
|
2017-11-04 04:29:27 +03:00
|
|
|
{
|
2020-04-29 01:59:08 +03:00
|
|
|
if (sr_name[par[0]]) {
|
|
|
|
tcg_gen_andi_i32(cpu_SR[par[0]], arg[0].in, par[2]);
|
|
|
|
}
|
2017-11-04 04:29:27 +03:00
|
|
|
}
|
|
|
|
|
2019-03-19 03:10:38 +03:00
|
|
|
static void translate_wsr_acchi(DisasContext *dc, const OpcodeArg arg[],
|
|
|
|
const uint32_t par[])
|
2017-11-04 04:29:27 +03:00
|
|
|
{
|
2019-03-19 03:10:38 +03:00
|
|
|
tcg_gen_ext8s_i32(cpu_SR[par[0]], arg[0].in);
|
2017-11-04 04:29:27 +03:00
|
|
|
}
|
|
|
|
|
2019-03-19 03:10:38 +03:00
|
|
|
static void translate_wsr_ccompare(DisasContext *dc, const OpcodeArg arg[],
|
|
|
|
const uint32_t par[])
|
2017-11-04 04:29:27 +03:00
|
|
|
{
|
2019-03-19 03:10:38 +03:00
|
|
|
#ifndef CONFIG_USER_ONLY
|
|
|
|
uint32_t id = par[0] - CCOMPARE;
|
|
|
|
TCGv_i32 tmp = tcg_const_i32(id);
|
|
|
|
|
|
|
|
assert(id < dc->config->nccompare);
|
|
|
|
if (tb_cflags(dc->base.tb) & CF_USE_ICOUNT) {
|
|
|
|
gen_io_start();
|
|
|
|
}
|
|
|
|
tcg_gen_mov_i32(cpu_SR[par[0]], arg[0].in);
|
|
|
|
gen_helper_update_ccompare(cpu_env, tmp);
|
|
|
|
tcg_temp_free(tmp);
|
|
|
|
#endif
|
2017-11-04 04:29:27 +03:00
|
|
|
}
|
|
|
|
|
2019-03-19 03:10:38 +03:00
|
|
|
static void translate_wsr_ccount(DisasContext *dc, const OpcodeArg arg[],
|
|
|
|
const uint32_t par[])
|
2018-08-28 07:43:43 +03:00
|
|
|
{
|
2019-03-19 03:10:38 +03:00
|
|
|
#ifndef CONFIG_USER_ONLY
|
|
|
|
if (tb_cflags(dc->base.tb) & CF_USE_ICOUNT) {
|
|
|
|
gen_io_start();
|
|
|
|
}
|
|
|
|
gen_helper_wsr_ccount(cpu_env, arg[0].in);
|
|
|
|
#endif
|
2018-08-28 07:43:43 +03:00
|
|
|
}
|
|
|
|
|
2019-03-19 03:10:38 +03:00
|
|
|
static void translate_wsr_dbreaka(DisasContext *dc, const OpcodeArg arg[],
|
|
|
|
const uint32_t par[])
|
2017-11-04 04:29:27 +03:00
|
|
|
{
|
2019-03-19 03:10:38 +03:00
|
|
|
#ifndef CONFIG_USER_ONLY
|
|
|
|
unsigned id = par[0] - DBREAKA;
|
|
|
|
TCGv_i32 tmp = tcg_const_i32(id);
|
2017-11-04 04:29:27 +03:00
|
|
|
|
2019-03-19 03:10:38 +03:00
|
|
|
assert(id < dc->config->ndbreak);
|
|
|
|
gen_helper_wsr_dbreaka(cpu_env, tmp, arg[0].in);
|
2018-08-29 20:37:29 +03:00
|
|
|
tcg_temp_free(tmp);
|
2019-03-19 03:10:38 +03:00
|
|
|
#endif
|
2017-11-04 04:29:27 +03:00
|
|
|
}
|
|
|
|
|
2019-03-19 03:10:38 +03:00
|
|
|
static void translate_wsr_dbreakc(DisasContext *dc, const OpcodeArg arg[],
|
|
|
|
const uint32_t par[])
|
|
|
|
{
|
|
|
|
#ifndef CONFIG_USER_ONLY
|
|
|
|
unsigned id = par[0] - DBREAKC;
|
|
|
|
TCGv_i32 tmp = tcg_const_i32(id);
|
|
|
|
|
|
|
|
assert(id < dc->config->ndbreak);
|
|
|
|
gen_helper_wsr_dbreakc(cpu_env, tmp, arg[0].in);
|
|
|
|
tcg_temp_free(tmp);
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
static void translate_wsr_ibreaka(DisasContext *dc, const OpcodeArg arg[],
|
|
|
|
const uint32_t par[])
|
|
|
|
{
|
|
|
|
#ifndef CONFIG_USER_ONLY
|
|
|
|
unsigned id = par[0] - IBREAKA;
|
|
|
|
TCGv_i32 tmp = tcg_const_i32(id);
|
|
|
|
|
|
|
|
assert(id < dc->config->nibreak);
|
|
|
|
gen_helper_wsr_ibreaka(cpu_env, tmp, arg[0].in);
|
|
|
|
tcg_temp_free(tmp);
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
static void translate_wsr_ibreakenable(DisasContext *dc, const OpcodeArg arg[],
|
|
|
|
const uint32_t par[])
|
|
|
|
{
|
|
|
|
#ifndef CONFIG_USER_ONLY
|
|
|
|
gen_helper_wsr_ibreakenable(cpu_env, arg[0].in);
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
static void translate_wsr_icount(DisasContext *dc, const OpcodeArg arg[],
|
|
|
|
const uint32_t par[])
|
2017-11-04 04:29:27 +03:00
|
|
|
{
|
2019-03-19 03:10:38 +03:00
|
|
|
#ifndef CONFIG_USER_ONLY
|
|
|
|
if (dc->icount) {
|
|
|
|
tcg_gen_mov_i32(dc->next_icount, arg[0].in);
|
2018-08-29 20:37:29 +03:00
|
|
|
} else {
|
2019-03-19 03:10:38 +03:00
|
|
|
tcg_gen_mov_i32(cpu_SR[par[0]], arg[0].in);
|
2017-11-04 04:29:27 +03:00
|
|
|
}
|
2019-03-19 03:10:38 +03:00
|
|
|
#endif
|
2017-11-04 04:29:27 +03:00
|
|
|
}
|
|
|
|
|
2019-03-19 03:10:38 +03:00
|
|
|
static void translate_wsr_intclear(DisasContext *dc, const OpcodeArg arg[],
|
|
|
|
const uint32_t par[])
|
|
|
|
{
|
|
|
|
#ifndef CONFIG_USER_ONLY
|
|
|
|
gen_helper_intclear(cpu_env, arg[0].in);
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
static void translate_wsr_intset(DisasContext *dc, const OpcodeArg arg[],
|
|
|
|
const uint32_t par[])
|
|
|
|
{
|
|
|
|
#ifndef CONFIG_USER_ONLY
|
|
|
|
gen_helper_intset(cpu_env, arg[0].in);
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
static void translate_wsr_memctl(DisasContext *dc, const OpcodeArg arg[],
|
|
|
|
const uint32_t par[])
|
|
|
|
{
|
|
|
|
#ifndef CONFIG_USER_ONLY
|
|
|
|
gen_helper_wsr_memctl(cpu_env, arg[0].in);
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2019-03-13 22:40:38 +03:00
|
|
|
static void translate_wsr_mpuenb(DisasContext *dc, const OpcodeArg arg[],
|
|
|
|
const uint32_t par[])
|
|
|
|
{
|
|
|
|
#ifndef CONFIG_USER_ONLY
|
|
|
|
gen_helper_wsr_mpuenb(cpu_env, arg[0].in);
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2019-03-19 03:10:38 +03:00
|
|
|
static void translate_wsr_ps(DisasContext *dc, const OpcodeArg arg[],
|
|
|
|
const uint32_t par[])
|
|
|
|
{
|
|
|
|
#ifndef CONFIG_USER_ONLY
|
|
|
|
uint32_t mask = PS_WOE | PS_CALLINC | PS_OWB |
|
|
|
|
PS_UM | PS_EXCM | PS_INTLEVEL;
|
|
|
|
|
2019-11-04 11:01:27 +03:00
|
|
|
if (option_enabled(dc, XTENSA_OPTION_MMU) ||
|
|
|
|
option_enabled(dc, XTENSA_OPTION_MPU)) {
|
2019-03-19 03:10:38 +03:00
|
|
|
mask |= PS_RING;
|
|
|
|
}
|
|
|
|
tcg_gen_andi_i32(cpu_SR[par[0]], arg[0].in, mask);
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
static void translate_wsr_rasid(DisasContext *dc, const OpcodeArg arg[],
|
|
|
|
const uint32_t par[])
|
|
|
|
{
|
|
|
|
#ifndef CONFIG_USER_ONLY
|
|
|
|
gen_helper_wsr_rasid(cpu_env, arg[0].in);
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
static void translate_wsr_sar(DisasContext *dc, const OpcodeArg arg[],
|
|
|
|
const uint32_t par[])
|
|
|
|
{
|
|
|
|
tcg_gen_andi_i32(cpu_SR[par[0]], arg[0].in, 0x3f);
|
|
|
|
if (dc->sar_m32_5bit) {
|
|
|
|
tcg_gen_discard_i32(dc->sar_m32);
|
|
|
|
}
|
|
|
|
dc->sar_5bit = false;
|
|
|
|
dc->sar_m32_5bit = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void translate_wsr_windowbase(DisasContext *dc, const OpcodeArg arg[],
|
|
|
|
const uint32_t par[])
|
|
|
|
{
|
|
|
|
#ifndef CONFIG_USER_ONLY
|
|
|
|
tcg_gen_mov_i32(cpu_windowbase_next, arg[0].in);
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
static void translate_wsr_windowstart(DisasContext *dc, const OpcodeArg arg[],
|
|
|
|
const uint32_t par[])
|
|
|
|
{
|
|
|
|
#ifndef CONFIG_USER_ONLY
|
|
|
|
tcg_gen_andi_i32(cpu_SR[par[0]], arg[0].in,
|
|
|
|
(1 << dc->config->nareg / 4) - 1);
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
static void translate_wur(DisasContext *dc, const OpcodeArg arg[],
|
2017-11-04 04:29:27 +03:00
|
|
|
const uint32_t par[])
|
|
|
|
{
|
2019-03-19 03:10:38 +03:00
|
|
|
tcg_gen_mov_i32(cpu_UR[par[0]], arg[0].in);
|
2017-11-04 04:29:27 +03:00
|
|
|
}
|
|
|
|
|
2019-03-19 03:10:38 +03:00
|
|
|
static void translate_xor(DisasContext *dc, const OpcodeArg arg[],
|
|
|
|
const uint32_t par[])
|
2018-08-28 07:43:43 +03:00
|
|
|
{
|
2019-03-19 03:10:38 +03:00
|
|
|
tcg_gen_xor_i32(arg[0].out, arg[1].in, arg[2].in);
|
2018-08-28 07:43:43 +03:00
|
|
|
}
|
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
static void translate_xsr(DisasContext *dc, const OpcodeArg arg[],
|
2017-11-04 04:29:27 +03:00
|
|
|
const uint32_t par[])
|
|
|
|
{
|
2020-04-29 01:59:08 +03:00
|
|
|
if (sr_name[par[0]]) {
|
|
|
|
TCGv_i32 tmp = tcg_temp_new_i32();
|
2017-11-04 04:29:27 +03:00
|
|
|
|
2020-04-29 01:59:08 +03:00
|
|
|
tcg_gen_mov_i32(tmp, arg[0].in);
|
|
|
|
tcg_gen_mov_i32(arg[0].out, cpu_SR[par[0]]);
|
|
|
|
tcg_gen_mov_i32(cpu_SR[par[0]], tmp);
|
|
|
|
tcg_temp_free(tmp);
|
|
|
|
} else {
|
|
|
|
tcg_gen_movi_i32(arg[0].out, 0);
|
|
|
|
}
|
2019-03-19 03:10:38 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
static void translate_xsr_mask(DisasContext *dc, const OpcodeArg arg[],
|
|
|
|
const uint32_t par[])
|
|
|
|
{
|
2020-04-29 01:59:08 +03:00
|
|
|
if (sr_name[par[0]]) {
|
|
|
|
TCGv_i32 tmp = tcg_temp_new_i32();
|
2019-03-19 03:10:38 +03:00
|
|
|
|
2020-04-29 01:59:08 +03:00
|
|
|
tcg_gen_mov_i32(tmp, arg[0].in);
|
|
|
|
tcg_gen_mov_i32(arg[0].out, cpu_SR[par[0]]);
|
|
|
|
tcg_gen_andi_i32(cpu_SR[par[0]], tmp, par[2]);
|
|
|
|
tcg_temp_free(tmp);
|
|
|
|
} else {
|
|
|
|
tcg_gen_movi_i32(arg[0].out, 0);
|
|
|
|
}
|
2019-03-19 03:10:38 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
static void translate_xsr_ccount(DisasContext *dc, const OpcodeArg arg[],
|
|
|
|
const uint32_t par[])
|
|
|
|
{
|
|
|
|
#ifndef CONFIG_USER_ONLY
|
|
|
|
TCGv_i32 tmp = tcg_temp_new_i32();
|
|
|
|
|
|
|
|
if (tb_cflags(dc->base.tb) & CF_USE_ICOUNT) {
|
|
|
|
gen_io_start();
|
|
|
|
}
|
|
|
|
|
|
|
|
gen_helper_update_ccount(cpu_env);
|
|
|
|
tcg_gen_mov_i32(tmp, cpu_SR[par[0]]);
|
|
|
|
gen_helper_wsr_ccount(cpu_env, arg[0].in);
|
|
|
|
tcg_gen_mov_i32(arg[0].out, tmp);
|
2018-08-29 20:37:29 +03:00
|
|
|
tcg_temp_free(tmp);
|
2019-03-19 03:10:38 +03:00
|
|
|
|
|
|
|
#endif
|
2017-11-04 04:29:27 +03:00
|
|
|
}
|
|
|
|
|
2019-03-19 03:10:38 +03:00
|
|
|
#define gen_translate_xsr(name) \
|
|
|
|
static void translate_xsr_##name(DisasContext *dc, const OpcodeArg arg[], \
|
|
|
|
const uint32_t par[]) \
|
|
|
|
{ \
|
|
|
|
TCGv_i32 tmp = tcg_temp_new_i32(); \
|
|
|
|
\
|
2020-04-29 01:59:08 +03:00
|
|
|
if (sr_name[par[0]]) { \
|
|
|
|
tcg_gen_mov_i32(tmp, cpu_SR[par[0]]); \
|
|
|
|
} else { \
|
|
|
|
tcg_gen_movi_i32(tmp, 0); \
|
|
|
|
} \
|
2019-03-19 03:10:38 +03:00
|
|
|
translate_wsr_##name(dc, arg, par); \
|
|
|
|
tcg_gen_mov_i32(arg[0].out, tmp); \
|
|
|
|
tcg_temp_free(tmp); \
|
|
|
|
}
|
|
|
|
|
|
|
|
gen_translate_xsr(acchi)
|
|
|
|
gen_translate_xsr(ccompare)
|
|
|
|
gen_translate_xsr(dbreaka)
|
|
|
|
gen_translate_xsr(dbreakc)
|
|
|
|
gen_translate_xsr(ibreaka)
|
|
|
|
gen_translate_xsr(ibreakenable)
|
|
|
|
gen_translate_xsr(icount)
|
|
|
|
gen_translate_xsr(memctl)
|
2019-03-13 22:40:38 +03:00
|
|
|
gen_translate_xsr(mpuenb)
|
2019-03-19 03:10:38 +03:00
|
|
|
gen_translate_xsr(ps)
|
|
|
|
gen_translate_xsr(rasid)
|
|
|
|
gen_translate_xsr(sar)
|
|
|
|
gen_translate_xsr(windowbase)
|
|
|
|
gen_translate_xsr(windowstart)
|
|
|
|
|
|
|
|
#undef gen_translate_xsr
|
|
|
|
|
2017-11-04 04:29:27 +03:00
|
|
|
static const XtensaOpcodeOps core_ops[] = {
|
|
|
|
{
|
|
|
|
.name = "abs",
|
|
|
|
.translate = translate_abs,
|
|
|
|
}, {
|
2019-02-10 10:39:10 +03:00
|
|
|
.name = (const char * const[]) {
|
|
|
|
"add", "add.n", NULL,
|
|
|
|
},
|
2017-11-04 04:29:27 +03:00
|
|
|
.translate = translate_add,
|
2019-02-10 10:39:10 +03:00
|
|
|
.op_flags = XTENSA_OP_NAME_ARRAY,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
2019-02-10 10:39:10 +03:00
|
|
|
.name = (const char * const[]) {
|
|
|
|
"addi", "addi.n", NULL,
|
|
|
|
},
|
2017-11-04 04:29:27 +03:00
|
|
|
.translate = translate_addi,
|
2019-02-10 10:39:10 +03:00
|
|
|
.op_flags = XTENSA_OP_NAME_ARRAY,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "addmi",
|
|
|
|
.translate = translate_addi,
|
|
|
|
}, {
|
|
|
|
.name = "addx2",
|
|
|
|
.translate = translate_addx,
|
|
|
|
.par = (const uint32_t[]){1},
|
|
|
|
}, {
|
|
|
|
.name = "addx4",
|
|
|
|
.translate = translate_addx,
|
|
|
|
.par = (const uint32_t[]){2},
|
|
|
|
}, {
|
|
|
|
.name = "addx8",
|
|
|
|
.translate = translate_addx,
|
|
|
|
.par = (const uint32_t[]){3},
|
|
|
|
}, {
|
|
|
|
.name = "all4",
|
|
|
|
.translate = translate_all,
|
|
|
|
.par = (const uint32_t[]){true, 4},
|
|
|
|
}, {
|
|
|
|
.name = "all8",
|
|
|
|
.translate = translate_all,
|
|
|
|
.par = (const uint32_t[]){true, 8},
|
|
|
|
}, {
|
|
|
|
.name = "and",
|
|
|
|
.translate = translate_and,
|
|
|
|
}, {
|
|
|
|
.name = "andb",
|
|
|
|
.translate = translate_boolean,
|
|
|
|
.par = (const uint32_t[]){BOOLEAN_AND},
|
|
|
|
}, {
|
|
|
|
.name = "andbc",
|
|
|
|
.translate = translate_boolean,
|
|
|
|
.par = (const uint32_t[]){BOOLEAN_ANDC},
|
|
|
|
}, {
|
|
|
|
.name = "any4",
|
|
|
|
.translate = translate_all,
|
|
|
|
.par = (const uint32_t[]){false, 4},
|
|
|
|
}, {
|
|
|
|
.name = "any8",
|
|
|
|
.translate = translate_all,
|
|
|
|
.par = (const uint32_t[]){false, 8},
|
|
|
|
}, {
|
2018-10-03 04:50:13 +03:00
|
|
|
.name = (const char * const[]) {
|
|
|
|
"ball", "ball.w15", "ball.w18", NULL,
|
|
|
|
},
|
2017-11-04 04:29:27 +03:00
|
|
|
.translate = translate_ball,
|
|
|
|
.par = (const uint32_t[]){TCG_COND_EQ},
|
2018-10-03 04:50:13 +03:00
|
|
|
.op_flags = XTENSA_OP_NAME_ARRAY,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
2018-10-03 04:50:13 +03:00
|
|
|
.name = (const char * const[]) {
|
|
|
|
"bany", "bany.w15", "bany.w18", NULL,
|
|
|
|
},
|
2017-11-04 04:29:27 +03:00
|
|
|
.translate = translate_bany,
|
|
|
|
.par = (const uint32_t[]){TCG_COND_NE},
|
2018-10-03 04:50:13 +03:00
|
|
|
.op_flags = XTENSA_OP_NAME_ARRAY,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
2018-10-03 04:50:13 +03:00
|
|
|
.name = (const char * const[]) {
|
|
|
|
"bbc", "bbc.w15", "bbc.w18", NULL,
|
|
|
|
},
|
2017-11-04 04:29:27 +03:00
|
|
|
.translate = translate_bb,
|
|
|
|
.par = (const uint32_t[]){TCG_COND_EQ},
|
2018-10-03 04:50:13 +03:00
|
|
|
.op_flags = XTENSA_OP_NAME_ARRAY,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
2018-10-03 04:50:13 +03:00
|
|
|
.name = (const char * const[]) {
|
|
|
|
"bbci", "bbci.w15", "bbci.w18", NULL,
|
|
|
|
},
|
2017-11-04 04:29:27 +03:00
|
|
|
.translate = translate_bbi,
|
|
|
|
.par = (const uint32_t[]){TCG_COND_EQ},
|
2018-10-03 04:50:13 +03:00
|
|
|
.op_flags = XTENSA_OP_NAME_ARRAY,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
2018-10-03 04:50:13 +03:00
|
|
|
.name = (const char * const[]) {
|
|
|
|
"bbs", "bbs.w15", "bbs.w18", NULL,
|
|
|
|
},
|
2017-11-04 04:29:27 +03:00
|
|
|
.translate = translate_bb,
|
|
|
|
.par = (const uint32_t[]){TCG_COND_NE},
|
2018-10-03 04:50:13 +03:00
|
|
|
.op_flags = XTENSA_OP_NAME_ARRAY,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
2018-10-03 04:50:13 +03:00
|
|
|
.name = (const char * const[]) {
|
|
|
|
"bbsi", "bbsi.w15", "bbsi.w18", NULL,
|
|
|
|
},
|
2017-11-04 04:29:27 +03:00
|
|
|
.translate = translate_bbi,
|
|
|
|
.par = (const uint32_t[]){TCG_COND_NE},
|
2018-10-03 04:50:13 +03:00
|
|
|
.op_flags = XTENSA_OP_NAME_ARRAY,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
2018-10-03 04:50:13 +03:00
|
|
|
.name = (const char * const[]) {
|
|
|
|
"beq", "beq.w15", "beq.w18", NULL,
|
|
|
|
},
|
2017-11-04 04:29:27 +03:00
|
|
|
.translate = translate_b,
|
|
|
|
.par = (const uint32_t[]){TCG_COND_EQ},
|
2018-10-03 04:50:13 +03:00
|
|
|
.op_flags = XTENSA_OP_NAME_ARRAY,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
2018-10-03 04:50:13 +03:00
|
|
|
.name = (const char * const[]) {
|
|
|
|
"beqi", "beqi.w15", "beqi.w18", NULL,
|
|
|
|
},
|
2017-11-04 04:29:27 +03:00
|
|
|
.translate = translate_bi,
|
|
|
|
.par = (const uint32_t[]){TCG_COND_EQ},
|
2018-10-03 04:50:13 +03:00
|
|
|
.op_flags = XTENSA_OP_NAME_ARRAY,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
2019-02-10 10:39:10 +03:00
|
|
|
.name = (const char * const[]) {
|
2018-10-03 04:50:13 +03:00
|
|
|
"beqz", "beqz.n", "beqz.w15", "beqz.w18", NULL,
|
2019-02-10 10:39:10 +03:00
|
|
|
},
|
2017-11-04 04:29:27 +03:00
|
|
|
.translate = translate_bz,
|
|
|
|
.par = (const uint32_t[]){TCG_COND_EQ},
|
2019-02-10 10:39:10 +03:00
|
|
|
.op_flags = XTENSA_OP_NAME_ARRAY,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "bf",
|
|
|
|
.translate = translate_bp,
|
|
|
|
.par = (const uint32_t[]){TCG_COND_EQ},
|
|
|
|
}, {
|
2018-10-03 04:50:13 +03:00
|
|
|
.name = (const char * const[]) {
|
|
|
|
"bge", "bge.w15", "bge.w18", NULL,
|
|
|
|
},
|
2017-11-04 04:29:27 +03:00
|
|
|
.translate = translate_b,
|
|
|
|
.par = (const uint32_t[]){TCG_COND_GE},
|
2018-10-03 04:50:13 +03:00
|
|
|
.op_flags = XTENSA_OP_NAME_ARRAY,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
2018-10-03 04:50:13 +03:00
|
|
|
.name = (const char * const[]) {
|
|
|
|
"bgei", "bgei.w15", "bgei.w18", NULL,
|
|
|
|
},
|
2017-11-04 04:29:27 +03:00
|
|
|
.translate = translate_bi,
|
|
|
|
.par = (const uint32_t[]){TCG_COND_GE},
|
2018-10-03 04:50:13 +03:00
|
|
|
.op_flags = XTENSA_OP_NAME_ARRAY,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
2018-10-03 04:50:13 +03:00
|
|
|
.name = (const char * const[]) {
|
|
|
|
"bgeu", "bgeu.w15", "bgeu.w18", NULL,
|
|
|
|
},
|
2017-11-04 04:29:27 +03:00
|
|
|
.translate = translate_b,
|
|
|
|
.par = (const uint32_t[]){TCG_COND_GEU},
|
2018-10-03 04:50:13 +03:00
|
|
|
.op_flags = XTENSA_OP_NAME_ARRAY,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
2018-10-03 04:50:13 +03:00
|
|
|
.name = (const char * const[]) {
|
|
|
|
"bgeui", "bgeui.w15", "bgeui.w18", NULL,
|
|
|
|
},
|
2017-11-04 04:29:27 +03:00
|
|
|
.translate = translate_bi,
|
|
|
|
.par = (const uint32_t[]){TCG_COND_GEU},
|
2018-10-03 04:50:13 +03:00
|
|
|
.op_flags = XTENSA_OP_NAME_ARRAY,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
2018-10-03 04:50:13 +03:00
|
|
|
.name = (const char * const[]) {
|
|
|
|
"bgez", "bgez.w15", "bgez.w18", NULL,
|
|
|
|
},
|
2017-11-04 04:29:27 +03:00
|
|
|
.translate = translate_bz,
|
|
|
|
.par = (const uint32_t[]){TCG_COND_GE},
|
2018-10-03 04:50:13 +03:00
|
|
|
.op_flags = XTENSA_OP_NAME_ARRAY,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
2018-10-03 04:50:13 +03:00
|
|
|
.name = (const char * const[]) {
|
|
|
|
"blt", "blt.w15", "blt.w18", NULL,
|
|
|
|
},
|
2017-11-04 04:29:27 +03:00
|
|
|
.translate = translate_b,
|
|
|
|
.par = (const uint32_t[]){TCG_COND_LT},
|
2018-10-03 04:50:13 +03:00
|
|
|
.op_flags = XTENSA_OP_NAME_ARRAY,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
2018-10-03 04:50:13 +03:00
|
|
|
.name = (const char * const[]) {
|
|
|
|
"blti", "blti.w15", "blti.w18", NULL,
|
|
|
|
},
|
2017-11-04 04:29:27 +03:00
|
|
|
.translate = translate_bi,
|
|
|
|
.par = (const uint32_t[]){TCG_COND_LT},
|
2018-10-03 04:50:13 +03:00
|
|
|
.op_flags = XTENSA_OP_NAME_ARRAY,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
2018-10-03 04:50:13 +03:00
|
|
|
.name = (const char * const[]) {
|
|
|
|
"bltu", "bltu.w15", "bltu.w18", NULL,
|
|
|
|
},
|
2017-11-04 04:29:27 +03:00
|
|
|
.translate = translate_b,
|
|
|
|
.par = (const uint32_t[]){TCG_COND_LTU},
|
2018-10-03 04:50:13 +03:00
|
|
|
.op_flags = XTENSA_OP_NAME_ARRAY,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
2018-10-03 04:50:13 +03:00
|
|
|
.name = (const char * const[]) {
|
|
|
|
"bltui", "bltui.w15", "bltui.w18", NULL,
|
|
|
|
},
|
2017-11-04 04:29:27 +03:00
|
|
|
.translate = translate_bi,
|
|
|
|
.par = (const uint32_t[]){TCG_COND_LTU},
|
2018-10-03 04:50:13 +03:00
|
|
|
.op_flags = XTENSA_OP_NAME_ARRAY,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
2018-10-03 04:50:13 +03:00
|
|
|
.name = (const char * const[]) {
|
|
|
|
"bltz", "bltz.w15", "bltz.w18", NULL,
|
|
|
|
},
|
2017-11-04 04:29:27 +03:00
|
|
|
.translate = translate_bz,
|
|
|
|
.par = (const uint32_t[]){TCG_COND_LT},
|
2018-10-03 04:50:13 +03:00
|
|
|
.op_flags = XTENSA_OP_NAME_ARRAY,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
2018-10-03 04:50:13 +03:00
|
|
|
.name = (const char * const[]) {
|
|
|
|
"bnall", "bnall.w15", "bnall.w18", NULL,
|
|
|
|
},
|
2017-11-04 04:29:27 +03:00
|
|
|
.translate = translate_ball,
|
|
|
|
.par = (const uint32_t[]){TCG_COND_NE},
|
2018-10-03 04:50:13 +03:00
|
|
|
.op_flags = XTENSA_OP_NAME_ARRAY,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
2018-10-03 04:50:13 +03:00
|
|
|
.name = (const char * const[]) {
|
|
|
|
"bne", "bne.w15", "bne.w18", NULL,
|
|
|
|
},
|
2017-11-04 04:29:27 +03:00
|
|
|
.translate = translate_b,
|
|
|
|
.par = (const uint32_t[]){TCG_COND_NE},
|
2018-10-03 04:50:13 +03:00
|
|
|
.op_flags = XTENSA_OP_NAME_ARRAY,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
2018-10-03 04:50:13 +03:00
|
|
|
.name = (const char * const[]) {
|
|
|
|
"bnei", "bnei.w15", "bnei.w18", NULL,
|
|
|
|
},
|
2017-11-04 04:29:27 +03:00
|
|
|
.translate = translate_bi,
|
|
|
|
.par = (const uint32_t[]){TCG_COND_NE},
|
2018-10-03 04:50:13 +03:00
|
|
|
.op_flags = XTENSA_OP_NAME_ARRAY,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
2019-02-10 10:39:10 +03:00
|
|
|
.name = (const char * const[]) {
|
2018-10-03 04:50:13 +03:00
|
|
|
"bnez", "bnez.n", "bnez.w15", "bnez.w18", NULL,
|
2019-02-10 10:39:10 +03:00
|
|
|
},
|
2017-11-04 04:29:27 +03:00
|
|
|
.translate = translate_bz,
|
|
|
|
.par = (const uint32_t[]){TCG_COND_NE},
|
2019-02-10 10:39:10 +03:00
|
|
|
.op_flags = XTENSA_OP_NAME_ARRAY,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
2018-10-03 04:50:13 +03:00
|
|
|
.name = (const char * const[]) {
|
|
|
|
"bnone", "bnone.w15", "bnone.w18", NULL,
|
|
|
|
},
|
2017-11-04 04:29:27 +03:00
|
|
|
.translate = translate_bany,
|
|
|
|
.par = (const uint32_t[]){TCG_COND_EQ},
|
2018-10-03 04:50:13 +03:00
|
|
|
.op_flags = XTENSA_OP_NAME_ARRAY,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "break",
|
2018-08-29 00:52:27 +03:00
|
|
|
.translate = translate_nop,
|
2017-11-04 04:29:27 +03:00
|
|
|
.par = (const uint32_t[]){DEBUGCAUSE_BI},
|
2018-08-29 00:52:27 +03:00
|
|
|
.op_flags = XTENSA_OP_DEBUG_BREAK,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "break.n",
|
2018-08-29 00:52:27 +03:00
|
|
|
.translate = translate_nop,
|
2017-11-04 04:29:27 +03:00
|
|
|
.par = (const uint32_t[]){DEBUGCAUSE_BN},
|
2018-08-29 00:52:27 +03:00
|
|
|
.op_flags = XTENSA_OP_DEBUG_BREAK,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "bt",
|
|
|
|
.translate = translate_bp,
|
|
|
|
.par = (const uint32_t[]){TCG_COND_NE},
|
|
|
|
}, {
|
|
|
|
.name = "call0",
|
|
|
|
.translate = translate_call0,
|
|
|
|
}, {
|
|
|
|
.name = "call12",
|
|
|
|
.translate = translate_callw,
|
|
|
|
.par = (const uint32_t[]){3},
|
|
|
|
}, {
|
|
|
|
.name = "call4",
|
|
|
|
.translate = translate_callw,
|
|
|
|
.par = (const uint32_t[]){1},
|
|
|
|
}, {
|
|
|
|
.name = "call8",
|
|
|
|
.translate = translate_callw,
|
|
|
|
.par = (const uint32_t[]){2},
|
|
|
|
}, {
|
|
|
|
.name = "callx0",
|
|
|
|
.translate = translate_callx0,
|
|
|
|
}, {
|
|
|
|
.name = "callx12",
|
|
|
|
.translate = translate_callxw,
|
|
|
|
.par = (const uint32_t[]){3},
|
|
|
|
}, {
|
|
|
|
.name = "callx4",
|
|
|
|
.translate = translate_callxw,
|
|
|
|
.par = (const uint32_t[]){1},
|
|
|
|
}, {
|
|
|
|
.name = "callx8",
|
|
|
|
.translate = translate_callxw,
|
|
|
|
.par = (const uint32_t[]){2},
|
|
|
|
}, {
|
|
|
|
.name = "clamps",
|
|
|
|
.translate = translate_clamps,
|
2017-02-18 03:21:36 +03:00
|
|
|
}, {
|
|
|
|
.name = "clrb_expstate",
|
|
|
|
.translate = translate_clrb_expstate,
|
2019-04-19 02:37:00 +03:00
|
|
|
}, {
|
|
|
|
.name = "clrex",
|
|
|
|
.translate = translate_clrex,
|
2017-11-03 01:05:56 +03:00
|
|
|
}, {
|
|
|
|
.name = "const16",
|
|
|
|
.translate = translate_const16,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "depbits",
|
|
|
|
.translate = translate_depbits,
|
|
|
|
}, {
|
|
|
|
.name = "dhi",
|
|
|
|
.translate = translate_dcache,
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2019-04-16 03:45:02 +03:00
|
|
|
}, {
|
|
|
|
.name = "dhi.b",
|
|
|
|
.translate = translate_nop,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "dhu",
|
|
|
|
.translate = translate_dcache,
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "dhwb",
|
|
|
|
.translate = translate_dcache,
|
2019-04-16 03:45:02 +03:00
|
|
|
}, {
|
|
|
|
.name = "dhwb.b",
|
|
|
|
.translate = translate_nop,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "dhwbi",
|
|
|
|
.translate = translate_dcache,
|
2019-04-16 03:45:02 +03:00
|
|
|
}, {
|
|
|
|
.name = "dhwbi.b",
|
|
|
|
.translate = translate_nop,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "dii",
|
2018-08-29 20:37:29 +03:00
|
|
|
.translate = translate_nop,
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "diu",
|
2018-08-29 20:37:29 +03:00
|
|
|
.translate = translate_nop,
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "diwb",
|
2018-08-29 20:37:29 +03:00
|
|
|
.translate = translate_nop,
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "diwbi",
|
2018-08-29 20:37:29 +03:00
|
|
|
.translate = translate_nop,
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2019-04-15 00:02:17 +03:00
|
|
|
}, {
|
|
|
|
.name = "diwbui.p",
|
|
|
|
.translate = translate_diwbuip,
|
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "dpfl",
|
|
|
|
.translate = translate_dcache,
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2019-04-16 03:45:02 +03:00
|
|
|
}, {
|
|
|
|
.name = "dpfm.b",
|
|
|
|
.translate = translate_nop,
|
|
|
|
}, {
|
|
|
|
.name = "dpfm.bf",
|
|
|
|
.translate = translate_nop,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "dpfr",
|
2018-08-29 20:37:29 +03:00
|
|
|
.translate = translate_nop,
|
2019-04-16 03:45:02 +03:00
|
|
|
}, {
|
|
|
|
.name = "dpfr.b",
|
|
|
|
.translate = translate_nop,
|
|
|
|
}, {
|
|
|
|
.name = "dpfr.bf",
|
|
|
|
.translate = translate_nop,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "dpfro",
|
2018-08-29 20:37:29 +03:00
|
|
|
.translate = translate_nop,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "dpfw",
|
2018-08-29 20:37:29 +03:00
|
|
|
.translate = translate_nop,
|
2019-04-16 03:45:02 +03:00
|
|
|
}, {
|
|
|
|
.name = "dpfw.b",
|
|
|
|
.translate = translate_nop,
|
|
|
|
}, {
|
|
|
|
.name = "dpfw.bf",
|
|
|
|
.translate = translate_nop,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "dpfwo",
|
2018-08-29 20:37:29 +03:00
|
|
|
.translate = translate_nop,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "dsync",
|
|
|
|
.translate = translate_nop,
|
|
|
|
}, {
|
|
|
|
.name = "entry",
|
|
|
|
.translate = translate_entry,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_entry,
|
2018-08-29 20:37:29 +03:00
|
|
|
.test_overflow = test_overflow_entry,
|
2019-01-31 01:56:29 +03:00
|
|
|
.op_flags = XTENSA_OP_EXIT_TB_M1 |
|
|
|
|
XTENSA_OP_SYNC_REGISTER_WINDOW,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "esync",
|
|
|
|
.translate = translate_nop,
|
|
|
|
}, {
|
|
|
|
.name = "excw",
|
|
|
|
.translate = translate_nop,
|
|
|
|
}, {
|
|
|
|
.name = "extui",
|
|
|
|
.translate = translate_extui,
|
|
|
|
}, {
|
|
|
|
.name = "extw",
|
2017-03-07 04:17:43 +03:00
|
|
|
.translate = translate_memw,
|
2019-04-19 02:37:00 +03:00
|
|
|
}, {
|
|
|
|
.name = "getex",
|
|
|
|
.translate = translate_getex,
|
2017-01-29 14:50:25 +03:00
|
|
|
}, {
|
|
|
|
.name = "hwwdtlba",
|
2018-08-28 07:43:43 +03:00
|
|
|
.op_flags = XTENSA_OP_ILL,
|
2017-01-29 14:50:25 +03:00
|
|
|
}, {
|
|
|
|
.name = "hwwitlba",
|
2018-08-28 07:43:43 +03:00
|
|
|
.op_flags = XTENSA_OP_ILL,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "idtlb",
|
|
|
|
.translate = translate_itlb,
|
|
|
|
.par = (const uint32_t[]){true},
|
2018-09-01 10:47:55 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED | XTENSA_OP_EXIT_TB_M1,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "ihi",
|
|
|
|
.translate = translate_icache,
|
|
|
|
}, {
|
|
|
|
.name = "ihu",
|
|
|
|
.translate = translate_icache,
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "iii",
|
2018-08-29 20:37:29 +03:00
|
|
|
.translate = translate_nop,
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "iitlb",
|
|
|
|
.translate = translate_itlb,
|
|
|
|
.par = (const uint32_t[]){false},
|
2018-09-01 10:47:55 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED | XTENSA_OP_EXIT_TB_M1,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "iiu",
|
2018-08-29 20:37:29 +03:00
|
|
|
.translate = translate_nop,
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
2019-02-10 10:39:10 +03:00
|
|
|
.name = (const char * const[]) {
|
|
|
|
"ill", "ill.n", NULL,
|
|
|
|
},
|
|
|
|
.op_flags = XTENSA_OP_ILL | XTENSA_OP_NAME_ARRAY,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "ipf",
|
2018-08-29 20:37:29 +03:00
|
|
|
.translate = translate_nop,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "ipfl",
|
|
|
|
.translate = translate_icache,
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "isync",
|
|
|
|
.translate = translate_nop,
|
|
|
|
}, {
|
|
|
|
.name = "j",
|
|
|
|
.translate = translate_j,
|
|
|
|
}, {
|
|
|
|
.name = "jx",
|
|
|
|
.translate = translate_jx,
|
|
|
|
}, {
|
|
|
|
.name = "l16si",
|
|
|
|
.translate = translate_ldst,
|
|
|
|
.par = (const uint32_t[]){MO_TESW, false, false},
|
2019-02-14 04:36:30 +03:00
|
|
|
.op_flags = XTENSA_OP_LOAD,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "l16ui",
|
|
|
|
.translate = translate_ldst,
|
|
|
|
.par = (const uint32_t[]){MO_TEUW, false, false},
|
2019-02-14 04:36:30 +03:00
|
|
|
.op_flags = XTENSA_OP_LOAD,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "l32ai",
|
|
|
|
.translate = translate_ldst,
|
|
|
|
.par = (const uint32_t[]){MO_TEUL, true, false},
|
2019-02-14 04:36:30 +03:00
|
|
|
.op_flags = XTENSA_OP_LOAD,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "l32e",
|
|
|
|
.translate = translate_l32e,
|
2019-02-14 04:36:30 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED | XTENSA_OP_LOAD,
|
2019-04-19 02:37:00 +03:00
|
|
|
}, {
|
|
|
|
.name = "l32ex",
|
|
|
|
.translate = translate_l32ex,
|
|
|
|
.op_flags = XTENSA_OP_LOAD,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
2019-02-10 10:39:10 +03:00
|
|
|
.name = (const char * const[]) {
|
|
|
|
"l32i", "l32i.n", NULL,
|
|
|
|
},
|
2017-11-04 04:29:27 +03:00
|
|
|
.translate = translate_ldst,
|
|
|
|
.par = (const uint32_t[]){MO_TEUL, false, false},
|
2019-02-14 04:36:30 +03:00
|
|
|
.op_flags = XTENSA_OP_NAME_ARRAY | XTENSA_OP_LOAD,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "l32r",
|
|
|
|
.translate = translate_l32r,
|
2019-02-14 04:36:30 +03:00
|
|
|
.op_flags = XTENSA_OP_LOAD,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "l8ui",
|
|
|
|
.translate = translate_ldst,
|
|
|
|
.par = (const uint32_t[]){MO_UB, false, false},
|
2019-02-14 04:36:30 +03:00
|
|
|
.op_flags = XTENSA_OP_LOAD,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "lddec",
|
|
|
|
.translate = translate_mac16,
|
2019-02-12 06:16:14 +03:00
|
|
|
.par = (const uint32_t[]){MAC16_NONE, 0, -4},
|
2019-02-14 04:36:30 +03:00
|
|
|
.op_flags = XTENSA_OP_LOAD,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "ldinc",
|
|
|
|
.translate = translate_mac16,
|
2019-02-12 06:16:14 +03:00
|
|
|
.par = (const uint32_t[]){MAC16_NONE, 0, 4},
|
2019-02-14 04:36:30 +03:00
|
|
|
.op_flags = XTENSA_OP_LOAD,
|
2017-01-29 14:50:25 +03:00
|
|
|
}, {
|
|
|
|
.name = "ldpte",
|
2018-08-28 07:43:43 +03:00
|
|
|
.op_flags = XTENSA_OP_ILL,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
2018-10-03 04:50:13 +03:00
|
|
|
.name = (const char * const[]) {
|
|
|
|
"loop", "loop.w15", NULL,
|
|
|
|
},
|
2017-11-04 04:29:27 +03:00
|
|
|
.translate = translate_loop,
|
|
|
|
.par = (const uint32_t[]){TCG_COND_NEVER},
|
2018-10-03 04:50:13 +03:00
|
|
|
.op_flags = XTENSA_OP_NAME_ARRAY,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
2018-10-03 04:50:13 +03:00
|
|
|
.name = (const char * const[]) {
|
|
|
|
"loopgtz", "loopgtz.w15", NULL,
|
|
|
|
},
|
2017-11-04 04:29:27 +03:00
|
|
|
.translate = translate_loop,
|
|
|
|
.par = (const uint32_t[]){TCG_COND_GT},
|
2018-10-03 04:50:13 +03:00
|
|
|
.op_flags = XTENSA_OP_NAME_ARRAY,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
2018-10-03 04:50:13 +03:00
|
|
|
.name = (const char * const[]) {
|
|
|
|
"loopnez", "loopnez.w15", NULL,
|
|
|
|
},
|
2017-11-04 04:29:27 +03:00
|
|
|
.translate = translate_loop,
|
|
|
|
.par = (const uint32_t[]){TCG_COND_NE},
|
2018-10-03 04:50:13 +03:00
|
|
|
.op_flags = XTENSA_OP_NAME_ARRAY,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "max",
|
2018-05-10 20:10:57 +03:00
|
|
|
.translate = translate_smax,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "maxu",
|
2018-05-10 20:10:57 +03:00
|
|
|
.translate = translate_umax,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "memw",
|
2017-03-07 04:17:43 +03:00
|
|
|
.translate = translate_memw,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "min",
|
2018-05-10 20:10:57 +03:00
|
|
|
.translate = translate_smin,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "minu",
|
2018-05-10 20:10:57 +03:00
|
|
|
.translate = translate_umin,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
2019-02-10 10:39:10 +03:00
|
|
|
.name = (const char * const[]) {
|
|
|
|
"mov", "mov.n", NULL,
|
|
|
|
},
|
2017-11-04 04:29:27 +03:00
|
|
|
.translate = translate_mov,
|
2019-02-10 10:39:10 +03:00
|
|
|
.op_flags = XTENSA_OP_NAME_ARRAY,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "moveqz",
|
|
|
|
.translate = translate_movcond,
|
|
|
|
.par = (const uint32_t[]){TCG_COND_EQ},
|
|
|
|
}, {
|
|
|
|
.name = "movf",
|
|
|
|
.translate = translate_movp,
|
|
|
|
.par = (const uint32_t[]){TCG_COND_EQ},
|
|
|
|
}, {
|
|
|
|
.name = "movgez",
|
|
|
|
.translate = translate_movcond,
|
|
|
|
.par = (const uint32_t[]){TCG_COND_GE},
|
|
|
|
}, {
|
|
|
|
.name = "movi",
|
|
|
|
.translate = translate_movi,
|
|
|
|
}, {
|
|
|
|
.name = "movi.n",
|
|
|
|
.translate = translate_movi,
|
|
|
|
}, {
|
|
|
|
.name = "movltz",
|
|
|
|
.translate = translate_movcond,
|
|
|
|
.par = (const uint32_t[]){TCG_COND_LT},
|
|
|
|
}, {
|
|
|
|
.name = "movnez",
|
|
|
|
.translate = translate_movcond,
|
|
|
|
.par = (const uint32_t[]){TCG_COND_NE},
|
|
|
|
}, {
|
|
|
|
.name = "movsp",
|
|
|
|
.translate = translate_movsp,
|
2018-08-31 04:21:22 +03:00
|
|
|
.op_flags = XTENSA_OP_ALLOCA,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "movt",
|
|
|
|
.translate = translate_movp,
|
|
|
|
.par = (const uint32_t[]){TCG_COND_NE},
|
|
|
|
}, {
|
|
|
|
.name = "mul.aa.hh",
|
|
|
|
.translate = translate_mac16,
|
2019-02-12 06:16:14 +03:00
|
|
|
.par = (const uint32_t[]){MAC16_MUL, MAC16_HH, 0},
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "mul.aa.hl",
|
|
|
|
.translate = translate_mac16,
|
2019-02-12 06:16:14 +03:00
|
|
|
.par = (const uint32_t[]){MAC16_MUL, MAC16_HL, 0},
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "mul.aa.lh",
|
|
|
|
.translate = translate_mac16,
|
2019-02-12 06:16:14 +03:00
|
|
|
.par = (const uint32_t[]){MAC16_MUL, MAC16_LH, 0},
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "mul.aa.ll",
|
|
|
|
.translate = translate_mac16,
|
2019-02-12 06:16:14 +03:00
|
|
|
.par = (const uint32_t[]){MAC16_MUL, MAC16_LL, 0},
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "mul.ad.hh",
|
|
|
|
.translate = translate_mac16,
|
2019-02-12 06:16:14 +03:00
|
|
|
.par = (const uint32_t[]){MAC16_MUL, MAC16_HH, 0},
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "mul.ad.hl",
|
|
|
|
.translate = translate_mac16,
|
2019-02-12 06:16:14 +03:00
|
|
|
.par = (const uint32_t[]){MAC16_MUL, MAC16_HL, 0},
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "mul.ad.lh",
|
|
|
|
.translate = translate_mac16,
|
2019-02-12 06:16:14 +03:00
|
|
|
.par = (const uint32_t[]){MAC16_MUL, MAC16_LH, 0},
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "mul.ad.ll",
|
|
|
|
.translate = translate_mac16,
|
2019-02-12 06:16:14 +03:00
|
|
|
.par = (const uint32_t[]){MAC16_MUL, MAC16_LL, 0},
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "mul.da.hh",
|
|
|
|
.translate = translate_mac16,
|
2019-02-12 06:16:14 +03:00
|
|
|
.par = (const uint32_t[]){MAC16_MUL, MAC16_HH, 0},
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "mul.da.hl",
|
|
|
|
.translate = translate_mac16,
|
2019-02-12 06:16:14 +03:00
|
|
|
.par = (const uint32_t[]){MAC16_MUL, MAC16_HL, 0},
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "mul.da.lh",
|
|
|
|
.translate = translate_mac16,
|
2019-02-12 06:16:14 +03:00
|
|
|
.par = (const uint32_t[]){MAC16_MUL, MAC16_LH, 0},
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "mul.da.ll",
|
|
|
|
.translate = translate_mac16,
|
2019-02-12 06:16:14 +03:00
|
|
|
.par = (const uint32_t[]){MAC16_MUL, MAC16_LL, 0},
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "mul.dd.hh",
|
|
|
|
.translate = translate_mac16,
|
2019-02-12 06:16:14 +03:00
|
|
|
.par = (const uint32_t[]){MAC16_MUL, MAC16_HH, 0},
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "mul.dd.hl",
|
|
|
|
.translate = translate_mac16,
|
2019-02-12 06:16:14 +03:00
|
|
|
.par = (const uint32_t[]){MAC16_MUL, MAC16_HL, 0},
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "mul.dd.lh",
|
|
|
|
.translate = translate_mac16,
|
2019-02-12 06:16:14 +03:00
|
|
|
.par = (const uint32_t[]){MAC16_MUL, MAC16_LH, 0},
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "mul.dd.ll",
|
|
|
|
.translate = translate_mac16,
|
2019-02-12 06:16:14 +03:00
|
|
|
.par = (const uint32_t[]){MAC16_MUL, MAC16_LL, 0},
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "mul16s",
|
|
|
|
.translate = translate_mul16,
|
|
|
|
.par = (const uint32_t[]){true},
|
|
|
|
}, {
|
|
|
|
.name = "mul16u",
|
|
|
|
.translate = translate_mul16,
|
|
|
|
.par = (const uint32_t[]){false},
|
|
|
|
}, {
|
|
|
|
.name = "mula.aa.hh",
|
|
|
|
.translate = translate_mac16,
|
2019-02-12 06:16:14 +03:00
|
|
|
.par = (const uint32_t[]){MAC16_MULA, MAC16_HH, 0},
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "mula.aa.hl",
|
|
|
|
.translate = translate_mac16,
|
2019-02-12 06:16:14 +03:00
|
|
|
.par = (const uint32_t[]){MAC16_MULA, MAC16_HL, 0},
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "mula.aa.lh",
|
|
|
|
.translate = translate_mac16,
|
2019-02-12 06:16:14 +03:00
|
|
|
.par = (const uint32_t[]){MAC16_MULA, MAC16_LH, 0},
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "mula.aa.ll",
|
|
|
|
.translate = translate_mac16,
|
2019-02-12 06:16:14 +03:00
|
|
|
.par = (const uint32_t[]){MAC16_MULA, MAC16_LL, 0},
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "mula.ad.hh",
|
|
|
|
.translate = translate_mac16,
|
2019-02-12 06:16:14 +03:00
|
|
|
.par = (const uint32_t[]){MAC16_MULA, MAC16_HH, 0},
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "mula.ad.hl",
|
|
|
|
.translate = translate_mac16,
|
2019-02-12 06:16:14 +03:00
|
|
|
.par = (const uint32_t[]){MAC16_MULA, MAC16_HL, 0},
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "mula.ad.lh",
|
|
|
|
.translate = translate_mac16,
|
2019-02-12 06:16:14 +03:00
|
|
|
.par = (const uint32_t[]){MAC16_MULA, MAC16_LH, 0},
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "mula.ad.ll",
|
|
|
|
.translate = translate_mac16,
|
2019-02-12 06:16:14 +03:00
|
|
|
.par = (const uint32_t[]){MAC16_MULA, MAC16_LL, 0},
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "mula.da.hh",
|
|
|
|
.translate = translate_mac16,
|
2019-02-12 06:16:14 +03:00
|
|
|
.par = (const uint32_t[]){MAC16_MULA, MAC16_HH, 0},
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "mula.da.hh.lddec",
|
|
|
|
.translate = translate_mac16,
|
2019-02-12 06:16:14 +03:00
|
|
|
.par = (const uint32_t[]){MAC16_MULA, MAC16_HH, -4},
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "mula.da.hh.ldinc",
|
|
|
|
.translate = translate_mac16,
|
2019-02-12 06:16:14 +03:00
|
|
|
.par = (const uint32_t[]){MAC16_MULA, MAC16_HH, 4},
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "mula.da.hl",
|
|
|
|
.translate = translate_mac16,
|
2019-02-12 06:16:14 +03:00
|
|
|
.par = (const uint32_t[]){MAC16_MULA, MAC16_HL, 0},
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "mula.da.hl.lddec",
|
|
|
|
.translate = translate_mac16,
|
2019-02-12 06:16:14 +03:00
|
|
|
.par = (const uint32_t[]){MAC16_MULA, MAC16_HL, -4},
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "mula.da.hl.ldinc",
|
|
|
|
.translate = translate_mac16,
|
2019-02-12 06:16:14 +03:00
|
|
|
.par = (const uint32_t[]){MAC16_MULA, MAC16_HL, 4},
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "mula.da.lh",
|
|
|
|
.translate = translate_mac16,
|
2019-02-12 06:16:14 +03:00
|
|
|
.par = (const uint32_t[]){MAC16_MULA, MAC16_LH, 0},
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "mula.da.lh.lddec",
|
|
|
|
.translate = translate_mac16,
|
2019-02-12 06:16:14 +03:00
|
|
|
.par = (const uint32_t[]){MAC16_MULA, MAC16_LH, -4},
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "mula.da.lh.ldinc",
|
|
|
|
.translate = translate_mac16,
|
2019-02-12 06:16:14 +03:00
|
|
|
.par = (const uint32_t[]){MAC16_MULA, MAC16_LH, 4},
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "mula.da.ll",
|
|
|
|
.translate = translate_mac16,
|
2019-02-12 06:16:14 +03:00
|
|
|
.par = (const uint32_t[]){MAC16_MULA, MAC16_LL, 0},
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "mula.da.ll.lddec",
|
|
|
|
.translate = translate_mac16,
|
2019-02-12 06:16:14 +03:00
|
|
|
.par = (const uint32_t[]){MAC16_MULA, MAC16_LL, -4},
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "mula.da.ll.ldinc",
|
|
|
|
.translate = translate_mac16,
|
2019-02-12 06:16:14 +03:00
|
|
|
.par = (const uint32_t[]){MAC16_MULA, MAC16_LL, 4},
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "mula.dd.hh",
|
|
|
|
.translate = translate_mac16,
|
2019-02-12 06:16:14 +03:00
|
|
|
.par = (const uint32_t[]){MAC16_MULA, MAC16_HH, 0},
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "mula.dd.hh.lddec",
|
|
|
|
.translate = translate_mac16,
|
2019-02-12 06:16:14 +03:00
|
|
|
.par = (const uint32_t[]){MAC16_MULA, MAC16_HH, -4},
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "mula.dd.hh.ldinc",
|
|
|
|
.translate = translate_mac16,
|
2019-02-12 06:16:14 +03:00
|
|
|
.par = (const uint32_t[]){MAC16_MULA, MAC16_HH, 4},
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "mula.dd.hl",
|
|
|
|
.translate = translate_mac16,
|
2019-02-12 06:16:14 +03:00
|
|
|
.par = (const uint32_t[]){MAC16_MULA, MAC16_HL, 0},
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "mula.dd.hl.lddec",
|
|
|
|
.translate = translate_mac16,
|
2019-02-12 06:16:14 +03:00
|
|
|
.par = (const uint32_t[]){MAC16_MULA, MAC16_HL, -4},
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "mula.dd.hl.ldinc",
|
|
|
|
.translate = translate_mac16,
|
2019-02-12 06:16:14 +03:00
|
|
|
.par = (const uint32_t[]){MAC16_MULA, MAC16_HL, 4},
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "mula.dd.lh",
|
|
|
|
.translate = translate_mac16,
|
2019-02-12 06:16:14 +03:00
|
|
|
.par = (const uint32_t[]){MAC16_MULA, MAC16_LH, 0},
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "mula.dd.lh.lddec",
|
|
|
|
.translate = translate_mac16,
|
2019-02-12 06:16:14 +03:00
|
|
|
.par = (const uint32_t[]){MAC16_MULA, MAC16_LH, -4},
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "mula.dd.lh.ldinc",
|
|
|
|
.translate = translate_mac16,
|
2019-02-12 06:16:14 +03:00
|
|
|
.par = (const uint32_t[]){MAC16_MULA, MAC16_LH, 4},
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "mula.dd.ll",
|
|
|
|
.translate = translate_mac16,
|
2019-02-12 06:16:14 +03:00
|
|
|
.par = (const uint32_t[]){MAC16_MULA, MAC16_LL, 0},
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "mula.dd.ll.lddec",
|
|
|
|
.translate = translate_mac16,
|
2019-02-12 06:16:14 +03:00
|
|
|
.par = (const uint32_t[]){MAC16_MULA, MAC16_LL, -4},
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "mula.dd.ll.ldinc",
|
|
|
|
.translate = translate_mac16,
|
2019-02-12 06:16:14 +03:00
|
|
|
.par = (const uint32_t[]){MAC16_MULA, MAC16_LL, 4},
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "mull",
|
|
|
|
.translate = translate_mull,
|
|
|
|
}, {
|
|
|
|
.name = "muls.aa.hh",
|
|
|
|
.translate = translate_mac16,
|
2019-02-12 06:16:14 +03:00
|
|
|
.par = (const uint32_t[]){MAC16_MULS, MAC16_HH, 0},
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "muls.aa.hl",
|
|
|
|
.translate = translate_mac16,
|
2019-02-12 06:16:14 +03:00
|
|
|
.par = (const uint32_t[]){MAC16_MULS, MAC16_HL, 0},
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "muls.aa.lh",
|
|
|
|
.translate = translate_mac16,
|
2019-02-12 06:16:14 +03:00
|
|
|
.par = (const uint32_t[]){MAC16_MULS, MAC16_LH, 0},
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "muls.aa.ll",
|
|
|
|
.translate = translate_mac16,
|
2019-02-12 06:16:14 +03:00
|
|
|
.par = (const uint32_t[]){MAC16_MULS, MAC16_LL, 0},
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "muls.ad.hh",
|
|
|
|
.translate = translate_mac16,
|
2019-02-12 06:16:14 +03:00
|
|
|
.par = (const uint32_t[]){MAC16_MULS, MAC16_HH, 0},
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "muls.ad.hl",
|
|
|
|
.translate = translate_mac16,
|
2019-02-12 06:16:14 +03:00
|
|
|
.par = (const uint32_t[]){MAC16_MULS, MAC16_HL, 0},
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "muls.ad.lh",
|
|
|
|
.translate = translate_mac16,
|
2019-02-12 06:16:14 +03:00
|
|
|
.par = (const uint32_t[]){MAC16_MULS, MAC16_LH, 0},
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "muls.ad.ll",
|
|
|
|
.translate = translate_mac16,
|
2019-02-12 06:16:14 +03:00
|
|
|
.par = (const uint32_t[]){MAC16_MULS, MAC16_LL, 0},
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "muls.da.hh",
|
|
|
|
.translate = translate_mac16,
|
2019-02-12 06:16:14 +03:00
|
|
|
.par = (const uint32_t[]){MAC16_MULS, MAC16_HH, 0},
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "muls.da.hl",
|
|
|
|
.translate = translate_mac16,
|
2019-02-12 06:16:14 +03:00
|
|
|
.par = (const uint32_t[]){MAC16_MULS, MAC16_HL, 0},
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "muls.da.lh",
|
|
|
|
.translate = translate_mac16,
|
2019-02-12 06:16:14 +03:00
|
|
|
.par = (const uint32_t[]){MAC16_MULS, MAC16_LH, 0},
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "muls.da.ll",
|
|
|
|
.translate = translate_mac16,
|
2019-02-12 06:16:14 +03:00
|
|
|
.par = (const uint32_t[]){MAC16_MULS, MAC16_LL, 0},
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "muls.dd.hh",
|
|
|
|
.translate = translate_mac16,
|
2019-02-12 06:16:14 +03:00
|
|
|
.par = (const uint32_t[]){MAC16_MULS, MAC16_HH, 0},
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "muls.dd.hl",
|
|
|
|
.translate = translate_mac16,
|
2019-02-12 06:16:14 +03:00
|
|
|
.par = (const uint32_t[]){MAC16_MULS, MAC16_HL, 0},
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "muls.dd.lh",
|
|
|
|
.translate = translate_mac16,
|
2019-02-12 06:16:14 +03:00
|
|
|
.par = (const uint32_t[]){MAC16_MULS, MAC16_LH, 0},
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "muls.dd.ll",
|
|
|
|
.translate = translate_mac16,
|
2019-02-12 06:16:14 +03:00
|
|
|
.par = (const uint32_t[]){MAC16_MULS, MAC16_LL, 0},
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "mulsh",
|
|
|
|
.translate = translate_mulh,
|
|
|
|
.par = (const uint32_t[]){true},
|
|
|
|
}, {
|
|
|
|
.name = "muluh",
|
|
|
|
.translate = translate_mulh,
|
|
|
|
.par = (const uint32_t[]){false},
|
|
|
|
}, {
|
|
|
|
.name = "neg",
|
|
|
|
.translate = translate_neg,
|
|
|
|
}, {
|
2019-02-10 10:39:10 +03:00
|
|
|
.name = (const char * const[]) {
|
|
|
|
"nop", "nop.n", NULL,
|
|
|
|
},
|
2017-11-04 04:29:27 +03:00
|
|
|
.translate = translate_nop,
|
2019-02-10 10:39:10 +03:00
|
|
|
.op_flags = XTENSA_OP_NAME_ARRAY,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "nsa",
|
|
|
|
.translate = translate_nsa,
|
|
|
|
}, {
|
|
|
|
.name = "nsau",
|
|
|
|
.translate = translate_nsau,
|
|
|
|
}, {
|
|
|
|
.name = "or",
|
|
|
|
.translate = translate_or,
|
|
|
|
}, {
|
|
|
|
.name = "orb",
|
|
|
|
.translate = translate_boolean,
|
|
|
|
.par = (const uint32_t[]){BOOLEAN_OR},
|
|
|
|
}, {
|
|
|
|
.name = "orbc",
|
|
|
|
.translate = translate_boolean,
|
|
|
|
.par = (const uint32_t[]){BOOLEAN_ORC},
|
|
|
|
}, {
|
|
|
|
.name = "pdtlb",
|
|
|
|
.translate = translate_ptlb,
|
|
|
|
.par = (const uint32_t[]){true},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2019-04-16 03:45:02 +03:00
|
|
|
}, {
|
|
|
|
.name = "pfend.a",
|
|
|
|
.translate = translate_nop,
|
|
|
|
}, {
|
|
|
|
.name = "pfend.o",
|
|
|
|
.translate = translate_nop,
|
|
|
|
}, {
|
|
|
|
.name = "pfnxt.f",
|
|
|
|
.translate = translate_nop,
|
|
|
|
}, {
|
|
|
|
.name = "pfwait.a",
|
|
|
|
.translate = translate_nop,
|
|
|
|
}, {
|
2020-02-26 23:43:52 +03:00
|
|
|
.name = "pfwait.r",
|
2019-04-16 03:45:02 +03:00
|
|
|
.translate = translate_nop,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "pitlb",
|
|
|
|
.translate = translate_ptlb,
|
|
|
|
.par = (const uint32_t[]){false},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2019-03-13 22:40:38 +03:00
|
|
|
}, {
|
|
|
|
.name = "pptlb",
|
|
|
|
.translate = translate_pptlb,
|
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "quos",
|
|
|
|
.translate = translate_quos,
|
|
|
|
.par = (const uint32_t[]){true},
|
2018-09-01 07:26:54 +03:00
|
|
|
.op_flags = XTENSA_OP_DIVIDE_BY_ZERO,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "quou",
|
|
|
|
.translate = translate_quou,
|
2018-09-01 07:26:54 +03:00
|
|
|
.op_flags = XTENSA_OP_DIVIDE_BY_ZERO,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "rdtlb0",
|
|
|
|
.translate = translate_rtlb,
|
|
|
|
.par = (const uint32_t[]){true, 0},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "rdtlb1",
|
|
|
|
.translate = translate_rtlb,
|
|
|
|
.par = (const uint32_t[]){true, 1},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-02-18 03:21:36 +03:00
|
|
|
}, {
|
|
|
|
.name = "read_impwire",
|
|
|
|
.translate = translate_read_impwire,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "rems",
|
|
|
|
.translate = translate_quos,
|
|
|
|
.par = (const uint32_t[]){false},
|
2018-09-01 07:26:54 +03:00
|
|
|
.op_flags = XTENSA_OP_DIVIDE_BY_ZERO,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "remu",
|
2018-09-01 07:26:54 +03:00
|
|
|
.translate = translate_remu,
|
|
|
|
.op_flags = XTENSA_OP_DIVIDE_BY_ZERO,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "rer",
|
|
|
|
.translate = translate_rer,
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
2019-02-10 10:39:10 +03:00
|
|
|
.name = (const char * const[]) {
|
|
|
|
"ret", "ret.n", NULL,
|
|
|
|
},
|
2017-11-04 04:29:27 +03:00
|
|
|
.translate = translate_ret,
|
2019-02-10 10:39:10 +03:00
|
|
|
.op_flags = XTENSA_OP_NAME_ARRAY,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
2019-02-10 10:39:10 +03:00
|
|
|
.name = (const char * const[]) {
|
|
|
|
"retw", "retw.n", NULL,
|
|
|
|
},
|
2017-11-04 04:29:27 +03:00
|
|
|
.translate = translate_retw,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_retw,
|
2019-02-10 10:39:10 +03:00
|
|
|
.op_flags = XTENSA_OP_UNDERFLOW | XTENSA_OP_NAME_ARRAY,
|
2017-01-29 14:50:25 +03:00
|
|
|
}, {
|
|
|
|
.name = "rfdd",
|
2018-08-28 07:43:43 +03:00
|
|
|
.op_flags = XTENSA_OP_ILL,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "rfde",
|
|
|
|
.translate = translate_rfde,
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-01-29 14:50:25 +03:00
|
|
|
}, {
|
|
|
|
.name = "rfdo",
|
2018-08-28 07:43:43 +03:00
|
|
|
.op_flags = XTENSA_OP_ILL,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "rfe",
|
|
|
|
.translate = translate_rfe,
|
2018-09-02 12:07:30 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED | XTENSA_OP_CHECK_INTERRUPTS,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "rfi",
|
|
|
|
.translate = translate_rfi,
|
2018-09-02 12:07:30 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED | XTENSA_OP_CHECK_INTERRUPTS,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "rfwo",
|
|
|
|
.translate = translate_rfw,
|
|
|
|
.par = (const uint32_t[]){true},
|
2018-09-02 12:07:30 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED | XTENSA_OP_CHECK_INTERRUPTS,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "rfwu",
|
|
|
|
.translate = translate_rfw,
|
|
|
|
.par = (const uint32_t[]){false},
|
2018-09-02 12:07:30 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED | XTENSA_OP_CHECK_INTERRUPTS,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "ritlb0",
|
|
|
|
.translate = translate_rtlb,
|
|
|
|
.par = (const uint32_t[]){false, 0},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "ritlb1",
|
|
|
|
.translate = translate_rtlb,
|
|
|
|
.par = (const uint32_t[]){false, 1},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2019-03-13 22:40:38 +03:00
|
|
|
}, {
|
|
|
|
.name = "rptlb0",
|
|
|
|
.translate = translate_rptlb0,
|
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
|
|
|
}, {
|
|
|
|
.name = "rptlb1",
|
|
|
|
.translate = translate_rptlb1,
|
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "rotw",
|
|
|
|
.translate = translate_rotw,
|
2019-01-31 01:56:29 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED |
|
|
|
|
XTENSA_OP_EXIT_TB_M1 |
|
|
|
|
XTENSA_OP_SYNC_REGISTER_WINDOW,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "rsil",
|
|
|
|
.translate = translate_rsil,
|
2018-09-02 12:07:30 +03:00
|
|
|
.op_flags =
|
|
|
|
XTENSA_OP_PRIVILEGED |
|
|
|
|
XTENSA_OP_EXIT_TB_0 |
|
|
|
|
XTENSA_OP_CHECK_INTERRUPTS,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "rsr.176",
|
|
|
|
.translate = translate_rsr,
|
|
|
|
.par = (const uint32_t[]){176},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "rsr.208",
|
|
|
|
.translate = translate_rsr,
|
|
|
|
.par = (const uint32_t[]){208},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "rsr.acchi",
|
|
|
|
.translate = translate_rsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
ACCHI,
|
|
|
|
XTENSA_OPTION_MAC16,
|
|
|
|
},
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "rsr.acclo",
|
|
|
|
.translate = translate_rsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
ACCLO,
|
|
|
|
XTENSA_OPTION_MAC16,
|
|
|
|
},
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "rsr.atomctl",
|
|
|
|
.translate = translate_rsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
ATOMCTL,
|
|
|
|
XTENSA_OPTION_ATOMCTL,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "rsr.br",
|
|
|
|
.translate = translate_rsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
BR,
|
|
|
|
XTENSA_OPTION_BOOLEAN,
|
|
|
|
},
|
2019-03-13 22:40:38 +03:00
|
|
|
}, {
|
|
|
|
.name = "rsr.cacheadrdis",
|
|
|
|
.translate = translate_rsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-13 22:40:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
CACHEADRDIS,
|
|
|
|
XTENSA_OPTION_MPU,
|
|
|
|
},
|
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "rsr.cacheattr",
|
|
|
|
.translate = translate_rsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
CACHEATTR,
|
|
|
|
XTENSA_OPTION_CACHEATTR,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "rsr.ccompare0",
|
|
|
|
.translate = translate_rsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_ccompare,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
CCOMPARE,
|
|
|
|
XTENSA_OPTION_TIMER_INTERRUPT,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "rsr.ccompare1",
|
|
|
|
.translate = translate_rsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_ccompare,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
CCOMPARE + 1,
|
|
|
|
XTENSA_OPTION_TIMER_INTERRUPT,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "rsr.ccompare2",
|
|
|
|
.translate = translate_rsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_ccompare,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
CCOMPARE + 2,
|
|
|
|
XTENSA_OPTION_TIMER_INTERRUPT,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "rsr.ccount",
|
2019-03-19 03:10:38 +03:00
|
|
|
.translate = translate_rsr_ccount,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
CCOUNT,
|
|
|
|
XTENSA_OPTION_TIMER_INTERRUPT,
|
|
|
|
},
|
2018-09-01 10:47:55 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED | XTENSA_OP_EXIT_TB_0,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "rsr.configid0",
|
|
|
|
.translate = translate_rsr,
|
|
|
|
.par = (const uint32_t[]){CONFIGID0},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "rsr.configid1",
|
|
|
|
.translate = translate_rsr,
|
|
|
|
.par = (const uint32_t[]){CONFIGID1},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "rsr.cpenable",
|
|
|
|
.translate = translate_rsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
CPENABLE,
|
|
|
|
XTENSA_OPTION_COPROCESSOR,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "rsr.dbreaka0",
|
|
|
|
.translate = translate_rsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_dbreak,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
DBREAKA,
|
|
|
|
XTENSA_OPTION_DEBUG,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "rsr.dbreaka1",
|
|
|
|
.translate = translate_rsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_dbreak,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
DBREAKA + 1,
|
|
|
|
XTENSA_OPTION_DEBUG,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "rsr.dbreakc0",
|
|
|
|
.translate = translate_rsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_dbreak,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
DBREAKC,
|
|
|
|
XTENSA_OPTION_DEBUG,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "rsr.dbreakc1",
|
|
|
|
.translate = translate_rsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_dbreak,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
DBREAKC + 1,
|
|
|
|
XTENSA_OPTION_DEBUG,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-01-29 14:50:25 +03:00
|
|
|
}, {
|
|
|
|
.name = "rsr.ddr",
|
|
|
|
.translate = translate_rsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
DDR,
|
|
|
|
XTENSA_OPTION_DEBUG,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "rsr.debugcause",
|
|
|
|
.translate = translate_rsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
DEBUGCAUSE,
|
|
|
|
XTENSA_OPTION_DEBUG,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "rsr.depc",
|
|
|
|
.translate = translate_rsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
DEPC,
|
|
|
|
XTENSA_OPTION_EXCEPTION,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "rsr.dtlbcfg",
|
|
|
|
.translate = translate_rsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
DTLBCFG,
|
|
|
|
XTENSA_OPTION_MMU,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "rsr.epc1",
|
|
|
|
.translate = translate_rsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
EPC1,
|
|
|
|
XTENSA_OPTION_EXCEPTION,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "rsr.epc2",
|
|
|
|
.translate = translate_rsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_hpi,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
EPC1 + 1,
|
|
|
|
XTENSA_OPTION_HIGH_PRIORITY_INTERRUPT,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "rsr.epc3",
|
|
|
|
.translate = translate_rsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_hpi,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
EPC1 + 2,
|
|
|
|
XTENSA_OPTION_HIGH_PRIORITY_INTERRUPT,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "rsr.epc4",
|
|
|
|
.translate = translate_rsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_hpi,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
EPC1 + 3,
|
|
|
|
XTENSA_OPTION_HIGH_PRIORITY_INTERRUPT,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "rsr.epc5",
|
|
|
|
.translate = translate_rsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_hpi,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
EPC1 + 4,
|
|
|
|
XTENSA_OPTION_HIGH_PRIORITY_INTERRUPT,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "rsr.epc6",
|
|
|
|
.translate = translate_rsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_hpi,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
EPC1 + 5,
|
|
|
|
XTENSA_OPTION_HIGH_PRIORITY_INTERRUPT,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "rsr.epc7",
|
|
|
|
.translate = translate_rsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_hpi,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
EPC1 + 6,
|
|
|
|
XTENSA_OPTION_HIGH_PRIORITY_INTERRUPT,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "rsr.eps2",
|
|
|
|
.translate = translate_rsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_hpi,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
EPS2,
|
|
|
|
XTENSA_OPTION_HIGH_PRIORITY_INTERRUPT,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "rsr.eps3",
|
|
|
|
.translate = translate_rsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_hpi,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
EPS2 + 1,
|
|
|
|
XTENSA_OPTION_HIGH_PRIORITY_INTERRUPT,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "rsr.eps4",
|
|
|
|
.translate = translate_rsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_hpi,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
EPS2 + 2,
|
|
|
|
XTENSA_OPTION_HIGH_PRIORITY_INTERRUPT,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "rsr.eps5",
|
|
|
|
.translate = translate_rsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_hpi,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
EPS2 + 3,
|
|
|
|
XTENSA_OPTION_HIGH_PRIORITY_INTERRUPT,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "rsr.eps6",
|
|
|
|
.translate = translate_rsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_hpi,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
EPS2 + 4,
|
|
|
|
XTENSA_OPTION_HIGH_PRIORITY_INTERRUPT,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "rsr.eps7",
|
|
|
|
.translate = translate_rsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_hpi,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
EPS2 + 5,
|
|
|
|
XTENSA_OPTION_HIGH_PRIORITY_INTERRUPT,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2019-03-13 22:40:38 +03:00
|
|
|
}, {
|
|
|
|
.name = "rsr.eraccess",
|
|
|
|
.translate = translate_rsr,
|
|
|
|
.par = (const uint32_t[]){ERACCESS},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "rsr.exccause",
|
|
|
|
.translate = translate_rsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
EXCCAUSE,
|
|
|
|
XTENSA_OPTION_EXCEPTION,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "rsr.excsave1",
|
|
|
|
.translate = translate_rsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
EXCSAVE1,
|
|
|
|
XTENSA_OPTION_EXCEPTION,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "rsr.excsave2",
|
|
|
|
.translate = translate_rsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_hpi,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
EXCSAVE1 + 1,
|
|
|
|
XTENSA_OPTION_HIGH_PRIORITY_INTERRUPT,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "rsr.excsave3",
|
|
|
|
.translate = translate_rsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_hpi,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
EXCSAVE1 + 2,
|
|
|
|
XTENSA_OPTION_HIGH_PRIORITY_INTERRUPT,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "rsr.excsave4",
|
|
|
|
.translate = translate_rsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_hpi,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
EXCSAVE1 + 3,
|
|
|
|
XTENSA_OPTION_HIGH_PRIORITY_INTERRUPT,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "rsr.excsave5",
|
|
|
|
.translate = translate_rsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_hpi,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
EXCSAVE1 + 4,
|
|
|
|
XTENSA_OPTION_HIGH_PRIORITY_INTERRUPT,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "rsr.excsave6",
|
|
|
|
.translate = translate_rsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_hpi,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
EXCSAVE1 + 5,
|
|
|
|
XTENSA_OPTION_HIGH_PRIORITY_INTERRUPT,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "rsr.excsave7",
|
|
|
|
.translate = translate_rsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_hpi,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
EXCSAVE1 + 6,
|
|
|
|
XTENSA_OPTION_HIGH_PRIORITY_INTERRUPT,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "rsr.excvaddr",
|
|
|
|
.translate = translate_rsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
EXCVADDR,
|
|
|
|
XTENSA_OPTION_EXCEPTION,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "rsr.ibreaka0",
|
|
|
|
.translate = translate_rsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_ibreak,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
IBREAKA,
|
|
|
|
XTENSA_OPTION_DEBUG,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "rsr.ibreaka1",
|
|
|
|
.translate = translate_rsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_ibreak,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
IBREAKA + 1,
|
|
|
|
XTENSA_OPTION_DEBUG,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "rsr.ibreakenable",
|
|
|
|
.translate = translate_rsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
IBREAKENABLE,
|
|
|
|
XTENSA_OPTION_DEBUG,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "rsr.icount",
|
|
|
|
.translate = translate_rsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
ICOUNT,
|
|
|
|
XTENSA_OPTION_DEBUG,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "rsr.icountlevel",
|
|
|
|
.translate = translate_rsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
ICOUNTLEVEL,
|
|
|
|
XTENSA_OPTION_DEBUG,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "rsr.intclear",
|
|
|
|
.translate = translate_rsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
INTCLEAR,
|
|
|
|
XTENSA_OPTION_INTERRUPT,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "rsr.intenable",
|
|
|
|
.translate = translate_rsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
INTENABLE,
|
|
|
|
XTENSA_OPTION_INTERRUPT,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "rsr.interrupt",
|
2019-03-19 03:10:38 +03:00
|
|
|
.translate = translate_rsr_ccount,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
INTSET,
|
|
|
|
XTENSA_OPTION_INTERRUPT,
|
|
|
|
},
|
2018-09-01 10:47:55 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED | XTENSA_OP_EXIT_TB_0,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "rsr.intset",
|
2019-03-19 03:10:38 +03:00
|
|
|
.translate = translate_rsr_ccount,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
INTSET,
|
|
|
|
XTENSA_OPTION_INTERRUPT,
|
|
|
|
},
|
2018-09-01 10:47:55 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED | XTENSA_OP_EXIT_TB_0,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "rsr.itlbcfg",
|
|
|
|
.translate = translate_rsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
ITLBCFG,
|
|
|
|
XTENSA_OPTION_MMU,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "rsr.lbeg",
|
|
|
|
.translate = translate_rsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
LBEG,
|
|
|
|
XTENSA_OPTION_LOOP,
|
|
|
|
},
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "rsr.lcount",
|
|
|
|
.translate = translate_rsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
LCOUNT,
|
|
|
|
XTENSA_OPTION_LOOP,
|
|
|
|
},
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "rsr.lend",
|
|
|
|
.translate = translate_rsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
LEND,
|
|
|
|
XTENSA_OPTION_LOOP,
|
|
|
|
},
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "rsr.litbase",
|
|
|
|
.translate = translate_rsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
LITBASE,
|
|
|
|
XTENSA_OPTION_EXTENDED_L32R,
|
|
|
|
},
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "rsr.m0",
|
|
|
|
.translate = translate_rsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
MR,
|
|
|
|
XTENSA_OPTION_MAC16,
|
|
|
|
},
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "rsr.m1",
|
|
|
|
.translate = translate_rsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
MR + 1,
|
|
|
|
XTENSA_OPTION_MAC16,
|
|
|
|
},
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "rsr.m2",
|
|
|
|
.translate = translate_rsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
MR + 2,
|
|
|
|
XTENSA_OPTION_MAC16,
|
|
|
|
},
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "rsr.m3",
|
|
|
|
.translate = translate_rsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
MR + 3,
|
|
|
|
XTENSA_OPTION_MAC16,
|
|
|
|
},
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "rsr.memctl",
|
|
|
|
.translate = translate_rsr,
|
|
|
|
.par = (const uint32_t[]){MEMCTL},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2019-03-13 22:41:13 +03:00
|
|
|
}, {
|
|
|
|
.name = "rsr.mecr",
|
|
|
|
.translate = translate_rsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-13 22:41:13 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
MECR,
|
|
|
|
XTENSA_OPTION_MEMORY_ECC_PARITY,
|
|
|
|
},
|
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
|
|
|
}, {
|
|
|
|
.name = "rsr.mepc",
|
|
|
|
.translate = translate_rsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-13 22:41:13 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
MEPC,
|
|
|
|
XTENSA_OPTION_MEMORY_ECC_PARITY,
|
|
|
|
},
|
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
|
|
|
}, {
|
|
|
|
.name = "rsr.meps",
|
|
|
|
.translate = translate_rsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-13 22:41:13 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
MEPS,
|
|
|
|
XTENSA_OPTION_MEMORY_ECC_PARITY,
|
|
|
|
},
|
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
|
|
|
}, {
|
|
|
|
.name = "rsr.mesave",
|
|
|
|
.translate = translate_rsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-13 22:41:13 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
MESAVE,
|
|
|
|
XTENSA_OPTION_MEMORY_ECC_PARITY,
|
|
|
|
},
|
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
|
|
|
}, {
|
|
|
|
.name = "rsr.mesr",
|
|
|
|
.translate = translate_rsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-13 22:41:13 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
MESR,
|
|
|
|
XTENSA_OPTION_MEMORY_ECC_PARITY,
|
|
|
|
},
|
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
|
|
|
}, {
|
|
|
|
.name = "rsr.mevaddr",
|
|
|
|
.translate = translate_rsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-13 22:41:13 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
MESR,
|
|
|
|
XTENSA_OPTION_MEMORY_ECC_PARITY,
|
|
|
|
},
|
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "rsr.misc0",
|
|
|
|
.translate = translate_rsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
MISC,
|
|
|
|
XTENSA_OPTION_MISC_SR,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "rsr.misc1",
|
|
|
|
.translate = translate_rsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
MISC + 1,
|
|
|
|
XTENSA_OPTION_MISC_SR,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "rsr.misc2",
|
|
|
|
.translate = translate_rsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
MISC + 2,
|
|
|
|
XTENSA_OPTION_MISC_SR,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "rsr.misc3",
|
|
|
|
.translate = translate_rsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
MISC + 3,
|
|
|
|
XTENSA_OPTION_MISC_SR,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2019-03-13 22:40:38 +03:00
|
|
|
}, {
|
|
|
|
.name = "rsr.mpucfg",
|
|
|
|
.translate = translate_rsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-13 22:40:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
MPUCFG,
|
|
|
|
XTENSA_OPTION_MPU,
|
|
|
|
},
|
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
|
|
|
}, {
|
|
|
|
.name = "rsr.mpuenb",
|
|
|
|
.translate = translate_rsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-13 22:40:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
MPUENB,
|
|
|
|
XTENSA_OPTION_MPU,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2019-02-18 14:11:40 +03:00
|
|
|
}, {
|
|
|
|
.name = "rsr.prefctl",
|
|
|
|
.translate = translate_rsr,
|
|
|
|
.par = (const uint32_t[]){PREFCTL},
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "rsr.prid",
|
|
|
|
.translate = translate_rsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
PRID,
|
|
|
|
XTENSA_OPTION_PROCESSOR_ID,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "rsr.ps",
|
|
|
|
.translate = translate_rsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
PS,
|
|
|
|
XTENSA_OPTION_EXCEPTION,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "rsr.ptevaddr",
|
2019-03-19 03:10:38 +03:00
|
|
|
.translate = translate_rsr_ptevaddr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
PTEVADDR,
|
|
|
|
XTENSA_OPTION_MMU,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "rsr.rasid",
|
|
|
|
.translate = translate_rsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
RASID,
|
|
|
|
XTENSA_OPTION_MMU,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "rsr.sar",
|
|
|
|
.translate = translate_rsr,
|
|
|
|
.par = (const uint32_t[]){SAR},
|
|
|
|
}, {
|
|
|
|
.name = "rsr.scompare1",
|
|
|
|
.translate = translate_rsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
SCOMPARE1,
|
|
|
|
XTENSA_OPTION_CONDITIONAL_STORE,
|
|
|
|
},
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "rsr.vecbase",
|
|
|
|
.translate = translate_rsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
VECBASE,
|
|
|
|
XTENSA_OPTION_RELOCATABLE_VECTOR,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "rsr.windowbase",
|
|
|
|
.translate = translate_rsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
WINDOW_BASE,
|
|
|
|
XTENSA_OPTION_WINDOWED_REGISTER,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "rsr.windowstart",
|
|
|
|
.translate = translate_rsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
WINDOW_START,
|
|
|
|
XTENSA_OPTION_WINDOWED_REGISTER,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "rsync",
|
|
|
|
.translate = translate_nop,
|
2017-02-18 03:21:36 +03:00
|
|
|
}, {
|
|
|
|
.name = "rur.expstate",
|
|
|
|
.translate = translate_rur,
|
|
|
|
.par = (const uint32_t[]){EXPSTATE},
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "rur.threadptr",
|
|
|
|
.translate = translate_rur,
|
|
|
|
.par = (const uint32_t[]){THREADPTR},
|
|
|
|
}, {
|
|
|
|
.name = "s16i",
|
|
|
|
.translate = translate_ldst,
|
|
|
|
.par = (const uint32_t[]){MO_TEUW, false, true},
|
2019-02-14 04:36:30 +03:00
|
|
|
.op_flags = XTENSA_OP_STORE,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "s32c1i",
|
|
|
|
.translate = translate_s32c1i,
|
2019-02-14 04:36:30 +03:00
|
|
|
.op_flags = XTENSA_OP_LOAD | XTENSA_OP_STORE,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "s32e",
|
|
|
|
.translate = translate_s32e,
|
2019-02-14 04:36:30 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED | XTENSA_OP_STORE,
|
2019-04-19 02:37:00 +03:00
|
|
|
}, {
|
|
|
|
.name = "s32ex",
|
|
|
|
.translate = translate_s32ex,
|
|
|
|
.op_flags = XTENSA_OP_LOAD | XTENSA_OP_STORE,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
2019-02-10 10:39:10 +03:00
|
|
|
.name = (const char * const[]) {
|
|
|
|
"s32i", "s32i.n", "s32nb", NULL,
|
|
|
|
},
|
2017-11-04 04:29:27 +03:00
|
|
|
.translate = translate_ldst,
|
|
|
|
.par = (const uint32_t[]){MO_TEUL, false, true},
|
2019-02-14 04:36:30 +03:00
|
|
|
.op_flags = XTENSA_OP_NAME_ARRAY | XTENSA_OP_STORE,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "s32ri",
|
|
|
|
.translate = translate_ldst,
|
|
|
|
.par = (const uint32_t[]){MO_TEUL, true, true},
|
2019-02-14 04:36:30 +03:00
|
|
|
.op_flags = XTENSA_OP_STORE,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "s8i",
|
|
|
|
.translate = translate_ldst,
|
|
|
|
.par = (const uint32_t[]){MO_UB, false, true},
|
2019-02-14 04:36:30 +03:00
|
|
|
.op_flags = XTENSA_OP_STORE,
|
2017-02-18 03:39:30 +03:00
|
|
|
}, {
|
|
|
|
.name = "salt",
|
|
|
|
.translate = translate_salt,
|
|
|
|
.par = (const uint32_t[]){TCG_COND_LT},
|
|
|
|
}, {
|
|
|
|
.name = "saltu",
|
|
|
|
.translate = translate_salt,
|
|
|
|
.par = (const uint32_t[]){TCG_COND_LTU},
|
2017-02-18 03:21:36 +03:00
|
|
|
}, {
|
|
|
|
.name = "setb_expstate",
|
|
|
|
.translate = translate_setb_expstate,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "sext",
|
|
|
|
.translate = translate_sext,
|
|
|
|
}, {
|
|
|
|
.name = "simcall",
|
|
|
|
.translate = translate_simcall,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_simcall,
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "sll",
|
|
|
|
.translate = translate_sll,
|
|
|
|
}, {
|
|
|
|
.name = "slli",
|
|
|
|
.translate = translate_slli,
|
|
|
|
}, {
|
|
|
|
.name = "sra",
|
|
|
|
.translate = translate_sra,
|
|
|
|
}, {
|
|
|
|
.name = "srai",
|
|
|
|
.translate = translate_srai,
|
|
|
|
}, {
|
|
|
|
.name = "src",
|
|
|
|
.translate = translate_src,
|
|
|
|
}, {
|
|
|
|
.name = "srl",
|
|
|
|
.translate = translate_srl,
|
|
|
|
}, {
|
|
|
|
.name = "srli",
|
|
|
|
.translate = translate_srli,
|
|
|
|
}, {
|
|
|
|
.name = "ssa8b",
|
|
|
|
.translate = translate_ssa8b,
|
|
|
|
}, {
|
|
|
|
.name = "ssa8l",
|
|
|
|
.translate = translate_ssa8l,
|
|
|
|
}, {
|
|
|
|
.name = "ssai",
|
|
|
|
.translate = translate_ssai,
|
|
|
|
}, {
|
|
|
|
.name = "ssl",
|
|
|
|
.translate = translate_ssl,
|
|
|
|
}, {
|
|
|
|
.name = "ssr",
|
|
|
|
.translate = translate_ssr,
|
|
|
|
}, {
|
|
|
|
.name = "sub",
|
|
|
|
.translate = translate_sub,
|
|
|
|
}, {
|
|
|
|
.name = "subx2",
|
|
|
|
.translate = translate_subx,
|
|
|
|
.par = (const uint32_t[]){1},
|
|
|
|
}, {
|
|
|
|
.name = "subx4",
|
|
|
|
.translate = translate_subx,
|
|
|
|
.par = (const uint32_t[]){2},
|
|
|
|
}, {
|
|
|
|
.name = "subx8",
|
|
|
|
.translate = translate_subx,
|
|
|
|
.par = (const uint32_t[]){3},
|
|
|
|
}, {
|
|
|
|
.name = "syscall",
|
2018-08-28 08:18:48 +03:00
|
|
|
.op_flags = XTENSA_OP_SYSCALL,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "umul.aa.hh",
|
|
|
|
.translate = translate_mac16,
|
2019-02-12 06:16:14 +03:00
|
|
|
.par = (const uint32_t[]){MAC16_UMUL, MAC16_HH, 0},
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "umul.aa.hl",
|
|
|
|
.translate = translate_mac16,
|
2019-02-12 06:16:14 +03:00
|
|
|
.par = (const uint32_t[]){MAC16_UMUL, MAC16_HL, 0},
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "umul.aa.lh",
|
|
|
|
.translate = translate_mac16,
|
2019-02-12 06:16:14 +03:00
|
|
|
.par = (const uint32_t[]){MAC16_UMUL, MAC16_LH, 0},
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "umul.aa.ll",
|
|
|
|
.translate = translate_mac16,
|
2019-02-12 06:16:14 +03:00
|
|
|
.par = (const uint32_t[]){MAC16_UMUL, MAC16_LL, 0},
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "waiti",
|
|
|
|
.translate = translate_waiti,
|
2018-09-01 10:47:55 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED | XTENSA_OP_EXIT_TB_0,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "wdtlb",
|
|
|
|
.translate = translate_wtlb,
|
|
|
|
.par = (const uint32_t[]){true},
|
2018-09-01 10:47:55 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED | XTENSA_OP_EXIT_TB_M1,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "wer",
|
|
|
|
.translate = translate_wer,
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "witlb",
|
|
|
|
.translate = translate_wtlb,
|
|
|
|
.par = (const uint32_t[]){false},
|
2018-09-01 10:47:55 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED | XTENSA_OP_EXIT_TB_M1,
|
2019-03-13 22:40:38 +03:00
|
|
|
}, {
|
|
|
|
.name = "wptlb",
|
|
|
|
.translate = translate_wptlb,
|
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED | XTENSA_OP_EXIT_TB_M1,
|
2017-02-18 03:21:36 +03:00
|
|
|
}, {
|
|
|
|
.name = "wrmsk_expstate",
|
|
|
|
.translate = translate_wrmsk_expstate,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "wsr.176",
|
2019-03-19 03:10:38 +03:00
|
|
|
.op_flags = XTENSA_OP_ILL,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "wsr.208",
|
2019-03-19 03:10:38 +03:00
|
|
|
.op_flags = XTENSA_OP_ILL,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "wsr.acchi",
|
2019-03-19 03:10:38 +03:00
|
|
|
.translate = translate_wsr_acchi,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
ACCHI,
|
|
|
|
XTENSA_OPTION_MAC16,
|
|
|
|
},
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "wsr.acclo",
|
|
|
|
.translate = translate_wsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
ACCLO,
|
|
|
|
XTENSA_OPTION_MAC16,
|
|
|
|
},
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "wsr.atomctl",
|
2019-03-19 03:10:38 +03:00
|
|
|
.translate = translate_wsr_mask,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
ATOMCTL,
|
|
|
|
XTENSA_OPTION_ATOMCTL,
|
|
|
|
0x3f,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "wsr.br",
|
2019-03-19 03:10:38 +03:00
|
|
|
.translate = translate_wsr_mask,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
BR,
|
|
|
|
XTENSA_OPTION_BOOLEAN,
|
|
|
|
0xffff,
|
|
|
|
},
|
2019-03-13 22:40:38 +03:00
|
|
|
}, {
|
|
|
|
.name = "wsr.cacheadrdis",
|
|
|
|
.translate = translate_wsr_mask,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-13 22:40:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
CACHEADRDIS,
|
|
|
|
XTENSA_OPTION_MPU,
|
|
|
|
0xff,
|
|
|
|
},
|
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "wsr.cacheattr",
|
|
|
|
.translate = translate_wsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
CACHEATTR,
|
|
|
|
XTENSA_OPTION_CACHEATTR,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "wsr.ccompare0",
|
2019-03-19 03:10:38 +03:00
|
|
|
.translate = translate_wsr_ccompare,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_ccompare,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
CCOMPARE,
|
|
|
|
XTENSA_OPTION_TIMER_INTERRUPT,
|
|
|
|
},
|
2018-09-01 10:47:55 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED | XTENSA_OP_EXIT_TB_0,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "wsr.ccompare1",
|
2019-03-19 03:10:38 +03:00
|
|
|
.translate = translate_wsr_ccompare,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_ccompare,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
CCOMPARE + 1,
|
|
|
|
XTENSA_OPTION_TIMER_INTERRUPT,
|
|
|
|
},
|
2018-09-01 10:47:55 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED | XTENSA_OP_EXIT_TB_0,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "wsr.ccompare2",
|
2019-03-19 03:10:38 +03:00
|
|
|
.translate = translate_wsr_ccompare,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_ccompare,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
CCOMPARE + 2,
|
|
|
|
XTENSA_OPTION_TIMER_INTERRUPT,
|
|
|
|
},
|
2018-09-01 10:47:55 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED | XTENSA_OP_EXIT_TB_0,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "wsr.ccount",
|
2019-03-19 03:10:38 +03:00
|
|
|
.translate = translate_wsr_ccount,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
CCOUNT,
|
|
|
|
XTENSA_OPTION_TIMER_INTERRUPT,
|
|
|
|
},
|
2018-09-01 10:47:55 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED | XTENSA_OP_EXIT_TB_0,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "wsr.configid0",
|
2019-03-19 03:10:38 +03:00
|
|
|
.op_flags = XTENSA_OP_ILL,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "wsr.configid1",
|
2019-03-19 03:10:38 +03:00
|
|
|
.op_flags = XTENSA_OP_ILL,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "wsr.cpenable",
|
2019-03-19 03:10:38 +03:00
|
|
|
.translate = translate_wsr_mask,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
CPENABLE,
|
|
|
|
XTENSA_OPTION_COPROCESSOR,
|
|
|
|
0xff,
|
|
|
|
},
|
2018-09-01 10:47:55 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED | XTENSA_OP_EXIT_TB_M1,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "wsr.dbreaka0",
|
2019-03-19 03:10:38 +03:00
|
|
|
.translate = translate_wsr_dbreaka,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_dbreak,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
DBREAKA,
|
|
|
|
XTENSA_OPTION_DEBUG,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "wsr.dbreaka1",
|
2019-03-19 03:10:38 +03:00
|
|
|
.translate = translate_wsr_dbreaka,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_dbreak,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
DBREAKA + 1,
|
|
|
|
XTENSA_OPTION_DEBUG,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "wsr.dbreakc0",
|
2019-03-19 03:10:38 +03:00
|
|
|
.translate = translate_wsr_dbreakc,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_dbreak,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
DBREAKC,
|
|
|
|
XTENSA_OPTION_DEBUG,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "wsr.dbreakc1",
|
2019-03-19 03:10:38 +03:00
|
|
|
.translate = translate_wsr_dbreakc,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_dbreak,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
DBREAKC + 1,
|
|
|
|
XTENSA_OPTION_DEBUG,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-01-29 14:50:25 +03:00
|
|
|
}, {
|
|
|
|
.name = "wsr.ddr",
|
|
|
|
.translate = translate_wsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
DDR,
|
|
|
|
XTENSA_OPTION_DEBUG,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "wsr.debugcause",
|
2019-03-19 03:10:38 +03:00
|
|
|
.op_flags = XTENSA_OP_ILL,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "wsr.depc",
|
|
|
|
.translate = translate_wsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
DEPC,
|
|
|
|
XTENSA_OPTION_EXCEPTION,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "wsr.dtlbcfg",
|
2019-03-19 03:10:38 +03:00
|
|
|
.translate = translate_wsr_mask,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
DTLBCFG,
|
|
|
|
XTENSA_OPTION_MMU,
|
|
|
|
0x01130000,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "wsr.epc1",
|
|
|
|
.translate = translate_wsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
EPC1,
|
|
|
|
XTENSA_OPTION_EXCEPTION,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "wsr.epc2",
|
|
|
|
.translate = translate_wsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_hpi,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
EPC1 + 1,
|
|
|
|
XTENSA_OPTION_HIGH_PRIORITY_INTERRUPT,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "wsr.epc3",
|
|
|
|
.translate = translate_wsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_hpi,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
EPC1 + 2,
|
|
|
|
XTENSA_OPTION_HIGH_PRIORITY_INTERRUPT,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "wsr.epc4",
|
|
|
|
.translate = translate_wsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_hpi,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
EPC1 + 3,
|
|
|
|
XTENSA_OPTION_HIGH_PRIORITY_INTERRUPT,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "wsr.epc5",
|
|
|
|
.translate = translate_wsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_hpi,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
EPC1 + 4,
|
|
|
|
XTENSA_OPTION_HIGH_PRIORITY_INTERRUPT,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "wsr.epc6",
|
|
|
|
.translate = translate_wsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_hpi,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
EPC1 + 5,
|
|
|
|
XTENSA_OPTION_HIGH_PRIORITY_INTERRUPT,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "wsr.epc7",
|
|
|
|
.translate = translate_wsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_hpi,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
EPC1 + 6,
|
|
|
|
XTENSA_OPTION_HIGH_PRIORITY_INTERRUPT,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "wsr.eps2",
|
|
|
|
.translate = translate_wsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_hpi,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
EPS2,
|
|
|
|
XTENSA_OPTION_HIGH_PRIORITY_INTERRUPT,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "wsr.eps3",
|
|
|
|
.translate = translate_wsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_hpi,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
EPS2 + 1,
|
|
|
|
XTENSA_OPTION_HIGH_PRIORITY_INTERRUPT,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "wsr.eps4",
|
|
|
|
.translate = translate_wsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_hpi,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
EPS2 + 2,
|
|
|
|
XTENSA_OPTION_HIGH_PRIORITY_INTERRUPT,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "wsr.eps5",
|
|
|
|
.translate = translate_wsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_hpi,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
EPS2 + 3,
|
|
|
|
XTENSA_OPTION_HIGH_PRIORITY_INTERRUPT,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "wsr.eps6",
|
|
|
|
.translate = translate_wsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_hpi,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
EPS2 + 4,
|
|
|
|
XTENSA_OPTION_HIGH_PRIORITY_INTERRUPT,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "wsr.eps7",
|
|
|
|
.translate = translate_wsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_hpi,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
EPS2 + 5,
|
|
|
|
XTENSA_OPTION_HIGH_PRIORITY_INTERRUPT,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2019-03-13 22:40:38 +03:00
|
|
|
}, {
|
|
|
|
.name = "wsr.eraccess",
|
|
|
|
.translate = translate_wsr_mask,
|
|
|
|
.par = (const uint32_t[]){
|
|
|
|
ERACCESS,
|
|
|
|
0,
|
|
|
|
0xffff,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "wsr.exccause",
|
|
|
|
.translate = translate_wsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
EXCCAUSE,
|
|
|
|
XTENSA_OPTION_EXCEPTION,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "wsr.excsave1",
|
|
|
|
.translate = translate_wsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
EXCSAVE1,
|
|
|
|
XTENSA_OPTION_EXCEPTION,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "wsr.excsave2",
|
|
|
|
.translate = translate_wsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_hpi,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
EXCSAVE1 + 1,
|
|
|
|
XTENSA_OPTION_HIGH_PRIORITY_INTERRUPT,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "wsr.excsave3",
|
|
|
|
.translate = translate_wsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_hpi,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
EXCSAVE1 + 2,
|
|
|
|
XTENSA_OPTION_HIGH_PRIORITY_INTERRUPT,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "wsr.excsave4",
|
|
|
|
.translate = translate_wsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_hpi,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
EXCSAVE1 + 3,
|
|
|
|
XTENSA_OPTION_HIGH_PRIORITY_INTERRUPT,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "wsr.excsave5",
|
|
|
|
.translate = translate_wsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_hpi,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
EXCSAVE1 + 4,
|
|
|
|
XTENSA_OPTION_HIGH_PRIORITY_INTERRUPT,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "wsr.excsave6",
|
|
|
|
.translate = translate_wsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_hpi,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
EXCSAVE1 + 5,
|
|
|
|
XTENSA_OPTION_HIGH_PRIORITY_INTERRUPT,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "wsr.excsave7",
|
|
|
|
.translate = translate_wsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_hpi,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
EXCSAVE1 + 6,
|
|
|
|
XTENSA_OPTION_HIGH_PRIORITY_INTERRUPT,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "wsr.excvaddr",
|
|
|
|
.translate = translate_wsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
EXCVADDR,
|
|
|
|
XTENSA_OPTION_EXCEPTION,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "wsr.ibreaka0",
|
2019-03-19 03:10:38 +03:00
|
|
|
.translate = translate_wsr_ibreaka,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_ibreak,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
IBREAKA,
|
|
|
|
XTENSA_OPTION_DEBUG,
|
|
|
|
},
|
2018-09-01 10:47:55 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED | XTENSA_OP_EXIT_TB_0,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "wsr.ibreaka1",
|
2019-03-19 03:10:38 +03:00
|
|
|
.translate = translate_wsr_ibreaka,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_ibreak,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
IBREAKA + 1,
|
|
|
|
XTENSA_OPTION_DEBUG,
|
|
|
|
},
|
2018-09-01 10:47:55 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED | XTENSA_OP_EXIT_TB_0,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "wsr.ibreakenable",
|
2019-03-19 03:10:38 +03:00
|
|
|
.translate = translate_wsr_ibreakenable,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
IBREAKENABLE,
|
|
|
|
XTENSA_OPTION_DEBUG,
|
|
|
|
},
|
2018-09-01 10:47:55 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED | XTENSA_OP_EXIT_TB_0,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "wsr.icount",
|
2019-03-19 03:10:38 +03:00
|
|
|
.translate = translate_wsr_icount,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
ICOUNT,
|
|
|
|
XTENSA_OPTION_DEBUG,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "wsr.icountlevel",
|
2019-03-19 03:10:38 +03:00
|
|
|
.translate = translate_wsr_mask,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
ICOUNTLEVEL,
|
|
|
|
XTENSA_OPTION_DEBUG,
|
|
|
|
0xf,
|
|
|
|
},
|
2018-09-01 10:47:55 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED | XTENSA_OP_EXIT_TB_M1,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "wsr.intclear",
|
2019-03-19 03:10:38 +03:00
|
|
|
.translate = translate_wsr_intclear,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
INTCLEAR,
|
|
|
|
XTENSA_OPTION_INTERRUPT,
|
|
|
|
},
|
2018-09-02 12:07:30 +03:00
|
|
|
.op_flags =
|
|
|
|
XTENSA_OP_PRIVILEGED |
|
|
|
|
XTENSA_OP_EXIT_TB_0 |
|
|
|
|
XTENSA_OP_CHECK_INTERRUPTS,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "wsr.intenable",
|
|
|
|
.translate = translate_wsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
INTENABLE,
|
|
|
|
XTENSA_OPTION_INTERRUPT,
|
|
|
|
},
|
2018-09-02 12:07:30 +03:00
|
|
|
.op_flags =
|
|
|
|
XTENSA_OP_PRIVILEGED |
|
|
|
|
XTENSA_OP_EXIT_TB_0 |
|
|
|
|
XTENSA_OP_CHECK_INTERRUPTS,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "wsr.interrupt",
|
|
|
|
.translate = translate_wsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
INTSET,
|
|
|
|
XTENSA_OPTION_INTERRUPT,
|
|
|
|
},
|
2018-09-02 12:07:30 +03:00
|
|
|
.op_flags =
|
|
|
|
XTENSA_OP_PRIVILEGED |
|
|
|
|
XTENSA_OP_EXIT_TB_0 |
|
|
|
|
XTENSA_OP_CHECK_INTERRUPTS,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "wsr.intset",
|
2019-03-19 03:10:38 +03:00
|
|
|
.translate = translate_wsr_intset,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
INTSET,
|
|
|
|
XTENSA_OPTION_INTERRUPT,
|
|
|
|
},
|
2018-09-02 12:07:30 +03:00
|
|
|
.op_flags =
|
|
|
|
XTENSA_OP_PRIVILEGED |
|
|
|
|
XTENSA_OP_EXIT_TB_0 |
|
|
|
|
XTENSA_OP_CHECK_INTERRUPTS,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "wsr.itlbcfg",
|
2019-03-19 03:10:38 +03:00
|
|
|
.translate = translate_wsr_mask,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
ITLBCFG,
|
|
|
|
XTENSA_OPTION_MMU,
|
|
|
|
0x01130000,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "wsr.lbeg",
|
|
|
|
.translate = translate_wsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
LBEG,
|
|
|
|
XTENSA_OPTION_LOOP,
|
|
|
|
},
|
2018-10-04 01:59:11 +03:00
|
|
|
.op_flags = XTENSA_OP_EXIT_TB_M1,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "wsr.lcount",
|
|
|
|
.translate = translate_wsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
LCOUNT,
|
|
|
|
XTENSA_OPTION_LOOP,
|
|
|
|
},
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "wsr.lend",
|
|
|
|
.translate = translate_wsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
LEND,
|
|
|
|
XTENSA_OPTION_LOOP,
|
|
|
|
},
|
2018-10-04 01:59:11 +03:00
|
|
|
.op_flags = XTENSA_OP_EXIT_TB_M1,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "wsr.litbase",
|
2019-03-19 03:10:38 +03:00
|
|
|
.translate = translate_wsr_mask,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
LITBASE,
|
|
|
|
XTENSA_OPTION_EXTENDED_L32R,
|
|
|
|
0xfffff001,
|
|
|
|
},
|
2018-09-01 10:47:55 +03:00
|
|
|
.op_flags = XTENSA_OP_EXIT_TB_M1,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "wsr.m0",
|
|
|
|
.translate = translate_wsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
MR,
|
|
|
|
XTENSA_OPTION_MAC16,
|
|
|
|
},
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "wsr.m1",
|
|
|
|
.translate = translate_wsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
MR + 1,
|
|
|
|
XTENSA_OPTION_MAC16,
|
|
|
|
},
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "wsr.m2",
|
|
|
|
.translate = translate_wsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
MR + 2,
|
|
|
|
XTENSA_OPTION_MAC16,
|
|
|
|
},
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "wsr.m3",
|
|
|
|
.translate = translate_wsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
MR + 3,
|
|
|
|
XTENSA_OPTION_MAC16,
|
|
|
|
},
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "wsr.memctl",
|
2019-03-19 03:10:38 +03:00
|
|
|
.translate = translate_wsr_memctl,
|
2017-11-04 04:29:27 +03:00
|
|
|
.par = (const uint32_t[]){MEMCTL},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2019-03-13 22:41:13 +03:00
|
|
|
}, {
|
|
|
|
.name = "wsr.mecr",
|
|
|
|
.translate = translate_wsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-13 22:41:13 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
MECR,
|
|
|
|
XTENSA_OPTION_MEMORY_ECC_PARITY,
|
|
|
|
},
|
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
|
|
|
}, {
|
|
|
|
.name = "wsr.mepc",
|
|
|
|
.translate = translate_wsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-13 22:41:13 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
MEPC,
|
|
|
|
XTENSA_OPTION_MEMORY_ECC_PARITY,
|
|
|
|
},
|
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
|
|
|
}, {
|
|
|
|
.name = "wsr.meps",
|
|
|
|
.translate = translate_wsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-13 22:41:13 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
MEPS,
|
|
|
|
XTENSA_OPTION_MEMORY_ECC_PARITY,
|
|
|
|
},
|
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
|
|
|
}, {
|
|
|
|
.name = "wsr.mesave",
|
|
|
|
.translate = translate_wsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-13 22:41:13 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
MESAVE,
|
|
|
|
XTENSA_OPTION_MEMORY_ECC_PARITY,
|
|
|
|
},
|
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
|
|
|
}, {
|
|
|
|
.name = "wsr.mesr",
|
|
|
|
.translate = translate_wsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-13 22:41:13 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
MESR,
|
|
|
|
XTENSA_OPTION_MEMORY_ECC_PARITY,
|
|
|
|
},
|
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
|
|
|
}, {
|
|
|
|
.name = "wsr.mevaddr",
|
|
|
|
.translate = translate_wsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-13 22:41:13 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
MESR,
|
|
|
|
XTENSA_OPTION_MEMORY_ECC_PARITY,
|
|
|
|
},
|
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "wsr.misc0",
|
|
|
|
.translate = translate_wsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
MISC,
|
|
|
|
XTENSA_OPTION_MISC_SR,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "wsr.misc1",
|
|
|
|
.translate = translate_wsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
MISC + 1,
|
|
|
|
XTENSA_OPTION_MISC_SR,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "wsr.misc2",
|
|
|
|
.translate = translate_wsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
MISC + 2,
|
|
|
|
XTENSA_OPTION_MISC_SR,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "wsr.misc3",
|
|
|
|
.translate = translate_wsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
MISC + 3,
|
|
|
|
XTENSA_OPTION_MISC_SR,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-01-29 14:50:25 +03:00
|
|
|
}, {
|
|
|
|
.name = "wsr.mmid",
|
|
|
|
.translate = translate_wsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
MMID,
|
|
|
|
XTENSA_OPTION_TRACE_PORT,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2019-03-13 22:40:38 +03:00
|
|
|
}, {
|
|
|
|
.name = "wsr.mpuenb",
|
|
|
|
.translate = translate_wsr_mpuenb,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-13 22:40:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
MPUENB,
|
|
|
|
XTENSA_OPTION_MPU,
|
|
|
|
},
|
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED | XTENSA_OP_EXIT_TB_M1,
|
2019-02-18 14:11:40 +03:00
|
|
|
}, {
|
|
|
|
.name = "wsr.prefctl",
|
|
|
|
.translate = translate_wsr,
|
|
|
|
.par = (const uint32_t[]){PREFCTL},
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "wsr.prid",
|
2019-03-19 03:10:38 +03:00
|
|
|
.op_flags = XTENSA_OP_ILL,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "wsr.ps",
|
2019-03-19 03:10:38 +03:00
|
|
|
.translate = translate_wsr_ps,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
PS,
|
|
|
|
XTENSA_OPTION_EXCEPTION,
|
|
|
|
},
|
2018-09-02 12:07:30 +03:00
|
|
|
.op_flags =
|
|
|
|
XTENSA_OP_PRIVILEGED |
|
|
|
|
XTENSA_OP_EXIT_TB_M1 |
|
|
|
|
XTENSA_OP_CHECK_INTERRUPTS,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "wsr.ptevaddr",
|
2019-03-19 03:10:38 +03:00
|
|
|
.translate = translate_wsr_mask,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
PTEVADDR,
|
|
|
|
XTENSA_OPTION_MMU,
|
|
|
|
0xffc00000,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "wsr.rasid",
|
2019-03-19 03:10:38 +03:00
|
|
|
.translate = translate_wsr_rasid,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
RASID,
|
|
|
|
XTENSA_OPTION_MMU,
|
|
|
|
},
|
2018-09-01 10:47:55 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED | XTENSA_OP_EXIT_TB_M1,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "wsr.sar",
|
2019-03-19 03:10:38 +03:00
|
|
|
.translate = translate_wsr_sar,
|
2017-11-04 04:29:27 +03:00
|
|
|
.par = (const uint32_t[]){SAR},
|
|
|
|
}, {
|
|
|
|
.name = "wsr.scompare1",
|
|
|
|
.translate = translate_wsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
SCOMPARE1,
|
|
|
|
XTENSA_OPTION_CONDITIONAL_STORE,
|
|
|
|
},
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "wsr.vecbase",
|
|
|
|
.translate = translate_wsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
VECBASE,
|
|
|
|
XTENSA_OPTION_RELOCATABLE_VECTOR,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "wsr.windowbase",
|
2019-03-19 03:10:38 +03:00
|
|
|
.translate = translate_wsr_windowbase,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
WINDOW_BASE,
|
|
|
|
XTENSA_OPTION_WINDOWED_REGISTER,
|
|
|
|
},
|
2019-01-31 01:56:29 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED |
|
|
|
|
XTENSA_OP_EXIT_TB_M1 |
|
|
|
|
XTENSA_OP_SYNC_REGISTER_WINDOW,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "wsr.windowstart",
|
2019-03-19 03:10:38 +03:00
|
|
|
.translate = translate_wsr_windowstart,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
WINDOW_START,
|
|
|
|
XTENSA_OPTION_WINDOWED_REGISTER,
|
|
|
|
},
|
2018-09-01 10:47:55 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED | XTENSA_OP_EXIT_TB_M1,
|
2017-02-18 03:21:36 +03:00
|
|
|
}, {
|
|
|
|
.name = "wur.expstate",
|
|
|
|
.translate = translate_wur,
|
|
|
|
.par = (const uint32_t[]){EXPSTATE},
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "wur.threadptr",
|
|
|
|
.translate = translate_wur,
|
|
|
|
.par = (const uint32_t[]){THREADPTR},
|
|
|
|
}, {
|
|
|
|
.name = "xor",
|
|
|
|
.translate = translate_xor,
|
|
|
|
}, {
|
|
|
|
.name = "xorb",
|
|
|
|
.translate = translate_boolean,
|
|
|
|
.par = (const uint32_t[]){BOOLEAN_XOR},
|
|
|
|
}, {
|
|
|
|
.name = "xsr.176",
|
2019-03-19 03:10:38 +03:00
|
|
|
.op_flags = XTENSA_OP_ILL,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "xsr.208",
|
2019-03-19 03:10:38 +03:00
|
|
|
.op_flags = XTENSA_OP_ILL,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "xsr.acchi",
|
2019-03-19 03:10:38 +03:00
|
|
|
.translate = translate_xsr_acchi,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
ACCHI,
|
|
|
|
XTENSA_OPTION_MAC16,
|
|
|
|
},
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "xsr.acclo",
|
|
|
|
.translate = translate_xsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
ACCLO,
|
|
|
|
XTENSA_OPTION_MAC16,
|
|
|
|
},
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "xsr.atomctl",
|
2019-03-19 03:10:38 +03:00
|
|
|
.translate = translate_xsr_mask,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
ATOMCTL,
|
|
|
|
XTENSA_OPTION_ATOMCTL,
|
|
|
|
0x3f,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "xsr.br",
|
2019-03-19 03:10:38 +03:00
|
|
|
.translate = translate_xsr_mask,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
BR,
|
|
|
|
XTENSA_OPTION_BOOLEAN,
|
|
|
|
0xffff,
|
|
|
|
},
|
2019-03-13 22:40:38 +03:00
|
|
|
}, {
|
|
|
|
.name = "xsr.cacheadrdis",
|
|
|
|
.translate = translate_xsr_mask,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-13 22:40:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
CACHEADRDIS,
|
|
|
|
XTENSA_OPTION_MPU,
|
|
|
|
0xff,
|
|
|
|
},
|
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "xsr.cacheattr",
|
|
|
|
.translate = translate_xsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
CACHEATTR,
|
|
|
|
XTENSA_OPTION_CACHEATTR,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "xsr.ccompare0",
|
2019-03-19 03:10:38 +03:00
|
|
|
.translate = translate_xsr_ccompare,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_ccompare,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
CCOMPARE,
|
|
|
|
XTENSA_OPTION_TIMER_INTERRUPT,
|
|
|
|
},
|
2018-09-01 10:47:55 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED | XTENSA_OP_EXIT_TB_0,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "xsr.ccompare1",
|
2019-03-19 03:10:38 +03:00
|
|
|
.translate = translate_xsr_ccompare,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_ccompare,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
CCOMPARE + 1,
|
|
|
|
XTENSA_OPTION_TIMER_INTERRUPT,
|
|
|
|
},
|
2018-09-01 10:47:55 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED | XTENSA_OP_EXIT_TB_0,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "xsr.ccompare2",
|
2019-03-19 03:10:38 +03:00
|
|
|
.translate = translate_xsr_ccompare,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_ccompare,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
CCOMPARE + 2,
|
|
|
|
XTENSA_OPTION_TIMER_INTERRUPT,
|
|
|
|
},
|
2018-09-01 10:47:55 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED | XTENSA_OP_EXIT_TB_0,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "xsr.ccount",
|
2019-03-19 03:10:38 +03:00
|
|
|
.translate = translate_xsr_ccount,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
CCOUNT,
|
|
|
|
XTENSA_OPTION_TIMER_INTERRUPT,
|
|
|
|
},
|
2018-09-01 10:47:55 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED | XTENSA_OP_EXIT_TB_0,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "xsr.configid0",
|
2019-03-19 03:10:38 +03:00
|
|
|
.op_flags = XTENSA_OP_ILL,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "xsr.configid1",
|
2019-03-19 03:10:38 +03:00
|
|
|
.op_flags = XTENSA_OP_ILL,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "xsr.cpenable",
|
2019-03-19 03:10:38 +03:00
|
|
|
.translate = translate_xsr_mask,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
CPENABLE,
|
|
|
|
XTENSA_OPTION_COPROCESSOR,
|
|
|
|
0xff,
|
|
|
|
},
|
2018-09-01 10:47:55 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED | XTENSA_OP_EXIT_TB_M1,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "xsr.dbreaka0",
|
2019-03-19 03:10:38 +03:00
|
|
|
.translate = translate_xsr_dbreaka,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_dbreak,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
DBREAKA,
|
|
|
|
XTENSA_OPTION_DEBUG,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "xsr.dbreaka1",
|
2019-03-19 03:10:38 +03:00
|
|
|
.translate = translate_xsr_dbreaka,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_dbreak,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
DBREAKA + 1,
|
|
|
|
XTENSA_OPTION_DEBUG,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "xsr.dbreakc0",
|
2019-03-19 03:10:38 +03:00
|
|
|
.translate = translate_xsr_dbreakc,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_dbreak,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
DBREAKC,
|
|
|
|
XTENSA_OPTION_DEBUG,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "xsr.dbreakc1",
|
2019-03-19 03:10:38 +03:00
|
|
|
.translate = translate_xsr_dbreakc,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_dbreak,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
DBREAKC + 1,
|
|
|
|
XTENSA_OPTION_DEBUG,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-01-29 14:50:25 +03:00
|
|
|
}, {
|
|
|
|
.name = "xsr.ddr",
|
|
|
|
.translate = translate_xsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
DDR,
|
|
|
|
XTENSA_OPTION_DEBUG,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "xsr.debugcause",
|
2019-03-19 03:10:38 +03:00
|
|
|
.op_flags = XTENSA_OP_ILL,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "xsr.depc",
|
|
|
|
.translate = translate_xsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
DEPC,
|
|
|
|
XTENSA_OPTION_EXCEPTION,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "xsr.dtlbcfg",
|
2019-03-19 03:10:38 +03:00
|
|
|
.translate = translate_xsr_mask,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
DTLBCFG,
|
|
|
|
XTENSA_OPTION_MMU,
|
|
|
|
0x01130000,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "xsr.epc1",
|
|
|
|
.translate = translate_xsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
EPC1,
|
|
|
|
XTENSA_OPTION_EXCEPTION,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "xsr.epc2",
|
|
|
|
.translate = translate_xsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_hpi,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
EPC1 + 1,
|
|
|
|
XTENSA_OPTION_HIGH_PRIORITY_INTERRUPT,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "xsr.epc3",
|
|
|
|
.translate = translate_xsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_hpi,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
EPC1 + 2,
|
|
|
|
XTENSA_OPTION_HIGH_PRIORITY_INTERRUPT,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "xsr.epc4",
|
|
|
|
.translate = translate_xsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_hpi,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
EPC1 + 3,
|
|
|
|
XTENSA_OPTION_HIGH_PRIORITY_INTERRUPT,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "xsr.epc5",
|
|
|
|
.translate = translate_xsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_hpi,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
EPC1 + 4,
|
|
|
|
XTENSA_OPTION_HIGH_PRIORITY_INTERRUPT,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "xsr.epc6",
|
|
|
|
.translate = translate_xsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_hpi,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
EPC1 + 5,
|
|
|
|
XTENSA_OPTION_HIGH_PRIORITY_INTERRUPT,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "xsr.epc7",
|
|
|
|
.translate = translate_xsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_hpi,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
EPC1 + 6,
|
|
|
|
XTENSA_OPTION_HIGH_PRIORITY_INTERRUPT,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "xsr.eps2",
|
|
|
|
.translate = translate_xsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_hpi,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
EPS2,
|
|
|
|
XTENSA_OPTION_HIGH_PRIORITY_INTERRUPT,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "xsr.eps3",
|
|
|
|
.translate = translate_xsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_hpi,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
EPS2 + 1,
|
|
|
|
XTENSA_OPTION_HIGH_PRIORITY_INTERRUPT,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "xsr.eps4",
|
|
|
|
.translate = translate_xsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_hpi,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
EPS2 + 2,
|
|
|
|
XTENSA_OPTION_HIGH_PRIORITY_INTERRUPT,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "xsr.eps5",
|
|
|
|
.translate = translate_xsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_hpi,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
EPS2 + 3,
|
|
|
|
XTENSA_OPTION_HIGH_PRIORITY_INTERRUPT,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "xsr.eps6",
|
|
|
|
.translate = translate_xsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_hpi,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
EPS2 + 4,
|
|
|
|
XTENSA_OPTION_HIGH_PRIORITY_INTERRUPT,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "xsr.eps7",
|
|
|
|
.translate = translate_xsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_hpi,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
EPS2 + 5,
|
|
|
|
XTENSA_OPTION_HIGH_PRIORITY_INTERRUPT,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2019-03-13 22:40:38 +03:00
|
|
|
}, {
|
|
|
|
.name = "xsr.eraccess",
|
|
|
|
.translate = translate_xsr_mask,
|
|
|
|
.par = (const uint32_t[]){
|
|
|
|
ERACCESS,
|
|
|
|
0,
|
|
|
|
0xffff,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "xsr.exccause",
|
|
|
|
.translate = translate_xsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
EXCCAUSE,
|
|
|
|
XTENSA_OPTION_EXCEPTION,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "xsr.excsave1",
|
|
|
|
.translate = translate_xsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
EXCSAVE1,
|
|
|
|
XTENSA_OPTION_EXCEPTION,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "xsr.excsave2",
|
|
|
|
.translate = translate_xsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_hpi,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
EXCSAVE1 + 1,
|
|
|
|
XTENSA_OPTION_HIGH_PRIORITY_INTERRUPT,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "xsr.excsave3",
|
|
|
|
.translate = translate_xsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_hpi,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
EXCSAVE1 + 2,
|
|
|
|
XTENSA_OPTION_HIGH_PRIORITY_INTERRUPT,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "xsr.excsave4",
|
|
|
|
.translate = translate_xsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_hpi,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
EXCSAVE1 + 3,
|
|
|
|
XTENSA_OPTION_HIGH_PRIORITY_INTERRUPT,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "xsr.excsave5",
|
|
|
|
.translate = translate_xsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_hpi,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
EXCSAVE1 + 4,
|
|
|
|
XTENSA_OPTION_HIGH_PRIORITY_INTERRUPT,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "xsr.excsave6",
|
|
|
|
.translate = translate_xsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_hpi,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
EXCSAVE1 + 5,
|
|
|
|
XTENSA_OPTION_HIGH_PRIORITY_INTERRUPT,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "xsr.excsave7",
|
|
|
|
.translate = translate_xsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_hpi,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
EXCSAVE1 + 6,
|
|
|
|
XTENSA_OPTION_HIGH_PRIORITY_INTERRUPT,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "xsr.excvaddr",
|
|
|
|
.translate = translate_xsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
EXCVADDR,
|
|
|
|
XTENSA_OPTION_EXCEPTION,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "xsr.ibreaka0",
|
2019-03-19 03:10:38 +03:00
|
|
|
.translate = translate_xsr_ibreaka,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_ibreak,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
IBREAKA,
|
|
|
|
XTENSA_OPTION_DEBUG,
|
|
|
|
},
|
2018-09-01 10:47:55 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED | XTENSA_OP_EXIT_TB_0,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "xsr.ibreaka1",
|
2019-03-19 03:10:38 +03:00
|
|
|
.translate = translate_xsr_ibreaka,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_ibreak,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
IBREAKA + 1,
|
|
|
|
XTENSA_OPTION_DEBUG,
|
|
|
|
},
|
2018-09-01 10:47:55 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED | XTENSA_OP_EXIT_TB_0,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "xsr.ibreakenable",
|
2019-03-19 03:10:38 +03:00
|
|
|
.translate = translate_xsr_ibreakenable,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
IBREAKENABLE,
|
|
|
|
XTENSA_OPTION_DEBUG,
|
|
|
|
},
|
2018-09-01 10:47:55 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED | XTENSA_OP_EXIT_TB_0,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "xsr.icount",
|
2019-03-19 03:10:38 +03:00
|
|
|
.translate = translate_xsr_icount,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
ICOUNT,
|
|
|
|
XTENSA_OPTION_DEBUG,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "xsr.icountlevel",
|
2019-03-19 03:10:38 +03:00
|
|
|
.translate = translate_xsr_mask,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
ICOUNTLEVEL,
|
|
|
|
XTENSA_OPTION_DEBUG,
|
|
|
|
0xf,
|
|
|
|
},
|
2018-09-01 10:47:55 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED | XTENSA_OP_EXIT_TB_M1,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "xsr.intclear",
|
2019-03-19 03:10:38 +03:00
|
|
|
.op_flags = XTENSA_OP_ILL,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "xsr.intenable",
|
|
|
|
.translate = translate_xsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
INTENABLE,
|
|
|
|
XTENSA_OPTION_INTERRUPT,
|
|
|
|
},
|
2018-09-02 12:07:30 +03:00
|
|
|
.op_flags =
|
|
|
|
XTENSA_OP_PRIVILEGED |
|
|
|
|
XTENSA_OP_EXIT_TB_0 |
|
|
|
|
XTENSA_OP_CHECK_INTERRUPTS,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "xsr.interrupt",
|
2019-03-19 03:10:38 +03:00
|
|
|
.op_flags = XTENSA_OP_ILL,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "xsr.intset",
|
2019-03-19 03:10:38 +03:00
|
|
|
.op_flags = XTENSA_OP_ILL,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "xsr.itlbcfg",
|
2019-03-19 03:10:38 +03:00
|
|
|
.translate = translate_xsr_mask,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
ITLBCFG,
|
|
|
|
XTENSA_OPTION_MMU,
|
|
|
|
0x01130000,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "xsr.lbeg",
|
|
|
|
.translate = translate_xsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
LBEG,
|
|
|
|
XTENSA_OPTION_LOOP,
|
|
|
|
},
|
2018-10-04 01:59:11 +03:00
|
|
|
.op_flags = XTENSA_OP_EXIT_TB_M1,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "xsr.lcount",
|
|
|
|
.translate = translate_xsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
LCOUNT,
|
|
|
|
XTENSA_OPTION_LOOP,
|
|
|
|
},
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "xsr.lend",
|
|
|
|
.translate = translate_xsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
LEND,
|
|
|
|
XTENSA_OPTION_LOOP,
|
|
|
|
},
|
2018-10-04 01:59:11 +03:00
|
|
|
.op_flags = XTENSA_OP_EXIT_TB_M1,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "xsr.litbase",
|
2019-03-19 03:10:38 +03:00
|
|
|
.translate = translate_xsr_mask,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
LITBASE,
|
|
|
|
XTENSA_OPTION_EXTENDED_L32R,
|
|
|
|
0xfffff001,
|
|
|
|
},
|
2018-09-01 10:47:55 +03:00
|
|
|
.op_flags = XTENSA_OP_EXIT_TB_M1,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "xsr.m0",
|
|
|
|
.translate = translate_xsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
MR,
|
|
|
|
XTENSA_OPTION_MAC16,
|
|
|
|
},
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "xsr.m1",
|
|
|
|
.translate = translate_xsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
MR + 1,
|
|
|
|
XTENSA_OPTION_MAC16,
|
|
|
|
},
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "xsr.m2",
|
|
|
|
.translate = translate_xsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
MR + 2,
|
|
|
|
XTENSA_OPTION_MAC16,
|
|
|
|
},
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "xsr.m3",
|
|
|
|
.translate = translate_xsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
MR + 3,
|
|
|
|
XTENSA_OPTION_MAC16,
|
|
|
|
},
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "xsr.memctl",
|
2019-03-19 03:10:38 +03:00
|
|
|
.translate = translate_xsr_memctl,
|
2017-11-04 04:29:27 +03:00
|
|
|
.par = (const uint32_t[]){MEMCTL},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2019-03-13 22:41:13 +03:00
|
|
|
}, {
|
|
|
|
.name = "xsr.mecr",
|
|
|
|
.translate = translate_xsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-13 22:41:13 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
MECR,
|
|
|
|
XTENSA_OPTION_MEMORY_ECC_PARITY,
|
|
|
|
},
|
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
|
|
|
}, {
|
|
|
|
.name = "xsr.mepc",
|
|
|
|
.translate = translate_xsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-13 22:41:13 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
MEPC,
|
|
|
|
XTENSA_OPTION_MEMORY_ECC_PARITY,
|
|
|
|
},
|
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
|
|
|
}, {
|
|
|
|
.name = "xsr.meps",
|
|
|
|
.translate = translate_xsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-13 22:41:13 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
MEPS,
|
|
|
|
XTENSA_OPTION_MEMORY_ECC_PARITY,
|
|
|
|
},
|
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
|
|
|
}, {
|
|
|
|
.name = "xsr.mesave",
|
|
|
|
.translate = translate_xsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-13 22:41:13 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
MESAVE,
|
|
|
|
XTENSA_OPTION_MEMORY_ECC_PARITY,
|
|
|
|
},
|
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
|
|
|
}, {
|
|
|
|
.name = "xsr.mesr",
|
|
|
|
.translate = translate_xsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-13 22:41:13 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
MESR,
|
|
|
|
XTENSA_OPTION_MEMORY_ECC_PARITY,
|
|
|
|
},
|
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
|
|
|
}, {
|
|
|
|
.name = "xsr.mevaddr",
|
|
|
|
.translate = translate_xsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-13 22:41:13 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
MESR,
|
|
|
|
XTENSA_OPTION_MEMORY_ECC_PARITY,
|
|
|
|
},
|
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "xsr.misc0",
|
|
|
|
.translate = translate_xsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
MISC,
|
|
|
|
XTENSA_OPTION_MISC_SR,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "xsr.misc1",
|
|
|
|
.translate = translate_xsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
MISC + 1,
|
|
|
|
XTENSA_OPTION_MISC_SR,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "xsr.misc2",
|
|
|
|
.translate = translate_xsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
MISC + 2,
|
|
|
|
XTENSA_OPTION_MISC_SR,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "xsr.misc3",
|
|
|
|
.translate = translate_xsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
MISC + 3,
|
|
|
|
XTENSA_OPTION_MISC_SR,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2019-03-13 22:40:38 +03:00
|
|
|
}, {
|
|
|
|
.name = "xsr.mpuenb",
|
|
|
|
.translate = translate_xsr_mpuenb,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-13 22:40:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
MPUENB,
|
|
|
|
XTENSA_OPTION_MPU,
|
|
|
|
},
|
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED | XTENSA_OP_EXIT_TB_M1,
|
2019-02-18 14:11:40 +03:00
|
|
|
}, {
|
|
|
|
.name = "xsr.prefctl",
|
|
|
|
.translate = translate_xsr,
|
|
|
|
.par = (const uint32_t[]){PREFCTL},
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "xsr.prid",
|
2019-03-19 03:10:38 +03:00
|
|
|
.op_flags = XTENSA_OP_ILL,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "xsr.ps",
|
2019-03-19 03:10:38 +03:00
|
|
|
.translate = translate_xsr_ps,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
PS,
|
|
|
|
XTENSA_OPTION_EXCEPTION,
|
|
|
|
},
|
2018-09-02 12:07:30 +03:00
|
|
|
.op_flags =
|
|
|
|
XTENSA_OP_PRIVILEGED |
|
|
|
|
XTENSA_OP_EXIT_TB_M1 |
|
|
|
|
XTENSA_OP_CHECK_INTERRUPTS,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "xsr.ptevaddr",
|
2019-03-19 03:10:38 +03:00
|
|
|
.translate = translate_xsr_mask,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
PTEVADDR,
|
|
|
|
XTENSA_OPTION_MMU,
|
|
|
|
0xffc00000,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "xsr.rasid",
|
2019-03-19 03:10:38 +03:00
|
|
|
.translate = translate_xsr_rasid,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
RASID,
|
|
|
|
XTENSA_OPTION_MMU,
|
|
|
|
},
|
2018-09-01 10:47:55 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED | XTENSA_OP_EXIT_TB_M1,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "xsr.sar",
|
2019-03-19 03:10:38 +03:00
|
|
|
.translate = translate_xsr_sar,
|
2017-11-04 04:29:27 +03:00
|
|
|
.par = (const uint32_t[]){SAR},
|
|
|
|
}, {
|
|
|
|
.name = "xsr.scompare1",
|
|
|
|
.translate = translate_xsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
SCOMPARE1,
|
|
|
|
XTENSA_OPTION_CONDITIONAL_STORE,
|
|
|
|
},
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "xsr.vecbase",
|
|
|
|
.translate = translate_xsr,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
VECBASE,
|
|
|
|
XTENSA_OPTION_RELOCATABLE_VECTOR,
|
|
|
|
},
|
2018-08-28 08:17:50 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "xsr.windowbase",
|
2019-03-19 03:10:38 +03:00
|
|
|
.translate = translate_xsr_windowbase,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
WINDOW_BASE,
|
|
|
|
XTENSA_OPTION_WINDOWED_REGISTER,
|
|
|
|
},
|
2019-01-31 01:56:29 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED |
|
|
|
|
XTENSA_OP_EXIT_TB_M1 |
|
|
|
|
XTENSA_OP_SYNC_REGISTER_WINDOW,
|
2017-11-04 04:29:27 +03:00
|
|
|
}, {
|
|
|
|
.name = "xsr.windowstart",
|
2019-03-19 03:10:38 +03:00
|
|
|
.translate = translate_xsr_windowstart,
|
2020-05-05 00:08:40 +03:00
|
|
|
.test_exceptions = test_exceptions_sr,
|
2019-03-19 03:10:38 +03:00
|
|
|
.par = (const uint32_t[]){
|
|
|
|
WINDOW_START,
|
|
|
|
XTENSA_OPTION_WINDOWED_REGISTER,
|
|
|
|
},
|
2018-09-01 10:47:55 +03:00
|
|
|
.op_flags = XTENSA_OP_PRIVILEGED | XTENSA_OP_EXIT_TB_M1,
|
2017-11-04 04:29:27 +03:00
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
const XtensaOpcodeTranslators xtensa_core_opcodes = {
|
|
|
|
.num_opcodes = ARRAY_SIZE(core_ops),
|
|
|
|
.opcode = core_ops,
|
|
|
|
};
|
2017-11-04 05:37:13 +03:00
|
|
|
|
|
|
|
|
2020-07-01 05:27:02 +03:00
|
|
|
static inline void get_f32_o1_i3(const OpcodeArg *arg, OpcodeArg *arg32,
|
|
|
|
int o0, int i0, int i1, int i2)
|
|
|
|
{
|
|
|
|
if ((i0 >= 0 && arg[i0].num_bits == 64) ||
|
|
|
|
(o0 >= 0 && arg[o0].num_bits == 64)) {
|
|
|
|
if (o0 >= 0) {
|
|
|
|
arg32[o0].out = tcg_temp_new_i32();
|
|
|
|
}
|
|
|
|
if (i0 >= 0) {
|
|
|
|
arg32[i0].in = tcg_temp_new_i32();
|
|
|
|
tcg_gen_extrl_i64_i32(arg32[i0].in, arg[i0].in);
|
|
|
|
}
|
|
|
|
if (i1 >= 0) {
|
|
|
|
arg32[i1].in = tcg_temp_new_i32();
|
|
|
|
tcg_gen_extrl_i64_i32(arg32[i1].in, arg[i1].in);
|
|
|
|
}
|
|
|
|
if (i2 >= 0) {
|
|
|
|
arg32[i2].in = tcg_temp_new_i32();
|
|
|
|
tcg_gen_extrl_i64_i32(arg32[i2].in, arg[i2].in);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
if (o0 >= 0) {
|
|
|
|
arg32[o0].out = arg[o0].out;
|
|
|
|
}
|
|
|
|
if (i0 >= 0) {
|
|
|
|
arg32[i0].in = arg[i0].in;
|
|
|
|
}
|
|
|
|
if (i1 >= 0) {
|
|
|
|
arg32[i1].in = arg[i1].in;
|
|
|
|
}
|
|
|
|
if (i2 >= 0) {
|
|
|
|
arg32[i2].in = arg[i2].in;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void put_f32_o1_i3(const OpcodeArg *arg, const OpcodeArg *arg32,
|
|
|
|
int o0, int i0, int i1, int i2)
|
|
|
|
{
|
|
|
|
if ((i0 >= 0 && arg[i0].num_bits == 64) ||
|
|
|
|
(o0 >= 0 && arg[o0].num_bits == 64)) {
|
|
|
|
if (o0 >= 0) {
|
|
|
|
tcg_gen_extu_i32_i64(arg[o0].out, arg32[o0].out);
|
|
|
|
tcg_temp_free_i32(arg32[o0].out);
|
|
|
|
}
|
|
|
|
if (i0 >= 0) {
|
|
|
|
tcg_temp_free_i32(arg32[i0].in);
|
|
|
|
}
|
|
|
|
if (i1 >= 0) {
|
|
|
|
tcg_temp_free_i32(arg32[i1].in);
|
|
|
|
}
|
|
|
|
if (i2 >= 0) {
|
|
|
|
tcg_temp_free_i32(arg32[i2].in);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void get_f32_o1_i2(const OpcodeArg *arg, OpcodeArg *arg32,
|
|
|
|
int o0, int i0, int i1)
|
|
|
|
{
|
|
|
|
get_f32_o1_i3(arg, arg32, o0, i0, i1, -1);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void put_f32_o1_i2(const OpcodeArg *arg, const OpcodeArg *arg32,
|
|
|
|
int o0, int i0, int i1)
|
|
|
|
{
|
|
|
|
put_f32_o1_i3(arg, arg32, o0, i0, i1, -1);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void get_f32_o1_i1(const OpcodeArg *arg, OpcodeArg *arg32,
|
|
|
|
int o0, int i0)
|
|
|
|
{
|
|
|
|
get_f32_o1_i2(arg, arg32, o0, i0, -1);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void put_f32_o1_i1(const OpcodeArg *arg, const OpcodeArg *arg32,
|
|
|
|
int o0, int i0)
|
|
|
|
{
|
|
|
|
put_f32_o1_i2(arg, arg32, o0, i0, -1);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void get_f32_o1(const OpcodeArg *arg, OpcodeArg *arg32,
|
|
|
|
int o0)
|
|
|
|
{
|
|
|
|
get_f32_o1_i1(arg, arg32, o0, -1);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void put_f32_o1(const OpcodeArg *arg, const OpcodeArg *arg32,
|
|
|
|
int o0)
|
|
|
|
{
|
|
|
|
put_f32_o1_i1(arg, arg32, o0, -1);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void get_f32_i2(const OpcodeArg *arg, OpcodeArg *arg32,
|
|
|
|
int i0, int i1)
|
|
|
|
{
|
|
|
|
get_f32_o1_i2(arg, arg32, -1, i0, i1);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void put_f32_i2(const OpcodeArg *arg, const OpcodeArg *arg32,
|
|
|
|
int i0, int i1)
|
|
|
|
{
|
|
|
|
put_f32_o1_i2(arg, arg32, -1, i0, i1);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void get_f32_i1(const OpcodeArg *arg, OpcodeArg *arg32,
|
|
|
|
int i0)
|
|
|
|
{
|
|
|
|
get_f32_i2(arg, arg32, i0, -1);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void put_f32_i1(const OpcodeArg *arg, const OpcodeArg *arg32,
|
|
|
|
int i0)
|
|
|
|
{
|
|
|
|
put_f32_i2(arg, arg32, i0, -1);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void translate_abs_d(DisasContext *dc, const OpcodeArg arg[],
|
|
|
|
const uint32_t par[])
|
|
|
|
{
|
|
|
|
gen_helper_abs_d(arg[0].out, arg[1].in);
|
|
|
|
}
|
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
static void translate_abs_s(DisasContext *dc, const OpcodeArg arg[],
|
2017-11-04 05:37:13 +03:00
|
|
|
const uint32_t par[])
|
|
|
|
{
|
2020-07-01 05:27:02 +03:00
|
|
|
OpcodeArg arg32[2];
|
|
|
|
|
|
|
|
get_f32_o1_i1(arg, arg32, 0, 1);
|
|
|
|
gen_helper_abs_s(arg32[0].out, arg32[1].in);
|
|
|
|
put_f32_o1_i1(arg, arg32, 0, 1);
|
2017-11-04 05:37:13 +03:00
|
|
|
}
|
|
|
|
|
2015-07-13 04:30:41 +03:00
|
|
|
static void translate_fpu2k_add_s(DisasContext *dc, const OpcodeArg arg[],
|
|
|
|
const uint32_t par[])
|
2017-11-04 05:37:13 +03:00
|
|
|
{
|
2015-07-13 04:30:41 +03:00
|
|
|
gen_helper_fpu2k_add_s(arg[0].out, cpu_env,
|
|
|
|
arg[1].in, arg[2].in);
|
2017-11-04 05:37:13 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
enum {
|
|
|
|
COMPARE_UN,
|
|
|
|
COMPARE_OEQ,
|
|
|
|
COMPARE_UEQ,
|
|
|
|
COMPARE_OLT,
|
|
|
|
COMPARE_ULT,
|
|
|
|
COMPARE_OLE,
|
|
|
|
COMPARE_ULE,
|
|
|
|
};
|
|
|
|
|
2020-07-01 05:27:02 +03:00
|
|
|
static void translate_compare_d(DisasContext *dc, const OpcodeArg arg[],
|
|
|
|
const uint32_t par[])
|
|
|
|
{
|
|
|
|
static void (* const helper[])(TCGv_i32 res, TCGv_env env,
|
|
|
|
TCGv_i64 s, TCGv_i64 t) = {
|
|
|
|
[COMPARE_UN] = gen_helper_un_d,
|
|
|
|
[COMPARE_OEQ] = gen_helper_oeq_d,
|
|
|
|
[COMPARE_UEQ] = gen_helper_ueq_d,
|
|
|
|
[COMPARE_OLT] = gen_helper_olt_d,
|
|
|
|
[COMPARE_ULT] = gen_helper_ult_d,
|
|
|
|
[COMPARE_OLE] = gen_helper_ole_d,
|
|
|
|
[COMPARE_ULE] = gen_helper_ule_d,
|
|
|
|
};
|
|
|
|
TCGv_i32 zero = tcg_const_i32(0);
|
|
|
|
TCGv_i32 res = tcg_temp_new_i32();
|
|
|
|
TCGv_i32 set_br = tcg_temp_new_i32();
|
|
|
|
TCGv_i32 clr_br = tcg_temp_new_i32();
|
|
|
|
|
|
|
|
tcg_gen_ori_i32(set_br, arg[0].in, 1 << arg[0].imm);
|
|
|
|
tcg_gen_andi_i32(clr_br, arg[0].in, ~(1 << arg[0].imm));
|
|
|
|
|
|
|
|
helper[par[0]](res, cpu_env, arg[1].in, arg[2].in);
|
|
|
|
tcg_gen_movcond_i32(TCG_COND_NE,
|
|
|
|
arg[0].out, res, zero,
|
|
|
|
set_br, clr_br);
|
|
|
|
tcg_temp_free(zero);
|
|
|
|
tcg_temp_free(res);
|
|
|
|
tcg_temp_free(set_br);
|
|
|
|
tcg_temp_free(clr_br);
|
|
|
|
}
|
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
static void translate_compare_s(DisasContext *dc, const OpcodeArg arg[],
|
2017-11-04 05:37:13 +03:00
|
|
|
const uint32_t par[])
|
|
|
|
{
|
2020-06-30 17:50:14 +03:00
|
|
|
static void (* const helper[])(TCGv_i32 res, TCGv_env env,
|
2017-11-04 05:37:13 +03:00
|
|
|
TCGv_i32 s, TCGv_i32 t) = {
|
|
|
|
[COMPARE_UN] = gen_helper_un_s,
|
|
|
|
[COMPARE_OEQ] = gen_helper_oeq_s,
|
|
|
|
[COMPARE_UEQ] = gen_helper_ueq_s,
|
|
|
|
[COMPARE_OLT] = gen_helper_olt_s,
|
|
|
|
[COMPARE_ULT] = gen_helper_ult_s,
|
|
|
|
[COMPARE_OLE] = gen_helper_ole_s,
|
|
|
|
[COMPARE_ULE] = gen_helper_ule_s,
|
|
|
|
};
|
2020-07-01 05:27:02 +03:00
|
|
|
OpcodeArg arg32[3];
|
2020-06-30 17:50:14 +03:00
|
|
|
TCGv_i32 zero = tcg_const_i32(0);
|
|
|
|
TCGv_i32 res = tcg_temp_new_i32();
|
|
|
|
TCGv_i32 set_br = tcg_temp_new_i32();
|
|
|
|
TCGv_i32 clr_br = tcg_temp_new_i32();
|
2017-11-04 05:37:13 +03:00
|
|
|
|
2020-06-30 17:50:14 +03:00
|
|
|
tcg_gen_ori_i32(set_br, arg[0].in, 1 << arg[0].imm);
|
|
|
|
tcg_gen_andi_i32(clr_br, arg[0].in, ~(1 << arg[0].imm));
|
|
|
|
|
2020-07-01 05:27:02 +03:00
|
|
|
get_f32_i2(arg, arg32, 1, 2);
|
|
|
|
helper[par[0]](res, cpu_env, arg32[1].in, arg32[2].in);
|
2020-06-30 17:50:14 +03:00
|
|
|
tcg_gen_movcond_i32(TCG_COND_NE,
|
|
|
|
arg[0].out, res, zero,
|
|
|
|
set_br, clr_br);
|
2020-07-01 05:27:02 +03:00
|
|
|
put_f32_i2(arg, arg32, 1, 2);
|
2020-06-30 17:50:14 +03:00
|
|
|
tcg_temp_free(zero);
|
|
|
|
tcg_temp_free(res);
|
|
|
|
tcg_temp_free(set_br);
|
|
|
|
tcg_temp_free(clr_br);
|
2017-11-04 05:37:13 +03:00
|
|
|
}
|
|
|
|
|
2020-07-01 05:27:02 +03:00
|
|
|
static void translate_const_d(DisasContext *dc, const OpcodeArg arg[],
|
|
|
|
const uint32_t par[])
|
|
|
|
{
|
|
|
|
static const uint64_t v[] = {
|
|
|
|
UINT64_C(0x0000000000000000),
|
|
|
|
UINT64_C(0x3ff0000000000000),
|
|
|
|
UINT64_C(0x4000000000000000),
|
|
|
|
UINT64_C(0x3fe0000000000000),
|
|
|
|
};
|
|
|
|
|
|
|
|
tcg_gen_movi_i64(arg[0].out, v[arg[1].imm % ARRAY_SIZE(v)]);
|
|
|
|
if (arg[1].imm >= ARRAY_SIZE(v)) {
|
|
|
|
qemu_log_mask(LOG_GUEST_ERROR,
|
|
|
|
"const.d f%d, #%d, immediate value is reserved\n",
|
|
|
|
arg[0].imm, arg[1].imm);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void translate_const_s(DisasContext *dc, const OpcodeArg arg[],
|
|
|
|
const uint32_t par[])
|
|
|
|
{
|
|
|
|
static const uint32_t v[] = {
|
|
|
|
0x00000000,
|
|
|
|
0x3f800000,
|
|
|
|
0x40000000,
|
|
|
|
0x3f000000,
|
|
|
|
};
|
|
|
|
|
|
|
|
if (arg[0].num_bits == 32) {
|
|
|
|
tcg_gen_movi_i32(arg[0].out, v[arg[1].imm % ARRAY_SIZE(v)]);
|
|
|
|
} else {
|
|
|
|
tcg_gen_movi_i64(arg[0].out, v[arg[1].imm % ARRAY_SIZE(v)]);
|
|
|
|
}
|
|
|
|
if (arg[1].imm >= ARRAY_SIZE(v)) {
|
|
|
|
qemu_log_mask(LOG_GUEST_ERROR,
|
|
|
|
"const.s f%d, #%d, immediate value is reserved\n",
|
|
|
|
arg[0].imm, arg[1].imm);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void translate_float_d(DisasContext *dc, const OpcodeArg arg[],
|
|
|
|
const uint32_t par[])
|
|
|
|
{
|
|
|
|
TCGv_i32 scale = tcg_const_i32(-arg[2].imm);
|
|
|
|
|
|
|
|
if (par[0]) {
|
|
|
|
gen_helper_uitof_d(arg[0].out, cpu_env, arg[1].in, scale);
|
|
|
|
} else {
|
|
|
|
gen_helper_itof_d(arg[0].out, cpu_env, arg[1].in, scale);
|
|
|
|
}
|
|
|
|
tcg_temp_free(scale);
|
|
|
|
}
|
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
static void translate_float_s(DisasContext *dc, const OpcodeArg arg[],
|
2017-11-04 05:37:13 +03:00
|
|
|
const uint32_t par[])
|
|
|
|
{
|
2019-02-12 05:53:19 +03:00
|
|
|
TCGv_i32 scale = tcg_const_i32(-arg[2].imm);
|
2020-07-01 05:27:02 +03:00
|
|
|
OpcodeArg arg32[1];
|
2017-11-04 05:37:13 +03:00
|
|
|
|
2020-07-01 05:27:02 +03:00
|
|
|
get_f32_o1(arg, arg32, 0);
|
2018-08-31 23:57:08 +03:00
|
|
|
if (par[0]) {
|
2020-07-01 05:27:02 +03:00
|
|
|
gen_helper_uitof_s(arg32[0].out, cpu_env, arg[1].in, scale);
|
|
|
|
} else {
|
|
|
|
gen_helper_itof_s(arg32[0].out, cpu_env, arg[1].in, scale);
|
|
|
|
}
|
|
|
|
put_f32_o1(arg, arg32, 0);
|
|
|
|
tcg_temp_free(scale);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void translate_ftoi_d(DisasContext *dc, const OpcodeArg arg[],
|
|
|
|
const uint32_t par[])
|
|
|
|
{
|
|
|
|
TCGv_i32 rounding_mode = tcg_const_i32(par[0]);
|
|
|
|
TCGv_i32 scale = tcg_const_i32(arg[2].imm);
|
|
|
|
|
|
|
|
if (par[1]) {
|
|
|
|
gen_helper_ftoui_d(arg[0].out, cpu_env, arg[1].in,
|
|
|
|
rounding_mode, scale);
|
2018-08-31 23:57:08 +03:00
|
|
|
} else {
|
2020-07-01 05:27:02 +03:00
|
|
|
gen_helper_ftoi_d(arg[0].out, cpu_env, arg[1].in,
|
|
|
|
rounding_mode, scale);
|
2017-11-04 05:37:13 +03:00
|
|
|
}
|
2020-07-01 05:27:02 +03:00
|
|
|
tcg_temp_free(rounding_mode);
|
2018-08-31 23:57:08 +03:00
|
|
|
tcg_temp_free(scale);
|
2017-11-04 05:37:13 +03:00
|
|
|
}
|
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
static void translate_ftoi_s(DisasContext *dc, const OpcodeArg arg[],
|
2017-11-04 05:37:13 +03:00
|
|
|
const uint32_t par[])
|
|
|
|
{
|
2018-08-31 23:57:08 +03:00
|
|
|
TCGv_i32 rounding_mode = tcg_const_i32(par[0]);
|
2019-02-12 05:53:19 +03:00
|
|
|
TCGv_i32 scale = tcg_const_i32(arg[2].imm);
|
2020-07-01 05:27:02 +03:00
|
|
|
OpcodeArg arg32[2];
|
2017-11-04 05:37:13 +03:00
|
|
|
|
2020-07-01 05:27:02 +03:00
|
|
|
get_f32_i1(arg, arg32, 1);
|
2018-08-31 23:57:08 +03:00
|
|
|
if (par[1]) {
|
2020-07-01 05:27:02 +03:00
|
|
|
gen_helper_ftoui_s(arg[0].out, cpu_env, arg32[1].in,
|
2015-07-13 04:30:41 +03:00
|
|
|
rounding_mode, scale);
|
2018-08-31 23:57:08 +03:00
|
|
|
} else {
|
2020-07-01 05:27:02 +03:00
|
|
|
gen_helper_ftoi_s(arg[0].out, cpu_env, arg32[1].in,
|
2015-07-13 04:30:41 +03:00
|
|
|
rounding_mode, scale);
|
2017-11-04 05:37:13 +03:00
|
|
|
}
|
2020-07-01 05:27:02 +03:00
|
|
|
put_f32_i1(arg, arg32, 1);
|
2018-08-31 23:57:08 +03:00
|
|
|
tcg_temp_free(rounding_mode);
|
|
|
|
tcg_temp_free(scale);
|
2017-11-04 05:37:13 +03:00
|
|
|
}
|
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
static void translate_ldsti(DisasContext *dc, const OpcodeArg arg[],
|
2017-11-04 05:37:13 +03:00
|
|
|
const uint32_t par[])
|
|
|
|
{
|
2018-08-31 23:57:08 +03:00
|
|
|
TCGv_i32 addr = tcg_temp_new_i32();
|
2017-11-04 05:37:13 +03:00
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
tcg_gen_addi_i32(addr, arg[1].in, arg[2].imm);
|
2018-08-31 23:57:08 +03:00
|
|
|
gen_load_store_alignment(dc, 2, addr, false);
|
|
|
|
if (par[0]) {
|
2019-02-12 05:53:19 +03:00
|
|
|
tcg_gen_qemu_st32(arg[0].in, addr, dc->cring);
|
2018-08-31 23:57:08 +03:00
|
|
|
} else {
|
2019-02-12 05:53:19 +03:00
|
|
|
tcg_gen_qemu_ld32u(arg[0].out, addr, dc->cring);
|
2017-11-04 05:37:13 +03:00
|
|
|
}
|
2018-08-31 23:57:08 +03:00
|
|
|
if (par[1]) {
|
2019-02-12 05:53:19 +03:00
|
|
|
tcg_gen_mov_i32(arg[1].out, addr);
|
2018-08-31 23:57:08 +03:00
|
|
|
}
|
|
|
|
tcg_temp_free(addr);
|
2017-11-04 05:37:13 +03:00
|
|
|
}
|
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
static void translate_ldstx(DisasContext *dc, const OpcodeArg arg[],
|
2017-11-04 05:37:13 +03:00
|
|
|
const uint32_t par[])
|
|
|
|
{
|
2018-08-31 23:57:08 +03:00
|
|
|
TCGv_i32 addr = tcg_temp_new_i32();
|
2017-11-04 05:37:13 +03:00
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
tcg_gen_add_i32(addr, arg[1].in, arg[2].in);
|
2018-08-31 23:57:08 +03:00
|
|
|
gen_load_store_alignment(dc, 2, addr, false);
|
|
|
|
if (par[0]) {
|
2019-02-12 05:53:19 +03:00
|
|
|
tcg_gen_qemu_st32(arg[0].in, addr, dc->cring);
|
2018-08-31 23:57:08 +03:00
|
|
|
} else {
|
2019-02-12 05:53:19 +03:00
|
|
|
tcg_gen_qemu_ld32u(arg[0].out, addr, dc->cring);
|
2018-08-31 23:57:08 +03:00
|
|
|
}
|
|
|
|
if (par[1]) {
|
2019-02-12 05:53:19 +03:00
|
|
|
tcg_gen_mov_i32(arg[1].out, addr);
|
2017-11-04 05:37:13 +03:00
|
|
|
}
|
2018-08-31 23:57:08 +03:00
|
|
|
tcg_temp_free(addr);
|
2017-11-04 05:37:13 +03:00
|
|
|
}
|
|
|
|
|
2015-07-13 04:30:41 +03:00
|
|
|
static void translate_fpu2k_madd_s(DisasContext *dc, const OpcodeArg arg[],
|
|
|
|
const uint32_t par[])
|
2017-11-04 05:37:13 +03:00
|
|
|
{
|
2015-07-13 04:30:41 +03:00
|
|
|
gen_helper_fpu2k_madd_s(arg[0].out, cpu_env,
|
|
|
|
arg[0].in, arg[1].in, arg[2].in);
|
2017-11-04 05:37:13 +03:00
|
|
|
}
|
|
|
|
|
2020-07-01 05:27:02 +03:00
|
|
|
static void translate_mov_d(DisasContext *dc, const OpcodeArg arg[],
|
|
|
|
const uint32_t par[])
|
|
|
|
{
|
|
|
|
tcg_gen_mov_i64(arg[0].out, arg[1].in);
|
|
|
|
}
|
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
static void translate_mov_s(DisasContext *dc, const OpcodeArg arg[],
|
2017-11-04 05:37:13 +03:00
|
|
|
const uint32_t par[])
|
|
|
|
{
|
2020-07-01 05:27:02 +03:00
|
|
|
if (arg[0].num_bits == 32) {
|
|
|
|
tcg_gen_mov_i32(arg[0].out, arg[1].in);
|
|
|
|
} else {
|
|
|
|
tcg_gen_mov_i64(arg[0].out, arg[1].in);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void translate_movcond_d(DisasContext *dc, const OpcodeArg arg[],
|
|
|
|
const uint32_t par[])
|
|
|
|
{
|
|
|
|
TCGv_i64 zero = tcg_const_i64(0);
|
|
|
|
TCGv_i64 arg2 = tcg_temp_new_i64();
|
|
|
|
|
|
|
|
tcg_gen_ext_i32_i64(arg2, arg[2].in);
|
|
|
|
tcg_gen_movcond_i64(par[0], arg[0].out,
|
|
|
|
arg2, zero,
|
|
|
|
arg[1].in, arg[0].in);
|
|
|
|
tcg_temp_free_i64(zero);
|
|
|
|
tcg_temp_free_i64(arg2);
|
2017-11-04 05:37:13 +03:00
|
|
|
}
|
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
static void translate_movcond_s(DisasContext *dc, const OpcodeArg arg[],
|
2017-11-04 05:37:13 +03:00
|
|
|
const uint32_t par[])
|
|
|
|
{
|
2020-07-01 05:27:02 +03:00
|
|
|
if (arg[0].num_bits == 32) {
|
|
|
|
TCGv_i32 zero = tcg_const_i32(0);
|
2017-11-04 05:37:13 +03:00
|
|
|
|
2020-07-01 05:27:02 +03:00
|
|
|
tcg_gen_movcond_i32(par[0], arg[0].out,
|
|
|
|
arg[2].in, zero,
|
|
|
|
arg[1].in, arg[0].in);
|
|
|
|
tcg_temp_free(zero);
|
|
|
|
} else {
|
|
|
|
translate_movcond_d(dc, arg, par);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void translate_movp_d(DisasContext *dc, const OpcodeArg arg[],
|
|
|
|
const uint32_t par[])
|
|
|
|
{
|
|
|
|
TCGv_i64 zero = tcg_const_i64(0);
|
|
|
|
TCGv_i32 tmp1 = tcg_temp_new_i32();
|
|
|
|
TCGv_i64 tmp2 = tcg_temp_new_i64();
|
|
|
|
|
|
|
|
tcg_gen_andi_i32(tmp1, arg[2].in, 1 << arg[2].imm);
|
|
|
|
tcg_gen_extu_i32_i64(tmp2, tmp1);
|
|
|
|
tcg_gen_movcond_i64(par[0],
|
|
|
|
arg[0].out, tmp2, zero,
|
2019-02-12 05:53:19 +03:00
|
|
|
arg[1].in, arg[0].in);
|
2020-07-01 05:27:02 +03:00
|
|
|
tcg_temp_free_i64(zero);
|
|
|
|
tcg_temp_free_i32(tmp1);
|
|
|
|
tcg_temp_free_i64(tmp2);
|
2017-11-04 05:37:13 +03:00
|
|
|
}
|
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
static void translate_movp_s(DisasContext *dc, const OpcodeArg arg[],
|
2017-11-04 05:37:13 +03:00
|
|
|
const uint32_t par[])
|
|
|
|
{
|
2020-07-01 05:27:02 +03:00
|
|
|
if (arg[0].num_bits == 32) {
|
|
|
|
TCGv_i32 zero = tcg_const_i32(0);
|
|
|
|
TCGv_i32 tmp = tcg_temp_new_i32();
|
2017-11-04 05:37:13 +03:00
|
|
|
|
2020-07-01 05:27:02 +03:00
|
|
|
tcg_gen_andi_i32(tmp, arg[2].in, 1 << arg[2].imm);
|
|
|
|
tcg_gen_movcond_i32(par[0],
|
|
|
|
arg[0].out, tmp, zero,
|
|
|
|
arg[1].in, arg[0].in);
|
|
|
|
tcg_temp_free(tmp);
|
|
|
|
tcg_temp_free(zero);
|
|
|
|
} else {
|
|
|
|
translate_movp_d(dc, arg, par);
|
|
|
|
}
|
2017-11-04 05:37:13 +03:00
|
|
|
}
|
|
|
|
|
2015-07-13 04:30:41 +03:00
|
|
|
static void translate_fpu2k_mul_s(DisasContext *dc, const OpcodeArg arg[],
|
|
|
|
const uint32_t par[])
|
2017-11-04 05:37:13 +03:00
|
|
|
{
|
2015-07-13 04:30:41 +03:00
|
|
|
gen_helper_fpu2k_mul_s(arg[0].out, cpu_env,
|
|
|
|
arg[1].in, arg[2].in);
|
2017-11-04 05:37:13 +03:00
|
|
|
}
|
|
|
|
|
2015-07-13 04:30:41 +03:00
|
|
|
static void translate_fpu2k_msub_s(DisasContext *dc, const OpcodeArg arg[],
|
|
|
|
const uint32_t par[])
|
2017-11-04 05:37:13 +03:00
|
|
|
{
|
2015-07-13 04:30:41 +03:00
|
|
|
gen_helper_fpu2k_msub_s(arg[0].out, cpu_env,
|
|
|
|
arg[0].in, arg[1].in, arg[2].in);
|
2017-11-04 05:37:13 +03:00
|
|
|
}
|
|
|
|
|
2020-07-01 05:27:02 +03:00
|
|
|
static void translate_neg_d(DisasContext *dc, const OpcodeArg arg[],
|
|
|
|
const uint32_t par[])
|
|
|
|
{
|
|
|
|
gen_helper_neg_d(arg[0].out, arg[1].in);
|
|
|
|
}
|
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
static void translate_neg_s(DisasContext *dc, const OpcodeArg arg[],
|
2017-11-04 05:37:13 +03:00
|
|
|
const uint32_t par[])
|
|
|
|
{
|
2020-07-01 05:27:02 +03:00
|
|
|
OpcodeArg arg32[2];
|
|
|
|
|
|
|
|
get_f32_o1_i1(arg, arg32, 0, 1);
|
|
|
|
gen_helper_neg_s(arg32[0].out, arg32[1].in);
|
|
|
|
put_f32_o1_i1(arg, arg32, 0, 1);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void translate_rfr_d(DisasContext *dc, const OpcodeArg arg[],
|
|
|
|
const uint32_t par[])
|
|
|
|
{
|
|
|
|
tcg_gen_extrh_i64_i32(arg[0].out, arg[1].in);
|
2017-11-04 05:37:13 +03:00
|
|
|
}
|
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
static void translate_rfr_s(DisasContext *dc, const OpcodeArg arg[],
|
2017-11-04 05:37:13 +03:00
|
|
|
const uint32_t par[])
|
|
|
|
{
|
2020-07-01 05:27:02 +03:00
|
|
|
if (arg[1].num_bits == 32) {
|
|
|
|
tcg_gen_mov_i32(arg[0].out, arg[1].in);
|
|
|
|
} else {
|
|
|
|
tcg_gen_extrl_i64_i32(arg[0].out, arg[1].in);
|
|
|
|
}
|
2017-11-04 05:37:13 +03:00
|
|
|
}
|
|
|
|
|
2015-07-13 04:30:41 +03:00
|
|
|
static void translate_fpu2k_sub_s(DisasContext *dc, const OpcodeArg arg[],
|
|
|
|
const uint32_t par[])
|
2017-11-04 05:37:13 +03:00
|
|
|
{
|
2015-07-13 04:30:41 +03:00
|
|
|
gen_helper_fpu2k_sub_s(arg[0].out, cpu_env,
|
|
|
|
arg[1].in, arg[2].in);
|
2017-11-04 05:37:13 +03:00
|
|
|
}
|
|
|
|
|
2020-07-01 05:27:02 +03:00
|
|
|
static void translate_wfr_d(DisasContext *dc, const OpcodeArg arg[],
|
|
|
|
const uint32_t par[])
|
|
|
|
{
|
|
|
|
tcg_gen_concat_i32_i64(arg[0].out, arg[2].in, arg[1].in);
|
|
|
|
}
|
|
|
|
|
2019-02-12 05:53:19 +03:00
|
|
|
static void translate_wfr_s(DisasContext *dc, const OpcodeArg arg[],
|
2017-11-04 05:37:13 +03:00
|
|
|
const uint32_t par[])
|
|
|
|
{
|
2020-07-01 05:27:02 +03:00
|
|
|
if (arg[0].num_bits == 32) {
|
|
|
|
tcg_gen_mov_i32(arg[0].out, arg[1].in);
|
|
|
|
} else {
|
|
|
|
tcg_gen_ext_i32_i64(arg[0].out, arg[1].in);
|
|
|
|
}
|
2017-11-04 05:37:13 +03:00
|
|
|
}
|
|
|
|
|
2015-07-13 04:30:41 +03:00
|
|
|
static void translate_wur_fpu2k_fcr(DisasContext *dc, const OpcodeArg arg[],
|
|
|
|
const uint32_t par[])
|
|
|
|
{
|
|
|
|
gen_helper_wur_fpu2k_fcr(cpu_env, arg[0].in);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void translate_wur_fpu2k_fsr(DisasContext *dc, const OpcodeArg arg[],
|
|
|
|
const uint32_t par[])
|
|
|
|
{
|
|
|
|
tcg_gen_andi_i32(cpu_UR[par[0]], arg[0].in, 0xffffff80);
|
|
|
|
}
|
|
|
|
|
2017-11-04 05:37:13 +03:00
|
|
|
static const XtensaOpcodeOps fpu2000_ops[] = {
|
|
|
|
{
|
|
|
|
.name = "abs.s",
|
|
|
|
.translate = translate_abs_s,
|
2018-08-31 23:57:08 +03:00
|
|
|
.coprocessor = 0x1,
|
2017-11-04 05:37:13 +03:00
|
|
|
}, {
|
|
|
|
.name = "add.s",
|
2015-07-13 04:30:41 +03:00
|
|
|
.translate = translate_fpu2k_add_s,
|
2018-08-31 23:57:08 +03:00
|
|
|
.coprocessor = 0x1,
|
2017-11-04 05:37:13 +03:00
|
|
|
}, {
|
|
|
|
.name = "ceil.s",
|
|
|
|
.translate = translate_ftoi_s,
|
|
|
|
.par = (const uint32_t[]){float_round_up, false},
|
2018-08-31 23:57:08 +03:00
|
|
|
.coprocessor = 0x1,
|
2017-11-04 05:37:13 +03:00
|
|
|
}, {
|
|
|
|
.name = "float.s",
|
|
|
|
.translate = translate_float_s,
|
|
|
|
.par = (const uint32_t[]){false},
|
2018-08-31 23:57:08 +03:00
|
|
|
.coprocessor = 0x1,
|
2017-11-04 05:37:13 +03:00
|
|
|
}, {
|
|
|
|
.name = "floor.s",
|
|
|
|
.translate = translate_ftoi_s,
|
|
|
|
.par = (const uint32_t[]){float_round_down, false},
|
2018-08-31 23:57:08 +03:00
|
|
|
.coprocessor = 0x1,
|
2017-11-04 05:37:13 +03:00
|
|
|
}, {
|
|
|
|
.name = "lsi",
|
|
|
|
.translate = translate_ldsti,
|
|
|
|
.par = (const uint32_t[]){false, false},
|
2019-02-14 04:36:30 +03:00
|
|
|
.op_flags = XTENSA_OP_LOAD,
|
2018-08-31 23:57:08 +03:00
|
|
|
.coprocessor = 0x1,
|
2017-11-04 05:37:13 +03:00
|
|
|
}, {
|
|
|
|
.name = "lsiu",
|
|
|
|
.translate = translate_ldsti,
|
|
|
|
.par = (const uint32_t[]){false, true},
|
2019-02-14 04:36:30 +03:00
|
|
|
.op_flags = XTENSA_OP_LOAD,
|
2018-08-31 23:57:08 +03:00
|
|
|
.coprocessor = 0x1,
|
2017-11-04 05:37:13 +03:00
|
|
|
}, {
|
|
|
|
.name = "lsx",
|
|
|
|
.translate = translate_ldstx,
|
|
|
|
.par = (const uint32_t[]){false, false},
|
2019-02-14 04:36:30 +03:00
|
|
|
.op_flags = XTENSA_OP_LOAD,
|
2018-08-31 23:57:08 +03:00
|
|
|
.coprocessor = 0x1,
|
2017-11-04 05:37:13 +03:00
|
|
|
}, {
|
|
|
|
.name = "lsxu",
|
|
|
|
.translate = translate_ldstx,
|
|
|
|
.par = (const uint32_t[]){false, true},
|
2019-02-14 04:36:30 +03:00
|
|
|
.op_flags = XTENSA_OP_LOAD,
|
2018-08-31 23:57:08 +03:00
|
|
|
.coprocessor = 0x1,
|
2017-11-04 05:37:13 +03:00
|
|
|
}, {
|
|
|
|
.name = "madd.s",
|
2015-07-13 04:30:41 +03:00
|
|
|
.translate = translate_fpu2k_madd_s,
|
2018-08-31 23:57:08 +03:00
|
|
|
.coprocessor = 0x1,
|
2017-11-04 05:37:13 +03:00
|
|
|
}, {
|
|
|
|
.name = "mov.s",
|
|
|
|
.translate = translate_mov_s,
|
2018-08-31 23:57:08 +03:00
|
|
|
.coprocessor = 0x1,
|
2017-11-04 05:37:13 +03:00
|
|
|
}, {
|
|
|
|
.name = "moveqz.s",
|
|
|
|
.translate = translate_movcond_s,
|
|
|
|
.par = (const uint32_t[]){TCG_COND_EQ},
|
2018-08-31 23:57:08 +03:00
|
|
|
.coprocessor = 0x1,
|
2017-11-04 05:37:13 +03:00
|
|
|
}, {
|
|
|
|
.name = "movf.s",
|
|
|
|
.translate = translate_movp_s,
|
|
|
|
.par = (const uint32_t[]){TCG_COND_EQ},
|
2018-08-31 23:57:08 +03:00
|
|
|
.coprocessor = 0x1,
|
2017-11-04 05:37:13 +03:00
|
|
|
}, {
|
|
|
|
.name = "movgez.s",
|
|
|
|
.translate = translate_movcond_s,
|
|
|
|
.par = (const uint32_t[]){TCG_COND_GE},
|
2018-08-31 23:57:08 +03:00
|
|
|
.coprocessor = 0x1,
|
2017-11-04 05:37:13 +03:00
|
|
|
}, {
|
|
|
|
.name = "movltz.s",
|
|
|
|
.translate = translate_movcond_s,
|
|
|
|
.par = (const uint32_t[]){TCG_COND_LT},
|
2018-08-31 23:57:08 +03:00
|
|
|
.coprocessor = 0x1,
|
2017-11-04 05:37:13 +03:00
|
|
|
}, {
|
|
|
|
.name = "movnez.s",
|
|
|
|
.translate = translate_movcond_s,
|
|
|
|
.par = (const uint32_t[]){TCG_COND_NE},
|
2018-08-31 23:57:08 +03:00
|
|
|
.coprocessor = 0x1,
|
2017-11-04 05:37:13 +03:00
|
|
|
}, {
|
|
|
|
.name = "movt.s",
|
|
|
|
.translate = translate_movp_s,
|
|
|
|
.par = (const uint32_t[]){TCG_COND_NE},
|
2018-08-31 23:57:08 +03:00
|
|
|
.coprocessor = 0x1,
|
2017-11-04 05:37:13 +03:00
|
|
|
}, {
|
|
|
|
.name = "msub.s",
|
2015-07-13 04:30:41 +03:00
|
|
|
.translate = translate_fpu2k_msub_s,
|
2018-08-31 23:57:08 +03:00
|
|
|
.coprocessor = 0x1,
|
2017-11-04 05:37:13 +03:00
|
|
|
}, {
|
|
|
|
.name = "mul.s",
|
2015-07-13 04:30:41 +03:00
|
|
|
.translate = translate_fpu2k_mul_s,
|
2018-08-31 23:57:08 +03:00
|
|
|
.coprocessor = 0x1,
|
2017-11-04 05:37:13 +03:00
|
|
|
}, {
|
|
|
|
.name = "neg.s",
|
|
|
|
.translate = translate_neg_s,
|
2018-08-31 23:57:08 +03:00
|
|
|
.coprocessor = 0x1,
|
2017-11-04 05:37:13 +03:00
|
|
|
}, {
|
|
|
|
.name = "oeq.s",
|
|
|
|
.translate = translate_compare_s,
|
|
|
|
.par = (const uint32_t[]){COMPARE_OEQ},
|
2018-08-31 23:57:08 +03:00
|
|
|
.coprocessor = 0x1,
|
2017-11-04 05:37:13 +03:00
|
|
|
}, {
|
|
|
|
.name = "ole.s",
|
|
|
|
.translate = translate_compare_s,
|
|
|
|
.par = (const uint32_t[]){COMPARE_OLE},
|
2018-08-31 23:57:08 +03:00
|
|
|
.coprocessor = 0x1,
|
2017-11-04 05:37:13 +03:00
|
|
|
}, {
|
|
|
|
.name = "olt.s",
|
|
|
|
.translate = translate_compare_s,
|
|
|
|
.par = (const uint32_t[]){COMPARE_OLT},
|
2018-08-31 23:57:08 +03:00
|
|
|
.coprocessor = 0x1,
|
2017-11-04 05:37:13 +03:00
|
|
|
}, {
|
2018-08-31 10:40:28 +03:00
|
|
|
.name = "rfr",
|
2017-11-04 05:37:13 +03:00
|
|
|
.translate = translate_rfr_s,
|
2018-08-31 23:57:08 +03:00
|
|
|
.coprocessor = 0x1,
|
2017-11-04 05:37:13 +03:00
|
|
|
}, {
|
|
|
|
.name = "round.s",
|
|
|
|
.translate = translate_ftoi_s,
|
|
|
|
.par = (const uint32_t[]){float_round_nearest_even, false},
|
2018-08-31 23:57:08 +03:00
|
|
|
.coprocessor = 0x1,
|
2015-07-13 04:30:41 +03:00
|
|
|
}, {
|
|
|
|
.name = "rur.fcr",
|
|
|
|
.translate = translate_rur,
|
|
|
|
.par = (const uint32_t[]){FCR},
|
|
|
|
.coprocessor = 0x1,
|
|
|
|
}, {
|
|
|
|
.name = "rur.fsr",
|
|
|
|
.translate = translate_rur,
|
|
|
|
.par = (const uint32_t[]){FSR},
|
|
|
|
.coprocessor = 0x1,
|
2017-11-04 05:37:13 +03:00
|
|
|
}, {
|
|
|
|
.name = "ssi",
|
|
|
|
.translate = translate_ldsti,
|
|
|
|
.par = (const uint32_t[]){true, false},
|
2019-02-14 04:36:30 +03:00
|
|
|
.op_flags = XTENSA_OP_STORE,
|
2018-08-31 23:57:08 +03:00
|
|
|
.coprocessor = 0x1,
|
2017-11-04 05:37:13 +03:00
|
|
|
}, {
|
|
|
|
.name = "ssiu",
|
|
|
|
.translate = translate_ldsti,
|
|
|
|
.par = (const uint32_t[]){true, true},
|
2019-02-14 04:36:30 +03:00
|
|
|
.op_flags = XTENSA_OP_STORE,
|
2018-08-31 23:57:08 +03:00
|
|
|
.coprocessor = 0x1,
|
2017-11-04 05:37:13 +03:00
|
|
|
}, {
|
|
|
|
.name = "ssx",
|
|
|
|
.translate = translate_ldstx,
|
|
|
|
.par = (const uint32_t[]){true, false},
|
2019-02-14 04:36:30 +03:00
|
|
|
.op_flags = XTENSA_OP_STORE,
|
2018-08-31 23:57:08 +03:00
|
|
|
.coprocessor = 0x1,
|
2017-11-04 05:37:13 +03:00
|
|
|
}, {
|
|
|
|
.name = "ssxu",
|
|
|
|
.translate = translate_ldstx,
|
|
|
|
.par = (const uint32_t[]){true, true},
|
2019-02-14 04:36:30 +03:00
|
|
|
.op_flags = XTENSA_OP_STORE,
|
2018-08-31 23:57:08 +03:00
|
|
|
.coprocessor = 0x1,
|
2017-11-04 05:37:13 +03:00
|
|
|
}, {
|
|
|
|
.name = "sub.s",
|
2015-07-13 04:30:41 +03:00
|
|
|
.translate = translate_fpu2k_sub_s,
|
2018-08-31 23:57:08 +03:00
|
|
|
.coprocessor = 0x1,
|
2017-11-04 05:37:13 +03:00
|
|
|
}, {
|
|
|
|
.name = "trunc.s",
|
|
|
|
.translate = translate_ftoi_s,
|
|
|
|
.par = (const uint32_t[]){float_round_to_zero, false},
|
2018-08-31 23:57:08 +03:00
|
|
|
.coprocessor = 0x1,
|
2017-11-04 05:37:13 +03:00
|
|
|
}, {
|
|
|
|
.name = "ueq.s",
|
|
|
|
.translate = translate_compare_s,
|
|
|
|
.par = (const uint32_t[]){COMPARE_UEQ},
|
2018-08-31 23:57:08 +03:00
|
|
|
.coprocessor = 0x1,
|
2017-11-04 05:37:13 +03:00
|
|
|
}, {
|
|
|
|
.name = "ufloat.s",
|
|
|
|
.translate = translate_float_s,
|
|
|
|
.par = (const uint32_t[]){true},
|
2018-08-31 23:57:08 +03:00
|
|
|
.coprocessor = 0x1,
|
2017-11-04 05:37:13 +03:00
|
|
|
}, {
|
|
|
|
.name = "ule.s",
|
|
|
|
.translate = translate_compare_s,
|
|
|
|
.par = (const uint32_t[]){COMPARE_ULE},
|
2018-08-31 23:57:08 +03:00
|
|
|
.coprocessor = 0x1,
|
2017-11-04 05:37:13 +03:00
|
|
|
}, {
|
|
|
|
.name = "ult.s",
|
|
|
|
.translate = translate_compare_s,
|
|
|
|
.par = (const uint32_t[]){COMPARE_ULT},
|
2018-08-31 23:57:08 +03:00
|
|
|
.coprocessor = 0x1,
|
2017-11-04 05:37:13 +03:00
|
|
|
}, {
|
|
|
|
.name = "un.s",
|
|
|
|
.translate = translate_compare_s,
|
|
|
|
.par = (const uint32_t[]){COMPARE_UN},
|
2018-08-31 23:57:08 +03:00
|
|
|
.coprocessor = 0x1,
|
2017-11-04 05:37:13 +03:00
|
|
|
}, {
|
|
|
|
.name = "utrunc.s",
|
|
|
|
.translate = translate_ftoi_s,
|
|
|
|
.par = (const uint32_t[]){float_round_to_zero, true},
|
2018-08-31 23:57:08 +03:00
|
|
|
.coprocessor = 0x1,
|
2017-11-04 05:37:13 +03:00
|
|
|
}, {
|
2018-08-31 10:40:28 +03:00
|
|
|
.name = "wfr",
|
2017-11-04 05:37:13 +03:00
|
|
|
.translate = translate_wfr_s,
|
2018-08-31 23:57:08 +03:00
|
|
|
.coprocessor = 0x1,
|
2015-07-13 04:30:41 +03:00
|
|
|
}, {
|
|
|
|
.name = "wur.fcr",
|
|
|
|
.translate = translate_wur_fpu2k_fcr,
|
|
|
|
.par = (const uint32_t[]){FCR},
|
|
|
|
.coprocessor = 0x1,
|
|
|
|
}, {
|
|
|
|
.name = "wur.fsr",
|
|
|
|
.translate = translate_wur_fpu2k_fsr,
|
|
|
|
.par = (const uint32_t[]){FSR},
|
|
|
|
.coprocessor = 0x1,
|
2017-11-04 05:37:13 +03:00
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
const XtensaOpcodeTranslators xtensa_fpu2000_opcodes = {
|
|
|
|
.num_opcodes = ARRAY_SIZE(fpu2000_ops),
|
|
|
|
.opcode = fpu2000_ops,
|
|
|
|
};
|
2020-07-01 05:27:02 +03:00
|
|
|
|
|
|
|
static void translate_add_d(DisasContext *dc, const OpcodeArg arg[],
|
|
|
|
const uint32_t par[])
|
|
|
|
{
|
|
|
|
gen_helper_add_d(arg[0].out, cpu_env, arg[1].in, arg[2].in);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void translate_add_s(DisasContext *dc, const OpcodeArg arg[],
|
|
|
|
const uint32_t par[])
|
|
|
|
{
|
|
|
|
if (option_enabled(dc, XTENSA_OPTION_DFPU_SINGLE_ONLY)) {
|
|
|
|
gen_helper_fpu2k_add_s(arg[0].out, cpu_env,
|
|
|
|
arg[1].in, arg[2].in);
|
|
|
|
} else {
|
|
|
|
OpcodeArg arg32[3];
|
|
|
|
|
|
|
|
get_f32_o1_i2(arg, arg32, 0, 1, 2);
|
|
|
|
gen_helper_add_s(arg32[0].out, cpu_env, arg32[1].in, arg32[2].in);
|
|
|
|
put_f32_o1_i2(arg, arg32, 0, 1, 2);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void translate_cvtd_s(DisasContext *dc, const OpcodeArg arg[],
|
|
|
|
const uint32_t par[])
|
|
|
|
{
|
|
|
|
TCGv_i32 v = tcg_temp_new_i32();
|
|
|
|
|
|
|
|
tcg_gen_extrl_i64_i32(v, arg[1].in);
|
|
|
|
gen_helper_cvtd_s(arg[0].out, cpu_env, v);
|
|
|
|
tcg_temp_free_i32(v);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void translate_cvts_d(DisasContext *dc, const OpcodeArg arg[],
|
|
|
|
const uint32_t par[])
|
|
|
|
{
|
|
|
|
TCGv_i32 v = tcg_temp_new_i32();
|
|
|
|
|
|
|
|
gen_helper_cvts_d(v, cpu_env, arg[1].in);
|
|
|
|
tcg_gen_extu_i32_i64(arg[0].out, v);
|
|
|
|
tcg_temp_free_i32(v);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void translate_ldsti_d(DisasContext *dc, const OpcodeArg arg[],
|
|
|
|
const uint32_t par[])
|
|
|
|
{
|
|
|
|
TCGv_i32 addr;
|
|
|
|
|
|
|
|
if (par[1]) {
|
|
|
|
addr = tcg_temp_new_i32();
|
|
|
|
tcg_gen_addi_i32(addr, arg[1].in, arg[2].imm);
|
|
|
|
} else {
|
|
|
|
addr = arg[1].in;
|
|
|
|
}
|
|
|
|
gen_load_store_alignment(dc, 3, addr, false);
|
|
|
|
if (par[0]) {
|
|
|
|
tcg_gen_qemu_st64(arg[0].in, addr, dc->cring);
|
|
|
|
} else {
|
|
|
|
tcg_gen_qemu_ld64(arg[0].out, addr, dc->cring);
|
|
|
|
}
|
|
|
|
if (par[2]) {
|
|
|
|
if (par[1]) {
|
|
|
|
tcg_gen_mov_i32(arg[1].out, addr);
|
|
|
|
} else {
|
|
|
|
tcg_gen_addi_i32(arg[1].out, arg[1].in, arg[2].imm);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (par[1]) {
|
|
|
|
tcg_temp_free(addr);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void translate_ldsti_s(DisasContext *dc, const OpcodeArg arg[],
|
|
|
|
const uint32_t par[])
|
|
|
|
{
|
|
|
|
TCGv_i32 addr;
|
|
|
|
OpcodeArg arg32[1];
|
|
|
|
|
|
|
|
if (par[1]) {
|
|
|
|
addr = tcg_temp_new_i32();
|
|
|
|
tcg_gen_addi_i32(addr, arg[1].in, arg[2].imm);
|
|
|
|
} else {
|
|
|
|
addr = arg[1].in;
|
|
|
|
}
|
|
|
|
gen_load_store_alignment(dc, 2, addr, false);
|
|
|
|
if (par[0]) {
|
|
|
|
get_f32_i1(arg, arg32, 0);
|
|
|
|
tcg_gen_qemu_st32(arg32[0].in, addr, dc->cring);
|
|
|
|
put_f32_i1(arg, arg32, 0);
|
|
|
|
} else {
|
|
|
|
get_f32_o1(arg, arg32, 0);
|
|
|
|
tcg_gen_qemu_ld32u(arg32[0].out, addr, dc->cring);
|
|
|
|
put_f32_o1(arg, arg32, 0);
|
|
|
|
}
|
|
|
|
if (par[2]) {
|
|
|
|
if (par[1]) {
|
|
|
|
tcg_gen_mov_i32(arg[1].out, addr);
|
|
|
|
} else {
|
|
|
|
tcg_gen_addi_i32(arg[1].out, arg[1].in, arg[2].imm);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (par[1]) {
|
|
|
|
tcg_temp_free(addr);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void translate_ldstx_d(DisasContext *dc, const OpcodeArg arg[],
|
|
|
|
const uint32_t par[])
|
|
|
|
{
|
|
|
|
TCGv_i32 addr;
|
|
|
|
|
|
|
|
if (par[1]) {
|
|
|
|
addr = tcg_temp_new_i32();
|
|
|
|
tcg_gen_add_i32(addr, arg[1].in, arg[2].in);
|
|
|
|
} else {
|
|
|
|
addr = arg[1].in;
|
|
|
|
}
|
|
|
|
gen_load_store_alignment(dc, 3, addr, false);
|
|
|
|
if (par[0]) {
|
|
|
|
tcg_gen_qemu_st64(arg[0].in, addr, dc->cring);
|
|
|
|
} else {
|
|
|
|
tcg_gen_qemu_ld64(arg[0].out, addr, dc->cring);
|
|
|
|
}
|
|
|
|
if (par[2]) {
|
|
|
|
if (par[1]) {
|
|
|
|
tcg_gen_mov_i32(arg[1].out, addr);
|
|
|
|
} else {
|
|
|
|
tcg_gen_add_i32(arg[1].out, arg[1].in, arg[2].in);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (par[1]) {
|
|
|
|
tcg_temp_free(addr);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void translate_ldstx_s(DisasContext *dc, const OpcodeArg arg[],
|
|
|
|
const uint32_t par[])
|
|
|
|
{
|
|
|
|
TCGv_i32 addr;
|
|
|
|
OpcodeArg arg32[1];
|
|
|
|
|
|
|
|
if (par[1]) {
|
|
|
|
addr = tcg_temp_new_i32();
|
|
|
|
tcg_gen_add_i32(addr, arg[1].in, arg[2].in);
|
|
|
|
} else {
|
|
|
|
addr = arg[1].in;
|
|
|
|
}
|
|
|
|
gen_load_store_alignment(dc, 2, addr, false);
|
|
|
|
if (par[0]) {
|
|
|
|
get_f32_i1(arg, arg32, 0);
|
|
|
|
tcg_gen_qemu_st32(arg32[0].in, addr, dc->cring);
|
|
|
|
put_f32_i1(arg, arg32, 0);
|
|
|
|
} else {
|
|
|
|
get_f32_o1(arg, arg32, 0);
|
|
|
|
tcg_gen_qemu_ld32u(arg32[0].out, addr, dc->cring);
|
|
|
|
put_f32_o1(arg, arg32, 0);
|
|
|
|
}
|
|
|
|
if (par[2]) {
|
|
|
|
if (par[1]) {
|
|
|
|
tcg_gen_mov_i32(arg[1].out, addr);
|
|
|
|
} else {
|
|
|
|
tcg_gen_add_i32(arg[1].out, arg[1].in, arg[2].in);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (par[1]) {
|
|
|
|
tcg_temp_free(addr);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void translate_madd_d(DisasContext *dc, const OpcodeArg arg[],
|
|
|
|
const uint32_t par[])
|
|
|
|
{
|
|
|
|
gen_helper_madd_d(arg[0].out, cpu_env,
|
|
|
|
arg[0].in, arg[1].in, arg[2].in);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void translate_madd_s(DisasContext *dc, const OpcodeArg arg[],
|
|
|
|
const uint32_t par[])
|
|
|
|
{
|
|
|
|
if (option_enabled(dc, XTENSA_OPTION_DFPU_SINGLE_ONLY)) {
|
|
|
|
gen_helper_fpu2k_madd_s(arg[0].out, cpu_env,
|
|
|
|
arg[0].in, arg[1].in, arg[2].in);
|
|
|
|
} else {
|
|
|
|
OpcodeArg arg32[3];
|
|
|
|
|
|
|
|
get_f32_o1_i3(arg, arg32, 0, 0, 1, 2);
|
|
|
|
gen_helper_madd_s(arg32[0].out, cpu_env,
|
|
|
|
arg32[0].in, arg32[1].in, arg32[2].in);
|
|
|
|
put_f32_o1_i3(arg, arg32, 0, 0, 1, 2);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void translate_mul_d(DisasContext *dc, const OpcodeArg arg[],
|
|
|
|
const uint32_t par[])
|
|
|
|
{
|
|
|
|
gen_helper_mul_d(arg[0].out, cpu_env, arg[1].in, arg[2].in);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void translate_mul_s(DisasContext *dc, const OpcodeArg arg[],
|
|
|
|
const uint32_t par[])
|
|
|
|
{
|
|
|
|
if (option_enabled(dc, XTENSA_OPTION_DFPU_SINGLE_ONLY)) {
|
|
|
|
gen_helper_fpu2k_mul_s(arg[0].out, cpu_env,
|
|
|
|
arg[1].in, arg[2].in);
|
|
|
|
} else {
|
|
|
|
OpcodeArg arg32[3];
|
|
|
|
|
|
|
|
get_f32_o1_i2(arg, arg32, 0, 1, 2);
|
|
|
|
gen_helper_mul_s(arg32[0].out, cpu_env, arg32[1].in, arg32[2].in);
|
|
|
|
put_f32_o1_i2(arg, arg32, 0, 1, 2);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void translate_msub_d(DisasContext *dc, const OpcodeArg arg[],
|
|
|
|
const uint32_t par[])
|
|
|
|
{
|
|
|
|
gen_helper_msub_d(arg[0].out, cpu_env,
|
|
|
|
arg[0].in, arg[1].in, arg[2].in);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void translate_msub_s(DisasContext *dc, const OpcodeArg arg[],
|
|
|
|
const uint32_t par[])
|
|
|
|
{
|
|
|
|
if (option_enabled(dc, XTENSA_OPTION_DFPU_SINGLE_ONLY)) {
|
|
|
|
gen_helper_fpu2k_msub_s(arg[0].out, cpu_env,
|
|
|
|
arg[0].in, arg[1].in, arg[2].in);
|
|
|
|
} else {
|
|
|
|
OpcodeArg arg32[3];
|
|
|
|
|
|
|
|
get_f32_o1_i3(arg, arg32, 0, 0, 1, 2);
|
|
|
|
gen_helper_msub_s(arg32[0].out, cpu_env,
|
|
|
|
arg32[0].in, arg32[1].in, arg32[2].in);
|
|
|
|
put_f32_o1_i3(arg, arg32, 0, 0, 1, 2);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void translate_sub_d(DisasContext *dc, const OpcodeArg arg[],
|
|
|
|
const uint32_t par[])
|
|
|
|
{
|
|
|
|
gen_helper_sub_d(arg[0].out, cpu_env, arg[1].in, arg[2].in);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void translate_sub_s(DisasContext *dc, const OpcodeArg arg[],
|
|
|
|
const uint32_t par[])
|
|
|
|
{
|
|
|
|
if (option_enabled(dc, XTENSA_OPTION_DFPU_SINGLE_ONLY)) {
|
|
|
|
gen_helper_fpu2k_sub_s(arg[0].out, cpu_env,
|
|
|
|
arg[1].in, arg[2].in);
|
|
|
|
} else {
|
|
|
|
OpcodeArg arg32[3];
|
|
|
|
|
|
|
|
get_f32_o1_i2(arg, arg32, 0, 1, 2);
|
|
|
|
gen_helper_sub_s(arg32[0].out, cpu_env, arg32[1].in, arg32[2].in);
|
|
|
|
put_f32_o1_i2(arg, arg32, 0, 1, 2);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-03-14 21:13:53 +03:00
|
|
|
static void translate_mkdadj_d(DisasContext *dc, const OpcodeArg arg[],
|
|
|
|
const uint32_t par[])
|
|
|
|
{
|
|
|
|
gen_helper_mkdadj_d(arg[0].out, cpu_env, arg[0].in, arg[1].in);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void translate_mkdadj_s(DisasContext *dc, const OpcodeArg arg[],
|
|
|
|
const uint32_t par[])
|
|
|
|
{
|
|
|
|
OpcodeArg arg32[2];
|
|
|
|
|
|
|
|
get_f32_o1_i2(arg, arg32, 0, 0, 1);
|
|
|
|
gen_helper_mkdadj_s(arg32[0].out, cpu_env, arg32[0].in, arg32[1].in);
|
|
|
|
put_f32_o1_i2(arg, arg32, 0, 0, 1);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void translate_mksadj_d(DisasContext *dc, const OpcodeArg arg[],
|
|
|
|
const uint32_t par[])
|
|
|
|
{
|
|
|
|
gen_helper_mksadj_d(arg[0].out, cpu_env, arg[1].in);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void translate_mksadj_s(DisasContext *dc, const OpcodeArg arg[],
|
|
|
|
const uint32_t par[])
|
|
|
|
{
|
|
|
|
OpcodeArg arg32[2];
|
|
|
|
|
|
|
|
get_f32_o1_i1(arg, arg32, 0, 1);
|
|
|
|
gen_helper_mksadj_s(arg32[0].out, cpu_env, arg32[1].in);
|
|
|
|
put_f32_o1_i1(arg, arg32, 0, 1);
|
|
|
|
}
|
|
|
|
|
2020-07-01 05:27:02 +03:00
|
|
|
static void translate_wur_fpu_fcr(DisasContext *dc, const OpcodeArg arg[],
|
|
|
|
const uint32_t par[])
|
|
|
|
{
|
|
|
|
gen_helper_wur_fpu_fcr(cpu_env, arg[0].in);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void translate_rur_fpu_fsr(DisasContext *dc, const OpcodeArg arg[],
|
|
|
|
const uint32_t par[])
|
|
|
|
{
|
|
|
|
gen_helper_rur_fpu_fsr(arg[0].out, cpu_env);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void translate_wur_fpu_fsr(DisasContext *dc, const OpcodeArg arg[],
|
|
|
|
const uint32_t par[])
|
|
|
|
{
|
|
|
|
gen_helper_wur_fpu_fsr(cpu_env, arg[0].in);
|
|
|
|
}
|
|
|
|
|
|
|
|
static const XtensaOpcodeOps fpu_ops[] = {
|
|
|
|
{
|
|
|
|
.name = "abs.d",
|
|
|
|
.translate = translate_abs_d,
|
|
|
|
.coprocessor = 0x1,
|
|
|
|
}, {
|
|
|
|
.name = "abs.s",
|
|
|
|
.translate = translate_abs_s,
|
|
|
|
.coprocessor = 0x1,
|
|
|
|
}, {
|
|
|
|
.name = "add.d",
|
|
|
|
.translate = translate_add_d,
|
|
|
|
.coprocessor = 0x1,
|
|
|
|
}, {
|
|
|
|
.name = "add.s",
|
|
|
|
.translate = translate_add_s,
|
|
|
|
.coprocessor = 0x1,
|
2020-03-14 21:13:53 +03:00
|
|
|
}, {
|
|
|
|
.name = "addexp.d",
|
|
|
|
.translate = translate_nop,
|
|
|
|
.coprocessor = 0x1,
|
|
|
|
}, {
|
|
|
|
.name = "addexp.s",
|
|
|
|
.translate = translate_nop,
|
|
|
|
.coprocessor = 0x1,
|
|
|
|
}, {
|
|
|
|
.name = "addexpm.d",
|
|
|
|
.translate = translate_mov_s,
|
|
|
|
.coprocessor = 0x1,
|
|
|
|
}, {
|
|
|
|
.name = "addexpm.s",
|
|
|
|
.translate = translate_mov_s,
|
|
|
|
.coprocessor = 0x1,
|
2020-07-01 05:27:02 +03:00
|
|
|
}, {
|
|
|
|
.name = "ceil.d",
|
|
|
|
.translate = translate_ftoi_d,
|
|
|
|
.par = (const uint32_t[]){float_round_up, false},
|
|
|
|
.coprocessor = 0x1,
|
|
|
|
}, {
|
|
|
|
.name = "ceil.s",
|
|
|
|
.translate = translate_ftoi_s,
|
|
|
|
.par = (const uint32_t[]){float_round_up, false},
|
|
|
|
.coprocessor = 0x1,
|
|
|
|
}, {
|
|
|
|
.name = "const.d",
|
|
|
|
.translate = translate_const_d,
|
|
|
|
.coprocessor = 0x1,
|
|
|
|
}, {
|
|
|
|
.name = "const.s",
|
|
|
|
.translate = translate_const_s,
|
|
|
|
.coprocessor = 0x1,
|
|
|
|
}, {
|
|
|
|
.name = "cvtd.s",
|
|
|
|
.translate = translate_cvtd_s,
|
|
|
|
.coprocessor = 0x1,
|
|
|
|
}, {
|
|
|
|
.name = "cvts.d",
|
|
|
|
.translate = translate_cvts_d,
|
|
|
|
.coprocessor = 0x1,
|
2020-03-14 21:13:53 +03:00
|
|
|
}, {
|
|
|
|
.name = "div0.d",
|
|
|
|
.translate = translate_nop,
|
|
|
|
.coprocessor = 0x1,
|
|
|
|
}, {
|
|
|
|
.name = "div0.s",
|
|
|
|
.translate = translate_nop,
|
|
|
|
.coprocessor = 0x1,
|
|
|
|
}, {
|
|
|
|
.name = "divn.d",
|
|
|
|
.translate = translate_nop,
|
|
|
|
.coprocessor = 0x1,
|
|
|
|
}, {
|
|
|
|
.name = "divn.s",
|
|
|
|
.translate = translate_nop,
|
|
|
|
.coprocessor = 0x1,
|
2020-07-01 05:27:02 +03:00
|
|
|
}, {
|
|
|
|
.name = "float.d",
|
|
|
|
.translate = translate_float_d,
|
|
|
|
.par = (const uint32_t[]){false},
|
|
|
|
.coprocessor = 0x1,
|
|
|
|
}, {
|
|
|
|
.name = "float.s",
|
|
|
|
.translate = translate_float_s,
|
|
|
|
.par = (const uint32_t[]){false},
|
|
|
|
.coprocessor = 0x1,
|
|
|
|
}, {
|
|
|
|
.name = "floor.d",
|
|
|
|
.translate = translate_ftoi_d,
|
|
|
|
.par = (const uint32_t[]){float_round_down, false},
|
|
|
|
.coprocessor = 0x1,
|
|
|
|
}, {
|
|
|
|
.name = "floor.s",
|
|
|
|
.translate = translate_ftoi_s,
|
|
|
|
.par = (const uint32_t[]){float_round_down, false},
|
|
|
|
.coprocessor = 0x1,
|
|
|
|
}, {
|
|
|
|
.name = "ldi",
|
|
|
|
.translate = translate_ldsti_d,
|
|
|
|
.par = (const uint32_t[]){false, true, false},
|
|
|
|
.op_flags = XTENSA_OP_LOAD,
|
|
|
|
.coprocessor = 0x1,
|
|
|
|
}, {
|
|
|
|
.name = "ldip",
|
|
|
|
.translate = translate_ldsti_d,
|
|
|
|
.par = (const uint32_t[]){false, false, true},
|
|
|
|
.op_flags = XTENSA_OP_LOAD,
|
|
|
|
.coprocessor = 0x1,
|
|
|
|
}, {
|
|
|
|
.name = "ldiu",
|
|
|
|
.translate = translate_ldsti_d,
|
|
|
|
.par = (const uint32_t[]){false, true, true},
|
|
|
|
.op_flags = XTENSA_OP_LOAD,
|
|
|
|
.coprocessor = 0x1,
|
|
|
|
}, {
|
|
|
|
.name = "ldx",
|
|
|
|
.translate = translate_ldstx_d,
|
|
|
|
.par = (const uint32_t[]){false, true, false},
|
|
|
|
.op_flags = XTENSA_OP_LOAD,
|
|
|
|
.coprocessor = 0x1,
|
|
|
|
}, {
|
|
|
|
.name = "ldxp",
|
|
|
|
.translate = translate_ldstx_d,
|
|
|
|
.par = (const uint32_t[]){false, false, true},
|
|
|
|
.op_flags = XTENSA_OP_LOAD,
|
|
|
|
.coprocessor = 0x1,
|
|
|
|
}, {
|
|
|
|
.name = "ldxu",
|
|
|
|
.translate = translate_ldstx_d,
|
|
|
|
.par = (const uint32_t[]){false, true, true},
|
|
|
|
.op_flags = XTENSA_OP_LOAD,
|
|
|
|
.coprocessor = 0x1,
|
|
|
|
}, {
|
|
|
|
.name = "lsi",
|
|
|
|
.translate = translate_ldsti_s,
|
|
|
|
.par = (const uint32_t[]){false, true, false},
|
|
|
|
.op_flags = XTENSA_OP_LOAD,
|
|
|
|
.coprocessor = 0x1,
|
|
|
|
}, {
|
|
|
|
.name = "lsip",
|
|
|
|
.translate = translate_ldsti_s,
|
|
|
|
.par = (const uint32_t[]){false, false, true},
|
|
|
|
.op_flags = XTENSA_OP_LOAD,
|
|
|
|
.coprocessor = 0x1,
|
|
|
|
}, {
|
|
|
|
.name = "lsiu",
|
|
|
|
.translate = translate_ldsti_s,
|
|
|
|
.par = (const uint32_t[]){false, true, true},
|
|
|
|
.op_flags = XTENSA_OP_LOAD,
|
|
|
|
.coprocessor = 0x1,
|
|
|
|
}, {
|
|
|
|
.name = "lsx",
|
|
|
|
.translate = translate_ldstx_s,
|
|
|
|
.par = (const uint32_t[]){false, true, false},
|
|
|
|
.op_flags = XTENSA_OP_LOAD,
|
|
|
|
.coprocessor = 0x1,
|
|
|
|
}, {
|
|
|
|
.name = "lsxp",
|
|
|
|
.translate = translate_ldstx_s,
|
|
|
|
.par = (const uint32_t[]){false, false, true},
|
|
|
|
.op_flags = XTENSA_OP_LOAD,
|
|
|
|
.coprocessor = 0x1,
|
|
|
|
}, {
|
|
|
|
.name = "lsxu",
|
|
|
|
.translate = translate_ldstx_s,
|
|
|
|
.par = (const uint32_t[]){false, true, true},
|
|
|
|
.op_flags = XTENSA_OP_LOAD,
|
|
|
|
.coprocessor = 0x1,
|
|
|
|
}, {
|
|
|
|
.name = "madd.d",
|
|
|
|
.translate = translate_madd_d,
|
|
|
|
.coprocessor = 0x1,
|
|
|
|
}, {
|
|
|
|
.name = "madd.s",
|
|
|
|
.translate = translate_madd_s,
|
|
|
|
.coprocessor = 0x1,
|
2020-03-14 21:13:53 +03:00
|
|
|
}, {
|
|
|
|
.name = "maddn.d",
|
|
|
|
.translate = translate_nop,
|
|
|
|
.coprocessor = 0x1,
|
|
|
|
}, {
|
|
|
|
.name = "maddn.s",
|
|
|
|
.translate = translate_nop,
|
|
|
|
.coprocessor = 0x1,
|
|
|
|
}, {
|
|
|
|
.name = "mkdadj.d",
|
|
|
|
.translate = translate_mkdadj_d,
|
|
|
|
.coprocessor = 0x1,
|
|
|
|
}, {
|
|
|
|
.name = "mkdadj.s",
|
|
|
|
.translate = translate_mkdadj_s,
|
|
|
|
.coprocessor = 0x1,
|
|
|
|
}, {
|
|
|
|
.name = "mksadj.d",
|
|
|
|
.translate = translate_mksadj_d,
|
|
|
|
.coprocessor = 0x1,
|
|
|
|
}, {
|
|
|
|
.name = "mksadj.s",
|
|
|
|
.translate = translate_mksadj_s,
|
|
|
|
.coprocessor = 0x1,
|
2020-07-01 05:27:02 +03:00
|
|
|
}, {
|
|
|
|
.name = "mov.d",
|
|
|
|
.translate = translate_mov_d,
|
|
|
|
.coprocessor = 0x1,
|
|
|
|
}, {
|
|
|
|
.name = "mov.s",
|
|
|
|
.translate = translate_mov_s,
|
|
|
|
.coprocessor = 0x1,
|
|
|
|
}, {
|
|
|
|
.name = "moveqz.d",
|
|
|
|
.translate = translate_movcond_d,
|
|
|
|
.par = (const uint32_t[]){TCG_COND_EQ},
|
|
|
|
.coprocessor = 0x1,
|
|
|
|
}, {
|
|
|
|
.name = "moveqz.s",
|
|
|
|
.translate = translate_movcond_s,
|
|
|
|
.par = (const uint32_t[]){TCG_COND_EQ},
|
|
|
|
.coprocessor = 0x1,
|
|
|
|
}, {
|
|
|
|
.name = "movf.d",
|
|
|
|
.translate = translate_movp_d,
|
|
|
|
.par = (const uint32_t[]){TCG_COND_EQ},
|
|
|
|
.coprocessor = 0x1,
|
|
|
|
}, {
|
|
|
|
.name = "movf.s",
|
|
|
|
.translate = translate_movp_s,
|
|
|
|
.par = (const uint32_t[]){TCG_COND_EQ},
|
|
|
|
.coprocessor = 0x1,
|
|
|
|
}, {
|
|
|
|
.name = "movgez.d",
|
|
|
|
.translate = translate_movcond_d,
|
|
|
|
.par = (const uint32_t[]){TCG_COND_GE},
|
|
|
|
.coprocessor = 0x1,
|
|
|
|
}, {
|
|
|
|
.name = "movgez.s",
|
|
|
|
.translate = translate_movcond_s,
|
|
|
|
.par = (const uint32_t[]){TCG_COND_GE},
|
|
|
|
.coprocessor = 0x1,
|
|
|
|
}, {
|
|
|
|
.name = "movltz.d",
|
|
|
|
.translate = translate_movcond_d,
|
|
|
|
.par = (const uint32_t[]){TCG_COND_LT},
|
|
|
|
.coprocessor = 0x1,
|
|
|
|
}, {
|
|
|
|
.name = "movltz.s",
|
|
|
|
.translate = translate_movcond_s,
|
|
|
|
.par = (const uint32_t[]){TCG_COND_LT},
|
|
|
|
.coprocessor = 0x1,
|
|
|
|
}, {
|
|
|
|
.name = "movnez.d",
|
|
|
|
.translate = translate_movcond_d,
|
|
|
|
.par = (const uint32_t[]){TCG_COND_NE},
|
|
|
|
.coprocessor = 0x1,
|
|
|
|
}, {
|
|
|
|
.name = "movnez.s",
|
|
|
|
.translate = translate_movcond_s,
|
|
|
|
.par = (const uint32_t[]){TCG_COND_NE},
|
|
|
|
.coprocessor = 0x1,
|
|
|
|
}, {
|
|
|
|
.name = "movt.d",
|
|
|
|
.translate = translate_movp_d,
|
|
|
|
.par = (const uint32_t[]){TCG_COND_NE},
|
|
|
|
.coprocessor = 0x1,
|
|
|
|
}, {
|
|
|
|
.name = "movt.s",
|
|
|
|
.translate = translate_movp_s,
|
|
|
|
.par = (const uint32_t[]){TCG_COND_NE},
|
|
|
|
.coprocessor = 0x1,
|
|
|
|
}, {
|
|
|
|
.name = "msub.d",
|
|
|
|
.translate = translate_msub_d,
|
|
|
|
.coprocessor = 0x1,
|
|
|
|
}, {
|
|
|
|
.name = "msub.s",
|
|
|
|
.translate = translate_msub_s,
|
|
|
|
.coprocessor = 0x1,
|
|
|
|
}, {
|
|
|
|
.name = "mul.d",
|
|
|
|
.translate = translate_mul_d,
|
|
|
|
.coprocessor = 0x1,
|
|
|
|
}, {
|
|
|
|
.name = "mul.s",
|
|
|
|
.translate = translate_mul_s,
|
|
|
|
.coprocessor = 0x1,
|
|
|
|
}, {
|
|
|
|
.name = "neg.d",
|
|
|
|
.translate = translate_neg_d,
|
|
|
|
.coprocessor = 0x1,
|
|
|
|
}, {
|
|
|
|
.name = "neg.s",
|
|
|
|
.translate = translate_neg_s,
|
|
|
|
.coprocessor = 0x1,
|
2020-03-14 21:13:53 +03:00
|
|
|
}, {
|
|
|
|
.name = "nexp01.d",
|
|
|
|
.translate = translate_nop,
|
|
|
|
.coprocessor = 0x1,
|
|
|
|
}, {
|
|
|
|
.name = "nexp01.s",
|
|
|
|
.translate = translate_nop,
|
|
|
|
.coprocessor = 0x1,
|
2020-07-01 05:27:02 +03:00
|
|
|
}, {
|
|
|
|
.name = "oeq.d",
|
|
|
|
.translate = translate_compare_d,
|
|
|
|
.par = (const uint32_t[]){COMPARE_OEQ},
|
|
|
|
.coprocessor = 0x1,
|
|
|
|
}, {
|
|
|
|
.name = "oeq.s",
|
|
|
|
.translate = translate_compare_s,
|
|
|
|
.par = (const uint32_t[]){COMPARE_OEQ},
|
|
|
|
.coprocessor = 0x1,
|
|
|
|
}, {
|
|
|
|
.name = "ole.d",
|
|
|
|
.translate = translate_compare_d,
|
|
|
|
.par = (const uint32_t[]){COMPARE_OLE},
|
|
|
|
.coprocessor = 0x1,
|
|
|
|
}, {
|
|
|
|
.name = "ole.s",
|
|
|
|
.translate = translate_compare_s,
|
|
|
|
.par = (const uint32_t[]){COMPARE_OLE},
|
|
|
|
.coprocessor = 0x1,
|
|
|
|
}, {
|
|
|
|
.name = "olt.d",
|
|
|
|
.translate = translate_compare_d,
|
|
|
|
.par = (const uint32_t[]){COMPARE_OLT},
|
|
|
|
.coprocessor = 0x1,
|
|
|
|
}, {
|
|
|
|
.name = "olt.s",
|
|
|
|
.translate = translate_compare_s,
|
|
|
|
.par = (const uint32_t[]){COMPARE_OLT},
|
|
|
|
.coprocessor = 0x1,
|
|
|
|
}, {
|
|
|
|
.name = "rfr",
|
|
|
|
.translate = translate_rfr_s,
|
|
|
|
.coprocessor = 0x1,
|
|
|
|
}, {
|
|
|
|
.name = "rfrd",
|
|
|
|
.translate = translate_rfr_d,
|
|
|
|
.coprocessor = 0x1,
|
|
|
|
}, {
|
|
|
|
.name = "round.d",
|
|
|
|
.translate = translate_ftoi_d,
|
|
|
|
.par = (const uint32_t[]){float_round_nearest_even, false},
|
|
|
|
.coprocessor = 0x1,
|
|
|
|
}, {
|
|
|
|
.name = "round.s",
|
|
|
|
.translate = translate_ftoi_s,
|
|
|
|
.par = (const uint32_t[]){float_round_nearest_even, false},
|
|
|
|
.coprocessor = 0x1,
|
|
|
|
}, {
|
|
|
|
.name = "rur.fcr",
|
|
|
|
.translate = translate_rur,
|
|
|
|
.par = (const uint32_t[]){FCR},
|
|
|
|
.coprocessor = 0x1,
|
|
|
|
}, {
|
|
|
|
.name = "rur.fsr",
|
|
|
|
.translate = translate_rur_fpu_fsr,
|
|
|
|
.coprocessor = 0x1,
|
|
|
|
}, {
|
|
|
|
.name = "sdi",
|
|
|
|
.translate = translate_ldsti_d,
|
|
|
|
.par = (const uint32_t[]){true, true, false},
|
|
|
|
.op_flags = XTENSA_OP_STORE,
|
|
|
|
.coprocessor = 0x1,
|
|
|
|
}, {
|
|
|
|
.name = "sdip",
|
|
|
|
.translate = translate_ldsti_d,
|
|
|
|
.par = (const uint32_t[]){true, false, true},
|
|
|
|
.op_flags = XTENSA_OP_STORE,
|
|
|
|
.coprocessor = 0x1,
|
|
|
|
}, {
|
|
|
|
.name = "sdiu",
|
|
|
|
.translate = translate_ldsti_d,
|
|
|
|
.par = (const uint32_t[]){true, true, true},
|
|
|
|
.op_flags = XTENSA_OP_STORE,
|
|
|
|
.coprocessor = 0x1,
|
|
|
|
}, {
|
|
|
|
.name = "sdx",
|
|
|
|
.translate = translate_ldstx_d,
|
|
|
|
.par = (const uint32_t[]){true, true, false},
|
|
|
|
.op_flags = XTENSA_OP_STORE,
|
|
|
|
.coprocessor = 0x1,
|
|
|
|
}, {
|
|
|
|
.name = "sdxp",
|
|
|
|
.translate = translate_ldstx_d,
|
|
|
|
.par = (const uint32_t[]){true, false, true},
|
|
|
|
.op_flags = XTENSA_OP_STORE,
|
|
|
|
.coprocessor = 0x1,
|
|
|
|
}, {
|
|
|
|
.name = "sdxu",
|
|
|
|
.translate = translate_ldstx_d,
|
|
|
|
.par = (const uint32_t[]){true, true, true},
|
|
|
|
.op_flags = XTENSA_OP_STORE,
|
|
|
|
.coprocessor = 0x1,
|
|
|
|
}, {
|
2020-03-14 21:13:53 +03:00
|
|
|
.name = "sqrt0.d",
|
|
|
|
.translate = translate_nop,
|
|
|
|
.coprocessor = 0x1,
|
|
|
|
}, {
|
|
|
|
.name = "sqrt0.s",
|
|
|
|
.translate = translate_nop,
|
|
|
|
.coprocessor = 0x1,
|
|
|
|
}, {
|
2020-07-01 05:27:02 +03:00
|
|
|
.name = "ssi",
|
|
|
|
.translate = translate_ldsti_s,
|
|
|
|
.par = (const uint32_t[]){true, true, false},
|
|
|
|
.op_flags = XTENSA_OP_STORE,
|
|
|
|
.coprocessor = 0x1,
|
|
|
|
}, {
|
|
|
|
.name = "ssip",
|
|
|
|
.translate = translate_ldsti_s,
|
|
|
|
.par = (const uint32_t[]){true, false, true},
|
|
|
|
.op_flags = XTENSA_OP_STORE,
|
|
|
|
.coprocessor = 0x1,
|
|
|
|
}, {
|
|
|
|
.name = "ssiu",
|
|
|
|
.translate = translate_ldsti_s,
|
|
|
|
.par = (const uint32_t[]){true, true, true},
|
|
|
|
.op_flags = XTENSA_OP_STORE,
|
|
|
|
.coprocessor = 0x1,
|
|
|
|
}, {
|
|
|
|
.name = "ssx",
|
|
|
|
.translate = translate_ldstx_s,
|
|
|
|
.par = (const uint32_t[]){true, true, false},
|
|
|
|
.op_flags = XTENSA_OP_STORE,
|
|
|
|
.coprocessor = 0x1,
|
|
|
|
}, {
|
|
|
|
.name = "ssxp",
|
|
|
|
.translate = translate_ldstx_s,
|
|
|
|
.par = (const uint32_t[]){true, false, true},
|
|
|
|
.op_flags = XTENSA_OP_STORE,
|
|
|
|
.coprocessor = 0x1,
|
|
|
|
}, {
|
|
|
|
.name = "ssxu",
|
|
|
|
.translate = translate_ldstx_s,
|
|
|
|
.par = (const uint32_t[]){true, true, true},
|
|
|
|
.op_flags = XTENSA_OP_STORE,
|
|
|
|
.coprocessor = 0x1,
|
|
|
|
}, {
|
|
|
|
.name = "sub.d",
|
|
|
|
.translate = translate_sub_d,
|
|
|
|
.coprocessor = 0x1,
|
|
|
|
}, {
|
|
|
|
.name = "sub.s",
|
|
|
|
.translate = translate_sub_s,
|
|
|
|
.coprocessor = 0x1,
|
|
|
|
}, {
|
|
|
|
.name = "trunc.d",
|
|
|
|
.translate = translate_ftoi_d,
|
|
|
|
.par = (const uint32_t[]){float_round_to_zero, false},
|
|
|
|
.coprocessor = 0x1,
|
|
|
|
}, {
|
|
|
|
.name = "trunc.s",
|
|
|
|
.translate = translate_ftoi_s,
|
|
|
|
.par = (const uint32_t[]){float_round_to_zero, false},
|
|
|
|
.coprocessor = 0x1,
|
|
|
|
}, {
|
|
|
|
.name = "ueq.d",
|
|
|
|
.translate = translate_compare_d,
|
|
|
|
.par = (const uint32_t[]){COMPARE_UEQ},
|
|
|
|
.coprocessor = 0x1,
|
|
|
|
}, {
|
|
|
|
.name = "ueq.s",
|
|
|
|
.translate = translate_compare_s,
|
|
|
|
.par = (const uint32_t[]){COMPARE_UEQ},
|
|
|
|
.coprocessor = 0x1,
|
|
|
|
}, {
|
|
|
|
.name = "ufloat.d",
|
|
|
|
.translate = translate_float_d,
|
|
|
|
.par = (const uint32_t[]){true},
|
|
|
|
.coprocessor = 0x1,
|
|
|
|
}, {
|
|
|
|
.name = "ufloat.s",
|
|
|
|
.translate = translate_float_s,
|
|
|
|
.par = (const uint32_t[]){true},
|
|
|
|
.coprocessor = 0x1,
|
|
|
|
}, {
|
|
|
|
.name = "ule.d",
|
|
|
|
.translate = translate_compare_d,
|
|
|
|
.par = (const uint32_t[]){COMPARE_ULE},
|
|
|
|
.coprocessor = 0x1,
|
|
|
|
}, {
|
|
|
|
.name = "ule.s",
|
|
|
|
.translate = translate_compare_s,
|
|
|
|
.par = (const uint32_t[]){COMPARE_ULE},
|
|
|
|
.coprocessor = 0x1,
|
|
|
|
}, {
|
|
|
|
.name = "ult.d",
|
|
|
|
.translate = translate_compare_d,
|
|
|
|
.par = (const uint32_t[]){COMPARE_ULT},
|
|
|
|
.coprocessor = 0x1,
|
|
|
|
}, {
|
|
|
|
.name = "ult.s",
|
|
|
|
.translate = translate_compare_s,
|
|
|
|
.par = (const uint32_t[]){COMPARE_ULT},
|
|
|
|
.coprocessor = 0x1,
|
|
|
|
}, {
|
|
|
|
.name = "un.d",
|
|
|
|
.translate = translate_compare_d,
|
|
|
|
.par = (const uint32_t[]){COMPARE_UN},
|
|
|
|
.coprocessor = 0x1,
|
|
|
|
}, {
|
|
|
|
.name = "un.s",
|
|
|
|
.translate = translate_compare_s,
|
|
|
|
.par = (const uint32_t[]){COMPARE_UN},
|
|
|
|
.coprocessor = 0x1,
|
|
|
|
}, {
|
|
|
|
.name = "utrunc.d",
|
|
|
|
.translate = translate_ftoi_d,
|
|
|
|
.par = (const uint32_t[]){float_round_to_zero, true},
|
|
|
|
.coprocessor = 0x1,
|
|
|
|
}, {
|
|
|
|
.name = "utrunc.s",
|
|
|
|
.translate = translate_ftoi_s,
|
|
|
|
.par = (const uint32_t[]){float_round_to_zero, true},
|
|
|
|
.coprocessor = 0x1,
|
|
|
|
}, {
|
|
|
|
.name = "wfr",
|
|
|
|
.translate = translate_wfr_s,
|
|
|
|
.coprocessor = 0x1,
|
|
|
|
}, {
|
|
|
|
.name = "wfrd",
|
|
|
|
.translate = translate_wfr_d,
|
|
|
|
.coprocessor = 0x1,
|
|
|
|
}, {
|
|
|
|
.name = "wur.fcr",
|
|
|
|
.translate = translate_wur_fpu_fcr,
|
|
|
|
.par = (const uint32_t[]){FCR},
|
|
|
|
.coprocessor = 0x1,
|
|
|
|
}, {
|
|
|
|
.name = "wur.fsr",
|
|
|
|
.translate = translate_wur_fpu_fsr,
|
|
|
|
.coprocessor = 0x1,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
const XtensaOpcodeTranslators xtensa_fpu_opcodes = {
|
|
|
|
.num_opcodes = ARRAY_SIZE(fpu_ops),
|
|
|
|
.opcode = fpu_ops,
|
|
|
|
};
|