1a5a4af3bSchristos /* Simulator instruction decoder for m32rbf. 2a5a4af3bSchristos 3a5a4af3bSchristos THIS FILE IS MACHINE GENERATED WITH CGEN. 4a5a4af3bSchristos 5*8b657b07Schristos Copyright 1996-2023 Free Software Foundation, Inc. 6a5a4af3bSchristos 7a5a4af3bSchristos This file is part of the GNU simulators. 8a5a4af3bSchristos 9a5a4af3bSchristos This file is free software; you can redistribute it and/or modify 10a5a4af3bSchristos it under the terms of the GNU General Public License as published by 11a5a4af3bSchristos the Free Software Foundation; either version 3, or (at your option) 12a5a4af3bSchristos any later version. 13a5a4af3bSchristos 14a5a4af3bSchristos It is distributed in the hope that it will be useful, but WITHOUT 15a5a4af3bSchristos ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 16a5a4af3bSchristos or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public 17a5a4af3bSchristos License for more details. 18a5a4af3bSchristos 19a5a4af3bSchristos You should have received a copy of the GNU General Public License along 20a5a4af3bSchristos with this program; if not, see <http://www.gnu.org/licenses/>. 21a5a4af3bSchristos 22a5a4af3bSchristos */ 23a5a4af3bSchristos 24a5a4af3bSchristos #define WANT_CPU m32rbf 25a5a4af3bSchristos #define WANT_CPU_M32RBF 26a5a4af3bSchristos 27a5a4af3bSchristos #include "sim-main.h" 28a5a4af3bSchristos #include "sim-assert.h" 29a5a4af3bSchristos 30a5a4af3bSchristos /* The instruction descriptor array. 31a5a4af3bSchristos This is computed at runtime. Space for it is not malloc'd to save a 32a5a4af3bSchristos teensy bit of cpu in the decoder. Moving it to malloc space is trivial 33a5a4af3bSchristos but won't be done until necessary (we don't currently support the runtime 34a5a4af3bSchristos addition of instructions nor an SMP machine with different cpus). */ 35a5a4af3bSchristos static IDESC m32rbf_insn_data[M32RBF_INSN__MAX]; 36a5a4af3bSchristos 37a5a4af3bSchristos /* Commas between elements are contained in the macros. 38a5a4af3bSchristos Some of these are conditionally compiled out. */ 39a5a4af3bSchristos 40a5a4af3bSchristos static const struct insn_sem m32rbf_insn_sem[] = 41a5a4af3bSchristos { 42a5a4af3bSchristos { VIRTUAL_INSN_X_INVALID, M32RBF_INSN_X_INVALID, M32RBF_SFMT_EMPTY }, 43a5a4af3bSchristos { VIRTUAL_INSN_X_AFTER, M32RBF_INSN_X_AFTER, M32RBF_SFMT_EMPTY }, 44a5a4af3bSchristos { VIRTUAL_INSN_X_BEFORE, M32RBF_INSN_X_BEFORE, M32RBF_SFMT_EMPTY }, 45a5a4af3bSchristos { VIRTUAL_INSN_X_CTI_CHAIN, M32RBF_INSN_X_CTI_CHAIN, M32RBF_SFMT_EMPTY }, 46a5a4af3bSchristos { VIRTUAL_INSN_X_CHAIN, M32RBF_INSN_X_CHAIN, M32RBF_SFMT_EMPTY }, 47a5a4af3bSchristos { VIRTUAL_INSN_X_BEGIN, M32RBF_INSN_X_BEGIN, M32RBF_SFMT_EMPTY }, 48a5a4af3bSchristos { M32R_INSN_ADD, M32RBF_INSN_ADD, M32RBF_SFMT_ADD }, 49a5a4af3bSchristos { M32R_INSN_ADD3, M32RBF_INSN_ADD3, M32RBF_SFMT_ADD3 }, 50a5a4af3bSchristos { M32R_INSN_AND, M32RBF_INSN_AND, M32RBF_SFMT_ADD }, 51a5a4af3bSchristos { M32R_INSN_AND3, M32RBF_INSN_AND3, M32RBF_SFMT_AND3 }, 52a5a4af3bSchristos { M32R_INSN_OR, M32RBF_INSN_OR, M32RBF_SFMT_ADD }, 53a5a4af3bSchristos { M32R_INSN_OR3, M32RBF_INSN_OR3, M32RBF_SFMT_OR3 }, 54a5a4af3bSchristos { M32R_INSN_XOR, M32RBF_INSN_XOR, M32RBF_SFMT_ADD }, 55a5a4af3bSchristos { M32R_INSN_XOR3, M32RBF_INSN_XOR3, M32RBF_SFMT_AND3 }, 56a5a4af3bSchristos { M32R_INSN_ADDI, M32RBF_INSN_ADDI, M32RBF_SFMT_ADDI }, 57a5a4af3bSchristos { M32R_INSN_ADDV, M32RBF_INSN_ADDV, M32RBF_SFMT_ADDV }, 58a5a4af3bSchristos { M32R_INSN_ADDV3, M32RBF_INSN_ADDV3, M32RBF_SFMT_ADDV3 }, 59a5a4af3bSchristos { M32R_INSN_ADDX, M32RBF_INSN_ADDX, M32RBF_SFMT_ADDX }, 60a5a4af3bSchristos { M32R_INSN_BC8, M32RBF_INSN_BC8, M32RBF_SFMT_BC8 }, 61a5a4af3bSchristos { M32R_INSN_BC24, M32RBF_INSN_BC24, M32RBF_SFMT_BC24 }, 62a5a4af3bSchristos { M32R_INSN_BEQ, M32RBF_INSN_BEQ, M32RBF_SFMT_BEQ }, 63a5a4af3bSchristos { M32R_INSN_BEQZ, M32RBF_INSN_BEQZ, M32RBF_SFMT_BEQZ }, 64a5a4af3bSchristos { M32R_INSN_BGEZ, M32RBF_INSN_BGEZ, M32RBF_SFMT_BEQZ }, 65a5a4af3bSchristos { M32R_INSN_BGTZ, M32RBF_INSN_BGTZ, M32RBF_SFMT_BEQZ }, 66a5a4af3bSchristos { M32R_INSN_BLEZ, M32RBF_INSN_BLEZ, M32RBF_SFMT_BEQZ }, 67a5a4af3bSchristos { M32R_INSN_BLTZ, M32RBF_INSN_BLTZ, M32RBF_SFMT_BEQZ }, 68a5a4af3bSchristos { M32R_INSN_BNEZ, M32RBF_INSN_BNEZ, M32RBF_SFMT_BEQZ }, 69a5a4af3bSchristos { M32R_INSN_BL8, M32RBF_INSN_BL8, M32RBF_SFMT_BL8 }, 70a5a4af3bSchristos { M32R_INSN_BL24, M32RBF_INSN_BL24, M32RBF_SFMT_BL24 }, 71a5a4af3bSchristos { M32R_INSN_BNC8, M32RBF_INSN_BNC8, M32RBF_SFMT_BC8 }, 72a5a4af3bSchristos { M32R_INSN_BNC24, M32RBF_INSN_BNC24, M32RBF_SFMT_BC24 }, 73a5a4af3bSchristos { M32R_INSN_BNE, M32RBF_INSN_BNE, M32RBF_SFMT_BEQ }, 74a5a4af3bSchristos { M32R_INSN_BRA8, M32RBF_INSN_BRA8, M32RBF_SFMT_BRA8 }, 75a5a4af3bSchristos { M32R_INSN_BRA24, M32RBF_INSN_BRA24, M32RBF_SFMT_BRA24 }, 76a5a4af3bSchristos { M32R_INSN_CMP, M32RBF_INSN_CMP, M32RBF_SFMT_CMP }, 77a5a4af3bSchristos { M32R_INSN_CMPI, M32RBF_INSN_CMPI, M32RBF_SFMT_CMPI }, 78a5a4af3bSchristos { M32R_INSN_CMPU, M32RBF_INSN_CMPU, M32RBF_SFMT_CMP }, 79a5a4af3bSchristos { M32R_INSN_CMPUI, M32RBF_INSN_CMPUI, M32RBF_SFMT_CMPI }, 80a5a4af3bSchristos { M32R_INSN_DIV, M32RBF_INSN_DIV, M32RBF_SFMT_DIV }, 81a5a4af3bSchristos { M32R_INSN_DIVU, M32RBF_INSN_DIVU, M32RBF_SFMT_DIV }, 82a5a4af3bSchristos { M32R_INSN_REM, M32RBF_INSN_REM, M32RBF_SFMT_DIV }, 83a5a4af3bSchristos { M32R_INSN_REMU, M32RBF_INSN_REMU, M32RBF_SFMT_DIV }, 84a5a4af3bSchristos { M32R_INSN_JL, M32RBF_INSN_JL, M32RBF_SFMT_JL }, 85a5a4af3bSchristos { M32R_INSN_JMP, M32RBF_INSN_JMP, M32RBF_SFMT_JMP }, 86a5a4af3bSchristos { M32R_INSN_LD, M32RBF_INSN_LD, M32RBF_SFMT_LD }, 87a5a4af3bSchristos { M32R_INSN_LD_D, M32RBF_INSN_LD_D, M32RBF_SFMT_LD_D }, 88a5a4af3bSchristos { M32R_INSN_LDB, M32RBF_INSN_LDB, M32RBF_SFMT_LDB }, 89a5a4af3bSchristos { M32R_INSN_LDB_D, M32RBF_INSN_LDB_D, M32RBF_SFMT_LDB_D }, 90a5a4af3bSchristos { M32R_INSN_LDH, M32RBF_INSN_LDH, M32RBF_SFMT_LDH }, 91a5a4af3bSchristos { M32R_INSN_LDH_D, M32RBF_INSN_LDH_D, M32RBF_SFMT_LDH_D }, 92a5a4af3bSchristos { M32R_INSN_LDUB, M32RBF_INSN_LDUB, M32RBF_SFMT_LDB }, 93a5a4af3bSchristos { M32R_INSN_LDUB_D, M32RBF_INSN_LDUB_D, M32RBF_SFMT_LDB_D }, 94a5a4af3bSchristos { M32R_INSN_LDUH, M32RBF_INSN_LDUH, M32RBF_SFMT_LDH }, 95a5a4af3bSchristos { M32R_INSN_LDUH_D, M32RBF_INSN_LDUH_D, M32RBF_SFMT_LDH_D }, 96a5a4af3bSchristos { M32R_INSN_LD_PLUS, M32RBF_INSN_LD_PLUS, M32RBF_SFMT_LD_PLUS }, 97a5a4af3bSchristos { M32R_INSN_LD24, M32RBF_INSN_LD24, M32RBF_SFMT_LD24 }, 98a5a4af3bSchristos { M32R_INSN_LDI8, M32RBF_INSN_LDI8, M32RBF_SFMT_LDI8 }, 99a5a4af3bSchristos { M32R_INSN_LDI16, M32RBF_INSN_LDI16, M32RBF_SFMT_LDI16 }, 100a5a4af3bSchristos { M32R_INSN_LOCK, M32RBF_INSN_LOCK, M32RBF_SFMT_LOCK }, 101a5a4af3bSchristos { M32R_INSN_MACHI, M32RBF_INSN_MACHI, M32RBF_SFMT_MACHI }, 102a5a4af3bSchristos { M32R_INSN_MACLO, M32RBF_INSN_MACLO, M32RBF_SFMT_MACHI }, 103a5a4af3bSchristos { M32R_INSN_MACWHI, M32RBF_INSN_MACWHI, M32RBF_SFMT_MACHI }, 104a5a4af3bSchristos { M32R_INSN_MACWLO, M32RBF_INSN_MACWLO, M32RBF_SFMT_MACHI }, 105a5a4af3bSchristos { M32R_INSN_MUL, M32RBF_INSN_MUL, M32RBF_SFMT_ADD }, 106a5a4af3bSchristos { M32R_INSN_MULHI, M32RBF_INSN_MULHI, M32RBF_SFMT_MULHI }, 107a5a4af3bSchristos { M32R_INSN_MULLO, M32RBF_INSN_MULLO, M32RBF_SFMT_MULHI }, 108a5a4af3bSchristos { M32R_INSN_MULWHI, M32RBF_INSN_MULWHI, M32RBF_SFMT_MULHI }, 109a5a4af3bSchristos { M32R_INSN_MULWLO, M32RBF_INSN_MULWLO, M32RBF_SFMT_MULHI }, 110a5a4af3bSchristos { M32R_INSN_MV, M32RBF_INSN_MV, M32RBF_SFMT_MV }, 111a5a4af3bSchristos { M32R_INSN_MVFACHI, M32RBF_INSN_MVFACHI, M32RBF_SFMT_MVFACHI }, 112a5a4af3bSchristos { M32R_INSN_MVFACLO, M32RBF_INSN_MVFACLO, M32RBF_SFMT_MVFACHI }, 113a5a4af3bSchristos { M32R_INSN_MVFACMI, M32RBF_INSN_MVFACMI, M32RBF_SFMT_MVFACHI }, 114a5a4af3bSchristos { M32R_INSN_MVFC, M32RBF_INSN_MVFC, M32RBF_SFMT_MVFC }, 115a5a4af3bSchristos { M32R_INSN_MVTACHI, M32RBF_INSN_MVTACHI, M32RBF_SFMT_MVTACHI }, 116a5a4af3bSchristos { M32R_INSN_MVTACLO, M32RBF_INSN_MVTACLO, M32RBF_SFMT_MVTACHI }, 117a5a4af3bSchristos { M32R_INSN_MVTC, M32RBF_INSN_MVTC, M32RBF_SFMT_MVTC }, 118a5a4af3bSchristos { M32R_INSN_NEG, M32RBF_INSN_NEG, M32RBF_SFMT_MV }, 119a5a4af3bSchristos { M32R_INSN_NOP, M32RBF_INSN_NOP, M32RBF_SFMT_NOP }, 120a5a4af3bSchristos { M32R_INSN_NOT, M32RBF_INSN_NOT, M32RBF_SFMT_MV }, 121a5a4af3bSchristos { M32R_INSN_RAC, M32RBF_INSN_RAC, M32RBF_SFMT_RAC }, 122a5a4af3bSchristos { M32R_INSN_RACH, M32RBF_INSN_RACH, M32RBF_SFMT_RAC }, 123a5a4af3bSchristos { M32R_INSN_RTE, M32RBF_INSN_RTE, M32RBF_SFMT_RTE }, 124a5a4af3bSchristos { M32R_INSN_SETH, M32RBF_INSN_SETH, M32RBF_SFMT_SETH }, 125a5a4af3bSchristos { M32R_INSN_SLL, M32RBF_INSN_SLL, M32RBF_SFMT_ADD }, 126a5a4af3bSchristos { M32R_INSN_SLL3, M32RBF_INSN_SLL3, M32RBF_SFMT_SLL3 }, 127a5a4af3bSchristos { M32R_INSN_SLLI, M32RBF_INSN_SLLI, M32RBF_SFMT_SLLI }, 128a5a4af3bSchristos { M32R_INSN_SRA, M32RBF_INSN_SRA, M32RBF_SFMT_ADD }, 129a5a4af3bSchristos { M32R_INSN_SRA3, M32RBF_INSN_SRA3, M32RBF_SFMT_SLL3 }, 130a5a4af3bSchristos { M32R_INSN_SRAI, M32RBF_INSN_SRAI, M32RBF_SFMT_SLLI }, 131a5a4af3bSchristos { M32R_INSN_SRL, M32RBF_INSN_SRL, M32RBF_SFMT_ADD }, 132a5a4af3bSchristos { M32R_INSN_SRL3, M32RBF_INSN_SRL3, M32RBF_SFMT_SLL3 }, 133a5a4af3bSchristos { M32R_INSN_SRLI, M32RBF_INSN_SRLI, M32RBF_SFMT_SLLI }, 134a5a4af3bSchristos { M32R_INSN_ST, M32RBF_INSN_ST, M32RBF_SFMT_ST }, 135a5a4af3bSchristos { M32R_INSN_ST_D, M32RBF_INSN_ST_D, M32RBF_SFMT_ST_D }, 136a5a4af3bSchristos { M32R_INSN_STB, M32RBF_INSN_STB, M32RBF_SFMT_STB }, 137a5a4af3bSchristos { M32R_INSN_STB_D, M32RBF_INSN_STB_D, M32RBF_SFMT_STB_D }, 138a5a4af3bSchristos { M32R_INSN_STH, M32RBF_INSN_STH, M32RBF_SFMT_STH }, 139a5a4af3bSchristos { M32R_INSN_STH_D, M32RBF_INSN_STH_D, M32RBF_SFMT_STH_D }, 140a5a4af3bSchristos { M32R_INSN_ST_PLUS, M32RBF_INSN_ST_PLUS, M32RBF_SFMT_ST_PLUS }, 141a5a4af3bSchristos { M32R_INSN_ST_MINUS, M32RBF_INSN_ST_MINUS, M32RBF_SFMT_ST_PLUS }, 142a5a4af3bSchristos { M32R_INSN_SUB, M32RBF_INSN_SUB, M32RBF_SFMT_ADD }, 143a5a4af3bSchristos { M32R_INSN_SUBV, M32RBF_INSN_SUBV, M32RBF_SFMT_ADDV }, 144a5a4af3bSchristos { M32R_INSN_SUBX, M32RBF_INSN_SUBX, M32RBF_SFMT_ADDX }, 145a5a4af3bSchristos { M32R_INSN_TRAP, M32RBF_INSN_TRAP, M32RBF_SFMT_TRAP }, 146a5a4af3bSchristos { M32R_INSN_UNLOCK, M32RBF_INSN_UNLOCK, M32RBF_SFMT_UNLOCK }, 147a5a4af3bSchristos { M32R_INSN_CLRPSW, M32RBF_INSN_CLRPSW, M32RBF_SFMT_CLRPSW }, 148a5a4af3bSchristos { M32R_INSN_SETPSW, M32RBF_INSN_SETPSW, M32RBF_SFMT_SETPSW }, 149a5a4af3bSchristos { M32R_INSN_BSET, M32RBF_INSN_BSET, M32RBF_SFMT_BSET }, 150a5a4af3bSchristos { M32R_INSN_BCLR, M32RBF_INSN_BCLR, M32RBF_SFMT_BSET }, 151a5a4af3bSchristos { M32R_INSN_BTST, M32RBF_INSN_BTST, M32RBF_SFMT_BTST }, 152a5a4af3bSchristos }; 153a5a4af3bSchristos 154a5a4af3bSchristos static const struct insn_sem m32rbf_insn_sem_invalid = 155a5a4af3bSchristos { 156a5a4af3bSchristos VIRTUAL_INSN_X_INVALID, M32RBF_INSN_X_INVALID, M32RBF_SFMT_EMPTY 157a5a4af3bSchristos }; 158a5a4af3bSchristos 159a5a4af3bSchristos /* Initialize an IDESC from the compile-time computable parts. */ 160a5a4af3bSchristos 161a5a4af3bSchristos static INLINE void 162a5a4af3bSchristos init_idesc (SIM_CPU *cpu, IDESC *id, const struct insn_sem *t) 163a5a4af3bSchristos { 164a5a4af3bSchristos const CGEN_INSN *insn_table = CGEN_CPU_INSN_TABLE (CPU_CPU_DESC (cpu))->init_entries; 165a5a4af3bSchristos 166a5a4af3bSchristos id->num = t->index; 167a5a4af3bSchristos id->sfmt = t->sfmt; 168a5a4af3bSchristos if ((int) t->type <= 0) 169a5a4af3bSchristos id->idata = & cgen_virtual_insn_table[- (int) t->type]; 170a5a4af3bSchristos else 171a5a4af3bSchristos id->idata = & insn_table[t->type]; 172a5a4af3bSchristos id->attrs = CGEN_INSN_ATTRS (id->idata); 173a5a4af3bSchristos /* Oh my god, a magic number. */ 174a5a4af3bSchristos id->length = CGEN_INSN_BITSIZE (id->idata) / 8; 175a5a4af3bSchristos 176a5a4af3bSchristos #if WITH_PROFILE_MODEL_P 177a5a4af3bSchristos id->timing = & MODEL_TIMING (CPU_MODEL (cpu)) [t->index]; 178a5a4af3bSchristos { 179a5a4af3bSchristos SIM_DESC sd = CPU_STATE (cpu); 180a5a4af3bSchristos SIM_ASSERT (t->index == id->timing->num); 181a5a4af3bSchristos } 182a5a4af3bSchristos #endif 183a5a4af3bSchristos 184a5a4af3bSchristos /* Semantic pointers are initialized elsewhere. */ 185a5a4af3bSchristos } 186a5a4af3bSchristos 187a5a4af3bSchristos /* Initialize the instruction descriptor table. */ 188a5a4af3bSchristos 189a5a4af3bSchristos void 190a5a4af3bSchristos m32rbf_init_idesc_table (SIM_CPU *cpu) 191a5a4af3bSchristos { 192a5a4af3bSchristos IDESC *id,*tabend; 193a5a4af3bSchristos const struct insn_sem *t,*tend; 194a5a4af3bSchristos int tabsize = M32RBF_INSN__MAX; 195a5a4af3bSchristos IDESC *table = m32rbf_insn_data; 196a5a4af3bSchristos 197a5a4af3bSchristos memset (table, 0, tabsize * sizeof (IDESC)); 198a5a4af3bSchristos 199a5a4af3bSchristos /* First set all entries to the `invalid insn'. */ 200a5a4af3bSchristos t = & m32rbf_insn_sem_invalid; 201a5a4af3bSchristos for (id = table, tabend = table + tabsize; id < tabend; ++id) 202a5a4af3bSchristos init_idesc (cpu, id, t); 203a5a4af3bSchristos 204a5a4af3bSchristos /* Now fill in the values for the chosen cpu. */ 20599e23f81Schristos for (t = m32rbf_insn_sem, tend = t + ARRAY_SIZE (m32rbf_insn_sem); 206a5a4af3bSchristos t != tend; ++t) 207a5a4af3bSchristos { 208a5a4af3bSchristos init_idesc (cpu, & table[t->index], t); 209a5a4af3bSchristos } 210a5a4af3bSchristos 211a5a4af3bSchristos /* Link the IDESC table into the cpu. */ 212a5a4af3bSchristos CPU_IDESC (cpu) = table; 213a5a4af3bSchristos } 214a5a4af3bSchristos 215a5a4af3bSchristos /* Given an instruction, return a pointer to its IDESC entry. */ 216a5a4af3bSchristos 217a5a4af3bSchristos const IDESC * 218a5a4af3bSchristos m32rbf_decode (SIM_CPU *current_cpu, IADDR pc, 219a5a4af3bSchristos CGEN_INSN_WORD base_insn, CGEN_INSN_WORD entire_insn, 220a5a4af3bSchristos ARGBUF *abuf) 221a5a4af3bSchristos { 222a5a4af3bSchristos /* Result of decoder. */ 223a5a4af3bSchristos M32RBF_INSN_TYPE itype; 224a5a4af3bSchristos 225a5a4af3bSchristos { 226a5a4af3bSchristos CGEN_INSN_WORD insn = base_insn; 227a5a4af3bSchristos 228a5a4af3bSchristos { 229a5a4af3bSchristos unsigned int val = (((insn >> 8) & (15 << 4)) | ((insn >> 4) & (15 << 0))); 230a5a4af3bSchristos switch (val) 231a5a4af3bSchristos { 232a5a4af3bSchristos case 0 : itype = M32RBF_INSN_SUBV; goto extract_sfmt_addv; 233a5a4af3bSchristos case 1 : itype = M32RBF_INSN_SUBX; goto extract_sfmt_addx; 234a5a4af3bSchristos case 2 : itype = M32RBF_INSN_SUB; goto extract_sfmt_add; 235a5a4af3bSchristos case 3 : itype = M32RBF_INSN_NEG; goto extract_sfmt_mv; 236a5a4af3bSchristos case 4 : itype = M32RBF_INSN_CMP; goto extract_sfmt_cmp; 237a5a4af3bSchristos case 5 : itype = M32RBF_INSN_CMPU; goto extract_sfmt_cmp; 238a5a4af3bSchristos case 8 : itype = M32RBF_INSN_ADDV; goto extract_sfmt_addv; 239a5a4af3bSchristos case 9 : itype = M32RBF_INSN_ADDX; goto extract_sfmt_addx; 240a5a4af3bSchristos case 10 : itype = M32RBF_INSN_ADD; goto extract_sfmt_add; 241a5a4af3bSchristos case 11 : itype = M32RBF_INSN_NOT; goto extract_sfmt_mv; 242a5a4af3bSchristos case 12 : itype = M32RBF_INSN_AND; goto extract_sfmt_add; 243a5a4af3bSchristos case 13 : itype = M32RBF_INSN_XOR; goto extract_sfmt_add; 244a5a4af3bSchristos case 14 : itype = M32RBF_INSN_OR; goto extract_sfmt_add; 245a5a4af3bSchristos case 15 : 246a5a4af3bSchristos if ((entire_insn & 0xf8f0) == 0xf0) 247a5a4af3bSchristos { itype = M32RBF_INSN_BTST; goto extract_sfmt_btst; } 248a5a4af3bSchristos itype = M32RBF_INSN_X_INVALID; goto extract_sfmt_empty; 249a5a4af3bSchristos case 16 : itype = M32RBF_INSN_SRL; goto extract_sfmt_add; 250a5a4af3bSchristos case 18 : itype = M32RBF_INSN_SRA; goto extract_sfmt_add; 251a5a4af3bSchristos case 20 : itype = M32RBF_INSN_SLL; goto extract_sfmt_add; 252a5a4af3bSchristos case 22 : itype = M32RBF_INSN_MUL; goto extract_sfmt_add; 253a5a4af3bSchristos case 24 : itype = M32RBF_INSN_MV; goto extract_sfmt_mv; 254a5a4af3bSchristos case 25 : itype = M32RBF_INSN_MVFC; goto extract_sfmt_mvfc; 255a5a4af3bSchristos case 26 : itype = M32RBF_INSN_MVTC; goto extract_sfmt_mvtc; 256a5a4af3bSchristos case 28 : 257a5a4af3bSchristos { 258a5a4af3bSchristos unsigned int val = (((insn >> 8) & (1 << 0))); 259a5a4af3bSchristos switch (val) 260a5a4af3bSchristos { 261a5a4af3bSchristos case 0 : 262a5a4af3bSchristos if ((entire_insn & 0xfff0) == 0x1ec0) 263a5a4af3bSchristos { itype = M32RBF_INSN_JL; goto extract_sfmt_jl; } 264a5a4af3bSchristos itype = M32RBF_INSN_X_INVALID; goto extract_sfmt_empty; 265a5a4af3bSchristos case 1 : 266a5a4af3bSchristos if ((entire_insn & 0xfff0) == 0x1fc0) 267a5a4af3bSchristos { itype = M32RBF_INSN_JMP; goto extract_sfmt_jmp; } 268a5a4af3bSchristos itype = M32RBF_INSN_X_INVALID; goto extract_sfmt_empty; 269a5a4af3bSchristos default : itype = M32RBF_INSN_X_INVALID; goto extract_sfmt_empty; 270a5a4af3bSchristos } 271a5a4af3bSchristos } 272a5a4af3bSchristos case 29 : 273a5a4af3bSchristos if ((entire_insn & 0xffff) == 0x10d6) 274a5a4af3bSchristos { itype = M32RBF_INSN_RTE; goto extract_sfmt_rte; } 275a5a4af3bSchristos itype = M32RBF_INSN_X_INVALID; goto extract_sfmt_empty; 276a5a4af3bSchristos case 31 : 277a5a4af3bSchristos if ((entire_insn & 0xfff0) == 0x10f0) 278a5a4af3bSchristos { itype = M32RBF_INSN_TRAP; goto extract_sfmt_trap; } 279a5a4af3bSchristos itype = M32RBF_INSN_X_INVALID; goto extract_sfmt_empty; 280a5a4af3bSchristos case 32 : itype = M32RBF_INSN_STB; goto extract_sfmt_stb; 281a5a4af3bSchristos case 34 : itype = M32RBF_INSN_STH; goto extract_sfmt_sth; 282a5a4af3bSchristos case 36 : itype = M32RBF_INSN_ST; goto extract_sfmt_st; 283a5a4af3bSchristos case 37 : itype = M32RBF_INSN_UNLOCK; goto extract_sfmt_unlock; 284a5a4af3bSchristos case 38 : itype = M32RBF_INSN_ST_PLUS; goto extract_sfmt_st_plus; 285a5a4af3bSchristos case 39 : itype = M32RBF_INSN_ST_MINUS; goto extract_sfmt_st_plus; 286a5a4af3bSchristos case 40 : itype = M32RBF_INSN_LDB; goto extract_sfmt_ldb; 287a5a4af3bSchristos case 41 : itype = M32RBF_INSN_LDUB; goto extract_sfmt_ldb; 288a5a4af3bSchristos case 42 : itype = M32RBF_INSN_LDH; goto extract_sfmt_ldh; 289a5a4af3bSchristos case 43 : itype = M32RBF_INSN_LDUH; goto extract_sfmt_ldh; 290a5a4af3bSchristos case 44 : itype = M32RBF_INSN_LD; goto extract_sfmt_ld; 291a5a4af3bSchristos case 45 : itype = M32RBF_INSN_LOCK; goto extract_sfmt_lock; 292a5a4af3bSchristos case 46 : itype = M32RBF_INSN_LD_PLUS; goto extract_sfmt_ld_plus; 293a5a4af3bSchristos case 48 : itype = M32RBF_INSN_MULHI; goto extract_sfmt_mulhi; 294a5a4af3bSchristos case 49 : itype = M32RBF_INSN_MULLO; goto extract_sfmt_mulhi; 295a5a4af3bSchristos case 50 : itype = M32RBF_INSN_MULWHI; goto extract_sfmt_mulhi; 296a5a4af3bSchristos case 51 : itype = M32RBF_INSN_MULWLO; goto extract_sfmt_mulhi; 297a5a4af3bSchristos case 52 : itype = M32RBF_INSN_MACHI; goto extract_sfmt_machi; 298a5a4af3bSchristos case 53 : itype = M32RBF_INSN_MACLO; goto extract_sfmt_machi; 299a5a4af3bSchristos case 54 : itype = M32RBF_INSN_MACWHI; goto extract_sfmt_machi; 300a5a4af3bSchristos case 55 : itype = M32RBF_INSN_MACWLO; goto extract_sfmt_machi; 301a5a4af3bSchristos case 64 : /* fall through */ 302a5a4af3bSchristos case 65 : /* fall through */ 303a5a4af3bSchristos case 66 : /* fall through */ 304a5a4af3bSchristos case 67 : /* fall through */ 305a5a4af3bSchristos case 68 : /* fall through */ 306a5a4af3bSchristos case 69 : /* fall through */ 307a5a4af3bSchristos case 70 : /* fall through */ 308a5a4af3bSchristos case 71 : /* fall through */ 309a5a4af3bSchristos case 72 : /* fall through */ 310a5a4af3bSchristos case 73 : /* fall through */ 311a5a4af3bSchristos case 74 : /* fall through */ 312a5a4af3bSchristos case 75 : /* fall through */ 313a5a4af3bSchristos case 76 : /* fall through */ 314a5a4af3bSchristos case 77 : /* fall through */ 315a5a4af3bSchristos case 78 : /* fall through */ 316a5a4af3bSchristos case 79 : itype = M32RBF_INSN_ADDI; goto extract_sfmt_addi; 317a5a4af3bSchristos case 80 : /* fall through */ 318a5a4af3bSchristos case 81 : itype = M32RBF_INSN_SRLI; goto extract_sfmt_slli; 319a5a4af3bSchristos case 82 : /* fall through */ 320a5a4af3bSchristos case 83 : itype = M32RBF_INSN_SRAI; goto extract_sfmt_slli; 321a5a4af3bSchristos case 84 : /* fall through */ 322a5a4af3bSchristos case 85 : itype = M32RBF_INSN_SLLI; goto extract_sfmt_slli; 323a5a4af3bSchristos case 87 : 324a5a4af3bSchristos { 325a5a4af3bSchristos unsigned int val = (((insn >> 0) & (1 << 0))); 326a5a4af3bSchristos switch (val) 327a5a4af3bSchristos { 328a5a4af3bSchristos case 0 : 329a5a4af3bSchristos if ((entire_insn & 0xf0ff) == 0x5070) 330a5a4af3bSchristos { itype = M32RBF_INSN_MVTACHI; goto extract_sfmt_mvtachi; } 331a5a4af3bSchristos itype = M32RBF_INSN_X_INVALID; goto extract_sfmt_empty; 332a5a4af3bSchristos case 1 : 333a5a4af3bSchristos if ((entire_insn & 0xf0ff) == 0x5071) 334a5a4af3bSchristos { itype = M32RBF_INSN_MVTACLO; goto extract_sfmt_mvtachi; } 335a5a4af3bSchristos itype = M32RBF_INSN_X_INVALID; goto extract_sfmt_empty; 336a5a4af3bSchristos default : itype = M32RBF_INSN_X_INVALID; goto extract_sfmt_empty; 337a5a4af3bSchristos } 338a5a4af3bSchristos } 339a5a4af3bSchristos case 88 : 340a5a4af3bSchristos if ((entire_insn & 0xffff) == 0x5080) 341a5a4af3bSchristos { itype = M32RBF_INSN_RACH; goto extract_sfmt_rac; } 342a5a4af3bSchristos itype = M32RBF_INSN_X_INVALID; goto extract_sfmt_empty; 343a5a4af3bSchristos case 89 : 344a5a4af3bSchristos if ((entire_insn & 0xffff) == 0x5090) 345a5a4af3bSchristos { itype = M32RBF_INSN_RAC; goto extract_sfmt_rac; } 346a5a4af3bSchristos itype = M32RBF_INSN_X_INVALID; goto extract_sfmt_empty; 347a5a4af3bSchristos case 95 : 348a5a4af3bSchristos { 349a5a4af3bSchristos unsigned int val = (((insn >> 0) & (3 << 0))); 350a5a4af3bSchristos switch (val) 351a5a4af3bSchristos { 352a5a4af3bSchristos case 0 : 353a5a4af3bSchristos if ((entire_insn & 0xf0ff) == 0x50f0) 354a5a4af3bSchristos { itype = M32RBF_INSN_MVFACHI; goto extract_sfmt_mvfachi; } 355a5a4af3bSchristos itype = M32RBF_INSN_X_INVALID; goto extract_sfmt_empty; 356a5a4af3bSchristos case 1 : 357a5a4af3bSchristos if ((entire_insn & 0xf0ff) == 0x50f1) 358a5a4af3bSchristos { itype = M32RBF_INSN_MVFACLO; goto extract_sfmt_mvfachi; } 359a5a4af3bSchristos itype = M32RBF_INSN_X_INVALID; goto extract_sfmt_empty; 360a5a4af3bSchristos case 2 : 361a5a4af3bSchristos if ((entire_insn & 0xf0ff) == 0x50f2) 362a5a4af3bSchristos { itype = M32RBF_INSN_MVFACMI; goto extract_sfmt_mvfachi; } 363a5a4af3bSchristos itype = M32RBF_INSN_X_INVALID; goto extract_sfmt_empty; 364a5a4af3bSchristos default : itype = M32RBF_INSN_X_INVALID; goto extract_sfmt_empty; 365a5a4af3bSchristos } 366a5a4af3bSchristos } 367a5a4af3bSchristos case 96 : /* fall through */ 368a5a4af3bSchristos case 97 : /* fall through */ 369a5a4af3bSchristos case 98 : /* fall through */ 370a5a4af3bSchristos case 99 : /* fall through */ 371a5a4af3bSchristos case 100 : /* fall through */ 372a5a4af3bSchristos case 101 : /* fall through */ 373a5a4af3bSchristos case 102 : /* fall through */ 374a5a4af3bSchristos case 103 : /* fall through */ 375a5a4af3bSchristos case 104 : /* fall through */ 376a5a4af3bSchristos case 105 : /* fall through */ 377a5a4af3bSchristos case 106 : /* fall through */ 378a5a4af3bSchristos case 107 : /* fall through */ 379a5a4af3bSchristos case 108 : /* fall through */ 380a5a4af3bSchristos case 109 : /* fall through */ 381a5a4af3bSchristos case 110 : /* fall through */ 382a5a4af3bSchristos case 111 : itype = M32RBF_INSN_LDI8; goto extract_sfmt_ldi8; 383a5a4af3bSchristos case 112 : 384a5a4af3bSchristos { 385a5a4af3bSchristos unsigned int val = (((insn >> 8) & (15 << 0))); 386a5a4af3bSchristos switch (val) 387a5a4af3bSchristos { 388a5a4af3bSchristos case 0 : 389a5a4af3bSchristos if ((entire_insn & 0xffff) == 0x7000) 390a5a4af3bSchristos { itype = M32RBF_INSN_NOP; goto extract_sfmt_nop; } 391a5a4af3bSchristos itype = M32RBF_INSN_X_INVALID; goto extract_sfmt_empty; 392a5a4af3bSchristos case 1 : itype = M32RBF_INSN_SETPSW; goto extract_sfmt_setpsw; 393a5a4af3bSchristos case 2 : itype = M32RBF_INSN_CLRPSW; goto extract_sfmt_clrpsw; 394a5a4af3bSchristos case 12 : itype = M32RBF_INSN_BC8; goto extract_sfmt_bc8; 395a5a4af3bSchristos case 13 : itype = M32RBF_INSN_BNC8; goto extract_sfmt_bc8; 396a5a4af3bSchristos case 14 : itype = M32RBF_INSN_BL8; goto extract_sfmt_bl8; 397a5a4af3bSchristos case 15 : itype = M32RBF_INSN_BRA8; goto extract_sfmt_bra8; 398a5a4af3bSchristos default : itype = M32RBF_INSN_X_INVALID; goto extract_sfmt_empty; 399a5a4af3bSchristos } 400a5a4af3bSchristos } 401a5a4af3bSchristos case 113 : /* fall through */ 402a5a4af3bSchristos case 114 : /* fall through */ 403a5a4af3bSchristos case 115 : /* fall through */ 404a5a4af3bSchristos case 116 : /* fall through */ 405a5a4af3bSchristos case 117 : /* fall through */ 406a5a4af3bSchristos case 118 : /* fall through */ 407a5a4af3bSchristos case 119 : /* fall through */ 408a5a4af3bSchristos case 120 : /* fall through */ 409a5a4af3bSchristos case 121 : /* fall through */ 410a5a4af3bSchristos case 122 : /* fall through */ 411a5a4af3bSchristos case 123 : /* fall through */ 412a5a4af3bSchristos case 124 : /* fall through */ 413a5a4af3bSchristos case 125 : /* fall through */ 414a5a4af3bSchristos case 126 : /* fall through */ 415a5a4af3bSchristos case 127 : 416a5a4af3bSchristos { 417a5a4af3bSchristos unsigned int val = (((insn >> 8) & (15 << 0))); 418a5a4af3bSchristos switch (val) 419a5a4af3bSchristos { 420a5a4af3bSchristos case 1 : itype = M32RBF_INSN_SETPSW; goto extract_sfmt_setpsw; 421a5a4af3bSchristos case 2 : itype = M32RBF_INSN_CLRPSW; goto extract_sfmt_clrpsw; 422a5a4af3bSchristos case 12 : itype = M32RBF_INSN_BC8; goto extract_sfmt_bc8; 423a5a4af3bSchristos case 13 : itype = M32RBF_INSN_BNC8; goto extract_sfmt_bc8; 424a5a4af3bSchristos case 14 : itype = M32RBF_INSN_BL8; goto extract_sfmt_bl8; 425a5a4af3bSchristos case 15 : itype = M32RBF_INSN_BRA8; goto extract_sfmt_bra8; 426a5a4af3bSchristos default : itype = M32RBF_INSN_X_INVALID; goto extract_sfmt_empty; 427a5a4af3bSchristos } 428a5a4af3bSchristos } 429a5a4af3bSchristos case 132 : 430a5a4af3bSchristos if ((entire_insn & 0xfff00000) == 0x80400000) 431a5a4af3bSchristos { itype = M32RBF_INSN_CMPI; goto extract_sfmt_cmpi; } 432a5a4af3bSchristos itype = M32RBF_INSN_X_INVALID; goto extract_sfmt_empty; 433a5a4af3bSchristos case 133 : 434a5a4af3bSchristos if ((entire_insn & 0xfff00000) == 0x80500000) 435a5a4af3bSchristos { itype = M32RBF_INSN_CMPUI; goto extract_sfmt_cmpi; } 436a5a4af3bSchristos itype = M32RBF_INSN_X_INVALID; goto extract_sfmt_empty; 437a5a4af3bSchristos case 136 : itype = M32RBF_INSN_ADDV3; goto extract_sfmt_addv3; 438a5a4af3bSchristos case 138 : itype = M32RBF_INSN_ADD3; goto extract_sfmt_add3; 439a5a4af3bSchristos case 140 : itype = M32RBF_INSN_AND3; goto extract_sfmt_and3; 440a5a4af3bSchristos case 141 : itype = M32RBF_INSN_XOR3; goto extract_sfmt_and3; 441a5a4af3bSchristos case 142 : itype = M32RBF_INSN_OR3; goto extract_sfmt_or3; 442a5a4af3bSchristos case 144 : 443a5a4af3bSchristos if ((entire_insn & 0xf0f0ffff) == 0x90000000) 444a5a4af3bSchristos { itype = M32RBF_INSN_DIV; goto extract_sfmt_div; } 445a5a4af3bSchristos itype = M32RBF_INSN_X_INVALID; goto extract_sfmt_empty; 446a5a4af3bSchristos case 145 : 447a5a4af3bSchristos if ((entire_insn & 0xf0f0ffff) == 0x90100000) 448a5a4af3bSchristos { itype = M32RBF_INSN_DIVU; goto extract_sfmt_div; } 449a5a4af3bSchristos itype = M32RBF_INSN_X_INVALID; goto extract_sfmt_empty; 450a5a4af3bSchristos case 146 : 451a5a4af3bSchristos if ((entire_insn & 0xf0f0ffff) == 0x90200000) 452a5a4af3bSchristos { itype = M32RBF_INSN_REM; goto extract_sfmt_div; } 453a5a4af3bSchristos itype = M32RBF_INSN_X_INVALID; goto extract_sfmt_empty; 454a5a4af3bSchristos case 147 : 455a5a4af3bSchristos if ((entire_insn & 0xf0f0ffff) == 0x90300000) 456a5a4af3bSchristos { itype = M32RBF_INSN_REMU; goto extract_sfmt_div; } 457a5a4af3bSchristos itype = M32RBF_INSN_X_INVALID; goto extract_sfmt_empty; 458a5a4af3bSchristos case 152 : itype = M32RBF_INSN_SRL3; goto extract_sfmt_sll3; 459a5a4af3bSchristos case 154 : itype = M32RBF_INSN_SRA3; goto extract_sfmt_sll3; 460a5a4af3bSchristos case 156 : itype = M32RBF_INSN_SLL3; goto extract_sfmt_sll3; 461a5a4af3bSchristos case 159 : 462a5a4af3bSchristos if ((entire_insn & 0xf0ff0000) == 0x90f00000) 463a5a4af3bSchristos { itype = M32RBF_INSN_LDI16; goto extract_sfmt_ldi16; } 464a5a4af3bSchristos itype = M32RBF_INSN_X_INVALID; goto extract_sfmt_empty; 465a5a4af3bSchristos case 160 : itype = M32RBF_INSN_STB_D; goto extract_sfmt_stb_d; 466a5a4af3bSchristos case 162 : itype = M32RBF_INSN_STH_D; goto extract_sfmt_sth_d; 467a5a4af3bSchristos case 164 : itype = M32RBF_INSN_ST_D; goto extract_sfmt_st_d; 468a5a4af3bSchristos case 166 : 469a5a4af3bSchristos if ((entire_insn & 0xf8f00000) == 0xa0600000) 470a5a4af3bSchristos { itype = M32RBF_INSN_BSET; goto extract_sfmt_bset; } 471a5a4af3bSchristos itype = M32RBF_INSN_X_INVALID; goto extract_sfmt_empty; 472a5a4af3bSchristos case 167 : 473a5a4af3bSchristos if ((entire_insn & 0xf8f00000) == 0xa0700000) 474a5a4af3bSchristos { itype = M32RBF_INSN_BCLR; goto extract_sfmt_bset; } 475a5a4af3bSchristos itype = M32RBF_INSN_X_INVALID; goto extract_sfmt_empty; 476a5a4af3bSchristos case 168 : itype = M32RBF_INSN_LDB_D; goto extract_sfmt_ldb_d; 477a5a4af3bSchristos case 169 : itype = M32RBF_INSN_LDUB_D; goto extract_sfmt_ldb_d; 478a5a4af3bSchristos case 170 : itype = M32RBF_INSN_LDH_D; goto extract_sfmt_ldh_d; 479a5a4af3bSchristos case 171 : itype = M32RBF_INSN_LDUH_D; goto extract_sfmt_ldh_d; 480a5a4af3bSchristos case 172 : itype = M32RBF_INSN_LD_D; goto extract_sfmt_ld_d; 481a5a4af3bSchristos case 176 : itype = M32RBF_INSN_BEQ; goto extract_sfmt_beq; 482a5a4af3bSchristos case 177 : itype = M32RBF_INSN_BNE; goto extract_sfmt_beq; 483a5a4af3bSchristos case 184 : 484a5a4af3bSchristos if ((entire_insn & 0xfff00000) == 0xb0800000) 485a5a4af3bSchristos { itype = M32RBF_INSN_BEQZ; goto extract_sfmt_beqz; } 486a5a4af3bSchristos itype = M32RBF_INSN_X_INVALID; goto extract_sfmt_empty; 487a5a4af3bSchristos case 185 : 488a5a4af3bSchristos if ((entire_insn & 0xfff00000) == 0xb0900000) 489a5a4af3bSchristos { itype = M32RBF_INSN_BNEZ; goto extract_sfmt_beqz; } 490a5a4af3bSchristos itype = M32RBF_INSN_X_INVALID; goto extract_sfmt_empty; 491a5a4af3bSchristos case 186 : 492a5a4af3bSchristos if ((entire_insn & 0xfff00000) == 0xb0a00000) 493a5a4af3bSchristos { itype = M32RBF_INSN_BLTZ; goto extract_sfmt_beqz; } 494a5a4af3bSchristos itype = M32RBF_INSN_X_INVALID; goto extract_sfmt_empty; 495a5a4af3bSchristos case 187 : 496a5a4af3bSchristos if ((entire_insn & 0xfff00000) == 0xb0b00000) 497a5a4af3bSchristos { itype = M32RBF_INSN_BGEZ; goto extract_sfmt_beqz; } 498a5a4af3bSchristos itype = M32RBF_INSN_X_INVALID; goto extract_sfmt_empty; 499a5a4af3bSchristos case 188 : 500a5a4af3bSchristos if ((entire_insn & 0xfff00000) == 0xb0c00000) 501a5a4af3bSchristos { itype = M32RBF_INSN_BLEZ; goto extract_sfmt_beqz; } 502a5a4af3bSchristos itype = M32RBF_INSN_X_INVALID; goto extract_sfmt_empty; 503a5a4af3bSchristos case 189 : 504a5a4af3bSchristos if ((entire_insn & 0xfff00000) == 0xb0d00000) 505a5a4af3bSchristos { itype = M32RBF_INSN_BGTZ; goto extract_sfmt_beqz; } 506a5a4af3bSchristos itype = M32RBF_INSN_X_INVALID; goto extract_sfmt_empty; 507a5a4af3bSchristos case 220 : 508a5a4af3bSchristos if ((entire_insn & 0xf0ff0000) == 0xd0c00000) 509a5a4af3bSchristos { itype = M32RBF_INSN_SETH; goto extract_sfmt_seth; } 510a5a4af3bSchristos itype = M32RBF_INSN_X_INVALID; goto extract_sfmt_empty; 511a5a4af3bSchristos case 224 : /* fall through */ 512a5a4af3bSchristos case 225 : /* fall through */ 513a5a4af3bSchristos case 226 : /* fall through */ 514a5a4af3bSchristos case 227 : /* fall through */ 515a5a4af3bSchristos case 228 : /* fall through */ 516a5a4af3bSchristos case 229 : /* fall through */ 517a5a4af3bSchristos case 230 : /* fall through */ 518a5a4af3bSchristos case 231 : /* fall through */ 519a5a4af3bSchristos case 232 : /* fall through */ 520a5a4af3bSchristos case 233 : /* fall through */ 521a5a4af3bSchristos case 234 : /* fall through */ 522a5a4af3bSchristos case 235 : /* fall through */ 523a5a4af3bSchristos case 236 : /* fall through */ 524a5a4af3bSchristos case 237 : /* fall through */ 525a5a4af3bSchristos case 238 : /* fall through */ 526a5a4af3bSchristos case 239 : itype = M32RBF_INSN_LD24; goto extract_sfmt_ld24; 527a5a4af3bSchristos case 240 : /* fall through */ 528a5a4af3bSchristos case 241 : /* fall through */ 529a5a4af3bSchristos case 242 : /* fall through */ 530a5a4af3bSchristos case 243 : /* fall through */ 531a5a4af3bSchristos case 244 : /* fall through */ 532a5a4af3bSchristos case 245 : /* fall through */ 533a5a4af3bSchristos case 246 : /* fall through */ 534a5a4af3bSchristos case 247 : /* fall through */ 535a5a4af3bSchristos case 248 : /* fall through */ 536a5a4af3bSchristos case 249 : /* fall through */ 537a5a4af3bSchristos case 250 : /* fall through */ 538a5a4af3bSchristos case 251 : /* fall through */ 539a5a4af3bSchristos case 252 : /* fall through */ 540a5a4af3bSchristos case 253 : /* fall through */ 541a5a4af3bSchristos case 254 : /* fall through */ 542a5a4af3bSchristos case 255 : 543a5a4af3bSchristos { 544a5a4af3bSchristos unsigned int val = (((insn >> 8) & (3 << 0))); 545a5a4af3bSchristos switch (val) 546a5a4af3bSchristos { 547a5a4af3bSchristos case 0 : 548a5a4af3bSchristos if ((entire_insn & 0xff000000) == 0xfc000000) 549a5a4af3bSchristos { itype = M32RBF_INSN_BC24; goto extract_sfmt_bc24; } 550a5a4af3bSchristos itype = M32RBF_INSN_X_INVALID; goto extract_sfmt_empty; 551a5a4af3bSchristos case 1 : 552a5a4af3bSchristos if ((entire_insn & 0xff000000) == 0xfd000000) 553a5a4af3bSchristos { itype = M32RBF_INSN_BNC24; goto extract_sfmt_bc24; } 554a5a4af3bSchristos itype = M32RBF_INSN_X_INVALID; goto extract_sfmt_empty; 555a5a4af3bSchristos case 2 : 556a5a4af3bSchristos if ((entire_insn & 0xff000000) == 0xfe000000) 557a5a4af3bSchristos { itype = M32RBF_INSN_BL24; goto extract_sfmt_bl24; } 558a5a4af3bSchristos itype = M32RBF_INSN_X_INVALID; goto extract_sfmt_empty; 559a5a4af3bSchristos case 3 : 560a5a4af3bSchristos if ((entire_insn & 0xff000000) == 0xff000000) 561a5a4af3bSchristos { itype = M32RBF_INSN_BRA24; goto extract_sfmt_bra24; } 562a5a4af3bSchristos itype = M32RBF_INSN_X_INVALID; goto extract_sfmt_empty; 563a5a4af3bSchristos default : itype = M32RBF_INSN_X_INVALID; goto extract_sfmt_empty; 564a5a4af3bSchristos } 565a5a4af3bSchristos } 566a5a4af3bSchristos default : itype = M32RBF_INSN_X_INVALID; goto extract_sfmt_empty; 567a5a4af3bSchristos } 568a5a4af3bSchristos } 569a5a4af3bSchristos } 570a5a4af3bSchristos 571a5a4af3bSchristos /* The instruction has been decoded, now extract the fields. */ 572a5a4af3bSchristos 573a5a4af3bSchristos extract_sfmt_empty: 574a5a4af3bSchristos { 575a5a4af3bSchristos const IDESC *idesc = &m32rbf_insn_data[itype]; 576a5a4af3bSchristos #define FLD(f) abuf->fields.sfmt_empty.f 577a5a4af3bSchristos 578a5a4af3bSchristos 579a5a4af3bSchristos /* Record the fields for the semantic handler. */ 580a5a4af3bSchristos CGEN_TRACE_EXTRACT (current_cpu, abuf, (current_cpu, pc, "sfmt_empty", (char *) 0)); 581a5a4af3bSchristos 582a5a4af3bSchristos #undef FLD 583a5a4af3bSchristos return idesc; 584a5a4af3bSchristos } 585a5a4af3bSchristos 586a5a4af3bSchristos extract_sfmt_add: 587a5a4af3bSchristos { 588a5a4af3bSchristos const IDESC *idesc = &m32rbf_insn_data[itype]; 589a5a4af3bSchristos CGEN_INSN_WORD insn = entire_insn; 590a5a4af3bSchristos #define FLD(f) abuf->fields.sfmt_add.f 591a5a4af3bSchristos UINT f_r1; 592a5a4af3bSchristos UINT f_r2; 593a5a4af3bSchristos 594a5a4af3bSchristos f_r1 = EXTRACT_MSB0_UINT (insn, 16, 4, 4); 595a5a4af3bSchristos f_r2 = EXTRACT_MSB0_UINT (insn, 16, 12, 4); 596a5a4af3bSchristos 597a5a4af3bSchristos /* Record the fields for the semantic handler. */ 598a5a4af3bSchristos FLD (f_r1) = f_r1; 599a5a4af3bSchristos FLD (f_r2) = f_r2; 600a5a4af3bSchristos FLD (i_dr) = & CPU (h_gr)[f_r1]; 601a5a4af3bSchristos FLD (i_sr) = & CPU (h_gr)[f_r2]; 602a5a4af3bSchristos CGEN_TRACE_EXTRACT (current_cpu, abuf, (current_cpu, pc, "sfmt_add", "f_r1 0x%x", 'x', f_r1, "f_r2 0x%x", 'x', f_r2, "dr 0x%x", 'x', f_r1, "sr 0x%x", 'x', f_r2, (char *) 0)); 603a5a4af3bSchristos 604a5a4af3bSchristos #if WITH_PROFILE_MODEL_P 605a5a4af3bSchristos /* Record the fields for profiling. */ 606a5a4af3bSchristos if (PROFILE_MODEL_P (current_cpu)) 607a5a4af3bSchristos { 608a5a4af3bSchristos FLD (in_dr) = f_r1; 609a5a4af3bSchristos FLD (in_sr) = f_r2; 610a5a4af3bSchristos FLD (out_dr) = f_r1; 611a5a4af3bSchristos } 612a5a4af3bSchristos #endif 613a5a4af3bSchristos #undef FLD 614a5a4af3bSchristos return idesc; 615a5a4af3bSchristos } 616a5a4af3bSchristos 617a5a4af3bSchristos extract_sfmt_add3: 618a5a4af3bSchristos { 619a5a4af3bSchristos const IDESC *idesc = &m32rbf_insn_data[itype]; 620a5a4af3bSchristos CGEN_INSN_WORD insn = entire_insn; 621a5a4af3bSchristos #define FLD(f) abuf->fields.sfmt_add3.f 622a5a4af3bSchristos UINT f_r1; 623a5a4af3bSchristos UINT f_r2; 624a5a4af3bSchristos INT f_simm16; 625a5a4af3bSchristos 626a5a4af3bSchristos f_r1 = EXTRACT_MSB0_UINT (insn, 32, 4, 4); 627a5a4af3bSchristos f_r2 = EXTRACT_MSB0_UINT (insn, 32, 12, 4); 628a5a4af3bSchristos f_simm16 = EXTRACT_MSB0_SINT (insn, 32, 16, 16); 629a5a4af3bSchristos 630a5a4af3bSchristos /* Record the fields for the semantic handler. */ 631a5a4af3bSchristos FLD (f_simm16) = f_simm16; 632a5a4af3bSchristos FLD (f_r2) = f_r2; 633a5a4af3bSchristos FLD (f_r1) = f_r1; 634a5a4af3bSchristos FLD (i_sr) = & CPU (h_gr)[f_r2]; 635a5a4af3bSchristos FLD (i_dr) = & CPU (h_gr)[f_r1]; 636a5a4af3bSchristos CGEN_TRACE_EXTRACT (current_cpu, abuf, (current_cpu, pc, "sfmt_add3", "f_simm16 0x%x", 'x', f_simm16, "f_r2 0x%x", 'x', f_r2, "f_r1 0x%x", 'x', f_r1, "sr 0x%x", 'x', f_r2, "dr 0x%x", 'x', f_r1, (char *) 0)); 637a5a4af3bSchristos 638a5a4af3bSchristos #if WITH_PROFILE_MODEL_P 639a5a4af3bSchristos /* Record the fields for profiling. */ 640a5a4af3bSchristos if (PROFILE_MODEL_P (current_cpu)) 641a5a4af3bSchristos { 642a5a4af3bSchristos FLD (in_sr) = f_r2; 643a5a4af3bSchristos FLD (out_dr) = f_r1; 644a5a4af3bSchristos } 645a5a4af3bSchristos #endif 646a5a4af3bSchristos #undef FLD 647a5a4af3bSchristos return idesc; 648a5a4af3bSchristos } 649a5a4af3bSchristos 650a5a4af3bSchristos extract_sfmt_and3: 651a5a4af3bSchristos { 652a5a4af3bSchristos const IDESC *idesc = &m32rbf_insn_data[itype]; 653a5a4af3bSchristos CGEN_INSN_WORD insn = entire_insn; 654a5a4af3bSchristos #define FLD(f) abuf->fields.sfmt_and3.f 655a5a4af3bSchristos UINT f_r1; 656a5a4af3bSchristos UINT f_r2; 657a5a4af3bSchristos UINT f_uimm16; 658a5a4af3bSchristos 659a5a4af3bSchristos f_r1 = EXTRACT_MSB0_UINT (insn, 32, 4, 4); 660a5a4af3bSchristos f_r2 = EXTRACT_MSB0_UINT (insn, 32, 12, 4); 661a5a4af3bSchristos f_uimm16 = EXTRACT_MSB0_UINT (insn, 32, 16, 16); 662a5a4af3bSchristos 663a5a4af3bSchristos /* Record the fields for the semantic handler. */ 664a5a4af3bSchristos FLD (f_r2) = f_r2; 665a5a4af3bSchristos FLD (f_uimm16) = f_uimm16; 666a5a4af3bSchristos FLD (f_r1) = f_r1; 667a5a4af3bSchristos FLD (i_sr) = & CPU (h_gr)[f_r2]; 668a5a4af3bSchristos FLD (i_dr) = & CPU (h_gr)[f_r1]; 669a5a4af3bSchristos CGEN_TRACE_EXTRACT (current_cpu, abuf, (current_cpu, pc, "sfmt_and3", "f_r2 0x%x", 'x', f_r2, "f_uimm16 0x%x", 'x', f_uimm16, "f_r1 0x%x", 'x', f_r1, "sr 0x%x", 'x', f_r2, "dr 0x%x", 'x', f_r1, (char *) 0)); 670a5a4af3bSchristos 671a5a4af3bSchristos #if WITH_PROFILE_MODEL_P 672a5a4af3bSchristos /* Record the fields for profiling. */ 673a5a4af3bSchristos if (PROFILE_MODEL_P (current_cpu)) 674a5a4af3bSchristos { 675a5a4af3bSchristos FLD (in_sr) = f_r2; 676a5a4af3bSchristos FLD (out_dr) = f_r1; 677a5a4af3bSchristos } 678a5a4af3bSchristos #endif 679a5a4af3bSchristos #undef FLD 680a5a4af3bSchristos return idesc; 681a5a4af3bSchristos } 682a5a4af3bSchristos 683a5a4af3bSchristos extract_sfmt_or3: 684a5a4af3bSchristos { 685a5a4af3bSchristos const IDESC *idesc = &m32rbf_insn_data[itype]; 686a5a4af3bSchristos CGEN_INSN_WORD insn = entire_insn; 687a5a4af3bSchristos #define FLD(f) abuf->fields.sfmt_and3.f 688a5a4af3bSchristos UINT f_r1; 689a5a4af3bSchristos UINT f_r2; 690a5a4af3bSchristos UINT f_uimm16; 691a5a4af3bSchristos 692a5a4af3bSchristos f_r1 = EXTRACT_MSB0_UINT (insn, 32, 4, 4); 693a5a4af3bSchristos f_r2 = EXTRACT_MSB0_UINT (insn, 32, 12, 4); 694a5a4af3bSchristos f_uimm16 = EXTRACT_MSB0_UINT (insn, 32, 16, 16); 695a5a4af3bSchristos 696a5a4af3bSchristos /* Record the fields for the semantic handler. */ 697a5a4af3bSchristos FLD (f_r2) = f_r2; 698a5a4af3bSchristos FLD (f_uimm16) = f_uimm16; 699a5a4af3bSchristos FLD (f_r1) = f_r1; 700a5a4af3bSchristos FLD (i_sr) = & CPU (h_gr)[f_r2]; 701a5a4af3bSchristos FLD (i_dr) = & CPU (h_gr)[f_r1]; 702a5a4af3bSchristos CGEN_TRACE_EXTRACT (current_cpu, abuf, (current_cpu, pc, "sfmt_or3", "f_r2 0x%x", 'x', f_r2, "f_uimm16 0x%x", 'x', f_uimm16, "f_r1 0x%x", 'x', f_r1, "sr 0x%x", 'x', f_r2, "dr 0x%x", 'x', f_r1, (char *) 0)); 703a5a4af3bSchristos 704a5a4af3bSchristos #if WITH_PROFILE_MODEL_P 705a5a4af3bSchristos /* Record the fields for profiling. */ 706a5a4af3bSchristos if (PROFILE_MODEL_P (current_cpu)) 707a5a4af3bSchristos { 708a5a4af3bSchristos FLD (in_sr) = f_r2; 709a5a4af3bSchristos FLD (out_dr) = f_r1; 710a5a4af3bSchristos } 711a5a4af3bSchristos #endif 712a5a4af3bSchristos #undef FLD 713a5a4af3bSchristos return idesc; 714a5a4af3bSchristos } 715a5a4af3bSchristos 716a5a4af3bSchristos extract_sfmt_addi: 717a5a4af3bSchristos { 718a5a4af3bSchristos const IDESC *idesc = &m32rbf_insn_data[itype]; 719a5a4af3bSchristos CGEN_INSN_WORD insn = entire_insn; 720a5a4af3bSchristos #define FLD(f) abuf->fields.sfmt_addi.f 721a5a4af3bSchristos UINT f_r1; 722a5a4af3bSchristos INT f_simm8; 723a5a4af3bSchristos 724a5a4af3bSchristos f_r1 = EXTRACT_MSB0_UINT (insn, 16, 4, 4); 725a5a4af3bSchristos f_simm8 = EXTRACT_MSB0_SINT (insn, 16, 8, 8); 726a5a4af3bSchristos 727a5a4af3bSchristos /* Record the fields for the semantic handler. */ 728a5a4af3bSchristos FLD (f_r1) = f_r1; 729a5a4af3bSchristos FLD (f_simm8) = f_simm8; 730a5a4af3bSchristos FLD (i_dr) = & CPU (h_gr)[f_r1]; 731a5a4af3bSchristos CGEN_TRACE_EXTRACT (current_cpu, abuf, (current_cpu, pc, "sfmt_addi", "f_r1 0x%x", 'x', f_r1, "f_simm8 0x%x", 'x', f_simm8, "dr 0x%x", 'x', f_r1, (char *) 0)); 732a5a4af3bSchristos 733a5a4af3bSchristos #if WITH_PROFILE_MODEL_P 734a5a4af3bSchristos /* Record the fields for profiling. */ 735a5a4af3bSchristos if (PROFILE_MODEL_P (current_cpu)) 736a5a4af3bSchristos { 737a5a4af3bSchristos FLD (in_dr) = f_r1; 738a5a4af3bSchristos FLD (out_dr) = f_r1; 739a5a4af3bSchristos } 740a5a4af3bSchristos #endif 741a5a4af3bSchristos #undef FLD 742a5a4af3bSchristos return idesc; 743a5a4af3bSchristos } 744a5a4af3bSchristos 745a5a4af3bSchristos extract_sfmt_addv: 746a5a4af3bSchristos { 747a5a4af3bSchristos const IDESC *idesc = &m32rbf_insn_data[itype]; 748a5a4af3bSchristos CGEN_INSN_WORD insn = entire_insn; 749a5a4af3bSchristos #define FLD(f) abuf->fields.sfmt_add.f 750a5a4af3bSchristos UINT f_r1; 751a5a4af3bSchristos UINT f_r2; 752a5a4af3bSchristos 753a5a4af3bSchristos f_r1 = EXTRACT_MSB0_UINT (insn, 16, 4, 4); 754a5a4af3bSchristos f_r2 = EXTRACT_MSB0_UINT (insn, 16, 12, 4); 755a5a4af3bSchristos 756a5a4af3bSchristos /* Record the fields for the semantic handler. */ 757a5a4af3bSchristos FLD (f_r1) = f_r1; 758a5a4af3bSchristos FLD (f_r2) = f_r2; 759a5a4af3bSchristos FLD (i_dr) = & CPU (h_gr)[f_r1]; 760a5a4af3bSchristos FLD (i_sr) = & CPU (h_gr)[f_r2]; 761a5a4af3bSchristos CGEN_TRACE_EXTRACT (current_cpu, abuf, (current_cpu, pc, "sfmt_addv", "f_r1 0x%x", 'x', f_r1, "f_r2 0x%x", 'x', f_r2, "dr 0x%x", 'x', f_r1, "sr 0x%x", 'x', f_r2, (char *) 0)); 762a5a4af3bSchristos 763a5a4af3bSchristos #if WITH_PROFILE_MODEL_P 764a5a4af3bSchristos /* Record the fields for profiling. */ 765a5a4af3bSchristos if (PROFILE_MODEL_P (current_cpu)) 766a5a4af3bSchristos { 767a5a4af3bSchristos FLD (in_dr) = f_r1; 768a5a4af3bSchristos FLD (in_sr) = f_r2; 769a5a4af3bSchristos FLD (out_dr) = f_r1; 770a5a4af3bSchristos } 771a5a4af3bSchristos #endif 772a5a4af3bSchristos #undef FLD 773a5a4af3bSchristos return idesc; 774a5a4af3bSchristos } 775a5a4af3bSchristos 776a5a4af3bSchristos extract_sfmt_addv3: 777a5a4af3bSchristos { 778a5a4af3bSchristos const IDESC *idesc = &m32rbf_insn_data[itype]; 779a5a4af3bSchristos CGEN_INSN_WORD insn = entire_insn; 780a5a4af3bSchristos #define FLD(f) abuf->fields.sfmt_add3.f 781a5a4af3bSchristos UINT f_r1; 782a5a4af3bSchristos UINT f_r2; 783a5a4af3bSchristos INT f_simm16; 784a5a4af3bSchristos 785a5a4af3bSchristos f_r1 = EXTRACT_MSB0_UINT (insn, 32, 4, 4); 786a5a4af3bSchristos f_r2 = EXTRACT_MSB0_UINT (insn, 32, 12, 4); 787a5a4af3bSchristos f_simm16 = EXTRACT_MSB0_SINT (insn, 32, 16, 16); 788a5a4af3bSchristos 789a5a4af3bSchristos /* Record the fields for the semantic handler. */ 790a5a4af3bSchristos FLD (f_simm16) = f_simm16; 791a5a4af3bSchristos FLD (f_r2) = f_r2; 792a5a4af3bSchristos FLD (f_r1) = f_r1; 793a5a4af3bSchristos FLD (i_sr) = & CPU (h_gr)[f_r2]; 794a5a4af3bSchristos FLD (i_dr) = & CPU (h_gr)[f_r1]; 795a5a4af3bSchristos CGEN_TRACE_EXTRACT (current_cpu, abuf, (current_cpu, pc, "sfmt_addv3", "f_simm16 0x%x", 'x', f_simm16, "f_r2 0x%x", 'x', f_r2, "f_r1 0x%x", 'x', f_r1, "sr 0x%x", 'x', f_r2, "dr 0x%x", 'x', f_r1, (char *) 0)); 796a5a4af3bSchristos 797a5a4af3bSchristos #if WITH_PROFILE_MODEL_P 798a5a4af3bSchristos /* Record the fields for profiling. */ 799a5a4af3bSchristos if (PROFILE_MODEL_P (current_cpu)) 800a5a4af3bSchristos { 801a5a4af3bSchristos FLD (in_sr) = f_r2; 802a5a4af3bSchristos FLD (out_dr) = f_r1; 803a5a4af3bSchristos } 804a5a4af3bSchristos #endif 805a5a4af3bSchristos #undef FLD 806a5a4af3bSchristos return idesc; 807a5a4af3bSchristos } 808a5a4af3bSchristos 809a5a4af3bSchristos extract_sfmt_addx: 810a5a4af3bSchristos { 811a5a4af3bSchristos const IDESC *idesc = &m32rbf_insn_data[itype]; 812a5a4af3bSchristos CGEN_INSN_WORD insn = entire_insn; 813a5a4af3bSchristos #define FLD(f) abuf->fields.sfmt_add.f 814a5a4af3bSchristos UINT f_r1; 815a5a4af3bSchristos UINT f_r2; 816a5a4af3bSchristos 817a5a4af3bSchristos f_r1 = EXTRACT_MSB0_UINT (insn, 16, 4, 4); 818a5a4af3bSchristos f_r2 = EXTRACT_MSB0_UINT (insn, 16, 12, 4); 819a5a4af3bSchristos 820a5a4af3bSchristos /* Record the fields for the semantic handler. */ 821a5a4af3bSchristos FLD (f_r1) = f_r1; 822a5a4af3bSchristos FLD (f_r2) = f_r2; 823a5a4af3bSchristos FLD (i_dr) = & CPU (h_gr)[f_r1]; 824a5a4af3bSchristos FLD (i_sr) = & CPU (h_gr)[f_r2]; 825a5a4af3bSchristos CGEN_TRACE_EXTRACT (current_cpu, abuf, (current_cpu, pc, "sfmt_addx", "f_r1 0x%x", 'x', f_r1, "f_r2 0x%x", 'x', f_r2, "dr 0x%x", 'x', f_r1, "sr 0x%x", 'x', f_r2, (char *) 0)); 826a5a4af3bSchristos 827a5a4af3bSchristos #if WITH_PROFILE_MODEL_P 828a5a4af3bSchristos /* Record the fields for profiling. */ 829a5a4af3bSchristos if (PROFILE_MODEL_P (current_cpu)) 830a5a4af3bSchristos { 831a5a4af3bSchristos FLD (in_dr) = f_r1; 832a5a4af3bSchristos FLD (in_sr) = f_r2; 833a5a4af3bSchristos FLD (out_dr) = f_r1; 834a5a4af3bSchristos } 835a5a4af3bSchristos #endif 836a5a4af3bSchristos #undef FLD 837a5a4af3bSchristos return idesc; 838a5a4af3bSchristos } 839a5a4af3bSchristos 840a5a4af3bSchristos extract_sfmt_bc8: 841a5a4af3bSchristos { 842a5a4af3bSchristos const IDESC *idesc = &m32rbf_insn_data[itype]; 843a5a4af3bSchristos CGEN_INSN_WORD insn = entire_insn; 844a5a4af3bSchristos #define FLD(f) abuf->fields.sfmt_bl8.f 845a5a4af3bSchristos SI f_disp8; 846a5a4af3bSchristos 847a5a4af3bSchristos f_disp8 = ((((EXTRACT_MSB0_SINT (insn, 16, 8, 8)) << (2))) + (((pc) & (-4)))); 848a5a4af3bSchristos 849a5a4af3bSchristos /* Record the fields for the semantic handler. */ 850a5a4af3bSchristos FLD (i_disp8) = f_disp8; 851a5a4af3bSchristos CGEN_TRACE_EXTRACT (current_cpu, abuf, (current_cpu, pc, "sfmt_bc8", "disp8 0x%x", 'x', f_disp8, (char *) 0)); 852a5a4af3bSchristos 853a5a4af3bSchristos #if WITH_PROFILE_MODEL_P 854a5a4af3bSchristos /* Record the fields for profiling. */ 855a5a4af3bSchristos if (PROFILE_MODEL_P (current_cpu)) 856a5a4af3bSchristos { 857a5a4af3bSchristos } 858a5a4af3bSchristos #endif 859a5a4af3bSchristos #undef FLD 860a5a4af3bSchristos return idesc; 861a5a4af3bSchristos } 862a5a4af3bSchristos 863a5a4af3bSchristos extract_sfmt_bc24: 864a5a4af3bSchristos { 865a5a4af3bSchristos const IDESC *idesc = &m32rbf_insn_data[itype]; 866a5a4af3bSchristos CGEN_INSN_WORD insn = entire_insn; 867a5a4af3bSchristos #define FLD(f) abuf->fields.sfmt_bl24.f 868a5a4af3bSchristos SI f_disp24; 869a5a4af3bSchristos 870a5a4af3bSchristos f_disp24 = ((((EXTRACT_MSB0_SINT (insn, 32, 8, 24)) << (2))) + (pc)); 871a5a4af3bSchristos 872a5a4af3bSchristos /* Record the fields for the semantic handler. */ 873a5a4af3bSchristos FLD (i_disp24) = f_disp24; 874a5a4af3bSchristos CGEN_TRACE_EXTRACT (current_cpu, abuf, (current_cpu, pc, "sfmt_bc24", "disp24 0x%x", 'x', f_disp24, (char *) 0)); 875a5a4af3bSchristos 876a5a4af3bSchristos #if WITH_PROFILE_MODEL_P 877a5a4af3bSchristos /* Record the fields for profiling. */ 878a5a4af3bSchristos if (PROFILE_MODEL_P (current_cpu)) 879a5a4af3bSchristos { 880a5a4af3bSchristos } 881a5a4af3bSchristos #endif 882a5a4af3bSchristos #undef FLD 883a5a4af3bSchristos return idesc; 884a5a4af3bSchristos } 885a5a4af3bSchristos 886a5a4af3bSchristos extract_sfmt_beq: 887a5a4af3bSchristos { 888a5a4af3bSchristos const IDESC *idesc = &m32rbf_insn_data[itype]; 889a5a4af3bSchristos CGEN_INSN_WORD insn = entire_insn; 890a5a4af3bSchristos #define FLD(f) abuf->fields.sfmt_beq.f 891a5a4af3bSchristos UINT f_r1; 892a5a4af3bSchristos UINT f_r2; 893a5a4af3bSchristos SI f_disp16; 894a5a4af3bSchristos 895a5a4af3bSchristos f_r1 = EXTRACT_MSB0_UINT (insn, 32, 4, 4); 896a5a4af3bSchristos f_r2 = EXTRACT_MSB0_UINT (insn, 32, 12, 4); 897a5a4af3bSchristos f_disp16 = ((((EXTRACT_MSB0_SINT (insn, 32, 16, 16)) << (2))) + (pc)); 898a5a4af3bSchristos 899a5a4af3bSchristos /* Record the fields for the semantic handler. */ 900a5a4af3bSchristos FLD (f_r1) = f_r1; 901a5a4af3bSchristos FLD (f_r2) = f_r2; 902a5a4af3bSchristos FLD (i_disp16) = f_disp16; 903a5a4af3bSchristos FLD (i_src1) = & CPU (h_gr)[f_r1]; 904a5a4af3bSchristos FLD (i_src2) = & CPU (h_gr)[f_r2]; 905a5a4af3bSchristos CGEN_TRACE_EXTRACT (current_cpu, abuf, (current_cpu, pc, "sfmt_beq", "f_r1 0x%x", 'x', f_r1, "f_r2 0x%x", 'x', f_r2, "disp16 0x%x", 'x', f_disp16, "src1 0x%x", 'x', f_r1, "src2 0x%x", 'x', f_r2, (char *) 0)); 906a5a4af3bSchristos 907a5a4af3bSchristos #if WITH_PROFILE_MODEL_P 908a5a4af3bSchristos /* Record the fields for profiling. */ 909a5a4af3bSchristos if (PROFILE_MODEL_P (current_cpu)) 910a5a4af3bSchristos { 911a5a4af3bSchristos FLD (in_src1) = f_r1; 912a5a4af3bSchristos FLD (in_src2) = f_r2; 913a5a4af3bSchristos } 914a5a4af3bSchristos #endif 915a5a4af3bSchristos #undef FLD 916a5a4af3bSchristos return idesc; 917a5a4af3bSchristos } 918a5a4af3bSchristos 919a5a4af3bSchristos extract_sfmt_beqz: 920a5a4af3bSchristos { 921a5a4af3bSchristos const IDESC *idesc = &m32rbf_insn_data[itype]; 922a5a4af3bSchristos CGEN_INSN_WORD insn = entire_insn; 923a5a4af3bSchristos #define FLD(f) abuf->fields.sfmt_beq.f 924a5a4af3bSchristos UINT f_r2; 925a5a4af3bSchristos SI f_disp16; 926a5a4af3bSchristos 927a5a4af3bSchristos f_r2 = EXTRACT_MSB0_UINT (insn, 32, 12, 4); 928a5a4af3bSchristos f_disp16 = ((((EXTRACT_MSB0_SINT (insn, 32, 16, 16)) << (2))) + (pc)); 929a5a4af3bSchristos 930a5a4af3bSchristos /* Record the fields for the semantic handler. */ 931a5a4af3bSchristos FLD (f_r2) = f_r2; 932a5a4af3bSchristos FLD (i_disp16) = f_disp16; 933a5a4af3bSchristos FLD (i_src2) = & CPU (h_gr)[f_r2]; 934a5a4af3bSchristos CGEN_TRACE_EXTRACT (current_cpu, abuf, (current_cpu, pc, "sfmt_beqz", "f_r2 0x%x", 'x', f_r2, "disp16 0x%x", 'x', f_disp16, "src2 0x%x", 'x', f_r2, (char *) 0)); 935a5a4af3bSchristos 936a5a4af3bSchristos #if WITH_PROFILE_MODEL_P 937a5a4af3bSchristos /* Record the fields for profiling. */ 938a5a4af3bSchristos if (PROFILE_MODEL_P (current_cpu)) 939a5a4af3bSchristos { 940a5a4af3bSchristos FLD (in_src2) = f_r2; 941a5a4af3bSchristos } 942a5a4af3bSchristos #endif 943a5a4af3bSchristos #undef FLD 944a5a4af3bSchristos return idesc; 945a5a4af3bSchristos } 946a5a4af3bSchristos 947a5a4af3bSchristos extract_sfmt_bl8: 948a5a4af3bSchristos { 949a5a4af3bSchristos const IDESC *idesc = &m32rbf_insn_data[itype]; 950a5a4af3bSchristos CGEN_INSN_WORD insn = entire_insn; 951a5a4af3bSchristos #define FLD(f) abuf->fields.sfmt_bl8.f 952a5a4af3bSchristos SI f_disp8; 953a5a4af3bSchristos 954a5a4af3bSchristos f_disp8 = ((((EXTRACT_MSB0_SINT (insn, 16, 8, 8)) << (2))) + (((pc) & (-4)))); 955a5a4af3bSchristos 956a5a4af3bSchristos /* Record the fields for the semantic handler. */ 957a5a4af3bSchristos FLD (i_disp8) = f_disp8; 958a5a4af3bSchristos CGEN_TRACE_EXTRACT (current_cpu, abuf, (current_cpu, pc, "sfmt_bl8", "disp8 0x%x", 'x', f_disp8, (char *) 0)); 959a5a4af3bSchristos 960a5a4af3bSchristos #if WITH_PROFILE_MODEL_P 961a5a4af3bSchristos /* Record the fields for profiling. */ 962a5a4af3bSchristos if (PROFILE_MODEL_P (current_cpu)) 963a5a4af3bSchristos { 964a5a4af3bSchristos FLD (out_h_gr_SI_14) = 14; 965a5a4af3bSchristos } 966a5a4af3bSchristos #endif 967a5a4af3bSchristos #undef FLD 968a5a4af3bSchristos return idesc; 969a5a4af3bSchristos } 970a5a4af3bSchristos 971a5a4af3bSchristos extract_sfmt_bl24: 972a5a4af3bSchristos { 973a5a4af3bSchristos const IDESC *idesc = &m32rbf_insn_data[itype]; 974a5a4af3bSchristos CGEN_INSN_WORD insn = entire_insn; 975a5a4af3bSchristos #define FLD(f) abuf->fields.sfmt_bl24.f 976a5a4af3bSchristos SI f_disp24; 977a5a4af3bSchristos 978a5a4af3bSchristos f_disp24 = ((((EXTRACT_MSB0_SINT (insn, 32, 8, 24)) << (2))) + (pc)); 979a5a4af3bSchristos 980a5a4af3bSchristos /* Record the fields for the semantic handler. */ 981a5a4af3bSchristos FLD (i_disp24) = f_disp24; 982a5a4af3bSchristos CGEN_TRACE_EXTRACT (current_cpu, abuf, (current_cpu, pc, "sfmt_bl24", "disp24 0x%x", 'x', f_disp24, (char *) 0)); 983a5a4af3bSchristos 984a5a4af3bSchristos #if WITH_PROFILE_MODEL_P 985a5a4af3bSchristos /* Record the fields for profiling. */ 986a5a4af3bSchristos if (PROFILE_MODEL_P (current_cpu)) 987a5a4af3bSchristos { 988a5a4af3bSchristos FLD (out_h_gr_SI_14) = 14; 989a5a4af3bSchristos } 990a5a4af3bSchristos #endif 991a5a4af3bSchristos #undef FLD 992a5a4af3bSchristos return idesc; 993a5a4af3bSchristos } 994a5a4af3bSchristos 995a5a4af3bSchristos extract_sfmt_bra8: 996a5a4af3bSchristos { 997a5a4af3bSchristos const IDESC *idesc = &m32rbf_insn_data[itype]; 998a5a4af3bSchristos CGEN_INSN_WORD insn = entire_insn; 999a5a4af3bSchristos #define FLD(f) abuf->fields.sfmt_bl8.f 1000a5a4af3bSchristos SI f_disp8; 1001a5a4af3bSchristos 1002a5a4af3bSchristos f_disp8 = ((((EXTRACT_MSB0_SINT (insn, 16, 8, 8)) << (2))) + (((pc) & (-4)))); 1003a5a4af3bSchristos 1004a5a4af3bSchristos /* Record the fields for the semantic handler. */ 1005a5a4af3bSchristos FLD (i_disp8) = f_disp8; 1006a5a4af3bSchristos CGEN_TRACE_EXTRACT (current_cpu, abuf, (current_cpu, pc, "sfmt_bra8", "disp8 0x%x", 'x', f_disp8, (char *) 0)); 1007a5a4af3bSchristos 1008a5a4af3bSchristos #if WITH_PROFILE_MODEL_P 1009a5a4af3bSchristos /* Record the fields for profiling. */ 1010a5a4af3bSchristos if (PROFILE_MODEL_P (current_cpu)) 1011a5a4af3bSchristos { 1012a5a4af3bSchristos } 1013a5a4af3bSchristos #endif 1014a5a4af3bSchristos #undef FLD 1015a5a4af3bSchristos return idesc; 1016a5a4af3bSchristos } 1017a5a4af3bSchristos 1018a5a4af3bSchristos extract_sfmt_bra24: 1019a5a4af3bSchristos { 1020a5a4af3bSchristos const IDESC *idesc = &m32rbf_insn_data[itype]; 1021a5a4af3bSchristos CGEN_INSN_WORD insn = entire_insn; 1022a5a4af3bSchristos #define FLD(f) abuf->fields.sfmt_bl24.f 1023a5a4af3bSchristos SI f_disp24; 1024a5a4af3bSchristos 1025a5a4af3bSchristos f_disp24 = ((((EXTRACT_MSB0_SINT (insn, 32, 8, 24)) << (2))) + (pc)); 1026a5a4af3bSchristos 1027a5a4af3bSchristos /* Record the fields for the semantic handler. */ 1028a5a4af3bSchristos FLD (i_disp24) = f_disp24; 1029a5a4af3bSchristos CGEN_TRACE_EXTRACT (current_cpu, abuf, (current_cpu, pc, "sfmt_bra24", "disp24 0x%x", 'x', f_disp24, (char *) 0)); 1030a5a4af3bSchristos 1031a5a4af3bSchristos #if WITH_PROFILE_MODEL_P 1032a5a4af3bSchristos /* Record the fields for profiling. */ 1033a5a4af3bSchristos if (PROFILE_MODEL_P (current_cpu)) 1034a5a4af3bSchristos { 1035a5a4af3bSchristos } 1036a5a4af3bSchristos #endif 1037a5a4af3bSchristos #undef FLD 1038a5a4af3bSchristos return idesc; 1039a5a4af3bSchristos } 1040a5a4af3bSchristos 1041a5a4af3bSchristos extract_sfmt_cmp: 1042a5a4af3bSchristos { 1043a5a4af3bSchristos const IDESC *idesc = &m32rbf_insn_data[itype]; 1044a5a4af3bSchristos CGEN_INSN_WORD insn = entire_insn; 1045a5a4af3bSchristos #define FLD(f) abuf->fields.sfmt_st_plus.f 1046a5a4af3bSchristos UINT f_r1; 1047a5a4af3bSchristos UINT f_r2; 1048a5a4af3bSchristos 1049a5a4af3bSchristos f_r1 = EXTRACT_MSB0_UINT (insn, 16, 4, 4); 1050a5a4af3bSchristos f_r2 = EXTRACT_MSB0_UINT (insn, 16, 12, 4); 1051a5a4af3bSchristos 1052a5a4af3bSchristos /* Record the fields for the semantic handler. */ 1053a5a4af3bSchristos FLD (f_r1) = f_r1; 1054a5a4af3bSchristos FLD (f_r2) = f_r2; 1055a5a4af3bSchristos FLD (i_src1) = & CPU (h_gr)[f_r1]; 1056a5a4af3bSchristos FLD (i_src2) = & CPU (h_gr)[f_r2]; 1057a5a4af3bSchristos CGEN_TRACE_EXTRACT (current_cpu, abuf, (current_cpu, pc, "sfmt_cmp", "f_r1 0x%x", 'x', f_r1, "f_r2 0x%x", 'x', f_r2, "src1 0x%x", 'x', f_r1, "src2 0x%x", 'x', f_r2, (char *) 0)); 1058a5a4af3bSchristos 1059a5a4af3bSchristos #if WITH_PROFILE_MODEL_P 1060a5a4af3bSchristos /* Record the fields for profiling. */ 1061a5a4af3bSchristos if (PROFILE_MODEL_P (current_cpu)) 1062a5a4af3bSchristos { 1063a5a4af3bSchristos FLD (in_src1) = f_r1; 1064a5a4af3bSchristos FLD (in_src2) = f_r2; 1065a5a4af3bSchristos } 1066a5a4af3bSchristos #endif 1067a5a4af3bSchristos #undef FLD 1068a5a4af3bSchristos return idesc; 1069a5a4af3bSchristos } 1070a5a4af3bSchristos 1071a5a4af3bSchristos extract_sfmt_cmpi: 1072a5a4af3bSchristos { 1073a5a4af3bSchristos const IDESC *idesc = &m32rbf_insn_data[itype]; 1074a5a4af3bSchristos CGEN_INSN_WORD insn = entire_insn; 1075a5a4af3bSchristos #define FLD(f) abuf->fields.sfmt_st_d.f 1076a5a4af3bSchristos UINT f_r2; 1077a5a4af3bSchristos INT f_simm16; 1078a5a4af3bSchristos 1079a5a4af3bSchristos f_r2 = EXTRACT_MSB0_UINT (insn, 32, 12, 4); 1080a5a4af3bSchristos f_simm16 = EXTRACT_MSB0_SINT (insn, 32, 16, 16); 1081a5a4af3bSchristos 1082a5a4af3bSchristos /* Record the fields for the semantic handler. */ 1083a5a4af3bSchristos FLD (f_simm16) = f_simm16; 1084a5a4af3bSchristos FLD (f_r2) = f_r2; 1085a5a4af3bSchristos FLD (i_src2) = & CPU (h_gr)[f_r2]; 1086a5a4af3bSchristos CGEN_TRACE_EXTRACT (current_cpu, abuf, (current_cpu, pc, "sfmt_cmpi", "f_simm16 0x%x", 'x', f_simm16, "f_r2 0x%x", 'x', f_r2, "src2 0x%x", 'x', f_r2, (char *) 0)); 1087a5a4af3bSchristos 1088a5a4af3bSchristos #if WITH_PROFILE_MODEL_P 1089a5a4af3bSchristos /* Record the fields for profiling. */ 1090a5a4af3bSchristos if (PROFILE_MODEL_P (current_cpu)) 1091a5a4af3bSchristos { 1092a5a4af3bSchristos FLD (in_src2) = f_r2; 1093a5a4af3bSchristos } 1094a5a4af3bSchristos #endif 1095a5a4af3bSchristos #undef FLD 1096a5a4af3bSchristos return idesc; 1097a5a4af3bSchristos } 1098a5a4af3bSchristos 1099a5a4af3bSchristos extract_sfmt_div: 1100a5a4af3bSchristos { 1101a5a4af3bSchristos const IDESC *idesc = &m32rbf_insn_data[itype]; 1102a5a4af3bSchristos CGEN_INSN_WORD insn = entire_insn; 1103a5a4af3bSchristos #define FLD(f) abuf->fields.sfmt_add.f 1104a5a4af3bSchristos UINT f_r1; 1105a5a4af3bSchristos UINT f_r2; 1106a5a4af3bSchristos 1107a5a4af3bSchristos f_r1 = EXTRACT_MSB0_UINT (insn, 32, 4, 4); 1108a5a4af3bSchristos f_r2 = EXTRACT_MSB0_UINT (insn, 32, 12, 4); 1109a5a4af3bSchristos 1110a5a4af3bSchristos /* Record the fields for the semantic handler. */ 1111a5a4af3bSchristos FLD (f_r1) = f_r1; 1112a5a4af3bSchristos FLD (f_r2) = f_r2; 1113a5a4af3bSchristos FLD (i_dr) = & CPU (h_gr)[f_r1]; 1114a5a4af3bSchristos FLD (i_sr) = & CPU (h_gr)[f_r2]; 1115a5a4af3bSchristos CGEN_TRACE_EXTRACT (current_cpu, abuf, (current_cpu, pc, "sfmt_div", "f_r1 0x%x", 'x', f_r1, "f_r2 0x%x", 'x', f_r2, "dr 0x%x", 'x', f_r1, "sr 0x%x", 'x', f_r2, (char *) 0)); 1116a5a4af3bSchristos 1117a5a4af3bSchristos #if WITH_PROFILE_MODEL_P 1118a5a4af3bSchristos /* Record the fields for profiling. */ 1119a5a4af3bSchristos if (PROFILE_MODEL_P (current_cpu)) 1120a5a4af3bSchristos { 1121a5a4af3bSchristos FLD (in_dr) = f_r1; 1122a5a4af3bSchristos FLD (in_sr) = f_r2; 1123a5a4af3bSchristos FLD (out_dr) = f_r1; 1124a5a4af3bSchristos } 1125a5a4af3bSchristos #endif 1126a5a4af3bSchristos #undef FLD 1127a5a4af3bSchristos return idesc; 1128a5a4af3bSchristos } 1129a5a4af3bSchristos 1130a5a4af3bSchristos extract_sfmt_jl: 1131a5a4af3bSchristos { 1132a5a4af3bSchristos const IDESC *idesc = &m32rbf_insn_data[itype]; 1133a5a4af3bSchristos CGEN_INSN_WORD insn = entire_insn; 1134a5a4af3bSchristos #define FLD(f) abuf->fields.sfmt_jl.f 1135a5a4af3bSchristos UINT f_r2; 1136a5a4af3bSchristos 1137a5a4af3bSchristos f_r2 = EXTRACT_MSB0_UINT (insn, 16, 12, 4); 1138a5a4af3bSchristos 1139a5a4af3bSchristos /* Record the fields for the semantic handler. */ 1140a5a4af3bSchristos FLD (f_r2) = f_r2; 1141a5a4af3bSchristos FLD (i_sr) = & CPU (h_gr)[f_r2]; 1142a5a4af3bSchristos CGEN_TRACE_EXTRACT (current_cpu, abuf, (current_cpu, pc, "sfmt_jl", "f_r2 0x%x", 'x', f_r2, "sr 0x%x", 'x', f_r2, (char *) 0)); 1143a5a4af3bSchristos 1144a5a4af3bSchristos #if WITH_PROFILE_MODEL_P 1145a5a4af3bSchristos /* Record the fields for profiling. */ 1146a5a4af3bSchristos if (PROFILE_MODEL_P (current_cpu)) 1147a5a4af3bSchristos { 1148a5a4af3bSchristos FLD (in_sr) = f_r2; 1149a5a4af3bSchristos FLD (out_h_gr_SI_14) = 14; 1150a5a4af3bSchristos } 1151a5a4af3bSchristos #endif 1152a5a4af3bSchristos #undef FLD 1153a5a4af3bSchristos return idesc; 1154a5a4af3bSchristos } 1155a5a4af3bSchristos 1156a5a4af3bSchristos extract_sfmt_jmp: 1157a5a4af3bSchristos { 1158a5a4af3bSchristos const IDESC *idesc = &m32rbf_insn_data[itype]; 1159a5a4af3bSchristos CGEN_INSN_WORD insn = entire_insn; 1160a5a4af3bSchristos #define FLD(f) abuf->fields.sfmt_jl.f 1161a5a4af3bSchristos UINT f_r2; 1162a5a4af3bSchristos 1163a5a4af3bSchristos f_r2 = EXTRACT_MSB0_UINT (insn, 16, 12, 4); 1164a5a4af3bSchristos 1165a5a4af3bSchristos /* Record the fields for the semantic handler. */ 1166a5a4af3bSchristos FLD (f_r2) = f_r2; 1167a5a4af3bSchristos FLD (i_sr) = & CPU (h_gr)[f_r2]; 1168a5a4af3bSchristos CGEN_TRACE_EXTRACT (current_cpu, abuf, (current_cpu, pc, "sfmt_jmp", "f_r2 0x%x", 'x', f_r2, "sr 0x%x", 'x', f_r2, (char *) 0)); 1169a5a4af3bSchristos 1170a5a4af3bSchristos #if WITH_PROFILE_MODEL_P 1171a5a4af3bSchristos /* Record the fields for profiling. */ 1172a5a4af3bSchristos if (PROFILE_MODEL_P (current_cpu)) 1173a5a4af3bSchristos { 1174a5a4af3bSchristos FLD (in_sr) = f_r2; 1175a5a4af3bSchristos } 1176a5a4af3bSchristos #endif 1177a5a4af3bSchristos #undef FLD 1178a5a4af3bSchristos return idesc; 1179a5a4af3bSchristos } 1180a5a4af3bSchristos 1181a5a4af3bSchristos extract_sfmt_ld: 1182a5a4af3bSchristos { 1183a5a4af3bSchristos const IDESC *idesc = &m32rbf_insn_data[itype]; 1184a5a4af3bSchristos CGEN_INSN_WORD insn = entire_insn; 1185a5a4af3bSchristos #define FLD(f) abuf->fields.sfmt_ld_plus.f 1186a5a4af3bSchristos UINT f_r1; 1187a5a4af3bSchristos UINT f_r2; 1188a5a4af3bSchristos 1189a5a4af3bSchristos f_r1 = EXTRACT_MSB0_UINT (insn, 16, 4, 4); 1190a5a4af3bSchristos f_r2 = EXTRACT_MSB0_UINT (insn, 16, 12, 4); 1191a5a4af3bSchristos 1192a5a4af3bSchristos /* Record the fields for the semantic handler. */ 1193a5a4af3bSchristos FLD (f_r2) = f_r2; 1194a5a4af3bSchristos FLD (f_r1) = f_r1; 1195a5a4af3bSchristos FLD (i_sr) = & CPU (h_gr)[f_r2]; 1196a5a4af3bSchristos FLD (i_dr) = & CPU (h_gr)[f_r1]; 1197a5a4af3bSchristos CGEN_TRACE_EXTRACT (current_cpu, abuf, (current_cpu, pc, "sfmt_ld", "f_r2 0x%x", 'x', f_r2, "f_r1 0x%x", 'x', f_r1, "sr 0x%x", 'x', f_r2, "dr 0x%x", 'x', f_r1, (char *) 0)); 1198a5a4af3bSchristos 1199a5a4af3bSchristos #if WITH_PROFILE_MODEL_P 1200a5a4af3bSchristos /* Record the fields for profiling. */ 1201a5a4af3bSchristos if (PROFILE_MODEL_P (current_cpu)) 1202a5a4af3bSchristos { 1203a5a4af3bSchristos FLD (in_sr) = f_r2; 1204a5a4af3bSchristos FLD (out_dr) = f_r1; 1205a5a4af3bSchristos } 1206a5a4af3bSchristos #endif 1207a5a4af3bSchristos #undef FLD 1208a5a4af3bSchristos return idesc; 1209a5a4af3bSchristos } 1210a5a4af3bSchristos 1211a5a4af3bSchristos extract_sfmt_ld_d: 1212a5a4af3bSchristos { 1213a5a4af3bSchristos const IDESC *idesc = &m32rbf_insn_data[itype]; 1214a5a4af3bSchristos CGEN_INSN_WORD insn = entire_insn; 1215a5a4af3bSchristos #define FLD(f) abuf->fields.sfmt_add3.f 1216a5a4af3bSchristos UINT f_r1; 1217a5a4af3bSchristos UINT f_r2; 1218a5a4af3bSchristos INT f_simm16; 1219a5a4af3bSchristos 1220a5a4af3bSchristos f_r1 = EXTRACT_MSB0_UINT (insn, 32, 4, 4); 1221a5a4af3bSchristos f_r2 = EXTRACT_MSB0_UINT (insn, 32, 12, 4); 1222a5a4af3bSchristos f_simm16 = EXTRACT_MSB0_SINT (insn, 32, 16, 16); 1223a5a4af3bSchristos 1224a5a4af3bSchristos /* Record the fields for the semantic handler. */ 1225a5a4af3bSchristos FLD (f_simm16) = f_simm16; 1226a5a4af3bSchristos FLD (f_r2) = f_r2; 1227a5a4af3bSchristos FLD (f_r1) = f_r1; 1228a5a4af3bSchristos FLD (i_sr) = & CPU (h_gr)[f_r2]; 1229a5a4af3bSchristos FLD (i_dr) = & CPU (h_gr)[f_r1]; 1230a5a4af3bSchristos CGEN_TRACE_EXTRACT (current_cpu, abuf, (current_cpu, pc, "sfmt_ld_d", "f_simm16 0x%x", 'x', f_simm16, "f_r2 0x%x", 'x', f_r2, "f_r1 0x%x", 'x', f_r1, "sr 0x%x", 'x', f_r2, "dr 0x%x", 'x', f_r1, (char *) 0)); 1231a5a4af3bSchristos 1232a5a4af3bSchristos #if WITH_PROFILE_MODEL_P 1233a5a4af3bSchristos /* Record the fields for profiling. */ 1234a5a4af3bSchristos if (PROFILE_MODEL_P (current_cpu)) 1235a5a4af3bSchristos { 1236a5a4af3bSchristos FLD (in_sr) = f_r2; 1237a5a4af3bSchristos FLD (out_dr) = f_r1; 1238a5a4af3bSchristos } 1239a5a4af3bSchristos #endif 1240a5a4af3bSchristos #undef FLD 1241a5a4af3bSchristos return idesc; 1242a5a4af3bSchristos } 1243a5a4af3bSchristos 1244a5a4af3bSchristos extract_sfmt_ldb: 1245a5a4af3bSchristos { 1246a5a4af3bSchristos const IDESC *idesc = &m32rbf_insn_data[itype]; 1247a5a4af3bSchristos CGEN_INSN_WORD insn = entire_insn; 1248a5a4af3bSchristos #define FLD(f) abuf->fields.sfmt_ld_plus.f 1249a5a4af3bSchristos UINT f_r1; 1250a5a4af3bSchristos UINT f_r2; 1251a5a4af3bSchristos 1252a5a4af3bSchristos f_r1 = EXTRACT_MSB0_UINT (insn, 16, 4, 4); 1253a5a4af3bSchristos f_r2 = EXTRACT_MSB0_UINT (insn, 16, 12, 4); 1254a5a4af3bSchristos 1255a5a4af3bSchristos /* Record the fields for the semantic handler. */ 1256a5a4af3bSchristos FLD (f_r2) = f_r2; 1257a5a4af3bSchristos FLD (f_r1) = f_r1; 1258a5a4af3bSchristos FLD (i_sr) = & CPU (h_gr)[f_r2]; 1259a5a4af3bSchristos FLD (i_dr) = & CPU (h_gr)[f_r1]; 1260a5a4af3bSchristos CGEN_TRACE_EXTRACT (current_cpu, abuf, (current_cpu, pc, "sfmt_ldb", "f_r2 0x%x", 'x', f_r2, "f_r1 0x%x", 'x', f_r1, "sr 0x%x", 'x', f_r2, "dr 0x%x", 'x', f_r1, (char *) 0)); 1261a5a4af3bSchristos 1262a5a4af3bSchristos #if WITH_PROFILE_MODEL_P 1263a5a4af3bSchristos /* Record the fields for profiling. */ 1264a5a4af3bSchristos if (PROFILE_MODEL_P (current_cpu)) 1265a5a4af3bSchristos { 1266a5a4af3bSchristos FLD (in_sr) = f_r2; 1267a5a4af3bSchristos FLD (out_dr) = f_r1; 1268a5a4af3bSchristos } 1269a5a4af3bSchristos #endif 1270a5a4af3bSchristos #undef FLD 1271a5a4af3bSchristos return idesc; 1272a5a4af3bSchristos } 1273a5a4af3bSchristos 1274a5a4af3bSchristos extract_sfmt_ldb_d: 1275a5a4af3bSchristos { 1276a5a4af3bSchristos const IDESC *idesc = &m32rbf_insn_data[itype]; 1277a5a4af3bSchristos CGEN_INSN_WORD insn = entire_insn; 1278a5a4af3bSchristos #define FLD(f) abuf->fields.sfmt_add3.f 1279a5a4af3bSchristos UINT f_r1; 1280a5a4af3bSchristos UINT f_r2; 1281a5a4af3bSchristos INT f_simm16; 1282a5a4af3bSchristos 1283a5a4af3bSchristos f_r1 = EXTRACT_MSB0_UINT (insn, 32, 4, 4); 1284a5a4af3bSchristos f_r2 = EXTRACT_MSB0_UINT (insn, 32, 12, 4); 1285a5a4af3bSchristos f_simm16 = EXTRACT_MSB0_SINT (insn, 32, 16, 16); 1286a5a4af3bSchristos 1287a5a4af3bSchristos /* Record the fields for the semantic handler. */ 1288a5a4af3bSchristos FLD (f_simm16) = f_simm16; 1289a5a4af3bSchristos FLD (f_r2) = f_r2; 1290a5a4af3bSchristos FLD (f_r1) = f_r1; 1291a5a4af3bSchristos FLD (i_sr) = & CPU (h_gr)[f_r2]; 1292a5a4af3bSchristos FLD (i_dr) = & CPU (h_gr)[f_r1]; 1293a5a4af3bSchristos CGEN_TRACE_EXTRACT (current_cpu, abuf, (current_cpu, pc, "sfmt_ldb_d", "f_simm16 0x%x", 'x', f_simm16, "f_r2 0x%x", 'x', f_r2, "f_r1 0x%x", 'x', f_r1, "sr 0x%x", 'x', f_r2, "dr 0x%x", 'x', f_r1, (char *) 0)); 1294a5a4af3bSchristos 1295a5a4af3bSchristos #if WITH_PROFILE_MODEL_P 1296a5a4af3bSchristos /* Record the fields for profiling. */ 1297a5a4af3bSchristos if (PROFILE_MODEL_P (current_cpu)) 1298a5a4af3bSchristos { 1299a5a4af3bSchristos FLD (in_sr) = f_r2; 1300a5a4af3bSchristos FLD (out_dr) = f_r1; 1301a5a4af3bSchristos } 1302a5a4af3bSchristos #endif 1303a5a4af3bSchristos #undef FLD 1304a5a4af3bSchristos return idesc; 1305a5a4af3bSchristos } 1306a5a4af3bSchristos 1307a5a4af3bSchristos extract_sfmt_ldh: 1308a5a4af3bSchristos { 1309a5a4af3bSchristos const IDESC *idesc = &m32rbf_insn_data[itype]; 1310a5a4af3bSchristos CGEN_INSN_WORD insn = entire_insn; 1311a5a4af3bSchristos #define FLD(f) abuf->fields.sfmt_ld_plus.f 1312a5a4af3bSchristos UINT f_r1; 1313a5a4af3bSchristos UINT f_r2; 1314a5a4af3bSchristos 1315a5a4af3bSchristos f_r1 = EXTRACT_MSB0_UINT (insn, 16, 4, 4); 1316a5a4af3bSchristos f_r2 = EXTRACT_MSB0_UINT (insn, 16, 12, 4); 1317a5a4af3bSchristos 1318a5a4af3bSchristos /* Record the fields for the semantic handler. */ 1319a5a4af3bSchristos FLD (f_r2) = f_r2; 1320a5a4af3bSchristos FLD (f_r1) = f_r1; 1321a5a4af3bSchristos FLD (i_sr) = & CPU (h_gr)[f_r2]; 1322a5a4af3bSchristos FLD (i_dr) = & CPU (h_gr)[f_r1]; 1323a5a4af3bSchristos CGEN_TRACE_EXTRACT (current_cpu, abuf, (current_cpu, pc, "sfmt_ldh", "f_r2 0x%x", 'x', f_r2, "f_r1 0x%x", 'x', f_r1, "sr 0x%x", 'x', f_r2, "dr 0x%x", 'x', f_r1, (char *) 0)); 1324a5a4af3bSchristos 1325a5a4af3bSchristos #if WITH_PROFILE_MODEL_P 1326a5a4af3bSchristos /* Record the fields for profiling. */ 1327a5a4af3bSchristos if (PROFILE_MODEL_P (current_cpu)) 1328a5a4af3bSchristos { 1329a5a4af3bSchristos FLD (in_sr) = f_r2; 1330a5a4af3bSchristos FLD (out_dr) = f_r1; 1331a5a4af3bSchristos } 1332a5a4af3bSchristos #endif 1333a5a4af3bSchristos #undef FLD 1334a5a4af3bSchristos return idesc; 1335a5a4af3bSchristos } 1336a5a4af3bSchristos 1337a5a4af3bSchristos extract_sfmt_ldh_d: 1338a5a4af3bSchristos { 1339a5a4af3bSchristos const IDESC *idesc = &m32rbf_insn_data[itype]; 1340a5a4af3bSchristos CGEN_INSN_WORD insn = entire_insn; 1341a5a4af3bSchristos #define FLD(f) abuf->fields.sfmt_add3.f 1342a5a4af3bSchristos UINT f_r1; 1343a5a4af3bSchristos UINT f_r2; 1344a5a4af3bSchristos INT f_simm16; 1345a5a4af3bSchristos 1346a5a4af3bSchristos f_r1 = EXTRACT_MSB0_UINT (insn, 32, 4, 4); 1347a5a4af3bSchristos f_r2 = EXTRACT_MSB0_UINT (insn, 32, 12, 4); 1348a5a4af3bSchristos f_simm16 = EXTRACT_MSB0_SINT (insn, 32, 16, 16); 1349a5a4af3bSchristos 1350a5a4af3bSchristos /* Record the fields for the semantic handler. */ 1351a5a4af3bSchristos FLD (f_simm16) = f_simm16; 1352a5a4af3bSchristos FLD (f_r2) = f_r2; 1353a5a4af3bSchristos FLD (f_r1) = f_r1; 1354a5a4af3bSchristos FLD (i_sr) = & CPU (h_gr)[f_r2]; 1355a5a4af3bSchristos FLD (i_dr) = & CPU (h_gr)[f_r1]; 1356a5a4af3bSchristos CGEN_TRACE_EXTRACT (current_cpu, abuf, (current_cpu, pc, "sfmt_ldh_d", "f_simm16 0x%x", 'x', f_simm16, "f_r2 0x%x", 'x', f_r2, "f_r1 0x%x", 'x', f_r1, "sr 0x%x", 'x', f_r2, "dr 0x%x", 'x', f_r1, (char *) 0)); 1357a5a4af3bSchristos 1358a5a4af3bSchristos #if WITH_PROFILE_MODEL_P 1359a5a4af3bSchristos /* Record the fields for profiling. */ 1360a5a4af3bSchristos if (PROFILE_MODEL_P (current_cpu)) 1361a5a4af3bSchristos { 1362a5a4af3bSchristos FLD (in_sr) = f_r2; 1363a5a4af3bSchristos FLD (out_dr) = f_r1; 1364a5a4af3bSchristos } 1365a5a4af3bSchristos #endif 1366a5a4af3bSchristos #undef FLD 1367a5a4af3bSchristos return idesc; 1368a5a4af3bSchristos } 1369a5a4af3bSchristos 1370a5a4af3bSchristos extract_sfmt_ld_plus: 1371a5a4af3bSchristos { 1372a5a4af3bSchristos const IDESC *idesc = &m32rbf_insn_data[itype]; 1373a5a4af3bSchristos CGEN_INSN_WORD insn = entire_insn; 1374a5a4af3bSchristos #define FLD(f) abuf->fields.sfmt_ld_plus.f 1375a5a4af3bSchristos UINT f_r1; 1376a5a4af3bSchristos UINT f_r2; 1377a5a4af3bSchristos 1378a5a4af3bSchristos f_r1 = EXTRACT_MSB0_UINT (insn, 16, 4, 4); 1379a5a4af3bSchristos f_r2 = EXTRACT_MSB0_UINT (insn, 16, 12, 4); 1380a5a4af3bSchristos 1381a5a4af3bSchristos /* Record the fields for the semantic handler. */ 1382a5a4af3bSchristos FLD (f_r2) = f_r2; 1383a5a4af3bSchristos FLD (f_r1) = f_r1; 1384a5a4af3bSchristos FLD (i_sr) = & CPU (h_gr)[f_r2]; 1385a5a4af3bSchristos FLD (i_dr) = & CPU (h_gr)[f_r1]; 1386a5a4af3bSchristos CGEN_TRACE_EXTRACT (current_cpu, abuf, (current_cpu, pc, "sfmt_ld_plus", "f_r2 0x%x", 'x', f_r2, "f_r1 0x%x", 'x', f_r1, "sr 0x%x", 'x', f_r2, "dr 0x%x", 'x', f_r1, (char *) 0)); 1387a5a4af3bSchristos 1388a5a4af3bSchristos #if WITH_PROFILE_MODEL_P 1389a5a4af3bSchristos /* Record the fields for profiling. */ 1390a5a4af3bSchristos if (PROFILE_MODEL_P (current_cpu)) 1391a5a4af3bSchristos { 1392a5a4af3bSchristos FLD (in_sr) = f_r2; 1393a5a4af3bSchristos FLD (out_dr) = f_r1; 1394a5a4af3bSchristos FLD (out_sr) = f_r2; 1395a5a4af3bSchristos } 1396a5a4af3bSchristos #endif 1397a5a4af3bSchristos #undef FLD 1398a5a4af3bSchristos return idesc; 1399a5a4af3bSchristos } 1400a5a4af3bSchristos 1401a5a4af3bSchristos extract_sfmt_ld24: 1402a5a4af3bSchristos { 1403a5a4af3bSchristos const IDESC *idesc = &m32rbf_insn_data[itype]; 1404a5a4af3bSchristos CGEN_INSN_WORD insn = entire_insn; 1405a5a4af3bSchristos #define FLD(f) abuf->fields.sfmt_ld24.f 1406a5a4af3bSchristos UINT f_r1; 1407a5a4af3bSchristos UINT f_uimm24; 1408a5a4af3bSchristos 1409a5a4af3bSchristos f_r1 = EXTRACT_MSB0_UINT (insn, 32, 4, 4); 1410a5a4af3bSchristos f_uimm24 = EXTRACT_MSB0_UINT (insn, 32, 8, 24); 1411a5a4af3bSchristos 1412a5a4af3bSchristos /* Record the fields for the semantic handler. */ 1413a5a4af3bSchristos FLD (f_r1) = f_r1; 1414a5a4af3bSchristos FLD (i_uimm24) = f_uimm24; 1415a5a4af3bSchristos FLD (i_dr) = & CPU (h_gr)[f_r1]; 1416a5a4af3bSchristos CGEN_TRACE_EXTRACT (current_cpu, abuf, (current_cpu, pc, "sfmt_ld24", "f_r1 0x%x", 'x', f_r1, "uimm24 0x%x", 'x', f_uimm24, "dr 0x%x", 'x', f_r1, (char *) 0)); 1417a5a4af3bSchristos 1418a5a4af3bSchristos #if WITH_PROFILE_MODEL_P 1419a5a4af3bSchristos /* Record the fields for profiling. */ 1420a5a4af3bSchristos if (PROFILE_MODEL_P (current_cpu)) 1421a5a4af3bSchristos { 1422a5a4af3bSchristos FLD (out_dr) = f_r1; 1423a5a4af3bSchristos } 1424a5a4af3bSchristos #endif 1425a5a4af3bSchristos #undef FLD 1426a5a4af3bSchristos return idesc; 1427a5a4af3bSchristos } 1428a5a4af3bSchristos 1429a5a4af3bSchristos extract_sfmt_ldi8: 1430a5a4af3bSchristos { 1431a5a4af3bSchristos const IDESC *idesc = &m32rbf_insn_data[itype]; 1432a5a4af3bSchristos CGEN_INSN_WORD insn = entire_insn; 1433a5a4af3bSchristos #define FLD(f) abuf->fields.sfmt_addi.f 1434a5a4af3bSchristos UINT f_r1; 1435a5a4af3bSchristos INT f_simm8; 1436a5a4af3bSchristos 1437a5a4af3bSchristos f_r1 = EXTRACT_MSB0_UINT (insn, 16, 4, 4); 1438a5a4af3bSchristos f_simm8 = EXTRACT_MSB0_SINT (insn, 16, 8, 8); 1439a5a4af3bSchristos 1440a5a4af3bSchristos /* Record the fields for the semantic handler. */ 1441a5a4af3bSchristos FLD (f_simm8) = f_simm8; 1442a5a4af3bSchristos FLD (f_r1) = f_r1; 1443a5a4af3bSchristos FLD (i_dr) = & CPU (h_gr)[f_r1]; 1444a5a4af3bSchristos CGEN_TRACE_EXTRACT (current_cpu, abuf, (current_cpu, pc, "sfmt_ldi8", "f_simm8 0x%x", 'x', f_simm8, "f_r1 0x%x", 'x', f_r1, "dr 0x%x", 'x', f_r1, (char *) 0)); 1445a5a4af3bSchristos 1446a5a4af3bSchristos #if WITH_PROFILE_MODEL_P 1447a5a4af3bSchristos /* Record the fields for profiling. */ 1448a5a4af3bSchristos if (PROFILE_MODEL_P (current_cpu)) 1449a5a4af3bSchristos { 1450a5a4af3bSchristos FLD (out_dr) = f_r1; 1451a5a4af3bSchristos } 1452a5a4af3bSchristos #endif 1453a5a4af3bSchristos #undef FLD 1454a5a4af3bSchristos return idesc; 1455a5a4af3bSchristos } 1456a5a4af3bSchristos 1457a5a4af3bSchristos extract_sfmt_ldi16: 1458a5a4af3bSchristos { 1459a5a4af3bSchristos const IDESC *idesc = &m32rbf_insn_data[itype]; 1460a5a4af3bSchristos CGEN_INSN_WORD insn = entire_insn; 1461a5a4af3bSchristos #define FLD(f) abuf->fields.sfmt_add3.f 1462a5a4af3bSchristos UINT f_r1; 1463a5a4af3bSchristos INT f_simm16; 1464a5a4af3bSchristos 1465a5a4af3bSchristos f_r1 = EXTRACT_MSB0_UINT (insn, 32, 4, 4); 1466a5a4af3bSchristos f_simm16 = EXTRACT_MSB0_SINT (insn, 32, 16, 16); 1467a5a4af3bSchristos 1468a5a4af3bSchristos /* Record the fields for the semantic handler. */ 1469a5a4af3bSchristos FLD (f_simm16) = f_simm16; 1470a5a4af3bSchristos FLD (f_r1) = f_r1; 1471a5a4af3bSchristos FLD (i_dr) = & CPU (h_gr)[f_r1]; 1472a5a4af3bSchristos CGEN_TRACE_EXTRACT (current_cpu, abuf, (current_cpu, pc, "sfmt_ldi16", "f_simm16 0x%x", 'x', f_simm16, "f_r1 0x%x", 'x', f_r1, "dr 0x%x", 'x', f_r1, (char *) 0)); 1473a5a4af3bSchristos 1474a5a4af3bSchristos #if WITH_PROFILE_MODEL_P 1475a5a4af3bSchristos /* Record the fields for profiling. */ 1476a5a4af3bSchristos if (PROFILE_MODEL_P (current_cpu)) 1477a5a4af3bSchristos { 1478a5a4af3bSchristos FLD (out_dr) = f_r1; 1479a5a4af3bSchristos } 1480a5a4af3bSchristos #endif 1481a5a4af3bSchristos #undef FLD 1482a5a4af3bSchristos return idesc; 1483a5a4af3bSchristos } 1484a5a4af3bSchristos 1485a5a4af3bSchristos extract_sfmt_lock: 1486a5a4af3bSchristos { 1487a5a4af3bSchristos const IDESC *idesc = &m32rbf_insn_data[itype]; 1488a5a4af3bSchristos CGEN_INSN_WORD insn = entire_insn; 1489a5a4af3bSchristos #define FLD(f) abuf->fields.sfmt_ld_plus.f 1490a5a4af3bSchristos UINT f_r1; 1491a5a4af3bSchristos UINT f_r2; 1492a5a4af3bSchristos 1493a5a4af3bSchristos f_r1 = EXTRACT_MSB0_UINT (insn, 16, 4, 4); 1494a5a4af3bSchristos f_r2 = EXTRACT_MSB0_UINT (insn, 16, 12, 4); 1495a5a4af3bSchristos 1496a5a4af3bSchristos /* Record the fields for the semantic handler. */ 1497a5a4af3bSchristos FLD (f_r2) = f_r2; 1498a5a4af3bSchristos FLD (f_r1) = f_r1; 1499a5a4af3bSchristos FLD (i_sr) = & CPU (h_gr)[f_r2]; 1500a5a4af3bSchristos FLD (i_dr) = & CPU (h_gr)[f_r1]; 1501a5a4af3bSchristos CGEN_TRACE_EXTRACT (current_cpu, abuf, (current_cpu, pc, "sfmt_lock", "f_r2 0x%x", 'x', f_r2, "f_r1 0x%x", 'x', f_r1, "sr 0x%x", 'x', f_r2, "dr 0x%x", 'x', f_r1, (char *) 0)); 1502a5a4af3bSchristos 1503a5a4af3bSchristos #if WITH_PROFILE_MODEL_P 1504a5a4af3bSchristos /* Record the fields for profiling. */ 1505a5a4af3bSchristos if (PROFILE_MODEL_P (current_cpu)) 1506a5a4af3bSchristos { 1507a5a4af3bSchristos FLD (in_sr) = f_r2; 1508a5a4af3bSchristos FLD (out_dr) = f_r1; 1509a5a4af3bSchristos } 1510a5a4af3bSchristos #endif 1511a5a4af3bSchristos #undef FLD 1512a5a4af3bSchristos return idesc; 1513a5a4af3bSchristos } 1514a5a4af3bSchristos 1515a5a4af3bSchristos extract_sfmt_machi: 1516a5a4af3bSchristos { 1517a5a4af3bSchristos const IDESC *idesc = &m32rbf_insn_data[itype]; 1518a5a4af3bSchristos CGEN_INSN_WORD insn = entire_insn; 1519a5a4af3bSchristos #define FLD(f) abuf->fields.sfmt_st_plus.f 1520a5a4af3bSchristos UINT f_r1; 1521a5a4af3bSchristos UINT f_r2; 1522a5a4af3bSchristos 1523a5a4af3bSchristos f_r1 = EXTRACT_MSB0_UINT (insn, 16, 4, 4); 1524a5a4af3bSchristos f_r2 = EXTRACT_MSB0_UINT (insn, 16, 12, 4); 1525a5a4af3bSchristos 1526a5a4af3bSchristos /* Record the fields for the semantic handler. */ 1527a5a4af3bSchristos FLD (f_r1) = f_r1; 1528a5a4af3bSchristos FLD (f_r2) = f_r2; 1529a5a4af3bSchristos FLD (i_src1) = & CPU (h_gr)[f_r1]; 1530a5a4af3bSchristos FLD (i_src2) = & CPU (h_gr)[f_r2]; 1531a5a4af3bSchristos CGEN_TRACE_EXTRACT (current_cpu, abuf, (current_cpu, pc, "sfmt_machi", "f_r1 0x%x", 'x', f_r1, "f_r2 0x%x", 'x', f_r2, "src1 0x%x", 'x', f_r1, "src2 0x%x", 'x', f_r2, (char *) 0)); 1532a5a4af3bSchristos 1533a5a4af3bSchristos #if WITH_PROFILE_MODEL_P 1534a5a4af3bSchristos /* Record the fields for profiling. */ 1535a5a4af3bSchristos if (PROFILE_MODEL_P (current_cpu)) 1536a5a4af3bSchristos { 1537a5a4af3bSchristos FLD (in_src1) = f_r1; 1538a5a4af3bSchristos FLD (in_src2) = f_r2; 1539a5a4af3bSchristos } 1540a5a4af3bSchristos #endif 1541a5a4af3bSchristos #undef FLD 1542a5a4af3bSchristos return idesc; 1543a5a4af3bSchristos } 1544a5a4af3bSchristos 1545a5a4af3bSchristos extract_sfmt_mulhi: 1546a5a4af3bSchristos { 1547a5a4af3bSchristos const IDESC *idesc = &m32rbf_insn_data[itype]; 1548a5a4af3bSchristos CGEN_INSN_WORD insn = entire_insn; 1549a5a4af3bSchristos #define FLD(f) abuf->fields.sfmt_st_plus.f 1550a5a4af3bSchristos UINT f_r1; 1551a5a4af3bSchristos UINT f_r2; 1552a5a4af3bSchristos 1553a5a4af3bSchristos f_r1 = EXTRACT_MSB0_UINT (insn, 16, 4, 4); 1554a5a4af3bSchristos f_r2 = EXTRACT_MSB0_UINT (insn, 16, 12, 4); 1555a5a4af3bSchristos 1556a5a4af3bSchristos /* Record the fields for the semantic handler. */ 1557a5a4af3bSchristos FLD (f_r1) = f_r1; 1558a5a4af3bSchristos FLD (f_r2) = f_r2; 1559a5a4af3bSchristos FLD (i_src1) = & CPU (h_gr)[f_r1]; 1560a5a4af3bSchristos FLD (i_src2) = & CPU (h_gr)[f_r2]; 1561a5a4af3bSchristos CGEN_TRACE_EXTRACT (current_cpu, abuf, (current_cpu, pc, "sfmt_mulhi", "f_r1 0x%x", 'x', f_r1, "f_r2 0x%x", 'x', f_r2, "src1 0x%x", 'x', f_r1, "src2 0x%x", 'x', f_r2, (char *) 0)); 1562a5a4af3bSchristos 1563a5a4af3bSchristos #if WITH_PROFILE_MODEL_P 1564a5a4af3bSchristos /* Record the fields for profiling. */ 1565a5a4af3bSchristos if (PROFILE_MODEL_P (current_cpu)) 1566a5a4af3bSchristos { 1567a5a4af3bSchristos FLD (in_src1) = f_r1; 1568a5a4af3bSchristos FLD (in_src2) = f_r2; 1569a5a4af3bSchristos } 1570a5a4af3bSchristos #endif 1571a5a4af3bSchristos #undef FLD 1572a5a4af3bSchristos return idesc; 1573a5a4af3bSchristos } 1574a5a4af3bSchristos 1575a5a4af3bSchristos extract_sfmt_mv: 1576a5a4af3bSchristos { 1577a5a4af3bSchristos const IDESC *idesc = &m32rbf_insn_data[itype]; 1578a5a4af3bSchristos CGEN_INSN_WORD insn = entire_insn; 1579a5a4af3bSchristos #define FLD(f) abuf->fields.sfmt_ld_plus.f 1580a5a4af3bSchristos UINT f_r1; 1581a5a4af3bSchristos UINT f_r2; 1582a5a4af3bSchristos 1583a5a4af3bSchristos f_r1 = EXTRACT_MSB0_UINT (insn, 16, 4, 4); 1584a5a4af3bSchristos f_r2 = EXTRACT_MSB0_UINT (insn, 16, 12, 4); 1585a5a4af3bSchristos 1586a5a4af3bSchristos /* Record the fields for the semantic handler. */ 1587a5a4af3bSchristos FLD (f_r2) = f_r2; 1588a5a4af3bSchristos FLD (f_r1) = f_r1; 1589a5a4af3bSchristos FLD (i_sr) = & CPU (h_gr)[f_r2]; 1590a5a4af3bSchristos FLD (i_dr) = & CPU (h_gr)[f_r1]; 1591a5a4af3bSchristos CGEN_TRACE_EXTRACT (current_cpu, abuf, (current_cpu, pc, "sfmt_mv", "f_r2 0x%x", 'x', f_r2, "f_r1 0x%x", 'x', f_r1, "sr 0x%x", 'x', f_r2, "dr 0x%x", 'x', f_r1, (char *) 0)); 1592a5a4af3bSchristos 1593a5a4af3bSchristos #if WITH_PROFILE_MODEL_P 1594a5a4af3bSchristos /* Record the fields for profiling. */ 1595a5a4af3bSchristos if (PROFILE_MODEL_P (current_cpu)) 1596a5a4af3bSchristos { 1597a5a4af3bSchristos FLD (in_sr) = f_r2; 1598a5a4af3bSchristos FLD (out_dr) = f_r1; 1599a5a4af3bSchristos } 1600a5a4af3bSchristos #endif 1601a5a4af3bSchristos #undef FLD 1602a5a4af3bSchristos return idesc; 1603a5a4af3bSchristos } 1604a5a4af3bSchristos 1605a5a4af3bSchristos extract_sfmt_mvfachi: 1606a5a4af3bSchristos { 1607a5a4af3bSchristos const IDESC *idesc = &m32rbf_insn_data[itype]; 1608a5a4af3bSchristos CGEN_INSN_WORD insn = entire_insn; 1609a5a4af3bSchristos #define FLD(f) abuf->fields.sfmt_seth.f 1610a5a4af3bSchristos UINT f_r1; 1611a5a4af3bSchristos 1612a5a4af3bSchristos f_r1 = EXTRACT_MSB0_UINT (insn, 16, 4, 4); 1613a5a4af3bSchristos 1614a5a4af3bSchristos /* Record the fields for the semantic handler. */ 1615a5a4af3bSchristos FLD (f_r1) = f_r1; 1616a5a4af3bSchristos FLD (i_dr) = & CPU (h_gr)[f_r1]; 1617a5a4af3bSchristos CGEN_TRACE_EXTRACT (current_cpu, abuf, (current_cpu, pc, "sfmt_mvfachi", "f_r1 0x%x", 'x', f_r1, "dr 0x%x", 'x', f_r1, (char *) 0)); 1618a5a4af3bSchristos 1619a5a4af3bSchristos #if WITH_PROFILE_MODEL_P 1620a5a4af3bSchristos /* Record the fields for profiling. */ 1621a5a4af3bSchristos if (PROFILE_MODEL_P (current_cpu)) 1622a5a4af3bSchristos { 1623a5a4af3bSchristos FLD (out_dr) = f_r1; 1624a5a4af3bSchristos } 1625a5a4af3bSchristos #endif 1626a5a4af3bSchristos #undef FLD 1627a5a4af3bSchristos return idesc; 1628a5a4af3bSchristos } 1629a5a4af3bSchristos 1630a5a4af3bSchristos extract_sfmt_mvfc: 1631a5a4af3bSchristos { 1632a5a4af3bSchristos const IDESC *idesc = &m32rbf_insn_data[itype]; 1633a5a4af3bSchristos CGEN_INSN_WORD insn = entire_insn; 1634a5a4af3bSchristos #define FLD(f) abuf->fields.sfmt_ld_plus.f 1635a5a4af3bSchristos UINT f_r1; 1636a5a4af3bSchristos UINT f_r2; 1637a5a4af3bSchristos 1638a5a4af3bSchristos f_r1 = EXTRACT_MSB0_UINT (insn, 16, 4, 4); 1639a5a4af3bSchristos f_r2 = EXTRACT_MSB0_UINT (insn, 16, 12, 4); 1640a5a4af3bSchristos 1641a5a4af3bSchristos /* Record the fields for the semantic handler. */ 1642a5a4af3bSchristos FLD (f_r2) = f_r2; 1643a5a4af3bSchristos FLD (f_r1) = f_r1; 1644a5a4af3bSchristos FLD (i_dr) = & CPU (h_gr)[f_r1]; 1645a5a4af3bSchristos CGEN_TRACE_EXTRACT (current_cpu, abuf, (current_cpu, pc, "sfmt_mvfc", "f_r2 0x%x", 'x', f_r2, "f_r1 0x%x", 'x', f_r1, "dr 0x%x", 'x', f_r1, (char *) 0)); 1646a5a4af3bSchristos 1647a5a4af3bSchristos #if WITH_PROFILE_MODEL_P 1648a5a4af3bSchristos /* Record the fields for profiling. */ 1649a5a4af3bSchristos if (PROFILE_MODEL_P (current_cpu)) 1650a5a4af3bSchristos { 1651a5a4af3bSchristos FLD (out_dr) = f_r1; 1652a5a4af3bSchristos } 1653a5a4af3bSchristos #endif 1654a5a4af3bSchristos #undef FLD 1655a5a4af3bSchristos return idesc; 1656a5a4af3bSchristos } 1657a5a4af3bSchristos 1658a5a4af3bSchristos extract_sfmt_mvtachi: 1659a5a4af3bSchristos { 1660a5a4af3bSchristos const IDESC *idesc = &m32rbf_insn_data[itype]; 1661a5a4af3bSchristos CGEN_INSN_WORD insn = entire_insn; 1662a5a4af3bSchristos #define FLD(f) abuf->fields.sfmt_st_plus.f 1663a5a4af3bSchristos UINT f_r1; 1664a5a4af3bSchristos 1665a5a4af3bSchristos f_r1 = EXTRACT_MSB0_UINT (insn, 16, 4, 4); 1666a5a4af3bSchristos 1667a5a4af3bSchristos /* Record the fields for the semantic handler. */ 1668a5a4af3bSchristos FLD (f_r1) = f_r1; 1669a5a4af3bSchristos FLD (i_src1) = & CPU (h_gr)[f_r1]; 1670a5a4af3bSchristos CGEN_TRACE_EXTRACT (current_cpu, abuf, (current_cpu, pc, "sfmt_mvtachi", "f_r1 0x%x", 'x', f_r1, "src1 0x%x", 'x', f_r1, (char *) 0)); 1671a5a4af3bSchristos 1672a5a4af3bSchristos #if WITH_PROFILE_MODEL_P 1673a5a4af3bSchristos /* Record the fields for profiling. */ 1674a5a4af3bSchristos if (PROFILE_MODEL_P (current_cpu)) 1675a5a4af3bSchristos { 1676a5a4af3bSchristos FLD (in_src1) = f_r1; 1677a5a4af3bSchristos } 1678a5a4af3bSchristos #endif 1679a5a4af3bSchristos #undef FLD 1680a5a4af3bSchristos return idesc; 1681a5a4af3bSchristos } 1682a5a4af3bSchristos 1683a5a4af3bSchristos extract_sfmt_mvtc: 1684a5a4af3bSchristos { 1685a5a4af3bSchristos const IDESC *idesc = &m32rbf_insn_data[itype]; 1686a5a4af3bSchristos CGEN_INSN_WORD insn = entire_insn; 1687a5a4af3bSchristos #define FLD(f) abuf->fields.sfmt_ld_plus.f 1688a5a4af3bSchristos UINT f_r1; 1689a5a4af3bSchristos UINT f_r2; 1690a5a4af3bSchristos 1691a5a4af3bSchristos f_r1 = EXTRACT_MSB0_UINT (insn, 16, 4, 4); 1692a5a4af3bSchristos f_r2 = EXTRACT_MSB0_UINT (insn, 16, 12, 4); 1693a5a4af3bSchristos 1694a5a4af3bSchristos /* Record the fields for the semantic handler. */ 1695a5a4af3bSchristos FLD (f_r2) = f_r2; 1696a5a4af3bSchristos FLD (f_r1) = f_r1; 1697a5a4af3bSchristos FLD (i_sr) = & CPU (h_gr)[f_r2]; 1698a5a4af3bSchristos CGEN_TRACE_EXTRACT (current_cpu, abuf, (current_cpu, pc, "sfmt_mvtc", "f_r2 0x%x", 'x', f_r2, "f_r1 0x%x", 'x', f_r1, "sr 0x%x", 'x', f_r2, (char *) 0)); 1699a5a4af3bSchristos 1700a5a4af3bSchristos #if WITH_PROFILE_MODEL_P 1701a5a4af3bSchristos /* Record the fields for profiling. */ 1702a5a4af3bSchristos if (PROFILE_MODEL_P (current_cpu)) 1703a5a4af3bSchristos { 1704a5a4af3bSchristos FLD (in_sr) = f_r2; 1705a5a4af3bSchristos } 1706a5a4af3bSchristos #endif 1707a5a4af3bSchristos #undef FLD 1708a5a4af3bSchristos return idesc; 1709a5a4af3bSchristos } 1710a5a4af3bSchristos 1711a5a4af3bSchristos extract_sfmt_nop: 1712a5a4af3bSchristos { 1713a5a4af3bSchristos const IDESC *idesc = &m32rbf_insn_data[itype]; 1714a5a4af3bSchristos #define FLD(f) abuf->fields.sfmt_empty.f 1715a5a4af3bSchristos 1716a5a4af3bSchristos 1717a5a4af3bSchristos /* Record the fields for the semantic handler. */ 1718a5a4af3bSchristos CGEN_TRACE_EXTRACT (current_cpu, abuf, (current_cpu, pc, "sfmt_nop", (char *) 0)); 1719a5a4af3bSchristos 1720a5a4af3bSchristos #undef FLD 1721a5a4af3bSchristos return idesc; 1722a5a4af3bSchristos } 1723a5a4af3bSchristos 1724a5a4af3bSchristos extract_sfmt_rac: 1725a5a4af3bSchristos { 1726a5a4af3bSchristos const IDESC *idesc = &m32rbf_insn_data[itype]; 1727a5a4af3bSchristos #define FLD(f) abuf->fields.sfmt_empty.f 1728a5a4af3bSchristos 1729a5a4af3bSchristos 1730a5a4af3bSchristos /* Record the fields for the semantic handler. */ 1731a5a4af3bSchristos CGEN_TRACE_EXTRACT (current_cpu, abuf, (current_cpu, pc, "sfmt_rac", (char *) 0)); 1732a5a4af3bSchristos 1733a5a4af3bSchristos #undef FLD 1734a5a4af3bSchristos return idesc; 1735a5a4af3bSchristos } 1736a5a4af3bSchristos 1737a5a4af3bSchristos extract_sfmt_rte: 1738a5a4af3bSchristos { 1739a5a4af3bSchristos const IDESC *idesc = &m32rbf_insn_data[itype]; 1740a5a4af3bSchristos #define FLD(f) abuf->fields.sfmt_empty.f 1741a5a4af3bSchristos 1742a5a4af3bSchristos 1743a5a4af3bSchristos /* Record the fields for the semantic handler. */ 1744a5a4af3bSchristos CGEN_TRACE_EXTRACT (current_cpu, abuf, (current_cpu, pc, "sfmt_rte", (char *) 0)); 1745a5a4af3bSchristos 1746a5a4af3bSchristos #if WITH_PROFILE_MODEL_P 1747a5a4af3bSchristos /* Record the fields for profiling. */ 1748a5a4af3bSchristos if (PROFILE_MODEL_P (current_cpu)) 1749a5a4af3bSchristos { 1750a5a4af3bSchristos } 1751a5a4af3bSchristos #endif 1752a5a4af3bSchristos #undef FLD 1753a5a4af3bSchristos return idesc; 1754a5a4af3bSchristos } 1755a5a4af3bSchristos 1756a5a4af3bSchristos extract_sfmt_seth: 1757a5a4af3bSchristos { 1758a5a4af3bSchristos const IDESC *idesc = &m32rbf_insn_data[itype]; 1759a5a4af3bSchristos CGEN_INSN_WORD insn = entire_insn; 1760a5a4af3bSchristos #define FLD(f) abuf->fields.sfmt_seth.f 1761a5a4af3bSchristos UINT f_r1; 1762a5a4af3bSchristos UINT f_hi16; 1763a5a4af3bSchristos 1764a5a4af3bSchristos f_r1 = EXTRACT_MSB0_UINT (insn, 32, 4, 4); 1765a5a4af3bSchristos f_hi16 = EXTRACT_MSB0_UINT (insn, 32, 16, 16); 1766a5a4af3bSchristos 1767a5a4af3bSchristos /* Record the fields for the semantic handler. */ 1768a5a4af3bSchristos FLD (f_hi16) = f_hi16; 1769a5a4af3bSchristos FLD (f_r1) = f_r1; 1770a5a4af3bSchristos FLD (i_dr) = & CPU (h_gr)[f_r1]; 1771a5a4af3bSchristos CGEN_TRACE_EXTRACT (current_cpu, abuf, (current_cpu, pc, "sfmt_seth", "f_hi16 0x%x", 'x', f_hi16, "f_r1 0x%x", 'x', f_r1, "dr 0x%x", 'x', f_r1, (char *) 0)); 1772a5a4af3bSchristos 1773a5a4af3bSchristos #if WITH_PROFILE_MODEL_P 1774a5a4af3bSchristos /* Record the fields for profiling. */ 1775a5a4af3bSchristos if (PROFILE_MODEL_P (current_cpu)) 1776a5a4af3bSchristos { 1777a5a4af3bSchristos FLD (out_dr) = f_r1; 1778a5a4af3bSchristos } 1779a5a4af3bSchristos #endif 1780a5a4af3bSchristos #undef FLD 1781a5a4af3bSchristos return idesc; 1782a5a4af3bSchristos } 1783a5a4af3bSchristos 1784a5a4af3bSchristos extract_sfmt_sll3: 1785a5a4af3bSchristos { 1786a5a4af3bSchristos const IDESC *idesc = &m32rbf_insn_data[itype]; 1787a5a4af3bSchristos CGEN_INSN_WORD insn = entire_insn; 1788a5a4af3bSchristos #define FLD(f) abuf->fields.sfmt_add3.f 1789a5a4af3bSchristos UINT f_r1; 1790a5a4af3bSchristos UINT f_r2; 1791a5a4af3bSchristos INT f_simm16; 1792a5a4af3bSchristos 1793a5a4af3bSchristos f_r1 = EXTRACT_MSB0_UINT (insn, 32, 4, 4); 1794a5a4af3bSchristos f_r2 = EXTRACT_MSB0_UINT (insn, 32, 12, 4); 1795a5a4af3bSchristos f_simm16 = EXTRACT_MSB0_SINT (insn, 32, 16, 16); 1796a5a4af3bSchristos 1797a5a4af3bSchristos /* Record the fields for the semantic handler. */ 1798a5a4af3bSchristos FLD (f_simm16) = f_simm16; 1799a5a4af3bSchristos FLD (f_r2) = f_r2; 1800a5a4af3bSchristos FLD (f_r1) = f_r1; 1801a5a4af3bSchristos FLD (i_sr) = & CPU (h_gr)[f_r2]; 1802a5a4af3bSchristos FLD (i_dr) = & CPU (h_gr)[f_r1]; 1803a5a4af3bSchristos CGEN_TRACE_EXTRACT (current_cpu, abuf, (current_cpu, pc, "sfmt_sll3", "f_simm16 0x%x", 'x', f_simm16, "f_r2 0x%x", 'x', f_r2, "f_r1 0x%x", 'x', f_r1, "sr 0x%x", 'x', f_r2, "dr 0x%x", 'x', f_r1, (char *) 0)); 1804a5a4af3bSchristos 1805a5a4af3bSchristos #if WITH_PROFILE_MODEL_P 1806a5a4af3bSchristos /* Record the fields for profiling. */ 1807a5a4af3bSchristos if (PROFILE_MODEL_P (current_cpu)) 1808a5a4af3bSchristos { 1809a5a4af3bSchristos FLD (in_sr) = f_r2; 1810a5a4af3bSchristos FLD (out_dr) = f_r1; 1811a5a4af3bSchristos } 1812a5a4af3bSchristos #endif 1813a5a4af3bSchristos #undef FLD 1814a5a4af3bSchristos return idesc; 1815a5a4af3bSchristos } 1816a5a4af3bSchristos 1817a5a4af3bSchristos extract_sfmt_slli: 1818a5a4af3bSchristos { 1819a5a4af3bSchristos const IDESC *idesc = &m32rbf_insn_data[itype]; 1820a5a4af3bSchristos CGEN_INSN_WORD insn = entire_insn; 1821a5a4af3bSchristos #define FLD(f) abuf->fields.sfmt_slli.f 1822a5a4af3bSchristos UINT f_r1; 1823a5a4af3bSchristos UINT f_uimm5; 1824a5a4af3bSchristos 1825a5a4af3bSchristos f_r1 = EXTRACT_MSB0_UINT (insn, 16, 4, 4); 1826a5a4af3bSchristos f_uimm5 = EXTRACT_MSB0_UINT (insn, 16, 11, 5); 1827a5a4af3bSchristos 1828a5a4af3bSchristos /* Record the fields for the semantic handler. */ 1829a5a4af3bSchristos FLD (f_r1) = f_r1; 1830a5a4af3bSchristos FLD (f_uimm5) = f_uimm5; 1831a5a4af3bSchristos FLD (i_dr) = & CPU (h_gr)[f_r1]; 1832a5a4af3bSchristos CGEN_TRACE_EXTRACT (current_cpu, abuf, (current_cpu, pc, "sfmt_slli", "f_r1 0x%x", 'x', f_r1, "f_uimm5 0x%x", 'x', f_uimm5, "dr 0x%x", 'x', f_r1, (char *) 0)); 1833a5a4af3bSchristos 1834a5a4af3bSchristos #if WITH_PROFILE_MODEL_P 1835a5a4af3bSchristos /* Record the fields for profiling. */ 1836a5a4af3bSchristos if (PROFILE_MODEL_P (current_cpu)) 1837a5a4af3bSchristos { 1838a5a4af3bSchristos FLD (in_dr) = f_r1; 1839a5a4af3bSchristos FLD (out_dr) = f_r1; 1840a5a4af3bSchristos } 1841a5a4af3bSchristos #endif 1842a5a4af3bSchristos #undef FLD 1843a5a4af3bSchristos return idesc; 1844a5a4af3bSchristos } 1845a5a4af3bSchristos 1846a5a4af3bSchristos extract_sfmt_st: 1847a5a4af3bSchristos { 1848a5a4af3bSchristos const IDESC *idesc = &m32rbf_insn_data[itype]; 1849a5a4af3bSchristos CGEN_INSN_WORD insn = entire_insn; 1850a5a4af3bSchristos #define FLD(f) abuf->fields.sfmt_st_plus.f 1851a5a4af3bSchristos UINT f_r1; 1852a5a4af3bSchristos UINT f_r2; 1853a5a4af3bSchristos 1854a5a4af3bSchristos f_r1 = EXTRACT_MSB0_UINT (insn, 16, 4, 4); 1855a5a4af3bSchristos f_r2 = EXTRACT_MSB0_UINT (insn, 16, 12, 4); 1856a5a4af3bSchristos 1857a5a4af3bSchristos /* Record the fields for the semantic handler. */ 1858a5a4af3bSchristos FLD (f_r1) = f_r1; 1859a5a4af3bSchristos FLD (f_r2) = f_r2; 1860a5a4af3bSchristos FLD (i_src1) = & CPU (h_gr)[f_r1]; 1861a5a4af3bSchristos FLD (i_src2) = & CPU (h_gr)[f_r2]; 1862a5a4af3bSchristos CGEN_TRACE_EXTRACT (current_cpu, abuf, (current_cpu, pc, "sfmt_st", "f_r1 0x%x", 'x', f_r1, "f_r2 0x%x", 'x', f_r2, "src1 0x%x", 'x', f_r1, "src2 0x%x", 'x', f_r2, (char *) 0)); 1863a5a4af3bSchristos 1864a5a4af3bSchristos #if WITH_PROFILE_MODEL_P 1865a5a4af3bSchristos /* Record the fields for profiling. */ 1866a5a4af3bSchristos if (PROFILE_MODEL_P (current_cpu)) 1867a5a4af3bSchristos { 1868a5a4af3bSchristos FLD (in_src1) = f_r1; 1869a5a4af3bSchristos FLD (in_src2) = f_r2; 1870a5a4af3bSchristos } 1871a5a4af3bSchristos #endif 1872a5a4af3bSchristos #undef FLD 1873a5a4af3bSchristos return idesc; 1874a5a4af3bSchristos } 1875a5a4af3bSchristos 1876a5a4af3bSchristos extract_sfmt_st_d: 1877a5a4af3bSchristos { 1878a5a4af3bSchristos const IDESC *idesc = &m32rbf_insn_data[itype]; 1879a5a4af3bSchristos CGEN_INSN_WORD insn = entire_insn; 1880a5a4af3bSchristos #define FLD(f) abuf->fields.sfmt_st_d.f 1881a5a4af3bSchristos UINT f_r1; 1882a5a4af3bSchristos UINT f_r2; 1883a5a4af3bSchristos INT f_simm16; 1884a5a4af3bSchristos 1885a5a4af3bSchristos f_r1 = EXTRACT_MSB0_UINT (insn, 32, 4, 4); 1886a5a4af3bSchristos f_r2 = EXTRACT_MSB0_UINT (insn, 32, 12, 4); 1887a5a4af3bSchristos f_simm16 = EXTRACT_MSB0_SINT (insn, 32, 16, 16); 1888a5a4af3bSchristos 1889a5a4af3bSchristos /* Record the fields for the semantic handler. */ 1890a5a4af3bSchristos FLD (f_simm16) = f_simm16; 1891a5a4af3bSchristos FLD (f_r1) = f_r1; 1892a5a4af3bSchristos FLD (f_r2) = f_r2; 1893a5a4af3bSchristos FLD (i_src1) = & CPU (h_gr)[f_r1]; 1894a5a4af3bSchristos FLD (i_src2) = & CPU (h_gr)[f_r2]; 1895a5a4af3bSchristos CGEN_TRACE_EXTRACT (current_cpu, abuf, (current_cpu, pc, "sfmt_st_d", "f_simm16 0x%x", 'x', f_simm16, "f_r1 0x%x", 'x', f_r1, "f_r2 0x%x", 'x', f_r2, "src1 0x%x", 'x', f_r1, "src2 0x%x", 'x', f_r2, (char *) 0)); 1896a5a4af3bSchristos 1897a5a4af3bSchristos #if WITH_PROFILE_MODEL_P 1898a5a4af3bSchristos /* Record the fields for profiling. */ 1899a5a4af3bSchristos if (PROFILE_MODEL_P (current_cpu)) 1900a5a4af3bSchristos { 1901a5a4af3bSchristos FLD (in_src1) = f_r1; 1902a5a4af3bSchristos FLD (in_src2) = f_r2; 1903a5a4af3bSchristos } 1904a5a4af3bSchristos #endif 1905a5a4af3bSchristos #undef FLD 1906a5a4af3bSchristos return idesc; 1907a5a4af3bSchristos } 1908a5a4af3bSchristos 1909a5a4af3bSchristos extract_sfmt_stb: 1910a5a4af3bSchristos { 1911a5a4af3bSchristos const IDESC *idesc = &m32rbf_insn_data[itype]; 1912a5a4af3bSchristos CGEN_INSN_WORD insn = entire_insn; 1913a5a4af3bSchristos #define FLD(f) abuf->fields.sfmt_st_plus.f 1914a5a4af3bSchristos UINT f_r1; 1915a5a4af3bSchristos UINT f_r2; 1916a5a4af3bSchristos 1917a5a4af3bSchristos f_r1 = EXTRACT_MSB0_UINT (insn, 16, 4, 4); 1918a5a4af3bSchristos f_r2 = EXTRACT_MSB0_UINT (insn, 16, 12, 4); 1919a5a4af3bSchristos 1920a5a4af3bSchristos /* Record the fields for the semantic handler. */ 1921a5a4af3bSchristos FLD (f_r1) = f_r1; 1922a5a4af3bSchristos FLD (f_r2) = f_r2; 1923a5a4af3bSchristos FLD (i_src1) = & CPU (h_gr)[f_r1]; 1924a5a4af3bSchristos FLD (i_src2) = & CPU (h_gr)[f_r2]; 1925a5a4af3bSchristos CGEN_TRACE_EXTRACT (current_cpu, abuf, (current_cpu, pc, "sfmt_stb", "f_r1 0x%x", 'x', f_r1, "f_r2 0x%x", 'x', f_r2, "src1 0x%x", 'x', f_r1, "src2 0x%x", 'x', f_r2, (char *) 0)); 1926a5a4af3bSchristos 1927a5a4af3bSchristos #if WITH_PROFILE_MODEL_P 1928a5a4af3bSchristos /* Record the fields for profiling. */ 1929a5a4af3bSchristos if (PROFILE_MODEL_P (current_cpu)) 1930a5a4af3bSchristos { 1931a5a4af3bSchristos FLD (in_src1) = f_r1; 1932a5a4af3bSchristos FLD (in_src2) = f_r2; 1933a5a4af3bSchristos } 1934a5a4af3bSchristos #endif 1935a5a4af3bSchristos #undef FLD 1936a5a4af3bSchristos return idesc; 1937a5a4af3bSchristos } 1938a5a4af3bSchristos 1939a5a4af3bSchristos extract_sfmt_stb_d: 1940a5a4af3bSchristos { 1941a5a4af3bSchristos const IDESC *idesc = &m32rbf_insn_data[itype]; 1942a5a4af3bSchristos CGEN_INSN_WORD insn = entire_insn; 1943a5a4af3bSchristos #define FLD(f) abuf->fields.sfmt_st_d.f 1944a5a4af3bSchristos UINT f_r1; 1945a5a4af3bSchristos UINT f_r2; 1946a5a4af3bSchristos INT f_simm16; 1947a5a4af3bSchristos 1948a5a4af3bSchristos f_r1 = EXTRACT_MSB0_UINT (insn, 32, 4, 4); 1949a5a4af3bSchristos f_r2 = EXTRACT_MSB0_UINT (insn, 32, 12, 4); 1950a5a4af3bSchristos f_simm16 = EXTRACT_MSB0_SINT (insn, 32, 16, 16); 1951a5a4af3bSchristos 1952a5a4af3bSchristos /* Record the fields for the semantic handler. */ 1953a5a4af3bSchristos FLD (f_simm16) = f_simm16; 1954a5a4af3bSchristos FLD (f_r1) = f_r1; 1955a5a4af3bSchristos FLD (f_r2) = f_r2; 1956a5a4af3bSchristos FLD (i_src1) = & CPU (h_gr)[f_r1]; 1957a5a4af3bSchristos FLD (i_src2) = & CPU (h_gr)[f_r2]; 1958a5a4af3bSchristos CGEN_TRACE_EXTRACT (current_cpu, abuf, (current_cpu, pc, "sfmt_stb_d", "f_simm16 0x%x", 'x', f_simm16, "f_r1 0x%x", 'x', f_r1, "f_r2 0x%x", 'x', f_r2, "src1 0x%x", 'x', f_r1, "src2 0x%x", 'x', f_r2, (char *) 0)); 1959a5a4af3bSchristos 1960a5a4af3bSchristos #if WITH_PROFILE_MODEL_P 1961a5a4af3bSchristos /* Record the fields for profiling. */ 1962a5a4af3bSchristos if (PROFILE_MODEL_P (current_cpu)) 1963a5a4af3bSchristos { 1964a5a4af3bSchristos FLD (in_src1) = f_r1; 1965a5a4af3bSchristos FLD (in_src2) = f_r2; 1966a5a4af3bSchristos } 1967a5a4af3bSchristos #endif 1968a5a4af3bSchristos #undef FLD 1969a5a4af3bSchristos return idesc; 1970a5a4af3bSchristos } 1971a5a4af3bSchristos 1972a5a4af3bSchristos extract_sfmt_sth: 1973a5a4af3bSchristos { 1974a5a4af3bSchristos const IDESC *idesc = &m32rbf_insn_data[itype]; 1975a5a4af3bSchristos CGEN_INSN_WORD insn = entire_insn; 1976a5a4af3bSchristos #define FLD(f) abuf->fields.sfmt_st_plus.f 1977a5a4af3bSchristos UINT f_r1; 1978a5a4af3bSchristos UINT f_r2; 1979a5a4af3bSchristos 1980a5a4af3bSchristos f_r1 = EXTRACT_MSB0_UINT (insn, 16, 4, 4); 1981a5a4af3bSchristos f_r2 = EXTRACT_MSB0_UINT (insn, 16, 12, 4); 1982a5a4af3bSchristos 1983a5a4af3bSchristos /* Record the fields for the semantic handler. */ 1984a5a4af3bSchristos FLD (f_r1) = f_r1; 1985a5a4af3bSchristos FLD (f_r2) = f_r2; 1986a5a4af3bSchristos FLD (i_src1) = & CPU (h_gr)[f_r1]; 1987a5a4af3bSchristos FLD (i_src2) = & CPU (h_gr)[f_r2]; 1988a5a4af3bSchristos CGEN_TRACE_EXTRACT (current_cpu, abuf, (current_cpu, pc, "sfmt_sth", "f_r1 0x%x", 'x', f_r1, "f_r2 0x%x", 'x', f_r2, "src1 0x%x", 'x', f_r1, "src2 0x%x", 'x', f_r2, (char *) 0)); 1989a5a4af3bSchristos 1990a5a4af3bSchristos #if WITH_PROFILE_MODEL_P 1991a5a4af3bSchristos /* Record the fields for profiling. */ 1992a5a4af3bSchristos if (PROFILE_MODEL_P (current_cpu)) 1993a5a4af3bSchristos { 1994a5a4af3bSchristos FLD (in_src1) = f_r1; 1995a5a4af3bSchristos FLD (in_src2) = f_r2; 1996a5a4af3bSchristos } 1997a5a4af3bSchristos #endif 1998a5a4af3bSchristos #undef FLD 1999a5a4af3bSchristos return idesc; 2000a5a4af3bSchristos } 2001a5a4af3bSchristos 2002a5a4af3bSchristos extract_sfmt_sth_d: 2003a5a4af3bSchristos { 2004a5a4af3bSchristos const IDESC *idesc = &m32rbf_insn_data[itype]; 2005a5a4af3bSchristos CGEN_INSN_WORD insn = entire_insn; 2006a5a4af3bSchristos #define FLD(f) abuf->fields.sfmt_st_d.f 2007a5a4af3bSchristos UINT f_r1; 2008a5a4af3bSchristos UINT f_r2; 2009a5a4af3bSchristos INT f_simm16; 2010a5a4af3bSchristos 2011a5a4af3bSchristos f_r1 = EXTRACT_MSB0_UINT (insn, 32, 4, 4); 2012a5a4af3bSchristos f_r2 = EXTRACT_MSB0_UINT (insn, 32, 12, 4); 2013a5a4af3bSchristos f_simm16 = EXTRACT_MSB0_SINT (insn, 32, 16, 16); 2014a5a4af3bSchristos 2015a5a4af3bSchristos /* Record the fields for the semantic handler. */ 2016a5a4af3bSchristos FLD (f_simm16) = f_simm16; 2017a5a4af3bSchristos FLD (f_r1) = f_r1; 2018a5a4af3bSchristos FLD (f_r2) = f_r2; 2019a5a4af3bSchristos FLD (i_src1) = & CPU (h_gr)[f_r1]; 2020a5a4af3bSchristos FLD (i_src2) = & CPU (h_gr)[f_r2]; 2021a5a4af3bSchristos CGEN_TRACE_EXTRACT (current_cpu, abuf, (current_cpu, pc, "sfmt_sth_d", "f_simm16 0x%x", 'x', f_simm16, "f_r1 0x%x", 'x', f_r1, "f_r2 0x%x", 'x', f_r2, "src1 0x%x", 'x', f_r1, "src2 0x%x", 'x', f_r2, (char *) 0)); 2022a5a4af3bSchristos 2023a5a4af3bSchristos #if WITH_PROFILE_MODEL_P 2024a5a4af3bSchristos /* Record the fields for profiling. */ 2025a5a4af3bSchristos if (PROFILE_MODEL_P (current_cpu)) 2026a5a4af3bSchristos { 2027a5a4af3bSchristos FLD (in_src1) = f_r1; 2028a5a4af3bSchristos FLD (in_src2) = f_r2; 2029a5a4af3bSchristos } 2030a5a4af3bSchristos #endif 2031a5a4af3bSchristos #undef FLD 2032a5a4af3bSchristos return idesc; 2033a5a4af3bSchristos } 2034a5a4af3bSchristos 2035a5a4af3bSchristos extract_sfmt_st_plus: 2036a5a4af3bSchristos { 2037a5a4af3bSchristos const IDESC *idesc = &m32rbf_insn_data[itype]; 2038a5a4af3bSchristos CGEN_INSN_WORD insn = entire_insn; 2039a5a4af3bSchristos #define FLD(f) abuf->fields.sfmt_st_plus.f 2040a5a4af3bSchristos UINT f_r1; 2041a5a4af3bSchristos UINT f_r2; 2042a5a4af3bSchristos 2043a5a4af3bSchristos f_r1 = EXTRACT_MSB0_UINT (insn, 16, 4, 4); 2044a5a4af3bSchristos f_r2 = EXTRACT_MSB0_UINT (insn, 16, 12, 4); 2045a5a4af3bSchristos 2046a5a4af3bSchristos /* Record the fields for the semantic handler. */ 2047a5a4af3bSchristos FLD (f_r1) = f_r1; 2048a5a4af3bSchristos FLD (f_r2) = f_r2; 2049a5a4af3bSchristos FLD (i_src1) = & CPU (h_gr)[f_r1]; 2050a5a4af3bSchristos FLD (i_src2) = & CPU (h_gr)[f_r2]; 2051a5a4af3bSchristos CGEN_TRACE_EXTRACT (current_cpu, abuf, (current_cpu, pc, "sfmt_st_plus", "f_r1 0x%x", 'x', f_r1, "f_r2 0x%x", 'x', f_r2, "src1 0x%x", 'x', f_r1, "src2 0x%x", 'x', f_r2, (char *) 0)); 2052a5a4af3bSchristos 2053a5a4af3bSchristos #if WITH_PROFILE_MODEL_P 2054a5a4af3bSchristos /* Record the fields for profiling. */ 2055a5a4af3bSchristos if (PROFILE_MODEL_P (current_cpu)) 2056a5a4af3bSchristos { 2057a5a4af3bSchristos FLD (in_src1) = f_r1; 2058a5a4af3bSchristos FLD (in_src2) = f_r2; 2059a5a4af3bSchristos FLD (out_src2) = f_r2; 2060a5a4af3bSchristos } 2061a5a4af3bSchristos #endif 2062a5a4af3bSchristos #undef FLD 2063a5a4af3bSchristos return idesc; 2064a5a4af3bSchristos } 2065a5a4af3bSchristos 2066a5a4af3bSchristos extract_sfmt_trap: 2067a5a4af3bSchristos { 2068a5a4af3bSchristos const IDESC *idesc = &m32rbf_insn_data[itype]; 2069a5a4af3bSchristos CGEN_INSN_WORD insn = entire_insn; 2070a5a4af3bSchristos #define FLD(f) abuf->fields.sfmt_trap.f 2071a5a4af3bSchristos UINT f_uimm4; 2072a5a4af3bSchristos 2073a5a4af3bSchristos f_uimm4 = EXTRACT_MSB0_UINT (insn, 16, 12, 4); 2074a5a4af3bSchristos 2075a5a4af3bSchristos /* Record the fields for the semantic handler. */ 2076a5a4af3bSchristos FLD (f_uimm4) = f_uimm4; 2077a5a4af3bSchristos CGEN_TRACE_EXTRACT (current_cpu, abuf, (current_cpu, pc, "sfmt_trap", "f_uimm4 0x%x", 'x', f_uimm4, (char *) 0)); 2078a5a4af3bSchristos 2079a5a4af3bSchristos #if WITH_PROFILE_MODEL_P 2080a5a4af3bSchristos /* Record the fields for profiling. */ 2081a5a4af3bSchristos if (PROFILE_MODEL_P (current_cpu)) 2082a5a4af3bSchristos { 2083a5a4af3bSchristos } 2084a5a4af3bSchristos #endif 2085a5a4af3bSchristos #undef FLD 2086a5a4af3bSchristos return idesc; 2087a5a4af3bSchristos } 2088a5a4af3bSchristos 2089a5a4af3bSchristos extract_sfmt_unlock: 2090a5a4af3bSchristos { 2091a5a4af3bSchristos const IDESC *idesc = &m32rbf_insn_data[itype]; 2092a5a4af3bSchristos CGEN_INSN_WORD insn = entire_insn; 2093a5a4af3bSchristos #define FLD(f) abuf->fields.sfmt_st_plus.f 2094a5a4af3bSchristos UINT f_r1; 2095a5a4af3bSchristos UINT f_r2; 2096a5a4af3bSchristos 2097a5a4af3bSchristos f_r1 = EXTRACT_MSB0_UINT (insn, 16, 4, 4); 2098a5a4af3bSchristos f_r2 = EXTRACT_MSB0_UINT (insn, 16, 12, 4); 2099a5a4af3bSchristos 2100a5a4af3bSchristos /* Record the fields for the semantic handler. */ 2101a5a4af3bSchristos FLD (f_r1) = f_r1; 2102a5a4af3bSchristos FLD (f_r2) = f_r2; 2103a5a4af3bSchristos FLD (i_src1) = & CPU (h_gr)[f_r1]; 2104a5a4af3bSchristos FLD (i_src2) = & CPU (h_gr)[f_r2]; 2105a5a4af3bSchristos CGEN_TRACE_EXTRACT (current_cpu, abuf, (current_cpu, pc, "sfmt_unlock", "f_r1 0x%x", 'x', f_r1, "f_r2 0x%x", 'x', f_r2, "src1 0x%x", 'x', f_r1, "src2 0x%x", 'x', f_r2, (char *) 0)); 2106a5a4af3bSchristos 2107a5a4af3bSchristos #if WITH_PROFILE_MODEL_P 2108a5a4af3bSchristos /* Record the fields for profiling. */ 2109a5a4af3bSchristos if (PROFILE_MODEL_P (current_cpu)) 2110a5a4af3bSchristos { 2111a5a4af3bSchristos FLD (in_src1) = f_r1; 2112a5a4af3bSchristos FLD (in_src2) = f_r2; 2113a5a4af3bSchristos } 2114a5a4af3bSchristos #endif 2115a5a4af3bSchristos #undef FLD 2116a5a4af3bSchristos return idesc; 2117a5a4af3bSchristos } 2118a5a4af3bSchristos 2119a5a4af3bSchristos extract_sfmt_clrpsw: 2120a5a4af3bSchristos { 2121a5a4af3bSchristos const IDESC *idesc = &m32rbf_insn_data[itype]; 2122a5a4af3bSchristos CGEN_INSN_WORD insn = entire_insn; 2123a5a4af3bSchristos #define FLD(f) abuf->fields.sfmt_clrpsw.f 2124a5a4af3bSchristos UINT f_uimm8; 2125a5a4af3bSchristos 2126a5a4af3bSchristos f_uimm8 = EXTRACT_MSB0_UINT (insn, 16, 8, 8); 2127a5a4af3bSchristos 2128a5a4af3bSchristos /* Record the fields for the semantic handler. */ 2129a5a4af3bSchristos FLD (f_uimm8) = f_uimm8; 2130a5a4af3bSchristos CGEN_TRACE_EXTRACT (current_cpu, abuf, (current_cpu, pc, "sfmt_clrpsw", "f_uimm8 0x%x", 'x', f_uimm8, (char *) 0)); 2131a5a4af3bSchristos 2132a5a4af3bSchristos #undef FLD 2133a5a4af3bSchristos return idesc; 2134a5a4af3bSchristos } 2135a5a4af3bSchristos 2136a5a4af3bSchristos extract_sfmt_setpsw: 2137a5a4af3bSchristos { 2138a5a4af3bSchristos const IDESC *idesc = &m32rbf_insn_data[itype]; 2139a5a4af3bSchristos CGEN_INSN_WORD insn = entire_insn; 2140a5a4af3bSchristos #define FLD(f) abuf->fields.sfmt_clrpsw.f 2141a5a4af3bSchristos UINT f_uimm8; 2142a5a4af3bSchristos 2143a5a4af3bSchristos f_uimm8 = EXTRACT_MSB0_UINT (insn, 16, 8, 8); 2144a5a4af3bSchristos 2145a5a4af3bSchristos /* Record the fields for the semantic handler. */ 2146a5a4af3bSchristos FLD (f_uimm8) = f_uimm8; 2147a5a4af3bSchristos CGEN_TRACE_EXTRACT (current_cpu, abuf, (current_cpu, pc, "sfmt_setpsw", "f_uimm8 0x%x", 'x', f_uimm8, (char *) 0)); 2148a5a4af3bSchristos 2149a5a4af3bSchristos #undef FLD 2150a5a4af3bSchristos return idesc; 2151a5a4af3bSchristos } 2152a5a4af3bSchristos 2153a5a4af3bSchristos extract_sfmt_bset: 2154a5a4af3bSchristos { 2155a5a4af3bSchristos const IDESC *idesc = &m32rbf_insn_data[itype]; 2156a5a4af3bSchristos CGEN_INSN_WORD insn = entire_insn; 2157a5a4af3bSchristos #define FLD(f) abuf->fields.sfmt_bset.f 2158a5a4af3bSchristos UINT f_uimm3; 2159a5a4af3bSchristos UINT f_r2; 2160a5a4af3bSchristos INT f_simm16; 2161a5a4af3bSchristos 2162a5a4af3bSchristos f_uimm3 = EXTRACT_MSB0_UINT (insn, 32, 5, 3); 2163a5a4af3bSchristos f_r2 = EXTRACT_MSB0_UINT (insn, 32, 12, 4); 2164a5a4af3bSchristos f_simm16 = EXTRACT_MSB0_SINT (insn, 32, 16, 16); 2165a5a4af3bSchristos 2166a5a4af3bSchristos /* Record the fields for the semantic handler. */ 2167a5a4af3bSchristos FLD (f_simm16) = f_simm16; 2168a5a4af3bSchristos FLD (f_r2) = f_r2; 2169a5a4af3bSchristos FLD (f_uimm3) = f_uimm3; 2170a5a4af3bSchristos FLD (i_sr) = & CPU (h_gr)[f_r2]; 2171a5a4af3bSchristos CGEN_TRACE_EXTRACT (current_cpu, abuf, (current_cpu, pc, "sfmt_bset", "f_simm16 0x%x", 'x', f_simm16, "f_r2 0x%x", 'x', f_r2, "f_uimm3 0x%x", 'x', f_uimm3, "sr 0x%x", 'x', f_r2, (char *) 0)); 2172a5a4af3bSchristos 2173a5a4af3bSchristos #if WITH_PROFILE_MODEL_P 2174a5a4af3bSchristos /* Record the fields for profiling. */ 2175a5a4af3bSchristos if (PROFILE_MODEL_P (current_cpu)) 2176a5a4af3bSchristos { 2177a5a4af3bSchristos FLD (in_sr) = f_r2; 2178a5a4af3bSchristos } 2179a5a4af3bSchristos #endif 2180a5a4af3bSchristos #undef FLD 2181a5a4af3bSchristos return idesc; 2182a5a4af3bSchristos } 2183a5a4af3bSchristos 2184a5a4af3bSchristos extract_sfmt_btst: 2185a5a4af3bSchristos { 2186a5a4af3bSchristos const IDESC *idesc = &m32rbf_insn_data[itype]; 2187a5a4af3bSchristos CGEN_INSN_WORD insn = entire_insn; 2188a5a4af3bSchristos #define FLD(f) abuf->fields.sfmt_bset.f 2189a5a4af3bSchristos UINT f_uimm3; 2190a5a4af3bSchristos UINT f_r2; 2191a5a4af3bSchristos 2192a5a4af3bSchristos f_uimm3 = EXTRACT_MSB0_UINT (insn, 16, 5, 3); 2193a5a4af3bSchristos f_r2 = EXTRACT_MSB0_UINT (insn, 16, 12, 4); 2194a5a4af3bSchristos 2195a5a4af3bSchristos /* Record the fields for the semantic handler. */ 2196a5a4af3bSchristos FLD (f_r2) = f_r2; 2197a5a4af3bSchristos FLD (f_uimm3) = f_uimm3; 2198a5a4af3bSchristos FLD (i_sr) = & CPU (h_gr)[f_r2]; 2199a5a4af3bSchristos CGEN_TRACE_EXTRACT (current_cpu, abuf, (current_cpu, pc, "sfmt_btst", "f_r2 0x%x", 'x', f_r2, "f_uimm3 0x%x", 'x', f_uimm3, "sr 0x%x", 'x', f_r2, (char *) 0)); 2200a5a4af3bSchristos 2201a5a4af3bSchristos #if WITH_PROFILE_MODEL_P 2202a5a4af3bSchristos /* Record the fields for profiling. */ 2203a5a4af3bSchristos if (PROFILE_MODEL_P (current_cpu)) 2204a5a4af3bSchristos { 2205a5a4af3bSchristos FLD (in_sr) = f_r2; 2206a5a4af3bSchristos } 2207a5a4af3bSchristos #endif 2208a5a4af3bSchristos #undef FLD 2209a5a4af3bSchristos return idesc; 2210a5a4af3bSchristos } 2211a5a4af3bSchristos 2212a5a4af3bSchristos } 2213