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