1a2b0a27dSPhilippe Mathieu-Daudé /* 2a2b0a27dSPhilippe Mathieu-Daudé * MIPS SIMD Architecture (MSA) translation routines 3a2b0a27dSPhilippe Mathieu-Daudé * 4a2b0a27dSPhilippe Mathieu-Daudé * Copyright (c) 2004-2005 Jocelyn Mayer 5a2b0a27dSPhilippe Mathieu-Daudé * Copyright (c) 2006 Marius Groeger (FPU operations) 6a2b0a27dSPhilippe Mathieu-Daudé * Copyright (c) 2006 Thiemo Seufer (MIPS32R2 support) 7a2b0a27dSPhilippe Mathieu-Daudé * Copyright (c) 2009 CodeSourcery (MIPS16 and microMIPS support) 8a2b0a27dSPhilippe Mathieu-Daudé * Copyright (c) 2012 Jia Liu & Dongxue Zhang (MIPS ASE DSP support) 9a2b0a27dSPhilippe Mathieu-Daudé * Copyright (c) 2020 Philippe Mathieu-Daudé 10a2b0a27dSPhilippe Mathieu-Daudé * 11a2b0a27dSPhilippe Mathieu-Daudé * SPDX-License-Identifier: LGPL-2.1-or-later 12a2b0a27dSPhilippe Mathieu-Daudé */ 13a2b0a27dSPhilippe Mathieu-Daudé #include "qemu/osdep.h" 14a2b0a27dSPhilippe Mathieu-Daudé #include "tcg/tcg-op.h" 15a2b0a27dSPhilippe Mathieu-Daudé #include "exec/helper-gen.h" 16a2b0a27dSPhilippe Mathieu-Daudé #include "translate.h" 17a2b0a27dSPhilippe Mathieu-Daudé #include "fpu_helper.h" 18a2b0a27dSPhilippe Mathieu-Daudé #include "internal.h" 19a2b0a27dSPhilippe Mathieu-Daudé 204701d23aSPhilippe Mathieu-Daudé static int bit_m(DisasContext *ctx, int x); 214701d23aSPhilippe Mathieu-Daudé static int bit_df(DisasContext *ctx, int x); 224701d23aSPhilippe Mathieu-Daudé 235c5b6400SPhilippe Mathieu-Daudé static inline int plus_2(DisasContext *s, int x) 245c5b6400SPhilippe Mathieu-Daudé { 255c5b6400SPhilippe Mathieu-Daudé return x + 2; 265c5b6400SPhilippe Mathieu-Daudé } 275c5b6400SPhilippe Mathieu-Daudé 28a2b0a27dSPhilippe Mathieu-Daudé /* Include the auto-generated decoder. */ 29f5c6ee0cSPhilippe Mathieu-Daudé #include "decode-msa.c.inc" 30a2b0a27dSPhilippe Mathieu-Daudé 31a2b0a27dSPhilippe Mathieu-Daudé #define OPC_MSA (0x1E << 26) 32a2b0a27dSPhilippe Mathieu-Daudé 33a2b0a27dSPhilippe Mathieu-Daudé #define MASK_MSA_MINOR(op) (MASK_OP_MAJOR(op) | (op & 0x3F)) 34a2b0a27dSPhilippe Mathieu-Daudé enum { 35a2b0a27dSPhilippe Mathieu-Daudé OPC_MSA_3R_0D = 0x0D | OPC_MSA, 36a2b0a27dSPhilippe Mathieu-Daudé OPC_MSA_3R_0E = 0x0E | OPC_MSA, 37a2b0a27dSPhilippe Mathieu-Daudé OPC_MSA_3R_0F = 0x0F | OPC_MSA, 38a2b0a27dSPhilippe Mathieu-Daudé OPC_MSA_3R_10 = 0x10 | OPC_MSA, 39a2b0a27dSPhilippe Mathieu-Daudé OPC_MSA_3R_11 = 0x11 | OPC_MSA, 40a2b0a27dSPhilippe Mathieu-Daudé OPC_MSA_3R_12 = 0x12 | OPC_MSA, 41a2b0a27dSPhilippe Mathieu-Daudé OPC_MSA_3R_13 = 0x13 | OPC_MSA, 42a2b0a27dSPhilippe Mathieu-Daudé OPC_MSA_3R_14 = 0x14 | OPC_MSA, 43a2b0a27dSPhilippe Mathieu-Daudé OPC_MSA_3R_15 = 0x15 | OPC_MSA, 44a2b0a27dSPhilippe Mathieu-Daudé OPC_MSA_ELM = 0x19 | OPC_MSA, 45a2b0a27dSPhilippe Mathieu-Daudé OPC_MSA_3RF_1A = 0x1A | OPC_MSA, 46a2b0a27dSPhilippe Mathieu-Daudé OPC_MSA_3RF_1B = 0x1B | OPC_MSA, 47a2b0a27dSPhilippe Mathieu-Daudé OPC_MSA_3RF_1C = 0x1C | OPC_MSA, 48a2b0a27dSPhilippe Mathieu-Daudé OPC_MSA_VEC = 0x1E | OPC_MSA, 49a2b0a27dSPhilippe Mathieu-Daudé }; 50a2b0a27dSPhilippe Mathieu-Daudé 51a2b0a27dSPhilippe Mathieu-Daudé enum { 52*adcff99aSPhilippe Mathieu-Daudé /* VEC instruction */ 53a2b0a27dSPhilippe Mathieu-Daudé OPC_AND_V = (0x00 << 21) | OPC_MSA_VEC, 54a2b0a27dSPhilippe Mathieu-Daudé OPC_OR_V = (0x01 << 21) | OPC_MSA_VEC, 55a2b0a27dSPhilippe Mathieu-Daudé OPC_NOR_V = (0x02 << 21) | OPC_MSA_VEC, 56a2b0a27dSPhilippe Mathieu-Daudé OPC_XOR_V = (0x03 << 21) | OPC_MSA_VEC, 57a2b0a27dSPhilippe Mathieu-Daudé OPC_BMNZ_V = (0x04 << 21) | OPC_MSA_VEC, 58a2b0a27dSPhilippe Mathieu-Daudé OPC_BMZ_V = (0x05 << 21) | OPC_MSA_VEC, 59a2b0a27dSPhilippe Mathieu-Daudé OPC_BSEL_V = (0x06 << 21) | OPC_MSA_VEC, 60a2b0a27dSPhilippe Mathieu-Daudé 61a2b0a27dSPhilippe Mathieu-Daudé /* 3R instruction df(bits 22..21) = _b, _h, _w, d */ 62a2b0a27dSPhilippe Mathieu-Daudé OPC_SLL_df = (0x0 << 23) | OPC_MSA_3R_0D, 63a2b0a27dSPhilippe Mathieu-Daudé OPC_ADDV_df = (0x0 << 23) | OPC_MSA_3R_0E, 64a2b0a27dSPhilippe Mathieu-Daudé OPC_CEQ_df = (0x0 << 23) | OPC_MSA_3R_0F, 65a2b0a27dSPhilippe Mathieu-Daudé OPC_ADD_A_df = (0x0 << 23) | OPC_MSA_3R_10, 66a2b0a27dSPhilippe Mathieu-Daudé OPC_SUBS_S_df = (0x0 << 23) | OPC_MSA_3R_11, 67a2b0a27dSPhilippe Mathieu-Daudé OPC_MULV_df = (0x0 << 23) | OPC_MSA_3R_12, 68a2b0a27dSPhilippe Mathieu-Daudé OPC_DOTP_S_df = (0x0 << 23) | OPC_MSA_3R_13, 69a2b0a27dSPhilippe Mathieu-Daudé OPC_SLD_df = (0x0 << 23) | OPC_MSA_3R_14, 70a2b0a27dSPhilippe Mathieu-Daudé OPC_VSHF_df = (0x0 << 23) | OPC_MSA_3R_15, 71a2b0a27dSPhilippe Mathieu-Daudé OPC_SRA_df = (0x1 << 23) | OPC_MSA_3R_0D, 72a2b0a27dSPhilippe Mathieu-Daudé OPC_SUBV_df = (0x1 << 23) | OPC_MSA_3R_0E, 73a2b0a27dSPhilippe Mathieu-Daudé OPC_ADDS_A_df = (0x1 << 23) | OPC_MSA_3R_10, 74a2b0a27dSPhilippe Mathieu-Daudé OPC_SUBS_U_df = (0x1 << 23) | OPC_MSA_3R_11, 75a2b0a27dSPhilippe Mathieu-Daudé OPC_MADDV_df = (0x1 << 23) | OPC_MSA_3R_12, 76a2b0a27dSPhilippe Mathieu-Daudé OPC_DOTP_U_df = (0x1 << 23) | OPC_MSA_3R_13, 77a2b0a27dSPhilippe Mathieu-Daudé OPC_SPLAT_df = (0x1 << 23) | OPC_MSA_3R_14, 78a2b0a27dSPhilippe Mathieu-Daudé OPC_SRAR_df = (0x1 << 23) | OPC_MSA_3R_15, 79a2b0a27dSPhilippe Mathieu-Daudé OPC_SRL_df = (0x2 << 23) | OPC_MSA_3R_0D, 80a2b0a27dSPhilippe Mathieu-Daudé OPC_MAX_S_df = (0x2 << 23) | OPC_MSA_3R_0E, 81a2b0a27dSPhilippe Mathieu-Daudé OPC_CLT_S_df = (0x2 << 23) | OPC_MSA_3R_0F, 82a2b0a27dSPhilippe Mathieu-Daudé OPC_ADDS_S_df = (0x2 << 23) | OPC_MSA_3R_10, 83a2b0a27dSPhilippe Mathieu-Daudé OPC_SUBSUS_U_df = (0x2 << 23) | OPC_MSA_3R_11, 84a2b0a27dSPhilippe Mathieu-Daudé OPC_MSUBV_df = (0x2 << 23) | OPC_MSA_3R_12, 85a2b0a27dSPhilippe Mathieu-Daudé OPC_DPADD_S_df = (0x2 << 23) | OPC_MSA_3R_13, 86a2b0a27dSPhilippe Mathieu-Daudé OPC_PCKEV_df = (0x2 << 23) | OPC_MSA_3R_14, 87a2b0a27dSPhilippe Mathieu-Daudé OPC_SRLR_df = (0x2 << 23) | OPC_MSA_3R_15, 88a2b0a27dSPhilippe Mathieu-Daudé OPC_BCLR_df = (0x3 << 23) | OPC_MSA_3R_0D, 89a2b0a27dSPhilippe Mathieu-Daudé OPC_MAX_U_df = (0x3 << 23) | OPC_MSA_3R_0E, 90a2b0a27dSPhilippe Mathieu-Daudé OPC_CLT_U_df = (0x3 << 23) | OPC_MSA_3R_0F, 91a2b0a27dSPhilippe Mathieu-Daudé OPC_ADDS_U_df = (0x3 << 23) | OPC_MSA_3R_10, 92a2b0a27dSPhilippe Mathieu-Daudé OPC_SUBSUU_S_df = (0x3 << 23) | OPC_MSA_3R_11, 93a2b0a27dSPhilippe Mathieu-Daudé OPC_DPADD_U_df = (0x3 << 23) | OPC_MSA_3R_13, 94a2b0a27dSPhilippe Mathieu-Daudé OPC_PCKOD_df = (0x3 << 23) | OPC_MSA_3R_14, 95a2b0a27dSPhilippe Mathieu-Daudé OPC_BSET_df = (0x4 << 23) | OPC_MSA_3R_0D, 96a2b0a27dSPhilippe Mathieu-Daudé OPC_MIN_S_df = (0x4 << 23) | OPC_MSA_3R_0E, 97a2b0a27dSPhilippe Mathieu-Daudé OPC_CLE_S_df = (0x4 << 23) | OPC_MSA_3R_0F, 98a2b0a27dSPhilippe Mathieu-Daudé OPC_AVE_S_df = (0x4 << 23) | OPC_MSA_3R_10, 99a2b0a27dSPhilippe Mathieu-Daudé OPC_ASUB_S_df = (0x4 << 23) | OPC_MSA_3R_11, 100a2b0a27dSPhilippe Mathieu-Daudé OPC_DIV_S_df = (0x4 << 23) | OPC_MSA_3R_12, 101a2b0a27dSPhilippe Mathieu-Daudé OPC_DPSUB_S_df = (0x4 << 23) | OPC_MSA_3R_13, 102a2b0a27dSPhilippe Mathieu-Daudé OPC_ILVL_df = (0x4 << 23) | OPC_MSA_3R_14, 103a2b0a27dSPhilippe Mathieu-Daudé OPC_HADD_S_df = (0x4 << 23) | OPC_MSA_3R_15, 104a2b0a27dSPhilippe Mathieu-Daudé OPC_BNEG_df = (0x5 << 23) | OPC_MSA_3R_0D, 105a2b0a27dSPhilippe Mathieu-Daudé OPC_MIN_U_df = (0x5 << 23) | OPC_MSA_3R_0E, 106a2b0a27dSPhilippe Mathieu-Daudé OPC_CLE_U_df = (0x5 << 23) | OPC_MSA_3R_0F, 107a2b0a27dSPhilippe Mathieu-Daudé OPC_AVE_U_df = (0x5 << 23) | OPC_MSA_3R_10, 108a2b0a27dSPhilippe Mathieu-Daudé OPC_ASUB_U_df = (0x5 << 23) | OPC_MSA_3R_11, 109a2b0a27dSPhilippe Mathieu-Daudé OPC_DIV_U_df = (0x5 << 23) | OPC_MSA_3R_12, 110a2b0a27dSPhilippe Mathieu-Daudé OPC_DPSUB_U_df = (0x5 << 23) | OPC_MSA_3R_13, 111a2b0a27dSPhilippe Mathieu-Daudé OPC_ILVR_df = (0x5 << 23) | OPC_MSA_3R_14, 112a2b0a27dSPhilippe Mathieu-Daudé OPC_HADD_U_df = (0x5 << 23) | OPC_MSA_3R_15, 113a2b0a27dSPhilippe Mathieu-Daudé OPC_BINSL_df = (0x6 << 23) | OPC_MSA_3R_0D, 114a2b0a27dSPhilippe Mathieu-Daudé OPC_MAX_A_df = (0x6 << 23) | OPC_MSA_3R_0E, 115a2b0a27dSPhilippe Mathieu-Daudé OPC_AVER_S_df = (0x6 << 23) | OPC_MSA_3R_10, 116a2b0a27dSPhilippe Mathieu-Daudé OPC_MOD_S_df = (0x6 << 23) | OPC_MSA_3R_12, 117a2b0a27dSPhilippe Mathieu-Daudé OPC_ILVEV_df = (0x6 << 23) | OPC_MSA_3R_14, 118a2b0a27dSPhilippe Mathieu-Daudé OPC_HSUB_S_df = (0x6 << 23) | OPC_MSA_3R_15, 119a2b0a27dSPhilippe Mathieu-Daudé OPC_BINSR_df = (0x7 << 23) | OPC_MSA_3R_0D, 120a2b0a27dSPhilippe Mathieu-Daudé OPC_MIN_A_df = (0x7 << 23) | OPC_MSA_3R_0E, 121a2b0a27dSPhilippe Mathieu-Daudé OPC_AVER_U_df = (0x7 << 23) | OPC_MSA_3R_10, 122a2b0a27dSPhilippe Mathieu-Daudé OPC_MOD_U_df = (0x7 << 23) | OPC_MSA_3R_12, 123a2b0a27dSPhilippe Mathieu-Daudé OPC_ILVOD_df = (0x7 << 23) | OPC_MSA_3R_14, 124a2b0a27dSPhilippe Mathieu-Daudé OPC_HSUB_U_df = (0x7 << 23) | OPC_MSA_3R_15, 125a2b0a27dSPhilippe Mathieu-Daudé 126a2b0a27dSPhilippe Mathieu-Daudé /* ELM instructions df(bits 21..16) = _b, _h, _w, _d */ 127a2b0a27dSPhilippe Mathieu-Daudé OPC_SLDI_df = (0x0 << 22) | (0x00 << 16) | OPC_MSA_ELM, 128a2b0a27dSPhilippe Mathieu-Daudé OPC_CTCMSA = (0x0 << 22) | (0x3E << 16) | OPC_MSA_ELM, 129a2b0a27dSPhilippe Mathieu-Daudé OPC_SPLATI_df = (0x1 << 22) | (0x00 << 16) | OPC_MSA_ELM, 130a2b0a27dSPhilippe Mathieu-Daudé OPC_CFCMSA = (0x1 << 22) | (0x3E << 16) | OPC_MSA_ELM, 131a2b0a27dSPhilippe Mathieu-Daudé OPC_COPY_S_df = (0x2 << 22) | (0x00 << 16) | OPC_MSA_ELM, 132a2b0a27dSPhilippe Mathieu-Daudé OPC_MOVE_V = (0x2 << 22) | (0x3E << 16) | OPC_MSA_ELM, 133a2b0a27dSPhilippe Mathieu-Daudé OPC_COPY_U_df = (0x3 << 22) | (0x00 << 16) | OPC_MSA_ELM, 134a2b0a27dSPhilippe Mathieu-Daudé OPC_INSERT_df = (0x4 << 22) | (0x00 << 16) | OPC_MSA_ELM, 135a2b0a27dSPhilippe Mathieu-Daudé OPC_INSVE_df = (0x5 << 22) | (0x00 << 16) | OPC_MSA_ELM, 136a2b0a27dSPhilippe Mathieu-Daudé 137a2b0a27dSPhilippe Mathieu-Daudé /* 3RF instruction _df(bit 21) = _w, _d */ 138a2b0a27dSPhilippe Mathieu-Daudé OPC_FCAF_df = (0x0 << 22) | OPC_MSA_3RF_1A, 139a2b0a27dSPhilippe Mathieu-Daudé OPC_FADD_df = (0x0 << 22) | OPC_MSA_3RF_1B, 140a2b0a27dSPhilippe Mathieu-Daudé OPC_FCUN_df = (0x1 << 22) | OPC_MSA_3RF_1A, 141a2b0a27dSPhilippe Mathieu-Daudé OPC_FSUB_df = (0x1 << 22) | OPC_MSA_3RF_1B, 142a2b0a27dSPhilippe Mathieu-Daudé OPC_FCOR_df = (0x1 << 22) | OPC_MSA_3RF_1C, 143a2b0a27dSPhilippe Mathieu-Daudé OPC_FCEQ_df = (0x2 << 22) | OPC_MSA_3RF_1A, 144a2b0a27dSPhilippe Mathieu-Daudé OPC_FMUL_df = (0x2 << 22) | OPC_MSA_3RF_1B, 145a2b0a27dSPhilippe Mathieu-Daudé OPC_FCUNE_df = (0x2 << 22) | OPC_MSA_3RF_1C, 146a2b0a27dSPhilippe Mathieu-Daudé OPC_FCUEQ_df = (0x3 << 22) | OPC_MSA_3RF_1A, 147a2b0a27dSPhilippe Mathieu-Daudé OPC_FDIV_df = (0x3 << 22) | OPC_MSA_3RF_1B, 148a2b0a27dSPhilippe Mathieu-Daudé OPC_FCNE_df = (0x3 << 22) | OPC_MSA_3RF_1C, 149a2b0a27dSPhilippe Mathieu-Daudé OPC_FCLT_df = (0x4 << 22) | OPC_MSA_3RF_1A, 150a2b0a27dSPhilippe Mathieu-Daudé OPC_FMADD_df = (0x4 << 22) | OPC_MSA_3RF_1B, 151a2b0a27dSPhilippe Mathieu-Daudé OPC_MUL_Q_df = (0x4 << 22) | OPC_MSA_3RF_1C, 152a2b0a27dSPhilippe Mathieu-Daudé OPC_FCULT_df = (0x5 << 22) | OPC_MSA_3RF_1A, 153a2b0a27dSPhilippe Mathieu-Daudé OPC_FMSUB_df = (0x5 << 22) | OPC_MSA_3RF_1B, 154a2b0a27dSPhilippe Mathieu-Daudé OPC_MADD_Q_df = (0x5 << 22) | OPC_MSA_3RF_1C, 155a2b0a27dSPhilippe Mathieu-Daudé OPC_FCLE_df = (0x6 << 22) | OPC_MSA_3RF_1A, 156a2b0a27dSPhilippe Mathieu-Daudé OPC_MSUB_Q_df = (0x6 << 22) | OPC_MSA_3RF_1C, 157a2b0a27dSPhilippe Mathieu-Daudé OPC_FCULE_df = (0x7 << 22) | OPC_MSA_3RF_1A, 158a2b0a27dSPhilippe Mathieu-Daudé OPC_FEXP2_df = (0x7 << 22) | OPC_MSA_3RF_1B, 159a2b0a27dSPhilippe Mathieu-Daudé OPC_FSAF_df = (0x8 << 22) | OPC_MSA_3RF_1A, 160a2b0a27dSPhilippe Mathieu-Daudé OPC_FEXDO_df = (0x8 << 22) | OPC_MSA_3RF_1B, 161a2b0a27dSPhilippe Mathieu-Daudé OPC_FSUN_df = (0x9 << 22) | OPC_MSA_3RF_1A, 162a2b0a27dSPhilippe Mathieu-Daudé OPC_FSOR_df = (0x9 << 22) | OPC_MSA_3RF_1C, 163a2b0a27dSPhilippe Mathieu-Daudé OPC_FSEQ_df = (0xA << 22) | OPC_MSA_3RF_1A, 164a2b0a27dSPhilippe Mathieu-Daudé OPC_FTQ_df = (0xA << 22) | OPC_MSA_3RF_1B, 165a2b0a27dSPhilippe Mathieu-Daudé OPC_FSUNE_df = (0xA << 22) | OPC_MSA_3RF_1C, 166a2b0a27dSPhilippe Mathieu-Daudé OPC_FSUEQ_df = (0xB << 22) | OPC_MSA_3RF_1A, 167a2b0a27dSPhilippe Mathieu-Daudé OPC_FSNE_df = (0xB << 22) | OPC_MSA_3RF_1C, 168a2b0a27dSPhilippe Mathieu-Daudé OPC_FSLT_df = (0xC << 22) | OPC_MSA_3RF_1A, 169a2b0a27dSPhilippe Mathieu-Daudé OPC_FMIN_df = (0xC << 22) | OPC_MSA_3RF_1B, 170a2b0a27dSPhilippe Mathieu-Daudé OPC_MULR_Q_df = (0xC << 22) | OPC_MSA_3RF_1C, 171a2b0a27dSPhilippe Mathieu-Daudé OPC_FSULT_df = (0xD << 22) | OPC_MSA_3RF_1A, 172a2b0a27dSPhilippe Mathieu-Daudé OPC_FMIN_A_df = (0xD << 22) | OPC_MSA_3RF_1B, 173a2b0a27dSPhilippe Mathieu-Daudé OPC_MADDR_Q_df = (0xD << 22) | OPC_MSA_3RF_1C, 174a2b0a27dSPhilippe Mathieu-Daudé OPC_FSLE_df = (0xE << 22) | OPC_MSA_3RF_1A, 175a2b0a27dSPhilippe Mathieu-Daudé OPC_FMAX_df = (0xE << 22) | OPC_MSA_3RF_1B, 176a2b0a27dSPhilippe Mathieu-Daudé OPC_MSUBR_Q_df = (0xE << 22) | OPC_MSA_3RF_1C, 177a2b0a27dSPhilippe Mathieu-Daudé OPC_FSULE_df = (0xF << 22) | OPC_MSA_3RF_1A, 178a2b0a27dSPhilippe Mathieu-Daudé OPC_FMAX_A_df = (0xF << 22) | OPC_MSA_3RF_1B, 179a2b0a27dSPhilippe Mathieu-Daudé }; 180a2b0a27dSPhilippe Mathieu-Daudé 18106106772SPhilippe Mathieu-Daudé static const char msaregnames[][6] = { 182a2b0a27dSPhilippe Mathieu-Daudé "w0.d0", "w0.d1", "w1.d0", "w1.d1", 183a2b0a27dSPhilippe Mathieu-Daudé "w2.d0", "w2.d1", "w3.d0", "w3.d1", 184a2b0a27dSPhilippe Mathieu-Daudé "w4.d0", "w4.d1", "w5.d0", "w5.d1", 185a2b0a27dSPhilippe Mathieu-Daudé "w6.d0", "w6.d1", "w7.d0", "w7.d1", 186a2b0a27dSPhilippe Mathieu-Daudé "w8.d0", "w8.d1", "w9.d0", "w9.d1", 187a2b0a27dSPhilippe Mathieu-Daudé "w10.d0", "w10.d1", "w11.d0", "w11.d1", 188a2b0a27dSPhilippe Mathieu-Daudé "w12.d0", "w12.d1", "w13.d0", "w13.d1", 189a2b0a27dSPhilippe Mathieu-Daudé "w14.d0", "w14.d1", "w15.d0", "w15.d1", 190a2b0a27dSPhilippe Mathieu-Daudé "w16.d0", "w16.d1", "w17.d0", "w17.d1", 191a2b0a27dSPhilippe Mathieu-Daudé "w18.d0", "w18.d1", "w19.d0", "w19.d1", 192a2b0a27dSPhilippe Mathieu-Daudé "w20.d0", "w20.d1", "w21.d0", "w21.d1", 193a2b0a27dSPhilippe Mathieu-Daudé "w22.d0", "w22.d1", "w23.d0", "w23.d1", 194a2b0a27dSPhilippe Mathieu-Daudé "w24.d0", "w24.d1", "w25.d0", "w25.d1", 195a2b0a27dSPhilippe Mathieu-Daudé "w26.d0", "w26.d1", "w27.d0", "w27.d1", 196a2b0a27dSPhilippe Mathieu-Daudé "w28.d0", "w28.d1", "w29.d0", "w29.d1", 197a2b0a27dSPhilippe Mathieu-Daudé "w30.d0", "w30.d1", "w31.d0", "w31.d1", 198a2b0a27dSPhilippe Mathieu-Daudé }; 199a2b0a27dSPhilippe Mathieu-Daudé 2004701d23aSPhilippe Mathieu-Daudé /* Encoding of Operation Field (must be indexed by CPUMIPSMSADataFormat) */ 2014701d23aSPhilippe Mathieu-Daudé struct dfe { 2024701d23aSPhilippe Mathieu-Daudé int start; 2034701d23aSPhilippe Mathieu-Daudé int length; 2044701d23aSPhilippe Mathieu-Daudé uint32_t mask; 2054701d23aSPhilippe Mathieu-Daudé }; 2064701d23aSPhilippe Mathieu-Daudé 2074701d23aSPhilippe Mathieu-Daudé /* 2084701d23aSPhilippe Mathieu-Daudé * Extract immediate from df/{m,n} format (used by ELM & BIT instructions). 2094701d23aSPhilippe Mathieu-Daudé * Returns the immediate value, or -1 if the format does not match. 2104701d23aSPhilippe Mathieu-Daudé */ 2114701d23aSPhilippe Mathieu-Daudé static int df_extract_val(DisasContext *ctx, int x, const struct dfe *s) 2124701d23aSPhilippe Mathieu-Daudé { 2134701d23aSPhilippe Mathieu-Daudé for (unsigned i = 0; i < 4; i++) { 2144701d23aSPhilippe Mathieu-Daudé if (extract32(x, s->start, s->length) == s->mask) { 2154701d23aSPhilippe Mathieu-Daudé return extract32(x, 0, s->start); 2164701d23aSPhilippe Mathieu-Daudé } 2174701d23aSPhilippe Mathieu-Daudé } 2184701d23aSPhilippe Mathieu-Daudé return -1; 2194701d23aSPhilippe Mathieu-Daudé } 2204701d23aSPhilippe Mathieu-Daudé 2214701d23aSPhilippe Mathieu-Daudé /* 2224701d23aSPhilippe Mathieu-Daudé * Extract DataField from df/{m,n} format (used by ELM & BIT instructions). 2234701d23aSPhilippe Mathieu-Daudé * Returns the DataField, or -1 if the format does not match. 2244701d23aSPhilippe Mathieu-Daudé */ 2254701d23aSPhilippe Mathieu-Daudé static int df_extract_df(DisasContext *ctx, int x, const struct dfe *s) 2264701d23aSPhilippe Mathieu-Daudé { 2274701d23aSPhilippe Mathieu-Daudé for (unsigned i = 0; i < 4; i++) { 2284701d23aSPhilippe Mathieu-Daudé if (extract32(x, s->start, s->length) == s->mask) { 2294701d23aSPhilippe Mathieu-Daudé return i; 2304701d23aSPhilippe Mathieu-Daudé } 2314701d23aSPhilippe Mathieu-Daudé } 2324701d23aSPhilippe Mathieu-Daudé return -1; 2334701d23aSPhilippe Mathieu-Daudé } 2344701d23aSPhilippe Mathieu-Daudé 2354701d23aSPhilippe Mathieu-Daudé static const struct dfe df_bit[] = { 2364701d23aSPhilippe Mathieu-Daudé /* Table 3.28 BIT Instruction Format */ 2374701d23aSPhilippe Mathieu-Daudé [DF_BYTE] = {3, 4, 0b1110}, 2384701d23aSPhilippe Mathieu-Daudé [DF_HALF] = {4, 3, 0b110}, 2394701d23aSPhilippe Mathieu-Daudé [DF_WORD] = {5, 2, 0b10}, 2404701d23aSPhilippe Mathieu-Daudé [DF_DOUBLE] = {6, 1, 0b0} 2414701d23aSPhilippe Mathieu-Daudé }; 2424701d23aSPhilippe Mathieu-Daudé 2434701d23aSPhilippe Mathieu-Daudé static int bit_m(DisasContext *ctx, int x) 2444701d23aSPhilippe Mathieu-Daudé { 2454701d23aSPhilippe Mathieu-Daudé return df_extract_val(ctx, x, df_bit); 2464701d23aSPhilippe Mathieu-Daudé } 2474701d23aSPhilippe Mathieu-Daudé 2484701d23aSPhilippe Mathieu-Daudé static int bit_df(DisasContext *ctx, int x) 2494701d23aSPhilippe Mathieu-Daudé { 2504701d23aSPhilippe Mathieu-Daudé return df_extract_df(ctx, x, df_bit); 2514701d23aSPhilippe Mathieu-Daudé } 2524701d23aSPhilippe Mathieu-Daudé 253a2b0a27dSPhilippe Mathieu-Daudé static TCGv_i64 msa_wr_d[64]; 254a2b0a27dSPhilippe Mathieu-Daudé 255a2b0a27dSPhilippe Mathieu-Daudé void msa_translate_init(void) 256a2b0a27dSPhilippe Mathieu-Daudé { 257a2b0a27dSPhilippe Mathieu-Daudé int i; 258a2b0a27dSPhilippe Mathieu-Daudé 259a2b0a27dSPhilippe Mathieu-Daudé for (i = 0; i < 32; i++) { 260bbc213b3SPhilippe Mathieu-Daudé int off; 261a2b0a27dSPhilippe Mathieu-Daudé 262a2b0a27dSPhilippe Mathieu-Daudé /* 263a2b0a27dSPhilippe Mathieu-Daudé * The MSA vector registers are mapped on the 264a2b0a27dSPhilippe Mathieu-Daudé * scalar floating-point unit (FPU) registers. 265a2b0a27dSPhilippe Mathieu-Daudé */ 266bbc213b3SPhilippe Mathieu-Daudé off = offsetof(CPUMIPSState, active_fpu.fpr[i].wr.d[0]); 267a2b0a27dSPhilippe Mathieu-Daudé msa_wr_d[i * 2] = fpu_f64[i]; 268bbc213b3SPhilippe Mathieu-Daudé 269a2b0a27dSPhilippe Mathieu-Daudé off = offsetof(CPUMIPSState, active_fpu.fpr[i].wr.d[1]); 270a2b0a27dSPhilippe Mathieu-Daudé msa_wr_d[i * 2 + 1] = 271a2b0a27dSPhilippe Mathieu-Daudé tcg_global_mem_new_i64(cpu_env, off, msaregnames[i * 2 + 1]); 272a2b0a27dSPhilippe Mathieu-Daudé } 273a2b0a27dSPhilippe Mathieu-Daudé } 274a2b0a27dSPhilippe Mathieu-Daudé 275340ee8b3SPhilippe Mathieu-Daudé /* 276340ee8b3SPhilippe Mathieu-Daudé * Check if MSA is enabled. 277340ee8b3SPhilippe Mathieu-Daudé * This function is always called with MSA available. 278340ee8b3SPhilippe Mathieu-Daudé * If MSA is disabled, raise an exception. 279340ee8b3SPhilippe Mathieu-Daudé */ 280340ee8b3SPhilippe Mathieu-Daudé static inline bool check_msa_enabled(DisasContext *ctx) 281a2b0a27dSPhilippe Mathieu-Daudé { 282a2b0a27dSPhilippe Mathieu-Daudé if (unlikely((ctx->hflags & MIPS_HFLAG_FPU) && 283a2b0a27dSPhilippe Mathieu-Daudé !(ctx->hflags & MIPS_HFLAG_F64))) { 284a2b0a27dSPhilippe Mathieu-Daudé gen_reserved_instruction(ctx); 285340ee8b3SPhilippe Mathieu-Daudé return false; 286a2b0a27dSPhilippe Mathieu-Daudé } 287a2b0a27dSPhilippe Mathieu-Daudé 288a2b0a27dSPhilippe Mathieu-Daudé if (unlikely(!(ctx->hflags & MIPS_HFLAG_MSA))) { 289a2b0a27dSPhilippe Mathieu-Daudé generate_exception_end(ctx, EXCP_MSADIS); 290340ee8b3SPhilippe Mathieu-Daudé return false; 291a2b0a27dSPhilippe Mathieu-Daudé } 292340ee8b3SPhilippe Mathieu-Daudé return true; 293a2b0a27dSPhilippe Mathieu-Daudé } 294a2b0a27dSPhilippe Mathieu-Daudé 295ce121fe2SPhilippe Mathieu-Daudé typedef void gen_helper_piv(TCGv_ptr, TCGv_i32, TCGv); 296*adcff99aSPhilippe Mathieu-Daudé typedef void gen_helper_pii(TCGv_ptr, TCGv_i32, TCGv_i32); 2977cc351ffSPhilippe Mathieu-Daudé typedef void gen_helper_piii(TCGv_ptr, TCGv_i32, TCGv_i32, TCGv_i32); 298b8e74816SPhilippe Mathieu-Daudé typedef void gen_helper_piiii(TCGv_ptr, TCGv_i32, TCGv_i32, TCGv_i32, TCGv_i32); 299b8e74816SPhilippe Mathieu-Daudé 300ce121fe2SPhilippe Mathieu-Daudé #define TRANS_DF_x(TYPE, NAME, trans_func, gen_func) \ 301ce121fe2SPhilippe Mathieu-Daudé static gen_helper_p##TYPE * const NAME##_tab[4] = { \ 302ce121fe2SPhilippe Mathieu-Daudé gen_func##_b, gen_func##_h, gen_func##_w, gen_func##_d \ 303ce121fe2SPhilippe Mathieu-Daudé }; \ 304ce121fe2SPhilippe Mathieu-Daudé TRANS(NAME, trans_func, NAME##_tab[a->df]) 305ce121fe2SPhilippe Mathieu-Daudé 306ce121fe2SPhilippe Mathieu-Daudé #define TRANS_DF_iv(NAME, trans_func, gen_func) \ 307ce121fe2SPhilippe Mathieu-Daudé TRANS_DF_x(iv, NAME, trans_func, gen_func) 308ce121fe2SPhilippe Mathieu-Daudé 309*adcff99aSPhilippe Mathieu-Daudé #define TRANS_DF_ii(NAME, trans_func, gen_func) \ 310*adcff99aSPhilippe Mathieu-Daudé TRANS_DF_x(ii, NAME, trans_func, gen_func) 311*adcff99aSPhilippe Mathieu-Daudé 312a2b0a27dSPhilippe Mathieu-Daudé static void gen_check_zero_element(TCGv tresult, uint8_t df, uint8_t wt, 313a2b0a27dSPhilippe Mathieu-Daudé TCGCond cond) 314a2b0a27dSPhilippe Mathieu-Daudé { 315a2b0a27dSPhilippe Mathieu-Daudé /* generates tcg ops to check if any element is 0 */ 316a2b0a27dSPhilippe Mathieu-Daudé /* Note this function only works with MSA_WRLEN = 128 */ 31740f75c02SPhilippe Mathieu-Daudé uint64_t eval_zero_or_big = dup_const(df, 1); 31840f75c02SPhilippe Mathieu-Daudé uint64_t eval_big = eval_zero_or_big << ((8 << df) - 1); 319a2b0a27dSPhilippe Mathieu-Daudé TCGv_i64 t0 = tcg_temp_new_i64(); 320a2b0a27dSPhilippe Mathieu-Daudé TCGv_i64 t1 = tcg_temp_new_i64(); 32140f75c02SPhilippe Mathieu-Daudé 322a2b0a27dSPhilippe Mathieu-Daudé tcg_gen_subi_i64(t0, msa_wr_d[wt << 1], eval_zero_or_big); 323a2b0a27dSPhilippe Mathieu-Daudé tcg_gen_andc_i64(t0, t0, msa_wr_d[wt << 1]); 324a2b0a27dSPhilippe Mathieu-Daudé tcg_gen_andi_i64(t0, t0, eval_big); 325a2b0a27dSPhilippe Mathieu-Daudé tcg_gen_subi_i64(t1, msa_wr_d[(wt << 1) + 1], eval_zero_or_big); 326a2b0a27dSPhilippe Mathieu-Daudé tcg_gen_andc_i64(t1, t1, msa_wr_d[(wt << 1) + 1]); 327a2b0a27dSPhilippe Mathieu-Daudé tcg_gen_andi_i64(t1, t1, eval_big); 328a2b0a27dSPhilippe Mathieu-Daudé tcg_gen_or_i64(t0, t0, t1); 329a2b0a27dSPhilippe Mathieu-Daudé /* if all bits are zero then all elements are not zero */ 330a2b0a27dSPhilippe Mathieu-Daudé /* if some bit is non-zero then some element is zero */ 331a2b0a27dSPhilippe Mathieu-Daudé tcg_gen_setcondi_i64(cond, t0, t0, 0); 332a2b0a27dSPhilippe Mathieu-Daudé tcg_gen_trunc_i64_tl(tresult, t0); 333a2b0a27dSPhilippe Mathieu-Daudé tcg_temp_free_i64(t0); 334a2b0a27dSPhilippe Mathieu-Daudé tcg_temp_free_i64(t1); 335a2b0a27dSPhilippe Mathieu-Daudé } 336a2b0a27dSPhilippe Mathieu-Daudé 337d61566cfSPhilippe Mathieu-Daudé static bool gen_msa_BxZ_V(DisasContext *ctx, int wt, int sa, TCGCond cond) 338a2b0a27dSPhilippe Mathieu-Daudé { 339a2b0a27dSPhilippe Mathieu-Daudé TCGv_i64 t0; 340a2b0a27dSPhilippe Mathieu-Daudé 341340ee8b3SPhilippe Mathieu-Daudé if (!check_msa_enabled(ctx)) { 342340ee8b3SPhilippe Mathieu-Daudé return true; 343340ee8b3SPhilippe Mathieu-Daudé } 344a2b0a27dSPhilippe Mathieu-Daudé 345a2b0a27dSPhilippe Mathieu-Daudé if (ctx->hflags & MIPS_HFLAG_BMASK) { 346a2b0a27dSPhilippe Mathieu-Daudé gen_reserved_instruction(ctx); 347a2b0a27dSPhilippe Mathieu-Daudé return true; 348a2b0a27dSPhilippe Mathieu-Daudé } 349a2b0a27dSPhilippe Mathieu-Daudé t0 = tcg_temp_new_i64(); 350a2b0a27dSPhilippe Mathieu-Daudé tcg_gen_or_i64(t0, msa_wr_d[wt << 1], msa_wr_d[(wt << 1) + 1]); 351a2b0a27dSPhilippe Mathieu-Daudé tcg_gen_setcondi_i64(cond, t0, t0, 0); 352a2b0a27dSPhilippe Mathieu-Daudé tcg_gen_trunc_i64_tl(bcond, t0); 353a2b0a27dSPhilippe Mathieu-Daudé tcg_temp_free_i64(t0); 354a2b0a27dSPhilippe Mathieu-Daudé 355d61566cfSPhilippe Mathieu-Daudé ctx->btarget = ctx->base.pc_next + (sa << 2) + 4; 356a2b0a27dSPhilippe Mathieu-Daudé 357a2b0a27dSPhilippe Mathieu-Daudé ctx->hflags |= MIPS_HFLAG_BC; 358a2b0a27dSPhilippe Mathieu-Daudé ctx->hflags |= MIPS_HFLAG_BDS32; 359a2b0a27dSPhilippe Mathieu-Daudé 360a2b0a27dSPhilippe Mathieu-Daudé return true; 361a2b0a27dSPhilippe Mathieu-Daudé } 362a2b0a27dSPhilippe Mathieu-Daudé 363a2b0a27dSPhilippe Mathieu-Daudé static bool trans_BZ_V(DisasContext *ctx, arg_msa_bz *a) 364a2b0a27dSPhilippe Mathieu-Daudé { 365d61566cfSPhilippe Mathieu-Daudé return gen_msa_BxZ_V(ctx, a->wt, a->sa, TCG_COND_EQ); 366a2b0a27dSPhilippe Mathieu-Daudé } 367a2b0a27dSPhilippe Mathieu-Daudé 368a2b0a27dSPhilippe Mathieu-Daudé static bool trans_BNZ_V(DisasContext *ctx, arg_msa_bz *a) 369a2b0a27dSPhilippe Mathieu-Daudé { 370d61566cfSPhilippe Mathieu-Daudé return gen_msa_BxZ_V(ctx, a->wt, a->sa, TCG_COND_NE); 371a2b0a27dSPhilippe Mathieu-Daudé } 372a2b0a27dSPhilippe Mathieu-Daudé 373d61566cfSPhilippe Mathieu-Daudé static bool gen_msa_BxZ(DisasContext *ctx, int df, int wt, int sa, bool if_not) 374a2b0a27dSPhilippe Mathieu-Daudé { 375340ee8b3SPhilippe Mathieu-Daudé if (!check_msa_enabled(ctx)) { 376340ee8b3SPhilippe Mathieu-Daudé return true; 377340ee8b3SPhilippe Mathieu-Daudé } 378a2b0a27dSPhilippe Mathieu-Daudé 379a2b0a27dSPhilippe Mathieu-Daudé if (ctx->hflags & MIPS_HFLAG_BMASK) { 380a2b0a27dSPhilippe Mathieu-Daudé gen_reserved_instruction(ctx); 381a2b0a27dSPhilippe Mathieu-Daudé return true; 382a2b0a27dSPhilippe Mathieu-Daudé } 383a2b0a27dSPhilippe Mathieu-Daudé 384a2b0a27dSPhilippe Mathieu-Daudé gen_check_zero_element(bcond, df, wt, if_not ? TCG_COND_EQ : TCG_COND_NE); 385a2b0a27dSPhilippe Mathieu-Daudé 386d61566cfSPhilippe Mathieu-Daudé ctx->btarget = ctx->base.pc_next + (sa << 2) + 4; 387a2b0a27dSPhilippe Mathieu-Daudé ctx->hflags |= MIPS_HFLAG_BC; 388a2b0a27dSPhilippe Mathieu-Daudé ctx->hflags |= MIPS_HFLAG_BDS32; 389a2b0a27dSPhilippe Mathieu-Daudé 390a2b0a27dSPhilippe Mathieu-Daudé return true; 391a2b0a27dSPhilippe Mathieu-Daudé } 392a2b0a27dSPhilippe Mathieu-Daudé 393d61566cfSPhilippe Mathieu-Daudé static bool trans_BZ(DisasContext *ctx, arg_msa_bz *a) 394a2b0a27dSPhilippe Mathieu-Daudé { 395d61566cfSPhilippe Mathieu-Daudé return gen_msa_BxZ(ctx, a->df, a->wt, a->sa, false); 396a2b0a27dSPhilippe Mathieu-Daudé } 397a2b0a27dSPhilippe Mathieu-Daudé 398d61566cfSPhilippe Mathieu-Daudé static bool trans_BNZ(DisasContext *ctx, arg_msa_bz *a) 399a2b0a27dSPhilippe Mathieu-Daudé { 400d61566cfSPhilippe Mathieu-Daudé return gen_msa_BxZ(ctx, a->df, a->wt, a->sa, true); 401a2b0a27dSPhilippe Mathieu-Daudé } 402a2b0a27dSPhilippe Mathieu-Daudé 4037cc351ffSPhilippe Mathieu-Daudé static bool trans_msa_i8(DisasContext *ctx, arg_msa_i *a, 4047cc351ffSPhilippe Mathieu-Daudé gen_helper_piii *gen_msa_i8) 405a2b0a27dSPhilippe Mathieu-Daudé { 4067cc351ffSPhilippe Mathieu-Daudé if (!check_msa_enabled(ctx)) { 4077cc351ffSPhilippe Mathieu-Daudé return true; 408a2b0a27dSPhilippe Mathieu-Daudé } 409a2b0a27dSPhilippe Mathieu-Daudé 4107cc351ffSPhilippe Mathieu-Daudé gen_msa_i8(cpu_env, 4117cc351ffSPhilippe Mathieu-Daudé tcg_constant_i32(a->wd), 4127cc351ffSPhilippe Mathieu-Daudé tcg_constant_i32(a->ws), 4137cc351ffSPhilippe Mathieu-Daudé tcg_constant_i32(a->sa)); 4147cc351ffSPhilippe Mathieu-Daudé 4157cc351ffSPhilippe Mathieu-Daudé return true; 416a2b0a27dSPhilippe Mathieu-Daudé } 417a2b0a27dSPhilippe Mathieu-Daudé 4187cc351ffSPhilippe Mathieu-Daudé TRANS(ANDI, trans_msa_i8, gen_helper_msa_andi_b); 4197cc351ffSPhilippe Mathieu-Daudé TRANS(ORI, trans_msa_i8, gen_helper_msa_ori_b); 4207cc351ffSPhilippe Mathieu-Daudé TRANS(NORI, trans_msa_i8, gen_helper_msa_nori_b); 4217cc351ffSPhilippe Mathieu-Daudé TRANS(XORI, trans_msa_i8, gen_helper_msa_xori_b); 4227cc351ffSPhilippe Mathieu-Daudé TRANS(BMNZI, trans_msa_i8, gen_helper_msa_bmnzi_b); 4237cc351ffSPhilippe Mathieu-Daudé TRANS(BMZI, trans_msa_i8, gen_helper_msa_bmzi_b); 4247cc351ffSPhilippe Mathieu-Daudé TRANS(BSELI, trans_msa_i8, gen_helper_msa_bseli_b); 4257cc351ffSPhilippe Mathieu-Daudé 426a9e17958SPhilippe Mathieu-Daudé static bool trans_SHF(DisasContext *ctx, arg_msa_i *a) 427a9e17958SPhilippe Mathieu-Daudé { 428a9e17958SPhilippe Mathieu-Daudé if (a->df == DF_DOUBLE) { 429a9e17958SPhilippe Mathieu-Daudé return false; 430a9e17958SPhilippe Mathieu-Daudé } 431a9e17958SPhilippe Mathieu-Daudé 432a9e17958SPhilippe Mathieu-Daudé if (!check_msa_enabled(ctx)) { 433a9e17958SPhilippe Mathieu-Daudé return true; 434a9e17958SPhilippe Mathieu-Daudé } 435a9e17958SPhilippe Mathieu-Daudé 436a9e17958SPhilippe Mathieu-Daudé gen_helper_msa_shf_df(cpu_env, 437a9e17958SPhilippe Mathieu-Daudé tcg_constant_i32(a->df), 438a9e17958SPhilippe Mathieu-Daudé tcg_constant_i32(a->wd), 439a9e17958SPhilippe Mathieu-Daudé tcg_constant_i32(a->ws), 440a9e17958SPhilippe Mathieu-Daudé tcg_constant_i32(a->sa)); 441a9e17958SPhilippe Mathieu-Daudé 442a9e17958SPhilippe Mathieu-Daudé return true; 443a9e17958SPhilippe Mathieu-Daudé } 444a9e17958SPhilippe Mathieu-Daudé 445b8e74816SPhilippe Mathieu-Daudé static bool trans_msa_i5(DisasContext *ctx, arg_msa_i *a, 446b8e74816SPhilippe Mathieu-Daudé gen_helper_piiii *gen_msa_i5) 447a2b0a27dSPhilippe Mathieu-Daudé { 448b8e74816SPhilippe Mathieu-Daudé if (!check_msa_enabled(ctx)) { 449b8e74816SPhilippe Mathieu-Daudé return true; 450a2b0a27dSPhilippe Mathieu-Daudé } 451a2b0a27dSPhilippe Mathieu-Daudé 452b8e74816SPhilippe Mathieu-Daudé gen_msa_i5(cpu_env, 453b8e74816SPhilippe Mathieu-Daudé tcg_constant_i32(a->df), 454b8e74816SPhilippe Mathieu-Daudé tcg_constant_i32(a->wd), 455b8e74816SPhilippe Mathieu-Daudé tcg_constant_i32(a->ws), 456b8e74816SPhilippe Mathieu-Daudé tcg_constant_i32(a->sa)); 457b8e74816SPhilippe Mathieu-Daudé 458b8e74816SPhilippe Mathieu-Daudé return true; 459a2b0a27dSPhilippe Mathieu-Daudé } 460a2b0a27dSPhilippe Mathieu-Daudé 461b8e74816SPhilippe Mathieu-Daudé TRANS(ADDVI, trans_msa_i5, gen_helper_msa_addvi_df); 462b8e74816SPhilippe Mathieu-Daudé TRANS(SUBVI, trans_msa_i5, gen_helper_msa_subvi_df); 463b8e74816SPhilippe Mathieu-Daudé TRANS(MAXI_S, trans_msa_i5, gen_helper_msa_maxi_s_df); 464b8e74816SPhilippe Mathieu-Daudé TRANS(MAXI_U, trans_msa_i5, gen_helper_msa_maxi_u_df); 465b8e74816SPhilippe Mathieu-Daudé TRANS(MINI_S, trans_msa_i5, gen_helper_msa_mini_s_df); 466b8e74816SPhilippe Mathieu-Daudé TRANS(MINI_U, trans_msa_i5, gen_helper_msa_mini_u_df); 467b8e74816SPhilippe Mathieu-Daudé TRANS(CLTI_S, trans_msa_i5, gen_helper_msa_clti_s_df); 468b8e74816SPhilippe Mathieu-Daudé TRANS(CLTI_U, trans_msa_i5, gen_helper_msa_clti_u_df); 469b8e74816SPhilippe Mathieu-Daudé TRANS(CLEI_S, trans_msa_i5, gen_helper_msa_clei_s_df); 470b8e74816SPhilippe Mathieu-Daudé TRANS(CLEI_U, trans_msa_i5, gen_helper_msa_clei_u_df); 471b8e74816SPhilippe Mathieu-Daudé TRANS(CEQI, trans_msa_i5, gen_helper_msa_ceqi_df); 472b8e74816SPhilippe Mathieu-Daudé 47375094c33SPhilippe Mathieu-Daudé static bool trans_LDI(DisasContext *ctx, arg_msa_ldi *a) 47475094c33SPhilippe Mathieu-Daudé { 47575094c33SPhilippe Mathieu-Daudé if (!check_msa_enabled(ctx)) { 47675094c33SPhilippe Mathieu-Daudé return true; 47775094c33SPhilippe Mathieu-Daudé } 47875094c33SPhilippe Mathieu-Daudé 47975094c33SPhilippe Mathieu-Daudé gen_helper_msa_ldi_df(cpu_env, 48075094c33SPhilippe Mathieu-Daudé tcg_constant_i32(a->df), 48175094c33SPhilippe Mathieu-Daudé tcg_constant_i32(a->wd), 48275094c33SPhilippe Mathieu-Daudé tcg_constant_i32(a->sa)); 48375094c33SPhilippe Mathieu-Daudé 48475094c33SPhilippe Mathieu-Daudé return true; 48575094c33SPhilippe Mathieu-Daudé } 48675094c33SPhilippe Mathieu-Daudé 4874701d23aSPhilippe Mathieu-Daudé static bool trans_msa_bit(DisasContext *ctx, arg_msa_bit *a, 4884701d23aSPhilippe Mathieu-Daudé gen_helper_piiii *gen_msa_bit) 489a2b0a27dSPhilippe Mathieu-Daudé { 4904701d23aSPhilippe Mathieu-Daudé if (a->df < 0) { 4914701d23aSPhilippe Mathieu-Daudé return false; 492a2b0a27dSPhilippe Mathieu-Daudé } 493a2b0a27dSPhilippe Mathieu-Daudé 4944701d23aSPhilippe Mathieu-Daudé if (!check_msa_enabled(ctx)) { 4954701d23aSPhilippe Mathieu-Daudé return true; 496a2b0a27dSPhilippe Mathieu-Daudé } 497a2b0a27dSPhilippe Mathieu-Daudé 4984701d23aSPhilippe Mathieu-Daudé gen_msa_bit(cpu_env, 4994701d23aSPhilippe Mathieu-Daudé tcg_constant_i32(a->df), 5004701d23aSPhilippe Mathieu-Daudé tcg_constant_i32(a->wd), 5014701d23aSPhilippe Mathieu-Daudé tcg_constant_i32(a->ws), 5024701d23aSPhilippe Mathieu-Daudé tcg_constant_i32(a->m)); 5034701d23aSPhilippe Mathieu-Daudé 5044701d23aSPhilippe Mathieu-Daudé return true; 505a2b0a27dSPhilippe Mathieu-Daudé } 506a2b0a27dSPhilippe Mathieu-Daudé 5074701d23aSPhilippe Mathieu-Daudé TRANS(SLLI, trans_msa_bit, gen_helper_msa_slli_df); 5084701d23aSPhilippe Mathieu-Daudé TRANS(SRAI, trans_msa_bit, gen_helper_msa_srai_df); 5094701d23aSPhilippe Mathieu-Daudé TRANS(SRLI, trans_msa_bit, gen_helper_msa_srli_df); 5104701d23aSPhilippe Mathieu-Daudé TRANS(BCLRI, trans_msa_bit, gen_helper_msa_bclri_df); 5114701d23aSPhilippe Mathieu-Daudé TRANS(BSETI, trans_msa_bit, gen_helper_msa_bseti_df); 5124701d23aSPhilippe Mathieu-Daudé TRANS(BNEGI, trans_msa_bit, gen_helper_msa_bnegi_df); 5134701d23aSPhilippe Mathieu-Daudé TRANS(BINSLI, trans_msa_bit, gen_helper_msa_binsli_df); 5144701d23aSPhilippe Mathieu-Daudé TRANS(BINSRI, trans_msa_bit, gen_helper_msa_binsri_df); 5154701d23aSPhilippe Mathieu-Daudé TRANS(SAT_S, trans_msa_bit, gen_helper_msa_sat_u_df); 5164701d23aSPhilippe Mathieu-Daudé TRANS(SAT_U, trans_msa_bit, gen_helper_msa_sat_u_df); 5174701d23aSPhilippe Mathieu-Daudé TRANS(SRARI, trans_msa_bit, gen_helper_msa_srari_df); 5184701d23aSPhilippe Mathieu-Daudé TRANS(SRLRI, trans_msa_bit, gen_helper_msa_srlri_df); 5194701d23aSPhilippe Mathieu-Daudé 520a2b0a27dSPhilippe Mathieu-Daudé static void gen_msa_3r(DisasContext *ctx) 521a2b0a27dSPhilippe Mathieu-Daudé { 522a2b0a27dSPhilippe Mathieu-Daudé #define MASK_MSA_3R(op) (MASK_MSA_MINOR(op) | (op & (0x7 << 23))) 523a2b0a27dSPhilippe Mathieu-Daudé uint8_t df = (ctx->opcode >> 21) & 0x3; 524a2b0a27dSPhilippe Mathieu-Daudé uint8_t wt = (ctx->opcode >> 16) & 0x1f; 525a2b0a27dSPhilippe Mathieu-Daudé uint8_t ws = (ctx->opcode >> 11) & 0x1f; 526a2b0a27dSPhilippe Mathieu-Daudé uint8_t wd = (ctx->opcode >> 6) & 0x1f; 527a2b0a27dSPhilippe Mathieu-Daudé 528a2b0a27dSPhilippe Mathieu-Daudé TCGv_i32 tdf = tcg_const_i32(df); 529a2b0a27dSPhilippe Mathieu-Daudé TCGv_i32 twd = tcg_const_i32(wd); 530a2b0a27dSPhilippe Mathieu-Daudé TCGv_i32 tws = tcg_const_i32(ws); 531a2b0a27dSPhilippe Mathieu-Daudé TCGv_i32 twt = tcg_const_i32(wt); 532a2b0a27dSPhilippe Mathieu-Daudé 533a2b0a27dSPhilippe Mathieu-Daudé switch (MASK_MSA_3R(ctx->opcode)) { 534a2b0a27dSPhilippe Mathieu-Daudé case OPC_BINSL_df: 535a2b0a27dSPhilippe Mathieu-Daudé switch (df) { 536a2b0a27dSPhilippe Mathieu-Daudé case DF_BYTE: 537a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_binsl_b(cpu_env, twd, tws, twt); 538a2b0a27dSPhilippe Mathieu-Daudé break; 539a2b0a27dSPhilippe Mathieu-Daudé case DF_HALF: 540a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_binsl_h(cpu_env, twd, tws, twt); 541a2b0a27dSPhilippe Mathieu-Daudé break; 542a2b0a27dSPhilippe Mathieu-Daudé case DF_WORD: 543a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_binsl_w(cpu_env, twd, tws, twt); 544a2b0a27dSPhilippe Mathieu-Daudé break; 545a2b0a27dSPhilippe Mathieu-Daudé case DF_DOUBLE: 546a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_binsl_d(cpu_env, twd, tws, twt); 547a2b0a27dSPhilippe Mathieu-Daudé break; 548a2b0a27dSPhilippe Mathieu-Daudé } 549a2b0a27dSPhilippe Mathieu-Daudé break; 550a2b0a27dSPhilippe Mathieu-Daudé case OPC_BINSR_df: 551a2b0a27dSPhilippe Mathieu-Daudé switch (df) { 552a2b0a27dSPhilippe Mathieu-Daudé case DF_BYTE: 553a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_binsr_b(cpu_env, twd, tws, twt); 554a2b0a27dSPhilippe Mathieu-Daudé break; 555a2b0a27dSPhilippe Mathieu-Daudé case DF_HALF: 556a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_binsr_h(cpu_env, twd, tws, twt); 557a2b0a27dSPhilippe Mathieu-Daudé break; 558a2b0a27dSPhilippe Mathieu-Daudé case DF_WORD: 559a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_binsr_w(cpu_env, twd, tws, twt); 560a2b0a27dSPhilippe Mathieu-Daudé break; 561a2b0a27dSPhilippe Mathieu-Daudé case DF_DOUBLE: 562a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_binsr_d(cpu_env, twd, tws, twt); 563a2b0a27dSPhilippe Mathieu-Daudé break; 564a2b0a27dSPhilippe Mathieu-Daudé } 565a2b0a27dSPhilippe Mathieu-Daudé break; 566a2b0a27dSPhilippe Mathieu-Daudé case OPC_BCLR_df: 567a2b0a27dSPhilippe Mathieu-Daudé switch (df) { 568a2b0a27dSPhilippe Mathieu-Daudé case DF_BYTE: 569a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_bclr_b(cpu_env, twd, tws, twt); 570a2b0a27dSPhilippe Mathieu-Daudé break; 571a2b0a27dSPhilippe Mathieu-Daudé case DF_HALF: 572a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_bclr_h(cpu_env, twd, tws, twt); 573a2b0a27dSPhilippe Mathieu-Daudé break; 574a2b0a27dSPhilippe Mathieu-Daudé case DF_WORD: 575a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_bclr_w(cpu_env, twd, tws, twt); 576a2b0a27dSPhilippe Mathieu-Daudé break; 577a2b0a27dSPhilippe Mathieu-Daudé case DF_DOUBLE: 578a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_bclr_d(cpu_env, twd, tws, twt); 579a2b0a27dSPhilippe Mathieu-Daudé break; 580a2b0a27dSPhilippe Mathieu-Daudé } 581a2b0a27dSPhilippe Mathieu-Daudé break; 582a2b0a27dSPhilippe Mathieu-Daudé case OPC_BNEG_df: 583a2b0a27dSPhilippe Mathieu-Daudé switch (df) { 584a2b0a27dSPhilippe Mathieu-Daudé case DF_BYTE: 585a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_bneg_b(cpu_env, twd, tws, twt); 586a2b0a27dSPhilippe Mathieu-Daudé break; 587a2b0a27dSPhilippe Mathieu-Daudé case DF_HALF: 588a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_bneg_h(cpu_env, twd, tws, twt); 589a2b0a27dSPhilippe Mathieu-Daudé break; 590a2b0a27dSPhilippe Mathieu-Daudé case DF_WORD: 591a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_bneg_w(cpu_env, twd, tws, twt); 592a2b0a27dSPhilippe Mathieu-Daudé break; 593a2b0a27dSPhilippe Mathieu-Daudé case DF_DOUBLE: 594a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_bneg_d(cpu_env, twd, tws, twt); 595a2b0a27dSPhilippe Mathieu-Daudé break; 596a2b0a27dSPhilippe Mathieu-Daudé } 597a2b0a27dSPhilippe Mathieu-Daudé break; 598a2b0a27dSPhilippe Mathieu-Daudé case OPC_BSET_df: 599a2b0a27dSPhilippe Mathieu-Daudé switch (df) { 600a2b0a27dSPhilippe Mathieu-Daudé case DF_BYTE: 601a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_bset_b(cpu_env, twd, tws, twt); 602a2b0a27dSPhilippe Mathieu-Daudé break; 603a2b0a27dSPhilippe Mathieu-Daudé case DF_HALF: 604a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_bset_h(cpu_env, twd, tws, twt); 605a2b0a27dSPhilippe Mathieu-Daudé break; 606a2b0a27dSPhilippe Mathieu-Daudé case DF_WORD: 607a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_bset_w(cpu_env, twd, tws, twt); 608a2b0a27dSPhilippe Mathieu-Daudé break; 609a2b0a27dSPhilippe Mathieu-Daudé case DF_DOUBLE: 610a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_bset_d(cpu_env, twd, tws, twt); 611a2b0a27dSPhilippe Mathieu-Daudé break; 612a2b0a27dSPhilippe Mathieu-Daudé } 613a2b0a27dSPhilippe Mathieu-Daudé break; 614a2b0a27dSPhilippe Mathieu-Daudé case OPC_ADD_A_df: 615a2b0a27dSPhilippe Mathieu-Daudé switch (df) { 616a2b0a27dSPhilippe Mathieu-Daudé case DF_BYTE: 617a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_add_a_b(cpu_env, twd, tws, twt); 618a2b0a27dSPhilippe Mathieu-Daudé break; 619a2b0a27dSPhilippe Mathieu-Daudé case DF_HALF: 620a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_add_a_h(cpu_env, twd, tws, twt); 621a2b0a27dSPhilippe Mathieu-Daudé break; 622a2b0a27dSPhilippe Mathieu-Daudé case DF_WORD: 623a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_add_a_w(cpu_env, twd, tws, twt); 624a2b0a27dSPhilippe Mathieu-Daudé break; 625a2b0a27dSPhilippe Mathieu-Daudé case DF_DOUBLE: 626a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_add_a_d(cpu_env, twd, tws, twt); 627a2b0a27dSPhilippe Mathieu-Daudé break; 628a2b0a27dSPhilippe Mathieu-Daudé } 629a2b0a27dSPhilippe Mathieu-Daudé break; 630a2b0a27dSPhilippe Mathieu-Daudé case OPC_ADDS_A_df: 631a2b0a27dSPhilippe Mathieu-Daudé switch (df) { 632a2b0a27dSPhilippe Mathieu-Daudé case DF_BYTE: 633a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_adds_a_b(cpu_env, twd, tws, twt); 634a2b0a27dSPhilippe Mathieu-Daudé break; 635a2b0a27dSPhilippe Mathieu-Daudé case DF_HALF: 636a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_adds_a_h(cpu_env, twd, tws, twt); 637a2b0a27dSPhilippe Mathieu-Daudé break; 638a2b0a27dSPhilippe Mathieu-Daudé case DF_WORD: 639a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_adds_a_w(cpu_env, twd, tws, twt); 640a2b0a27dSPhilippe Mathieu-Daudé break; 641a2b0a27dSPhilippe Mathieu-Daudé case DF_DOUBLE: 642a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_adds_a_d(cpu_env, twd, tws, twt); 643a2b0a27dSPhilippe Mathieu-Daudé break; 644a2b0a27dSPhilippe Mathieu-Daudé } 645a2b0a27dSPhilippe Mathieu-Daudé break; 646a2b0a27dSPhilippe Mathieu-Daudé case OPC_ADDS_S_df: 647a2b0a27dSPhilippe Mathieu-Daudé switch (df) { 648a2b0a27dSPhilippe Mathieu-Daudé case DF_BYTE: 649a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_adds_s_b(cpu_env, twd, tws, twt); 650a2b0a27dSPhilippe Mathieu-Daudé break; 651a2b0a27dSPhilippe Mathieu-Daudé case DF_HALF: 652a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_adds_s_h(cpu_env, twd, tws, twt); 653a2b0a27dSPhilippe Mathieu-Daudé break; 654a2b0a27dSPhilippe Mathieu-Daudé case DF_WORD: 655a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_adds_s_w(cpu_env, twd, tws, twt); 656a2b0a27dSPhilippe Mathieu-Daudé break; 657a2b0a27dSPhilippe Mathieu-Daudé case DF_DOUBLE: 658a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_adds_s_d(cpu_env, twd, tws, twt); 659a2b0a27dSPhilippe Mathieu-Daudé break; 660a2b0a27dSPhilippe Mathieu-Daudé } 661a2b0a27dSPhilippe Mathieu-Daudé break; 662a2b0a27dSPhilippe Mathieu-Daudé case OPC_ADDS_U_df: 663a2b0a27dSPhilippe Mathieu-Daudé switch (df) { 664a2b0a27dSPhilippe Mathieu-Daudé case DF_BYTE: 665a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_adds_u_b(cpu_env, twd, tws, twt); 666a2b0a27dSPhilippe Mathieu-Daudé break; 667a2b0a27dSPhilippe Mathieu-Daudé case DF_HALF: 668a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_adds_u_h(cpu_env, twd, tws, twt); 669a2b0a27dSPhilippe Mathieu-Daudé break; 670a2b0a27dSPhilippe Mathieu-Daudé case DF_WORD: 671a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_adds_u_w(cpu_env, twd, tws, twt); 672a2b0a27dSPhilippe Mathieu-Daudé break; 673a2b0a27dSPhilippe Mathieu-Daudé case DF_DOUBLE: 674a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_adds_u_d(cpu_env, twd, tws, twt); 675a2b0a27dSPhilippe Mathieu-Daudé break; 676a2b0a27dSPhilippe Mathieu-Daudé } 677a2b0a27dSPhilippe Mathieu-Daudé break; 678a2b0a27dSPhilippe Mathieu-Daudé case OPC_ADDV_df: 679a2b0a27dSPhilippe Mathieu-Daudé switch (df) { 680a2b0a27dSPhilippe Mathieu-Daudé case DF_BYTE: 681a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_addv_b(cpu_env, twd, tws, twt); 682a2b0a27dSPhilippe Mathieu-Daudé break; 683a2b0a27dSPhilippe Mathieu-Daudé case DF_HALF: 684a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_addv_h(cpu_env, twd, tws, twt); 685a2b0a27dSPhilippe Mathieu-Daudé break; 686a2b0a27dSPhilippe Mathieu-Daudé case DF_WORD: 687a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_addv_w(cpu_env, twd, tws, twt); 688a2b0a27dSPhilippe Mathieu-Daudé break; 689a2b0a27dSPhilippe Mathieu-Daudé case DF_DOUBLE: 690a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_addv_d(cpu_env, twd, tws, twt); 691a2b0a27dSPhilippe Mathieu-Daudé break; 692a2b0a27dSPhilippe Mathieu-Daudé } 693a2b0a27dSPhilippe Mathieu-Daudé break; 694a2b0a27dSPhilippe Mathieu-Daudé case OPC_AVE_S_df: 695a2b0a27dSPhilippe Mathieu-Daudé switch (df) { 696a2b0a27dSPhilippe Mathieu-Daudé case DF_BYTE: 697a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_ave_s_b(cpu_env, twd, tws, twt); 698a2b0a27dSPhilippe Mathieu-Daudé break; 699a2b0a27dSPhilippe Mathieu-Daudé case DF_HALF: 700a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_ave_s_h(cpu_env, twd, tws, twt); 701a2b0a27dSPhilippe Mathieu-Daudé break; 702a2b0a27dSPhilippe Mathieu-Daudé case DF_WORD: 703a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_ave_s_w(cpu_env, twd, tws, twt); 704a2b0a27dSPhilippe Mathieu-Daudé break; 705a2b0a27dSPhilippe Mathieu-Daudé case DF_DOUBLE: 706a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_ave_s_d(cpu_env, twd, tws, twt); 707a2b0a27dSPhilippe Mathieu-Daudé break; 708a2b0a27dSPhilippe Mathieu-Daudé } 709a2b0a27dSPhilippe Mathieu-Daudé break; 710a2b0a27dSPhilippe Mathieu-Daudé case OPC_AVE_U_df: 711a2b0a27dSPhilippe Mathieu-Daudé switch (df) { 712a2b0a27dSPhilippe Mathieu-Daudé case DF_BYTE: 713a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_ave_u_b(cpu_env, twd, tws, twt); 714a2b0a27dSPhilippe Mathieu-Daudé break; 715a2b0a27dSPhilippe Mathieu-Daudé case DF_HALF: 716a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_ave_u_h(cpu_env, twd, tws, twt); 717a2b0a27dSPhilippe Mathieu-Daudé break; 718a2b0a27dSPhilippe Mathieu-Daudé case DF_WORD: 719a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_ave_u_w(cpu_env, twd, tws, twt); 720a2b0a27dSPhilippe Mathieu-Daudé break; 721a2b0a27dSPhilippe Mathieu-Daudé case DF_DOUBLE: 722a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_ave_u_d(cpu_env, twd, tws, twt); 723a2b0a27dSPhilippe Mathieu-Daudé break; 724a2b0a27dSPhilippe Mathieu-Daudé } 725a2b0a27dSPhilippe Mathieu-Daudé break; 726a2b0a27dSPhilippe Mathieu-Daudé case OPC_AVER_S_df: 727a2b0a27dSPhilippe Mathieu-Daudé switch (df) { 728a2b0a27dSPhilippe Mathieu-Daudé case DF_BYTE: 729a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_aver_s_b(cpu_env, twd, tws, twt); 730a2b0a27dSPhilippe Mathieu-Daudé break; 731a2b0a27dSPhilippe Mathieu-Daudé case DF_HALF: 732a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_aver_s_h(cpu_env, twd, tws, twt); 733a2b0a27dSPhilippe Mathieu-Daudé break; 734a2b0a27dSPhilippe Mathieu-Daudé case DF_WORD: 735a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_aver_s_w(cpu_env, twd, tws, twt); 736a2b0a27dSPhilippe Mathieu-Daudé break; 737a2b0a27dSPhilippe Mathieu-Daudé case DF_DOUBLE: 738a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_aver_s_d(cpu_env, twd, tws, twt); 739a2b0a27dSPhilippe Mathieu-Daudé break; 740a2b0a27dSPhilippe Mathieu-Daudé } 741a2b0a27dSPhilippe Mathieu-Daudé break; 742a2b0a27dSPhilippe Mathieu-Daudé case OPC_AVER_U_df: 743a2b0a27dSPhilippe Mathieu-Daudé switch (df) { 744a2b0a27dSPhilippe Mathieu-Daudé case DF_BYTE: 745a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_aver_u_b(cpu_env, twd, tws, twt); 746a2b0a27dSPhilippe Mathieu-Daudé break; 747a2b0a27dSPhilippe Mathieu-Daudé case DF_HALF: 748a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_aver_u_h(cpu_env, twd, tws, twt); 749a2b0a27dSPhilippe Mathieu-Daudé break; 750a2b0a27dSPhilippe Mathieu-Daudé case DF_WORD: 751a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_aver_u_w(cpu_env, twd, tws, twt); 752a2b0a27dSPhilippe Mathieu-Daudé break; 753a2b0a27dSPhilippe Mathieu-Daudé case DF_DOUBLE: 754a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_aver_u_d(cpu_env, twd, tws, twt); 755a2b0a27dSPhilippe Mathieu-Daudé break; 756a2b0a27dSPhilippe Mathieu-Daudé } 757a2b0a27dSPhilippe Mathieu-Daudé break; 758a2b0a27dSPhilippe Mathieu-Daudé case OPC_CEQ_df: 759a2b0a27dSPhilippe Mathieu-Daudé switch (df) { 760a2b0a27dSPhilippe Mathieu-Daudé case DF_BYTE: 761a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_ceq_b(cpu_env, twd, tws, twt); 762a2b0a27dSPhilippe Mathieu-Daudé break; 763a2b0a27dSPhilippe Mathieu-Daudé case DF_HALF: 764a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_ceq_h(cpu_env, twd, tws, twt); 765a2b0a27dSPhilippe Mathieu-Daudé break; 766a2b0a27dSPhilippe Mathieu-Daudé case DF_WORD: 767a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_ceq_w(cpu_env, twd, tws, twt); 768a2b0a27dSPhilippe Mathieu-Daudé break; 769a2b0a27dSPhilippe Mathieu-Daudé case DF_DOUBLE: 770a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_ceq_d(cpu_env, twd, tws, twt); 771a2b0a27dSPhilippe Mathieu-Daudé break; 772a2b0a27dSPhilippe Mathieu-Daudé } 773a2b0a27dSPhilippe Mathieu-Daudé break; 774a2b0a27dSPhilippe Mathieu-Daudé case OPC_CLE_S_df: 775a2b0a27dSPhilippe Mathieu-Daudé switch (df) { 776a2b0a27dSPhilippe Mathieu-Daudé case DF_BYTE: 777a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_cle_s_b(cpu_env, twd, tws, twt); 778a2b0a27dSPhilippe Mathieu-Daudé break; 779a2b0a27dSPhilippe Mathieu-Daudé case DF_HALF: 780a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_cle_s_h(cpu_env, twd, tws, twt); 781a2b0a27dSPhilippe Mathieu-Daudé break; 782a2b0a27dSPhilippe Mathieu-Daudé case DF_WORD: 783a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_cle_s_w(cpu_env, twd, tws, twt); 784a2b0a27dSPhilippe Mathieu-Daudé break; 785a2b0a27dSPhilippe Mathieu-Daudé case DF_DOUBLE: 786a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_cle_s_d(cpu_env, twd, tws, twt); 787a2b0a27dSPhilippe Mathieu-Daudé break; 788a2b0a27dSPhilippe Mathieu-Daudé } 789a2b0a27dSPhilippe Mathieu-Daudé break; 790a2b0a27dSPhilippe Mathieu-Daudé case OPC_CLE_U_df: 791a2b0a27dSPhilippe Mathieu-Daudé switch (df) { 792a2b0a27dSPhilippe Mathieu-Daudé case DF_BYTE: 793a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_cle_u_b(cpu_env, twd, tws, twt); 794a2b0a27dSPhilippe Mathieu-Daudé break; 795a2b0a27dSPhilippe Mathieu-Daudé case DF_HALF: 796a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_cle_u_h(cpu_env, twd, tws, twt); 797a2b0a27dSPhilippe Mathieu-Daudé break; 798a2b0a27dSPhilippe Mathieu-Daudé case DF_WORD: 799a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_cle_u_w(cpu_env, twd, tws, twt); 800a2b0a27dSPhilippe Mathieu-Daudé break; 801a2b0a27dSPhilippe Mathieu-Daudé case DF_DOUBLE: 802a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_cle_u_d(cpu_env, twd, tws, twt); 803a2b0a27dSPhilippe Mathieu-Daudé break; 804a2b0a27dSPhilippe Mathieu-Daudé } 805a2b0a27dSPhilippe Mathieu-Daudé break; 806a2b0a27dSPhilippe Mathieu-Daudé case OPC_CLT_S_df: 807a2b0a27dSPhilippe Mathieu-Daudé switch (df) { 808a2b0a27dSPhilippe Mathieu-Daudé case DF_BYTE: 809a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_clt_s_b(cpu_env, twd, tws, twt); 810a2b0a27dSPhilippe Mathieu-Daudé break; 811a2b0a27dSPhilippe Mathieu-Daudé case DF_HALF: 812a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_clt_s_h(cpu_env, twd, tws, twt); 813a2b0a27dSPhilippe Mathieu-Daudé break; 814a2b0a27dSPhilippe Mathieu-Daudé case DF_WORD: 815a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_clt_s_w(cpu_env, twd, tws, twt); 816a2b0a27dSPhilippe Mathieu-Daudé break; 817a2b0a27dSPhilippe Mathieu-Daudé case DF_DOUBLE: 818a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_clt_s_d(cpu_env, twd, tws, twt); 819a2b0a27dSPhilippe Mathieu-Daudé break; 820a2b0a27dSPhilippe Mathieu-Daudé } 821a2b0a27dSPhilippe Mathieu-Daudé break; 822a2b0a27dSPhilippe Mathieu-Daudé case OPC_CLT_U_df: 823a2b0a27dSPhilippe Mathieu-Daudé switch (df) { 824a2b0a27dSPhilippe Mathieu-Daudé case DF_BYTE: 825a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_clt_u_b(cpu_env, twd, tws, twt); 826a2b0a27dSPhilippe Mathieu-Daudé break; 827a2b0a27dSPhilippe Mathieu-Daudé case DF_HALF: 828a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_clt_u_h(cpu_env, twd, tws, twt); 829a2b0a27dSPhilippe Mathieu-Daudé break; 830a2b0a27dSPhilippe Mathieu-Daudé case DF_WORD: 831a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_clt_u_w(cpu_env, twd, tws, twt); 832a2b0a27dSPhilippe Mathieu-Daudé break; 833a2b0a27dSPhilippe Mathieu-Daudé case DF_DOUBLE: 834a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_clt_u_d(cpu_env, twd, tws, twt); 835a2b0a27dSPhilippe Mathieu-Daudé break; 836a2b0a27dSPhilippe Mathieu-Daudé } 837a2b0a27dSPhilippe Mathieu-Daudé break; 838a2b0a27dSPhilippe Mathieu-Daudé case OPC_DIV_S_df: 839a2b0a27dSPhilippe Mathieu-Daudé switch (df) { 840a2b0a27dSPhilippe Mathieu-Daudé case DF_BYTE: 841a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_div_s_b(cpu_env, twd, tws, twt); 842a2b0a27dSPhilippe Mathieu-Daudé break; 843a2b0a27dSPhilippe Mathieu-Daudé case DF_HALF: 844a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_div_s_h(cpu_env, twd, tws, twt); 845a2b0a27dSPhilippe Mathieu-Daudé break; 846a2b0a27dSPhilippe Mathieu-Daudé case DF_WORD: 847a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_div_s_w(cpu_env, twd, tws, twt); 848a2b0a27dSPhilippe Mathieu-Daudé break; 849a2b0a27dSPhilippe Mathieu-Daudé case DF_DOUBLE: 850a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_div_s_d(cpu_env, twd, tws, twt); 851a2b0a27dSPhilippe Mathieu-Daudé break; 852a2b0a27dSPhilippe Mathieu-Daudé } 853a2b0a27dSPhilippe Mathieu-Daudé break; 854a2b0a27dSPhilippe Mathieu-Daudé case OPC_DIV_U_df: 855a2b0a27dSPhilippe Mathieu-Daudé switch (df) { 856a2b0a27dSPhilippe Mathieu-Daudé case DF_BYTE: 857a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_div_u_b(cpu_env, twd, tws, twt); 858a2b0a27dSPhilippe Mathieu-Daudé break; 859a2b0a27dSPhilippe Mathieu-Daudé case DF_HALF: 860a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_div_u_h(cpu_env, twd, tws, twt); 861a2b0a27dSPhilippe Mathieu-Daudé break; 862a2b0a27dSPhilippe Mathieu-Daudé case DF_WORD: 863a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_div_u_w(cpu_env, twd, tws, twt); 864a2b0a27dSPhilippe Mathieu-Daudé break; 865a2b0a27dSPhilippe Mathieu-Daudé case DF_DOUBLE: 866a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_div_u_d(cpu_env, twd, tws, twt); 867a2b0a27dSPhilippe Mathieu-Daudé break; 868a2b0a27dSPhilippe Mathieu-Daudé } 869a2b0a27dSPhilippe Mathieu-Daudé break; 870a2b0a27dSPhilippe Mathieu-Daudé case OPC_MAX_A_df: 871a2b0a27dSPhilippe Mathieu-Daudé switch (df) { 872a2b0a27dSPhilippe Mathieu-Daudé case DF_BYTE: 873a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_max_a_b(cpu_env, twd, tws, twt); 874a2b0a27dSPhilippe Mathieu-Daudé break; 875a2b0a27dSPhilippe Mathieu-Daudé case DF_HALF: 876a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_max_a_h(cpu_env, twd, tws, twt); 877a2b0a27dSPhilippe Mathieu-Daudé break; 878a2b0a27dSPhilippe Mathieu-Daudé case DF_WORD: 879a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_max_a_w(cpu_env, twd, tws, twt); 880a2b0a27dSPhilippe Mathieu-Daudé break; 881a2b0a27dSPhilippe Mathieu-Daudé case DF_DOUBLE: 882a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_max_a_d(cpu_env, twd, tws, twt); 883a2b0a27dSPhilippe Mathieu-Daudé break; 884a2b0a27dSPhilippe Mathieu-Daudé } 885a2b0a27dSPhilippe Mathieu-Daudé break; 886a2b0a27dSPhilippe Mathieu-Daudé case OPC_MAX_S_df: 887a2b0a27dSPhilippe Mathieu-Daudé switch (df) { 888a2b0a27dSPhilippe Mathieu-Daudé case DF_BYTE: 889a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_max_s_b(cpu_env, twd, tws, twt); 890a2b0a27dSPhilippe Mathieu-Daudé break; 891a2b0a27dSPhilippe Mathieu-Daudé case DF_HALF: 892a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_max_s_h(cpu_env, twd, tws, twt); 893a2b0a27dSPhilippe Mathieu-Daudé break; 894a2b0a27dSPhilippe Mathieu-Daudé case DF_WORD: 895a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_max_s_w(cpu_env, twd, tws, twt); 896a2b0a27dSPhilippe Mathieu-Daudé break; 897a2b0a27dSPhilippe Mathieu-Daudé case DF_DOUBLE: 898a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_max_s_d(cpu_env, twd, tws, twt); 899a2b0a27dSPhilippe Mathieu-Daudé break; 900a2b0a27dSPhilippe Mathieu-Daudé } 901a2b0a27dSPhilippe Mathieu-Daudé break; 902a2b0a27dSPhilippe Mathieu-Daudé case OPC_MAX_U_df: 903a2b0a27dSPhilippe Mathieu-Daudé switch (df) { 904a2b0a27dSPhilippe Mathieu-Daudé case DF_BYTE: 905a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_max_u_b(cpu_env, twd, tws, twt); 906a2b0a27dSPhilippe Mathieu-Daudé break; 907a2b0a27dSPhilippe Mathieu-Daudé case DF_HALF: 908a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_max_u_h(cpu_env, twd, tws, twt); 909a2b0a27dSPhilippe Mathieu-Daudé break; 910a2b0a27dSPhilippe Mathieu-Daudé case DF_WORD: 911a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_max_u_w(cpu_env, twd, tws, twt); 912a2b0a27dSPhilippe Mathieu-Daudé break; 913a2b0a27dSPhilippe Mathieu-Daudé case DF_DOUBLE: 914a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_max_u_d(cpu_env, twd, tws, twt); 915a2b0a27dSPhilippe Mathieu-Daudé break; 916a2b0a27dSPhilippe Mathieu-Daudé } 917a2b0a27dSPhilippe Mathieu-Daudé break; 918a2b0a27dSPhilippe Mathieu-Daudé case OPC_MIN_A_df: 919a2b0a27dSPhilippe Mathieu-Daudé switch (df) { 920a2b0a27dSPhilippe Mathieu-Daudé case DF_BYTE: 921a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_min_a_b(cpu_env, twd, tws, twt); 922a2b0a27dSPhilippe Mathieu-Daudé break; 923a2b0a27dSPhilippe Mathieu-Daudé case DF_HALF: 924a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_min_a_h(cpu_env, twd, tws, twt); 925a2b0a27dSPhilippe Mathieu-Daudé break; 926a2b0a27dSPhilippe Mathieu-Daudé case DF_WORD: 927a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_min_a_w(cpu_env, twd, tws, twt); 928a2b0a27dSPhilippe Mathieu-Daudé break; 929a2b0a27dSPhilippe Mathieu-Daudé case DF_DOUBLE: 930a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_min_a_d(cpu_env, twd, tws, twt); 931a2b0a27dSPhilippe Mathieu-Daudé break; 932a2b0a27dSPhilippe Mathieu-Daudé } 933a2b0a27dSPhilippe Mathieu-Daudé break; 934a2b0a27dSPhilippe Mathieu-Daudé case OPC_MIN_S_df: 935a2b0a27dSPhilippe Mathieu-Daudé switch (df) { 936a2b0a27dSPhilippe Mathieu-Daudé case DF_BYTE: 937a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_min_s_b(cpu_env, twd, tws, twt); 938a2b0a27dSPhilippe Mathieu-Daudé break; 939a2b0a27dSPhilippe Mathieu-Daudé case DF_HALF: 940a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_min_s_h(cpu_env, twd, tws, twt); 941a2b0a27dSPhilippe Mathieu-Daudé break; 942a2b0a27dSPhilippe Mathieu-Daudé case DF_WORD: 943a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_min_s_w(cpu_env, twd, tws, twt); 944a2b0a27dSPhilippe Mathieu-Daudé break; 945a2b0a27dSPhilippe Mathieu-Daudé case DF_DOUBLE: 946a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_min_s_d(cpu_env, twd, tws, twt); 947a2b0a27dSPhilippe Mathieu-Daudé break; 948a2b0a27dSPhilippe Mathieu-Daudé } 949a2b0a27dSPhilippe Mathieu-Daudé break; 950a2b0a27dSPhilippe Mathieu-Daudé case OPC_MIN_U_df: 951a2b0a27dSPhilippe Mathieu-Daudé switch (df) { 952a2b0a27dSPhilippe Mathieu-Daudé case DF_BYTE: 953a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_min_u_b(cpu_env, twd, tws, twt); 954a2b0a27dSPhilippe Mathieu-Daudé break; 955a2b0a27dSPhilippe Mathieu-Daudé case DF_HALF: 956a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_min_u_h(cpu_env, twd, tws, twt); 957a2b0a27dSPhilippe Mathieu-Daudé break; 958a2b0a27dSPhilippe Mathieu-Daudé case DF_WORD: 959a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_min_u_w(cpu_env, twd, tws, twt); 960a2b0a27dSPhilippe Mathieu-Daudé break; 961a2b0a27dSPhilippe Mathieu-Daudé case DF_DOUBLE: 962a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_min_u_d(cpu_env, twd, tws, twt); 963a2b0a27dSPhilippe Mathieu-Daudé break; 964a2b0a27dSPhilippe Mathieu-Daudé } 965a2b0a27dSPhilippe Mathieu-Daudé break; 966a2b0a27dSPhilippe Mathieu-Daudé case OPC_MOD_S_df: 967a2b0a27dSPhilippe Mathieu-Daudé switch (df) { 968a2b0a27dSPhilippe Mathieu-Daudé case DF_BYTE: 969a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_mod_s_b(cpu_env, twd, tws, twt); 970a2b0a27dSPhilippe Mathieu-Daudé break; 971a2b0a27dSPhilippe Mathieu-Daudé case DF_HALF: 972a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_mod_s_h(cpu_env, twd, tws, twt); 973a2b0a27dSPhilippe Mathieu-Daudé break; 974a2b0a27dSPhilippe Mathieu-Daudé case DF_WORD: 975a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_mod_s_w(cpu_env, twd, tws, twt); 976a2b0a27dSPhilippe Mathieu-Daudé break; 977a2b0a27dSPhilippe Mathieu-Daudé case DF_DOUBLE: 978a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_mod_s_d(cpu_env, twd, tws, twt); 979a2b0a27dSPhilippe Mathieu-Daudé break; 980a2b0a27dSPhilippe Mathieu-Daudé } 981a2b0a27dSPhilippe Mathieu-Daudé break; 982a2b0a27dSPhilippe Mathieu-Daudé case OPC_MOD_U_df: 983a2b0a27dSPhilippe Mathieu-Daudé switch (df) { 984a2b0a27dSPhilippe Mathieu-Daudé case DF_BYTE: 985a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_mod_u_b(cpu_env, twd, tws, twt); 986a2b0a27dSPhilippe Mathieu-Daudé break; 987a2b0a27dSPhilippe Mathieu-Daudé case DF_HALF: 988a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_mod_u_h(cpu_env, twd, tws, twt); 989a2b0a27dSPhilippe Mathieu-Daudé break; 990a2b0a27dSPhilippe Mathieu-Daudé case DF_WORD: 991a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_mod_u_w(cpu_env, twd, tws, twt); 992a2b0a27dSPhilippe Mathieu-Daudé break; 993a2b0a27dSPhilippe Mathieu-Daudé case DF_DOUBLE: 994a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_mod_u_d(cpu_env, twd, tws, twt); 995a2b0a27dSPhilippe Mathieu-Daudé break; 996a2b0a27dSPhilippe Mathieu-Daudé } 997a2b0a27dSPhilippe Mathieu-Daudé break; 998a2b0a27dSPhilippe Mathieu-Daudé case OPC_MADDV_df: 999a2b0a27dSPhilippe Mathieu-Daudé switch (df) { 1000a2b0a27dSPhilippe Mathieu-Daudé case DF_BYTE: 1001a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_maddv_b(cpu_env, twd, tws, twt); 1002a2b0a27dSPhilippe Mathieu-Daudé break; 1003a2b0a27dSPhilippe Mathieu-Daudé case DF_HALF: 1004a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_maddv_h(cpu_env, twd, tws, twt); 1005a2b0a27dSPhilippe Mathieu-Daudé break; 1006a2b0a27dSPhilippe Mathieu-Daudé case DF_WORD: 1007a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_maddv_w(cpu_env, twd, tws, twt); 1008a2b0a27dSPhilippe Mathieu-Daudé break; 1009a2b0a27dSPhilippe Mathieu-Daudé case DF_DOUBLE: 1010a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_maddv_d(cpu_env, twd, tws, twt); 1011a2b0a27dSPhilippe Mathieu-Daudé break; 1012a2b0a27dSPhilippe Mathieu-Daudé } 1013a2b0a27dSPhilippe Mathieu-Daudé break; 1014a2b0a27dSPhilippe Mathieu-Daudé case OPC_MSUBV_df: 1015a2b0a27dSPhilippe Mathieu-Daudé switch (df) { 1016a2b0a27dSPhilippe Mathieu-Daudé case DF_BYTE: 1017a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_msubv_b(cpu_env, twd, tws, twt); 1018a2b0a27dSPhilippe Mathieu-Daudé break; 1019a2b0a27dSPhilippe Mathieu-Daudé case DF_HALF: 1020a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_msubv_h(cpu_env, twd, tws, twt); 1021a2b0a27dSPhilippe Mathieu-Daudé break; 1022a2b0a27dSPhilippe Mathieu-Daudé case DF_WORD: 1023a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_msubv_w(cpu_env, twd, tws, twt); 1024a2b0a27dSPhilippe Mathieu-Daudé break; 1025a2b0a27dSPhilippe Mathieu-Daudé case DF_DOUBLE: 1026a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_msubv_d(cpu_env, twd, tws, twt); 1027a2b0a27dSPhilippe Mathieu-Daudé break; 1028a2b0a27dSPhilippe Mathieu-Daudé } 1029a2b0a27dSPhilippe Mathieu-Daudé break; 1030a2b0a27dSPhilippe Mathieu-Daudé case OPC_ASUB_S_df: 1031a2b0a27dSPhilippe Mathieu-Daudé switch (df) { 1032a2b0a27dSPhilippe Mathieu-Daudé case DF_BYTE: 1033a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_asub_s_b(cpu_env, twd, tws, twt); 1034a2b0a27dSPhilippe Mathieu-Daudé break; 1035a2b0a27dSPhilippe Mathieu-Daudé case DF_HALF: 1036a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_asub_s_h(cpu_env, twd, tws, twt); 1037a2b0a27dSPhilippe Mathieu-Daudé break; 1038a2b0a27dSPhilippe Mathieu-Daudé case DF_WORD: 1039a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_asub_s_w(cpu_env, twd, tws, twt); 1040a2b0a27dSPhilippe Mathieu-Daudé break; 1041a2b0a27dSPhilippe Mathieu-Daudé case DF_DOUBLE: 1042a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_asub_s_d(cpu_env, twd, tws, twt); 1043a2b0a27dSPhilippe Mathieu-Daudé break; 1044a2b0a27dSPhilippe Mathieu-Daudé } 1045a2b0a27dSPhilippe Mathieu-Daudé break; 1046a2b0a27dSPhilippe Mathieu-Daudé case OPC_ASUB_U_df: 1047a2b0a27dSPhilippe Mathieu-Daudé switch (df) { 1048a2b0a27dSPhilippe Mathieu-Daudé case DF_BYTE: 1049a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_asub_u_b(cpu_env, twd, tws, twt); 1050a2b0a27dSPhilippe Mathieu-Daudé break; 1051a2b0a27dSPhilippe Mathieu-Daudé case DF_HALF: 1052a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_asub_u_h(cpu_env, twd, tws, twt); 1053a2b0a27dSPhilippe Mathieu-Daudé break; 1054a2b0a27dSPhilippe Mathieu-Daudé case DF_WORD: 1055a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_asub_u_w(cpu_env, twd, tws, twt); 1056a2b0a27dSPhilippe Mathieu-Daudé break; 1057a2b0a27dSPhilippe Mathieu-Daudé case DF_DOUBLE: 1058a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_asub_u_d(cpu_env, twd, tws, twt); 1059a2b0a27dSPhilippe Mathieu-Daudé break; 1060a2b0a27dSPhilippe Mathieu-Daudé } 1061a2b0a27dSPhilippe Mathieu-Daudé break; 1062a2b0a27dSPhilippe Mathieu-Daudé case OPC_ILVEV_df: 1063a2b0a27dSPhilippe Mathieu-Daudé switch (df) { 1064a2b0a27dSPhilippe Mathieu-Daudé case DF_BYTE: 1065a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_ilvev_b(cpu_env, twd, tws, twt); 1066a2b0a27dSPhilippe Mathieu-Daudé break; 1067a2b0a27dSPhilippe Mathieu-Daudé case DF_HALF: 1068a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_ilvev_h(cpu_env, twd, tws, twt); 1069a2b0a27dSPhilippe Mathieu-Daudé break; 1070a2b0a27dSPhilippe Mathieu-Daudé case DF_WORD: 1071a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_ilvev_w(cpu_env, twd, tws, twt); 1072a2b0a27dSPhilippe Mathieu-Daudé break; 1073a2b0a27dSPhilippe Mathieu-Daudé case DF_DOUBLE: 1074a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_ilvev_d(cpu_env, twd, tws, twt); 1075a2b0a27dSPhilippe Mathieu-Daudé break; 1076a2b0a27dSPhilippe Mathieu-Daudé } 1077a2b0a27dSPhilippe Mathieu-Daudé break; 1078a2b0a27dSPhilippe Mathieu-Daudé case OPC_ILVOD_df: 1079a2b0a27dSPhilippe Mathieu-Daudé switch (df) { 1080a2b0a27dSPhilippe Mathieu-Daudé case DF_BYTE: 1081a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_ilvod_b(cpu_env, twd, tws, twt); 1082a2b0a27dSPhilippe Mathieu-Daudé break; 1083a2b0a27dSPhilippe Mathieu-Daudé case DF_HALF: 1084a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_ilvod_h(cpu_env, twd, tws, twt); 1085a2b0a27dSPhilippe Mathieu-Daudé break; 1086a2b0a27dSPhilippe Mathieu-Daudé case DF_WORD: 1087a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_ilvod_w(cpu_env, twd, tws, twt); 1088a2b0a27dSPhilippe Mathieu-Daudé break; 1089a2b0a27dSPhilippe Mathieu-Daudé case DF_DOUBLE: 1090a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_ilvod_d(cpu_env, twd, tws, twt); 1091a2b0a27dSPhilippe Mathieu-Daudé break; 1092a2b0a27dSPhilippe Mathieu-Daudé } 1093a2b0a27dSPhilippe Mathieu-Daudé break; 1094a2b0a27dSPhilippe Mathieu-Daudé case OPC_ILVL_df: 1095a2b0a27dSPhilippe Mathieu-Daudé switch (df) { 1096a2b0a27dSPhilippe Mathieu-Daudé case DF_BYTE: 1097a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_ilvl_b(cpu_env, twd, tws, twt); 1098a2b0a27dSPhilippe Mathieu-Daudé break; 1099a2b0a27dSPhilippe Mathieu-Daudé case DF_HALF: 1100a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_ilvl_h(cpu_env, twd, tws, twt); 1101a2b0a27dSPhilippe Mathieu-Daudé break; 1102a2b0a27dSPhilippe Mathieu-Daudé case DF_WORD: 1103a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_ilvl_w(cpu_env, twd, tws, twt); 1104a2b0a27dSPhilippe Mathieu-Daudé break; 1105a2b0a27dSPhilippe Mathieu-Daudé case DF_DOUBLE: 1106a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_ilvl_d(cpu_env, twd, tws, twt); 1107a2b0a27dSPhilippe Mathieu-Daudé break; 1108a2b0a27dSPhilippe Mathieu-Daudé } 1109a2b0a27dSPhilippe Mathieu-Daudé break; 1110a2b0a27dSPhilippe Mathieu-Daudé case OPC_ILVR_df: 1111a2b0a27dSPhilippe Mathieu-Daudé switch (df) { 1112a2b0a27dSPhilippe Mathieu-Daudé case DF_BYTE: 1113a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_ilvr_b(cpu_env, twd, tws, twt); 1114a2b0a27dSPhilippe Mathieu-Daudé break; 1115a2b0a27dSPhilippe Mathieu-Daudé case DF_HALF: 1116a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_ilvr_h(cpu_env, twd, tws, twt); 1117a2b0a27dSPhilippe Mathieu-Daudé break; 1118a2b0a27dSPhilippe Mathieu-Daudé case DF_WORD: 1119a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_ilvr_w(cpu_env, twd, tws, twt); 1120a2b0a27dSPhilippe Mathieu-Daudé break; 1121a2b0a27dSPhilippe Mathieu-Daudé case DF_DOUBLE: 1122a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_ilvr_d(cpu_env, twd, tws, twt); 1123a2b0a27dSPhilippe Mathieu-Daudé break; 1124a2b0a27dSPhilippe Mathieu-Daudé } 1125a2b0a27dSPhilippe Mathieu-Daudé break; 1126a2b0a27dSPhilippe Mathieu-Daudé case OPC_PCKEV_df: 1127a2b0a27dSPhilippe Mathieu-Daudé switch (df) { 1128a2b0a27dSPhilippe Mathieu-Daudé case DF_BYTE: 1129a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_pckev_b(cpu_env, twd, tws, twt); 1130a2b0a27dSPhilippe Mathieu-Daudé break; 1131a2b0a27dSPhilippe Mathieu-Daudé case DF_HALF: 1132a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_pckev_h(cpu_env, twd, tws, twt); 1133a2b0a27dSPhilippe Mathieu-Daudé break; 1134a2b0a27dSPhilippe Mathieu-Daudé case DF_WORD: 1135a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_pckev_w(cpu_env, twd, tws, twt); 1136a2b0a27dSPhilippe Mathieu-Daudé break; 1137a2b0a27dSPhilippe Mathieu-Daudé case DF_DOUBLE: 1138a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_pckev_d(cpu_env, twd, tws, twt); 1139a2b0a27dSPhilippe Mathieu-Daudé break; 1140a2b0a27dSPhilippe Mathieu-Daudé } 1141a2b0a27dSPhilippe Mathieu-Daudé break; 1142a2b0a27dSPhilippe Mathieu-Daudé case OPC_PCKOD_df: 1143a2b0a27dSPhilippe Mathieu-Daudé switch (df) { 1144a2b0a27dSPhilippe Mathieu-Daudé case DF_BYTE: 1145a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_pckod_b(cpu_env, twd, tws, twt); 1146a2b0a27dSPhilippe Mathieu-Daudé break; 1147a2b0a27dSPhilippe Mathieu-Daudé case DF_HALF: 1148a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_pckod_h(cpu_env, twd, tws, twt); 1149a2b0a27dSPhilippe Mathieu-Daudé break; 1150a2b0a27dSPhilippe Mathieu-Daudé case DF_WORD: 1151a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_pckod_w(cpu_env, twd, tws, twt); 1152a2b0a27dSPhilippe Mathieu-Daudé break; 1153a2b0a27dSPhilippe Mathieu-Daudé case DF_DOUBLE: 1154a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_pckod_d(cpu_env, twd, tws, twt); 1155a2b0a27dSPhilippe Mathieu-Daudé break; 1156a2b0a27dSPhilippe Mathieu-Daudé } 1157a2b0a27dSPhilippe Mathieu-Daudé break; 1158a2b0a27dSPhilippe Mathieu-Daudé case OPC_SLL_df: 1159a2b0a27dSPhilippe Mathieu-Daudé switch (df) { 1160a2b0a27dSPhilippe Mathieu-Daudé case DF_BYTE: 1161a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_sll_b(cpu_env, twd, tws, twt); 1162a2b0a27dSPhilippe Mathieu-Daudé break; 1163a2b0a27dSPhilippe Mathieu-Daudé case DF_HALF: 1164a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_sll_h(cpu_env, twd, tws, twt); 1165a2b0a27dSPhilippe Mathieu-Daudé break; 1166a2b0a27dSPhilippe Mathieu-Daudé case DF_WORD: 1167a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_sll_w(cpu_env, twd, tws, twt); 1168a2b0a27dSPhilippe Mathieu-Daudé break; 1169a2b0a27dSPhilippe Mathieu-Daudé case DF_DOUBLE: 1170a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_sll_d(cpu_env, twd, tws, twt); 1171a2b0a27dSPhilippe Mathieu-Daudé break; 1172a2b0a27dSPhilippe Mathieu-Daudé } 1173a2b0a27dSPhilippe Mathieu-Daudé break; 1174a2b0a27dSPhilippe Mathieu-Daudé case OPC_SRA_df: 1175a2b0a27dSPhilippe Mathieu-Daudé switch (df) { 1176a2b0a27dSPhilippe Mathieu-Daudé case DF_BYTE: 1177a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_sra_b(cpu_env, twd, tws, twt); 1178a2b0a27dSPhilippe Mathieu-Daudé break; 1179a2b0a27dSPhilippe Mathieu-Daudé case DF_HALF: 1180a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_sra_h(cpu_env, twd, tws, twt); 1181a2b0a27dSPhilippe Mathieu-Daudé break; 1182a2b0a27dSPhilippe Mathieu-Daudé case DF_WORD: 1183a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_sra_w(cpu_env, twd, tws, twt); 1184a2b0a27dSPhilippe Mathieu-Daudé break; 1185a2b0a27dSPhilippe Mathieu-Daudé case DF_DOUBLE: 1186a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_sra_d(cpu_env, twd, tws, twt); 1187a2b0a27dSPhilippe Mathieu-Daudé break; 1188a2b0a27dSPhilippe Mathieu-Daudé } 1189a2b0a27dSPhilippe Mathieu-Daudé break; 1190a2b0a27dSPhilippe Mathieu-Daudé case OPC_SRAR_df: 1191a2b0a27dSPhilippe Mathieu-Daudé switch (df) { 1192a2b0a27dSPhilippe Mathieu-Daudé case DF_BYTE: 1193a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_srar_b(cpu_env, twd, tws, twt); 1194a2b0a27dSPhilippe Mathieu-Daudé break; 1195a2b0a27dSPhilippe Mathieu-Daudé case DF_HALF: 1196a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_srar_h(cpu_env, twd, tws, twt); 1197a2b0a27dSPhilippe Mathieu-Daudé break; 1198a2b0a27dSPhilippe Mathieu-Daudé case DF_WORD: 1199a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_srar_w(cpu_env, twd, tws, twt); 1200a2b0a27dSPhilippe Mathieu-Daudé break; 1201a2b0a27dSPhilippe Mathieu-Daudé case DF_DOUBLE: 1202a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_srar_d(cpu_env, twd, tws, twt); 1203a2b0a27dSPhilippe Mathieu-Daudé break; 1204a2b0a27dSPhilippe Mathieu-Daudé } 1205a2b0a27dSPhilippe Mathieu-Daudé break; 1206a2b0a27dSPhilippe Mathieu-Daudé case OPC_SRL_df: 1207a2b0a27dSPhilippe Mathieu-Daudé switch (df) { 1208a2b0a27dSPhilippe Mathieu-Daudé case DF_BYTE: 1209a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_srl_b(cpu_env, twd, tws, twt); 1210a2b0a27dSPhilippe Mathieu-Daudé break; 1211a2b0a27dSPhilippe Mathieu-Daudé case DF_HALF: 1212a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_srl_h(cpu_env, twd, tws, twt); 1213a2b0a27dSPhilippe Mathieu-Daudé break; 1214a2b0a27dSPhilippe Mathieu-Daudé case DF_WORD: 1215a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_srl_w(cpu_env, twd, tws, twt); 1216a2b0a27dSPhilippe Mathieu-Daudé break; 1217a2b0a27dSPhilippe Mathieu-Daudé case DF_DOUBLE: 1218a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_srl_d(cpu_env, twd, tws, twt); 1219a2b0a27dSPhilippe Mathieu-Daudé break; 1220a2b0a27dSPhilippe Mathieu-Daudé } 1221a2b0a27dSPhilippe Mathieu-Daudé break; 1222a2b0a27dSPhilippe Mathieu-Daudé case OPC_SRLR_df: 1223a2b0a27dSPhilippe Mathieu-Daudé switch (df) { 1224a2b0a27dSPhilippe Mathieu-Daudé case DF_BYTE: 1225a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_srlr_b(cpu_env, twd, tws, twt); 1226a2b0a27dSPhilippe Mathieu-Daudé break; 1227a2b0a27dSPhilippe Mathieu-Daudé case DF_HALF: 1228a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_srlr_h(cpu_env, twd, tws, twt); 1229a2b0a27dSPhilippe Mathieu-Daudé break; 1230a2b0a27dSPhilippe Mathieu-Daudé case DF_WORD: 1231a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_srlr_w(cpu_env, twd, tws, twt); 1232a2b0a27dSPhilippe Mathieu-Daudé break; 1233a2b0a27dSPhilippe Mathieu-Daudé case DF_DOUBLE: 1234a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_srlr_d(cpu_env, twd, tws, twt); 1235a2b0a27dSPhilippe Mathieu-Daudé break; 1236a2b0a27dSPhilippe Mathieu-Daudé } 1237a2b0a27dSPhilippe Mathieu-Daudé break; 1238a2b0a27dSPhilippe Mathieu-Daudé case OPC_SUBS_S_df: 1239a2b0a27dSPhilippe Mathieu-Daudé switch (df) { 1240a2b0a27dSPhilippe Mathieu-Daudé case DF_BYTE: 1241a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_subs_s_b(cpu_env, twd, tws, twt); 1242a2b0a27dSPhilippe Mathieu-Daudé break; 1243a2b0a27dSPhilippe Mathieu-Daudé case DF_HALF: 1244a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_subs_s_h(cpu_env, twd, tws, twt); 1245a2b0a27dSPhilippe Mathieu-Daudé break; 1246a2b0a27dSPhilippe Mathieu-Daudé case DF_WORD: 1247a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_subs_s_w(cpu_env, twd, tws, twt); 1248a2b0a27dSPhilippe Mathieu-Daudé break; 1249a2b0a27dSPhilippe Mathieu-Daudé case DF_DOUBLE: 1250a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_subs_s_d(cpu_env, twd, tws, twt); 1251a2b0a27dSPhilippe Mathieu-Daudé break; 1252a2b0a27dSPhilippe Mathieu-Daudé } 1253a2b0a27dSPhilippe Mathieu-Daudé break; 1254a2b0a27dSPhilippe Mathieu-Daudé case OPC_MULV_df: 1255a2b0a27dSPhilippe Mathieu-Daudé switch (df) { 1256a2b0a27dSPhilippe Mathieu-Daudé case DF_BYTE: 1257a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_mulv_b(cpu_env, twd, tws, twt); 1258a2b0a27dSPhilippe Mathieu-Daudé break; 1259a2b0a27dSPhilippe Mathieu-Daudé case DF_HALF: 1260a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_mulv_h(cpu_env, twd, tws, twt); 1261a2b0a27dSPhilippe Mathieu-Daudé break; 1262a2b0a27dSPhilippe Mathieu-Daudé case DF_WORD: 1263a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_mulv_w(cpu_env, twd, tws, twt); 1264a2b0a27dSPhilippe Mathieu-Daudé break; 1265a2b0a27dSPhilippe Mathieu-Daudé case DF_DOUBLE: 1266a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_mulv_d(cpu_env, twd, tws, twt); 1267a2b0a27dSPhilippe Mathieu-Daudé break; 1268a2b0a27dSPhilippe Mathieu-Daudé } 1269a2b0a27dSPhilippe Mathieu-Daudé break; 1270a2b0a27dSPhilippe Mathieu-Daudé case OPC_SLD_df: 1271a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_sld_df(cpu_env, tdf, twd, tws, twt); 1272a2b0a27dSPhilippe Mathieu-Daudé break; 1273a2b0a27dSPhilippe Mathieu-Daudé case OPC_VSHF_df: 1274a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_vshf_df(cpu_env, tdf, twd, tws, twt); 1275a2b0a27dSPhilippe Mathieu-Daudé break; 1276a2b0a27dSPhilippe Mathieu-Daudé case OPC_SUBV_df: 1277a2b0a27dSPhilippe Mathieu-Daudé switch (df) { 1278a2b0a27dSPhilippe Mathieu-Daudé case DF_BYTE: 1279a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_subv_b(cpu_env, twd, tws, twt); 1280a2b0a27dSPhilippe Mathieu-Daudé break; 1281a2b0a27dSPhilippe Mathieu-Daudé case DF_HALF: 1282a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_subv_h(cpu_env, twd, tws, twt); 1283a2b0a27dSPhilippe Mathieu-Daudé break; 1284a2b0a27dSPhilippe Mathieu-Daudé case DF_WORD: 1285a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_subv_w(cpu_env, twd, tws, twt); 1286a2b0a27dSPhilippe Mathieu-Daudé break; 1287a2b0a27dSPhilippe Mathieu-Daudé case DF_DOUBLE: 1288a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_subv_d(cpu_env, twd, tws, twt); 1289a2b0a27dSPhilippe Mathieu-Daudé break; 1290a2b0a27dSPhilippe Mathieu-Daudé } 1291a2b0a27dSPhilippe Mathieu-Daudé break; 1292a2b0a27dSPhilippe Mathieu-Daudé case OPC_SUBS_U_df: 1293a2b0a27dSPhilippe Mathieu-Daudé switch (df) { 1294a2b0a27dSPhilippe Mathieu-Daudé case DF_BYTE: 1295a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_subs_u_b(cpu_env, twd, tws, twt); 1296a2b0a27dSPhilippe Mathieu-Daudé break; 1297a2b0a27dSPhilippe Mathieu-Daudé case DF_HALF: 1298a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_subs_u_h(cpu_env, twd, tws, twt); 1299a2b0a27dSPhilippe Mathieu-Daudé break; 1300a2b0a27dSPhilippe Mathieu-Daudé case DF_WORD: 1301a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_subs_u_w(cpu_env, twd, tws, twt); 1302a2b0a27dSPhilippe Mathieu-Daudé break; 1303a2b0a27dSPhilippe Mathieu-Daudé case DF_DOUBLE: 1304a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_subs_u_d(cpu_env, twd, tws, twt); 1305a2b0a27dSPhilippe Mathieu-Daudé break; 1306a2b0a27dSPhilippe Mathieu-Daudé } 1307a2b0a27dSPhilippe Mathieu-Daudé break; 1308a2b0a27dSPhilippe Mathieu-Daudé case OPC_SPLAT_df: 1309a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_splat_df(cpu_env, tdf, twd, tws, twt); 1310a2b0a27dSPhilippe Mathieu-Daudé break; 1311a2b0a27dSPhilippe Mathieu-Daudé case OPC_SUBSUS_U_df: 1312a2b0a27dSPhilippe Mathieu-Daudé switch (df) { 1313a2b0a27dSPhilippe Mathieu-Daudé case DF_BYTE: 1314a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_subsus_u_b(cpu_env, twd, tws, twt); 1315a2b0a27dSPhilippe Mathieu-Daudé break; 1316a2b0a27dSPhilippe Mathieu-Daudé case DF_HALF: 1317a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_subsus_u_h(cpu_env, twd, tws, twt); 1318a2b0a27dSPhilippe Mathieu-Daudé break; 1319a2b0a27dSPhilippe Mathieu-Daudé case DF_WORD: 1320a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_subsus_u_w(cpu_env, twd, tws, twt); 1321a2b0a27dSPhilippe Mathieu-Daudé break; 1322a2b0a27dSPhilippe Mathieu-Daudé case DF_DOUBLE: 1323a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_subsus_u_d(cpu_env, twd, tws, twt); 1324a2b0a27dSPhilippe Mathieu-Daudé break; 1325a2b0a27dSPhilippe Mathieu-Daudé } 1326a2b0a27dSPhilippe Mathieu-Daudé break; 1327a2b0a27dSPhilippe Mathieu-Daudé case OPC_SUBSUU_S_df: 1328a2b0a27dSPhilippe Mathieu-Daudé switch (df) { 1329a2b0a27dSPhilippe Mathieu-Daudé case DF_BYTE: 1330a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_subsuu_s_b(cpu_env, twd, tws, twt); 1331a2b0a27dSPhilippe Mathieu-Daudé break; 1332a2b0a27dSPhilippe Mathieu-Daudé case DF_HALF: 1333a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_subsuu_s_h(cpu_env, twd, tws, twt); 1334a2b0a27dSPhilippe Mathieu-Daudé break; 1335a2b0a27dSPhilippe Mathieu-Daudé case DF_WORD: 1336a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_subsuu_s_w(cpu_env, twd, tws, twt); 1337a2b0a27dSPhilippe Mathieu-Daudé break; 1338a2b0a27dSPhilippe Mathieu-Daudé case DF_DOUBLE: 1339a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_subsuu_s_d(cpu_env, twd, tws, twt); 1340a2b0a27dSPhilippe Mathieu-Daudé break; 1341a2b0a27dSPhilippe Mathieu-Daudé } 1342a2b0a27dSPhilippe Mathieu-Daudé break; 1343a2b0a27dSPhilippe Mathieu-Daudé 1344a2b0a27dSPhilippe Mathieu-Daudé case OPC_DOTP_S_df: 1345a2b0a27dSPhilippe Mathieu-Daudé case OPC_DOTP_U_df: 1346a2b0a27dSPhilippe Mathieu-Daudé case OPC_DPADD_S_df: 1347a2b0a27dSPhilippe Mathieu-Daudé case OPC_DPADD_U_df: 1348a2b0a27dSPhilippe Mathieu-Daudé case OPC_DPSUB_S_df: 1349a2b0a27dSPhilippe Mathieu-Daudé case OPC_HADD_S_df: 1350a2b0a27dSPhilippe Mathieu-Daudé case OPC_DPSUB_U_df: 1351a2b0a27dSPhilippe Mathieu-Daudé case OPC_HADD_U_df: 1352a2b0a27dSPhilippe Mathieu-Daudé case OPC_HSUB_S_df: 1353a2b0a27dSPhilippe Mathieu-Daudé case OPC_HSUB_U_df: 1354a2b0a27dSPhilippe Mathieu-Daudé if (df == DF_BYTE) { 1355a2b0a27dSPhilippe Mathieu-Daudé gen_reserved_instruction(ctx); 1356a2b0a27dSPhilippe Mathieu-Daudé break; 1357a2b0a27dSPhilippe Mathieu-Daudé } 1358a2b0a27dSPhilippe Mathieu-Daudé switch (MASK_MSA_3R(ctx->opcode)) { 1359a2b0a27dSPhilippe Mathieu-Daudé case OPC_HADD_S_df: 1360a2b0a27dSPhilippe Mathieu-Daudé switch (df) { 1361a2b0a27dSPhilippe Mathieu-Daudé case DF_HALF: 1362a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_hadd_s_h(cpu_env, twd, tws, twt); 1363a2b0a27dSPhilippe Mathieu-Daudé break; 1364a2b0a27dSPhilippe Mathieu-Daudé case DF_WORD: 1365a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_hadd_s_w(cpu_env, twd, tws, twt); 1366a2b0a27dSPhilippe Mathieu-Daudé break; 1367a2b0a27dSPhilippe Mathieu-Daudé case DF_DOUBLE: 1368a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_hadd_s_d(cpu_env, twd, tws, twt); 1369a2b0a27dSPhilippe Mathieu-Daudé break; 1370a2b0a27dSPhilippe Mathieu-Daudé } 1371a2b0a27dSPhilippe Mathieu-Daudé break; 1372a2b0a27dSPhilippe Mathieu-Daudé case OPC_HADD_U_df: 1373a2b0a27dSPhilippe Mathieu-Daudé switch (df) { 1374a2b0a27dSPhilippe Mathieu-Daudé case DF_HALF: 1375a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_hadd_u_h(cpu_env, twd, tws, twt); 1376a2b0a27dSPhilippe Mathieu-Daudé break; 1377a2b0a27dSPhilippe Mathieu-Daudé case DF_WORD: 1378a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_hadd_u_w(cpu_env, twd, tws, twt); 1379a2b0a27dSPhilippe Mathieu-Daudé break; 1380a2b0a27dSPhilippe Mathieu-Daudé case DF_DOUBLE: 1381a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_hadd_u_d(cpu_env, twd, tws, twt); 1382a2b0a27dSPhilippe Mathieu-Daudé break; 1383a2b0a27dSPhilippe Mathieu-Daudé } 1384a2b0a27dSPhilippe Mathieu-Daudé break; 1385a2b0a27dSPhilippe Mathieu-Daudé case OPC_HSUB_S_df: 1386a2b0a27dSPhilippe Mathieu-Daudé switch (df) { 1387a2b0a27dSPhilippe Mathieu-Daudé case DF_HALF: 1388a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_hsub_s_h(cpu_env, twd, tws, twt); 1389a2b0a27dSPhilippe Mathieu-Daudé break; 1390a2b0a27dSPhilippe Mathieu-Daudé case DF_WORD: 1391a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_hsub_s_w(cpu_env, twd, tws, twt); 1392a2b0a27dSPhilippe Mathieu-Daudé break; 1393a2b0a27dSPhilippe Mathieu-Daudé case DF_DOUBLE: 1394a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_hsub_s_d(cpu_env, twd, tws, twt); 1395a2b0a27dSPhilippe Mathieu-Daudé break; 1396a2b0a27dSPhilippe Mathieu-Daudé } 1397a2b0a27dSPhilippe Mathieu-Daudé break; 1398a2b0a27dSPhilippe Mathieu-Daudé case OPC_HSUB_U_df: 1399a2b0a27dSPhilippe Mathieu-Daudé switch (df) { 1400a2b0a27dSPhilippe Mathieu-Daudé case DF_HALF: 1401a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_hsub_u_h(cpu_env, twd, tws, twt); 1402a2b0a27dSPhilippe Mathieu-Daudé break; 1403a2b0a27dSPhilippe Mathieu-Daudé case DF_WORD: 1404a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_hsub_u_w(cpu_env, twd, tws, twt); 1405a2b0a27dSPhilippe Mathieu-Daudé break; 1406a2b0a27dSPhilippe Mathieu-Daudé case DF_DOUBLE: 1407a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_hsub_u_d(cpu_env, twd, tws, twt); 1408a2b0a27dSPhilippe Mathieu-Daudé break; 1409a2b0a27dSPhilippe Mathieu-Daudé } 1410a2b0a27dSPhilippe Mathieu-Daudé break; 1411a2b0a27dSPhilippe Mathieu-Daudé case OPC_DOTP_S_df: 1412a2b0a27dSPhilippe Mathieu-Daudé switch (df) { 1413a2b0a27dSPhilippe Mathieu-Daudé case DF_HALF: 1414a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_dotp_s_h(cpu_env, twd, tws, twt); 1415a2b0a27dSPhilippe Mathieu-Daudé break; 1416a2b0a27dSPhilippe Mathieu-Daudé case DF_WORD: 1417a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_dotp_s_w(cpu_env, twd, tws, twt); 1418a2b0a27dSPhilippe Mathieu-Daudé break; 1419a2b0a27dSPhilippe Mathieu-Daudé case DF_DOUBLE: 1420a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_dotp_s_d(cpu_env, twd, tws, twt); 1421a2b0a27dSPhilippe Mathieu-Daudé break; 1422a2b0a27dSPhilippe Mathieu-Daudé } 1423a2b0a27dSPhilippe Mathieu-Daudé break; 1424a2b0a27dSPhilippe Mathieu-Daudé case OPC_DOTP_U_df: 1425a2b0a27dSPhilippe Mathieu-Daudé switch (df) { 1426a2b0a27dSPhilippe Mathieu-Daudé case DF_HALF: 1427a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_dotp_u_h(cpu_env, twd, tws, twt); 1428a2b0a27dSPhilippe Mathieu-Daudé break; 1429a2b0a27dSPhilippe Mathieu-Daudé case DF_WORD: 1430a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_dotp_u_w(cpu_env, twd, tws, twt); 1431a2b0a27dSPhilippe Mathieu-Daudé break; 1432a2b0a27dSPhilippe Mathieu-Daudé case DF_DOUBLE: 1433a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_dotp_u_d(cpu_env, twd, tws, twt); 1434a2b0a27dSPhilippe Mathieu-Daudé break; 1435a2b0a27dSPhilippe Mathieu-Daudé } 1436a2b0a27dSPhilippe Mathieu-Daudé break; 1437a2b0a27dSPhilippe Mathieu-Daudé case OPC_DPADD_S_df: 1438a2b0a27dSPhilippe Mathieu-Daudé switch (df) { 1439a2b0a27dSPhilippe Mathieu-Daudé case DF_HALF: 1440a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_dpadd_s_h(cpu_env, twd, tws, twt); 1441a2b0a27dSPhilippe Mathieu-Daudé break; 1442a2b0a27dSPhilippe Mathieu-Daudé case DF_WORD: 1443a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_dpadd_s_w(cpu_env, twd, tws, twt); 1444a2b0a27dSPhilippe Mathieu-Daudé break; 1445a2b0a27dSPhilippe Mathieu-Daudé case DF_DOUBLE: 1446a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_dpadd_s_d(cpu_env, twd, tws, twt); 1447a2b0a27dSPhilippe Mathieu-Daudé break; 1448a2b0a27dSPhilippe Mathieu-Daudé } 1449a2b0a27dSPhilippe Mathieu-Daudé break; 1450a2b0a27dSPhilippe Mathieu-Daudé case OPC_DPADD_U_df: 1451a2b0a27dSPhilippe Mathieu-Daudé switch (df) { 1452a2b0a27dSPhilippe Mathieu-Daudé case DF_HALF: 1453a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_dpadd_u_h(cpu_env, twd, tws, twt); 1454a2b0a27dSPhilippe Mathieu-Daudé break; 1455a2b0a27dSPhilippe Mathieu-Daudé case DF_WORD: 1456a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_dpadd_u_w(cpu_env, twd, tws, twt); 1457a2b0a27dSPhilippe Mathieu-Daudé break; 1458a2b0a27dSPhilippe Mathieu-Daudé case DF_DOUBLE: 1459a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_dpadd_u_d(cpu_env, twd, tws, twt); 1460a2b0a27dSPhilippe Mathieu-Daudé break; 1461a2b0a27dSPhilippe Mathieu-Daudé } 1462a2b0a27dSPhilippe Mathieu-Daudé break; 1463a2b0a27dSPhilippe Mathieu-Daudé case OPC_DPSUB_S_df: 1464a2b0a27dSPhilippe Mathieu-Daudé switch (df) { 1465a2b0a27dSPhilippe Mathieu-Daudé case DF_HALF: 1466a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_dpsub_s_h(cpu_env, twd, tws, twt); 1467a2b0a27dSPhilippe Mathieu-Daudé break; 1468a2b0a27dSPhilippe Mathieu-Daudé case DF_WORD: 1469a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_dpsub_s_w(cpu_env, twd, tws, twt); 1470a2b0a27dSPhilippe Mathieu-Daudé break; 1471a2b0a27dSPhilippe Mathieu-Daudé case DF_DOUBLE: 1472a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_dpsub_s_d(cpu_env, twd, tws, twt); 1473a2b0a27dSPhilippe Mathieu-Daudé break; 1474a2b0a27dSPhilippe Mathieu-Daudé } 1475a2b0a27dSPhilippe Mathieu-Daudé break; 1476a2b0a27dSPhilippe Mathieu-Daudé case OPC_DPSUB_U_df: 1477a2b0a27dSPhilippe Mathieu-Daudé switch (df) { 1478a2b0a27dSPhilippe Mathieu-Daudé case DF_HALF: 1479a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_dpsub_u_h(cpu_env, twd, tws, twt); 1480a2b0a27dSPhilippe Mathieu-Daudé break; 1481a2b0a27dSPhilippe Mathieu-Daudé case DF_WORD: 1482a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_dpsub_u_w(cpu_env, twd, tws, twt); 1483a2b0a27dSPhilippe Mathieu-Daudé break; 1484a2b0a27dSPhilippe Mathieu-Daudé case DF_DOUBLE: 1485a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_dpsub_u_d(cpu_env, twd, tws, twt); 1486a2b0a27dSPhilippe Mathieu-Daudé break; 1487a2b0a27dSPhilippe Mathieu-Daudé } 1488a2b0a27dSPhilippe Mathieu-Daudé break; 1489a2b0a27dSPhilippe Mathieu-Daudé } 1490a2b0a27dSPhilippe Mathieu-Daudé break; 1491a2b0a27dSPhilippe Mathieu-Daudé default: 1492a2b0a27dSPhilippe Mathieu-Daudé MIPS_INVAL("MSA instruction"); 1493a2b0a27dSPhilippe Mathieu-Daudé gen_reserved_instruction(ctx); 1494a2b0a27dSPhilippe Mathieu-Daudé break; 1495a2b0a27dSPhilippe Mathieu-Daudé } 1496a2b0a27dSPhilippe Mathieu-Daudé tcg_temp_free_i32(twd); 1497a2b0a27dSPhilippe Mathieu-Daudé tcg_temp_free_i32(tws); 1498a2b0a27dSPhilippe Mathieu-Daudé tcg_temp_free_i32(twt); 1499a2b0a27dSPhilippe Mathieu-Daudé tcg_temp_free_i32(tdf); 1500a2b0a27dSPhilippe Mathieu-Daudé } 1501a2b0a27dSPhilippe Mathieu-Daudé 1502a2b0a27dSPhilippe Mathieu-Daudé static void gen_msa_elm_3e(DisasContext *ctx) 1503a2b0a27dSPhilippe Mathieu-Daudé { 1504a2b0a27dSPhilippe Mathieu-Daudé #define MASK_MSA_ELM_DF3E(op) (MASK_MSA_MINOR(op) | (op & (0x3FF << 16))) 1505a2b0a27dSPhilippe Mathieu-Daudé uint8_t source = (ctx->opcode >> 11) & 0x1f; 1506a2b0a27dSPhilippe Mathieu-Daudé uint8_t dest = (ctx->opcode >> 6) & 0x1f; 1507a2b0a27dSPhilippe Mathieu-Daudé TCGv telm = tcg_temp_new(); 1508a2b0a27dSPhilippe Mathieu-Daudé TCGv_i32 tsr = tcg_const_i32(source); 1509a2b0a27dSPhilippe Mathieu-Daudé TCGv_i32 tdt = tcg_const_i32(dest); 1510a2b0a27dSPhilippe Mathieu-Daudé 1511a2b0a27dSPhilippe Mathieu-Daudé switch (MASK_MSA_ELM_DF3E(ctx->opcode)) { 1512a2b0a27dSPhilippe Mathieu-Daudé case OPC_CTCMSA: 1513a2b0a27dSPhilippe Mathieu-Daudé gen_load_gpr(telm, source); 1514a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_ctcmsa(cpu_env, telm, tdt); 1515a2b0a27dSPhilippe Mathieu-Daudé break; 1516a2b0a27dSPhilippe Mathieu-Daudé case OPC_CFCMSA: 1517a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_cfcmsa(telm, cpu_env, tsr); 1518a2b0a27dSPhilippe Mathieu-Daudé gen_store_gpr(telm, dest); 1519a2b0a27dSPhilippe Mathieu-Daudé break; 1520a2b0a27dSPhilippe Mathieu-Daudé case OPC_MOVE_V: 1521a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_move_v(cpu_env, tdt, tsr); 1522a2b0a27dSPhilippe Mathieu-Daudé break; 1523a2b0a27dSPhilippe Mathieu-Daudé default: 1524a2b0a27dSPhilippe Mathieu-Daudé MIPS_INVAL("MSA instruction"); 1525a2b0a27dSPhilippe Mathieu-Daudé gen_reserved_instruction(ctx); 1526a2b0a27dSPhilippe Mathieu-Daudé break; 1527a2b0a27dSPhilippe Mathieu-Daudé } 1528a2b0a27dSPhilippe Mathieu-Daudé 1529a2b0a27dSPhilippe Mathieu-Daudé tcg_temp_free(telm); 1530a2b0a27dSPhilippe Mathieu-Daudé tcg_temp_free_i32(tdt); 1531a2b0a27dSPhilippe Mathieu-Daudé tcg_temp_free_i32(tsr); 1532a2b0a27dSPhilippe Mathieu-Daudé } 1533a2b0a27dSPhilippe Mathieu-Daudé 1534a2b0a27dSPhilippe Mathieu-Daudé static void gen_msa_elm_df(DisasContext *ctx, uint32_t df, uint32_t n) 1535a2b0a27dSPhilippe Mathieu-Daudé { 1536a2b0a27dSPhilippe Mathieu-Daudé #define MASK_MSA_ELM(op) (MASK_MSA_MINOR(op) | (op & (0xf << 22))) 1537a2b0a27dSPhilippe Mathieu-Daudé uint8_t ws = (ctx->opcode >> 11) & 0x1f; 1538a2b0a27dSPhilippe Mathieu-Daudé uint8_t wd = (ctx->opcode >> 6) & 0x1f; 1539a2b0a27dSPhilippe Mathieu-Daudé 1540a2b0a27dSPhilippe Mathieu-Daudé TCGv_i32 tws = tcg_const_i32(ws); 1541a2b0a27dSPhilippe Mathieu-Daudé TCGv_i32 twd = tcg_const_i32(wd); 1542a2b0a27dSPhilippe Mathieu-Daudé TCGv_i32 tn = tcg_const_i32(n); 15432b537a3dSPhilippe Mathieu-Daudé TCGv_i32 tdf = tcg_constant_i32(df); 1544a2b0a27dSPhilippe Mathieu-Daudé 1545a2b0a27dSPhilippe Mathieu-Daudé switch (MASK_MSA_ELM(ctx->opcode)) { 1546a2b0a27dSPhilippe Mathieu-Daudé case OPC_SLDI_df: 1547a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_sldi_df(cpu_env, tdf, twd, tws, tn); 1548a2b0a27dSPhilippe Mathieu-Daudé break; 1549a2b0a27dSPhilippe Mathieu-Daudé case OPC_SPLATI_df: 1550a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_splati_df(cpu_env, tdf, twd, tws, tn); 1551a2b0a27dSPhilippe Mathieu-Daudé break; 1552a2b0a27dSPhilippe Mathieu-Daudé case OPC_INSVE_df: 1553a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_insve_df(cpu_env, tdf, twd, tws, tn); 1554a2b0a27dSPhilippe Mathieu-Daudé break; 1555a2b0a27dSPhilippe Mathieu-Daudé case OPC_COPY_S_df: 1556a2b0a27dSPhilippe Mathieu-Daudé case OPC_COPY_U_df: 1557a2b0a27dSPhilippe Mathieu-Daudé case OPC_INSERT_df: 1558a2b0a27dSPhilippe Mathieu-Daudé #if !defined(TARGET_MIPS64) 1559a2b0a27dSPhilippe Mathieu-Daudé /* Double format valid only for MIPS64 */ 1560a2b0a27dSPhilippe Mathieu-Daudé if (df == DF_DOUBLE) { 1561a2b0a27dSPhilippe Mathieu-Daudé gen_reserved_instruction(ctx); 1562a2b0a27dSPhilippe Mathieu-Daudé break; 1563a2b0a27dSPhilippe Mathieu-Daudé } 1564a2b0a27dSPhilippe Mathieu-Daudé if ((MASK_MSA_ELM(ctx->opcode) == OPC_COPY_U_df) && 1565a2b0a27dSPhilippe Mathieu-Daudé (df == DF_WORD)) { 1566a2b0a27dSPhilippe Mathieu-Daudé gen_reserved_instruction(ctx); 1567a2b0a27dSPhilippe Mathieu-Daudé break; 1568a2b0a27dSPhilippe Mathieu-Daudé } 1569a2b0a27dSPhilippe Mathieu-Daudé #endif 1570a2b0a27dSPhilippe Mathieu-Daudé switch (MASK_MSA_ELM(ctx->opcode)) { 1571a2b0a27dSPhilippe Mathieu-Daudé case OPC_COPY_S_df: 1572a2b0a27dSPhilippe Mathieu-Daudé if (likely(wd != 0)) { 1573a2b0a27dSPhilippe Mathieu-Daudé switch (df) { 1574a2b0a27dSPhilippe Mathieu-Daudé case DF_BYTE: 1575a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_copy_s_b(cpu_env, twd, tws, tn); 1576a2b0a27dSPhilippe Mathieu-Daudé break; 1577a2b0a27dSPhilippe Mathieu-Daudé case DF_HALF: 1578a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_copy_s_h(cpu_env, twd, tws, tn); 1579a2b0a27dSPhilippe Mathieu-Daudé break; 1580a2b0a27dSPhilippe Mathieu-Daudé case DF_WORD: 1581a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_copy_s_w(cpu_env, twd, tws, tn); 1582a2b0a27dSPhilippe Mathieu-Daudé break; 1583a2b0a27dSPhilippe Mathieu-Daudé #if defined(TARGET_MIPS64) 1584a2b0a27dSPhilippe Mathieu-Daudé case DF_DOUBLE: 1585a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_copy_s_d(cpu_env, twd, tws, tn); 1586a2b0a27dSPhilippe Mathieu-Daudé break; 1587a2b0a27dSPhilippe Mathieu-Daudé #endif 1588a2b0a27dSPhilippe Mathieu-Daudé default: 1589a2b0a27dSPhilippe Mathieu-Daudé assert(0); 1590a2b0a27dSPhilippe Mathieu-Daudé } 1591a2b0a27dSPhilippe Mathieu-Daudé } 1592a2b0a27dSPhilippe Mathieu-Daudé break; 1593a2b0a27dSPhilippe Mathieu-Daudé case OPC_COPY_U_df: 1594a2b0a27dSPhilippe Mathieu-Daudé if (likely(wd != 0)) { 1595a2b0a27dSPhilippe Mathieu-Daudé switch (df) { 1596a2b0a27dSPhilippe Mathieu-Daudé case DF_BYTE: 1597a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_copy_u_b(cpu_env, twd, tws, tn); 1598a2b0a27dSPhilippe Mathieu-Daudé break; 1599a2b0a27dSPhilippe Mathieu-Daudé case DF_HALF: 1600a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_copy_u_h(cpu_env, twd, tws, tn); 1601a2b0a27dSPhilippe Mathieu-Daudé break; 1602a2b0a27dSPhilippe Mathieu-Daudé #if defined(TARGET_MIPS64) 1603a2b0a27dSPhilippe Mathieu-Daudé case DF_WORD: 1604a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_copy_u_w(cpu_env, twd, tws, tn); 1605a2b0a27dSPhilippe Mathieu-Daudé break; 1606a2b0a27dSPhilippe Mathieu-Daudé #endif 1607a2b0a27dSPhilippe Mathieu-Daudé default: 1608a2b0a27dSPhilippe Mathieu-Daudé assert(0); 1609a2b0a27dSPhilippe Mathieu-Daudé } 1610a2b0a27dSPhilippe Mathieu-Daudé } 1611a2b0a27dSPhilippe Mathieu-Daudé break; 1612a2b0a27dSPhilippe Mathieu-Daudé case OPC_INSERT_df: 1613a2b0a27dSPhilippe Mathieu-Daudé switch (df) { 1614a2b0a27dSPhilippe Mathieu-Daudé case DF_BYTE: 1615a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_insert_b(cpu_env, twd, tws, tn); 1616a2b0a27dSPhilippe Mathieu-Daudé break; 1617a2b0a27dSPhilippe Mathieu-Daudé case DF_HALF: 1618a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_insert_h(cpu_env, twd, tws, tn); 1619a2b0a27dSPhilippe Mathieu-Daudé break; 1620a2b0a27dSPhilippe Mathieu-Daudé case DF_WORD: 1621a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_insert_w(cpu_env, twd, tws, tn); 1622a2b0a27dSPhilippe Mathieu-Daudé break; 1623a2b0a27dSPhilippe Mathieu-Daudé #if defined(TARGET_MIPS64) 1624a2b0a27dSPhilippe Mathieu-Daudé case DF_DOUBLE: 1625a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_insert_d(cpu_env, twd, tws, tn); 1626a2b0a27dSPhilippe Mathieu-Daudé break; 1627a2b0a27dSPhilippe Mathieu-Daudé #endif 1628a2b0a27dSPhilippe Mathieu-Daudé default: 1629a2b0a27dSPhilippe Mathieu-Daudé assert(0); 1630a2b0a27dSPhilippe Mathieu-Daudé } 1631a2b0a27dSPhilippe Mathieu-Daudé break; 1632a2b0a27dSPhilippe Mathieu-Daudé } 1633a2b0a27dSPhilippe Mathieu-Daudé break; 1634a2b0a27dSPhilippe Mathieu-Daudé default: 1635a2b0a27dSPhilippe Mathieu-Daudé MIPS_INVAL("MSA instruction"); 1636a2b0a27dSPhilippe Mathieu-Daudé gen_reserved_instruction(ctx); 1637a2b0a27dSPhilippe Mathieu-Daudé } 1638a2b0a27dSPhilippe Mathieu-Daudé tcg_temp_free_i32(twd); 1639a2b0a27dSPhilippe Mathieu-Daudé tcg_temp_free_i32(tws); 1640a2b0a27dSPhilippe Mathieu-Daudé tcg_temp_free_i32(tn); 1641a2b0a27dSPhilippe Mathieu-Daudé } 1642a2b0a27dSPhilippe Mathieu-Daudé 1643a2b0a27dSPhilippe Mathieu-Daudé static void gen_msa_elm(DisasContext *ctx) 1644a2b0a27dSPhilippe Mathieu-Daudé { 1645a2b0a27dSPhilippe Mathieu-Daudé uint8_t dfn = (ctx->opcode >> 16) & 0x3f; 1646a2b0a27dSPhilippe Mathieu-Daudé uint32_t df = 0, n = 0; 1647a2b0a27dSPhilippe Mathieu-Daudé 1648a2b0a27dSPhilippe Mathieu-Daudé if ((dfn & 0x30) == 0x00) { 1649a2b0a27dSPhilippe Mathieu-Daudé n = dfn & 0x0f; 1650a2b0a27dSPhilippe Mathieu-Daudé df = DF_BYTE; 1651a2b0a27dSPhilippe Mathieu-Daudé } else if ((dfn & 0x38) == 0x20) { 1652a2b0a27dSPhilippe Mathieu-Daudé n = dfn & 0x07; 1653a2b0a27dSPhilippe Mathieu-Daudé df = DF_HALF; 1654a2b0a27dSPhilippe Mathieu-Daudé } else if ((dfn & 0x3c) == 0x30) { 1655a2b0a27dSPhilippe Mathieu-Daudé n = dfn & 0x03; 1656a2b0a27dSPhilippe Mathieu-Daudé df = DF_WORD; 1657a2b0a27dSPhilippe Mathieu-Daudé } else if ((dfn & 0x3e) == 0x38) { 1658a2b0a27dSPhilippe Mathieu-Daudé n = dfn & 0x01; 1659a2b0a27dSPhilippe Mathieu-Daudé df = DF_DOUBLE; 1660a2b0a27dSPhilippe Mathieu-Daudé } else if (dfn == 0x3E) { 1661a2b0a27dSPhilippe Mathieu-Daudé /* CTCMSA, CFCMSA, MOVE.V */ 1662a2b0a27dSPhilippe Mathieu-Daudé gen_msa_elm_3e(ctx); 1663a2b0a27dSPhilippe Mathieu-Daudé return; 1664a2b0a27dSPhilippe Mathieu-Daudé } else { 1665a2b0a27dSPhilippe Mathieu-Daudé gen_reserved_instruction(ctx); 1666a2b0a27dSPhilippe Mathieu-Daudé return; 1667a2b0a27dSPhilippe Mathieu-Daudé } 1668a2b0a27dSPhilippe Mathieu-Daudé 1669a2b0a27dSPhilippe Mathieu-Daudé gen_msa_elm_df(ctx, df, n); 1670a2b0a27dSPhilippe Mathieu-Daudé } 1671a2b0a27dSPhilippe Mathieu-Daudé 1672a2b0a27dSPhilippe Mathieu-Daudé static void gen_msa_3rf(DisasContext *ctx) 1673a2b0a27dSPhilippe Mathieu-Daudé { 1674a2b0a27dSPhilippe Mathieu-Daudé #define MASK_MSA_3RF(op) (MASK_MSA_MINOR(op) | (op & (0xf << 22))) 1675a2b0a27dSPhilippe Mathieu-Daudé uint8_t df = (ctx->opcode >> 21) & 0x1; 1676a2b0a27dSPhilippe Mathieu-Daudé uint8_t wt = (ctx->opcode >> 16) & 0x1f; 1677a2b0a27dSPhilippe Mathieu-Daudé uint8_t ws = (ctx->opcode >> 11) & 0x1f; 1678a2b0a27dSPhilippe Mathieu-Daudé uint8_t wd = (ctx->opcode >> 6) & 0x1f; 1679a2b0a27dSPhilippe Mathieu-Daudé 1680a2b0a27dSPhilippe Mathieu-Daudé TCGv_i32 twd = tcg_const_i32(wd); 1681a2b0a27dSPhilippe Mathieu-Daudé TCGv_i32 tws = tcg_const_i32(ws); 1682a2b0a27dSPhilippe Mathieu-Daudé TCGv_i32 twt = tcg_const_i32(wt); 16831b5c0a11SPhilippe Mathieu-Daudé TCGv_i32 tdf; 1684a2b0a27dSPhilippe Mathieu-Daudé 1685a2b0a27dSPhilippe Mathieu-Daudé /* adjust df value for floating-point instruction */ 16861b5c0a11SPhilippe Mathieu-Daudé switch (MASK_MSA_3RF(ctx->opcode)) { 16871b5c0a11SPhilippe Mathieu-Daudé case OPC_MUL_Q_df: 16881b5c0a11SPhilippe Mathieu-Daudé case OPC_MADD_Q_df: 16891b5c0a11SPhilippe Mathieu-Daudé case OPC_MSUB_Q_df: 16901b5c0a11SPhilippe Mathieu-Daudé case OPC_MULR_Q_df: 16911b5c0a11SPhilippe Mathieu-Daudé case OPC_MADDR_Q_df: 16921b5c0a11SPhilippe Mathieu-Daudé case OPC_MSUBR_Q_df: 16937e9db46dSPhilippe Mathieu-Daudé tdf = tcg_constant_i32(DF_HALF + df); 16941b5c0a11SPhilippe Mathieu-Daudé break; 16951b5c0a11SPhilippe Mathieu-Daudé default: 16967e9db46dSPhilippe Mathieu-Daudé tdf = tcg_constant_i32(DF_WORD + df); 16971b5c0a11SPhilippe Mathieu-Daudé break; 16981b5c0a11SPhilippe Mathieu-Daudé } 1699a2b0a27dSPhilippe Mathieu-Daudé 1700a2b0a27dSPhilippe Mathieu-Daudé switch (MASK_MSA_3RF(ctx->opcode)) { 1701a2b0a27dSPhilippe Mathieu-Daudé case OPC_FCAF_df: 1702a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_fcaf_df(cpu_env, tdf, twd, tws, twt); 1703a2b0a27dSPhilippe Mathieu-Daudé break; 1704a2b0a27dSPhilippe Mathieu-Daudé case OPC_FADD_df: 1705a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_fadd_df(cpu_env, tdf, twd, tws, twt); 1706a2b0a27dSPhilippe Mathieu-Daudé break; 1707a2b0a27dSPhilippe Mathieu-Daudé case OPC_FCUN_df: 1708a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_fcun_df(cpu_env, tdf, twd, tws, twt); 1709a2b0a27dSPhilippe Mathieu-Daudé break; 1710a2b0a27dSPhilippe Mathieu-Daudé case OPC_FSUB_df: 1711a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_fsub_df(cpu_env, tdf, twd, tws, twt); 1712a2b0a27dSPhilippe Mathieu-Daudé break; 1713a2b0a27dSPhilippe Mathieu-Daudé case OPC_FCOR_df: 1714a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_fcor_df(cpu_env, tdf, twd, tws, twt); 1715a2b0a27dSPhilippe Mathieu-Daudé break; 1716a2b0a27dSPhilippe Mathieu-Daudé case OPC_FCEQ_df: 1717a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_fceq_df(cpu_env, tdf, twd, tws, twt); 1718a2b0a27dSPhilippe Mathieu-Daudé break; 1719a2b0a27dSPhilippe Mathieu-Daudé case OPC_FMUL_df: 1720a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_fmul_df(cpu_env, tdf, twd, tws, twt); 1721a2b0a27dSPhilippe Mathieu-Daudé break; 1722a2b0a27dSPhilippe Mathieu-Daudé case OPC_FCUNE_df: 1723a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_fcune_df(cpu_env, tdf, twd, tws, twt); 1724a2b0a27dSPhilippe Mathieu-Daudé break; 1725a2b0a27dSPhilippe Mathieu-Daudé case OPC_FCUEQ_df: 1726a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_fcueq_df(cpu_env, tdf, twd, tws, twt); 1727a2b0a27dSPhilippe Mathieu-Daudé break; 1728a2b0a27dSPhilippe Mathieu-Daudé case OPC_FDIV_df: 1729a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_fdiv_df(cpu_env, tdf, twd, tws, twt); 1730a2b0a27dSPhilippe Mathieu-Daudé break; 1731a2b0a27dSPhilippe Mathieu-Daudé case OPC_FCNE_df: 1732a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_fcne_df(cpu_env, tdf, twd, tws, twt); 1733a2b0a27dSPhilippe Mathieu-Daudé break; 1734a2b0a27dSPhilippe Mathieu-Daudé case OPC_FCLT_df: 1735a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_fclt_df(cpu_env, tdf, twd, tws, twt); 1736a2b0a27dSPhilippe Mathieu-Daudé break; 1737a2b0a27dSPhilippe Mathieu-Daudé case OPC_FMADD_df: 1738a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_fmadd_df(cpu_env, tdf, twd, tws, twt); 1739a2b0a27dSPhilippe Mathieu-Daudé break; 1740a2b0a27dSPhilippe Mathieu-Daudé case OPC_MUL_Q_df: 1741a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_mul_q_df(cpu_env, tdf, twd, tws, twt); 1742a2b0a27dSPhilippe Mathieu-Daudé break; 1743a2b0a27dSPhilippe Mathieu-Daudé case OPC_FCULT_df: 1744a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_fcult_df(cpu_env, tdf, twd, tws, twt); 1745a2b0a27dSPhilippe Mathieu-Daudé break; 1746a2b0a27dSPhilippe Mathieu-Daudé case OPC_FMSUB_df: 1747a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_fmsub_df(cpu_env, tdf, twd, tws, twt); 1748a2b0a27dSPhilippe Mathieu-Daudé break; 1749a2b0a27dSPhilippe Mathieu-Daudé case OPC_MADD_Q_df: 1750a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_madd_q_df(cpu_env, tdf, twd, tws, twt); 1751a2b0a27dSPhilippe Mathieu-Daudé break; 1752a2b0a27dSPhilippe Mathieu-Daudé case OPC_FCLE_df: 1753a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_fcle_df(cpu_env, tdf, twd, tws, twt); 1754a2b0a27dSPhilippe Mathieu-Daudé break; 1755a2b0a27dSPhilippe Mathieu-Daudé case OPC_MSUB_Q_df: 1756a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_msub_q_df(cpu_env, tdf, twd, tws, twt); 1757a2b0a27dSPhilippe Mathieu-Daudé break; 1758a2b0a27dSPhilippe Mathieu-Daudé case OPC_FCULE_df: 1759a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_fcule_df(cpu_env, tdf, twd, tws, twt); 1760a2b0a27dSPhilippe Mathieu-Daudé break; 1761a2b0a27dSPhilippe Mathieu-Daudé case OPC_FEXP2_df: 1762a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_fexp2_df(cpu_env, tdf, twd, tws, twt); 1763a2b0a27dSPhilippe Mathieu-Daudé break; 1764a2b0a27dSPhilippe Mathieu-Daudé case OPC_FSAF_df: 1765a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_fsaf_df(cpu_env, tdf, twd, tws, twt); 1766a2b0a27dSPhilippe Mathieu-Daudé break; 1767a2b0a27dSPhilippe Mathieu-Daudé case OPC_FEXDO_df: 1768a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_fexdo_df(cpu_env, tdf, twd, tws, twt); 1769a2b0a27dSPhilippe Mathieu-Daudé break; 1770a2b0a27dSPhilippe Mathieu-Daudé case OPC_FSUN_df: 1771a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_fsun_df(cpu_env, tdf, twd, tws, twt); 1772a2b0a27dSPhilippe Mathieu-Daudé break; 1773a2b0a27dSPhilippe Mathieu-Daudé case OPC_FSOR_df: 1774a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_fsor_df(cpu_env, tdf, twd, tws, twt); 1775a2b0a27dSPhilippe Mathieu-Daudé break; 1776a2b0a27dSPhilippe Mathieu-Daudé case OPC_FSEQ_df: 1777a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_fseq_df(cpu_env, tdf, twd, tws, twt); 1778a2b0a27dSPhilippe Mathieu-Daudé break; 1779a2b0a27dSPhilippe Mathieu-Daudé case OPC_FTQ_df: 1780a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_ftq_df(cpu_env, tdf, twd, tws, twt); 1781a2b0a27dSPhilippe Mathieu-Daudé break; 1782a2b0a27dSPhilippe Mathieu-Daudé case OPC_FSUNE_df: 1783a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_fsune_df(cpu_env, tdf, twd, tws, twt); 1784a2b0a27dSPhilippe Mathieu-Daudé break; 1785a2b0a27dSPhilippe Mathieu-Daudé case OPC_FSUEQ_df: 1786a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_fsueq_df(cpu_env, tdf, twd, tws, twt); 1787a2b0a27dSPhilippe Mathieu-Daudé break; 1788a2b0a27dSPhilippe Mathieu-Daudé case OPC_FSNE_df: 1789a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_fsne_df(cpu_env, tdf, twd, tws, twt); 1790a2b0a27dSPhilippe Mathieu-Daudé break; 1791a2b0a27dSPhilippe Mathieu-Daudé case OPC_FSLT_df: 1792a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_fslt_df(cpu_env, tdf, twd, tws, twt); 1793a2b0a27dSPhilippe Mathieu-Daudé break; 1794a2b0a27dSPhilippe Mathieu-Daudé case OPC_FMIN_df: 1795a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_fmin_df(cpu_env, tdf, twd, tws, twt); 1796a2b0a27dSPhilippe Mathieu-Daudé break; 1797a2b0a27dSPhilippe Mathieu-Daudé case OPC_MULR_Q_df: 1798a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_mulr_q_df(cpu_env, tdf, twd, tws, twt); 1799a2b0a27dSPhilippe Mathieu-Daudé break; 1800a2b0a27dSPhilippe Mathieu-Daudé case OPC_FSULT_df: 1801a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_fsult_df(cpu_env, tdf, twd, tws, twt); 1802a2b0a27dSPhilippe Mathieu-Daudé break; 1803a2b0a27dSPhilippe Mathieu-Daudé case OPC_FMIN_A_df: 1804a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_fmin_a_df(cpu_env, tdf, twd, tws, twt); 1805a2b0a27dSPhilippe Mathieu-Daudé break; 1806a2b0a27dSPhilippe Mathieu-Daudé case OPC_MADDR_Q_df: 1807a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_maddr_q_df(cpu_env, tdf, twd, tws, twt); 1808a2b0a27dSPhilippe Mathieu-Daudé break; 1809a2b0a27dSPhilippe Mathieu-Daudé case OPC_FSLE_df: 1810a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_fsle_df(cpu_env, tdf, twd, tws, twt); 1811a2b0a27dSPhilippe Mathieu-Daudé break; 1812a2b0a27dSPhilippe Mathieu-Daudé case OPC_FMAX_df: 1813a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_fmax_df(cpu_env, tdf, twd, tws, twt); 1814a2b0a27dSPhilippe Mathieu-Daudé break; 1815a2b0a27dSPhilippe Mathieu-Daudé case OPC_MSUBR_Q_df: 1816a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_msubr_q_df(cpu_env, tdf, twd, tws, twt); 1817a2b0a27dSPhilippe Mathieu-Daudé break; 1818a2b0a27dSPhilippe Mathieu-Daudé case OPC_FSULE_df: 1819a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_fsule_df(cpu_env, tdf, twd, tws, twt); 1820a2b0a27dSPhilippe Mathieu-Daudé break; 1821a2b0a27dSPhilippe Mathieu-Daudé case OPC_FMAX_A_df: 1822a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_fmax_a_df(cpu_env, tdf, twd, tws, twt); 1823a2b0a27dSPhilippe Mathieu-Daudé break; 1824a2b0a27dSPhilippe Mathieu-Daudé default: 1825a2b0a27dSPhilippe Mathieu-Daudé MIPS_INVAL("MSA instruction"); 1826a2b0a27dSPhilippe Mathieu-Daudé gen_reserved_instruction(ctx); 1827a2b0a27dSPhilippe Mathieu-Daudé break; 1828a2b0a27dSPhilippe Mathieu-Daudé } 1829a2b0a27dSPhilippe Mathieu-Daudé 1830a2b0a27dSPhilippe Mathieu-Daudé tcg_temp_free_i32(twd); 1831a2b0a27dSPhilippe Mathieu-Daudé tcg_temp_free_i32(tws); 1832a2b0a27dSPhilippe Mathieu-Daudé tcg_temp_free_i32(twt); 1833a2b0a27dSPhilippe Mathieu-Daudé } 1834a2b0a27dSPhilippe Mathieu-Daudé 1835*adcff99aSPhilippe Mathieu-Daudé static bool trans_msa_2r(DisasContext *ctx, arg_msa_r *a, 1836*adcff99aSPhilippe Mathieu-Daudé gen_helper_pii *gen_msa_2r) 1837a2b0a27dSPhilippe Mathieu-Daudé { 1838*adcff99aSPhilippe Mathieu-Daudé if (!check_msa_enabled(ctx)) { 1839*adcff99aSPhilippe Mathieu-Daudé return true; 1840a2b0a27dSPhilippe Mathieu-Daudé } 1841a2b0a27dSPhilippe Mathieu-Daudé 1842*adcff99aSPhilippe Mathieu-Daudé gen_msa_2r(cpu_env, tcg_constant_i32(a->wd), tcg_constant_i32(a->ws)); 1843*adcff99aSPhilippe Mathieu-Daudé 1844*adcff99aSPhilippe Mathieu-Daudé return true; 1845a2b0a27dSPhilippe Mathieu-Daudé } 1846a2b0a27dSPhilippe Mathieu-Daudé 1847*adcff99aSPhilippe Mathieu-Daudé TRANS_DF_ii(PCNT, trans_msa_2r, gen_helper_msa_pcnt); 1848*adcff99aSPhilippe Mathieu-Daudé TRANS_DF_ii(NLOC, trans_msa_2r, gen_helper_msa_nloc); 1849*adcff99aSPhilippe Mathieu-Daudé TRANS_DF_ii(NLZC, trans_msa_2r, gen_helper_msa_nlzc); 1850*adcff99aSPhilippe Mathieu-Daudé 1851675bf34aSPhilippe Mathieu-Daudé static bool trans_FILL(DisasContext *ctx, arg_msa_r *a) 1852675bf34aSPhilippe Mathieu-Daudé { 1853675bf34aSPhilippe Mathieu-Daudé if (TARGET_LONG_BITS != 64 && a->df == DF_DOUBLE) { 1854675bf34aSPhilippe Mathieu-Daudé /* Double format valid only for MIPS64 */ 1855675bf34aSPhilippe Mathieu-Daudé return false; 1856675bf34aSPhilippe Mathieu-Daudé } 1857675bf34aSPhilippe Mathieu-Daudé 1858675bf34aSPhilippe Mathieu-Daudé if (!check_msa_enabled(ctx)) { 1859675bf34aSPhilippe Mathieu-Daudé return true; 1860675bf34aSPhilippe Mathieu-Daudé } 1861675bf34aSPhilippe Mathieu-Daudé 1862675bf34aSPhilippe Mathieu-Daudé gen_helper_msa_fill_df(cpu_env, 1863675bf34aSPhilippe Mathieu-Daudé tcg_constant_i32(a->df), 1864675bf34aSPhilippe Mathieu-Daudé tcg_constant_i32(a->wd), 1865675bf34aSPhilippe Mathieu-Daudé tcg_constant_i32(a->ws)); 1866675bf34aSPhilippe Mathieu-Daudé 1867675bf34aSPhilippe Mathieu-Daudé return true; 1868675bf34aSPhilippe Mathieu-Daudé } 1869675bf34aSPhilippe Mathieu-Daudé 18705c5b6400SPhilippe Mathieu-Daudé static bool trans_msa_2rf(DisasContext *ctx, arg_msa_r *a, 18715c5b6400SPhilippe Mathieu-Daudé gen_helper_piii *gen_msa_2rf) 1872a2b0a27dSPhilippe Mathieu-Daudé { 18735c5b6400SPhilippe Mathieu-Daudé if (!check_msa_enabled(ctx)) { 18745c5b6400SPhilippe Mathieu-Daudé return true; 1875a2b0a27dSPhilippe Mathieu-Daudé } 1876a2b0a27dSPhilippe Mathieu-Daudé 18775c5b6400SPhilippe Mathieu-Daudé gen_msa_2rf(cpu_env, 18785c5b6400SPhilippe Mathieu-Daudé tcg_constant_i32(a->df), 18795c5b6400SPhilippe Mathieu-Daudé tcg_constant_i32(a->wd), 18805c5b6400SPhilippe Mathieu-Daudé tcg_constant_i32(a->ws)); 18815c5b6400SPhilippe Mathieu-Daudé 18825c5b6400SPhilippe Mathieu-Daudé return true; 1883a2b0a27dSPhilippe Mathieu-Daudé } 1884a2b0a27dSPhilippe Mathieu-Daudé 18855c5b6400SPhilippe Mathieu-Daudé TRANS(FCLASS, trans_msa_2rf, gen_helper_msa_fclass_df); 18865c5b6400SPhilippe Mathieu-Daudé TRANS(FTRUNC_S, trans_msa_2rf, gen_helper_msa_fclass_df); 18875c5b6400SPhilippe Mathieu-Daudé TRANS(FTRUNC_U, trans_msa_2rf, gen_helper_msa_ftrunc_s_df); 18885c5b6400SPhilippe Mathieu-Daudé TRANS(FSQRT, trans_msa_2rf, gen_helper_msa_fsqrt_df); 18895c5b6400SPhilippe Mathieu-Daudé TRANS(FRSQRT, trans_msa_2rf, gen_helper_msa_frsqrt_df); 18905c5b6400SPhilippe Mathieu-Daudé TRANS(FRCP, trans_msa_2rf, gen_helper_msa_frcp_df); 18915c5b6400SPhilippe Mathieu-Daudé TRANS(FRINT, trans_msa_2rf, gen_helper_msa_frint_df); 18925c5b6400SPhilippe Mathieu-Daudé TRANS(FLOG2, trans_msa_2rf, gen_helper_msa_flog2_df); 18935c5b6400SPhilippe Mathieu-Daudé TRANS(FEXUPL, trans_msa_2rf, gen_helper_msa_fexupl_df); 18945c5b6400SPhilippe Mathieu-Daudé TRANS(FEXUPR, trans_msa_2rf, gen_helper_msa_fexupr_df); 18955c5b6400SPhilippe Mathieu-Daudé TRANS(FFQL, trans_msa_2rf, gen_helper_msa_ffql_df); 18965c5b6400SPhilippe Mathieu-Daudé TRANS(FFQR, trans_msa_2rf, gen_helper_msa_ffqr_df); 18975c5b6400SPhilippe Mathieu-Daudé TRANS(FTINT_S, trans_msa_2rf, gen_helper_msa_ftint_s_df); 18985c5b6400SPhilippe Mathieu-Daudé TRANS(FTINT_U, trans_msa_2rf, gen_helper_msa_ftint_u_df); 18995c5b6400SPhilippe Mathieu-Daudé TRANS(FFINT_S, trans_msa_2rf, gen_helper_msa_ffint_s_df); 19005c5b6400SPhilippe Mathieu-Daudé TRANS(FFINT_U, trans_msa_2rf, gen_helper_msa_ffint_u_df); 19015c5b6400SPhilippe Mathieu-Daudé 1902a2b0a27dSPhilippe Mathieu-Daudé static void gen_msa_vec_v(DisasContext *ctx) 1903a2b0a27dSPhilippe Mathieu-Daudé { 1904a2b0a27dSPhilippe Mathieu-Daudé #define MASK_MSA_VEC(op) (MASK_MSA_MINOR(op) | (op & (0x1f << 21))) 1905a2b0a27dSPhilippe Mathieu-Daudé uint8_t wt = (ctx->opcode >> 16) & 0x1f; 1906a2b0a27dSPhilippe Mathieu-Daudé uint8_t ws = (ctx->opcode >> 11) & 0x1f; 1907a2b0a27dSPhilippe Mathieu-Daudé uint8_t wd = (ctx->opcode >> 6) & 0x1f; 1908a2b0a27dSPhilippe Mathieu-Daudé TCGv_i32 twd = tcg_const_i32(wd); 1909a2b0a27dSPhilippe Mathieu-Daudé TCGv_i32 tws = tcg_const_i32(ws); 1910a2b0a27dSPhilippe Mathieu-Daudé TCGv_i32 twt = tcg_const_i32(wt); 1911a2b0a27dSPhilippe Mathieu-Daudé 1912a2b0a27dSPhilippe Mathieu-Daudé switch (MASK_MSA_VEC(ctx->opcode)) { 1913a2b0a27dSPhilippe Mathieu-Daudé case OPC_AND_V: 1914a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_and_v(cpu_env, twd, tws, twt); 1915a2b0a27dSPhilippe Mathieu-Daudé break; 1916a2b0a27dSPhilippe Mathieu-Daudé case OPC_OR_V: 1917a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_or_v(cpu_env, twd, tws, twt); 1918a2b0a27dSPhilippe Mathieu-Daudé break; 1919a2b0a27dSPhilippe Mathieu-Daudé case OPC_NOR_V: 1920a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_nor_v(cpu_env, twd, tws, twt); 1921a2b0a27dSPhilippe Mathieu-Daudé break; 1922a2b0a27dSPhilippe Mathieu-Daudé case OPC_XOR_V: 1923a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_xor_v(cpu_env, twd, tws, twt); 1924a2b0a27dSPhilippe Mathieu-Daudé break; 1925a2b0a27dSPhilippe Mathieu-Daudé case OPC_BMNZ_V: 1926a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_bmnz_v(cpu_env, twd, tws, twt); 1927a2b0a27dSPhilippe Mathieu-Daudé break; 1928a2b0a27dSPhilippe Mathieu-Daudé case OPC_BMZ_V: 1929a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_bmz_v(cpu_env, twd, tws, twt); 1930a2b0a27dSPhilippe Mathieu-Daudé break; 1931a2b0a27dSPhilippe Mathieu-Daudé case OPC_BSEL_V: 1932a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_bsel_v(cpu_env, twd, tws, twt); 1933a2b0a27dSPhilippe Mathieu-Daudé break; 1934a2b0a27dSPhilippe Mathieu-Daudé default: 1935a2b0a27dSPhilippe Mathieu-Daudé MIPS_INVAL("MSA instruction"); 1936a2b0a27dSPhilippe Mathieu-Daudé gen_reserved_instruction(ctx); 1937a2b0a27dSPhilippe Mathieu-Daudé break; 1938a2b0a27dSPhilippe Mathieu-Daudé } 1939a2b0a27dSPhilippe Mathieu-Daudé 1940a2b0a27dSPhilippe Mathieu-Daudé tcg_temp_free_i32(twd); 1941a2b0a27dSPhilippe Mathieu-Daudé tcg_temp_free_i32(tws); 1942a2b0a27dSPhilippe Mathieu-Daudé tcg_temp_free_i32(twt); 1943a2b0a27dSPhilippe Mathieu-Daudé } 1944a2b0a27dSPhilippe Mathieu-Daudé 1945a2b0a27dSPhilippe Mathieu-Daudé static void gen_msa_vec(DisasContext *ctx) 1946a2b0a27dSPhilippe Mathieu-Daudé { 1947a2b0a27dSPhilippe Mathieu-Daudé switch (MASK_MSA_VEC(ctx->opcode)) { 1948a2b0a27dSPhilippe Mathieu-Daudé case OPC_AND_V: 1949a2b0a27dSPhilippe Mathieu-Daudé case OPC_OR_V: 1950a2b0a27dSPhilippe Mathieu-Daudé case OPC_NOR_V: 1951a2b0a27dSPhilippe Mathieu-Daudé case OPC_XOR_V: 1952a2b0a27dSPhilippe Mathieu-Daudé case OPC_BMNZ_V: 1953a2b0a27dSPhilippe Mathieu-Daudé case OPC_BMZ_V: 1954a2b0a27dSPhilippe Mathieu-Daudé case OPC_BSEL_V: 1955a2b0a27dSPhilippe Mathieu-Daudé gen_msa_vec_v(ctx); 1956a2b0a27dSPhilippe Mathieu-Daudé break; 1957a2b0a27dSPhilippe Mathieu-Daudé default: 1958a2b0a27dSPhilippe Mathieu-Daudé MIPS_INVAL("MSA instruction"); 1959a2b0a27dSPhilippe Mathieu-Daudé gen_reserved_instruction(ctx); 1960a2b0a27dSPhilippe Mathieu-Daudé break; 1961a2b0a27dSPhilippe Mathieu-Daudé } 1962a2b0a27dSPhilippe Mathieu-Daudé } 1963a2b0a27dSPhilippe Mathieu-Daudé 1964525ea877SPhilippe Mathieu-Daudé static bool trans_MSA(DisasContext *ctx, arg_MSA *a) 1965a2b0a27dSPhilippe Mathieu-Daudé { 1966a2b0a27dSPhilippe Mathieu-Daudé uint32_t opcode = ctx->opcode; 1967a2b0a27dSPhilippe Mathieu-Daudé 1968340ee8b3SPhilippe Mathieu-Daudé if (!check_msa_enabled(ctx)) { 1969340ee8b3SPhilippe Mathieu-Daudé return true; 1970340ee8b3SPhilippe Mathieu-Daudé } 1971a2b0a27dSPhilippe Mathieu-Daudé 1972a2b0a27dSPhilippe Mathieu-Daudé switch (MASK_MSA_MINOR(opcode)) { 1973a2b0a27dSPhilippe Mathieu-Daudé case OPC_MSA_3R_0D: 1974a2b0a27dSPhilippe Mathieu-Daudé case OPC_MSA_3R_0E: 1975a2b0a27dSPhilippe Mathieu-Daudé case OPC_MSA_3R_0F: 1976a2b0a27dSPhilippe Mathieu-Daudé case OPC_MSA_3R_10: 1977a2b0a27dSPhilippe Mathieu-Daudé case OPC_MSA_3R_11: 1978a2b0a27dSPhilippe Mathieu-Daudé case OPC_MSA_3R_12: 1979a2b0a27dSPhilippe Mathieu-Daudé case OPC_MSA_3R_13: 1980a2b0a27dSPhilippe Mathieu-Daudé case OPC_MSA_3R_14: 1981a2b0a27dSPhilippe Mathieu-Daudé case OPC_MSA_3R_15: 1982a2b0a27dSPhilippe Mathieu-Daudé gen_msa_3r(ctx); 1983a2b0a27dSPhilippe Mathieu-Daudé break; 1984a2b0a27dSPhilippe Mathieu-Daudé case OPC_MSA_ELM: 1985a2b0a27dSPhilippe Mathieu-Daudé gen_msa_elm(ctx); 1986a2b0a27dSPhilippe Mathieu-Daudé break; 1987a2b0a27dSPhilippe Mathieu-Daudé case OPC_MSA_3RF_1A: 1988a2b0a27dSPhilippe Mathieu-Daudé case OPC_MSA_3RF_1B: 1989a2b0a27dSPhilippe Mathieu-Daudé case OPC_MSA_3RF_1C: 1990a2b0a27dSPhilippe Mathieu-Daudé gen_msa_3rf(ctx); 1991a2b0a27dSPhilippe Mathieu-Daudé break; 1992a2b0a27dSPhilippe Mathieu-Daudé case OPC_MSA_VEC: 1993a2b0a27dSPhilippe Mathieu-Daudé gen_msa_vec(ctx); 1994a2b0a27dSPhilippe Mathieu-Daudé break; 1995a2b0a27dSPhilippe Mathieu-Daudé default: 1996a2b0a27dSPhilippe Mathieu-Daudé MIPS_INVAL("MSA instruction"); 1997a2b0a27dSPhilippe Mathieu-Daudé gen_reserved_instruction(ctx); 1998a2b0a27dSPhilippe Mathieu-Daudé break; 1999a2b0a27dSPhilippe Mathieu-Daudé } 2000a2b0a27dSPhilippe Mathieu-Daudé 2001a2b0a27dSPhilippe Mathieu-Daudé return true; 2002a2b0a27dSPhilippe Mathieu-Daudé } 2003a2b0a27dSPhilippe Mathieu-Daudé 2004ce121fe2SPhilippe Mathieu-Daudé static bool trans_msa_ldst(DisasContext *ctx, arg_msa_i *a, 2005ce121fe2SPhilippe Mathieu-Daudé gen_helper_piv *gen_msa_ldst) 2006ce121fe2SPhilippe Mathieu-Daudé { 2007ce121fe2SPhilippe Mathieu-Daudé TCGv taddr; 2008ce121fe2SPhilippe Mathieu-Daudé 2009ce121fe2SPhilippe Mathieu-Daudé if (!check_msa_enabled(ctx)) { 2010ce121fe2SPhilippe Mathieu-Daudé return true; 2011ce121fe2SPhilippe Mathieu-Daudé } 2012ce121fe2SPhilippe Mathieu-Daudé 2013ce121fe2SPhilippe Mathieu-Daudé taddr = tcg_temp_new(); 2014ce121fe2SPhilippe Mathieu-Daudé 2015ce121fe2SPhilippe Mathieu-Daudé gen_base_offset_addr(ctx, taddr, a->ws, a->sa << a->df); 2016ce121fe2SPhilippe Mathieu-Daudé gen_msa_ldst(cpu_env, tcg_constant_i32(a->wd), taddr); 2017ce121fe2SPhilippe Mathieu-Daudé 2018ce121fe2SPhilippe Mathieu-Daudé tcg_temp_free(taddr); 2019ce121fe2SPhilippe Mathieu-Daudé 2020ce121fe2SPhilippe Mathieu-Daudé return true; 2021ce121fe2SPhilippe Mathieu-Daudé } 2022ce121fe2SPhilippe Mathieu-Daudé 2023ce121fe2SPhilippe Mathieu-Daudé TRANS_DF_iv(LD, trans_msa_ldst, gen_helper_msa_ld); 2024ce121fe2SPhilippe Mathieu-Daudé TRANS_DF_iv(ST, trans_msa_ldst, gen_helper_msa_st); 2025ce121fe2SPhilippe Mathieu-Daudé 202634fe9fa3SPhilippe Mathieu-Daudé static bool trans_LSA(DisasContext *ctx, arg_r *a) 2027a2b0a27dSPhilippe Mathieu-Daudé { 2028a2b0a27dSPhilippe Mathieu-Daudé return gen_lsa(ctx, a->rd, a->rt, a->rs, a->sa); 2029a2b0a27dSPhilippe Mathieu-Daudé } 2030a2b0a27dSPhilippe Mathieu-Daudé 203134fe9fa3SPhilippe Mathieu-Daudé static bool trans_DLSA(DisasContext *ctx, arg_r *a) 2032a2b0a27dSPhilippe Mathieu-Daudé { 2033f5c6ee0cSPhilippe Mathieu-Daudé if (TARGET_LONG_BITS != 64) { 2034f5c6ee0cSPhilippe Mathieu-Daudé return false; 2035f5c6ee0cSPhilippe Mathieu-Daudé } 2036a2b0a27dSPhilippe Mathieu-Daudé return gen_dlsa(ctx, a->rd, a->rt, a->rs, a->sa); 2037a2b0a27dSPhilippe Mathieu-Daudé } 2038