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