| /* Xtensa configuration-specific ISA information. |
| Copyright 2003, 2004, 2005 Free Software Foundation, Inc. |
| |
| This file is part of BFD, the Binary File Descriptor library. |
| |
| This program is free software; you can redistribute it and/or |
| modify it under the terms of the GNU General Public License as |
| published by the Free Software Foundation; either version 2 of the |
| License, or (at your option) any later version. |
| |
| This program is distributed in the hope that it will be useful, |
| but WITHOUT ANY WARRANTY; without even the implied warranty of |
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| General Public License for more details. |
| |
| You should have received a copy of the GNU General Public License |
| along with this program; if not, write to the Free Software |
| Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA |
| 02110-1301, USA. */ |
| |
| #include "qemu/osdep.h" |
| #include "xtensa-isa.h" |
| #include "xtensa-isa-internal.h" |
| |
| |
| /* Sysregs. */ |
| |
| static xtensa_sysreg_internal sysregs[] = { |
| { "LBEG", 0, 0 }, |
| { "LEND", 1, 0 }, |
| { "LCOUNT", 2, 0 }, |
| { "PTEVADDR", 83, 0 }, |
| { "DDR", 104, 0 }, |
| { "176", 176, 0 }, |
| { "208", 208, 0 }, |
| { "INTERRUPT", 226, 0 }, |
| { "INTCLEAR", 227, 0 }, |
| { "CCOUNT", 234, 0 }, |
| { "PRID", 235, 0 }, |
| { "ICOUNT", 236, 0 }, |
| { "CCOMPARE0", 240, 0 }, |
| { "CCOMPARE1", 241, 0 }, |
| { "CCOMPARE2", 242, 0 }, |
| { "EPC1", 177, 0 }, |
| { "EPC2", 178, 0 }, |
| { "EPC3", 179, 0 }, |
| { "EPC4", 180, 0 }, |
| { "EXCSAVE1", 209, 0 }, |
| { "EXCSAVE2", 210, 0 }, |
| { "EXCSAVE3", 211, 0 }, |
| { "EXCSAVE4", 212, 0 }, |
| { "EPS2", 194, 0 }, |
| { "EPS3", 195, 0 }, |
| { "EPS4", 196, 0 }, |
| { "EXCCAUSE", 232, 0 }, |
| { "DEPC", 192, 0 }, |
| { "EXCVADDR", 238, 0 }, |
| { "WINDOWBASE", 72, 0 }, |
| { "WINDOWSTART", 73, 0 }, |
| { "SAR", 3, 0 }, |
| { "LITBASE", 5, 0 }, |
| { "PS", 230, 0 }, |
| { "MISC0", 244, 0 }, |
| { "MISC1", 245, 0 }, |
| { "INTENABLE", 228, 0 }, |
| { "DBREAKA0", 144, 0 }, |
| { "DBREAKC0", 160, 0 }, |
| { "DBREAKA1", 145, 0 }, |
| { "DBREAKC1", 161, 0 }, |
| { "IBREAKA0", 128, 0 }, |
| { "IBREAKA1", 129, 0 }, |
| { "IBREAKENABLE", 96, 0 }, |
| { "ICOUNTLEVEL", 237, 0 }, |
| { "DEBUGCAUSE", 233, 0 }, |
| { "RASID", 90, 0 }, |
| { "ITLBCFG", 91, 0 }, |
| { "DTLBCFG", 92, 0 } |
| }; |
| |
| #define NUM_SYSREGS 49 |
| #define MAX_SPECIAL_REG 245 |
| #define MAX_USER_REG 0 |
| |
| |
| /* Processor states. */ |
| |
| static xtensa_state_internal states[] = { |
| { "LCOUNT", 32, 0 }, |
| { "PC", 32, 0 }, |
| { "ICOUNT", 32, 0 }, |
| { "DDR", 32, 0 }, |
| { "INTERRUPT", 17, 0 }, |
| { "CCOUNT", 32, 0 }, |
| { "XTSYNC", 1, 0 }, |
| { "EPC1", 32, 0 }, |
| { "EPC2", 32, 0 }, |
| { "EPC3", 32, 0 }, |
| { "EPC4", 32, 0 }, |
| { "EXCSAVE1", 32, 0 }, |
| { "EXCSAVE2", 32, 0 }, |
| { "EXCSAVE3", 32, 0 }, |
| { "EXCSAVE4", 32, 0 }, |
| { "EPS2", 15, 0 }, |
| { "EPS3", 15, 0 }, |
| { "EPS4", 15, 0 }, |
| { "EXCCAUSE", 6, 0 }, |
| { "PSINTLEVEL", 4, 0 }, |
| { "PSUM", 1, 0 }, |
| { "PSWOE", 1, 0 }, |
| { "PSRING", 2, 0 }, |
| { "PSEXCM", 1, 0 }, |
| { "DEPC", 32, 0 }, |
| { "EXCVADDR", 32, 0 }, |
| { "WindowBase", 4, 0 }, |
| { "WindowStart", 16, 0 }, |
| { "PSCALLINC", 2, 0 }, |
| { "PSOWB", 4, 0 }, |
| { "LBEG", 32, 0 }, |
| { "LEND", 32, 0 }, |
| { "SAR", 6, 0 }, |
| { "LITBADDR", 20, 0 }, |
| { "LITBEN", 1, 0 }, |
| { "MISC0", 32, 0 }, |
| { "MISC1", 32, 0 }, |
| { "InOCDMode", 1, 0 }, |
| { "INTENABLE", 17, 0 }, |
| { "DBREAKA0", 32, 0 }, |
| { "DBREAKC0", 8, 0 }, |
| { "DBREAKA1", 32, 0 }, |
| { "DBREAKC1", 8, 0 }, |
| { "IBREAKA0", 32, 0 }, |
| { "IBREAKA1", 32, 0 }, |
| { "IBREAKENABLE", 2, 0 }, |
| { "ICOUNTLEVEL", 4, 0 }, |
| { "DEBUGCAUSE", 6, 0 }, |
| { "DBNUM", 4, 0 }, |
| { "CCOMPARE0", 32, 0 }, |
| { "CCOMPARE1", 32, 0 }, |
| { "CCOMPARE2", 32, 0 }, |
| { "ASID3", 8, 0 }, |
| { "ASID2", 8, 0 }, |
| { "ASID1", 8, 0 }, |
| { "INSTPGSZID4", 2, 0 }, |
| { "DATAPGSZID4", 2, 0 }, |
| { "PTBASE", 10, 0 } |
| }; |
| |
| #define NUM_STATES 58 |
| |
| /* Macros for xtensa_state numbers (for use in iclasses because the |
| state numbers are not available when the iclass table is generated). */ |
| |
| #define STATE_LCOUNT 0 |
| #define STATE_PC 1 |
| #define STATE_ICOUNT 2 |
| #define STATE_DDR 3 |
| #define STATE_INTERRUPT 4 |
| #define STATE_CCOUNT 5 |
| #define STATE_XTSYNC 6 |
| #define STATE_EPC1 7 |
| #define STATE_EPC2 8 |
| #define STATE_EPC3 9 |
| #define STATE_EPC4 10 |
| #define STATE_EXCSAVE1 11 |
| #define STATE_EXCSAVE2 12 |
| #define STATE_EXCSAVE3 13 |
| #define STATE_EXCSAVE4 14 |
| #define STATE_EPS2 15 |
| #define STATE_EPS3 16 |
| #define STATE_EPS4 17 |
| #define STATE_EXCCAUSE 18 |
| #define STATE_PSINTLEVEL 19 |
| #define STATE_PSUM 20 |
| #define STATE_PSWOE 21 |
| #define STATE_PSRING 22 |
| #define STATE_PSEXCM 23 |
| #define STATE_DEPC 24 |
| #define STATE_EXCVADDR 25 |
| #define STATE_WindowBase 26 |
| #define STATE_WindowStart 27 |
| #define STATE_PSCALLINC 28 |
| #define STATE_PSOWB 29 |
| #define STATE_LBEG 30 |
| #define STATE_LEND 31 |
| #define STATE_SAR 32 |
| #define STATE_LITBADDR 33 |
| #define STATE_LITBEN 34 |
| #define STATE_MISC0 35 |
| #define STATE_MISC1 36 |
| #define STATE_InOCDMode 37 |
| #define STATE_INTENABLE 38 |
| #define STATE_DBREAKA0 39 |
| #define STATE_DBREAKC0 40 |
| #define STATE_DBREAKA1 41 |
| #define STATE_DBREAKC1 42 |
| #define STATE_IBREAKA0 43 |
| #define STATE_IBREAKA1 44 |
| #define STATE_IBREAKENABLE 45 |
| #define STATE_ICOUNTLEVEL 46 |
| #define STATE_DEBUGCAUSE 47 |
| #define STATE_DBNUM 48 |
| #define STATE_CCOMPARE0 49 |
| #define STATE_CCOMPARE1 50 |
| #define STATE_CCOMPARE2 51 |
| #define STATE_ASID3 52 |
| #define STATE_ASID2 53 |
| #define STATE_ASID1 54 |
| #define STATE_INSTPGSZID4 55 |
| #define STATE_DATAPGSZID4 56 |
| #define STATE_PTBASE 57 |
| |
| |
| /* Field definitions. */ |
| |
| static unsigned |
| Field_t_Slot_inst_get (const xtensa_insnbuf insn) |
| { |
| unsigned tie_t = 0; |
| tie_t = (tie_t << 4) | ((insn[0] << 12) >> 28); |
| return tie_t; |
| } |
| |
| static void |
| Field_t_Slot_inst_set (xtensa_insnbuf insn, uint32 val) |
| { |
| uint32 tie_t; |
| tie_t = (val << 28) >> 28; |
| insn[0] = (insn[0] & ~0xf0000) | (tie_t << 16); |
| } |
| |
| static unsigned |
| Field_s_Slot_inst_get (const xtensa_insnbuf insn) |
| { |
| unsigned tie_t = 0; |
| tie_t = (tie_t << 4) | ((insn[0] << 16) >> 28); |
| return tie_t; |
| } |
| |
| static void |
| Field_s_Slot_inst_set (xtensa_insnbuf insn, uint32 val) |
| { |
| uint32 tie_t; |
| tie_t = (val << 28) >> 28; |
| insn[0] = (insn[0] & ~0xf000) | (tie_t << 12); |
| } |
| |
| static unsigned |
| Field_r_Slot_inst_get (const xtensa_insnbuf insn) |
| { |
| unsigned tie_t = 0; |
| tie_t = (tie_t << 4) | ((insn[0] << 20) >> 28); |
| return tie_t; |
| } |
| |
| static void |
| Field_r_Slot_inst_set (xtensa_insnbuf insn, uint32 val) |
| { |
| uint32 tie_t; |
| tie_t = (val << 28) >> 28; |
| insn[0] = (insn[0] & ~0xf00) | (tie_t << 8); |
| } |
| |
| static unsigned |
| Field_op2_Slot_inst_get (const xtensa_insnbuf insn) |
| { |
| unsigned tie_t = 0; |
| tie_t = (tie_t << 4) | ((insn[0] << 28) >> 28); |
| return tie_t; |
| } |
| |
| static void |
| Field_op2_Slot_inst_set (xtensa_insnbuf insn, uint32 val) |
| { |
| uint32 tie_t; |
| tie_t = (val << 28) >> 28; |
| insn[0] = (insn[0] & ~0xf) | (tie_t << 0); |
| } |
| |
| static unsigned |
| Field_op1_Slot_inst_get (const xtensa_insnbuf insn) |
| { |
| unsigned tie_t = 0; |
| tie_t = (tie_t << 4) | ((insn[0] << 24) >> 28); |
| return tie_t; |
| } |
| |
| static void |
| Field_op1_Slot_inst_set (xtensa_insnbuf insn, uint32 val) |
| { |
| uint32 tie_t; |
| tie_t = (val << 28) >> 28; |
| insn[0] = (insn[0] & ~0xf0) | (tie_t << 4); |
| } |
| |
| static unsigned |
| Field_op0_Slot_inst_get (const xtensa_insnbuf insn) |
| { |
| unsigned tie_t = 0; |
| tie_t = (tie_t << 4) | ((insn[0] << 8) >> 28); |
| return tie_t; |
| } |
| |
| static void |
| Field_op0_Slot_inst_set (xtensa_insnbuf insn, uint32 val) |
| { |
| uint32 tie_t; |
| tie_t = (val << 28) >> 28; |
| insn[0] = (insn[0] & ~0xf00000) | (tie_t << 20); |
| } |
| |
| static unsigned |
| Field_n_Slot_inst_get (const xtensa_insnbuf insn) |
| { |
| unsigned tie_t = 0; |
| tie_t = (tie_t << 2) | ((insn[0] << 12) >> 30); |
| return tie_t; |
| } |
| |
| static void |
| Field_n_Slot_inst_set (xtensa_insnbuf insn, uint32 val) |
| { |
| uint32 tie_t; |
| tie_t = (val << 30) >> 30; |
| insn[0] = (insn[0] & ~0xc0000) | (tie_t << 18); |
| } |
| |
| static unsigned |
| Field_m_Slot_inst_get (const xtensa_insnbuf insn) |
| { |
| unsigned tie_t = 0; |
| tie_t = (tie_t << 2) | ((insn[0] << 14) >> 30); |
| return tie_t; |
| } |
| |
| static void |
| Field_m_Slot_inst_set (xtensa_insnbuf insn, uint32 val) |
| { |
| uint32 tie_t; |
| tie_t = (val << 30) >> 30; |
| insn[0] = (insn[0] & ~0x30000) | (tie_t << 16); |
| } |
| |
| static unsigned |
| Field_sr_Slot_inst_get (const xtensa_insnbuf insn) |
| { |
| unsigned tie_t = 0; |
| tie_t = (tie_t << 4) | ((insn[0] << 16) >> 28); |
| tie_t = (tie_t << 4) | ((insn[0] << 20) >> 28); |
| return tie_t; |
| } |
| |
| static void |
| Field_sr_Slot_inst_set (xtensa_insnbuf insn, uint32 val) |
| { |
| uint32 tie_t; |
| tie_t = (val << 28) >> 28; |
| insn[0] = (insn[0] & ~0xf00) | (tie_t << 8); |
| tie_t = (val << 24) >> 28; |
| insn[0] = (insn[0] & ~0xf000) | (tie_t << 12); |
| } |
| |
| static unsigned |
| Field_thi3_Slot_inst_get (const xtensa_insnbuf insn) |
| { |
| unsigned tie_t = 0; |
| tie_t = (tie_t << 3) | ((insn[0] << 12) >> 29); |
| return tie_t; |
| } |
| |
| static void |
| Field_thi3_Slot_inst_set (xtensa_insnbuf insn, uint32 val) |
| { |
| uint32 tie_t; |
| tie_t = (val << 29) >> 29; |
| insn[0] = (insn[0] & ~0xe0000) | (tie_t << 17); |
| } |
| |
| static unsigned |
| Field_op0_Slot_inst16a_get (const xtensa_insnbuf insn) |
| { |
| unsigned tie_t = 0; |
| tie_t = (tie_t << 4) | ((insn[0] << 16) >> 28); |
| return tie_t; |
| } |
| |
| static void |
| Field_op0_Slot_inst16a_set (xtensa_insnbuf insn, uint32 val) |
| { |
| uint32 tie_t; |
| tie_t = (val << 28) >> 28; |
| insn[0] = (insn[0] & ~0xf000) | (tie_t << 12); |
| } |
| |
| static unsigned |
| Field_t_Slot_inst16b_get (const xtensa_insnbuf insn) |
| { |
| unsigned tie_t = 0; |
| tie_t = (tie_t << 4) | ((insn[0] << 20) >> 28); |
| return tie_t; |
| } |
| |
| static void |
| Field_t_Slot_inst16b_set (xtensa_insnbuf insn, uint32 val) |
| { |
| uint32 tie_t; |
| tie_t = (val << 28) >> 28; |
| insn[0] = (insn[0] & ~0xf00) | (tie_t << 8); |
| } |
| |
| static unsigned |
| Field_r_Slot_inst16b_get (const xtensa_insnbuf insn) |
| { |
| unsigned tie_t = 0; |
| tie_t = (tie_t << 4) | ((insn[0] << 28) >> 28); |
| return tie_t; |
| } |
| |
| static void |
| Field_r_Slot_inst16b_set (xtensa_insnbuf insn, uint32 val) |
| { |
| uint32 tie_t; |
| tie_t = (val << 28) >> 28; |
| insn[0] = (insn[0] & ~0xf) | (tie_t << 0); |
| } |
| |
| static unsigned |
| Field_op0_Slot_inst16b_get (const xtensa_insnbuf insn) |
| { |
| unsigned tie_t = 0; |
| tie_t = (tie_t << 4) | ((insn[0] << 16) >> 28); |
| return tie_t; |
| } |
| |
| static void |
| Field_op0_Slot_inst16b_set (xtensa_insnbuf insn, uint32 val) |
| { |
| uint32 tie_t; |
| tie_t = (val << 28) >> 28; |
| insn[0] = (insn[0] & ~0xf000) | (tie_t << 12); |
| } |
| |
| static unsigned |
| Field_z_Slot_inst16b_get (const xtensa_insnbuf insn) |
| { |
| unsigned tie_t = 0; |
| tie_t = (tie_t << 1) | ((insn[0] << 21) >> 31); |
| return tie_t; |
| } |
| |
| static void |
| Field_z_Slot_inst16b_set (xtensa_insnbuf insn, uint32 val) |
| { |
| uint32 tie_t; |
| tie_t = (val << 31) >> 31; |
| insn[0] = (insn[0] & ~0x400) | (tie_t << 10); |
| } |
| |
| static unsigned |
| Field_i_Slot_inst16b_get (const xtensa_insnbuf insn) |
| { |
| unsigned tie_t = 0; |
| tie_t = (tie_t << 1) | ((insn[0] << 20) >> 31); |
| return tie_t; |
| } |
| |
| static void |
| Field_i_Slot_inst16b_set (xtensa_insnbuf insn, uint32 val) |
| { |
| uint32 tie_t; |
| tie_t = (val << 31) >> 31; |
| insn[0] = (insn[0] & ~0x800) | (tie_t << 11); |
| } |
| |
| static unsigned |
| Field_s_Slot_inst16b_get (const xtensa_insnbuf insn) |
| { |
| unsigned tie_t = 0; |
| tie_t = (tie_t << 4) | ((insn[0] << 24) >> 28); |
| return tie_t; |
| } |
| |
| static void |
| Field_s_Slot_inst16b_set (xtensa_insnbuf insn, uint32 val) |
| { |
| uint32 tie_t; |
| tie_t = (val << 28) >> 28; |
| insn[0] = (insn[0] & ~0xf0) | (tie_t << 4); |
| } |
| |
| static unsigned |
| Field_t_Slot_inst16a_get (const xtensa_insnbuf insn) |
| { |
| unsigned tie_t = 0; |
| tie_t = (tie_t << 4) | ((insn[0] << 20) >> 28); |
| return tie_t; |
| } |
| |
| static void |
| Field_t_Slot_inst16a_set (xtensa_insnbuf insn, uint32 val) |
| { |
| uint32 tie_t; |
| tie_t = (val << 28) >> 28; |
| insn[0] = (insn[0] & ~0xf00) | (tie_t << 8); |
| } |
| |
| static unsigned |
| Field_bbi4_Slot_inst_get (const xtensa_insnbuf insn) |
| { |
| unsigned tie_t = 0; |
| tie_t = (tie_t << 1) | ((insn[0] << 23) >> 31); |
| return tie_t; |
| } |
| |
| static void |
| Field_bbi4_Slot_inst_set (xtensa_insnbuf insn, uint32 val) |
| { |
| uint32 tie_t; |
| tie_t = (val << 31) >> 31; |
| insn[0] = (insn[0] & ~0x100) | (tie_t << 8); |
| } |
| |
| static unsigned |
| Field_bbi_Slot_inst_get (const xtensa_insnbuf insn) |
| { |
| unsigned tie_t = 0; |
| tie_t = (tie_t << 1) | ((insn[0] << 23) >> 31); |
| tie_t = (tie_t << 4) | ((insn[0] << 12) >> 28); |
| return tie_t; |
| } |
| |
| static void |
| Field_bbi_Slot_inst_set (xtensa_insnbuf insn, uint32 val) |
| { |
| uint32 tie_t; |
| tie_t = (val << 28) >> 28; |
| insn[0] = (insn[0] & ~0xf0000) | (tie_t << 16); |
| tie_t = (val << 27) >> 31; |
| insn[0] = (insn[0] & ~0x100) | (tie_t << 8); |
| } |
| |
| static unsigned |
| Field_imm12_Slot_inst_get (const xtensa_insnbuf insn) |
| { |
| unsigned tie_t = 0; |
| tie_t = (tie_t << 12) | ((insn[0] << 20) >> 20); |
| return tie_t; |
| } |
| |
| static void |
| Field_imm12_Slot_inst_set (xtensa_insnbuf insn, uint32 val) |
| { |
| uint32 tie_t; |
| tie_t = (val << 20) >> 20; |
| insn[0] = (insn[0] & ~0xfff) | (tie_t << 0); |
| } |
| |
| static unsigned |
| Field_imm8_Slot_inst_get (const xtensa_insnbuf insn) |
| { |
| unsigned tie_t = 0; |
| tie_t = (tie_t << 8) | ((insn[0] << 24) >> 24); |
| return tie_t; |
| } |
| |
| static void |
| Field_imm8_Slot_inst_set (xtensa_insnbuf insn, uint32 val) |
| { |
| uint32 tie_t; |
| tie_t = (val << 24) >> 24; |
| insn[0] = (insn[0] & ~0xff) | (tie_t << 0); |
| } |
| |
| static unsigned |
| Field_s_Slot_inst16a_get (const xtensa_insnbuf insn) |
| { |
| unsigned tie_t = 0; |
| tie_t = (tie_t << 4) | ((insn[0] << 24) >> 28); |
| return tie_t; |
| } |
| |
| static void |
| Field_s_Slot_inst16a_set (xtensa_insnbuf insn, uint32 val) |
| { |
| uint32 tie_t; |
| tie_t = (val << 28) >> 28; |
| insn[0] = (insn[0] & ~0xf0) | (tie_t << 4); |
| } |
| |
| static unsigned |
| Field_imm12b_Slot_inst_get (const xtensa_insnbuf insn) |
| { |
| unsigned tie_t = 0; |
| tie_t = (tie_t << 4) | ((insn[0] << 16) >> 28); |
| tie_t = (tie_t << 8) | ((insn[0] << 24) >> 24); |
| return tie_t; |
| } |
| |
| static void |
| Field_imm12b_Slot_inst_set (xtensa_insnbuf insn, uint32 val) |
| { |
| uint32 tie_t; |
| tie_t = (val << 24) >> 24; |
| insn[0] = (insn[0] & ~0xff) | (tie_t << 0); |
| tie_t = (val << 20) >> 28; |
| insn[0] = (insn[0] & ~0xf000) | (tie_t << 12); |
| } |
| |
| static unsigned |
| Field_imm16_Slot_inst_get (const xtensa_insnbuf insn) |
| { |
| unsigned tie_t = 0; |
| tie_t = (tie_t << 16) | ((insn[0] << 16) >> 16); |
| return tie_t; |
| } |
| |
| static void |
| Field_imm16_Slot_inst_set (xtensa_insnbuf insn, uint32 val) |
| { |
| uint32 tie_t; |
| tie_t = (val << 16) >> 16; |
| insn[0] = (insn[0] & ~0xffff) | (tie_t << 0); |
| } |
| |
| static unsigned |
| Field_offset_Slot_inst_get (const xtensa_insnbuf insn) |
| { |
| unsigned tie_t = 0; |
| tie_t = (tie_t << 18) | ((insn[0] << 14) >> 14); |
| return tie_t; |
| } |
| |
| static void |
| Field_offset_Slot_inst_set (xtensa_insnbuf insn, uint32 val) |
| { |
| uint32 tie_t; |
| tie_t = (val << 14) >> 14; |
| insn[0] = (insn[0] & ~0x3ffff) | (tie_t << 0); |
| } |
| |
| static unsigned |
| Field_r_Slot_inst16a_get (const xtensa_insnbuf insn) |
| { |
| unsigned tie_t = 0; |
| tie_t = (tie_t << 4) | ((insn[0] << 28) >> 28); |
| return tie_t; |
| } |
| |
| static void |
| Field_r_Slot_inst16a_set (xtensa_insnbuf insn, uint32 val) |
| { |
| uint32 tie_t; |
| tie_t = (val << 28) >> 28; |
| insn[0] = (insn[0] & ~0xf) | (tie_t << 0); |
| } |
| |
| static unsigned |
| Field_sa4_Slot_inst_get (const xtensa_insnbuf insn) |
| { |
| unsigned tie_t = 0; |
| tie_t = (tie_t << 1) | ((insn[0] << 31) >> 31); |
| return tie_t; |
| } |
| |
| static void |
| Field_sa4_Slot_inst_set (xtensa_insnbuf insn, uint32 val) |
| { |
| uint32 tie_t; |
| tie_t = (val << 31) >> 31; |
| insn[0] = (insn[0] & ~0x1) | (tie_t << 0); |
| } |
| |
| static unsigned |
| Field_sae4_Slot_inst_get (const xtensa_insnbuf insn) |
| { |
| unsigned tie_t = 0; |
| tie_t = (tie_t << 1) | ((insn[0] << 27) >> 31); |
| return tie_t; |
| } |
| |
| static void |
| Field_sae4_Slot_inst_set (xtensa_insnbuf insn, uint32 val) |
| { |
| uint32 tie_t; |
| tie_t = (val << 31) >> 31; |
| insn[0] = (insn[0] & ~0x10) | (tie_t << 4); |
| } |
| |
| static unsigned |
| Field_sae_Slot_inst_get (const xtensa_insnbuf insn) |
| { |
| unsigned tie_t = 0; |
| tie_t = (tie_t << 1) | ((insn[0] << 27) >> 31); |
| tie_t = (tie_t << 4) | ((insn[0] << 16) >> 28); |
| return tie_t; |
| } |
| |
| static void |
| Field_sae_Slot_inst_set (xtensa_insnbuf insn, uint32 val) |
| { |
| uint32 tie_t; |
| tie_t = (val << 28) >> 28; |
| insn[0] = (insn[0] & ~0xf000) | (tie_t << 12); |
| tie_t = (val << 27) >> 31; |
| insn[0] = (insn[0] & ~0x10) | (tie_t << 4); |
| } |
| |
| static unsigned |
| Field_sal_Slot_inst_get (const xtensa_insnbuf insn) |
| { |
| unsigned tie_t = 0; |
| tie_t = (tie_t << 1) | ((insn[0] << 31) >> 31); |
| tie_t = (tie_t << 4) | ((insn[0] << 12) >> 28); |
| return tie_t; |
| } |
| |
| static void |
| Field_sal_Slot_inst_set (xtensa_insnbuf insn, uint32 val) |
| { |
| uint32 tie_t; |
| tie_t = (val << 28) >> 28; |
| insn[0] = (insn[0] & ~0xf0000) | (tie_t << 16); |
| tie_t = (val << 27) >> 31; |
| insn[0] = (insn[0] & ~0x1) | (tie_t << 0); |
| } |
| |
| static unsigned |
| Field_sargt_Slot_inst_get (const xtensa_insnbuf insn) |
| { |
| unsigned tie_t = 0; |
| tie_t = (tie_t << 1) | ((insn[0] << 31) >> 31); |
| tie_t = (tie_t << 4) | ((insn[0] << 16) >> 28); |
| return tie_t; |
| } |
| |
| static void |
| Field_sargt_Slot_inst_set (xtensa_insnbuf insn, uint32 val) |
| { |
| uint32 tie_t; |
| tie_t = (val << 28) >> 28; |
| insn[0] = (insn[0] & ~0xf000) | (tie_t << 12); |
| tie_t = (val << 27) >> 31; |
| insn[0] = (insn[0] & ~0x1) | (tie_t << 0); |
| } |
| |
| static unsigned |
| Field_sas4_Slot_inst_get (const xtensa_insnbuf insn) |
| { |
| unsigned tie_t = 0; |
| tie_t = (tie_t << 1) | ((insn[0] << 15) >> 31); |
| return tie_t; |
| } |
| |
| static void |
| Field_sas4_Slot_inst_set (xtensa_insnbuf insn, uint32 val) |
| { |
| uint32 tie_t; |
| tie_t = (val << 31) >> 31; |
| insn[0] = (insn[0] & ~0x10000) | (tie_t << 16); |
| } |
| |
| static unsigned |
| Field_sas_Slot_inst_get (const xtensa_insnbuf insn) |
| { |
| unsigned tie_t = 0; |
| tie_t = (tie_t << 1) | ((insn[0] << 15) >> 31); |
| tie_t = (tie_t << 4) | ((insn[0] << 16) >> 28); |
| return tie_t; |
| } |
| |
| static void |
| Field_sas_Slot_inst_set (xtensa_insnbuf insn, uint32 val) |
| { |
| uint32 tie_t; |
| tie_t = (val << 28) >> 28; |
| insn[0] = (insn[0] & ~0xf000) | (tie_t << 12); |
| tie_t = (val << 27) >> 31; |
| insn[0] = (insn[0] & ~0x10000) | (tie_t << 16); |
| } |
| |
| static unsigned |
| Field_sr_Slot_inst16a_get (const xtensa_insnbuf insn) |
| { |
| unsigned tie_t = 0; |
| tie_t = (tie_t << 4) | ((insn[0] << 24) >> 28); |
| tie_t = (tie_t << 4) | ((insn[0] << 28) >> 28); |
| return tie_t; |
| } |
| |
| static void |
| Field_sr_Slot_inst16a_set (xtensa_insnbuf insn, uint32 val) |
| { |
| uint32 tie_t; |
| tie_t = (val << 28) >> 28; |
| insn[0] = (insn[0] & ~0xf) | (tie_t << 0); |
| tie_t = (val << 24) >> 28; |
| insn[0] = (insn[0] & ~0xf0) | (tie_t << 4); |
| } |
| |
| static unsigned |
| Field_sr_Slot_inst16b_get (const xtensa_insnbuf insn) |
| { |
| unsigned tie_t = 0; |
| tie_t = (tie_t << 4) | ((insn[0] << 24) >> 28); |
| tie_t = (tie_t << 4) | ((insn[0] << 28) >> 28); |
| return tie_t; |
| } |
| |
| static void |
| Field_sr_Slot_inst16b_set (xtensa_insnbuf insn, uint32 val) |
| { |
| uint32 tie_t; |
| tie_t = (val << 28) >> 28; |
| insn[0] = (insn[0] & ~0xf) | (tie_t << 0); |
| tie_t = (val << 24) >> 28; |
| insn[0] = (insn[0] & ~0xf0) | (tie_t << 4); |
| } |
| |
| static unsigned |
| Field_st_Slot_inst_get (const xtensa_insnbuf insn) |
| { |
| unsigned tie_t = 0; |
| tie_t = (tie_t << 4) | ((insn[0] << 16) >> 28); |
| tie_t = (tie_t << 4) | ((insn[0] << 12) >> 28); |
| return tie_t; |
| } |
| |
| static void |
| Field_st_Slot_inst_set (xtensa_insnbuf insn, uint32 val) |
| { |
| uint32 tie_t; |
| tie_t = (val << 28) >> 28; |
| insn[0] = (insn[0] & ~0xf0000) | (tie_t << 16); |
| tie_t = (val << 24) >> 28; |
| insn[0] = (insn[0] & ~0xf000) | (tie_t << 12); |
| } |
| |
| static unsigned |
| Field_st_Slot_inst16a_get (const xtensa_insnbuf insn) |
| { |
| unsigned tie_t = 0; |
| tie_t = (tie_t << 4) | ((insn[0] << 24) >> 28); |
| tie_t = (tie_t << 4) | ((insn[0] << 20) >> 28); |
| return tie_t; |
| } |
| |
| static void |
| Field_st_Slot_inst16a_set (xtensa_insnbuf insn, uint32 val) |
| { |
| uint32 tie_t; |
| tie_t = (val << 28) >> 28; |
| insn[0] = (insn[0] & ~0xf00) | (tie_t << 8); |
| tie_t = (val << 24) >> 28; |
| insn[0] = (insn[0] & ~0xf0) | (tie_t << 4); |
| } |
| |
| static unsigned |
| Field_st_Slot_inst16b_get (const xtensa_insnbuf insn) |
| { |
| unsigned tie_t = 0; |
| tie_t = (tie_t << 4) | ((insn[0] << 24) >> 28); |
| tie_t = (tie_t << 4) | ((insn[0] << 20) >> 28); |
| return tie_t; |
| } |
| |
| static void |
| Field_st_Slot_inst16b_set (xtensa_insnbuf insn, uint32 val) |
| { |
| uint32 tie_t; |
| tie_t = (val << 28) >> 28; |
| insn[0] = (insn[0] & ~0xf00) | (tie_t << 8); |
| tie_t = (val << 24) >> 28; |
| insn[0] = (insn[0] & ~0xf0) | (tie_t << 4); |
| } |
| |
| static unsigned |
| Field_imm4_Slot_inst_get (const xtensa_insnbuf insn) |
| { |
| unsigned tie_t = 0; |
| tie_t = (tie_t << 4) | ((insn[0] << 20) >> 28); |
| return tie_t; |
| } |
| |
| static void |
| Field_imm4_Slot_inst_set (xtensa_insnbuf insn, uint32 val) |
| { |
| uint32 tie_t; |
| tie_t = (val << 28) >> 28; |
| insn[0] = (insn[0] & ~0xf00) | (tie_t << 8); |
| } |
| |
| static unsigned |
| Field_imm4_Slot_inst16a_get (const xtensa_insnbuf insn) |
| { |
| unsigned tie_t = 0; |
| tie_t = (tie_t << 4) | ((insn[0] << 28) >> 28); |
| return tie_t; |
| } |
| |
| static void |
| Field_imm4_Slot_inst16a_set (xtensa_insnbuf insn, uint32 val) |
| { |
| uint32 tie_t; |
| tie_t = (val << 28) >> 28; |
| insn[0] = (insn[0] & ~0xf) | (tie_t << 0); |
| } |
| |
| static unsigned |
| Field_imm4_Slot_inst16b_get (const xtensa_insnbuf insn) |
| { |
| unsigned tie_t = 0; |
| tie_t = (tie_t << 4) | ((insn[0] << 28) >> 28); |
| return tie_t; |
| } |
| |
| static void |
| Field_imm4_Slot_inst16b_set (xtensa_insnbuf insn, uint32 val) |
| { |
| uint32 tie_t; |
| tie_t = (val << 28) >> 28; |
| insn[0] = (insn[0] & ~0xf) | (tie_t << 0); |
| } |
| |
| static unsigned |
| Field_mn_Slot_inst_get (const xtensa_insnbuf insn) |
| { |
| unsigned tie_t = 0; |
| tie_t = (tie_t << 2) | ((insn[0] << 12) >> 30); |
| tie_t = (tie_t << 2) | ((insn[0] << 14) >> 30); |
| return tie_t; |
| } |
| |
| static void |
| Field_mn_Slot_inst_set (xtensa_insnbuf insn, uint32 val) |
| { |
| uint32 tie_t; |
| tie_t = (val << 30) >> 30; |
| insn[0] = (insn[0] & ~0x30000) | (tie_t << 16); |
| tie_t = (val << 28) >> 30; |
| insn[0] = (insn[0] & ~0xc0000) | (tie_t << 18); |
| } |
| |
| static unsigned |
| Field_i_Slot_inst16a_get (const xtensa_insnbuf insn) |
| { |
| unsigned tie_t = 0; |
| tie_t = (tie_t << 1) | ((insn[0] << 20) >> 31); |
| return tie_t; |
| } |
| |
| static void |
| Field_i_Slot_inst16a_set (xtensa_insnbuf insn, uint32 val) |
| { |
| uint32 tie_t; |
| tie_t = (val << 31) >> 31; |
| insn[0] = (insn[0] & ~0x800) | (tie_t << 11); |
| } |
| |
| static unsigned |
| Field_imm6lo_Slot_inst16a_get (const xtensa_insnbuf insn) |
| { |
| unsigned tie_t = 0; |
| tie_t = (tie_t << 4) | ((insn[0] << 28) >> 28); |
| return tie_t; |
| } |
| |
| static void |
| Field_imm6lo_Slot_inst16a_set (xtensa_insnbuf insn, uint32 val) |
| { |
| uint32 tie_t; |
| tie_t = (val << 28) >> 28; |
| insn[0] = (insn[0] & ~0xf) | (tie_t << 0); |
| } |
| |
| static unsigned |
| Field_imm6lo_Slot_inst16b_get (const xtensa_insnbuf insn) |
| { |
| unsigned tie_t = 0; |
| tie_t = (tie_t << 4) | ((insn[0] << 28) >> 28); |
| return tie_t; |
| } |
| |
| static void |
| Field_imm6lo_Slot_inst16b_set (xtensa_insnbuf insn, uint32 val) |
| { |
| uint32 tie_t; |
| tie_t = (val << 28) >> 28; |
| insn[0] = (insn[0] & ~0xf) | (tie_t << 0); |
| } |
| |
| static unsigned |
| Field_imm6hi_Slot_inst16a_get (const xtensa_insnbuf insn) |
| { |
| unsigned tie_t = 0; |
| tie_t = (tie_t << 2) | ((insn[0] << 22) >> 30); |
| return tie_t; |
| } |
| |
| static void |
| Field_imm6hi_Slot_inst16a_set (xtensa_insnbuf insn, uint32 val) |
| { |
| uint32 tie_t; |
| tie_t = (val << 30) >> 30; |
| insn[0] = (insn[0] & ~0x300) | (tie_t << 8); |
| } |
| |
| static unsigned |
| Field_imm6hi_Slot_inst16b_get (const xtensa_insnbuf insn) |
| { |
| unsigned tie_t = 0; |
| tie_t = (tie_t << 2) | ((insn[0] << 22) >> 30); |
| return tie_t; |
| } |
| |
| static void |
| Field_imm6hi_Slot_inst16b_set (xtensa_insnbuf insn, uint32 val) |
| { |
| uint32 tie_t; |
| tie_t = (val << 30) >> 30; |
| insn[0] = (insn[0] & ~0x300) | (tie_t << 8); |
| } |
| |
| static unsigned |
| Field_imm7lo_Slot_inst16a_get (const xtensa_insnbuf insn) |
| { |
| unsigned tie_t = 0; |
| tie_t = (tie_t << 4) | ((insn[0] << 28) >> 28); |
| return tie_t; |
| } |
| |
| static void |
| Field_imm7lo_Slot_inst16a_set (xtensa_insnbuf insn, uint32 val) |
| { |
| uint32 tie_t; |
| tie_t = (val << 28) >> 28; |
| insn[0] = (insn[0] & ~0xf) | (tie_t << 0); |
| } |
| |
| static unsigned |
| Field_imm7lo_Slot_inst16b_get (const xtensa_insnbuf insn) |
| { |
| unsigned tie_t = 0; |
| tie_t = (tie_t << 4) | ((insn[0] << 28) >> 28); |
| return tie_t; |
| } |
| |
| static void |
| Field_imm7lo_Slot_inst16b_set (xtensa_insnbuf insn, uint32 val) |
| { |
| uint32 tie_t; |
| tie_t = (val << 28) >> 28; |
| insn[0] = (insn[0] & ~0xf) | (tie_t << 0); |
| } |
| |
| static unsigned |
| Field_imm7hi_Slot_inst16a_get (const xtensa_insnbuf insn) |
| { |
| unsigned tie_t = 0; |
| tie_t = (tie_t << 3) | ((insn[0] << 21) >> 29); |
| return tie_t; |
| } |
| |
| static void |
| Field_imm7hi_Slot_inst16a_set (xtensa_insnbuf insn, uint32 val) |
| { |
| uint32 tie_t; |
| tie_t = (val << 29) >> 29; |
| insn[0] = (insn[0] & ~0x700) | (tie_t << 8); |
| } |
| |
| static unsigned |
| Field_imm7hi_Slot_inst16b_get (const xtensa_insnbuf insn) |
| { |
| unsigned tie_t = 0; |
| tie_t = (tie_t << 3) | ((insn[0] << 21) >> 29); |
| return tie_t; |
| } |
| |
| static void |
| Field_imm7hi_Slot_inst16b_set (xtensa_insnbuf insn, uint32 val) |
| { |
| uint32 tie_t; |
| tie_t = (val << 29) >> 29; |
| insn[0] = (insn[0] & ~0x700) | (tie_t << 8); |
| } |
| |
| static unsigned |
| Field_z_Slot_inst16a_get (const xtensa_insnbuf insn) |
| { |
| unsigned tie_t = 0; |
| tie_t = (tie_t << 1) | ((insn[0] << 21) >> 31); |
| return tie_t; |
| } |
| |
| static void |
| Field_z_Slot_inst16a_set (xtensa_insnbuf insn, uint32 val) |
| { |
| uint32 tie_t; |
| tie_t = (val << 31) >> 31; |
| insn[0] = (insn[0] & ~0x400) | (tie_t << 10); |
| } |
| |
| static unsigned |
| Field_imm6_Slot_inst16a_get (const xtensa_insnbuf insn) |
| { |
| unsigned tie_t = 0; |
| tie_t = (tie_t << 2) | ((insn[0] << 22) >> 30); |
| tie_t = (tie_t << 4) | ((insn[0] << 28) >> 28); |
| return tie_t; |
| } |
| |
| static void |
| Field_imm6_Slot_inst16a_set (xtensa_insnbuf insn, uint32 val) |
| { |
| uint32 tie_t; |
| tie_t = (val << 28) >> 28; |
| insn[0] = (insn[0] & ~0xf) | (tie_t << 0); |
| tie_t = (val << 26) >> 30; |
| insn[0] = (insn[0] & ~0x300) | (tie_t << 8); |
| } |
| |
| static unsigned |
| Field_imm6_Slot_inst16b_get (const xtensa_insnbuf insn) |
| { |
| unsigned tie_t = 0; |
| tie_t = (tie_t << 2) | ((insn[0] << 22) >> 30); |
| tie_t = (tie_t << 4) | ((insn[0] << 28) >> 28); |
| return tie_t; |
| } |
| |
| static void |
| Field_imm6_Slot_inst16b_set (xtensa_insnbuf insn, uint32 val) |
| { |
| uint32 tie_t; |
| tie_t = (val << 28) >> 28; |
| insn[0] = (insn[0] & ~0xf) | (tie_t << 0); |
| tie_t = (val << 26) >> 30; |
| insn[0] = (insn[0] & ~0x300) | (tie_t << 8); |
| } |
| |
| static unsigned |
| Field_imm7_Slot_inst16a_get (const xtensa_insnbuf insn) |
| { |
| unsigned tie_t = 0; |
| tie_t = (tie_t << 3) | ((insn[0] << 21) >> 29); |
| tie_t = (tie_t << 4) | ((insn[0] << 28) >> 28); |
| return tie_t; |
| } |
| |
| static void |
| Field_imm7_Slot_inst16a_set (xtensa_insnbuf insn, uint32 val) |
| { |
| uint32 tie_t; |
| tie_t = (val << 28) >> 28; |
| insn[0] = (insn[0] & ~0xf) | (tie_t << 0); |
| tie_t = (val << 25) >> 29; |
| insn[0] = (insn[0] & ~0x700) | (tie_t << 8); |
| } |
| |
| static unsigned |
| Field_imm7_Slot_inst16b_get (const xtensa_insnbuf insn) |
| { |
| unsigned tie_t = 0; |
| tie_t = (tie_t << 3) | ((insn[0] << 21) >> 29); |
| tie_t = (tie_t << 4) | ((insn[0] << 28) >> 28); |
| return tie_t; |
| } |
| |
| static void |
| Field_imm7_Slot_inst16b_set (xtensa_insnbuf insn, uint32 val) |
| { |
| uint32 tie_t; |
| tie_t = (val << 28) >> 28; |
| insn[0] = (insn[0] & ~0xf) | (tie_t << 0); |
| tie_t = (val << 25) >> 29; |
| insn[0] = (insn[0] & ~0x700) | (tie_t << 8); |
| } |
| |
| static void |
| Implicit_Field_set (xtensa_insnbuf insn ATTRIBUTE_UNUSED, |
| uint32 val ATTRIBUTE_UNUSED) |
| { |
| /* Do nothing. */ |
| } |
| |
| static unsigned |
| Implicit_Field_ar0_get (const xtensa_insnbuf insn ATTRIBUTE_UNUSED) |
| { |
| return 0; |
| } |
| |
| static unsigned |
| Implicit_Field_ar4_get (const xtensa_insnbuf insn ATTRIBUTE_UNUSED) |
| { |
| return 4; |
| } |
| |
| static unsigned |
| Implicit_Field_ar8_get (const xtensa_insnbuf insn ATTRIBUTE_UNUSED) |
| { |
| return 8; |
| } |
| |
| static unsigned |
| Implicit_Field_ar12_get (const xtensa_insnbuf insn ATTRIBUTE_UNUSED) |
| { |
| return 12; |
| } |
| |
| |
| /* Functional units. */ |
| |
| static xtensa_funcUnit_internal funcUnits[] = { |
| |
| }; |
| |
| |
| /* Register files. */ |
| |
| static xtensa_regfile_internal regfiles[] = { |
| { "AR", "a", 0, 32, 64 } |
| }; |
| |
| |
| /* Interfaces. */ |
| |
| static xtensa_interface_internal interfaces[] = { |
| |
| }; |
| |
| |
| /* Constant tables. */ |
| |
| /* constant table ai4c */ |
| static const unsigned CONST_TBL_ai4c_0[] = { |
| 0xffffffff, |
| 0x1, |
| 0x2, |
| 0x3, |
| 0x4, |
| 0x5, |
| 0x6, |
| 0x7, |
| 0x8, |
| 0x9, |
| 0xa, |
| 0xb, |
| 0xc, |
| 0xd, |
| 0xe, |
| 0xf, |
| 0 |
| }; |
| |
| /* constant table b4c */ |
| static const unsigned CONST_TBL_b4c_0[] = { |
| 0xffffffff, |
| 0x1, |
| 0x2, |
| 0x3, |
| 0x4, |
| 0x5, |
| 0x6, |
| 0x7, |
| 0x8, |
| 0xa, |
| 0xc, |
| 0x10, |
| 0x20, |
| 0x40, |
| 0x80, |
| 0x100, |
| 0 |
| }; |
| |
| /* constant table b4cu */ |
| static const unsigned CONST_TBL_b4cu_0[] = { |
| 0x8000, |
| 0x10000, |
| 0x2, |
| 0x3, |
| 0x4, |
| 0x5, |
| 0x6, |
| 0x7, |
| 0x8, |
| 0xa, |
| 0xc, |
| 0x10, |
| 0x20, |
| 0x40, |
| 0x80, |
| 0x100, |
| 0 |
| }; |
| |
| |
| /* Instruction operands. */ |
| |
| static int |
| Operand_soffsetx4_decode (uint32 *valp) |
| { |
| unsigned soffsetx4_0, offset_0; |
| offset_0 = *valp & 0x3ffff; |
| soffsetx4_0 = 0x4 + ((((int) offset_0 << 14) >> 14) << 2); |
| *valp = soffsetx4_0; |
| return 0; |
| } |
| |
| static int |
| Operand_soffsetx4_encode (uint32 *valp) |
| { |
| unsigned offset_0, soffsetx4_0; |
| soffsetx4_0 = *valp; |
| offset_0 = ((soffsetx4_0 - 0x4) >> 2) & 0x3ffff; |
| *valp = offset_0; |
| return 0; |
| } |
| |
| static int |
| Operand_soffsetx4_ator (uint32 *valp, uint32 pc) |
| { |
| *valp -= (pc & ~0x3); |
| return 0; |
| } |
| |
| static int |
| Operand_soffsetx4_rtoa (uint32 *valp, uint32 pc) |
| { |
| *valp += (pc & ~0x3); |
| return 0; |
| } |
| |
| static int |
| Operand_uimm12x8_decode (uint32 *valp) |
| { |
| unsigned uimm12x8_0, imm12_0; |
| imm12_0 = *valp & 0xfff; |
| uimm12x8_0 = imm12_0 << 3; |
| *valp = uimm12x8_0; |
| return 0; |
| } |
| |
| static int |
| Operand_uimm12x8_encode (uint32 *valp) |
| { |
| unsigned imm12_0, uimm12x8_0; |
| uimm12x8_0 = *valp; |
| imm12_0 = ((uimm12x8_0 >> 3) & 0xfff); |
| *valp = imm12_0; |
| return 0; |
| } |
| |
| static int |
| Operand_simm4_decode (uint32 *valp) |
| { |
| unsigned simm4_0, mn_0; |
| mn_0 = *valp & 0xf; |
| simm4_0 = ((int) mn_0 << 28) >> 28; |
| *valp = simm4_0; |
| return 0; |
| } |
| |
| static int |
| Operand_simm4_encode (uint32 *valp) |
| { |
| unsigned mn_0, simm4_0; |
| simm4_0 = *valp; |
| mn_0 = (simm4_0 & 0xf); |
| *valp = mn_0; |
| return 0; |
| } |
| |
| static int |
| Operand_arr_decode (uint32 *valp ATTRIBUTE_UNUSED) |
| { |
| return 0; |
| } |
| |
| static int |
| Operand_arr_encode (uint32 *valp) |
| { |
| return (*valp & ~0xf) != 0; |
| } |
| |
| static int |
| Operand_ars_decode (uint32 *valp ATTRIBUTE_UNUSED) |
| { |
| return 0; |
| } |
| |
| static int |
| Operand_ars_encode (uint32 *valp) |
| { |
| return (*valp & ~0xf) != 0; |
| } |
| |
| static int |
| Operand_art_decode (uint32 *valp ATTRIBUTE_UNUSED) |
| { |
| return 0; |
| } |
| |
| static int |
| Operand_art_encode (uint32 *valp) |
| { |
| return (*valp & ~0xf) != 0; |
| } |
| |
| static int |
| Operand_ar0_decode (uint32 *valp ATTRIBUTE_UNUSED) |
| { |
| return 0; |
| } |
| |
| static int |
| Operand_ar0_encode (uint32 *valp) |
| { |
| return (*valp & ~0x3f) != 0; |
| } |
| |
| static int |
| Operand_ar4_decode (uint32 *valp ATTRIBUTE_UNUSED) |
| { |
| return 0; |
| } |
| |
| static int |
| Operand_ar4_encode (uint32 *valp) |
| { |
| return (*valp & ~0x3f) != 0; |
| } |
| |
| static int |
| Operand_ar8_decode (uint32 *valp ATTRIBUTE_UNUSED) |
| { |
| return 0; |
| } |
| |
| static int |
| Operand_ar8_encode (uint32 *valp) |
| { |
| return (*valp & ~0x3f) != 0; |
| } |
| |
| static int |
| Operand_ar12_decode (uint32 *valp ATTRIBUTE_UNUSED) |
| { |
| return 0; |
| } |
| |
| static int |
| Operand_ar12_encode (uint32 *valp) |
| { |
| return (*valp & ~0x3f) != 0; |
| } |
| |
| static int |
| Operand_ars_entry_decode (uint32 *valp ATTRIBUTE_UNUSED) |
| { |
| return 0; |
| } |
| |
| static int |
| Operand_ars_entry_encode (uint32 *valp) |
| { |
| return (*valp & ~0x3f) != 0; |
| } |
| |
| static int |
| Operand_immrx4_decode (uint32 *valp) |
| { |
| unsigned immrx4_0, r_0; |
| r_0 = *valp & 0xf; |
| immrx4_0 = ((((0xfffffff)) << 4) | r_0) << 2; |
| *valp = immrx4_0; |
| return 0; |
| } |
| |
| static int |
| Operand_immrx4_encode (uint32 *valp) |
| { |
| unsigned r_0, immrx4_0; |
| immrx4_0 = *valp; |
| r_0 = ((immrx4_0 >> 2) & 0xf); |
| *valp = r_0; |
| return 0; |
| } |
| |
| static int |
| Operand_lsi4x4_decode (uint32 *valp) |
| { |
| unsigned lsi4x4_0, r_0; |
| r_0 = *valp & 0xf; |
| lsi4x4_0 = r_0 << 2; |
| *valp = lsi4x4_0; |
| return 0; |
| } |
| |
| static int |
| Operand_lsi4x4_encode (uint32 *valp) |
| { |
| unsigned r_0, lsi4x4_0; |
| lsi4x4_0 = *valp; |
| r_0 = ((lsi4x4_0 >> 2) & 0xf); |
| *valp = r_0; |
| return 0; |
| } |
| |
| static int |
| Operand_simm7_decode (uint32 *valp) |
| { |
| unsigned simm7_0, imm7_0; |
| imm7_0 = *valp & 0x7f; |
| simm7_0 = ((((-((((imm7_0 >> 6) & 1)) & (((imm7_0 >> 5) & 1)))) & 0x1ffffff)) << 7) | imm7_0; |
| *valp = simm7_0; |
| return 0; |
| } |
| |
| static int |
| Operand_simm7_encode (uint32 *valp) |
| { |
| unsigned imm7_0, simm7_0; |
| simm7_0 = *valp; |
| imm7_0 = (simm7_0 & 0x7f); |
| *valp = imm7_0; |
| return 0; |
| } |
| |
| static int |
| Operand_uimm6_decode (uint32 *valp) |
| { |
| unsigned uimm6_0, imm6_0; |
| imm6_0 = *valp & 0x3f; |
| uimm6_0 = 0x4 + ((((0)) << 6) | imm6_0); |
| *valp = uimm6_0; |
| return 0; |
| } |
| |
| static int |
| Operand_uimm6_encode (uint32 *valp) |
| { |
| unsigned imm6_0, uimm6_0; |
| uimm6_0 = *valp; |
| imm6_0 = (uimm6_0 - 0x4) & 0x3f; |
| *valp = imm6_0; |
| return 0; |
| } |
| |
| static int |
| Operand_uimm6_ator (uint32 *valp, uint32 pc) |
| { |
| *valp -= pc; |
| return 0; |
| } |
| |
| static int |
| Operand_uimm6_rtoa (uint32 *valp, uint32 pc) |
| { |
| *valp += pc; |
| return 0; |
| } |
| |
| static int |
| Operand_ai4const_decode (uint32 *valp) |
| { |
| unsigned ai4const_0, t_0; |
| t_0 = *valp & 0xf; |
| ai4const_0 = CONST_TBL_ai4c_0[t_0 & 0xf]; |
| *valp = ai4const_0; |
| return 0; |
| } |
| |
| static int |
| Operand_ai4const_encode (uint32 *valp) |
| { |
| unsigned t_0, ai4const_0; |
| ai4const_0 = *valp; |
| switch (ai4const_0) |
| { |
| case 0xffffffff: t_0 = 0; break; |
| case 0x1: t_0 = 0x1; break; |
| case 0x2: t_0 = 0x2; break; |
| case 0x3: t_0 = 0x3; break; |
| case 0x4: t_0 = 0x4; break; |
| case 0x5: t_0 = 0x5; break; |
| case 0x6: t_0 = 0x6; break; |
| case 0x7: t_0 = 0x7; break; |
| case 0x8: t_0 = 0x8; break; |
| case 0x9: t_0 = 0x9; break; |
| case 0xa: t_0 = 0xa; break; |
| case 0xb: t_0 = 0xb; break; |
| case 0xc: t_0 = 0xc; break; |
| case 0xd: t_0 = 0xd; break; |
| case 0xe: t_0 = 0xe; break; |
| default: t_0 = 0xf; break; |
| } |
| *valp = t_0; |
| return 0; |
| } |
| |
| static int |
| Operand_b4const_decode (uint32 *valp) |
| { |
| unsigned b4const_0, r_0; |
| r_0 = *valp & 0xf; |
| b4const_0 = CONST_TBL_b4c_0[r_0 & 0xf]; |
| *valp = b4const_0; |
| return 0; |
| } |
| |
| static int |
| Operand_b4const_encode (uint32 *valp) |
| { |
| unsigned r_0, b4const_0; |
| b4const_0 = *valp; |
| switch (b4const_0) |
| { |
| case 0xffffffff: r_0 = 0; break; |
| case 0x1: r_0 = 0x1; break; |
| case 0x2: r_0 = 0x2; break; |
| case 0x3: r_0 = 0x3; break; |
| case 0x4: r_0 = 0x4; break; |
| case 0x5: r_0 = 0x5; break; |
| case 0x6: r_0 = 0x6; break; |
| case 0x7: r_0 = 0x7; break; |
| case 0x8: r_0 = 0x8; break; |
| case 0xa: r_0 = 0x9; break; |
| case 0xc: r_0 = 0xa; break; |
| case 0x10: r_0 = 0xb; break; |
| case 0x20: r_0 = 0xc; break; |
| case 0x40: r_0 = 0xd; break; |
| case 0x80: r_0 = 0xe; break; |
| default: r_0 = 0xf; break; |
| } |
| *valp = r_0; |
| return 0; |
| } |
| |
| static int |
| Operand_b4constu_decode (uint32 *valp) |
| { |
| unsigned b4constu_0, r_0; |
| r_0 = *valp & 0xf; |
| b4constu_0 = CONST_TBL_b4cu_0[r_0 & 0xf]; |
| *valp = b4constu_0; |
| return 0; |
| } |
| |
| static int |
| Operand_b4constu_encode (uint32 *valp) |
| { |
| unsigned r_0, b4constu_0; |
| b4constu_0 = *valp; |
| switch (b4constu_0) |
| { |
| case 0x8000: r_0 = 0; break; |
| case 0x10000: r_0 = 0x1; break; |
| case 0x2: r_0 = 0x2; break; |
| case 0x3: r_0 = 0x3; break; |
| case 0x4: r_0 = 0x4; break; |
| case 0x5: r_0 = 0x5; break; |
| case 0x6: r_0 = 0x6; break; |
| case 0x7: r_0 = 0x7; break; |
| case 0x8: r_0 = 0x8; break; |
| case 0xa: r_0 = 0x9; break; |
| case 0xc: r_0 = 0xa; break; |
| case 0x10: r_0 = 0xb; break; |
| case 0x20: r_0 = 0xc; break; |
| case 0x40: r_0 = 0xd; break; |
| case 0x80: r_0 = 0xe; break; |
| default: r_0 = 0xf; break; |
| } |
| *valp = r_0; |
| return 0; |
| } |
| |
| static int |
| Operand_uimm8_decode (uint32 *valp) |
| { |
| unsigned uimm8_0, imm8_0; |
| imm8_0 = *valp & 0xff; |
| uimm8_0 = imm8_0; |
| *valp = uimm8_0; |
| return 0; |
| } |
| |
| static int |
| Operand_uimm8_encode (uint32 *valp) |
| { |
| unsigned imm8_0, uimm8_0; |
| uimm8_0 = *valp; |
| imm8_0 = (uimm8_0 & 0xff); |
| *valp = imm8_0; |
| return 0; |
| } |
| |
| static int |
| Operand_uimm8x2_decode (uint32 *valp) |
| { |
| unsigned uimm8x2_0, imm8_0; |
| imm8_0 = *valp & 0xff; |
| uimm8x2_0 = imm8_0 << 1; |
| *valp = uimm8x2_0; |
| return 0; |
| } |
| |
| static int |
| Operand_uimm8x2_encode (uint32 *valp) |
| { |
| unsigned imm8_0, uimm8x2_0; |
| uimm8x2_0 = *valp; |
| imm8_0 = ((uimm8x2_0 >> 1) & 0xff); |
| *valp = imm8_0; |
| return 0; |
| } |
| |
| static int |
| Operand_uimm8x4_decode (uint32 *valp) |
| { |
| unsigned uimm8x4_0, imm8_0; |
| imm8_0 = *valp & 0xff; |
| uimm8x4_0 = imm8_0 << 2; |
| *valp = uimm8x4_0; |
| return 0; |
| } |
| |
| static int |
| Operand_uimm8x4_encode (uint32 *valp) |
| { |
| unsigned imm8_0, uimm8x4_0; |
| uimm8x4_0 = *valp; |
| imm8_0 = ((uimm8x4_0 >> 2) & 0xff); |
| *valp = imm8_0; |
| return 0; |
| } |
| |
| static int |
| Operand_uimm4x16_decode (uint32 *valp) |
| { |
| unsigned uimm4x16_0, op2_0; |
| op2_0 = *valp & 0xf; |
| uimm4x16_0 = op2_0 << 4; |
| *valp = uimm4x16_0; |
| return 0; |
| } |
| |
| static int |
| Operand_uimm4x16_encode (uint32 *valp) |
| { |
| unsigned op2_0, uimm4x16_0; |
| uimm4x16_0 = *valp; |
| op2_0 = ((uimm4x16_0 >> 4) & 0xf); |
| *valp = op2_0; |
| return 0; |
| } |
| |
| static int |
| Operand_simm8_decode (uint32 *valp) |
| { |
| unsigned simm8_0, imm8_0; |
| imm8_0 = *valp & 0xff; |
| simm8_0 = ((int) imm8_0 << 24) >> 24; |
| *valp = simm8_0; |
| return 0; |
| } |
| |
| static int |
| Operand_simm8_encode (uint32 *valp) |
| { |
| unsigned imm8_0, simm8_0; |
| simm8_0 = *valp; |
| imm8_0 = (simm8_0 & 0xff); |
| *valp = imm8_0; |
| return 0; |
| } |
| |
| static int |
| Operand_simm8x256_decode (uint32 *valp) |
| { |
| unsigned simm8x256_0, imm8_0; |
| imm8_0 = *valp & 0xff; |
| simm8x256_0 = (((int) imm8_0 << 24) >> 24) << 8; |
| *valp = simm8x256_0; |
| return 0; |
| } |
| |
| static int |
| Operand_simm8x256_encode (uint32 *valp) |
| { |
| unsigned imm8_0, simm8x256_0; |
| simm8x256_0 = *valp; |
| imm8_0 = ((simm8x256_0 >> 8) & 0xff); |
| *valp = imm8_0; |
| return 0; |
| } |
| |
| static int |
| Operand_simm12b_decode (uint32 *valp) |
| { |
| unsigned simm12b_0, imm12b_0; |
| imm12b_0 = *valp & 0xfff; |
| simm12b_0 = ((int) imm12b_0 << 20) >> 20; |
| *valp = simm12b_0; |
| return 0; |
| } |
| |
| static int |
| Operand_simm12b_encode (uint32 *valp) |
| { |
| unsigned imm12b_0, simm12b_0; |
| simm12b_0 = *valp; |
| imm12b_0 = (simm12b_0 & 0xfff); |
| *valp = imm12b_0; |
| return 0; |
| } |
| |
| static int |
| Operand_msalp32_decode (uint32 *valp) |
| { |
| unsigned msalp32_0, sal_0; |
| sal_0 = *valp & 0x1f; |
| msalp32_0 = 0x20 - sal_0; |
| *valp = msalp32_0; |
| return 0; |
| } |
| |
| static int |
| Operand_msalp32_encode (uint32 *valp) |
| { |
| unsigned sal_0, msalp32_0; |
| msalp32_0 = *valp; |
| sal_0 = (0x20 - msalp32_0) & 0x1f; |
| *valp = sal_0; |
| return 0; |
| } |
| |
| static int |
| Operand_op2p1_decode (uint32 *valp) |
| { |
| unsigned op2p1_0, op2_0; |
| op2_0 = *valp & 0xf; |
| op2p1_0 = op2_0 + 0x1; |
| *valp = op2p1_0; |
| return 0; |
| } |
| |
| static int |
| Operand_op2p1_encode (uint32 *valp) |
| { |
| unsigned op2_0, op2p1_0; |
| op2p1_0 = *valp; |
| op2_0 = (op2p1_0 - 0x1) & 0xf; |
| *valp = op2_0; |
| return 0; |
| } |
| |
| static int |
| Operand_label8_decode (uint32 *valp) |
| { |
| unsigned label8_0, imm8_0; |
| imm8_0 = *valp & 0xff; |
| label8_0 = 0x4 + (((int) imm8_0 << 24) >> 24); |
| *valp = label8_0; |
| return 0; |
| } |
| |
| static int |
| Operand_label8_encode (uint32 *valp) |
| { |
| unsigned imm8_0, label8_0; |
| label8_0 = *valp; |
| imm8_0 = (label8_0 - 0x4) & 0xff; |
| *valp = imm8_0; |
| return 0; |
| } |
| |
| static int |
| Operand_label8_ator (uint32 *valp, uint32 pc) |
| { |
| *valp -= pc; |
| return 0; |
| } |
| |
| static int |
| Operand_label8_rtoa (uint32 *valp, uint32 pc) |
| { |
| *valp += pc; |
| return 0; |
| } |
| |
| static int |
| Operand_ulabel8_decode (uint32 *valp) |
| { |
| unsigned ulabel8_0, imm8_0; |
| imm8_0 = *valp & 0xff; |
| ulabel8_0 = 0x4 + ((((0)) << 8) | imm8_0); |
| *valp = ulabel8_0; |
| return 0; |
| } |
| |
| static int |
| Operand_ulabel8_encode (uint32 *valp) |
| { |
| unsigned imm8_0, ulabel8_0; |
| ulabel8_0 = *valp; |
| imm8_0 = (ulabel8_0 - 0x4) & 0xff; |
| *valp = imm8_0; |
| return 0; |
| } |
| |
| static int |
| Operand_ulabel8_ator (uint32 *valp, uint32 pc) |
| { |
| *valp -= pc; |
| return 0; |
| } |
| |
| static int |
| Operand_ulabel8_rtoa (uint32 *valp, uint32 pc) |
| { |
| *valp += pc; |
| return 0; |
| } |
| |
| static int |
| Operand_label12_decode (uint32 *valp) |
| { |
| unsigned label12_0, imm12_0; |
| imm12_0 = *valp & 0xfff; |
| label12_0 = 0x4 + (((int) imm12_0 << 20) >> 20); |
| *valp = label12_0; |
| return 0; |
| } |
| |
| static int |
| Operand_label12_encode (uint32 *valp) |
| { |
| unsigned imm12_0, label12_0; |
| label12_0 = *valp; |
| imm12_0 = (label12_0 - 0x4) & 0xfff; |
| *valp = imm12_0; |
| return 0; |
| } |
| |
| static int |
| Operand_label12_ator (uint32 *valp, uint32 pc) |
| { |
| *valp -= pc; |
| return 0; |
| } |
| |
| static int |
| Operand_label12_rtoa (uint32 *valp, uint32 pc) |
| { |
| *valp += pc; |
| return 0; |
| } |
| |
| static int |
| Operand_soffset_decode (uint32 *valp) |
| { |
| unsigned soffset_0, offset_0; |
| offset_0 = *valp & 0x3ffff; |
| soffset_0 = 0x4 + (((int) offset_0 << 14) >> 14); |
| *valp = soffset_0; |
| return 0; |
| } |
| |
| static int |
| Operand_soffset_encode (uint32 *valp) |
| { |
| unsigned offset_0, soffset_0; |
| soffset_0 = *valp; |
| offset_0 = (soffset_0 - 0x4) & 0x3ffff; |
| *valp = offset_0; |
| return 0; |
| } |
| |
| static int |
| Operand_soffset_ator (uint32 *valp, uint32 pc) |
| { |
| *valp -= pc; |
| return 0; |
| } |
| |
| static int |
| Operand_soffset_rtoa (uint32 *valp, uint32 pc) |
| { |
| *valp += pc; |
| return 0; |
| } |
| |
| static int |
| Operand_uimm16x4_decode (uint32 *valp) |
| { |
| unsigned uimm16x4_0, imm16_0; |
| imm16_0 = *valp & 0xffff; |
| uimm16x4_0 = ((((0xffff)) << 16) | imm16_0) << 2; |
| *valp = uimm16x4_0; |
| return 0; |
| } |
| |
| static int |
| Operand_uimm16x4_encode (uint32 *valp) |
| { |
| unsigned imm16_0, uimm16x4_0; |
| uimm16x4_0 = *valp; |
| imm16_0 = (uimm16x4_0 >> 2) & 0xffff; |
| *valp = imm16_0; |
| return 0; |
| } |
| |
| static int |
| Operand_uimm16x4_ator (uint32 *valp, uint32 pc) |
| { |
| *valp -= ((pc + 3) & ~0x3); |
| return 0; |
| } |
| |
| static int |
| Operand_uimm16x4_rtoa (uint32 *valp, uint32 pc) |
| { |
| *valp += ((pc + 3) & ~0x3); |
| return 0; |
| } |
| |
| static int |
| Operand_immt_decode (uint32 *valp) |
| { |
| unsigned immt_0, t_0; |
| t_0 = *valp & 0xf; |
| immt_0 = t_0; |
| *valp = immt_0; |
| return 0; |
| } |
| |
| static int |
| Operand_immt_encode (uint32 *valp) |
| { |
| unsigned t_0, immt_0; |
| immt_0 = *valp; |
| t_0 = immt_0 & 0xf; |
| *valp = t_0; |
| return 0; |
| } |
| |
| static int |
| Operand_imms_decode (uint32 *valp) |
| { |
| unsigned imms_0, s_0; |
| s_0 = *valp & 0xf; |
| imms_0 = s_0; |
| *valp = imms_0; |
| return 0; |
| } |
| |
| static int |
| Operand_imms_encode (uint32 *valp) |
| { |
| unsigned s_0, imms_0; |
| imms_0 = *valp; |
| s_0 = imms_0 & 0xf; |
| *valp = s_0; |
| return 0; |
| } |
| |
| static xtensa_operand_internal operands[] = { |
| { "soffsetx4", 10, -1, 0, |
| XTENSA_OPERAND_IS_PCRELATIVE, |
| Operand_soffsetx4_encode, Operand_soffsetx4_decode, |
| Operand_soffsetx4_ator, Operand_soffsetx4_rtoa }, |
| { "uimm12x8", 3, -1, 0, |
| 0, |
| Operand_uimm12x8_encode, Operand_uimm12x8_decode, |
| 0, 0 }, |
| { "simm4", 26, -1, 0, |
| 0, |
| Operand_simm4_encode, Operand_simm4_decode, |
| 0, 0 }, |
| { "arr", 14, 0, 1, |
| XTENSA_OPERAND_IS_REGISTER, |
| Operand_arr_encode, Operand_arr_decode, |
| 0, 0 }, |
| { "ars", 5, 0, 1, |
| XTENSA_OPERAND_IS_REGISTER, |
| Operand_ars_encode, Operand_ars_decode, |
| 0, 0 }, |
| { "*ars_invisible", 5, 0, 1, |
| XTENSA_OPERAND_IS_REGISTER | XTENSA_OPERAND_IS_INVISIBLE, |
| Operand_ars_encode, Operand_ars_decode, |
| 0, 0 }, |
| { "art", 0, 0, 1, |
| XTENSA_OPERAND_IS_REGISTER, |
| Operand_art_encode, Operand_art_decode, |
| 0, 0 }, |
| { "ar0", 35, 0, 1, |
| XTENSA_OPERAND_IS_REGISTER | XTENSA_OPERAND_IS_INVISIBLE, |
| Operand_ar0_encode, Operand_ar0_decode, |
| 0, 0 }, |
| { "ar4", 36, 0, 1, |
| XTENSA_OPERAND_IS_REGISTER | XTENSA_OPERAND_IS_INVISIBLE, |
| Operand_ar4_encode, Operand_ar4_decode, |
| 0, 0 }, |
| { "ar8", 37, 0, 1, |
| XTENSA_OPERAND_IS_REGISTER | XTENSA_OPERAND_IS_INVISIBLE, |
| Operand_ar8_encode, Operand_ar8_decode, |
| 0, 0 }, |
| { "ar12", 38, 0, 1, |
| XTENSA_OPERAND_IS_REGISTER | XTENSA_OPERAND_IS_INVISIBLE, |
| Operand_ar12_encode, Operand_ar12_decode, |
| 0, 0 }, |
| { "ars_entry", 5, 0, 1, |
| XTENSA_OPERAND_IS_REGISTER, |
| Operand_ars_entry_encode, Operand_ars_entry_decode, |
| 0, 0 }, |
| { "immrx4", 14, -1, 0, |
| 0, |
| Operand_immrx4_encode, Operand_immrx4_decode, |
| 0, 0 }, |
| { "lsi4x4", 14, -1, 0, |
| 0, |
| Operand_lsi4x4_encode, Operand_lsi4x4_decode, |
| 0, 0 }, |
| { "simm7", 34, -1, 0, |
| 0, |
| Operand_simm7_encode, Operand_simm7_decode, |
| 0, 0 }, |
| { "uimm6", 33, -1, 0, |
| XTENSA_OPERAND_IS_PCRELATIVE, |
| Operand_uimm6_encode, Operand_uimm6_decode, |
| Operand_uimm6_ator, Operand_uimm6_rtoa }, |
| { "ai4const", 0, -1, 0, |
| 0, |
| Operand_ai4const_encode, Operand_ai4const_decode, |
| 0, 0 }, |
| { "b4const", 14, -1, 0, |
| 0, |
| Operand_b4const_encode, Operand_b4const_decode, |
| 0, 0 }, |
| { "b4constu", 14, -1, 0, |
| 0, |
| Operand_b4constu_encode, Operand_b4constu_decode, |
| 0, 0 }, |
| { "uimm8", 4, -1, 0, |
| 0, |
| Operand_uimm8_encode, Operand_uimm8_decode, |
| 0, 0 }, |
| { "uimm8x2", 4, -1, 0, |
| 0, |
| Operand_uimm8x2_encode, Operand_uimm8x2_decode, |
| 0, 0 }, |
| { "uimm8x4", 4, -1, 0, |
| 0, |
| Operand_uimm8x4_encode, Operand_uimm8x4_decode, |
| 0, 0 }, |
| { "uimm4x16", 13, -1, 0, |
| 0, |
| Operand_uimm4x16_encode, Operand_uimm4x16_decode, |
| 0, 0 }, |
| { "simm8", 4, -1, 0, |
| 0, |
| Operand_simm8_encode, Operand_simm8_decode, |
| 0, 0 }, |
| { "simm8x256", 4, -1, 0, |
| 0, |
| Operand_simm8x256_encode, Operand_simm8x256_decode, |
| 0, 0 }, |
| { "simm12b", 6, -1, 0, |
| 0, |
| Operand_simm12b_encode, Operand_simm12b_decode, |
| 0, 0 }, |
| { "msalp32", 18, -1, 0, |
| 0, |
| Operand_msalp32_encode, Operand_msalp32_decode, |
| 0, 0 }, |
| { "op2p1", 13, -1, 0, |
| 0, |
| Operand_op2p1_encode, Operand_op2p1_decode, |
| 0, 0 }, |
| { "label8", 4, -1, 0, |
| XTENSA_OPERAND_IS_PCRELATIVE, |
| Operand_label8_encode, Operand_label8_decode, |
| Operand_label8_ator, Operand_label8_rtoa }, |
| { "ulabel8", 4, -1, 0, |
| XTENSA_OPERAND_IS_PCRELATIVE, |
| Operand_ulabel8_encode, Operand_ulabel8_decode, |
| Operand_ulabel8_ator, Operand_ulabel8_rtoa }, |
| { "label12", 3, -1, 0, |
| XTENSA_OPERAND_IS_PCRELATIVE, |
| Operand_label12_encode, Operand_label12_decode, |
| Operand_label12_ator, Operand_label12_rtoa }, |
| { "soffset", 10, -1, 0, |
| XTENSA_OPERAND_IS_PCRELATIVE, |
| Operand_soffset_encode, Operand_soffset_decode, |
| Operand_soffset_ator, Operand_soffset_rtoa }, |
| { "uimm16x4", 7, -1, 0, |
| XTENSA_OPERAND_IS_PCRELATIVE, |
| Operand_uimm16x4_encode, Operand_uimm16x4_decode, |
| Operand_uimm16x4_ator, Operand_uimm16x4_rtoa }, |
| { "immt", 0, -1, 0, |
| 0, |
| Operand_immt_encode, Operand_immt_decode, |
| 0, 0 }, |
| { "imms", 5, -1, 0, |
| 0, |
| Operand_imms_encode, Operand_imms_decode, |
| 0, 0 }, |
| { "t", 0, -1, 0, 0, 0, 0, 0, 0 }, |
| { "bbi4", 1, -1, 0, 0, 0, 0, 0, 0 }, |
| { "bbi", 2, -1, 0, 0, 0, 0, 0, 0 }, |
| { "imm12", 3, -1, 0, 0, 0, 0, 0, 0 }, |
| { "imm8", 4, -1, 0, 0, 0, 0, 0, 0 }, |
| { "s", 5, -1, 0, 0, 0, 0, 0, 0 }, |
| { "imm12b", 6, -1, 0, 0, 0, 0, 0, 0 }, |
| { "imm16", 7, -1, 0, 0, 0, 0, 0, 0 }, |
| { "m", 8, -1, 0, 0, 0, 0, 0, 0 }, |
| { "n", 9, -1, 0, 0, 0, 0, 0, 0 }, |
| { "offset", 10, -1, 0, 0, 0, 0, 0, 0 }, |
| { "op0", 11, -1, 0, 0, 0, 0, 0, 0 }, |
| { "op1", 12, -1, 0, 0, 0, 0, 0, 0 }, |
| { "op2", 13, -1, 0, 0, 0, 0, 0, 0 }, |
| { "r", 14, -1, 0, 0, 0, 0, 0, 0 }, |
| { "sa4", 15, -1, 0, 0, 0, 0, 0, 0 }, |
| { "sae4", 16, -1, 0, 0, 0, 0, 0, 0 }, |
| { "sae", 17, -1, 0, 0, 0, 0, 0, 0 }, |
| { "sal", 18, -1, 0, 0, 0, 0, 0, 0 }, |
| { "sargt", 19, -1, 0, 0, 0, 0, 0, 0 }, |
| { "sas4", 20, -1, 0, 0, 0, 0, 0, 0 }, |
| { "sas", 21, -1, 0, 0, 0, 0, 0, 0 }, |
| { "sr", 22, -1, 0, 0, 0, 0, 0, 0 }, |
| { "st", 23, -1, 0, 0, 0, 0, 0, 0 }, |
| { "thi3", 24, -1, 0, 0, 0, 0, 0, 0 }, |
| { "imm4", 25, -1, 0, 0, 0, 0, 0, 0 }, |
| { "mn", 26, -1, 0, 0, 0, 0, 0, 0 }, |
| { "i", 27, -1, 0, 0, 0, 0, 0, 0 }, |
| { "imm6lo", 28, -1, 0, 0, 0, 0, 0, 0 }, |
| { "imm6hi", 29, -1, 0, 0, 0, 0, 0, 0 }, |
| { "imm7lo", 30, -1, 0, 0, 0, 0, 0, 0 }, |
| { "imm7hi", 31, -1, 0, 0, 0, 0, 0, 0 }, |
| { "z", 32, -1, 0, 0, 0, 0, 0, 0 }, |
| { "imm6", 33, -1, 0, 0, 0, 0, 0, 0 }, |
| { "imm7", 34, -1, 0, 0, 0, 0, 0, 0 } |
| }; |
| |
| |
| /* Iclass table. */ |
| |
| static xtensa_arg_internal Iclass_xt_iclass_rfe_stateArgs[] = { |
| { { STATE_PSRING }, 'i' }, |
| { { STATE_PSEXCM }, 'm' }, |
| { { STATE_EPC1 }, 'i' } |
| }; |
| |
| static xtensa_arg_internal Iclass_xt_iclass_rfde_stateArgs[] = { |
| { { STATE_PSEXCM }, 'i' }, |
| { { STATE_PSRING }, 'i' }, |
| { { STATE_DEPC }, 'i' } |
| }; |
| |
| static xtensa_arg_internal Iclass_xt_iclass_call12_args[] = { |
| { { 0 /* soffsetx4 */ }, 'i' }, |
| { { 10 /* ar12 */ }, 'o' } |
| }; |
| |
| static xtensa_arg_internal Iclass_xt_iclass_call12_stateArgs[] = { |
| { { STATE_PSCALLINC }, 'o' } |
| }; |
| |
| static xtensa_arg_internal Iclass_xt_iclass_call8_args[] = { |
| { { 0 /* soffsetx4 */ }, 'i' }, |
| { { 9 /* ar8 */ }, 'o' } |
| }; |
| |
| static xtensa_arg_internal Iclass_xt_iclass_call8_stateArgs[] = { |
| { { STATE_PSCALLINC }, 'o' } |
| }; |
| |
| static xtensa_arg_internal Iclass_xt_iclass_call4_args[] = { |
| { { 0 /* soffsetx4 */ }, 'i' }, |
| { { 8 /* ar4 */ }, 'o' } |
| }; |
| |
| static xtensa_arg_internal Iclass_xt_iclass_call4_stateArgs[] = { |
| { { STATE_PSCALLINC }, 'o' } |
| }; |
| |
| static xtensa_arg_internal Iclass_xt_iclass_callx12_args[] = { |
| { { 4 /* ars */ }, 'i' }, |
| { { 10 /* ar12 */ }, 'o' } |
| }; |
| |
| static xtensa_arg_internal Iclass_xt_iclass_callx12_stateArgs[] = { |
| { { STATE_PSCALLINC }, 'o' } |
| }; |
| |
| static xtensa_arg_internal Iclass_xt_iclass_callx8_args[] = { |
| { { 4 /* ars */ }, 'i' }, |
| { { 9 /* ar8 */ }, 'o' } |
| }; |
| |
| static xtensa_arg_internal Iclass_xt_iclass_callx8_stateArgs[] = { |
| { { STATE_PSCALLINC }, 'o' } |
| }; |
| |
| static xtensa_arg_internal Iclass_xt_iclass_callx4_args[] = { |
| { { 4 /* ars */ }, 'i' }, |
| { { 8 /* ar4 */ }, 'o' } |
| }; |
| |
| static xtensa_arg_internal Iclass_xt_iclass_callx4_stateArgs[] = { |
| { { STATE_PSCALLINC }, 'o' } |
| }; |
| |
| static xtensa_arg_internal Iclass_xt_iclass_entry_args[] = { |
| { { 11 /* ars_entry */ }, 's' }, |
| { { 4 /* ars */ }, 'i' }, |
| { { 1 /* uimm12x8 */ }, 'i' } |
| }; |
| |
| static xtensa_arg_internal Iclass_xt_iclass_entry_stateArgs[] = { |
| { { STATE_PSCALLINC }, 'i' }, |
| { { STATE_PSEXCM }, 'i' }, |
| { { STATE_PSWOE }, 'i' }, |
| { { STATE_WindowBase }, 'm' }, |
| { { STATE_WindowStart }, 'm' } |
| }; |
| |
| static xtensa_arg_internal Iclass_xt_iclass_movsp_args[] = { |
| { { 6 /* art */ }, 'o' }, |
| { { 4 /* ars */ }, 'i' } |
| }; |
| |
| static xtensa_arg_internal Iclass_xt_iclass_movsp_stateArgs[] = { |
| { { STATE_WindowBase }, 'i' }, |
| { { STATE_WindowStart }, 'i' } |
| }; |
| |
| static xtensa_arg_internal Iclass_xt_iclass_rotw_args[] = { |
| { { 2 /* simm4 */ }, 'i' } |
| }; |
| |
| static xtensa_arg_internal Iclass_xt_iclass_rotw_stateArgs[] = { |
| { { STATE_PSEXCM }, 'i' }, |
| { { STATE_PSRING }, 'i' }, |
| { { STATE_WindowBase }, 'm' } |
| }; |
| |
| static xtensa_arg_internal Iclass_xt_iclass_retw_args[] = { |
| { { 5 /* *ars_invisible */ }, 'i' } |
| }; |
| |
| static xtensa_arg_internal Iclass_xt_iclass_retw_stateArgs[] = { |
| { { STATE_WindowBase }, 'm' }, |
| { { STATE_WindowStart }, 'm' }, |
| { { STATE_PSEXCM }, 'i' }, |
| { { STATE_PSWOE }, 'i' } |
| }; |
| |
| static xtensa_arg_internal Iclass_xt_iclass_rfwou_stateArgs[] = { |
| { { STATE_EPC1 }, 'i' }, |
| { { STATE_PSEXCM }, 'm' }, |
| { { STATE_PSRING }, 'i' }, |
| { { STATE_WindowBase }, 'm' }, |
| { { STATE_WindowStart }, 'm' }, |
| { { STATE_PSOWB }, 'i' } |
| }; |
| |
| static xtensa_arg_internal Iclass_xt_iclass_l32e_args[] = { |
| { { 6 /* art */ }, 'o' }, |
| { { 4 /* ars */ }, 'i' }, |
| { { 12 /* immrx4 */ }, 'i' } |
| }; |
| |
| static xtensa_arg_internal Iclass_xt_iclass_l32e_stateArgs[] = { |
| { { STATE_PSEXCM }, 'i' }, |
| { { STATE_PSRING }, 'i' } |
| }; |
| |
| static xtensa_arg_internal Iclass_xt_iclass_s32e_args[] = { |
| { { 6 /* art */ }, 'i' }, |
| { { 4 /* ars */ }, 'i' }, |
| { { 12 /* immrx4 */ }, 'i' } |
| }; |
| |
| static xtensa_arg_internal Iclass_xt_iclass_s32e_stateArgs[] = { |
| { { STATE_PSEXCM }, 'i' }, |
| { { STATE_PSRING }, 'i' } |
| }; |
| |
| static xtensa_arg_internal Iclass_xt_iclass_rsr_windowbase_args[] = { |
| { { 6 /* art */ }, 'o' } |
| }; |
| |
| static xtensa_arg_internal Iclass_xt_iclass_rsr_windowbase_stateArgs[] = { |
| { { STATE_PSEXCM }, 'i' }, |
| { { STATE_PSRING }, 'i' }, |
| { { STATE_WindowBase }, 'i' } |
| }; |
| |
| static xtensa_arg_internal Iclass_xt_iclass_wsr_windowbase_args[] = { |
| { { 6 /* art */ }, 'i' } |
| }; |
| |
| static xtensa_arg_internal Iclass_xt_iclass_wsr_windowbase_stateArgs[] = { |
| { { STATE_PSEXCM }, 'i' }, |
| { { STATE_PSRING }, 'i' }, |
| { { STATE_WindowBase }, 'o' } |
| }; |
| |
| static xtensa_arg_internal Iclass_xt_iclass_xsr_windowbase_args[] = { |
| { { 6 /* art */ }, 'm' } |
| }; |
| |
| static xtensa_arg_internal Iclass_xt_iclass_xsr_windowbase_stateArgs[] = { |
| { { STATE_PSEXCM }, 'i' }, |
| { { STATE_PSRING }, 'i' }, |
| { { STATE_WindowBase }, 'm' } |
| }; |
| |
| static xtensa_arg_internal Iclass_xt_iclass_rsr_windowstart_args[] = { |
| { { 6 /* art */ }, 'o' } |
| }; |
| |
| static xtensa_arg_internal Iclass_xt_iclass_rsr_windowstart_stateArgs[] = { |
| { { STATE_PSEXCM }, 'i' }, |
| { { STATE_PSRING }, 'i' }, |
| { { STATE_WindowStart }, 'i' } |
| }; |
| |
| static xtensa_arg_internal Iclass_xt_iclass_wsr_windowstart_args[] = { |
| { { 6 /* art */ }, 'i' } |
| }; |
| |
| static xtensa_arg_internal Iclass_xt_iclass_wsr_windowstart_stateArgs[] = { |
| { { STATE_PSEXCM }, 'i' }, |
| { { STATE_PSRING }, 'i' }, |
| { { STATE_WindowStart }, 'o' } |
| }; |
| |
| static xtensa_arg_internal Iclass_xt_iclass_xsr_windowstart_args[] = { |
| { { 6 /* art */ }, 'm' } |
| }; |
| |
| static xtensa_arg_internal Iclass_xt_iclass_xsr_windowstart_stateArgs[] = { |
| { { STATE_PSEXCM }, 'i' }, |
| { { STATE_PSRING }, 'i' }, |
| { { STATE_WindowStart }, 'm' } |
| }; |
| |
| static xtensa_arg_internal Iclass_xt_iclass_add_n_args[] = { |
| { { 3 /* arr */ }, 'o' }, |
| { { 4 /* ars */ }, 'i' }, |
| { { 6 /* art */ }, 'i' } |
| }; |
| |
| static xtensa_arg_internal Iclass_xt_iclass_addi_n_args[] = { |
| { { 3 /* arr */ }, 'o' }, |
| { { 4 /* ars */ }, 'i' }, |
| { { 16 /* ai4const */ }, 'i' } |
| }; |
| |
| static xtensa_arg_internal Iclass_xt_iclass_bz6_args[] = { |
| { { 4 /* ars */ }, 'i' }, |
| { { 15 /* uimm6 */ }, 'i' } |
| }; |
| |
| static xtensa_arg_internal Iclass_xt_iclass_loadi4_args[] = { |
| { { 6 /* art */ }, 'o' }, |
| { { 4 /* ars */ }, 'i' }, |
| { { 13 /* lsi4x4 */ }, 'i' } |
| }; |
| |
| static xtensa_arg_internal Iclass_xt_iclass_mov_n_args[] = { |
| { { 6 /* art */ }, 'o' }, |
| { { 4 /* ars */ }, 'i' } |
| }; |
| |
| static xtensa_arg_internal Iclass_xt_iclass_movi_n_args[] = { |
| { { 4 /* ars */ }, 'o' }, |
| { { 14 /* simm7 */ }, 'i' } |
| }; |
| |
| static xtensa_arg_internal Iclass_xt_iclass_retn_args[] = { |
| { { 5 /* *ars_invisible */ }, 'i' } |
| }; |
| |
| static xtensa_arg_internal Iclass_xt_iclass_storei4_args[] = { |
| { { 6 /* art */ }, 'i' }, |
| { { 4 /* ars */ }, 'i' }, |
| { { 13 /* lsi4x4 */ }, 'i' } |
| }; |
| |
| static xtensa_arg_internal Iclass_xt_iclass_addi_args[] = { |
| { { 6 /* art */ }, 'o' }, |
| { { 4 /* ars */ }, 'i' }, |
| { { 23 /* simm8 */ }, 'i' } |
| }; |
| |
| static xtensa_arg_internal Iclass_xt_iclass_addmi_args[] = { |
| { { 6 /* art */ }, 'o' }, |
| { { 4 /* ars */ }, 'i' }, |
| { { 24 /* simm8x256 */ }, 'i' } |
| }; |
| |
| static xtensa_arg_internal Iclass_xt_iclass_addsub_args[] = { |
| { { 3 /* arr */ }, 'o' }, |
| { { 4 /* ars */ }, 'i' }, |
| { { 6 /* art */ }, 'i' } |
| }; |
| |
| static xtensa_arg_internal Iclass_xt_iclass_bit_args[] = { |
| { { 3 /* arr */ }, 'o' }, |
| { { 4 /* ars */ }, 'i' }, |
| { { 6 /* art */ }, 'i' } |
| }; |
| |
| static xtensa_arg_internal Iclass_xt_iclass_bsi8_args[] = { |
| { { 4 /* ars */ }, 'i' }, |
| { { 17 /* b4const */ }, 'i' }, |
| { { 28 /* label8 */ }, 'i' } |
| }; |
| |
| static xtensa_arg_internal Iclass_xt_iclass_bsi8b_args[] = { |
| { { 4 /* ars */ }, 'i' }, |
| { { 37 /* bbi */ }, 'i' }, |
| { { 28 /* label8 */ }, 'i' } |
| }; |
| |
| static xtensa_arg_internal Iclass_xt_iclass_bsi8u_args[] = { |
| { { 4 /* ars */ }, 'i' }, |
| { { 18 /* b4constu */ }, 'i' }, |
| { { 28 /* label8 */ }, 'i' } |
| }; |
| |
| static xtensa_arg_internal Iclass_xt_iclass_bst8_args[] = { |
| { { 4 /* ars */ }, 'i' }, |
| { { 6 /* art */ }, 'i' }, |
| { { 28 /* label8 */ }, 'i' } |
| }; |
| |
| static xtensa_arg_internal Iclass_xt_iclass_bsz12_args[] = { |
| { { 4 /* ars */ }, 'i' }, |
| { { 30 /* label12 */ }, 'i' } |
| }; |
| |
| static xtensa_arg_internal Iclass_xt_iclass_call0_args[] = { |
| { { 0 /* soffsetx4 */ }, 'i' }, |
| { { 7 /* ar0 */ }, 'o' } |
| }; |
| |
| static xtensa_arg_internal Iclass_xt_iclass_callx0_args[] = { |
| { { 4 /* ars */ }, 'i' }, |
| { { 7 /* ar0 */ }, 'o' } |
| }; |
| |
| static xtensa_arg_internal Iclass_xt_iclass_exti_args[] = { |
| { { 3 /* arr */ }, 'o' }, |
| { { 6 /* art */ }, 'i' }, |
| { { 52 /* sae */ }, 'i' }, |
| { { 27 /* op2p1 */ }, 'i' } |
| }; |
| |
| static xtensa_arg_internal Iclass_xt_iclass_jump_args[] = { |
| { { 31 /* soffset */ }, 'i' } |
| }; |
| |
| static xtensa_arg_internal Iclass_xt_iclass_jumpx_args[] = { |
| { { 4 /* ars */ }, 'i' } |
| }; |
| |
| static xtensa_arg_internal Iclass_xt_iclass_l16ui_args[] = { |
| { { 6 /* art */ }, 'o' }, |
| { { 4 /* ars */ }, 'i' }, |
| { { 20 /* uimm8x2 */ }, 'i' } |
| }; |
| |
| static xtensa_arg_internal Iclass_xt_iclass_l16si_args[] = { |
| { { 6 /* art */ }, 'o' }, |
| { { 4 /* ars */ }, 'i' }, |
| { { 20 /* uimm8x2 */ }, 'i' } |
| }; |
| |
| static xtensa_arg_internal Iclass_xt_iclass_l32i_args[] = { |
| { { 6 /* art */ }, 'o' }, |
| { { 4 /* ars */ }, 'i' }, |
| { { 21 /* uimm8x4 */ }, 'i' } |
| }; |
| |
| static xtensa_arg_internal Iclass_xt_iclass_l32r_args[] = { |
| { { 6 /* art */ }, 'o' }, |
| { { 32 /* uimm16x4 */ }, 'i' } |
| }; |
| |
| static xtensa_arg_internal Iclass_xt_iclass_l32r_stateArgs[] = { |
| { { STATE_LITBADDR }, 'i' }, |
| { { STATE_LITBEN }, 'i' } |
| }; |
| |
| static xtensa_arg_internal Iclass_xt_iclass_l8i_args[] = { |
| { { 6 /* art */ }, 'o' }, |
| { { 4 /* ars */ }, 'i' }, |
| { { 19 /* uimm8 */ }, 'i' } |
| }; |
| |
| static xtensa_arg_internal Iclass_xt_iclass_loop_args[] = { |
| { { 4 /* ars */ }, 'i' }, |
| { { 29 /* ulabel8 */ }, 'i' } |
| }; |
| |
| static xtensa_arg_internal Iclass_xt_iclass_loop_stateArgs[] = { |
| { { STATE_LBEG }, 'o' }, |
| { { STATE_LEND }, 'o' }, |
| { { STATE_LCOUNT }, 'o' } |
| }; |
| |
| static xtensa_arg_internal Iclass_xt_iclass_loopz_args[] = { |
| { { 4 /* ars */ }, 'i' }, |
| { { 29 /* ulabel8 */ }, 'i' } |
| }; |
| |
| static xtensa_arg_internal Iclass_xt_iclass_loopz_stateArgs[] = { |
| { { STATE_LBEG }, 'o' }, |
| { { STATE_LEND }, 'o' }, |
| { { STATE_LCOUNT }, 'o' } |
| }; |
| |
| static xtensa_arg_internal Iclass_xt_iclass_movi_args[] = { |
| { { 6 /* art */ }, 'o' }, |
| { { 25 /* simm12b */ }, 'i' } |
| }; |
| |
| static xtensa_arg_internal Iclass_xt_iclass_movz_args[] = { |
| { { 3 /* arr */ }, 'm' }, |
| { { 4 /* ars */ }, 'i' }, |
| { { 6 /* art */ }, 'i' } |
| }; |
| |
| static xtensa_arg_internal Iclass_xt_iclass_neg_args[] = { |
| { { 3 /* arr */ }, 'o' }, |
| { { 6 /* art */ }, 'i' } |
| }; |
| |
| static xtensa_arg_internal Iclass_xt_iclass_return_args[] = { |
| { { 5 /* *ars_invisible */ }, 'i' } |
| }; |
| |
| static xtensa_arg_internal Iclass_xt_iclass_s16i_args[] = { |
| { { 6 /* art */ }, 'i' }, |
| { { 4 /* ars */ }, 'i' }, |
| { { 20 /* uimm8x2 */ }, 'i' } |
| }; |
| |
| static xtensa_arg_internal Iclass_xt_iclass_s32i_args[] = { |
| { { 6 /* art */ }, 'i' }, |
| { { 4 /* ars */ }, 'i' }, |
| { { 21 /* uimm8x4 */ }, 'i' } |
| }; |
| |
| static xtensa_arg_internal Iclass_xt_iclass_s8i_args[] = { |
| { { 6 /* art */ }, 'i' }, |
| { { 4 /* ars */ }, 'i' }, |
| { { 19 /* uimm8 */ }, 'i' } |
| }; |
| |
| static xtensa_arg_internal Iclass_xt_iclass_sar_args[] = { |
| { { 4 /* ars */ }, 'i' } |
| }; |
| |
| static xtensa_arg_internal Iclass_xt_iclass_sar_stateArgs[] = { |
| { { STATE_SAR }, 'o' } |
| }; |
| |
| static xtensa_arg_internal Iclass_xt_iclass_sari_args[] = { |
| { { 56 /* sas */ }, 'i' } |
| }; |
| |
| static xtensa_arg_internal Iclass_xt_iclass_sari_stateArgs[] = { |
| { { STATE_SAR }, 'o' } |
| }; |
| |
| static xtensa_arg_internal Iclass_xt_iclass_shifts_args[] = { |
| { { 3 /* arr */ }, 'o' }, |
| { { 4 /* ars */ }, 'i' } |
| }; |
|