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é 23ff29e5d3SPhilippe Mathieu-Daudé static inline int plus_1(DisasContext *s, int x) 24ff29e5d3SPhilippe Mathieu-Daudé { 25ff29e5d3SPhilippe Mathieu-Daudé return x + 1; 26ff29e5d3SPhilippe Mathieu-Daudé } 27ff29e5d3SPhilippe Mathieu-Daudé 285c5b6400SPhilippe Mathieu-Daudé static inline int plus_2(DisasContext *s, int x) 295c5b6400SPhilippe Mathieu-Daudé { 305c5b6400SPhilippe Mathieu-Daudé return x + 2; 315c5b6400SPhilippe Mathieu-Daudé } 325c5b6400SPhilippe Mathieu-Daudé 33a2b0a27dSPhilippe Mathieu-Daudé /* Include the auto-generated decoder. */ 34f5c6ee0cSPhilippe Mathieu-Daudé #include "decode-msa.c.inc" 35a2b0a27dSPhilippe Mathieu-Daudé 36a2b0a27dSPhilippe Mathieu-Daudé #define OPC_MSA (0x1E << 26) 37a2b0a27dSPhilippe Mathieu-Daudé 38a2b0a27dSPhilippe Mathieu-Daudé #define MASK_MSA_MINOR(op) (MASK_OP_MAJOR(op) | (op & 0x3F)) 39a2b0a27dSPhilippe Mathieu-Daudé enum { 40a2b0a27dSPhilippe Mathieu-Daudé OPC_MSA_3R_0D = 0x0D | OPC_MSA, 41a2b0a27dSPhilippe Mathieu-Daudé OPC_MSA_3R_0E = 0x0E | OPC_MSA, 42a2b0a27dSPhilippe Mathieu-Daudé OPC_MSA_3R_0F = 0x0F | OPC_MSA, 43a2b0a27dSPhilippe Mathieu-Daudé OPC_MSA_3R_10 = 0x10 | OPC_MSA, 44a2b0a27dSPhilippe Mathieu-Daudé OPC_MSA_3R_11 = 0x11 | OPC_MSA, 45a2b0a27dSPhilippe Mathieu-Daudé OPC_MSA_3R_12 = 0x12 | OPC_MSA, 46a2b0a27dSPhilippe Mathieu-Daudé OPC_MSA_3R_13 = 0x13 | OPC_MSA, 47a2b0a27dSPhilippe Mathieu-Daudé OPC_MSA_3R_14 = 0x14 | OPC_MSA, 48a2b0a27dSPhilippe Mathieu-Daudé OPC_MSA_3R_15 = 0x15 | OPC_MSA, 49a2b0a27dSPhilippe Mathieu-Daudé OPC_MSA_ELM = 0x19 | OPC_MSA, 50a2b0a27dSPhilippe Mathieu-Daudé }; 51a2b0a27dSPhilippe Mathieu-Daudé 52a2b0a27dSPhilippe Mathieu-Daudé enum { 53a2b0a27dSPhilippe Mathieu-Daudé /* 3R instruction df(bits 22..21) = _b, _h, _w, d */ 54a2b0a27dSPhilippe Mathieu-Daudé OPC_SLL_df = (0x0 << 23) | OPC_MSA_3R_0D, 55a2b0a27dSPhilippe Mathieu-Daudé OPC_ADDV_df = (0x0 << 23) | OPC_MSA_3R_0E, 56a2b0a27dSPhilippe Mathieu-Daudé OPC_CEQ_df = (0x0 << 23) | OPC_MSA_3R_0F, 57a2b0a27dSPhilippe Mathieu-Daudé OPC_ADD_A_df = (0x0 << 23) | OPC_MSA_3R_10, 58a2b0a27dSPhilippe Mathieu-Daudé OPC_SUBS_S_df = (0x0 << 23) | OPC_MSA_3R_11, 59a2b0a27dSPhilippe Mathieu-Daudé OPC_MULV_df = (0x0 << 23) | OPC_MSA_3R_12, 60a2b0a27dSPhilippe Mathieu-Daudé OPC_SRA_df = (0x1 << 23) | OPC_MSA_3R_0D, 61a2b0a27dSPhilippe Mathieu-Daudé OPC_SUBV_df = (0x1 << 23) | OPC_MSA_3R_0E, 62a2b0a27dSPhilippe Mathieu-Daudé OPC_ADDS_A_df = (0x1 << 23) | OPC_MSA_3R_10, 63a2b0a27dSPhilippe Mathieu-Daudé OPC_SUBS_U_df = (0x1 << 23) | OPC_MSA_3R_11, 64a2b0a27dSPhilippe Mathieu-Daudé OPC_MADDV_df = (0x1 << 23) | OPC_MSA_3R_12, 65a2b0a27dSPhilippe Mathieu-Daudé OPC_SRAR_df = (0x1 << 23) | OPC_MSA_3R_15, 66a2b0a27dSPhilippe Mathieu-Daudé OPC_SRL_df = (0x2 << 23) | OPC_MSA_3R_0D, 67a2b0a27dSPhilippe Mathieu-Daudé OPC_MAX_S_df = (0x2 << 23) | OPC_MSA_3R_0E, 68a2b0a27dSPhilippe Mathieu-Daudé OPC_CLT_S_df = (0x2 << 23) | OPC_MSA_3R_0F, 69a2b0a27dSPhilippe Mathieu-Daudé OPC_ADDS_S_df = (0x2 << 23) | OPC_MSA_3R_10, 70a2b0a27dSPhilippe Mathieu-Daudé OPC_SUBSUS_U_df = (0x2 << 23) | OPC_MSA_3R_11, 71a2b0a27dSPhilippe Mathieu-Daudé OPC_MSUBV_df = (0x2 << 23) | OPC_MSA_3R_12, 72a2b0a27dSPhilippe Mathieu-Daudé OPC_PCKEV_df = (0x2 << 23) | OPC_MSA_3R_14, 73a2b0a27dSPhilippe Mathieu-Daudé OPC_SRLR_df = (0x2 << 23) | OPC_MSA_3R_15, 74a2b0a27dSPhilippe Mathieu-Daudé OPC_BCLR_df = (0x3 << 23) | OPC_MSA_3R_0D, 75a2b0a27dSPhilippe Mathieu-Daudé OPC_MAX_U_df = (0x3 << 23) | OPC_MSA_3R_0E, 76a2b0a27dSPhilippe Mathieu-Daudé OPC_CLT_U_df = (0x3 << 23) | OPC_MSA_3R_0F, 77a2b0a27dSPhilippe Mathieu-Daudé OPC_ADDS_U_df = (0x3 << 23) | OPC_MSA_3R_10, 78a2b0a27dSPhilippe Mathieu-Daudé OPC_SUBSUU_S_df = (0x3 << 23) | OPC_MSA_3R_11, 79a2b0a27dSPhilippe Mathieu-Daudé OPC_PCKOD_df = (0x3 << 23) | OPC_MSA_3R_14, 80a2b0a27dSPhilippe Mathieu-Daudé OPC_BSET_df = (0x4 << 23) | OPC_MSA_3R_0D, 81a2b0a27dSPhilippe Mathieu-Daudé OPC_MIN_S_df = (0x4 << 23) | OPC_MSA_3R_0E, 82a2b0a27dSPhilippe Mathieu-Daudé OPC_CLE_S_df = (0x4 << 23) | OPC_MSA_3R_0F, 83a2b0a27dSPhilippe Mathieu-Daudé OPC_AVE_S_df = (0x4 << 23) | OPC_MSA_3R_10, 84a2b0a27dSPhilippe Mathieu-Daudé OPC_ASUB_S_df = (0x4 << 23) | OPC_MSA_3R_11, 85a2b0a27dSPhilippe Mathieu-Daudé OPC_DIV_S_df = (0x4 << 23) | OPC_MSA_3R_12, 86a2b0a27dSPhilippe Mathieu-Daudé OPC_ILVL_df = (0x4 << 23) | OPC_MSA_3R_14, 87a2b0a27dSPhilippe Mathieu-Daudé OPC_BNEG_df = (0x5 << 23) | OPC_MSA_3R_0D, 88a2b0a27dSPhilippe Mathieu-Daudé OPC_MIN_U_df = (0x5 << 23) | OPC_MSA_3R_0E, 89a2b0a27dSPhilippe Mathieu-Daudé OPC_CLE_U_df = (0x5 << 23) | OPC_MSA_3R_0F, 90a2b0a27dSPhilippe Mathieu-Daudé OPC_AVE_U_df = (0x5 << 23) | OPC_MSA_3R_10, 91a2b0a27dSPhilippe Mathieu-Daudé OPC_ASUB_U_df = (0x5 << 23) | OPC_MSA_3R_11, 92a2b0a27dSPhilippe Mathieu-Daudé OPC_DIV_U_df = (0x5 << 23) | OPC_MSA_3R_12, 93a2b0a27dSPhilippe Mathieu-Daudé OPC_ILVR_df = (0x5 << 23) | OPC_MSA_3R_14, 94a2b0a27dSPhilippe Mathieu-Daudé OPC_MAX_A_df = (0x6 << 23) | OPC_MSA_3R_0E, 95a2b0a27dSPhilippe Mathieu-Daudé OPC_AVER_S_df = (0x6 << 23) | OPC_MSA_3R_10, 96a2b0a27dSPhilippe Mathieu-Daudé OPC_MOD_S_df = (0x6 << 23) | OPC_MSA_3R_12, 97a2b0a27dSPhilippe Mathieu-Daudé OPC_ILVEV_df = (0x6 << 23) | OPC_MSA_3R_14, 98a2b0a27dSPhilippe Mathieu-Daudé OPC_MIN_A_df = (0x7 << 23) | OPC_MSA_3R_0E, 99a2b0a27dSPhilippe Mathieu-Daudé OPC_AVER_U_df = (0x7 << 23) | OPC_MSA_3R_10, 100a2b0a27dSPhilippe Mathieu-Daudé OPC_MOD_U_df = (0x7 << 23) | OPC_MSA_3R_12, 101a2b0a27dSPhilippe Mathieu-Daudé OPC_ILVOD_df = (0x7 << 23) | OPC_MSA_3R_14, 102a2b0a27dSPhilippe Mathieu-Daudé 103a2b0a27dSPhilippe Mathieu-Daudé /* ELM instructions df(bits 21..16) = _b, _h, _w, _d */ 104a2b0a27dSPhilippe Mathieu-Daudé OPC_SLDI_df = (0x0 << 22) | (0x00 << 16) | OPC_MSA_ELM, 105a2b0a27dSPhilippe Mathieu-Daudé OPC_CTCMSA = (0x0 << 22) | (0x3E << 16) | OPC_MSA_ELM, 106a2b0a27dSPhilippe Mathieu-Daudé OPC_SPLATI_df = (0x1 << 22) | (0x00 << 16) | OPC_MSA_ELM, 107a2b0a27dSPhilippe Mathieu-Daudé OPC_CFCMSA = (0x1 << 22) | (0x3E << 16) | OPC_MSA_ELM, 108a2b0a27dSPhilippe Mathieu-Daudé OPC_COPY_S_df = (0x2 << 22) | (0x00 << 16) | OPC_MSA_ELM, 109a2b0a27dSPhilippe Mathieu-Daudé OPC_MOVE_V = (0x2 << 22) | (0x3E << 16) | OPC_MSA_ELM, 110a2b0a27dSPhilippe Mathieu-Daudé OPC_COPY_U_df = (0x3 << 22) | (0x00 << 16) | OPC_MSA_ELM, 111a2b0a27dSPhilippe Mathieu-Daudé OPC_INSERT_df = (0x4 << 22) | (0x00 << 16) | OPC_MSA_ELM, 112a2b0a27dSPhilippe Mathieu-Daudé OPC_INSVE_df = (0x5 << 22) | (0x00 << 16) | OPC_MSA_ELM, 113a2b0a27dSPhilippe Mathieu-Daudé }; 114a2b0a27dSPhilippe Mathieu-Daudé 11506106772SPhilippe Mathieu-Daudé static const char msaregnames[][6] = { 116a2b0a27dSPhilippe Mathieu-Daudé "w0.d0", "w0.d1", "w1.d0", "w1.d1", 117a2b0a27dSPhilippe Mathieu-Daudé "w2.d0", "w2.d1", "w3.d0", "w3.d1", 118a2b0a27dSPhilippe Mathieu-Daudé "w4.d0", "w4.d1", "w5.d0", "w5.d1", 119a2b0a27dSPhilippe Mathieu-Daudé "w6.d0", "w6.d1", "w7.d0", "w7.d1", 120a2b0a27dSPhilippe Mathieu-Daudé "w8.d0", "w8.d1", "w9.d0", "w9.d1", 121a2b0a27dSPhilippe Mathieu-Daudé "w10.d0", "w10.d1", "w11.d0", "w11.d1", 122a2b0a27dSPhilippe Mathieu-Daudé "w12.d0", "w12.d1", "w13.d0", "w13.d1", 123a2b0a27dSPhilippe Mathieu-Daudé "w14.d0", "w14.d1", "w15.d0", "w15.d1", 124a2b0a27dSPhilippe Mathieu-Daudé "w16.d0", "w16.d1", "w17.d0", "w17.d1", 125a2b0a27dSPhilippe Mathieu-Daudé "w18.d0", "w18.d1", "w19.d0", "w19.d1", 126a2b0a27dSPhilippe Mathieu-Daudé "w20.d0", "w20.d1", "w21.d0", "w21.d1", 127a2b0a27dSPhilippe Mathieu-Daudé "w22.d0", "w22.d1", "w23.d0", "w23.d1", 128a2b0a27dSPhilippe Mathieu-Daudé "w24.d0", "w24.d1", "w25.d0", "w25.d1", 129a2b0a27dSPhilippe Mathieu-Daudé "w26.d0", "w26.d1", "w27.d0", "w27.d1", 130a2b0a27dSPhilippe Mathieu-Daudé "w28.d0", "w28.d1", "w29.d0", "w29.d1", 131a2b0a27dSPhilippe Mathieu-Daudé "w30.d0", "w30.d1", "w31.d0", "w31.d1", 132a2b0a27dSPhilippe Mathieu-Daudé }; 133a2b0a27dSPhilippe Mathieu-Daudé 1344701d23aSPhilippe Mathieu-Daudé /* Encoding of Operation Field (must be indexed by CPUMIPSMSADataFormat) */ 1354701d23aSPhilippe Mathieu-Daudé struct dfe { 1364701d23aSPhilippe Mathieu-Daudé int start; 1374701d23aSPhilippe Mathieu-Daudé int length; 1384701d23aSPhilippe Mathieu-Daudé uint32_t mask; 1394701d23aSPhilippe Mathieu-Daudé }; 1404701d23aSPhilippe Mathieu-Daudé 1414701d23aSPhilippe Mathieu-Daudé /* 1424701d23aSPhilippe Mathieu-Daudé * Extract immediate from df/{m,n} format (used by ELM & BIT instructions). 1434701d23aSPhilippe Mathieu-Daudé * Returns the immediate value, or -1 if the format does not match. 1444701d23aSPhilippe Mathieu-Daudé */ 1454701d23aSPhilippe Mathieu-Daudé static int df_extract_val(DisasContext *ctx, int x, const struct dfe *s) 1464701d23aSPhilippe Mathieu-Daudé { 1474701d23aSPhilippe Mathieu-Daudé for (unsigned i = 0; i < 4; i++) { 1484701d23aSPhilippe Mathieu-Daudé if (extract32(x, s->start, s->length) == s->mask) { 1494701d23aSPhilippe Mathieu-Daudé return extract32(x, 0, s->start); 1504701d23aSPhilippe Mathieu-Daudé } 1514701d23aSPhilippe Mathieu-Daudé } 1524701d23aSPhilippe Mathieu-Daudé return -1; 1534701d23aSPhilippe Mathieu-Daudé } 1544701d23aSPhilippe Mathieu-Daudé 1554701d23aSPhilippe Mathieu-Daudé /* 1564701d23aSPhilippe Mathieu-Daudé * Extract DataField from df/{m,n} format (used by ELM & BIT instructions). 1574701d23aSPhilippe Mathieu-Daudé * Returns the DataField, or -1 if the format does not match. 1584701d23aSPhilippe Mathieu-Daudé */ 1594701d23aSPhilippe Mathieu-Daudé static int df_extract_df(DisasContext *ctx, int x, const struct dfe *s) 1604701d23aSPhilippe Mathieu-Daudé { 1614701d23aSPhilippe Mathieu-Daudé for (unsigned i = 0; i < 4; i++) { 1624701d23aSPhilippe Mathieu-Daudé if (extract32(x, s->start, s->length) == s->mask) { 1634701d23aSPhilippe Mathieu-Daudé return i; 1644701d23aSPhilippe Mathieu-Daudé } 1654701d23aSPhilippe Mathieu-Daudé } 1664701d23aSPhilippe Mathieu-Daudé return -1; 1674701d23aSPhilippe Mathieu-Daudé } 1684701d23aSPhilippe Mathieu-Daudé 1694701d23aSPhilippe Mathieu-Daudé static const struct dfe df_bit[] = { 1704701d23aSPhilippe Mathieu-Daudé /* Table 3.28 BIT Instruction Format */ 1714701d23aSPhilippe Mathieu-Daudé [DF_BYTE] = {3, 4, 0b1110}, 1724701d23aSPhilippe Mathieu-Daudé [DF_HALF] = {4, 3, 0b110}, 1734701d23aSPhilippe Mathieu-Daudé [DF_WORD] = {5, 2, 0b10}, 1744701d23aSPhilippe Mathieu-Daudé [DF_DOUBLE] = {6, 1, 0b0} 1754701d23aSPhilippe Mathieu-Daudé }; 1764701d23aSPhilippe Mathieu-Daudé 1774701d23aSPhilippe Mathieu-Daudé static int bit_m(DisasContext *ctx, int x) 1784701d23aSPhilippe Mathieu-Daudé { 1794701d23aSPhilippe Mathieu-Daudé return df_extract_val(ctx, x, df_bit); 1804701d23aSPhilippe Mathieu-Daudé } 1814701d23aSPhilippe Mathieu-Daudé 1824701d23aSPhilippe Mathieu-Daudé static int bit_df(DisasContext *ctx, int x) 1834701d23aSPhilippe Mathieu-Daudé { 1844701d23aSPhilippe Mathieu-Daudé return df_extract_df(ctx, x, df_bit); 1854701d23aSPhilippe Mathieu-Daudé } 1864701d23aSPhilippe Mathieu-Daudé 187a2b0a27dSPhilippe Mathieu-Daudé static TCGv_i64 msa_wr_d[64]; 188a2b0a27dSPhilippe Mathieu-Daudé 189a2b0a27dSPhilippe Mathieu-Daudé void msa_translate_init(void) 190a2b0a27dSPhilippe Mathieu-Daudé { 191a2b0a27dSPhilippe Mathieu-Daudé int i; 192a2b0a27dSPhilippe Mathieu-Daudé 193a2b0a27dSPhilippe Mathieu-Daudé for (i = 0; i < 32; i++) { 194bbc213b3SPhilippe Mathieu-Daudé int off; 195a2b0a27dSPhilippe Mathieu-Daudé 196a2b0a27dSPhilippe Mathieu-Daudé /* 197a2b0a27dSPhilippe Mathieu-Daudé * The MSA vector registers are mapped on the 198a2b0a27dSPhilippe Mathieu-Daudé * scalar floating-point unit (FPU) registers. 199a2b0a27dSPhilippe Mathieu-Daudé */ 200bbc213b3SPhilippe Mathieu-Daudé off = offsetof(CPUMIPSState, active_fpu.fpr[i].wr.d[0]); 201a2b0a27dSPhilippe Mathieu-Daudé msa_wr_d[i * 2] = fpu_f64[i]; 202bbc213b3SPhilippe Mathieu-Daudé 203a2b0a27dSPhilippe Mathieu-Daudé off = offsetof(CPUMIPSState, active_fpu.fpr[i].wr.d[1]); 204a2b0a27dSPhilippe Mathieu-Daudé msa_wr_d[i * 2 + 1] = 205a2b0a27dSPhilippe Mathieu-Daudé tcg_global_mem_new_i64(cpu_env, off, msaregnames[i * 2 + 1]); 206a2b0a27dSPhilippe Mathieu-Daudé } 207a2b0a27dSPhilippe Mathieu-Daudé } 208a2b0a27dSPhilippe Mathieu-Daudé 209340ee8b3SPhilippe Mathieu-Daudé /* 210340ee8b3SPhilippe Mathieu-Daudé * Check if MSA is enabled. 211340ee8b3SPhilippe Mathieu-Daudé * This function is always called with MSA available. 212340ee8b3SPhilippe Mathieu-Daudé * If MSA is disabled, raise an exception. 213340ee8b3SPhilippe Mathieu-Daudé */ 214340ee8b3SPhilippe Mathieu-Daudé static inline bool check_msa_enabled(DisasContext *ctx) 215a2b0a27dSPhilippe Mathieu-Daudé { 216a2b0a27dSPhilippe Mathieu-Daudé if (unlikely((ctx->hflags & MIPS_HFLAG_FPU) && 217a2b0a27dSPhilippe Mathieu-Daudé !(ctx->hflags & MIPS_HFLAG_F64))) { 218a2b0a27dSPhilippe Mathieu-Daudé gen_reserved_instruction(ctx); 219340ee8b3SPhilippe Mathieu-Daudé return false; 220a2b0a27dSPhilippe Mathieu-Daudé } 221a2b0a27dSPhilippe Mathieu-Daudé 222a2b0a27dSPhilippe Mathieu-Daudé if (unlikely(!(ctx->hflags & MIPS_HFLAG_MSA))) { 223a2b0a27dSPhilippe Mathieu-Daudé generate_exception_end(ctx, EXCP_MSADIS); 224340ee8b3SPhilippe Mathieu-Daudé return false; 225a2b0a27dSPhilippe Mathieu-Daudé } 226340ee8b3SPhilippe Mathieu-Daudé return true; 227a2b0a27dSPhilippe Mathieu-Daudé } 228a2b0a27dSPhilippe Mathieu-Daudé 229ce121fe2SPhilippe Mathieu-Daudé typedef void gen_helper_piv(TCGv_ptr, TCGv_i32, TCGv); 230adcff99aSPhilippe Mathieu-Daudé typedef void gen_helper_pii(TCGv_ptr, TCGv_i32, TCGv_i32); 2317cc351ffSPhilippe Mathieu-Daudé typedef void gen_helper_piii(TCGv_ptr, TCGv_i32, TCGv_i32, TCGv_i32); 232b8e74816SPhilippe Mathieu-Daudé typedef void gen_helper_piiii(TCGv_ptr, TCGv_i32, TCGv_i32, TCGv_i32, TCGv_i32); 233b8e74816SPhilippe Mathieu-Daudé 234ce121fe2SPhilippe Mathieu-Daudé #define TRANS_DF_x(TYPE, NAME, trans_func, gen_func) \ 235ce121fe2SPhilippe Mathieu-Daudé static gen_helper_p##TYPE * const NAME##_tab[4] = { \ 236ce121fe2SPhilippe Mathieu-Daudé gen_func##_b, gen_func##_h, gen_func##_w, gen_func##_d \ 237ce121fe2SPhilippe Mathieu-Daudé }; \ 238ce121fe2SPhilippe Mathieu-Daudé TRANS(NAME, trans_func, NAME##_tab[a->df]) 239ce121fe2SPhilippe Mathieu-Daudé 240ce121fe2SPhilippe Mathieu-Daudé #define TRANS_DF_iv(NAME, trans_func, gen_func) \ 241ce121fe2SPhilippe Mathieu-Daudé TRANS_DF_x(iv, NAME, trans_func, gen_func) 242ce121fe2SPhilippe Mathieu-Daudé 243adcff99aSPhilippe Mathieu-Daudé #define TRANS_DF_ii(NAME, trans_func, gen_func) \ 244adcff99aSPhilippe Mathieu-Daudé TRANS_DF_x(ii, NAME, trans_func, gen_func) 245adcff99aSPhilippe Mathieu-Daudé 246*c79db8c2SPhilippe Mathieu-Daudé #define TRANS_DF_iii(NAME, trans_func, gen_func) \ 247*c79db8c2SPhilippe Mathieu-Daudé TRANS_DF_x(iii, NAME, trans_func, gen_func) 248*c79db8c2SPhilippe Mathieu-Daudé 249f18708a5SPhilippe Mathieu-Daudé #define TRANS_DF_iii_b(NAME, trans_func, gen_func) \ 250f18708a5SPhilippe Mathieu-Daudé static gen_helper_piii * const NAME##_tab[4] = { \ 251f18708a5SPhilippe Mathieu-Daudé NULL, gen_func##_h, gen_func##_w, gen_func##_d \ 252f18708a5SPhilippe Mathieu-Daudé }; \ 253f18708a5SPhilippe Mathieu-Daudé static bool trans_##NAME(DisasContext *ctx, arg_##NAME *a) \ 254f18708a5SPhilippe Mathieu-Daudé { \ 255f18708a5SPhilippe Mathieu-Daudé return trans_func(ctx, a, NAME##_tab[a->df]); \ 256f18708a5SPhilippe Mathieu-Daudé } 257f18708a5SPhilippe Mathieu-Daudé 258a2b0a27dSPhilippe Mathieu-Daudé static void gen_check_zero_element(TCGv tresult, uint8_t df, uint8_t wt, 259a2b0a27dSPhilippe Mathieu-Daudé TCGCond cond) 260a2b0a27dSPhilippe Mathieu-Daudé { 261a2b0a27dSPhilippe Mathieu-Daudé /* generates tcg ops to check if any element is 0 */ 262a2b0a27dSPhilippe Mathieu-Daudé /* Note this function only works with MSA_WRLEN = 128 */ 26340f75c02SPhilippe Mathieu-Daudé uint64_t eval_zero_or_big = dup_const(df, 1); 26440f75c02SPhilippe Mathieu-Daudé uint64_t eval_big = eval_zero_or_big << ((8 << df) - 1); 265a2b0a27dSPhilippe Mathieu-Daudé TCGv_i64 t0 = tcg_temp_new_i64(); 266a2b0a27dSPhilippe Mathieu-Daudé TCGv_i64 t1 = tcg_temp_new_i64(); 26740f75c02SPhilippe Mathieu-Daudé 268a2b0a27dSPhilippe Mathieu-Daudé tcg_gen_subi_i64(t0, msa_wr_d[wt << 1], eval_zero_or_big); 269a2b0a27dSPhilippe Mathieu-Daudé tcg_gen_andc_i64(t0, t0, msa_wr_d[wt << 1]); 270a2b0a27dSPhilippe Mathieu-Daudé tcg_gen_andi_i64(t0, t0, eval_big); 271a2b0a27dSPhilippe Mathieu-Daudé tcg_gen_subi_i64(t1, msa_wr_d[(wt << 1) + 1], eval_zero_or_big); 272a2b0a27dSPhilippe Mathieu-Daudé tcg_gen_andc_i64(t1, t1, msa_wr_d[(wt << 1) + 1]); 273a2b0a27dSPhilippe Mathieu-Daudé tcg_gen_andi_i64(t1, t1, eval_big); 274a2b0a27dSPhilippe Mathieu-Daudé tcg_gen_or_i64(t0, t0, t1); 275a2b0a27dSPhilippe Mathieu-Daudé /* if all bits are zero then all elements are not zero */ 276a2b0a27dSPhilippe Mathieu-Daudé /* if some bit is non-zero then some element is zero */ 277a2b0a27dSPhilippe Mathieu-Daudé tcg_gen_setcondi_i64(cond, t0, t0, 0); 278a2b0a27dSPhilippe Mathieu-Daudé tcg_gen_trunc_i64_tl(tresult, t0); 279a2b0a27dSPhilippe Mathieu-Daudé tcg_temp_free_i64(t0); 280a2b0a27dSPhilippe Mathieu-Daudé tcg_temp_free_i64(t1); 281a2b0a27dSPhilippe Mathieu-Daudé } 282a2b0a27dSPhilippe Mathieu-Daudé 283d61566cfSPhilippe Mathieu-Daudé static bool gen_msa_BxZ_V(DisasContext *ctx, int wt, int sa, TCGCond cond) 284a2b0a27dSPhilippe Mathieu-Daudé { 285a2b0a27dSPhilippe Mathieu-Daudé TCGv_i64 t0; 286a2b0a27dSPhilippe Mathieu-Daudé 287340ee8b3SPhilippe Mathieu-Daudé if (!check_msa_enabled(ctx)) { 288340ee8b3SPhilippe Mathieu-Daudé return true; 289340ee8b3SPhilippe Mathieu-Daudé } 290a2b0a27dSPhilippe Mathieu-Daudé 291a2b0a27dSPhilippe Mathieu-Daudé if (ctx->hflags & MIPS_HFLAG_BMASK) { 292a2b0a27dSPhilippe Mathieu-Daudé gen_reserved_instruction(ctx); 293a2b0a27dSPhilippe Mathieu-Daudé return true; 294a2b0a27dSPhilippe Mathieu-Daudé } 295a2b0a27dSPhilippe Mathieu-Daudé t0 = tcg_temp_new_i64(); 296a2b0a27dSPhilippe Mathieu-Daudé tcg_gen_or_i64(t0, msa_wr_d[wt << 1], msa_wr_d[(wt << 1) + 1]); 297a2b0a27dSPhilippe Mathieu-Daudé tcg_gen_setcondi_i64(cond, t0, t0, 0); 298a2b0a27dSPhilippe Mathieu-Daudé tcg_gen_trunc_i64_tl(bcond, t0); 299a2b0a27dSPhilippe Mathieu-Daudé tcg_temp_free_i64(t0); 300a2b0a27dSPhilippe Mathieu-Daudé 301d61566cfSPhilippe Mathieu-Daudé ctx->btarget = ctx->base.pc_next + (sa << 2) + 4; 302a2b0a27dSPhilippe Mathieu-Daudé 303a2b0a27dSPhilippe Mathieu-Daudé ctx->hflags |= MIPS_HFLAG_BC; 304a2b0a27dSPhilippe Mathieu-Daudé ctx->hflags |= MIPS_HFLAG_BDS32; 305a2b0a27dSPhilippe Mathieu-Daudé 306a2b0a27dSPhilippe Mathieu-Daudé return true; 307a2b0a27dSPhilippe Mathieu-Daudé } 308a2b0a27dSPhilippe Mathieu-Daudé 309a2b0a27dSPhilippe Mathieu-Daudé static bool trans_BZ_V(DisasContext *ctx, arg_msa_bz *a) 310a2b0a27dSPhilippe Mathieu-Daudé { 311d61566cfSPhilippe Mathieu-Daudé return gen_msa_BxZ_V(ctx, a->wt, a->sa, TCG_COND_EQ); 312a2b0a27dSPhilippe Mathieu-Daudé } 313a2b0a27dSPhilippe Mathieu-Daudé 314a2b0a27dSPhilippe Mathieu-Daudé static bool trans_BNZ_V(DisasContext *ctx, arg_msa_bz *a) 315a2b0a27dSPhilippe Mathieu-Daudé { 316d61566cfSPhilippe Mathieu-Daudé return gen_msa_BxZ_V(ctx, a->wt, a->sa, TCG_COND_NE); 317a2b0a27dSPhilippe Mathieu-Daudé } 318a2b0a27dSPhilippe Mathieu-Daudé 319d61566cfSPhilippe Mathieu-Daudé static bool gen_msa_BxZ(DisasContext *ctx, int df, int wt, int sa, bool if_not) 320a2b0a27dSPhilippe Mathieu-Daudé { 321340ee8b3SPhilippe Mathieu-Daudé if (!check_msa_enabled(ctx)) { 322340ee8b3SPhilippe Mathieu-Daudé return true; 323340ee8b3SPhilippe Mathieu-Daudé } 324a2b0a27dSPhilippe Mathieu-Daudé 325a2b0a27dSPhilippe Mathieu-Daudé if (ctx->hflags & MIPS_HFLAG_BMASK) { 326a2b0a27dSPhilippe Mathieu-Daudé gen_reserved_instruction(ctx); 327a2b0a27dSPhilippe Mathieu-Daudé return true; 328a2b0a27dSPhilippe Mathieu-Daudé } 329a2b0a27dSPhilippe Mathieu-Daudé 330a2b0a27dSPhilippe Mathieu-Daudé gen_check_zero_element(bcond, df, wt, if_not ? TCG_COND_EQ : TCG_COND_NE); 331a2b0a27dSPhilippe Mathieu-Daudé 332d61566cfSPhilippe Mathieu-Daudé ctx->btarget = ctx->base.pc_next + (sa << 2) + 4; 333a2b0a27dSPhilippe Mathieu-Daudé ctx->hflags |= MIPS_HFLAG_BC; 334a2b0a27dSPhilippe Mathieu-Daudé ctx->hflags |= MIPS_HFLAG_BDS32; 335a2b0a27dSPhilippe Mathieu-Daudé 336a2b0a27dSPhilippe Mathieu-Daudé return true; 337a2b0a27dSPhilippe Mathieu-Daudé } 338a2b0a27dSPhilippe Mathieu-Daudé 339d61566cfSPhilippe Mathieu-Daudé static bool trans_BZ(DisasContext *ctx, arg_msa_bz *a) 340a2b0a27dSPhilippe Mathieu-Daudé { 341d61566cfSPhilippe Mathieu-Daudé return gen_msa_BxZ(ctx, a->df, a->wt, a->sa, false); 342a2b0a27dSPhilippe Mathieu-Daudé } 343a2b0a27dSPhilippe Mathieu-Daudé 344d61566cfSPhilippe Mathieu-Daudé static bool trans_BNZ(DisasContext *ctx, arg_msa_bz *a) 345a2b0a27dSPhilippe Mathieu-Daudé { 346d61566cfSPhilippe Mathieu-Daudé return gen_msa_BxZ(ctx, a->df, a->wt, a->sa, true); 347a2b0a27dSPhilippe Mathieu-Daudé } 348a2b0a27dSPhilippe Mathieu-Daudé 3497cc351ffSPhilippe Mathieu-Daudé static bool trans_msa_i8(DisasContext *ctx, arg_msa_i *a, 3507cc351ffSPhilippe Mathieu-Daudé gen_helper_piii *gen_msa_i8) 351a2b0a27dSPhilippe Mathieu-Daudé { 3527cc351ffSPhilippe Mathieu-Daudé if (!check_msa_enabled(ctx)) { 3537cc351ffSPhilippe Mathieu-Daudé return true; 354a2b0a27dSPhilippe Mathieu-Daudé } 355a2b0a27dSPhilippe Mathieu-Daudé 3567cc351ffSPhilippe Mathieu-Daudé gen_msa_i8(cpu_env, 3577cc351ffSPhilippe Mathieu-Daudé tcg_constant_i32(a->wd), 3587cc351ffSPhilippe Mathieu-Daudé tcg_constant_i32(a->ws), 3597cc351ffSPhilippe Mathieu-Daudé tcg_constant_i32(a->sa)); 3607cc351ffSPhilippe Mathieu-Daudé 3617cc351ffSPhilippe Mathieu-Daudé return true; 362a2b0a27dSPhilippe Mathieu-Daudé } 363a2b0a27dSPhilippe Mathieu-Daudé 3647cc351ffSPhilippe Mathieu-Daudé TRANS(ANDI, trans_msa_i8, gen_helper_msa_andi_b); 3657cc351ffSPhilippe Mathieu-Daudé TRANS(ORI, trans_msa_i8, gen_helper_msa_ori_b); 3667cc351ffSPhilippe Mathieu-Daudé TRANS(NORI, trans_msa_i8, gen_helper_msa_nori_b); 3677cc351ffSPhilippe Mathieu-Daudé TRANS(XORI, trans_msa_i8, gen_helper_msa_xori_b); 3687cc351ffSPhilippe Mathieu-Daudé TRANS(BMNZI, trans_msa_i8, gen_helper_msa_bmnzi_b); 3697cc351ffSPhilippe Mathieu-Daudé TRANS(BMZI, trans_msa_i8, gen_helper_msa_bmzi_b); 3707cc351ffSPhilippe Mathieu-Daudé TRANS(BSELI, trans_msa_i8, gen_helper_msa_bseli_b); 3717cc351ffSPhilippe Mathieu-Daudé 372a9e17958SPhilippe Mathieu-Daudé static bool trans_SHF(DisasContext *ctx, arg_msa_i *a) 373a9e17958SPhilippe Mathieu-Daudé { 374a9e17958SPhilippe Mathieu-Daudé if (a->df == DF_DOUBLE) { 375a9e17958SPhilippe Mathieu-Daudé return false; 376a9e17958SPhilippe Mathieu-Daudé } 377a9e17958SPhilippe Mathieu-Daudé 378a9e17958SPhilippe Mathieu-Daudé if (!check_msa_enabled(ctx)) { 379a9e17958SPhilippe Mathieu-Daudé return true; 380a9e17958SPhilippe Mathieu-Daudé } 381a9e17958SPhilippe Mathieu-Daudé 382a9e17958SPhilippe Mathieu-Daudé gen_helper_msa_shf_df(cpu_env, 383a9e17958SPhilippe Mathieu-Daudé tcg_constant_i32(a->df), 384a9e17958SPhilippe Mathieu-Daudé tcg_constant_i32(a->wd), 385a9e17958SPhilippe Mathieu-Daudé tcg_constant_i32(a->ws), 386a9e17958SPhilippe Mathieu-Daudé tcg_constant_i32(a->sa)); 387a9e17958SPhilippe Mathieu-Daudé 388a9e17958SPhilippe Mathieu-Daudé return true; 389a9e17958SPhilippe Mathieu-Daudé } 390a9e17958SPhilippe Mathieu-Daudé 391b8e74816SPhilippe Mathieu-Daudé static bool trans_msa_i5(DisasContext *ctx, arg_msa_i *a, 392b8e74816SPhilippe Mathieu-Daudé gen_helper_piiii *gen_msa_i5) 393a2b0a27dSPhilippe Mathieu-Daudé { 394b8e74816SPhilippe Mathieu-Daudé if (!check_msa_enabled(ctx)) { 395b8e74816SPhilippe Mathieu-Daudé return true; 396a2b0a27dSPhilippe Mathieu-Daudé } 397a2b0a27dSPhilippe Mathieu-Daudé 398b8e74816SPhilippe Mathieu-Daudé gen_msa_i5(cpu_env, 399b8e74816SPhilippe Mathieu-Daudé tcg_constant_i32(a->df), 400b8e74816SPhilippe Mathieu-Daudé tcg_constant_i32(a->wd), 401b8e74816SPhilippe Mathieu-Daudé tcg_constant_i32(a->ws), 402b8e74816SPhilippe Mathieu-Daudé tcg_constant_i32(a->sa)); 403b8e74816SPhilippe Mathieu-Daudé 404b8e74816SPhilippe Mathieu-Daudé return true; 405a2b0a27dSPhilippe Mathieu-Daudé } 406a2b0a27dSPhilippe Mathieu-Daudé 407b8e74816SPhilippe Mathieu-Daudé TRANS(ADDVI, trans_msa_i5, gen_helper_msa_addvi_df); 408b8e74816SPhilippe Mathieu-Daudé TRANS(SUBVI, trans_msa_i5, gen_helper_msa_subvi_df); 409b8e74816SPhilippe Mathieu-Daudé TRANS(MAXI_S, trans_msa_i5, gen_helper_msa_maxi_s_df); 410b8e74816SPhilippe Mathieu-Daudé TRANS(MAXI_U, trans_msa_i5, gen_helper_msa_maxi_u_df); 411b8e74816SPhilippe Mathieu-Daudé TRANS(MINI_S, trans_msa_i5, gen_helper_msa_mini_s_df); 412b8e74816SPhilippe Mathieu-Daudé TRANS(MINI_U, trans_msa_i5, gen_helper_msa_mini_u_df); 413b8e74816SPhilippe Mathieu-Daudé TRANS(CLTI_S, trans_msa_i5, gen_helper_msa_clti_s_df); 414b8e74816SPhilippe Mathieu-Daudé TRANS(CLTI_U, trans_msa_i5, gen_helper_msa_clti_u_df); 415b8e74816SPhilippe Mathieu-Daudé TRANS(CLEI_S, trans_msa_i5, gen_helper_msa_clei_s_df); 416b8e74816SPhilippe Mathieu-Daudé TRANS(CLEI_U, trans_msa_i5, gen_helper_msa_clei_u_df); 417b8e74816SPhilippe Mathieu-Daudé TRANS(CEQI, trans_msa_i5, gen_helper_msa_ceqi_df); 418b8e74816SPhilippe Mathieu-Daudé 41975094c33SPhilippe Mathieu-Daudé static bool trans_LDI(DisasContext *ctx, arg_msa_ldi *a) 42075094c33SPhilippe Mathieu-Daudé { 42175094c33SPhilippe Mathieu-Daudé if (!check_msa_enabled(ctx)) { 42275094c33SPhilippe Mathieu-Daudé return true; 42375094c33SPhilippe Mathieu-Daudé } 42475094c33SPhilippe Mathieu-Daudé 42575094c33SPhilippe Mathieu-Daudé gen_helper_msa_ldi_df(cpu_env, 42675094c33SPhilippe Mathieu-Daudé tcg_constant_i32(a->df), 42775094c33SPhilippe Mathieu-Daudé tcg_constant_i32(a->wd), 42875094c33SPhilippe Mathieu-Daudé tcg_constant_i32(a->sa)); 42975094c33SPhilippe Mathieu-Daudé 43075094c33SPhilippe Mathieu-Daudé return true; 43175094c33SPhilippe Mathieu-Daudé } 43275094c33SPhilippe Mathieu-Daudé 4334701d23aSPhilippe Mathieu-Daudé static bool trans_msa_bit(DisasContext *ctx, arg_msa_bit *a, 4344701d23aSPhilippe Mathieu-Daudé gen_helper_piiii *gen_msa_bit) 435a2b0a27dSPhilippe Mathieu-Daudé { 4364701d23aSPhilippe Mathieu-Daudé if (a->df < 0) { 4374701d23aSPhilippe Mathieu-Daudé return false; 438a2b0a27dSPhilippe Mathieu-Daudé } 439a2b0a27dSPhilippe Mathieu-Daudé 4404701d23aSPhilippe Mathieu-Daudé if (!check_msa_enabled(ctx)) { 4414701d23aSPhilippe Mathieu-Daudé return true; 442a2b0a27dSPhilippe Mathieu-Daudé } 443a2b0a27dSPhilippe Mathieu-Daudé 4444701d23aSPhilippe Mathieu-Daudé gen_msa_bit(cpu_env, 4454701d23aSPhilippe Mathieu-Daudé tcg_constant_i32(a->df), 4464701d23aSPhilippe Mathieu-Daudé tcg_constant_i32(a->wd), 4474701d23aSPhilippe Mathieu-Daudé tcg_constant_i32(a->ws), 4484701d23aSPhilippe Mathieu-Daudé tcg_constant_i32(a->m)); 4494701d23aSPhilippe Mathieu-Daudé 4504701d23aSPhilippe Mathieu-Daudé return true; 451a2b0a27dSPhilippe Mathieu-Daudé } 452a2b0a27dSPhilippe Mathieu-Daudé 4534701d23aSPhilippe Mathieu-Daudé TRANS(SLLI, trans_msa_bit, gen_helper_msa_slli_df); 4544701d23aSPhilippe Mathieu-Daudé TRANS(SRAI, trans_msa_bit, gen_helper_msa_srai_df); 4554701d23aSPhilippe Mathieu-Daudé TRANS(SRLI, trans_msa_bit, gen_helper_msa_srli_df); 4564701d23aSPhilippe Mathieu-Daudé TRANS(BCLRI, trans_msa_bit, gen_helper_msa_bclri_df); 4574701d23aSPhilippe Mathieu-Daudé TRANS(BSETI, trans_msa_bit, gen_helper_msa_bseti_df); 4584701d23aSPhilippe Mathieu-Daudé TRANS(BNEGI, trans_msa_bit, gen_helper_msa_bnegi_df); 4594701d23aSPhilippe Mathieu-Daudé TRANS(BINSLI, trans_msa_bit, gen_helper_msa_binsli_df); 4604701d23aSPhilippe Mathieu-Daudé TRANS(BINSRI, trans_msa_bit, gen_helper_msa_binsri_df); 4614701d23aSPhilippe Mathieu-Daudé TRANS(SAT_S, trans_msa_bit, gen_helper_msa_sat_u_df); 4624701d23aSPhilippe Mathieu-Daudé TRANS(SAT_U, trans_msa_bit, gen_helper_msa_sat_u_df); 4634701d23aSPhilippe Mathieu-Daudé TRANS(SRARI, trans_msa_bit, gen_helper_msa_srari_df); 4644701d23aSPhilippe Mathieu-Daudé TRANS(SRLRI, trans_msa_bit, gen_helper_msa_srlri_df); 4654701d23aSPhilippe Mathieu-Daudé 466ff29e5d3SPhilippe Mathieu-Daudé static bool trans_msa_3rf(DisasContext *ctx, arg_msa_r *a, 467ff29e5d3SPhilippe Mathieu-Daudé gen_helper_piiii *gen_msa_3rf) 468ff29e5d3SPhilippe Mathieu-Daudé { 469ff29e5d3SPhilippe Mathieu-Daudé if (!check_msa_enabled(ctx)) { 470ff29e5d3SPhilippe Mathieu-Daudé return true; 471ff29e5d3SPhilippe Mathieu-Daudé } 472ff29e5d3SPhilippe Mathieu-Daudé 473ff29e5d3SPhilippe Mathieu-Daudé gen_msa_3rf(cpu_env, 474ff29e5d3SPhilippe Mathieu-Daudé tcg_constant_i32(a->df), 475ff29e5d3SPhilippe Mathieu-Daudé tcg_constant_i32(a->wd), 476ff29e5d3SPhilippe Mathieu-Daudé tcg_constant_i32(a->ws), 477ff29e5d3SPhilippe Mathieu-Daudé tcg_constant_i32(a->wt)); 478ff29e5d3SPhilippe Mathieu-Daudé 479ff29e5d3SPhilippe Mathieu-Daudé return true; 480ff29e5d3SPhilippe Mathieu-Daudé } 481ff29e5d3SPhilippe Mathieu-Daudé 4827acb5c78SPhilippe Mathieu-Daudé static bool trans_msa_3r(DisasContext *ctx, arg_msa_r *a, 4837acb5c78SPhilippe Mathieu-Daudé gen_helper_piii *gen_msa_3r) 4847acb5c78SPhilippe Mathieu-Daudé { 485f18708a5SPhilippe Mathieu-Daudé if (!gen_msa_3r) { 486f18708a5SPhilippe Mathieu-Daudé return false; 487f18708a5SPhilippe Mathieu-Daudé } 488f18708a5SPhilippe Mathieu-Daudé 4897acb5c78SPhilippe Mathieu-Daudé if (!check_msa_enabled(ctx)) { 4907acb5c78SPhilippe Mathieu-Daudé return true; 4917acb5c78SPhilippe Mathieu-Daudé } 4927acb5c78SPhilippe Mathieu-Daudé 4937acb5c78SPhilippe Mathieu-Daudé gen_msa_3r(cpu_env, 4947acb5c78SPhilippe Mathieu-Daudé tcg_constant_i32(a->wd), 4957acb5c78SPhilippe Mathieu-Daudé tcg_constant_i32(a->ws), 4967acb5c78SPhilippe Mathieu-Daudé tcg_constant_i32(a->wt)); 4977acb5c78SPhilippe Mathieu-Daudé 4987acb5c78SPhilippe Mathieu-Daudé return true; 4997acb5c78SPhilippe Mathieu-Daudé } 5007acb5c78SPhilippe Mathieu-Daudé 5017acb5c78SPhilippe Mathieu-Daudé TRANS(AND_V, trans_msa_3r, gen_helper_msa_and_v); 5027acb5c78SPhilippe Mathieu-Daudé TRANS(OR_V, trans_msa_3r, gen_helper_msa_or_v); 5037acb5c78SPhilippe Mathieu-Daudé TRANS(NOR_V, trans_msa_3r, gen_helper_msa_nor_v); 5047acb5c78SPhilippe Mathieu-Daudé TRANS(XOR_V, trans_msa_3r, gen_helper_msa_xor_v); 5057acb5c78SPhilippe Mathieu-Daudé TRANS(BMNZ_V, trans_msa_3r, gen_helper_msa_bmnz_v); 5067acb5c78SPhilippe Mathieu-Daudé TRANS(BMZ_V, trans_msa_3r, gen_helper_msa_bmz_v); 5077acb5c78SPhilippe Mathieu-Daudé TRANS(BSEL_V, trans_msa_3r, gen_helper_msa_bsel_v); 5087acb5c78SPhilippe Mathieu-Daudé 509*c79db8c2SPhilippe Mathieu-Daudé TRANS_DF_iii(BINSL, trans_msa_3r, gen_helper_msa_binsl); 510*c79db8c2SPhilippe Mathieu-Daudé TRANS_DF_iii(BINSR, trans_msa_3r, gen_helper_msa_binsr); 511*c79db8c2SPhilippe Mathieu-Daudé 512f18708a5SPhilippe Mathieu-Daudé TRANS_DF_iii_b(DOTP_S, trans_msa_3r, gen_helper_msa_dotp_s); 513f18708a5SPhilippe Mathieu-Daudé TRANS_DF_iii_b(DOTP_U, trans_msa_3r, gen_helper_msa_dotp_u); 514f18708a5SPhilippe Mathieu-Daudé TRANS_DF_iii_b(DPADD_S, trans_msa_3r, gen_helper_msa_dpadd_s); 515f18708a5SPhilippe Mathieu-Daudé TRANS_DF_iii_b(DPADD_U, trans_msa_3r, gen_helper_msa_dpadd_u); 516f18708a5SPhilippe Mathieu-Daudé TRANS_DF_iii_b(DPSUB_S, trans_msa_3r, gen_helper_msa_dpsub_s); 517f18708a5SPhilippe Mathieu-Daudé TRANS_DF_iii_b(DPSUB_U, trans_msa_3r, gen_helper_msa_dpsub_u); 518f18708a5SPhilippe Mathieu-Daudé 51967bedef5SPhilippe Mathieu-Daudé TRANS(SLD, trans_msa_3rf, gen_helper_msa_sld_df); 52067bedef5SPhilippe Mathieu-Daudé TRANS(SPLAT, trans_msa_3rf, gen_helper_msa_splat_df); 52167bedef5SPhilippe Mathieu-Daudé 52267bedef5SPhilippe Mathieu-Daudé TRANS(VSHF, trans_msa_3rf, gen_helper_msa_vshf_df); 523f18708a5SPhilippe Mathieu-Daudé TRANS_DF_iii_b(HADD_S, trans_msa_3r, gen_helper_msa_hadd_s); 524f18708a5SPhilippe Mathieu-Daudé TRANS_DF_iii_b(HADD_U, trans_msa_3r, gen_helper_msa_hadd_u); 525f18708a5SPhilippe Mathieu-Daudé TRANS_DF_iii_b(HSUB_S, trans_msa_3r, gen_helper_msa_hsub_s); 526f18708a5SPhilippe Mathieu-Daudé TRANS_DF_iii_b(HSUB_U, trans_msa_3r, gen_helper_msa_hsub_u); 52767bedef5SPhilippe Mathieu-Daudé 528a2b0a27dSPhilippe Mathieu-Daudé static void gen_msa_3r(DisasContext *ctx) 529a2b0a27dSPhilippe Mathieu-Daudé { 530a2b0a27dSPhilippe Mathieu-Daudé #define MASK_MSA_3R(op) (MASK_MSA_MINOR(op) | (op & (0x7 << 23))) 531a2b0a27dSPhilippe Mathieu-Daudé uint8_t df = (ctx->opcode >> 21) & 0x3; 532a2b0a27dSPhilippe Mathieu-Daudé uint8_t wt = (ctx->opcode >> 16) & 0x1f; 533a2b0a27dSPhilippe Mathieu-Daudé uint8_t ws = (ctx->opcode >> 11) & 0x1f; 534a2b0a27dSPhilippe Mathieu-Daudé uint8_t wd = (ctx->opcode >> 6) & 0x1f; 535a2b0a27dSPhilippe Mathieu-Daudé 536a2b0a27dSPhilippe Mathieu-Daudé TCGv_i32 tdf = tcg_const_i32(df); 537a2b0a27dSPhilippe Mathieu-Daudé TCGv_i32 twd = tcg_const_i32(wd); 538a2b0a27dSPhilippe Mathieu-Daudé TCGv_i32 tws = tcg_const_i32(ws); 539a2b0a27dSPhilippe Mathieu-Daudé TCGv_i32 twt = tcg_const_i32(wt); 540a2b0a27dSPhilippe Mathieu-Daudé 541a2b0a27dSPhilippe Mathieu-Daudé switch (MASK_MSA_3R(ctx->opcode)) { 542a2b0a27dSPhilippe Mathieu-Daudé case OPC_BCLR_df: 543a2b0a27dSPhilippe Mathieu-Daudé switch (df) { 544a2b0a27dSPhilippe Mathieu-Daudé case DF_BYTE: 545a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_bclr_b(cpu_env, twd, tws, twt); 546a2b0a27dSPhilippe Mathieu-Daudé break; 547a2b0a27dSPhilippe Mathieu-Daudé case DF_HALF: 548a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_bclr_h(cpu_env, twd, tws, twt); 549a2b0a27dSPhilippe Mathieu-Daudé break; 550a2b0a27dSPhilippe Mathieu-Daudé case DF_WORD: 551a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_bclr_w(cpu_env, twd, tws, twt); 552a2b0a27dSPhilippe Mathieu-Daudé break; 553a2b0a27dSPhilippe Mathieu-Daudé case DF_DOUBLE: 554a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_bclr_d(cpu_env, twd, tws, twt); 555a2b0a27dSPhilippe Mathieu-Daudé break; 556a2b0a27dSPhilippe Mathieu-Daudé } 557a2b0a27dSPhilippe Mathieu-Daudé break; 558a2b0a27dSPhilippe Mathieu-Daudé case OPC_BNEG_df: 559a2b0a27dSPhilippe Mathieu-Daudé switch (df) { 560a2b0a27dSPhilippe Mathieu-Daudé case DF_BYTE: 561a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_bneg_b(cpu_env, twd, tws, twt); 562a2b0a27dSPhilippe Mathieu-Daudé break; 563a2b0a27dSPhilippe Mathieu-Daudé case DF_HALF: 564a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_bneg_h(cpu_env, twd, tws, twt); 565a2b0a27dSPhilippe Mathieu-Daudé break; 566a2b0a27dSPhilippe Mathieu-Daudé case DF_WORD: 567a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_bneg_w(cpu_env, twd, tws, twt); 568a2b0a27dSPhilippe Mathieu-Daudé break; 569a2b0a27dSPhilippe Mathieu-Daudé case DF_DOUBLE: 570a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_bneg_d(cpu_env, twd, tws, twt); 571a2b0a27dSPhilippe Mathieu-Daudé break; 572a2b0a27dSPhilippe Mathieu-Daudé } 573a2b0a27dSPhilippe Mathieu-Daudé break; 574a2b0a27dSPhilippe Mathieu-Daudé case OPC_BSET_df: 575a2b0a27dSPhilippe Mathieu-Daudé switch (df) { 576a2b0a27dSPhilippe Mathieu-Daudé case DF_BYTE: 577a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_bset_b(cpu_env, twd, tws, twt); 578a2b0a27dSPhilippe Mathieu-Daudé break; 579a2b0a27dSPhilippe Mathieu-Daudé case DF_HALF: 580a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_bset_h(cpu_env, twd, tws, twt); 581a2b0a27dSPhilippe Mathieu-Daudé break; 582a2b0a27dSPhilippe Mathieu-Daudé case DF_WORD: 583a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_bset_w(cpu_env, twd, tws, twt); 584a2b0a27dSPhilippe Mathieu-Daudé break; 585a2b0a27dSPhilippe Mathieu-Daudé case DF_DOUBLE: 586a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_bset_d(cpu_env, twd, tws, twt); 587a2b0a27dSPhilippe Mathieu-Daudé break; 588a2b0a27dSPhilippe Mathieu-Daudé } 589a2b0a27dSPhilippe Mathieu-Daudé break; 590a2b0a27dSPhilippe Mathieu-Daudé case OPC_ADD_A_df: 591a2b0a27dSPhilippe Mathieu-Daudé switch (df) { 592a2b0a27dSPhilippe Mathieu-Daudé case DF_BYTE: 593a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_add_a_b(cpu_env, twd, tws, twt); 594a2b0a27dSPhilippe Mathieu-Daudé break; 595a2b0a27dSPhilippe Mathieu-Daudé case DF_HALF: 596a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_add_a_h(cpu_env, twd, tws, twt); 597a2b0a27dSPhilippe Mathieu-Daudé break; 598a2b0a27dSPhilippe Mathieu-Daudé case DF_WORD: 599a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_add_a_w(cpu_env, twd, tws, twt); 600a2b0a27dSPhilippe Mathieu-Daudé break; 601a2b0a27dSPhilippe Mathieu-Daudé case DF_DOUBLE: 602a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_add_a_d(cpu_env, twd, tws, twt); 603a2b0a27dSPhilippe Mathieu-Daudé break; 604a2b0a27dSPhilippe Mathieu-Daudé } 605a2b0a27dSPhilippe Mathieu-Daudé break; 606a2b0a27dSPhilippe Mathieu-Daudé case OPC_ADDS_A_df: 607a2b0a27dSPhilippe Mathieu-Daudé switch (df) { 608a2b0a27dSPhilippe Mathieu-Daudé case DF_BYTE: 609a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_adds_a_b(cpu_env, twd, tws, twt); 610a2b0a27dSPhilippe Mathieu-Daudé break; 611a2b0a27dSPhilippe Mathieu-Daudé case DF_HALF: 612a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_adds_a_h(cpu_env, twd, tws, twt); 613a2b0a27dSPhilippe Mathieu-Daudé break; 614a2b0a27dSPhilippe Mathieu-Daudé case DF_WORD: 615a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_adds_a_w(cpu_env, twd, tws, twt); 616a2b0a27dSPhilippe Mathieu-Daudé break; 617a2b0a27dSPhilippe Mathieu-Daudé case DF_DOUBLE: 618a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_adds_a_d(cpu_env, twd, tws, twt); 619a2b0a27dSPhilippe Mathieu-Daudé break; 620a2b0a27dSPhilippe Mathieu-Daudé } 621a2b0a27dSPhilippe Mathieu-Daudé break; 622a2b0a27dSPhilippe Mathieu-Daudé case OPC_ADDS_S_df: 623a2b0a27dSPhilippe Mathieu-Daudé switch (df) { 624a2b0a27dSPhilippe Mathieu-Daudé case DF_BYTE: 625a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_adds_s_b(cpu_env, twd, tws, twt); 626a2b0a27dSPhilippe Mathieu-Daudé break; 627a2b0a27dSPhilippe Mathieu-Daudé case DF_HALF: 628a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_adds_s_h(cpu_env, twd, tws, twt); 629a2b0a27dSPhilippe Mathieu-Daudé break; 630a2b0a27dSPhilippe Mathieu-Daudé case DF_WORD: 631a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_adds_s_w(cpu_env, twd, tws, twt); 632a2b0a27dSPhilippe Mathieu-Daudé break; 633a2b0a27dSPhilippe Mathieu-Daudé case DF_DOUBLE: 634a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_adds_s_d(cpu_env, twd, tws, twt); 635a2b0a27dSPhilippe Mathieu-Daudé break; 636a2b0a27dSPhilippe Mathieu-Daudé } 637a2b0a27dSPhilippe Mathieu-Daudé break; 638a2b0a27dSPhilippe Mathieu-Daudé case OPC_ADDS_U_df: 639a2b0a27dSPhilippe Mathieu-Daudé switch (df) { 640a2b0a27dSPhilippe Mathieu-Daudé case DF_BYTE: 641a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_adds_u_b(cpu_env, twd, tws, twt); 642a2b0a27dSPhilippe Mathieu-Daudé break; 643a2b0a27dSPhilippe Mathieu-Daudé case DF_HALF: 644a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_adds_u_h(cpu_env, twd, tws, twt); 645a2b0a27dSPhilippe Mathieu-Daudé break; 646a2b0a27dSPhilippe Mathieu-Daudé case DF_WORD: 647a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_adds_u_w(cpu_env, twd, tws, twt); 648a2b0a27dSPhilippe Mathieu-Daudé break; 649a2b0a27dSPhilippe Mathieu-Daudé case DF_DOUBLE: 650a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_adds_u_d(cpu_env, twd, tws, twt); 651a2b0a27dSPhilippe Mathieu-Daudé break; 652a2b0a27dSPhilippe Mathieu-Daudé } 653a2b0a27dSPhilippe Mathieu-Daudé break; 654a2b0a27dSPhilippe Mathieu-Daudé case OPC_ADDV_df: 655a2b0a27dSPhilippe Mathieu-Daudé switch (df) { 656a2b0a27dSPhilippe Mathieu-Daudé case DF_BYTE: 657a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_addv_b(cpu_env, twd, tws, twt); 658a2b0a27dSPhilippe Mathieu-Daudé break; 659a2b0a27dSPhilippe Mathieu-Daudé case DF_HALF: 660a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_addv_h(cpu_env, twd, tws, twt); 661a2b0a27dSPhilippe Mathieu-Daudé break; 662a2b0a27dSPhilippe Mathieu-Daudé case DF_WORD: 663a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_addv_w(cpu_env, twd, tws, twt); 664a2b0a27dSPhilippe Mathieu-Daudé break; 665a2b0a27dSPhilippe Mathieu-Daudé case DF_DOUBLE: 666a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_addv_d(cpu_env, twd, tws, twt); 667a2b0a27dSPhilippe Mathieu-Daudé break; 668a2b0a27dSPhilippe Mathieu-Daudé } 669a2b0a27dSPhilippe Mathieu-Daudé break; 670a2b0a27dSPhilippe Mathieu-Daudé case OPC_AVE_S_df: 671a2b0a27dSPhilippe Mathieu-Daudé switch (df) { 672a2b0a27dSPhilippe Mathieu-Daudé case DF_BYTE: 673a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_ave_s_b(cpu_env, twd, tws, twt); 674a2b0a27dSPhilippe Mathieu-Daudé break; 675a2b0a27dSPhilippe Mathieu-Daudé case DF_HALF: 676a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_ave_s_h(cpu_env, twd, tws, twt); 677a2b0a27dSPhilippe Mathieu-Daudé break; 678a2b0a27dSPhilippe Mathieu-Daudé case DF_WORD: 679a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_ave_s_w(cpu_env, twd, tws, twt); 680a2b0a27dSPhilippe Mathieu-Daudé break; 681a2b0a27dSPhilippe Mathieu-Daudé case DF_DOUBLE: 682a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_ave_s_d(cpu_env, twd, tws, twt); 683a2b0a27dSPhilippe Mathieu-Daudé break; 684a2b0a27dSPhilippe Mathieu-Daudé } 685a2b0a27dSPhilippe Mathieu-Daudé break; 686a2b0a27dSPhilippe Mathieu-Daudé case OPC_AVE_U_df: 687a2b0a27dSPhilippe Mathieu-Daudé switch (df) { 688a2b0a27dSPhilippe Mathieu-Daudé case DF_BYTE: 689a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_ave_u_b(cpu_env, twd, tws, twt); 690a2b0a27dSPhilippe Mathieu-Daudé break; 691a2b0a27dSPhilippe Mathieu-Daudé case DF_HALF: 692a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_ave_u_h(cpu_env, twd, tws, twt); 693a2b0a27dSPhilippe Mathieu-Daudé break; 694a2b0a27dSPhilippe Mathieu-Daudé case DF_WORD: 695a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_ave_u_w(cpu_env, twd, tws, twt); 696a2b0a27dSPhilippe Mathieu-Daudé break; 697a2b0a27dSPhilippe Mathieu-Daudé case DF_DOUBLE: 698a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_ave_u_d(cpu_env, twd, tws, twt); 699a2b0a27dSPhilippe Mathieu-Daudé break; 700a2b0a27dSPhilippe Mathieu-Daudé } 701a2b0a27dSPhilippe Mathieu-Daudé break; 702a2b0a27dSPhilippe Mathieu-Daudé case OPC_AVER_S_df: 703a2b0a27dSPhilippe Mathieu-Daudé switch (df) { 704a2b0a27dSPhilippe Mathieu-Daudé case DF_BYTE: 705a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_aver_s_b(cpu_env, twd, tws, twt); 706a2b0a27dSPhilippe Mathieu-Daudé break; 707a2b0a27dSPhilippe Mathieu-Daudé case DF_HALF: 708a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_aver_s_h(cpu_env, twd, tws, twt); 709a2b0a27dSPhilippe Mathieu-Daudé break; 710a2b0a27dSPhilippe Mathieu-Daudé case DF_WORD: 711a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_aver_s_w(cpu_env, twd, tws, twt); 712a2b0a27dSPhilippe Mathieu-Daudé break; 713a2b0a27dSPhilippe Mathieu-Daudé case DF_DOUBLE: 714a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_aver_s_d(cpu_env, twd, tws, twt); 715a2b0a27dSPhilippe Mathieu-Daudé break; 716a2b0a27dSPhilippe Mathieu-Daudé } 717a2b0a27dSPhilippe Mathieu-Daudé break; 718a2b0a27dSPhilippe Mathieu-Daudé case OPC_AVER_U_df: 719a2b0a27dSPhilippe Mathieu-Daudé switch (df) { 720a2b0a27dSPhilippe Mathieu-Daudé case DF_BYTE: 721a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_aver_u_b(cpu_env, twd, tws, twt); 722a2b0a27dSPhilippe Mathieu-Daudé break; 723a2b0a27dSPhilippe Mathieu-Daudé case DF_HALF: 724a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_aver_u_h(cpu_env, twd, tws, twt); 725a2b0a27dSPhilippe Mathieu-Daudé break; 726a2b0a27dSPhilippe Mathieu-Daudé case DF_WORD: 727a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_aver_u_w(cpu_env, twd, tws, twt); 728a2b0a27dSPhilippe Mathieu-Daudé break; 729a2b0a27dSPhilippe Mathieu-Daudé case DF_DOUBLE: 730a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_aver_u_d(cpu_env, twd, tws, twt); 731a2b0a27dSPhilippe Mathieu-Daudé break; 732a2b0a27dSPhilippe Mathieu-Daudé } 733a2b0a27dSPhilippe Mathieu-Daudé break; 734a2b0a27dSPhilippe Mathieu-Daudé case OPC_CEQ_df: 735a2b0a27dSPhilippe Mathieu-Daudé switch (df) { 736a2b0a27dSPhilippe Mathieu-Daudé case DF_BYTE: 737a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_ceq_b(cpu_env, twd, tws, twt); 738a2b0a27dSPhilippe Mathieu-Daudé break; 739a2b0a27dSPhilippe Mathieu-Daudé case DF_HALF: 740a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_ceq_h(cpu_env, twd, tws, twt); 741a2b0a27dSPhilippe Mathieu-Daudé break; 742a2b0a27dSPhilippe Mathieu-Daudé case DF_WORD: 743a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_ceq_w(cpu_env, twd, tws, twt); 744a2b0a27dSPhilippe Mathieu-Daudé break; 745a2b0a27dSPhilippe Mathieu-Daudé case DF_DOUBLE: 746a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_ceq_d(cpu_env, twd, tws, twt); 747a2b0a27dSPhilippe Mathieu-Daudé break; 748a2b0a27dSPhilippe Mathieu-Daudé } 749a2b0a27dSPhilippe Mathieu-Daudé break; 750a2b0a27dSPhilippe Mathieu-Daudé case OPC_CLE_S_df: 751a2b0a27dSPhilippe Mathieu-Daudé switch (df) { 752a2b0a27dSPhilippe Mathieu-Daudé case DF_BYTE: 753a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_cle_s_b(cpu_env, twd, tws, twt); 754a2b0a27dSPhilippe Mathieu-Daudé break; 755a2b0a27dSPhilippe Mathieu-Daudé case DF_HALF: 756a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_cle_s_h(cpu_env, twd, tws, twt); 757a2b0a27dSPhilippe Mathieu-Daudé break; 758a2b0a27dSPhilippe Mathieu-Daudé case DF_WORD: 759a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_cle_s_w(cpu_env, twd, tws, twt); 760a2b0a27dSPhilippe Mathieu-Daudé break; 761a2b0a27dSPhilippe Mathieu-Daudé case DF_DOUBLE: 762a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_cle_s_d(cpu_env, twd, tws, twt); 763a2b0a27dSPhilippe Mathieu-Daudé break; 764a2b0a27dSPhilippe Mathieu-Daudé } 765a2b0a27dSPhilippe Mathieu-Daudé break; 766a2b0a27dSPhilippe Mathieu-Daudé case OPC_CLE_U_df: 767a2b0a27dSPhilippe Mathieu-Daudé switch (df) { 768a2b0a27dSPhilippe Mathieu-Daudé case DF_BYTE: 769a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_cle_u_b(cpu_env, twd, tws, twt); 770a2b0a27dSPhilippe Mathieu-Daudé break; 771a2b0a27dSPhilippe Mathieu-Daudé case DF_HALF: 772a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_cle_u_h(cpu_env, twd, tws, twt); 773a2b0a27dSPhilippe Mathieu-Daudé break; 774a2b0a27dSPhilippe Mathieu-Daudé case DF_WORD: 775a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_cle_u_w(cpu_env, twd, tws, twt); 776a2b0a27dSPhilippe Mathieu-Daudé break; 777a2b0a27dSPhilippe Mathieu-Daudé case DF_DOUBLE: 778a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_cle_u_d(cpu_env, twd, tws, twt); 779a2b0a27dSPhilippe Mathieu-Daudé break; 780a2b0a27dSPhilippe Mathieu-Daudé } 781a2b0a27dSPhilippe Mathieu-Daudé break; 782a2b0a27dSPhilippe Mathieu-Daudé case OPC_CLT_S_df: 783a2b0a27dSPhilippe Mathieu-Daudé switch (df) { 784a2b0a27dSPhilippe Mathieu-Daudé case DF_BYTE: 785a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_clt_s_b(cpu_env, twd, tws, twt); 786a2b0a27dSPhilippe Mathieu-Daudé break; 787a2b0a27dSPhilippe Mathieu-Daudé case DF_HALF: 788a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_clt_s_h(cpu_env, twd, tws, twt); 789a2b0a27dSPhilippe Mathieu-Daudé break; 790a2b0a27dSPhilippe Mathieu-Daudé case DF_WORD: 791a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_clt_s_w(cpu_env, twd, tws, twt); 792a2b0a27dSPhilippe Mathieu-Daudé break; 793a2b0a27dSPhilippe Mathieu-Daudé case DF_DOUBLE: 794a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_clt_s_d(cpu_env, twd, tws, twt); 795a2b0a27dSPhilippe Mathieu-Daudé break; 796a2b0a27dSPhilippe Mathieu-Daudé } 797a2b0a27dSPhilippe Mathieu-Daudé break; 798a2b0a27dSPhilippe Mathieu-Daudé case OPC_CLT_U_df: 799a2b0a27dSPhilippe Mathieu-Daudé switch (df) { 800a2b0a27dSPhilippe Mathieu-Daudé case DF_BYTE: 801a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_clt_u_b(cpu_env, twd, tws, twt); 802a2b0a27dSPhilippe Mathieu-Daudé break; 803a2b0a27dSPhilippe Mathieu-Daudé case DF_HALF: 804a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_clt_u_h(cpu_env, twd, tws, twt); 805a2b0a27dSPhilippe Mathieu-Daudé break; 806a2b0a27dSPhilippe Mathieu-Daudé case DF_WORD: 807a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_clt_u_w(cpu_env, twd, tws, twt); 808a2b0a27dSPhilippe Mathieu-Daudé break; 809a2b0a27dSPhilippe Mathieu-Daudé case DF_DOUBLE: 810a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_clt_u_d(cpu_env, twd, tws, twt); 811a2b0a27dSPhilippe Mathieu-Daudé break; 812a2b0a27dSPhilippe Mathieu-Daudé } 813a2b0a27dSPhilippe Mathieu-Daudé break; 814a2b0a27dSPhilippe Mathieu-Daudé case OPC_DIV_S_df: 815a2b0a27dSPhilippe Mathieu-Daudé switch (df) { 816a2b0a27dSPhilippe Mathieu-Daudé case DF_BYTE: 817a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_div_s_b(cpu_env, twd, tws, twt); 818a2b0a27dSPhilippe Mathieu-Daudé break; 819a2b0a27dSPhilippe Mathieu-Daudé case DF_HALF: 820a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_div_s_h(cpu_env, twd, tws, twt); 821a2b0a27dSPhilippe Mathieu-Daudé break; 822a2b0a27dSPhilippe Mathieu-Daudé case DF_WORD: 823a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_div_s_w(cpu_env, twd, tws, twt); 824a2b0a27dSPhilippe Mathieu-Daudé break; 825a2b0a27dSPhilippe Mathieu-Daudé case DF_DOUBLE: 826a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_div_s_d(cpu_env, twd, tws, twt); 827a2b0a27dSPhilippe Mathieu-Daudé break; 828a2b0a27dSPhilippe Mathieu-Daudé } 829a2b0a27dSPhilippe Mathieu-Daudé break; 830a2b0a27dSPhilippe Mathieu-Daudé case OPC_DIV_U_df: 831a2b0a27dSPhilippe Mathieu-Daudé switch (df) { 832a2b0a27dSPhilippe Mathieu-Daudé case DF_BYTE: 833a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_div_u_b(cpu_env, twd, tws, twt); 834a2b0a27dSPhilippe Mathieu-Daudé break; 835a2b0a27dSPhilippe Mathieu-Daudé case DF_HALF: 836a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_div_u_h(cpu_env, twd, tws, twt); 837a2b0a27dSPhilippe Mathieu-Daudé break; 838a2b0a27dSPhilippe Mathieu-Daudé case DF_WORD: 839a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_div_u_w(cpu_env, twd, tws, twt); 840a2b0a27dSPhilippe Mathieu-Daudé break; 841a2b0a27dSPhilippe Mathieu-Daudé case DF_DOUBLE: 842a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_div_u_d(cpu_env, twd, tws, twt); 843a2b0a27dSPhilippe Mathieu-Daudé break; 844a2b0a27dSPhilippe Mathieu-Daudé } 845a2b0a27dSPhilippe Mathieu-Daudé break; 846a2b0a27dSPhilippe Mathieu-Daudé case OPC_MAX_A_df: 847a2b0a27dSPhilippe Mathieu-Daudé switch (df) { 848a2b0a27dSPhilippe Mathieu-Daudé case DF_BYTE: 849a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_max_a_b(cpu_env, twd, tws, twt); 850a2b0a27dSPhilippe Mathieu-Daudé break; 851a2b0a27dSPhilippe Mathieu-Daudé case DF_HALF: 852a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_max_a_h(cpu_env, twd, tws, twt); 853a2b0a27dSPhilippe Mathieu-Daudé break; 854a2b0a27dSPhilippe Mathieu-Daudé case DF_WORD: 855a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_max_a_w(cpu_env, twd, tws, twt); 856a2b0a27dSPhilippe Mathieu-Daudé break; 857a2b0a27dSPhilippe Mathieu-Daudé case DF_DOUBLE: 858a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_max_a_d(cpu_env, twd, tws, twt); 859a2b0a27dSPhilippe Mathieu-Daudé break; 860a2b0a27dSPhilippe Mathieu-Daudé } 861a2b0a27dSPhilippe Mathieu-Daudé break; 862a2b0a27dSPhilippe Mathieu-Daudé case OPC_MAX_S_df: 863a2b0a27dSPhilippe Mathieu-Daudé switch (df) { 864a2b0a27dSPhilippe Mathieu-Daudé case DF_BYTE: 865a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_max_s_b(cpu_env, twd, tws, twt); 866a2b0a27dSPhilippe Mathieu-Daudé break; 867a2b0a27dSPhilippe Mathieu-Daudé case DF_HALF: 868a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_max_s_h(cpu_env, twd, tws, twt); 869a2b0a27dSPhilippe Mathieu-Daudé break; 870a2b0a27dSPhilippe Mathieu-Daudé case DF_WORD: 871a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_max_s_w(cpu_env, twd, tws, twt); 872a2b0a27dSPhilippe Mathieu-Daudé break; 873a2b0a27dSPhilippe Mathieu-Daudé case DF_DOUBLE: 874a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_max_s_d(cpu_env, twd, tws, twt); 875a2b0a27dSPhilippe Mathieu-Daudé break; 876a2b0a27dSPhilippe Mathieu-Daudé } 877a2b0a27dSPhilippe Mathieu-Daudé break; 878a2b0a27dSPhilippe Mathieu-Daudé case OPC_MAX_U_df: 879a2b0a27dSPhilippe Mathieu-Daudé switch (df) { 880a2b0a27dSPhilippe Mathieu-Daudé case DF_BYTE: 881a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_max_u_b(cpu_env, twd, tws, twt); 882a2b0a27dSPhilippe Mathieu-Daudé break; 883a2b0a27dSPhilippe Mathieu-Daudé case DF_HALF: 884a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_max_u_h(cpu_env, twd, tws, twt); 885a2b0a27dSPhilippe Mathieu-Daudé break; 886a2b0a27dSPhilippe Mathieu-Daudé case DF_WORD: 887a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_max_u_w(cpu_env, twd, tws, twt); 888a2b0a27dSPhilippe Mathieu-Daudé break; 889a2b0a27dSPhilippe Mathieu-Daudé case DF_DOUBLE: 890a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_max_u_d(cpu_env, twd, tws, twt); 891a2b0a27dSPhilippe Mathieu-Daudé break; 892a2b0a27dSPhilippe Mathieu-Daudé } 893a2b0a27dSPhilippe Mathieu-Daudé break; 894a2b0a27dSPhilippe Mathieu-Daudé case OPC_MIN_A_df: 895a2b0a27dSPhilippe Mathieu-Daudé switch (df) { 896a2b0a27dSPhilippe Mathieu-Daudé case DF_BYTE: 897a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_min_a_b(cpu_env, twd, tws, twt); 898a2b0a27dSPhilippe Mathieu-Daudé break; 899a2b0a27dSPhilippe Mathieu-Daudé case DF_HALF: 900a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_min_a_h(cpu_env, twd, tws, twt); 901a2b0a27dSPhilippe Mathieu-Daudé break; 902a2b0a27dSPhilippe Mathieu-Daudé case DF_WORD: 903a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_min_a_w(cpu_env, twd, tws, twt); 904a2b0a27dSPhilippe Mathieu-Daudé break; 905a2b0a27dSPhilippe Mathieu-Daudé case DF_DOUBLE: 906a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_min_a_d(cpu_env, twd, tws, twt); 907a2b0a27dSPhilippe Mathieu-Daudé break; 908a2b0a27dSPhilippe Mathieu-Daudé } 909a2b0a27dSPhilippe Mathieu-Daudé break; 910a2b0a27dSPhilippe Mathieu-Daudé case OPC_MIN_S_df: 911a2b0a27dSPhilippe Mathieu-Daudé switch (df) { 912a2b0a27dSPhilippe Mathieu-Daudé case DF_BYTE: 913a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_min_s_b(cpu_env, twd, tws, twt); 914a2b0a27dSPhilippe Mathieu-Daudé break; 915a2b0a27dSPhilippe Mathieu-Daudé case DF_HALF: 916a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_min_s_h(cpu_env, twd, tws, twt); 917a2b0a27dSPhilippe Mathieu-Daudé break; 918a2b0a27dSPhilippe Mathieu-Daudé case DF_WORD: 919a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_min_s_w(cpu_env, twd, tws, twt); 920a2b0a27dSPhilippe Mathieu-Daudé break; 921a2b0a27dSPhilippe Mathieu-Daudé case DF_DOUBLE: 922a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_min_s_d(cpu_env, twd, tws, twt); 923a2b0a27dSPhilippe Mathieu-Daudé break; 924a2b0a27dSPhilippe Mathieu-Daudé } 925a2b0a27dSPhilippe Mathieu-Daudé break; 926a2b0a27dSPhilippe Mathieu-Daudé case OPC_MIN_U_df: 927a2b0a27dSPhilippe Mathieu-Daudé switch (df) { 928a2b0a27dSPhilippe Mathieu-Daudé case DF_BYTE: 929a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_min_u_b(cpu_env, twd, tws, twt); 930a2b0a27dSPhilippe Mathieu-Daudé break; 931a2b0a27dSPhilippe Mathieu-Daudé case DF_HALF: 932a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_min_u_h(cpu_env, twd, tws, twt); 933a2b0a27dSPhilippe Mathieu-Daudé break; 934a2b0a27dSPhilippe Mathieu-Daudé case DF_WORD: 935a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_min_u_w(cpu_env, twd, tws, twt); 936a2b0a27dSPhilippe Mathieu-Daudé break; 937a2b0a27dSPhilippe Mathieu-Daudé case DF_DOUBLE: 938a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_min_u_d(cpu_env, twd, tws, twt); 939a2b0a27dSPhilippe Mathieu-Daudé break; 940a2b0a27dSPhilippe Mathieu-Daudé } 941a2b0a27dSPhilippe Mathieu-Daudé break; 942a2b0a27dSPhilippe Mathieu-Daudé case OPC_MOD_S_df: 943a2b0a27dSPhilippe Mathieu-Daudé switch (df) { 944a2b0a27dSPhilippe Mathieu-Daudé case DF_BYTE: 945a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_mod_s_b(cpu_env, twd, tws, twt); 946a2b0a27dSPhilippe Mathieu-Daudé break; 947a2b0a27dSPhilippe Mathieu-Daudé case DF_HALF: 948a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_mod_s_h(cpu_env, twd, tws, twt); 949a2b0a27dSPhilippe Mathieu-Daudé break; 950a2b0a27dSPhilippe Mathieu-Daudé case DF_WORD: 951a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_mod_s_w(cpu_env, twd, tws, twt); 952a2b0a27dSPhilippe Mathieu-Daudé break; 953a2b0a27dSPhilippe Mathieu-Daudé case DF_DOUBLE: 954a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_mod_s_d(cpu_env, twd, tws, twt); 955a2b0a27dSPhilippe Mathieu-Daudé break; 956a2b0a27dSPhilippe Mathieu-Daudé } 957a2b0a27dSPhilippe Mathieu-Daudé break; 958a2b0a27dSPhilippe Mathieu-Daudé case OPC_MOD_U_df: 959a2b0a27dSPhilippe Mathieu-Daudé switch (df) { 960a2b0a27dSPhilippe Mathieu-Daudé case DF_BYTE: 961a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_mod_u_b(cpu_env, twd, tws, twt); 962a2b0a27dSPhilippe Mathieu-Daudé break; 963a2b0a27dSPhilippe Mathieu-Daudé case DF_HALF: 964a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_mod_u_h(cpu_env, twd, tws, twt); 965a2b0a27dSPhilippe Mathieu-Daudé break; 966a2b0a27dSPhilippe Mathieu-Daudé case DF_WORD: 967a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_mod_u_w(cpu_env, twd, tws, twt); 968a2b0a27dSPhilippe Mathieu-Daudé break; 969a2b0a27dSPhilippe Mathieu-Daudé case DF_DOUBLE: 970a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_mod_u_d(cpu_env, twd, tws, twt); 971a2b0a27dSPhilippe Mathieu-Daudé break; 972a2b0a27dSPhilippe Mathieu-Daudé } 973a2b0a27dSPhilippe Mathieu-Daudé break; 974a2b0a27dSPhilippe Mathieu-Daudé case OPC_MADDV_df: 975a2b0a27dSPhilippe Mathieu-Daudé switch (df) { 976a2b0a27dSPhilippe Mathieu-Daudé case DF_BYTE: 977a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_maddv_b(cpu_env, twd, tws, twt); 978a2b0a27dSPhilippe Mathieu-Daudé break; 979a2b0a27dSPhilippe Mathieu-Daudé case DF_HALF: 980a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_maddv_h(cpu_env, twd, tws, twt); 981a2b0a27dSPhilippe Mathieu-Daudé break; 982a2b0a27dSPhilippe Mathieu-Daudé case DF_WORD: 983a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_maddv_w(cpu_env, twd, tws, twt); 984a2b0a27dSPhilippe Mathieu-Daudé break; 985a2b0a27dSPhilippe Mathieu-Daudé case DF_DOUBLE: 986a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_maddv_d(cpu_env, twd, tws, twt); 987a2b0a27dSPhilippe Mathieu-Daudé break; 988a2b0a27dSPhilippe Mathieu-Daudé } 989a2b0a27dSPhilippe Mathieu-Daudé break; 990a2b0a27dSPhilippe Mathieu-Daudé case OPC_MSUBV_df: 991a2b0a27dSPhilippe Mathieu-Daudé switch (df) { 992a2b0a27dSPhilippe Mathieu-Daudé case DF_BYTE: 993a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_msubv_b(cpu_env, twd, tws, twt); 994a2b0a27dSPhilippe Mathieu-Daudé break; 995a2b0a27dSPhilippe Mathieu-Daudé case DF_HALF: 996a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_msubv_h(cpu_env, twd, tws, twt); 997a2b0a27dSPhilippe Mathieu-Daudé break; 998a2b0a27dSPhilippe Mathieu-Daudé case DF_WORD: 999a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_msubv_w(cpu_env, twd, tws, twt); 1000a2b0a27dSPhilippe Mathieu-Daudé break; 1001a2b0a27dSPhilippe Mathieu-Daudé case DF_DOUBLE: 1002a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_msubv_d(cpu_env, twd, tws, twt); 1003a2b0a27dSPhilippe Mathieu-Daudé break; 1004a2b0a27dSPhilippe Mathieu-Daudé } 1005a2b0a27dSPhilippe Mathieu-Daudé break; 1006a2b0a27dSPhilippe Mathieu-Daudé case OPC_ASUB_S_df: 1007a2b0a27dSPhilippe Mathieu-Daudé switch (df) { 1008a2b0a27dSPhilippe Mathieu-Daudé case DF_BYTE: 1009a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_asub_s_b(cpu_env, twd, tws, twt); 1010a2b0a27dSPhilippe Mathieu-Daudé break; 1011a2b0a27dSPhilippe Mathieu-Daudé case DF_HALF: 1012a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_asub_s_h(cpu_env, twd, tws, twt); 1013a2b0a27dSPhilippe Mathieu-Daudé break; 1014a2b0a27dSPhilippe Mathieu-Daudé case DF_WORD: 1015a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_asub_s_w(cpu_env, twd, tws, twt); 1016a2b0a27dSPhilippe Mathieu-Daudé break; 1017a2b0a27dSPhilippe Mathieu-Daudé case DF_DOUBLE: 1018a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_asub_s_d(cpu_env, twd, tws, twt); 1019a2b0a27dSPhilippe Mathieu-Daudé break; 1020a2b0a27dSPhilippe Mathieu-Daudé } 1021a2b0a27dSPhilippe Mathieu-Daudé break; 1022a2b0a27dSPhilippe Mathieu-Daudé case OPC_ASUB_U_df: 1023a2b0a27dSPhilippe Mathieu-Daudé switch (df) { 1024a2b0a27dSPhilippe Mathieu-Daudé case DF_BYTE: 1025a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_asub_u_b(cpu_env, twd, tws, twt); 1026a2b0a27dSPhilippe Mathieu-Daudé break; 1027a2b0a27dSPhilippe Mathieu-Daudé case DF_HALF: 1028a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_asub_u_h(cpu_env, twd, tws, twt); 1029a2b0a27dSPhilippe Mathieu-Daudé break; 1030a2b0a27dSPhilippe Mathieu-Daudé case DF_WORD: 1031a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_asub_u_w(cpu_env, twd, tws, twt); 1032a2b0a27dSPhilippe Mathieu-Daudé break; 1033a2b0a27dSPhilippe Mathieu-Daudé case DF_DOUBLE: 1034a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_asub_u_d(cpu_env, twd, tws, twt); 1035a2b0a27dSPhilippe Mathieu-Daudé break; 1036a2b0a27dSPhilippe Mathieu-Daudé } 1037a2b0a27dSPhilippe Mathieu-Daudé break; 1038a2b0a27dSPhilippe Mathieu-Daudé case OPC_ILVEV_df: 1039a2b0a27dSPhilippe Mathieu-Daudé switch (df) { 1040a2b0a27dSPhilippe Mathieu-Daudé case DF_BYTE: 1041a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_ilvev_b(cpu_env, twd, tws, twt); 1042a2b0a27dSPhilippe Mathieu-Daudé break; 1043a2b0a27dSPhilippe Mathieu-Daudé case DF_HALF: 1044a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_ilvev_h(cpu_env, twd, tws, twt); 1045a2b0a27dSPhilippe Mathieu-Daudé break; 1046a2b0a27dSPhilippe Mathieu-Daudé case DF_WORD: 1047a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_ilvev_w(cpu_env, twd, tws, twt); 1048a2b0a27dSPhilippe Mathieu-Daudé break; 1049a2b0a27dSPhilippe Mathieu-Daudé case DF_DOUBLE: 1050a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_ilvev_d(cpu_env, twd, tws, twt); 1051a2b0a27dSPhilippe Mathieu-Daudé break; 1052a2b0a27dSPhilippe Mathieu-Daudé } 1053a2b0a27dSPhilippe Mathieu-Daudé break; 1054a2b0a27dSPhilippe Mathieu-Daudé case OPC_ILVOD_df: 1055a2b0a27dSPhilippe Mathieu-Daudé switch (df) { 1056a2b0a27dSPhilippe Mathieu-Daudé case DF_BYTE: 1057a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_ilvod_b(cpu_env, twd, tws, twt); 1058a2b0a27dSPhilippe Mathieu-Daudé break; 1059a2b0a27dSPhilippe Mathieu-Daudé case DF_HALF: 1060a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_ilvod_h(cpu_env, twd, tws, twt); 1061a2b0a27dSPhilippe Mathieu-Daudé break; 1062a2b0a27dSPhilippe Mathieu-Daudé case DF_WORD: 1063a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_ilvod_w(cpu_env, twd, tws, twt); 1064a2b0a27dSPhilippe Mathieu-Daudé break; 1065a2b0a27dSPhilippe Mathieu-Daudé case DF_DOUBLE: 1066a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_ilvod_d(cpu_env, twd, tws, twt); 1067a2b0a27dSPhilippe Mathieu-Daudé break; 1068a2b0a27dSPhilippe Mathieu-Daudé } 1069a2b0a27dSPhilippe Mathieu-Daudé break; 1070a2b0a27dSPhilippe Mathieu-Daudé case OPC_ILVL_df: 1071a2b0a27dSPhilippe Mathieu-Daudé switch (df) { 1072a2b0a27dSPhilippe Mathieu-Daudé case DF_BYTE: 1073a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_ilvl_b(cpu_env, twd, tws, twt); 1074a2b0a27dSPhilippe Mathieu-Daudé break; 1075a2b0a27dSPhilippe Mathieu-Daudé case DF_HALF: 1076a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_ilvl_h(cpu_env, twd, tws, twt); 1077a2b0a27dSPhilippe Mathieu-Daudé break; 1078a2b0a27dSPhilippe Mathieu-Daudé case DF_WORD: 1079a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_ilvl_w(cpu_env, twd, tws, twt); 1080a2b0a27dSPhilippe Mathieu-Daudé break; 1081a2b0a27dSPhilippe Mathieu-Daudé case DF_DOUBLE: 1082a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_ilvl_d(cpu_env, twd, tws, twt); 1083a2b0a27dSPhilippe Mathieu-Daudé break; 1084a2b0a27dSPhilippe Mathieu-Daudé } 1085a2b0a27dSPhilippe Mathieu-Daudé break; 1086a2b0a27dSPhilippe Mathieu-Daudé case OPC_ILVR_df: 1087a2b0a27dSPhilippe Mathieu-Daudé switch (df) { 1088a2b0a27dSPhilippe Mathieu-Daudé case DF_BYTE: 1089a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_ilvr_b(cpu_env, twd, tws, twt); 1090a2b0a27dSPhilippe Mathieu-Daudé break; 1091a2b0a27dSPhilippe Mathieu-Daudé case DF_HALF: 1092a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_ilvr_h(cpu_env, twd, tws, twt); 1093a2b0a27dSPhilippe Mathieu-Daudé break; 1094a2b0a27dSPhilippe Mathieu-Daudé case DF_WORD: 1095a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_ilvr_w(cpu_env, twd, tws, twt); 1096a2b0a27dSPhilippe Mathieu-Daudé break; 1097a2b0a27dSPhilippe Mathieu-Daudé case DF_DOUBLE: 1098a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_ilvr_d(cpu_env, twd, tws, twt); 1099a2b0a27dSPhilippe Mathieu-Daudé break; 1100a2b0a27dSPhilippe Mathieu-Daudé } 1101a2b0a27dSPhilippe Mathieu-Daudé break; 1102a2b0a27dSPhilippe Mathieu-Daudé case OPC_PCKEV_df: 1103a2b0a27dSPhilippe Mathieu-Daudé switch (df) { 1104a2b0a27dSPhilippe Mathieu-Daudé case DF_BYTE: 1105a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_pckev_b(cpu_env, twd, tws, twt); 1106a2b0a27dSPhilippe Mathieu-Daudé break; 1107a2b0a27dSPhilippe Mathieu-Daudé case DF_HALF: 1108a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_pckev_h(cpu_env, twd, tws, twt); 1109a2b0a27dSPhilippe Mathieu-Daudé break; 1110a2b0a27dSPhilippe Mathieu-Daudé case DF_WORD: 1111a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_pckev_w(cpu_env, twd, tws, twt); 1112a2b0a27dSPhilippe Mathieu-Daudé break; 1113a2b0a27dSPhilippe Mathieu-Daudé case DF_DOUBLE: 1114a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_pckev_d(cpu_env, twd, tws, twt); 1115a2b0a27dSPhilippe Mathieu-Daudé break; 1116a2b0a27dSPhilippe Mathieu-Daudé } 1117a2b0a27dSPhilippe Mathieu-Daudé break; 1118a2b0a27dSPhilippe Mathieu-Daudé case OPC_PCKOD_df: 1119a2b0a27dSPhilippe Mathieu-Daudé switch (df) { 1120a2b0a27dSPhilippe Mathieu-Daudé case DF_BYTE: 1121a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_pckod_b(cpu_env, twd, tws, twt); 1122a2b0a27dSPhilippe Mathieu-Daudé break; 1123a2b0a27dSPhilippe Mathieu-Daudé case DF_HALF: 1124a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_pckod_h(cpu_env, twd, tws, twt); 1125a2b0a27dSPhilippe Mathieu-Daudé break; 1126a2b0a27dSPhilippe Mathieu-Daudé case DF_WORD: 1127a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_pckod_w(cpu_env, twd, tws, twt); 1128a2b0a27dSPhilippe Mathieu-Daudé break; 1129a2b0a27dSPhilippe Mathieu-Daudé case DF_DOUBLE: 1130a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_pckod_d(cpu_env, twd, tws, twt); 1131a2b0a27dSPhilippe Mathieu-Daudé break; 1132a2b0a27dSPhilippe Mathieu-Daudé } 1133a2b0a27dSPhilippe Mathieu-Daudé break; 1134a2b0a27dSPhilippe Mathieu-Daudé case OPC_SLL_df: 1135a2b0a27dSPhilippe Mathieu-Daudé switch (df) { 1136a2b0a27dSPhilippe Mathieu-Daudé case DF_BYTE: 1137a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_sll_b(cpu_env, twd, tws, twt); 1138a2b0a27dSPhilippe Mathieu-Daudé break; 1139a2b0a27dSPhilippe Mathieu-Daudé case DF_HALF: 1140a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_sll_h(cpu_env, twd, tws, twt); 1141a2b0a27dSPhilippe Mathieu-Daudé break; 1142a2b0a27dSPhilippe Mathieu-Daudé case DF_WORD: 1143a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_sll_w(cpu_env, twd, tws, twt); 1144a2b0a27dSPhilippe Mathieu-Daudé break; 1145a2b0a27dSPhilippe Mathieu-Daudé case DF_DOUBLE: 1146a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_sll_d(cpu_env, twd, tws, twt); 1147a2b0a27dSPhilippe Mathieu-Daudé break; 1148a2b0a27dSPhilippe Mathieu-Daudé } 1149a2b0a27dSPhilippe Mathieu-Daudé break; 1150a2b0a27dSPhilippe Mathieu-Daudé case OPC_SRA_df: 1151a2b0a27dSPhilippe Mathieu-Daudé switch (df) { 1152a2b0a27dSPhilippe Mathieu-Daudé case DF_BYTE: 1153a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_sra_b(cpu_env, twd, tws, twt); 1154a2b0a27dSPhilippe Mathieu-Daudé break; 1155a2b0a27dSPhilippe Mathieu-Daudé case DF_HALF: 1156a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_sra_h(cpu_env, twd, tws, twt); 1157a2b0a27dSPhilippe Mathieu-Daudé break; 1158a2b0a27dSPhilippe Mathieu-Daudé case DF_WORD: 1159a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_sra_w(cpu_env, twd, tws, twt); 1160a2b0a27dSPhilippe Mathieu-Daudé break; 1161a2b0a27dSPhilippe Mathieu-Daudé case DF_DOUBLE: 1162a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_sra_d(cpu_env, twd, tws, twt); 1163a2b0a27dSPhilippe Mathieu-Daudé break; 1164a2b0a27dSPhilippe Mathieu-Daudé } 1165a2b0a27dSPhilippe Mathieu-Daudé break; 1166a2b0a27dSPhilippe Mathieu-Daudé case OPC_SRAR_df: 1167a2b0a27dSPhilippe Mathieu-Daudé switch (df) { 1168a2b0a27dSPhilippe Mathieu-Daudé case DF_BYTE: 1169a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_srar_b(cpu_env, twd, tws, twt); 1170a2b0a27dSPhilippe Mathieu-Daudé break; 1171a2b0a27dSPhilippe Mathieu-Daudé case DF_HALF: 1172a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_srar_h(cpu_env, twd, tws, twt); 1173a2b0a27dSPhilippe Mathieu-Daudé break; 1174a2b0a27dSPhilippe Mathieu-Daudé case DF_WORD: 1175a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_srar_w(cpu_env, twd, tws, twt); 1176a2b0a27dSPhilippe Mathieu-Daudé break; 1177a2b0a27dSPhilippe Mathieu-Daudé case DF_DOUBLE: 1178a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_srar_d(cpu_env, twd, tws, twt); 1179a2b0a27dSPhilippe Mathieu-Daudé break; 1180a2b0a27dSPhilippe Mathieu-Daudé } 1181a2b0a27dSPhilippe Mathieu-Daudé break; 1182a2b0a27dSPhilippe Mathieu-Daudé case OPC_SRL_df: 1183a2b0a27dSPhilippe Mathieu-Daudé switch (df) { 1184a2b0a27dSPhilippe Mathieu-Daudé case DF_BYTE: 1185a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_srl_b(cpu_env, twd, tws, twt); 1186a2b0a27dSPhilippe Mathieu-Daudé break; 1187a2b0a27dSPhilippe Mathieu-Daudé case DF_HALF: 1188a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_srl_h(cpu_env, twd, tws, twt); 1189a2b0a27dSPhilippe Mathieu-Daudé break; 1190a2b0a27dSPhilippe Mathieu-Daudé case DF_WORD: 1191a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_srl_w(cpu_env, twd, tws, twt); 1192a2b0a27dSPhilippe Mathieu-Daudé break; 1193a2b0a27dSPhilippe Mathieu-Daudé case DF_DOUBLE: 1194a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_srl_d(cpu_env, twd, tws, twt); 1195a2b0a27dSPhilippe Mathieu-Daudé break; 1196a2b0a27dSPhilippe Mathieu-Daudé } 1197a2b0a27dSPhilippe Mathieu-Daudé break; 1198a2b0a27dSPhilippe Mathieu-Daudé case OPC_SRLR_df: 1199a2b0a27dSPhilippe Mathieu-Daudé switch (df) { 1200a2b0a27dSPhilippe Mathieu-Daudé case DF_BYTE: 1201a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_srlr_b(cpu_env, twd, tws, twt); 1202a2b0a27dSPhilippe Mathieu-Daudé break; 1203a2b0a27dSPhilippe Mathieu-Daudé case DF_HALF: 1204a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_srlr_h(cpu_env, twd, tws, twt); 1205a2b0a27dSPhilippe Mathieu-Daudé break; 1206a2b0a27dSPhilippe Mathieu-Daudé case DF_WORD: 1207a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_srlr_w(cpu_env, twd, tws, twt); 1208a2b0a27dSPhilippe Mathieu-Daudé break; 1209a2b0a27dSPhilippe Mathieu-Daudé case DF_DOUBLE: 1210a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_srlr_d(cpu_env, twd, tws, twt); 1211a2b0a27dSPhilippe Mathieu-Daudé break; 1212a2b0a27dSPhilippe Mathieu-Daudé } 1213a2b0a27dSPhilippe Mathieu-Daudé break; 1214a2b0a27dSPhilippe Mathieu-Daudé case OPC_SUBS_S_df: 1215a2b0a27dSPhilippe Mathieu-Daudé switch (df) { 1216a2b0a27dSPhilippe Mathieu-Daudé case DF_BYTE: 1217a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_subs_s_b(cpu_env, twd, tws, twt); 1218a2b0a27dSPhilippe Mathieu-Daudé break; 1219a2b0a27dSPhilippe Mathieu-Daudé case DF_HALF: 1220a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_subs_s_h(cpu_env, twd, tws, twt); 1221a2b0a27dSPhilippe Mathieu-Daudé break; 1222a2b0a27dSPhilippe Mathieu-Daudé case DF_WORD: 1223a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_subs_s_w(cpu_env, twd, tws, twt); 1224a2b0a27dSPhilippe Mathieu-Daudé break; 1225a2b0a27dSPhilippe Mathieu-Daudé case DF_DOUBLE: 1226a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_subs_s_d(cpu_env, twd, tws, twt); 1227a2b0a27dSPhilippe Mathieu-Daudé break; 1228a2b0a27dSPhilippe Mathieu-Daudé } 1229a2b0a27dSPhilippe Mathieu-Daudé break; 1230a2b0a27dSPhilippe Mathieu-Daudé case OPC_MULV_df: 1231a2b0a27dSPhilippe Mathieu-Daudé switch (df) { 1232a2b0a27dSPhilippe Mathieu-Daudé case DF_BYTE: 1233a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_mulv_b(cpu_env, twd, tws, twt); 1234a2b0a27dSPhilippe Mathieu-Daudé break; 1235a2b0a27dSPhilippe Mathieu-Daudé case DF_HALF: 1236a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_mulv_h(cpu_env, twd, tws, twt); 1237a2b0a27dSPhilippe Mathieu-Daudé break; 1238a2b0a27dSPhilippe Mathieu-Daudé case DF_WORD: 1239a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_mulv_w(cpu_env, twd, tws, twt); 1240a2b0a27dSPhilippe Mathieu-Daudé break; 1241a2b0a27dSPhilippe Mathieu-Daudé case DF_DOUBLE: 1242a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_mulv_d(cpu_env, twd, tws, twt); 1243a2b0a27dSPhilippe Mathieu-Daudé break; 1244a2b0a27dSPhilippe Mathieu-Daudé } 1245a2b0a27dSPhilippe Mathieu-Daudé break; 1246a2b0a27dSPhilippe Mathieu-Daudé case OPC_SUBV_df: 1247a2b0a27dSPhilippe Mathieu-Daudé switch (df) { 1248a2b0a27dSPhilippe Mathieu-Daudé case DF_BYTE: 1249a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_subv_b(cpu_env, twd, tws, twt); 1250a2b0a27dSPhilippe Mathieu-Daudé break; 1251a2b0a27dSPhilippe Mathieu-Daudé case DF_HALF: 1252a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_subv_h(cpu_env, twd, tws, twt); 1253a2b0a27dSPhilippe Mathieu-Daudé break; 1254a2b0a27dSPhilippe Mathieu-Daudé case DF_WORD: 1255a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_subv_w(cpu_env, twd, tws, twt); 1256a2b0a27dSPhilippe Mathieu-Daudé break; 1257a2b0a27dSPhilippe Mathieu-Daudé case DF_DOUBLE: 1258a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_subv_d(cpu_env, twd, tws, twt); 1259a2b0a27dSPhilippe Mathieu-Daudé break; 1260a2b0a27dSPhilippe Mathieu-Daudé } 1261a2b0a27dSPhilippe Mathieu-Daudé break; 1262a2b0a27dSPhilippe Mathieu-Daudé case OPC_SUBS_U_df: 1263a2b0a27dSPhilippe Mathieu-Daudé switch (df) { 1264a2b0a27dSPhilippe Mathieu-Daudé case DF_BYTE: 1265a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_subs_u_b(cpu_env, twd, tws, twt); 1266a2b0a27dSPhilippe Mathieu-Daudé break; 1267a2b0a27dSPhilippe Mathieu-Daudé case DF_HALF: 1268a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_subs_u_h(cpu_env, twd, tws, twt); 1269a2b0a27dSPhilippe Mathieu-Daudé break; 1270a2b0a27dSPhilippe Mathieu-Daudé case DF_WORD: 1271a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_subs_u_w(cpu_env, twd, tws, twt); 1272a2b0a27dSPhilippe Mathieu-Daudé break; 1273a2b0a27dSPhilippe Mathieu-Daudé case DF_DOUBLE: 1274a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_subs_u_d(cpu_env, twd, tws, twt); 1275a2b0a27dSPhilippe Mathieu-Daudé break; 1276a2b0a27dSPhilippe Mathieu-Daudé } 1277a2b0a27dSPhilippe Mathieu-Daudé break; 1278a2b0a27dSPhilippe Mathieu-Daudé case OPC_SUBSUS_U_df: 1279a2b0a27dSPhilippe Mathieu-Daudé switch (df) { 1280a2b0a27dSPhilippe Mathieu-Daudé case DF_BYTE: 1281a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_subsus_u_b(cpu_env, twd, tws, twt); 1282a2b0a27dSPhilippe Mathieu-Daudé break; 1283a2b0a27dSPhilippe Mathieu-Daudé case DF_HALF: 1284a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_subsus_u_h(cpu_env, twd, tws, twt); 1285a2b0a27dSPhilippe Mathieu-Daudé break; 1286a2b0a27dSPhilippe Mathieu-Daudé case DF_WORD: 1287a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_subsus_u_w(cpu_env, twd, tws, twt); 1288a2b0a27dSPhilippe Mathieu-Daudé break; 1289a2b0a27dSPhilippe Mathieu-Daudé case DF_DOUBLE: 1290a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_subsus_u_d(cpu_env, twd, tws, twt); 1291a2b0a27dSPhilippe Mathieu-Daudé break; 1292a2b0a27dSPhilippe Mathieu-Daudé } 1293a2b0a27dSPhilippe Mathieu-Daudé break; 1294a2b0a27dSPhilippe Mathieu-Daudé case OPC_SUBSUU_S_df: 1295a2b0a27dSPhilippe Mathieu-Daudé switch (df) { 1296a2b0a27dSPhilippe Mathieu-Daudé case DF_BYTE: 1297a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_subsuu_s_b(cpu_env, twd, tws, twt); 1298a2b0a27dSPhilippe Mathieu-Daudé break; 1299a2b0a27dSPhilippe Mathieu-Daudé case DF_HALF: 1300a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_subsuu_s_h(cpu_env, twd, tws, twt); 1301a2b0a27dSPhilippe Mathieu-Daudé break; 1302a2b0a27dSPhilippe Mathieu-Daudé case DF_WORD: 1303a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_subsuu_s_w(cpu_env, twd, tws, twt); 1304a2b0a27dSPhilippe Mathieu-Daudé break; 1305a2b0a27dSPhilippe Mathieu-Daudé case DF_DOUBLE: 1306a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_subsuu_s_d(cpu_env, twd, tws, twt); 1307a2b0a27dSPhilippe Mathieu-Daudé break; 1308a2b0a27dSPhilippe Mathieu-Daudé } 1309a2b0a27dSPhilippe Mathieu-Daudé break; 1310a2b0a27dSPhilippe Mathieu-Daudé default: 1311a2b0a27dSPhilippe Mathieu-Daudé MIPS_INVAL("MSA instruction"); 1312a2b0a27dSPhilippe Mathieu-Daudé gen_reserved_instruction(ctx); 1313a2b0a27dSPhilippe Mathieu-Daudé break; 1314a2b0a27dSPhilippe Mathieu-Daudé } 1315a2b0a27dSPhilippe Mathieu-Daudé tcg_temp_free_i32(twd); 1316a2b0a27dSPhilippe Mathieu-Daudé tcg_temp_free_i32(tws); 1317a2b0a27dSPhilippe Mathieu-Daudé tcg_temp_free_i32(twt); 1318a2b0a27dSPhilippe Mathieu-Daudé tcg_temp_free_i32(tdf); 1319a2b0a27dSPhilippe Mathieu-Daudé } 1320a2b0a27dSPhilippe Mathieu-Daudé 1321a2b0a27dSPhilippe Mathieu-Daudé static void gen_msa_elm_3e(DisasContext *ctx) 1322a2b0a27dSPhilippe Mathieu-Daudé { 1323a2b0a27dSPhilippe Mathieu-Daudé #define MASK_MSA_ELM_DF3E(op) (MASK_MSA_MINOR(op) | (op & (0x3FF << 16))) 1324a2b0a27dSPhilippe Mathieu-Daudé uint8_t source = (ctx->opcode >> 11) & 0x1f; 1325a2b0a27dSPhilippe Mathieu-Daudé uint8_t dest = (ctx->opcode >> 6) & 0x1f; 1326a2b0a27dSPhilippe Mathieu-Daudé TCGv telm = tcg_temp_new(); 1327a2b0a27dSPhilippe Mathieu-Daudé TCGv_i32 tsr = tcg_const_i32(source); 1328a2b0a27dSPhilippe Mathieu-Daudé TCGv_i32 tdt = tcg_const_i32(dest); 1329a2b0a27dSPhilippe Mathieu-Daudé 1330a2b0a27dSPhilippe Mathieu-Daudé switch (MASK_MSA_ELM_DF3E(ctx->opcode)) { 1331a2b0a27dSPhilippe Mathieu-Daudé case OPC_CTCMSA: 1332a2b0a27dSPhilippe Mathieu-Daudé gen_load_gpr(telm, source); 1333a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_ctcmsa(cpu_env, telm, tdt); 1334a2b0a27dSPhilippe Mathieu-Daudé break; 1335a2b0a27dSPhilippe Mathieu-Daudé case OPC_CFCMSA: 1336a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_cfcmsa(telm, cpu_env, tsr); 1337a2b0a27dSPhilippe Mathieu-Daudé gen_store_gpr(telm, dest); 1338a2b0a27dSPhilippe Mathieu-Daudé break; 1339a2b0a27dSPhilippe Mathieu-Daudé case OPC_MOVE_V: 1340a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_move_v(cpu_env, tdt, tsr); 1341a2b0a27dSPhilippe Mathieu-Daudé break; 1342a2b0a27dSPhilippe Mathieu-Daudé default: 1343a2b0a27dSPhilippe Mathieu-Daudé MIPS_INVAL("MSA instruction"); 1344a2b0a27dSPhilippe Mathieu-Daudé gen_reserved_instruction(ctx); 1345a2b0a27dSPhilippe Mathieu-Daudé break; 1346a2b0a27dSPhilippe Mathieu-Daudé } 1347a2b0a27dSPhilippe Mathieu-Daudé 1348a2b0a27dSPhilippe Mathieu-Daudé tcg_temp_free(telm); 1349a2b0a27dSPhilippe Mathieu-Daudé tcg_temp_free_i32(tdt); 1350a2b0a27dSPhilippe Mathieu-Daudé tcg_temp_free_i32(tsr); 1351a2b0a27dSPhilippe Mathieu-Daudé } 1352a2b0a27dSPhilippe Mathieu-Daudé 1353a2b0a27dSPhilippe Mathieu-Daudé static void gen_msa_elm_df(DisasContext *ctx, uint32_t df, uint32_t n) 1354a2b0a27dSPhilippe Mathieu-Daudé { 1355a2b0a27dSPhilippe Mathieu-Daudé #define MASK_MSA_ELM(op) (MASK_MSA_MINOR(op) | (op & (0xf << 22))) 1356a2b0a27dSPhilippe Mathieu-Daudé uint8_t ws = (ctx->opcode >> 11) & 0x1f; 1357a2b0a27dSPhilippe Mathieu-Daudé uint8_t wd = (ctx->opcode >> 6) & 0x1f; 1358a2b0a27dSPhilippe Mathieu-Daudé 1359a2b0a27dSPhilippe Mathieu-Daudé TCGv_i32 tws = tcg_const_i32(ws); 1360a2b0a27dSPhilippe Mathieu-Daudé TCGv_i32 twd = tcg_const_i32(wd); 1361a2b0a27dSPhilippe Mathieu-Daudé TCGv_i32 tn = tcg_const_i32(n); 13622b537a3dSPhilippe Mathieu-Daudé TCGv_i32 tdf = tcg_constant_i32(df); 1363a2b0a27dSPhilippe Mathieu-Daudé 1364a2b0a27dSPhilippe Mathieu-Daudé switch (MASK_MSA_ELM(ctx->opcode)) { 1365a2b0a27dSPhilippe Mathieu-Daudé case OPC_SLDI_df: 1366a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_sldi_df(cpu_env, tdf, twd, tws, tn); 1367a2b0a27dSPhilippe Mathieu-Daudé break; 1368a2b0a27dSPhilippe Mathieu-Daudé case OPC_SPLATI_df: 1369a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_splati_df(cpu_env, tdf, twd, tws, tn); 1370a2b0a27dSPhilippe Mathieu-Daudé break; 1371a2b0a27dSPhilippe Mathieu-Daudé case OPC_INSVE_df: 1372a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_insve_df(cpu_env, tdf, twd, tws, tn); 1373a2b0a27dSPhilippe Mathieu-Daudé break; 1374a2b0a27dSPhilippe Mathieu-Daudé case OPC_COPY_S_df: 1375a2b0a27dSPhilippe Mathieu-Daudé case OPC_COPY_U_df: 1376a2b0a27dSPhilippe Mathieu-Daudé case OPC_INSERT_df: 1377a2b0a27dSPhilippe Mathieu-Daudé #if !defined(TARGET_MIPS64) 1378a2b0a27dSPhilippe Mathieu-Daudé /* Double format valid only for MIPS64 */ 1379a2b0a27dSPhilippe Mathieu-Daudé if (df == DF_DOUBLE) { 1380a2b0a27dSPhilippe Mathieu-Daudé gen_reserved_instruction(ctx); 1381a2b0a27dSPhilippe Mathieu-Daudé break; 1382a2b0a27dSPhilippe Mathieu-Daudé } 1383a2b0a27dSPhilippe Mathieu-Daudé if ((MASK_MSA_ELM(ctx->opcode) == OPC_COPY_U_df) && 1384a2b0a27dSPhilippe Mathieu-Daudé (df == DF_WORD)) { 1385a2b0a27dSPhilippe Mathieu-Daudé gen_reserved_instruction(ctx); 1386a2b0a27dSPhilippe Mathieu-Daudé break; 1387a2b0a27dSPhilippe Mathieu-Daudé } 1388a2b0a27dSPhilippe Mathieu-Daudé #endif 1389a2b0a27dSPhilippe Mathieu-Daudé switch (MASK_MSA_ELM(ctx->opcode)) { 1390a2b0a27dSPhilippe Mathieu-Daudé case OPC_COPY_S_df: 1391a2b0a27dSPhilippe Mathieu-Daudé if (likely(wd != 0)) { 1392a2b0a27dSPhilippe Mathieu-Daudé switch (df) { 1393a2b0a27dSPhilippe Mathieu-Daudé case DF_BYTE: 1394a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_copy_s_b(cpu_env, twd, tws, tn); 1395a2b0a27dSPhilippe Mathieu-Daudé break; 1396a2b0a27dSPhilippe Mathieu-Daudé case DF_HALF: 1397a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_copy_s_h(cpu_env, twd, tws, tn); 1398a2b0a27dSPhilippe Mathieu-Daudé break; 1399a2b0a27dSPhilippe Mathieu-Daudé case DF_WORD: 1400a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_copy_s_w(cpu_env, twd, tws, tn); 1401a2b0a27dSPhilippe Mathieu-Daudé break; 1402a2b0a27dSPhilippe Mathieu-Daudé #if defined(TARGET_MIPS64) 1403a2b0a27dSPhilippe Mathieu-Daudé case DF_DOUBLE: 1404a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_copy_s_d(cpu_env, twd, tws, tn); 1405a2b0a27dSPhilippe Mathieu-Daudé break; 1406a2b0a27dSPhilippe Mathieu-Daudé #endif 1407a2b0a27dSPhilippe Mathieu-Daudé default: 1408a2b0a27dSPhilippe Mathieu-Daudé assert(0); 1409a2b0a27dSPhilippe Mathieu-Daudé } 1410a2b0a27dSPhilippe Mathieu-Daudé } 1411a2b0a27dSPhilippe Mathieu-Daudé break; 1412a2b0a27dSPhilippe Mathieu-Daudé case OPC_COPY_U_df: 1413a2b0a27dSPhilippe Mathieu-Daudé if (likely(wd != 0)) { 1414a2b0a27dSPhilippe Mathieu-Daudé switch (df) { 1415a2b0a27dSPhilippe Mathieu-Daudé case DF_BYTE: 1416a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_copy_u_b(cpu_env, twd, tws, tn); 1417a2b0a27dSPhilippe Mathieu-Daudé break; 1418a2b0a27dSPhilippe Mathieu-Daudé case DF_HALF: 1419a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_copy_u_h(cpu_env, twd, tws, tn); 1420a2b0a27dSPhilippe Mathieu-Daudé break; 1421a2b0a27dSPhilippe Mathieu-Daudé #if defined(TARGET_MIPS64) 1422a2b0a27dSPhilippe Mathieu-Daudé case DF_WORD: 1423a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_copy_u_w(cpu_env, twd, tws, tn); 1424a2b0a27dSPhilippe Mathieu-Daudé break; 1425a2b0a27dSPhilippe Mathieu-Daudé #endif 1426a2b0a27dSPhilippe Mathieu-Daudé default: 1427a2b0a27dSPhilippe Mathieu-Daudé assert(0); 1428a2b0a27dSPhilippe Mathieu-Daudé } 1429a2b0a27dSPhilippe Mathieu-Daudé } 1430a2b0a27dSPhilippe Mathieu-Daudé break; 1431a2b0a27dSPhilippe Mathieu-Daudé case OPC_INSERT_df: 1432a2b0a27dSPhilippe Mathieu-Daudé switch (df) { 1433a2b0a27dSPhilippe Mathieu-Daudé case DF_BYTE: 1434a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_insert_b(cpu_env, twd, tws, tn); 1435a2b0a27dSPhilippe Mathieu-Daudé break; 1436a2b0a27dSPhilippe Mathieu-Daudé case DF_HALF: 1437a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_insert_h(cpu_env, twd, tws, tn); 1438a2b0a27dSPhilippe Mathieu-Daudé break; 1439a2b0a27dSPhilippe Mathieu-Daudé case DF_WORD: 1440a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_insert_w(cpu_env, twd, tws, tn); 1441a2b0a27dSPhilippe Mathieu-Daudé break; 1442a2b0a27dSPhilippe Mathieu-Daudé #if defined(TARGET_MIPS64) 1443a2b0a27dSPhilippe Mathieu-Daudé case DF_DOUBLE: 1444a2b0a27dSPhilippe Mathieu-Daudé gen_helper_msa_insert_d(cpu_env, twd, tws, tn); 1445a2b0a27dSPhilippe Mathieu-Daudé break; 1446a2b0a27dSPhilippe Mathieu-Daudé #endif 1447a2b0a27dSPhilippe Mathieu-Daudé default: 1448a2b0a27dSPhilippe Mathieu-Daudé assert(0); 1449a2b0a27dSPhilippe Mathieu-Daudé } 1450a2b0a27dSPhilippe Mathieu-Daudé break; 1451a2b0a27dSPhilippe Mathieu-Daudé } 1452a2b0a27dSPhilippe Mathieu-Daudé break; 1453a2b0a27dSPhilippe Mathieu-Daudé default: 1454a2b0a27dSPhilippe Mathieu-Daudé MIPS_INVAL("MSA instruction"); 1455a2b0a27dSPhilippe Mathieu-Daudé gen_reserved_instruction(ctx); 1456a2b0a27dSPhilippe Mathieu-Daudé } 1457a2b0a27dSPhilippe Mathieu-Daudé tcg_temp_free_i32(twd); 1458a2b0a27dSPhilippe Mathieu-Daudé tcg_temp_free_i32(tws); 1459a2b0a27dSPhilippe Mathieu-Daudé tcg_temp_free_i32(tn); 1460a2b0a27dSPhilippe Mathieu-Daudé } 1461a2b0a27dSPhilippe Mathieu-Daudé 1462a2b0a27dSPhilippe Mathieu-Daudé static void gen_msa_elm(DisasContext *ctx) 1463a2b0a27dSPhilippe Mathieu-Daudé { 1464a2b0a27dSPhilippe Mathieu-Daudé uint8_t dfn = (ctx->opcode >> 16) & 0x3f; 1465a2b0a27dSPhilippe Mathieu-Daudé uint32_t df = 0, n = 0; 1466a2b0a27dSPhilippe Mathieu-Daudé 1467a2b0a27dSPhilippe Mathieu-Daudé if ((dfn & 0x30) == 0x00) { 1468a2b0a27dSPhilippe Mathieu-Daudé n = dfn & 0x0f; 1469a2b0a27dSPhilippe Mathieu-Daudé df = DF_BYTE; 1470a2b0a27dSPhilippe Mathieu-Daudé } else if ((dfn & 0x38) == 0x20) { 1471a2b0a27dSPhilippe Mathieu-Daudé n = dfn & 0x07; 1472a2b0a27dSPhilippe Mathieu-Daudé df = DF_HALF; 1473a2b0a27dSPhilippe Mathieu-Daudé } else if ((dfn & 0x3c) == 0x30) { 1474a2b0a27dSPhilippe Mathieu-Daudé n = dfn & 0x03; 1475a2b0a27dSPhilippe Mathieu-Daudé df = DF_WORD; 1476a2b0a27dSPhilippe Mathieu-Daudé } else if ((dfn & 0x3e) == 0x38) { 1477a2b0a27dSPhilippe Mathieu-Daudé n = dfn & 0x01; 1478a2b0a27dSPhilippe Mathieu-Daudé df = DF_DOUBLE; 1479a2b0a27dSPhilippe Mathieu-Daudé } else if (dfn == 0x3E) { 1480a2b0a27dSPhilippe Mathieu-Daudé /* CTCMSA, CFCMSA, MOVE.V */ 1481a2b0a27dSPhilippe Mathieu-Daudé gen_msa_elm_3e(ctx); 1482a2b0a27dSPhilippe Mathieu-Daudé return; 1483a2b0a27dSPhilippe Mathieu-Daudé } else { 1484a2b0a27dSPhilippe Mathieu-Daudé gen_reserved_instruction(ctx); 1485a2b0a27dSPhilippe Mathieu-Daudé return; 1486a2b0a27dSPhilippe Mathieu-Daudé } 1487a2b0a27dSPhilippe Mathieu-Daudé 1488a2b0a27dSPhilippe Mathieu-Daudé gen_msa_elm_df(ctx, df, n); 1489a2b0a27dSPhilippe Mathieu-Daudé } 1490a2b0a27dSPhilippe Mathieu-Daudé 14912d5246f3SPhilippe Mathieu-Daudé TRANS(FCAF, trans_msa_3rf, gen_helper_msa_fcaf_df); 14922d5246f3SPhilippe Mathieu-Daudé TRANS(FCUN, trans_msa_3rf, gen_helper_msa_fcun_df); 14932d5246f3SPhilippe Mathieu-Daudé TRANS(FCEQ, trans_msa_3rf, gen_helper_msa_fceq_df); 14942d5246f3SPhilippe Mathieu-Daudé TRANS(FCUEQ, trans_msa_3rf, gen_helper_msa_fcueq_df); 14952d5246f3SPhilippe Mathieu-Daudé TRANS(FCLT, trans_msa_3rf, gen_helper_msa_fclt_df); 14962d5246f3SPhilippe Mathieu-Daudé TRANS(FCULT, trans_msa_3rf, gen_helper_msa_fcult_df); 14972d5246f3SPhilippe Mathieu-Daudé TRANS(FCLE, trans_msa_3rf, gen_helper_msa_fcle_df); 14982d5246f3SPhilippe Mathieu-Daudé TRANS(FCULE, trans_msa_3rf, gen_helper_msa_fcule_df); 14992d5246f3SPhilippe Mathieu-Daudé TRANS(FSAF, trans_msa_3rf, gen_helper_msa_fsaf_df); 15002d5246f3SPhilippe Mathieu-Daudé TRANS(FSUN, trans_msa_3rf, gen_helper_msa_fsun_df); 15012d5246f3SPhilippe Mathieu-Daudé TRANS(FSEQ, trans_msa_3rf, gen_helper_msa_fseq_df); 15022d5246f3SPhilippe Mathieu-Daudé TRANS(FSUEQ, trans_msa_3rf, gen_helper_msa_fsueq_df); 15032d5246f3SPhilippe Mathieu-Daudé TRANS(FSLT, trans_msa_3rf, gen_helper_msa_fslt_df); 15042d5246f3SPhilippe Mathieu-Daudé TRANS(FSULT, trans_msa_3rf, gen_helper_msa_fsult_df); 15052d5246f3SPhilippe Mathieu-Daudé TRANS(FSLE, trans_msa_3rf, gen_helper_msa_fsle_df); 15062d5246f3SPhilippe Mathieu-Daudé TRANS(FSULE, trans_msa_3rf, gen_helper_msa_fsule_df); 15072d5246f3SPhilippe Mathieu-Daudé 15082d5246f3SPhilippe Mathieu-Daudé TRANS(FADD, trans_msa_3rf, gen_helper_msa_fadd_df); 15092d5246f3SPhilippe Mathieu-Daudé TRANS(FSUB, trans_msa_3rf, gen_helper_msa_fsub_df); 15102d5246f3SPhilippe Mathieu-Daudé TRANS(FMUL, trans_msa_3rf, gen_helper_msa_fmul_df); 15112d5246f3SPhilippe Mathieu-Daudé TRANS(FDIV, trans_msa_3rf, gen_helper_msa_fdiv_df); 15122d5246f3SPhilippe Mathieu-Daudé TRANS(FMADD, trans_msa_3rf, gen_helper_msa_fmadd_df); 15132d5246f3SPhilippe Mathieu-Daudé TRANS(FMSUB, trans_msa_3rf, gen_helper_msa_fmsub_df); 15142d5246f3SPhilippe Mathieu-Daudé TRANS(FEXP2, trans_msa_3rf, gen_helper_msa_fexp2_df); 15152d5246f3SPhilippe Mathieu-Daudé TRANS(FEXDO, trans_msa_3rf, gen_helper_msa_fexdo_df); 15162d5246f3SPhilippe Mathieu-Daudé TRANS(FTQ, trans_msa_3rf, gen_helper_msa_ftq_df); 15172d5246f3SPhilippe Mathieu-Daudé TRANS(FMIN, trans_msa_3rf, gen_helper_msa_fmin_df); 15182d5246f3SPhilippe Mathieu-Daudé TRANS(FMIN_A, trans_msa_3rf, gen_helper_msa_fmin_a_df); 15192d5246f3SPhilippe Mathieu-Daudé TRANS(FMAX, trans_msa_3rf, gen_helper_msa_fmax_df); 15202d5246f3SPhilippe Mathieu-Daudé TRANS(FMAX_A, trans_msa_3rf, gen_helper_msa_fmax_a_df); 15212d5246f3SPhilippe Mathieu-Daudé 15222d5246f3SPhilippe Mathieu-Daudé TRANS(FCOR, trans_msa_3rf, gen_helper_msa_fcor_df); 15232d5246f3SPhilippe Mathieu-Daudé TRANS(FCUNE, trans_msa_3rf, gen_helper_msa_fcune_df); 15242d5246f3SPhilippe Mathieu-Daudé TRANS(FCNE, trans_msa_3rf, gen_helper_msa_fcne_df); 1525ff29e5d3SPhilippe Mathieu-Daudé TRANS(MUL_Q, trans_msa_3rf, gen_helper_msa_mul_q_df); 1526ff29e5d3SPhilippe Mathieu-Daudé TRANS(MADD_Q, trans_msa_3rf, gen_helper_msa_madd_q_df); 1527ff29e5d3SPhilippe Mathieu-Daudé TRANS(MSUB_Q, trans_msa_3rf, gen_helper_msa_msub_q_df); 15282d5246f3SPhilippe Mathieu-Daudé TRANS(FSOR, trans_msa_3rf, gen_helper_msa_fsor_df); 15292d5246f3SPhilippe Mathieu-Daudé TRANS(FSUNE, trans_msa_3rf, gen_helper_msa_fsune_df); 15302d5246f3SPhilippe Mathieu-Daudé TRANS(FSNE, trans_msa_3rf, gen_helper_msa_fsne_df); 1531ff29e5d3SPhilippe Mathieu-Daudé TRANS(MULR_Q, trans_msa_3rf, gen_helper_msa_mulr_q_df); 1532ff29e5d3SPhilippe Mathieu-Daudé TRANS(MADDR_Q, trans_msa_3rf, gen_helper_msa_maddr_q_df); 1533ff29e5d3SPhilippe Mathieu-Daudé TRANS(MSUBR_Q, trans_msa_3rf, gen_helper_msa_msubr_q_df); 1534ff29e5d3SPhilippe Mathieu-Daudé 1535adcff99aSPhilippe Mathieu-Daudé static bool trans_msa_2r(DisasContext *ctx, arg_msa_r *a, 1536adcff99aSPhilippe Mathieu-Daudé gen_helper_pii *gen_msa_2r) 1537a2b0a27dSPhilippe Mathieu-Daudé { 1538adcff99aSPhilippe Mathieu-Daudé if (!check_msa_enabled(ctx)) { 1539adcff99aSPhilippe Mathieu-Daudé return true; 1540a2b0a27dSPhilippe Mathieu-Daudé } 1541a2b0a27dSPhilippe Mathieu-Daudé 1542adcff99aSPhilippe Mathieu-Daudé gen_msa_2r(cpu_env, tcg_constant_i32(a->wd), tcg_constant_i32(a->ws)); 1543adcff99aSPhilippe Mathieu-Daudé 1544adcff99aSPhilippe Mathieu-Daudé return true; 1545a2b0a27dSPhilippe Mathieu-Daudé } 1546a2b0a27dSPhilippe Mathieu-Daudé 1547adcff99aSPhilippe Mathieu-Daudé TRANS_DF_ii(PCNT, trans_msa_2r, gen_helper_msa_pcnt); 1548adcff99aSPhilippe Mathieu-Daudé TRANS_DF_ii(NLOC, trans_msa_2r, gen_helper_msa_nloc); 1549adcff99aSPhilippe Mathieu-Daudé TRANS_DF_ii(NLZC, trans_msa_2r, gen_helper_msa_nlzc); 1550adcff99aSPhilippe Mathieu-Daudé 1551675bf34aSPhilippe Mathieu-Daudé static bool trans_FILL(DisasContext *ctx, arg_msa_r *a) 1552675bf34aSPhilippe Mathieu-Daudé { 1553675bf34aSPhilippe Mathieu-Daudé if (TARGET_LONG_BITS != 64 && a->df == DF_DOUBLE) { 1554675bf34aSPhilippe Mathieu-Daudé /* Double format valid only for MIPS64 */ 1555675bf34aSPhilippe Mathieu-Daudé return false; 1556675bf34aSPhilippe Mathieu-Daudé } 1557675bf34aSPhilippe Mathieu-Daudé 1558675bf34aSPhilippe Mathieu-Daudé if (!check_msa_enabled(ctx)) { 1559675bf34aSPhilippe Mathieu-Daudé return true; 1560675bf34aSPhilippe Mathieu-Daudé } 1561675bf34aSPhilippe Mathieu-Daudé 1562675bf34aSPhilippe Mathieu-Daudé gen_helper_msa_fill_df(cpu_env, 1563675bf34aSPhilippe Mathieu-Daudé tcg_constant_i32(a->df), 1564675bf34aSPhilippe Mathieu-Daudé tcg_constant_i32(a->wd), 1565675bf34aSPhilippe Mathieu-Daudé tcg_constant_i32(a->ws)); 1566675bf34aSPhilippe Mathieu-Daudé 1567675bf34aSPhilippe Mathieu-Daudé return true; 1568675bf34aSPhilippe Mathieu-Daudé } 1569675bf34aSPhilippe Mathieu-Daudé 15705c5b6400SPhilippe Mathieu-Daudé static bool trans_msa_2rf(DisasContext *ctx, arg_msa_r *a, 15715c5b6400SPhilippe Mathieu-Daudé gen_helper_piii *gen_msa_2rf) 1572a2b0a27dSPhilippe Mathieu-Daudé { 15735c5b6400SPhilippe Mathieu-Daudé if (!check_msa_enabled(ctx)) { 15745c5b6400SPhilippe Mathieu-Daudé return true; 1575a2b0a27dSPhilippe Mathieu-Daudé } 1576a2b0a27dSPhilippe Mathieu-Daudé 15775c5b6400SPhilippe Mathieu-Daudé gen_msa_2rf(cpu_env, 15785c5b6400SPhilippe Mathieu-Daudé tcg_constant_i32(a->df), 15795c5b6400SPhilippe Mathieu-Daudé tcg_constant_i32(a->wd), 15805c5b6400SPhilippe Mathieu-Daudé tcg_constant_i32(a->ws)); 15815c5b6400SPhilippe Mathieu-Daudé 15825c5b6400SPhilippe Mathieu-Daudé return true; 1583a2b0a27dSPhilippe Mathieu-Daudé } 1584a2b0a27dSPhilippe Mathieu-Daudé 15855c5b6400SPhilippe Mathieu-Daudé TRANS(FCLASS, trans_msa_2rf, gen_helper_msa_fclass_df); 15865c5b6400SPhilippe Mathieu-Daudé TRANS(FTRUNC_S, trans_msa_2rf, gen_helper_msa_fclass_df); 15875c5b6400SPhilippe Mathieu-Daudé TRANS(FTRUNC_U, trans_msa_2rf, gen_helper_msa_ftrunc_s_df); 15885c5b6400SPhilippe Mathieu-Daudé TRANS(FSQRT, trans_msa_2rf, gen_helper_msa_fsqrt_df); 15895c5b6400SPhilippe Mathieu-Daudé TRANS(FRSQRT, trans_msa_2rf, gen_helper_msa_frsqrt_df); 15905c5b6400SPhilippe Mathieu-Daudé TRANS(FRCP, trans_msa_2rf, gen_helper_msa_frcp_df); 15915c5b6400SPhilippe Mathieu-Daudé TRANS(FRINT, trans_msa_2rf, gen_helper_msa_frint_df); 15925c5b6400SPhilippe Mathieu-Daudé TRANS(FLOG2, trans_msa_2rf, gen_helper_msa_flog2_df); 15935c5b6400SPhilippe Mathieu-Daudé TRANS(FEXUPL, trans_msa_2rf, gen_helper_msa_fexupl_df); 15945c5b6400SPhilippe Mathieu-Daudé TRANS(FEXUPR, trans_msa_2rf, gen_helper_msa_fexupr_df); 15955c5b6400SPhilippe Mathieu-Daudé TRANS(FFQL, trans_msa_2rf, gen_helper_msa_ffql_df); 15965c5b6400SPhilippe Mathieu-Daudé TRANS(FFQR, trans_msa_2rf, gen_helper_msa_ffqr_df); 15975c5b6400SPhilippe Mathieu-Daudé TRANS(FTINT_S, trans_msa_2rf, gen_helper_msa_ftint_s_df); 15985c5b6400SPhilippe Mathieu-Daudé TRANS(FTINT_U, trans_msa_2rf, gen_helper_msa_ftint_u_df); 15995c5b6400SPhilippe Mathieu-Daudé TRANS(FFINT_S, trans_msa_2rf, gen_helper_msa_ffint_s_df); 16005c5b6400SPhilippe Mathieu-Daudé TRANS(FFINT_U, trans_msa_2rf, gen_helper_msa_ffint_u_df); 16015c5b6400SPhilippe Mathieu-Daudé 1602525ea877SPhilippe Mathieu-Daudé static bool trans_MSA(DisasContext *ctx, arg_MSA *a) 1603a2b0a27dSPhilippe Mathieu-Daudé { 1604a2b0a27dSPhilippe Mathieu-Daudé uint32_t opcode = ctx->opcode; 1605a2b0a27dSPhilippe Mathieu-Daudé 1606340ee8b3SPhilippe Mathieu-Daudé if (!check_msa_enabled(ctx)) { 1607340ee8b3SPhilippe Mathieu-Daudé return true; 1608340ee8b3SPhilippe Mathieu-Daudé } 1609a2b0a27dSPhilippe Mathieu-Daudé 1610a2b0a27dSPhilippe Mathieu-Daudé switch (MASK_MSA_MINOR(opcode)) { 1611a2b0a27dSPhilippe Mathieu-Daudé case OPC_MSA_3R_0D: 1612a2b0a27dSPhilippe Mathieu-Daudé case OPC_MSA_3R_0E: 1613a2b0a27dSPhilippe Mathieu-Daudé case OPC_MSA_3R_0F: 1614a2b0a27dSPhilippe Mathieu-Daudé case OPC_MSA_3R_10: 1615a2b0a27dSPhilippe Mathieu-Daudé case OPC_MSA_3R_11: 1616a2b0a27dSPhilippe Mathieu-Daudé case OPC_MSA_3R_12: 1617a2b0a27dSPhilippe Mathieu-Daudé case OPC_MSA_3R_13: 1618a2b0a27dSPhilippe Mathieu-Daudé case OPC_MSA_3R_14: 1619a2b0a27dSPhilippe Mathieu-Daudé case OPC_MSA_3R_15: 1620a2b0a27dSPhilippe Mathieu-Daudé gen_msa_3r(ctx); 1621a2b0a27dSPhilippe Mathieu-Daudé break; 1622a2b0a27dSPhilippe Mathieu-Daudé case OPC_MSA_ELM: 1623a2b0a27dSPhilippe Mathieu-Daudé gen_msa_elm(ctx); 1624a2b0a27dSPhilippe Mathieu-Daudé break; 1625a2b0a27dSPhilippe Mathieu-Daudé default: 1626a2b0a27dSPhilippe Mathieu-Daudé MIPS_INVAL("MSA instruction"); 1627a2b0a27dSPhilippe Mathieu-Daudé gen_reserved_instruction(ctx); 1628a2b0a27dSPhilippe Mathieu-Daudé break; 1629a2b0a27dSPhilippe Mathieu-Daudé } 1630a2b0a27dSPhilippe Mathieu-Daudé 1631a2b0a27dSPhilippe Mathieu-Daudé return true; 1632a2b0a27dSPhilippe Mathieu-Daudé } 1633a2b0a27dSPhilippe Mathieu-Daudé 1634ce121fe2SPhilippe Mathieu-Daudé static bool trans_msa_ldst(DisasContext *ctx, arg_msa_i *a, 1635ce121fe2SPhilippe Mathieu-Daudé gen_helper_piv *gen_msa_ldst) 1636ce121fe2SPhilippe Mathieu-Daudé { 1637ce121fe2SPhilippe Mathieu-Daudé TCGv taddr; 1638ce121fe2SPhilippe Mathieu-Daudé 1639ce121fe2SPhilippe Mathieu-Daudé if (!check_msa_enabled(ctx)) { 1640ce121fe2SPhilippe Mathieu-Daudé return true; 1641ce121fe2SPhilippe Mathieu-Daudé } 1642ce121fe2SPhilippe Mathieu-Daudé 1643ce121fe2SPhilippe Mathieu-Daudé taddr = tcg_temp_new(); 1644ce121fe2SPhilippe Mathieu-Daudé 1645ce121fe2SPhilippe Mathieu-Daudé gen_base_offset_addr(ctx, taddr, a->ws, a->sa << a->df); 1646ce121fe2SPhilippe Mathieu-Daudé gen_msa_ldst(cpu_env, tcg_constant_i32(a->wd), taddr); 1647ce121fe2SPhilippe Mathieu-Daudé 1648ce121fe2SPhilippe Mathieu-Daudé tcg_temp_free(taddr); 1649ce121fe2SPhilippe Mathieu-Daudé 1650ce121fe2SPhilippe Mathieu-Daudé return true; 1651ce121fe2SPhilippe Mathieu-Daudé } 1652ce121fe2SPhilippe Mathieu-Daudé 1653ce121fe2SPhilippe Mathieu-Daudé TRANS_DF_iv(LD, trans_msa_ldst, gen_helper_msa_ld); 1654ce121fe2SPhilippe Mathieu-Daudé TRANS_DF_iv(ST, trans_msa_ldst, gen_helper_msa_st); 1655ce121fe2SPhilippe Mathieu-Daudé 165634fe9fa3SPhilippe Mathieu-Daudé static bool trans_LSA(DisasContext *ctx, arg_r *a) 1657a2b0a27dSPhilippe Mathieu-Daudé { 1658a2b0a27dSPhilippe Mathieu-Daudé return gen_lsa(ctx, a->rd, a->rt, a->rs, a->sa); 1659a2b0a27dSPhilippe Mathieu-Daudé } 1660a2b0a27dSPhilippe Mathieu-Daudé 166134fe9fa3SPhilippe Mathieu-Daudé static bool trans_DLSA(DisasContext *ctx, arg_r *a) 1662a2b0a27dSPhilippe Mathieu-Daudé { 1663f5c6ee0cSPhilippe Mathieu-Daudé if (TARGET_LONG_BITS != 64) { 1664f5c6ee0cSPhilippe Mathieu-Daudé return false; 1665f5c6ee0cSPhilippe Mathieu-Daudé } 1666a2b0a27dSPhilippe Mathieu-Daudé return gen_dlsa(ctx, a->rd, a->rt, a->rs, a->sa); 1667a2b0a27dSPhilippe Mathieu-Daudé } 1668