From patchwork Wed Aug 21 17:28:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Bobek X-Patchwork-Id: 11107659 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 706811399 for ; Wed, 21 Aug 2019 17:45:16 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 365E222D6D for ; Wed, 21 Aug 2019 17:45:16 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="PRu5Gw5P" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 365E222D6D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:51296 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0Ufa-0004yE-W9 for patchwork-qemu-devel@patchwork.kernel.org; Wed, 21 Aug 2019 13:45:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40667) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0UQx-0000c7-Be for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i0UQu-0006yE-RS for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:07 -0400 Received: from mail-yw1-xc44.google.com ([2607:f8b0:4864:20::c44]:44244) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i0UQu-0006xp-FH for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:04 -0400 Received: by mail-yw1-xc44.google.com with SMTP id l79so1225588ywe.11 for ; Wed, 21 Aug 2019 10:30:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=VWqjFx/O0u8bCwF/JLEXfrLf2VEXAXqQnhgjFcPCqxY=; b=PRu5Gw5PHQp/3QARA4hpp8VmW7YaOrd2FpkBbVUo2KBfN/omkYMQ6W3hb3a0u2OJ70 PuSAgD6ecp3WwacXq6SF+A7HMS6Is21KW9RC2/rUQWZbuGZX3E6WAK/PbmiZpx/dhjAf vpXrT5z4CtcRqJI8+N8eAozZvUz3/8prb07jFyU/kR+duHnlEWabN5PKAFeCHpuS+77w lnHMynhUS4xNWUM7wX7KHAadsYq2GGS3QmJUH5OTzlpEkVv5loYolwrAvMyUG6wsg/Pw IGt4FDiI2fQe450TFZ8kswaJt330d+A8HI239Kv3mkAsgy7FMbGST2BsjsRe35i9cw+Q w3iw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=VWqjFx/O0u8bCwF/JLEXfrLf2VEXAXqQnhgjFcPCqxY=; b=S8ZUOVtQYg7wv4l4Br0oHWghJA9t2qI9OTDkaD+cmHCkfPiFkgAYecYH0hxInSQJpY dF2zvANE8lM+HjSrLl/yhMInNkUp1c24RhUD2OXqdExi6s5SQI/eLcfltBdOVndHc8Ij ZKZOQOMNsR2OL/xmER0dK8NG9ebnix2lQA/1LYOZxTrLfGBbk/JASYv8owRQFxpuJ9dM kJ1bWeBsN1As9CTsA9TWJqOScmmIaaoOGtkRlYXoG2tsv+61vyRD64Cv+WvA60obczEQ kyugNcTlVbAz8JsN82TewmIJ4I1LXSX2S7R/8w4SbLWUOSTIrbeL8scD/qY1rqS/rp4I ndNw== X-Gm-Message-State: APjAAAUivnuV/n2fmZAkoBN+gL7n5rcwK27f4e8h20w5FX9eeHx21TE/ WzIh4rBHOF1Emp09tVSwmM7aCOke X-Google-Smtp-Source: APXvYqyfUtHwCmk3BMBrjS84QPhn+d8Nt1tJ8u3jpHk1oeMPvYTCJxHrBPiIDd4mFL0lO4n8GoWjwg== X-Received: by 2002:a81:70c8:: with SMTP id l191mr25400723ywc.425.1566408602411; Wed, 21 Aug 2019 10:30:02 -0700 (PDT) Received: from localhost.localdomain ([2601:c0:c67f:e390::3]) by smtp.gmail.com with ESMTPSA id l71sm2826167ywl.39.2019.08.21.10.30.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Aug 2019 10:30:01 -0700 (PDT) From: Jan Bobek To: qemu-devel@nongnu.org Date: Wed, 21 Aug 2019 13:28:37 -0400 Message-Id: <20190821172951.15333-2-jan.bobek@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190821172951.15333-1-jan.bobek@gmail.com> References: <20190821172951.15333-1-jan.bobek@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::c44 Subject: [Qemu-devel] [RFC PATCH v4 01/75] target/i386: Push rex_r into DisasContext X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson Treat this value the same as we do for rex_b and rex_x. Signed-off-by: Richard Henderson --- target/i386/translate.c | 85 +++++++++++++++++++++-------------------- 1 file changed, 44 insertions(+), 41 deletions(-) diff --git a/target/i386/translate.c b/target/i386/translate.c index 5cd74ad639..3aac84e5b0 100644 --- a/target/i386/translate.c +++ b/target/i386/translate.c @@ -43,10 +43,12 @@ #define CODE64(s) ((s)->code64) #define REX_X(s) ((s)->rex_x) #define REX_B(s) ((s)->rex_b) +#define REX_R(s) ((s)->rex_r) #else #define CODE64(s) 0 #define REX_X(s) 0 #define REX_B(s) 0 +#define REX_R(s) 0 #endif #ifdef TARGET_X86_64 @@ -98,7 +100,7 @@ typedef struct DisasContext { #ifdef TARGET_X86_64 int lma; /* long mode active */ int code64; /* 64 bit code segment */ - int rex_x, rex_b; + int rex_x, rex_b, rex_r; #endif int vex_l; /* vex vector length */ int vex_v; /* vex vvvv register, without 1's complement. */ @@ -3037,7 +3039,7 @@ static const struct SSEOpHelper_eppi sse_op_table7[256] = { }; static void gen_sse(CPUX86State *env, DisasContext *s, int b, - target_ulong pc_start, int rex_r) + target_ulong pc_start) { int b1, op1_offset, op2_offset, is_xmm, val; int modrm, mod, rm, reg; @@ -3107,8 +3109,9 @@ static void gen_sse(CPUX86State *env, DisasContext *s, int b, modrm = x86_ldub_code(env, s); reg = ((modrm >> 3) & 7); - if (is_xmm) - reg |= rex_r; + if (is_xmm) { + reg |= REX_R(s); + } mod = (modrm >> 6) & 3; if (sse_fn_epp == SSE_SPECIAL) { b |= (b1 << 8); @@ -3642,7 +3645,7 @@ static void gen_sse(CPUX86State *env, DisasContext *s, int b, tcg_gen_ld16u_tl(s->T0, cpu_env, offsetof(CPUX86State,fpregs[rm].mmx.MMX_W(val))); } - reg = ((modrm >> 3) & 7) | rex_r; + reg = ((modrm >> 3) & 7) | REX_R(s); gen_op_mov_reg_v(s, ot, reg, s->T0); break; case 0x1d6: /* movq ea, xmm */ @@ -3686,7 +3689,7 @@ static void gen_sse(CPUX86State *env, DisasContext *s, int b, offsetof(CPUX86State, fpregs[rm].mmx)); gen_helper_pmovmskb_mmx(s->tmp2_i32, cpu_env, s->ptr0); } - reg = ((modrm >> 3) & 7) | rex_r; + reg = ((modrm >> 3) & 7) | REX_R(s); tcg_gen_extu_i32_tl(cpu_regs[reg], s->tmp2_i32); break; @@ -3698,7 +3701,7 @@ static void gen_sse(CPUX86State *env, DisasContext *s, int b, } modrm = x86_ldub_code(env, s); rm = modrm & 7; - reg = ((modrm >> 3) & 7) | rex_r; + reg = ((modrm >> 3) & 7) | REX_R(s); mod = (modrm >> 6) & 3; if (b1 >= 2) { goto unknown_op; @@ -3774,7 +3777,7 @@ static void gen_sse(CPUX86State *env, DisasContext *s, int b, /* Various integer extensions at 0f 38 f[0-f]. */ b = modrm | (b1 << 8); modrm = x86_ldub_code(env, s); - reg = ((modrm >> 3) & 7) | rex_r; + reg = ((modrm >> 3) & 7) | REX_R(s); switch (b) { case 0x3f0: /* crc32 Gd,Eb */ @@ -4128,7 +4131,7 @@ static void gen_sse(CPUX86State *env, DisasContext *s, int b, b = modrm; modrm = x86_ldub_code(env, s); rm = modrm & 7; - reg = ((modrm >> 3) & 7) | rex_r; + reg = ((modrm >> 3) & 7) | REX_R(s); mod = (modrm >> 6) & 3; if (b1 >= 2) { goto unknown_op; @@ -4148,7 +4151,7 @@ static void gen_sse(CPUX86State *env, DisasContext *s, int b, rm = (modrm & 7) | REX_B(s); if (mod != 3) gen_lea_modrm(env, s, modrm); - reg = ((modrm >> 3) & 7) | rex_r; + reg = ((modrm >> 3) & 7) | REX_R(s); val = x86_ldub_code(env, s); switch (b) { case 0x14: /* pextrb */ @@ -4317,7 +4320,7 @@ static void gen_sse(CPUX86State *env, DisasContext *s, int b, /* Various integer extensions at 0f 3a f[0-f]. */ b = modrm | (b1 << 8); modrm = x86_ldub_code(env, s); - reg = ((modrm >> 3) & 7) | rex_r; + reg = ((modrm >> 3) & 7) | REX_R(s); switch (b) { case 0x3f0: /* rorx Gy,Ey, Ib */ @@ -4491,14 +4494,15 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) TCGMemOp ot, aflag, dflag; int modrm, reg, rm, mod, op, opreg, val; target_ulong next_eip, tval; - int rex_w, rex_r; target_ulong pc_start = s->base.pc_next; + int rex_w; s->pc_start = s->pc = pc_start; s->override = -1; #ifdef TARGET_X86_64 s->rex_x = 0; s->rex_b = 0; + s->rex_r = 0; s->x86_64_hregs = false; #endif s->rip_offset = 0; /* for relative ip address */ @@ -4511,7 +4515,6 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) prefixes = 0; rex_w = -1; - rex_r = 0; next_byte: b = x86_ldub_code(env, s); @@ -4555,9 +4558,9 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) if (CODE64(s)) { /* REX prefix */ rex_w = (b >> 3) & 1; - rex_r = (b & 0x4) << 1; + s->rex_r = (b & 0x4) << 1; s->rex_x = (b & 0x2) << 2; - REX_B(s) = (b & 0x1) << 3; + s->rex_b = (b & 0x1) << 3; /* select uniform byte register addressing */ s->x86_64_hregs = true; goto next_byte; @@ -4590,8 +4593,8 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) if (s->x86_64_hregs) { goto illegal_op; } + s->rex_r = (~vex2 >> 4) & 8; #endif - rex_r = (~vex2 >> 4) & 8; if (b == 0xc5) { /* 2-byte VEX prefix: RVVVVlpp, implied 0f leading opcode byte */ vex3 = vex2; @@ -4681,7 +4684,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) switch(f) { case 0: /* OP Ev, Gv */ modrm = x86_ldub_code(env, s); - reg = ((modrm >> 3) & 7) | rex_r; + reg = ((modrm >> 3) & 7) | REX_R(s); mod = (modrm >> 6) & 3; rm = (modrm & 7) | REX_B(s); if (mod != 3) { @@ -4703,7 +4706,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) case 1: /* OP Gv, Ev */ modrm = x86_ldub_code(env, s); mod = (modrm >> 6) & 3; - reg = ((modrm >> 3) & 7) | rex_r; + reg = ((modrm >> 3) & 7) | REX_R(s); rm = (modrm & 7) | REX_B(s); if (mod != 3) { gen_lea_modrm(env, s, modrm); @@ -5123,7 +5126,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) ot = mo_b_d(b, dflag); modrm = x86_ldub_code(env, s); - reg = ((modrm >> 3) & 7) | rex_r; + reg = ((modrm >> 3) & 7) | REX_R(s); gen_ldst_modrm(env, s, modrm, ot, OR_TMP0, 0); gen_op_mov_v_reg(s, ot, s->T1, reg); @@ -5195,7 +5198,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) case 0x6b: ot = dflag; modrm = x86_ldub_code(env, s); - reg = ((modrm >> 3) & 7) | rex_r; + reg = ((modrm >> 3) & 7) | REX_R(s); if (b == 0x69) s->rip_offset = insn_const_size(ot); else if (b == 0x6b) @@ -5247,7 +5250,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) case 0x1c1: /* xadd Ev, Gv */ ot = mo_b_d(b, dflag); modrm = x86_ldub_code(env, s); - reg = ((modrm >> 3) & 7) | rex_r; + reg = ((modrm >> 3) & 7) | REX_R(s); mod = (modrm >> 6) & 3; gen_op_mov_v_reg(s, ot, s->T0, reg); if (mod == 3) { @@ -5279,7 +5282,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) ot = mo_b_d(b, dflag); modrm = x86_ldub_code(env, s); - reg = ((modrm >> 3) & 7) | rex_r; + reg = ((modrm >> 3) & 7) | REX_R(s); mod = (modrm >> 6) & 3; oldv = tcg_temp_new(); newv = tcg_temp_new(); @@ -5501,7 +5504,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) case 0x89: /* mov Gv, Ev */ ot = mo_b_d(b, dflag); modrm = x86_ldub_code(env, s); - reg = ((modrm >> 3) & 7) | rex_r; + reg = ((modrm >> 3) & 7) | REX_R(s); /* generate a generic store */ gen_ldst_modrm(env, s, modrm, ot, reg, 1); @@ -5527,7 +5530,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) case 0x8b: /* mov Ev, Gv */ ot = mo_b_d(b, dflag); modrm = x86_ldub_code(env, s); - reg = ((modrm >> 3) & 7) | rex_r; + reg = ((modrm >> 3) & 7) | REX_R(s); gen_ldst_modrm(env, s, modrm, ot, OR_TMP0, 0); gen_op_mov_reg_v(s, ot, reg, s->T0); @@ -5577,7 +5580,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) s_ot = b & 8 ? MO_SIGN | ot : ot; modrm = x86_ldub_code(env, s); - reg = ((modrm >> 3) & 7) | rex_r; + reg = ((modrm >> 3) & 7) | REX_R(s); mod = (modrm >> 6) & 3; rm = (modrm & 7) | REX_B(s); @@ -5616,7 +5619,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) mod = (modrm >> 6) & 3; if (mod == 3) goto illegal_op; - reg = ((modrm >> 3) & 7) | rex_r; + reg = ((modrm >> 3) & 7) | REX_R(s); { AddressParts a = gen_lea_modrm_0(env, s, modrm); TCGv ea = gen_lea_modrm_1(s, a); @@ -5698,7 +5701,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) case 0x87: /* xchg Ev, Gv */ ot = mo_b_d(b, dflag); modrm = x86_ldub_code(env, s); - reg = ((modrm >> 3) & 7) | rex_r; + reg = ((modrm >> 3) & 7) | REX_R(s); mod = (modrm >> 6) & 3; if (mod == 3) { rm = (modrm & 7) | REX_B(s); @@ -5735,7 +5738,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) do_lxx: ot = dflag != MO_16 ? MO_32 : MO_16; modrm = x86_ldub_code(env, s); - reg = ((modrm >> 3) & 7) | rex_r; + reg = ((modrm >> 3) & 7) | REX_R(s); mod = (modrm >> 6) & 3; if (mod == 3) goto illegal_op; @@ -5818,7 +5821,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) modrm = x86_ldub_code(env, s); mod = (modrm >> 6) & 3; rm = (modrm & 7) | REX_B(s); - reg = ((modrm >> 3) & 7) | rex_r; + reg = ((modrm >> 3) & 7) | REX_R(s); if (mod != 3) { gen_lea_modrm(env, s, modrm); opreg = OR_TMP0; @@ -6669,7 +6672,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) } ot = dflag; modrm = x86_ldub_code(env, s); - reg = ((modrm >> 3) & 7) | rex_r; + reg = ((modrm >> 3) & 7) | REX_R(s); gen_cmovcc1(env, s, ot, b, modrm, reg); break; @@ -6819,7 +6822,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) do_btx: ot = dflag; modrm = x86_ldub_code(env, s); - reg = ((modrm >> 3) & 7) | rex_r; + reg = ((modrm >> 3) & 7) | REX_R(s); mod = (modrm >> 6) & 3; rm = (modrm & 7) | REX_B(s); gen_op_mov_v_reg(s, MO_32, s->T1, reg); @@ -6924,7 +6927,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) case 0x1bd: /* bsr / lzcnt */ ot = dflag; modrm = x86_ldub_code(env, s); - reg = ((modrm >> 3) & 7) | rex_r; + reg = ((modrm >> 3) & 7) | REX_R(s); gen_ldst_modrm(env, s, modrm, ot, OR_TMP0, 0); gen_extu(ot, s->T0); @@ -7686,7 +7689,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) d_ot = dflag; modrm = x86_ldub_code(env, s); - reg = ((modrm >> 3) & 7) | rex_r; + reg = ((modrm >> 3) & 7) | REX_R(s); mod = (modrm >> 6) & 3; rm = (modrm & 7) | REX_B(s); @@ -7760,7 +7763,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) goto illegal_op; ot = dflag != MO_16 ? MO_32 : MO_16; modrm = x86_ldub_code(env, s); - reg = ((modrm >> 3) & 7) | rex_r; + reg = ((modrm >> 3) & 7) | REX_R(s); gen_ldst_modrm(env, s, modrm, MO_16, OR_TMP0, 0); t0 = tcg_temp_local_new(); gen_update_cc_op(s); @@ -7801,7 +7804,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) modrm = x86_ldub_code(env, s); if (s->flags & HF_MPX_EN_MASK) { mod = (modrm >> 6) & 3; - reg = ((modrm >> 3) & 7) | rex_r; + reg = ((modrm >> 3) & 7) | REX_R(s); if (prefixes & PREFIX_REPZ) { /* bndcl */ if (reg >= 4 @@ -7891,7 +7894,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) modrm = x86_ldub_code(env, s); if (s->flags & HF_MPX_EN_MASK) { mod = (modrm >> 6) & 3; - reg = ((modrm >> 3) & 7) | rex_r; + reg = ((modrm >> 3) & 7) | REX_R(s); if (mod != 3 && (prefixes & PREFIX_REPZ)) { /* bndmk */ if (reg >= 4 @@ -8005,7 +8008,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) * are assumed to be 1's, regardless of actual values. */ rm = (modrm & 7) | REX_B(s); - reg = ((modrm >> 3) & 7) | rex_r; + reg = ((modrm >> 3) & 7) | REX_R(s); if (CODE64(s)) ot = MO_64; else @@ -8059,7 +8062,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) * are assumed to be 1's, regardless of actual values. */ rm = (modrm & 7) | REX_B(s); - reg = ((modrm >> 3) & 7) | rex_r; + reg = ((modrm >> 3) & 7) | REX_R(s); if (CODE64(s)) ot = MO_64; else @@ -8102,7 +8105,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) mod = (modrm >> 6) & 3; if (mod == 3) goto illegal_op; - reg = ((modrm >> 3) & 7) | rex_r; + reg = ((modrm >> 3) & 7) | REX_R(s); /* generate a generic store */ gen_ldst_modrm(env, s, modrm, ot, reg, 1); break; @@ -8328,7 +8331,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) goto illegal_op; modrm = x86_ldub_code(env, s); - reg = ((modrm >> 3) & 7) | rex_r; + reg = ((modrm >> 3) & 7) | REX_R(s); if (s->prefix & PREFIX_DATA) { ot = MO_16; @@ -8356,7 +8359,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) case 0x1c2: case 0x1c4 ... 0x1c6: case 0x1d0 ... 0x1fe: - gen_sse(env, s, b, pc_start, rex_r); + gen_sse(env, s, b, pc_start); break; default: goto unknown_op; From patchwork Wed Aug 21 17:28:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Bobek X-Patchwork-Id: 11107649 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8EAE613B1 for ; Wed, 21 Aug 2019 17:42:37 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 666D922DD3 for ; Wed, 21 Aug 2019 17:42:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Xw5X9cPx" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 666D922DD3 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:51266 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0Ud2-000192-9z for patchwork-qemu-devel@patchwork.kernel.org; Wed, 21 Aug 2019 13:42:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40647) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0UQv-0000YS-9O for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i0UQu-0006xc-34 for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:05 -0400 Received: from mail-yb1-xb43.google.com ([2607:f8b0:4864:20::b43]:34113) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i0UQt-0006xF-V4 for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:04 -0400 Received: by mail-yb1-xb43.google.com with SMTP id u68so1355814ybg.1 for ; Wed, 21 Aug 2019 10:30:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=XcHdhv7Tr8pKpZ8Bf3TEPpKCMu1p8Id3mWUlS1gcqrc=; b=Xw5X9cPx1RdPubh44uZHmPQ1stqP4lHLBum8Q76kpYIIWSf/GUnEU4NM5yDCCwlGgn OTJJ1jHQzA6ja4a6s6k/07DnOBqq/OD7jDz95SvfL9TBXJovizBeHH+w8A+cFexfI7fg K+ae/MzRZJefzDIKxS2VaONyU1uKfZlZNGsk0Zd6NxMIArwFKeGAUj69jcE7WT3gLWPh Ki5+s1lqQaPAs6uOjnILbwBvNo9iCp4LH5FAuHRcROCkD9S8L6hhZbM2LNvxSVBH30Zw WZgdehcPT6PA3pDASxx2d/YOPbsDWLN1yezNEJNcPwtqt/fUN4eWbnoO1SQSUmeMLFTM vwsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=XcHdhv7Tr8pKpZ8Bf3TEPpKCMu1p8Id3mWUlS1gcqrc=; b=MVL1WZ4XK6OTuBx/TpgIxAaRqC96s8scG/hgxBTJNjnc2tIi0cQT1dq1WvlJz7cpzt 8RzfXnTYvbD6r83JXuQVm0Fl4rE0TLLnwLHo//90GXil/UHr9tj+ayY1hKQLPfjfT183 WXmW8ahAQzeKIraNkSo4ytPJOxFXHoLC4qvTxn2QK7qwq6zw4NmFBaQhZvjTFVtI/ysx iwG5mibj//Bjo3lPZBbkaMHuElBv9BJpFvXxRJSailZ3T0GvUtZAb0kBENwLzRLEpHY+ DpwF1/YjaOCK4NJPRQio6iM7pAm1apwePQr0Vq7lQ8BrQxOY66JoTfhd4thcCluHr7Rf X7sQ== X-Gm-Message-State: APjAAAURe47yID9JaaP05btAu7AgIHm270VNYeazA8kGZznP9F/3pTJT A6YLgS33ZDJBSrNLLIsxke0COJ+f X-Google-Smtp-Source: APXvYqwoX1TKvYpu8ENJC/RO3QJ6buzhjONJEFjE1YJX1EmfmOMJp6f+TVjwDSH/buRI0YI8+pFYEQ== X-Received: by 2002:a5b:7d2:: with SMTP id t18mr8941048ybq.326.1566408603228; Wed, 21 Aug 2019 10:30:03 -0700 (PDT) Received: from localhost.localdomain ([2601:c0:c67f:e390::3]) by smtp.gmail.com with ESMTPSA id l71sm2826167ywl.39.2019.08.21.10.30.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Aug 2019 10:30:02 -0700 (PDT) From: Jan Bobek To: qemu-devel@nongnu.org Date: Wed, 21 Aug 2019 13:28:38 -0400 Message-Id: <20190821172951.15333-3-jan.bobek@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190821172951.15333-1-jan.bobek@gmail.com> References: <20190821172951.15333-1-jan.bobek@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::b43 Subject: [Qemu-devel] [RFC PATCH v4 02/75] target/i386: Push rex_w into DisasContext X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson Treat this the same as we already do for other rex bits. Signed-off-by: Richard Henderson --- target/i386/translate.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/target/i386/translate.c b/target/i386/translate.c index 3aac84e5b0..9ec1c79371 100644 --- a/target/i386/translate.c +++ b/target/i386/translate.c @@ -44,11 +44,13 @@ #define REX_X(s) ((s)->rex_x) #define REX_B(s) ((s)->rex_b) #define REX_R(s) ((s)->rex_r) +#define REX_W(s) ((s)->rex_w) #else #define CODE64(s) 0 #define REX_X(s) 0 #define REX_B(s) 0 #define REX_R(s) 0 +#define REX_W(s) -1 #endif #ifdef TARGET_X86_64 @@ -100,7 +102,7 @@ typedef struct DisasContext { #ifdef TARGET_X86_64 int lma; /* long mode active */ int code64; /* 64 bit code segment */ - int rex_x, rex_b, rex_r; + int rex_x, rex_b, rex_r, rex_w; #endif int vex_l; /* vex vector length */ int vex_v; /* vex vvvv register, without 1's complement. */ @@ -4495,7 +4497,6 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) int modrm, reg, rm, mod, op, opreg, val; target_ulong next_eip, tval; target_ulong pc_start = s->base.pc_next; - int rex_w; s->pc_start = s->pc = pc_start; s->override = -1; @@ -4503,6 +4504,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) s->rex_x = 0; s->rex_b = 0; s->rex_r = 0; + s->rex_w = -1; s->x86_64_hregs = false; #endif s->rip_offset = 0; /* for relative ip address */ @@ -4514,7 +4516,6 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) } prefixes = 0; - rex_w = -1; next_byte: b = x86_ldub_code(env, s); @@ -4557,7 +4558,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) case 0x40 ... 0x4f: if (CODE64(s)) { /* REX prefix */ - rex_w = (b >> 3) & 1; + s->rex_w = (b >> 3) & 1; s->rex_r = (b & 0x4) << 1; s->rex_x = (b & 0x2) << 2; s->rex_b = (b & 0x1) << 3; @@ -4606,7 +4607,9 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) s->rex_b = (~vex2 >> 2) & 8; #endif vex3 = x86_ldub_code(env, s); - rex_w = (vex3 >> 7) & 1; +#ifdef TARGET_X86_64 + s->rex_w = (vex3 >> 7) & 1; +#endif switch (vex2 & 0x1f) { case 0x01: /* Implied 0f leading opcode bytes. */ b = x86_ldub_code(env, s) | 0x100; @@ -4631,9 +4634,9 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) /* Post-process prefixes. */ if (CODE64(s)) { /* In 64-bit mode, the default data size is 32-bit. Select 64-bit - data with rex_w, and 16-bit data with 0x66; rex_w takes precedence + data with REX_W, and 16-bit data with 0x66; REX_W takes precedence over 0x66 if both are present. */ - dflag = (rex_w > 0 ? MO_64 : prefixes & PREFIX_DATA ? MO_16 : MO_32); + dflag = (REX_W(s) > 0 ? MO_64 : prefixes & PREFIX_DATA ? MO_16 : MO_32); /* In 64-bit mode, 0x67 selects 32-bit addressing. */ aflag = (prefixes & PREFIX_ADR ? MO_32 : MO_64); } else { @@ -5029,7 +5032,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) /* operand size for jumps is 64 bit */ ot = MO_64; } else if (op == 3 || op == 5) { - ot = dflag != MO_16 ? MO_32 + (rex_w == 1) : MO_16; + ot = dflag != MO_16 ? MO_32 + (REX_W(s) == 1) : MO_16; } else if (op == 6) { /* default push size is 64 bit */ ot = mo_pushpop(s, dflag); From patchwork Wed Aug 21 17:28:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Bobek X-Patchwork-Id: 11107685 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B658A14DE for ; Wed, 21 Aug 2019 17:54:43 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7BB90233A2 for ; Wed, 21 Aug 2019 17:54:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="RfQk/qGo" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7BB90233A2 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:51398 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0Uok-0000f4-7h for patchwork-qemu-devel@patchwork.kernel.org; Wed, 21 Aug 2019 13:54:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40692) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0UQz-0000ft-05 for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i0UQv-0006yv-Pn for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:08 -0400 Received: from mail-yb1-xb43.google.com ([2607:f8b0:4864:20::b43]:32968) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i0UQv-0006yf-JN for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:05 -0400 Received: by mail-yb1-xb43.google.com with SMTP id b16so1356628ybq.0 for ; Wed, 21 Aug 2019 10:30:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=cFRAWFFdmyoCzE1WNd5jllqs96rRW3z2FUI/e4S8BVI=; b=RfQk/qGoR+eTCjUOw43Xc+TR1X/uS5P/0mA3zjrDJNYyuZr8M2ZaW0FTifwrbp3gQV RjxfiXhetilyr8mgiVxMvbQOCCbaYYrxEi7TKG6fawzPyih1GecaQg0A3iWkMPvjbDjS i/xe+sqx4NQ+eOgPzfri+xTmWQ5g+49UhuyZusIVBc3MSAH13Hf6Mj8qre9GgLSu2zp7 p0UKoq//z37agKqrMomWRQxnWlUPRDpMBvwUd4lstOmm0ypbbkTMDV7vbf6YwFmFxeLD EJH0SdAz0bx+KF/8wRBX5QU/dfAR2Kcai8x7nDIl0PS0G58MR/q2VqG5vdQnqoJBSwtb bPDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=cFRAWFFdmyoCzE1WNd5jllqs96rRW3z2FUI/e4S8BVI=; b=fIDT8nkRDNRy7p93l17quGBivQfCwreggdMIaMO7MxHRhrf/08KAodwHe4OpAGR6r+ LbApMB1B3YhR5/22GIYozAHPr32F2x2T8MX/1ynpdI+mZVACn5CS57qoG/jYLYtM+gFN SXzOM4HHmzruBC/6rUoJDm0/DI7IN7BiYWaKGzRO7AIV7YRVjVfyOPTadKUlkYl9wLT3 8T7cc3fsBgmByDh7dck8tp7XmqypbObAPZbMi6ED1xglw4MPFL6GKmKsF5yuPsjsJrwd VNs8Om5lGrP5epYrOElmKsvUxqMw08iPPPQyp/MDtPETUmIM/38CWNBf1R+8bt45f6F5 ictA== X-Gm-Message-State: APjAAAVc5/XxIcEigklJmlWBXAqbUVK8a9DRCdm3Vj2bXtH/ixKiGnlw dGOwkrJI7zZSfGU7U/iPX2zg+fDP X-Google-Smtp-Source: APXvYqwqEqRtFV/WvRIrGiZBwr7da4kZhDHCxk/Al5DduTQqQOUNFHTiugjJmW/qBDON38Umh3fiiQ== X-Received: by 2002:a25:8001:: with SMTP id m1mr22786665ybk.66.1566408604184; Wed, 21 Aug 2019 10:30:04 -0700 (PDT) Received: from localhost.localdomain ([2601:c0:c67f:e390::3]) by smtp.gmail.com with ESMTPSA id l71sm2826167ywl.39.2019.08.21.10.30.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Aug 2019 10:30:03 -0700 (PDT) From: Jan Bobek To: qemu-devel@nongnu.org Date: Wed, 21 Aug 2019 13:28:39 -0400 Message-Id: <20190821172951.15333-4-jan.bobek@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190821172951.15333-1-jan.bobek@gmail.com> References: <20190821172951.15333-1-jan.bobek@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::b43 Subject: [Qemu-devel] [RFC PATCH v4 03/75] target/i386: use dflag from DisasContext X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jan Bobek , =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" There already is a variable dflag in DisasContext, so use that one rather than the identically-named local helper variable. Suggested-by: Richard Henderson Signed-off-by: Jan Bobek --- target/i386/translate.c | 180 ++++++++++++++++++++-------------------- 1 file changed, 90 insertions(+), 90 deletions(-) diff --git a/target/i386/translate.c b/target/i386/translate.c index 9ec1c79371..7226c67d2e 100644 --- a/target/i386/translate.c +++ b/target/i386/translate.c @@ -4682,7 +4682,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) op = (b >> 3) & 7; f = (b >> 1) & 3; - ot = mo_b_d(b, dflag); + ot = mo_b_d(b, s->dflag); switch(f) { case 0: /* OP Ev, Gv */ @@ -4740,7 +4740,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) { int val; - ot = mo_b_d(b, dflag); + ot = mo_b_d(b, s->dflag); modrm = x86_ldub_code(env, s); mod = (modrm >> 6) & 3; @@ -4777,16 +4777,16 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) /**************************/ /* inc, dec, and other misc arith */ case 0x40 ... 0x47: /* inc Gv */ - ot = dflag; + ot = s->dflag; gen_inc(s, ot, OR_EAX + (b & 7), 1); break; case 0x48 ... 0x4f: /* dec Gv */ - ot = dflag; + ot = s->dflag; gen_inc(s, ot, OR_EAX + (b & 7), -1); break; case 0xf6: /* GRP3 */ case 0xf7: - ot = mo_b_d(b, dflag); + ot = mo_b_d(b, s->dflag); modrm = x86_ldub_code(env, s); mod = (modrm >> 6) & 3; @@ -5018,7 +5018,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) case 0xfe: /* GRP4 */ case 0xff: /* GRP5 */ - ot = mo_b_d(b, dflag); + ot = mo_b_d(b, s->dflag); modrm = x86_ldub_code(env, s); mod = (modrm >> 6) & 3; @@ -5032,10 +5032,10 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) /* operand size for jumps is 64 bit */ ot = MO_64; } else if (op == 3 || op == 5) { - ot = dflag != MO_16 ? MO_32 + (REX_W(s) == 1) : MO_16; + ot = s->dflag != MO_16 ? MO_32 + (REX_W(s) == 1) : MO_16; } else if (op == 6) { /* default push size is 64 bit */ - ot = mo_pushpop(s, dflag); + ot = mo_pushpop(s, s->dflag); } } if (mod != 3) { @@ -5063,7 +5063,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) break; case 2: /* call Ev */ /* XXX: optimize if memory (no 'and' is necessary) */ - if (dflag == MO_16) { + if (s->dflag == MO_16) { tcg_gen_ext16u_tl(s->T0, s->T0); } next_eip = s->pc - s->cs_base; @@ -5081,19 +5081,19 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) if (s->pe && !s->vm86) { tcg_gen_trunc_tl_i32(s->tmp2_i32, s->T0); gen_helper_lcall_protected(cpu_env, s->tmp2_i32, s->T1, - tcg_const_i32(dflag - 1), + tcg_const_i32(s->dflag - 1), tcg_const_tl(s->pc - s->cs_base)); } else { tcg_gen_trunc_tl_i32(s->tmp2_i32, s->T0); gen_helper_lcall_real(cpu_env, s->tmp2_i32, s->T1, - tcg_const_i32(dflag - 1), + tcg_const_i32(s->dflag - 1), tcg_const_i32(s->pc - s->cs_base)); } tcg_gen_ld_tl(s->tmp4, cpu_env, offsetof(CPUX86State, eip)); gen_jr(s, s->tmp4); break; case 4: /* jmp Ev */ - if (dflag == MO_16) { + if (s->dflag == MO_16) { tcg_gen_ext16u_tl(s->T0, s->T0); } gen_op_jmp_v(s->T0); @@ -5126,7 +5126,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) case 0x84: /* test Ev, Gv */ case 0x85: - ot = mo_b_d(b, dflag); + ot = mo_b_d(b, s->dflag); modrm = x86_ldub_code(env, s); reg = ((modrm >> 3) & 7) | REX_R(s); @@ -5139,7 +5139,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) case 0xa8: /* test eAX, Iv */ case 0xa9: - ot = mo_b_d(b, dflag); + ot = mo_b_d(b, s->dflag); val = insn_get(env, s, ot); gen_op_mov_v_reg(s, ot, s->T0, OR_EAX); @@ -5149,7 +5149,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) break; case 0x98: /* CWDE/CBW */ - switch (dflag) { + switch (s->dflag) { #ifdef TARGET_X86_64 case MO_64: gen_op_mov_v_reg(s, MO_32, s->T0, R_EAX); @@ -5172,7 +5172,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) } break; case 0x99: /* CDQ/CWD */ - switch (dflag) { + switch (s->dflag) { #ifdef TARGET_X86_64 case MO_64: gen_op_mov_v_reg(s, MO_64, s->T0, R_EAX); @@ -5199,7 +5199,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) case 0x1af: /* imul Gv, Ev */ case 0x69: /* imul Gv, Ev, I */ case 0x6b: - ot = dflag; + ot = s->dflag; modrm = x86_ldub_code(env, s); reg = ((modrm >> 3) & 7) | REX_R(s); if (b == 0x69) @@ -5251,7 +5251,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) break; case 0x1c0: case 0x1c1: /* xadd Ev, Gv */ - ot = mo_b_d(b, dflag); + ot = mo_b_d(b, s->dflag); modrm = x86_ldub_code(env, s); reg = ((modrm >> 3) & 7) | REX_R(s); mod = (modrm >> 6) & 3; @@ -5283,7 +5283,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) { TCGv oldv, newv, cmpv; - ot = mo_b_d(b, dflag); + ot = mo_b_d(b, s->dflag); modrm = x86_ldub_code(env, s); reg = ((modrm >> 3) & 7) | REX_R(s); mod = (modrm >> 6) & 3; @@ -5344,7 +5344,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) goto illegal_op; } #ifdef TARGET_X86_64 - if (dflag == MO_64) { + if (s->dflag == MO_64) { if (!(s->cpuid_ext_features & CPUID_EXT_CX16)) { goto illegal_op; } @@ -5384,7 +5384,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) } gen_helper_rdrand(s->T0, cpu_env); rm = (modrm & 7) | REX_B(s); - gen_op_mov_reg_v(s, dflag, rm, s->T0); + gen_op_mov_reg_v(s, s->dflag, rm, s->T0); set_cc_op(s, CC_OP_EFLAGS); if (tb_cflags(s->base.tb) & CF_USE_ICOUNT) { gen_jmp(s, s->pc - s->cs_base); @@ -5420,7 +5420,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) break; case 0x68: /* push Iv */ case 0x6a: - ot = mo_pushpop(s, dflag); + ot = mo_pushpop(s, s->dflag); if (b == 0x68) val = insn_get(env, s, ot); else @@ -5505,7 +5505,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) /* mov */ case 0x88: case 0x89: /* mov Gv, Ev */ - ot = mo_b_d(b, dflag); + ot = mo_b_d(b, s->dflag); modrm = x86_ldub_code(env, s); reg = ((modrm >> 3) & 7) | REX_R(s); @@ -5514,7 +5514,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) break; case 0xc6: case 0xc7: /* mov Ev, Iv */ - ot = mo_b_d(b, dflag); + ot = mo_b_d(b, s->dflag); modrm = x86_ldub_code(env, s); mod = (modrm >> 6) & 3; if (mod != 3) { @@ -5531,7 +5531,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) break; case 0x8a: case 0x8b: /* mov Ev, Gv */ - ot = mo_b_d(b, dflag); + ot = mo_b_d(b, s->dflag); modrm = x86_ldub_code(env, s); reg = ((modrm >> 3) & 7) | REX_R(s); @@ -5563,7 +5563,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) if (reg >= 6) goto illegal_op; gen_op_movl_T0_seg(s, reg); - ot = mod == 3 ? dflag : MO_16; + ot = mod == 3 ? s->dflag : MO_16; gen_ldst_modrm(env, s, modrm, ot, OR_TMP0, 1); break; @@ -5576,7 +5576,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) TCGMemOp s_ot; /* d_ot is the size of destination */ - d_ot = dflag; + d_ot = s->dflag; /* ot is the size of source */ ot = (b & 1) + MO_8; /* s_ot is the sign+size of source */ @@ -5627,7 +5627,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) AddressParts a = gen_lea_modrm_0(env, s, modrm); TCGv ea = gen_lea_modrm_1(s, a); gen_lea_v_seg(s, s->aflag, ea, -1, -1); - gen_op_mov_reg_v(s, dflag, reg, s->A0); + gen_op_mov_reg_v(s, s->dflag, reg, s->A0); } break; @@ -5638,7 +5638,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) { target_ulong offset_addr; - ot = mo_b_d(b, dflag); + ot = mo_b_d(b, s->dflag); switch (s->aflag) { #ifdef TARGET_X86_64 case MO_64: @@ -5676,7 +5676,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) break; case 0xb8 ... 0xbf: /* mov R, Iv */ #ifdef TARGET_X86_64 - if (dflag == MO_64) { + if (s->dflag == MO_64) { uint64_t tmp; /* 64 bit case */ tmp = x86_ldq_code(env, s); @@ -5686,7 +5686,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) } else #endif { - ot = dflag; + ot = s->dflag; val = insn_get(env, s, ot); reg = (b & 7) | REX_B(s); tcg_gen_movi_tl(s->T0, val); @@ -5696,13 +5696,13 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) case 0x91 ... 0x97: /* xchg R, EAX */ do_xchg_reg_eax: - ot = dflag; + ot = s->dflag; reg = (b & 7) | REX_B(s); rm = R_EAX; goto do_xchg_reg; case 0x86: case 0x87: /* xchg Ev, Gv */ - ot = mo_b_d(b, dflag); + ot = mo_b_d(b, s->dflag); modrm = x86_ldub_code(env, s); reg = ((modrm >> 3) & 7) | REX_R(s); mod = (modrm >> 6) & 3; @@ -5739,7 +5739,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) case 0x1b5: /* lgs Gv */ op = R_GS; do_lxx: - ot = dflag != MO_16 ? MO_32 : MO_16; + ot = s->dflag != MO_16 ? MO_32 : MO_16; modrm = x86_ldub_code(env, s); reg = ((modrm >> 3) & 7) | REX_R(s); mod = (modrm >> 6) & 3; @@ -5767,7 +5767,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) shift = 2; grp2: { - ot = mo_b_d(b, dflag); + ot = mo_b_d(b, s->dflag); modrm = x86_ldub_code(env, s); mod = (modrm >> 6) & 3; op = (modrm >> 3) & 7; @@ -5820,7 +5820,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) op = 1; shift = 0; do_shiftd: - ot = dflag; + ot = s->dflag; modrm = x86_ldub_code(env, s); mod = (modrm >> 6) & 3; rm = (modrm & 7) | REX_B(s); @@ -5982,7 +5982,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) } break; case 0x0c: /* fldenv mem */ - gen_helper_fldenv(cpu_env, s->A0, tcg_const_i32(dflag - 1)); + gen_helper_fldenv(cpu_env, s->A0, tcg_const_i32(s->dflag - 1)); break; case 0x0d: /* fldcw mem */ tcg_gen_qemu_ld_i32(s->tmp2_i32, s->A0, @@ -5990,7 +5990,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) gen_helper_fldcw(cpu_env, s->tmp2_i32); break; case 0x0e: /* fnstenv mem */ - gen_helper_fstenv(cpu_env, s->A0, tcg_const_i32(dflag - 1)); + gen_helper_fstenv(cpu_env, s->A0, tcg_const_i32(s->dflag - 1)); break; case 0x0f: /* fnstcw mem */ gen_helper_fnstcw(s->tmp2_i32, cpu_env); @@ -6005,10 +6005,10 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) gen_helper_fpop(cpu_env); break; case 0x2c: /* frstor mem */ - gen_helper_frstor(cpu_env, s->A0, tcg_const_i32(dflag - 1)); + gen_helper_frstor(cpu_env, s->A0, tcg_const_i32(s->dflag - 1)); break; case 0x2e: /* fnsave mem */ - gen_helper_fsave(cpu_env, s->A0, tcg_const_i32(dflag - 1)); + gen_helper_fsave(cpu_env, s->A0, tcg_const_i32(s->dflag - 1)); break; case 0x2f: /* fnstsw mem */ gen_helper_fnstsw(s->tmp2_i32, cpu_env); @@ -6350,7 +6350,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) case 0xa4: /* movsS */ case 0xa5: - ot = mo_b_d(b, dflag); + ot = mo_b_d(b, s->dflag); if (prefixes & (PREFIX_REPZ | PREFIX_REPNZ)) { gen_repz_movs(s, ot, pc_start - s->cs_base, s->pc - s->cs_base); } else { @@ -6360,7 +6360,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) case 0xaa: /* stosS */ case 0xab: - ot = mo_b_d(b, dflag); + ot = mo_b_d(b, s->dflag); if (prefixes & (PREFIX_REPZ | PREFIX_REPNZ)) { gen_repz_stos(s, ot, pc_start - s->cs_base, s->pc - s->cs_base); } else { @@ -6369,7 +6369,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) break; case 0xac: /* lodsS */ case 0xad: - ot = mo_b_d(b, dflag); + ot = mo_b_d(b, s->dflag); if (prefixes & (PREFIX_REPZ | PREFIX_REPNZ)) { gen_repz_lods(s, ot, pc_start - s->cs_base, s->pc - s->cs_base); } else { @@ -6378,7 +6378,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) break; case 0xae: /* scasS */ case 0xaf: - ot = mo_b_d(b, dflag); + ot = mo_b_d(b, s->dflag); if (prefixes & PREFIX_REPNZ) { gen_repz_scas(s, ot, pc_start - s->cs_base, s->pc - s->cs_base, 1); } else if (prefixes & PREFIX_REPZ) { @@ -6390,7 +6390,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) case 0xa6: /* cmpsS */ case 0xa7: - ot = mo_b_d(b, dflag); + ot = mo_b_d(b, s->dflag); if (prefixes & PREFIX_REPNZ) { gen_repz_cmps(s, ot, pc_start - s->cs_base, s->pc - s->cs_base, 1); } else if (prefixes & PREFIX_REPZ) { @@ -6401,7 +6401,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) break; case 0x6c: /* insS */ case 0x6d: - ot = mo_b_d32(b, dflag); + ot = mo_b_d32(b, s->dflag); tcg_gen_ext16u_tl(s->T0, cpu_regs[R_EDX]); gen_check_io(s, ot, pc_start - s->cs_base, SVM_IOIO_TYPE_MASK | svm_is_rep(prefixes) | 4); @@ -6416,7 +6416,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) break; case 0x6e: /* outsS */ case 0x6f: - ot = mo_b_d32(b, dflag); + ot = mo_b_d32(b, s->dflag); tcg_gen_ext16u_tl(s->T0, cpu_regs[R_EDX]); gen_check_io(s, ot, pc_start - s->cs_base, svm_is_rep(prefixes) | 4); @@ -6435,7 +6435,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) case 0xe4: case 0xe5: - ot = mo_b_d32(b, dflag); + ot = mo_b_d32(b, s->dflag); val = x86_ldub_code(env, s); tcg_gen_movi_tl(s->T0, val); gen_check_io(s, ot, pc_start - s->cs_base, @@ -6453,7 +6453,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) break; case 0xe6: case 0xe7: - ot = mo_b_d32(b, dflag); + ot = mo_b_d32(b, s->dflag); val = x86_ldub_code(env, s); tcg_gen_movi_tl(s->T0, val); gen_check_io(s, ot, pc_start - s->cs_base, @@ -6473,7 +6473,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) break; case 0xec: case 0xed: - ot = mo_b_d32(b, dflag); + ot = mo_b_d32(b, s->dflag); tcg_gen_ext16u_tl(s->T0, cpu_regs[R_EDX]); gen_check_io(s, ot, pc_start - s->cs_base, SVM_IOIO_TYPE_MASK | svm_is_rep(prefixes)); @@ -6490,7 +6490,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) break; case 0xee: case 0xef: - ot = mo_b_d32(b, dflag); + ot = mo_b_d32(b, s->dflag); tcg_gen_ext16u_tl(s->T0, cpu_regs[R_EDX]); gen_check_io(s, ot, pc_start - s->cs_base, svm_is_rep(prefixes)); @@ -6533,21 +6533,21 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) if (s->pe && !s->vm86) { gen_update_cc_op(s); gen_jmp_im(s, pc_start - s->cs_base); - gen_helper_lret_protected(cpu_env, tcg_const_i32(dflag - 1), + gen_helper_lret_protected(cpu_env, tcg_const_i32(s->dflag - 1), tcg_const_i32(val)); } else { gen_stack_A0(s); /* pop offset */ - gen_op_ld_v(s, dflag, s->T0, s->A0); + gen_op_ld_v(s, s->dflag, s->T0, s->A0); /* NOTE: keeping EIP updated is not a problem in case of exception */ gen_op_jmp_v(s->T0); /* pop selector */ - gen_add_A0_im(s, 1 << dflag); - gen_op_ld_v(s, dflag, s->T0, s->A0); + gen_add_A0_im(s, 1 << s->dflag); + gen_op_ld_v(s, s->dflag, s->T0, s->A0); gen_op_movl_seg_T0_vm(s, R_CS); /* add stack offset */ - gen_stack_update(s, val + (2 << dflag)); + gen_stack_update(s, val + (2 << s->dflag)); } gen_eob(s); break; @@ -6558,17 +6558,17 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) gen_svm_check_intercept(s, pc_start, SVM_EXIT_IRET); if (!s->pe) { /* real mode */ - gen_helper_iret_real(cpu_env, tcg_const_i32(dflag - 1)); + gen_helper_iret_real(cpu_env, tcg_const_i32(s->dflag - 1)); set_cc_op(s, CC_OP_EFLAGS); } else if (s->vm86) { if (s->iopl != 3) { gen_exception(s, EXCP0D_GPF, pc_start - s->cs_base); } else { - gen_helper_iret_real(cpu_env, tcg_const_i32(dflag - 1)); + gen_helper_iret_real(cpu_env, tcg_const_i32(s->dflag - 1)); set_cc_op(s, CC_OP_EFLAGS); } } else { - gen_helper_iret_protected(cpu_env, tcg_const_i32(dflag - 1), + gen_helper_iret_protected(cpu_env, tcg_const_i32(s->dflag - 1), tcg_const_i32(s->pc - s->cs_base)); set_cc_op(s, CC_OP_EFLAGS); } @@ -6576,14 +6576,14 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) break; case 0xe8: /* call im */ { - if (dflag != MO_16) { + if (s->dflag != MO_16) { tval = (int32_t)insn_get(env, s, MO_32); } else { tval = (int16_t)insn_get(env, s, MO_16); } next_eip = s->pc - s->cs_base; tval += next_eip; - if (dflag == MO_16) { + if (s->dflag == MO_16) { tval &= 0xffff; } else if (!CODE64(s)) { tval &= 0xffffffff; @@ -6600,7 +6600,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) if (CODE64(s)) goto illegal_op; - ot = dflag; + ot = s->dflag; offset = insn_get(env, s, ot); selector = insn_get(env, s, MO_16); @@ -6609,13 +6609,13 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) } goto do_lcall; case 0xe9: /* jmp im */ - if (dflag != MO_16) { + if (s->dflag != MO_16) { tval = (int32_t)insn_get(env, s, MO_32); } else { tval = (int16_t)insn_get(env, s, MO_16); } tval += s->pc - s->cs_base; - if (dflag == MO_16) { + if (s->dflag == MO_16) { tval &= 0xffff; } else if (!CODE64(s)) { tval &= 0xffffffff; @@ -6629,7 +6629,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) if (CODE64(s)) goto illegal_op; - ot = dflag; + ot = s->dflag; offset = insn_get(env, s, ot); selector = insn_get(env, s, MO_16); @@ -6640,7 +6640,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) case 0xeb: /* jmp Jb */ tval = (int8_t)insn_get(env, s, MO_8); tval += s->pc - s->cs_base; - if (dflag == MO_16) { + if (s->dflag == MO_16) { tval &= 0xffff; } gen_jmp(s, tval); @@ -6649,7 +6649,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) tval = (int8_t)insn_get(env, s, MO_8); goto do_jcc; case 0x180 ... 0x18f: /* jcc Jv */ - if (dflag != MO_16) { + if (s->dflag != MO_16) { tval = (int32_t)insn_get(env, s, MO_32); } else { tval = (int16_t)insn_get(env, s, MO_16); @@ -6657,7 +6657,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) do_jcc: next_eip = s->pc - s->cs_base; tval += next_eip; - if (dflag == MO_16) { + if (s->dflag == MO_16) { tval &= 0xffff; } gen_bnd_jmp(s); @@ -6673,7 +6673,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) if (!(s->cpuid_features & CPUID_CMOV)) { goto illegal_op; } - ot = dflag; + ot = s->dflag; modrm = x86_ldub_code(env, s); reg = ((modrm >> 3) & 7) | REX_R(s); gen_cmovcc1(env, s, ot, b, modrm, reg); @@ -6698,7 +6698,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) } else { ot = gen_pop_T0(s); if (s->cpl == 0) { - if (dflag != MO_16) { + if (s->dflag != MO_16) { gen_helper_write_eflags(cpu_env, s->T0, tcg_const_i32((TF_MASK | AC_MASK | ID_MASK | NT_MASK | @@ -6713,7 +6713,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) } } else { if (s->cpl <= s->iopl) { - if (dflag != MO_16) { + if (s->dflag != MO_16) { gen_helper_write_eflags(cpu_env, s->T0, tcg_const_i32((TF_MASK | AC_MASK | @@ -6730,7 +6730,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) & 0xffff)); } } else { - if (dflag != MO_16) { + if (s->dflag != MO_16) { gen_helper_write_eflags(cpu_env, s->T0, tcg_const_i32((TF_MASK | AC_MASK | ID_MASK | NT_MASK))); @@ -6790,7 +6790,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) /************************/ /* bit operations */ case 0x1ba: /* bt/bts/btr/btc Gv, im */ - ot = dflag; + ot = s->dflag; modrm = x86_ldub_code(env, s); op = (modrm >> 3) & 7; mod = (modrm >> 6) & 3; @@ -6823,7 +6823,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) case 0x1bb: /* btc */ op = 3; do_btx: - ot = dflag; + ot = s->dflag; modrm = x86_ldub_code(env, s); reg = ((modrm >> 3) & 7) | REX_R(s); mod = (modrm >> 6) & 3; @@ -6928,7 +6928,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) break; case 0x1bc: /* bsf / tzcnt */ case 0x1bd: /* bsr / lzcnt */ - ot = dflag; + ot = s->dflag; modrm = x86_ldub_code(env, s); reg = ((modrm >> 3) & 7) | REX_R(s); gen_ldst_modrm(env, s, modrm, ot, OR_TMP0, 0); @@ -7102,7 +7102,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) case 0x62: /* bound */ if (CODE64(s)) goto illegal_op; - ot = dflag; + ot = s->dflag; modrm = x86_ldub_code(env, s); reg = (modrm >> 3) & 7; mod = (modrm >> 6) & 3; @@ -7120,7 +7120,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) case 0x1c8 ... 0x1cf: /* bswap reg */ reg = (b & 7) | REX_B(s); #ifdef TARGET_X86_64 - if (dflag == MO_64) { + if (s->dflag == MO_64) { gen_op_mov_v_reg(s, MO_64, s->T0, reg); tcg_gen_bswap64_i64(s->T0, s->T0); gen_op_mov_reg_v(s, MO_64, reg, s->T0); @@ -7150,7 +7150,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) tval = (int8_t)insn_get(env, s, MO_8); next_eip = s->pc - s->cs_base; tval += next_eip; - if (dflag == MO_16) { + if (s->dflag == MO_16) { tval &= 0xffff; } @@ -7233,7 +7233,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) if (!s->pe) { gen_exception(s, EXCP0D_GPF, pc_start - s->cs_base); } else { - gen_helper_sysexit(cpu_env, tcg_const_i32(dflag - 1)); + gen_helper_sysexit(cpu_env, tcg_const_i32(s->dflag - 1)); gen_eob(s); } break; @@ -7252,7 +7252,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) if (!s->pe) { gen_exception(s, EXCP0D_GPF, pc_start - s->cs_base); } else { - gen_helper_sysret(cpu_env, tcg_const_i32(dflag - 1)); + gen_helper_sysret(cpu_env, tcg_const_i32(s->dflag - 1)); /* condition codes are modified only in long mode */ if (s->lma) { set_cc_op(s, CC_OP_EFLAGS); @@ -7291,7 +7291,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) gen_svm_check_intercept(s, pc_start, SVM_EXIT_LDTR_READ); tcg_gen_ld32u_tl(s->T0, cpu_env, offsetof(CPUX86State, ldt.selector)); - ot = mod == 3 ? dflag : MO_16; + ot = mod == 3 ? s->dflag : MO_16; gen_ldst_modrm(env, s, modrm, ot, OR_TMP0, 1); break; case 2: /* lldt */ @@ -7312,7 +7312,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) gen_svm_check_intercept(s, pc_start, SVM_EXIT_TR_READ); tcg_gen_ld32u_tl(s->T0, cpu_env, offsetof(CPUX86State, tr.selector)); - ot = mod == 3 ? dflag : MO_16; + ot = mod == 3 ? s->dflag : MO_16; gen_ldst_modrm(env, s, modrm, ot, OR_TMP0, 1); break; case 3: /* ltr */ @@ -7356,7 +7356,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) gen_op_st_v(s, MO_16, s->T0, s->A0); gen_add_A0_im(s, 2); tcg_gen_ld_tl(s->T0, cpu_env, offsetof(CPUX86State, gdt.base)); - if (dflag == MO_16) { + if (s->dflag == MO_16) { tcg_gen_andi_tl(s->T0, s->T0, 0xffffff); } gen_op_st_v(s, CODE64(s) + MO_32, s->T0, s->A0); @@ -7411,7 +7411,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) gen_op_st_v(s, MO_16, s->T0, s->A0); gen_add_A0_im(s, 2); tcg_gen_ld_tl(s->T0, cpu_env, offsetof(CPUX86State, idt.base)); - if (dflag == MO_16) { + if (s->dflag == MO_16) { tcg_gen_andi_tl(s->T0, s->T0, 0xffffff); } gen_op_st_v(s, CODE64(s) + MO_32, s->T0, s->A0); @@ -7561,7 +7561,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) gen_op_ld_v(s, MO_16, s->T1, s->A0); gen_add_A0_im(s, 2); gen_op_ld_v(s, CODE64(s) + MO_32, s->T0, s->A0); - if (dflag == MO_16) { + if (s->dflag == MO_16) { tcg_gen_andi_tl(s->T0, s->T0, 0xffffff); } tcg_gen_st_tl(s->T0, cpu_env, offsetof(CPUX86State, gdt.base)); @@ -7578,7 +7578,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) gen_op_ld_v(s, MO_16, s->T1, s->A0); gen_add_A0_im(s, 2); gen_op_ld_v(s, CODE64(s) + MO_32, s->T0, s->A0); - if (dflag == MO_16) { + if (s->dflag == MO_16) { tcg_gen_andi_tl(s->T0, s->T0, 0xffffff); } tcg_gen_st_tl(s->T0, cpu_env, offsetof(CPUX86State, idt.base)); @@ -7689,7 +7689,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) if (CODE64(s)) { int d_ot; /* d_ot is the size of destination */ - d_ot = dflag; + d_ot = s->dflag; modrm = x86_ldub_code(env, s); reg = ((modrm >> 3) & 7) | REX_R(s); @@ -7764,7 +7764,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) TCGv t0; if (!s->pe || s->vm86) goto illegal_op; - ot = dflag != MO_16 ? MO_32 : MO_16; + ot = s->dflag != MO_16 ? MO_32 : MO_16; modrm = x86_ldub_code(env, s); reg = ((modrm >> 3) & 7) | REX_R(s); gen_ldst_modrm(env, s, modrm, MO_16, OR_TMP0, 0); @@ -8103,7 +8103,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) case 0x1c3: /* MOVNTI reg, mem */ if (!(s->cpuid_features & CPUID_SSE2)) goto illegal_op; - ot = mo_64_32(dflag); + ot = mo_64_32(s->dflag); modrm = x86_ldub_code(env, s); mod = (modrm >> 6) & 3; if (mod == 3) @@ -8339,7 +8339,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) if (s->prefix & PREFIX_DATA) { ot = MO_16; } else { - ot = mo_64_32(dflag); + ot = mo_64_32(s->dflag); } gen_ldst_modrm(env, s, modrm, ot, OR_TMP0, 0); From patchwork Wed Aug 21 17:28:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Bobek X-Patchwork-Id: 11107653 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 56C5E13B1 for ; Wed, 21 Aug 2019 17:43:48 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1E01E22D6D for ; Wed, 21 Aug 2019 17:43:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Y9fCm6fR" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1E01E22D6D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:51276 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0UeA-0002mP-Ut for patchwork-qemu-devel@patchwork.kernel.org; Wed, 21 Aug 2019 13:43:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40682) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0UQy-0000ey-Cp for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i0UQv-0006z6-Vt for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:08 -0400 Received: from mail-yb1-xb41.google.com ([2607:f8b0:4864:20::b41]:44224) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i0UQv-0006yj-QF for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:05 -0400 Received: by mail-yb1-xb41.google.com with SMTP id y21so1328936ybi.11 for ; Wed, 21 Aug 2019 10:30:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=2MVezhOnSXMFe1BhwqdhtO91Z2Tkal6SpzZGZbQLrrE=; b=Y9fCm6fRzR5Do4wFxbVCzycW+dRB9A5U21RQxCwNvF21GV2IgfRoxPjayXsvMOh/yi krMy3ZAU9hgZSJ/qoKMiQLIbGAaovclhudGyXZLGcb1gDePHV9bj4iN4R8V1GuOKo3de s2zhlnd0+KaMaHcFfbTwIikOlnqKnH5SlayauMm/7+usalz1a+/9E6qPP6vQMRAn0wtm yu/O0uH5I7dEqk40ZfFIAzh8WAFFidMLkrIWvmwZK1RYhblANmPj06ojR1eadNZr+tXX ZzNylor+akBybUu1ufCBgzzdJi9sIhiXYGD251Gp4SN/hCYU5U8otKKxyG2v5xFLeWtB uqwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=2MVezhOnSXMFe1BhwqdhtO91Z2Tkal6SpzZGZbQLrrE=; b=YaeOlLz2gKoITIeW41uqzKhEMdFC+jS6gypiInIEHoGsg5yTDoBmb7mPMY7RaVXlnT u+DN7zxkSg/tESDyu9j2S6ZaJQhfNXWBp1rq2Nx3KlW8rTI+z/RSRxnxkx0uSbJ1Njxf 0sVYG/r0C5umE0N2X/0jHNQoftKtw1I1QeepoaVy1gp2uDcA0iuVX7uOl+kaTM33ZoOi swlleuQFdPWr2jq4mnMoeyP/UBSV/8DV54o1TDBEkG6CiYlpGw/qYWp4WVGI3hvDXmRs 09hFK+H9G1y/hC7+U6MxEr4fLqUmElhgg5d7M9QLaEAUfMZui6JPkIzB1lVe5/MY8tJi IwLg== X-Gm-Message-State: APjAAAV9MF8KBCv6W0nl3MgH2Nvo62W/4xHmJcPvnNsulqe8Uw+FquX8 skf9gBdL0Dd6mQEoXPi7p4QUudyb X-Google-Smtp-Source: APXvYqyDR9X7Yj5/mbMoHZLigfKava5RCY8urorR5JBSWk8bL5FE/psxWZeToP3Q6UlPUMbWe27C+Q== X-Received: by 2002:a25:dc87:: with SMTP id y129mr15425092ybe.424.1566408604920; Wed, 21 Aug 2019 10:30:04 -0700 (PDT) Received: from localhost.localdomain ([2601:c0:c67f:e390::3]) by smtp.gmail.com with ESMTPSA id l71sm2826167ywl.39.2019.08.21.10.30.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Aug 2019 10:30:04 -0700 (PDT) From: Jan Bobek To: qemu-devel@nongnu.org Date: Wed, 21 Aug 2019 13:28:40 -0400 Message-Id: <20190821172951.15333-5-jan.bobek@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190821172951.15333-1-jan.bobek@gmail.com> References: <20190821172951.15333-1-jan.bobek@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::b41 Subject: [Qemu-devel] [RFC PATCH v4 04/75] target/i386: use prefix from DisasContext X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jan Bobek , =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Use prefix from DisasContext instead of the local helper variable prefixes. Suggested-by: Richard Henderson Signed-off-by: Jan Bobek --- target/i386/translate.c | 110 ++++++++++++++++++++-------------------- 1 file changed, 55 insertions(+), 55 deletions(-) diff --git a/target/i386/translate.c b/target/i386/translate.c index 7226c67d2e..99a9097c49 100644 --- a/target/i386/translate.c +++ b/target/i386/translate.c @@ -6351,7 +6351,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) case 0xa4: /* movsS */ case 0xa5: ot = mo_b_d(b, s->dflag); - if (prefixes & (PREFIX_REPZ | PREFIX_REPNZ)) { + if (s->prefix & (PREFIX_REPZ | PREFIX_REPNZ)) { gen_repz_movs(s, ot, pc_start - s->cs_base, s->pc - s->cs_base); } else { gen_movs(s, ot); @@ -6361,7 +6361,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) case 0xaa: /* stosS */ case 0xab: ot = mo_b_d(b, s->dflag); - if (prefixes & (PREFIX_REPZ | PREFIX_REPNZ)) { + if (s->prefix & (PREFIX_REPZ | PREFIX_REPNZ)) { gen_repz_stos(s, ot, pc_start - s->cs_base, s->pc - s->cs_base); } else { gen_stos(s, ot); @@ -6370,7 +6370,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) case 0xac: /* lodsS */ case 0xad: ot = mo_b_d(b, s->dflag); - if (prefixes & (PREFIX_REPZ | PREFIX_REPNZ)) { + if (s->prefix & (PREFIX_REPZ | PREFIX_REPNZ)) { gen_repz_lods(s, ot, pc_start - s->cs_base, s->pc - s->cs_base); } else { gen_lods(s, ot); @@ -6379,9 +6379,9 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) case 0xae: /* scasS */ case 0xaf: ot = mo_b_d(b, s->dflag); - if (prefixes & PREFIX_REPNZ) { + if (s->prefix & PREFIX_REPNZ) { gen_repz_scas(s, ot, pc_start - s->cs_base, s->pc - s->cs_base, 1); - } else if (prefixes & PREFIX_REPZ) { + } else if (s->prefix & PREFIX_REPZ) { gen_repz_scas(s, ot, pc_start - s->cs_base, s->pc - s->cs_base, 0); } else { gen_scas(s, ot); @@ -6391,9 +6391,9 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) case 0xa6: /* cmpsS */ case 0xa7: ot = mo_b_d(b, s->dflag); - if (prefixes & PREFIX_REPNZ) { + if (s->prefix & PREFIX_REPNZ) { gen_repz_cmps(s, ot, pc_start - s->cs_base, s->pc - s->cs_base, 1); - } else if (prefixes & PREFIX_REPZ) { + } else if (s->prefix & PREFIX_REPZ) { gen_repz_cmps(s, ot, pc_start - s->cs_base, s->pc - s->cs_base, 0); } else { gen_cmps(s, ot); @@ -6404,8 +6404,8 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) ot = mo_b_d32(b, s->dflag); tcg_gen_ext16u_tl(s->T0, cpu_regs[R_EDX]); gen_check_io(s, ot, pc_start - s->cs_base, - SVM_IOIO_TYPE_MASK | svm_is_rep(prefixes) | 4); - if (prefixes & (PREFIX_REPZ | PREFIX_REPNZ)) { + SVM_IOIO_TYPE_MASK | svm_is_rep(s->prefix) | 4); + if (s->prefix & (PREFIX_REPZ | PREFIX_REPNZ)) { gen_repz_ins(s, ot, pc_start - s->cs_base, s->pc - s->cs_base); } else { gen_ins(s, ot); @@ -6419,8 +6419,8 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) ot = mo_b_d32(b, s->dflag); tcg_gen_ext16u_tl(s->T0, cpu_regs[R_EDX]); gen_check_io(s, ot, pc_start - s->cs_base, - svm_is_rep(prefixes) | 4); - if (prefixes & (PREFIX_REPZ | PREFIX_REPNZ)) { + svm_is_rep(s->prefix) | 4); + if (s->prefix & (PREFIX_REPZ | PREFIX_REPNZ)) { gen_repz_outs(s, ot, pc_start - s->cs_base, s->pc - s->cs_base); } else { gen_outs(s, ot); @@ -6439,7 +6439,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) val = x86_ldub_code(env, s); tcg_gen_movi_tl(s->T0, val); gen_check_io(s, ot, pc_start - s->cs_base, - SVM_IOIO_TYPE_MASK | svm_is_rep(prefixes)); + SVM_IOIO_TYPE_MASK | svm_is_rep(s->prefix)); if (tb_cflags(s->base.tb) & CF_USE_ICOUNT) { gen_io_start(); } @@ -6457,7 +6457,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) val = x86_ldub_code(env, s); tcg_gen_movi_tl(s->T0, val); gen_check_io(s, ot, pc_start - s->cs_base, - svm_is_rep(prefixes)); + svm_is_rep(s->prefix)); gen_op_mov_v_reg(s, ot, s->T1, R_EAX); if (tb_cflags(s->base.tb) & CF_USE_ICOUNT) { @@ -6476,7 +6476,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) ot = mo_b_d32(b, s->dflag); tcg_gen_ext16u_tl(s->T0, cpu_regs[R_EDX]); gen_check_io(s, ot, pc_start - s->cs_base, - SVM_IOIO_TYPE_MASK | svm_is_rep(prefixes)); + SVM_IOIO_TYPE_MASK | svm_is_rep(s->prefix)); if (tb_cflags(s->base.tb) & CF_USE_ICOUNT) { gen_io_start(); } @@ -6493,7 +6493,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) ot = mo_b_d32(b, s->dflag); tcg_gen_ext16u_tl(s->T0, cpu_regs[R_EDX]); gen_check_io(s, ot, pc_start - s->cs_base, - svm_is_rep(prefixes)); + svm_is_rep(s->prefix)); gen_op_mov_v_reg(s, ot, s->T1, R_EAX); if (tb_cflags(s->base.tb) & CF_USE_ICOUNT) { @@ -6935,7 +6935,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) gen_extu(ot, s->T0); /* Note that lzcnt and tzcnt are in different extensions. */ - if ((prefixes & PREFIX_REPZ) + if ((s->prefix & PREFIX_REPZ) && (b & 1 ? s->cpuid_ext3_features & CPUID_EXT3_ABM : s->cpuid_7_0_ebx_features & CPUID_7_0_EBX_BMI1)) { @@ -7028,14 +7028,14 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) /* misc */ case 0x90: /* nop */ /* XXX: correct lock test for all insn */ - if (prefixes & PREFIX_LOCK) { + if (s->prefix & PREFIX_LOCK) { goto illegal_op; } /* If REX_B is set, then this is xchg eax, r8d, not a nop. */ if (REX_B(s)) { goto do_xchg_reg_eax; } - if (prefixes & PREFIX_REPZ) { + if (s->prefix & PREFIX_REPZ) { gen_update_cc_op(s); gen_jmp_im(s, pc_start - s->cs_base); gen_helper_pause(cpu_env, tcg_const_i32(s->pc - pc_start)); @@ -7597,7 +7597,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) gen_ldst_modrm(env, s, modrm, ot, OR_TMP0, 1); break; case 0xee: /* rdpkru */ - if (prefixes & PREFIX_LOCK) { + if (s->prefix & PREFIX_LOCK) { goto illegal_op; } tcg_gen_trunc_tl_i32(s->tmp2_i32, cpu_regs[R_ECX]); @@ -7605,7 +7605,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) tcg_gen_extr_i64_tl(cpu_regs[R_EAX], cpu_regs[R_EDX], s->tmp1_i64); break; case 0xef: /* wrpkru */ - if (prefixes & PREFIX_LOCK) { + if (s->prefix & PREFIX_LOCK) { goto illegal_op; } tcg_gen_concat_tl_i64(s->tmp1_i64, cpu_regs[R_EAX], @@ -7808,18 +7808,18 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) if (s->flags & HF_MPX_EN_MASK) { mod = (modrm >> 6) & 3; reg = ((modrm >> 3) & 7) | REX_R(s); - if (prefixes & PREFIX_REPZ) { + if (s->prefix & PREFIX_REPZ) { /* bndcl */ if (reg >= 4 - || (prefixes & PREFIX_LOCK) + || (s->prefix & PREFIX_LOCK) || s->aflag == MO_16) { goto illegal_op; } gen_bndck(env, s, modrm, TCG_COND_LTU, cpu_bndl[reg]); - } else if (prefixes & PREFIX_REPNZ) { + } else if (s->prefix & PREFIX_REPNZ) { /* bndcu */ if (reg >= 4 - || (prefixes & PREFIX_LOCK) + || (s->prefix & PREFIX_LOCK) || s->aflag == MO_16) { goto illegal_op; } @@ -7827,14 +7827,14 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) tcg_gen_not_i64(notu, cpu_bndu[reg]); gen_bndck(env, s, modrm, TCG_COND_GTU, notu); tcg_temp_free_i64(notu); - } else if (prefixes & PREFIX_DATA) { + } else if (s->prefix & PREFIX_DATA) { /* bndmov -- from reg/mem */ if (reg >= 4 || s->aflag == MO_16) { goto illegal_op; } if (mod == 3) { int reg2 = (modrm & 7) | REX_B(s); - if (reg2 >= 4 || (prefixes & PREFIX_LOCK)) { + if (reg2 >= 4 || (s->prefix & PREFIX_LOCK)) { goto illegal_op; } if (s->flags & HF_MPX_IU_MASK) { @@ -7863,7 +7863,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) /* bndldx */ AddressParts a = gen_lea_modrm_0(env, s, modrm); if (reg >= 4 - || (prefixes & PREFIX_LOCK) + || (s->prefix & PREFIX_LOCK) || s->aflag == MO_16 || a.base < -1) { goto illegal_op; @@ -7898,10 +7898,10 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) if (s->flags & HF_MPX_EN_MASK) { mod = (modrm >> 6) & 3; reg = ((modrm >> 3) & 7) | REX_R(s); - if (mod != 3 && (prefixes & PREFIX_REPZ)) { + if (mod != 3 && (s->prefix & PREFIX_REPZ)) { /* bndmk */ if (reg >= 4 - || (prefixes & PREFIX_LOCK) + || (s->prefix & PREFIX_LOCK) || s->aflag == MO_16) { goto illegal_op; } @@ -7926,22 +7926,22 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) /* bnd registers are now in-use */ gen_set_hflag(s, HF_MPX_IU_MASK); break; - } else if (prefixes & PREFIX_REPNZ) { + } else if (s->prefix & PREFIX_REPNZ) { /* bndcn */ if (reg >= 4 - || (prefixes & PREFIX_LOCK) + || (s->prefix & PREFIX_LOCK) || s->aflag == MO_16) { goto illegal_op; } gen_bndck(env, s, modrm, TCG_COND_GTU, cpu_bndu[reg]); - } else if (prefixes & PREFIX_DATA) { + } else if (s->prefix & PREFIX_DATA) { /* bndmov -- to reg/mem */ if (reg >= 4 || s->aflag == MO_16) { goto illegal_op; } if (mod == 3) { int reg2 = (modrm & 7) | REX_B(s); - if (reg2 >= 4 || (prefixes & PREFIX_LOCK)) { + if (reg2 >= 4 || (s->prefix & PREFIX_LOCK)) { goto illegal_op; } if (s->flags & HF_MPX_IU_MASK) { @@ -7968,7 +7968,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) /* bndstx */ AddressParts a = gen_lea_modrm_0(env, s, modrm); if (reg >= 4 - || (prefixes & PREFIX_LOCK) + || (s->prefix & PREFIX_LOCK) || s->aflag == MO_16 || a.base < -1) { goto illegal_op; @@ -8016,7 +8016,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) ot = MO_64; else ot = MO_32; - if ((prefixes & PREFIX_LOCK) && (reg == 0) && + if ((s->prefix & PREFIX_LOCK) && (reg == 0) && (s->cpuid_ext3_features & CPUID_EXT3_CR8LEG)) { reg = 8; } @@ -8117,7 +8117,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) switch (modrm) { CASE_MODRM_MEM_OP(0): /* fxsave */ if (!(s->cpuid_features & CPUID_FXSR) - || (prefixes & PREFIX_LOCK)) { + || (s->prefix & PREFIX_LOCK)) { goto illegal_op; } if ((s->flags & HF_EM_MASK) || (s->flags & HF_TS_MASK)) { @@ -8130,7 +8130,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) CASE_MODRM_MEM_OP(1): /* fxrstor */ if (!(s->cpuid_features & CPUID_FXSR) - || (prefixes & PREFIX_LOCK)) { + || (s->prefix & PREFIX_LOCK)) { goto illegal_op; } if ((s->flags & HF_EM_MASK) || (s->flags & HF_TS_MASK)) { @@ -8169,8 +8169,8 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) CASE_MODRM_MEM_OP(4): /* xsave */ if ((s->cpuid_ext_features & CPUID_EXT_XSAVE) == 0 - || (prefixes & (PREFIX_LOCK | PREFIX_DATA - | PREFIX_REPZ | PREFIX_REPNZ))) { + || (s->prefix & (PREFIX_LOCK | PREFIX_DATA + | PREFIX_REPZ | PREFIX_REPNZ))) { goto illegal_op; } gen_lea_modrm(env, s, modrm); @@ -8181,8 +8181,8 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) CASE_MODRM_MEM_OP(5): /* xrstor */ if ((s->cpuid_ext_features & CPUID_EXT_XSAVE) == 0 - || (prefixes & (PREFIX_LOCK | PREFIX_DATA - | PREFIX_REPZ | PREFIX_REPNZ))) { + || (s->prefix & (PREFIX_LOCK | PREFIX_DATA + | PREFIX_REPZ | PREFIX_REPNZ))) { goto illegal_op; } gen_lea_modrm(env, s, modrm); @@ -8197,10 +8197,10 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) break; CASE_MODRM_MEM_OP(6): /* xsaveopt / clwb */ - if (prefixes & PREFIX_LOCK) { + if (s->prefix & PREFIX_LOCK) { goto illegal_op; } - if (prefixes & PREFIX_DATA) { + if (s->prefix & PREFIX_DATA) { /* clwb */ if (!(s->cpuid_7_0_ebx_features & CPUID_7_0_EBX_CLWB)) { goto illegal_op; @@ -8210,7 +8210,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) /* xsaveopt */ if ((s->cpuid_ext_features & CPUID_EXT_XSAVE) == 0 || (s->cpuid_xsave_features & CPUID_XSAVE_XSAVEOPT) == 0 - || (prefixes & (PREFIX_REPZ | PREFIX_REPNZ))) { + || (s->prefix & (PREFIX_REPZ | PREFIX_REPNZ))) { goto illegal_op; } gen_lea_modrm(env, s, modrm); @@ -8221,10 +8221,10 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) break; CASE_MODRM_MEM_OP(7): /* clflush / clflushopt */ - if (prefixes & PREFIX_LOCK) { + if (s->prefix & PREFIX_LOCK) { goto illegal_op; } - if (prefixes & PREFIX_DATA) { + if (s->prefix & PREFIX_DATA) { /* clflushopt */ if (!(s->cpuid_7_0_ebx_features & CPUID_7_0_EBX_CLFLUSHOPT)) { goto illegal_op; @@ -8244,8 +8244,8 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) case 0xd0 ... 0xd7: /* wrfsbase (f3 0f ae /2) */ case 0xd8 ... 0xdf: /* wrgsbase (f3 0f ae /3) */ if (CODE64(s) - && (prefixes & PREFIX_REPZ) - && !(prefixes & PREFIX_LOCK) + && (s->prefix & PREFIX_REPZ) + && !(s->prefix & PREFIX_LOCK) && (s->cpuid_7_0_ebx_features & CPUID_7_0_EBX_FSGSBASE)) { TCGv base, treg, src, dst; @@ -8274,10 +8274,10 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) goto unknown_op; case 0xf8: /* sfence / pcommit */ - if (prefixes & PREFIX_DATA) { + if (s->prefix & PREFIX_DATA) { /* pcommit */ if (!(s->cpuid_7_0_ebx_features & CPUID_7_0_EBX_PCOMMIT) - || (prefixes & PREFIX_LOCK)) { + || (s->prefix & PREFIX_LOCK)) { goto illegal_op; } break; @@ -8285,21 +8285,21 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) /* fallthru */ case 0xf9 ... 0xff: /* sfence */ if (!(s->cpuid_features & CPUID_SSE) - || (prefixes & PREFIX_LOCK)) { + || (s->prefix & PREFIX_LOCK)) { goto illegal_op; } tcg_gen_mb(TCG_MO_ST_ST | TCG_BAR_SC); break; case 0xe8 ... 0xef: /* lfence */ if (!(s->cpuid_features & CPUID_SSE) - || (prefixes & PREFIX_LOCK)) { + || (s->prefix & PREFIX_LOCK)) { goto illegal_op; } tcg_gen_mb(TCG_MO_LD_LD | TCG_BAR_SC); break; case 0xf0 ... 0xf7: /* mfence */ if (!(s->cpuid_features & CPUID_SSE2) - || (prefixes & PREFIX_LOCK)) { + || (s->prefix & PREFIX_LOCK)) { goto illegal_op; } tcg_gen_mb(TCG_MO_ALL | TCG_BAR_SC); @@ -8327,8 +8327,8 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) gen_eob(s); break; case 0x1b8: /* SSE4.2 popcnt */ - if ((prefixes & (PREFIX_REPZ | PREFIX_LOCK | PREFIX_REPNZ)) != - PREFIX_REPZ) + if ((s->prefix & (PREFIX_REPZ | PREFIX_LOCK | PREFIX_REPNZ)) != + PREFIX_REPZ) goto illegal_op; if (!(s->cpuid_ext_features & CPUID_EXT_POPCNT)) goto illegal_op; From patchwork Wed Aug 21 17:28:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Bobek X-Patchwork-Id: 11107673 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E286514DE for ; Wed, 21 Aug 2019 17:50:58 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B9BDB22D6D for ; Wed, 21 Aug 2019 17:50:58 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="k02dIzb9" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B9BDB22D6D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:51344 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0Ul7-0003QO-CS for patchwork-qemu-devel@patchwork.kernel.org; Wed, 21 Aug 2019 13:50:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40689) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0UQy-0000fT-MX for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i0UQx-00070J-Hr for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:08 -0400 Received: from mail-yb1-xb41.google.com ([2607:f8b0:4864:20::b41]:38903) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i0UQx-0006zv-9M for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:07 -0400 Received: by mail-yb1-xb41.google.com with SMTP id j199so1342110ybg.5 for ; Wed, 21 Aug 2019 10:30:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ZYdh/Z3ecBgZtHTkBl32/Cm7PyOKZEPBtGwbEDdvb8Y=; b=k02dIzb9SvRf/8E6UwVLVT3c5BwFV0wqo0v/von+zbOmBfSjL3nADbQxWSPTP+IXMD qKBc5grjXGvhYlEPcfQw/oiCM6J/G56xQRIg//DzBV8xMTiW1NksFIHJnw02HLdGOejs 8u+ypTIKXo22oYRjSgHdxJkgYv2Jc+bXOhS2oWU6CwZ0d8WRReep83/rASzaXMx2efCu zGe+6V9H3ImZ+0XWncrFXmLieL735cfDL7Nrpwun2N6EX1W61dSomx6L3D9jM1dfOJfp ft7Z68BySH/tpWJr+TEWL8rcvCKPViRxg1+RkdcRI6Dr+TqZ3HXRK51ViDNMK5jusv/M yNxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ZYdh/Z3ecBgZtHTkBl32/Cm7PyOKZEPBtGwbEDdvb8Y=; b=LCpX2/CTk//J5+TfZDycYmDgzvUazmXrKYZY+1PoIobIYMhN5obpllFDAAMqz0iUPs Dcsg3I1hoDkXqfdU2VytjoqQUTUxT7bAb39sVRQPufeiB8KddNvEdDxulR8iOkERnNbP sqsC0tFHl3eorETSJMjVZ+UZj4b9TT7DpVEIfMYrI8e4ftX34S5wDndTUlgw9ILh2dDy sehJlLLBtIsySHU8+a9U5nbb5yaAlQm2tHVSaBRFq52XZqpa6udt3491VHkFiGqCrLVg HpjVBHuNW8lO4ZucVxQYjQ2yvGS2dz9eds1/C01cvUXkMNP5NNMnUkqomMjLITN7EoMv jIfQ== X-Gm-Message-State: APjAAAUmJwr7Ake5FCZm0u/su2eOdm9aq8/8ax1OSwczN+s+aYhGC508 fUcTAoVuCFyVhJDehAFNxTJ8omJM X-Google-Smtp-Source: APXvYqxoJ485tdppN+pbDF1aIrZbsgEW1+WIDonnOJkyFZvh/F+MUPNox3D8ENAwblUZ/QT4uQechg== X-Received: by 2002:a25:ccd7:: with SMTP id l206mr24409392ybf.165.1566408606673; Wed, 21 Aug 2019 10:30:06 -0700 (PDT) Received: from localhost.localdomain ([2601:c0:c67f:e390::3]) by smtp.gmail.com with ESMTPSA id l71sm2826167ywl.39.2019.08.21.10.30.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Aug 2019 10:30:06 -0700 (PDT) From: Jan Bobek To: qemu-devel@nongnu.org Date: Wed, 21 Aug 2019 13:28:41 -0400 Message-Id: <20190821172951.15333-6-jan.bobek@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190821172951.15333-1-jan.bobek@gmail.com> References: <20190821172951.15333-1-jan.bobek@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::b41 Subject: [Qemu-devel] [RFC PATCH v4 05/75] target/i386: introduce disas_insn_prefix X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jan Bobek , =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Move the code for decoding an instruction prefix into a separate function. Signed-off-by: Jan Bobek --- target/i386/translate.c | 48 +++++++++++++++++++++++++++++------------ 1 file changed, 34 insertions(+), 14 deletions(-) diff --git a/target/i386/translate.c b/target/i386/translate.c index 99a9097c49..410aa89c75 100644 --- a/target/i386/translate.c +++ b/target/i386/translate.c @@ -4486,19 +4486,11 @@ static void gen_sse(CPUX86State *env, DisasContext *s, int b, } } -/* convert one instruction. s->base.is_jmp is set if the translation must - be stopped. Return the next pc value */ -static target_ulong disas_insn(DisasContext *s, CPUState *cpu) +static int disas_insn_prefix(DisasContext *s, CPUX86State *env) { - CPUX86State *env = cpu->env_ptr; int b, prefixes; - int shift; - TCGMemOp ot, aflag, dflag; - int modrm, reg, rm, mod, op, opreg, val; - target_ulong next_eip, tval; - target_ulong pc_start = s->base.pc_next; + TCGMemOp aflag, dflag; - s->pc_start = s->pc = pc_start; s->override = -1; #ifdef TARGET_X86_64 s->rex_x = 0; @@ -4510,10 +4502,6 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) s->rip_offset = 0; /* for relative ip address */ s->vex_l = 0; s->vex_v = 0; - if (sigsetjmp(s->jmpbuf, 0) != 0) { - gen_exception(s, EXCP0D_GPF, pc_start - s->cs_base); - return s->pc; - } prefixes = 0; @@ -4657,6 +4645,38 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) s->prefix = prefixes; s->aflag = aflag; s->dflag = dflag; + return b; +illegal_op: + gen_illegal_opcode(s); + return -1; +unknown_op: + gen_unknown_opcode(env, s); + return -1; +} + +/* + * convert one instruction. s->base.is_jmp is set if the translation must + * be stopped. Return the next pc value. + */ +static target_ulong disas_insn(DisasContext *s, CPUState *cpu) +{ + CPUX86State *env = cpu->env_ptr; + int b, shift; + TCGMemOp ot; + int modrm, reg, rm, mod, op, opreg, val; + target_ulong next_eip, tval; + target_ulong pc_start = s->base.pc_next; + + s->pc_start = s->pc = pc_start; + if (sigsetjmp(s->jmpbuf, 0) != 0) { + gen_exception(s, EXCP0D_GPF, pc_start - s->cs_base); + return s->pc; + } + + b = disas_insn_prefix(s, env); + if (b < 0) { + return s->pc; + } /* now check op code */ reswitch: From patchwork Wed Aug 21 17:28:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Bobek X-Patchwork-Id: 11107765 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D5A8114DE for ; Wed, 21 Aug 2019 17:58:43 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9D8532070B for ; Wed, 21 Aug 2019 17:58:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="DWYh9eNz" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9D8532070B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:51436 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0Usc-0004Sz-5n for patchwork-qemu-devel@patchwork.kernel.org; Wed, 21 Aug 2019 13:58:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40725) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0UR3-0000ik-4Q for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i0UQy-000711-HB for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:12 -0400 Received: from mail-yb1-xb42.google.com ([2607:f8b0:4864:20::b42]:38904) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i0UQy-00070b-B9 for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:08 -0400 Received: by mail-yb1-xb42.google.com with SMTP id j199so1342130ybg.5 for ; Wed, 21 Aug 2019 10:30:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=wrwJcSab9woLJp3CeeA/fK1v8L09Nrf6lrmn7x9jQd0=; b=DWYh9eNzBaeOZvi8VI2nm+7dBC6jRu8zDJpJs1So5qvq+OfeRm2QgdVXFVKQkhDxaJ fgXB9b1i4obU8cT84ZD6QWuyN8gPhr5yZgOYo4adtdSo95I9iSIJsvPM19uEsKu4krPy dsYYGeLZfcVRM07gWEkzcQUkBSqEUPCKGZ3D58nAnFZJFPa1Ho6mNDGbDK7Swkg6RTnd VTwY9SHkdFEfJQjqfi64gvSfMJ3rzpMd0T/HgQA9IprTD/HtzwlqFi7uPcYQBJ111gAr y6snF+OOo3ZuvtyDqCvqKrXuw2MSlEduWjnupItnmLOsH0uTlRiKoIxvNZdeRmWQlix6 Z6wA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=wrwJcSab9woLJp3CeeA/fK1v8L09Nrf6lrmn7x9jQd0=; b=hypIww71OPoIjsAuDT35Bw4sP3J5i7KQAGBPurV4vnyhKlnOZNtJby8VLALtesiwvB ujytYSbpkTqhHHtrfGWOOPMpDzvhCz3yGD8DlqOL/qQcG2QMZh05nT3DF3ZD5NlHfhiJ EXrmTUyVvYwta0TzdSdRpbJnhi7U+vqOvgr4tAEaRpGKpQzw+9sxELKUzmiDZmZW+2A3 UUSkJYIwLqGLFkS69I66fx+pt0S72WDPxfW6Q1GYp+zFEGi/H7YGw2282nYu2cWXL88f Xy4HqsqWLJo1x34Jgu8XZpXocEbrhG1/7ilb1c2nezOBF8E2l7zthhLZfbEDS8My6a9C 5yvg== X-Gm-Message-State: APjAAAVpU3W/UNcITcr2n7sfAKT+qspnce6jlI8UP/0O+qB4REx250w7 mjyU+0L+0rR7g8Lpb4T3P+Dyx2eY X-Google-Smtp-Source: APXvYqxzXHEhbVcQHmQobc3i6Ikg+Vqu2eEUXI5DsKuEYPcI8rhJWnjyBitmAzZl44bjlAD9yymEhQ== X-Received: by 2002:a25:2bc8:: with SMTP id r191mr24056147ybr.327.1566408607478; Wed, 21 Aug 2019 10:30:07 -0700 (PDT) Received: from localhost.localdomain ([2601:c0:c67f:e390::3]) by smtp.gmail.com with ESMTPSA id l71sm2826167ywl.39.2019.08.21.10.30.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Aug 2019 10:30:06 -0700 (PDT) From: Jan Bobek To: qemu-devel@nongnu.org Date: Wed, 21 Aug 2019 13:28:42 -0400 Message-Id: <20190821172951.15333-7-jan.bobek@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190821172951.15333-1-jan.bobek@gmail.com> References: <20190821172951.15333-1-jan.bobek@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::b42 Subject: [Qemu-devel] [RFC PATCH v4 06/75] target/i386: Simplify gen_exception arguments X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson We can compute cur_eip from values present within DisasContext. Signed-off-by: Richard Henderson --- target/i386/translate.c | 89 ++++++++++++++++++++--------------------- 1 file changed, 44 insertions(+), 45 deletions(-) diff --git a/target/i386/translate.c b/target/i386/translate.c index 410aa89c75..b067323962 100644 --- a/target/i386/translate.c +++ b/target/i386/translate.c @@ -1272,10 +1272,10 @@ static void gen_helper_fp_arith_STN_ST0(int op, int opreg) } } -static void gen_exception(DisasContext *s, int trapno, target_ulong cur_eip) +static void gen_exception(DisasContext *s, int trapno) { gen_update_cc_op(s); - gen_jmp_im(s, cur_eip); + gen_jmp_im(s, s->pc_start - s->cs_base); gen_helper_raise_exception(cpu_env, tcg_const_i32(trapno)); s->base.is_jmp = DISAS_NORETURN; } @@ -1284,7 +1284,7 @@ static void gen_exception(DisasContext *s, int trapno, target_ulong cur_eip) the instruction is known, but it isn't allowed in the current cpu mode. */ static void gen_illegal_opcode(DisasContext *s) { - gen_exception(s, EXCP06_ILLOP, s->pc_start - s->cs_base); + gen_exception(s, EXCP06_ILLOP); } /* if d == OR_TMP0, it means memory operand (address in A0) */ @@ -3040,8 +3040,7 @@ static const struct SSEOpHelper_eppi sse_op_table7[256] = { [0xdf] = AESNI_OP(aeskeygenassist), }; -static void gen_sse(CPUX86State *env, DisasContext *s, int b, - target_ulong pc_start) +static void gen_sse(CPUX86State *env, DisasContext *s, int b) { int b1, op1_offset, op2_offset, is_xmm, val; int modrm, mod, rm, reg; @@ -3076,7 +3075,7 @@ static void gen_sse(CPUX86State *env, DisasContext *s, int b, } /* simple MMX/SSE operation */ if (s->flags & HF_TS_MASK) { - gen_exception(s, EXCP07_PREX, pc_start - s->cs_base); + gen_exception(s, EXCP07_PREX); return; } if (s->flags & HF_EM_MASK) { @@ -4669,7 +4668,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) s->pc_start = s->pc = pc_start; if (sigsetjmp(s->jmpbuf, 0) != 0) { - gen_exception(s, EXCP0D_GPF, pc_start - s->cs_base); + gen_exception(s, EXCP0D_GPF); return s->pc; } @@ -5868,7 +5867,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) if (s->flags & (HF_EM_MASK | HF_TS_MASK)) { /* if CR0.EM or CR0.TS are set, generate an FPU exception */ /* XXX: what to do if illegal op ? */ - gen_exception(s, EXCP07_PREX, pc_start - s->cs_base); + gen_exception(s, EXCP07_PREX); break; } modrm = x86_ldub_code(env, s); @@ -6582,7 +6581,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) set_cc_op(s, CC_OP_EFLAGS); } else if (s->vm86) { if (s->iopl != 3) { - gen_exception(s, EXCP0D_GPF, pc_start - s->cs_base); + gen_exception(s, EXCP0D_GPF); } else { gen_helper_iret_real(cpu_env, tcg_const_i32(s->dflag - 1)); set_cc_op(s, CC_OP_EFLAGS); @@ -6704,7 +6703,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) case 0x9c: /* pushf */ gen_svm_check_intercept(s, pc_start, SVM_EXIT_PUSHF); if (s->vm86 && s->iopl != 3) { - gen_exception(s, EXCP0D_GPF, pc_start - s->cs_base); + gen_exception(s, EXCP0D_GPF); } else { gen_update_cc_op(s); gen_helper_read_eflags(s->T0, cpu_env); @@ -6714,7 +6713,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) case 0x9d: /* popf */ gen_svm_check_intercept(s, pc_start, SVM_EXIT_POPF); if (s->vm86 && s->iopl != 3) { - gen_exception(s, EXCP0D_GPF, pc_start - s->cs_base); + gen_exception(s, EXCP0D_GPF); } else { ot = gen_pop_T0(s); if (s->cpl == 0) { @@ -7031,7 +7030,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) goto illegal_op; val = x86_ldub_code(env, s); if (val == 0) { - gen_exception(s, EXCP00_DIVZ, pc_start - s->cs_base); + gen_exception(s, EXCP00_DIVZ); } else { gen_helper_aam(cpu_env, tcg_const_i32(val)); set_cc_op(s, CC_OP_LOGICB); @@ -7065,7 +7064,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) case 0x9b: /* fwait */ if ((s->flags & (HF_MP_MASK | HF_TS_MASK)) == (HF_MP_MASK | HF_TS_MASK)) { - gen_exception(s, EXCP07_PREX, pc_start - s->cs_base); + gen_exception(s, EXCP07_PREX); } else { gen_helper_fwait(cpu_env); } @@ -7076,7 +7075,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) case 0xcd: /* int N */ val = x86_ldub_code(env, s); if (s->vm86 && s->iopl != 3) { - gen_exception(s, EXCP0D_GPF, pc_start - s->cs_base); + gen_exception(s, EXCP0D_GPF); } else { gen_interrupt(s, val, pc_start - s->cs_base, s->pc - s->cs_base); } @@ -7099,13 +7098,13 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) if (s->cpl <= s->iopl) { gen_helper_cli(cpu_env); } else { - gen_exception(s, EXCP0D_GPF, pc_start - s->cs_base); + gen_exception(s, EXCP0D_GPF); } } else { if (s->iopl == 3) { gen_helper_cli(cpu_env); } else { - gen_exception(s, EXCP0D_GPF, pc_start - s->cs_base); + gen_exception(s, EXCP0D_GPF); } } break; @@ -7116,7 +7115,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) gen_jmp_im(s, s->pc - s->cs_base); gen_eob_inhibit_irq(s, true); } else { - gen_exception(s, EXCP0D_GPF, pc_start - s->cs_base); + gen_exception(s, EXCP0D_GPF); } break; case 0x62: /* bound */ @@ -7208,7 +7207,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) case 0x130: /* wrmsr */ case 0x132: /* rdmsr */ if (s->cpl != 0) { - gen_exception(s, EXCP0D_GPF, pc_start - s->cs_base); + gen_exception(s, EXCP0D_GPF); } else { gen_update_cc_op(s); gen_jmp_im(s, pc_start - s->cs_base); @@ -7240,7 +7239,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) if (CODE64(s) && env->cpuid_vendor1 != CPUID_VENDOR_INTEL_1) goto illegal_op; if (!s->pe) { - gen_exception(s, EXCP0D_GPF, pc_start - s->cs_base); + gen_exception(s, EXCP0D_GPF); } else { gen_helper_sysenter(cpu_env); gen_eob(s); @@ -7251,7 +7250,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) if (CODE64(s) && env->cpuid_vendor1 != CPUID_VENDOR_INTEL_1) goto illegal_op; if (!s->pe) { - gen_exception(s, EXCP0D_GPF, pc_start - s->cs_base); + gen_exception(s, EXCP0D_GPF); } else { gen_helper_sysexit(cpu_env, tcg_const_i32(s->dflag - 1)); gen_eob(s); @@ -7270,7 +7269,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) break; case 0x107: /* sysret */ if (!s->pe) { - gen_exception(s, EXCP0D_GPF, pc_start - s->cs_base); + gen_exception(s, EXCP0D_GPF); } else { gen_helper_sysret(cpu_env, tcg_const_i32(s->dflag - 1)); /* condition codes are modified only in long mode */ @@ -7292,7 +7291,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) break; case 0xf4: /* hlt */ if (s->cpl != 0) { - gen_exception(s, EXCP0D_GPF, pc_start - s->cs_base); + gen_exception(s, EXCP0D_GPF); } else { gen_update_cc_op(s); gen_jmp_im(s, pc_start - s->cs_base); @@ -7318,7 +7317,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) if (!s->pe || s->vm86) goto illegal_op; if (s->cpl != 0) { - gen_exception(s, EXCP0D_GPF, pc_start - s->cs_base); + gen_exception(s, EXCP0D_GPF); } else { gen_svm_check_intercept(s, pc_start, SVM_EXIT_LDTR_WRITE); gen_ldst_modrm(env, s, modrm, MO_16, OR_TMP0, 0); @@ -7339,7 +7338,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) if (!s->pe || s->vm86) goto illegal_op; if (s->cpl != 0) { - gen_exception(s, EXCP0D_GPF, pc_start - s->cs_base); + gen_exception(s, EXCP0D_GPF); } else { gen_svm_check_intercept(s, pc_start, SVM_EXIT_TR_WRITE); gen_ldst_modrm(env, s, modrm, MO_16, OR_TMP0, 0); @@ -7455,7 +7454,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) goto illegal_op; } if (s->cpl != 0) { - gen_exception(s, EXCP0D_GPF, pc_start - s->cs_base); + gen_exception(s, EXCP0D_GPF); break; } tcg_gen_concat_tl_i64(s->tmp1_i64, cpu_regs[R_EAX], @@ -7472,7 +7471,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) goto illegal_op; } if (s->cpl != 0) { - gen_exception(s, EXCP0D_GPF, pc_start - s->cs_base); + gen_exception(s, EXCP0D_GPF); break; } gen_update_cc_op(s); @@ -7497,7 +7496,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) goto illegal_op; } if (s->cpl != 0) { - gen_exception(s, EXCP0D_GPF, pc_start - s->cs_base); + gen_exception(s, EXCP0D_GPF); break; } gen_update_cc_op(s); @@ -7510,7 +7509,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) goto illegal_op; } if (s->cpl != 0) { - gen_exception(s, EXCP0D_GPF, pc_start - s->cs_base); + gen_exception(s, EXCP0D_GPF); break; } gen_update_cc_op(s); @@ -7525,7 +7524,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) goto illegal_op; } if (s->cpl != 0) { - gen_exception(s, EXCP0D_GPF, pc_start - s->cs_base); + gen_exception(s, EXCP0D_GPF); break; } gen_update_cc_op(s); @@ -7539,7 +7538,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) goto illegal_op; } if (s->cpl != 0) { - gen_exception(s, EXCP0D_GPF, pc_start - s->cs_base); + gen_exception(s, EXCP0D_GPF); break; } gen_update_cc_op(s); @@ -7563,7 +7562,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) goto illegal_op; } if (s->cpl != 0) { - gen_exception(s, EXCP0D_GPF, pc_start - s->cs_base); + gen_exception(s, EXCP0D_GPF); break; } gen_update_cc_op(s); @@ -7573,7 +7572,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) CASE_MODRM_MEM_OP(2): /* lgdt */ if (s->cpl != 0) { - gen_exception(s, EXCP0D_GPF, pc_start - s->cs_base); + gen_exception(s, EXCP0D_GPF); break; } gen_svm_check_intercept(s, pc_start, SVM_EXIT_GDTR_WRITE); @@ -7590,7 +7589,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) CASE_MODRM_MEM_OP(3): /* lidt */ if (s->cpl != 0) { - gen_exception(s, EXCP0D_GPF, pc_start - s->cs_base); + gen_exception(s, EXCP0D_GPF); break; } gen_svm_check_intercept(s, pc_start, SVM_EXIT_IDTR_WRITE); @@ -7635,7 +7634,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) break; CASE_MODRM_OP(6): /* lmsw */ if (s->cpl != 0) { - gen_exception(s, EXCP0D_GPF, pc_start - s->cs_base); + gen_exception(s, EXCP0D_GPF); break; } gen_svm_check_intercept(s, pc_start, SVM_EXIT_WRITE_CR0); @@ -7647,7 +7646,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) CASE_MODRM_MEM_OP(7): /* invlpg */ if (s->cpl != 0) { - gen_exception(s, EXCP0D_GPF, pc_start - s->cs_base); + gen_exception(s, EXCP0D_GPF); break; } gen_update_cc_op(s); @@ -7662,7 +7661,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) #ifdef TARGET_X86_64 if (CODE64(s)) { if (s->cpl != 0) { - gen_exception(s, EXCP0D_GPF, pc_start - s->cs_base); + gen_exception(s, EXCP0D_GPF); } else { tcg_gen_mov_tl(s->T0, cpu_seg_base[R_GS]); tcg_gen_ld_tl(cpu_seg_base[R_GS], cpu_env, @@ -7698,7 +7697,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) case 0x108: /* invd */ case 0x109: /* wbinvd */ if (s->cpl != 0) { - gen_exception(s, EXCP0D_GPF, pc_start - s->cs_base); + gen_exception(s, EXCP0D_GPF); } else { gen_svm_check_intercept(s, pc_start, (b & 2) ? SVM_EXIT_INVD : SVM_EXIT_WBINVD); /* nothing to do */ @@ -8022,7 +8021,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) case 0x120: /* mov reg, crN */ case 0x122: /* mov crN, reg */ if (s->cpl != 0) { - gen_exception(s, EXCP0D_GPF, pc_start - s->cs_base); + gen_exception(s, EXCP0D_GPF); } else { modrm = x86_ldub_code(env, s); /* Ignore the mod bits (assume (modrm&0xc0)==0xc0). @@ -8076,7 +8075,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) case 0x121: /* mov reg, drN */ case 0x123: /* mov drN, reg */ if (s->cpl != 0) { - gen_exception(s, EXCP0D_GPF, pc_start - s->cs_base); + gen_exception(s, EXCP0D_GPF); } else { modrm = x86_ldub_code(env, s); /* Ignore the mod bits (assume (modrm&0xc0)==0xc0). @@ -8110,7 +8109,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) break; case 0x106: /* clts */ if (s->cpl != 0) { - gen_exception(s, EXCP0D_GPF, pc_start - s->cs_base); + gen_exception(s, EXCP0D_GPF); } else { gen_svm_check_intercept(s, pc_start, SVM_EXIT_WRITE_CR0); gen_helper_clts(cpu_env); @@ -8141,7 +8140,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) goto illegal_op; } if ((s->flags & HF_EM_MASK) || (s->flags & HF_TS_MASK)) { - gen_exception(s, EXCP07_PREX, pc_start - s->cs_base); + gen_exception(s, EXCP07_PREX); break; } gen_lea_modrm(env, s, modrm); @@ -8154,7 +8153,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) goto illegal_op; } if ((s->flags & HF_EM_MASK) || (s->flags & HF_TS_MASK)) { - gen_exception(s, EXCP07_PREX, pc_start - s->cs_base); + gen_exception(s, EXCP07_PREX); break; } gen_lea_modrm(env, s, modrm); @@ -8166,7 +8165,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) goto illegal_op; } if (s->flags & HF_TS_MASK) { - gen_exception(s, EXCP07_PREX, pc_start - s->cs_base); + gen_exception(s, EXCP07_PREX); break; } gen_lea_modrm(env, s, modrm); @@ -8179,7 +8178,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) goto illegal_op; } if (s->flags & HF_TS_MASK) { - gen_exception(s, EXCP07_PREX, pc_start - s->cs_base); + gen_exception(s, EXCP07_PREX); break; } gen_lea_modrm(env, s, modrm); @@ -8382,7 +8381,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) case 0x1c2: case 0x1c4 ... 0x1c6: case 0x1d0 ... 0x1fe: - gen_sse(env, s, b, pc_start); + gen_sse(env, s, b); break; default: goto unknown_op; From patchwork Wed Aug 21 17:28:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Bobek X-Patchwork-Id: 11107695 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 12EAD14DE for ; Wed, 21 Aug 2019 17:57:07 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CE9E92070B for ; Wed, 21 Aug 2019 17:57:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="OTUaQkn9" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CE9E92070B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:51428 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0Ur3-0003G3-Hb for patchwork-qemu-devel@patchwork.kernel.org; Wed, 21 Aug 2019 13:57:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40824) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0UR6-0000p6-RB for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i0UR3-00078t-Ea for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:16 -0400 Received: from mail-yb1-xb41.google.com ([2607:f8b0:4864:20::b41]:45505) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i0UR3-00073S-6V for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:13 -0400 Received: by mail-yb1-xb41.google.com with SMTP id u32so1326322ybi.12 for ; Wed, 21 Aug 2019 10:30:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=b12E1NzLfXOoLi68dls/QS9gB062z+8UHoCI55OSbHE=; b=OTUaQkn9/4aXRg43zGkaqo+cAWT92rLyehPeJYx5HvjHLn4EsSMtJPAxMJaPR3891+ LpsnrfFAkb3Fu5MRq4oZFwHLrpXj2rjdu7DKuZEY0ivr1ITlz28KO9dYVwaAhbF3K35V INH/vAt1IU+kRZViBsmE+lWI4m5Go775qp3vdj6NoTLb9WTlmzJvz0RXhUQRNOe6CCvH to9WeQqm/oR04artZ24p5gDRIxE5We3lCjTIzVeHBX/4ZwStzkcjpBtvcptG2iX5VHHa o+nRc02X9qrlbUhWWku51/eUVV+zumMW8bti7Do2LX+CgrZuDBV55Fy9GdqOJqehyexX MTMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=b12E1NzLfXOoLi68dls/QS9gB062z+8UHoCI55OSbHE=; b=pTVkr5rw7lbtwz5UqB4bkx2uPYJW8O8fzvGC+D332uXvHljW11WgI9COac27CsmFNV aYfY1jVygPTEkMttL+ZurLouzLf2vMBWj3//eDzURS39gt448aZ4oqaNV2XFpGXLDO3K wciyDH0b7eECNdi+uASyMo1qaV3+48f3b7LlmE0jpO+Pegy4a6irWc5HubuZEel8YGYz indv0X7nq7BPuR27sta3cKqWMucdVFPBsFw9JkAr7lNCiKQ7csjh/TG1sjicUPs6h0hT j+sDvOFp6YFtsUu7AYPEIA4S4fvSMPrrYlOe38YhUMsaNMfprXdKEhcxyP5LI5pu3YAC aLmw== X-Gm-Message-State: APjAAAV0Guqhi9GXblmgpgN0DDd1B4jURXZMABq8SY4tUvfv38ifnZJr eDSGbH+YJ/imcdwgZiYHQPsiorHl X-Google-Smtp-Source: APXvYqxbfhCnwOdniI2JEnCv089djytI3PD6TpqRvmiJ6axNj06rRRmFVUQEg4WcxmhuFdl+G0ZQXg== X-Received: by 2002:a25:888a:: with SMTP id d10mr24838321ybl.308.1566408608553; Wed, 21 Aug 2019 10:30:08 -0700 (PDT) Received: from localhost.localdomain ([2601:c0:c67f:e390::3]) by smtp.gmail.com with ESMTPSA id l71sm2826167ywl.39.2019.08.21.10.30.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Aug 2019 10:30:07 -0700 (PDT) From: Jan Bobek To: qemu-devel@nongnu.org Date: Wed, 21 Aug 2019 13:28:43 -0400 Message-Id: <20190821172951.15333-8-jan.bobek@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190821172951.15333-1-jan.bobek@gmail.com> References: <20190821172951.15333-1-jan.bobek@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::b41 Subject: [Qemu-devel] [RFC PATCH v4 07/75] target/i386: use pc_start from DisasContext X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jan Bobek , =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" The variable pc_start is already a member of DisasContext. Remove the superfluous local variable. Reviewed-by: Richard Henderson Signed-off-by: Jan Bobek --- target/i386/translate.c | 131 ++++++++++++++++++++-------------------- 1 file changed, 65 insertions(+), 66 deletions(-) diff --git a/target/i386/translate.c b/target/i386/translate.c index b067323962..62cce20735 100644 --- a/target/i386/translate.c +++ b/target/i386/translate.c @@ -4664,9 +4664,8 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) TCGMemOp ot; int modrm, reg, rm, mod, op, opreg, val; target_ulong next_eip, tval; - target_ulong pc_start = s->base.pc_next; - s->pc_start = s->pc = pc_start; + s->pc_start = s->pc = s->base.pc_next; if (sigsetjmp(s->jmpbuf, 0) != 0) { gen_exception(s, EXCP0D_GPF); return s->pc; @@ -6371,7 +6370,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) case 0xa5: ot = mo_b_d(b, s->dflag); if (s->prefix & (PREFIX_REPZ | PREFIX_REPNZ)) { - gen_repz_movs(s, ot, pc_start - s->cs_base, s->pc - s->cs_base); + gen_repz_movs(s, ot, s->pc_start - s->cs_base, s->pc - s->cs_base); } else { gen_movs(s, ot); } @@ -6381,7 +6380,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) case 0xab: ot = mo_b_d(b, s->dflag); if (s->prefix & (PREFIX_REPZ | PREFIX_REPNZ)) { - gen_repz_stos(s, ot, pc_start - s->cs_base, s->pc - s->cs_base); + gen_repz_stos(s, ot, s->pc_start - s->cs_base, s->pc - s->cs_base); } else { gen_stos(s, ot); } @@ -6390,7 +6389,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) case 0xad: ot = mo_b_d(b, s->dflag); if (s->prefix & (PREFIX_REPZ | PREFIX_REPNZ)) { - gen_repz_lods(s, ot, pc_start - s->cs_base, s->pc - s->cs_base); + gen_repz_lods(s, ot, s->pc_start - s->cs_base, s->pc - s->cs_base); } else { gen_lods(s, ot); } @@ -6399,9 +6398,9 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) case 0xaf: ot = mo_b_d(b, s->dflag); if (s->prefix & PREFIX_REPNZ) { - gen_repz_scas(s, ot, pc_start - s->cs_base, s->pc - s->cs_base, 1); + gen_repz_scas(s, ot, s->pc_start - s->cs_base, s->pc - s->cs_base, 1); } else if (s->prefix & PREFIX_REPZ) { - gen_repz_scas(s, ot, pc_start - s->cs_base, s->pc - s->cs_base, 0); + gen_repz_scas(s, ot, s->pc_start - s->cs_base, s->pc - s->cs_base, 0); } else { gen_scas(s, ot); } @@ -6411,9 +6410,9 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) case 0xa7: ot = mo_b_d(b, s->dflag); if (s->prefix & PREFIX_REPNZ) { - gen_repz_cmps(s, ot, pc_start - s->cs_base, s->pc - s->cs_base, 1); + gen_repz_cmps(s, ot, s->pc_start - s->cs_base, s->pc - s->cs_base, 1); } else if (s->prefix & PREFIX_REPZ) { - gen_repz_cmps(s, ot, pc_start - s->cs_base, s->pc - s->cs_base, 0); + gen_repz_cmps(s, ot, s->pc_start - s->cs_base, s->pc - s->cs_base, 0); } else { gen_cmps(s, ot); } @@ -6422,10 +6421,10 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) case 0x6d: ot = mo_b_d32(b, s->dflag); tcg_gen_ext16u_tl(s->T0, cpu_regs[R_EDX]); - gen_check_io(s, ot, pc_start - s->cs_base, + gen_check_io(s, ot, s->pc_start - s->cs_base, SVM_IOIO_TYPE_MASK | svm_is_rep(s->prefix) | 4); if (s->prefix & (PREFIX_REPZ | PREFIX_REPNZ)) { - gen_repz_ins(s, ot, pc_start - s->cs_base, s->pc - s->cs_base); + gen_repz_ins(s, ot, s->pc_start - s->cs_base, s->pc - s->cs_base); } else { gen_ins(s, ot); if (tb_cflags(s->base.tb) & CF_USE_ICOUNT) { @@ -6437,10 +6436,10 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) case 0x6f: ot = mo_b_d32(b, s->dflag); tcg_gen_ext16u_tl(s->T0, cpu_regs[R_EDX]); - gen_check_io(s, ot, pc_start - s->cs_base, + gen_check_io(s, ot, s->pc_start - s->cs_base, svm_is_rep(s->prefix) | 4); if (s->prefix & (PREFIX_REPZ | PREFIX_REPNZ)) { - gen_repz_outs(s, ot, pc_start - s->cs_base, s->pc - s->cs_base); + gen_repz_outs(s, ot, s->pc_start - s->cs_base, s->pc - s->cs_base); } else { gen_outs(s, ot); if (tb_cflags(s->base.tb) & CF_USE_ICOUNT) { @@ -6457,7 +6456,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) ot = mo_b_d32(b, s->dflag); val = x86_ldub_code(env, s); tcg_gen_movi_tl(s->T0, val); - gen_check_io(s, ot, pc_start - s->cs_base, + gen_check_io(s, ot, s->pc_start - s->cs_base, SVM_IOIO_TYPE_MASK | svm_is_rep(s->prefix)); if (tb_cflags(s->base.tb) & CF_USE_ICOUNT) { gen_io_start(); @@ -6475,7 +6474,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) ot = mo_b_d32(b, s->dflag); val = x86_ldub_code(env, s); tcg_gen_movi_tl(s->T0, val); - gen_check_io(s, ot, pc_start - s->cs_base, + gen_check_io(s, ot, s->pc_start - s->cs_base, svm_is_rep(s->prefix)); gen_op_mov_v_reg(s, ot, s->T1, R_EAX); @@ -6494,7 +6493,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) case 0xed: ot = mo_b_d32(b, s->dflag); tcg_gen_ext16u_tl(s->T0, cpu_regs[R_EDX]); - gen_check_io(s, ot, pc_start - s->cs_base, + gen_check_io(s, ot, s->pc_start - s->cs_base, SVM_IOIO_TYPE_MASK | svm_is_rep(s->prefix)); if (tb_cflags(s->base.tb) & CF_USE_ICOUNT) { gen_io_start(); @@ -6511,7 +6510,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) case 0xef: ot = mo_b_d32(b, s->dflag); tcg_gen_ext16u_tl(s->T0, cpu_regs[R_EDX]); - gen_check_io(s, ot, pc_start - s->cs_base, + gen_check_io(s, ot, s->pc_start - s->cs_base, svm_is_rep(s->prefix)); gen_op_mov_v_reg(s, ot, s->T1, R_EAX); @@ -6551,7 +6550,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) do_lret: if (s->pe && !s->vm86) { gen_update_cc_op(s); - gen_jmp_im(s, pc_start - s->cs_base); + gen_jmp_im(s, s->pc_start - s->cs_base); gen_helper_lret_protected(cpu_env, tcg_const_i32(s->dflag - 1), tcg_const_i32(val)); } else { @@ -6574,7 +6573,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) val = 0; goto do_lret; case 0xcf: /* iret */ - gen_svm_check_intercept(s, pc_start, SVM_EXIT_IRET); + gen_svm_check_intercept(s, s->pc_start, SVM_EXIT_IRET); if (!s->pe) { /* real mode */ gen_helper_iret_real(cpu_env, tcg_const_i32(s->dflag - 1)); @@ -6701,7 +6700,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) /************************/ /* flags */ case 0x9c: /* pushf */ - gen_svm_check_intercept(s, pc_start, SVM_EXIT_PUSHF); + gen_svm_check_intercept(s, s->pc_start, SVM_EXIT_PUSHF); if (s->vm86 && s->iopl != 3) { gen_exception(s, EXCP0D_GPF); } else { @@ -6711,7 +6710,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) } break; case 0x9d: /* popf */ - gen_svm_check_intercept(s, pc_start, SVM_EXIT_POPF); + gen_svm_check_intercept(s, s->pc_start, SVM_EXIT_POPF); if (s->vm86 && s->iopl != 3) { gen_exception(s, EXCP0D_GPF); } else { @@ -7056,8 +7055,8 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) } if (s->prefix & PREFIX_REPZ) { gen_update_cc_op(s); - gen_jmp_im(s, pc_start - s->cs_base); - gen_helper_pause(cpu_env, tcg_const_i32(s->pc - pc_start)); + gen_jmp_im(s, s->pc_start - s->cs_base); + gen_helper_pause(cpu_env, tcg_const_i32(s->pc - s->pc_start)); s->base.is_jmp = DISAS_NORETURN; } break; @@ -7070,27 +7069,27 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) } break; case 0xcc: /* int3 */ - gen_interrupt(s, EXCP03_INT3, pc_start - s->cs_base, s->pc - s->cs_base); + gen_interrupt(s, EXCP03_INT3, s->pc_start - s->cs_base, s->pc - s->cs_base); break; case 0xcd: /* int N */ val = x86_ldub_code(env, s); if (s->vm86 && s->iopl != 3) { gen_exception(s, EXCP0D_GPF); } else { - gen_interrupt(s, val, pc_start - s->cs_base, s->pc - s->cs_base); + gen_interrupt(s, val, s->pc_start - s->cs_base, s->pc - s->cs_base); } break; case 0xce: /* into */ if (CODE64(s)) goto illegal_op; gen_update_cc_op(s); - gen_jmp_im(s, pc_start - s->cs_base); - gen_helper_into(cpu_env, tcg_const_i32(s->pc - pc_start)); + gen_jmp_im(s, s->pc_start - s->cs_base); + gen_helper_into(cpu_env, tcg_const_i32(s->pc - s->pc_start)); break; #ifdef WANT_ICEBP case 0xf1: /* icebp (undocumented, exits to external debugger) */ - gen_svm_check_intercept(s, pc_start, SVM_EXIT_ICEBP); - gen_debug(s, pc_start - s->cs_base); + gen_svm_check_intercept(s, s->pc_start, SVM_EXIT_ICEBP); + gen_debug(s, s->pc_start - s->cs_base); break; #endif case 0xfa: /* cli */ @@ -7210,7 +7209,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) gen_exception(s, EXCP0D_GPF); } else { gen_update_cc_op(s); - gen_jmp_im(s, pc_start - s->cs_base); + gen_jmp_im(s, s->pc_start - s->cs_base); if (b & 2) { gen_helper_rdmsr(cpu_env); } else { @@ -7220,7 +7219,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) break; case 0x131: /* rdtsc */ gen_update_cc_op(s); - gen_jmp_im(s, pc_start - s->cs_base); + gen_jmp_im(s, s->pc_start - s->cs_base); if (tb_cflags(s->base.tb) & CF_USE_ICOUNT) { gen_io_start(); } @@ -7231,7 +7230,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) break; case 0x133: /* rdpmc */ gen_update_cc_op(s); - gen_jmp_im(s, pc_start - s->cs_base); + gen_jmp_im(s, s->pc_start - s->cs_base); gen_helper_rdpmc(cpu_env); break; case 0x134: /* sysenter */ @@ -7260,8 +7259,8 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) case 0x105: /* syscall */ /* XXX: is it usable in real mode ? */ gen_update_cc_op(s); - gen_jmp_im(s, pc_start - s->cs_base); - gen_helper_syscall(cpu_env, tcg_const_i32(s->pc - pc_start)); + gen_jmp_im(s, s->pc_start - s->cs_base); + gen_helper_syscall(cpu_env, tcg_const_i32(s->pc - s->pc_start)); /* TF handling for the syscall insn is different. The TF bit is checked after the syscall insn completes. This allows #DB to not be generated after one has entered CPL0 if TF is set in FMASK. */ @@ -7286,7 +7285,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) #endif case 0x1a2: /* cpuid */ gen_update_cc_op(s); - gen_jmp_im(s, pc_start - s->cs_base); + gen_jmp_im(s, s->pc_start - s->cs_base); gen_helper_cpuid(cpu_env); break; case 0xf4: /* hlt */ @@ -7294,8 +7293,8 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) gen_exception(s, EXCP0D_GPF); } else { gen_update_cc_op(s); - gen_jmp_im(s, pc_start - s->cs_base); - gen_helper_hlt(cpu_env, tcg_const_i32(s->pc - pc_start)); + gen_jmp_im(s, s->pc_start - s->cs_base); + gen_helper_hlt(cpu_env, tcg_const_i32(s->pc - s->pc_start)); s->base.is_jmp = DISAS_NORETURN; } break; @@ -7307,7 +7306,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) case 0: /* sldt */ if (!s->pe || s->vm86) goto illegal_op; - gen_svm_check_intercept(s, pc_start, SVM_EXIT_LDTR_READ); + gen_svm_check_intercept(s, s->pc_start, SVM_EXIT_LDTR_READ); tcg_gen_ld32u_tl(s->T0, cpu_env, offsetof(CPUX86State, ldt.selector)); ot = mod == 3 ? s->dflag : MO_16; @@ -7319,7 +7318,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) if (s->cpl != 0) { gen_exception(s, EXCP0D_GPF); } else { - gen_svm_check_intercept(s, pc_start, SVM_EXIT_LDTR_WRITE); + gen_svm_check_intercept(s, s->pc_start, SVM_EXIT_LDTR_WRITE); gen_ldst_modrm(env, s, modrm, MO_16, OR_TMP0, 0); tcg_gen_trunc_tl_i32(s->tmp2_i32, s->T0); gen_helper_lldt(cpu_env, s->tmp2_i32); @@ -7328,7 +7327,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) case 1: /* str */ if (!s->pe || s->vm86) goto illegal_op; - gen_svm_check_intercept(s, pc_start, SVM_EXIT_TR_READ); + gen_svm_check_intercept(s, s->pc_start, SVM_EXIT_TR_READ); tcg_gen_ld32u_tl(s->T0, cpu_env, offsetof(CPUX86State, tr.selector)); ot = mod == 3 ? s->dflag : MO_16; @@ -7340,7 +7339,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) if (s->cpl != 0) { gen_exception(s, EXCP0D_GPF); } else { - gen_svm_check_intercept(s, pc_start, SVM_EXIT_TR_WRITE); + gen_svm_check_intercept(s, s->pc_start, SVM_EXIT_TR_WRITE); gen_ldst_modrm(env, s, modrm, MO_16, OR_TMP0, 0); tcg_gen_trunc_tl_i32(s->tmp2_i32, s->T0); gen_helper_ltr(cpu_env, s->tmp2_i32); @@ -7368,7 +7367,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) modrm = x86_ldub_code(env, s); switch (modrm) { CASE_MODRM_MEM_OP(0): /* sgdt */ - gen_svm_check_intercept(s, pc_start, SVM_EXIT_GDTR_READ); + gen_svm_check_intercept(s, s->pc_start, SVM_EXIT_GDTR_READ); gen_lea_modrm(env, s, modrm); tcg_gen_ld32u_tl(s->T0, cpu_env, offsetof(CPUX86State, gdt.limit)); @@ -7386,7 +7385,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) goto illegal_op; } gen_update_cc_op(s); - gen_jmp_im(s, pc_start - s->cs_base); + gen_jmp_im(s, s->pc_start - s->cs_base); tcg_gen_mov_tl(s->A0, cpu_regs[R_EAX]); gen_extu(s->aflag, s->A0); gen_add_A0_ds_seg(s); @@ -7398,8 +7397,8 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) goto illegal_op; } gen_update_cc_op(s); - gen_jmp_im(s, pc_start - s->cs_base); - gen_helper_mwait(cpu_env, tcg_const_i32(s->pc - pc_start)); + gen_jmp_im(s, s->pc_start - s->cs_base); + gen_helper_mwait(cpu_env, tcg_const_i32(s->pc - s->pc_start)); gen_eob(s); break; @@ -7424,7 +7423,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) break; CASE_MODRM_MEM_OP(1): /* sidt */ - gen_svm_check_intercept(s, pc_start, SVM_EXIT_IDTR_READ); + gen_svm_check_intercept(s, s->pc_start, SVM_EXIT_IDTR_READ); gen_lea_modrm(env, s, modrm); tcg_gen_ld32u_tl(s->T0, cpu_env, offsetof(CPUX86State, idt.limit)); gen_op_st_v(s, MO_16, s->T0, s->A0); @@ -7475,9 +7474,9 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) break; } gen_update_cc_op(s); - gen_jmp_im(s, pc_start - s->cs_base); + gen_jmp_im(s, s->pc_start - s->cs_base); gen_helper_vmrun(cpu_env, tcg_const_i32(s->aflag - 1), - tcg_const_i32(s->pc - pc_start)); + tcg_const_i32(s->pc - s->pc_start)); tcg_gen_exit_tb(NULL, 0); s->base.is_jmp = DISAS_NORETURN; break; @@ -7487,7 +7486,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) goto illegal_op; } gen_update_cc_op(s); - gen_jmp_im(s, pc_start - s->cs_base); + gen_jmp_im(s, s->pc_start - s->cs_base); gen_helper_vmmcall(cpu_env); break; @@ -7500,7 +7499,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) break; } gen_update_cc_op(s); - gen_jmp_im(s, pc_start - s->cs_base); + gen_jmp_im(s, s->pc_start - s->cs_base); gen_helper_vmload(cpu_env, tcg_const_i32(s->aflag - 1)); break; @@ -7513,7 +7512,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) break; } gen_update_cc_op(s); - gen_jmp_im(s, pc_start - s->cs_base); + gen_jmp_im(s, s->pc_start - s->cs_base); gen_helper_vmsave(cpu_env, tcg_const_i32(s->aflag - 1)); break; @@ -7542,7 +7541,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) break; } gen_update_cc_op(s); - gen_jmp_im(s, pc_start - s->cs_base); + gen_jmp_im(s, s->pc_start - s->cs_base); gen_helper_clgi(cpu_env); break; @@ -7553,7 +7552,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) goto illegal_op; } gen_update_cc_op(s); - gen_jmp_im(s, pc_start - s->cs_base); + gen_jmp_im(s, s->pc_start - s->cs_base); gen_helper_skinit(cpu_env); break; @@ -7566,7 +7565,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) break; } gen_update_cc_op(s); - gen_jmp_im(s, pc_start - s->cs_base); + gen_jmp_im(s, s->pc_start - s->cs_base); gen_helper_invlpga(cpu_env, tcg_const_i32(s->aflag - 1)); break; @@ -7575,7 +7574,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) gen_exception(s, EXCP0D_GPF); break; } - gen_svm_check_intercept(s, pc_start, SVM_EXIT_GDTR_WRITE); + gen_svm_check_intercept(s, s->pc_start, SVM_EXIT_GDTR_WRITE); gen_lea_modrm(env, s, modrm); gen_op_ld_v(s, MO_16, s->T1, s->A0); gen_add_A0_im(s, 2); @@ -7592,7 +7591,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) gen_exception(s, EXCP0D_GPF); break; } - gen_svm_check_intercept(s, pc_start, SVM_EXIT_IDTR_WRITE); + gen_svm_check_intercept(s, s->pc_start, SVM_EXIT_IDTR_WRITE); gen_lea_modrm(env, s, modrm); gen_op_ld_v(s, MO_16, s->T1, s->A0); gen_add_A0_im(s, 2); @@ -7605,7 +7604,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) break; CASE_MODRM_OP(4): /* smsw */ - gen_svm_check_intercept(s, pc_start, SVM_EXIT_READ_CR0); + gen_svm_check_intercept(s, s->pc_start, SVM_EXIT_READ_CR0); tcg_gen_ld_tl(s->T0, cpu_env, offsetof(CPUX86State, cr[0])); if (CODE64(s)) { mod = (modrm >> 6) & 3; @@ -7637,7 +7636,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) gen_exception(s, EXCP0D_GPF); break; } - gen_svm_check_intercept(s, pc_start, SVM_EXIT_WRITE_CR0); + gen_svm_check_intercept(s, s->pc_start, SVM_EXIT_WRITE_CR0); gen_ldst_modrm(env, s, modrm, MO_16, OR_TMP0, 0); gen_helper_lmsw(cpu_env, s->T0); gen_jmp_im(s, s->pc - s->cs_base); @@ -7650,7 +7649,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) break; } gen_update_cc_op(s); - gen_jmp_im(s, pc_start - s->cs_base); + gen_jmp_im(s, s->pc_start - s->cs_base); gen_lea_modrm(env, s, modrm); gen_helper_invlpg(cpu_env, s->A0); gen_jmp_im(s, s->pc - s->cs_base); @@ -7679,7 +7678,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) goto illegal_op; } gen_update_cc_op(s); - gen_jmp_im(s, pc_start - s->cs_base); + gen_jmp_im(s, s->pc_start - s->cs_base); if (tb_cflags(s->base.tb) & CF_USE_ICOUNT) { gen_io_start(); } @@ -7699,7 +7698,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) if (s->cpl != 0) { gen_exception(s, EXCP0D_GPF); } else { - gen_svm_check_intercept(s, pc_start, (b & 2) ? SVM_EXIT_INVD : SVM_EXIT_WBINVD); + gen_svm_check_intercept(s, s->pc_start, (b & 2) ? SVM_EXIT_INVD : SVM_EXIT_WBINVD); /* nothing to do */ } break; @@ -8046,7 +8045,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) case 4: case 8: gen_update_cc_op(s); - gen_jmp_im(s, pc_start - s->cs_base); + gen_jmp_im(s, s->pc_start - s->cs_base); if (b & 2) { if (tb_cflags(s->base.tb) & CF_USE_ICOUNT) { gen_io_start(); @@ -8093,14 +8092,14 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) goto illegal_op; } if (b & 2) { - gen_svm_check_intercept(s, pc_start, SVM_EXIT_WRITE_DR0 + reg); + gen_svm_check_intercept(s, s->pc_start, SVM_EXIT_WRITE_DR0 + reg); gen_op_mov_v_reg(s, ot, s->T0, rm); tcg_gen_movi_i32(s->tmp2_i32, reg); gen_helper_set_dr(cpu_env, s->tmp2_i32, s->T0); gen_jmp_im(s, s->pc - s->cs_base); gen_eob(s); } else { - gen_svm_check_intercept(s, pc_start, SVM_EXIT_READ_DR0 + reg); + gen_svm_check_intercept(s, s->pc_start, SVM_EXIT_READ_DR0 + reg); tcg_gen_movi_i32(s->tmp2_i32, reg); gen_helper_get_dr(s->T0, cpu_env, s->tmp2_i32); gen_op_mov_reg_v(s, ot, rm, s->T0); @@ -8111,7 +8110,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) if (s->cpl != 0) { gen_exception(s, EXCP0D_GPF); } else { - gen_svm_check_intercept(s, pc_start, SVM_EXIT_WRITE_CR0); + gen_svm_check_intercept(s, s->pc_start, SVM_EXIT_WRITE_CR0); gen_helper_clts(cpu_env); /* abort block because static cpu state changed */ gen_jmp_im(s, s->pc - s->cs_base); @@ -8337,7 +8336,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) gen_nop_modrm(env, s, modrm); break; case 0x1aa: /* rsm */ - gen_svm_check_intercept(s, pc_start, SVM_EXIT_RSM); + gen_svm_check_intercept(s, s->pc_start, SVM_EXIT_RSM); if (!(s->flags & HF_SMM_MASK)) goto illegal_op; gen_update_cc_op(s); From patchwork Wed Aug 21 17:28:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Bobek X-Patchwork-Id: 11107681 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0CD691399 for ; Wed, 21 Aug 2019 17:53:42 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D85AB22CF7 for ; Wed, 21 Aug 2019 17:53:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="i7RkWlQ+" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D85AB22CF7 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:51390 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0Unk-0007s5-JJ for patchwork-qemu-devel@patchwork.kernel.org; Wed, 21 Aug 2019 13:53:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40770) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0UR4-0000lK-NM for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i0UR3-00078l-DT for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:14 -0400 Received: from mail-yw1-xc43.google.com ([2607:f8b0:4864:20::c43]:43602) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i0UR3-00074c-80 for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:13 -0400 Received: by mail-yw1-xc43.google.com with SMTP id n205so1228448ywb.10 for ; Wed, 21 Aug 2019 10:30:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=kid9rscQIJb9t8FEV+oHIuiy5oBbxmvCzn1qBeeyM5E=; b=i7RkWlQ+HXBTVTAIS3qN+A0xa07EGCcxFZ9VRGjQjdZkTS2rgCKi3G3PtRzNvVo/9Y 8OKZ60VXm/wtvD4SFiaHDsRcUhhuyFFlOOz4FQp+i2sJiIN3FQFimRpHPKUWBAelaE5K cuhM3pHExMXO6abEZUcX1VuTBLDKZK7MJYRN+WfbJNbrc6M1Nt5R/xxhcsTUNejQhMHj iSmatuUmYOUt5HTXPkamoS4Gr+2lGZJG1bWYLoi7mTvjqF0CB0esvSYGsq0Xxshi93xv s9kB3gqRP6rEHxaa0/+p0gJGaauotuWr6C0TVSWd1z26lCKtH/ArHWjQMBP+1Rt7uFvB 6knA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=kid9rscQIJb9t8FEV+oHIuiy5oBbxmvCzn1qBeeyM5E=; b=Rs+/9ndickvNaRAaKcwTjE40QaxWXotGNaDWjZm5ROnVADCxKDxDJ8uMbtm8KUIK+m jgVwc+3JFD826W0IkIg3JbyeGKli0TUo83lmX6zhTbqbnTBbAQrKb15B9+JI7cU2LdZi NPt1WbDST8Yu1+4BQ4Y6CA5+62i6hJJZb4eiAWVQRB6pnDFAdZgnB7eK80KsE21Lh5w3 Dk5svzwebBeSAnotWaENWVxLFaAcsvcuImHAbP5K4DDCnHBuyi6R2q4hpZaFqIf+zR/m x5DIpSY6/jABOxDUVs9hpXmUZVoGDJTo0e7ogJhNrHRr/2y4TmxV6dP7Sxv3FlYRnWKI Uldg== X-Gm-Message-State: APjAAAW+amof7TUDFZQrytV/sNUn0GbPIUCYw7hFlWF0/qs3jsfqEwXi kuR+vQwgM+ucFLDmPcCV13q1/z6A X-Google-Smtp-Source: APXvYqwZlPJj4y0RI8WzUypmEV+XEYrHGh73D3ltf2PZRPRRo+0BNRyhzQeDWoQ7jMEsa4zCO6UDJg== X-Received: by 2002:a81:2e84:: with SMTP id u126mr24490087ywu.398.1566408609312; Wed, 21 Aug 2019 10:30:09 -0700 (PDT) Received: from localhost.localdomain ([2601:c0:c67f:e390::3]) by smtp.gmail.com with ESMTPSA id l71sm2826167ywl.39.2019.08.21.10.30.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Aug 2019 10:30:08 -0700 (PDT) From: Jan Bobek To: qemu-devel@nongnu.org Date: Wed, 21 Aug 2019 13:28:44 -0400 Message-Id: <20190821172951.15333-9-jan.bobek@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190821172951.15333-1-jan.bobek@gmail.com> References: <20190821172951.15333-1-jan.bobek@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::c43 Subject: [Qemu-devel] [RFC PATCH v4 08/75] target/i386: make variable b1 const X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jan Bobek , =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" The variable b1 does not change value once assigned. Make this fact explicit by marking it const. Reviewed-by: Richard Henderson Signed-off-by: Jan Bobek --- target/i386/translate.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/target/i386/translate.c b/target/i386/translate.c index 62cce20735..3be869a8e3 100644 --- a/target/i386/translate.c +++ b/target/i386/translate.c @@ -3042,7 +3042,7 @@ static const struct SSEOpHelper_eppi sse_op_table7[256] = { static void gen_sse(CPUX86State *env, DisasContext *s, int b) { - int b1, op1_offset, op2_offset, is_xmm, val; + int op1_offset, op2_offset, is_xmm, val; int modrm, mod, rm, reg; SSEFunc_0_epp sse_fn_epp; SSEFunc_0_eppi sse_fn_eppi; @@ -3051,14 +3051,11 @@ static void gen_sse(CPUX86State *env, DisasContext *s, int b) TCGMemOp ot; b &= 0xff; - if (s->prefix & PREFIX_DATA) - b1 = 1; - else if (s->prefix & PREFIX_REPZ) - b1 = 2; - else if (s->prefix & PREFIX_REPNZ) - b1 = 3; - else - b1 = 0; + const int b1 = + s->prefix & PREFIX_DATA ? 1 + : s->prefix & PREFIX_REPZ ? 2 + : s->prefix & PREFIX_REPNZ ? 3 + : 0; sse_fn_epp = sse_op_table1[b][b1]; if (!sse_fn_epp) { goto unknown_op; From patchwork Wed Aug 21 17:28:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Bobek X-Patchwork-Id: 11107671 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7C0C1184E for ; Wed, 21 Aug 2019 17:49:39 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 540B522D6D for ; Wed, 21 Aug 2019 17:49:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="J82OWh3i" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 540B522D6D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:51330 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0Ujq-0001UM-7Z for patchwork-qemu-devel@patchwork.kernel.org; Wed, 21 Aug 2019 13:49:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40774) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0UR5-0000lp-07 for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i0UR3-00078f-Cn for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:14 -0400 Received: from mail-yb1-xb41.google.com ([2607:f8b0:4864:20::b41]:34112) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i0UR3-00075p-7H for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:13 -0400 Received: by mail-yb1-xb41.google.com with SMTP id u68so1355983ybg.1 for ; Wed, 21 Aug 2019 10:30:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Iu3ZFqMy8y3ADU+zLNpdk/MYmfeKvllPrPbfuoyaSFk=; b=J82OWh3i0K29+MdsNTPBIEJWBx8aPxI2+eQpOexizCcEi8qWlOZHBtHvdZR5hm0Q5O 7wLRq6Jsyhw86tqfZayi/iweA3IUhMrnjE3bzJoJ50EA17/nyBW22ggY8fDobSQoHQuE Gi5EaSyjeWwym/pljej7IY9YBw9xSfY9Mxxy8icO7G/dygq0pUFiynUM5Gg9AAkhPu+n 62zLMs+WoSj+SIOaXDGbxtDORB6JDX2ThAbcVVRwCKSeJ7n6k2hVHgv/Iki1YkOWGM7H zXtWgPw6fyTM18qTNGQ9dOdhNPMD/Lp8XrdnjsFKhnLSWorkH0IWd/FqiYeNwbycCWOx XfpQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Iu3ZFqMy8y3ADU+zLNpdk/MYmfeKvllPrPbfuoyaSFk=; b=GbzWtZYyYP3Bk5fB+L0h/Yt8VBUUL7o3ZNZGWeHWsHw08EN5ccwcGlWtCepSgPY9mV ng03tMdGVNddTE+Yf0KA9WeB1WrdfbrG45cpEZ4Rred28kXJ+mRwzhpVYqSTUkVYXU36 xbPgI1dhW2JJIr45sPAIz/K7C4/1h963WfhUYZavEcaf9MkfVuSs+PNuV+1QP3w1asqi tPfHUIDKm/S0C7VUuEIEEQX60H1ItMyKhO8VYu1g0zPdnLf/wG7Ze3ee7KhK88lQ3FLR riagjIQ8ZvvPnkVpqSds8ro7GBUPbBD/EE/QJeU/pzDr+8bqgGcO6HO510E29HzIDwUK duFQ== X-Gm-Message-State: APjAAAXbcqHjrLBPN90KXv4bBYw81/GILNkHKoQNA1ymQ68FpfpJ9xv4 Y8BHxlKCAbK9CInsAxXk5geqRvwi X-Google-Smtp-Source: APXvYqxlIw0hRr0pUVrlumsNppjaJ0zkpNs70UJeJQOcbVvlrmde1gKMtjW+lMym3NPnC1osQwSJaw== X-Received: by 2002:a5b:cc2:: with SMTP id e2mr23823891ybr.288.1566408610199; Wed, 21 Aug 2019 10:30:10 -0700 (PDT) Received: from localhost.localdomain ([2601:c0:c67f:e390::3]) by smtp.gmail.com with ESMTPSA id l71sm2826167ywl.39.2019.08.21.10.30.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Aug 2019 10:30:09 -0700 (PDT) From: Jan Bobek To: qemu-devel@nongnu.org Date: Wed, 21 Aug 2019 13:28:45 -0400 Message-Id: <20190821172951.15333-10-jan.bobek@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190821172951.15333-1-jan.bobek@gmail.com> References: <20190821172951.15333-1-jan.bobek@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::b41 Subject: [Qemu-devel] [RFC PATCH v4 09/75] target/i386: make variable is_xmm const X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jan Bobek , =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" The variable is_xmm does not change value after assignment, so make this fact explicit by marking it const. Reviewed-by: Richard Henderson Signed-off-by: Jan Bobek --- target/i386/translate.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/target/i386/translate.c b/target/i386/translate.c index 3be869a8e3..44ad55f9ee 100644 --- a/target/i386/translate.c +++ b/target/i386/translate.c @@ -3042,7 +3042,7 @@ static const struct SSEOpHelper_eppi sse_op_table7[256] = { static void gen_sse(CPUX86State *env, DisasContext *s, int b) { - int op1_offset, op2_offset, is_xmm, val; + int op1_offset, op2_offset, val; int modrm, mod, rm, reg; SSEFunc_0_epp sse_fn_epp; SSEFunc_0_eppi sse_fn_eppi; @@ -3056,20 +3056,15 @@ static void gen_sse(CPUX86State *env, DisasContext *s, int b) : s->prefix & PREFIX_REPZ ? 2 : s->prefix & PREFIX_REPNZ ? 3 : 0; + const int is_xmm = + (0x10 <= b && b <= 0x5f) + || b == 0xc6 + || b == 0xc2 + || !!b1; sse_fn_epp = sse_op_table1[b][b1]; if (!sse_fn_epp) { goto unknown_op; } - if ((b <= 0x5f && b >= 0x10) || b == 0xc6 || b == 0xc2) { - is_xmm = 1; - } else { - if (b1 == 0) { - /* MMX case */ - is_xmm = 0; - } else { - is_xmm = 1; - } - } /* simple MMX/SSE operation */ if (s->flags & HF_TS_MASK) { gen_exception(s, EXCP07_PREX); From patchwork Wed Aug 21 17:28:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Bobek X-Patchwork-Id: 11107647 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 48DAE1395 for ; Wed, 21 Aug 2019 17:42:13 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2037222DD3 for ; Wed, 21 Aug 2019 17:42:13 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="JlNm4gqX" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2037222DD3 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:51260 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0Ucd-0000Tv-Up for patchwork-qemu-devel@patchwork.kernel.org; Wed, 21 Aug 2019 13:42:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40751) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0UR4-0000kE-1K for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i0UR2-00077Q-QG for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:13 -0400 Received: from mail-yb1-xb44.google.com ([2607:f8b0:4864:20::b44]:35302) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i0UR2-000767-Lq for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:12 -0400 Received: by mail-yb1-xb44.google.com with SMTP id c9so1353020ybf.2 for ; Wed, 21 Aug 2019 10:30:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=YAMNXlLOuM4Ta9jqg2Fe8pblTj+VNxEkwoFOEYqrh7E=; b=JlNm4gqXEy62ha6a6f4ap8noJQ8VLKhi/CmH4NsEw+PWbrcglnYisvy8i5VxZHpTe5 xDc9gz5/RiOmJwdsnf/1FnkHnOqNzq0w9Xs/jl4LuJjUHxNkz80bHDazU9KeIi697n/k ISxlwsFXgZnOGFixjpJEhlbIYIp7Ii3YJdiTXyHwkHcJxmnYIo3UFtonbTK1H9WjmPoH 0SDruOpEVbCe4xJ8RHJrAr/Gsku99VPV4GLXaPOLgARmQ936wBqxvNFg3AiC7+NEGj/m fwgDCVlD8NXlTZneognZV+9LiiDkzG1hubkagkMhol8g3Dv6kna8AThyd39xXC9r8/Bh 6UcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=YAMNXlLOuM4Ta9jqg2Fe8pblTj+VNxEkwoFOEYqrh7E=; b=m0hmHk0m/fv6yO/1Ftxf4CVn0vpO/epcOsTPf4OutOB7bKD090vgyM0elrp/5ruVvj LvSLMT8p2iWi1ClSDiVKFGLe83k8poqzzkPZ91U4aiTt8laIzv93bdmlyw9gfphvEzAM +clFz/c5Jflvvx/DQf2RUPLq84MZhykBsduwLyneZ4GjcW1MIRLB2pxgqmVMg3SWAPgm TeN64/BftN9ThD2fFKezerMtR1YgJHzCwbRvA2aYtOyvBYt+ju3WJzbfYJ9lMdBunz1N u0YUuXZXRk7Pdv5n7BbVGPnbYad5yf1LnfP5HPabUmNOsbtLlbTpCIAfiNHz06CyVOO6 QmCg== X-Gm-Message-State: APjAAAXB+/wYzVlJIiFJtVXQvJGtHHTooxgScxQVFCQlHcCHi6G6d6Rw o9owv/1xDmGzZsu9A6jv2xEMnWXO X-Google-Smtp-Source: APXvYqzfUTazJKO8tiolkBFWkiYuIFg81dxKDejSTtcXisSSpRHQwxxfK+LxA3/m+EI76/v4vZGfeg== X-Received: by 2002:a25:76ca:: with SMTP id r193mr26497258ybc.33.1566408610938; Wed, 21 Aug 2019 10:30:10 -0700 (PDT) Received: from localhost.localdomain ([2601:c0:c67f:e390::3]) by smtp.gmail.com with ESMTPSA id l71sm2826167ywl.39.2019.08.21.10.30.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Aug 2019 10:30:10 -0700 (PDT) From: Jan Bobek To: qemu-devel@nongnu.org Date: Wed, 21 Aug 2019 13:28:46 -0400 Message-Id: <20190821172951.15333-11-jan.bobek@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190821172951.15333-1-jan.bobek@gmail.com> References: <20190821172951.15333-1-jan.bobek@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::b44 Subject: [Qemu-devel] [RFC PATCH v4 10/75] target/i386: add vector register file alignment constraints X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jan Bobek , =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" gvec operations require that all vectors be aligned on 16-byte boundary; make sure the MM/XMM/YMM/ZMM register file is aligned as neccessary. Reviewed-by: Richard Henderson Signed-off-by: Jan Bobek --- target/i386/cpu.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/target/i386/cpu.h b/target/i386/cpu.h index 5f6e3a029a..f226e61724 100644 --- a/target/i386/cpu.h +++ b/target/i386/cpu.h @@ -1202,9 +1202,9 @@ typedef struct CPUX86State { float_status mmx_status; /* for 3DNow! float ops */ float_status sse_status; uint32_t mxcsr; - ZMMReg xmm_regs[CPU_NB_REGS == 8 ? 8 : 32]; - ZMMReg xmm_t0; - MMXReg mmx_t0; + ZMMReg xmm_regs[CPU_NB_REGS == 8 ? 8 : 32] QEMU_ALIGNED(16); + ZMMReg xmm_t0 QEMU_ALIGNED(16); + MMXReg mmx_t0 QEMU_ALIGNED(8); XMMReg ymmh_regs[CPU_NB_REGS]; From patchwork Wed Aug 21 17:28:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Bobek X-Patchwork-Id: 11107665 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C70E9112C for ; Wed, 21 Aug 2019 17:47:44 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9F53C22D6D for ; Wed, 21 Aug 2019 17:47:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="HxkgLEEq" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9F53C22D6D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:51310 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0Uhz-0007OP-3P for patchwork-qemu-devel@patchwork.kernel.org; Wed, 21 Aug 2019 13:47:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40764) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0UR4-0000kv-E4 for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i0UR2-00077Z-Tw for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:14 -0400 Received: from mail-yb1-xb42.google.com ([2607:f8b0:4864:20::b42]:45506) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i0UR2-000772-Os for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:12 -0400 Received: by mail-yb1-xb42.google.com with SMTP id u32so1326379ybi.12 for ; Wed, 21 Aug 2019 10:30:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=WEqQSkOn6tgWF8MsWRjc3VD3xb5ORz43vFOppSEWU84=; b=HxkgLEEqA6TL3H7Zwvae9d7MkzG/UZL+Txz+QRTzZWfUAw0eP4MRFXHGMf9aK39ZEv /YAIgzLgGcSw5dF0D0EVSaJMwDWz321bliNXF/yiLBRpdZg6WerLgtgPKmq7IX8A4YTe MIOSJGCVSpbEFxTr/mk2AShFD9qTmERmlWifUYTcTSGws2ZhvXqtRkGPmdlpbvaO60Yp 54q21Z5wmWKPSlwfOAFRbCVwjZI3P0/3bgWQe5UR/xm+AxH/TDY6L88PyFMuFHr8PBNd W0IpsGF8WLT9laPwAZBSTpR/dNe7Klujg8Q2znbhn5qUsK9qlBcePdZ0LxtUJzLgKGMx OLnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=WEqQSkOn6tgWF8MsWRjc3VD3xb5ORz43vFOppSEWU84=; b=H+F11B0ZJT9WPYKE5BdZoPyUJDb+rrW5t9hCLU4kClByk4aeE6YwuXFuYgIqfMJ/au V82J6HpBeOrnQbw3cbgzrwKPDs0Qk32TOWgxg+htfMQjLrCB5jjLDmHfaYwriT5mOeZa UMz9q31tEw89QJgm+WjM1M5GPtB6/JHlL48g9/lxv0x+rAiQxJsoE8BIOXKYxKIoGnEM qfxxtJltf+2dtIbzcFZ09axM0yACf2e6S1UgUWXwMVQipidDVSLw1lZiT5HwPp188llQ FKtup6EVr4p9QJBB9VO+OfrdpyEU5RJqWN4Zq5ZbO952pNpq8I5+YqoI8UM2lnQHadLM /46w== X-Gm-Message-State: APjAAAXhrZNtT3TZZ+GI7bkZA8rAH8DiSzgJc/9alFJkOnsR2yUeBdId TR4HAJjLMhZVql/oMcw+fpq3dgS7 X-Google-Smtp-Source: APXvYqxBKE+N+fOMgly2HFf1ieXZCAAAqtKm+g6/isBUNKIKzLmLbSgB7bpxVOHbeaD/cpkrOHjBcw== X-Received: by 2002:a25:324b:: with SMTP id y72mr12446483yby.361.1566408612104; Wed, 21 Aug 2019 10:30:12 -0700 (PDT) Received: from localhost.localdomain ([2601:c0:c67f:e390::3]) by smtp.gmail.com with ESMTPSA id l71sm2826167ywl.39.2019.08.21.10.30.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Aug 2019 10:30:11 -0700 (PDT) From: Jan Bobek To: qemu-devel@nongnu.org Date: Wed, 21 Aug 2019 13:28:47 -0400 Message-Id: <20190821172951.15333-12-jan.bobek@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190821172951.15333-1-jan.bobek@gmail.com> References: <20190821172951.15333-1-jan.bobek@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::b42 Subject: [Qemu-devel] [RFC PATCH v4 11/75] target/i386: introduce gen_sse_ng X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jan Bobek , =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" This function serves as the point-of-intercept for all newly implemented instructions. If no new implementation exists, fall back to gen_sse. Signed-off-by: Jan Bobek --- target/i386/translate.c | 46 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 45 insertions(+), 1 deletion(-) diff --git a/target/i386/translate.c b/target/i386/translate.c index 44ad55f9ee..8045ce3ce0 100644 --- a/target/i386/translate.c +++ b/target/i386/translate.c @@ -4477,6 +4477,50 @@ static void gen_sse(CPUX86State *env, DisasContext *s, int b) } } +static void gen_sse_ng(CPUX86State *env, DisasContext *s, int b) +{ + enum { + P_NP = 0, + P_66 = 1 << 8, + P_F3 = 1 << 9, + P_F2 = 1 << 10, + + M_NA = 0, + M_0F = 1 << 11, + M_0F38 = 1 << 12, + M_0F3A = 1 << 13, + + W_0 = 0, + W_1 = 1 << 14, + + VEX_128 = 1 << 15, + VEX_256 = 1 << 16, + }; + + const int p = + (s->prefix & PREFIX_DATA ? P_66 : 0) + | (s->prefix & PREFIX_REPZ ? P_F3 : 0) + | (s->prefix & PREFIX_REPNZ ? P_F2 : 0) + | (!(s->prefix & PREFIX_VEX) ? 0 : + (s->vex_l ? VEX_256 : VEX_128)); + int m = + M_0F; + const int w = + REX_W(s) > 0 ? W_1 : W_0; + int op = + b & 0xff; + + while (1) { + switch (p | m | w | op) { + + default: { + gen_sse(env, s, b); + } return; + + } + } +} + static int disas_insn_prefix(DisasContext *s, CPUX86State *env) { int b, prefixes; @@ -8372,7 +8416,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) case 0x1c2: case 0x1c4 ... 0x1c6: case 0x1d0 ... 0x1fe: - gen_sse(env, s, b); + gen_sse_ng(env, s, b); break; default: goto unknown_op; From patchwork Wed Aug 21 17:28:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Bobek X-Patchwork-Id: 11107679 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 99FED1399 for ; Wed, 21 Aug 2019 17:52:22 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 720C522CF7 for ; Wed, 21 Aug 2019 17:52:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="K4fFfMIf" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 720C522CF7 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:51372 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0UmT-0005RF-8f for patchwork-qemu-devel@patchwork.kernel.org; Wed, 21 Aug 2019 13:52:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40802) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0UR5-0000n9-RX for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i0UR4-00079i-3W for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:15 -0400 Received: from mail-yw1-xc43.google.com ([2607:f8b0:4864:20::c43]:45838) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i0UR3-00079E-V1 for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:14 -0400 Received: by mail-yw1-xc43.google.com with SMTP id n69so1221943ywd.12 for ; Wed, 21 Aug 2019 10:30:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=6m0yt4X0AzcKuAyXkMVUD4QHQI5bggYWOuwLDi6hZRQ=; b=K4fFfMIfXRKqmaeUnwEA3CzZjJOLx4j5pscs92ToMNf1VxANB9gHzwyfxiIuEB1JHG iiKnDHbTOtsxmaJvpgU4/RmAnzWm/nOhtBhWCW/92YFTjxiLXd0Gx/BPvQ+4+HhwC/KE LZoFVT095BA3LPjdO4TRnXGtEG9n3yFtvTGFF8eGKI4yWf6unqLmCnjeW0Jvj7rTdBXC Jmy35EJvcpInEWAuBmRClb0OXmHDUaKIu06o8GGwa8fy+eYF1HFrX75IxSg4VeqmwsTp n1Xl5CoIBUkIhcYnL1T7z/87es/jgh+fCTYXKcM6bZN00RybOT8jrkxUwQDTuDKGpORN eSOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=6m0yt4X0AzcKuAyXkMVUD4QHQI5bggYWOuwLDi6hZRQ=; b=hv+t8DB2a5EeEL5DeirCEgtAKM+bRA5f5UFjmvl/OxxqEfT0Pi7nVtrJ/tIe1AhSNE jZ6+shVH8Rg+lf+fn9a01t3JmG50/Un5kjbqR1+AacjcMKthyB1NTlYB+IEhESKUJPtI jfIQ6AhvueG5nugQOtph6B21RmVDFbG9/+YWLCUkLp0LLavLL5K9f4DOXqKy4wph6U+1 +t5vzxwCxf4NPm8nO7N6bT3aDMyRgZvFr/+GzLQm9CzJY3cnh9hmLMa0NZAR9mRd2VpO qL/YP6dBsyVJ01PsQyIixMikf5UOTpMql6qzsRmreqlMVWpplUhYNsXXNcXjruFJZ0km u9ag== X-Gm-Message-State: APjAAAVQNgnIPRyf9kCZXQeMjyC0nbR+/IY0mi0HEB/6O24TnbScXur2 avSZWAWIvCLBc8F9g+twUY6SEBmN X-Google-Smtp-Source: APXvYqwq78d7GpFsKOUDO96LYUBVf1XA2696hF0vYegfYZLM8jFznG33gSzekwjMLoARpqN4L1GSzg== X-Received: by 2002:a81:6b54:: with SMTP id g81mr21944181ywc.283.1566408613101; Wed, 21 Aug 2019 10:30:13 -0700 (PDT) Received: from localhost.localdomain ([2601:c0:c67f:e390::3]) by smtp.gmail.com with ESMTPSA id l71sm2826167ywl.39.2019.08.21.10.30.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Aug 2019 10:30:12 -0700 (PDT) From: Jan Bobek To: qemu-devel@nongnu.org Date: Wed, 21 Aug 2019 13:28:48 -0400 Message-Id: <20190821172951.15333-13-jan.bobek@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190821172951.15333-1-jan.bobek@gmail.com> References: <20190821172951.15333-1-jan.bobek@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::c43 Subject: [Qemu-devel] [RFC PATCH v4 12/75] target/i386: introduce CASES_* macros in gen_sse_ng X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jan Bobek , =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" In case one or more fields should be ignored during instruction disambiguation, we need to generate multiple case labels. Introduce CASES_* macros for this purpose. Signed-off-by: Jan Bobek --- target/i386/translate.c | 54 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/target/i386/translate.c b/target/i386/translate.c index 8045ce3ce0..661010973b 100644 --- a/target/i386/translate.c +++ b/target/i386/translate.c @@ -4513,10 +4513,64 @@ static void gen_sse_ng(CPUX86State *env, DisasContext *s, int b) while (1) { switch (p | m | w | op) { +#define CASES_0(e) case (e): +#define CASES_1(e, A, ...) CASES_ ## A(e, 0, ## __VA_ARGS__) +#define CASES_2(e, A, ...) CASES_ ## A(e, 1, ## __VA_ARGS__) +#define CASES_3(e, A, ...) CASES_ ## A(e, 2, ## __VA_ARGS__) +#define CASES_4(e, A, ...) CASES_ ## A(e, 3, ## __VA_ARGS__) +#define CASES(e, N, ...) CASES_ ## N(e, ## __VA_ARGS__) + +#define CASES_P(e, N, p, ...) CASES_P ## p(e, N, ## __VA_ARGS__) +#define CASES_PNP(e, N, ...) CASES_ ## N(P_NP | e, ## __VA_ARGS__) +#define CASES_P66(e, N, ...) CASES_ ## N(P_66 | e, ## __VA_ARGS__) +#define CASES_PF3(e, N, ...) CASES_ ## N(P_F3 | e, ## __VA_ARGS__) +#define CASES_PF2(e, N, ...) CASES_ ## N(P_F2 | e, ## __VA_ARGS__) +#define CASES_PIG(e, N, ...) CASES_PNP(e, N, ## __VA_ARGS__) \ + CASES_P66(e, N, ## __VA_ARGS__) \ + CASES_PF3(e, N, ## __VA_ARGS__) \ + CASES_PF2(e, N, ## __VA_ARGS__) + +#define CASES_M(e, N, m, ...) CASES_ ## N(M_ ## m | e, ## __VA_ARGS__) + +#define CASES_W(e, N, w, ...) CASES_W ## w(e, N, ## __VA_ARGS__) +#define CASES_W0(e, N, ...) CASES_ ## N(W_0 | e, ## __VA_ARGS__) +#define CASES_W1(e, N, ...) CASES_ ## N(W_1 | e, ## __VA_ARGS__) +#define CASES_WIG(e, N, ...) CASES_W0(e, N, ## __VA_ARGS__) \ + CASES_W1(e, N, ## __VA_ARGS__) + +#define CASES_VEX_L(e, N, l, ...) CASES_VEX_L ## l(e, N, ## __VA_ARGS__) +#define CASES_VEX_L128(e, N, ...) CASES_ ## N(VEX_128 | e, ## __VA_ARGS__) +#define CASES_VEX_L256(e, N, ...) CASES_ ## N(VEX_256 | e, ## __VA_ARGS__) +#define CASES_VEX_LZ CASES_VEX_L128 +#define CASES_VEX_LIG(e, N, ...) CASES_VEX_L128(e, N, ## __VA_ARGS__) \ + CASES_VEX_L256(e, N, ## __VA_ARGS__) + default: { gen_sse(env, s, b); } return; +#undef CASES_0 +#undef CASES_1 +#undef CASES_2 +#undef CASES_3 +#undef CASES_4 +#undef CASES +#undef CASES_P +#undef CASES_PNP +#undef CASES_P66 +#undef CASES_PF3 +#undef CASES_PF2 +#undef CASES_PIG +#undef CASES_M +#undef CASES_W +#undef CASES_W0 +#undef CASES_W1 +#undef CASES_WIG +#undef CASES_VEX_L +#undef CASES_VEX_L128 +#undef CASES_VEX_L256 +#undef CASES_VEX_LZ +#undef CASES_VEX_LIG } } } From patchwork Wed Aug 21 17:28:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Bobek X-Patchwork-Id: 11107691 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AEF1D1399 for ; Wed, 21 Aug 2019 17:55:14 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 87A752332A for ; Wed, 21 Aug 2019 17:55:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="KbFad2KZ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 87A752332A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:51404 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0UpF-0001UE-Ab for patchwork-qemu-devel@patchwork.kernel.org; Wed, 21 Aug 2019 13:55:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40818) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0UR6-0000oQ-Hf for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i0UR5-0007BR-A4 for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:16 -0400 Received: from mail-yb1-xb44.google.com ([2607:f8b0:4864:20::b44]:39259) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i0UR5-0007Af-4P for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:15 -0400 Received: by mail-yb1-xb44.google.com with SMTP id s142so1340941ybc.6 for ; Wed, 21 Aug 2019 10:30:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=j47aWmgFVqZnau895YhI/GcoyHImA6cC56u4iojAVmY=; b=KbFad2KZhTuIF8rr8F4xKcfTiIyXS8SmiL3Bn3PfLKv4EGV0m34L5nNye7CBECxVNv yb/lDLBI8/nU5+0WsoJowoq1igOmVoLryh5q5TLLsS1ZxkrBc9SnQnf02CUbpZLaT7S6 J993sz5zXKcS131FpjlUMOXT8g71VDwTFf+KfYyjsSLd+w6QFzKmeC9nt91lY2BKWgCa CV9be1cUhZCy3kLl0C3cyLNC67TEm3+B3tl6CQm+EQw0Bg8ZD4T9LaZ0FE3/Y+3+Mxoe aG3yTY8oNdMiXm/a2qdu2UmxmVJ3tiRF4+or4TCnfd/Q+Wsy4wYFgQG0+2hdAbKGxdSU ZRgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=j47aWmgFVqZnau895YhI/GcoyHImA6cC56u4iojAVmY=; b=n/KXdCNWxpk74rl5V+O7JyV40k4etLImU7DKOfcPU6XjYMfgkvKANSeD40t1J0in8o L8OYbh++oW+sRS8qrB6f7bSKa5l9TwWTZhVuhxtlDCUExS5KQFS0aTf50bvq3ofwtXyl Wvwa60Wp2qcDin8vervICK6oXv0iAr8Os4/ij6whiMtQ9flTZKVcnOTLb/Nb79MDt+nl jrHY83lLbB8OS0f1Z62kbgwg+NUVrtGCJRQfS5vGaZoxlJ0eiOQzQTf0lGI6nMAqS86z NWQAbz5UwgmvsMzeJPDRnKipXDKaAa8x2VhDHJWIi3/M9x5QCw26EMMvxJdl3bs4T5Kb m5Pw== X-Gm-Message-State: APjAAAXlfqkpj93hggvl2dAObYGnBsUxnf/eeOzKafbgCc9gOB93V64C ExjMcilUvcfx5Fzj/uML3FaCpvom X-Google-Smtp-Source: APXvYqwfvtOi3W8OFmGtx4+kBJotX4Lfoh7L2BHi0lh361VuwORjV4NeQNAJPeK3DtlLy/zAUeogpQ== X-Received: by 2002:a25:587:: with SMTP id 129mr25650453ybf.121.1566408614478; Wed, 21 Aug 2019 10:30:14 -0700 (PDT) Received: from localhost.localdomain ([2601:c0:c67f:e390::3]) by smtp.gmail.com with ESMTPSA id l71sm2826167ywl.39.2019.08.21.10.30.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Aug 2019 10:30:13 -0700 (PDT) From: Jan Bobek To: qemu-devel@nongnu.org Date: Wed, 21 Aug 2019 13:28:49 -0400 Message-Id: <20190821172951.15333-14-jan.bobek@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190821172951.15333-1-jan.bobek@gmail.com> References: <20190821172951.15333-1-jan.bobek@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::b44 Subject: [Qemu-devel] [RFC PATCH v4 13/75] target/i386: decode the 0F38/0F3A prefix in gen_sse_ng X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jan Bobek , =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" In order to decode 0F38/0F3A-prefixed instructions, we need to load an additional byte. This poses a problem if the instruction is not implemented yet; implement a rewind in this (default) case. Signed-off-by: Jan Bobek --- target/i386/translate.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/target/i386/translate.c b/target/i386/translate.c index 661010973b..bd9c62dc54 100644 --- a/target/i386/translate.c +++ b/target/i386/translate.c @@ -4545,7 +4545,23 @@ static void gen_sse_ng(CPUX86State *env, DisasContext *s, int b) #define CASES_VEX_LIG(e, N, ...) CASES_VEX_L128(e, N, ## __VA_ARGS__) \ CASES_VEX_L256(e, N, ## __VA_ARGS__) + CASES(0x38, 3, W, IG, M, 0F, P, IG) + CASES(0x38, 4, W, IG, M, 0F, P, IG, VEX_L, IG) { + m = M_0F38; + op = x86_ldub_code(env, s); + } break; + + CASES(0x3a, 3, W, IG, M, 0F, P, IG) + CASES(0x3a, 4, W, IG, M, 0F, P, IG, VEX_L, IG) { + m = M_0F3A; + op = x86_ldub_code(env, s); + } break; + default: { + if (m == M_0F38 || m == M_0F3A) { + /* rewind the advance_pc() x86_ldub_code() did */ + advance_pc(env, s, -1); + } gen_sse(env, s, b); } return; From patchwork Wed Aug 21 17:28:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Bobek X-Patchwork-Id: 11107655 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AECB513B1 for ; Wed, 21 Aug 2019 17:44:36 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8666C22D6D for ; Wed, 21 Aug 2019 17:44:36 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="kOXPwq+1" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8666C22D6D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:51284 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0Uex-00045a-6N for patchwork-qemu-devel@patchwork.kernel.org; Wed, 21 Aug 2019 13:44:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40841) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0UR7-0000qL-Iu for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i0UR6-0007Cv-7x for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:17 -0400 Received: from mail-yw1-xc43.google.com ([2607:f8b0:4864:20::c43]:33620) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i0UR6-0007CV-3D for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:16 -0400 Received: by mail-yw1-xc43.google.com with SMTP id e65so1253136ywh.0 for ; Wed, 21 Aug 2019 10:30:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=unvBXoZP2PhE77vw3JAkXue/pIkYAU2oPlhgBYzDV70=; b=kOXPwq+1l+eLfNz2tbh2rWvgooSbH6IbqCBCTaVTtD35AUhtXwOYSD385X6oJKybiO sEoLcfcgClRH0mI4n/sWf6dzCoVJwi+8O7lYXh/hSRjKAivrUKehQ1J0ZTJ6JXchX2YX tn3rLU8aWbOkTice8EjQhpJHE9pTd+830EOVGwMTy/49uVNf4dJ8tyhqRmWhNR2CKa4s Ku7UhsfeN4RXYXD4or+/4E/2s7oTMrB1P80xlzFPsFyeuCznN9dNXqSULY+/hneuzSpN 3WSiCPjiCgFn+1zDBUpbLjIsoWBWg6MhGDvXJZatGgo+tCZDwLYpVpdLPD/GibrenwNF e0mQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=unvBXoZP2PhE77vw3JAkXue/pIkYAU2oPlhgBYzDV70=; b=MNy65gledYUBaQhEFGFS2mzbTJg7Cdx9N5MEMLFRl6wrooMBNE4WyP/fd27GQClTnO PxelM2tK0PgKSVNl9/XBebOwiHkXNmWH5ahPRv0BiDyKQ5dfvYSbVA1Qmymr9VRhZF61 KQYE7JlU96nCZwAmMIuPWBsB+/Kelg/fYbV+hrZOQS3z19va8PupuYwKL+1s66WXfQZC nIIoMs7ZDJCKKXGTV/KRiNw9MfgtsrNtF+K3JDkouoFUKmwwsnLZkDReQW75iDSYtPDA 1pPmFtH5RCysa0GKfBo1b1SCQCcsG0XZnp85Lj+dgp9uvMRzr1CsZfbVCieU/TBXNzB4 qDEA== X-Gm-Message-State: APjAAAUjmdCEGs3aRFXnygW6khmF0BPmxN2/+/uwA18AB4+4MosGn29T XWmzFNhnWguGT+qRH6w9g0y8TeT+ X-Google-Smtp-Source: APXvYqwZwSlmHCjmiidmDNs9eKtYtaPFcWRFIjIGZtrB09C75u0OBo/o9bldwxqS3bj/Jrr2EdWMlA== X-Received: by 2002:a81:33cd:: with SMTP id z196mr23203716ywz.213.1566408615432; Wed, 21 Aug 2019 10:30:15 -0700 (PDT) Received: from localhost.localdomain ([2601:c0:c67f:e390::3]) by smtp.gmail.com with ESMTPSA id l71sm2826167ywl.39.2019.08.21.10.30.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Aug 2019 10:30:14 -0700 (PDT) From: Jan Bobek To: qemu-devel@nongnu.org Date: Wed, 21 Aug 2019 13:28:50 -0400 Message-Id: <20190821172951.15333-15-jan.bobek@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190821172951.15333-1-jan.bobek@gmail.com> References: <20190821172951.15333-1-jan.bobek@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::c43 Subject: [Qemu-devel] [RFC PATCH v4 14/75] target/i386: introduce aliases for some tcg_gvec operations X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jan Bobek , =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" The aliases create a thin layer above the raw tcg_gvec functions, making room for us to permute the arguments, pass additional constant values etc., which will prove highly useful later. Signed-off-by: Jan Bobek --- target/i386/translate.c | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/target/i386/translate.c b/target/i386/translate.c index bd9c62dc54..467ecf15ba 100644 --- a/target/i386/translate.c +++ b/target/i386/translate.c @@ -22,6 +22,7 @@ #include "cpu.h" #include "disas/disas.h" #include "exec/exec-all.h" +#include "tcg-gvec-desc.h" #include "tcg-op.h" #include "exec/cpu_ldst.h" #include "exec/translator.h" @@ -4477,6 +4478,44 @@ static void gen_sse(CPUX86State *env, DisasContext *s, int b) } } +#define gen_gvec_mov(dofs, aofs, oprsz, maxsz, vece) \ + tcg_gen_gvec_mov(vece, dofs, aofs, oprsz, maxsz) + +#define gen_gvec_add(dofs, aofs, bofs, oprsz, maxsz, vece) \ + tcg_gen_gvec_add(vece, dofs, aofs, bofs, oprsz, maxsz) +#define gen_gvec_sub(dofs, aofs, bofs, oprsz, maxsz, vece) \ + tcg_gen_gvec_sub(vece, dofs, aofs, bofs, oprsz, maxsz) + +#define gen_gvec_ssadd(dofs, aofs, bofs, oprsz, maxsz, vece) \ + tcg_gen_gvec_ssadd(vece, dofs, aofs, bofs, oprsz, maxsz) +#define gen_gvec_sssub(dofs, aofs, bofs, oprsz, maxsz, vece) \ + tcg_gen_gvec_sssub(vece, dofs, aofs, bofs, oprsz, maxsz) +#define gen_gvec_usadd(dofs, aofs, bofs, oprsz, maxsz, vece) \ + tcg_gen_gvec_usadd(vece, dofs, aofs, bofs, oprsz, maxsz) +#define gen_gvec_ussub(dofs, aofs, bofs, oprsz, maxsz, vece) \ + tcg_gen_gvec_ussub(vece, dofs, aofs, bofs, oprsz, maxsz) + +#define gen_gvec_smin(dofs, aofs, bofs, oprsz, maxsz, vece) \ + tcg_gen_gvec_smin(vece, dofs, aofs, bofs, oprsz, maxsz) +#define gen_gvec_umin(dofs, aofs, bofs, oprsz, maxsz, vece) \ + tcg_gen_gvec_umin(vece, dofs, aofs, bofs, oprsz, maxsz) +#define gen_gvec_smax(dofs, aofs, bofs, oprsz, maxsz, vece) \ + tcg_gen_gvec_smax(vece, dofs, aofs, bofs, oprsz, maxsz) +#define gen_gvec_umax(dofs, aofs, bofs, oprsz, maxsz, vece) \ + tcg_gen_gvec_umax(vece, dofs, aofs, bofs, oprsz, maxsz) + +#define gen_gvec_and(dofs, aofs, bofs, oprsz, maxsz, vece) \ + tcg_gen_gvec_and(vece, dofs, aofs, bofs, oprsz, maxsz) +#define gen_gvec_andn(dofs, aofs, bofs, oprsz, maxsz, vece) \ + tcg_gen_gvec_andc(vece, dofs, bofs, aofs, oprsz, maxsz) +#define gen_gvec_or(dofs, aofs, bofs, oprsz, maxsz, vece) \ + tcg_gen_gvec_or(vece, dofs, aofs, bofs, oprsz, maxsz) +#define gen_gvec_xor(dofs, aofs, bofs, oprsz, maxsz, vece) \ + tcg_gen_gvec_xor(vece, dofs, aofs, bofs, oprsz, maxsz) + +#define gen_gvec_cmp(dofs, aofs, bofs, oprsz, maxsz, vece, cond) \ + tcg_gen_gvec_cmp(cond, vece, dofs, aofs, bofs, oprsz, maxsz) + static void gen_sse_ng(CPUX86State *env, DisasContext *s, int b) { enum { From patchwork Wed Aug 21 17:28:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Bobek X-Patchwork-Id: 11107779 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D879C14DE for ; Wed, 21 Aug 2019 17:59:13 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id AFD42233FE for ; Wed, 21 Aug 2019 17:59:13 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ZL2ebsA7" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AFD42233FE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:51440 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0Ut6-0005Jr-9Y for patchwork-qemu-devel@patchwork.kernel.org; Wed, 21 Aug 2019 13:59:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40856) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0UR8-0000rT-Ey for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i0UR7-0007Dw-5n for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:18 -0400 Received: from mail-yb1-xb44.google.com ([2607:f8b0:4864:20::b44]:45508) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i0UR7-0007Dc-1g for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:17 -0400 Received: by mail-yb1-xb44.google.com with SMTP id u32so1326455ybi.12 for ; Wed, 21 Aug 2019 10:30:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=78dLtAzIc8Khj/cWFcmAZfU/AZ/wK2C4JMNwdD2INNQ=; b=ZL2ebsA7Ub9YoCKiuOEpEwUzvZFXxms+seoXSC0LrQYXmqmYYJc7iwb39cH/mBuf/S fhufh1DmiR9QGVYugodcVj48Zz5JD0Y6u38QB9wEwV+KaPhXMJTFg2VZFOg8YhhChjzA GMyjP9+cxMplJhsrxa3Fkna8RcEojWBhJI2LJW11hWAuq4gFH2x57WdUWlNzrnslup+i IlUFkSbbbIxHvTvVSfudFv2EHfr/kCx/qN+GDNqomRoPZKy5pMrvnLPzQG0UqfMR5mGB 5oEmYtuidgt3edagar3BnaXsKiLXOeCQRq5v+C/Ti/LR0Hw9PEFoCCMPILxM6sry0SPp Nmfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=78dLtAzIc8Khj/cWFcmAZfU/AZ/wK2C4JMNwdD2INNQ=; b=ko5+v+HCbXoRztb23XtdMF+OyH5rrlU1/8zq+tn5CIq2KOaybNqYmiKCwF8rrpJCWb 6NNm7WOoy1KOtpmZRguYlMvlbP2VQI7Lasl3xCobF504YmNORjSE+2aX+5UB1gYVnSZv ucuEcITbMZndBflgBqGj1l17/zcglq4BD/yl3it5JX9OqVrVTZmNVjzclSh1DPrPX+cs lDnKLAd6tdxhnDwIvnqsDwA/o1/85K4WU23c2Bg/ChW0TNKGLluqG5+dn8NJzVzfSEDN HrkAg1Q3vAwIzf8nxt6XhW7bfDVFsnatLqhvqHAxW9Cplxi4Ug2ZCyVBocJOkWwNT3rT /mZQ== X-Gm-Message-State: APjAAAWQK/s77+UpwDimO88CnWk96EgCwRakSXTBdMBYkFD5GaF+bm1U FcGWosvFmZXmlCeflnxtSsVB2/XQ X-Google-Smtp-Source: APXvYqzhO8XWDTYidGfiIjCG0N6lRQ7/iFEdbkMJSv00QA+QLj0reMc8igQpfB3QRxYgMhdPOwC7CQ== X-Received: by 2002:a25:6846:: with SMTP id d67mr25596541ybc.483.1566408616372; Wed, 21 Aug 2019 10:30:16 -0700 (PDT) Received: from localhost.localdomain ([2601:c0:c67f:e390::3]) by smtp.gmail.com with ESMTPSA id l71sm2826167ywl.39.2019.08.21.10.30.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Aug 2019 10:30:15 -0700 (PDT) From: Jan Bobek To: qemu-devel@nongnu.org Date: Wed, 21 Aug 2019 13:28:51 -0400 Message-Id: <20190821172951.15333-16-jan.bobek@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190821172951.15333-1-jan.bobek@gmail.com> References: <20190821172951.15333-1-jan.bobek@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::b44 Subject: [Qemu-devel] [RFC PATCH v4 15/75] target/i386: introduce function check_cpuid X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jan Bobek , =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Introduce a helper function to take care of instruction CPUID checks. Signed-off-by: Jan Bobek --- target/i386/translate.c | 62 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/target/i386/translate.c b/target/i386/translate.c index 467ecf15ba..3e54443d99 100644 --- a/target/i386/translate.c +++ b/target/i386/translate.c @@ -4516,6 +4516,68 @@ static void gen_sse(CPUX86State *env, DisasContext *s, int b) #define gen_gvec_cmp(dofs, aofs, bofs, oprsz, maxsz, vece, cond) \ tcg_gen_gvec_cmp(cond, vece, dofs, aofs, bofs, oprsz, maxsz) +typedef enum { + CHECK_CPUID_MMX = 1, + CHECK_CPUID_3DNOW, + CHECK_CPUID_SSE, + CHECK_CPUID_SSE2, + CHECK_CPUID_CLFLUSH, + CHECK_CPUID_SSE3, + CHECK_CPUID_SSSE3, + CHECK_CPUID_SSE4_1, + CHECK_CPUID_SSE4_2, + CHECK_CPUID_SSE4A, + CHECK_CPUID_AES, + CHECK_CPUID_PCLMULQDQ, + CHECK_CPUID_AVX, + CHECK_CPUID_AES_AVX, + CHECK_CPUID_PCLMULQDQ_AVX, + CHECK_CPUID_AVX2, +} CheckCpuidFeat; + +static bool check_cpuid(CPUX86State *env, DisasContext *s, CheckCpuidFeat feat) +{ + switch (feat) { + case CHECK_CPUID_MMX: + return (s->cpuid_features & CPUID_MMX) + && (s->cpuid_ext2_features & CPUID_EXT2_MMX); + case CHECK_CPUID_3DNOW: + return s->cpuid_ext2_features & CPUID_EXT2_3DNOW; + case CHECK_CPUID_SSE: + return s->cpuid_features & CPUID_SSE; + case CHECK_CPUID_SSE2: + return s->cpuid_features & CPUID_SSE2; + case CHECK_CPUID_CLFLUSH: + return s->cpuid_features & CPUID_CLFLUSH; + case CHECK_CPUID_SSE3: + return s->cpuid_ext_features & CPUID_EXT_SSE3; + case CHECK_CPUID_SSSE3: + return s->cpuid_ext_features & CPUID_EXT_SSSE3; + case CHECK_CPUID_SSE4_1: + return s->cpuid_ext_features & CPUID_EXT_SSE41; + case CHECK_CPUID_SSE4_2: + return s->cpuid_ext_features & CPUID_EXT_SSE42; + case CHECK_CPUID_SSE4A: + return s->cpuid_ext3_features & CPUID_EXT3_SSE4A; + case CHECK_CPUID_AES: + return s->cpuid_ext_features & CPUID_EXT_AES; + case CHECK_CPUID_PCLMULQDQ: + return s->cpuid_ext_features & CPUID_EXT_PCLMULQDQ; + case CHECK_CPUID_AVX: + return s->cpuid_ext_features & CPUID_EXT_AVX; + case CHECK_CPUID_AES_AVX: + return (s->cpuid_ext_features & CPUID_EXT_AES) + && (s->cpuid_ext_features & CPUID_EXT_AVX); + case CHECK_CPUID_PCLMULQDQ_AVX: + return (s->cpuid_ext_features & CPUID_EXT_PCLMULQDQ) + && (s->cpuid_ext_features & CPUID_EXT_AVX); + case CHECK_CPUID_AVX2: + return s->cpuid_7_0_ebx_features & CPUID_7_0_EBX_AVX2; + default: + g_assert_not_reached(); + } +} + static void gen_sse_ng(CPUX86State *env, DisasContext *s, int b) { enum { From patchwork Wed Aug 21 17:28:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Bobek X-Patchwork-Id: 11107793 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2F7AA14DE for ; Wed, 21 Aug 2019 18:03:16 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0751B2082F for ; Wed, 21 Aug 2019 18:03:16 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="fCR8Uniw" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0751B2082F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:51474 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0Ux0-0002DX-Hb for patchwork-qemu-devel@patchwork.kernel.org; Wed, 21 Aug 2019 14:03:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40870) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0UR9-0000tC-GY for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i0UR8-0007Er-9t for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:19 -0400 Received: from mail-yb1-xb43.google.com ([2607:f8b0:4864:20::b43]:40494) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i0UR8-0007EZ-5M for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:18 -0400 Received: by mail-yb1-xb43.google.com with SMTP id g7so1338169ybd.7 for ; Wed, 21 Aug 2019 10:30:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=m7m1DBEvl4+jXT++i64MbAF5g/HBmU0aL7h5oTNL2Gk=; b=fCR8UniwwETVrmgG27bXzUGg2drdEa9RK9bKRdOLv86k2YBAT4ETfcuRvxo0bDjA1I D/FX/V6pNkaykt00EgSll14XUd6S7up/h8jdlg197P2geIFDWJlMDMXlnCC25UFRa2i5 VTUhj64r+ZLyK5nhMIIo4QAUf/lEzxh+vnh3H+G/Bb002oRq1jAums7IsQWGLU9FeVDA /k9E/3dg/ULQfuvmCR5zrujPRsEocq16t+EYQapiet/TOU7AFd2b5kRMJlH3+i2KbpjM TE960ccKnF0mp6j2qleGQL/FpXC/+uhjfFA1v43WgA/uvPK/J0c0PaiyUyrDPJGmChb/ lY8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=m7m1DBEvl4+jXT++i64MbAF5g/HBmU0aL7h5oTNL2Gk=; b=cDFKZCcg6sQxQWUs/ml7UxDCjVy6BoNyDCP06Q/LYAk5RoehIhQB3xFVnnqJWRi5Ls BwoNaM1Lcsk5x43+JjqE4vEIn/27I6Zic2C0z13HALY1GiwzANU/UvRenpBDTdt8dDsP bRZ+U0j7rglB7K6ApT8wSRoreUXXk07/+iIBbA5btJWC2w/Ctok0ObMQHtpOoWawlU1P 7F40apMnM98b4D00sCcjaXFKVi7yoZDvXaOGfGEdpmZlUL0enDs1o/6Y6wdtFP/oEoXh sEbmOGN85myxJ5s3dzCC5D+7MnYxNafgMHPX1L5T/JFIOSgqy+RcDtyyRQ4qCxBGzSvX rTGQ== X-Gm-Message-State: APjAAAVkRw7PFWVcShqvHX1yAO2Wx1QDjnOINr3eQFF4PDGCfBJCDCCK Q92huIrESTZxJV8cxlMZIaP1xXLf X-Google-Smtp-Source: APXvYqxoMY7RxTikxPHgeu0Z8VtojPUHRc7MVklEvQQAU52Gz2+pPxQQ7MqvI4IJt+5SjYPHEs65Wg== X-Received: by 2002:a25:c2c4:: with SMTP id s187mr25659291ybf.21.1566408617497; Wed, 21 Aug 2019 10:30:17 -0700 (PDT) Received: from localhost.localdomain ([2601:c0:c67f:e390::3]) by smtp.gmail.com with ESMTPSA id l71sm2826167ywl.39.2019.08.21.10.30.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Aug 2019 10:30:16 -0700 (PDT) From: Jan Bobek To: qemu-devel@nongnu.org Date: Wed, 21 Aug 2019 13:28:52 -0400 Message-Id: <20190821172951.15333-17-jan.bobek@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190821172951.15333-1-jan.bobek@gmail.com> References: <20190821172951.15333-1-jan.bobek@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::b43 Subject: [Qemu-devel] [RFC PATCH v4 16/75] target/i386: disable AVX/AVX2 cpuid bitchecks X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jan Bobek , =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Ignore the AVX/AVX2 cpuid bits when checking for availability of the relevant instructions. This is clearly incorrect, but it preserves the old behavior, which is useful during development. Note: This changeset is intended for development only and shall not be included in the final patch series. Signed-off-by: Jan Bobek --- target/i386/translate.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/target/i386/translate.c b/target/i386/translate.c index 3e54443d99..e7c2ad41bf 100644 --- a/target/i386/translate.c +++ b/target/i386/translate.c @@ -4564,15 +4564,15 @@ static bool check_cpuid(CPUX86State *env, DisasContext *s, CheckCpuidFeat feat) case CHECK_CPUID_PCLMULQDQ: return s->cpuid_ext_features & CPUID_EXT_PCLMULQDQ; case CHECK_CPUID_AVX: - return s->cpuid_ext_features & CPUID_EXT_AVX; + return true /* s->cpuid_ext_features & CPUID_EXT_AVX */; case CHECK_CPUID_AES_AVX: - return (s->cpuid_ext_features & CPUID_EXT_AES) - && (s->cpuid_ext_features & CPUID_EXT_AVX); + return s->cpuid_ext_features & CPUID_EXT_AES + /* && (s->cpuid_ext_features & CPUID_EXT_AVX) */; case CHECK_CPUID_PCLMULQDQ_AVX: - return (s->cpuid_ext_features & CPUID_EXT_PCLMULQDQ) - && (s->cpuid_ext_features & CPUID_EXT_AVX); + return s->cpuid_ext_features & CPUID_EXT_PCLMULQDQ + /* && (s->cpuid_ext_features & CPUID_EXT_AVX) */; case CHECK_CPUID_AVX2: - return s->cpuid_7_0_ebx_features & CPUID_7_0_EBX_AVX2; + return true /* s->cpuid_7_0_ebx_features & CPUID_7_0_EBX_AVX2 */; default: g_assert_not_reached(); } From patchwork Wed Aug 21 17:28:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Bobek X-Patchwork-Id: 11107787 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 755F713B1 for ; Wed, 21 Aug 2019 18:00:59 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4D70E214DA for ; Wed, 21 Aug 2019 18:00:59 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="XoMobaYD" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4D70E214DA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:51460 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0Uun-0008HK-Un for patchwork-qemu-devel@patchwork.kernel.org; Wed, 21 Aug 2019 14:00:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40884) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0URA-0000vT-Ad for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i0UR9-0007H0-1B for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:20 -0400 Received: from mail-yw1-xc44.google.com ([2607:f8b0:4864:20::c44]:35834) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i0UR8-0007GN-TO for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:18 -0400 Received: by mail-yw1-xc44.google.com with SMTP id g19so1247117ywe.2 for ; Wed, 21 Aug 2019 10:30:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=R7SHwqk+rBA3T0M/WcbegqvZ7iRiLvL4LCeF6iLjNDw=; b=XoMobaYDKq6t4PZ9X95CtpSikcnYYEJAaVndZCQVQ2HnQt8cU9OohOjTnRXhTxlJXM 2NQE9eO5++WR3nVQWFCtxtWT9ktxXmo+kPF7vR/Q5GsSjUVJ+7TD32XysKxXvu8A+NlD riPhfrNFrctpDJz1MYlsOb0cQUFlBCiCYTzHkn6mkKxT7bfrjtwuZzOZuTv+ihGrTr/R JfnLpoY6qqckbHDQFh2xKx9nyRDNIdR5IkwFn4j+3lycuLtkwnYfqZBSRlASj9GDWVr+ Bnn5WwuTH/DLkUSEPB5p0cf88Sp6mDJh4dZ8XQLk7fCc+pYUYWE2yy1QRAJPOVRxn59z HP4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=R7SHwqk+rBA3T0M/WcbegqvZ7iRiLvL4LCeF6iLjNDw=; b=sEPEQmEqcJC0XF2wv4q7t9JSsM0EldITkR8xew8UaADNQn+GM1af8ZM3di3XMknq/Q X6a7NrRCmvnUVavTGmnATwfv65sj/x3SNFBgtaePx4pT621425MZKpo3mdHqt5Lsjml+ 5spcHtZPXzxwVNGkj6Y35vVIfFl1DgUtYps8TqJCD59+p12KEDF5LWEhwuxxkXVI//Xd 2OgHokyN4RrUcBkbeZjcxWvHU0Op1k9Ck/DnhlIC97elgs7BcVrE367rrkLFWDWw8nIw x5fkoQQshm8T1H6aVS1BF5jAfQ8tUi3bH2TphOcOuCngUCcgtihFPsHENa/Uv2kquIXk DZVw== X-Gm-Message-State: APjAAAV6Ho+HMRM3Ng+NALscqU7/sGV2ngI2X0MrlcPPXFJA7t7MfO/J 7h+7iW7QG2SwtcAa5JDIPhFVUXAf X-Google-Smtp-Source: APXvYqzt6kuFhdQGNnl8D2BZfjGQKBy9wtyM/I+G9jApxtS7OEGQeL1L04krXeRLmaojVK++NU6EUw== X-Received: by 2002:a0d:ec12:: with SMTP id v18mr25003657ywe.458.1566408618252; Wed, 21 Aug 2019 10:30:18 -0700 (PDT) Received: from localhost.localdomain ([2601:c0:c67f:e390::3]) by smtp.gmail.com with ESMTPSA id l71sm2826167ywl.39.2019.08.21.10.30.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Aug 2019 10:30:17 -0700 (PDT) From: Jan Bobek To: qemu-devel@nongnu.org Date: Wed, 21 Aug 2019 13:28:53 -0400 Message-Id: <20190821172951.15333-18-jan.bobek@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190821172951.15333-1-jan.bobek@gmail.com> References: <20190821172951.15333-1-jan.bobek@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::c44 Subject: [Qemu-devel] [RFC PATCH v4 17/75] target/i386: introduce instruction operand infrastructure X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jan Bobek , =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" insnop_arg_t, insnop_ctxt_t and init, prepare and finalize functions form the basis of instruction operand decoding. Introduce macros for defining a generic instruction operand; use cases for operand decoding will be introduced later. Signed-off-by: Jan Bobek --- target/i386/translate.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/target/i386/translate.c b/target/i386/translate.c index e7c2ad41bf..78ef0e6608 100644 --- a/target/i386/translate.c +++ b/target/i386/translate.c @@ -4578,6 +4578,34 @@ static bool check_cpuid(CPUX86State *env, DisasContext *s, CheckCpuidFeat feat) } } +/* + * Instruction operand + */ +#define insnop_arg_t(opT) insnop_ ## opT ## _arg_t +#define insnop_ctxt_t(opT) insnop_ ## opT ## _ctxt_t +#define insnop_init(opT) insnop_ ## opT ## _init +#define insnop_prepare(opT) insnop_ ## opT ## _prepare +#define insnop_finalize(opT) insnop_ ## opT ## _finalize + +#define INSNOP_INIT(opT) \ + static bool insnop_init(opT)(insnop_ctxt_t(opT) *ctxt, \ + CPUX86State *env, \ + DisasContext *s, \ + int modrm, bool is_write) + +#define INSNOP_PREPARE(opT) \ + static insnop_arg_t(opT) insnop_prepare(opT)(insnop_ctxt_t(opT) *ctxt, \ + CPUX86State *env, \ + DisasContext *s, \ + int modrm, bool is_write) + +#define INSNOP_FINALIZE(opT) \ + static void insnop_finalize(opT)(insnop_ctxt_t(opT) *ctxt, \ + CPUX86State *env, \ + DisasContext *s, \ + int modrm, bool is_write, \ + insnop_arg_t(opT) arg) + static void gen_sse_ng(CPUX86State *env, DisasContext *s, int b) { enum { From patchwork Wed Aug 21 17:28:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Bobek X-Patchwork-Id: 11107791 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D47B713A4 for ; Wed, 21 Aug 2019 18:02:38 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id ACC2F2082F for ; Wed, 21 Aug 2019 18:02:38 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="YFZs8vUB" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org ACC2F2082F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:51470 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0UwP-0001a0-2y for patchwork-qemu-devel@patchwork.kernel.org; Wed, 21 Aug 2019 14:02:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40896) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0URB-0000y8-0j for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i0UR9-0007I1-Tp for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:20 -0400 Received: from mail-yb1-xb41.google.com ([2607:f8b0:4864:20::b41]:44226) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i0UR9-0007Hn-Po for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:19 -0400 Received: by mail-yb1-xb41.google.com with SMTP id y21so1329187ybi.11 for ; Wed, 21 Aug 2019 10:30:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=jS+rLYgxOqIa8/bxsHiDIZiaK1N2ucGgGDJ5Wj9+e7w=; b=YFZs8vUBuuO/1tlqZ1ku0SsxOWi3NSAYNxfco/azk5unhNJkCqWHoIXKBb1RWjBqtj pVbxLq9yGCnVfhxn6F4i5JGM1iU68BtZooS6bZFbxzYyd74AKb2yzc3TVcCE53KC0Clj JF0NcqGfVlxlRijXGtfzB9qsVF35ZZ9/gKPM8TANnX+P31pink36R70MKmbo0MA31NWF gaecxTnIy68tdVldVMEZrTGilCSnzFQOwBKKtqgArZgGcmIQgpdP6khFz7JETJBLD/mh vWH5VisZydQh3WCaxWPjy5O7b3ocJ9HvBI30eMi+jZhEK2vlt2iBD3KZsMirW2fdz6YP rzug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=jS+rLYgxOqIa8/bxsHiDIZiaK1N2ucGgGDJ5Wj9+e7w=; b=bg8jrxFWoasSwJjAGdxdbWPoVne4FA9oOoOfW0PaHqkUm8zIadS7G3Yr5oPOaDHg19 kHHRB+Vr0Bvh4Xvjt9jWh2haxUMzehVq3xm/vCJaXNyb5D6UUC2vcN7CWUNu4u3FAHoh yQI8BXSGJYsUT0HxRgH7PHrpKLQNpkG1f4P0VfQwA+3kwZvnO1d59eafbcZK+IOFUuWZ gJgInohFnF2Z3Q+xhfvnBMY83oVX7Q996vFZ9FTspKkuSzrPiiuN7kSELLaZ0AJgXX4+ 7FZxdKFGuZqEf8sEfSwf/U+xBYLRssgybPt5HvCUAcn1Gi3vWa1cVWTzT4LTHpYI1iwR WLjQ== X-Gm-Message-State: APjAAAWwDMvryB1xIlDNA2fiL2a24x2g3mw6kumEyIZlBXX1Z2K1Vcsd 2DOJLjiK6pRxDODHX92aO67E69WR X-Google-Smtp-Source: APXvYqw9guS2f10ej8yDGrrA/+NmBCRK3PyB9q3dhCQ000tek7vjIzw4I+8TXBTQH+8Q4BoyQpMCaA== X-Received: by 2002:a25:2f42:: with SMTP id v63mr24151993ybv.228.1566408619155; Wed, 21 Aug 2019 10:30:19 -0700 (PDT) Received: from localhost.localdomain ([2601:c0:c67f:e390::3]) by smtp.gmail.com with ESMTPSA id l71sm2826167ywl.39.2019.08.21.10.30.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Aug 2019 10:30:18 -0700 (PDT) From: Jan Bobek To: qemu-devel@nongnu.org Date: Wed, 21 Aug 2019 13:28:54 -0400 Message-Id: <20190821172951.15333-19-jan.bobek@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190821172951.15333-1-jan.bobek@gmail.com> References: <20190821172951.15333-1-jan.bobek@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::b41 Subject: [Qemu-devel] [RFC PATCH v4 18/75] target/i386: introduce generic operand alias X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jan Bobek , =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" It turns out it is useful to be able to declare operand name aliases. Introduce a macro to capture this functionality. Signed-off-by: Jan Bobek --- target/i386/translate.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/target/i386/translate.c b/target/i386/translate.c index 78ef0e6608..a6f23bae4e 100644 --- a/target/i386/translate.c +++ b/target/i386/translate.c @@ -4606,6 +4606,26 @@ static bool check_cpuid(CPUX86State *env, DisasContext *s, CheckCpuidFeat feat) int modrm, bool is_write, \ insnop_arg_t(opT) arg) +/* + * Operand alias + */ +#define DEF_INSNOP_ALIAS(opT, opT2) \ + typedef insnop_arg_t(opT2) insnop_arg_t(opT); \ + typedef insnop_ctxt_t(opT2) insnop_ctxt_t(opT); \ + \ + INSNOP_INIT(opT) \ + { \ + return insnop_init(opT2)(ctxt, env, s, modrm, is_write); \ + } \ + INSNOP_PREPARE(opT) \ + { \ + return insnop_prepare(opT2)(ctxt, env, s, modrm, is_write); \ + } \ + INSNOP_FINALIZE(opT) \ + { \ + insnop_finalize(opT2)(ctxt, env, s, modrm, is_write, arg); \ + } + static void gen_sse_ng(CPUX86State *env, DisasContext *s, int b) { enum { From patchwork Wed Aug 21 17:28:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Bobek X-Patchwork-Id: 11107799 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CDE4713A4 for ; Wed, 21 Aug 2019 18:04:36 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A58082082F for ; Wed, 21 Aug 2019 18:04:36 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="h/adDrch" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A58082082F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:51488 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0UyJ-000437-K0 for patchwork-qemu-devel@patchwork.kernel.org; Wed, 21 Aug 2019 14:04:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40910) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0URC-00010V-55 for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i0URA-0007JI-SP for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:21 -0400 Received: from mail-yb1-xb41.google.com ([2607:f8b0:4864:20::b41]:36299) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i0URA-0007Io-Ml for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:20 -0400 Received: by mail-yb1-xb41.google.com with SMTP id m9so1348549ybm.3 for ; Wed, 21 Aug 2019 10:30:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=OvlCr4Wc0c1/xk8kLuYNb9twi6LI6UWMtiWdSenUQkk=; b=h/adDrchKBkmZ4ZEIGetv9Kiqj4y8CrBXpH3MOsPGs1wDMTiphC+QeM+E+7LgBQKQV p8cRXC7QaVTVtB+vlXOgtrGATjnEhto0ycR6NOY3YMDxOjb+tjYuC0Bk1/VJGEt5LNJV 270AMsYgSTzW3hr0XBxPjWgPHKO2zCpKdz5mtJySkqhyYvHxNX5PV+CFIw1ptw5CFjwr AhNeSxAyf6xhJCmSmkVnRjWjQPqt4sTP+W5iQR/9mHcu0Y1JcDXfzXAokciXPHaetNoW dCgqWOcK4iOX1ZkEBMv/2YzDao/hihCah3+qtodzaryldUevLNWm+GytAghg4q6CGOmP XQSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=OvlCr4Wc0c1/xk8kLuYNb9twi6LI6UWMtiWdSenUQkk=; b=oXM5fyXs/DdKVexjnPfuBemT83yzCxBUgunWu+dSUuM0E+Eu6yXPKqQ+faxB7Ouh0H AfgNfgn4L/7REFQYrjfLrjyX4oyY0QESVfBKjAkRLawvn9LwQQaGAXXEs26/rX4cMX46 L8vbSzGFjZwqnuU8Tj5gj2pL3Wqcjj4LZDo3tD4719I2SeDFJzEiXvr1MMS9yt5ibEem uSYCSK32CCDeEVyfSjFopBNm/PI/RBk+/SWICrAogTz6o2+qdlDxbPZw8V4f5gQC6/+c GAxqrm5sFYjQB2lmdk6tmaXXBu95RdVkhM65HWpBbyc5hsnN7FUWiVAQ2PeSsmBlkDOU cQaw== X-Gm-Message-State: APjAAAUsvcVHnWHUqclF6yP9VPcykqkbk6Pu9gBKecu6kL5UNR40yd6W RCJTamWXhWwjEUN9lHIlLJwSjUGw X-Google-Smtp-Source: APXvYqxhpWvTkDuBKP3wUwfM8duau9BLvQh6Hy1AbFW78p1WS+z7Psx/JhZWlH2BGBa1u8XV6c83Tg== X-Received: by 2002:a25:8001:: with SMTP id m1mr22787580ybk.66.1566408620088; Wed, 21 Aug 2019 10:30:20 -0700 (PDT) Received: from localhost.localdomain ([2601:c0:c67f:e390::3]) by smtp.gmail.com with ESMTPSA id l71sm2826167ywl.39.2019.08.21.10.30.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Aug 2019 10:30:19 -0700 (PDT) From: Jan Bobek To: qemu-devel@nongnu.org Date: Wed, 21 Aug 2019 13:28:55 -0400 Message-Id: <20190821172951.15333-20-jan.bobek@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190821172951.15333-1-jan.bobek@gmail.com> References: <20190821172951.15333-1-jan.bobek@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::b41 Subject: [Qemu-devel] [RFC PATCH v4 19/75] target/i386: introduce generic either-or operand X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jan Bobek , =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" The either-or operand attempts to decode one operand, and if it fails, it falls back to a second operand. It is unifying, meaning that insnop_arg_t of the second operand must be implicitly castable to insnop_arg_t of the first operand. Signed-off-by: Jan Bobek --- target/i386/translate.c | 44 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/target/i386/translate.c b/target/i386/translate.c index a6f23bae4e..68c6b7d16b 100644 --- a/target/i386/translate.c +++ b/target/i386/translate.c @@ -4626,6 +4626,50 @@ static bool check_cpuid(CPUX86State *env, DisasContext *s, CheckCpuidFeat feat) insnop_finalize(opT2)(ctxt, env, s, modrm, is_write, arg); \ } +/* + * Generic unifying either-or operand + */ +#define DEF_INSNOP_EITHER(opT, opT1, opT2) \ + typedef insnop_arg_t(opT1) insnop_arg_t(opT); \ + typedef struct { \ + bool is_ ## opT1; \ + union { \ + insnop_ctxt_t(opT1) ctxt_ ## opT1; \ + insnop_ctxt_t(opT2) ctxt_ ## opT2; \ + }; \ + } insnop_ctxt_t(opT); \ + \ + INSNOP_INIT(opT) \ + { \ + if (insnop_init(opT1)(&ctxt->ctxt_ ## opT1, \ + env, s, modrm, is_write)) { \ + ctxt->is_ ## opT1 = true; \ + return true; \ + } \ + if (insnop_init(opT2)(&ctxt->ctxt_ ## opT2, \ + env, s, modrm, is_write)) { \ + ctxt->is_ ## opT1 = false; \ + return true; \ + } \ + return false; \ + } \ + INSNOP_PREPARE(opT) \ + { \ + return (ctxt->is_ ## opT1 \ + ? insnop_prepare(opT1)(&ctxt->ctxt_ ## opT1, \ + env, s, modrm, is_write) \ + : insnop_prepare(opT2)(&ctxt->ctxt_ ## opT2, \ + env, s, modrm, is_write)); \ + } \ + INSNOP_FINALIZE(opT) \ + { \ + (ctxt->is_ ## opT1 \ + ? insnop_finalize(opT1)(&ctxt->ctxt_ ## opT1, \ + env, s, modrm, is_write, arg) \ + : insnop_finalize(opT2)(&ctxt->ctxt_ ## opT2, \ + env, s, modrm, is_write, arg)); \ + } + static void gen_sse_ng(CPUX86State *env, DisasContext *s, int b) { enum { From patchwork Wed Aug 21 17:28:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Bobek X-Patchwork-Id: 11107803 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 89B3514DE for ; Wed, 21 Aug 2019 18:05:32 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 62124214DA for ; Wed, 21 Aug 2019 18:05:32 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="M3Ek/Dbc" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 62124214DA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:51494 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0UzD-0005cw-9C for patchwork-qemu-devel@patchwork.kernel.org; Wed, 21 Aug 2019 14:05:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40919) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0URC-00011o-Pu for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i0URB-0007Kf-K5 for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:22 -0400 Received: from mail-yb1-xb42.google.com ([2607:f8b0:4864:20::b42]:40494) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i0URB-0007Jj-FA for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:21 -0400 Received: by mail-yb1-xb42.google.com with SMTP id g7so1338231ybd.7 for ; Wed, 21 Aug 2019 10:30:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=i/Nisqp4PZPuP7Q0R+kpy6leP61SyzgXDzHcbhyn0mU=; b=M3Ek/DbcHLz4YcNRyUpcsXOgonQWD8kWJcjNfLsgiNPTZXhyhhmZjcDfZwxVRTWrWO BSFuYFAGZNDWoyHmE0w+xodZdjfS55GpTwMFjbZ628m4dHEk72j4t+kVYnH++ZyEDSSz GfziXcQdctFMUTHqtgb8UoGtw8y54rRhJ4Mf3ThR1W8ggamj1+5paamHmubqMoG31Lrt 2MOFVvD7YKNo1BVIhKNRiJAIYS/IiYTT/8YfJZ0EYfoPNQmbz80uncKFylj3qWG5h/Ut 6XOa75EKDehKpVACQybI+v9iYf6Y4cX/KIwNLwuGWLhDxt95irX3EQEgCCoEIkEMc2w4 yIDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=i/Nisqp4PZPuP7Q0R+kpy6leP61SyzgXDzHcbhyn0mU=; b=XJQxP9GHXheC2emoHJTG1f+Kgsm3wPegJwwSvgYvb0gW1pLU4rfFnvRV2GL0YQaMqP SQNx7shuBBBT3jrRbiLjG2eXH6vzErM45zseVuo2f6Llb8aw3eLflARoHS/XCLZxHheP GE7pBwsTX+Fy28el8OGFJdyYF5SRBWoCnU9s6gXT4q5mFN4+d/3bVIbniWyh/Q+rlyhF EPAt07QivdQkyjQiaKA0mXB7N1v9IGPQS1u0yEh3xbnJedm6Isg8wAbQQLh0fokxiF44 ofmqnqDDLOcFPxQjEFzbdsS5ebavmGTEBDSwNkqybMHT57XS8a/W6ayknp+fGGzbcFnb HVRA== X-Gm-Message-State: APjAAAXnwg9iZf+B42tEcZq1xGgB5XsN8lNF4wwBM82xb4PoZcVjKi7c vI23feyP3iwk8WO+Fcnwas9UFhmM X-Google-Smtp-Source: APXvYqyWABG0NkqDKp0p3deEUjyuT7JDWJi4fkjslISxLj0UAY9jObhYg5iBpcqvqfUj4GQXIDpCXg== X-Received: by 2002:a5b:612:: with SMTP id d18mr3124392ybq.475.1566408620847; Wed, 21 Aug 2019 10:30:20 -0700 (PDT) Received: from localhost.localdomain ([2601:c0:c67f:e390::3]) by smtp.gmail.com with ESMTPSA id l71sm2826167ywl.39.2019.08.21.10.30.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Aug 2019 10:30:20 -0700 (PDT) From: Jan Bobek To: qemu-devel@nongnu.org Date: Wed, 21 Aug 2019 13:28:56 -0400 Message-Id: <20190821172951.15333-21-jan.bobek@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190821172951.15333-1-jan.bobek@gmail.com> References: <20190821172951.15333-1-jan.bobek@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::b42 Subject: [Qemu-devel] [RFC PATCH v4 20/75] target/i386: introduce generic load-store operand X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jan Bobek , =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" This operand attempts to capture the "indirect" or "memory" operand in a generic way. It significatly reduces the amount code that needs to be written in order to read operands from memory to temporary storage and write them back. Signed-off-by: Jan Bobek --- target/i386/translate.c | 57 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/target/i386/translate.c b/target/i386/translate.c index 68c6b7d16b..1be6176934 100644 --- a/target/i386/translate.c +++ b/target/i386/translate.c @@ -4670,6 +4670,63 @@ static bool check_cpuid(CPUX86State *env, DisasContext *s, CheckCpuidFeat feat) env, s, modrm, is_write, arg)); \ } +/* + * Generic load-store operand + */ +#define insnop_ldst(opTarg, opTptr) \ + insnop_ldst_ ## opTarg ## opTptr + +#define INSNOP_LDST(opTarg, opTptr) \ + static void insnop_ldst(opTarg, opTptr)(CPUX86State *env, \ + DisasContext *s, \ + bool is_write, \ + insnop_arg_t(opTarg) arg, \ + insnop_arg_t(opTptr) ptr) + +#define DEF_INSNOP_LDST(opT, opTarg, opTptr) \ + typedef insnop_arg_t(opTarg) insnop_arg_t(opT); \ + typedef struct { \ + insnop_ctxt_t(opTarg) arg_ctxt; \ + insnop_ctxt_t(opTptr) ptr_ctxt; \ + insnop_arg_t(opTptr) ptr; \ + } insnop_ctxt_t(opT); \ + \ + /* forward declaration */ \ + INSNOP_LDST(opTarg, opTptr); \ + \ + INSNOP_INIT(opT) \ + { \ + return insnop_init(opTarg)(&ctxt->arg_ctxt, \ + env, s, modrm, is_write) \ + && insnop_init(opTptr)(&ctxt->ptr_ctxt, \ + env, s, modrm, is_write); \ + } \ + INSNOP_PREPARE(opT) \ + { \ + const insnop_arg_t(opTarg) arg = \ + insnop_prepare(opTarg)(&ctxt->arg_ctxt, \ + env, s, modrm, is_write); \ + ctxt->ptr = \ + insnop_prepare(opTptr)(&ctxt->ptr_ctxt, \ + env, s, modrm, is_write); \ + if (!is_write) { \ + insnop_ldst(opTarg, opTptr)(env, s, is_write, \ + arg, ctxt->ptr); \ + } \ + return arg; \ + } \ + INSNOP_FINALIZE(opT) \ + { \ + if (is_write) { \ + insnop_ldst(opTarg, opTptr)(env, s, is_write, \ + arg, ctxt->ptr); \ + } \ + insnop_finalize(opTptr)(&ctxt->ptr_ctxt, \ + env, s, modrm, is_write, ctxt->ptr); \ + insnop_finalize(opTarg)(&ctxt->arg_ctxt, \ + env, s, modrm, is_write, arg); \ + } + static void gen_sse_ng(CPUX86State *env, DisasContext *s, int b) { enum { From patchwork Wed Aug 21 17:28:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Bobek X-Patchwork-Id: 11107667 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D4B4614DE for ; Wed, 21 Aug 2019 17:48:49 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id AC81922D6D for ; Wed, 21 Aug 2019 17:48:49 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="UAX5yKI+" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AC81922D6D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:51318 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0Uj2-0000Io-Aa for patchwork-qemu-devel@patchwork.kernel.org; Wed, 21 Aug 2019 13:48:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40934) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0URD-00013C-Hx for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i0URC-0007Lz-Hg for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:23 -0400 Received: from mail-yw1-xc42.google.com ([2607:f8b0:4864:20::c42]:35833) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i0URC-0007LC-Df for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:22 -0400 Received: by mail-yw1-xc42.google.com with SMTP id g19so1247176ywe.2 for ; Wed, 21 Aug 2019 10:30:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=iDDKKkIsqc5vcwy+TY7VAlm2HY42sA6+LGzneYmglI8=; b=UAX5yKI+RA4KqLkVkxerCxJuJZg3JYm2iJx/OEg04OTyGx1uB4zRQqge6A2COGPbBX ADLg1+0HwdqtuXee+MK1KdkNiZrVbufG2iVV+4THnlDJsh/N03h9EH9SJEJMfsjsch+7 eG/TsLIv1fRWoB79aonXWpac0Skdxn0fSpW3r0IGb2pB56M6aIZjzm4fapq0K1sRW3TC XFk4loHjKibTKvRhG8HgH7EIh+NK7Tu80732Kyod+IVsZ2BbRu94O7D6XCdSHEwaQuQl PZ8egdU0I7wNpUQ5JuTmfKyjI1mYqbDWlYIs5rFS0ajkzZZQTi6kzDXtuSFKHZKz7Kdj 4CzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=iDDKKkIsqc5vcwy+TY7VAlm2HY42sA6+LGzneYmglI8=; b=HKfuwxnUxqj6hgDdI5yowEqaotMw9KlbbVATiVjzphZC0c74EOLIHJak2i1vIjeYiw DNrt8WXpcbUARAqbDbXeqK7GiQdtVSYNJTk7w/q+Xg7Ch1+8wIBtaHgL8PBVSuMrqi0g ADaIAz8hda7Hm5GNBC+9vjyFSiJVGdoSe9otRIRtkto4xVDSKJ+EzHKBdCuVExAOMAeM aheyVupIbElwrzbKwjJohfgt4FTtwUU/Ww6VZeRPyyHqVXNzXzzJsDOk6ck3cibMMIA+ ix1ZzHbqJF1TtRz25IuEb8vuh6SKYmT5AW44VmiQzCWStDBlUropUiiBJUUmAFxCTz1P MQ0Q== X-Gm-Message-State: APjAAAVkY4cnvYodaa8RDI+GK7FvMF8/VnzWMKF1QmeoOpI+qNpxJCq2 4cpuLe8n64JSnT8IZ4M0qZG6oXaZ X-Google-Smtp-Source: APXvYqy0qumOobhp63Wtn1kLDwOnTWQ7f/SFiUWXPEWFDUqRhLWx8bEX4IxHJUI29XCtyv0dOouBUQ== X-Received: by 2002:a81:7914:: with SMTP id u20mr25352685ywc.230.1566408621648; Wed, 21 Aug 2019 10:30:21 -0700 (PDT) Received: from localhost.localdomain ([2601:c0:c67f:e390::3]) by smtp.gmail.com with ESMTPSA id l71sm2826167ywl.39.2019.08.21.10.30.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Aug 2019 10:30:21 -0700 (PDT) From: Jan Bobek To: qemu-devel@nongnu.org Date: Wed, 21 Aug 2019 13:28:57 -0400 Message-Id: <20190821172951.15333-22-jan.bobek@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190821172951.15333-1-jan.bobek@gmail.com> References: <20190821172951.15333-1-jan.bobek@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::c42 Subject: [Qemu-devel] [RFC PATCH v4 21/75] target/i386: introduce tcg register operands X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jan Bobek , =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" TCG operands allocate a 32-bit or 64-bit TCG temporary and later automatically free it. Signed-off-by: Jan Bobek --- target/i386/translate.c | 44 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/target/i386/translate.c b/target/i386/translate.c index 1be6176934..80cfb59978 100644 --- a/target/i386/translate.c +++ b/target/i386/translate.c @@ -4727,6 +4727,50 @@ static bool check_cpuid(CPUX86State *env, DisasContext *s, CheckCpuidFeat feat) env, s, modrm, is_write, arg); \ } +/* + * tcg_i32 + * + * Operand which allocates a 32-bit TCG temporary and frees it + * automatically after use. + */ +typedef TCGv_i32 insnop_arg_t(tcg_i32); +typedef struct {} insnop_ctxt_t(tcg_i32); + +INSNOP_INIT(tcg_i32) +{ + return true; +} +INSNOP_PREPARE(tcg_i32) +{ + return tcg_temp_new_i32(); +} +INSNOP_FINALIZE(tcg_i32) +{ + tcg_temp_free_i32(arg); +} + +/* + * tcg_i64 + * + * Operand which allocates a 64-bit TCG temporary and frees it + * automatically after use. + */ +typedef TCGv_i64 insnop_arg_t(tcg_i64); +typedef struct {} insnop_ctxt_t(tcg_i64); + +INSNOP_INIT(tcg_i64) +{ + return true; +} +INSNOP_PREPARE(tcg_i64) +{ + return tcg_temp_new_i64(); +} +INSNOP_FINALIZE(tcg_i64) +{ + tcg_temp_free_i64(arg); +} + static void gen_sse_ng(CPUX86State *env, DisasContext *s, int b) { enum { From patchwork Wed Aug 21 17:28:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Bobek X-Patchwork-Id: 11107811 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C607913A4 for ; Wed, 21 Aug 2019 18:07:10 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9DE6D214DA for ; Wed, 21 Aug 2019 18:07:10 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="OhZR2peg" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9DE6D214DA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:51514 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0V0n-0008RH-M4 for patchwork-qemu-devel@patchwork.kernel.org; Wed, 21 Aug 2019 14:07:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40944) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0URE-00013S-9H for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i0URD-0007Nd-6O for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:24 -0400 Received: from mail-yb1-xb44.google.com ([2607:f8b0:4864:20::b44]:34115) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i0URD-0007N8-2s for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:23 -0400 Received: by mail-yb1-xb44.google.com with SMTP id u68so1356179ybg.1 for ; Wed, 21 Aug 2019 10:30:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=HWIcXPysmeS2l7c7W0WqcjKf8OA5bIZKBcQSIeG2wd8=; b=OhZR2peg55sHT1qIxNFy+UUAURo5zRTulvbSkHsLq/WFTWKqXG2lTRgbtfzVhw3mjj E3unQu2qSVzltYX2jm7ba/WmltgO2gmvEjxHowVd92p6rWzVyqjHVlVPrhMerXfa24Uk 20gd8ZvWM93KH8MN9ls7Sz4lm5n9CBNmYd3zJY3mlC8mG/g5yhwTBGldmTAIpS1ivnff Zpfqz1SLBalyMKypacYV/XC2whFl25DUjTh2n+Hl1O+JdFpFyI4rWiqtmWidT/GG8mSa 7qXFZZdSxPt1GgTbJGOmMJy7JW2sw1FDm1LvRPRmyMvN3N89zszJ8DEAQ2cbMndtisps HMMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=HWIcXPysmeS2l7c7W0WqcjKf8OA5bIZKBcQSIeG2wd8=; b=rHc7x8wvLaR5/t9fM8OH8+0EPxa+NosA3EFZoLt6yN33Cz2nUnQ2ZpP0JAlcGNRXEx v3jU8ieRPtdM861INgehm9vUzWODxnlwSQBXi1s2LBtF9pBQn5vDCe3sL0hwglwm7ctQ jibIs5kwuZCKkn98EogZkrOZKKDpVglSZd6NFmnsK2MpB4wTgv6ZG1OYyaGNoKdXwAlc +LRYKVKKBoPS9YeJYDzJcLa0zWzC9I73q/PxRXgQzvAGec+l81PGOsYKLG+Mco54Zihf wCBdrMxNcYfYIUKdvJjgGBBuRFBOHxkqIWrNluA20q1yyo49eeC0TKPHGTPIA5diBWHO WtKQ== X-Gm-Message-State: APjAAAUT8OtlN6aBzYMaRuY5UPrUHYBd7HO8ZuLw0NEmBrkl/6CpNV+O OfiLrT/zNvGDR7Y7SbF5yK1jRc6h X-Google-Smtp-Source: APXvYqyBvZHNzUM2k0PLedAL9H2YzytwFvXdzEwb3XW5AS2v7C1sBbtQnfvVyokVlsbdWxXN12mE9w== X-Received: by 2002:a25:7357:: with SMTP id o84mr26087341ybc.54.1566408622418; Wed, 21 Aug 2019 10:30:22 -0700 (PDT) Received: from localhost.localdomain ([2601:c0:c67f:e390::3]) by smtp.gmail.com with ESMTPSA id l71sm2826167ywl.39.2019.08.21.10.30.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Aug 2019 10:30:21 -0700 (PDT) From: Jan Bobek To: qemu-devel@nongnu.org Date: Wed, 21 Aug 2019 13:28:58 -0400 Message-Id: <20190821172951.15333-23-jan.bobek@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190821172951.15333-1-jan.bobek@gmail.com> References: <20190821172951.15333-1-jan.bobek@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::b44 Subject: [Qemu-devel] [RFC PATCH v4 22/75] target/i386: introduce modrm operand X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jan Bobek , =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" This permits the ModR/M byte to be passed raw into the code generator, effectively allowing to short-circuit the operand decoding mechanism and do the decoding work manually in the code generator. Signed-off-by: Jan Bobek --- target/i386/translate.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/target/i386/translate.c b/target/i386/translate.c index 80cfb59978..a0a9f64ff3 100644 --- a/target/i386/translate.c +++ b/target/i386/translate.c @@ -4771,6 +4771,26 @@ INSNOP_FINALIZE(tcg_i64) tcg_temp_free_i64(arg); } +/* + * modrm + * + * Operand whose value is the ModR/M byte. + */ +typedef int insnop_arg_t(modrm); +typedef struct {} insnop_ctxt_t(modrm); + +INSNOP_INIT(modrm) +{ + return true; +} +INSNOP_PREPARE(modrm) +{ + return modrm; +} +INSNOP_FINALIZE(modrm) +{ +} + static void gen_sse_ng(CPUX86State *env, DisasContext *s, int b) { enum { From patchwork Wed Aug 21 17:28:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Bobek X-Patchwork-Id: 11107805 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7DB1613A4 for ; Wed, 21 Aug 2019 18:06:01 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 55F2E214DA for ; Wed, 21 Aug 2019 18:06:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="GcGbpCAy" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 55F2E214DA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:51498 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0Uzg-0006LI-3q for patchwork-qemu-devel@patchwork.kernel.org; Wed, 21 Aug 2019 14:06:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40955) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0URF-00013z-8z for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i0URE-0007Qp-A7 for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:25 -0400 Received: from mail-yb1-xb43.google.com ([2607:f8b0:4864:20::b43]:35302) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i0URE-0007PI-5x for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:24 -0400 Received: by mail-yb1-xb43.google.com with SMTP id c9so1353244ybf.2 for ; Wed, 21 Aug 2019 10:30:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=q98AimDtwVY381Wbpacj9E/FBb8VmamvTK/57HXfzu4=; b=GcGbpCAyVf+Q4NMS+Gshz1tQEJLuTWS6wNY2JMHoPTnxMv2j+6qWpXa53yVUrQLVIb zgsltgVInfnTObgfJCXKj2YY9z3y2A6KJfCnTQNU+5LcMR8kMB4rNmL2jqomyVEAaOaT Hn7iec+E2R+VRs5bxLUw33H1RBlvT65SP2lUQOy4v8gZd8YRVR3J4zZo50i4Az2kKELB 8DoFmH4WiuXpstkoUcq3vs/nYNOyiFC58wfat1PlGbegRW2bYVGYerAYBginThWmcAh7 U2W4sY4epd/37dA9JP6xmSLfR0jnwqF+WNw0x3irtM54V9gBn/UCBJAcl4DY6tX9RMW0 Wsyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=q98AimDtwVY381Wbpacj9E/FBb8VmamvTK/57HXfzu4=; b=tqJg1Xjm86Hwj926V0EF8O9WjqwDqobhBadgKWvT7stbupowsxk0+mDwKEIUunnQDR U5H4UkvyJQ/89np0fVsseUyI1q69Ar/nnDRojIlzyosG+oUeeB8IJztTMTfVdChTOP6T JHXslEniXNIpEd8T3D4c2S3OF/N+vr/tLXV+F+38AFd70E9CxnjhFsPsB2LOLTGLwFb2 vbsL/sFy2p/e+9UTSiegmnz3nnLB09lhsp0AjS2HVhEkRAUEl7cOVURXwuXzpQUYrThU IpvPaqjWjRtc/ye8gfxyjtbVwiq/kWS8++cHNBd4hogGMbMIiftGJMQvVXPzQRwqnsUw +s2Q== X-Gm-Message-State: APjAAAWVP6giffHXV4jfQWM6ftU2gHyfr7i/m5gKzwqPGHPpM0AX/9fV tDQaECALCCFuh2EmsEJoELFvn2cJ X-Google-Smtp-Source: APXvYqyZo9/AWGRAVj8NIWrUtiatkx3Zjsl5MyUcFttI3zgVZ/ZZdxk2x/05s/8851/xD2/JYpTF7A== X-Received: by 2002:a25:7005:: with SMTP id l5mr25780274ybc.452.1566408623303; Wed, 21 Aug 2019 10:30:23 -0700 (PDT) Received: from localhost.localdomain ([2601:c0:c67f:e390::3]) by smtp.gmail.com with ESMTPSA id l71sm2826167ywl.39.2019.08.21.10.30.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Aug 2019 10:30:22 -0700 (PDT) From: Jan Bobek To: qemu-devel@nongnu.org Date: Wed, 21 Aug 2019 13:28:59 -0400 Message-Id: <20190821172951.15333-24-jan.bobek@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190821172951.15333-1-jan.bobek@gmail.com> References: <20190821172951.15333-1-jan.bobek@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::b43 Subject: [Qemu-devel] [RFC PATCH v4 23/75] target/i386: introduce operands for decoding modrm fields X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jan Bobek , =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" The old code uses bitshifts and bitwise-and all over the place for decoding ModR/M fields. Avoid doing that by introducing proper decoding operands. Signed-off-by: Jan Bobek --- target/i386/translate.c | 62 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/target/i386/translate.c b/target/i386/translate.c index a0a9f64ff3..b3b316d389 100644 --- a/target/i386/translate.c +++ b/target/i386/translate.c @@ -4791,6 +4791,68 @@ INSNOP_FINALIZE(modrm) { } +/* + * modrm_mod + * + * Operand whose value is the MOD field of the ModR/M byte. + */ +typedef int insnop_arg_t(modrm_mod); +typedef struct {} insnop_ctxt_t(modrm_mod); + +INSNOP_INIT(modrm_mod) +{ + return true; +} +INSNOP_PREPARE(modrm_mod) +{ + return (modrm >> 6) & 3; +} +INSNOP_FINALIZE(modrm_mod) +{ +} + +/* + * modrm_reg + * + * Operand whose value is the REG field of the ModR/M byte, extended + * with the REX.R bit if REX prefix is present. + */ +typedef int insnop_arg_t(modrm_reg); +typedef struct {} insnop_ctxt_t(modrm_reg); + +INSNOP_INIT(modrm_reg) +{ + return true; +} +INSNOP_PREPARE(modrm_reg) +{ + return ((modrm >> 3) & 7) | REX_R(s); +} +INSNOP_FINALIZE(modrm_reg) +{ +} + +/* + * modrm_rm + * + * Operand whose value is the RM field of the ModR/M byte, extended + * with the REX.B bit if REX prefix is present. + */ +typedef int insnop_arg_t(modrm_rm); +typedef struct {} insnop_ctxt_t(modrm_rm); + +INSNOP_INIT(modrm_rm) +{ + return true; +} +INSNOP_PREPARE(modrm_rm) +{ + return (modrm & 7) | REX_B(s); +} +INSNOP_FINALIZE(modrm_rm) +{ +} + static void gen_sse_ng(CPUX86State *env, DisasContext *s, int b) { enum { From patchwork Wed Aug 21 17:29:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Bobek X-Patchwork-Id: 11107813 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 69ADC14DE for ; Wed, 21 Aug 2019 18:08:14 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3E41B22D6D for ; Wed, 21 Aug 2019 18:08:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="H2fsKVxS" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3E41B22D6D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:51520 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0V1p-0001BG-3d for patchwork-qemu-devel@patchwork.kernel.org; Wed, 21 Aug 2019 14:08:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40969) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0URI-0001AG-Hr for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i0URF-0007S0-HQ for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:26 -0400 Received: from mail-yb1-xb44.google.com ([2607:f8b0:4864:20::b44]:32970) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i0URF-0007Re-DQ for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:25 -0400 Received: by mail-yb1-xb44.google.com with SMTP id b16so1356989ybq.0 for ; Wed, 21 Aug 2019 10:30:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=gYuBNOkKKJStCysNXLLG2nufiXX8kYlFxubPjNYQr7Q=; b=H2fsKVxSTX6vSTFGqie94brcD8woNBB0D51JK6oOKe8L8MtaKHc22VmJt+kfkyizrw 0ewynb0hOTQUqRvkQI68wGa8Tz16eVyfiGzFvHMApSesWxP3JWdo9FZA1W7tDYecKA6U d9Fy0qeOpb5qJEaVRb4RqibPly/tTfmLCW7gAdXzGD7ECt7NEfMAk4xEqEXESzfXFDhx Y18gY/KG5wsyIUxf5PAXDNlUysPNt+3Mx4kBM362S/Vds3iJptyMti9F16z8r9n4oShz wdB4ZvLM94krvbKfnEzurE2QT+BioQsuYoQ+ZBSvg7aCe42jbx3BPTRMKD6/JB3upFNQ K8nQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=gYuBNOkKKJStCysNXLLG2nufiXX8kYlFxubPjNYQr7Q=; b=OD13PfVzgJ4KtaQY9oeldmsfX/zGAHVmHzcAiEAoNzzgyLSox8GwKhgy7RthWYAjfl cS0qrEgTp1WyWiBMybWkeDQI22loJp7wm7uB4oiqRoVnHE/csN8/sE0LXDU4/nCUY41g rRGWM+g+/hZlHujjLZlTnrcHkVrqeoh6n5dqQKruiDnsA15I1hwC9U4kEOV724wls3ak DOelNA5GUrgrjM2zXO3igigBd6yKYsclSUd3H+EhSMECIpZz9nPGM3wPEZOmms9EqdWi ia8iKviIcdPTEIqemHiApmZ8p9bsO3IRfG0i0noTTTndv/xXh6p/n51pUaH/Ib3uc1tA DcnA== X-Gm-Message-State: APjAAAVWDhqvV22M+XERKLAvJo2M6nLYEaIm4VWzGGfBcTzOZHz5S06c drDgqv8/8H93yCHCShxm6hX4a5Wr X-Google-Smtp-Source: APXvYqzIQWTBU4QWQHj0lqWtoYPnrdqpFjl4gu3/aeIduRuINP1DiQDcPlYMtTqfQouGUREDB5GQSg== X-Received: by 2002:a25:e806:: with SMTP id k6mr25957365ybd.74.1566408624792; Wed, 21 Aug 2019 10:30:24 -0700 (PDT) Received: from localhost.localdomain ([2601:c0:c67f:e390::3]) by smtp.gmail.com with ESMTPSA id l71sm2826167ywl.39.2019.08.21.10.30.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Aug 2019 10:30:24 -0700 (PDT) From: Jan Bobek To: qemu-devel@nongnu.org Date: Wed, 21 Aug 2019 13:29:00 -0400 Message-Id: <20190821172951.15333-25-jan.bobek@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190821172951.15333-1-jan.bobek@gmail.com> References: <20190821172951.15333-1-jan.bobek@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::b44 Subject: [Qemu-devel] [RFC PATCH v4 24/75] target/i386: introduce operand for direct-only r/m field X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jan Bobek , =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Many operands can only decode successfully if the ModR/M byte has the direct form (i.e. MOD=3). Capture this common aspect by introducing a special direct-only r/m field operand. Signed-off-by: Jan Bobek --- target/i386/translate.c | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/target/i386/translate.c b/target/i386/translate.c index b3b316d389..886f64a58f 100644 --- a/target/i386/translate.c +++ b/target/i386/translate.c @@ -4853,6 +4853,43 @@ INSNOP_FINALIZE(modrm_rm) { } +/* + * modrm_rm_direct + * + * Equivalent of modrm_rm, but only decodes successfully if + * the ModR/M byte has the direct form (i.e. MOD=3). + */ +typedef insnop_arg_t(modrm_rm) insnop_arg_t(modrm_rm_direct); +typedef struct { + insnop_ctxt_t(modrm_rm) rm; +} insnop_ctxt_t(modrm_rm_direct); + +INSNOP_INIT(modrm_rm_direct) +{ + bool ret; + insnop_ctxt_t(modrm_mod) modctxt; + + ret = insnop_init(modrm_mod)(&modctxt, env, s, modrm, 0); + if (ret) { + const int mod = insnop_prepare(modrm_mod)(&modctxt, env, s, modrm, 0); + if (mod == 3) { + ret = insnop_init(modrm_rm)(&ctxt->rm, env, s, modrm, is_write); + } else { + ret = false; + } + insnop_finalize(modrm_mod)(&modctxt, env, s, modrm, 0, mod); + } + return ret; +} +INSNOP_PREPARE(modrm_rm_direct) +{ + return insnop_prepare(modrm_rm)(&ctxt->rm, env, s, modrm, is_write); +} +INSNOP_FINALIZE(modrm_rm_direct) +{ + insnop_finalize(modrm_rm)(&ctxt->rm, env, s, modrm, is_write, arg); +} + static void gen_sse_ng(CPUX86State *env, DisasContext *s, int b) { enum { From patchwork Wed Aug 21 17:29:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Bobek X-Patchwork-Id: 11107675 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 055C51399 for ; Wed, 21 Aug 2019 17:51:50 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D13A622D6D for ; Wed, 21 Aug 2019 17:51:49 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="r5zeisa3" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D13A622D6D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:51364 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0Ulw-0004Z1-Nv for patchwork-qemu-devel@patchwork.kernel.org; Wed, 21 Aug 2019 13:51:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40991) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0URJ-0001CY-U1 for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i0URJ-0007Y3-0b for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:29 -0400 Received: from mail-yb1-xb43.google.com ([2607:f8b0:4864:20::b43]:34115) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i0URG-0007SV-He for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:27 -0400 Received: by mail-yb1-xb43.google.com with SMTP id u68so1356279ybg.1 for ; Wed, 21 Aug 2019 10:30:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=aKnxDUl+pAS+n7e2NGlRxgig6yb22d1z6rELIvzn6Yg=; b=r5zeisa3m8t866tcsegYfLtu5+E6a8eg7w9MbR8oPXD7Sf2R1IB+wUFkJY2Qz3aRkh nOZ5of8LHREQ3UkfnJac6387a4mxGPjNjYyPTKRMAM4VZ/JcAN3Js7SB86UQ2FVo217y klcnbxUyw16+x0TVRDwfk1CVjTxHTRxqBqIx1KUlETZbD+2B8i8puBd/Rs6yJmdnQgNO Yn0jmTqXyCvNKgaMPzRTAalQfXN6CzSinB72mYSMW/C7pnZf+eIG9PpEkLZr3BjCf+G5 i/n4pOq2m/6bbXQatkJIlhoyj53nr6yxrk70jUTj75oGmVeNoUYx4xYvERpXq6Xv2jNr 4sHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=aKnxDUl+pAS+n7e2NGlRxgig6yb22d1z6rELIvzn6Yg=; b=jyadkH9yjviMz4dYvLDWRh70cA9tLpX+Dp8Ph82gzFBWyZgUGbBnXpcruaSk8d2DNk 5rKXNGfJeXaaQ29RGaGjq/maQFeXYJoTxbqzGYgf1TIQAjrrt0GXRuz1tCIk0NL1Jd84 rQ5rN6NUoMS4jjukTieg+50r2BnHQzgKjffvXyvR4+J+Jbl/a2A0oKUZrXmGyXR66+rZ 9De0CzuIMrhuDjMUD8/kiBc8pjxwZAXgMeCHnfEaBO+z1vFjlnFt1yClX2pRR/wiXZBY 12Z9eTEZGfOyKe6Qt40z6SkU9cjFsqOz8yr3bApwz7LYZ0A+33CeFGgYg7le61ZazJdh B95g== X-Gm-Message-State: APjAAAXeF3ibW+4uyyLwC7FDoQWcZxA+FKMmSANCXKOlRgOO+fWZ5yhT OctJXY1/LQyMLNO1L75CDsDfZ54z X-Google-Smtp-Source: APXvYqz9+rNiNH6SpyKg4wZzc5cot203hMBq8CXisOkmABA4EAxsOD0kAUMew+3zjJSFPSN5pXc0pw== X-Received: by 2002:a25:ccd7:: with SMTP id l206mr24410486ybf.165.1566408625718; Wed, 21 Aug 2019 10:30:25 -0700 (PDT) Received: from localhost.localdomain ([2601:c0:c67f:e390::3]) by smtp.gmail.com with ESMTPSA id l71sm2826167ywl.39.2019.08.21.10.30.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Aug 2019 10:30:24 -0700 (PDT) From: Jan Bobek To: qemu-devel@nongnu.org Date: Wed, 21 Aug 2019 13:29:01 -0400 Message-Id: <20190821172951.15333-26-jan.bobek@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190821172951.15333-1-jan.bobek@gmail.com> References: <20190821172951.15333-1-jan.bobek@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::b43 Subject: [Qemu-devel] [RFC PATCH v4 25/75] target/i386: introduce Ib (immediate) operand X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jan Bobek , =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Introduce the immediate-byte operand, which loads a byte from the instruction stream and passes its value as the operand. Signed-off-by: Jan Bobek --- target/i386/translate.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/target/i386/translate.c b/target/i386/translate.c index 886f64a58f..9f02ea58d1 100644 --- a/target/i386/translate.c +++ b/target/i386/translate.c @@ -4890,6 +4890,24 @@ INSNOP_FINALIZE(modrm_rm_direct) insnop_finalize(modrm_rm)(&ctxt->rm, env, s, modrm, is_write, arg); } +/* + * Immediate operand + */ +typedef uint8_t insnop_arg_t(Ib); +typedef struct {} insnop_ctxt_t(Ib); + +INSNOP_INIT(Ib) +{ + return true; +} +INSNOP_PREPARE(Ib) +{ + return x86_ldub_code(env, s); +} +INSNOP_FINALIZE(Ib) +{ +} + static void gen_sse_ng(CPUX86State *env, DisasContext *s, int b) { enum { From patchwork Wed Aug 21 17:29:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Bobek X-Patchwork-Id: 11107819 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 95CD413A4 for ; Wed, 21 Aug 2019 18:10:55 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6D65122D6D for ; Wed, 21 Aug 2019 18:10:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="XG5BTREc" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6D65122D6D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:51544 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0V4Q-0004uK-BI for patchwork-qemu-devel@patchwork.kernel.org; Wed, 21 Aug 2019 14:10:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40996) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0URK-0001Cr-68 for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i0URJ-0007YP-4u for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:30 -0400 Received: from mail-yb1-xb42.google.com ([2607:f8b0:4864:20::b42]:41464) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i0URI-0007UH-Em for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:29 -0400 Received: by mail-yb1-xb42.google.com with SMTP id 1so900343ybj.8 for ; Wed, 21 Aug 2019 10:30:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=5TLzq0TMAhLaEkuTNtNrEWRG0fHFI+G4R8X7EvD7Djs=; b=XG5BTREcHbSuvT0PguwR95kWOrgeFXm8Pn00oawGdsTyeZ1HBNS8LV9IDWfMDM9PHU 4uI5Jfciw/3eDQTtTBrm4bf270X8XHRAp7xsz1JZzV9VlgISSAVcsF+it5Uneqvo1eP+ 87kLZv9piYjl1/sdpP1HKXFCwZiqnSlXWk93lxx3nwUswtSJbvXlQkLQ80SFqauu/3NI RwTPoLaErvNQz73BKW+RAvmTrbe3lyQqJCHT0WynHLav9Hc2nC6lmHuarcamyagS1OtY df4pGY35ItVr3lzzaMgQwpI/uRfnPQXgdpy3VwF5189uC1fg8GQsMmnDawPmZObUewCt J5PA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=5TLzq0TMAhLaEkuTNtNrEWRG0fHFI+G4R8X7EvD7Djs=; b=h/fg9qf9iIFizEpH8S6/uBkyg3oCW408JSxibxeKCb5vvEnQkiV5AxTrQwnE4UrJRw Bk/q9D04CuULGZOozN3d/0ECja+SBSPIvFTAiwakCFFdnZUTRCQTjF8XXH3v7Y3HiEUP Z3HFZy+PXIeFlSbWoSnDFl4PuACCFh2oS/CMlN6lT+udHvPFJ/KuMpm6utNaOF/MkZTp 873bIxjinKf2wcFiXzRptdFc5ClbgGdAcug+FNSlHe7dRfH5oP+8ro3f98g4gd11+zYf RzVsIUVZJuI6mJe/0b99ru9x8IEwqd3vjgoa/UW+4OYWplbR4srl6XpzP1rwZIM2f+26 CSjQ== X-Gm-Message-State: APjAAAU9YJgVEGyZ05Fr72ZEkaGP4a4HazunR7PqpgPeyJ4kdv5jXHtr 2AjbA8JwUW9YyKXVy+MRmDM7c+JK X-Google-Smtp-Source: APXvYqzaCqobI1pjh63OSj43KhG+mcsTg5aFYqdODo+TE7hDxjD30Wb4R7jM7FRwznbyCqfe18yc6Q== X-Received: by 2002:a25:6b43:: with SMTP id o3mr24801627ybm.295.1566408626611; Wed, 21 Aug 2019 10:30:26 -0700 (PDT) Received: from localhost.localdomain ([2601:c0:c67f:e390::3]) by smtp.gmail.com with ESMTPSA id l71sm2826167ywl.39.2019.08.21.10.30.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Aug 2019 10:30:25 -0700 (PDT) From: Jan Bobek To: qemu-devel@nongnu.org Date: Wed, 21 Aug 2019 13:29:02 -0400 Message-Id: <20190821172951.15333-27-jan.bobek@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190821172951.15333-1-jan.bobek@gmail.com> References: <20190821172951.15333-1-jan.bobek@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::b42 Subject: [Qemu-devel] [RFC PATCH v4 26/75] target/i386: introduce M* (memptr) operands X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jan Bobek , =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" The memory-pointer operand decodes the indirect form of ModR/M byte, loads the effective address into a register and passes that register as the operand. Signed-off-by: Jan Bobek --- target/i386/translate.c | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/target/i386/translate.c b/target/i386/translate.c index 9f02ea58d1..46c41cc3be 100644 --- a/target/i386/translate.c +++ b/target/i386/translate.c @@ -4908,6 +4908,42 @@ INSNOP_FINALIZE(Ib) { } +/* + * Memory-pointer operand + */ +typedef TCGv insnop_arg_t(M); +typedef struct {} insnop_ctxt_t(M); + +INSNOP_INIT(M) +{ + bool ret; + insnop_ctxt_t(modrm_mod) modctxt; + + ret = insnop_init(modrm_mod)(&modctxt, env, s, modrm, is_write); + if (ret) { + const int mod = + insnop_prepare(modrm_mod)(&modctxt, env, s, modrm, is_write); + ret = (mod != 3); + insnop_finalize(modrm_mod)(&modctxt, env, s, modrm, is_write, mod); + } + return ret; +} +INSNOP_PREPARE(M) +{ + gen_lea_modrm(env, s, modrm); + return s->A0; +} +INSNOP_FINALIZE(M) +{ +} + +DEF_INSNOP_ALIAS(Mb, M) +DEF_INSNOP_ALIAS(Mw, M) +DEF_INSNOP_ALIAS(Md, M) +DEF_INSNOP_ALIAS(Mq, M) +DEF_INSNOP_ALIAS(Mdq, M) +DEF_INSNOP_ALIAS(Mqq, M) + static void gen_sse_ng(CPUX86State *env, DisasContext *s, int b) { enum { From patchwork Wed Aug 21 17:29:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Bobek X-Patchwork-Id: 11107683 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3AEB01399 for ; Wed, 21 Aug 2019 17:54:43 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D3B3422CF7 for ; Wed, 21 Aug 2019 17:54:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="jP7ysIsN" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D3B3422CF7 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:51396 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0Uoj-0000dQ-9F for patchwork-qemu-devel@patchwork.kernel.org; Wed, 21 Aug 2019 13:54:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41001) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0URK-0001DA-FY for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i0URJ-0007YV-7W for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:30 -0400 Received: from mail-yb1-xb43.google.com ([2607:f8b0:4864:20::b43]:41465) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i0URJ-0007WI-0o for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:29 -0400 Received: by mail-yb1-xb43.google.com with SMTP id 1so900358ybj.8 for ; Wed, 21 Aug 2019 10:30:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=jd8mPhTXyu3w3ABGcqRNH3LYLJveHqDWxHnZ8Lape/8=; b=jP7ysIsN/bVRk/QyuJYmCiMyqFOY7hTv+TvYWsGKQ7EfEgP9tBgULbq3TTQnFUqbrK 0LYTeViICcvPW/TDDX6btygmQM4NmCaGh9/oIbqOb77Xm9xFwlg1yRbwUuQs1DuDqHzo 6BTBrgOenh5yht5j6D+tTgUpztcMY4DquEADQQwoPpfJ5evl8JXfHV92EauaN0gc87Z8 NXnkyfjHfAz3arZqq9AlFtiIX7vCKMefwjTHWaR9N7azFynXaSuF+O49aLYaC2GjC7Ze PMbhqpchBryLsp60S4Vu78CxYo1lqrTmJCYQGlPvMHoYCWU8ajfVxj+ObXbg2OVvOkke Nr9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=jd8mPhTXyu3w3ABGcqRNH3LYLJveHqDWxHnZ8Lape/8=; b=RyqEVsFTnkDHnXrKdvZ7oWshPeK0oj+p5cYATSLV67Cm7geKJBOxU5pvEV6kNPvNwM /hndyQZEzLJ08NDhMrA2TrtwqBY4pd4RfAl7ynRkdaz/mbbTxsbujOAPj9QIsLP5FPKV +V+d5JwtQIgF1yHFG9AqQjenGMrbQJCRoZqhp4fnDqIJNjaxKmjDQW41MP8cFXZGnKH6 LZShP/DgCU2O+wUsm7/IpqD8xOx5odCD3kSHn5LQztoSMDy184kQl7GYu+edF9v86sLZ DsoaQ2ZQXDzMttueuETc5DK3F10pLvaBDmoVJcGZitxNl/8dtn+BQHUg0/knUyhdE+3p HCDw== X-Gm-Message-State: APjAAAU5WlBUbM4qLT/e5BtkCLY30cgcx31v31uWgvStHeRSvbej025E VAdO7ftFuzS2rKUbephjDhJc8p0N X-Google-Smtp-Source: APXvYqxhpL/8P/NOnHQy5Yy1bHNxWj+oqgyOClCV6zDJ1BH0Ad9OBAu68jhsBYJR/hpYuYafn8KAqg== X-Received: by 2002:a25:888a:: with SMTP id d10mr24839501ybl.308.1566408627731; Wed, 21 Aug 2019 10:30:27 -0700 (PDT) Received: from localhost.localdomain ([2601:c0:c67f:e390::3]) by smtp.gmail.com with ESMTPSA id l71sm2826167ywl.39.2019.08.21.10.30.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Aug 2019 10:30:27 -0700 (PDT) From: Jan Bobek To: qemu-devel@nongnu.org Date: Wed, 21 Aug 2019 13:29:03 -0400 Message-Id: <20190821172951.15333-28-jan.bobek@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190821172951.15333-1-jan.bobek@gmail.com> References: <20190821172951.15333-1-jan.bobek@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::b43 Subject: [Qemu-devel] [RFC PATCH v4 27/75] target/i386: introduce G*, R*, E* (general register) operands X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jan Bobek , =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" These address the general-purpose register file. The corresponding 32-bit or 64-bit register is passed as the operand value. Signed-off-by: Jan Bobek --- target/i386/translate.c | 88 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) diff --git a/target/i386/translate.c b/target/i386/translate.c index 46c41cc3be..d6d32c7f06 100644 --- a/target/i386/translate.c +++ b/target/i386/translate.c @@ -4944,6 +4944,94 @@ DEF_INSNOP_ALIAS(Mq, M) DEF_INSNOP_ALIAS(Mdq, M) DEF_INSNOP_ALIAS(Mqq, M) +/* + * 32-bit general register operands + */ +DEF_INSNOP_LDST(Gd, tcg_i32, modrm_reg) +DEF_INSNOP_LDST(Rd, tcg_i32, modrm_rm_direct) + +INSNOP_LDST(tcg_i32, modrm_reg) +{ + assert(0 <= ptr && ptr < CPU_NB_REGS); + if (is_write) { + tcg_gen_extu_i32_tl(cpu_regs[ptr], arg); + } else { + tcg_gen_trunc_tl_i32(arg, cpu_regs[ptr]); + } +} +INSNOP_LDST(tcg_i32, modrm_rm_direct) +{ + insnop_ldst(tcg_i32, modrm_reg)(env, s, is_write, arg, ptr); +} + +DEF_INSNOP_LDST(MEd, tcg_i32, Md) +DEF_INSNOP_EITHER(Ed, Rd, MEd) +DEF_INSNOP_LDST(MRdMw, tcg_i32, Mw) +DEF_INSNOP_EITHER(RdMw, Rd, MRdMw) +DEF_INSNOP_LDST(MRdMb, tcg_i32, Mb) +DEF_INSNOP_EITHER(RdMb, Rd, MRdMb) + +INSNOP_LDST(tcg_i32, Md) +{ + if (is_write) { + tcg_gen_qemu_st_i32(arg, ptr, s->mem_index, MO_LEUL); + } else { + tcg_gen_qemu_ld_i32(arg, ptr, s->mem_index, MO_LEUL); + } +} +INSNOP_LDST(tcg_i32, Mw) +{ + if (is_write) { + tcg_gen_qemu_st_i32(arg, ptr, s->mem_index, MO_LEUW); + } else { + tcg_gen_qemu_ld_i32(arg, ptr, s->mem_index, MO_LEUW); + } +} +INSNOP_LDST(tcg_i32, Mb) +{ + if (is_write) { + tcg_gen_qemu_st_i32(arg, ptr, s->mem_index, MO_UB); + } else { + tcg_gen_qemu_ld_i32(arg, ptr, s->mem_index, MO_UB); + } +} + +/* + * 64-bit general register operands + */ +DEF_INSNOP_LDST(Gq, tcg_i64, modrm_reg) +DEF_INSNOP_LDST(Rq, tcg_i64, modrm_rm_direct) + +INSNOP_LDST(tcg_i64, modrm_reg) +{ +#ifdef TARGET_X86_64 + assert(0 <= ptr && ptr < CPU_NB_REGS); + if (is_write) { + tcg_gen_mov_i64(cpu_regs[ptr], arg); + } else { + tcg_gen_mov_i64(arg, cpu_regs[ptr]); + } +#else /* !TARGET_X86_64 */ + g_assert_not_reached(); +#endif /* !TARGET_X86_64 */ +} +INSNOP_LDST(tcg_i64, modrm_rm_direct) +{ + insnop_ldst(tcg_i64, modrm_reg)(env, s, is_write, arg, ptr); +} + +DEF_INSNOP_LDST(MEq, tcg_i64, Mq) +DEF_INSNOP_EITHER(Eq, Rq, MEq) + +INSNOP_LDST(tcg_i64, Mq) +{ + if (is_write) { + tcg_gen_qemu_st_i64(arg, ptr, s->mem_index, MO_LEQ); + } else { + tcg_gen_qemu_ld_i64(arg, ptr, s->mem_index, MO_LEQ); + } +} + static void gen_sse_ng(CPUX86State *env, DisasContext *s, int b) { enum { From patchwork Wed Aug 21 17:29:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Bobek X-Patchwork-Id: 11107821 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EE2EF14DE for ; Wed, 21 Aug 2019 18:10:57 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C633522D6D for ; Wed, 21 Aug 2019 18:10:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="cQQ1ZVTc" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C633522D6D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:51548 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0V4S-0004y1-ES for patchwork-qemu-devel@patchwork.kernel.org; Wed, 21 Aug 2019 14:10:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41013) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0URL-0001E1-3V for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i0URJ-0007b1-PD for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:30 -0400 Received: from mail-yb1-xb41.google.com ([2607:f8b0:4864:20::b41]:39258) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i0URJ-0007ZQ-L2 for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:29 -0400 Received: by mail-yb1-xb41.google.com with SMTP id s142so1341277ybc.6 for ; Wed, 21 Aug 2019 10:30:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=hFsqTxXX8rsrnf3xHudaOJA2J0Kvvq2y/vZUzrj1f20=; b=cQQ1ZVTcTBv8Uj6li4mk6ryBIR5zQQgliyaoqbyowP5pn9LBxc3agOclMK7x9C6PeD yCdPEbCZmkery0Zhv+zSj3rTWxgInPchZOyMpZjFwACidgLpcoWmV5zA4vnEzgIMDJ/h axg9HwbOwS9AO1QsFXxtbFo16+G8rbWXv1eVxjsxe1VeI2DpXUs6pO2mzChwgYjpU026 gS/0K8K9mhsle0voO+e1DaK/KrvDbPw3LUxVYXTcCoYByddbidA8S7K2Rny7DcM2/6AJ HtkYba53xXI19W9RwcSluppljL1pzIHpzeQXdy5MdYBJZHeSPq4mUxQJTR7/HZxPCAz9 f1sQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=hFsqTxXX8rsrnf3xHudaOJA2J0Kvvq2y/vZUzrj1f20=; b=lAQukZTKuVJpwkPCnVEtDWJ0LWGTS5AkKJp5AaUqaZX4YAcFkSxdBhFP2QL9WVBSdb 7r6P3jxQRzOw/CLsPwqH1Q7BSPIamRlEeixlD9PDoSoiBUighKNVle/dIZd6yc7QxJ29 nAozX9wbL65KUdmbWxobu86KpN48A/ybfV6oCFNmWlMkQ1HOUmhsSZ8cMqJCuWEZbP6g ZDsaDIEWpeeTK0Y6cZGIPtz/imunx/lfg0C6xms8nAoXifb+rmTUblAkEhsuu3zOpzYi ulKUDghLSibsI/uhcAyxf9ribpo1iU821cWUbzlXKJLpGwr4l8yFiMrgzM+bI+3vXxHl diZw== X-Gm-Message-State: APjAAAVQQhenk62j6uiFpMMfoN7i90Y1ydu/RJQqalGfGJfzc+nzOvV+ /OekY8PuDiRpU0WMESFCJIm1dQiJ X-Google-Smtp-Source: APXvYqxmjOtU0//ZaXx+NhkHAhUPbeWbu2XjIlc1QD4mkVt6rUh5ZjYZkDKh2Po4fxjLxcuGZpkmmg== X-Received: by 2002:a25:76ca:: with SMTP id r193mr26498443ybc.33.1566408628987; Wed, 21 Aug 2019 10:30:28 -0700 (PDT) Received: from localhost.localdomain ([2601:c0:c67f:e390::3]) by smtp.gmail.com with ESMTPSA id l71sm2826167ywl.39.2019.08.21.10.30.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Aug 2019 10:30:28 -0700 (PDT) From: Jan Bobek To: qemu-devel@nongnu.org Date: Wed, 21 Aug 2019 13:29:04 -0400 Message-Id: <20190821172951.15333-29-jan.bobek@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190821172951.15333-1-jan.bobek@gmail.com> References: <20190821172951.15333-1-jan.bobek@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::b41 Subject: [Qemu-devel] [RFC PATCH v4 28/75] target/i386: introduce P*, N*, Q* (MMX) operands X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jan Bobek , =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" These address the MMX-technology register file; the corresponding cpu_env offset is passed as the operand value. Notably, offset of the entire register is pased at all times, regardless of the operand-size suffix. Signed-off-by: Jan Bobek --- target/i386/translate.c | 80 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) diff --git a/target/i386/translate.c b/target/i386/translate.c index d6d32c7f06..815354f12b 100644 --- a/target/i386/translate.c +++ b/target/i386/translate.c @@ -5032,6 +5032,86 @@ INSNOP_LDST(tcg_i64, Mq) } } +/* + * MMX-technology register operands + */ +typedef unsigned int insnop_arg_t(mm); +typedef struct {} insnop_ctxt_t(mm); + +INSNOP_INIT(mm) +{ + return true; +} +INSNOP_PREPARE(mm) +{ + return offsetof(CPUX86State, mmx_t0); +} +INSNOP_FINALIZE(mm) +{ +} + +#define DEF_INSNOP_MM(opT, opTmmid) \ + typedef insnop_arg_t(mm) insnop_arg_t(opT); \ + typedef struct { \ + insnop_ctxt_t(opTmmid) mmid; \ + } insnop_ctxt_t(opT); \ + \ + INSNOP_INIT(opT) \ + { \ + return insnop_init(opTmmid)(&ctxt->mmid, env, s, modrm, is_write); \ + } \ + INSNOP_PREPARE(opT) \ + { \ + const insnop_arg_t(opTmmid) mmid = \ + insnop_prepare(opTmmid)(&ctxt->mmid, env, s, modrm, is_write); \ + const insnop_arg_t(opT) arg = \ + offsetof(CPUX86State, fpregs[mmid & 7].mmx); \ + insnop_finalize(opTmmid)(&ctxt->mmid, env, s, modrm, is_write, mmid); \ + return arg; \ + } \ + INSNOP_FINALIZE(opT) \ + { \ + } + +DEF_INSNOP_MM(P, modrm_reg) +DEF_INSNOP_ALIAS(Pq, P) + +DEF_INSNOP_MM(N, modrm_rm_direct) +DEF_INSNOP_ALIAS(Nd, N) +DEF_INSNOP_ALIAS(Nq, N) + +DEF_INSNOP_LDST(MQd, mm, Md) +DEF_INSNOP_LDST(MQq, mm, Mq) +DEF_INSNOP_EITHER(Qd, Nd, MQd) +DEF_INSNOP_EITHER(Qq, Nq, MQq) + +INSNOP_LDST(mm, Md) +{ + const insnop_arg_t(mm) ofs = offsetof(MMXReg, MMX_L(0)); + const TCGv_i32 r32 = tcg_temp_new_i32(); + if (is_write) { + tcg_gen_ld_i32(r32, cpu_env, arg + ofs); + tcg_gen_qemu_st_i32(r32, ptr, s->mem_index, MO_LEUL); + } else { + tcg_gen_qemu_ld_i32(r32, ptr, s->mem_index, MO_LEUL); + tcg_gen_st_i32(r32, cpu_env, arg + ofs); + } + tcg_temp_free_i32(r32); +} +INSNOP_LDST(mm, Mq) +{ + const insnop_arg_t(mm) ofs = offsetof(MMXReg, MMX_Q(0)); + const TCGv_i64 r64 = tcg_temp_new_i64(); + if (is_write) { + tcg_gen_ld_i64(r64, cpu_env, arg + ofs); + tcg_gen_qemu_st_i64(r64, ptr, s->mem_index, MO_LEQ); + } else { + tcg_gen_qemu_ld_i64(r64, ptr, s->mem_index, MO_LEQ); + tcg_gen_st_i64(r64, cpu_env, arg + ofs); + } + tcg_temp_free_i64(r64); +} + static void gen_sse_ng(CPUX86State *env, DisasContext *s, int b) { enum { From patchwork Wed Aug 21 17:29:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Bobek X-Patchwork-Id: 11107831 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4630E14DE for ; Wed, 21 Aug 2019 18:14:13 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1D90F22D6D for ; Wed, 21 Aug 2019 18:14:13 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="gMZUZ9jH" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1D90F22D6D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:51574 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0V7a-0000QX-E5 for patchwork-qemu-devel@patchwork.kernel.org; Wed, 21 Aug 2019 14:14:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41041) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0URM-0001Fp-5E for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i0URK-0007dS-LM for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:32 -0400 Received: from mail-yb1-xb43.google.com ([2607:f8b0:4864:20::b43]:36301) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i0URK-0007d2-ET for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:30 -0400 Received: by mail-yb1-xb43.google.com with SMTP id m9so1348822ybm.3 for ; Wed, 21 Aug 2019 10:30:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=6bOlBMUzHxMY+ckeyPeMo2G/Pj7vU+8jQz+taX0+9kU=; b=gMZUZ9jHX3S2XhvcYCTmxCN0gfPyfHVzgBP+D8FC3f6t9rKeyLwObycra7v2X16oPo jWgdGLb8BjO3+zyZ5DTXgq6pmB5hBjc9GPU/ISZTb0LkUq2klo85VlZmLXpHvz+hF1Ln SzE7jzKbJnFdYUm5XqCNtC0qI2bT666F+o1+ibAsFtL8l/zEAD2MEb7msBq3pl4jz4D5 L2cgrJm+VleSFiO2pwsx7urlEn9dXPBagqeFagScdWK/JAiengdeSGoICeuugaOO+ynX F0vHm3phDmn29+lnyzVJppDD0ZWHPGA0lR80Z+ve05OaXNaahHbHgHRR5iLRlL6+RA86 zFLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=6bOlBMUzHxMY+ckeyPeMo2G/Pj7vU+8jQz+taX0+9kU=; b=FPNflBtgrjb2qiQ4CWkIg9jCVHdsQOZHlM6Lr6Cdvs48aJmdqGLKc2cCamLfhR/0mr +E8aVThWcEs1HmvbAa7DCA4XmD3pczRAv6MX2LxLJfqZRUQ7ty+ND2iqlvN3QffSntL7 yCPuUt3wx9TVwAd6K8Wo434ge8SdKmlmjS7t3Us7lNkbEdIo8d0L4uHkb5KNrlfKDnkI coY/rFHLrkys8ggFGJfFtojPvKMot9ZanLDeOQzIR8ID3jgodzqDkvQ5ucy3TD4e4XtC VWdoDK/h2mEzlH/LW/iBKXIzStqte8mwKTvYbFWGQUoOHGRY/GGY73AcHApCL82RwtTG /11Q== X-Gm-Message-State: APjAAAU1H2AlC7DPlEsXf3VwzUNmTZ6wfkfGafpsWXdcazJhkS+yyoo7 gufITJhoacprJ+JNN0cQJQWBfO5J X-Google-Smtp-Source: APXvYqxm4sG/ZZJLAtV2ziLHlGvY4p3YzW0zIsUDNwUmFhkqAyUpwHMEcEnvlEiG5fN4yuQHqpD5jg== X-Received: by 2002:a25:324b:: with SMTP id y72mr12447519yby.361.1566408629759; Wed, 21 Aug 2019 10:30:29 -0700 (PDT) Received: from localhost.localdomain ([2601:c0:c67f:e390::3]) by smtp.gmail.com with ESMTPSA id l71sm2826167ywl.39.2019.08.21.10.30.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Aug 2019 10:30:29 -0700 (PDT) From: Jan Bobek To: qemu-devel@nongnu.org Date: Wed, 21 Aug 2019 13:29:05 -0400 Message-Id: <20190821172951.15333-30-jan.bobek@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190821172951.15333-1-jan.bobek@gmail.com> References: <20190821172951.15333-1-jan.bobek@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::b43 Subject: [Qemu-devel] [RFC PATCH v4 29/75] target/i386: introduce H*, L*, V*, U*, W* (SSE/AVX) operands X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jan Bobek , =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" These address the SSE/AVX-technology register file. Offset of the entire corresponding register is passed as the operand value, regardless of operand-size suffix. Signed-off-by: Jan Bobek --- target/i386/translate.c | 220 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 220 insertions(+) diff --git a/target/i386/translate.c b/target/i386/translate.c index 815354f12b..23ba1d5edd 100644 --- a/target/i386/translate.c +++ b/target/i386/translate.c @@ -4941,6 +4941,7 @@ DEF_INSNOP_ALIAS(Mb, M) DEF_INSNOP_ALIAS(Mw, M) DEF_INSNOP_ALIAS(Md, M) DEF_INSNOP_ALIAS(Mq, M) +DEF_INSNOP_ALIAS(Mhq, M) DEF_INSNOP_ALIAS(Mdq, M) DEF_INSNOP_ALIAS(Mqq, M) @@ -5112,6 +5113,225 @@ INSNOP_LDST(mm, Mq) tcg_temp_free_i64(r64); } +/* + * vex_v + * + * Operand whose value is the VVVV field of the VEX prefix. + */ +typedef int insnop_arg_t(vex_v); +typedef struct {} insnop_ctxt_t(vex_v); + +INSNOP_INIT(vex_v) +{ + return s->prefix & PREFIX_VEX; +} +INSNOP_PREPARE(vex_v) +{ + return s->vex_v; +} +INSNOP_FINALIZE(vex_v) +{ +} + +/* + * is4 + * + * Upper 4 bits of the 8-bit immediate selector, used with the SSE/AVX + * register file in some instructions. + */ +typedef int insnop_arg_t(is4); +typedef struct { + insnop_ctxt_t(Ib) ctxt_Ib; + insnop_arg_t(Ib) arg_Ib; +} insnop_ctxt_t(is4); + +INSNOP_INIT(is4) +{ + return insnop_init(Ib)(&ctxt->ctxt_Ib, env, s, modrm, is_write); +} +INSNOP_PREPARE(is4) +{ + ctxt->arg_Ib = insnop_prepare(Ib)(&ctxt->ctxt_Ib, env, s, modrm, is_write); + return (ctxt->arg_Ib >> 4) & 0xf; +} +INSNOP_FINALIZE(is4) +{ + insnop_finalize(Ib)(&ctxt->ctxt_Ib, env, s, modrm, is_write, ctxt->arg_Ib); +} + +/* + * SSE/AVX-technology registers + */ +typedef unsigned int insnop_arg_t(xmm); +typedef struct {} insnop_ctxt_t(xmm); + +INSNOP_INIT(xmm) +{ + return true; +} +INSNOP_PREPARE(xmm) +{ + return offsetof(CPUX86State, xmm_t0); +} +INSNOP_FINALIZE(xmm) +{ +} + +#define DEF_INSNOP_XMM(opT, opTxmmid) \ + typedef insnop_arg_t(xmm) insnop_arg_t(opT); \ + typedef struct { \ + insnop_ctxt_t(opTxmmid) xmmid; \ + } insnop_ctxt_t(opT); \ + \ + INSNOP_INIT(opT) \ + { \ + return insnop_init(opTxmmid)(&ctxt->xmmid, env, s, modrm, is_write); \ + } \ + INSNOP_PREPARE(opT) \ + { \ + const insnop_arg_t(opTxmmid) xmmid = \ + insnop_prepare(opTxmmid)(&ctxt->xmmid, env, s, modrm, is_write); \ + const insnop_arg_t(opT) arg = \ + offsetof(CPUX86State, xmm_regs[xmmid]); \ + insnop_finalize(opTxmmid)(&ctxt->xmmid, env, s, \ + modrm, is_write, xmmid); \ + return arg; \ + } \ + INSNOP_FINALIZE(opT) \ + { \ + } + +DEF_INSNOP_XMM(V, modrm_reg) +DEF_INSNOP_ALIAS(Vd, V) +DEF_INSNOP_ALIAS(Vq, V) +DEF_INSNOP_ALIAS(Vdq, V) +DEF_INSNOP_ALIAS(Vqq, V) + +DEF_INSNOP_XMM(U, modrm_rm_direct) +DEF_INSNOP_ALIAS(Ub, U) +DEF_INSNOP_ALIAS(Uw, U) +DEF_INSNOP_ALIAS(Ud, U) +DEF_INSNOP_ALIAS(Uq, U) +DEF_INSNOP_ALIAS(Udq, U) +DEF_INSNOP_ALIAS(Uqq, U) + +DEF_INSNOP_XMM(H, vex_v) +DEF_INSNOP_ALIAS(Hd, H) +DEF_INSNOP_ALIAS(Hq, H) +DEF_INSNOP_ALIAS(Hdq, H) +DEF_INSNOP_ALIAS(Hqq, H) + +DEF_INSNOP_XMM(L, is4) +DEF_INSNOP_ALIAS(Ldq, L) +DEF_INSNOP_ALIAS(Lqq, L) + +DEF_INSNOP_LDST(MWb, xmm, Mb) +DEF_INSNOP_LDST(MWw, xmm, Mw) +DEF_INSNOP_LDST(MWd, xmm, Md) +DEF_INSNOP_LDST(MWq, xmm, Mq) +DEF_INSNOP_LDST(MWdq, xmm, Mdq) +DEF_INSNOP_LDST(MWqq, xmm, Mqq) +DEF_INSNOP_LDST(MUdqMhq, xmm, Mhq) +DEF_INSNOP_EITHER(Wb, Ub, MWb) +DEF_INSNOP_EITHER(Ww, Uw, MWw) +DEF_INSNOP_EITHER(Wd, Ud, MWd) +DEF_INSNOP_EITHER(Wq, Uq, MWq) +DEF_INSNOP_EITHER(Wdq, Udq, MWdq) +DEF_INSNOP_EITHER(Wqq, Uqq, MWqq) +DEF_INSNOP_EITHER(UdqMq, Udq, MWq) +DEF_INSNOP_EITHER(UdqMhq, Udq, MUdqMhq) + +INSNOP_LDST(xmm, Mb) +{ + const insnop_arg_t(xmm) ofs = offsetof(ZMMReg, ZMM_B(0)); + const TCGv_i32 r32 = tcg_temp_new_i32(); + if (is_write) { + tcg_gen_ld_i32(r32, cpu_env, arg + ofs); + tcg_gen_qemu_st_i32(r32, ptr, s->mem_index, MO_UB); + } else { + tcg_gen_qemu_ld_i32(r32, ptr, s->mem_index, MO_UB); + tcg_gen_st_i32(r32, cpu_env, arg + ofs); + } + tcg_temp_free_i32(r32); +} +INSNOP_LDST(xmm, Mw) +{ + const insnop_arg_t(xmm) ofs = offsetof(ZMMReg, ZMM_W(0)); + const TCGv_i32 r32 = tcg_temp_new_i32(); + if (is_write) { + tcg_gen_ld_i32(r32, cpu_env, arg + ofs); + tcg_gen_qemu_st_i32(r32, ptr, s->mem_index, MO_LEUW); + } else { + tcg_gen_qemu_ld_i32(r32, ptr, s->mem_index, MO_LEUW); + tcg_gen_st_i32(r32, cpu_env, arg + ofs); + } + tcg_temp_free_i32(r32); +} +INSNOP_LDST(xmm, Md) +{ + const insnop_arg_t(xmm) ofs = offsetof(ZMMReg, ZMM_L(0)); + const TCGv_i32 r32 = tcg_temp_new_i32(); + if (is_write) { + tcg_gen_ld_i32(r32, cpu_env, arg + ofs); + tcg_gen_qemu_st_i32(r32, ptr, s->mem_index, MO_LEUL); + } else { + tcg_gen_qemu_ld_i32(r32, ptr, s->mem_index, MO_LEUL); + tcg_gen_st_i32(r32, cpu_env, arg + ofs); + } + tcg_temp_free_i32(r32); +} +INSNOP_LDST(xmm, Mq) +{ + const insnop_arg_t(xmm) ofs = offsetof(ZMMReg, ZMM_Q(0)); + const TCGv_i64 r64 = tcg_temp_new_i64(); + if (is_write) { + tcg_gen_ld_i64(r64, cpu_env, arg + ofs); + tcg_gen_qemu_st_i64(r64, ptr, s->mem_index, MO_LEQ); + } else { + tcg_gen_qemu_ld_i64(r64, ptr, s->mem_index, MO_LEQ); + tcg_gen_st_i64(r64, cpu_env, arg + ofs); + } + tcg_temp_free_i64(r64); +} +INSNOP_LDST(xmm, Mdq) +{ + const insnop_arg_t(xmm) ofs = offsetof(ZMMReg, ZMM_Q(0)); + const insnop_arg_t(xmm) ofs1 = offsetof(ZMMReg, ZMM_Q(1)); + const TCGv_i64 r64 = tcg_temp_new_i64(); + const TCGv ptr1 = tcg_temp_new(); + tcg_gen_addi_tl(ptr1, ptr, sizeof(uint64_t)); + if (is_write) { + tcg_gen_ld_i64(r64, cpu_env, arg + ofs); + tcg_gen_qemu_st_i64(r64, ptr, s->mem_index, MO_LEQ); + tcg_gen_ld_i64(r64, cpu_env, arg + ofs1); + tcg_gen_qemu_st_i64(r64, ptr1, s->mem_index, MO_LEQ); + } else { + tcg_gen_qemu_ld_i64(r64, ptr, s->mem_index, MO_LEQ); + tcg_gen_st_i64(r64, cpu_env, arg + ofs); + tcg_gen_qemu_ld_i64(r64, ptr1, s->mem_index, MO_LEQ); + tcg_gen_st_i64(r64, cpu_env, arg + ofs1); + } + tcg_temp_free_i64(r64); + tcg_temp_free(ptr1); +} +INSNOP_LDST(xmm, Mqq) +{ + insnop_ldst(xmm, Mdq)(env, s, is_write, arg, ptr); +} +INSNOP_LDST(xmm, Mhq) +{ + const insnop_arg_t(xmm) ofs = offsetof(ZMMReg, ZMM_Q(1)); + const TCGv_i64 r64 = tcg_temp_new_i64(); + if (is_write) { + tcg_gen_ld_i64(r64, cpu_env, arg + ofs); + tcg_gen_qemu_st_i64(r64, ptr, s->mem_index, MO_LEQ); + } else { + tcg_gen_qemu_ld_i64(r64, ptr, s->mem_index, MO_LEQ); + tcg_gen_st_i64(r64, cpu_env, arg + ofs); + } + tcg_temp_free_i64(r64); +} + static void gen_sse_ng(CPUX86State *env, DisasContext *s, int b) { enum { From patchwork Wed Aug 21 17:29:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Bobek X-Patchwork-Id: 11107817 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 21B5D13A4 for ; Wed, 21 Aug 2019 18:09:02 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id EC39222D6D for ; Wed, 21 Aug 2019 18:09:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Eu4tlEZ5" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EC39222D6D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:51526 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0V2a-0001sy-Ne for patchwork-qemu-devel@patchwork.kernel.org; Wed, 21 Aug 2019 14:09:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41050) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0URM-0001Gj-Ok for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i0URL-0007eN-LE for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:32 -0400 Received: from mail-yb1-xb42.google.com ([2607:f8b0:4864:20::b42]:41465) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i0URL-0007e5-Gc for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:31 -0400 Received: by mail-yb1-xb42.google.com with SMTP id 1so900424ybj.8 for ; Wed, 21 Aug 2019 10:30:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=qHjUE6hQeSyTtFW1oZQXiyVdSrjm8yWd2Nh58FvFQ8w=; b=Eu4tlEZ5OKFmSRfWZfzFzEAwife8C9VegTazhgbcXXfzhGaRgG9IFLmlOae7Jn0w2H NHvHYX8Z0BiP0ERQrDnyKQBpRxSeN8eNiAi/d3gxwCVB8IoMOs+kJMLSFqNLJrZhu7WO +7umkdgLSBKJiVB3YQ6EKilJCN2Jj5BYTsGTEMNqjKpfQkfNOdBxUQ8I2Oj8CiyaEzAm 6GFxDk0P0Jzt4EKUje+aoDDy8yh8O/LDXoE/jXSrw/ImWIPwmNZ0GgIMGTPBnmrzoc7f 9Nuvolg8aOfi7ctpxGBZ9gqW4YvUhMStQeFfqGjfCUYHFyz6gizEfVTyo0csIovxU2Rq E98g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=qHjUE6hQeSyTtFW1oZQXiyVdSrjm8yWd2Nh58FvFQ8w=; b=FweTbg3fNBW4PPhH/uD7lo1RKDcJaC08RkqBGWlVsTQzUj3RTCrbpRkay6hjvb819a wh1bW7GhBCnk9Af1ryNb1WLPP3hc4qURMgVFuWz8+Kc3J9gns57BpNbKrZbnahjJ2ucI bnzvBhD3XCiVsomOaJVWoiUpTq39rjCgtAjk2DNeQkPvWewbasNmp9C0HWHZMP6vRkqv ltHW1wltS+RzVr+v7TdkgC0ecvM53d/fiGyXfmxtUjywXW/cye3BkTaVVk9lYP7KKH3f GaTCL/UEuT+nBZouex2VaiI6SkTi2LzdukyR0m/dlvWCb8fv7pLgWODXkdx/d4L4UTxN JFiw== X-Gm-Message-State: APjAAAWUsGxKvYB0wcMIp1H1Yl7zyktXix0C7FYciIusol+Z6ziytCHH ruihKDk//OHf3tC905W+b41ht+54 X-Google-Smtp-Source: APXvYqxV1OpztZHwK//vcd4rFUr1TgpKMc6SekcT1tz1hVXxf1nWntMlzcMdyZVQfqazlcux9JfnXA== X-Received: by 2002:a25:bd4e:: with SMTP id p14mr24099030ybm.148.1566408630872; Wed, 21 Aug 2019 10:30:30 -0700 (PDT) Received: from localhost.localdomain ([2601:c0:c67f:e390::3]) by smtp.gmail.com with ESMTPSA id l71sm2826167ywl.39.2019.08.21.10.30.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Aug 2019 10:30:30 -0700 (PDT) From: Jan Bobek To: qemu-devel@nongnu.org Date: Wed, 21 Aug 2019 13:29:06 -0400 Message-Id: <20190821172951.15333-31-jan.bobek@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190821172951.15333-1-jan.bobek@gmail.com> References: <20190821172951.15333-1-jan.bobek@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::b42 Subject: [Qemu-devel] [RFC PATCH v4 30/75] target/i386: alias H* operands with the V* operands X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jan Bobek , =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" This effectively means that all thee-operand VEX-encoded instructions using the VEX.V field will be decoded as their non-VEX-encoded two-operand equivalents. While this is incorrect, it is the old behavior, which is useful during development. Note: This changeset is intended for development only and shall not be included in the final patch series. Signed-off-by: Jan Bobek --- target/i386/translate.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/target/i386/translate.c b/target/i386/translate.c index 23ba1d5edd..2e78bed78f 100644 --- a/target/i386/translate.c +++ b/target/i386/translate.c @@ -5215,11 +5215,10 @@ DEF_INSNOP_ALIAS(Uq, U) DEF_INSNOP_ALIAS(Udq, U) DEF_INSNOP_ALIAS(Uqq, U) -DEF_INSNOP_XMM(H, vex_v) -DEF_INSNOP_ALIAS(Hd, H) -DEF_INSNOP_ALIAS(Hq, H) -DEF_INSNOP_ALIAS(Hdq, H) -DEF_INSNOP_ALIAS(Hqq, H) +DEF_INSNOP_ALIAS(Hd, Vd) +DEF_INSNOP_ALIAS(Hq, Vq) +DEF_INSNOP_ALIAS(Hdq, Vdq) +DEF_INSNOP_ALIAS(Hqq, Vqq) DEF_INSNOP_XMM(L, is4) DEF_INSNOP_ALIAS(Ldq, L) From patchwork Wed Aug 21 17:29:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Bobek X-Patchwork-Id: 11107827 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A276C13A4 for ; Wed, 21 Aug 2019 18:14:05 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7524F22D6D for ; Wed, 21 Aug 2019 18:14:05 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="JWiBNTd1" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7524F22D6D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:51570 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0V7U-0000IP-51 for patchwork-qemu-devel@patchwork.kernel.org; Wed, 21 Aug 2019 14:14:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41067) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0URN-0001Hm-Lb for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i0URM-0007fO-Cs for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:33 -0400 Received: from mail-yb1-xb43.google.com ([2607:f8b0:4864:20::b43]:38906) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i0URM-0007er-8n for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:32 -0400 Received: by mail-yb1-xb43.google.com with SMTP id j199so1342652ybg.5 for ; Wed, 21 Aug 2019 10:30:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Dia+2E+EwYAIeEy7FxR5qqk5fG2xeAyDdIAC0jw1NTM=; b=JWiBNTd16MADRhgW46cOm2MlooHPX4hMZYubOZ0ugPdCwCLiQDIK+L9jUX6L6QkpgP OrtIWwFSeQqKNITmUifj40UgILJNZX8er6iWkzeYwaJ5FcynEf+ZlCHUE3vyb7P86W30 mAWpYHBxMd1SwyZEVvEVVCzgDQrft2r1I6YBijQWLnaLq9HtBcRY1G9RVaqRXVdIZXZ3 KgKsP64HwxhRepHk8neERUmq4NFvbeocLL4j7QgjA/mDA/320WuwE9O9Ih7AXvED7SZP HtljJu9CWQ+j4gXnZjAyNHcDMRDx9iiMx9b/+mYTl5zJQwCmloHx6BmKsvqzZQ8akfc1 HZRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Dia+2E+EwYAIeEy7FxR5qqk5fG2xeAyDdIAC0jw1NTM=; b=HQ0Mr13ThTai7wUic7qpLdWILxqNt1PsnJX6CgxplLpu1X4dM4yr3di3IB88Msk0fW T7ubBshh2qtDPuyoXI7UFK4A1PDsJl28Phdw6eBeFBwXBJF/fOvzDSxzduxVlMbv0NFB WK86+6EEqlW/5OzBc1f2mtr2iPSsEYlaUa6D7R7WjtMVxpCwtbr4CwKBt6s+W7EBntk5 kxPawHXEzJwN5ZJnQ+5rlHbLY2Z5WEBe7sGxdYvcipziGuUD2zZbb8qXNF/5VAZNPqpL WbH8gpcL364GOj7klmJbPRNxcbFKfsqKTpv/81e1cecb2ER7Cwio9HUj4xMmZeUgORDk KfCg== X-Gm-Message-State: APjAAAV36Q2ox+VA3biv9XIaz0xMfdFrhyMBPrZTZQ5sNw/OQ3zD+4GN hll6L+6ufhnkROcS8wogi49fUhCN X-Google-Smtp-Source: APXvYqw6yLoc8zhpFYnYp9nTixCzdjKR9JpvyHtwfv8WcGn3geWfP6pV0pRHWybs4BqmoexZHD24Ng== X-Received: by 2002:a25:587:: with SMTP id 129mr25651564ybf.121.1566408631621; Wed, 21 Aug 2019 10:30:31 -0700 (PDT) Received: from localhost.localdomain ([2601:c0:c67f:e390::3]) by smtp.gmail.com with ESMTPSA id l71sm2826167ywl.39.2019.08.21.10.30.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Aug 2019 10:30:31 -0700 (PDT) From: Jan Bobek To: qemu-devel@nongnu.org Date: Wed, 21 Aug 2019 13:29:07 -0400 Message-Id: <20190821172951.15333-32-jan.bobek@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190821172951.15333-1-jan.bobek@gmail.com> References: <20190821172951.15333-1-jan.bobek@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::b43 Subject: [Qemu-devel] [RFC PATCH v4 31/75] target/i386: introduce code generators X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jan Bobek , =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" In this context, "code generators" are functions that receive decoded instruction operands and emit TCG ops implementing the correct instruction functionality. Introduce the naming macros first, actual generator macros will be added later. Signed-off-by: Jan Bobek --- target/i386/translate.c | 46 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/target/i386/translate.c b/target/i386/translate.c index 2e78bed78f..603a5b80a1 100644 --- a/target/i386/translate.c +++ b/target/i386/translate.c @@ -5331,6 +5331,52 @@ INSNOP_LDST(xmm, Mhq) tcg_temp_free_i64(r64); } +/* + * Code generators + */ +#define gen_insn(mnem, argc, ...) \ + glue(gen_insn, argc)(mnem, ## __VA_ARGS__) +#define gen_insn0(mnem) \ + gen_ ## mnem ## _0 +#define gen_insn1(mnem, opT1) \ + gen_ ## mnem ## _1 ## opT1 +#define gen_insn2(mnem, opT1, opT2) \ + gen_ ## mnem ## _2 ## opT1 ## opT2 +#define gen_insn3(mnem, opT1, opT2, opT3) \ + gen_ ## mnem ## _3 ## opT1 ## opT2 ## opT3 +#define gen_insn4(mnem, opT1, opT2, opT3, opT4) \ + gen_ ## mnem ## _4 ## opT1 ## opT2 ## opT3 ## opT4 +#define gen_insn5(mnem, opT1, opT2, opT3, opT4, opT5) \ + gen_ ## mnem ## _5 ## opT1 ## opT2 ## opT3 ## opT4 ## opT5 + +#define GEN_INSN0(mnem) \ + static void gen_insn0(mnem)( \ + CPUX86State *env, DisasContext *s) +#define GEN_INSN1(mnem, opT1) \ + static void gen_insn1(mnem, opT1)( \ + CPUX86State *env, DisasContext *s, \ + insnop_arg_t(opT1) arg1) +#define GEN_INSN2(mnem, opT1, opT2) \ + static void gen_insn2(mnem, opT1, opT2)( \ + CPUX86State *env, DisasContext *s, \ + insnop_arg_t(opT1) arg1, insnop_arg_t(opT2) arg2) +#define GEN_INSN3(mnem, opT1, opT2, opT3) \ + static void gen_insn3(mnem, opT1, opT2, opT3)( \ + CPUX86State *env, DisasContext *s, \ + insnop_arg_t(opT1) arg1, insnop_arg_t(opT2) arg2, \ + insnop_arg_t(opT3) arg3) +#define GEN_INSN4(mnem, opT1, opT2, opT3, opT4) \ + static void gen_insn4(mnem, opT1, opT2, opT3, opT4)( \ + CPUX86State *env, DisasContext *s, \ + insnop_arg_t(opT1) arg1, insnop_arg_t(opT2) arg2, \ + insnop_arg_t(opT3) arg3, insnop_arg_t(opT4) arg4) +#define GEN_INSN5(mnem, opT1, opT2, opT3, opT4, opT5) \ + static void gen_insn5(mnem, opT1, opT2, opT3, opT4, opT5)( \ + CPUX86State *env, DisasContext *s, \ + insnop_arg_t(opT1) arg1, insnop_arg_t(opT2) arg2, \ + insnop_arg_t(opT3) arg3, insnop_arg_t(opT4) arg4, \ + insnop_arg_t(opT5) arg5) + static void gen_sse_ng(CPUX86State *env, DisasContext *s, int b) { enum { From patchwork Wed Aug 21 17:29:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Bobek X-Patchwork-Id: 11107753 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B40E1184E for ; Wed, 21 Aug 2019 17:58:22 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7BAA72070B for ; Wed, 21 Aug 2019 17:58:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="hNhSru+H" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7BAA72070B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:51434 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0UsH-0004O4-Bg for patchwork-qemu-devel@patchwork.kernel.org; Wed, 21 Aug 2019 13:58:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41083) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0URO-0001Jm-UN for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i0URN-0007hI-FA for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:34 -0400 Received: from mail-yb1-xb43.google.com ([2607:f8b0:4864:20::b43]:32970) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i0URN-0007gv-9a for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:33 -0400 Received: by mail-yb1-xb43.google.com with SMTP id b16so1357194ybq.0 for ; Wed, 21 Aug 2019 10:30:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=netrSEZQl2bmTZcuntz1QA9QFA375JtQxyUKl0B/xrw=; b=hNhSru+H6LBc1SmAAHNHVBMHJEiNKOVnqyBmB5iQyXXjbE60K5cxvnkYeFmZ+U2xdL Peq1ykFsjpnQKjMvMjzmRxgGxvm0fFKczR5pbPj4+WgXRnXXmVRAmSGOCFacB9sjftLu w0gFYl5clXb2HUNPEmvs8z/WFeARjBVrUzXXhFQ+nBWVe9JDBucwEbMZrHczXOj6Crl2 vB+2m3LVXHFXw+TLKLiTLQI1i/SXrAUVDlX21gM1XWQF1XyEdcSk0M60w1mRZA9MbCZh +g7Rs2JxbjwikNRm6CefkswsFnI+jkwVLgZXMxxRfoZct+kFph6CGu1ic6CemrojtEf6 6ETg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=netrSEZQl2bmTZcuntz1QA9QFA375JtQxyUKl0B/xrw=; b=POswP5BIDzPIFMUn7+gJEkM8/CeYpDLTKSqsj8wSb5pOlwninSAEYPxDaHxzpOSyQi tVpM4OpZhPKEHYjLx6kVaaZ7E/04Fd+jLlj5Tpig3hs+txoEqSBbCUPeqaULkoByOmrn yYiMwpkBJlGR86naCOdc71S3kE3pxM2HKWjP27CBayYwCMInZV/G2BESv0omthEXD03/ 5sjmfBhr+RCrMidO3VwobMsJvgx2zzxXWnLo00ItdEOZW5l3hQEQyZgOt3riMB2+kvkd 5aGm1VDCKt0KW/T8i7Gx2KkLLJpaX7KlyRdYtrBv+CWWkGlGSFOdjx+QsswM6VMw8cx3 hKHw== X-Gm-Message-State: APjAAAWHKOhBDRT3arWreJz/m88sW8eJjkxcuaSifWA6KJDdRO5D3M6P IPT5YGhlM3lpkzaFmMAUyxy1a7WI X-Google-Smtp-Source: APXvYqxDpNULtr8341LbscrzcYwLwANTSsWPz3fPyiBXLLDK67xTX9UtsNK2c2jYXoZMG6uofwh9kA== X-Received: by 2002:a25:6846:: with SMTP id d67mr25597595ybc.483.1566408632650; Wed, 21 Aug 2019 10:30:32 -0700 (PDT) Received: from localhost.localdomain ([2601:c0:c67f:e390::3]) by smtp.gmail.com with ESMTPSA id l71sm2826167ywl.39.2019.08.21.10.30.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Aug 2019 10:30:31 -0700 (PDT) From: Jan Bobek To: qemu-devel@nongnu.org Date: Wed, 21 Aug 2019 13:29:08 -0400 Message-Id: <20190821172951.15333-33-jan.bobek@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190821172951.15333-1-jan.bobek@gmail.com> References: <20190821172951.15333-1-jan.bobek@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::b43 Subject: [Qemu-devel] [RFC PATCH v4 32/75] target/i386: introduce helper-based code generator macros X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jan Bobek , =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Code generators defined using these macros rely on a helper function (as emitted by gen_helper_*). Signed-off-by: Jan Bobek --- target/i386/translate.c | 160 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 160 insertions(+) diff --git a/target/i386/translate.c b/target/i386/translate.c index 603a5b80a1..046914578b 100644 --- a/target/i386/translate.c +++ b/target/i386/translate.c @@ -5377,6 +5377,166 @@ INSNOP_LDST(xmm, Mhq) insnop_arg_t(opT3) arg3, insnop_arg_t(opT4) arg4, \ insnop_arg_t(opT5) arg5) +#define DEF_GEN_INSN0_HELPER(mnem, helper) \ + GEN_INSN0(mnem) \ + { \ + gen_helper_ ## helper(cpu_env); \ + } + +#define DEF_GEN_INSN2_HELPER_EPD(mnem, helper, opT1, opT2) \ + GEN_INSN2(mnem, opT1, opT2) \ + { \ + const TCGv_ptr arg1_ptr = tcg_temp_new_ptr(); \ + \ + tcg_gen_addi_ptr(arg1_ptr, cpu_env, arg1); \ + gen_helper_ ## helper(cpu_env, arg1_ptr, arg2); \ + \ + tcg_temp_free_ptr(arg1_ptr); \ + } +#define DEF_GEN_INSN2_HELPER_DEP(mnem, helper, opT1, opT2) \ + GEN_INSN2(mnem, opT1, opT2) \ + { \ + const TCGv_ptr arg2_ptr = tcg_temp_new_ptr(); \ + \ + tcg_gen_addi_ptr(arg2_ptr, cpu_env, arg2); \ + gen_helper_ ## helper(arg1, cpu_env, arg2_ptr); \ + \ + tcg_temp_free_ptr(arg2_ptr); \ + } +#ifdef TARGET_X86_64 +#define DEF_GEN_INSN2_HELPER_EPQ(mnem, helper, opT1, opT2) \ + DEF_GEN_INSN2_HELPER_EPD(mnem, helper, opT1, opT2) +#define DEF_GEN_INSN2_HELPER_QEP(mnem, helper, opT1, opT2) \ + DEF_GEN_INSN2_HELPER_DEP(mnem, helper, opT1, opT2) +#else /* !TARGET_X86_64 */ +#define DEF_GEN_INSN2_HELPER_EPQ(mnem, helper, opT1, opT2) \ + GEN_INSN2(mnem, opT1, opT2) \ + { \ + g_assert_not_reached(); \ + } +#define DEF_GEN_INSN2_HELPER_QEP(mnem, helper, opT1, opT2) \ + GEN_INSN2(mnem, opT1, opT2) \ + { \ + g_assert_not_reached(); \ + } +#endif /* !TARGET_X86_64 */ +#define DEF_GEN_INSN2_HELPER_EPP(mnem, helper, opT1, opT2) \ + GEN_INSN2(mnem, opT1, opT2) \ + { \ + const TCGv_ptr arg1_ptr = tcg_temp_new_ptr(); \ + const TCGv_ptr arg2_ptr = tcg_temp_new_ptr(); \ + \ + tcg_gen_addi_ptr(arg1_ptr, cpu_env, arg1); \ + tcg_gen_addi_ptr(arg2_ptr, cpu_env, arg2); \ + gen_helper_ ## helper(cpu_env, arg1_ptr, arg2_ptr); \ + \ + tcg_temp_free_ptr(arg1_ptr); \ + tcg_temp_free_ptr(arg2_ptr); \ + } + +#define DEF_GEN_INSN3_HELPER_EPD(mnem, helper, opT1, opT2, opT3) \ + GEN_INSN3(mnem, opT1, opT2, opT3) \ + { \ + const TCGv_ptr arg1_ptr = tcg_temp_new_ptr(); \ + \ + assert(arg1 == arg2); \ + tcg_gen_addi_ptr(arg1_ptr, cpu_env, arg1); \ + gen_helper_ ## helper(cpu_env, arg1_ptr, arg3); \ + \ + tcg_temp_free_ptr(arg1_ptr); \ + } +#ifdef TARGET_X86_64 +#define DEF_GEN_INSN3_HELPER_EPQ(mnem, helper, opT1, opT2, opT3) \ + DEF_GEN_INSN3_HELPER_EPD(mnem, helper, opT1, opT2, opT3) +#else /* !TARGET_X86_64 */ +#define DEF_GEN_INSN3_HELPER_EPQ(mnem, helper, opT1, opT2, opT3) \ + GEN_INSN3(mnem, opT1, opT2, opT3) \ + { \ + g_assert_not_reached(); \ + } +#endif /* !TARGET_X86_64 */ +#define DEF_GEN_INSN3_HELPER_EPP(mnem, helper, opT1, opT2, opT3) \ + GEN_INSN3(mnem, opT1, opT2, opT3) \ + { \ + const TCGv_ptr arg1_ptr = tcg_temp_new_ptr(); \ + const TCGv_ptr arg3_ptr = tcg_temp_new_ptr(); \ + \ + assert(arg1 == arg2); \ + tcg_gen_addi_ptr(arg1_ptr, cpu_env, arg1); \ + tcg_gen_addi_ptr(arg3_ptr, cpu_env, arg3); \ + gen_helper_ ## helper(cpu_env, arg1_ptr, arg3_ptr); \ + \ + tcg_temp_free_ptr(arg1_ptr); \ + tcg_temp_free_ptr(arg3_ptr); \ + } +#define DEF_GEN_INSN3_HELPER_PPI(mnem, helper, opT1, opT2, opT3) \ + GEN_INSN3(mnem, opT1, opT2, opT3) \ + { \ + const TCGv_ptr arg1_ptr = tcg_temp_new_ptr(); \ + const TCGv_ptr arg2_ptr = tcg_temp_new_ptr(); \ + const TCGv_i32 arg3_r32 = tcg_temp_new_i32(); \ + \ + tcg_gen_addi_ptr(arg1_ptr, cpu_env, arg1); \ + tcg_gen_addi_ptr(arg2_ptr, cpu_env, arg2); \ + tcg_gen_movi_i32(arg3_r32, arg3); \ + gen_helper_ ## helper(arg1_ptr, arg2_ptr, arg3_r32); \ + \ + tcg_temp_free_ptr(arg1_ptr); \ + tcg_temp_free_ptr(arg2_ptr); \ + tcg_temp_free_i32(arg3_r32); \ + } +#define DEF_GEN_INSN3_HELPER_EPPI(mnem, helper, opT1, opT2, opT3) \ + GEN_INSN3(mnem, opT1, opT2, opT3) \ + { \ + const TCGv_ptr arg1_ptr = tcg_temp_new_ptr(); \ + const TCGv_ptr arg2_ptr = tcg_temp_new_ptr(); \ + const TCGv_i32 arg3_r32 = tcg_temp_new_i32(); \ + \ + tcg_gen_addi_ptr(arg1_ptr, cpu_env, arg1); \ + tcg_gen_addi_ptr(arg2_ptr, cpu_env, arg2); \ + tcg_gen_movi_i32(arg3_r32, arg3); \ + gen_helper_ ## helper(cpu_env, arg1_ptr, arg2_ptr, arg3_r32); \ + \ + tcg_temp_free_ptr(arg1_ptr); \ + tcg_temp_free_ptr(arg2_ptr); \ + tcg_temp_free_i32(arg3_r32); \ + } + +#define DEF_GEN_INSN4_HELPER_PPI(mnem, helper, opT1, opT2, opT3, opT4) \ + GEN_INSN4(mnem, opT1, opT2, opT3, opT4) \ + { \ + const TCGv_ptr arg1_ptr = tcg_temp_new_ptr(); \ + const TCGv_ptr arg3_ptr = tcg_temp_new_ptr(); \ + const TCGv_i32 arg4_r32 = tcg_temp_new_i32(); \ + \ + assert(arg1 == arg2); \ + tcg_gen_addi_ptr(arg1_ptr, cpu_env, arg1); \ + tcg_gen_addi_ptr(arg3_ptr, cpu_env, arg3); \ + tcg_gen_movi_i32(arg4_r32, arg4); \ + gen_helper_ ## helper(arg1_ptr, arg3_ptr, arg4_r32); \ + \ + tcg_temp_free_ptr(arg1_ptr); \ + tcg_temp_free_ptr(arg3_ptr); \ + tcg_temp_free_i32(arg4_r32); \ + } +#define DEF_GEN_INSN4_HELPER_EPPI(mnem, helper, opT1, opT2, opT3, opT4) \ + GEN_INSN4(mnem, opT1, opT2, opT3, opT4) \ + { \ + const TCGv_ptr arg1_ptr = tcg_temp_new_ptr(); \ + const TCGv_ptr arg3_ptr = tcg_temp_new_ptr(); \ + const TCGv_i32 arg4_r32 = tcg_temp_new_i32(); \ + \ + assert(arg1 == arg2); \ + tcg_gen_addi_ptr(arg1_ptr, cpu_env, arg1); \ + tcg_gen_addi_ptr(arg3_ptr, cpu_env, arg3); \ + tcg_gen_movi_i32(arg4_r32, arg4); \ + gen_helper_ ## helper(cpu_env, arg1_ptr, arg3_ptr, arg4_r32); \ + \ + tcg_temp_free_ptr(arg1_ptr); \ + tcg_temp_free_ptr(arg3_ptr); \ + tcg_temp_free_i32(arg4_r32); \ + } + static void gen_sse_ng(CPUX86State *env, DisasContext *s, int b) { enum { From patchwork Wed Aug 21 17:29:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Bobek X-Patchwork-Id: 11107825 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6C13313A4 for ; Wed, 21 Aug 2019 18:11:21 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4454722D6D for ; Wed, 21 Aug 2019 18:11:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="PsGg9oiK" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4454722D6D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:51550 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0V4p-0005cV-VB for patchwork-qemu-devel@patchwork.kernel.org; Wed, 21 Aug 2019 14:11:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41088) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0URP-0001KH-Cc for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i0URO-0007iB-6S for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:35 -0400 Received: from mail-yw1-xc43.google.com ([2607:f8b0:4864:20::c43]:39004) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i0URO-0007hu-2S for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:34 -0400 Received: by mail-yw1-xc43.google.com with SMTP id x74so1237464ywx.6 for ; Wed, 21 Aug 2019 10:30:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=hWoTu4BSOFujsEiCBxEz0mfSRHs6zhG1mcUNUpMJ3nY=; b=PsGg9oiKcgt05G3r4tjKehbmiOw+iSekxmf8r+N33Ng4Nc+kyx7pdcK6AvZFbhLK2k mvAEAeyFUZO2F6mOtnCSqT/7MJnND+/hYD+GtndS0mZOPTJilq1o3es380HZ/GMJwufS mOuVjXgS9s9Xc4WE9FeVohgUniAOeJm1VeqAqn1pGdNGZUpbtZZFlplBy+slC6xwtZ3R ekS2JWJlq2d40xDjl0wBBPT2uQB13CDPSiS84fEE5pXIBqQoTDOXf+C/vk2jXYuCcq39 2mPgVEdGOOq5m8NXiey1qJEHAXO/hPuHO29NGEj3kY3RLxuq/Gyrg1BffJSiR1tmrezX gLcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=hWoTu4BSOFujsEiCBxEz0mfSRHs6zhG1mcUNUpMJ3nY=; b=qJPbYv9PmZschSo+shMpCk+Cv0uLHR9BWcxsrsQ1CRWfoFpfwCB0O62Z858x+Tm7qC QG7Hhn+4pgAWkgLJJtJccoQO9OuJ5cracPRZ1jxNmdLBEkfNc8pgyT+v9QWoKyJrtLwQ zakMs0xTsE0D9QDJGs6LHl53SIr/RC7NNnNnRSGcGjUjOEK8miK0AgJY9OImA4/KHVS3 MJKjrwZxHgWVUu8pw14Ig+Z6gO5YT0YnjB6Z+4PytezhnLv33oxau65HOueihOVPhT+T XbmAz8CE/YybIjZQAtC0iFLh1QFxUFtSXXSadoppYAXMcHrqBj11P2pZ5Vs2Vyyk6Zu+ RWvw== X-Gm-Message-State: APjAAAX76bDLyTbLRvzqlv8aDZNgWhPtPwx6PKMXloS/19r3tAnWrWiY nZ/IVfMrzMyIEbRd85EY0n8rzqQe X-Google-Smtp-Source: APXvYqxo5pXuO2yeU4Leuxsdt8n+SOo97kYafdE+A6d97+HCUIO99qI1g8A3pVRdklouwtmBpWokgw== X-Received: by 2002:a0d:dd51:: with SMTP id g78mr24039298ywe.102.1566408633436; Wed, 21 Aug 2019 10:30:33 -0700 (PDT) Received: from localhost.localdomain ([2601:c0:c67f:e390::3]) by smtp.gmail.com with ESMTPSA id l71sm2826167ywl.39.2019.08.21.10.30.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Aug 2019 10:30:32 -0700 (PDT) From: Jan Bobek To: qemu-devel@nongnu.org Date: Wed, 21 Aug 2019 13:29:09 -0400 Message-Id: <20190821172951.15333-34-jan.bobek@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190821172951.15333-1-jan.bobek@gmail.com> References: <20190821172951.15333-1-jan.bobek@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::c43 Subject: [Qemu-devel] [RFC PATCH v4 33/75] target/i386: introduce gvec-based code generator macros X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jan Bobek , =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Code generators defined using these macros rely on a gvec operation (i.e. tcg_gen_gvec_*). Signed-off-by: Jan Bobek --- target/i386/translate.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/target/i386/translate.c b/target/i386/translate.c index 046914578b..eab36963c3 100644 --- a/target/i386/translate.c +++ b/target/i386/translate.c @@ -24,6 +24,7 @@ #include "exec/exec-all.h" #include "tcg-gvec-desc.h" #include "tcg-op.h" +#include "tcg-op-gvec.h" #include "exec/cpu_ldst.h" #include "exec/translator.h" @@ -5537,6 +5538,30 @@ INSNOP_LDST(xmm, Mhq) tcg_temp_free_i32(arg4_r32); \ } +#define MM_OPRSZ sizeof(MMXReg) +#define MM_MAXSZ sizeof(MMXReg) +#define XMM_OPRSZ (!(s->prefix & PREFIX_VEX) ? sizeof(XMMReg) : \ + s->vex_l ? sizeof(XMMReg) : \ + sizeof(XMMReg)) +#define XMM_MAXSZ (!(s->prefix & PREFIX_VEX) ? sizeof(XMMReg) : \ + sizeof(YMMReg)) + +#define DEF_GEN_INSN2_GVEC(mnem, opT1, opT2, gvec, ...) \ + GEN_INSN2(mnem, opT1, opT2) \ + { \ + gen_gvec_ ## gvec(arg1, arg2, ## __VA_ARGS__); \ + } +#define DEF_GEN_INSN3_GVEC(mnem, opT1, opT2, opT3, gvec, ...) \ + GEN_INSN3(mnem, opT1, opT2, opT3) \ + { \ + gen_gvec_ ## gvec(arg1, arg2, arg3, ## __VA_ARGS__); \ + } +#define DEF_GEN_INSN4_GVEC(mnem, opT1, opT2, opT3, opT4, gvec, ...) \ + GEN_INSN4(mnem, opT1, opT2, opT3, opT4) \ + { \ + gen_gvec_ ## gvec(arg1, arg2, arg3, arg4, ## __VA_ARGS__); \ + } + static void gen_sse_ng(CPUX86State *env, DisasContext *s, int b) { enum { From patchwork Wed Aug 21 17:29:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Bobek X-Patchwork-Id: 11107835 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CC75113A4 for ; Wed, 21 Aug 2019 18:14:37 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A4AA622D6D for ; Wed, 21 Aug 2019 18:14:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="nRvAHIAP" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A4AA622D6D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:51576 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0V80-000148-Fl for patchwork-qemu-devel@patchwork.kernel.org; Wed, 21 Aug 2019 14:14:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41104) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0URQ-0001M8-J7 for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i0URP-0007jq-7D for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:36 -0400 Received: from mail-yb1-xb43.google.com ([2607:f8b0:4864:20::b43]:40496) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i0URP-0007jP-3G for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:35 -0400 Received: by mail-yb1-xb43.google.com with SMTP id g7so1338540ybd.7 for ; Wed, 21 Aug 2019 10:30:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=IcwQpmkLt1xTNEoF+bKnuxFt/yx/kcsF9Q+D3f4422I=; b=nRvAHIAPxGkQDt3et5N4S2mvV+FztDRTCV+QuOlNF1wT/2XxAoP1sFv4QFpgT1kDMb N1iBfP+O1/ZZSgyje0ZSFmBD1cafGbf3kZoz5A9oybZZU/0teMethlpPFebPGp6KEqvF EWjA2t0KgUmDrKBQVZC6NY4SRORRhk8FUM4VKPX3fdKONfswP+UcLStLS16LjZiYVl52 UcFOZTJVbsvmj024dTFN6fTlV75/44mzpCeMQqmujQ72fM24bFJroeCHPA1Wmq8rT9jM CD/pEESzhY/KxhgyKWtaNxujhH8LKEeopdU055h6HeFii5ifj4z1mlVUSuQYwTi03vuc 2BKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=IcwQpmkLt1xTNEoF+bKnuxFt/yx/kcsF9Q+D3f4422I=; b=hekFNDhuKsWpNmAhHdG5qkQvIoVu6tc0MHsDTK0d9ZBCHqRIvH0cnRcnje7fNVb1nY 5CGuFQL1ABMYiRd2/O3lA8S4Eqmn49nEkqKdsGYz54BBQrrBrSb+VbFUXSMdgUqq4Hc0 gbK8Q7ZVf5DK7aFfwy35xVxdtiVHitsQMUi2Kw8nkl8os/mDgti+Jnw0j+6qY4AxgS05 0dVfUY1eMErRovS/ywwx6DFmG4d3siOEfBt86MgG16LqI1C2Xw28+wuSZjEEhrjTl+Of xzq7TJseXxvDfna927kIrkk5jeFBTyVPalNbREzZ7GnXangNaKdyU1o6Sb/iSmpgM6+X awHA== X-Gm-Message-State: APjAAAVYEegPCRwRCDBEzQLnZtRFYKNERrnqoZNToveuA0myVxigLsNi mhCAov+feN4vlfsk6GG+zgRtOQti X-Google-Smtp-Source: APXvYqwzP/lQ/uOT1hAXiiRVlX1hNr86JbO07SQXfxps5TrXU6OZvdqbVjCTz8BGvvXK0MIif1EhoQ== X-Received: by 2002:a25:2455:: with SMTP id k82mr23846689ybk.12.1566408634437; Wed, 21 Aug 2019 10:30:34 -0700 (PDT) Received: from localhost.localdomain ([2601:c0:c67f:e390::3]) by smtp.gmail.com with ESMTPSA id l71sm2826167ywl.39.2019.08.21.10.30.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Aug 2019 10:30:33 -0700 (PDT) From: Jan Bobek To: qemu-devel@nongnu.org Date: Wed, 21 Aug 2019 13:29:10 -0400 Message-Id: <20190821172951.15333-35-jan.bobek@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190821172951.15333-1-jan.bobek@gmail.com> References: <20190821172951.15333-1-jan.bobek@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::b43 Subject: [Qemu-devel] [RFC PATCH v4 34/75] target/i386: introduce sse-opcode.inc.h X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jan Bobek , =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" This header is intended to eventually list all supported instructions along with some useful details (e.g. mnemonics, opcode, operands etc.) It shall be used (along with some preprocessor magic) anytime we need to automatically generate code for every instruction. Signed-off-by: Jan Bobek --- target/i386/sse-opcode.inc.h | 75 ++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 target/i386/sse-opcode.inc.h diff --git a/target/i386/sse-opcode.inc.h b/target/i386/sse-opcode.inc.h new file mode 100644 index 0000000000..04d0c49168 --- /dev/null +++ b/target/i386/sse-opcode.inc.h @@ -0,0 +1,75 @@ +#define FMTI____ (0, 0, 0, ) +#define FMTI__R__ (1, 1, 0, r) +#define FMTI__RR__ (2, 2, 0, rr) +#define FMTI__RRR__ (3, 3, 0, rrr) +#define FMTI__W__ (1, 0, 1, w) +#define FMTI__WR__ (2, 1, 1, wr) +#define FMTI__WRR__ (3, 2, 1, wrr) +#define FMTI__WRRR__ (4, 3, 1, wrrr) +#define FMTI__WRRRR__ (5, 4, 1, wrrrr) +#define FMTI__WWRRR__ (5, 3, 2, wwrrr) + +#define FMTI__(prop, fmti) FMTI_ ## prop ## __ fmti + +#define FMTI_ARGC__(argc, argc_rd, argc_wr, lower) argc +#define FMTI_ARGC_RD__(argc, argc_rd, argc_wr, lower) argc_rd +#define FMTI_ARGC_WR__(argc, argc_rd, argc_wr, lower) argc_wr +#define FMTI_LOWER__(argc, argc_rd, argc_wr, lower) lower + +#define FMT_ARGC(fmt) FMTI__(ARGC, FMTI__ ## fmt ## __) +#define FMT_ARGC_RD(fmt) FMTI__(ARGC_RD, FMTI__ ## fmt ## __) +#define FMT_ARGC_WR(fmt) FMTI__(ARGC_WR, FMTI__ ## fmt ## __) +#define FMT_LOWER(fmt) FMTI__(LOWER, FMTI__ ## fmt ## __) +#define FMT_UPPER(fmt) fmt + +#ifndef OPCODE +# define OPCODE(mnem, opcode, feat, fmt, ...) +#endif /* OPCODE */ + +#ifndef OPCODE_GRP +# define OPCODE_GRP(grpname, opcode) +#endif /* OPCODE_GRP */ + +#ifndef OPCODE_GRP_BEGIN +# define OPCODE_GRP_BEGIN(grpname) +#endif /* OPCODE_GRP_BEGIN */ + +#ifndef OPCODE_GRPMEMB +# define OPCODE_GRPMEMB(grpname, mnem, opcode, feat, fmt, ...) +#endif /* OPCODE_GRPMEMB */ + +#ifndef OPCODE_GRP_END +# define OPCODE_GRP_END(grpname) +#endif /* OPCODE_GRP_END */ + +#undef FMTI____ +#undef FMTI__R__ +#undef FMTI__RR__ +#undef FMTI__RRR__ +#undef FMTI__W__ +#undef FMTI__WR__ +#undef FMTI__WRR__ +#undef FMTI__WRRR__ +#undef FMTI__WRRRR__ +#undef FMTI__WWRRR__ + +#undef FMTI__ + +#undef FMTI_ARGC__ +#undef FMTI_ARGC_RD__ +#undef FMTI_ARGC_WR__ +#undef FMTI_LOWER__ + +#undef FMT_ARGC +#undef FMT_ARGC_RD +#undef FMT_ARGC_WR +#undef FMT_LOWER +#undef FMT_UPPER + +#undef LEG +#undef VEX +#undef OPCODE +#undef OPCODE_GRP +#undef OPCODE_GRP_BEGIN +#undef OPCODE_GRPMEMB +#undef OPCODE_GRP_END From patchwork Wed Aug 21 17:29:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Bobek X-Patchwork-Id: 11107843 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5293014DB for ; Wed, 21 Aug 2019 18:17:36 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1A14122D6D for ; Wed, 21 Aug 2019 18:17:36 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="sibHeTZe" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1A14122D6D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:51606 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0VAs-0005De-Tb for patchwork-qemu-devel@patchwork.kernel.org; Wed, 21 Aug 2019 14:17:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41121) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0URS-0001OW-58 for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i0URQ-0007lg-BW for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:38 -0400 Received: from mail-yw1-xc44.google.com ([2607:f8b0:4864:20::c44]:40394) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i0URQ-0007lE-5d for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:36 -0400 Received: by mail-yw1-xc44.google.com with SMTP id z64so1236872ywe.7 for ; Wed, 21 Aug 2019 10:30:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=+uLJOL/RgAja9bJUYo0TBd45RJXP+ge2yD8CTS7XiW0=; b=sibHeTZeArQSl0BSqw/4+P1t+bv04UaCA6R5oG3l2yXVRVTXUHjPp4RUKfrLbJUcSj WreJZsXPu2d1A/vVbyYbKS/Khj0cCwU5cU1AlnxY2Yoguq+pXDB9aEGr6xkxcPxlpDSJ imh5z41W0E3AnT8HYxqCOfgQX6gSCPpcp3KPdihKsQNjzYDhnZ4Fx4VeJxj5TB5c5kha VNSRK8hEGccPBWaikaQp4Xq2dyX2yExpctucE361J+qtZoFJWYp9b9iuC33M2B9eIGSH S56YWNai62sLIxDBPeTtUluFep4GYpIVs9DSwGeSCz3d69JOYIAq9/aE4ilQI82nO7Ts /P5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=+uLJOL/RgAja9bJUYo0TBd45RJXP+ge2yD8CTS7XiW0=; b=lOLH1qZbcDj7CA6st7Af1tDGG1yloIXQoKW/SwGrW2ImV04pP1tO4jbXuQ8MB3iUdy dklKUeOShZjGKX0LFjN/VnCnM33Bzun9bMfdcfNtr+os9pR1nKx0G5YMq7uWxjSkE4kD lCpMd0UYMkYAVhnUwHMn880mQVmqzSWpVvzwNs3VXoEFn0WSIvLZSz+0ZLI57ToewbcH /yPk5upY7oo73JGjbYtQXqK7xrv8KKAA2uitBjsTgTevbwoSvt3pyIIoKU2ckm8W7RRk nn9BpX9UdZsOi0RWRosFcOWD71UPfWT7A8G86IJFz35lbn0gqzB074Y58kHKy4JGqrRL cBkg== X-Gm-Message-State: APjAAAWw8ca+JCA2fZ99ibV3aedmRw4KQOs3/d4zeXeKzyFx2lVdfCCz sLJg+ZMCf9KkJq1lgi+TbC0mG9lW X-Google-Smtp-Source: APXvYqwbGkKCqkDDa8ztlsn/Zd3SJS1OFzi+p/u72LYxxpwkLcE3nouYjDuaUVcgq//7FV9rCqV6rw== X-Received: by 2002:a81:494f:: with SMTP id w76mr23955219ywa.21.1566408635443; Wed, 21 Aug 2019 10:30:35 -0700 (PDT) Received: from localhost.localdomain ([2601:c0:c67f:e390::3]) by smtp.gmail.com with ESMTPSA id l71sm2826167ywl.39.2019.08.21.10.30.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Aug 2019 10:30:34 -0700 (PDT) From: Jan Bobek To: qemu-devel@nongnu.org Date: Wed, 21 Aug 2019 13:29:11 -0400 Message-Id: <20190821172951.15333-36-jan.bobek@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190821172951.15333-1-jan.bobek@gmail.com> References: <20190821172951.15333-1-jan.bobek@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::c44 Subject: [Qemu-devel] [RFC PATCH v4 35/75] target/i386: introduce instruction translator macros X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jan Bobek , =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Instruction "translators" are responsible for decoding and loading instruction operands, calling the passed-in code generator, and storing the operands back (if applicable). Once a translator returns, the instruction has been translated to TCG ops, hence the name. Signed-off-by: Jan Bobek --- target/i386/translate.c | 272 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 272 insertions(+) diff --git a/target/i386/translate.c b/target/i386/translate.c index eab36963c3..1c2502ff50 100644 --- a/target/i386/translate.c +++ b/target/i386/translate.c @@ -5562,6 +5562,262 @@ INSNOP_LDST(xmm, Mhq) gen_gvec_ ## gvec(arg1, arg2, arg3, arg4, ## __VA_ARGS__); \ } +/* + * Instruction translators + */ +#define translate_insn(argc, ...) \ + glue(translate_insn, argc)(__VA_ARGS__) +#define translate_insn0() \ + translate_insn_0 +#define translate_insn1(opT1) \ + translate_insn_1 ## opT1 +#define translate_insn2(opT1, opT2) \ + translate_insn_2 ## opT1 ## opT2 +#define translate_insn3(opT1, opT2, opT3) \ + translate_insn_3 ## opT1 ## opT2 ## opT3 +#define translate_insn4(opT1, opT2, opT3, opT4) \ + translate_insn_4 ## opT1 ## opT2 ## opT3 ## opT4 +#define translate_insn5(opT1, opT2, opT3, opT4, opT5) \ + translate_insn_5 ## opT1 ## opT2 ## opT3 ## opT4 ## opT5 +#define translate_group(grpname) \ + translate_group_ ## grpname + +static void translate_insn0()( + CPUX86State *env, DisasContext *s, int modrm, + CheckCpuidFeat feat, unsigned int argc_wr, + void (*gen_insn_fp)(CPUX86State *, DisasContext *)) +{ + if (!check_cpuid(env, s, feat)) { + gen_illegal_opcode(s); + return; + } + + (*gen_insn_fp)(env, s); +} + +#define DEF_TRANSLATE_INSN1(opT1) \ + static void translate_insn1(opT1)( \ + CPUX86State *env, DisasContext *s, int modrm, \ + CheckCpuidFeat feat, unsigned int argc_wr, \ + void (*gen_insn1_fp)(CPUX86State *, DisasContext *, \ + insnop_arg_t(opT1))) \ + { \ + insnop_ctxt_t(opT1) ctxt1; \ + \ + const bool is_write1 = (1 <= argc_wr); \ + \ + if (check_cpuid(env, s, feat) \ + && insnop_init(opT1)(&ctxt1, env, s, modrm, is_write1)) { \ + \ + const insnop_arg_t(opT1) arg1 = \ + insnop_prepare(opT1)(&ctxt1, env, s, modrm, is_write1); \ + \ + (*gen_insn1_fp)(env, s, arg1); \ + \ + insnop_finalize(opT1)(&ctxt1, env, s, modrm, is_write1, arg1); \ + } else { \ + gen_illegal_opcode(s); \ + } \ + } + +#define DEF_TRANSLATE_INSN2(opT1, opT2) \ + static void translate_insn2(opT1, opT2)( \ + CPUX86State *env, DisasContext *s, int modrm, \ + CheckCpuidFeat feat, unsigned int argc_wr, \ + void (*gen_insn2_fp)(CPUX86State *, DisasContext *, \ + insnop_arg_t(opT1), insnop_arg_t(opT2))) \ + { \ + insnop_ctxt_t(opT1) ctxt1; \ + insnop_ctxt_t(opT2) ctxt2; \ + \ + const bool is_write1 = (1 <= argc_wr); \ + const bool is_write2 = (2 <= argc_wr); \ + \ + if (check_cpuid(env, s, feat) \ + && insnop_init(opT1)(&ctxt1, env, s, modrm, is_write1) \ + && insnop_init(opT2)(&ctxt2, env, s, modrm, is_write2)) { \ + \ + const insnop_arg_t(opT1) arg1 = \ + insnop_prepare(opT1)(&ctxt1, env, s, modrm, is_write1); \ + const insnop_arg_t(opT2) arg2 = \ + insnop_prepare(opT2)(&ctxt2, env, s, modrm, is_write2); \ + \ + (*gen_insn2_fp)(env, s, arg1, arg2); \ + \ + insnop_finalize(opT1)(&ctxt1, env, s, modrm, is_write1, arg1); \ + insnop_finalize(opT2)(&ctxt2, env, s, modrm, is_write2, arg2); \ + } else { \ + gen_illegal_opcode(s); \ + } \ + } + +#define DEF_TRANSLATE_INSN3(opT1, opT2, opT3) \ + static void translate_insn3(opT1, opT2, opT3)( \ + CPUX86State *env, DisasContext *s, int modrm, \ + CheckCpuidFeat feat, unsigned int argc_wr, \ + void (*gen_insn3_fp)(CPUX86State *, DisasContext *, \ + insnop_arg_t(opT1), insnop_arg_t(opT2), \ + insnop_arg_t(opT3))) \ + { \ + insnop_ctxt_t(opT1) ctxt1; \ + insnop_ctxt_t(opT2) ctxt2; \ + insnop_ctxt_t(opT3) ctxt3; \ + \ + const bool is_write1 = (1 <= argc_wr); \ + const bool is_write2 = (2 <= argc_wr); \ + const bool is_write3 = (3 <= argc_wr); \ + \ + if (check_cpuid(env, s, feat) \ + && insnop_init(opT1)(&ctxt1, env, s, modrm, is_write1) \ + && insnop_init(opT2)(&ctxt2, env, s, modrm, is_write2) \ + && insnop_init(opT3)(&ctxt3, env, s, modrm, is_write3)) { \ + \ + const insnop_arg_t(opT1) arg1 = \ + insnop_prepare(opT1)(&ctxt1, env, s, modrm, is_write1); \ + const insnop_arg_t(opT2) arg2 = \ + insnop_prepare(opT2)(&ctxt2, env, s, modrm, is_write2); \ + const insnop_arg_t(opT3) arg3 = \ + insnop_prepare(opT3)(&ctxt3, env, s, modrm, is_write3); \ + \ + (*gen_insn3_fp)(env, s, arg1, arg2, arg3); \ + \ + insnop_finalize(opT1)(&ctxt1, env, s, modrm, is_write1, arg1); \ + insnop_finalize(opT2)(&ctxt2, env, s, modrm, is_write2, arg2); \ + insnop_finalize(opT3)(&ctxt3, env, s, modrm, is_write3, arg3); \ + } else { \ + gen_illegal_opcode(s); \ + } \ + } + +#define DEF_TRANSLATE_INSN4(opT1, opT2, opT3, opT4) \ + static void translate_insn4(opT1, opT2, opT3, opT4)( \ + CPUX86State *env, DisasContext *s, int modrm, \ + CheckCpuidFeat feat, unsigned int argc_wr, \ + void (*gen_insn4_fp)(CPUX86State *, DisasContext *, \ + insnop_arg_t(opT1), insnop_arg_t(opT2), \ + insnop_arg_t(opT3), insnop_arg_t(opT4))) \ + { \ + insnop_ctxt_t(opT1) ctxt1; \ + insnop_ctxt_t(opT2) ctxt2; \ + insnop_ctxt_t(opT3) ctxt3; \ + insnop_ctxt_t(opT4) ctxt4; \ + \ + const bool is_write1 = (1 <= argc_wr); \ + const bool is_write2 = (2 <= argc_wr); \ + const bool is_write3 = (3 <= argc_wr); \ + const bool is_write4 = (4 <= argc_wr); \ + \ + if (check_cpuid(env, s, feat) \ + && insnop_init(opT1)(&ctxt1, env, s, modrm, is_write1) \ + && insnop_init(opT2)(&ctxt2, env, s, modrm, is_write2) \ + && insnop_init(opT3)(&ctxt3, env, s, modrm, is_write3) \ + && insnop_init(opT4)(&ctxt4, env, s, modrm, is_write4)) { \ + \ + const insnop_arg_t(opT1) arg1 = \ + insnop_prepare(opT1)(&ctxt1, env, s, modrm, is_write1); \ + const insnop_arg_t(opT2) arg2 = \ + insnop_prepare(opT2)(&ctxt2, env, s, modrm, is_write2); \ + const insnop_arg_t(opT3) arg3 = \ + insnop_prepare(opT3)(&ctxt3, env, s, modrm, is_write3); \ + const insnop_arg_t(opT4) arg4 = \ + insnop_prepare(opT4)(&ctxt4, env, s, modrm, is_write4); \ + \ + (*gen_insn4_fp)(env, s, arg1, arg2, arg3, arg4); \ + \ + insnop_finalize(opT1)(&ctxt1, env, s, modrm, is_write1, arg1); \ + insnop_finalize(opT2)(&ctxt2, env, s, modrm, is_write2, arg2); \ + insnop_finalize(opT3)(&ctxt3, env, s, modrm, is_write3, arg3); \ + insnop_finalize(opT4)(&ctxt4, env, s, modrm, is_write4, arg4); \ + } else { \ + gen_illegal_opcode(s); \ + } \ + } + +#define DEF_TRANSLATE_INSN5(opT1, opT2, opT3, opT4, opT5) \ + static void translate_insn5(opT1, opT2, opT3, opT4, opT5)( \ + CPUX86State *env, DisasContext *s, int modrm, \ + CheckCpuidFeat feat, unsigned int argc_wr, \ + void (*gen_insn5_fp)(CPUX86State *, DisasContext *, \ + insnop_arg_t(opT1), insnop_arg_t(opT2), \ + insnop_arg_t(opT3), insnop_arg_t(opT4), \ + insnop_arg_t(opT5))) \ + { \ + insnop_ctxt_t(opT1) ctxt1; \ + insnop_ctxt_t(opT2) ctxt2; \ + insnop_ctxt_t(opT3) ctxt3; \ + insnop_ctxt_t(opT4) ctxt4; \ + insnop_ctxt_t(opT5) ctxt5; \ + \ + const bool is_write1 = (1 <= argc_wr); \ + const bool is_write2 = (2 <= argc_wr); \ + const bool is_write3 = (3 <= argc_wr); \ + const bool is_write4 = (4 <= argc_wr); \ + const bool is_write5 = (5 <= argc_wr); \ + \ + if (check_cpuid(env, s, feat) \ + && insnop_init(opT1)(&ctxt1, env, s, modrm, is_write1) \ + && insnop_init(opT2)(&ctxt2, env, s, modrm, is_write2) \ + && insnop_init(opT3)(&ctxt3, env, s, modrm, is_write3) \ + && insnop_init(opT4)(&ctxt4, env, s, modrm, is_write4) \ + && insnop_init(opT5)(&ctxt5, env, s, modrm, is_write5)) { \ + \ + const insnop_arg_t(opT1) arg1 = \ + insnop_prepare(opT1)(&ctxt1, env, s, modrm, is_write1); \ + const insnop_arg_t(opT2) arg2 = \ + insnop_prepare(opT2)(&ctxt2, env, s, modrm, is_write2); \ + const insnop_arg_t(opT3) arg3 = \ + insnop_prepare(opT3)(&ctxt3, env, s, modrm, is_write3); \ + const insnop_arg_t(opT4) arg4 = \ + insnop_prepare(opT4)(&ctxt4, env, s, modrm, is_write4); \ + const insnop_arg_t(opT5) arg5 = \ + insnop_prepare(opT5)(&ctxt5, env, s, modrm, is_write5); \ + \ + (*gen_insn5_fp)(env, s, arg1, arg2, arg3, arg4, arg5); \ + \ + insnop_finalize(opT1)(&ctxt1, env, s, modrm, is_write1, arg1); \ + insnop_finalize(opT2)(&ctxt2, env, s, modrm, is_write2, arg2); \ + insnop_finalize(opT3)(&ctxt3, env, s, modrm, is_write3, arg3); \ + insnop_finalize(opT4)(&ctxt4, env, s, modrm, is_write4, arg4); \ + insnop_finalize(opT5)(&ctxt5, env, s, modrm, is_write5, arg5); \ + } else { \ + gen_illegal_opcode(s); \ + } \ + } + +#define OPCODE_GRP_BEGIN(grpname) \ + static void translate_group(grpname)( \ + CPUX86State *env, DisasContext *s, int modrm) \ + { \ + bool ret; \ + insnop_ctxt_t(modrm_reg) regctxt; \ + \ + ret = insnop_init(modrm_reg)(®ctxt, env, s, modrm, 0); \ + if (ret) { \ + const insnop_arg_t(modrm_reg) reg = \ + insnop_prepare(modrm_reg)(®ctxt, env, s, modrm, 0); \ + \ + switch (reg & 7) { +#define OPCODE_GRPMEMB(grpname, mnem, opcode, feat, fmt, ...) \ + case opcode: \ + translate_insn(FMT_ARGC(fmt), ## __VA_ARGS__)( \ + env, s, modrm, CHECK_CPUID_ ## feat, FMT_ARGC_WR(fmt), \ + gen_insn(mnem, FMT_ARGC(fmt), ## __VA_ARGS__)); \ + break; +#define OPCODE_GRP_END(grpname) \ + default: \ + ret = false; \ + break; \ + } \ + \ + insnop_finalize(modrm_reg)(®ctxt, env, s, modrm, 0, reg); \ + } \ + \ + if (!ret) { \ + gen_illegal_opcode(s); \ + } \ + } +#include "sse-opcode.inc.h" + static void gen_sse_ng(CPUX86State *env, DisasContext *s, int b) { enum { @@ -5642,6 +5898,22 @@ static void gen_sse_ng(CPUX86State *env, DisasContext *s, int b) op = x86_ldub_code(env, s); } break; +#define LEG(p, m, w, op) CASES(op, 3, W, w, M, m, P, p) +#define VEX(l, p, m, w, op) CASES(op, 4, W, w, M, m, P, p, VEX_L, l) +#define OPCODE(mnem, cases, feat, fmt, ...) \ + cases { \ + const int modrm = 0 < FMT_ARGC(fmt) ? x86_ldub_code(env, s) : -1; \ + translate_insn(FMT_ARGC(fmt), ## __VA_ARGS__)( \ + env, s, modrm, CHECK_CPUID_ ## feat, FMT_ARGC_WR(fmt), \ + gen_insn(mnem, FMT_ARGC(fmt), ## __VA_ARGS__)); \ + } return; +#define OPCODE_GRP(grpname, cases) \ + cases { \ + const int modrm = x86_ldub_code(env, s); \ + translate_group(grpname)(env, s, modrm); \ + } return; +#include "sse-opcode.inc.h" + default: { if (m == M_0F38 || m == M_0F3A) { /* rewind the advance_pc() x86_ldub_code() did */ From patchwork Wed Aug 21 17:29:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Bobek X-Patchwork-Id: 11107837 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 87FE91864 for ; Wed, 21 Aug 2019 18:17:11 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5EE6022D6D for ; Wed, 21 Aug 2019 18:17:11 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Q4KzcmK8" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5EE6022D6D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:51600 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0VAU-0004Wj-3G for patchwork-qemu-devel@patchwork.kernel.org; Wed, 21 Aug 2019 14:17:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41125) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0URS-0001Ow-Rn for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i0URR-0007mK-91 for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:38 -0400 Received: from mail-yw1-xc43.google.com ([2607:f8b0:4864:20::c43]:41407) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i0URR-0007m8-53 for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:37 -0400 Received: by mail-yw1-xc43.google.com with SMTP id i138so1232346ywg.8 for ; Wed, 21 Aug 2019 10:30:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=tGTWM/7NjsvRzqpXeVBnEsMojpdECNSYAS0P31ZubK0=; b=Q4KzcmK8TrQrlVIJQJaBIbQopAVlxyhC/j4MnUSUr8WVcYKPSzdkBHExuR2VNhN0lm 5zh6xdv9oZxtOZzZtRp/2rWd2HKtmxAajQZq4USAVoGi5Kkg28dA2V29xAaBsOt7OmZr GZR0PYnE5sZ+1FQtXsK+RhPXslXMOk9J9u2hOvHrvTYxIxaoSfkXZNHT/V2a2N53LCbU AKqg4jXmwolS7mGgYTNnsuS4L2JsviRZa+hDSDCxF5A/LZqwCnbEXlwfo2UyRHHLGLAQ Edo2jKtd6OCh+W4jGe7VXhH2+DgmaTQ0hf2EKY4dzQL3UUhyFJUbaAcrUVM1rtotCH47 +JRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=tGTWM/7NjsvRzqpXeVBnEsMojpdECNSYAS0P31ZubK0=; b=jQY00YH8EMkhyTIWQCa6/AjrMatXl0iYBsDuU9GOfmWsG1GqTPfGOZUFYlFYiqIR4u yS9Ft6perrqrAxb5i2vTSX3O92eSU0Weq93NabR46DrRzwTTeo3J4jPHlCUxTH44yRTe u7udEQDC4Nquq5y1fGg2a4XWvxHDZ+BjNFbVV0FBn+WS9u2KiosR43vUsZvnaMUqFTJa DKl5BfUYh6UYhUgGvcR7p0lNBfjCOKuQKlVus4RHiKhoqiW1R06skTjO96HwLINIjWgT zm/9QmRtvLsAteEHgI2iTXpP2/QaeRz8xygFrnaL3Tc2Fg08nw7vmYCy0y1JBQCUVt4B C/9A== X-Gm-Message-State: APjAAAXazcobjavf9ZzDpzPyhEBi0vOIXWVxJogjMGFHZEH19q6icbQV eRvKdW0kJVFgLcL+TAhegEiJuG9q X-Google-Smtp-Source: APXvYqzdlKKRM/N67ra66pzDUbkVRCJRsA48KbkkWnEfoEdPwjHNRm46NYyNp8wmjHzoKzTxDiVduA== X-Received: by 2002:a81:70c8:: with SMTP id l191mr25402729ywc.425.1566408636367; Wed, 21 Aug 2019 10:30:36 -0700 (PDT) Received: from localhost.localdomain ([2601:c0:c67f:e390::3]) by smtp.gmail.com with ESMTPSA id l71sm2826167ywl.39.2019.08.21.10.30.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Aug 2019 10:30:35 -0700 (PDT) From: Jan Bobek To: qemu-devel@nongnu.org Date: Wed, 21 Aug 2019 13:29:12 -0400 Message-Id: <20190821172951.15333-37-jan.bobek@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190821172951.15333-1-jan.bobek@gmail.com> References: <20190821172951.15333-1-jan.bobek@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::c43 Subject: [Qemu-devel] [RFC PATCH v4 36/75] target/i386: introduce MMX translators X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jan Bobek , =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Use the translator macros to define instruction translators required by MMX instructions. Signed-off-by: Jan Bobek --- target/i386/translate.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/target/i386/translate.c b/target/i386/translate.c index 1c2502ff50..96ba0f5704 100644 --- a/target/i386/translate.c +++ b/target/i386/translate.c @@ -5651,6 +5651,13 @@ static void translate_insn0()( } \ } +DEF_TRANSLATE_INSN2(Ed, Pq) +DEF_TRANSLATE_INSN2(Eq, Pq) +DEF_TRANSLATE_INSN2(Pq, Ed) +DEF_TRANSLATE_INSN2(Pq, Eq) +DEF_TRANSLATE_INSN2(Pq, Qq) +DEF_TRANSLATE_INSN2(Qq, Pq) + #define DEF_TRANSLATE_INSN3(opT1, opT2, opT3) \ static void translate_insn3(opT1, opT2, opT3)( \ CPUX86State *env, DisasContext *s, int modrm, \ @@ -5689,6 +5696,10 @@ static void translate_insn0()( } \ } +DEF_TRANSLATE_INSN3(Nq, Nq, Ib) +DEF_TRANSLATE_INSN3(Pq, Pq, Qd) +DEF_TRANSLATE_INSN3(Pq, Pq, Qq) + #define DEF_TRANSLATE_INSN4(opT1, opT2, opT3, opT4) \ static void translate_insn4(opT1, opT2, opT3, opT4)( \ CPUX86State *env, DisasContext *s, int modrm, \ From patchwork Wed Aug 21 17:29:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Bobek X-Patchwork-Id: 11107789 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C7EF514DE for ; Wed, 21 Aug 2019 18:02:35 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9FEF82082F for ; Wed, 21 Aug 2019 18:02:35 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="bvL9pH30" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9FEF82082F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:51468 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0UwM-0001W4-6D for patchwork-qemu-devel@patchwork.kernel.org; Wed, 21 Aug 2019 14:02:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41133) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0URT-0001PL-C5 for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i0URR-0007mp-Vt for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:39 -0400 Received: from mail-yw1-xc41.google.com ([2607:f8b0:4864:20::c41]:40392) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i0URR-0007mZ-Rx for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:37 -0400 Received: by mail-yw1-xc41.google.com with SMTP id z64so1236900ywe.7 for ; Wed, 21 Aug 2019 10:30:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=e7TSPLQJppV2kJSUSSJUOZp4SK6UfMc7HuT2qa4iFuk=; b=bvL9pH30UdHSfjqzq9uEuoTrBCg+OVGZRZUZJO2fcv6LHsdjitAQby7vqyg42I73Ap QB3jCUoSmm5C0Fqu2GokCTPYuHIQKo7Sri2LsfKI89Sl+bwWuOOtIbVJeby7isMKPhKk Cxzqn4q2UO+yWT1e5ErpC1v0fOU9JVBzVjYH+SN/pzAeW6jOrS4563uI52w0nB7BVZG6 itaY04VfkByVW4dkDovnFDdYnQy6IZA1ORSzfaSSJU9zfrZvIDFOBh+/7xF37oJqYpOO u3TpOSdXWl2BLXU0jCs4tmoya9mr3zjk6mE2nXb1AdJSjmgT79kRd/19W2yHyj1Flt5G tD8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=e7TSPLQJppV2kJSUSSJUOZp4SK6UfMc7HuT2qa4iFuk=; b=ZepMKaRLjp6cUOGhjaBFBfo6SjXCO3+f60L2JzUkGWDWCImPqBEcxsXpzR69QRvpsE HlS5jLZVcxOdaCtiCyM9E9SZtlWImrO+GJYzg2+hPOR5yCN7O/7ov0beidVnyTUH4xew KAhz9ICt4DqIa9BxOdH6nB3U8KB6qoHrEhojMxX43VIclAQaE1Kqbo6nFHt59JLnBicd gFCvd7LmyQjH3ZdPj+qOnuei50GUmY1jCnnH9qOvqiGDI8medjLroWxKhE/kfH1bYP4D gloG5q7ttl3v2KySfMRVTkgObdIoUk8EfiM6g/f6TnFpPWK/YuFjvPucdQHzmiHATl5y wn5w== X-Gm-Message-State: APjAAAXST6envxKeJyQp2GO0YC8lNtH+SwrDp8WlpIn6vAcnREqePItY L/Fn3gyW/7FEdj8lh7gTM7ypOu8A X-Google-Smtp-Source: APXvYqz8iPJ486nXZBSSij+afjOnO1NdFydOM/wRoVOMHiKXA87XavabpN2QQIugtsgnHsOa7g88Qg== X-Received: by 2002:a81:5ed7:: with SMTP id s206mr2104333ywb.441.1566408636959; Wed, 21 Aug 2019 10:30:36 -0700 (PDT) Received: from localhost.localdomain ([2601:c0:c67f:e390::3]) by smtp.gmail.com with ESMTPSA id l71sm2826167ywl.39.2019.08.21.10.30.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Aug 2019 10:30:36 -0700 (PDT) From: Jan Bobek To: qemu-devel@nongnu.org Date: Wed, 21 Aug 2019 13:29:13 -0400 Message-Id: <20190821172951.15333-38-jan.bobek@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190821172951.15333-1-jan.bobek@gmail.com> References: <20190821172951.15333-1-jan.bobek@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::c41 Subject: [Qemu-devel] [RFC PATCH v4 37/75] target/i386: introduce MMX code generators X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jan Bobek , =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Define code generators required for MMX instructions. Signed-off-by: Jan Bobek --- target/i386/translate.c | 100 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 100 insertions(+) diff --git a/target/i386/translate.c b/target/i386/translate.c index 96ba0f5704..fdfca03071 100644 --- a/target/i386/translate.c +++ b/target/i386/translate.c @@ -5562,6 +5562,106 @@ INSNOP_LDST(xmm, Mhq) gen_gvec_ ## gvec(arg1, arg2, arg3, arg4, ## __VA_ARGS__); \ } +GEN_INSN2(movq, Pq, Eq); /* forward declaration */ +GEN_INSN2(movd, Pq, Ed) +{ + const insnop_arg_t(Eq) arg2_r64 = tcg_temp_new_i64(); + tcg_gen_extu_i32_i64(arg2_r64, arg2); + gen_insn2(movq, Pq, Eq)(env, s, arg1, arg2_r64); + tcg_temp_free_i64(arg2_r64); +} +GEN_INSN2(movd, Ed, Pq) +{ + tcg_gen_ld_i32(arg1, cpu_env, arg2 + offsetof(MMXReg, MMX_L(0))); +} + +GEN_INSN2(movq, Pq, Eq) +{ + tcg_gen_st_i64(arg2, cpu_env, arg1 + offsetof(MMXReg, MMX_Q(0))); +} +GEN_INSN2(movq, Eq, Pq) +{ + tcg_gen_ld_i64(arg1, cpu_env, arg2 + offsetof(MMXReg, MMX_Q(0))); +} + +DEF_GEN_INSN2_GVEC(movq, Pq, Qq, mov, MM_OPRSZ, MM_MAXSZ, MO_64) +DEF_GEN_INSN2_GVEC(movq, Qq, Pq, mov, MM_OPRSZ, MM_MAXSZ, MO_64) + +DEF_GEN_INSN3_GVEC(paddb, Pq, Pq, Qq, add, MM_OPRSZ, MM_MAXSZ, MO_8) +DEF_GEN_INSN3_GVEC(paddw, Pq, Pq, Qq, add, MM_OPRSZ, MM_MAXSZ, MO_16) +DEF_GEN_INSN3_GVEC(paddd, Pq, Pq, Qq, add, MM_OPRSZ, MM_MAXSZ, MO_32) +DEF_GEN_INSN3_GVEC(paddsb, Pq, Pq, Qq, ssadd, MM_OPRSZ, MM_MAXSZ, MO_8) +DEF_GEN_INSN3_GVEC(paddsw, Pq, Pq, Qq, ssadd, MM_OPRSZ, MM_MAXSZ, MO_16) +DEF_GEN_INSN3_GVEC(paddusb, Pq, Pq, Qq, usadd, MM_OPRSZ, MM_MAXSZ, MO_8) +DEF_GEN_INSN3_GVEC(paddusw, Pq, Pq, Qq, usadd, MM_OPRSZ, MM_MAXSZ, MO_16) + +DEF_GEN_INSN3_GVEC(psubb, Pq, Pq, Qq, sub, MM_OPRSZ, MM_MAXSZ, MO_8) +DEF_GEN_INSN3_GVEC(psubw, Pq, Pq, Qq, sub, MM_OPRSZ, MM_MAXSZ, MO_16) +DEF_GEN_INSN3_GVEC(psubd, Pq, Pq, Qq, sub, MM_OPRSZ, MM_MAXSZ, MO_32) +DEF_GEN_INSN3_GVEC(psubsb, Pq, Pq, Qq, sssub, MM_OPRSZ, MM_MAXSZ, MO_8) +DEF_GEN_INSN3_GVEC(psubsw, Pq, Pq, Qq, sssub, MM_OPRSZ, MM_MAXSZ, MO_16) +DEF_GEN_INSN3_GVEC(psubusb, Pq, Pq, Qq, ussub, MM_OPRSZ, MM_MAXSZ, MO_8) +DEF_GEN_INSN3_GVEC(psubusw, Pq, Pq, Qq, ussub, MM_OPRSZ, MM_MAXSZ, MO_16) + +DEF_GEN_INSN3_HELPER_EPP(pmullw, pmullw_mmx, Pq, Pq, Qq) +DEF_GEN_INSN3_HELPER_EPP(pmulhw, pmulhw_mmx, Pq, Pq, Qq) +DEF_GEN_INSN3_HELPER_EPP(pmaddwd, pmaddwd_mmx, Pq, Pq, Qq) + +DEF_GEN_INSN3_GVEC(pcmpeqb, Pq, Pq, Qq, cmp, MM_OPRSZ, MM_MAXSZ, MO_8, TCG_COND_EQ) +DEF_GEN_INSN3_GVEC(pcmpeqw, Pq, Pq, Qq, cmp, MM_OPRSZ, MM_MAXSZ, MO_16, TCG_COND_EQ) +DEF_GEN_INSN3_GVEC(pcmpeqd, Pq, Pq, Qq, cmp, MM_OPRSZ, MM_MAXSZ, MO_32, TCG_COND_EQ) +DEF_GEN_INSN3_GVEC(pcmpgtb, Pq, Pq, Qq, cmp, MM_OPRSZ, MM_MAXSZ, MO_8, TCG_COND_GT) +DEF_GEN_INSN3_GVEC(pcmpgtw, Pq, Pq, Qq, cmp, MM_OPRSZ, MM_MAXSZ, MO_16, TCG_COND_GT) +DEF_GEN_INSN3_GVEC(pcmpgtd, Pq, Pq, Qq, cmp, MM_OPRSZ, MM_MAXSZ, MO_32, TCG_COND_GT) + +DEF_GEN_INSN3_GVEC(pand, Pq, Pq, Qq, and, MM_OPRSZ, MM_MAXSZ, MO_64) +DEF_GEN_INSN3_GVEC(pandn, Pq, Pq, Qq, andn, MM_OPRSZ, MM_MAXSZ, MO_64) +DEF_GEN_INSN3_GVEC(por, Pq, Pq, Qq, or, MM_OPRSZ, MM_MAXSZ, MO_64) +DEF_GEN_INSN3_GVEC(pxor, Pq, Pq, Qq, xor, MM_OPRSZ, MM_MAXSZ, MO_64) + +DEF_GEN_INSN3_HELPER_EPP(psllw, psllw_mmx, Pq, Pq, Qq) +DEF_GEN_INSN3_HELPER_EPP(pslld, pslld_mmx, Pq, Pq, Qq) +DEF_GEN_INSN3_HELPER_EPP(psllq, psllq_mmx, Pq, Pq, Qq) +DEF_GEN_INSN3_HELPER_EPP(psrlw, psrlw_mmx, Pq, Pq, Qq) +DEF_GEN_INSN3_HELPER_EPP(psrld, psrld_mmx, Pq, Pq, Qq) +DEF_GEN_INSN3_HELPER_EPP(psrlq, psrlq_mmx, Pq, Pq, Qq) +DEF_GEN_INSN3_HELPER_EPP(psraw, psraw_mmx, Pq, Pq, Qq) +DEF_GEN_INSN3_HELPER_EPP(psrad, psrad_mmx, Pq, Pq, Qq) + +#define DEF_GEN_PSHIFT_IMM_MM(mnem, opT1, opT2) \ + GEN_INSN3(mnem, opT1, opT2, Ib) \ + { \ + const uint64_t arg3_ui64 = (uint8_t)arg3; \ + const insnop_arg_t(Eq) arg3_r64 = s->tmp1_i64; \ + const insnop_arg_t(Qq) arg3_mm = \ + offsetof(CPUX86State, mmx_t0.MMX_Q(0)); \ + \ + tcg_gen_movi_i64(arg3_r64, arg3_ui64); \ + gen_insn2(movq, Pq, Eq)(env, s, arg3_mm, arg3_r64); \ + gen_insn3(mnem, Pq, Pq, Qq)(env, s, arg1, arg2, arg3_mm); \ + } + +DEF_GEN_PSHIFT_IMM_MM(psllw, Nq, Nq) +DEF_GEN_PSHIFT_IMM_MM(pslld, Nq, Nq) +DEF_GEN_PSHIFT_IMM_MM(psllq, Nq, Nq) +DEF_GEN_PSHIFT_IMM_MM(psrlw, Nq, Nq) +DEF_GEN_PSHIFT_IMM_MM(psrld, Nq, Nq) +DEF_GEN_PSHIFT_IMM_MM(psrlq, Nq, Nq) +DEF_GEN_PSHIFT_IMM_MM(psraw, Nq, Nq) +DEF_GEN_PSHIFT_IMM_MM(psrad, Nq, Nq) + +DEF_GEN_INSN3_HELPER_EPP(packsswb, packsswb_mmx, Pq, Pq, Qq) +DEF_GEN_INSN3_HELPER_EPP(packssdw, packssdw_mmx, Pq, Pq, Qq) +DEF_GEN_INSN3_HELPER_EPP(packuswb, packuswb_mmx, Pq, Pq, Qq) +DEF_GEN_INSN3_HELPER_EPP(punpcklbw, punpcklbw_mmx, Pq, Pq, Qd) +DEF_GEN_INSN3_HELPER_EPP(punpcklwd, punpcklwd_mmx, Pq, Pq, Qd) +DEF_GEN_INSN3_HELPER_EPP(punpckldq, punpckldq_mmx, Pq, Pq, Qd) +DEF_GEN_INSN3_HELPER_EPP(punpckhbw, punpckhbw_mmx, Pq, Pq, Qq) +DEF_GEN_INSN3_HELPER_EPP(punpckhwd, punpckhwd_mmx, Pq, Pq, Qq) +DEF_GEN_INSN3_HELPER_EPP(punpckhdq, punpckhdq_mmx, Pq, Pq, Qq) + +DEF_GEN_INSN0_HELPER(emms, emms) + /* * Instruction translators */ From patchwork Wed Aug 21 17:29:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Bobek X-Patchwork-Id: 11107861 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1898414DB for ; Wed, 21 Aug 2019 18:21:28 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E49ED22D6D for ; Wed, 21 Aug 2019 18:21:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="AQk1ikQA" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E49ED22D6D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:51632 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0VEc-0002hZ-Ha for patchwork-qemu-devel@patchwork.kernel.org; Wed, 21 Aug 2019 14:21:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41154) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0URU-0001R4-G5 for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i0URS-0007nY-SR for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:40 -0400 Received: from mail-yb1-xb44.google.com ([2607:f8b0:4864:20::b44]:39262) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i0URS-0007mv-L2 for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:38 -0400 Received: by mail-yb1-xb44.google.com with SMTP id s142so1341448ybc.6 for ; Wed, 21 Aug 2019 10:30:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=J3PXpQ6i3FSUXXhz2as2ONuMwdI/5nd0+9IeX01O4wY=; b=AQk1ikQAXV/wYhzN1nfDrpUKTohk+KholUSnmTeIL9EPuR+7XNw9RvPOciFdBB91GC oJmSLf5yOCr1IS2MJEu5pfuXT2FB428zbhAWsZPxO77xK9mjJLUxWC/qM0IYMG3nVwwN Ne9NDHhQCuwe+QK4lQNELBnVBYAxBo3Ul6WQa9M4hDb8iozbUN8n+fRdRcRC8SuOFExV vmWBR17+6ruUn9h7n5CcFVyXHQcsXe1K7gj/+n1UZGOpLmIABPEP6aWOEUeyxH1Gictx GVsnVRfWNw2agSuxv8Ht+mH5Ldtkx0E9RGHJSPTMmm17Adm27KzOqe3YdiD1a6XyrLfz yuPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=J3PXpQ6i3FSUXXhz2as2ONuMwdI/5nd0+9IeX01O4wY=; b=FXDqUe3Xdx0vYkz3v6X5cg3lL0Ldx4g3ZN+Ekc90K8pKFhYkY+HkNzoGloqiP6OYb/ VhAFQXjHe8oA3pDSLVxQCCh5wDvMDfnJ2xcYHpYLnFD+iK6W+L0Wfrqu2pbx+47sw0Gg dJcnjpzgeAM7AaBp12+4+mLgoSE3B9qlgFfuzZH4Uey1cH97f1FltTD9VOoWliSyrK8V EsS8wNc8BuP1GPLGTilp6U3CYMNlE8ePKCTSN2UA8i5xesCGuEWrDkq+WAQdWVKYqMST 6EzKpXDZVrZTBJeqUb3brvC5chhuY4ZgGHNPwZs+U8tOPYJ/HVcbMzGAFTgKvBxZ0eRq YqYQ== X-Gm-Message-State: APjAAAXcaK3sFsE9/HsYQnS9hBXxjvVdL46WyIc+nOIEA94znocv+bT3 isL8z7GChTO22DvxpcW3yWZvgGiL X-Google-Smtp-Source: APXvYqwl4epSS55/boztUgO7H9t9hnYoeE8q0z4PmvwkELasym/b6KZPcydqfMeCpnx1aOoRTxuzJA== X-Received: by 2002:a25:ba91:: with SMTP id s17mr23287214ybg.460.1566408637554; Wed, 21 Aug 2019 10:30:37 -0700 (PDT) Received: from localhost.localdomain ([2601:c0:c67f:e390::3]) by smtp.gmail.com with ESMTPSA id l71sm2826167ywl.39.2019.08.21.10.30.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Aug 2019 10:30:37 -0700 (PDT) From: Jan Bobek To: qemu-devel@nongnu.org Date: Wed, 21 Aug 2019 13:29:14 -0400 Message-Id: <20190821172951.15333-39-jan.bobek@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190821172951.15333-1-jan.bobek@gmail.com> References: <20190821172951.15333-1-jan.bobek@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::b44 Subject: [Qemu-devel] [RFC PATCH v4 38/75] target/i386: introduce MMX vector instructions to sse-opcode.inc.h X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jan Bobek , =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Add all MMX vector instruction entries to sse-opcode.inc.h. Signed-off-by: Jan Bobek --- target/i386/sse-opcode.inc.h | 136 +++++++++++++++++++++++++++++++++++ 1 file changed, 136 insertions(+) diff --git a/target/i386/sse-opcode.inc.h b/target/i386/sse-opcode.inc.h index 04d0c49168..e570d449fc 100644 --- a/target/i386/sse-opcode.inc.h +++ b/target/i386/sse-opcode.inc.h @@ -42,6 +42,142 @@ # define OPCODE_GRP_END(grpname) #endif /* OPCODE_GRP_END */ +/* + * MMX Instructions + * ----------------- + * NP 0F 6E /r MOVD mm,r/m32 + * NP 0F 7E /r MOVD r/m32,mm + * NP REX.W + 0F 6E /r MOVQ mm,r/m64 + * NP REX.W + 0F 7E /r MOVQ r/m64,mm + * NP 0F 6F /r MOVQ mm, mm/m64 + * NP 0F 7F /r MOVQ mm/m64, mm + * NP 0F FC /r PADDB mm, mm/m64 + * NP 0F FD /r PADDW mm, mm/m64 + * NP 0F FE /r PADDD mm, mm/m64 + * NP 0F EC /r PADDSB mm, mm/m64 + * NP 0F ED /r PADDSW mm, mm/m64 + * NP 0F DC /r PADDUSB mm,mm/m64 + * NP 0F DD /r PADDUSW mm,mm/m64 + * NP 0F F8 /r PSUBB mm, mm/m64 + * NP 0F F9 /r PSUBW mm, mm/m64 + * NP 0F FA /r PSUBD mm, mm/m64 + * NP 0F E8 /r PSUBSB mm, mm/m64 + * NP 0F E9 /r PSUBSW mm, mm/m64 + * NP 0F D8 /r PSUBUSB mm, mm/m64 + * NP 0F D9 /r PSUBUSW mm, mm/m64 + * NP 0F D5 /r PMULLW mm, mm/m64 + * NP 0F E5 /r PMULHW mm, mm/m64 + * NP 0F F5 /r PMADDWD mm, mm/m64 + * NP 0F 74 /r PCMPEQB mm,mm/m64 + * NP 0F 75 /r PCMPEQW mm,mm/m64 + * NP 0F 76 /r PCMPEQD mm,mm/m64 + * NP 0F 64 /r PCMPGTB mm,mm/m64 + * NP 0F 65 /r PCMPGTW mm,mm/m64 + * NP 0F 66 /r PCMPGTD mm,mm/m64 + * NP 0F DB /r PAND mm, mm/m64 + * NP 0F DF /r PANDN mm, mm/m64 + * NP 0F EB /r POR mm, mm/m64 + * NP 0F EF /r PXOR mm, mm/m64 + * NP 0F F1 /r PSLLW mm, mm/m64 + * NP 0F F2 /r PSLLD mm, mm/m64 + * NP 0F F3 /r PSLLQ mm, mm/m64 + * NP 0F D1 /r PSRLW mm, mm/m64 + * NP 0F D2 /r PSRLD mm, mm/m64 + * NP 0F D3 /r PSRLQ mm, mm/m64 + * NP 0F E1 /r PSRAW mm,mm/m64 + * NP 0F E2 /r PSRAD mm,mm/m64 + * NP 0F 63 /r PACKSSWB mm1, mm2/m64 + * NP 0F 6B /r PACKSSDW mm1, mm2/m64 + * NP 0F 67 /r PACKUSWB mm, mm/m64 + * NP 0F 68 /r PUNPCKHBW mm, mm/m64 + * NP 0F 69 /r PUNPCKHWD mm, mm/m64 + * NP 0F 6A /r PUNPCKHDQ mm, mm/m64 + * NP 0F 60 /r PUNPCKLBW mm, mm/m32 + * NP 0F 61 /r PUNPCKLWD mm, mm/m32 + * NP 0F 62 /r PUNPCKLDQ mm, mm/m32 + * NP 0F 77 EMMS + * NP 0F 71 /6 ib PSLLW mm1, imm8 + * NP 0F 71 /2 ib PSRLW mm, imm8 + * NP 0F 71 /4 ib PSRAW mm,imm8 + * NP 0F 72 /6 ib PSLLD mm, imm8 + * NP 0F 72 /2 ib PSRLD mm, imm8 + * NP 0F 72 /4 ib PSRAD mm,imm8 + * NP 0F 73 /6 ib PSLLQ mm, imm8 + * NP 0F 73 /2 ib PSRLQ mm, imm8 + */ + +OPCODE(movd, LEG(NP, 0F, 0, 0x6e), MMX, WR, Pq, Ed) +OPCODE(movd, LEG(NP, 0F, 0, 0x7e), MMX, WR, Ed, Pq) +OPCODE(movq, LEG(NP, 0F, 1, 0x6e), MMX, WR, Pq, Eq) +OPCODE(movq, LEG(NP, 0F, 1, 0x7e), MMX, WR, Eq, Pq) +OPCODE(movq, LEG(NP, 0F, 0, 0x6f), MMX, WR, Pq, Qq) +OPCODE(movq, LEG(NP, 0F, 0, 0x7f), MMX, WR, Qq, Pq) +OPCODE(paddb, LEG(NP, 0F, 0, 0xfc), MMX, WRR, Pq, Pq, Qq) +OPCODE(paddw, LEG(NP, 0F, 0, 0xfd), MMX, WRR, Pq, Pq, Qq) +OPCODE(paddd, LEG(NP, 0F, 0, 0xfe), MMX, WRR, Pq, Pq, Qq) +OPCODE(paddsb, LEG(NP, 0F, 0, 0xec), MMX, WRR, Pq, Pq, Qq) +OPCODE(paddsw, LEG(NP, 0F, 0, 0xed), MMX, WRR, Pq, Pq, Qq) +OPCODE(paddusb, LEG(NP, 0F, 0, 0xdc), MMX, WRR, Pq, Pq, Qq) +OPCODE(paddusw, LEG(NP, 0F, 0, 0xdd), MMX, WRR, Pq, Pq, Qq) +OPCODE(psubb, LEG(NP, 0F, 0, 0xf8), MMX, WRR, Pq, Pq, Qq) +OPCODE(psubw, LEG(NP, 0F, 0, 0xf9), MMX, WRR, Pq, Pq, Qq) +OPCODE(psubd, LEG(NP, 0F, 0, 0xfa), MMX, WRR, Pq, Pq, Qq) +OPCODE(psubsb, LEG(NP, 0F, 0, 0xe8), MMX, WRR, Pq, Pq, Qq) +OPCODE(psubsw, LEG(NP, 0F, 0, 0xe9), MMX, WRR, Pq, Pq, Qq) +OPCODE(psubusb, LEG(NP, 0F, 0, 0xd8), MMX, WRR, Pq, Pq, Qq) +OPCODE(psubusw, LEG(NP, 0F, 0, 0xd9), MMX, WRR, Pq, Pq, Qq) +OPCODE(pmullw, LEG(NP, 0F, 0, 0xd5), MMX, WRR, Pq, Pq, Qq) +OPCODE(pmulhw, LEG(NP, 0F, 0, 0xe5), MMX, WRR, Pq, Pq, Qq) +OPCODE(pmaddwd, LEG(NP, 0F, 0, 0xf5), MMX, WRR, Pq, Pq, Qq) +OPCODE(pcmpeqb, LEG(NP, 0F, 0, 0x74), MMX, WRR, Pq, Pq, Qq) +OPCODE(pcmpeqw, LEG(NP, 0F, 0, 0x75), MMX, WRR, Pq, Pq, Qq) +OPCODE(pcmpeqd, LEG(NP, 0F, 0, 0x76), MMX, WRR, Pq, Pq, Qq) +OPCODE(pcmpgtb, LEG(NP, 0F, 0, 0x64), MMX, WRR, Pq, Pq, Qq) +OPCODE(pcmpgtw, LEG(NP, 0F, 0, 0x65), MMX, WRR, Pq, Pq, Qq) +OPCODE(pcmpgtd, LEG(NP, 0F, 0, 0x66), MMX, WRR, Pq, Pq, Qq) +OPCODE(pand, LEG(NP, 0F, 0, 0xdb), MMX, WRR, Pq, Pq, Qq) +OPCODE(pandn, LEG(NP, 0F, 0, 0xdf), MMX, WRR, Pq, Pq, Qq) +OPCODE(por, LEG(NP, 0F, 0, 0xeb), MMX, WRR, Pq, Pq, Qq) +OPCODE(pxor, LEG(NP, 0F, 0, 0xef), MMX, WRR, Pq, Pq, Qq) +OPCODE(psllw, LEG(NP, 0F, 0, 0xf1), MMX, WRR, Pq, Pq, Qq) +OPCODE(pslld, LEG(NP, 0F, 0, 0xf2), MMX, WRR, Pq, Pq, Qq) +OPCODE(psllq, LEG(NP, 0F, 0, 0xf3), MMX, WRR, Pq, Pq, Qq) +OPCODE(psrlw, LEG(NP, 0F, 0, 0xd1), MMX, WRR, Pq, Pq, Qq) +OPCODE(psrld, LEG(NP, 0F, 0, 0xd2), MMX, WRR, Pq, Pq, Qq) +OPCODE(psrlq, LEG(NP, 0F, 0, 0xd3), MMX, WRR, Pq, Pq, Qq) +OPCODE(psraw, LEG(NP, 0F, 0, 0xe1), MMX, WRR, Pq, Pq, Qq) +OPCODE(psrad, LEG(NP, 0F, 0, 0xe2), MMX, WRR, Pq, Pq, Qq) +OPCODE(packsswb, LEG(NP, 0F, 0, 0x63), MMX, WRR, Pq, Pq, Qq) +OPCODE(packssdw, LEG(NP, 0F, 0, 0x6b), MMX, WRR, Pq, Pq, Qq) +OPCODE(packuswb, LEG(NP, 0F, 0, 0x67), MMX, WRR, Pq, Pq, Qq) +OPCODE(punpckhbw, LEG(NP, 0F, 0, 0x68), MMX, WRR, Pq, Pq, Qq) +OPCODE(punpckhwd, LEG(NP, 0F, 0, 0x69), MMX, WRR, Pq, Pq, Qq) +OPCODE(punpckhdq, LEG(NP, 0F, 0, 0x6a), MMX, WRR, Pq, Pq, Qq) +OPCODE(punpcklbw, LEG(NP, 0F, 0, 0x60), MMX, WRR, Pq, Pq, Qd) +OPCODE(punpcklwd, LEG(NP, 0F, 0, 0x61), MMX, WRR, Pq, Pq, Qd) +OPCODE(punpckldq, LEG(NP, 0F, 0, 0x62), MMX, WRR, Pq, Pq, Qd) +OPCODE(emms, LEG(NP, 0F, 0, 0x77), MMX, ) + +OPCODE_GRP(grp12_LEG_NP, LEG(NP, 0F, 0, 0x71)) +OPCODE_GRP_BEGIN(grp12_LEG_NP) + OPCODE_GRPMEMB(grp12_LEG_NP, psllw, 6, MMX, WRR, Nq, Nq, Ib) + OPCODE_GRPMEMB(grp12_LEG_NP, psrlw, 2, MMX, WRR, Nq, Nq, Ib) + OPCODE_GRPMEMB(grp12_LEG_NP, psraw, 4, MMX, WRR, Nq, Nq, Ib) +OPCODE_GRP_END(grp12_LEG_NP) + +OPCODE_GRP(grp13_LEG_NP, LEG(NP, 0F, 0, 0x72)) +OPCODE_GRP_BEGIN(grp13_LEG_NP) + OPCODE_GRPMEMB(grp13_LEG_NP, pslld, 6, MMX, WRR, Nq, Nq, Ib) + OPCODE_GRPMEMB(grp13_LEG_NP, psrld, 2, MMX, WRR, Nq, Nq, Ib) + OPCODE_GRPMEMB(grp13_LEG_NP, psrad, 4, MMX, WRR, Nq, Nq, Ib) +OPCODE_GRP_END(grp13_LEG_NP) + +OPCODE_GRP(grp14_LEG_NP, LEG(NP, 0F, 0, 0x73)) +OPCODE_GRP_BEGIN(grp14_LEG_NP) + OPCODE_GRPMEMB(grp14_LEG_NP, psllq, 6, MMX, WRR, Nq, Nq, Ib) + OPCODE_GRPMEMB(grp14_LEG_NP, psrlq, 2, MMX, WRR, Nq, Nq, Ib) +OPCODE_GRP_END(grp14_LEG_NP) + #undef FMTI____ #undef FMTI__R__ #undef FMTI__RR__ From patchwork Wed Aug 21 17:29:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Bobek X-Patchwork-Id: 11107801 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2FBA214DE for ; Wed, 21 Aug 2019 18:05:31 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 05DBE214DA for ; Wed, 21 Aug 2019 18:05:30 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="gXjtE/ML" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 05DBE214DA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:51492 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0UzB-0005Zf-K2 for patchwork-qemu-devel@patchwork.kernel.org; Wed, 21 Aug 2019 14:05:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41153) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0URU-0001R1-Fp for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i0URT-0007o6-9B for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:40 -0400 Received: from mail-yb1-xb41.google.com ([2607:f8b0:4864:20::b41]:41465) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i0URT-0007ne-4v for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:39 -0400 Received: by mail-yb1-xb41.google.com with SMTP id 1so900566ybj.8 for ; Wed, 21 Aug 2019 10:30:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=u85Ude1ydVnfdQhG5ukKRSXQHHwYa85nY6X3O1K+7Jc=; b=gXjtE/MLwgsy1Kp8SgVU5ZJHLJxwz5RKUAIUtGan5NDJAe+vR6BbEP1cmvgQ4zw18N cNH3jpCvZs2YH4PT8cM9MJ0IbC7REAj340x6u/0dANtKJhVxB3q0ZgT4D1tbOau4YN1+ OWRWXVbnXZfslrO2T0I/7T/7MnGNZ4Ah0i/lax/XLPKXqsRyA+OGCfFyyPHjqrdjnC5R dQyGuBuN8RTi0IYpjPzgFMrhimgcGWb5T5ZVg1fnpirNzHIijav7K85AwW1GJmwrujwc Mldgl4MFKKY4VtWm4+ZKw04lFYkJKHERhPv0rJCBqSdLdZCOxdxcP8Drh5KvW3N2JDbB 2mlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=u85Ude1ydVnfdQhG5ukKRSXQHHwYa85nY6X3O1K+7Jc=; b=ZA+bsl2UByEyo2dI5UXZydMvje2ljbj6S9vLI4az0+fHTd6W3DHxxJge/cNDH6FbnN 9fZl0ttYQhYrjSmxOM0S/u+UxSb586S13BjBOqrZfvxe3mqhBPPsZbZlyuWF6Iv35f4S lSIjnBiy0yYXOy+0HOxFG6wWsoud4qTqkL8VjEoIYUuV1GuT4UMmOqlkERncJrtYynbn UppWvMrcESlbJmxZQ2z2KgcoCPeCrLmMLbkJBDa0Unf2U8wRhh3ZkZutTQCcKXns24WA a1QCF4gaopH+u9MH6zRvcfmb6KfrxQTpnC0yemH9RBykIvP+fYDa3ltNyhg1SuevWpjA twQg== X-Gm-Message-State: APjAAAUWaTffo7sGVQpKGn8Bo5E5zqdsrk9DKwp5uynKzL8mLiu3Sq8b IV67fen9LFaVRWmPTuMcCIVNoaPG X-Google-Smtp-Source: APXvYqxoXWzVyPfoQGPjCCNRfHq3ab/JGkjXqnxv5r2/UJFoFdQ3o5hoNeer68oridnxNa5JOwgJGg== X-Received: by 2002:a25:1806:: with SMTP id 6mr25564458yby.415.1566408638523; Wed, 21 Aug 2019 10:30:38 -0700 (PDT) Received: from localhost.localdomain ([2601:c0:c67f:e390::3]) by smtp.gmail.com with ESMTPSA id l71sm2826167ywl.39.2019.08.21.10.30.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Aug 2019 10:30:37 -0700 (PDT) From: Jan Bobek To: qemu-devel@nongnu.org Date: Wed, 21 Aug 2019 13:29:15 -0400 Message-Id: <20190821172951.15333-40-jan.bobek@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190821172951.15333-1-jan.bobek@gmail.com> References: <20190821172951.15333-1-jan.bobek@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::b41 Subject: [Qemu-devel] [RFC PATCH v4 39/75] target/i386: introduce SSE translators X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jan Bobek , =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Use the translator macros to define translators required by SSE instructions. Signed-off-by: Jan Bobek --- target/i386/translate.c | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/target/i386/translate.c b/target/i386/translate.c index fdfca03071..d77c08b7db 100644 --- a/target/i386/translate.c +++ b/target/i386/translate.c @@ -5720,6 +5720,9 @@ static void translate_insn0()( } \ } +DEF_TRANSLATE_INSN1(Mb) +DEF_TRANSLATE_INSN1(Md) + #define DEF_TRANSLATE_INSN2(opT1, opT2) \ static void translate_insn2(opT1, opT2)( \ CPUX86State *env, DisasContext *s, int modrm, \ @@ -5753,10 +5756,29 @@ static void translate_insn0()( DEF_TRANSLATE_INSN2(Ed, Pq) DEF_TRANSLATE_INSN2(Eq, Pq) +DEF_TRANSLATE_INSN2(Gd, Nq) +DEF_TRANSLATE_INSN2(Gd, Udq) +DEF_TRANSLATE_INSN2(Gd, Wd) +DEF_TRANSLATE_INSN2(Gq, Nq) +DEF_TRANSLATE_INSN2(Gq, Udq) +DEF_TRANSLATE_INSN2(Gq, Wd) +DEF_TRANSLATE_INSN2(Mdq, Vdq) +DEF_TRANSLATE_INSN2(Mq, Pq) +DEF_TRANSLATE_INSN2(Mq, Vdq) +DEF_TRANSLATE_INSN2(Mq, Vq) DEF_TRANSLATE_INSN2(Pq, Ed) DEF_TRANSLATE_INSN2(Pq, Eq) +DEF_TRANSLATE_INSN2(Pq, Nq) DEF_TRANSLATE_INSN2(Pq, Qq) +DEF_TRANSLATE_INSN2(Pq, Wq) DEF_TRANSLATE_INSN2(Qq, Pq) +DEF_TRANSLATE_INSN2(Vd, Ed) +DEF_TRANSLATE_INSN2(Vd, Eq) +DEF_TRANSLATE_INSN2(Vd, Wd) +DEF_TRANSLATE_INSN2(Vdq, Qq) +DEF_TRANSLATE_INSN2(Vdq, Wdq) +DEF_TRANSLATE_INSN2(Wd, Vd) +DEF_TRANSLATE_INSN2(Wdq, Vdq) #define DEF_TRANSLATE_INSN3(opT1, opT2, opT3) \ static void translate_insn3(opT1, opT2, opT3)( \ @@ -5796,9 +5818,16 @@ DEF_TRANSLATE_INSN2(Qq, Pq) } \ } +DEF_TRANSLATE_INSN3(Gd, Nq, Ib) +DEF_TRANSLATE_INSN3(Gq, Nq, Ib) DEF_TRANSLATE_INSN3(Nq, Nq, Ib) DEF_TRANSLATE_INSN3(Pq, Pq, Qd) DEF_TRANSLATE_INSN3(Pq, Pq, Qq) +DEF_TRANSLATE_INSN3(Pq, Qq, Ib) +DEF_TRANSLATE_INSN3(Vd, Vd, Wd) +DEF_TRANSLATE_INSN3(Vdq, Vdq, UdqMhq) +DEF_TRANSLATE_INSN3(Vdq, Vdq, Wdq) +DEF_TRANSLATE_INSN3(Vdq, Vq, Wq) #define DEF_TRANSLATE_INSN4(opT1, opT2, opT3, opT4) \ static void translate_insn4(opT1, opT2, opT3, opT4)( \ @@ -5844,6 +5873,11 @@ DEF_TRANSLATE_INSN3(Pq, Pq, Qq) } \ } +DEF_TRANSLATE_INSN4(Pq, Pq, RdMw, Ib) +DEF_TRANSLATE_INSN4(Vd, Vd, Wd, Ib) +DEF_TRANSLATE_INSN4(Vdq, Vdq, Wd, modrm_mod) +DEF_TRANSLATE_INSN4(Vdq, Vdq, Wdq, Ib) + #define DEF_TRANSLATE_INSN5(opT1, opT2, opT3, opT4, opT5) \ static void translate_insn5(opT1, opT2, opT3, opT4, opT5)( \ CPUX86State *env, DisasContext *s, int modrm, \ From patchwork Wed Aug 21 17:29:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Bobek X-Patchwork-Id: 11107815 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 23B42184E for ; Wed, 21 Aug 2019 18:08:15 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DFC2622D6D for ; Wed, 21 Aug 2019 18:08:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="fJ2YPWRR" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DFC2622D6D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:51522 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0V1q-0001BI-0C for patchwork-qemu-devel@patchwork.kernel.org; Wed, 21 Aug 2019 14:08:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41182) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0URX-0001Ut-4M for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i0URU-0007pg-RV for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:42 -0400 Received: from mail-yb1-xb43.google.com ([2607:f8b0:4864:20::b43]:36947) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i0URU-0007pM-Mk for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:40 -0400 Received: by mail-yb1-xb43.google.com with SMTP id t5so1346376ybt.4 for ; Wed, 21 Aug 2019 10:30:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=XTNhzsWZmlyghNA6cx/sDxfqZ+eeuh66Tyk6g/qnVYc=; b=fJ2YPWRRgZ/WRbpCWfVHxCVIY5xCih/3JwiZEEG+ObXBuJdtyZJfBdFzHVkouyRjcB Qcmwr0lIM0upyeQW1NbiIuUmGL3GCRKEbYcA8S4v5vIKQUSwaGUwcnpIUYB3A8Azb4kM wSwTDRMU1/UDDKoKj6lM8WSnS202n8sYJlsiJIywk/DCz2Tk5p1uYjP2Rvyl5n/ZZlo/ 8cV/PKxevQ8rVBhw9DNWgOaT62XDFfpFNaBoDZaxRZ4y6zUX6vr/5RrGAIr6ZIBcQgaT FoslNFxHDn4IKUrIHhu8O3+PlUu0W/C+W5LmbbMG4V3v1fdvHuV0u9rLwU/dcn6AcwWy hrYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=XTNhzsWZmlyghNA6cx/sDxfqZ+eeuh66Tyk6g/qnVYc=; b=QyoMIyOfN+2gWO8bq4w0yDplwBHB+k0Ei0uAdkBaG/NHIbXurfFvHWSKeE65n3t16d HVmXITLjdN3ZqqMNOKyAxRCiAFacapS6oWxRtk9DEyOCNhKOROmNhbYasLZFAjZktmyq jFDjxdcjMBIsRF/mymYgYsGis4V5nAV5kb3iVq1tcD+xW9LND1wc8E+GzUuEksbID2Eo UXkEJKAk/8NP8ot0TJVtykHXUHtHsOSu/RCeEpOyhkPlkpsTkvtzz/TJ5QgZDFYS956T pJ3/HISjjOT7Ah5jnx7/4J1pQew+cvy1A6vTFtHO3JipIBppF+WW1Azcn4cVHwGJVwi7 YB7A== X-Gm-Message-State: APjAAAXINX3AvcNChUB4MukrdMfv5ho9YwWPvnBt1Nv90ve2HBpMlcNp eI9IlqlpJ+hOCooymTTxie4WPejr X-Google-Smtp-Source: APXvYqwNdlEGGdLhUEVengpl+3aks77+QgOneT7wNGU/CV1uGNpgK2Icppa3JD7j4TWKreXw8eZ/LA== X-Received: by 2002:a25:7005:: with SMTP id l5mr25781407ybc.452.1566408639799; Wed, 21 Aug 2019 10:30:39 -0700 (PDT) Received: from localhost.localdomain ([2601:c0:c67f:e390::3]) by smtp.gmail.com with ESMTPSA id l71sm2826167ywl.39.2019.08.21.10.30.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Aug 2019 10:30:39 -0700 (PDT) From: Jan Bobek To: qemu-devel@nongnu.org Date: Wed, 21 Aug 2019 13:29:16 -0400 Message-Id: <20190821172951.15333-41-jan.bobek@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190821172951.15333-1-jan.bobek@gmail.com> References: <20190821172951.15333-1-jan.bobek@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::b43 Subject: [Qemu-devel] [RFC PATCH v4 40/75] target/i386: introduce SSE code generators X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jan Bobek , =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Introduce code generators required by SSE instructions. Signed-off-by: Jan Bobek --- target/i386/translate.c | 309 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 309 insertions(+) diff --git a/target/i386/translate.c b/target/i386/translate.c index d77c08b7db..d1537bc1b7 100644 --- a/target/i386/translate.c +++ b/target/i386/translate.c @@ -5586,6 +5586,90 @@ GEN_INSN2(movq, Eq, Pq) DEF_GEN_INSN2_GVEC(movq, Pq, Qq, mov, MM_OPRSZ, MM_MAXSZ, MO_64) DEF_GEN_INSN2_GVEC(movq, Qq, Pq, mov, MM_OPRSZ, MM_MAXSZ, MO_64) +DEF_GEN_INSN2_GVEC(movaps, Vdq, Wdq, mov, XMM_OPRSZ, XMM_MAXSZ, MO_64) +DEF_GEN_INSN2_GVEC(movaps, Wdq, Vdq, mov, XMM_OPRSZ, XMM_MAXSZ, MO_64) +DEF_GEN_INSN2_GVEC(movups, Vdq, Wdq, mov, XMM_OPRSZ, XMM_MAXSZ, MO_64) +DEF_GEN_INSN2_GVEC(movups, Wdq, Vdq, mov, XMM_OPRSZ, XMM_MAXSZ, MO_64) + +GEN_INSN4(movss, Vdq, Vdq, Wd, modrm_mod) +{ + const TCGv_i32 r32 = tcg_temp_new_i32(); + const TCGv_i64 r64 = tcg_temp_new_i64(); + if (arg4 == 3) { + /* merging movss */ + tcg_gen_ld_i32(r32, cpu_env, arg3 + offsetof(ZMMReg, ZMM_L(0))); + tcg_gen_st_i32(r32, cpu_env, arg1 + offsetof(ZMMReg, ZMM_L(0))); + if (arg1 != arg2) { + tcg_gen_ld_i32(r32, cpu_env, arg2 + offsetof(ZMMReg, ZMM_L(1))); + tcg_gen_st_i32(r32, cpu_env, arg1 + offsetof(ZMMReg, ZMM_L(1))); + tcg_gen_ld_i64(r64, cpu_env, arg2 + offsetof(ZMMReg, ZMM_Q(1))); + tcg_gen_st_i64(r64, cpu_env, arg1 + offsetof(ZMMReg, ZMM_Q(1))); + } + } else { + /* zero-extending movss */ + tcg_gen_ld_i32(r32, cpu_env, arg3 + offsetof(ZMMReg, ZMM_L(0))); + tcg_gen_extu_i32_i64(r64, r32); + tcg_gen_st_i64(r64, cpu_env, arg1 + offsetof(ZMMReg, ZMM_Q(0))); + tcg_gen_movi_i64(r64, 0); + tcg_gen_st_i64(r64, cpu_env, arg1 + offsetof(ZMMReg, ZMM_Q(1))); + } + tcg_temp_free_i32(r32); + tcg_temp_free_i64(r64); +} +GEN_INSN2(movss, Wd, Vd) +{ + gen_insn4(movss, Vdq, Vdq, Wd, modrm_mod)(env, s, arg1, arg1, arg2, 3); +} + +GEN_INSN3(movhlps, Vdq, Vdq, UdqMhq) +{ + const TCGv_i64 r64 = tcg_temp_new_i64(); + tcg_gen_ld_i64(r64, cpu_env, arg3 + offsetof(ZMMReg, ZMM_Q(1))); + tcg_gen_st_i64(r64, cpu_env, arg1 + offsetof(ZMMReg, ZMM_Q(0))); + if (arg1 != arg2) { + tcg_gen_ld_i64(r64, cpu_env, arg2 + offsetof(ZMMReg, ZMM_Q(1))); + tcg_gen_st_i64(r64, cpu_env, arg1 + offsetof(ZMMReg, ZMM_Q(1))); + } + tcg_temp_free_i64(r64); +} +GEN_INSN2(movlps, Mq, Vq) +{ + insnop_ldst(xmm, Mq)(env, s, 1, arg2, arg1); +} + +GEN_INSN3(movlhps, Vdq, Vq, Wq) +{ + const TCGv_i64 r64 = tcg_temp_new_i64(); + tcg_gen_ld_i64(r64, cpu_env, arg3 + offsetof(ZMMReg, ZMM_Q(0))); + tcg_gen_st_i64(r64, cpu_env, arg1 + offsetof(ZMMReg, ZMM_Q(1))); + if (arg1 != arg2) { + tcg_gen_ld_i64(r64, cpu_env, arg2 + offsetof(ZMMReg, ZMM_Q(0))); + tcg_gen_st_i64(r64, cpu_env, arg1 + offsetof(ZMMReg, ZMM_Q(0))); + } + tcg_temp_free_i64(r64); +} +GEN_INSN2(movhps, Mq, Vdq) +{ + insnop_ldst(xmm, Mhq)(env, s, 1, arg2, arg1); +} + +DEF_GEN_INSN2_HELPER_DEP(pmovmskb, pmovmskb_mmx, Gd, Nq) +GEN_INSN2(pmovmskb, Gq, Nq) +{ + const TCGv_i32 arg1_r32 = tcg_temp_new_i32(); + gen_insn2(pmovmskb, Gd, Nq)(env, s, arg1_r32, arg2); + tcg_gen_extu_i32_i64(arg1, arg1_r32); + tcg_temp_free_i32(arg1_r32); +} + +DEF_GEN_INSN2_HELPER_DEP(movmskps, movmskps, Gd, Udq) +GEN_INSN2(movmskps, Gq, Udq) +{ + const TCGv_i32 arg1_r32 = tcg_temp_new_i32(); + gen_insn2(movmskps, Gd, Udq)(env, s, arg1_r32, arg2); + tcg_gen_extu_i32_i64(arg1, arg1_r32); + tcg_temp_free_i32(arg1_r32); +} DEF_GEN_INSN3_GVEC(paddb, Pq, Pq, Qq, add, MM_OPRSZ, MM_MAXSZ, MO_8) DEF_GEN_INSN3_GVEC(paddw, Pq, Pq, Qq, add, MM_OPRSZ, MM_MAXSZ, MO_16) @@ -5594,6 +5678,8 @@ DEF_GEN_INSN3_GVEC(paddsb, Pq, Pq, Qq, ssadd, MM_OPRSZ, MM_MAXSZ, MO_8) DEF_GEN_INSN3_GVEC(paddsw, Pq, Pq, Qq, ssadd, MM_OPRSZ, MM_MAXSZ, MO_16) DEF_GEN_INSN3_GVEC(paddusb, Pq, Pq, Qq, usadd, MM_OPRSZ, MM_MAXSZ, MO_8) DEF_GEN_INSN3_GVEC(paddusw, Pq, Pq, Qq, usadd, MM_OPRSZ, MM_MAXSZ, MO_16) +DEF_GEN_INSN3_HELPER_EPP(addps, addps, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(addss, addss, Vd, Vd, Wd) DEF_GEN_INSN3_GVEC(psubb, Pq, Pq, Qq, sub, MM_OPRSZ, MM_MAXSZ, MO_8) DEF_GEN_INSN3_GVEC(psubw, Pq, Pq, Qq, sub, MM_OPRSZ, MM_MAXSZ, MO_16) @@ -5602,11 +5688,38 @@ DEF_GEN_INSN3_GVEC(psubsb, Pq, Pq, Qq, sssub, MM_OPRSZ, MM_MAXSZ, MO_8) DEF_GEN_INSN3_GVEC(psubsw, Pq, Pq, Qq, sssub, MM_OPRSZ, MM_MAXSZ, MO_16) DEF_GEN_INSN3_GVEC(psubusb, Pq, Pq, Qq, ussub, MM_OPRSZ, MM_MAXSZ, MO_8) DEF_GEN_INSN3_GVEC(psubusw, Pq, Pq, Qq, ussub, MM_OPRSZ, MM_MAXSZ, MO_16) +DEF_GEN_INSN3_HELPER_EPP(subps, subps, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(subss, subss, Vd, Vd, Wd) DEF_GEN_INSN3_HELPER_EPP(pmullw, pmullw_mmx, Pq, Pq, Qq) DEF_GEN_INSN3_HELPER_EPP(pmulhw, pmulhw_mmx, Pq, Pq, Qq) +DEF_GEN_INSN3_HELPER_EPP(pmulhuw, pmulhuw_mmx, Pq, Pq, Qq) +DEF_GEN_INSN3_HELPER_EPP(mulps, mulps, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(mulss, mulss, Vd, Vd, Wd) DEF_GEN_INSN3_HELPER_EPP(pmaddwd, pmaddwd_mmx, Pq, Pq, Qq) +DEF_GEN_INSN3_HELPER_EPP(divps, divps, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(divss, divss, Vd, Vd, Wd) + +DEF_GEN_INSN2_HELPER_EPP(rcpps, rcpps, Vdq, Wdq) +DEF_GEN_INSN2_HELPER_EPP(rcpss, rcpss, Vd, Wd) +DEF_GEN_INSN2_HELPER_EPP(sqrtps, sqrtps, Vdq, Wdq) +DEF_GEN_INSN2_HELPER_EPP(sqrtss, sqrtss, Vd, Wd) +DEF_GEN_INSN2_HELPER_EPP(rsqrtps, rsqrtps, Vdq, Wdq) +DEF_GEN_INSN2_HELPER_EPP(rsqrtss, rsqrtss, Vd, Wd) + +DEF_GEN_INSN3_GVEC(pminub, Pq, Pq, Qq, umin, MM_OPRSZ, MM_MAXSZ, MO_8) +DEF_GEN_INSN3_GVEC(pminsw, Pq, Pq, Qq, smin, MM_OPRSZ, MM_MAXSZ, MO_16) +DEF_GEN_INSN3_HELPER_EPP(minps, minps, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(minss, minss, Vd, Vd, Wd) +DEF_GEN_INSN3_GVEC(pmaxub, Pq, Pq, Qq, umax, MM_OPRSZ, MM_MAXSZ, MO_8) +DEF_GEN_INSN3_GVEC(pmaxsw, Pq, Pq, Qq, smax, MM_OPRSZ, MM_MAXSZ, MO_16) +DEF_GEN_INSN3_HELPER_EPP(maxps, maxps, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(maxss, maxss, Vd, Vd, Wd) +DEF_GEN_INSN3_HELPER_EPP(pavgb, pavgb_mmx, Pq, Pq, Qq) +DEF_GEN_INSN3_HELPER_EPP(pavgw, pavgw_mmx, Pq, Pq, Qq) +DEF_GEN_INSN3_HELPER_EPP(psadbw, psadbw_mmx, Pq, Pq, Qq) + DEF_GEN_INSN3_GVEC(pcmpeqb, Pq, Pq, Qq, cmp, MM_OPRSZ, MM_MAXSZ, MO_8, TCG_COND_EQ) DEF_GEN_INSN3_GVEC(pcmpeqw, Pq, Pq, Qq, cmp, MM_OPRSZ, MM_MAXSZ, MO_16, TCG_COND_EQ) DEF_GEN_INSN3_GVEC(pcmpeqd, Pq, Pq, Qq, cmp, MM_OPRSZ, MM_MAXSZ, MO_32, TCG_COND_EQ) @@ -5614,10 +5727,98 @@ DEF_GEN_INSN3_GVEC(pcmpgtb, Pq, Pq, Qq, cmp, MM_OPRSZ, MM_MAXSZ, MO_8, TCG_COND_ DEF_GEN_INSN3_GVEC(pcmpgtw, Pq, Pq, Qq, cmp, MM_OPRSZ, MM_MAXSZ, MO_16, TCG_COND_GT) DEF_GEN_INSN3_GVEC(pcmpgtd, Pq, Pq, Qq, cmp, MM_OPRSZ, MM_MAXSZ, MO_32, TCG_COND_GT) +DEF_GEN_INSN3_HELPER_EPP(cmpeqps, cmpeqps, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(cmpeqss, cmpeqss, Vd, Vd, Wd) +DEF_GEN_INSN3_HELPER_EPP(cmpltps, cmpltps, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(cmpltss, cmpltss, Vd, Vd, Wd) +DEF_GEN_INSN3_HELPER_EPP(cmpleps, cmpleps, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(cmpless, cmpless, Vd, Vd, Wd) +DEF_GEN_INSN3_HELPER_EPP(cmpunordps, cmpunordps, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(cmpunordss, cmpunordss, Vd, Vd, Wd) +DEF_GEN_INSN3_HELPER_EPP(cmpneqps, cmpneqps, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(cmpneqss, cmpneqss, Vd, Vd, Wd) +DEF_GEN_INSN3_HELPER_EPP(cmpnltps, cmpnltps, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(cmpnltss, cmpnltss, Vd, Vd, Wd) +DEF_GEN_INSN3_HELPER_EPP(cmpnleps, cmpnleps, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(cmpnless, cmpnless, Vd, Vd, Wd) +DEF_GEN_INSN3_HELPER_EPP(cmpordps, cmpordps, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(cmpordss, cmpordss, Vd, Vd, Wd) + +GEN_INSN4(cmpps, Vdq, Vdq, Wdq, Ib) +{ + switch (arg4 & 7) { + case 0: + gen_insn3(cmpeqps, Vdq, Vdq, Wdq)(env, s, arg1, arg2, arg3); + return; + case 1: + gen_insn3(cmpltps, Vdq, Vdq, Wdq)(env, s, arg1, arg2, arg3); + return; + case 2: + gen_insn3(cmpleps, Vdq, Vdq, Wdq)(env, s, arg1, arg2, arg3); + return; + case 3: + gen_insn3(cmpunordps, Vdq, Vdq, Wdq)(env, s, arg1, arg2, arg3); + return; + case 4: + gen_insn3(cmpneqps, Vdq, Vdq, Wdq)(env, s, arg1, arg2, arg3); + return; + case 5: + gen_insn3(cmpnltps, Vdq, Vdq, Wdq)(env, s, arg1, arg2, arg3); + return; + case 6: + gen_insn3(cmpnleps, Vdq, Vdq, Wdq)(env, s, arg1, arg2, arg3); + return; + case 7: + gen_insn3(cmpordps, Vdq, Vdq, Wdq)(env, s, arg1, arg2, arg3); + return; + } + + g_assert_not_reached(); +} + +GEN_INSN4(cmpss, Vd, Vd, Wd, Ib) +{ + switch (arg4 & 7) { + case 0: + gen_insn3(cmpeqss, Vd, Vd, Wd)(env, s, arg1, arg2, arg3); + return; + case 1: + gen_insn3(cmpltss, Vd, Vd, Wd)(env, s, arg1, arg2, arg3); + return; + case 2: + gen_insn3(cmpless, Vd, Vd, Wd)(env, s, arg1, arg2, arg3); + return; + case 3: + gen_insn3(cmpunordss, Vd, Vd, Wd)(env, s, arg1, arg2, arg3); + return; + case 4: + gen_insn3(cmpneqss, Vd, Vd, Wd)(env, s, arg1, arg2, arg3); + return; + case 5: + gen_insn3(cmpnltss, Vd, Vd, Wd)(env, s, arg1, arg2, arg3); + return; + case 6: + gen_insn3(cmpnless, Vd, Vd, Wd)(env, s, arg1, arg2, arg3); + return; + case 7: + gen_insn3(cmpordss, Vd, Vd, Wd)(env, s, arg1, arg2, arg3); + return; + } + + g_assert_not_reached(); +} + +DEF_GEN_INSN2_HELPER_EPP(comiss, comiss, Vd, Wd) +DEF_GEN_INSN2_HELPER_EPP(ucomiss, ucomiss, Vd, Wd) + DEF_GEN_INSN3_GVEC(pand, Pq, Pq, Qq, and, MM_OPRSZ, MM_MAXSZ, MO_64) +DEF_GEN_INSN3_GVEC(andps, Vdq, Vdq, Wdq, and, XMM_OPRSZ, XMM_MAXSZ, MO_64) DEF_GEN_INSN3_GVEC(pandn, Pq, Pq, Qq, andn, MM_OPRSZ, MM_MAXSZ, MO_64) +DEF_GEN_INSN3_GVEC(andnps, Vdq, Vdq, Wdq, andn, XMM_OPRSZ, XMM_MAXSZ, MO_64) DEF_GEN_INSN3_GVEC(por, Pq, Pq, Qq, or, MM_OPRSZ, MM_MAXSZ, MO_64) +DEF_GEN_INSN3_GVEC(orps, Vdq, Vdq, Wdq, or, XMM_OPRSZ, XMM_MAXSZ, MO_64) DEF_GEN_INSN3_GVEC(pxor, Pq, Pq, Qq, xor, MM_OPRSZ, MM_MAXSZ, MO_64) +DEF_GEN_INSN3_GVEC(xorps, Vdq, Vdq, Wdq, xor, XMM_OPRSZ, XMM_MAXSZ, MO_64) DEF_GEN_INSN3_HELPER_EPP(psllw, psllw_mmx, Pq, Pq, Qq) DEF_GEN_INSN3_HELPER_EPP(pslld, pslld_mmx, Pq, Pq, Qq) @@ -5660,8 +5861,116 @@ DEF_GEN_INSN3_HELPER_EPP(punpckhbw, punpckhbw_mmx, Pq, Pq, Qq) DEF_GEN_INSN3_HELPER_EPP(punpckhwd, punpckhwd_mmx, Pq, Pq, Qq) DEF_GEN_INSN3_HELPER_EPP(punpckhdq, punpckhdq_mmx, Pq, Pq, Qq) +DEF_GEN_INSN3_HELPER_EPP(unpcklps, punpckldq_xmm, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(unpckhps, punpckhdq_xmm, Vdq, Vdq, Wdq) + +DEF_GEN_INSN3_HELPER_PPI(pshufw, pshufw_mmx, Pq, Qq, Ib) +DEF_GEN_INSN4_HELPER_PPI(shufps, shufps, Vdq, Vdq, Wdq, Ib) + +GEN_INSN4(pinsrw, Pq, Pq, RdMw, Ib) +{ + assert(arg1 == arg2); + + const size_t ofs = offsetof(MMXReg, MMX_W(arg4 & 3)); + tcg_gen_st16_i32(arg3, cpu_env, arg1 + ofs); +} + +GEN_INSN3(pextrw, Gd, Nq, Ib) +{ + const size_t ofs = offsetof(MMXReg, MMX_W(arg3 & 3)); + tcg_gen_ld16u_i32(arg1, cpu_env, arg2 + ofs); +} +GEN_INSN3(pextrw, Gq, Nq, Ib) +{ + const size_t ofs = offsetof(MMXReg, MMX_W(arg3 & 3)); + tcg_gen_ld16u_i64(arg1, cpu_env, arg2 + ofs); +} + +DEF_GEN_INSN2_HELPER_EPP(cvtpi2ps, cvtpi2ps, Vdq, Qq) +DEF_GEN_INSN2_HELPER_EPD(cvtsi2ss, cvtsi2ss, Vd, Ed) +DEF_GEN_INSN2_HELPER_EPQ(cvtsi2ss, cvtsq2ss, Vd, Eq) +DEF_GEN_INSN2_HELPER_EPP(cvtps2pi, cvtps2pi, Pq, Wq) +DEF_GEN_INSN2_HELPER_DEP(cvtss2si, cvtss2si, Gd, Wd) +DEF_GEN_INSN2_HELPER_QEP(cvtss2si, cvtss2sq, Gq, Wd) +DEF_GEN_INSN2_HELPER_EPP(cvttps2pi, cvttps2pi, Pq, Wq) +DEF_GEN_INSN2_HELPER_DEP(cvttss2si, cvttss2si, Gd, Wd) +DEF_GEN_INSN2_HELPER_QEP(cvttss2si, cvttss2sq, Gq, Wd) + +GEN_INSN2(maskmovq, Pq, Nq) +{ + const TCGv_ptr arg1_ptr = tcg_temp_new_ptr(); + const TCGv_ptr arg2_ptr = tcg_temp_new_ptr(); + + tcg_gen_mov_tl(s->A0, cpu_regs[R_EDI]); + gen_extu(s->aflag, s->A0); + gen_add_A0_ds_seg(s); + + tcg_gen_addi_ptr(arg1_ptr, cpu_env, arg1); + tcg_gen_addi_ptr(arg2_ptr, cpu_env, arg2); + gen_helper_maskmov_mmx(cpu_env, arg1_ptr, arg2_ptr, s->A0); + + tcg_temp_free_ptr(arg1_ptr); + tcg_temp_free_ptr(arg2_ptr); +} + +GEN_INSN2(movntps, Mdq, Vdq) +{ + insnop_ldst(xmm, Mdq)(env, s, 1, arg2, arg1); +} + +GEN_INSN2(movntq, Mq, Pq) +{ + insnop_ldst(mm, Mq)(env, s, 1, arg2, arg1); +} + DEF_GEN_INSN0_HELPER(emms, emms) +GEN_INSN0(sfence) +{ + if (s->prefix & PREFIX_LOCK) { + gen_illegal_opcode(s); + } else { + tcg_gen_mb(TCG_MO_ST_ST | TCG_BAR_SC); + } +} + +GEN_INSN1(ldmxcsr, Md) +{ + if ((s->flags & HF_EM_MASK) || !(s->flags & HF_OSFXSR_MASK)) { + gen_illegal_opcode(s); + } else if (s->flags & HF_TS_MASK) { + gen_exception(s, EXCP07_PREX); + } else { + tcg_gen_qemu_ld_i32(s->tmp2_i32, arg1, s->mem_index, MO_LEUL); + gen_helper_ldmxcsr(cpu_env, s->tmp2_i32); + } +} +GEN_INSN1(stmxcsr, Md) +{ + if ((s->flags & HF_EM_MASK) || !(s->flags & HF_OSFXSR_MASK)) { + gen_illegal_opcode(s); + } else if (s->flags & HF_TS_MASK) { + gen_exception(s, EXCP07_PREX); + } else { + const size_t ofs = offsetof(CPUX86State, mxcsr); + tcg_gen_ld_i32(s->tmp2_i32, cpu_env, ofs); + tcg_gen_qemu_st_i32(s->tmp2_i32, arg1, s->mem_index, MO_LEUL); + } +} + +GEN_INSN1(prefetcht0, Mb) +{ +} +GEN_INSN1(prefetcht1, Mb) +{ +} +GEN_INSN1(prefetcht2, Mb) +{ +} +GEN_INSN1(prefetchnta, Mb) +{ +} + /* * Instruction translators */ From patchwork Wed Aug 21 17:29:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Bobek X-Patchwork-Id: 11107829 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 42A2B13A4 for ; Wed, 21 Aug 2019 18:14:10 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0A55A22D6D for ; Wed, 21 Aug 2019 18:14:10 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="id5TFTc+" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0A55A22D6D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:51572 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0V7Y-0000NH-Ur for patchwork-qemu-devel@patchwork.kernel.org; Wed, 21 Aug 2019 14:14:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41206) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0URY-0001W1-3B for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i0URV-0007ro-UH for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:43 -0400 Received: from mail-yb1-xb43.google.com ([2607:f8b0:4864:20::b43]:38907) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i0URV-0007qn-Os for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:41 -0400 Received: by mail-yb1-xb43.google.com with SMTP id j199so1342833ybg.5 for ; Wed, 21 Aug 2019 10:30:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=rsb+ZcxAmfMO59dSw7a4dzp3XF7GxsSOH97ehlPsfvg=; b=id5TFTc+gfjwEBmcLWpFTxKteMstfJBBK0oKgqZ1xl4lfDA5+fjRcijxb1Qp3J1F8w j0fynG5kRA100b/3M4+uC4gemW4O2zQMKJFSTlBtu62+LgmRi4RlcvJKkVM1fPlaDUBr qzAzlYsui1l1tkPQh2UTuKjV5IKQJUuA/KbmqMHfTgSvQbZDioYHzA2qIg1CJ7ww9aO5 EfXznVLKqxyJ4Qp28Ivkd8w8p/s1aYp1tWeTkQjBvV9yORlwifig9BOkxBlh48A9ng5l o9TUGFVeYWSPjJWdbiw+dbv52WmqjJp6OoEgZoO5N1AhRM0m+zs6lcPpvhgNV4bQpUje /Gpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=rsb+ZcxAmfMO59dSw7a4dzp3XF7GxsSOH97ehlPsfvg=; b=t5aWqeEvY6FeoN10D2mzEyunTmstF56ujj8gNy5i1IdQhDe9Ek+ffFRdRL6MrJwyxI XwHbfj9S1UMbd9kBaQ3eUimHDyYaYErlphHbHrKpxFNp15TonUNSCZKaxlNPBdetYvgu qNB0OXis5KhAathlf7K1VUh+1ZqJRP0xny5FiutivHN/vG1TIVPEdtThMlc7Na51Cr+W wn8bTexnD3za7T82n2I36lB4kr9wbjV09/hcH4hw8Qq4PE2FKtiEIw5LQPa5MtcpfvJk /0TACi4fOx8Y2jcjfbnjUTMZbOkGOWW142gxtbMNK6d8VSkYZ/eWmkpudm7gorOh7lwE BpUQ== X-Gm-Message-State: APjAAAXoCgtY3uNi/SsUXPx2CVr/VVKrQ6XR6J3Qgb6UrQh9nMZIwEfu +5Pv1vRNakOYQIoF2MLlqeTDyXiM X-Google-Smtp-Source: APXvYqw+UFpO8/WM1vxAL37VHAqykbEkFlN/UYIEW0VWXNCd87LynOJjKMu79NTrAm65UfApUGbAJw== X-Received: by 2002:a25:2bc8:: with SMTP id r191mr24058302ybr.327.1566408640909; Wed, 21 Aug 2019 10:30:40 -0700 (PDT) Received: from localhost.localdomain ([2601:c0:c67f:e390::3]) by smtp.gmail.com with ESMTPSA id l71sm2826167ywl.39.2019.08.21.10.30.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Aug 2019 10:30:40 -0700 (PDT) From: Jan Bobek To: qemu-devel@nongnu.org Date: Wed, 21 Aug 2019 13:29:17 -0400 Message-Id: <20190821172951.15333-42-jan.bobek@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190821172951.15333-1-jan.bobek@gmail.com> References: <20190821172951.15333-1-jan.bobek@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::b43 Subject: [Qemu-devel] [RFC PATCH v4 41/75] target/i386: introduce SSE vector instructions to sse-opcode.inc.h X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jan Bobek , =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Add all the SSE vector instruction entries to sse-opcode.inc.h. Signed-off-by: Jan Bobek --- target/i386/sse-opcode.inc.h | 161 +++++++++++++++++++++++++++++++++++ 1 file changed, 161 insertions(+) diff --git a/target/i386/sse-opcode.inc.h b/target/i386/sse-opcode.inc.h index e570d449fc..92581703cd 100644 --- a/target/i386/sse-opcode.inc.h +++ b/target/i386/sse-opcode.inc.h @@ -104,6 +104,85 @@ * NP 0F 72 /4 ib PSRAD mm,imm8 * NP 0F 73 /6 ib PSLLQ mm, imm8 * NP 0F 73 /2 ib PSRLQ mm, imm8 + * + * SSE Instructions + * ----------------- + * NP 0F 28 /r MOVAPS xmm1, xmm2/m128 + * NP 0F 29 /r MOVAPS xmm2/m128, xmm1 + * NP 0F 10 /r MOVUPS xmm1, xmm2/m128 + * NP 0F 11 /r MOVUPS xmm2/m128, xmm1 + * F3 0F 10 /r MOVSS xmm1, xmm2/m32 + * F3 0F 11 /r MOVSS xmm2/m32, xmm1 + * NP 0F 12 /r MOVHLPS xmm1, xmm2 + * NP 0F 12 /r MOVLPS xmm1, m64 + * 0F 13 /r MOVLPS m64, xmm1 + * NP 0F 16 /r MOVLHPS xmm1, xmm2 + * NP 0F 16 /r MOVHPS xmm1, m64 + * NP 0F 17 /r MOVHPS m64, xmm1 + * NP 0F D7 /r PMOVMSKB r32, mm + * NP REX.W 0F D7 /r PMOVMSKB r64, mm + * NP 0F 50 /r MOVMSKPS r32, xmm + * NP REX.W 0F 50 /r MOVMSKPS r64, xmm + * NP 0F 58 /r ADDPS xmm1, xmm2/m128 + * F3 0F 58 /r ADDSS xmm1, xmm2/m32 + * NP 0F 5C /r SUBPS xmm1, xmm2/m128 + * F3 0F 5C /r SUBSS xmm1, xmm2/m32 + * NP 0F E4 /r PMULHUW mm1, mm2/m64 + * NP 0F 59 /r MULPS xmm1, xmm2/m128 + * F3 0F 59 /r MULSS xmm1,xmm2/m32 + * NP 0F 5E /r DIVPS xmm1, xmm2/m128 + * F3 0F 5E /r DIVSS xmm1, xmm2/m32 + * NP 0F 53 /r RCPPS xmm1, xmm2/m128 + * F3 0F 53 /r RCPSS xmm1, xmm2/m32 + * NP 0F 51 /r SQRTPS xmm1, xmm2/m128 + * F3 0F 51 /r SQRTSS xmm1, xmm2/m32 + * NP 0F 52 /r RSQRTPS xmm1, xmm2/m128 + * F3 0F 52 /r RSQRTSS xmm1, xmm2/m32 + * NP 0F DA /r PMINUB mm1, mm2/m64 + * NP 0F EA /r PMINSW mm1, mm2/m64 + * NP 0F 5D /r MINPS xmm1, xmm2/m128 + * F3 0F 5D /r MINSS xmm1,xmm2/m32 + * NP 0F DE /r PMAXUB mm1, mm2/m64 + * NP 0F EE /r PMAXSW mm1, mm2/m64 + * NP 0F 5F /r MAXPS xmm1, xmm2/m128 + * F3 0F 5F /r MAXSS xmm1, xmm2/m32 + * NP 0F E0 /r PAVGB mm1, mm2/m64 + * NP 0F E3 /r PAVGW mm1, mm2/m64 + * NP 0F F6 /r PSADBW mm1, mm2/m64 + * NP 0F C2 /r ib CMPPS xmm1, xmm2/m128, imm8 + * F3 0F C2 /r ib CMPSS xmm1, xmm2/m32, imm8 + * NP 0F 2E /r UCOMISS xmm1, xmm2/m32 + * NP 0F 2F /r COMISS xmm1, xmm2/m32 + * NP 0F 54 /r ANDPS xmm1, xmm2/m128 + * NP 0F 55 /r ANDNPS xmm1, xmm2/m128 + * NP 0F 56 /r ORPS xmm1, xmm2/m128 + * NP 0F 57 /r XORPS xmm1, xmm2/m128 + * NP 0F 14 /r UNPCKLPS xmm1, xmm2/m128 + * NP 0F 15 /r UNPCKHPS xmm1, xmm2/m128 + * NP 0F 70 /r ib PSHUFW mm1, mm2/m64, imm8 + * NP 0F C6 /r ib SHUFPS xmm1, xmm3/m128, imm8 + * NP 0F C4 /r ib PINSRW mm, r32/m16, imm8 + * NP 0F C5 /r ib PEXTRW r32, mm, imm8 + * NP REX.W 0F C5 /r ib PEXTRW r64, mm, imm8 + * NP 0F 2A /r CVTPI2PS xmm, mm/m64 + * F3 0F 2A /r CVTSI2SS xmm1,r/m32 + * F3 REX.W 0F 2A /r CVTSI2SS xmm1,r/m64 + * NP 0F 2D /r CVTPS2PI mm, xmm/m64 + * F3 0F 2D /r CVTSS2SI r32,xmm1/m32 + * F3 REX.W 0F 2D /r CVTSS2SI r64,xmm1/m32 + * NP 0F 2C /r CVTTPS2PI mm, xmm/m64 + * F3 0F 2C /r CVTTSS2SI r32,xmm1/m32 + * F3 REX.W 0F 2C /r CVTTSS2SI r64,xmm1/m32 + * NP 0F F7 /r MASKMOVQ mm1, mm2 + * NP 0F 2B /r MOVNTPS m128, xmm1 + * NP 0F E7 /r MOVNTQ m64, mm + * NP 0F AE /7 SFENCE + * NP 0F AE /2 LDMXCSR m32 + * NP 0F AE /3 STMXCSR m32 + * 0F 18 /1 PREFETCHT0 m8 + * 0F 18 /2 PREFETCHT1 m8 + * 0F 18 /3 PREFETCHT2 m8 + * 0F 18 /0 PREFETCHNTA m8 */ OPCODE(movd, LEG(NP, 0F, 0, 0x6e), MMX, WR, Pq, Ed) @@ -112,6 +191,20 @@ OPCODE(movq, LEG(NP, 0F, 1, 0x6e), MMX, WR, Pq, Eq) OPCODE(movq, LEG(NP, 0F, 1, 0x7e), MMX, WR, Eq, Pq) OPCODE(movq, LEG(NP, 0F, 0, 0x6f), MMX, WR, Pq, Qq) OPCODE(movq, LEG(NP, 0F, 0, 0x7f), MMX, WR, Qq, Pq) +OPCODE(movaps, LEG(NP, 0F, 0, 0x28), SSE, WR, Vdq, Wdq) +OPCODE(movaps, LEG(NP, 0F, 0, 0x29), SSE, WR, Wdq, Vdq) +OPCODE(movups, LEG(NP, 0F, 0, 0x10), SSE, WR, Vdq, Wdq) +OPCODE(movups, LEG(NP, 0F, 0, 0x11), SSE, WR, Wdq, Vdq) +OPCODE(movss, LEG(F3, 0F, 0, 0x10), SSE, WRRR, Vdq, Vdq, Wd, modrm_mod) +OPCODE(movss, LEG(F3, 0F, 0, 0x11), SSE, WR, Wd, Vd) +OPCODE(movhlps, LEG(NP, 0F, 0, 0x12), SSE, WRR, Vdq, Vdq, UdqMhq) +OPCODE(movlps, LEG(NP, 0F, 0, 0x13), SSE, WR, Mq, Vq) +OPCODE(movlhps, LEG(NP, 0F, 0, 0x16), SSE, WRR, Vdq, Vq, Wq) +OPCODE(movhps, LEG(NP, 0F, 0, 0x17), SSE, WR, Mq, Vdq) +OPCODE(pmovmskb, LEG(NP, 0F, 0, 0xd7), SSE, WR, Gd, Nq) +OPCODE(pmovmskb, LEG(NP, 0F, 1, 0xd7), SSE, WR, Gq, Nq) +OPCODE(movmskps, LEG(NP, 0F, 0, 0x50), SSE, WR, Gd, Udq) +OPCODE(movmskps, LEG(NP, 0F, 1, 0x50), SSE, WR, Gq, Udq) OPCODE(paddb, LEG(NP, 0F, 0, 0xfc), MMX, WRR, Pq, Pq, Qq) OPCODE(paddw, LEG(NP, 0F, 0, 0xfd), MMX, WRR, Pq, Pq, Qq) OPCODE(paddd, LEG(NP, 0F, 0, 0xfe), MMX, WRR, Pq, Pq, Qq) @@ -119,6 +212,8 @@ OPCODE(paddsb, LEG(NP, 0F, 0, 0xec), MMX, WRR, Pq, Pq, Qq) OPCODE(paddsw, LEG(NP, 0F, 0, 0xed), MMX, WRR, Pq, Pq, Qq) OPCODE(paddusb, LEG(NP, 0F, 0, 0xdc), MMX, WRR, Pq, Pq, Qq) OPCODE(paddusw, LEG(NP, 0F, 0, 0xdd), MMX, WRR, Pq, Pq, Qq) +OPCODE(addps, LEG(NP, 0F, 0, 0x58), SSE, WRR, Vdq, Vdq, Wdq) +OPCODE(addss, LEG(F3, 0F, 0, 0x58), SSE, WRR, Vd, Vd, Wd) OPCODE(psubb, LEG(NP, 0F, 0, 0xf8), MMX, WRR, Pq, Pq, Qq) OPCODE(psubw, LEG(NP, 0F, 0, 0xf9), MMX, WRR, Pq, Pq, Qq) OPCODE(psubd, LEG(NP, 0F, 0, 0xfa), MMX, WRR, Pq, Pq, Qq) @@ -126,19 +221,51 @@ OPCODE(psubsb, LEG(NP, 0F, 0, 0xe8), MMX, WRR, Pq, Pq, Qq) OPCODE(psubsw, LEG(NP, 0F, 0, 0xe9), MMX, WRR, Pq, Pq, Qq) OPCODE(psubusb, LEG(NP, 0F, 0, 0xd8), MMX, WRR, Pq, Pq, Qq) OPCODE(psubusw, LEG(NP, 0F, 0, 0xd9), MMX, WRR, Pq, Pq, Qq) +OPCODE(subps, LEG(NP, 0F, 0, 0x5c), SSE, WRR, Vdq, Vdq, Wdq) +OPCODE(subss, LEG(F3, 0F, 0, 0x5c), SSE, WRR, Vd, Vd, Wd) OPCODE(pmullw, LEG(NP, 0F, 0, 0xd5), MMX, WRR, Pq, Pq, Qq) OPCODE(pmulhw, LEG(NP, 0F, 0, 0xe5), MMX, WRR, Pq, Pq, Qq) +OPCODE(pmulhuw, LEG(NP, 0F, 0, 0xe4), SSE, WRR, Pq, Pq, Qq) +OPCODE(mulps, LEG(NP, 0F, 0, 0x59), SSE, WRR, Vdq, Vdq, Wdq) +OPCODE(mulss, LEG(F3, 0F, 0, 0x59), SSE, WRR, Vd, Vd, Wd) OPCODE(pmaddwd, LEG(NP, 0F, 0, 0xf5), MMX, WRR, Pq, Pq, Qq) +OPCODE(divps, LEG(NP, 0F, 0, 0x5e), SSE, WRR, Vdq, Vdq, Wdq) +OPCODE(divss, LEG(F3, 0F, 0, 0x5e), SSE, WRR, Vd, Vd, Wd) +OPCODE(rcpps, LEG(NP, 0F, 0, 0x53), SSE, WR, Vdq, Wdq) +OPCODE(rcpss, LEG(F3, 0F, 0, 0x53), SSE, WR, Vd, Wd) +OPCODE(sqrtps, LEG(NP, 0F, 0, 0x51), SSE, WR, Vdq, Wdq) +OPCODE(sqrtss, LEG(F3, 0F, 0, 0x51), SSE, WR, Vd, Wd) +OPCODE(rsqrtps, LEG(NP, 0F, 0, 0x52), SSE, WR, Vdq, Wdq) +OPCODE(rsqrtss, LEG(F3, 0F, 0, 0x52), SSE, WR, Vd, Wd) +OPCODE(pminub, LEG(NP, 0F, 0, 0xda), SSE, WRR, Pq, Pq, Qq) +OPCODE(pminsw, LEG(NP, 0F, 0, 0xea), SSE, WRR, Pq, Pq, Qq) +OPCODE(minps, LEG(NP, 0F, 0, 0x5d), SSE, WRR, Vdq, Vdq, Wdq) +OPCODE(minss, LEG(F3, 0F, 0, 0x5d), SSE, WRR, Vd, Vd, Wd) +OPCODE(pmaxub, LEG(NP, 0F, 0, 0xde), SSE, WRR, Pq, Pq, Qq) +OPCODE(pmaxsw, LEG(NP, 0F, 0, 0xee), SSE, WRR, Pq, Pq, Qq) +OPCODE(maxps, LEG(NP, 0F, 0, 0x5f), SSE, WRR, Vdq, Vdq, Wdq) +OPCODE(maxss, LEG(F3, 0F, 0, 0x5f), SSE, WRR, Vd, Vd, Wd) +OPCODE(pavgb, LEG(NP, 0F, 0, 0xe0), SSE, WRR, Pq, Pq, Qq) +OPCODE(pavgw, LEG(NP, 0F, 0, 0xe3), SSE, WRR, Pq, Pq, Qq) +OPCODE(psadbw, LEG(NP, 0F, 0, 0xf6), SSE, WRR, Pq, Pq, Qq) OPCODE(pcmpeqb, LEG(NP, 0F, 0, 0x74), MMX, WRR, Pq, Pq, Qq) OPCODE(pcmpeqw, LEG(NP, 0F, 0, 0x75), MMX, WRR, Pq, Pq, Qq) OPCODE(pcmpeqd, LEG(NP, 0F, 0, 0x76), MMX, WRR, Pq, Pq, Qq) OPCODE(pcmpgtb, LEG(NP, 0F, 0, 0x64), MMX, WRR, Pq, Pq, Qq) OPCODE(pcmpgtw, LEG(NP, 0F, 0, 0x65), MMX, WRR, Pq, Pq, Qq) OPCODE(pcmpgtd, LEG(NP, 0F, 0, 0x66), MMX, WRR, Pq, Pq, Qq) +OPCODE(cmpps, LEG(NP, 0F, 0, 0xc2), SSE, WRRR, Vdq, Vdq, Wdq, Ib) +OPCODE(cmpss, LEG(F3, 0F, 0, 0xc2), SSE, WRRR, Vd, Vd, Wd, Ib) +OPCODE(ucomiss, LEG(NP, 0F, 0, 0x2e), SSE, RR, Vd, Wd) +OPCODE(comiss, LEG(NP, 0F, 0, 0x2f), SSE, RR, Vd, Wd) OPCODE(pand, LEG(NP, 0F, 0, 0xdb), MMX, WRR, Pq, Pq, Qq) +OPCODE(andps, LEG(NP, 0F, 0, 0x54), SSE, WRR, Vdq, Vdq, Wdq) OPCODE(pandn, LEG(NP, 0F, 0, 0xdf), MMX, WRR, Pq, Pq, Qq) +OPCODE(andnps, LEG(NP, 0F, 0, 0x55), SSE, WRR, Vdq, Vdq, Wdq) OPCODE(por, LEG(NP, 0F, 0, 0xeb), MMX, WRR, Pq, Pq, Qq) +OPCODE(orps, LEG(NP, 0F, 0, 0x56), SSE, WRR, Vdq, Vdq, Wdq) OPCODE(pxor, LEG(NP, 0F, 0, 0xef), MMX, WRR, Pq, Pq, Qq) +OPCODE(xorps, LEG(NP, 0F, 0, 0x57), SSE, WRR, Vdq, Vdq, Wdq) OPCODE(psllw, LEG(NP, 0F, 0, 0xf1), MMX, WRR, Pq, Pq, Qq) OPCODE(pslld, LEG(NP, 0F, 0, 0xf2), MMX, WRR, Pq, Pq, Qq) OPCODE(psllq, LEG(NP, 0F, 0, 0xf3), MMX, WRR, Pq, Pq, Qq) @@ -156,6 +283,25 @@ OPCODE(punpckhdq, LEG(NP, 0F, 0, 0x6a), MMX, WRR, Pq, Pq, Qq) OPCODE(punpcklbw, LEG(NP, 0F, 0, 0x60), MMX, WRR, Pq, Pq, Qd) OPCODE(punpcklwd, LEG(NP, 0F, 0, 0x61), MMX, WRR, Pq, Pq, Qd) OPCODE(punpckldq, LEG(NP, 0F, 0, 0x62), MMX, WRR, Pq, Pq, Qd) +OPCODE(unpcklps, LEG(NP, 0F, 0, 0x14), SSE, WRR, Vdq, Vdq, Wdq) +OPCODE(unpckhps, LEG(NP, 0F, 0, 0x15), SSE, WRR, Vdq, Vdq, Wdq) +OPCODE(pshufw, LEG(NP, 0F, 0, 0x70), SSE, WRR, Pq, Qq, Ib) +OPCODE(shufps, LEG(NP, 0F, 0, 0xc6), SSE, WRRR, Vdq, Vdq, Wdq, Ib) +OPCODE(pinsrw, LEG(NP, 0F, 0, 0xc4), SSE, WRRR, Pq, Pq, RdMw, Ib) +OPCODE(pextrw, LEG(NP, 0F, 0, 0xc5), SSE, WRR, Gd, Nq, Ib) +OPCODE(pextrw, LEG(NP, 0F, 1, 0xc5), SSE, WRR, Gq, Nq, Ib) +OPCODE(cvtpi2ps, LEG(NP, 0F, 0, 0x2a), SSE, WR, Vdq, Qq) +OPCODE(cvtsi2ss, LEG(F3, 0F, 0, 0x2a), SSE, WR, Vd, Ed) +OPCODE(cvtsi2ss, LEG(F3, 0F, 1, 0x2a), SSE, WR, Vd, Eq) +OPCODE(cvtps2pi, LEG(NP, 0F, 0, 0x2d), SSE, WR, Pq, Wq) +OPCODE(cvtss2si, LEG(F3, 0F, 0, 0x2d), SSE, WR, Gd, Wd) +OPCODE(cvtss2si, LEG(F3, 0F, 1, 0x2d), SSE, WR, Gq, Wd) +OPCODE(cvttps2pi, LEG(NP, 0F, 0, 0x2c), SSE, WR, Pq, Wq) +OPCODE(cvttss2si, LEG(F3, 0F, 0, 0x2c), SSE, WR, Gd, Wd) +OPCODE(cvttss2si, LEG(F3, 0F, 1, 0x2c), SSE, WR, Gq, Wd) +OPCODE(maskmovq, LEG(NP, 0F, 0, 0xf7), SSE, RR, Pq, Nq) +OPCODE(movntps, LEG(NP, 0F, 0, 0x2b), SSE, WR, Mdq, Vdq) +OPCODE(movntq, LEG(NP, 0F, 0, 0xe7), SSE, WR, Mq, Pq) OPCODE(emms, LEG(NP, 0F, 0, 0x77), MMX, ) OPCODE_GRP(grp12_LEG_NP, LEG(NP, 0F, 0, 0x71)) @@ -178,6 +324,21 @@ OPCODE_GRP_BEGIN(grp14_LEG_NP) OPCODE_GRPMEMB(grp14_LEG_NP, psrlq, 2, MMX, WRR, Nq, Nq, Ib) OPCODE_GRP_END(grp14_LEG_NP) +OPCODE_GRP(grp15_LEG_NP, LEG(NP, 0F, 0, 0xae)) +OPCODE_GRP_BEGIN(grp15_LEG_NP) + OPCODE_GRPMEMB(grp15_LEG_NP, sfence, 7, SSE, ) + OPCODE_GRPMEMB(grp15_LEG_NP, ldmxcsr, 2, SSE, R, Md) + OPCODE_GRPMEMB(grp15_LEG_NP, stmxcsr, 3, SSE, W, Md) +OPCODE_GRP_END(grp15_LEG_NP) + +OPCODE_GRP(grp16_LEG_NP, LEG(NP, 0F, 0, 0x18)) +OPCODE_GRP_BEGIN(grp16_LEG_NP) + OPCODE_GRPMEMB(grp16_LEG_NP, prefetcht0, 1, SSE, R, Mb) + OPCODE_GRPMEMB(grp16_LEG_NP, prefetcht1, 2, SSE, R, Mb) + OPCODE_GRPMEMB(grp16_LEG_NP, prefetcht2, 3, SSE, R, Mb) + OPCODE_GRPMEMB(grp16_LEG_NP, prefetchnta, 0, SSE, R, Mb) +OPCODE_GRP_END(grp16_LEG_NP) + #undef FMTI____ #undef FMTI__R__ #undef FMTI__RR__ From patchwork Wed Aug 21 17:29:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Bobek X-Patchwork-Id: 11107823 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 26EE6184E for ; Wed, 21 Aug 2019 18:10:58 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id ECC5D22DD3 for ; Wed, 21 Aug 2019 18:10:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="uIGb93tR" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org ECC5D22DD3 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:51546 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0V4S-0004xk-Nu for patchwork-qemu-devel@patchwork.kernel.org; Wed, 21 Aug 2019 14:10:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41209) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0URY-0001WB-AI for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i0URW-0007sm-N5 for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:43 -0400 Received: from mail-yb1-xb43.google.com ([2607:f8b0:4864:20::b43]:40497) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i0URW-0007sR-HM for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:42 -0400 Received: by mail-yb1-xb43.google.com with SMTP id g7so1338695ybd.7 for ; Wed, 21 Aug 2019 10:30:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=4A9C2L46vAXwKZhyDA+ICHUAa54BeR9KBizREODjwCw=; b=uIGb93tRbzRUVZVwv0iIUcHpXW1wHM9igvLUkxucm/tkJdAA589fUkMeRtqm21aoaD q2XyYu9NsIioYe1gjp/EcqA9H+mG8Y5A9/5agYLu39i7rfXmZXrhJML02gEU/yJ7J3pP MTsrhOhAlcmozo7zbftPx+6+p1qbsscvtmh5R5Pu+MtTp/BBQYhHLaaRPtNPBztblpKO OpkIOwQ24QHW8OuRd0YemCiQOLBPMt+XUywxXQpkRke2SO1lNtg7/2vci2PwrALRJaec 4NsPJ8RTKFJuuu4XD02Qs6WFMGDb4OHKYw5ueO8yefLydoskR3rVLrPzKqUxc1r+cbUB i95Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=4A9C2L46vAXwKZhyDA+ICHUAa54BeR9KBizREODjwCw=; b=ZP1APlFUANCJL5aNSGDFXUaEmVzBi0ms/eUJAPOWgTXibtqOetn0yFBXeEi9b2ENqY yI2tFP8ORp/x3JFqlN0cdE8Ug/nGHRb2Ww9YpcmtbMDMfj3I4juaecosH2zukos1oUXt 5sGj1tHpq7SP4Ynat1rkyAqHvsXnr9GGccM8oP4LFCPcVWYHpue4uIeQkVY7D6zOy0Nu bMaNnY8kOI6fBhvjhXwOnVcsJMMuQm2mllHkeNE++w4K0+ZHfzWAtPO/GC75YlwKXtf5 pajGWKZ3Rl2c9zp40iCuz2x8R9T0oIMV41odhFqfBPWPGzX474KuwNdO+lyqlYCo09OA 8HWg== X-Gm-Message-State: APjAAAVcGRa5+OoZ7Y+TYxA7DzmcpupYa0ZrDekpSxHYkHnnzD7bZwEx RX8nNFZfskkWMOQlb2cN9JVQTq9J X-Google-Smtp-Source: APXvYqxa3saaZ9vn41bMqKBcTIv5N5cvJTYJCVTn+4BsDiMM4JPmVGo2gCdrdMBuf+BygAhad0J5UA== X-Received: by 2002:a25:6b43:: with SMTP id o3mr24802663ybm.295.1566408641892; Wed, 21 Aug 2019 10:30:41 -0700 (PDT) Received: from localhost.localdomain ([2601:c0:c67f:e390::3]) by smtp.gmail.com with ESMTPSA id l71sm2826167ywl.39.2019.08.21.10.30.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Aug 2019 10:30:41 -0700 (PDT) From: Jan Bobek To: qemu-devel@nongnu.org Date: Wed, 21 Aug 2019 13:29:18 -0400 Message-Id: <20190821172951.15333-43-jan.bobek@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190821172951.15333-1-jan.bobek@gmail.com> References: <20190821172951.15333-1-jan.bobek@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::b43 Subject: [Qemu-devel] [RFC PATCH v4 42/75] target/i386: introduce SSE2 translators X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jan Bobek , =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Use the translator macros to define translators required by SSE2 instructions. Signed-off-by: Jan Bobek --- target/i386/translate.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/target/i386/translate.c b/target/i386/translate.c index d1537bc1b7..43917edc76 100644 --- a/target/i386/translate.c +++ b/target/i386/translate.c @@ -6064,14 +6064,20 @@ DEF_TRANSLATE_INSN1(Md) } DEF_TRANSLATE_INSN2(Ed, Pq) +DEF_TRANSLATE_INSN2(Ed, Vdq) DEF_TRANSLATE_INSN2(Eq, Pq) +DEF_TRANSLATE_INSN2(Eq, Vdq) DEF_TRANSLATE_INSN2(Gd, Nq) DEF_TRANSLATE_INSN2(Gd, Udq) DEF_TRANSLATE_INSN2(Gd, Wd) +DEF_TRANSLATE_INSN2(Gd, Wq) DEF_TRANSLATE_INSN2(Gq, Nq) DEF_TRANSLATE_INSN2(Gq, Udq) DEF_TRANSLATE_INSN2(Gq, Wd) +DEF_TRANSLATE_INSN2(Gq, Wq) +DEF_TRANSLATE_INSN2(Md, Gd) DEF_TRANSLATE_INSN2(Mdq, Vdq) +DEF_TRANSLATE_INSN2(Mq, Gq) DEF_TRANSLATE_INSN2(Mq, Pq) DEF_TRANSLATE_INSN2(Mq, Vdq) DEF_TRANSLATE_INSN2(Mq, Vq) @@ -6079,15 +6085,30 @@ DEF_TRANSLATE_INSN2(Pq, Ed) DEF_TRANSLATE_INSN2(Pq, Eq) DEF_TRANSLATE_INSN2(Pq, Nq) DEF_TRANSLATE_INSN2(Pq, Qq) +DEF_TRANSLATE_INSN2(Pq, Uq) +DEF_TRANSLATE_INSN2(Pq, Wdq) DEF_TRANSLATE_INSN2(Pq, Wq) DEF_TRANSLATE_INSN2(Qq, Pq) +DEF_TRANSLATE_INSN2(UdqMq, Vq) DEF_TRANSLATE_INSN2(Vd, Ed) DEF_TRANSLATE_INSN2(Vd, Eq) DEF_TRANSLATE_INSN2(Vd, Wd) +DEF_TRANSLATE_INSN2(Vd, Wq) +DEF_TRANSLATE_INSN2(Vdq, Ed) +DEF_TRANSLATE_INSN2(Vdq, Eq) +DEF_TRANSLATE_INSN2(Vdq, Nq) DEF_TRANSLATE_INSN2(Vdq, Qq) +DEF_TRANSLATE_INSN2(Vdq, Udq) DEF_TRANSLATE_INSN2(Vdq, Wdq) +DEF_TRANSLATE_INSN2(Vdq, Wq) +DEF_TRANSLATE_INSN2(Vq, Ed) +DEF_TRANSLATE_INSN2(Vq, Eq) +DEF_TRANSLATE_INSN2(Vq, Wd) +DEF_TRANSLATE_INSN2(Vq, Wq) DEF_TRANSLATE_INSN2(Wd, Vd) DEF_TRANSLATE_INSN2(Wdq, Vdq) +DEF_TRANSLATE_INSN2(Wq, Vq) +DEF_TRANSLATE_INSN2(modrm_mod, modrm) #define DEF_TRANSLATE_INSN3(opT1, opT2, opT3) \ static void translate_insn3(opT1, opT2, opT3)( \ @@ -6128,15 +6149,22 @@ DEF_TRANSLATE_INSN2(Wdq, Vdq) } DEF_TRANSLATE_INSN3(Gd, Nq, Ib) +DEF_TRANSLATE_INSN3(Gd, Udq, Ib) DEF_TRANSLATE_INSN3(Gq, Nq, Ib) +DEF_TRANSLATE_INSN3(Gq, Udq, Ib) DEF_TRANSLATE_INSN3(Nq, Nq, Ib) DEF_TRANSLATE_INSN3(Pq, Pq, Qd) DEF_TRANSLATE_INSN3(Pq, Pq, Qq) DEF_TRANSLATE_INSN3(Pq, Qq, Ib) +DEF_TRANSLATE_INSN3(Udq, Udq, Ib) DEF_TRANSLATE_INSN3(Vd, Vd, Wd) +DEF_TRANSLATE_INSN3(Vdq, Vdq, Mq) DEF_TRANSLATE_INSN3(Vdq, Vdq, UdqMhq) DEF_TRANSLATE_INSN3(Vdq, Vdq, Wdq) +DEF_TRANSLATE_INSN3(Vdq, Vq, Mq) DEF_TRANSLATE_INSN3(Vdq, Vq, Wq) +DEF_TRANSLATE_INSN3(Vdq, Wdq, Ib) +DEF_TRANSLATE_INSN3(Vq, Vq, Wq) #define DEF_TRANSLATE_INSN4(opT1, opT2, opT3, opT4) \ static void translate_insn4(opT1, opT2, opT3, opT4)( \ @@ -6184,8 +6212,11 @@ DEF_TRANSLATE_INSN3(Vdq, Vq, Wq) DEF_TRANSLATE_INSN4(Pq, Pq, RdMw, Ib) DEF_TRANSLATE_INSN4(Vd, Vd, Wd, Ib) +DEF_TRANSLATE_INSN4(Vdq, Vdq, RdMw, Ib) DEF_TRANSLATE_INSN4(Vdq, Vdq, Wd, modrm_mod) DEF_TRANSLATE_INSN4(Vdq, Vdq, Wdq, Ib) +DEF_TRANSLATE_INSN4(Vdq, Vdq, Wq, modrm_mod) +DEF_TRANSLATE_INSN4(Vq, Vq, Wq, Ib) #define DEF_TRANSLATE_INSN5(opT1, opT2, opT3, opT4, opT5) \ static void translate_insn5(opT1, opT2, opT3, opT4, opT5)( \ From patchwork Wed Aug 21 17:29:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Bobek X-Patchwork-Id: 11107957 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C182C1395 for ; Wed, 21 Aug 2019 18:34:25 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 88898216F4 for ; Wed, 21 Aug 2019 18:34:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="XzsBqYpX" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 88898216F4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:51796 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0VRA-0006wA-8m for patchwork-qemu-devel@patchwork.kernel.org; Wed, 21 Aug 2019 14:34:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41510) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0URv-0001ns-Mx for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:31:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i0URm-0008Ks-FK for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:31:07 -0400 Received: from mail-yb1-xb43.google.com ([2607:f8b0:4864:20::b43]:46163) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i0URi-0007vD-Kk for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:56 -0400 Received: by mail-yb1-xb43.google.com with SMTP id x10so1325687ybs.13 for ; Wed, 21 Aug 2019 10:30:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=pU4OjXMQdfhpu4voemk/g2dOGLQZu6Z3EM3QJS/y5Hk=; b=XzsBqYpXhI4blTRF6DoUtl6ZqPW27AuRBHgg4vanGvR9eDQH7yOc3fp/9Ghb432OCV r8kgt9MwnNlWQdwG37acuEm3O2EqNDuw/Tol1W8revGD1NEttQRZMqWdbhGGFni0aCZi vxHcxxYWEL+sP9RadLmW4Fwh384iPaKJexWfIzUro0YKDr/c4I+ep/JGhvbSXOsoY/x5 n1MUKS/e24AkGyplz3eIqHNa2rcSh3ofWjqurB/VD22S7GleXjf/WdCzaQv/WouZLWaE 1DexHLsMULwQfcDySdapkIshjXuyaaz5f6GTgzW2KqE2AB/upOMveTZvjHz4F1zk8Rya bUUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=pU4OjXMQdfhpu4voemk/g2dOGLQZu6Z3EM3QJS/y5Hk=; b=mpLEjwVKWt+nHKEAGOz6dKU5hfhdtbv59yilzA0obakHa5fsPLuq9Mtilhv8QLklzk ty/ol4BJJksQpzzsoCKOsjFSZ1n0GQHLvjigBEk+k4M+gc67TZLflYdb3FaDM6ng9kTT KZV4YeIl1ZF3D5N0CAn3n8QL6umuL62yJzLGIoAZbnG+8W1lwSf8fcnXQPrw/SgSq5OL 8YgF9Em1wuPrVOdw74hmYkw0ot1pIsdeb9CnVGwT7Qw3VqoQ44XU5PG6Cx4y29AZ7rOf rjYAAZ5+ADSCvr6huQsGrOrtP7YaoHLiBb0VtZUTSROACGOy6mICnuqQz8eWduiANq51 qUqQ== X-Gm-Message-State: APjAAAWdzaIjWwoy2fCQNhVZODVeQJHa5AcgZRRH4v7n24IIEPYZaBiB 8izVVLF+KbZLjR2bKJkzPQfAg5IX X-Google-Smtp-Source: APXvYqz6Ollxe0RId96LARzICEKPANZRL4e+IS8Wl1wNvUpW/uE4lVJ9sKdezpfpEFhnXvFyhHvGiQ== X-Received: by 2002:a5b:cc2:: with SMTP id e2mr23826057ybr.288.1566408642934; Wed, 21 Aug 2019 10:30:42 -0700 (PDT) Received: from localhost.localdomain ([2601:c0:c67f:e390::3]) by smtp.gmail.com with ESMTPSA id l71sm2826167ywl.39.2019.08.21.10.30.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Aug 2019 10:30:42 -0700 (PDT) From: Jan Bobek To: qemu-devel@nongnu.org Date: Wed, 21 Aug 2019 13:29:19 -0400 Message-Id: <20190821172951.15333-44-jan.bobek@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190821172951.15333-1-jan.bobek@gmail.com> References: <20190821172951.15333-1-jan.bobek@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::b43 Subject: [Qemu-devel] [RFC PATCH v4 43/75] target/i386: introduce SSE2 code generators X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jan Bobek , =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Introduce code generators required by SSE2 instructions. Signed-off-by: Jan Bobek --- target/i386/translate.c | 427 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 425 insertions(+), 2 deletions(-) diff --git a/target/i386/translate.c b/target/i386/translate.c index 43917edc76..3445b4cff1 100644 --- a/target/i386/translate.c +++ b/target/i386/translate.c @@ -5563,6 +5563,7 @@ INSNOP_LDST(xmm, Mhq) } GEN_INSN2(movq, Pq, Eq); /* forward declaration */ +GEN_INSN2(movq, Vdq, Eq); /* forward declaration */ GEN_INSN2(movd, Pq, Ed) { const insnop_arg_t(Eq) arg2_r64 = tcg_temp_new_i64(); @@ -5574,6 +5575,17 @@ GEN_INSN2(movd, Ed, Pq) { tcg_gen_ld_i32(arg1, cpu_env, arg2 + offsetof(MMXReg, MMX_L(0))); } +GEN_INSN2(movd, Vdq, Ed) +{ + const insnop_arg_t(Eq) arg2_r64 = tcg_temp_new_i64(); + tcg_gen_extu_i32_i64(arg2_r64, arg2); + gen_insn2(movq, Vdq, Eq)(env, s, arg1, arg2_r64); + tcg_temp_free_i64(arg2_r64); +} +GEN_INSN2(movd, Ed, Vdq) +{ + tcg_gen_ld_i32(arg1, cpu_env, arg2 + offsetof(ZMMReg, ZMM_L(0))); +} GEN_INSN2(movq, Pq, Eq) { @@ -5583,13 +5595,45 @@ GEN_INSN2(movq, Eq, Pq) { tcg_gen_ld_i64(arg1, cpu_env, arg2 + offsetof(MMXReg, MMX_Q(0))); } +GEN_INSN2(movq, Vdq, Eq) +{ + const TCGv_i64 r64 = tcg_temp_new_i64(); + tcg_gen_st_i64(arg2, cpu_env, arg1 + offsetof(ZMMReg, ZMM_Q(0))); + tcg_gen_movi_i64(r64, 0); + tcg_gen_st_i64(r64, cpu_env, arg1 + offsetof(ZMMReg, ZMM_Q(1))); + tcg_temp_free_i64(r64); +} +GEN_INSN2(movq, Eq, Vdq) +{ + tcg_gen_ld_i64(arg1, cpu_env, arg2 + offsetof(ZMMReg, ZMM_Q(0))); +} DEF_GEN_INSN2_GVEC(movq, Pq, Qq, mov, MM_OPRSZ, MM_MAXSZ, MO_64) DEF_GEN_INSN2_GVEC(movq, Qq, Pq, mov, MM_OPRSZ, MM_MAXSZ, MO_64) +GEN_INSN2(movq, Vdq, Wq) +{ + const TCGv_i64 r64 = tcg_temp_new_i64(); + tcg_gen_ld_i64(r64, cpu_env, arg2 + offsetof(ZMMReg, ZMM_Q(0))); + gen_insn2(movq, Vdq, Eq)(env, s, arg1, r64); + tcg_temp_free_i64(r64); +} +GEN_INSN2(movq, UdqMq, Vq) +{ + gen_insn2(movq, Vdq, Wq)(env, s, arg1, arg2); +} + DEF_GEN_INSN2_GVEC(movaps, Vdq, Wdq, mov, XMM_OPRSZ, XMM_MAXSZ, MO_64) DEF_GEN_INSN2_GVEC(movaps, Wdq, Vdq, mov, XMM_OPRSZ, XMM_MAXSZ, MO_64) +DEF_GEN_INSN2_GVEC(movapd, Vdq, Wdq, mov, XMM_OPRSZ, XMM_MAXSZ, MO_64) +DEF_GEN_INSN2_GVEC(movapd, Wdq, Vdq, mov, XMM_OPRSZ, XMM_MAXSZ, MO_64) +DEF_GEN_INSN2_GVEC(movdqa, Vdq, Wdq, mov, XMM_OPRSZ, XMM_MAXSZ, MO_64) +DEF_GEN_INSN2_GVEC(movdqa, Wdq, Vdq, mov, XMM_OPRSZ, XMM_MAXSZ, MO_64) DEF_GEN_INSN2_GVEC(movups, Vdq, Wdq, mov, XMM_OPRSZ, XMM_MAXSZ, MO_64) DEF_GEN_INSN2_GVEC(movups, Wdq, Vdq, mov, XMM_OPRSZ, XMM_MAXSZ, MO_64) +DEF_GEN_INSN2_GVEC(movupd, Vdq, Wdq, mov, XMM_OPRSZ, XMM_MAXSZ, MO_64) +DEF_GEN_INSN2_GVEC(movupd, Wdq, Vdq, mov, XMM_OPRSZ, XMM_MAXSZ, MO_64) +DEF_GEN_INSN2_GVEC(movdqu, Vdq, Wdq, mov, XMM_OPRSZ, XMM_MAXSZ, MO_64) +DEF_GEN_INSN2_GVEC(movdqu, Wdq, Vdq, mov, XMM_OPRSZ, XMM_MAXSZ, MO_64) GEN_INSN4(movss, Vdq, Vdq, Wd, modrm_mod) { @@ -5621,6 +5665,46 @@ GEN_INSN2(movss, Wd, Vd) gen_insn4(movss, Vdq, Vdq, Wd, modrm_mod)(env, s, arg1, arg1, arg2, 3); } +GEN_INSN4(movsd, Vdq, Vdq, Wq, modrm_mod) +{ + const TCGv_i64 r64 = tcg_temp_new_i64(); + tcg_gen_ld_i64(r64, cpu_env, arg3 + offsetof(ZMMReg, ZMM_Q(0))); + tcg_gen_st_i64(r64, cpu_env, arg1 + offsetof(ZMMReg, ZMM_Q(0))); + if (arg4 == 3) { + /* merging movsd */ + if (arg1 != arg2) { + tcg_gen_ld_i64(r64, cpu_env, arg2 + offsetof(ZMMReg, ZMM_Q(1))); + tcg_gen_st_i64(r64, cpu_env, arg1 + offsetof(ZMMReg, ZMM_Q(1))); + } + } else { + /* zero-extending movsd */ + tcg_gen_movi_i64(r64, 0); + tcg_gen_st_i64(r64, cpu_env, arg1 + offsetof(ZMMReg, ZMM_Q(1))); + } + tcg_temp_free_i64(r64); +} +GEN_INSN2(movsd, Wq, Vq) +{ + gen_insn4(movsd, Vdq, Vdq, Wq, modrm_mod)(env, s, arg1, arg1, arg2, 3); +} + +GEN_INSN2(movq2dq, Vdq, Nq) +{ + const insnop_arg_t(Vdq) dofs = offsetof(ZMMReg, ZMM_Q(0)); + const insnop_arg_t(Nq) aofs = offsetof(MMXReg, MMX_Q(0)); + gen_op_movq(s, arg1 + dofs, arg2 + aofs); + + const TCGv_i64 r64z = tcg_const_i64(0); + tcg_gen_st_i64(r64z, cpu_env, arg1 + offsetof(ZMMReg, ZMM_Q(1))); + tcg_temp_free_i64(r64z); +} +GEN_INSN2(movdq2q, Pq, Uq) +{ + const insnop_arg_t(Pq) dofs = offsetof(MMXReg, MMX_Q(0)); + const insnop_arg_t(Uq) aofs = offsetof(ZMMReg, ZMM_Q(0)); + gen_op_movq(s, arg1 + dofs, arg2 + aofs); +} + GEN_INSN3(movhlps, Vdq, Vdq, UdqMhq) { const TCGv_i64 r64 = tcg_temp_new_i64(); @@ -5637,6 +5721,21 @@ GEN_INSN2(movlps, Mq, Vq) insnop_ldst(xmm, Mq)(env, s, 1, arg2, arg1); } +GEN_INSN3(movlpd, Vdq, Vdq, Mq) +{ + insnop_ldst(xmm, Mq)(env, s, 0, arg1, arg3); + if (arg1 != arg2) { + const TCGv_i64 r64 = tcg_temp_new_i64(); + tcg_gen_ld_i64(r64, cpu_env, arg2 + offsetof(ZMMReg, ZMM_Q(1))); + tcg_gen_st_i64(r64, cpu_env, arg1 + offsetof(ZMMReg, ZMM_Q(1))); + tcg_temp_free_i64(r64); + } +} +GEN_INSN2(movlpd, Mq, Vq) +{ + insnop_ldst(xmm, Mq)(env, s, 1, arg2, arg1); +} + GEN_INSN3(movlhps, Vdq, Vq, Wq) { const TCGv_i64 r64 = tcg_temp_new_i64(); @@ -5653,6 +5752,21 @@ GEN_INSN2(movhps, Mq, Vdq) insnop_ldst(xmm, Mhq)(env, s, 1, arg2, arg1); } +GEN_INSN3(movhpd, Vdq, Vq, Mq) +{ + if (arg1 != arg2) { + const TCGv_i64 r64 = tcg_temp_new_i64(); + tcg_gen_ld_i64(r64, cpu_env, arg2 + offsetof(ZMMReg, ZMM_Q(0))); + tcg_gen_st_i64(r64, cpu_env, arg1 + offsetof(ZMMReg, ZMM_Q(0))); + tcg_temp_free_i64(r64); + } + insnop_ldst(xmm, Mhq)(env, s, 0, arg1, arg3); +} +GEN_INSN2(movhpd, Mq, Vdq) +{ + insnop_ldst(xmm, Mhq)(env, s, 1, arg2, arg1); +} + DEF_GEN_INSN2_HELPER_DEP(pmovmskb, pmovmskb_mmx, Gd, Nq) GEN_INSN2(pmovmskb, Gq, Nq) { @@ -5661,6 +5775,14 @@ GEN_INSN2(pmovmskb, Gq, Nq) tcg_gen_extu_i32_i64(arg1, arg1_r32); tcg_temp_free_i32(arg1_r32); } +DEF_GEN_INSN2_HELPER_DEP(pmovmskb, pmovmskb_xmm, Gd, Udq) +GEN_INSN2(pmovmskb, Gq, Udq) +{ + const TCGv_i32 arg1_r32 = tcg_temp_new_i32(); + gen_insn2(pmovmskb, Gd, Udq)(env, s, arg1_r32, arg2); + tcg_gen_extu_i32_i64(arg1, arg1_r32); + tcg_temp_free_i32(arg1_r32); +} DEF_GEN_INSN2_HELPER_DEP(movmskps, movmskps, Gd, Udq) GEN_INSN2(movmskps, Gq, Udq) @@ -5671,78 +5793,154 @@ GEN_INSN2(movmskps, Gq, Udq) tcg_temp_free_i32(arg1_r32); } +DEF_GEN_INSN2_HELPER_DEP(movmskpd, movmskpd, Gd, Udq) +GEN_INSN2(movmskpd, Gq, Udq) +{ + const TCGv_i32 arg1_r32 = tcg_temp_new_i32(); + gen_insn2(movmskpd, Gd, Udq)(env, s, arg1_r32, arg2); + tcg_gen_extu_i32_i64(arg1, arg1_r32); + tcg_temp_free_i32(arg1_r32); +} + DEF_GEN_INSN3_GVEC(paddb, Pq, Pq, Qq, add, MM_OPRSZ, MM_MAXSZ, MO_8) +DEF_GEN_INSN3_GVEC(paddb, Vdq, Vdq, Wdq, add, XMM_OPRSZ, XMM_MAXSZ, MO_8) DEF_GEN_INSN3_GVEC(paddw, Pq, Pq, Qq, add, MM_OPRSZ, MM_MAXSZ, MO_16) +DEF_GEN_INSN3_GVEC(paddw, Vdq, Vdq, Wdq, add, XMM_OPRSZ, XMM_MAXSZ, MO_16) DEF_GEN_INSN3_GVEC(paddd, Pq, Pq, Qq, add, MM_OPRSZ, MM_MAXSZ, MO_32) +DEF_GEN_INSN3_GVEC(paddd, Vdq, Vdq, Wdq, add, XMM_OPRSZ, XMM_MAXSZ, MO_32) +DEF_GEN_INSN3_GVEC(paddq, Pq, Pq, Qq, add, MM_OPRSZ, MM_MAXSZ, MO_64) +DEF_GEN_INSN3_GVEC(paddq, Vdq, Vdq, Wdq, add, XMM_OPRSZ, XMM_MAXSZ, MO_64) DEF_GEN_INSN3_GVEC(paddsb, Pq, Pq, Qq, ssadd, MM_OPRSZ, MM_MAXSZ, MO_8) +DEF_GEN_INSN3_GVEC(paddsb, Vdq, Vdq, Wdq, ssadd, XMM_OPRSZ, XMM_MAXSZ, MO_8) DEF_GEN_INSN3_GVEC(paddsw, Pq, Pq, Qq, ssadd, MM_OPRSZ, MM_MAXSZ, MO_16) +DEF_GEN_INSN3_GVEC(paddsw, Vdq, Vdq, Wdq, ssadd, XMM_OPRSZ, XMM_MAXSZ, MO_16) DEF_GEN_INSN3_GVEC(paddusb, Pq, Pq, Qq, usadd, MM_OPRSZ, MM_MAXSZ, MO_8) +DEF_GEN_INSN3_GVEC(paddusb, Vdq, Vdq, Wdq, usadd, XMM_OPRSZ, XMM_MAXSZ, MO_8) DEF_GEN_INSN3_GVEC(paddusw, Pq, Pq, Qq, usadd, MM_OPRSZ, MM_MAXSZ, MO_16) +DEF_GEN_INSN3_GVEC(paddusw, Vdq, Vdq, Wdq, usadd, XMM_OPRSZ, XMM_MAXSZ, MO_16) DEF_GEN_INSN3_HELPER_EPP(addps, addps, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(addpd, addpd, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(addss, addss, Vd, Vd, Wd) +DEF_GEN_INSN3_HELPER_EPP(addsd, addsd, Vq, Vq, Wq) DEF_GEN_INSN3_GVEC(psubb, Pq, Pq, Qq, sub, MM_OPRSZ, MM_MAXSZ, MO_8) +DEF_GEN_INSN3_GVEC(psubb, Vdq, Vdq, Wdq, sub, XMM_OPRSZ, XMM_MAXSZ, MO_8) DEF_GEN_INSN3_GVEC(psubw, Pq, Pq, Qq, sub, MM_OPRSZ, MM_MAXSZ, MO_16) +DEF_GEN_INSN3_GVEC(psubw, Vdq, Vdq, Wdq, sub, XMM_OPRSZ, XMM_MAXSZ, MO_16) DEF_GEN_INSN3_GVEC(psubd, Pq, Pq, Qq, sub, MM_OPRSZ, MM_MAXSZ, MO_32) +DEF_GEN_INSN3_GVEC(psubd, Vdq, Vdq, Wdq, sub, XMM_OPRSZ, XMM_MAXSZ, MO_32) +DEF_GEN_INSN3_GVEC(psubq, Pq, Pq, Qq, sub, MM_OPRSZ, MM_MAXSZ, MO_64) +DEF_GEN_INSN3_GVEC(psubq, Vdq, Vdq, Wdq, sub, XMM_OPRSZ, XMM_MAXSZ, MO_64) DEF_GEN_INSN3_GVEC(psubsb, Pq, Pq, Qq, sssub, MM_OPRSZ, MM_MAXSZ, MO_8) +DEF_GEN_INSN3_GVEC(psubsb, Vdq, Vdq, Wdq, sssub, XMM_OPRSZ, XMM_MAXSZ, MO_8) DEF_GEN_INSN3_GVEC(psubsw, Pq, Pq, Qq, sssub, MM_OPRSZ, MM_MAXSZ, MO_16) +DEF_GEN_INSN3_GVEC(psubsw, Vdq, Vdq, Wdq, sssub, XMM_OPRSZ, XMM_MAXSZ, MO_16) DEF_GEN_INSN3_GVEC(psubusb, Pq, Pq, Qq, ussub, MM_OPRSZ, MM_MAXSZ, MO_8) +DEF_GEN_INSN3_GVEC(psubusb, Vdq, Vdq, Wdq, ussub, XMM_OPRSZ, XMM_MAXSZ, MO_8) DEF_GEN_INSN3_GVEC(psubusw, Pq, Pq, Qq, ussub, MM_OPRSZ, MM_MAXSZ, MO_16) +DEF_GEN_INSN3_GVEC(psubusw, Vdq, Vdq, Wdq, ussub, XMM_OPRSZ, XMM_MAXSZ, MO_16) DEF_GEN_INSN3_HELPER_EPP(subps, subps, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(subpd, subpd, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(subss, subss, Vd, Vd, Wd) +DEF_GEN_INSN3_HELPER_EPP(subsd, subsd, Vq, Vq, Wq) DEF_GEN_INSN3_HELPER_EPP(pmullw, pmullw_mmx, Pq, Pq, Qq) +DEF_GEN_INSN3_HELPER_EPP(pmullw, pmullw_xmm, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(pmulhw, pmulhw_mmx, Pq, Pq, Qq) +DEF_GEN_INSN3_HELPER_EPP(pmulhw, pmulhw_xmm, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(pmulhuw, pmulhuw_mmx, Pq, Pq, Qq) +DEF_GEN_INSN3_HELPER_EPP(pmulhuw, pmulhuw_xmm, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(pmuludq, pmuludq_mmx, Pq, Pq, Qq) +DEF_GEN_INSN3_HELPER_EPP(pmuludq, pmuludq_xmm, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(mulps, mulps, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(mulpd, mulpd, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(mulss, mulss, Vd, Vd, Wd) +DEF_GEN_INSN3_HELPER_EPP(mulsd, mulsd, Vq, Vq, Wq) DEF_GEN_INSN3_HELPER_EPP(pmaddwd, pmaddwd_mmx, Pq, Pq, Qq) +DEF_GEN_INSN3_HELPER_EPP(pmaddwd, pmaddwd_xmm, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(divps, divps, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(divpd, divpd, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(divss, divss, Vd, Vd, Wd) +DEF_GEN_INSN3_HELPER_EPP(divsd, divsd, Vq, Vq, Wq) DEF_GEN_INSN2_HELPER_EPP(rcpps, rcpps, Vdq, Wdq) DEF_GEN_INSN2_HELPER_EPP(rcpss, rcpss, Vd, Wd) DEF_GEN_INSN2_HELPER_EPP(sqrtps, sqrtps, Vdq, Wdq) +DEF_GEN_INSN2_HELPER_EPP(sqrtpd, sqrtpd, Vdq, Wdq) DEF_GEN_INSN2_HELPER_EPP(sqrtss, sqrtss, Vd, Wd) +DEF_GEN_INSN2_HELPER_EPP(sqrtsd, sqrtsd, Vq, Wq) DEF_GEN_INSN2_HELPER_EPP(rsqrtps, rsqrtps, Vdq, Wdq) DEF_GEN_INSN2_HELPER_EPP(rsqrtss, rsqrtss, Vd, Wd) DEF_GEN_INSN3_GVEC(pminub, Pq, Pq, Qq, umin, MM_OPRSZ, MM_MAXSZ, MO_8) +DEF_GEN_INSN3_GVEC(pminub, Vdq, Vdq, Wdq, umin, XMM_OPRSZ, XMM_MAXSZ, MO_8) DEF_GEN_INSN3_GVEC(pminsw, Pq, Pq, Qq, smin, MM_OPRSZ, MM_MAXSZ, MO_16) +DEF_GEN_INSN3_GVEC(pminsw, Vdq, Vdq, Wdq, smin, XMM_OPRSZ, XMM_MAXSZ, MO_16) DEF_GEN_INSN3_HELPER_EPP(minps, minps, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(minpd, minpd, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(minss, minss, Vd, Vd, Wd) +DEF_GEN_INSN3_HELPER_EPP(minsd, minsd, Vq, Vq, Wq) DEF_GEN_INSN3_GVEC(pmaxub, Pq, Pq, Qq, umax, MM_OPRSZ, MM_MAXSZ, MO_8) +DEF_GEN_INSN3_GVEC(pmaxub, Vdq, Vdq, Wdq, umax, XMM_OPRSZ, XMM_MAXSZ, MO_8) DEF_GEN_INSN3_GVEC(pmaxsw, Pq, Pq, Qq, smax, MM_OPRSZ, MM_MAXSZ, MO_16) +DEF_GEN_INSN3_GVEC(pmaxsw, Vdq, Vdq, Wdq, smax, XMM_OPRSZ, XMM_MAXSZ, MO_16) DEF_GEN_INSN3_HELPER_EPP(maxps, maxps, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(maxpd, maxpd, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(maxss, maxss, Vd, Vd, Wd) +DEF_GEN_INSN3_HELPER_EPP(maxsd, maxsd, Vq, Vq, Wq) DEF_GEN_INSN3_HELPER_EPP(pavgb, pavgb_mmx, Pq, Pq, Qq) +DEF_GEN_INSN3_HELPER_EPP(pavgb, pavgb_xmm, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(pavgw, pavgw_mmx, Pq, Pq, Qq) +DEF_GEN_INSN3_HELPER_EPP(pavgw, pavgw_xmm, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(psadbw, psadbw_mmx, Pq, Pq, Qq) +DEF_GEN_INSN3_HELPER_EPP(psadbw, psadbw_xmm, Vdq, Vdq, Wdq) DEF_GEN_INSN3_GVEC(pcmpeqb, Pq, Pq, Qq, cmp, MM_OPRSZ, MM_MAXSZ, MO_8, TCG_COND_EQ) +DEF_GEN_INSN3_GVEC(pcmpeqb, Vdq, Vdq, Wdq, cmp, XMM_OPRSZ, XMM_MAXSZ, MO_8, TCG_COND_EQ) DEF_GEN_INSN3_GVEC(pcmpeqw, Pq, Pq, Qq, cmp, MM_OPRSZ, MM_MAXSZ, MO_16, TCG_COND_EQ) +DEF_GEN_INSN3_GVEC(pcmpeqw, Vdq, Vdq, Wdq, cmp, XMM_OPRSZ, XMM_MAXSZ, MO_16, TCG_COND_EQ) DEF_GEN_INSN3_GVEC(pcmpeqd, Pq, Pq, Qq, cmp, MM_OPRSZ, MM_MAXSZ, MO_32, TCG_COND_EQ) +DEF_GEN_INSN3_GVEC(pcmpeqd, Vdq, Vdq, Wdq, cmp, XMM_OPRSZ, XMM_MAXSZ, MO_32, TCG_COND_EQ) DEF_GEN_INSN3_GVEC(pcmpgtb, Pq, Pq, Qq, cmp, MM_OPRSZ, MM_MAXSZ, MO_8, TCG_COND_GT) +DEF_GEN_INSN3_GVEC(pcmpgtb, Vdq, Vdq, Wdq, cmp, XMM_OPRSZ, XMM_MAXSZ, MO_8, TCG_COND_GT) DEF_GEN_INSN3_GVEC(pcmpgtw, Pq, Pq, Qq, cmp, MM_OPRSZ, MM_MAXSZ, MO_16, TCG_COND_GT) +DEF_GEN_INSN3_GVEC(pcmpgtw, Vdq, Vdq, Wdq, cmp, XMM_OPRSZ, XMM_MAXSZ, MO_16, TCG_COND_GT) DEF_GEN_INSN3_GVEC(pcmpgtd, Pq, Pq, Qq, cmp, MM_OPRSZ, MM_MAXSZ, MO_32, TCG_COND_GT) +DEF_GEN_INSN3_GVEC(pcmpgtd, Vdq, Vdq, Wdq, cmp, XMM_OPRSZ, XMM_MAXSZ, MO_32, TCG_COND_GT) DEF_GEN_INSN3_HELPER_EPP(cmpeqps, cmpeqps, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(cmpeqpd, cmpeqpd, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(cmpeqss, cmpeqss, Vd, Vd, Wd) +DEF_GEN_INSN3_HELPER_EPP(cmpeqsd, cmpeqsd, Vq, Vq, Wq) DEF_GEN_INSN3_HELPER_EPP(cmpltps, cmpltps, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(cmpltpd, cmpltpd, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(cmpltss, cmpltss, Vd, Vd, Wd) +DEF_GEN_INSN3_HELPER_EPP(cmpltsd, cmpltsd, Vq, Vq, Wq) DEF_GEN_INSN3_HELPER_EPP(cmpleps, cmpleps, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(cmplepd, cmplepd, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(cmpless, cmpless, Vd, Vd, Wd) +DEF_GEN_INSN3_HELPER_EPP(cmplesd, cmplesd, Vq, Vq, Wq) DEF_GEN_INSN3_HELPER_EPP(cmpunordps, cmpunordps, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(cmpunordpd, cmpunordpd, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(cmpunordss, cmpunordss, Vd, Vd, Wd) +DEF_GEN_INSN3_HELPER_EPP(cmpunordsd, cmpunordsd, Vq, Vq, Wq) DEF_GEN_INSN3_HELPER_EPP(cmpneqps, cmpneqps, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(cmpneqpd, cmpneqpd, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(cmpneqss, cmpneqss, Vd, Vd, Wd) +DEF_GEN_INSN3_HELPER_EPP(cmpneqsd, cmpneqsd, Vq, Vq, Wq) DEF_GEN_INSN3_HELPER_EPP(cmpnltps, cmpnltps, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(cmpnltpd, cmpnltpd, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(cmpnltss, cmpnltss, Vd, Vd, Wd) +DEF_GEN_INSN3_HELPER_EPP(cmpnltsd, cmpnltsd, Vq, Vq, Wq) DEF_GEN_INSN3_HELPER_EPP(cmpnleps, cmpnleps, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(cmpnlepd, cmpnlepd, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(cmpnless, cmpnless, Vd, Vd, Wd) +DEF_GEN_INSN3_HELPER_EPP(cmpnlesd, cmpnlesd, Vq, Vq, Wq) DEF_GEN_INSN3_HELPER_EPP(cmpordps, cmpordps, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(cmpordpd, cmpordpd, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(cmpordss, cmpordss, Vd, Vd, Wd) +DEF_GEN_INSN3_HELPER_EPP(cmpordsd, cmpordsd, Vq, Vq, Wq) GEN_INSN4(cmpps, Vdq, Vdq, Wdq, Ib) { @@ -5776,6 +5974,38 @@ GEN_INSN4(cmpps, Vdq, Vdq, Wdq, Ib) g_assert_not_reached(); } +GEN_INSN4(cmppd, Vdq, Vdq, Wdq, Ib) +{ + switch (arg4 & 7) { + case 0: + gen_insn3(cmpeqpd, Vdq, Vdq, Wdq)(env, s, arg1, arg2, arg3); + return; + case 1: + gen_insn3(cmpltpd, Vdq, Vdq, Wdq)(env, s, arg1, arg2, arg3); + return; + case 2: + gen_insn3(cmplepd, Vdq, Vdq, Wdq)(env, s, arg1, arg2, arg3); + return; + case 3: + gen_insn3(cmpunordpd, Vdq, Vdq, Wdq)(env, s, arg1, arg2, arg3); + return; + case 4: + gen_insn3(cmpneqpd, Vdq, Vdq, Wdq)(env, s, arg1, arg2, arg3); + return; + case 5: + gen_insn3(cmpnltpd, Vdq, Vdq, Wdq)(env, s, arg1, arg2, arg3); + return; + case 6: + gen_insn3(cmpnlepd, Vdq, Vdq, Wdq)(env, s, arg1, arg2, arg3); + return; + case 7: + gen_insn3(cmpordpd, Vdq, Vdq, Wdq)(env, s, arg1, arg2, arg3); + return; + } + + g_assert_not_reached(); +} + GEN_INSN4(cmpss, Vd, Vd, Wd, Ib) { switch (arg4 & 7) { @@ -5808,26 +6038,78 @@ GEN_INSN4(cmpss, Vd, Vd, Wd, Ib) g_assert_not_reached(); } +GEN_INSN4(cmpsd, Vq, Vq, Wq, Ib) +{ + switch (arg4 & 7) { + case 0: + gen_insn3(cmpeqsd, Vq, Vq, Wq)(env, s, arg1, arg2, arg3); + return; + case 1: + gen_insn3(cmpltsd, Vq, Vq, Wq)(env, s, arg1, arg2, arg3); + return; + case 2: + gen_insn3(cmplesd, Vq, Vq, Wq)(env, s, arg1, arg2, arg3); + return; + case 3: + gen_insn3(cmpunordsd, Vq, Vq, Wq)(env, s, arg1, arg2, arg3); + return; + case 4: + gen_insn3(cmpneqsd, Vq, Vq, Wq)(env, s, arg1, arg2, arg3); + return; + case 5: + gen_insn3(cmpnltsd, Vq, Vq, Wq)(env, s, arg1, arg2, arg3); + return; + case 6: + gen_insn3(cmpnlesd, Vq, Vq, Wq)(env, s, arg1, arg2, arg3); + return; + case 7: + gen_insn3(cmpordsd, Vq, Vq, Wq)(env, s, arg1, arg2, arg3); + return; + } + + g_assert_not_reached(); +} + DEF_GEN_INSN2_HELPER_EPP(comiss, comiss, Vd, Wd) +DEF_GEN_INSN2_HELPER_EPP(comisd, comisd, Vq, Wq) DEF_GEN_INSN2_HELPER_EPP(ucomiss, ucomiss, Vd, Wd) +DEF_GEN_INSN2_HELPER_EPP(ucomisd, ucomisd, Vq, Wq) DEF_GEN_INSN3_GVEC(pand, Pq, Pq, Qq, and, MM_OPRSZ, MM_MAXSZ, MO_64) +DEF_GEN_INSN3_GVEC(pand, Vdq, Vdq, Wdq, and, XMM_OPRSZ, XMM_MAXSZ, MO_64) DEF_GEN_INSN3_GVEC(andps, Vdq, Vdq, Wdq, and, XMM_OPRSZ, XMM_MAXSZ, MO_64) +DEF_GEN_INSN3_GVEC(andpd, Vdq, Vdq, Wdq, and, XMM_OPRSZ, XMM_MAXSZ, MO_64) DEF_GEN_INSN3_GVEC(pandn, Pq, Pq, Qq, andn, MM_OPRSZ, MM_MAXSZ, MO_64) +DEF_GEN_INSN3_GVEC(pandn, Vdq, Vdq, Wdq, andn, XMM_OPRSZ, XMM_MAXSZ, MO_64) DEF_GEN_INSN3_GVEC(andnps, Vdq, Vdq, Wdq, andn, XMM_OPRSZ, XMM_MAXSZ, MO_64) +DEF_GEN_INSN3_GVEC(andnpd, Vdq, Vdq, Wdq, andn, XMM_OPRSZ, XMM_MAXSZ, MO_64) DEF_GEN_INSN3_GVEC(por, Pq, Pq, Qq, or, MM_OPRSZ, MM_MAXSZ, MO_64) +DEF_GEN_INSN3_GVEC(por, Vdq, Vdq, Wdq, or, XMM_OPRSZ, XMM_MAXSZ, MO_64) DEF_GEN_INSN3_GVEC(orps, Vdq, Vdq, Wdq, or, XMM_OPRSZ, XMM_MAXSZ, MO_64) +DEF_GEN_INSN3_GVEC(orpd, Vdq, Vdq, Wdq, or, XMM_OPRSZ, XMM_MAXSZ, MO_64) DEF_GEN_INSN3_GVEC(pxor, Pq, Pq, Qq, xor, MM_OPRSZ, MM_MAXSZ, MO_64) +DEF_GEN_INSN3_GVEC(pxor, Vdq, Vdq, Wdq, xor, XMM_OPRSZ, XMM_MAXSZ, MO_64) DEF_GEN_INSN3_GVEC(xorps, Vdq, Vdq, Wdq, xor, XMM_OPRSZ, XMM_MAXSZ, MO_64) +DEF_GEN_INSN3_GVEC(xorpd, Vdq, Vdq, Wdq, xor, XMM_OPRSZ, XMM_MAXSZ, MO_64) DEF_GEN_INSN3_HELPER_EPP(psllw, psllw_mmx, Pq, Pq, Qq) +DEF_GEN_INSN3_HELPER_EPP(psllw, psllw_xmm, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(pslld, pslld_mmx, Pq, Pq, Qq) +DEF_GEN_INSN3_HELPER_EPP(pslld, pslld_xmm, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(psllq, psllq_mmx, Pq, Pq, Qq) +DEF_GEN_INSN3_HELPER_EPP(psllq, psllq_xmm, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(pslldq, pslldq_xmm, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(psrlw, psrlw_mmx, Pq, Pq, Qq) +DEF_GEN_INSN3_HELPER_EPP(psrlw, psrlw_xmm, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(psrld, psrld_mmx, Pq, Pq, Qq) +DEF_GEN_INSN3_HELPER_EPP(psrld, psrld_xmm, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(psrlq, psrlq_mmx, Pq, Pq, Qq) +DEF_GEN_INSN3_HELPER_EPP(psrlq, psrlq_xmm, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(psrldq, psrldq_xmm, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(psraw, psraw_mmx, Pq, Pq, Qq) +DEF_GEN_INSN3_HELPER_EPP(psraw, psraw_xmm, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(psrad, psrad_mmx, Pq, Pq, Qq) +DEF_GEN_INSN3_HELPER_EPP(psrad, psrad_xmm, Vdq, Vdq, Wdq) #define DEF_GEN_PSHIFT_IMM_MM(mnem, opT1, opT2) \ GEN_INSN3(mnem, opT1, opT2, Ib) \ @@ -5841,31 +6123,70 @@ DEF_GEN_INSN3_HELPER_EPP(psrad, psrad_mmx, Pq, Pq, Qq) gen_insn2(movq, Pq, Eq)(env, s, arg3_mm, arg3_r64); \ gen_insn3(mnem, Pq, Pq, Qq)(env, s, arg1, arg2, arg3_mm); \ } +#define DEF_GEN_PSHIFT_IMM_XMM(mnem, opT1, opT2) \ + GEN_INSN3(mnem, opT1, opT2, Ib) \ + { \ + const uint64_t arg3_ui64 = (uint8_t)arg3; \ + const insnop_arg_t(Eq) arg3_r64 = s->tmp1_i64; \ + const insnop_arg_t(Wdq) arg3_xmm = \ + offsetof(CPUX86State, xmm_t0.ZMM_Q(0)); \ + \ + tcg_gen_movi_i64(arg3_r64, arg3_ui64); \ + gen_insn2(movq, Vdq, Eq)(env, s, arg3_xmm, arg3_r64); \ + gen_insn3(mnem, Vdq, Vdq, Wdq)(env, s, arg1, arg2, arg3_xmm); \ + } DEF_GEN_PSHIFT_IMM_MM(psllw, Nq, Nq) +DEF_GEN_PSHIFT_IMM_XMM(psllw, Udq, Udq) DEF_GEN_PSHIFT_IMM_MM(pslld, Nq, Nq) +DEF_GEN_PSHIFT_IMM_XMM(pslld, Udq, Udq) DEF_GEN_PSHIFT_IMM_MM(psllq, Nq, Nq) +DEF_GEN_PSHIFT_IMM_XMM(psllq, Udq, Udq) +DEF_GEN_PSHIFT_IMM_XMM(pslldq, Udq, Udq) DEF_GEN_PSHIFT_IMM_MM(psrlw, Nq, Nq) +DEF_GEN_PSHIFT_IMM_XMM(psrlw, Udq, Udq) DEF_GEN_PSHIFT_IMM_MM(psrld, Nq, Nq) +DEF_GEN_PSHIFT_IMM_XMM(psrld, Udq, Udq) DEF_GEN_PSHIFT_IMM_MM(psrlq, Nq, Nq) +DEF_GEN_PSHIFT_IMM_XMM(psrlq, Udq, Udq) +DEF_GEN_PSHIFT_IMM_XMM(psrldq, Udq, Udq) DEF_GEN_PSHIFT_IMM_MM(psraw, Nq, Nq) +DEF_GEN_PSHIFT_IMM_XMM(psraw, Udq, Udq) DEF_GEN_PSHIFT_IMM_MM(psrad, Nq, Nq) +DEF_GEN_PSHIFT_IMM_XMM(psrad, Udq, Udq) DEF_GEN_INSN3_HELPER_EPP(packsswb, packsswb_mmx, Pq, Pq, Qq) +DEF_GEN_INSN3_HELPER_EPP(packsswb, packsswb_xmm, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(packssdw, packssdw_mmx, Pq, Pq, Qq) +DEF_GEN_INSN3_HELPER_EPP(packssdw, packssdw_xmm, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(packuswb, packuswb_mmx, Pq, Pq, Qq) +DEF_GEN_INSN3_HELPER_EPP(packuswb, packuswb_xmm, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(punpcklbw, punpcklbw_mmx, Pq, Pq, Qd) +DEF_GEN_INSN3_HELPER_EPP(punpcklbw, punpcklbw_xmm, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(punpcklwd, punpcklwd_mmx, Pq, Pq, Qd) +DEF_GEN_INSN3_HELPER_EPP(punpcklwd, punpcklwd_xmm, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(punpckldq, punpckldq_mmx, Pq, Pq, Qd) +DEF_GEN_INSN3_HELPER_EPP(punpckldq, punpckldq_xmm, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(punpcklqdq, punpcklqdq_xmm, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(punpckhbw, punpckhbw_mmx, Pq, Pq, Qq) +DEF_GEN_INSN3_HELPER_EPP(punpckhbw, punpckhbw_xmm, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(punpckhwd, punpckhwd_mmx, Pq, Pq, Qq) +DEF_GEN_INSN3_HELPER_EPP(punpckhwd, punpckhwd_xmm, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(punpckhdq, punpckhdq_mmx, Pq, Pq, Qq) +DEF_GEN_INSN3_HELPER_EPP(punpckhdq, punpckhdq_xmm, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(punpckhqdq, punpckhqdq_xmm, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(unpcklps, punpckldq_xmm, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(unpcklpd, punpcklqdq_xmm, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(unpckhps, punpckhdq_xmm, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(unpckhpd, punpckhqdq_xmm, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_PPI(pshufw, pshufw_mmx, Pq, Qq, Ib) +DEF_GEN_INSN3_HELPER_PPI(pshuflw, pshuflw_xmm, Vdq, Wdq, Ib) +DEF_GEN_INSN3_HELPER_PPI(pshufhw, pshufhw_xmm, Vdq, Wdq, Ib) +DEF_GEN_INSN3_HELPER_PPI(pshufd, pshufd_xmm, Vdq, Wdq, Ib) DEF_GEN_INSN4_HELPER_PPI(shufps, shufps, Vdq, Vdq, Wdq, Ib) +DEF_GEN_INSN4_HELPER_PPI(shufpd, shufpd, Vdq, Vdq, Wdq, Ib) GEN_INSN4(pinsrw, Pq, Pq, RdMw, Ib) { @@ -5874,6 +6195,13 @@ GEN_INSN4(pinsrw, Pq, Pq, RdMw, Ib) const size_t ofs = offsetof(MMXReg, MMX_W(arg4 & 3)); tcg_gen_st16_i32(arg3, cpu_env, arg1 + ofs); } +GEN_INSN4(pinsrw, Vdq, Vdq, RdMw, Ib) +{ + assert(arg1 == arg2); + + const size_t ofs = offsetof(ZMMReg, ZMM_W(arg4 & 7)); + tcg_gen_st16_i32(arg3, cpu_env, arg1 + ofs); +} GEN_INSN3(pextrw, Gd, Nq, Ib) { @@ -5885,16 +6213,46 @@ GEN_INSN3(pextrw, Gq, Nq, Ib) const size_t ofs = offsetof(MMXReg, MMX_W(arg3 & 3)); tcg_gen_ld16u_i64(arg1, cpu_env, arg2 + ofs); } +GEN_INSN3(pextrw, Gd, Udq, Ib) +{ + const size_t ofs = offsetof(ZMMReg, ZMM_W(arg3 & 7)); + tcg_gen_ld16u_i32(arg1, cpu_env, arg2 + ofs); +} +GEN_INSN3(pextrw, Gq, Udq, Ib) +{ + const size_t ofs = offsetof(ZMMReg, ZMM_W(arg3 & 7)); + tcg_gen_ld16u_i64(arg1, cpu_env, arg2 + ofs); +} DEF_GEN_INSN2_HELPER_EPP(cvtpi2ps, cvtpi2ps, Vdq, Qq) DEF_GEN_INSN2_HELPER_EPD(cvtsi2ss, cvtsi2ss, Vd, Ed) DEF_GEN_INSN2_HELPER_EPQ(cvtsi2ss, cvtsq2ss, Vd, Eq) +DEF_GEN_INSN2_HELPER_EPP(cvtpi2pd, cvtpi2pd, Vdq, Qq) +DEF_GEN_INSN2_HELPER_EPD(cvtsi2sd, cvtsi2sd, Vq, Ed) +DEF_GEN_INSN2_HELPER_EPQ(cvtsi2sd, cvtsq2sd, Vq, Eq) DEF_GEN_INSN2_HELPER_EPP(cvtps2pi, cvtps2pi, Pq, Wq) DEF_GEN_INSN2_HELPER_DEP(cvtss2si, cvtss2si, Gd, Wd) DEF_GEN_INSN2_HELPER_QEP(cvtss2si, cvtss2sq, Gq, Wd) +DEF_GEN_INSN2_HELPER_EPP(cvtpd2pi, cvtpd2pi, Pq, Wdq) +DEF_GEN_INSN2_HELPER_DEP(cvtsd2si, cvtsd2si, Gd, Wq) +DEF_GEN_INSN2_HELPER_QEP(cvtsd2si, cvtsd2sq, Gq, Wq) DEF_GEN_INSN2_HELPER_EPP(cvttps2pi, cvttps2pi, Pq, Wq) DEF_GEN_INSN2_HELPER_DEP(cvttss2si, cvttss2si, Gd, Wd) DEF_GEN_INSN2_HELPER_QEP(cvttss2si, cvttss2sq, Gq, Wd) +DEF_GEN_INSN2_HELPER_EPP(cvttpd2pi, cvttpd2pi, Pq, Wdq) +DEF_GEN_INSN2_HELPER_DEP(cvttsd2si, cvttsd2si, Gd, Wq) +DEF_GEN_INSN2_HELPER_QEP(cvttsd2si, cvttsd2sq, Gq, Wq) + +DEF_GEN_INSN2_HELPER_EPP(cvtpd2dq, cvtpd2dq, Vdq, Wdq) +DEF_GEN_INSN2_HELPER_EPP(cvttpd2dq, cvttpd2dq, Vdq, Wdq) +DEF_GEN_INSN2_HELPER_EPP(cvtdq2pd, cvtdq2pd, Vdq, Wq) +DEF_GEN_INSN2_HELPER_EPP(cvtps2pd, cvtps2pd, Vdq, Wq) +DEF_GEN_INSN2_HELPER_EPP(cvtpd2ps, cvtpd2ps, Vdq, Wdq) +DEF_GEN_INSN2_HELPER_EPP(cvtss2sd, cvtss2sd, Vq, Wd) +DEF_GEN_INSN2_HELPER_EPP(cvtsd2ss, cvtsd2ss, Vd, Wq) +DEF_GEN_INSN2_HELPER_EPP(cvtdq2ps, cvtdq2ps, Vdq, Wdq) +DEF_GEN_INSN2_HELPER_EPP(cvtps2dq, cvtps2dq, Vdq, Wdq) +DEF_GEN_INSN2_HELPER_EPP(cvttps2dq, cvttps2dq, Vdq, Wdq) GEN_INSN2(maskmovq, Pq, Nq) { @@ -5912,25 +6270,90 @@ GEN_INSN2(maskmovq, Pq, Nq) tcg_temp_free_ptr(arg1_ptr); tcg_temp_free_ptr(arg2_ptr); } +GEN_INSN2(maskmovdqu, Vdq, Udq) +{ + const TCGv_ptr arg1_ptr = tcg_temp_new_ptr(); + const TCGv_ptr arg2_ptr = tcg_temp_new_ptr(); + + tcg_gen_mov_tl(s->A0, cpu_regs[R_EDI]); + gen_extu(s->aflag, s->A0); + gen_add_A0_ds_seg(s); + + tcg_gen_addi_ptr(arg1_ptr, cpu_env, arg1); + tcg_gen_addi_ptr(arg2_ptr, cpu_env, arg2); + gen_helper_maskmov_xmm(cpu_env, arg1_ptr, arg2_ptr, s->A0); + + tcg_temp_free_ptr(arg1_ptr); + tcg_temp_free_ptr(arg2_ptr); +} GEN_INSN2(movntps, Mdq, Vdq) { insnop_ldst(xmm, Mdq)(env, s, 1, arg2, arg1); } +GEN_INSN2(movntpd, Mdq, Vdq) +{ + insnop_ldst(xmm, Mdq)(env, s, 1, arg2, arg1); +} + +GEN_INSN2(movnti, Md, Gd) +{ + insnop_ldst(tcg_i32, Md)(env, s, 1, arg2, arg1); +} +GEN_INSN2(movnti, Mq, Gq) +{ + insnop_ldst(tcg_i64, Mq)(env, s, 1, arg2, arg1); +} GEN_INSN2(movntq, Mq, Pq) { insnop_ldst(mm, Mq)(env, s, 1, arg2, arg1); } +GEN_INSN2(movntdq, Mdq, Vdq) +{ + insnop_ldst(xmm, Mdq)(env, s, 1, arg2, arg1); +} + +GEN_INSN0(pause) +{ + /* handled in disas_insn at the moment */ + g_assert_not_reached(); +} DEF_GEN_INSN0_HELPER(emms, emms) -GEN_INSN0(sfence) +GEN_INSN2(sfence_clflush, modrm_mod, modrm) +{ + if (arg1 == 3) { + /* sfence */ + if (s->prefix & PREFIX_LOCK) { + gen_illegal_opcode(s); + } else { + tcg_gen_mb(TCG_MO_ST_ST | TCG_BAR_SC); + } + } else { + /* clflush */ + if (!check_cpuid(env, s, CHECK_CPUID_CLFLUSH)) { + gen_illegal_opcode(s); + } else { + gen_nop_modrm(env, s, arg2); + } + } +} +GEN_INSN0(lfence) +{ + if (s->prefix & PREFIX_LOCK) { + gen_illegal_opcode(s); + } else { + tcg_gen_mb(TCG_MO_LD_LD | TCG_BAR_SC); + } +} +GEN_INSN0(mfence) { if (s->prefix & PREFIX_LOCK) { gen_illegal_opcode(s); } else { - tcg_gen_mb(TCG_MO_ST_ST | TCG_BAR_SC); + tcg_gen_mb(TCG_MO_ALL | TCG_BAR_SC); } } From patchwork Wed Aug 21 17:29:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Bobek X-Patchwork-Id: 11107839 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6C0761864 for ; Wed, 21 Aug 2019 18:17:12 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 33C2822DD3 for ; Wed, 21 Aug 2019 18:17:12 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="edYt+AvG" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 33C2822DD3 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:51602 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0VAU-0004ZX-U9 for patchwork-qemu-devel@patchwork.kernel.org; Wed, 21 Aug 2019 14:17:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41266) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0URc-0001cC-E5 for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i0URZ-0007x9-4Z for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:48 -0400 Received: from mail-yw1-xc44.google.com ([2607:f8b0:4864:20::c44]:34427) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i0URY-0007wn-Ud for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:45 -0400 Received: by mail-yw1-xc44.google.com with SMTP id n126so1251411ywf.1 for ; Wed, 21 Aug 2019 10:30:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=5ETbzXw0KudTDOiB+1LF035zgw9Ic3L1yVdG3poi8PU=; b=edYt+AvG3QQbfUTqIoKVNOPF7On0H1snmrlUtSJOO6bCr5arnTygaKCAbdhjGDaNvV pI6DIUGbyFFd3xugk2DsMvpfm8IOEjuLiE5MOnEgmSY8DmZyfjLa3QZRhxwprPVw4eIp gaEG3/MRRD4I9zCg2dYn/fWwmGJtXPsN2gAiR4DtutpHZHB8LCt+Z7d53sLgj8jRJ58N 4GPdjS9qVcV8f6b38ZK9nYORZa198CE20QLmYCtPfMDCIe8BvKFmNSibd2LwrCtJbfg9 eL0MdSJXs4iQx0BoPE1lI9VHT9xZLj3K0G1qKf4FMwplgKFEBYaGCcom+BxoEoBG1Jk8 z9oQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=5ETbzXw0KudTDOiB+1LF035zgw9Ic3L1yVdG3poi8PU=; b=SVWU57FoMdKbswb45jUcy3MmhrPe74Cz0vhkqznIvfeMq6iXxzaoMWt0EcLKlvxTKl sUO69633jLcFxUcNCGlWo+Q9iymhldS1VG/XHx7sSWLD8Wh09PPqDyTLb8uRrSQLXrFp cwTzqj/4mq+j3kdcc+l/oA1OyKw8I1zWlwWS8AtPtIdW0snjvpy3Cwj1ynVT3eCt9Ppi 1Thpa5Op8bHgibxVOb5mrZ5xe1CJ9OqRbdl2GrMXhxAuaEpASC/AoE+rBdNWVFa/9LRO RBPmWdzeDa0Ie5UUqNFDop19SFxYHsyMqw37+dtjIKLw786ka/BO982WbeN4zSM3P/L/ iBIw== X-Gm-Message-State: APjAAAXWFhRjR37CF79hrwE8KSn0qOVs61Yeg7PtXLVHEmitPMKSGGQ2 MC6bwvrIrzhqLOnFztVg+OORFwjw X-Google-Smtp-Source: APXvYqzg/EcCAnJ2dNEIhfawokmahD5rHUKrOnmF2yDc2mhwX/RN5kQLa2RM1xoUP8aeMghEgbaOpA== X-Received: by 2002:a81:2e84:: with SMTP id u126mr24492170ywu.398.1566408643768; Wed, 21 Aug 2019 10:30:43 -0700 (PDT) Received: from localhost.localdomain ([2601:c0:c67f:e390::3]) by smtp.gmail.com with ESMTPSA id l71sm2826167ywl.39.2019.08.21.10.30.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Aug 2019 10:30:43 -0700 (PDT) From: Jan Bobek To: qemu-devel@nongnu.org Date: Wed, 21 Aug 2019 13:29:20 -0400 Message-Id: <20190821172951.15333-45-jan.bobek@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190821172951.15333-1-jan.bobek@gmail.com> References: <20190821172951.15333-1-jan.bobek@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::c44 Subject: [Qemu-devel] [RFC PATCH v4 44/75] target/i386: introduce SSE2 vector instructions to sse-opcode.inc.h X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jan Bobek , =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Add all the SSE2 vector instruction entries to sse-opcode.inc.h. Signed-off-by: Jan Bobek --- target/i386/sse-opcode.inc.h | 326 ++++++++++++++++++++++++++++++++++- 1 file changed, 325 insertions(+), 1 deletion(-) diff --git a/target/i386/sse-opcode.inc.h b/target/i386/sse-opcode.inc.h index 92581703cd..6df5fda010 100644 --- a/target/i386/sse-opcode.inc.h +++ b/target/i386/sse-opcode.inc.h @@ -183,127 +183,434 @@ * 0F 18 /2 PREFETCHT1 m8 * 0F 18 /3 PREFETCHT2 m8 * 0F 18 /0 PREFETCHNTA m8 + * + * SSE2 Instructions + * ------------------ + * 66 0F 6E /r MOVD xmm,r/m32 + * 66 0F 7E /r MOVD r/m32,xmm + * 66 REX.W 0F 6E /r MOVQ xmm,r/m64 + * 66 REX.W 0F 7E /r MOVQ r/m64,xmm + * F3 0F 7E /r MOVQ xmm1, xmm2/m64 + * 66 0F D6 /r MOVQ xmm2/m64, xmm1 + * 66 0F 28 /r MOVAPD xmm1, xmm2/m128 + * 66 0F 29 /r MOVAPD xmm2/m128, xmm1 + * 66 0F 6F /r MOVDQA xmm1, xmm2/m128 + * 66 0F 7F /r MOVDQA xmm2/m128, xmm1 + * 66 0F 10 /r MOVUPD xmm1, xmm2/m128 + * 66 0F 11 /r MOVUPD xmm2/m128, xmm1 + * F3 0F 6F /r MOVDQU xmm1,xmm2/m128 + * F3 0F 7F /r MOVDQU xmm2/m128,xmm1 + * F2 0F 10 /r MOVSD xmm1, xmm2/m64 + * F2 0F 11 /r MOVSD xmm1/m64, xmm2 + * F3 0F D6 /r MOVQ2DQ xmm, mm + * F2 0F D6 /r MOVDQ2Q mm, xmm + * 66 0F 12 /r MOVLPD xmm1,m64 + * 66 0F 13 /r MOVLPD m64,xmm1 + * 66 0F 16 /r MOVHPD xmm1, m64 + * 66 0F 17 /r MOVHPD m64, xmm1 + * 66 0F D7 /r PMOVMSKB r32, xmm + * 66 REX.W 0F D7 /r PMOVMSKB r64, xmm + * 66 0F 50 /r MOVMSKPD r32, xmm + * 66 REX.W 0F 50 /r MOVMSKPD r64, xmm + * 66 0F FC /r PADDB xmm1, xmm2/m128 + * 66 0F FD /r PADDW xmm1, xmm2/m128 + * 66 0F FE /r PADDD xmm1, xmm2/m128 + * NP 0F D4 /r PADDQ mm, mm/m64 + * 66 0F D4 /r PADDQ xmm1, xmm2/m128 + * 66 0F EC /r PADDSB xmm1, xmm2/m128 + * 66 0F ED /r PADDSW xmm1, xmm2/m128 + * 66 0F DC /r PADDUSB xmm1,xmm2/m128 + * 66 0F DD /r PADDUSW xmm1,xmm2/m128 + * 66 0F 58 /r ADDPD xmm1, xmm2/m128 + * F2 0F 58 /r ADDSD xmm1, xmm2/m64 + * 66 0F F8 /r PSUBB xmm1, xmm2/m128 + * 66 0F F9 /r PSUBW xmm1, xmm2/m128 + * 66 0F FA /r PSUBD xmm1, xmm2/m128 + * NP 0F FB /r PSUBQ mm1, mm2/m64 + * 66 0F FB /r PSUBQ xmm1, xmm2/m128 + * 66 0F E8 /r PSUBSB xmm1, xmm2/m128 + * 66 0F E9 /r PSUBSW xmm1, xmm2/m128 + * 66 0F D8 /r PSUBUSB xmm1, xmm2/m128 + * 66 0F D9 /r PSUBUSW xmm1, xmm2/m128 + * 66 0F 5C /r SUBPD xmm1, xmm2/m128 + * F2 0F 5C /r SUBSD xmm1, xmm2/m64 + * 66 0F D5 /r PMULLW xmm1, xmm2/m128 + * 66 0F E5 /r PMULHW xmm1, xmm2/m128 + * 66 0F E4 /r PMULHUW xmm1, xmm2/m128 + * NP 0F F4 /r PMULUDQ mm1, mm2/m64 + * 66 0F F4 /r PMULUDQ xmm1, xmm2/m128 + * 66 0F 59 /r MULPD xmm1, xmm2/m128 + * F2 0F 59 /r MULSD xmm1,xmm2/m64 + * 66 0F F5 /r PMADDWD xmm1, xmm2/m128 + * 66 0F 5E /r DIVPD xmm1, xmm2/m128 + * F2 0F 5E /r DIVSD xmm1, xmm2/m64 + * 66 0F 51 /r SQRTPD xmm1, xmm2/m128 + * F2 0F 51 /r SQRTSD xmm1,xmm2/m64 + * 66 0F DA /r PMINUB xmm1, xmm2/m128 + * 66 0F EA /r PMINSW xmm1, xmm2/m128 + * 66 0F 5D /r MINPD xmm1, xmm2/m128 + * F2 0F 5D /r MINSD xmm1, xmm2/m64 + * 66 0F DE /r PMAXUB xmm1, xmm2/m128 + * 66 0F EE /r PMAXSW xmm1, xmm2/m128 + * 66 0F 5F /r MAXPD xmm1, xmm2/m128 + * F2 0F 5F /r MAXSD xmm1, xmm2/m64 + * 66 0F E0 /r PAVGB xmm1, xmm2/m128 + * 66 0F E3 /r PAVGW xmm1, xmm2/m128 + * 66 0F F6 /r PSADBW xmm1, xmm2/m128 + * 66 0F 74 /r PCMPEQB xmm1,xmm2/m128 + * 66 0F 75 /r PCMPEQW xmm1,xmm2/m128 + * 66 0F 76 /r PCMPEQD xmm1,xmm2/m128 + * 66 0F 64 /r PCMPGTB xmm1,xmm2/m128 + * 66 0F 65 /r PCMPGTW xmm1,xmm2/m128 + * 66 0F 66 /r PCMPGTD xmm1,xmm2/m128 + * 66 0F C2 /r ib CMPPD xmm1, xmm2/m128, imm8 + * F2 0F C2 /r ib CMPSD xmm1, xmm2/m64, imm8 + * 66 0F 2E /r UCOMISD xmm1, xmm2/m64 + * 66 0F 2F /r COMISD xmm1, xmm2/m64 + * 66 0F DB /r PAND xmm1, xmm2/m128 + * 66 0F 54 /r ANDPD xmm1, xmm2/m128 + * 66 0F DF /r PANDN xmm1, xmm2/m128 + * 66 0F 55 /r ANDNPD xmm1, xmm2/m128 + * 66 0F EB /r POR xmm1, xmm2/m128 + * 66 0F 56 /r ORPD xmm1, xmm2/m128 + * 66 0F EF /r PXOR xmm1, xmm2/m128 + * 66 0F 57 /r XORPD xmm1, xmm2/m128 + * 66 0F F1 /r PSLLW xmm1, xmm2/m128 + * 66 0F F2 /r PSLLD xmm1, xmm2/m128 + * 66 0F F3 /r PSLLQ xmm1, xmm2/m128 + * 66 0F D1 /r PSRLW xmm1, xmm2/m128 + * 66 0F D2 /r PSRLD xmm1, xmm2/m128 + * 66 0F D3 /r PSRLQ xmm1, xmm2/m128 + * 66 0F E1 /r PSRAW xmm1,xmm2/m128 + * 66 0F E2 /r PSRAD xmm1,xmm2/m128 + * 66 0F 63 /r PACKSSWB xmm1, xmm2/m128 + * 66 0F 6B /r PACKSSDW xmm1, xmm2/m128 + * 66 0F 67 /r PACKUSWB xmm1, xmm2/m128 + * 66 0F 68 /r PUNPCKHBW xmm1, xmm2/m128 + * 66 0F 69 /r PUNPCKHWD xmm1, xmm2/m128 + * 66 0F 6A /r PUNPCKHDQ xmm1, xmm2/m128 + * 66 0F 6D /r PUNPCKHQDQ xmm1, xmm2/m128 + * 66 0F 60 /r PUNPCKLBW xmm1, xmm2/m128 + * 66 0F 61 /r PUNPCKLWD xmm1, xmm2/m128 + * 66 0F 62 /r PUNPCKLDQ xmm1, xmm2/m128 + * 66 0F 6C /r PUNPCKLQDQ xmm1, xmm2/m128 + * 66 0F 14 /r UNPCKLPD xmm1, xmm2/m128 + * 66 0F 15 /r UNPCKHPD xmm1, xmm2/m128 + * F2 0F 70 /r ib PSHUFLW xmm1, xmm2/m128, imm8 + * F3 0F 70 /r ib PSHUFHW xmm1, xmm2/m128, imm8 + * 66 0F 70 /r ib PSHUFD xmm1, xmm2/m128, imm8 + * 66 0F C6 /r ib SHUFPD xmm1, xmm2/m128, imm8 + * 66 0F C4 /r ib PINSRW xmm, r32/m16, imm8 + * 66 0F C5 /r ib PEXTRW r32, xmm, imm8 + * 66 REX.W 0F C5 /r ib PEXTRW r64, xmm, imm8 + * 66 0F 2A /r CVTPI2PD xmm, mm/m64 + * F2 0F 2A /r CVTSI2SD xmm1,r32/m32 + * F2 REX.W 0F 2A /r CVTSI2SD xmm1,r/m64 + * 66 0F 2D /r CVTPD2PI mm, xmm/m128 + * F2 0F 2D /r CVTSD2SI r32,xmm1/m64 + * F2 REX.W 0F 2D /r CVTSD2SI r64,xmm1/m64 + * 66 0F 2C /r CVTTPD2PI mm, xmm/m128 + * F2 0F 2C /r CVTTSD2SI r32,xmm1/m64 + * F2 REX.W 0F 2C /r CVTTSD2SI r64,xmm1/m64 + * F2 0F E6 /r CVTPD2DQ xmm1, xmm2/m128 + * 66 0F E6 /r CVTTPD2DQ xmm1, xmm2/m128 + * F3 0F E6 /r CVTDQ2PD xmm1, xmm2/m64 + * NP 0F 5A /r CVTPS2PD xmm1, xmm2/m64 + * 66 0F 5A /r CVTPD2PS xmm1, xmm2/m128 + * F3 0F 5A /r CVTSS2SD xmm1, xmm2/m32 + * F2 0F 5A /r CVTSD2SS xmm1, xmm2/m64 + * NP 0F 5B /r CVTDQ2PS xmm1, xmm2/m128 + * 66 0F 5B /r CVTPS2DQ xmm1, xmm2/m128 + * F3 0F 5B /r CVTTPS2DQ xmm1, xmm2/m128 + * 66 0F F7 /r MASKMOVDQU xmm1, xmm2 + * 66 0F 2B /r MOVNTPD m128, xmm1 + * NP 0F C3 /r MOVNTI m32, r32 + * NP REX.W + 0F C3 /r MOVNTI m64, r64 + * 66 0F E7 /r MOVNTDQ m128, xmm1 + * F3 90 PAUSE + * 66 0F 71 /6 ib PSLLW xmm1, imm8 + * 66 0F 71 /2 ib PSRLW xmm1, imm8 + * 66 0F 71 /4 ib PSRAW xmm1,imm8 + * 66 0F 72 /6 ib PSLLD xmm1, imm8 + * 66 0F 72 /2 ib PSRLD xmm1, imm8 + * 66 0F 72 /4 ib PSRAD xmm1,imm8 + * 66 0F 73 /6 ib PSLLQ xmm1, imm8 + * 66 0F 73 /7 ib PSLLDQ xmm1, imm8 + * 66 0F 73 /2 ib PSRLQ xmm1, imm8 + * 66 0F 73 /3 ib PSRLDQ xmm1, imm8 + * NP 0F AE /7 CLFLUSH m8 + * NP 0F AE /5 LFENCE + * NP 0F AE /6 MFENCE */ OPCODE(movd, LEG(NP, 0F, 0, 0x6e), MMX, WR, Pq, Ed) OPCODE(movd, LEG(NP, 0F, 0, 0x7e), MMX, WR, Ed, Pq) +OPCODE(movd, LEG(66, 0F, 0, 0x6e), SSE2, WR, Vdq, Ed) +OPCODE(movd, LEG(66, 0F, 0, 0x7e), SSE2, WR, Ed, Vdq) OPCODE(movq, LEG(NP, 0F, 1, 0x6e), MMX, WR, Pq, Eq) OPCODE(movq, LEG(NP, 0F, 1, 0x7e), MMX, WR, Eq, Pq) +OPCODE(movq, LEG(66, 0F, 1, 0x6e), SSE2, WR, Vdq, Eq) +OPCODE(movq, LEG(66, 0F, 1, 0x7e), SSE2, WR, Eq, Vdq) OPCODE(movq, LEG(NP, 0F, 0, 0x6f), MMX, WR, Pq, Qq) OPCODE(movq, LEG(NP, 0F, 0, 0x7f), MMX, WR, Qq, Pq) +OPCODE(movq, LEG(F3, 0F, 0, 0x7e), SSE2, WR, Vdq, Wq) +OPCODE(movq, LEG(66, 0F, 0, 0xd6), SSE2, WR, UdqMq, Vq) OPCODE(movaps, LEG(NP, 0F, 0, 0x28), SSE, WR, Vdq, Wdq) OPCODE(movaps, LEG(NP, 0F, 0, 0x29), SSE, WR, Wdq, Vdq) +OPCODE(movapd, LEG(66, 0F, 0, 0x28), SSE2, WR, Vdq, Wdq) +OPCODE(movapd, LEG(66, 0F, 0, 0x29), SSE2, WR, Wdq, Vdq) +OPCODE(movdqa, LEG(66, 0F, 0, 0x6f), SSE2, WR, Vdq, Wdq) +OPCODE(movdqa, LEG(66, 0F, 0, 0x7f), SSE2, WR, Wdq, Vdq) OPCODE(movups, LEG(NP, 0F, 0, 0x10), SSE, WR, Vdq, Wdq) OPCODE(movups, LEG(NP, 0F, 0, 0x11), SSE, WR, Wdq, Vdq) +OPCODE(movupd, LEG(66, 0F, 0, 0x10), SSE2, WR, Vdq, Wdq) +OPCODE(movupd, LEG(66, 0F, 0, 0x11), SSE2, WR, Wdq, Vdq) +OPCODE(movdqu, LEG(F3, 0F, 0, 0x6f), SSE2, WR, Vdq, Wdq) +OPCODE(movdqu, LEG(F3, 0F, 0, 0x7f), SSE2, WR, Wdq, Vdq) OPCODE(movss, LEG(F3, 0F, 0, 0x10), SSE, WRRR, Vdq, Vdq, Wd, modrm_mod) OPCODE(movss, LEG(F3, 0F, 0, 0x11), SSE, WR, Wd, Vd) +OPCODE(movsd, LEG(F2, 0F, 0, 0x10), SSE2, WRRR, Vdq, Vdq, Wq, modrm_mod) +OPCODE(movsd, LEG(F2, 0F, 0, 0x11), SSE2, WR, Wq, Vq) +OPCODE(movq2dq, LEG(F3, 0F, 0, 0xd6), SSE2, WR, Vdq, Nq) +OPCODE(movdq2q, LEG(F2, 0F, 0, 0xd6), SSE2, WR, Pq, Uq) OPCODE(movhlps, LEG(NP, 0F, 0, 0x12), SSE, WRR, Vdq, Vdq, UdqMhq) OPCODE(movlps, LEG(NP, 0F, 0, 0x13), SSE, WR, Mq, Vq) +OPCODE(movlpd, LEG(66, 0F, 0, 0x12), SSE2, WRR, Vdq, Vdq, Mq) +OPCODE(movlpd, LEG(66, 0F, 0, 0x13), SSE2, WR, Mq, Vq) OPCODE(movlhps, LEG(NP, 0F, 0, 0x16), SSE, WRR, Vdq, Vq, Wq) OPCODE(movhps, LEG(NP, 0F, 0, 0x17), SSE, WR, Mq, Vdq) +OPCODE(movhpd, LEG(66, 0F, 0, 0x16), SSE2, WRR, Vdq, Vq, Mq) +OPCODE(movhpd, LEG(66, 0F, 0, 0x17), SSE2, WR, Mq, Vdq) OPCODE(pmovmskb, LEG(NP, 0F, 0, 0xd7), SSE, WR, Gd, Nq) OPCODE(pmovmskb, LEG(NP, 0F, 1, 0xd7), SSE, WR, Gq, Nq) +OPCODE(pmovmskb, LEG(66, 0F, 0, 0xd7), SSE2, WR, Gd, Udq) +OPCODE(pmovmskb, LEG(66, 0F, 1, 0xd7), SSE2, WR, Gq, Udq) OPCODE(movmskps, LEG(NP, 0F, 0, 0x50), SSE, WR, Gd, Udq) OPCODE(movmskps, LEG(NP, 0F, 1, 0x50), SSE, WR, Gq, Udq) +OPCODE(movmskpd, LEG(66, 0F, 0, 0x50), SSE2, WR, Gd, Udq) +OPCODE(movmskpd, LEG(66, 0F, 1, 0x50), SSE2, WR, Gq, Udq) OPCODE(paddb, LEG(NP, 0F, 0, 0xfc), MMX, WRR, Pq, Pq, Qq) +OPCODE(paddb, LEG(66, 0F, 0, 0xfc), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(paddw, LEG(NP, 0F, 0, 0xfd), MMX, WRR, Pq, Pq, Qq) +OPCODE(paddw, LEG(66, 0F, 0, 0xfd), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(paddd, LEG(NP, 0F, 0, 0xfe), MMX, WRR, Pq, Pq, Qq) +OPCODE(paddd, LEG(66, 0F, 0, 0xfe), SSE2, WRR, Vdq, Vdq, Wdq) +OPCODE(paddq, LEG(NP, 0F, 0, 0xd4), SSE2, WRR, Pq, Pq, Qq) +OPCODE(paddq, LEG(66, 0F, 0, 0xd4), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(paddsb, LEG(NP, 0F, 0, 0xec), MMX, WRR, Pq, Pq, Qq) +OPCODE(paddsb, LEG(66, 0F, 0, 0xec), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(paddsw, LEG(NP, 0F, 0, 0xed), MMX, WRR, Pq, Pq, Qq) +OPCODE(paddsw, LEG(66, 0F, 0, 0xed), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(paddusb, LEG(NP, 0F, 0, 0xdc), MMX, WRR, Pq, Pq, Qq) +OPCODE(paddusb, LEG(66, 0F, 0, 0xdc), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(paddusw, LEG(NP, 0F, 0, 0xdd), MMX, WRR, Pq, Pq, Qq) +OPCODE(paddusw, LEG(66, 0F, 0, 0xdd), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(addps, LEG(NP, 0F, 0, 0x58), SSE, WRR, Vdq, Vdq, Wdq) +OPCODE(addpd, LEG(66, 0F, 0, 0x58), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(addss, LEG(F3, 0F, 0, 0x58), SSE, WRR, Vd, Vd, Wd) +OPCODE(addsd, LEG(F2, 0F, 0, 0x58), SSE2, WRR, Vq, Vq, Wq) OPCODE(psubb, LEG(NP, 0F, 0, 0xf8), MMX, WRR, Pq, Pq, Qq) +OPCODE(psubb, LEG(66, 0F, 0, 0xf8), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(psubw, LEG(NP, 0F, 0, 0xf9), MMX, WRR, Pq, Pq, Qq) +OPCODE(psubw, LEG(66, 0F, 0, 0xf9), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(psubd, LEG(NP, 0F, 0, 0xfa), MMX, WRR, Pq, Pq, Qq) +OPCODE(psubd, LEG(66, 0F, 0, 0xfa), SSE2, WRR, Vdq, Vdq, Wdq) +OPCODE(psubq, LEG(NP, 0F, 0, 0xfb), SSE2, WRR, Pq, Pq, Qq) +OPCODE(psubq, LEG(66, 0F, 0, 0xfb), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(psubsb, LEG(NP, 0F, 0, 0xe8), MMX, WRR, Pq, Pq, Qq) +OPCODE(psubsb, LEG(66, 0F, 0, 0xe8), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(psubsw, LEG(NP, 0F, 0, 0xe9), MMX, WRR, Pq, Pq, Qq) +OPCODE(psubsw, LEG(66, 0F, 0, 0xe9), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(psubusb, LEG(NP, 0F, 0, 0xd8), MMX, WRR, Pq, Pq, Qq) +OPCODE(psubusb, LEG(66, 0F, 0, 0xd8), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(psubusw, LEG(NP, 0F, 0, 0xd9), MMX, WRR, Pq, Pq, Qq) +OPCODE(psubusw, LEG(66, 0F, 0, 0xd9), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(subps, LEG(NP, 0F, 0, 0x5c), SSE, WRR, Vdq, Vdq, Wdq) +OPCODE(subpd, LEG(66, 0F, 0, 0x5c), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(subss, LEG(F3, 0F, 0, 0x5c), SSE, WRR, Vd, Vd, Wd) +OPCODE(subsd, LEG(F2, 0F, 0, 0x5c), SSE2, WRR, Vq, Vq, Wq) OPCODE(pmullw, LEG(NP, 0F, 0, 0xd5), MMX, WRR, Pq, Pq, Qq) +OPCODE(pmullw, LEG(66, 0F, 0, 0xd5), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(pmulhw, LEG(NP, 0F, 0, 0xe5), MMX, WRR, Pq, Pq, Qq) +OPCODE(pmulhw, LEG(66, 0F, 0, 0xe5), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(pmulhuw, LEG(NP, 0F, 0, 0xe4), SSE, WRR, Pq, Pq, Qq) +OPCODE(pmulhuw, LEG(66, 0F, 0, 0xe4), SSE2, WRR, Vdq, Vdq, Wdq) +OPCODE(pmuludq, LEG(NP, 0F, 0, 0xf4), SSE2, WRR, Pq, Pq, Qq) +OPCODE(pmuludq, LEG(66, 0F, 0, 0xf4), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(mulps, LEG(NP, 0F, 0, 0x59), SSE, WRR, Vdq, Vdq, Wdq) +OPCODE(mulpd, LEG(66, 0F, 0, 0x59), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(mulss, LEG(F3, 0F, 0, 0x59), SSE, WRR, Vd, Vd, Wd) +OPCODE(mulsd, LEG(F2, 0F, 0, 0x59), SSE2, WRR, Vq, Vq, Wq) OPCODE(pmaddwd, LEG(NP, 0F, 0, 0xf5), MMX, WRR, Pq, Pq, Qq) +OPCODE(pmaddwd, LEG(66, 0F, 0, 0xf5), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(divps, LEG(NP, 0F, 0, 0x5e), SSE, WRR, Vdq, Vdq, Wdq) +OPCODE(divpd, LEG(66, 0F, 0, 0x5e), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(divss, LEG(F3, 0F, 0, 0x5e), SSE, WRR, Vd, Vd, Wd) +OPCODE(divsd, LEG(F2, 0F, 0, 0x5e), SSE2, WRR, Vq, Vq, Wq) OPCODE(rcpps, LEG(NP, 0F, 0, 0x53), SSE, WR, Vdq, Wdq) OPCODE(rcpss, LEG(F3, 0F, 0, 0x53), SSE, WR, Vd, Wd) OPCODE(sqrtps, LEG(NP, 0F, 0, 0x51), SSE, WR, Vdq, Wdq) +OPCODE(sqrtpd, LEG(66, 0F, 0, 0x51), SSE2, WR, Vdq, Wdq) OPCODE(sqrtss, LEG(F3, 0F, 0, 0x51), SSE, WR, Vd, Wd) +OPCODE(sqrtsd, LEG(F2, 0F, 0, 0x51), SSE2, WR, Vq, Wq) OPCODE(rsqrtps, LEG(NP, 0F, 0, 0x52), SSE, WR, Vdq, Wdq) OPCODE(rsqrtss, LEG(F3, 0F, 0, 0x52), SSE, WR, Vd, Wd) OPCODE(pminub, LEG(NP, 0F, 0, 0xda), SSE, WRR, Pq, Pq, Qq) +OPCODE(pminub, LEG(66, 0F, 0, 0xda), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(pminsw, LEG(NP, 0F, 0, 0xea), SSE, WRR, Pq, Pq, Qq) +OPCODE(pminsw, LEG(66, 0F, 0, 0xea), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(minps, LEG(NP, 0F, 0, 0x5d), SSE, WRR, Vdq, Vdq, Wdq) +OPCODE(minpd, LEG(66, 0F, 0, 0x5d), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(minss, LEG(F3, 0F, 0, 0x5d), SSE, WRR, Vd, Vd, Wd) +OPCODE(minsd, LEG(F2, 0F, 0, 0x5d), SSE2, WRR, Vq, Vq, Wq) OPCODE(pmaxub, LEG(NP, 0F, 0, 0xde), SSE, WRR, Pq, Pq, Qq) +OPCODE(pmaxub, LEG(66, 0F, 0, 0xde), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(pmaxsw, LEG(NP, 0F, 0, 0xee), SSE, WRR, Pq, Pq, Qq) +OPCODE(pmaxsw, LEG(66, 0F, 0, 0xee), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(maxps, LEG(NP, 0F, 0, 0x5f), SSE, WRR, Vdq, Vdq, Wdq) +OPCODE(maxpd, LEG(66, 0F, 0, 0x5f), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(maxss, LEG(F3, 0F, 0, 0x5f), SSE, WRR, Vd, Vd, Wd) +OPCODE(maxsd, LEG(F2, 0F, 0, 0x5f), SSE2, WRR, Vq, Vq, Wq) OPCODE(pavgb, LEG(NP, 0F, 0, 0xe0), SSE, WRR, Pq, Pq, Qq) +OPCODE(pavgb, LEG(66, 0F, 0, 0xe0), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(pavgw, LEG(NP, 0F, 0, 0xe3), SSE, WRR, Pq, Pq, Qq) +OPCODE(pavgw, LEG(66, 0F, 0, 0xe3), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(psadbw, LEG(NP, 0F, 0, 0xf6), SSE, WRR, Pq, Pq, Qq) +OPCODE(psadbw, LEG(66, 0F, 0, 0xf6), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(pcmpeqb, LEG(NP, 0F, 0, 0x74), MMX, WRR, Pq, Pq, Qq) +OPCODE(pcmpeqb, LEG(66, 0F, 0, 0x74), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(pcmpeqw, LEG(NP, 0F, 0, 0x75), MMX, WRR, Pq, Pq, Qq) +OPCODE(pcmpeqw, LEG(66, 0F, 0, 0x75), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(pcmpeqd, LEG(NP, 0F, 0, 0x76), MMX, WRR, Pq, Pq, Qq) +OPCODE(pcmpeqd, LEG(66, 0F, 0, 0x76), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(pcmpgtb, LEG(NP, 0F, 0, 0x64), MMX, WRR, Pq, Pq, Qq) +OPCODE(pcmpgtb, LEG(66, 0F, 0, 0x64), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(pcmpgtw, LEG(NP, 0F, 0, 0x65), MMX, WRR, Pq, Pq, Qq) +OPCODE(pcmpgtw, LEG(66, 0F, 0, 0x65), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(pcmpgtd, LEG(NP, 0F, 0, 0x66), MMX, WRR, Pq, Pq, Qq) +OPCODE(pcmpgtd, LEG(66, 0F, 0, 0x66), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(cmpps, LEG(NP, 0F, 0, 0xc2), SSE, WRRR, Vdq, Vdq, Wdq, Ib) +OPCODE(cmppd, LEG(66, 0F, 0, 0xc2), SSE2, WRRR, Vdq, Vdq, Wdq, Ib) OPCODE(cmpss, LEG(F3, 0F, 0, 0xc2), SSE, WRRR, Vd, Vd, Wd, Ib) +OPCODE(cmpsd, LEG(F2, 0F, 0, 0xc2), SSE2, WRRR, Vq, Vq, Wq, Ib) OPCODE(ucomiss, LEG(NP, 0F, 0, 0x2e), SSE, RR, Vd, Wd) +OPCODE(ucomisd, LEG(66, 0F, 0, 0x2e), SSE2, RR, Vq, Wq) OPCODE(comiss, LEG(NP, 0F, 0, 0x2f), SSE, RR, Vd, Wd) +OPCODE(comisd, LEG(66, 0F, 0, 0x2f), SSE2, RR, Vq, Wq) OPCODE(pand, LEG(NP, 0F, 0, 0xdb), MMX, WRR, Pq, Pq, Qq) +OPCODE(pand, LEG(66, 0F, 0, 0xdb), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(andps, LEG(NP, 0F, 0, 0x54), SSE, WRR, Vdq, Vdq, Wdq) +OPCODE(andpd, LEG(66, 0F, 0, 0x54), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(pandn, LEG(NP, 0F, 0, 0xdf), MMX, WRR, Pq, Pq, Qq) +OPCODE(pandn, LEG(66, 0F, 0, 0xdf), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(andnps, LEG(NP, 0F, 0, 0x55), SSE, WRR, Vdq, Vdq, Wdq) +OPCODE(andnpd, LEG(66, 0F, 0, 0x55), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(por, LEG(NP, 0F, 0, 0xeb), MMX, WRR, Pq, Pq, Qq) +OPCODE(por, LEG(66, 0F, 0, 0xeb), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(orps, LEG(NP, 0F, 0, 0x56), SSE, WRR, Vdq, Vdq, Wdq) +OPCODE(orpd, LEG(66, 0F, 0, 0x56), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(pxor, LEG(NP, 0F, 0, 0xef), MMX, WRR, Pq, Pq, Qq) +OPCODE(pxor, LEG(66, 0F, 0, 0xef), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(xorps, LEG(NP, 0F, 0, 0x57), SSE, WRR, Vdq, Vdq, Wdq) +OPCODE(xorpd, LEG(66, 0F, 0, 0x57), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(psllw, LEG(NP, 0F, 0, 0xf1), MMX, WRR, Pq, Pq, Qq) +OPCODE(psllw, LEG(66, 0F, 0, 0xf1), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(pslld, LEG(NP, 0F, 0, 0xf2), MMX, WRR, Pq, Pq, Qq) +OPCODE(pslld, LEG(66, 0F, 0, 0xf2), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(psllq, LEG(NP, 0F, 0, 0xf3), MMX, WRR, Pq, Pq, Qq) +OPCODE(psllq, LEG(66, 0F, 0, 0xf3), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(psrlw, LEG(NP, 0F, 0, 0xd1), MMX, WRR, Pq, Pq, Qq) +OPCODE(psrlw, LEG(66, 0F, 0, 0xd1), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(psrld, LEG(NP, 0F, 0, 0xd2), MMX, WRR, Pq, Pq, Qq) +OPCODE(psrld, LEG(66, 0F, 0, 0xd2), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(psrlq, LEG(NP, 0F, 0, 0xd3), MMX, WRR, Pq, Pq, Qq) +OPCODE(psrlq, LEG(66, 0F, 0, 0xd3), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(psraw, LEG(NP, 0F, 0, 0xe1), MMX, WRR, Pq, Pq, Qq) +OPCODE(psraw, LEG(66, 0F, 0, 0xe1), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(psrad, LEG(NP, 0F, 0, 0xe2), MMX, WRR, Pq, Pq, Qq) +OPCODE(psrad, LEG(66, 0F, 0, 0xe2), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(packsswb, LEG(NP, 0F, 0, 0x63), MMX, WRR, Pq, Pq, Qq) +OPCODE(packsswb, LEG(66, 0F, 0, 0x63), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(packssdw, LEG(NP, 0F, 0, 0x6b), MMX, WRR, Pq, Pq, Qq) +OPCODE(packssdw, LEG(66, 0F, 0, 0x6b), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(packuswb, LEG(NP, 0F, 0, 0x67), MMX, WRR, Pq, Pq, Qq) +OPCODE(packuswb, LEG(66, 0F, 0, 0x67), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(punpckhbw, LEG(NP, 0F, 0, 0x68), MMX, WRR, Pq, Pq, Qq) +OPCODE(punpckhbw, LEG(66, 0F, 0, 0x68), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(punpckhwd, LEG(NP, 0F, 0, 0x69), MMX, WRR, Pq, Pq, Qq) +OPCODE(punpckhwd, LEG(66, 0F, 0, 0x69), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(punpckhdq, LEG(NP, 0F, 0, 0x6a), MMX, WRR, Pq, Pq, Qq) +OPCODE(punpckhdq, LEG(66, 0F, 0, 0x6a), SSE2, WRR, Vdq, Vdq, Wdq) +OPCODE(punpckhqdq, LEG(66, 0F, 0, 0x6d), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(punpcklbw, LEG(NP, 0F, 0, 0x60), MMX, WRR, Pq, Pq, Qd) +OPCODE(punpcklbw, LEG(66, 0F, 0, 0x60), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(punpcklwd, LEG(NP, 0F, 0, 0x61), MMX, WRR, Pq, Pq, Qd) +OPCODE(punpcklwd, LEG(66, 0F, 0, 0x61), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(punpckldq, LEG(NP, 0F, 0, 0x62), MMX, WRR, Pq, Pq, Qd) +OPCODE(punpckldq, LEG(66, 0F, 0, 0x62), SSE2, WRR, Vdq, Vdq, Wdq) +OPCODE(punpcklqdq, LEG(66, 0F, 0, 0x6c), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(unpcklps, LEG(NP, 0F, 0, 0x14), SSE, WRR, Vdq, Vdq, Wdq) +OPCODE(unpcklpd, LEG(66, 0F, 0, 0x14), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(unpckhps, LEG(NP, 0F, 0, 0x15), SSE, WRR, Vdq, Vdq, Wdq) +OPCODE(unpckhpd, LEG(66, 0F, 0, 0x15), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(pshufw, LEG(NP, 0F, 0, 0x70), SSE, WRR, Pq, Qq, Ib) +OPCODE(pshuflw, LEG(F2, 0F, 0, 0x70), SSE2, WRR, Vdq, Wdq, Ib) +OPCODE(pshufhw, LEG(F3, 0F, 0, 0x70), SSE2, WRR, Vdq, Wdq, Ib) +OPCODE(pshufd, LEG(66, 0F, 0, 0x70), SSE2, WRR, Vdq, Wdq, Ib) OPCODE(shufps, LEG(NP, 0F, 0, 0xc6), SSE, WRRR, Vdq, Vdq, Wdq, Ib) +OPCODE(shufpd, LEG(66, 0F, 0, 0xc6), SSE2, WRRR, Vdq, Vdq, Wdq, Ib) OPCODE(pinsrw, LEG(NP, 0F, 0, 0xc4), SSE, WRRR, Pq, Pq, RdMw, Ib) +OPCODE(pinsrw, LEG(66, 0F, 0, 0xc4), SSE2, WRRR, Vdq, Vdq, RdMw, Ib) OPCODE(pextrw, LEG(NP, 0F, 0, 0xc5), SSE, WRR, Gd, Nq, Ib) OPCODE(pextrw, LEG(NP, 0F, 1, 0xc5), SSE, WRR, Gq, Nq, Ib) +OPCODE(pextrw, LEG(66, 0F, 0, 0xc5), SSE2, WRR, Gd, Udq, Ib) +OPCODE(pextrw, LEG(66, 0F, 1, 0xc5), SSE2, WRR, Gq, Udq, Ib) OPCODE(cvtpi2ps, LEG(NP, 0F, 0, 0x2a), SSE, WR, Vdq, Qq) OPCODE(cvtsi2ss, LEG(F3, 0F, 0, 0x2a), SSE, WR, Vd, Ed) OPCODE(cvtsi2ss, LEG(F3, 0F, 1, 0x2a), SSE, WR, Vd, Eq) +OPCODE(cvtpi2pd, LEG(66, 0F, 0, 0x2a), SSE2, WR, Vdq, Qq) +OPCODE(cvtsi2sd, LEG(F2, 0F, 0, 0x2a), SSE2, WR, Vq, Ed) +OPCODE(cvtsi2sd, LEG(F2, 0F, 1, 0x2a), SSE2, WR, Vq, Eq) OPCODE(cvtps2pi, LEG(NP, 0F, 0, 0x2d), SSE, WR, Pq, Wq) OPCODE(cvtss2si, LEG(F3, 0F, 0, 0x2d), SSE, WR, Gd, Wd) OPCODE(cvtss2si, LEG(F3, 0F, 1, 0x2d), SSE, WR, Gq, Wd) +OPCODE(cvtpd2pi, LEG(66, 0F, 0, 0x2d), SSE2, WR, Pq, Wdq) +OPCODE(cvtsd2si, LEG(F2, 0F, 0, 0x2d), SSE2, WR, Gd, Wq) +OPCODE(cvtsd2si, LEG(F2, 0F, 1, 0x2d), SSE2, WR, Gq, Wq) OPCODE(cvttps2pi, LEG(NP, 0F, 0, 0x2c), SSE, WR, Pq, Wq) OPCODE(cvttss2si, LEG(F3, 0F, 0, 0x2c), SSE, WR, Gd, Wd) OPCODE(cvttss2si, LEG(F3, 0F, 1, 0x2c), SSE, WR, Gq, Wd) +OPCODE(cvttpd2pi, LEG(66, 0F, 0, 0x2c), SSE2, WR, Pq, Wdq) +OPCODE(cvttsd2si, LEG(F2, 0F, 0, 0x2c), SSE2, WR, Gd, Wq) +OPCODE(cvttsd2si, LEG(F2, 0F, 1, 0x2c), SSE2, WR, Gq, Wq) +OPCODE(cvtpd2dq, LEG(F2, 0F, 0, 0xe6), SSE2, WR, Vdq, Wdq) +OPCODE(cvttpd2dq, LEG(66, 0F, 0, 0xe6), SSE2, WR, Vdq, Wdq) +OPCODE(cvtdq2pd, LEG(F3, 0F, 0, 0xe6), SSE2, WR, Vdq, Wq) +OPCODE(cvtps2pd, LEG(NP, 0F, 0, 0x5a), SSE2, WR, Vdq, Wq) +OPCODE(cvtpd2ps, LEG(66, 0F, 0, 0x5a), SSE2, WR, Vdq, Wdq) +OPCODE(cvtss2sd, LEG(F3, 0F, 0, 0x5a), SSE2, WR, Vq, Wd) +OPCODE(cvtsd2ss, LEG(F2, 0F, 0, 0x5a), SSE2, WR, Vd, Wq) +OPCODE(cvtdq2ps, LEG(NP, 0F, 0, 0x5b), SSE2, WR, Vdq, Wdq) +OPCODE(cvtps2dq, LEG(66, 0F, 0, 0x5b), SSE2, WR, Vdq, Wdq) +OPCODE(cvttps2dq, LEG(F3, 0F, 0, 0x5b), SSE2, WR, Vdq, Wdq) OPCODE(maskmovq, LEG(NP, 0F, 0, 0xf7), SSE, RR, Pq, Nq) +OPCODE(maskmovdqu, LEG(66, 0F, 0, 0xf7), SSE2, RR, Vdq, Udq) OPCODE(movntps, LEG(NP, 0F, 0, 0x2b), SSE, WR, Mdq, Vdq) +OPCODE(movntpd, LEG(66, 0F, 0, 0x2b), SSE2, WR, Mdq, Vdq) +OPCODE(movnti, LEG(NP, 0F, 0, 0xc3), SSE2, WR, Md, Gd) +OPCODE(movnti, LEG(NP, 0F, 1, 0xc3), SSE2, WR, Mq, Gq) OPCODE(movntq, LEG(NP, 0F, 0, 0xe7), SSE, WR, Mq, Pq) +OPCODE(movntdq, LEG(66, 0F, 0, 0xe7), SSE2, WR, Mdq, Vdq) +OPCODE(pause, LEG(F3, NA, 0, 0x90), SSE2, ) OPCODE(emms, LEG(NP, 0F, 0, 0x77), MMX, ) +OPCODE_GRP(grp12_LEG_66, LEG(66, 0F, 0, 0x71)) +OPCODE_GRP_BEGIN(grp12_LEG_66) + OPCODE_GRPMEMB(grp12_LEG_66, psllw, 6, SSE2, WRR, Udq, Udq, Ib) + OPCODE_GRPMEMB(grp12_LEG_66, psrlw, 2, SSE2, WRR, Udq, Udq, Ib) + OPCODE_GRPMEMB(grp12_LEG_66, psraw, 4, SSE2, WRR, Udq, Udq, Ib) +OPCODE_GRP_END(grp12_LEG_66) + OPCODE_GRP(grp12_LEG_NP, LEG(NP, 0F, 0, 0x71)) OPCODE_GRP_BEGIN(grp12_LEG_NP) OPCODE_GRPMEMB(grp12_LEG_NP, psllw, 6, MMX, WRR, Nq, Nq, Ib) @@ -311,6 +618,13 @@ OPCODE_GRP_BEGIN(grp12_LEG_NP) OPCODE_GRPMEMB(grp12_LEG_NP, psraw, 4, MMX, WRR, Nq, Nq, Ib) OPCODE_GRP_END(grp12_LEG_NP) +OPCODE_GRP(grp13_LEG_66, LEG(66, 0F, 0, 0x72)) +OPCODE_GRP_BEGIN(grp13_LEG_66) + OPCODE_GRPMEMB(grp13_LEG_66, pslld, 6, SSE2, WRR, Udq, Udq, Ib) + OPCODE_GRPMEMB(grp13_LEG_66, psrld, 2, SSE2, WRR, Udq, Udq, Ib) + OPCODE_GRPMEMB(grp13_LEG_66, psrad, 4, SSE2, WRR, Udq, Udq, Ib) +OPCODE_GRP_END(grp13_LEG_66) + OPCODE_GRP(grp13_LEG_NP, LEG(NP, 0F, 0, 0x72)) OPCODE_GRP_BEGIN(grp13_LEG_NP) OPCODE_GRPMEMB(grp13_LEG_NP, pslld, 6, MMX, WRR, Nq, Nq, Ib) @@ -318,6 +632,14 @@ OPCODE_GRP_BEGIN(grp13_LEG_NP) OPCODE_GRPMEMB(grp13_LEG_NP, psrad, 4, MMX, WRR, Nq, Nq, Ib) OPCODE_GRP_END(grp13_LEG_NP) +OPCODE_GRP(grp14_LEG_66, LEG(66, 0F, 0, 0x73)) +OPCODE_GRP_BEGIN(grp14_LEG_66) + OPCODE_GRPMEMB(grp14_LEG_66, psllq, 6, SSE2, WRR, Udq, Udq, Ib) + OPCODE_GRPMEMB(grp14_LEG_66, pslldq, 7, SSE2, WRR, Udq, Udq, Ib) + OPCODE_GRPMEMB(grp14_LEG_66, psrlq, 2, SSE2, WRR, Udq, Udq, Ib) + OPCODE_GRPMEMB(grp14_LEG_66, psrldq, 3, SSE2, WRR, Udq, Udq, Ib) +OPCODE_GRP_END(grp14_LEG_66) + OPCODE_GRP(grp14_LEG_NP, LEG(NP, 0F, 0, 0x73)) OPCODE_GRP_BEGIN(grp14_LEG_NP) OPCODE_GRPMEMB(grp14_LEG_NP, psllq, 6, MMX, WRR, Nq, Nq, Ib) @@ -326,7 +648,9 @@ OPCODE_GRP_END(grp14_LEG_NP) OPCODE_GRP(grp15_LEG_NP, LEG(NP, 0F, 0, 0xae)) OPCODE_GRP_BEGIN(grp15_LEG_NP) - OPCODE_GRPMEMB(grp15_LEG_NP, sfence, 7, SSE, ) + OPCODE_GRPMEMB(grp15_LEG_NP, sfence_clflush, 7, SSE, RR, modrm_mod, modrm) + OPCODE_GRPMEMB(grp15_LEG_NP, lfence, 5, SSE2, ) + OPCODE_GRPMEMB(grp15_LEG_NP, mfence, 6, SSE2, ) OPCODE_GRPMEMB(grp15_LEG_NP, ldmxcsr, 2, SSE, R, Md) OPCODE_GRPMEMB(grp15_LEG_NP, stmxcsr, 3, SSE, W, Md) OPCODE_GRP_END(grp15_LEG_NP) From patchwork Wed Aug 21 17:29:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Bobek X-Patchwork-Id: 11107869 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9648A14DB for ; Wed, 21 Aug 2019 18:25:31 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6DDB4216F4 for ; Wed, 21 Aug 2019 18:25:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="orBbVQiN" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6DDB4216F4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:51666 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0VIX-0001ed-UC for patchwork-qemu-devel@patchwork.kernel.org; Wed, 21 Aug 2019 14:25:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41235) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0URa-0001Ys-7m for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i0URZ-0007xI-5t for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:46 -0400 Received: from mail-yb1-xb44.google.com ([2607:f8b0:4864:20::b44]:38908) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i0URZ-0007wt-28 for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:45 -0400 Received: by mail-yb1-xb44.google.com with SMTP id j199so1342893ybg.5 for ; Wed, 21 Aug 2019 10:30:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=3WmwthMXAARi91QckFwEai37drlx513p6L/n0kwcJA0=; b=orBbVQiN7Xl+9YDnrXn0c7vWFYNEiVqeXB1EM9l8EJT+ftPf0/DHZRsyafF4EJT6Nv bFHwCjNWFQNG1Bm40IUzTUNMEkrRsVRca+0z4ERLGVcQS5LLiH/sVE5XPLFGaoGQw85u wKf42CTdSID0RFyWGvMjub8ubm7VhuHfGDu9E6IAACa63FLkSd1LJwiaTNKfwMRT8/F8 2cF6JUe02YGNpph1gn1tdfp7UlVfrBXNjiV4guHeTAObYD6ooc6+DmJ543ihwIqHRhVW GDG+3dJFtWqtxIT5cNRgEGpyhmviRwJxTk5vJYyw8AdL1u1kArUYtUjlYvygKKaKDQzr cciw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=3WmwthMXAARi91QckFwEai37drlx513p6L/n0kwcJA0=; b=GzS3rkVpQ90gi3Wg+bgYCiJh2v/aCXEBVfgns99/t/29mLf9DpxNlOUlPw/hcasFkb 7Ox4B2oiyxfIgSb6rt53xrsykKUnjosePY5ONl4QL4/hhniEu1CChtnzkEIaUvART9sI 1VLwlgyHQtWJB2WW61Lm2KBw053guRQkNxpakCOLvs3brh1lGGtnK67w158UdHPYWp3H XRCcEJpaK/q0AW+LlyNL5hbvPxBVN/anrKjQGjATEfBFP4zh2Y8YJVmB4uDXjRZu9ZeR d/DSPwViguklEsO2TIt6Z5WBSbAQgCCK3S/5yP2S5KOEw5wFlHPknwRd0UfgSS6YFF/p 5HwA== X-Gm-Message-State: APjAAAWsOGhfj9xjhJxbS1H8g3AuWfk7bIq42r0E7oQ/zSx9WzsVH4Gb e9ba4UGHc4pWcgS9okbsaGCz6hMj X-Google-Smtp-Source: APXvYqyggDawdm68NLIV0ccp3enaEwqG4hrwasjmx0XPHhU+o5/evcl2PKZN7eNmON17ZM29tT+0lQ== X-Received: by 2002:a25:324b:: with SMTP id y72mr12448534yby.361.1566408644344; Wed, 21 Aug 2019 10:30:44 -0700 (PDT) Received: from localhost.localdomain ([2601:c0:c67f:e390::3]) by smtp.gmail.com with ESMTPSA id l71sm2826167ywl.39.2019.08.21.10.30.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Aug 2019 10:30:43 -0700 (PDT) From: Jan Bobek To: qemu-devel@nongnu.org Date: Wed, 21 Aug 2019 13:29:21 -0400 Message-Id: <20190821172951.15333-46-jan.bobek@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190821172951.15333-1-jan.bobek@gmail.com> References: <20190821172951.15333-1-jan.bobek@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::b44 Subject: [Qemu-devel] [RFC PATCH v4 45/75] target/i386: introduce SSE3 translators X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jan Bobek , =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Use the translator macros to define translators required by SSE3 instructions. Signed-off-by: Jan Bobek --- target/i386/translate.c | 1 + 1 file changed, 1 insertion(+) diff --git a/target/i386/translate.c b/target/i386/translate.c index 3445b4cff1..a478f73c17 100644 --- a/target/i386/translate.c +++ b/target/i386/translate.c @@ -6519,6 +6519,7 @@ DEF_TRANSLATE_INSN2(Vd, Wd) DEF_TRANSLATE_INSN2(Vd, Wq) DEF_TRANSLATE_INSN2(Vdq, Ed) DEF_TRANSLATE_INSN2(Vdq, Eq) +DEF_TRANSLATE_INSN2(Vdq, Mdq) DEF_TRANSLATE_INSN2(Vdq, Nq) DEF_TRANSLATE_INSN2(Vdq, Qq) DEF_TRANSLATE_INSN2(Vdq, Udq) From patchwork Wed Aug 21 17:29:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Bobek X-Patchwork-Id: 11107875 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7417E1395 for ; Wed, 21 Aug 2019 18:28:06 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4BDB4216F4 for ; Wed, 21 Aug 2019 18:28:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="MbG4w56K" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4BDB4216F4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:51694 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0VL2-0005Xa-JG for patchwork-qemu-devel@patchwork.kernel.org; Wed, 21 Aug 2019 14:28:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41249) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0URb-0001aZ-Cd for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i0URZ-0007z6-W1 for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:47 -0400 Received: from mail-yb1-xb41.google.com ([2607:f8b0:4864:20::b41]:38906) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i0URZ-0007yk-S7 for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:45 -0400 Received: by mail-yb1-xb41.google.com with SMTP id j199so1342913ybg.5 for ; Wed, 21 Aug 2019 10:30:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=a0oLr3XUNUYycYpp9Snrt/anxTMoMxsixsmZcVdJyo0=; b=MbG4w56Kr1WHZUkdmMySnt0G3oJU4x7OZOz4qanJRL//OvHCyCP5deHX19I8XCRVQc QA+hmrYJCX3ZO28SQf2b+Ob+eBqMXpVDtARmkuINrZ9LsRZtHWMW0RDYgf/vZFd9m3bi OnF0H//vQCa+P9L7xhqPcDSKGi++OVaVOh2sshr6wwtWjlT/LdIH9aZ/3gHArjdNA/iH fjYnj386m/RDeRHrH+ljOz/ERRjS/nz4PQNZXkaZxDKxuss0194EaqN3lcoT66PNjvf6 1GuiE9tWKxuEN+To6SIyl/kq2Npslnfrz8dcFw9cgmiUgGqhm+RYCkd+QmgYG7SllGXx nNSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=a0oLr3XUNUYycYpp9Snrt/anxTMoMxsixsmZcVdJyo0=; b=NXpWa7N9I/1EOP+zFT57cCGUCgZdm9PZ6eCWN5104O4sppfGR9iBoxMkWTMiVZ2TPY nXoyWbY+Ohm285P/YKP2qE/K6VxtOjpWBa2aX8Vgw8xJWwtSiXv7FYVoy+1HQdPaKBlm mdC63SNFarBqN+2MLcBuVGe/n7sTk64Vo3/9WvMe5H+urTiZm7RuDj7Ha/gNh1ID76Mp jy2Tjo0EhOKScw7vflBstQFSRYjY2g2IpP9shuDmOVWNUGNsXlTmfmkjr7FB/OGwn+Bi yVIp/uFkgv1mJEBg9Cgp7Ff6733OGdv4rYqeu88925GEcHCbA8GxxemIT47ToNhBfzoW lJPA== X-Gm-Message-State: APjAAAW9mda22QfEkw1xta07TS2uXiFw5v1IpVfBjBk+Z24GLAGP6ggs hCJj5KI4ZgbpwLQIVLXLLC2T2am9 X-Google-Smtp-Source: APXvYqyAE3jpJRud7euQ+JIYGwIwOGchXosaNnS7Wo1JWtmiS+tnh9Y4Kg+D56WXTlxx9SSMZVF6Bw== X-Received: by 2002:a25:bd4e:: with SMTP id p14mr24100080ybm.148.1566408645259; Wed, 21 Aug 2019 10:30:45 -0700 (PDT) Received: from localhost.localdomain ([2601:c0:c67f:e390::3]) by smtp.gmail.com with ESMTPSA id l71sm2826167ywl.39.2019.08.21.10.30.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Aug 2019 10:30:44 -0700 (PDT) From: Jan Bobek To: qemu-devel@nongnu.org Date: Wed, 21 Aug 2019 13:29:22 -0400 Message-Id: <20190821172951.15333-47-jan.bobek@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190821172951.15333-1-jan.bobek@gmail.com> References: <20190821172951.15333-1-jan.bobek@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::b41 Subject: [Qemu-devel] [RFC PATCH v4 46/75] target/i386: introduce SSE3 code generators X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jan Bobek , =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Introduce code generators required by SSE3 instructions. Signed-off-by: Jan Bobek --- target/i386/translate.c | 61 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/target/i386/translate.c b/target/i386/translate.c index a478f73c17..d449a64464 100644 --- a/target/i386/translate.c +++ b/target/i386/translate.c @@ -5802,6 +5802,60 @@ GEN_INSN2(movmskpd, Gq, Udq) tcg_temp_free_i32(arg1_r32); } +GEN_INSN2(lddqu, Vdq, Mdq) +{ + insnop_ldst(xmm, Mdq)(env, s, 0, arg1, arg2); +} + +GEN_INSN2(movshdup, Vdq, Wdq) +{ + const TCGv_i32 r32 = tcg_temp_new_i32(); + + tcg_gen_ld_i32(r32, cpu_env, arg2 + offsetof(ZMMReg, ZMM_L(1))); + tcg_gen_st_i32(r32, cpu_env, arg1 + offsetof(ZMMReg, ZMM_L(0))); + if (arg1 != arg2) { + tcg_gen_st_i32(r32, cpu_env, arg1 + offsetof(ZMMReg, ZMM_L(1))); + } + + tcg_gen_ld_i32(r32, cpu_env, arg2 + offsetof(ZMMReg, ZMM_L(3))); + tcg_gen_st_i32(r32, cpu_env, arg1 + offsetof(ZMMReg, ZMM_L(2))); + if (arg1 != arg2) { + tcg_gen_st_i32(r32, cpu_env, arg1 + offsetof(ZMMReg, ZMM_L(3))); + } + + tcg_temp_free_i32(r32); +} +GEN_INSN2(movsldup, Vdq, Wdq) +{ + const TCGv_i32 r32 = tcg_temp_new_i32(); + + tcg_gen_ld_i32(r32, cpu_env, arg2 + offsetof(ZMMReg, ZMM_L(0))); + if (arg1 != arg2) { + tcg_gen_st_i32(r32, cpu_env, arg1 + offsetof(ZMMReg, ZMM_L(0))); + } + tcg_gen_st_i32(r32, cpu_env, arg1 + offsetof(ZMMReg, ZMM_L(1))); + + tcg_gen_ld_i32(r32, cpu_env, arg2 + offsetof(ZMMReg, ZMM_L(2))); + if (arg1 != arg2) { + tcg_gen_st_i32(r32, cpu_env, arg1 + offsetof(ZMMReg, ZMM_L(2))); + } + tcg_gen_st_i32(r32, cpu_env, arg1 + offsetof(ZMMReg, ZMM_L(3))); + + tcg_temp_free_i32(r32); +} +GEN_INSN2(movddup, Vdq, Wq) +{ + const TCGv_i64 r64 = tcg_temp_new_i64(); + + tcg_gen_ld_i64(r64, cpu_env, arg2 + offsetof(ZMMReg, ZMM_Q(0))); + if (arg1 != arg2) { + tcg_gen_st_i64(r64, cpu_env, arg1 + offsetof(ZMMReg, ZMM_Q(0))); + } + tcg_gen_st_i64(r64, cpu_env, arg1 + offsetof(ZMMReg, ZMM_Q(1))); + + tcg_temp_free_i64(r64); +} + DEF_GEN_INSN3_GVEC(paddb, Pq, Pq, Qq, add, MM_OPRSZ, MM_MAXSZ, MO_8) DEF_GEN_INSN3_GVEC(paddb, Vdq, Vdq, Wdq, add, XMM_OPRSZ, XMM_MAXSZ, MO_8) DEF_GEN_INSN3_GVEC(paddw, Pq, Pq, Qq, add, MM_OPRSZ, MM_MAXSZ, MO_16) @@ -5822,6 +5876,8 @@ DEF_GEN_INSN3_HELPER_EPP(addps, addps, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(addpd, addpd, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(addss, addss, Vd, Vd, Wd) DEF_GEN_INSN3_HELPER_EPP(addsd, addsd, Vq, Vq, Wq) +DEF_GEN_INSN3_HELPER_EPP(haddps, haddps, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(haddpd, haddpd, Vdq, Vdq, Wdq) DEF_GEN_INSN3_GVEC(psubb, Pq, Pq, Qq, sub, MM_OPRSZ, MM_MAXSZ, MO_8) DEF_GEN_INSN3_GVEC(psubb, Vdq, Vdq, Wdq, sub, XMM_OPRSZ, XMM_MAXSZ, MO_8) @@ -5843,6 +5899,11 @@ DEF_GEN_INSN3_HELPER_EPP(subps, subps, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(subpd, subpd, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(subss, subss, Vd, Vd, Wd) DEF_GEN_INSN3_HELPER_EPP(subsd, subsd, Vq, Vq, Wq) +DEF_GEN_INSN3_HELPER_EPP(hsubps, hsubps, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(hsubpd, hsubpd, Vdq, Vdq, Wdq) + +DEF_GEN_INSN3_HELPER_EPP(addsubps, addsubps, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(addsubpd, addsubpd, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(pmullw, pmullw_mmx, Pq, Pq, Qq) DEF_GEN_INSN3_HELPER_EPP(pmullw, pmullw_xmm, Vdq, Vdq, Wdq) From patchwork Wed Aug 21 17:29:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Bobek X-Patchwork-Id: 11107867 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 07E9414DB for ; Wed, 21 Aug 2019 18:24:55 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D3CBC22DD3 for ; Wed, 21 Aug 2019 18:24:54 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="vdwdTcR1" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D3CBC22DD3 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:51660 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0VHx-0000dJ-F8 for patchwork-qemu-devel@patchwork.kernel.org; Wed, 21 Aug 2019 14:24:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41401) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0URq-0001hj-Cf for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:31:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i0URo-0008Px-Kg for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:31:02 -0400 Received: from mail-yb1-xb43.google.com ([2607:f8b0:4864:20::b43]:39262) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i0URm-000810-De for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:31:00 -0400 Received: by mail-yb1-xb43.google.com with SMTP id s142so1341607ybc.6 for ; Wed, 21 Aug 2019 10:30:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=wDlBybYVRe7OaKyJaw8OMfE6wxYZwPdGtL10eKPQHAU=; b=vdwdTcR1egGCVoxAv/PU0tpGyOZ8kbPe/mdfZV6HuZBQkhC34hHWHdUUpV6ijzgY1H 7/pwNK/4moFIxRxtSdEoLs9NMYMqgYV5AkYl2EcptAkGkRqlEj3GA6HQtUUxcb4aX6Gn tmoXRBQFyie5dBKwJerSj72+wLldCEyUh45fc+Dzag9V5zRkihZN2qz8llqxl7dj8zvc g9VxgOSYosDZpYNki90X+5acViEP2gTvhgX37/IPtwU+0XHnKd4SUgbQwOLM6AdEl8YN jg9l2TXMKiznpsnkQaiOSghyzgIqVqQPSb5AkhM9KQ+1bFwOnn2cROOpQ2MHFAG0d667 Uviw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=wDlBybYVRe7OaKyJaw8OMfE6wxYZwPdGtL10eKPQHAU=; b=XRfHG/lWWjWfq32uRqdY7KnCtPOfv3XREZmn1/Kwg7O0oh/HwrEy+d+ZjTCY1LcRea bkYs6uco7h+7qg567E3Y0h7AxuML8K2SPHADLoJBHUHFtq6m56/q8jC5C1Kstytckrfd l2+Pc54lYL7VbSlri1qjvoLPxXY63vaAVmXcBxNQ2ppyn2ufe0q7pGTYAP1runyLrcao 78/foPdDdXoSmRkeaVLP8Ht1kXXJoWNpQ0KgypkwjFLY4wp4mXwSMfECWrHq+vvPOAmM 6kGG/D/nJ6NEZjfirgKVXjliws709bXTLa36Mk2uGOD4EdUevwcCWY+kR91z1WfaofpG mcCg== X-Gm-Message-State: APjAAAWoY7n6VmEp5SZrxrqOhYIG0c5fAJi9aE4Fq0WCzbvFTOdPs5WO sqPfiHhgcj4QeSbBWXlc363JRM30 X-Google-Smtp-Source: APXvYqyLTRxeCpoha3rLETX5YIVAydNDb+q2UbnZWYYwOscNgmhisnn4GyANrDatr3zTlroUhuZ+XQ== X-Received: by 2002:a25:db05:: with SMTP id g5mr25606493ybf.397.1566408646058; Wed, 21 Aug 2019 10:30:46 -0700 (PDT) Received: from localhost.localdomain ([2601:c0:c67f:e390::3]) by smtp.gmail.com with ESMTPSA id l71sm2826167ywl.39.2019.08.21.10.30.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Aug 2019 10:30:45 -0700 (PDT) From: Jan Bobek To: qemu-devel@nongnu.org Date: Wed, 21 Aug 2019 13:29:23 -0400 Message-Id: <20190821172951.15333-48-jan.bobek@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190821172951.15333-1-jan.bobek@gmail.com> References: <20190821172951.15333-1-jan.bobek@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::b43 Subject: [Qemu-devel] [RFC PATCH v4 47/75] target/i386: introduce SSE3 vector instructions to sse-opcode.inc.h X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jan Bobek , =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Add all the SSE3 vector instruction entries to sse-opcode.inc.h. Signed-off-by: Jan Bobek --- target/i386/sse-opcode.inc.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/target/i386/sse-opcode.inc.h b/target/i386/sse-opcode.inc.h index 6df5fda010..84785a4e04 100644 --- a/target/i386/sse-opcode.inc.h +++ b/target/i386/sse-opcode.inc.h @@ -341,6 +341,19 @@ * NP 0F AE /7 CLFLUSH m8 * NP 0F AE /5 LFENCE * NP 0F AE /6 MFENCE + * + * SSE3 Instructions + * ------------------ + * F2 0F F0 /r LDDQU xmm1, m128 + * F3 0F 16 /r MOVSHDUP xmm1, xmm2/m128 + * F3 0F 12 /r MOVSLDUP xmm1, xmm2/m128 + * F2 0F 12 /r MOVDDUP xmm1, xmm2/m64 + * F2 0F 7C /r HADDPS xmm1, xmm2/m128 + * 66 0F 7C /r HADDPD xmm1, xmm2/m128 + * F2 0F 7D /r HSUBPS xmm1, xmm2/m128 + * 66 0F 7D /r HSUBPD xmm1, xmm2/m128 + * F2 0F D0 /r ADDSUBPS xmm1, xmm2/m128 + * 66 0F D0 /r ADDSUBPD xmm1, xmm2/m128 */ OPCODE(movd, LEG(NP, 0F, 0, 0x6e), MMX, WR, Pq, Ed) @@ -389,6 +402,10 @@ OPCODE(movmskps, LEG(NP, 0F, 0, 0x50), SSE, WR, Gd, Udq) OPCODE(movmskps, LEG(NP, 0F, 1, 0x50), SSE, WR, Gq, Udq) OPCODE(movmskpd, LEG(66, 0F, 0, 0x50), SSE2, WR, Gd, Udq) OPCODE(movmskpd, LEG(66, 0F, 1, 0x50), SSE2, WR, Gq, Udq) +OPCODE(lddqu, LEG(F2, 0F, 0, 0xf0), SSE3, WR, Vdq, Mdq) +OPCODE(movshdup, LEG(F3, 0F, 0, 0x16), SSE3, WR, Vdq, Wdq) +OPCODE(movsldup, LEG(F3, 0F, 0, 0x12), SSE3, WR, Vdq, Wdq) +OPCODE(movddup, LEG(F2, 0F, 0, 0x12), SSE3, WR, Vdq, Wq) OPCODE(paddb, LEG(NP, 0F, 0, 0xfc), MMX, WRR, Pq, Pq, Qq) OPCODE(paddb, LEG(66, 0F, 0, 0xfc), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(paddw, LEG(NP, 0F, 0, 0xfd), MMX, WRR, Pq, Pq, Qq) @@ -409,6 +426,8 @@ OPCODE(addps, LEG(NP, 0F, 0, 0x58), SSE, WRR, Vdq, Vdq, Wdq) OPCODE(addpd, LEG(66, 0F, 0, 0x58), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(addss, LEG(F3, 0F, 0, 0x58), SSE, WRR, Vd, Vd, Wd) OPCODE(addsd, LEG(F2, 0F, 0, 0x58), SSE2, WRR, Vq, Vq, Wq) +OPCODE(haddps, LEG(F2, 0F, 0, 0x7c), SSE3, WRR, Vdq, Vdq, Wdq) +OPCODE(haddpd, LEG(66, 0F, 0, 0x7c), SSE3, WRR, Vdq, Vdq, Wdq) OPCODE(psubb, LEG(NP, 0F, 0, 0xf8), MMX, WRR, Pq, Pq, Qq) OPCODE(psubb, LEG(66, 0F, 0, 0xf8), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(psubw, LEG(NP, 0F, 0, 0xf9), MMX, WRR, Pq, Pq, Qq) @@ -429,6 +448,10 @@ OPCODE(subps, LEG(NP, 0F, 0, 0x5c), SSE, WRR, Vdq, Vdq, Wdq) OPCODE(subpd, LEG(66, 0F, 0, 0x5c), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(subss, LEG(F3, 0F, 0, 0x5c), SSE, WRR, Vd, Vd, Wd) OPCODE(subsd, LEG(F2, 0F, 0, 0x5c), SSE2, WRR, Vq, Vq, Wq) +OPCODE(hsubps, LEG(F2, 0F, 0, 0x7d), SSE3, WRR, Vdq, Vdq, Wdq) +OPCODE(hsubpd, LEG(66, 0F, 0, 0x7d), SSE3, WRR, Vdq, Vdq, Wdq) +OPCODE(addsubps, LEG(F2, 0F, 0, 0xd0), SSE3, WRR, Vdq, Vdq, Wdq) +OPCODE(addsubpd, LEG(66, 0F, 0, 0xd0), SSE3, WRR, Vdq, Vdq, Wdq) OPCODE(pmullw, LEG(NP, 0F, 0, 0xd5), MMX, WRR, Pq, Pq, Qq) OPCODE(pmullw, LEG(66, 0F, 0, 0xd5), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(pmulhw, LEG(NP, 0F, 0, 0xe5), MMX, WRR, Pq, Pq, Qq) From patchwork Wed Aug 21 17:29:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Bobek X-Patchwork-Id: 11107887 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3E30314DE for ; Wed, 21 Aug 2019 18:30:56 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1685122DD3 for ; Wed, 21 Aug 2019 18:30:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="RyuNXgJx" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1685122DD3 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:51746 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0VNm-0001fD-RH for patchwork-qemu-devel@patchwork.kernel.org; Wed, 21 Aug 2019 14:30:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41269) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0URc-0001cu-On for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i0URb-00083C-KJ for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:48 -0400 Received: from mail-yb1-xb44.google.com ([2607:f8b0:4864:20::b44]:44231) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i0URb-00082o-GX for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:47 -0400 Received: by mail-yb1-xb44.google.com with SMTP id y21so1329763ybi.11 for ; Wed, 21 Aug 2019 10:30:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=gosbLDgNdgsc0Fx9UmfEmWrg5QYj+ch3TSiaoisHlvk=; b=RyuNXgJx6gKNWlDqrXrIIICrHFlnOJ3FtCZCKUhgQWb0WHlD0dUuXKc+jubI78aCuT Kklz9uM9y2yd2VBgkyc5aioY9p0CZ62Qee/tA9qMEC4C8vxU2wFSuJVmmswBdjtLeJA7 CoB2AacqINJVOEq3xihc1fsJQ9YIe1ycEzrlT/X+rpDtQ9v/3I7YyJOQJIra43g4jlCe 8UxuTNlCXkBBBnzXfJOVJ+vtJxQaKkak0omFh9E2XgRnyI95qJl7IWDWLg/de1IlpeDN 2Tge+ww78NGDnqjgwrTzuZU+JG8o4h8zBuHQlJz5psjao1Db2a+MOlOELZ54cgbL0Ggf OUGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=gosbLDgNdgsc0Fx9UmfEmWrg5QYj+ch3TSiaoisHlvk=; b=GkcY6iFNP5pLHFFn0Yk/770qEniYqWMJ9xEog/jDKADtrn5pgz3OdUQA+CG8Hm9ith 5uwYF9KPpynYOLUufE9R9Qplb2pxVaiNaENIg8Rsy9kVrETQWhibfOuhx+HG1tw/ghQU 9qfmeTDnuKarANUxWoolcvuC8eDYt5esdPni4onwSGebJpnzsoHfW7ikGzlXXFoMuo5w K/qDgknl9xIcccWrh0EfJzXma3o5ZO9deX55WBcAba0QQgyR0gp832JbD/xlFsvEh78P rp/X/LN/76V+uT9/BKWHdHEhBe0S6U69cDwYUrVqDIltGcNjqmhLpAebszCIhs0OTPz5 ZEfA== X-Gm-Message-State: APjAAAV3VHs7bjuknTY0cSoBVbPyts8EDvB1pEH3aKfODSr/oEsey5Wb VXDmhTh0AA30ypQ3leGGhHUmgVO+ X-Google-Smtp-Source: APXvYqy98RMveNdh48LGIf0dAstGEJu7RtLeHOXxnnGFsWlLZChdWfKLBZ4c12BbTpxzH6Sa15lsdw== X-Received: by 2002:a25:cb81:: with SMTP id b123mr22789393ybg.233.1566408646900; Wed, 21 Aug 2019 10:30:46 -0700 (PDT) Received: from localhost.localdomain ([2601:c0:c67f:e390::3]) by smtp.gmail.com with ESMTPSA id l71sm2826167ywl.39.2019.08.21.10.30.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Aug 2019 10:30:46 -0700 (PDT) From: Jan Bobek To: qemu-devel@nongnu.org Date: Wed, 21 Aug 2019 13:29:24 -0400 Message-Id: <20190821172951.15333-49-jan.bobek@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190821172951.15333-1-jan.bobek@gmail.com> References: <20190821172951.15333-1-jan.bobek@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::b44 Subject: [Qemu-devel] [RFC PATCH v4 48/75] target/i386: introduce SSSE3 translators X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jan Bobek , =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Use the translator macros to define translators required by SSSE3 instructions. Signed-off-by: Jan Bobek --- target/i386/translate.c | 1 + 1 file changed, 1 insertion(+) diff --git a/target/i386/translate.c b/target/i386/translate.c index d449a64464..25d3b969b1 100644 --- a/target/i386/translate.c +++ b/target/i386/translate.c @@ -6695,6 +6695,7 @@ DEF_TRANSLATE_INSN3(Vq, Vq, Wq) } \ } +DEF_TRANSLATE_INSN4(Pq, Pq, Qq, Ib) DEF_TRANSLATE_INSN4(Pq, Pq, RdMw, Ib) DEF_TRANSLATE_INSN4(Vd, Vd, Wd, Ib) DEF_TRANSLATE_INSN4(Vdq, Vdq, RdMw, Ib) From patchwork Wed Aug 21 17:29:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Bobek X-Patchwork-Id: 11107863 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9AEB81395 for ; Wed, 21 Aug 2019 18:23:30 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 72F7B21655 for ; Wed, 21 Aug 2019 18:23:30 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="cjar5h6v" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 72F7B21655 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:51654 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0VGb-0006zJ-5f for patchwork-qemu-devel@patchwork.kernel.org; Wed, 21 Aug 2019 14:23:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41308) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0URi-0001f6-MD for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i0URg-00089Q-MR for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:54 -0400 Received: from mail-yw1-xc41.google.com ([2607:f8b0:4864:20::c41]:39004) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i0URe-00085R-MV for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:52 -0400 Received: by mail-yw1-xc41.google.com with SMTP id x74so1237736ywx.6 for ; Wed, 21 Aug 2019 10:30:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=uOPaFPjPDvChBnik70h2TWTBMB5d+sd6THHXJhiI/U4=; b=cjar5h6v8W2TJNu49XScOdgEKNZ0XIKwHU7gpACm51uJDWHQVA3/5Ds/VUyGNnqk20 kufrViJrrQXsAVubroK0cbcGize9hn1QQAl3pEoKUpEXRp0BI0CbGdvI30ltmHumIcow thZ3meLVGDbQu0AfSVwIiVzw3YphuYqHoMvjaIWpfEtZKNVBrPI/Wlb57/8lSTTp9qVs KOrnAjh6Lw0e/6lQDia2UHet3dt6fgaPMA5sTHfG96q3WsrB4mpRAOBzfO0MFcZn0EZn WNThQR3UbJK9wnAmBehOerQGgyfxmEmdnexoxLX9JPWz1G/XiXbYsvfH59PrrfR/vM3k m/jQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=uOPaFPjPDvChBnik70h2TWTBMB5d+sd6THHXJhiI/U4=; b=sroI6GznGOLsPyBMyZDZU3nLTg6ygMsNZTGH4D6fPHomLMDydRTUyXltx627wZQhXK 3OhbaTkzHPCxPQAedS+3XqE8hv5EexZpBMS8BDSk/cZ4SZNezq6X/YVIz7oXgdqAoKM9 VtbZNgG6mRThB/6vlCIHxHjMXt82sPutqPZobsi1g+6RQxS0YB1DqTOOVt14uc2Ezl+d 5tpDJOq/5lvV7THk05AJ6o4IYkAYxaEL5m7yuY0gF2xJH4iLG+VRwHQ2pSeHRUwrJTMr Z7lpzBGRpTtrkQu8GRt+KWhqigcNZyyF9NjN5blniG6T5Uk7kI+Z3RNQzBM1c1uk/FLp Bieg== X-Gm-Message-State: APjAAAWxwKPhzv1Dxjwj6wU4czWF9XLN2SVtvSdTEoRo9d/ROD2QlDbc h0JmIYNKOEruxCsR3Ptc41NYUw+t X-Google-Smtp-Source: APXvYqzKH6aJXucIywZAY3hcMXNTph6JUTPBHZIIqaOrtuAB6sSCjeonHms5MiiIHcJinrcxCbQ1Ig== X-Received: by 2002:a81:2d83:: with SMTP id t125mr25778407ywt.421.1566408647734; Wed, 21 Aug 2019 10:30:47 -0700 (PDT) Received: from localhost.localdomain ([2601:c0:c67f:e390::3]) by smtp.gmail.com with ESMTPSA id l71sm2826167ywl.39.2019.08.21.10.30.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Aug 2019 10:30:47 -0700 (PDT) From: Jan Bobek To: qemu-devel@nongnu.org Date: Wed, 21 Aug 2019 13:29:25 -0400 Message-Id: <20190821172951.15333-50-jan.bobek@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190821172951.15333-1-jan.bobek@gmail.com> References: <20190821172951.15333-1-jan.bobek@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::c41 Subject: [Qemu-devel] [RFC PATCH v4 49/75] target/i386: introduce SSSE3 code generators X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jan Bobek , =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Introduce code generators required by SSSE3 instructions. Signed-off-by: Jan Bobek --- target/i386/translate.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/target/i386/translate.c b/target/i386/translate.c index 25d3b969b1..f43e9b1ba4 100644 --- a/target/i386/translate.c +++ b/target/i386/translate.c @@ -5876,6 +5876,12 @@ DEF_GEN_INSN3_HELPER_EPP(addps, addps, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(addpd, addpd, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(addss, addss, Vd, Vd, Wd) DEF_GEN_INSN3_HELPER_EPP(addsd, addsd, Vq, Vq, Wq) +DEF_GEN_INSN3_HELPER_EPP(phaddw, phaddw_mmx, Pq, Pq, Qq) +DEF_GEN_INSN3_HELPER_EPP(phaddw, phaddw_xmm, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(phaddd, phaddd_mmx, Pq, Pq, Qq) +DEF_GEN_INSN3_HELPER_EPP(phaddd, phaddd_xmm, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(phaddsw, phaddsw_mmx, Pq, Pq, Qq) +DEF_GEN_INSN3_HELPER_EPP(phaddsw, phaddsw_xmm, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(haddps, haddps, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(haddpd, haddpd, Vdq, Vdq, Wdq) @@ -5899,6 +5905,12 @@ DEF_GEN_INSN3_HELPER_EPP(subps, subps, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(subpd, subpd, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(subss, subss, Vd, Vd, Wd) DEF_GEN_INSN3_HELPER_EPP(subsd, subsd, Vq, Vq, Wq) +DEF_GEN_INSN3_HELPER_EPP(phsubw, phsubw_mmx, Pq, Pq, Qq) +DEF_GEN_INSN3_HELPER_EPP(phsubw, phsubw_xmm, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(phsubd, phsubd_mmx, Pq, Pq, Qq) +DEF_GEN_INSN3_HELPER_EPP(phsubd, phsubd_xmm, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(phsubsw, phsubsw_mmx, Pq, Pq, Qq) +DEF_GEN_INSN3_HELPER_EPP(phsubsw, phsubsw_xmm, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(hsubps, hsubps, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(hsubpd, hsubpd, Vdq, Vdq, Wdq) @@ -5913,12 +5925,16 @@ DEF_GEN_INSN3_HELPER_EPP(pmulhuw, pmulhuw_mmx, Pq, Pq, Qq) DEF_GEN_INSN3_HELPER_EPP(pmulhuw, pmulhuw_xmm, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(pmuludq, pmuludq_mmx, Pq, Pq, Qq) DEF_GEN_INSN3_HELPER_EPP(pmuludq, pmuludq_xmm, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(pmulhrsw, pmulhrsw_mmx, Pq, Pq, Qq) +DEF_GEN_INSN3_HELPER_EPP(pmulhrsw, pmulhrsw_xmm, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(mulps, mulps, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(mulpd, mulpd, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(mulss, mulss, Vd, Vd, Wd) DEF_GEN_INSN3_HELPER_EPP(mulsd, mulsd, Vq, Vq, Wq) DEF_GEN_INSN3_HELPER_EPP(pmaddwd, pmaddwd_mmx, Pq, Pq, Qq) DEF_GEN_INSN3_HELPER_EPP(pmaddwd, pmaddwd_xmm, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(pmaddubsw, pmaddubsw_mmx, Pq, Pq, Qq) +DEF_GEN_INSN3_HELPER_EPP(pmaddubsw, pmaddubsw_xmm, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(divps, divps, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(divpd, divpd, Vdq, Vdq, Wdq) @@ -5956,6 +5972,18 @@ DEF_GEN_INSN3_HELPER_EPP(pavgw, pavgw_mmx, Pq, Pq, Qq) DEF_GEN_INSN3_HELPER_EPP(pavgw, pavgw_xmm, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(psadbw, psadbw_mmx, Pq, Pq, Qq) DEF_GEN_INSN3_HELPER_EPP(psadbw, psadbw_xmm, Vdq, Vdq, Wdq) +DEF_GEN_INSN2_HELPER_EPP(pabsb, pabsb_mmx, Pq, Qq) +DEF_GEN_INSN2_HELPER_EPP(pabsb, pabsb_xmm, Vdq, Wdq) +DEF_GEN_INSN2_HELPER_EPP(pabsw, pabsw_mmx, Pq, Qq) +DEF_GEN_INSN2_HELPER_EPP(pabsw, pabsw_xmm, Vdq, Wdq) +DEF_GEN_INSN2_HELPER_EPP(pabsd, pabsd_mmx, Pq, Qq) +DEF_GEN_INSN2_HELPER_EPP(pabsd, pabsd_xmm, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(psignb, psignb_mmx, Pq, Pq, Qq) +DEF_GEN_INSN3_HELPER_EPP(psignb, psignb_xmm, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(psignw, psignw_mmx, Pq, Pq, Qq) +DEF_GEN_INSN3_HELPER_EPP(psignw, psignw_xmm, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(psignd, psignd_mmx, Pq, Pq, Qq) +DEF_GEN_INSN3_HELPER_EPP(psignd, psignd_xmm, Vdq, Vdq, Wdq) DEF_GEN_INSN3_GVEC(pcmpeqb, Pq, Pq, Qq, cmp, MM_OPRSZ, MM_MAXSZ, MO_8, TCG_COND_EQ) DEF_GEN_INSN3_GVEC(pcmpeqb, Vdq, Vdq, Wdq, cmp, XMM_OPRSZ, XMM_MAXSZ, MO_8, TCG_COND_EQ) @@ -6216,6 +6244,9 @@ DEF_GEN_PSHIFT_IMM_XMM(psraw, Udq, Udq) DEF_GEN_PSHIFT_IMM_MM(psrad, Nq, Nq) DEF_GEN_PSHIFT_IMM_XMM(psrad, Udq, Udq) +DEF_GEN_INSN4_HELPER_EPPI(palignr, palignr_mmx, Pq, Pq, Qq, Ib) +DEF_GEN_INSN4_HELPER_EPPI(palignr, palignr_xmm, Vdq, Vdq, Wdq, Ib) + DEF_GEN_INSN3_HELPER_EPP(packsswb, packsswb_mmx, Pq, Pq, Qq) DEF_GEN_INSN3_HELPER_EPP(packsswb, packsswb_xmm, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(packssdw, packssdw_mmx, Pq, Pq, Qq) @@ -6242,6 +6273,8 @@ DEF_GEN_INSN3_HELPER_EPP(unpcklpd, punpcklqdq_xmm, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(unpckhps, punpckhdq_xmm, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(unpckhpd, punpckhqdq_xmm, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(pshufb, pshufb_mmx, Pq, Pq, Qq) +DEF_GEN_INSN3_HELPER_EPP(pshufb, pshufb_xmm, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_PPI(pshufw, pshufw_mmx, Pq, Qq, Ib) DEF_GEN_INSN3_HELPER_PPI(pshuflw, pshuflw_xmm, Vdq, Wdq, Ib) DEF_GEN_INSN3_HELPER_PPI(pshufhw, pshufhw_xmm, Vdq, Wdq, Ib) From patchwork Wed Aug 21 17:29:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Bobek X-Patchwork-Id: 11107859 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EF5A41395 for ; Wed, 21 Aug 2019 18:21:03 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C7CE022D6D for ; Wed, 21 Aug 2019 18:21:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="seZkKlmW" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C7CE022D6D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:51628 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0VEE-0001ZT-B9 for patchwork-qemu-devel@patchwork.kernel.org; Wed, 21 Aug 2019 14:21:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41310) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0URi-0001fE-PL for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i0URg-00089b-N0 for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:54 -0400 Received: from mail-yw1-xc44.google.com ([2607:f8b0:4864:20::c44]:44247) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i0URe-00085B-Mq for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:52 -0400 Received: by mail-yw1-xc44.google.com with SMTP id l79so1226392ywe.11 for ; Wed, 21 Aug 2019 10:30:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=UzwOWGnlxNuJcAEM/mDIC5BJDuCr0O/luDbpoecD9KU=; b=seZkKlmWa2gvgg3JYOy6ShYBq16OOrxkpBcL9pKv0MyLs5z/rT1kBPrG6+oTQIgpEK bG4khtlZUZQqxYrVYAb2x2RWP58X7sUD+ElFOhE89JfhCT5dKt7Z7uaRvwAolPZL1jmX AXuFZ/5TrFmQimg+Hzc8FvjaSKvh/9saOW9JHSTel5ruX+cTFvWT4LYCLmtWyV1zeTTh 8I8yBa3PJMx+ICP6UJcqrYD+YIAB0dbhb2tV9XrZzuu5TTe44gzmhKbKyl2B7MCLXyXF eoCqMvVJg1t4OzMje/RavkPwOwC5BGJoGc985gN1kL5edbZgXCsR0WrSqYqxOi6zJNrC 2F2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=UzwOWGnlxNuJcAEM/mDIC5BJDuCr0O/luDbpoecD9KU=; b=GciWvR/sEeeP1IOeifnRAZSbPBUG/gEDHQ4PcIOs7eruP7hvZEOzgrPfnA0jCKxUPB XlSGidXoqKMlyxaVFiyXpU8Zj8HzGKKwRj+gKbY29JoJ9cQHLeIoJptaACRjjaSjmHDy 7kjpSe8VizBIgylCoHG3yokpLBK86Aqa3ebzBGTISJ94URDkM71GGNI9bJ0zVgiUT332 ZGftLUMZG95dzTGoEwBbuTtLCX2/fWUkXaUjkAxUA7VIn0uKYX+6DOpd/M3fiNZX9hS4 Ycdri60MmD7RzJDG7sC3DS6mRjpWbwWzH6Zfb5/V/i7p0PQ1FbdbtxUpOrsxjk7BRuWx udUw== X-Gm-Message-State: APjAAAX9jnhkZ++8gMm+W9gHK8OA6uD5x3xeeM5YqlWTxgDaxS0ecdkt Q1guL3x5iIZlGQewOtndOiLXAAs8 X-Google-Smtp-Source: APXvYqy+F1OGDGXVO7nSIWGl6AnFeMHnM8o86FbdenPuTze3qaM/xuFd4M1aOhy8BdOglsw9W3rPgA== X-Received: by 2002:a81:5ec2:: with SMTP id s185mr24952283ywb.35.1566408648314; Wed, 21 Aug 2019 10:30:48 -0700 (PDT) Received: from localhost.localdomain ([2601:c0:c67f:e390::3]) by smtp.gmail.com with ESMTPSA id l71sm2826167ywl.39.2019.08.21.10.30.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Aug 2019 10:30:47 -0700 (PDT) From: Jan Bobek To: qemu-devel@nongnu.org Date: Wed, 21 Aug 2019 13:29:26 -0400 Message-Id: <20190821172951.15333-51-jan.bobek@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190821172951.15333-1-jan.bobek@gmail.com> References: <20190821172951.15333-1-jan.bobek@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::c44 Subject: [Qemu-devel] [RFC PATCH v4 50/75] target/i386: introduce SSSE3 vector instructions to sse-opcode.inc.h X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jan Bobek , =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Add all the SSSE3 vector instruction entries to sse-opcode.inc.h. Signed-off-by: Jan Bobek --- target/i386/sse-opcode.inc.h | 67 ++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) diff --git a/target/i386/sse-opcode.inc.h b/target/i386/sse-opcode.inc.h index 84785a4e04..d8ea71aa6c 100644 --- a/target/i386/sse-opcode.inc.h +++ b/target/i386/sse-opcode.inc.h @@ -354,6 +354,41 @@ * 66 0F 7D /r HSUBPD xmm1, xmm2/m128 * F2 0F D0 /r ADDSUBPS xmm1, xmm2/m128 * 66 0F D0 /r ADDSUBPD xmm1, xmm2/m128 + * + * SSSE3 Instructions + * ------------------- + * NP 0F 38 01 /r PHADDW mm1, mm2/m64 + * 66 0F 38 01 /r PHADDW xmm1, xmm2/m128 + * NP 0F 38 02 /r PHADDD mm1, mm2/m64 + * 66 0F 38 02 /r PHADDD xmm1, xmm2/m128 + * NP 0F 38 03 /r PHADDSW mm1, mm2/m64 + * 66 0F 38 03 /r PHADDSW xmm1, xmm2/m128 + * NP 0F 38 05 /r PHSUBW mm1, mm2/m64 + * 66 0F 38 05 /r PHSUBW xmm1, xmm2/m128 + * NP 0F 38 06 /r PHSUBD mm1, mm2/m64 + * 66 0F 38 06 /r PHSUBD xmm1, xmm2/m128 + * NP 0F 38 07 /r PHSUBSW mm1, mm2/m64 + * 66 0F 38 07 /r PHSUBSW xmm1, xmm2/m128 + * NP 0F 38 0B /r PMULHRSW mm1, mm2/m64 + * 66 0F 38 0B /r PMULHRSW xmm1, xmm2/m128 + * NP 0F 38 04 /r PMADDUBSW mm1, mm2/m64 + * 66 0F 38 04 /r PMADDUBSW xmm1, xmm2/m128 + * NP 0F 38 1C /r PABSB mm1, mm2/m64 + * 66 0F 38 1C /r PABSB xmm1, xmm2/m128 + * NP 0F 38 1D /r PABSW mm1, mm2/m64 + * 66 0F 38 1D /r PABSW xmm1, xmm2/m128 + * NP 0F 38 1E /r PABSD mm1, mm2/m64 + * 66 0F 38 1E /r PABSD xmm1, xmm2/m128 + * NP 0F 38 08 /r PSIGNB mm1, mm2/m64 + * 66 0F 38 08 /r PSIGNB xmm1, xmm2/m128 + * NP 0F 38 09 /r PSIGNW mm1, mm2/m64 + * 66 0F 38 09 /r PSIGNW xmm1, xmm2/m128 + * NP 0F 38 0A /r PSIGND mm1, mm2/m64 + * 66 0F 38 0A /r PSIGND xmm1, xmm2/m128 + * NP 0F 3A 0F /r ib PALIGNR mm1, mm2/m64, imm8 + * 66 0F 3A 0F /r ib PALIGNR xmm1, xmm2/m128, imm8 + * NP 0F 38 00 /r PSHUFB mm1, mm2/m64 + * 66 0F 38 00 /r PSHUFB xmm1, xmm2/m128 */ OPCODE(movd, LEG(NP, 0F, 0, 0x6e), MMX, WR, Pq, Ed) @@ -426,6 +461,12 @@ OPCODE(addps, LEG(NP, 0F, 0, 0x58), SSE, WRR, Vdq, Vdq, Wdq) OPCODE(addpd, LEG(66, 0F, 0, 0x58), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(addss, LEG(F3, 0F, 0, 0x58), SSE, WRR, Vd, Vd, Wd) OPCODE(addsd, LEG(F2, 0F, 0, 0x58), SSE2, WRR, Vq, Vq, Wq) +OPCODE(phaddw, LEG(NP, 0F38, 0, 0x01), SSSE3, WRR, Pq, Pq, Qq) +OPCODE(phaddw, LEG(66, 0F38, 0, 0x01), SSSE3, WRR, Vdq, Vdq, Wdq) +OPCODE(phaddd, LEG(NP, 0F38, 0, 0x02), SSSE3, WRR, Pq, Pq, Qq) +OPCODE(phaddd, LEG(66, 0F38, 0, 0x02), SSSE3, WRR, Vdq, Vdq, Wdq) +OPCODE(phaddsw, LEG(NP, 0F38, 0, 0x03), SSSE3, WRR, Pq, Pq, Qq) +OPCODE(phaddsw, LEG(66, 0F38, 0, 0x03), SSSE3, WRR, Vdq, Vdq, Wdq) OPCODE(haddps, LEG(F2, 0F, 0, 0x7c), SSE3, WRR, Vdq, Vdq, Wdq) OPCODE(haddpd, LEG(66, 0F, 0, 0x7c), SSE3, WRR, Vdq, Vdq, Wdq) OPCODE(psubb, LEG(NP, 0F, 0, 0xf8), MMX, WRR, Pq, Pq, Qq) @@ -448,6 +489,12 @@ OPCODE(subps, LEG(NP, 0F, 0, 0x5c), SSE, WRR, Vdq, Vdq, Wdq) OPCODE(subpd, LEG(66, 0F, 0, 0x5c), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(subss, LEG(F3, 0F, 0, 0x5c), SSE, WRR, Vd, Vd, Wd) OPCODE(subsd, LEG(F2, 0F, 0, 0x5c), SSE2, WRR, Vq, Vq, Wq) +OPCODE(phsubw, LEG(NP, 0F38, 0, 0x05), SSSE3, WRR, Pq, Pq, Qq) +OPCODE(phsubw, LEG(66, 0F38, 0, 0x05), SSSE3, WRR, Vdq, Vdq, Wdq) +OPCODE(phsubd, LEG(NP, 0F38, 0, 0x06), SSSE3, WRR, Pq, Pq, Qq) +OPCODE(phsubd, LEG(66, 0F38, 0, 0x06), SSSE3, WRR, Vdq, Vdq, Wdq) +OPCODE(phsubsw, LEG(NP, 0F38, 0, 0x07), SSSE3, WRR, Pq, Pq, Qq) +OPCODE(phsubsw, LEG(66, 0F38, 0, 0x07), SSSE3, WRR, Vdq, Vdq, Wdq) OPCODE(hsubps, LEG(F2, 0F, 0, 0x7d), SSE3, WRR, Vdq, Vdq, Wdq) OPCODE(hsubpd, LEG(66, 0F, 0, 0x7d), SSE3, WRR, Vdq, Vdq, Wdq) OPCODE(addsubps, LEG(F2, 0F, 0, 0xd0), SSE3, WRR, Vdq, Vdq, Wdq) @@ -460,12 +507,16 @@ OPCODE(pmulhuw, LEG(NP, 0F, 0, 0xe4), SSE, WRR, Pq, Pq, Qq) OPCODE(pmulhuw, LEG(66, 0F, 0, 0xe4), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(pmuludq, LEG(NP, 0F, 0, 0xf4), SSE2, WRR, Pq, Pq, Qq) OPCODE(pmuludq, LEG(66, 0F, 0, 0xf4), SSE2, WRR, Vdq, Vdq, Wdq) +OPCODE(pmulhrsw, LEG(NP, 0F38, 0, 0x0b), SSSE3, WRR, Pq, Pq, Qq) +OPCODE(pmulhrsw, LEG(66, 0F38, 0, 0x0b), SSSE3, WRR, Vdq, Vdq, Wdq) OPCODE(mulps, LEG(NP, 0F, 0, 0x59), SSE, WRR, Vdq, Vdq, Wdq) OPCODE(mulpd, LEG(66, 0F, 0, 0x59), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(mulss, LEG(F3, 0F, 0, 0x59), SSE, WRR, Vd, Vd, Wd) OPCODE(mulsd, LEG(F2, 0F, 0, 0x59), SSE2, WRR, Vq, Vq, Wq) OPCODE(pmaddwd, LEG(NP, 0F, 0, 0xf5), MMX, WRR, Pq, Pq, Qq) OPCODE(pmaddwd, LEG(66, 0F, 0, 0xf5), SSE2, WRR, Vdq, Vdq, Wdq) +OPCODE(pmaddubsw, LEG(NP, 0F38, 0, 0x04), SSSE3, WRR, Pq, Pq, Qq) +OPCODE(pmaddubsw, LEG(66, 0F38, 0, 0x04), SSSE3, WRR, Vdq, Vdq, Wdq) OPCODE(divps, LEG(NP, 0F, 0, 0x5e), SSE, WRR, Vdq, Vdq, Wdq) OPCODE(divpd, LEG(66, 0F, 0, 0x5e), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(divss, LEG(F3, 0F, 0, 0x5e), SSE, WRR, Vd, Vd, Wd) @@ -500,6 +551,18 @@ OPCODE(pavgw, LEG(NP, 0F, 0, 0xe3), SSE, WRR, Pq, Pq, Qq) OPCODE(pavgw, LEG(66, 0F, 0, 0xe3), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(psadbw, LEG(NP, 0F, 0, 0xf6), SSE, WRR, Pq, Pq, Qq) OPCODE(psadbw, LEG(66, 0F, 0, 0xf6), SSE2, WRR, Vdq, Vdq, Wdq) +OPCODE(pabsb, LEG(NP, 0F38, 0, 0x1c), SSSE3, WR, Pq, Qq) +OPCODE(pabsb, LEG(66, 0F38, 0, 0x1c), SSSE3, WR, Vdq, Wdq) +OPCODE(pabsw, LEG(NP, 0F38, 0, 0x1d), SSSE3, WR, Pq, Qq) +OPCODE(pabsw, LEG(66, 0F38, 0, 0x1d), SSSE3, WR, Vdq, Wdq) +OPCODE(pabsd, LEG(NP, 0F38, 0, 0x1e), SSSE3, WR, Pq, Qq) +OPCODE(pabsd, LEG(66, 0F38, 0, 0x1e), SSSE3, WR, Vdq, Wdq) +OPCODE(psignb, LEG(NP, 0F38, 0, 0x08), SSSE3, WRR, Pq, Pq, Qq) +OPCODE(psignb, LEG(66, 0F38, 0, 0x08), SSSE3, WRR, Vdq, Vdq, Wdq) +OPCODE(psignw, LEG(NP, 0F38, 0, 0x09), SSSE3, WRR, Pq, Pq, Qq) +OPCODE(psignw, LEG(66, 0F38, 0, 0x09), SSSE3, WRR, Vdq, Vdq, Wdq) +OPCODE(psignd, LEG(NP, 0F38, 0, 0x0a), SSSE3, WRR, Pq, Pq, Qq) +OPCODE(psignd, LEG(66, 0F38, 0, 0x0a), SSSE3, WRR, Vdq, Vdq, Wdq) OPCODE(pcmpeqb, LEG(NP, 0F, 0, 0x74), MMX, WRR, Pq, Pq, Qq) OPCODE(pcmpeqb, LEG(66, 0F, 0, 0x74), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(pcmpeqw, LEG(NP, 0F, 0, 0x75), MMX, WRR, Pq, Pq, Qq) @@ -552,6 +615,8 @@ OPCODE(psraw, LEG(NP, 0F, 0, 0xe1), MMX, WRR, Pq, Pq, Qq) OPCODE(psraw, LEG(66, 0F, 0, 0xe1), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(psrad, LEG(NP, 0F, 0, 0xe2), MMX, WRR, Pq, Pq, Qq) OPCODE(psrad, LEG(66, 0F, 0, 0xe2), SSE2, WRR, Vdq, Vdq, Wdq) +OPCODE(palignr, LEG(NP, 0F3A, 0, 0x0f), SSSE3, WRRR, Pq, Pq, Qq, Ib) +OPCODE(palignr, LEG(66, 0F3A, 0, 0x0f), SSSE3, WRRR, Vdq, Vdq, Wdq, Ib) OPCODE(packsswb, LEG(NP, 0F, 0, 0x63), MMX, WRR, Pq, Pq, Qq) OPCODE(packsswb, LEG(66, 0F, 0, 0x63), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(packssdw, LEG(NP, 0F, 0, 0x6b), MMX, WRR, Pq, Pq, Qq) @@ -576,6 +641,8 @@ OPCODE(unpcklps, LEG(NP, 0F, 0, 0x14), SSE, WRR, Vdq, Vdq, Wdq) OPCODE(unpcklpd, LEG(66, 0F, 0, 0x14), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(unpckhps, LEG(NP, 0F, 0, 0x15), SSE, WRR, Vdq, Vdq, Wdq) OPCODE(unpckhpd, LEG(66, 0F, 0, 0x15), SSE2, WRR, Vdq, Vdq, Wdq) +OPCODE(pshufb, LEG(NP, 0F38, 0, 0x00), SSSE3, WRR, Pq, Pq, Qq) +OPCODE(pshufb, LEG(66, 0F38, 0, 0x00), SSSE3, WRR, Vdq, Vdq, Wdq) OPCODE(pshufw, LEG(NP, 0F, 0, 0x70), SSE, WRR, Pq, Qq, Ib) OPCODE(pshuflw, LEG(F2, 0F, 0, 0x70), SSE2, WRR, Vdq, Wdq, Ib) OPCODE(pshufhw, LEG(F3, 0F, 0, 0x70), SSE2, WRR, Vdq, Wdq, Ib) From patchwork Wed Aug 21 17:29:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Bobek X-Patchwork-Id: 11107855 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BCDA714DB for ; Wed, 21 Aug 2019 18:20:57 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8FE1322D6D for ; Wed, 21 Aug 2019 18:20:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="YzmQjkGE" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8FE1322D6D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:51624 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0VE8-0001PD-F1 for patchwork-qemu-devel@patchwork.kernel.org; Wed, 21 Aug 2019 14:20:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41309) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0URi-0001f7-Mm for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i0URg-00089h-OC for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:54 -0400 Received: from mail-yw1-xc43.google.com ([2607:f8b0:4864:20::c43]:45841) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i0URg-00085i-J5 for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:52 -0400 Received: by mail-yw1-xc43.google.com with SMTP id n69so1222558ywd.12 for ; Wed, 21 Aug 2019 10:30:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=OaEXlIcC0ElEqv7wBsTi+9DAensG0Cger0elzEwwNHA=; b=YzmQjkGEO7nWBErQaln8vXMigSGwdbnVK8M+acJssDOD5d4yOxP/9N7XTKyw3w+xsm l25/8nNFhZKzLq/QowzXOIhjjVqbT5mGw5W2T1nUtBrM/y32Kqz6zSR7hmRKdqUWe7Dc zxKG46NeQrVDesCuR4f3/wK7qVqhnOJMvsw3DdGF+gkpWl7CTVr9+0jG6Yspk9A7+ye5 nQNxX7/MDrjPKeY1MNIS4HpIla/gEYCoCvdLZZdDMBq/v7ow3USbXZqdEFoI7kXwdjKI CZxqjWarZis2OXY1Zs5EzjsYBAwan9Z/spv5FMTLg0gnVhbS7tvV8vC1g/VufsO1qvem +4bQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=OaEXlIcC0ElEqv7wBsTi+9DAensG0Cger0elzEwwNHA=; b=i0lYGoBR8fThsO/m2EQXSXDXUutn3n01NgW4NgABh+DkxXRbcM8Nqwb5Vz17yDs5No nFWK40Pt3xvd2EwOCT2MxlgSHbBJD4tXndqEk34kW2G9aAwVpNLLzfNhdLo7jGmGUzlN zD8VnI0c73mIcGCDitFSiIwFeO8ZYGdJL1I49J29C2GmxjeyeLNEAUXM0CPZ5c6LbXZj Z5zG49J0mOjJxxV5QPLGsczvEDnzj/rXivGl9puSoi1O+Fc+jg9NMFAUdKLy39iFbjC4 ZRbmKjJIo4kUQwKVIXIU4hpJTk9j9J+9GTXTQPWszyV4Mkd5+Jme0Mo1l5FeXfVoBPBu XiyQ== X-Gm-Message-State: APjAAAUHu8YYf0BG2RKzM0KyYmA7McP3EKH5UOpZrJxZ42TIhvJqE5KC VVcPrspZMRJ3SARsyG5eXRfxs6f3 X-Google-Smtp-Source: APXvYqwqYxPi6W72+vzq1jg+NSwl/ZaBco+kPHlxAroiFb1WzIX80lLL2RFNOG7egG8FmIFOYVsGag== X-Received: by 2002:a81:9293:: with SMTP id j141mr25650180ywg.363.1566408649045; Wed, 21 Aug 2019 10:30:49 -0700 (PDT) Received: from localhost.localdomain ([2601:c0:c67f:e390::3]) by smtp.gmail.com with ESMTPSA id l71sm2826167ywl.39.2019.08.21.10.30.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Aug 2019 10:30:48 -0700 (PDT) From: Jan Bobek To: qemu-devel@nongnu.org Date: Wed, 21 Aug 2019 13:29:27 -0400 Message-Id: <20190821172951.15333-52-jan.bobek@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190821172951.15333-1-jan.bobek@gmail.com> References: <20190821172951.15333-1-jan.bobek@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::c43 Subject: [Qemu-devel] [RFC PATCH v4 51/75] target/i386: introduce SSE4.1 translators X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jan Bobek , =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Use the translator macros to define translators required by SSE4.1 instructions. Signed-off-by: Jan Bobek --- target/i386/translate.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/target/i386/translate.c b/target/i386/translate.c index f43e9b1ba4..110b963215 100644 --- a/target/i386/translate.c +++ b/target/i386/translate.c @@ -6617,8 +6617,10 @@ DEF_TRANSLATE_INSN2(Vdq, Mdq) DEF_TRANSLATE_INSN2(Vdq, Nq) DEF_TRANSLATE_INSN2(Vdq, Qq) DEF_TRANSLATE_INSN2(Vdq, Udq) +DEF_TRANSLATE_INSN2(Vdq, Wd) DEF_TRANSLATE_INSN2(Vdq, Wdq) DEF_TRANSLATE_INSN2(Vdq, Wq) +DEF_TRANSLATE_INSN2(Vdq, Ww) DEF_TRANSLATE_INSN2(Vq, Ed) DEF_TRANSLATE_INSN2(Vq, Eq) DEF_TRANSLATE_INSN2(Vq, Wd) @@ -6666,6 +6668,8 @@ DEF_TRANSLATE_INSN2(modrm_mod, modrm) } \ } +DEF_TRANSLATE_INSN3(Ed, Vdq, Ib) +DEF_TRANSLATE_INSN3(Eq, Vdq, Ib) DEF_TRANSLATE_INSN3(Gd, Nq, Ib) DEF_TRANSLATE_INSN3(Gd, Udq, Ib) DEF_TRANSLATE_INSN3(Gq, Nq, Ib) @@ -6674,8 +6678,11 @@ DEF_TRANSLATE_INSN3(Nq, Nq, Ib) DEF_TRANSLATE_INSN3(Pq, Pq, Qd) DEF_TRANSLATE_INSN3(Pq, Pq, Qq) DEF_TRANSLATE_INSN3(Pq, Qq, Ib) +DEF_TRANSLATE_INSN3(RdMb, Vdq, Ib) +DEF_TRANSLATE_INSN3(RdMw, Vdq, Ib) DEF_TRANSLATE_INSN3(Udq, Udq, Ib) DEF_TRANSLATE_INSN3(Vd, Vd, Wd) +DEF_TRANSLATE_INSN3(Vd, Wd, Ib) DEF_TRANSLATE_INSN3(Vdq, Vdq, Mq) DEF_TRANSLATE_INSN3(Vdq, Vdq, UdqMhq) DEF_TRANSLATE_INSN3(Vdq, Vdq, Wdq) @@ -6683,6 +6690,7 @@ DEF_TRANSLATE_INSN3(Vdq, Vq, Mq) DEF_TRANSLATE_INSN3(Vdq, Vq, Wq) DEF_TRANSLATE_INSN3(Vdq, Wdq, Ib) DEF_TRANSLATE_INSN3(Vq, Vq, Wq) +DEF_TRANSLATE_INSN3(Vq, Wq, Ib) #define DEF_TRANSLATE_INSN4(opT1, opT2, opT3, opT4) \ static void translate_insn4(opT1, opT2, opT3, opT4)( \ @@ -6731,7 +6739,11 @@ DEF_TRANSLATE_INSN3(Vq, Vq, Wq) DEF_TRANSLATE_INSN4(Pq, Pq, Qq, Ib) DEF_TRANSLATE_INSN4(Pq, Pq, RdMw, Ib) DEF_TRANSLATE_INSN4(Vd, Vd, Wd, Ib) +DEF_TRANSLATE_INSN4(Vdq, Vdq, Ed, Ib) +DEF_TRANSLATE_INSN4(Vdq, Vdq, Eq, Ib) +DEF_TRANSLATE_INSN4(Vdq, Vdq, RdMb, Ib) DEF_TRANSLATE_INSN4(Vdq, Vdq, RdMw, Ib) +DEF_TRANSLATE_INSN4(Vdq, Vdq, Wd, Ib) DEF_TRANSLATE_INSN4(Vdq, Vdq, Wd, modrm_mod) DEF_TRANSLATE_INSN4(Vdq, Vdq, Wdq, Ib) DEF_TRANSLATE_INSN4(Vdq, Vdq, Wq, modrm_mod) From patchwork Wed Aug 21 17:29:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Bobek X-Patchwork-Id: 11107857 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 00C3E1395 for ; Wed, 21 Aug 2019 18:21:03 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BD25022D6D for ; Wed, 21 Aug 2019 18:21:02 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="LpOmLS+n" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BD25022D6D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:51626 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0VED-0001YX-8L for patchwork-qemu-devel@patchwork.kernel.org; Wed, 21 Aug 2019 14:21:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41342) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0URk-0001gI-MR for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i0URi-0008EP-MF for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:56 -0400 Received: from mail-yw1-xc43.google.com ([2607:f8b0:4864:20::c43]:42661) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i0URg-00087A-Mh for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:54 -0400 Received: by mail-yw1-xc43.google.com with SMTP id z63so1230585ywz.9 for ; Wed, 21 Aug 2019 10:30:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=1jERwIPIqXMfT3UR8I7azk7/2A3NcFEkOETXPyGFr8o=; b=LpOmLS+n0P3+DivJVz2taSpvPj74nEHpRTEh4sCRo6rXU86hfyTSyUaIzt5oeeatT2 U9O+rT14qwQs9v8ZhOYBmtOaMHXslf6VF3FLhE9hjoV6soMKzzhd1u/A11U/k42ThbwE i4Q1fsrD8bkB6JHDWCaLGpO62Sm2t9P38p6cLme2frwNAdfZyAMEQIC4uE83E7dEcQ+3 H3EX50wAfPuLy7TU0bxVMQ5zr1BDRfZ2Wf5WI+s5R1VV273lgDdjzf1D3XSbZgVeCcBe nJRUy+V8kxsbWdm7Gn402t5wJnc5rGXsoy7yzxvY08f0gqTxrN7b9FM6LKPOQJGVY7dp 0+fA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=1jERwIPIqXMfT3UR8I7azk7/2A3NcFEkOETXPyGFr8o=; b=NeMkAAlzh63Oo1xCRMQXqtTgV8RwZCJJcXtKVHgWMeFlRtWVQPMzATq3068rnUyK07 +UJeVke/uqJRVK5MWkw1yFKOdAE7mjEPe7TXQsXCxSzb7SKpOy6pOKiaiSaVT2B072f0 7etqjDR5T+Rth54/aIUNZO1QEAVj36sYsPs+lWGgvSDE/e05tZ/MIb+cIZDt+UwMZQN9 YlpCXvcNOjKWcJK5KDlSWFUi6tAADRTNcAFGJJliglkNUvbI68ZaaJKaMlc+FJEcH2n0 rP68EmNZliIs0YNfN6/GHnQA1t/drG8Ws8RaAFpbbLZz5Uml1brXeHBBWuqG6Q9b4JJy CBDg== X-Gm-Message-State: APjAAAXKfRRhzCIGMA2Z/HEu0s7QHWlFDgVb1+r6JWbp48vLVHTUCiW3 UGxWAKqCG3bATv7VMkAyw/kABwqq X-Google-Smtp-Source: APXvYqxRTQfxe19p5KLnxefQbMair6pwd8TF0o2/y/oNl1shxW2bEeiU1awvbTvfvwVQ66F4Pz30iw== X-Received: by 2002:a81:918c:: with SMTP id i134mr15564634ywg.65.1566408650130; Wed, 21 Aug 2019 10:30:50 -0700 (PDT) Received: from localhost.localdomain ([2601:c0:c67f:e390::3]) by smtp.gmail.com with ESMTPSA id l71sm2826167ywl.39.2019.08.21.10.30.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Aug 2019 10:30:49 -0700 (PDT) From: Jan Bobek To: qemu-devel@nongnu.org Date: Wed, 21 Aug 2019 13:29:28 -0400 Message-Id: <20190821172951.15333-53-jan.bobek@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190821172951.15333-1-jan.bobek@gmail.com> References: <20190821172951.15333-1-jan.bobek@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::c43 Subject: [Qemu-devel] [RFC PATCH v4 52/75] target/i386: introduce SSE4.1 code generators X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jan Bobek , =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Introduce code generators required by SSE4.1 instructions. Signed-off-by: Jan Bobek --- target/i386/translate.c | 101 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 101 insertions(+) diff --git a/target/i386/translate.c b/target/i386/translate.c index 110b963215..3ff063b701 100644 --- a/target/i386/translate.c +++ b/target/i386/translate.c @@ -5919,10 +5919,12 @@ DEF_GEN_INSN3_HELPER_EPP(addsubpd, addsubpd, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(pmullw, pmullw_mmx, Pq, Pq, Qq) DEF_GEN_INSN3_HELPER_EPP(pmullw, pmullw_xmm, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(pmulld, pmulld_xmm, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(pmulhw, pmulhw_mmx, Pq, Pq, Qq) DEF_GEN_INSN3_HELPER_EPP(pmulhw, pmulhw_xmm, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(pmulhuw, pmulhuw_mmx, Pq, Pq, Qq) DEF_GEN_INSN3_HELPER_EPP(pmulhuw, pmulhuw_xmm, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(pmuldq, pmuldq_xmm, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(pmuludq, pmuludq_mmx, Pq, Pq, Qq) DEF_GEN_INSN3_HELPER_EPP(pmuludq, pmuludq_xmm, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(pmulhrsw, pmulhrsw_mmx, Pq, Pq, Qq) @@ -5952,16 +5954,25 @@ DEF_GEN_INSN2_HELPER_EPP(rsqrtss, rsqrtss, Vd, Wd) DEF_GEN_INSN3_GVEC(pminub, Pq, Pq, Qq, umin, MM_OPRSZ, MM_MAXSZ, MO_8) DEF_GEN_INSN3_GVEC(pminub, Vdq, Vdq, Wdq, umin, XMM_OPRSZ, XMM_MAXSZ, MO_8) +DEF_GEN_INSN3_GVEC(pminuw, Vdq, Vdq, Wdq, umin, XMM_OPRSZ, XMM_MAXSZ, MO_16) +DEF_GEN_INSN3_GVEC(pminud, Vdq, Vdq, Wdq, umin, XMM_OPRSZ, XMM_MAXSZ, MO_32) +DEF_GEN_INSN3_GVEC(pminsb, Vdq, Vdq, Wdq, smin, XMM_OPRSZ, XMM_MAXSZ, MO_8) DEF_GEN_INSN3_GVEC(pminsw, Pq, Pq, Qq, smin, MM_OPRSZ, MM_MAXSZ, MO_16) DEF_GEN_INSN3_GVEC(pminsw, Vdq, Vdq, Wdq, smin, XMM_OPRSZ, XMM_MAXSZ, MO_16) +DEF_GEN_INSN3_GVEC(pminsd, Vdq, Vdq, Wdq, smin, XMM_OPRSZ, XMM_MAXSZ, MO_32) DEF_GEN_INSN3_HELPER_EPP(minps, minps, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(minpd, minpd, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(minss, minss, Vd, Vd, Wd) DEF_GEN_INSN3_HELPER_EPP(minsd, minsd, Vq, Vq, Wq) +DEF_GEN_INSN2_HELPER_EPP(phminposuw, phminposuw_xmm, Vdq, Wdq) DEF_GEN_INSN3_GVEC(pmaxub, Pq, Pq, Qq, umax, MM_OPRSZ, MM_MAXSZ, MO_8) DEF_GEN_INSN3_GVEC(pmaxub, Vdq, Vdq, Wdq, umax, XMM_OPRSZ, XMM_MAXSZ, MO_8) +DEF_GEN_INSN3_GVEC(pmaxuw, Vdq, Vdq, Wdq, umax, XMM_OPRSZ, XMM_MAXSZ, MO_16) +DEF_GEN_INSN3_GVEC(pmaxud, Vdq, Vdq, Wdq, umax, XMM_OPRSZ, XMM_MAXSZ, MO_32) +DEF_GEN_INSN3_GVEC(pmaxsb, Vdq, Vdq, Wdq, smax, XMM_OPRSZ, XMM_MAXSZ, MO_8) DEF_GEN_INSN3_GVEC(pmaxsw, Pq, Pq, Qq, smax, MM_OPRSZ, MM_MAXSZ, MO_16) DEF_GEN_INSN3_GVEC(pmaxsw, Vdq, Vdq, Wdq, smax, XMM_OPRSZ, XMM_MAXSZ, MO_16) +DEF_GEN_INSN3_GVEC(pmaxsd, Vdq, Vdq, Wdq, smax, XMM_OPRSZ, XMM_MAXSZ, MO_32) DEF_GEN_INSN3_HELPER_EPP(maxps, maxps, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(maxpd, maxpd, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(maxss, maxss, Vd, Vd, Wd) @@ -5972,6 +5983,7 @@ DEF_GEN_INSN3_HELPER_EPP(pavgw, pavgw_mmx, Pq, Pq, Qq) DEF_GEN_INSN3_HELPER_EPP(pavgw, pavgw_xmm, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(psadbw, psadbw_mmx, Pq, Pq, Qq) DEF_GEN_INSN3_HELPER_EPP(psadbw, psadbw_xmm, Vdq, Vdq, Wdq) +DEF_GEN_INSN4_HELPER_EPPI(mpsadbw, mpsadbw_xmm, Vdq, Vdq, Wdq, Ib) DEF_GEN_INSN2_HELPER_EPP(pabsb, pabsb_mmx, Pq, Qq) DEF_GEN_INSN2_HELPER_EPP(pabsb, pabsb_xmm, Vdq, Wdq) DEF_GEN_INSN2_HELPER_EPP(pabsw, pabsw_mmx, Pq, Qq) @@ -5985,12 +5997,20 @@ DEF_GEN_INSN3_HELPER_EPP(psignw, psignw_xmm, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(psignd, psignd_mmx, Pq, Pq, Qq) DEF_GEN_INSN3_HELPER_EPP(psignd, psignd_xmm, Vdq, Vdq, Wdq) +DEF_GEN_INSN4_HELPER_EPPI(dpps, dpps_xmm, Vdq, Vdq, Wdq, Ib) +DEF_GEN_INSN4_HELPER_EPPI(dppd, dppd_xmm, Vdq, Vdq, Wdq, Ib) +DEF_GEN_INSN3_HELPER_EPPI(roundps, roundps_xmm, Vdq, Wdq, Ib) +DEF_GEN_INSN3_HELPER_EPPI(roundpd, roundpd_xmm, Vdq, Wdq, Ib) +DEF_GEN_INSN3_HELPER_EPPI(roundss, roundss_xmm, Vd, Wd, Ib) +DEF_GEN_INSN3_HELPER_EPPI(roundsd, roundsd_xmm, Vq, Wq, Ib) + DEF_GEN_INSN3_GVEC(pcmpeqb, Pq, Pq, Qq, cmp, MM_OPRSZ, MM_MAXSZ, MO_8, TCG_COND_EQ) DEF_GEN_INSN3_GVEC(pcmpeqb, Vdq, Vdq, Wdq, cmp, XMM_OPRSZ, XMM_MAXSZ, MO_8, TCG_COND_EQ) DEF_GEN_INSN3_GVEC(pcmpeqw, Pq, Pq, Qq, cmp, MM_OPRSZ, MM_MAXSZ, MO_16, TCG_COND_EQ) DEF_GEN_INSN3_GVEC(pcmpeqw, Vdq, Vdq, Wdq, cmp, XMM_OPRSZ, XMM_MAXSZ, MO_16, TCG_COND_EQ) DEF_GEN_INSN3_GVEC(pcmpeqd, Pq, Pq, Qq, cmp, MM_OPRSZ, MM_MAXSZ, MO_32, TCG_COND_EQ) DEF_GEN_INSN3_GVEC(pcmpeqd, Vdq, Vdq, Wdq, cmp, XMM_OPRSZ, XMM_MAXSZ, MO_32, TCG_COND_EQ) +DEF_GEN_INSN3_GVEC(pcmpeqq, Vdq, Vdq, Wdq, cmp, XMM_OPRSZ, XMM_MAXSZ, MO_64, TCG_COND_EQ) DEF_GEN_INSN3_GVEC(pcmpgtb, Pq, Pq, Qq, cmp, MM_OPRSZ, MM_MAXSZ, MO_8, TCG_COND_GT) DEF_GEN_INSN3_GVEC(pcmpgtb, Vdq, Vdq, Wdq, cmp, XMM_OPRSZ, XMM_MAXSZ, MO_8, TCG_COND_GT) DEF_GEN_INSN3_GVEC(pcmpgtw, Pq, Pq, Qq, cmp, MM_OPRSZ, MM_MAXSZ, MO_16, TCG_COND_GT) @@ -5998,6 +6018,8 @@ DEF_GEN_INSN3_GVEC(pcmpgtw, Vdq, Vdq, Wdq, cmp, XMM_OPRSZ, XMM_MAXSZ, MO_16, TCG DEF_GEN_INSN3_GVEC(pcmpgtd, Pq, Pq, Qq, cmp, MM_OPRSZ, MM_MAXSZ, MO_32, TCG_COND_GT) DEF_GEN_INSN3_GVEC(pcmpgtd, Vdq, Vdq, Wdq, cmp, XMM_OPRSZ, XMM_MAXSZ, MO_32, TCG_COND_GT) +DEF_GEN_INSN2_HELPER_EPP(ptest, ptest_xmm, Vdq, Wdq) + DEF_GEN_INSN3_HELPER_EPP(cmpeqps, cmpeqps, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(cmpeqpd, cmpeqpd, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(cmpeqss, cmpeqss, Vd, Vd, Wd) @@ -6253,6 +6275,7 @@ DEF_GEN_INSN3_HELPER_EPP(packssdw, packssdw_mmx, Pq, Pq, Qq) DEF_GEN_INSN3_HELPER_EPP(packssdw, packssdw_xmm, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(packuswb, packuswb_mmx, Pq, Pq, Qq) DEF_GEN_INSN3_HELPER_EPP(packuswb, packuswb_xmm, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(packusdw, packusdw_xmm, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(punpcklbw, punpcklbw_mmx, Pq, Pq, Qd) DEF_GEN_INSN3_HELPER_EPP(punpcklbw, punpcklbw_xmm, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(punpcklwd, punpcklwd_mmx, Pq, Pq, Qd) @@ -6282,6 +6305,28 @@ DEF_GEN_INSN3_HELPER_PPI(pshufd, pshufd_xmm, Vdq, Wdq, Ib) DEF_GEN_INSN4_HELPER_PPI(shufps, shufps, Vdq, Vdq, Wdq, Ib) DEF_GEN_INSN4_HELPER_PPI(shufpd, shufpd, Vdq, Vdq, Wdq, Ib) +DEF_GEN_INSN4_HELPER_EPPI(blendps, blendps_xmm, Vdq, Vdq, Wdq, Ib) +DEF_GEN_INSN4_HELPER_EPPI(blendpd, blendpd_xmm, Vdq, Vdq, Wdq, Ib) +DEF_GEN_INSN3_HELPER_EPP(blendvps, blendvps_xmm, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(blendvpd, blendvpd_xmm, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(pblendvb, pblendvb_xmm, Vdq, Vdq, Wdq) +DEF_GEN_INSN4_HELPER_EPPI(pblendw, pblendw_xmm, Vdq, Vdq, Wdq, Ib) + +GEN_INSN4(insertps, Vdq, Vdq, Wd, Ib) +{ + assert(arg1 == arg2); + + const size_t dofs = offsetof(ZMMReg, ZMM_L(arg4 & 3)); + const size_t aofs = offsetof(ZMMReg, ZMM_L(0)); + gen_op_movl(s, arg1 + dofs, arg3 + aofs); +} +GEN_INSN4(pinsrb, Vdq, Vdq, RdMb, Ib) +{ + assert(arg1 == arg2); + + const size_t ofs = offsetof(ZMMReg, ZMM_B(arg4 & 15)); + tcg_gen_st8_i32(arg3, cpu_env, arg1 + ofs); +} GEN_INSN4(pinsrw, Pq, Pq, RdMw, Ib) { assert(arg1 == arg2); @@ -6296,7 +6341,46 @@ GEN_INSN4(pinsrw, Vdq, Vdq, RdMw, Ib) const size_t ofs = offsetof(ZMMReg, ZMM_W(arg4 & 7)); tcg_gen_st16_i32(arg3, cpu_env, arg1 + ofs); } +GEN_INSN4(pinsrd, Vdq, Vdq, Ed, Ib) +{ + assert(arg1 == arg2); + const size_t ofs = offsetof(ZMMReg, ZMM_L(arg4 & 3)); + tcg_gen_st_i32(arg3, cpu_env, arg1 + ofs); +} +GEN_INSN4(pinsrq, Vdq, Vdq, Eq, Ib) +{ + assert(arg1 == arg2); + + const size_t ofs = offsetof(ZMMReg, ZMM_Q(arg4 & 1)); + tcg_gen_st_i64(arg3, cpu_env, arg1 + ofs); +} + +GEN_INSN3(extractps, Ed, Vdq, Ib) +{ + const size_t ofs = offsetof(ZMMReg, ZMM_L(arg3 & 3)); + tcg_gen_ld_i32(arg1, cpu_env, arg2 + ofs); +} +GEN_INSN3(pextrb, RdMb, Vdq, Ib) +{ + const size_t ofs = offsetof(ZMMReg, ZMM_B(arg3 & 15)); + tcg_gen_ld8u_i32(arg1, cpu_env, arg2 + ofs); +} +GEN_INSN3(pextrw, RdMw, Vdq, Ib) +{ + const size_t ofs = offsetof(ZMMReg, ZMM_W(arg3 & 7)); + tcg_gen_ld16u_i32(arg1, cpu_env, arg2 + ofs); +} +GEN_INSN3(pextrd, Ed, Vdq, Ib) +{ + const size_t ofs = offsetof(ZMMReg, ZMM_L(arg3 & 3)); + tcg_gen_ld_i32(arg1, cpu_env, arg2 + ofs); +} +GEN_INSN3(pextrq, Eq, Vdq, Ib) +{ + const size_t ofs = offsetof(ZMMReg, ZMM_Q(arg3 & 1)); + tcg_gen_ld_i64(arg1, cpu_env, arg2 + ofs); +} GEN_INSN3(pextrw, Gd, Nq, Ib) { const size_t ofs = offsetof(MMXReg, MMX_W(arg3 & 3)); @@ -6318,6 +6402,19 @@ GEN_INSN3(pextrw, Gq, Udq, Ib) tcg_gen_ld16u_i64(arg1, cpu_env, arg2 + ofs); } +DEF_GEN_INSN2_HELPER_EPP(pmovsxbw, pmovsxbw_xmm, Vdq, Wq) +DEF_GEN_INSN2_HELPER_EPP(pmovsxbd, pmovsxbd_xmm, Vdq, Wd) +DEF_GEN_INSN2_HELPER_EPP(pmovsxbq, pmovsxbq_xmm, Vdq, Ww) +DEF_GEN_INSN2_HELPER_EPP(pmovsxwd, pmovsxwd_xmm, Vdq, Wq) +DEF_GEN_INSN2_HELPER_EPP(pmovsxwq, pmovsxwq_xmm, Vdq, Wd) +DEF_GEN_INSN2_HELPER_EPP(pmovsxdq, pmovsxdq_xmm, Vdq, Wq) +DEF_GEN_INSN2_HELPER_EPP(pmovzxbw, pmovzxbw_xmm, Vdq, Wq) +DEF_GEN_INSN2_HELPER_EPP(pmovzxbd, pmovzxbd_xmm, Vdq, Wd) +DEF_GEN_INSN2_HELPER_EPP(pmovzxbq, pmovzxbq_xmm, Vdq, Ww) +DEF_GEN_INSN2_HELPER_EPP(pmovzxwd, pmovzxwd_xmm, Vdq, Wq) +DEF_GEN_INSN2_HELPER_EPP(pmovzxwq, pmovzxwq_xmm, Vdq, Wd) +DEF_GEN_INSN2_HELPER_EPP(pmovzxdq, pmovzxdq_xmm, Vdq, Wq) + DEF_GEN_INSN2_HELPER_EPP(cvtpi2ps, cvtpi2ps, Vdq, Qq) DEF_GEN_INSN2_HELPER_EPD(cvtsi2ss, cvtsi2ss, Vd, Ed) DEF_GEN_INSN2_HELPER_EPQ(cvtsi2ss, cvtsq2ss, Vd, Eq) @@ -6407,6 +6504,10 @@ GEN_INSN2(movntdq, Mdq, Vdq) { insnop_ldst(xmm, Mdq)(env, s, 1, arg2, arg1); } +GEN_INSN2(movntdqa, Vdq, Mdq) +{ + insnop_ldst(xmm, Mdq)(env, s, 0, arg1, arg2); +} GEN_INSN0(pause) { From patchwork Wed Aug 21 17:29:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Bobek X-Patchwork-Id: 11107865 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 17CED1395 for ; Wed, 21 Aug 2019 18:23:40 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D366A21655 for ; Wed, 21 Aug 2019 18:23:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="PdWPU2L9" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D366A21655 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:51656 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0VGk-0007C4-Es for patchwork-qemu-devel@patchwork.kernel.org; Wed, 21 Aug 2019 14:23:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41361) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0URm-0001gt-Gr for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:31:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i0URi-0008EL-M8 for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:58 -0400 Received: from mail-yw1-xc44.google.com ([2607:f8b0:4864:20::c44]:42662) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i0URg-00088d-NN for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:54 -0400 Received: by mail-yw1-xc44.google.com with SMTP id z63so1230594ywz.9 for ; Wed, 21 Aug 2019 10:30:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=o7fOGW+Cc55NYFbvUmZ6fMX/JBD2BN8yXcVO5+NI94E=; b=PdWPU2L9E7OaEJmp72M5OsZfdqCyF4mWin21qcWlPayrA/oMPRyyOUWI/Jh2cPE62k K0brP6papVg2w9CY0gX4YkzTEbEbm0hQDyekEEDu72OeUyZQbFckic9e+9rqnxXfC7MR YHESZjHNQGEO5Sx0iQRQJlX773LxRSk9BzzTXOsL5CDXn8Qln89aHwov4WgoEjsXDoCW ZJtGrBJmSL4v2D8rcHc1EiYIXDL1/yq/mWC+/opkn1Xlgkngj0kOsdDXqYadbSEUNtCC lIVSH3xfuhj5vMzYYQLdxpBpd0fr4RiM0jBR4BePZ8XxlCOp3vp3kUWshTSuzAiJr7Rd jYgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=o7fOGW+Cc55NYFbvUmZ6fMX/JBD2BN8yXcVO5+NI94E=; b=KE9Pr4rcK/E0CJe+oYsU+dEeYq0uBXo93UOqLSZx/SFWTFYeeOcieiXxygW5XaQ5qP EBqQ0A7nSSLgJ2YMsEEiRiSL20m3053kdBMgpFxUeyKtW8bHejpO2lkhmFjaqSWtfkTe 8xtuMjF1r3l5bEIIwVhzodXeKKX1NGNEjVh1Oa7iCG8MGiZeJqoSWP0/hQcAPntZvJRm dWAc/jy6nCDwhk/Xbd3jaQ/rbh7AVQEI8pOMMKPlwUFXpTOYikA/GMcLZr6zR1E4GHNp mjlOS2TlvOgjHmVx4y/khKByz9PrS8WQHw9tKTfZnnpz7/AaBnuxTZttip5tX/ZgdP6t Cr9w== X-Gm-Message-State: APjAAAWmPRLBdsbDSoEdx7nyEUD7Bjp5YBTe9S9X6rB5jihVGD4gUm1e KJnR02DICSHe3ttdUBjWX0UKHmqz X-Google-Smtp-Source: APXvYqyR68239eN/8fMmsOT6tiDgBPegwz6Vab3+Qvg8CRy0sX8PX0BDjJFFMwWpzsz3Jv2Icgs2RA== X-Received: by 2002:a81:5793:: with SMTP id l141mr23225148ywb.175.1566408650787; Wed, 21 Aug 2019 10:30:50 -0700 (PDT) Received: from localhost.localdomain ([2601:c0:c67f:e390::3]) by smtp.gmail.com with ESMTPSA id l71sm2826167ywl.39.2019.08.21.10.30.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Aug 2019 10:30:50 -0700 (PDT) From: Jan Bobek To: qemu-devel@nongnu.org Date: Wed, 21 Aug 2019 13:29:29 -0400 Message-Id: <20190821172951.15333-54-jan.bobek@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190821172951.15333-1-jan.bobek@gmail.com> References: <20190821172951.15333-1-jan.bobek@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::c44 Subject: [Qemu-devel] [RFC PATCH v4 53/75] target/i386: introduce SSE4.1 vector instructions to sse-opcode.inc.h X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jan Bobek , =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Add all the SSE4.1 vector instruction entries to sse-opcode.inc.h. Signed-off-by: Jan Bobek --- target/i386/sse-opcode.inc.h | 101 +++++++++++++++++++++++++++++++++++ 1 file changed, 101 insertions(+) diff --git a/target/i386/sse-opcode.inc.h b/target/i386/sse-opcode.inc.h index d8ea71aa6c..9682cce7ef 100644 --- a/target/i386/sse-opcode.inc.h +++ b/target/i386/sse-opcode.inc.h @@ -389,6 +389,58 @@ * 66 0F 3A 0F /r ib PALIGNR xmm1, xmm2/m128, imm8 * NP 0F 38 00 /r PSHUFB mm1, mm2/m64 * 66 0F 38 00 /r PSHUFB xmm1, xmm2/m128 + * + * SSE4.1 Instructions + * -------------------- + * 66 0F 38 40 /r PMULLD xmm1, xmm2/m128 + * 66 0F 38 28 /r PMULDQ xmm1, xmm2/m128 + * 66 0F 38 3A /r PMINUW xmm1, xmm2/m128 + * 66 0F 38 3B /r PMINUD xmm1, xmm2/m128 + * 66 0F 38 38 /r PMINSB xmm1, xmm2/m128 + * 66 0F 38 39 /r PMINSD xmm1, xmm2/m128 + * 66 0F 38 41 /r PHMINPOSUW xmm1, xmm2/m128 + * 66 0F 38 3E /r PMAXUW xmm1, xmm2/m128 + * 66 0F 38 3F /r PMAXUD xmm1, xmm2/m128 + * 66 0F 38 3C /r PMAXSB xmm1, xmm2/m128 + * 66 0F 38 3D /r PMAXSD xmm1, xmm2/m128 + * 66 0F 3A 42 /r ib MPSADBW xmm1, xmm2/m128, imm8 + * 66 0F 3A 40 /r ib DPPS xmm1, xmm2/m128, imm8 + * 66 0F 3A 41 /r ib DPPD xmm1, xmm2/m128, imm8 + * 66 0F 3A 08 /r ib ROUNDPS xmm1, xmm2/m128, imm8 + * 66 0F 3A 09 /r ib ROUNDPD xmm1, xmm2/m128, imm8 + * 66 0F 3A 0A /r ib ROUNDSS xmm1, xmm2/m32, imm8 + * 66 0F 3A 0B /r ib ROUNDSD xmm1, xmm2/m64, imm8 + * 66 0F 38 29 /r PCMPEQQ xmm1, xmm2/m128 + * 66 0F 38 17 /r PTEST xmm1, xmm2/m128 + * 66 0F 38 2B /r PACKUSDW xmm1, xmm2/m128 + * 66 0F 3A 0C /r ib BLENDPS xmm1, xmm2/m128, imm8 + * 66 0F 3A 0D /r ib BLENDPD xmm1, xmm2/m128, imm8 + * 66 0F 38 14 /r BLENDVPS xmm1, xmm2/m128, + * 66 0F 38 15 /r BLENDVPD xmm1, xmm2/m128 , + * 66 0F 38 10 /r PBLENDVB xmm1, xmm2/m128, + * 66 0F 3A 0E /r ib PBLENDW xmm1, xmm2/m128, imm8 + * 66 0F 3A 21 /r ib INSERTPS xmm1, xmm2/m32, imm8 + * 66 0F 3A 20 /r ib PINSRB xmm1,r32/m8,imm8 + * 66 0F 3A 22 /r ib PINSRD xmm1,r/m32,imm8 + * 66 REX.W 0F 3A 22 /r ib PINSRQ xmm1,r/m64,imm8 + * 66 0F 3A 17 /r ib EXTRACTPS reg/m32, xmm1, imm8 + * 66 0F 3A 14 /r ib PEXTRB r32/m8,xmm2,imm8 + * 66 0F 3A 15 /r ib PEXTRW r32/m16, xmm, imm8 + * 66 0F 3A 16 /r ib PEXTRD r/m32,xmm2,imm8 + * 66 REX.W 0F 3A 16 /r ib PEXTRQ r/m64,xmm2,imm8 + * 66 0f 38 20 /r PMOVSXBW xmm1, xmm2/m64 + * 66 0f 38 21 /r PMOVSXBD xmm1, xmm2/m32 + * 66 0f 38 22 /r PMOVSXBQ xmm1, xmm2/m16 + * 66 0f 38 23 /r PMOVSXWD xmm1, xmm2/m64 + * 66 0f 38 24 /r PMOVSXWQ xmm1, xmm2/m32 + * 66 0f 38 25 /r PMOVSXDQ xmm1, xmm2/m64 + * 66 0f 38 30 /r PMOVZXBW xmm1, xmm2/m64 + * 66 0f 38 31 /r PMOVZXBD xmm1, xmm2/m32 + * 66 0f 38 32 /r PMOVZXBQ xmm1, xmm2/m16 + * 66 0f 38 33 /r PMOVZXWD xmm1, xmm2/m64 + * 66 0f 38 34 /r PMOVZXWQ xmm1, xmm2/m32 + * 66 0f 38 35 /r PMOVZXDQ xmm1, xmm2/m64 + * 66 0F 38 2A /r MOVNTDQA xmm1, m128 */ OPCODE(movd, LEG(NP, 0F, 0, 0x6e), MMX, WR, Pq, Ed) @@ -501,10 +553,12 @@ OPCODE(addsubps, LEG(F2, 0F, 0, 0xd0), SSE3, WRR, Vdq, Vdq, Wdq) OPCODE(addsubpd, LEG(66, 0F, 0, 0xd0), SSE3, WRR, Vdq, Vdq, Wdq) OPCODE(pmullw, LEG(NP, 0F, 0, 0xd5), MMX, WRR, Pq, Pq, Qq) OPCODE(pmullw, LEG(66, 0F, 0, 0xd5), SSE2, WRR, Vdq, Vdq, Wdq) +OPCODE(pmulld, LEG(66, 0F38, 0, 0x40), SSE4_1, WRR, Vdq, Vdq, Wdq) OPCODE(pmulhw, LEG(NP, 0F, 0, 0xe5), MMX, WRR, Pq, Pq, Qq) OPCODE(pmulhw, LEG(66, 0F, 0, 0xe5), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(pmulhuw, LEG(NP, 0F, 0, 0xe4), SSE, WRR, Pq, Pq, Qq) OPCODE(pmulhuw, LEG(66, 0F, 0, 0xe4), SSE2, WRR, Vdq, Vdq, Wdq) +OPCODE(pmuldq, LEG(66, 0F38, 0, 0x28), SSE4_1, WRR, Vdq, Vdq, Wdq) OPCODE(pmuludq, LEG(NP, 0F, 0, 0xf4), SSE2, WRR, Pq, Pq, Qq) OPCODE(pmuludq, LEG(66, 0F, 0, 0xf4), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(pmulhrsw, LEG(NP, 0F38, 0, 0x0b), SSSE3, WRR, Pq, Pq, Qq) @@ -531,16 +585,25 @@ OPCODE(rsqrtps, LEG(NP, 0F, 0, 0x52), SSE, WR, Vdq, Wdq) OPCODE(rsqrtss, LEG(F3, 0F, 0, 0x52), SSE, WR, Vd, Wd) OPCODE(pminub, LEG(NP, 0F, 0, 0xda), SSE, WRR, Pq, Pq, Qq) OPCODE(pminub, LEG(66, 0F, 0, 0xda), SSE2, WRR, Vdq, Vdq, Wdq) +OPCODE(pminuw, LEG(66, 0F38, 0, 0x3a), SSE4_1, WRR, Vdq, Vdq, Wdq) +OPCODE(pminud, LEG(66, 0F38, 0, 0x3b), SSE4_1, WRR, Vdq, Vdq, Wdq) +OPCODE(pminsb, LEG(66, 0F38, 0, 0x38), SSE4_1, WRR, Vdq, Vdq, Wdq) OPCODE(pminsw, LEG(NP, 0F, 0, 0xea), SSE, WRR, Pq, Pq, Qq) OPCODE(pminsw, LEG(66, 0F, 0, 0xea), SSE2, WRR, Vdq, Vdq, Wdq) +OPCODE(pminsd, LEG(66, 0F38, 0, 0x39), SSE4_1, WRR, Vdq, Vdq, Wdq) OPCODE(minps, LEG(NP, 0F, 0, 0x5d), SSE, WRR, Vdq, Vdq, Wdq) OPCODE(minpd, LEG(66, 0F, 0, 0x5d), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(minss, LEG(F3, 0F, 0, 0x5d), SSE, WRR, Vd, Vd, Wd) OPCODE(minsd, LEG(F2, 0F, 0, 0x5d), SSE2, WRR, Vq, Vq, Wq) +OPCODE(phminposuw, LEG(66, 0F38, 0, 0x41), SSE4_1, WR, Vdq, Wdq) OPCODE(pmaxub, LEG(NP, 0F, 0, 0xde), SSE, WRR, Pq, Pq, Qq) OPCODE(pmaxub, LEG(66, 0F, 0, 0xde), SSE2, WRR, Vdq, Vdq, Wdq) +OPCODE(pmaxuw, LEG(66, 0F38, 0, 0x3e), SSE4_1, WRR, Vdq, Vdq, Wdq) +OPCODE(pmaxud, LEG(66, 0F38, 0, 0x3f), SSE4_1, WRR, Vdq, Vdq, Wdq) +OPCODE(pmaxsb, LEG(66, 0F38, 0, 0x3c), SSE4_1, WRR, Vdq, Vdq, Wdq) OPCODE(pmaxsw, LEG(NP, 0F, 0, 0xee), SSE, WRR, Pq, Pq, Qq) OPCODE(pmaxsw, LEG(66, 0F, 0, 0xee), SSE2, WRR, Vdq, Vdq, Wdq) +OPCODE(pmaxsd, LEG(66, 0F38, 0, 0x3d), SSE4_1, WRR, Vdq, Vdq, Wdq) OPCODE(maxps, LEG(NP, 0F, 0, 0x5f), SSE, WRR, Vdq, Vdq, Wdq) OPCODE(maxpd, LEG(66, 0F, 0, 0x5f), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(maxss, LEG(F3, 0F, 0, 0x5f), SSE, WRR, Vd, Vd, Wd) @@ -551,6 +614,7 @@ OPCODE(pavgw, LEG(NP, 0F, 0, 0xe3), SSE, WRR, Pq, Pq, Qq) OPCODE(pavgw, LEG(66, 0F, 0, 0xe3), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(psadbw, LEG(NP, 0F, 0, 0xf6), SSE, WRR, Pq, Pq, Qq) OPCODE(psadbw, LEG(66, 0F, 0, 0xf6), SSE2, WRR, Vdq, Vdq, Wdq) +OPCODE(mpsadbw, LEG(66, 0F3A, 0, 0x42), SSE4_1, WRRR, Vdq, Vdq, Wdq, Ib) OPCODE(pabsb, LEG(NP, 0F38, 0, 0x1c), SSSE3, WR, Pq, Qq) OPCODE(pabsb, LEG(66, 0F38, 0, 0x1c), SSSE3, WR, Vdq, Wdq) OPCODE(pabsw, LEG(NP, 0F38, 0, 0x1d), SSSE3, WR, Pq, Qq) @@ -563,18 +627,26 @@ OPCODE(psignw, LEG(NP, 0F38, 0, 0x09), SSSE3, WRR, Pq, Pq, Qq) OPCODE(psignw, LEG(66, 0F38, 0, 0x09), SSSE3, WRR, Vdq, Vdq, Wdq) OPCODE(psignd, LEG(NP, 0F38, 0, 0x0a), SSSE3, WRR, Pq, Pq, Qq) OPCODE(psignd, LEG(66, 0F38, 0, 0x0a), SSSE3, WRR, Vdq, Vdq, Wdq) +OPCODE(dpps, LEG(66, 0F3A, 0, 0x40), SSE4_1, WRRR, Vdq, Vdq, Wdq, Ib) +OPCODE(dppd, LEG(66, 0F3A, 0, 0x41), SSE4_1, WRRR, Vdq, Vdq, Wdq, Ib) +OPCODE(roundps, LEG(66, 0F3A, 0, 0x08), SSE4_1, WRR, Vdq, Wdq, Ib) +OPCODE(roundpd, LEG(66, 0F3A, 0, 0x09), SSE4_1, WRR, Vdq, Wdq, Ib) +OPCODE(roundss, LEG(66, 0F3A, 0, 0x0a), SSE4_1, WRR, Vd, Wd, Ib) +OPCODE(roundsd, LEG(66, 0F3A, 0, 0x0b), SSE4_1, WRR, Vq, Wq, Ib) OPCODE(pcmpeqb, LEG(NP, 0F, 0, 0x74), MMX, WRR, Pq, Pq, Qq) OPCODE(pcmpeqb, LEG(66, 0F, 0, 0x74), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(pcmpeqw, LEG(NP, 0F, 0, 0x75), MMX, WRR, Pq, Pq, Qq) OPCODE(pcmpeqw, LEG(66, 0F, 0, 0x75), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(pcmpeqd, LEG(NP, 0F, 0, 0x76), MMX, WRR, Pq, Pq, Qq) OPCODE(pcmpeqd, LEG(66, 0F, 0, 0x76), SSE2, WRR, Vdq, Vdq, Wdq) +OPCODE(pcmpeqq, LEG(66, 0F38, 0, 0x29), SSE4_1, WRR, Vdq, Vdq, Wdq) OPCODE(pcmpgtb, LEG(NP, 0F, 0, 0x64), MMX, WRR, Pq, Pq, Qq) OPCODE(pcmpgtb, LEG(66, 0F, 0, 0x64), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(pcmpgtw, LEG(NP, 0F, 0, 0x65), MMX, WRR, Pq, Pq, Qq) OPCODE(pcmpgtw, LEG(66, 0F, 0, 0x65), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(pcmpgtd, LEG(NP, 0F, 0, 0x66), MMX, WRR, Pq, Pq, Qq) OPCODE(pcmpgtd, LEG(66, 0F, 0, 0x66), SSE2, WRR, Vdq, Vdq, Wdq) +OPCODE(ptest, LEG(66, 0F38, 0, 0x17), SSE4_1, RR, Vdq, Wdq) OPCODE(cmpps, LEG(NP, 0F, 0, 0xc2), SSE, WRRR, Vdq, Vdq, Wdq, Ib) OPCODE(cmppd, LEG(66, 0F, 0, 0xc2), SSE2, WRRR, Vdq, Vdq, Wdq, Ib) OPCODE(cmpss, LEG(F3, 0F, 0, 0xc2), SSE, WRRR, Vd, Vd, Wd, Ib) @@ -623,6 +695,7 @@ OPCODE(packssdw, LEG(NP, 0F, 0, 0x6b), MMX, WRR, Pq, Pq, Qq) OPCODE(packssdw, LEG(66, 0F, 0, 0x6b), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(packuswb, LEG(NP, 0F, 0, 0x67), MMX, WRR, Pq, Pq, Qq) OPCODE(packuswb, LEG(66, 0F, 0, 0x67), SSE2, WRR, Vdq, Vdq, Wdq) +OPCODE(packusdw, LEG(66, 0F38, 0, 0x2b), SSE4_1, WRR, Vdq, Vdq, Wdq) OPCODE(punpckhbw, LEG(NP, 0F, 0, 0x68), MMX, WRR, Pq, Pq, Qq) OPCODE(punpckhbw, LEG(66, 0F, 0, 0x68), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(punpckhwd, LEG(NP, 0F, 0, 0x69), MMX, WRR, Pq, Pq, Qq) @@ -649,12 +722,39 @@ OPCODE(pshufhw, LEG(F3, 0F, 0, 0x70), SSE2, WRR, Vdq, Wdq, Ib) OPCODE(pshufd, LEG(66, 0F, 0, 0x70), SSE2, WRR, Vdq, Wdq, Ib) OPCODE(shufps, LEG(NP, 0F, 0, 0xc6), SSE, WRRR, Vdq, Vdq, Wdq, Ib) OPCODE(shufpd, LEG(66, 0F, 0, 0xc6), SSE2, WRRR, Vdq, Vdq, Wdq, Ib) +OPCODE(blendps, LEG(66, 0F3A, 0, 0x0c), SSE4_1, WRRR, Vdq, Vdq, Wdq, Ib) +OPCODE(blendpd, LEG(66, 0F3A, 0, 0x0d), SSE4_1, WRRR, Vdq, Vdq, Wdq, Ib) +OPCODE(blendvps, LEG(66, 0F38, 0, 0x14), SSE4_1, WRR, Vdq, Vdq, Wdq) +OPCODE(blendvpd, LEG(66, 0F38, 0, 0x15), SSE4_1, WRR, Vdq, Vdq, Wdq) +OPCODE(pblendvb, LEG(66, 0F38, 0, 0x10), SSE4_1, WRR, Vdq, Vdq, Wdq) +OPCODE(pblendw, LEG(66, 0F3A, 0, 0x0e), SSE4_1, WRRR, Vdq, Vdq, Wdq, Ib) +OPCODE(insertps, LEG(66, 0F3A, 0, 0x21), SSE4_1, WRRR, Vdq, Vdq, Wd, Ib) +OPCODE(pinsrb, LEG(66, 0F3A, 0, 0x20), SSE4_1, WRRR, Vdq, Vdq, RdMb, Ib) OPCODE(pinsrw, LEG(NP, 0F, 0, 0xc4), SSE, WRRR, Pq, Pq, RdMw, Ib) OPCODE(pinsrw, LEG(66, 0F, 0, 0xc4), SSE2, WRRR, Vdq, Vdq, RdMw, Ib) +OPCODE(pinsrd, LEG(66, 0F3A, 0, 0x22), SSE4_1, WRRR, Vdq, Vdq, Ed, Ib) +OPCODE(pinsrq, LEG(66, 0F3A, 1, 0x22), SSE4_1, WRRR, Vdq, Vdq, Eq, Ib) +OPCODE(extractps, LEG(66, 0F3A, 0, 0x17), SSE4_1, WRR, Ed, Vdq, Ib) +OPCODE(pextrb, LEG(66, 0F3A, 0, 0x14), SSE4_1, WRR, RdMb, Vdq, Ib) +OPCODE(pextrw, LEG(66, 0F3A, 0, 0x15), SSE4_1, WRR, RdMw, Vdq, Ib) +OPCODE(pextrd, LEG(66, 0F3A, 0, 0x16), SSE4_1, WRR, Ed, Vdq, Ib) +OPCODE(pextrq, LEG(66, 0F3A, 1, 0x16), SSE4_1, WRR, Eq, Vdq, Ib) OPCODE(pextrw, LEG(NP, 0F, 0, 0xc5), SSE, WRR, Gd, Nq, Ib) OPCODE(pextrw, LEG(NP, 0F, 1, 0xc5), SSE, WRR, Gq, Nq, Ib) OPCODE(pextrw, LEG(66, 0F, 0, 0xc5), SSE2, WRR, Gd, Udq, Ib) OPCODE(pextrw, LEG(66, 0F, 1, 0xc5), SSE2, WRR, Gq, Udq, Ib) +OPCODE(pmovsxbw, LEG(66, 0F38, 0, 0x20), SSE4_1, WR, Vdq, Wq) +OPCODE(pmovsxbd, LEG(66, 0F38, 0, 0x21), SSE4_1, WR, Vdq, Wd) +OPCODE(pmovsxbq, LEG(66, 0F38, 0, 0x22), SSE4_1, WR, Vdq, Ww) +OPCODE(pmovsxwd, LEG(66, 0F38, 0, 0x23), SSE4_1, WR, Vdq, Wq) +OPCODE(pmovsxwq, LEG(66, 0F38, 0, 0x24), SSE4_1, WR, Vdq, Wd) +OPCODE(pmovsxdq, LEG(66, 0F38, 0, 0x25), SSE4_1, WR, Vdq, Wq) +OPCODE(pmovzxbw, LEG(66, 0F38, 0, 0x30), SSE4_1, WR, Vdq, Wq) +OPCODE(pmovzxbd, LEG(66, 0F38, 0, 0x31), SSE4_1, WR, Vdq, Wd) +OPCODE(pmovzxbq, LEG(66, 0F38, 0, 0x32), SSE4_1, WR, Vdq, Ww) +OPCODE(pmovzxwd, LEG(66, 0F38, 0, 0x33), SSE4_1, WR, Vdq, Wq) +OPCODE(pmovzxwq, LEG(66, 0F38, 0, 0x34), SSE4_1, WR, Vdq, Wd) +OPCODE(pmovzxdq, LEG(66, 0F38, 0, 0x35), SSE4_1, WR, Vdq, Wq) OPCODE(cvtpi2ps, LEG(NP, 0F, 0, 0x2a), SSE, WR, Vdq, Qq) OPCODE(cvtsi2ss, LEG(F3, 0F, 0, 0x2a), SSE, WR, Vd, Ed) OPCODE(cvtsi2ss, LEG(F3, 0F, 1, 0x2a), SSE, WR, Vd, Eq) @@ -691,6 +791,7 @@ OPCODE(movnti, LEG(NP, 0F, 0, 0xc3), SSE2, WR, Md, Gd) OPCODE(movnti, LEG(NP, 0F, 1, 0xc3), SSE2, WR, Mq, Gq) OPCODE(movntq, LEG(NP, 0F, 0, 0xe7), SSE, WR, Mq, Pq) OPCODE(movntdq, LEG(66, 0F, 0, 0xe7), SSE2, WR, Mdq, Vdq) +OPCODE(movntdqa, LEG(66, 0F38, 0, 0x2a), SSE4_1, WR, Vdq, Mdq) OPCODE(pause, LEG(F3, NA, 0, 0x90), SSE2, ) OPCODE(emms, LEG(NP, 0F, 0, 0x77), MMX, ) From patchwork Wed Aug 21 17:29:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Bobek X-Patchwork-Id: 11107841 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0C510184E for ; Wed, 21 Aug 2019 18:17:15 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D86E322D6D for ; Wed, 21 Aug 2019 18:17:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Rvh8ifjn" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D86E322D6D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:51604 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0VAX-0004ci-IQ for patchwork-qemu-devel@patchwork.kernel.org; Wed, 21 Aug 2019 14:17:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41341) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0URk-0001gH-MK for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i0URi-0008E3-Jw for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:56 -0400 Received: from mail-yw1-xc36.google.com ([2607:f8b0:4864:20::c36]:44920) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i0URg-00088w-Kz for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:52 -0400 Received: by mail-yw1-xc36.google.com with SMTP id l79so1226438ywe.11 for ; Wed, 21 Aug 2019 10:30:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=7u+giNyM0KxCv4hol+VuiD6f2ETDBJss3uZycjWTu2I=; b=Rvh8ifjnHREp9bn7e07pxyoCCP/UfwFqb+FpekhZmWfvisv9YYIb9dpAt64Q6DlVP7 X1TviOIqAljCRGcRCEVEd1JG+VSiHRJAM0KhPs7KUTw8j13QZijS9g+L/0AUnyg79Fot uVgFicxTW7a9Vh9cD5awJvOlUsiOAvQL6mu3MomwisuBfccRCpQ+GRzPZCNj+vwZzWap /MLA/w9eEIf5uV3X/aY/eKi7pgMzmq5b/lbBxczK8EEz5FoM61prIqYgxgBvJbrsytK0 fAKB+OcBmN64W6n9p9SWXfbCpaOHzj0EY02Y2Jr9Fcgv3m44+y8QeVd90anuLs4GVw8e fZTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=7u+giNyM0KxCv4hol+VuiD6f2ETDBJss3uZycjWTu2I=; b=g28FiZrfPw8UZ1cOA26Ksq6HHM4L0bRhsfdUe1AZKs3Oz5EuP0TtjhAfSzwNJn2k8L 8Jd5wM8xHeF4LojR1RXmgODZaeaBDrs9DP/gSqQA1Gfgm3MZ9hmPw8lX8jwJAjnKZgnl nNfBhgaUOo9RnnslO4PSZmaguCr5m4hJU4+mZkb5F83l9DYcphUg1ZRBHx4ffkwq0gGj L4xzgJvx6EOgSWMwuDJsJmR0851lPnQWlYG9cY2c6g+neEuluXl7jBsOnNKqXujuwMz2 YOd4i09vBLg13gZbtSXGd76oR6rJJnDQUuDg1qdW0URoqrS5B52xoiFXUOuBNajEOn5P pGnw== X-Gm-Message-State: APjAAAWG+8+xBSZDepmL5IvFHTs5D49WrI9lP6IZRRFPEhax+Mh6JpOl JABPmhRcPDM2lf/DivgNXL4x+0Bm X-Google-Smtp-Source: APXvYqw5slZbbq0VwpoYhcihE1t2SOJziv0/2sHK8pzGkOEhZHYHHZzaPLFsYEW6K81d3DPBTGIu0g== X-Received: by 2002:a81:33c1:: with SMTP id z184mr25181651ywz.422.1566408651460; Wed, 21 Aug 2019 10:30:51 -0700 (PDT) Received: from localhost.localdomain ([2601:c0:c67f:e390::3]) by smtp.gmail.com with ESMTPSA id l71sm2826167ywl.39.2019.08.21.10.30.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Aug 2019 10:30:51 -0700 (PDT) From: Jan Bobek To: qemu-devel@nongnu.org Date: Wed, 21 Aug 2019 13:29:30 -0400 Message-Id: <20190821172951.15333-55-jan.bobek@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190821172951.15333-1-jan.bobek@gmail.com> References: <20190821172951.15333-1-jan.bobek@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::c36 Subject: [Qemu-devel] [RFC PATCH v4 54/75] target/i386: introduce SSE4.2 code generators X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jan Bobek , =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Introduce code generators required by SSE4.2 instructions. Signed-off-by: Jan Bobek --- target/i386/translate.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/target/i386/translate.c b/target/i386/translate.c index 3ff063b701..f3b047c0df 100644 --- a/target/i386/translate.c +++ b/target/i386/translate.c @@ -6017,6 +6017,12 @@ DEF_GEN_INSN3_GVEC(pcmpgtw, Pq, Pq, Qq, cmp, MM_OPRSZ, MM_MAXSZ, MO_16, TCG_COND DEF_GEN_INSN3_GVEC(pcmpgtw, Vdq, Vdq, Wdq, cmp, XMM_OPRSZ, XMM_MAXSZ, MO_16, TCG_COND_GT) DEF_GEN_INSN3_GVEC(pcmpgtd, Pq, Pq, Qq, cmp, MM_OPRSZ, MM_MAXSZ, MO_32, TCG_COND_GT) DEF_GEN_INSN3_GVEC(pcmpgtd, Vdq, Vdq, Wdq, cmp, XMM_OPRSZ, XMM_MAXSZ, MO_32, TCG_COND_GT) +DEF_GEN_INSN3_GVEC(pcmpgtq, Vdq, Vdq, Wdq, cmp, XMM_OPRSZ, XMM_MAXSZ, MO_64, TCG_COND_GT) + +DEF_GEN_INSN3_HELPER_EPPI(pcmpestrm, pcmpestrm_xmm, Vdq, Wdq, Ib) +DEF_GEN_INSN3_HELPER_EPPI(pcmpestri, pcmpestri_xmm, Vdq, Wdq, Ib) +DEF_GEN_INSN3_HELPER_EPPI(pcmpistrm, pcmpistrm_xmm, Vdq, Wdq, Ib) +DEF_GEN_INSN3_HELPER_EPPI(pcmpistri, pcmpistri_xmm, Vdq, Wdq, Ib) DEF_GEN_INSN2_HELPER_EPP(ptest, ptest_xmm, Vdq, Wdq) From patchwork Wed Aug 21 17:29:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Bobek X-Patchwork-Id: 11107943 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D2BC81395 for ; Wed, 21 Aug 2019 18:33:07 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A527A216F4 for ; Wed, 21 Aug 2019 18:33:07 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="SWkpW2ic" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A527A216F4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:51780 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0VPu-00052H-9J for patchwork-qemu-devel@patchwork.kernel.org; Wed, 21 Aug 2019 14:33:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41373) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0URo-0001hM-EZ for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:31:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i0URm-0008Kt-FT for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:31:00 -0400 Received: from mail-yb1-xb41.google.com ([2607:f8b0:4864:20::b41]:41466) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i0URi-00089u-Ln for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:56 -0400 Received: by mail-yb1-xb41.google.com with SMTP id 1so900811ybj.8 for ; Wed, 21 Aug 2019 10:30:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=dCAnUoqj/GPXx5JdXdQFBAGk0+RtvAipvhXnYHQQRl4=; b=SWkpW2icRFz7+dNEJdXFlfXKqIGZrcuzQwjkwKIa8WKbxf4XZVwab5qb1LDcKbY/Lm 1Xm43uMtdNrlrN6pQaSvI3dZqZ+dJyYYELViinVi2TC8WRlKbec1PhO3gDaBkWDbgnuM kU6iucTKbcyPAHIYqNV6IYFntt2NYT/Yy4a6DqwS2ltWCXQfIyXPs+doRTA6BfEuUFqs J1zf1lCkOPv65ZTTs0Sch38aH2VrnCZh35X4pu2c/6v6PspD2uNvaRcNXieizZZpjBjj jUqaEjsAVV3hxbPVmWo+xa9BK6AosulL+4HRB/VuM0WIyoE+kEam/LqT0Fgs8aIqO0Hr pssQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=dCAnUoqj/GPXx5JdXdQFBAGk0+RtvAipvhXnYHQQRl4=; b=pABp/tROvSHqVblQaRAd1MbQc2+16AibMJIDgawz+C7/AbpWGnq5r9JxltLoWPZPag jMSUPuOfm7m+2dtZ2O1uj46X2dzkF6a5zSkCFcQlprXy59KiPpTLYYvnxzxSUxU+jjRs fT69Kq2S5K8ZF1GE+wdFuoI3YMvY8UU8Bwci1hYqUFwpnw1N3Ul/nSydMmiSNbcrdYfa epx+FTBcnTPLmriDvlIVxlgRBIvnrM/F9w7txnQ5kNb4dzxqaOIOg1XVZ/UTSRIqX9nM MpR+gSGC6/Zb/X8/dKZf8fG4kCeWIJDKsPHnkyjGh8GtTsJKnMvLiaFSXpxOvvzDxvGc ChHw== X-Gm-Message-State: APjAAAUjHCcFyxpsCO9GScWVf8jFQdqMC+u8lnXA3HEOR9v7x5nJeAKO qlZ/cllr5gwzAQltl4WsqiMRFamk X-Google-Smtp-Source: APXvYqyERs28C54jUGP5C1van7eu0zSY3AElYkO2Bo09G3rdSJFRO1+uYp4f4vjTXTij5dAm2ajaOA== X-Received: by 2002:a25:42cb:: with SMTP id p194mr22462857yba.334.1566408652465; Wed, 21 Aug 2019 10:30:52 -0700 (PDT) Received: from localhost.localdomain ([2601:c0:c67f:e390::3]) by smtp.gmail.com with ESMTPSA id l71sm2826167ywl.39.2019.08.21.10.30.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Aug 2019 10:30:51 -0700 (PDT) From: Jan Bobek To: qemu-devel@nongnu.org Date: Wed, 21 Aug 2019 13:29:31 -0400 Message-Id: <20190821172951.15333-56-jan.bobek@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190821172951.15333-1-jan.bobek@gmail.com> References: <20190821172951.15333-1-jan.bobek@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::b41 Subject: [Qemu-devel] [RFC PATCH v4 55/75] target/i386: introduce SSE4.2 vector instructions to sse-opcode.inc.h X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jan Bobek , =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Add all the SSE4.2 vector instruction entries to sse-opcode.inc.h. Signed-off-by: Jan Bobek --- target/i386/sse-opcode.inc.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/target/i386/sse-opcode.inc.h b/target/i386/sse-opcode.inc.h index 9682cce7ef..f43436213e 100644 --- a/target/i386/sse-opcode.inc.h +++ b/target/i386/sse-opcode.inc.h @@ -441,6 +441,14 @@ * 66 0f 38 34 /r PMOVZXWQ xmm1, xmm2/m32 * 66 0f 38 35 /r PMOVZXDQ xmm1, xmm2/m64 * 66 0F 38 2A /r MOVNTDQA xmm1, m128 + * + * SSE4.2 Instructions + * -------------------- + * 66 0F 38 37 /r PCMPGTQ xmm1,xmm2/m128 + * 66 0F 3A 60 /r imm8 PCMPESTRM xmm1, xmm2/m128, imm8 + * 66 0F 3A 61 /r imm8 PCMPESTRI xmm1, xmm2/m128, imm8 + * 66 0F 3A 62 /r imm8 PCMPISTRM xmm1, xmm2/m128, imm8 + * 66 0F 3A 63 /r imm8 PCMPISTRI xmm1, xmm2/m128, imm8 */ OPCODE(movd, LEG(NP, 0F, 0, 0x6e), MMX, WR, Pq, Ed) @@ -646,6 +654,11 @@ OPCODE(pcmpgtw, LEG(NP, 0F, 0, 0x65), MMX, WRR, Pq, Pq, Qq) OPCODE(pcmpgtw, LEG(66, 0F, 0, 0x65), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(pcmpgtd, LEG(NP, 0F, 0, 0x66), MMX, WRR, Pq, Pq, Qq) OPCODE(pcmpgtd, LEG(66, 0F, 0, 0x66), SSE2, WRR, Vdq, Vdq, Wdq) +OPCODE(pcmpgtq, LEG(66, 0F38, 0, 0x37), SSE4_2, WRR, Vdq, Vdq, Wdq) +OPCODE(pcmpestrm, LEG(66, 0F3A, 0, 0x60), SSE4_2, RRR, Vdq, Wdq, Ib) +OPCODE(pcmpestri, LEG(66, 0F3A, 0, 0x61), SSE4_2, RRR, Vdq, Wdq, Ib) +OPCODE(pcmpistrm, LEG(66, 0F3A, 0, 0x62), SSE4_2, RRR, Vdq, Wdq, Ib) +OPCODE(pcmpistri, LEG(66, 0F3A, 0, 0x63), SSE4_2, RRR, Vdq, Wdq, Ib) OPCODE(ptest, LEG(66, 0F38, 0, 0x17), SSE4_1, RR, Vdq, Wdq) OPCODE(cmpps, LEG(NP, 0F, 0, 0xc2), SSE, WRRR, Vdq, Vdq, Wdq, Ib) OPCODE(cmppd, LEG(66, 0F, 0, 0xc2), SSE2, WRRR, Vdq, Vdq, Wdq, Ib) From patchwork Wed Aug 21 17:29:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Bobek X-Patchwork-Id: 11107871 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 807691395 for ; Wed, 21 Aug 2019 18:26:41 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5849B216F4 for ; Wed, 21 Aug 2019 18:26:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Ac4hClXp" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5849B216F4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:51680 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0VJf-0003bS-Q5 for patchwork-qemu-devel@patchwork.kernel.org; Wed, 21 Aug 2019 14:26:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41399) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0URq-0001hi-Cc for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:31:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i0URo-0008Oh-CK for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:31:02 -0400 Received: from mail-yw1-xc42.google.com ([2607:f8b0:4864:20::c42]:38482) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i0URl-0008EH-KG for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:30:58 -0400 Received: by mail-yw1-xc42.google.com with SMTP id f187so1239207ywa.5 for ; Wed, 21 Aug 2019 10:30:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=UcQMIQ6Snz8KBsqYuuztiUpYqscBWVjLt4Fbmt6g/lo=; b=Ac4hClXp6WhNxIjcYTcbA/dPGADWZ8P5i7EzKtpLKnllESUBzQWN8DRogs9YN9L+cL B6ctRrihusn4F2rQtu6AP5FEWSdtiADFbo1CrjgiXAVevhxpSCarV4Kd8WCWNVuI1XEx d25a9F1jDkDvIU3XWiHGliy07sglpiiR8ivAGNFTGqxCSnAsw3d0iYwmahPnUaJUxnZW yzqVYi0HkQZgSIQXZxUweALBkhw79mh+rF40suJ8HFgAbRqge30NFfDUKjKex3jFXSIG tJFdc4/VIzr8qxsNqrYb7MUYyuApi1grb5uNfGL8Az/Mgtoq/ls9ksdVuzGZ+fyoMwEh HHYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=UcQMIQ6Snz8KBsqYuuztiUpYqscBWVjLt4Fbmt6g/lo=; b=o83/dZ21SL/ogAjFcBZN7rbhUAyOIyu786nNa0elUA3uVSHzmF6hkWOfslATBDGHX3 EAkSlUGCx2TM1kppF2fM/Ybt2BhBeNq2JwmBXqxpvSujtYIRKnc7mpy/I0cVY3fZR5Mq 7PfiaLteOv8mIb/ZYTICbF9/T8jCozKTsMwmAIfpqAFDztOwIM7IQ3fzXAp6pv7tPQR3 Q3drsQBtNaO1LKaaj6rSSktPelttJRpTG3ETp5iAmxidId7FBpQYA2/bDC/KP58uDj2R rooyHE1X7XZuovZviuKWB6M4E6vip1yGsaPbMtynNze2X0z+N3VYLxGMhJAgrA6nNLv/ Z77Q== X-Gm-Message-State: APjAAAXjTMgGhUYN4dtlxB5s/B4RdiCTpt9QoJ1CPRlQJ5RAdfEDfNqY nRVKEOkHFV7sTYib7tyINLkiJrB/ X-Google-Smtp-Source: APXvYqwCFAP9m49rpGzKbcGNpttfSnxyJ73CBzymajkvCAaRl36/g9QxxS27pP6Fn/k2D+5LV0YUJQ== X-Received: by 2002:a0d:ec14:: with SMTP id v20mr26146295ywe.24.1566408654192; Wed, 21 Aug 2019 10:30:54 -0700 (PDT) Received: from localhost.localdomain ([2601:c0:c67f:e390::3]) by smtp.gmail.com with ESMTPSA id l71sm2826167ywl.39.2019.08.21.10.30.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Aug 2019 10:30:53 -0700 (PDT) From: Jan Bobek To: qemu-devel@nongnu.org Date: Wed, 21 Aug 2019 13:29:33 -0400 Message-Id: <20190821172951.15333-58-jan.bobek@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190821172951.15333-1-jan.bobek@gmail.com> References: <20190821172951.15333-1-jan.bobek@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::c42 Subject: [Qemu-devel] [RFC PATCH v4 57/75] target/i386: introduce AES and PCLMULQDQ code generators X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jan Bobek , =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Introduce code generators required by AES and PCLMULQDQ instructions. Signed-off-by: Jan Bobek --- target/i386/translate.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/target/i386/translate.c b/target/i386/translate.c index 75b0a818f2..14117c2993 100644 --- a/target/i386/translate.c +++ b/target/i386/translate.c @@ -6004,6 +6004,21 @@ DEF_GEN_INSN3_HELPER_EPPI(roundpd, roundpd_xmm, Vdq, Wdq, Ib) DEF_GEN_INSN3_HELPER_EPPI(roundss, roundss_xmm, Vd, Wd, Ib) DEF_GEN_INSN3_HELPER_EPPI(roundsd, roundsd_xmm, Vq, Wq, Ib) +DEF_GEN_INSN3_HELPER_EPP(aesdec, aesdec_xmm, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vaesdec, aesdec_xmm, Vdq, Hdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(aesdeclast, aesdeclast_xmm, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vaesdeclast, aesdeclast_xmm, Vdq, Hdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(aesenc, aesenc_xmm, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vaesenc, aesenc_xmm, Vdq, Hdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(aesenclast, aesenclast_xmm, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vaesenclast, aesenclast_xmm, Vdq, Hdq, Wdq) +DEF_GEN_INSN2_HELPER_EPP(aesimc, aesimc_xmm, Vdq, Wdq) +DEF_GEN_INSN2_HELPER_EPP(vaesimc, aesimc_xmm, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPPI(aeskeygenassist, aeskeygenassist_xmm, Vdq, Wdq, Ib) +DEF_GEN_INSN3_HELPER_EPPI(vaeskeygenassist, aeskeygenassist_xmm, Vdq, Wdq, Ib) +DEF_GEN_INSN4_HELPER_EPPI(pclmulqdq, pclmulqdq_xmm, Vdq, Vdq, Wdq, Ib) +DEF_GEN_INSN4_HELPER_EPPI(vpclmulqdq, pclmulqdq_xmm, Vdq, Hdq, Wdq, Ib) + DEF_GEN_INSN3_GVEC(pcmpeqb, Pq, Pq, Qq, cmp, MM_OPRSZ, MM_MAXSZ, MO_8, TCG_COND_EQ) DEF_GEN_INSN3_GVEC(pcmpeqb, Vdq, Vdq, Wdq, cmp, XMM_OPRSZ, XMM_MAXSZ, MO_8, TCG_COND_EQ) DEF_GEN_INSN3_GVEC(pcmpeqw, Pq, Pq, Qq, cmp, MM_OPRSZ, MM_MAXSZ, MO_16, TCG_COND_EQ) From patchwork Wed Aug 21 17:29:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Bobek X-Patchwork-Id: 11107987 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A932C13B1 for ; Wed, 21 Aug 2019 18:38:44 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 813FA214DA for ; Wed, 21 Aug 2019 18:38:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ilfPe8Yp" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 813FA214DA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:51850 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0VVL-00046O-BC for patchwork-qemu-devel@patchwork.kernel.org; Wed, 21 Aug 2019 14:38:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41431) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0URs-0001iD-Dc for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:31:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i0URq-0008Sa-9b for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:31:04 -0400 Received: from mail-yw1-xc43.google.com ([2607:f8b0:4864:20::c43]:34428) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i0URm-0008Fl-EH for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:31:00 -0400 Received: by mail-yw1-xc43.google.com with SMTP id n126so1251616ywf.1 for ; Wed, 21 Aug 2019 10:30:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=mtpv7TUPO152TH+n/5BNHJ1qaIvUaGy6XgtApaMVtnM=; b=ilfPe8YpyZ+B8nRL37pxj2aSNOh9sb45BFaR3UBHkCtq8w7CHVXRsDetA3HAUjgLLl zCnZ8ZjzjlftubnCFG7OiZhiQEuj20rk8eDI3NMFc1r6rXC/Z+Xey7HZ+IYQcGL+nsA5 tlPzz8JT1XxxkSHrxwttyULSt1G31siIiTARUG9fYhfIb/cQMbBNB98KdaNW6MkQAQhB NrXLp3ak6y2qq+k7g9qWCx+Y8MHC8rCLArjzy7HTAmhI4+rmYFF6c5G4gRjtoKk8asuy HvACbRftVx0avhZ2nkmsnAIpWy2WjQS5Eyn5JFo/x7OUdai2Rc77xpBz1dn8kW/1bNf+ Gw3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=mtpv7TUPO152TH+n/5BNHJ1qaIvUaGy6XgtApaMVtnM=; b=OeiPjOsWbzSgUrw6KMab0cLv+YXutakX3tDPWyn1AT0y7iTeiZnD/w30OsrQg6BT8C T40fP7tfgVDaiD+H8ky4k8MyFVTjY0vonHbeiomJyDnOlsHkpM26uPLiwiXcFW0dfCN7 1bA6j33WRYWRDioVT7OkGOV6ozNODxB30OBCjDEpCQ8nm/qzqIl7pXw+BhJs8Cd1YYY2 2v2+1EQL/Cg7fIiz5dDZSBo83D3FdSjyqR3zWeKWOO8Zn6r81v3nJviTRQNOOkgdXnMg +TVQjxwa6lE/4EVJHlOTzqhqcK1xBClvahsb0MI8RiMa7RYDpSXoZEeeHzrJEdGMzIlR 0zLg== X-Gm-Message-State: APjAAAXtQ58tXjmLNZ/W0oPP3ld9zENyPIEX+juaNKU0Sl5oIPCL/e2B qxlcISOY11CeXtSYNr1Ra2APEDsm X-Google-Smtp-Source: APXvYqyCDglQlUmedOo1m5TRIe3meIgOW3c58Ubo0jTVKaRiWBzfXvnUh/SHtP0OVUyFJvLaQA6adQ== X-Received: by 2002:a81:2903:: with SMTP id p3mr23551543ywp.355.1566408655145; Wed, 21 Aug 2019 10:30:55 -0700 (PDT) Received: from localhost.localdomain ([2601:c0:c67f:e390::3]) by smtp.gmail.com with ESMTPSA id l71sm2826167ywl.39.2019.08.21.10.30.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Aug 2019 10:30:54 -0700 (PDT) From: Jan Bobek To: qemu-devel@nongnu.org Date: Wed, 21 Aug 2019 13:29:34 -0400 Message-Id: <20190821172951.15333-59-jan.bobek@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190821172951.15333-1-jan.bobek@gmail.com> References: <20190821172951.15333-1-jan.bobek@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::c43 Subject: [Qemu-devel] [RFC PATCH v4 58/75] target/i386: introduce AES and PCLMULQDQ vector instructions to sse-opcode.inc.h X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jan Bobek , =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Add all the AES and PCLMULQDQ vector instruction entries to sse-opcode.inc.h. Signed-off-by: Jan Bobek --- target/i386/sse-opcode.inc.h | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/target/i386/sse-opcode.inc.h b/target/i386/sse-opcode.inc.h index f43436213e..1359508424 100644 --- a/target/i386/sse-opcode.inc.h +++ b/target/i386/sse-opcode.inc.h @@ -449,6 +449,26 @@ * 66 0F 3A 61 /r imm8 PCMPESTRI xmm1, xmm2/m128, imm8 * 66 0F 3A 62 /r imm8 PCMPISTRM xmm1, xmm2/m128, imm8 * 66 0F 3A 63 /r imm8 PCMPISTRI xmm1, xmm2/m128, imm8 + * + * AES Instructions + * ----------------- + * 66 0F 38 DE /r AESDEC xmm1, xmm2/m128 + * VEX.128.66.0F38.WIG DE /r VAESDEC xmm1, xmm2, xmm3/m128 + * 66 0F 38 DF /r AESDECLAST xmm1, xmm2/m128 + * VEX.128.66.0F38.WIG DF /r VAESDECLAST xmm1, xmm2, xmm3/m128 + * 66 0F 38 DC /r AESENC xmm1, xmm2/m128 + * VEX.128.66.0F38.WIG DC /r VAESENC xmm1, xmm2, xmm3/m128 + * 66 0F 38 DD /r AESENCLAST xmm1, xmm2/m128 + * VEX.128.66.0F38.WIG DD /r VAESENCLAST xmm1, xmm2, xmm3/m128 + * 66 0F 38 DB /r AESIMC xmm1, xmm2/m128 + * VEX.128.66.0F38.WIG DB /r VAESIMC xmm1, xmm2/m128 + * 66 0F 3A DF /r ib AESKEYGENASSIST xmm1, xmm2/m128, imm8 + * VEX.128.66.0F3A.WIG DF /r ib VAESKEYGENASSIST xmm1, xmm2/m128, imm8 + * + * PCLMULQDQ Instructions + * ----------------------- + * 66 0F 3A 44 /r ib PCLMULQDQ xmm1, xmm2/m128, imm8 + * VEX.128.66.0F3A.WIG 44 /r ib VPCLMULQDQ xmm1, xmm2, xmm3/m128, imm8 */ OPCODE(movd, LEG(NP, 0F, 0, 0x6e), MMX, WR, Pq, Ed) @@ -641,6 +661,20 @@ OPCODE(roundps, LEG(66, 0F3A, 0, 0x08), SSE4_1, WRR, Vdq, Wdq, Ib) OPCODE(roundpd, LEG(66, 0F3A, 0, 0x09), SSE4_1, WRR, Vdq, Wdq, Ib) OPCODE(roundss, LEG(66, 0F3A, 0, 0x0a), SSE4_1, WRR, Vd, Wd, Ib) OPCODE(roundsd, LEG(66, 0F3A, 0, 0x0b), SSE4_1, WRR, Vq, Wq, Ib) +OPCODE(aesdec, LEG(66, 0F38, 0, 0xde), AES, WRR, Vdq, Vdq, Wdq) +OPCODE(vaesdec, VEX(128, 66, 0F38, IG, 0xde), AES_AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(aesdeclast, LEG(66, 0F38, 0, 0xdf), AES, WRR, Vdq, Vdq, Wdq) +OPCODE(vaesdeclast, VEX(128, 66, 0F38, IG, 0xdf), AES_AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(aesenc, LEG(66, 0F38, 0, 0xdc), AES, WRR, Vdq, Vdq, Wdq) +OPCODE(vaesenc, VEX(128, 66, 0F38, IG, 0xdc), AES_AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(aesenclast, LEG(66, 0F38, 0, 0xdd), AES, WRR, Vdq, Vdq, Wdq) +OPCODE(vaesenclast, VEX(128, 66, 0F38, IG, 0xdd), AES_AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(aesimc, LEG(66, 0F38, 0, 0xdb), AES, WR, Vdq, Wdq) +OPCODE(vaesimc, VEX(128, 66, 0F38, IG, 0xdb), AES_AVX, WR, Vdq, Wdq) +OPCODE(aeskeygenassist, LEG(66, 0F3A, 0, 0xdf), AES, WRR, Vdq, Wdq, Ib) +OPCODE(vaeskeygenassist, VEX(128, 66, 0F3A, IG, 0xdf), AES_AVX, WRR, Vdq, Wdq, Ib) +OPCODE(pclmulqdq, LEG(66, 0F3A, 0, 0x44), PCLMULQDQ, WRRR, Vdq, Vdq, Wdq, Ib) +OPCODE(vpclmulqdq, VEX(128, 66, 0F3A, IG, 0x44), PCLMULQDQ_AVX, WRRR, Vdq, Hdq, Wdq, Ib) OPCODE(pcmpeqb, LEG(NP, 0F, 0, 0x74), MMX, WRR, Pq, Pq, Qq) OPCODE(pcmpeqb, LEG(66, 0F, 0, 0x74), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(pcmpeqw, LEG(NP, 0F, 0, 0x75), MMX, WRR, Pq, Pq, Qq) From patchwork Wed Aug 21 17:29:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Bobek X-Patchwork-Id: 11107969 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4DDA61813 for ; Wed, 21 Aug 2019 18:35:41 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 259AE216F4 for ; Wed, 21 Aug 2019 18:35:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="pFpLkMNy" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 259AE216F4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:51810 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0VSO-0000Q5-5T for patchwork-qemu-devel@patchwork.kernel.org; Wed, 21 Aug 2019 14:35:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41402) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0URq-0001hk-Cg for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:31:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i0URo-0008Pd-KJ for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:31:02 -0400 Received: from mail-yw1-xc41.google.com ([2607:f8b0:4864:20::c41]:45840) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i0URm-0008IX-FP for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:31:00 -0400 Received: by mail-yw1-xc41.google.com with SMTP id n69so1222696ywd.12 for ; Wed, 21 Aug 2019 10:30:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=370BzNA3AWFdFiLriyDposG4pv4fhHrQn56gCrkrpxY=; b=pFpLkMNyI1VYI/vFtpMRMpnmJ5ZTpBekdQOyDFoa7472a2/6uQSuXI2sgwCfsxKtVf 9VrnjWRWak8SRI/Q1wjrUI5D6DNk3/SM0AdHEicdmEmUeaRg/RwXKCv55ciBS5ZYU3XQ 9Y9c6KSHWVDRDquKJWWczQXM0X/xXA0lZZAsAb5xmKcYtS8TTfiqZWFE27fd/dcxguvT ZzG0yCQ7P3XnFsUEanXZJz9+fipChJkTHzMbg/hgM8DfPgiMiF0li6i9mKISSn0N+iC/ 4HCSkL8hk2vsUu7jFquKrhlug5eTwBHYnRUL5QEepYD7hEHTwfMwP4q8WzWio/WqhAnP VLRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=370BzNA3AWFdFiLriyDposG4pv4fhHrQn56gCrkrpxY=; b=ZnWBKk9D/8sambM3y0yHz1ZUwx3H1qb0O2xw6Pp7Cy3aI1fH0Wqzq0W3D8qq/aI19y T4G+CGqPhWUZ1duVbrCYYHdxIKjscp4vPR4a720hO/ejVSzDF5/KHuwm2fXvqE8RaX/K S5jq0gGQP7y86ilms3h2MQ3PUeLsadioRO+GKBf9rOU8WHrXPi7V5Xyfezs4fzX5/uAf Z6ZkfutXjVW9+Vspbo9FFlb3qMbreeRIStEMEnul9ve6nf/ifEzCWk6kuEcPpT9f8ajQ 5FTVgZ41Z1RFqKlOjJOxy9pmkFw20qKWavPZn9xKo1ZYgaenY3Ta5OoqSyvGpKnWql/1 UGtA== X-Gm-Message-State: APjAAAW6RJkeQi+Veoj49sAYiZ3tXZFBF9SF3JLWLzvXyDE8lZUj08Yl 2JtfLnyCCTDHS2vB30D3tRGq42/L X-Google-Smtp-Source: APXvYqwGhdkUhlePZ5QcPXe/Zkq+op0PQ7FQEiIe5FEUDql/LC9njXsjjyCfUiyocl526ruJ6lp0fQ== X-Received: by 2002:a81:ad4c:: with SMTP id l12mr24371223ywk.300.1566408656192; Wed, 21 Aug 2019 10:30:56 -0700 (PDT) Received: from localhost.localdomain ([2601:c0:c67f:e390::3]) by smtp.gmail.com with ESMTPSA id l71sm2826167ywl.39.2019.08.21.10.30.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Aug 2019 10:30:55 -0700 (PDT) From: Jan Bobek To: qemu-devel@nongnu.org Date: Wed, 21 Aug 2019 13:29:35 -0400 Message-Id: <20190821172951.15333-60-jan.bobek@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190821172951.15333-1-jan.bobek@gmail.com> References: <20190821172951.15333-1-jan.bobek@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::c41 Subject: [Qemu-devel] [RFC PATCH v4 59/75] target/i386: introduce AVX translators X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jan Bobek , =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Use the translator macros to define translators required by AVX instructions. Signed-off-by: Jan Bobek --- target/i386/translate.c | 48 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/target/i386/translate.c b/target/i386/translate.c index 14117c2993..9b9f0d4ed1 100644 --- a/target/i386/translate.c +++ b/target/i386/translate.c @@ -6708,10 +6708,12 @@ DEF_TRANSLATE_INSN2(Eq, Pq) DEF_TRANSLATE_INSN2(Eq, Vdq) DEF_TRANSLATE_INSN2(Gd, Nq) DEF_TRANSLATE_INSN2(Gd, Udq) +DEF_TRANSLATE_INSN2(Gd, Uqq) DEF_TRANSLATE_INSN2(Gd, Wd) DEF_TRANSLATE_INSN2(Gd, Wq) DEF_TRANSLATE_INSN2(Gq, Nq) DEF_TRANSLATE_INSN2(Gq, Udq) +DEF_TRANSLATE_INSN2(Gq, Uqq) DEF_TRANSLATE_INSN2(Gq, Wd) DEF_TRANSLATE_INSN2(Gq, Wq) DEF_TRANSLATE_INSN2(Md, Gd) @@ -6720,6 +6722,7 @@ DEF_TRANSLATE_INSN2(Mq, Gq) DEF_TRANSLATE_INSN2(Mq, Pq) DEF_TRANSLATE_INSN2(Mq, Vdq) DEF_TRANSLATE_INSN2(Mq, Vq) +DEF_TRANSLATE_INSN2(Mqq, Vqq) DEF_TRANSLATE_INSN2(Pq, Ed) DEF_TRANSLATE_INSN2(Pq, Eq) DEF_TRANSLATE_INSN2(Pq, Nq) @@ -6735,6 +6738,7 @@ DEF_TRANSLATE_INSN2(Vd, Wd) DEF_TRANSLATE_INSN2(Vd, Wq) DEF_TRANSLATE_INSN2(Vdq, Ed) DEF_TRANSLATE_INSN2(Vdq, Eq) +DEF_TRANSLATE_INSN2(Vdq, Md) DEF_TRANSLATE_INSN2(Vdq, Mdq) DEF_TRANSLATE_INSN2(Vdq, Nq) DEF_TRANSLATE_INSN2(Vdq, Qq) @@ -6742,14 +6746,22 @@ DEF_TRANSLATE_INSN2(Vdq, Udq) DEF_TRANSLATE_INSN2(Vdq, Wd) DEF_TRANSLATE_INSN2(Vdq, Wdq) DEF_TRANSLATE_INSN2(Vdq, Wq) +DEF_TRANSLATE_INSN2(Vdq, Wqq) DEF_TRANSLATE_INSN2(Vdq, Ww) DEF_TRANSLATE_INSN2(Vq, Ed) DEF_TRANSLATE_INSN2(Vq, Eq) DEF_TRANSLATE_INSN2(Vq, Wd) DEF_TRANSLATE_INSN2(Vq, Wq) +DEF_TRANSLATE_INSN2(Vqq, Md) +DEF_TRANSLATE_INSN2(Vqq, Mdq) +DEF_TRANSLATE_INSN2(Vqq, Mq) +DEF_TRANSLATE_INSN2(Vqq, Mqq) +DEF_TRANSLATE_INSN2(Vqq, Wdq) +DEF_TRANSLATE_INSN2(Vqq, Wqq) DEF_TRANSLATE_INSN2(Wd, Vd) DEF_TRANSLATE_INSN2(Wdq, Vdq) DEF_TRANSLATE_INSN2(Wq, Vq) +DEF_TRANSLATE_INSN2(Wqq, Vqq) DEF_TRANSLATE_INSN2(modrm_mod, modrm) #define DEF_TRANSLATE_INSN3(opT1, opT2, opT3) \ @@ -6796,6 +6808,9 @@ DEF_TRANSLATE_INSN3(Gd, Nq, Ib) DEF_TRANSLATE_INSN3(Gd, Udq, Ib) DEF_TRANSLATE_INSN3(Gq, Nq, Ib) DEF_TRANSLATE_INSN3(Gq, Udq, Ib) +DEF_TRANSLATE_INSN3(Hdq, Udq, Ib) +DEF_TRANSLATE_INSN3(Mdq, Hdq, Vdq) +DEF_TRANSLATE_INSN3(Mqq, Hqq, Vqq) DEF_TRANSLATE_INSN3(Nq, Nq, Ib) DEF_TRANSLATE_INSN3(Pq, Pq, Qd) DEF_TRANSLATE_INSN3(Pq, Pq, Qq) @@ -6803,17 +6818,34 @@ DEF_TRANSLATE_INSN3(Pq, Qq, Ib) DEF_TRANSLATE_INSN3(RdMb, Vdq, Ib) DEF_TRANSLATE_INSN3(RdMw, Vdq, Ib) DEF_TRANSLATE_INSN3(Udq, Udq, Ib) +DEF_TRANSLATE_INSN3(Vd, Hd, Ed) +DEF_TRANSLATE_INSN3(Vd, Hd, Eq) +DEF_TRANSLATE_INSN3(Vd, Hd, Wd) +DEF_TRANSLATE_INSN3(Vd, Hd, Wq) DEF_TRANSLATE_INSN3(Vd, Vd, Wd) DEF_TRANSLATE_INSN3(Vd, Wd, Ib) +DEF_TRANSLATE_INSN3(Vdq, Hdq, Mdq) +DEF_TRANSLATE_INSN3(Vdq, Hdq, Mq) +DEF_TRANSLATE_INSN3(Vdq, Hdq, UdqMhq) DEF_TRANSLATE_INSN3(Vdq, Hdq, Wdq) +DEF_TRANSLATE_INSN3(Vdq, Hq, Mq) +DEF_TRANSLATE_INSN3(Vdq, Hq, Wq) DEF_TRANSLATE_INSN3(Vdq, Vdq, Mq) DEF_TRANSLATE_INSN3(Vdq, Vdq, UdqMhq) DEF_TRANSLATE_INSN3(Vdq, Vdq, Wdq) DEF_TRANSLATE_INSN3(Vdq, Vq, Mq) DEF_TRANSLATE_INSN3(Vdq, Vq, Wq) DEF_TRANSLATE_INSN3(Vdq, Wdq, Ib) +DEF_TRANSLATE_INSN3(Vq, Hq, Ed) +DEF_TRANSLATE_INSN3(Vq, Hq, Eq) +DEF_TRANSLATE_INSN3(Vq, Hq, Wd) +DEF_TRANSLATE_INSN3(Vq, Hq, Wq) DEF_TRANSLATE_INSN3(Vq, Vq, Wq) DEF_TRANSLATE_INSN3(Vq, Wq, Ib) +DEF_TRANSLATE_INSN3(Vqq, Hqq, Mqq) +DEF_TRANSLATE_INSN3(Vqq, Hqq, Wqq) +DEF_TRANSLATE_INSN3(Vqq, Wqq, Ib) +DEF_TRANSLATE_INSN3(Wdq, Vqq, Ib) #define DEF_TRANSLATE_INSN4(opT1, opT2, opT3, opT4) \ static void translate_insn4(opT1, opT2, opT3, opT4)( \ @@ -6861,8 +6893,15 @@ DEF_TRANSLATE_INSN3(Vq, Wq, Ib) DEF_TRANSLATE_INSN4(Pq, Pq, Qq, Ib) DEF_TRANSLATE_INSN4(Pq, Pq, RdMw, Ib) +DEF_TRANSLATE_INSN4(Vd, Hd, Wd, Ib) DEF_TRANSLATE_INSN4(Vd, Vd, Wd, Ib) +DEF_TRANSLATE_INSN4(Vdq, Hdq, Ed, Ib) +DEF_TRANSLATE_INSN4(Vdq, Hdq, Eq, Ib) +DEF_TRANSLATE_INSN4(Vdq, Hdq, RdMb, Ib) +DEF_TRANSLATE_INSN4(Vdq, Hdq, RdMw, Ib) +DEF_TRANSLATE_INSN4(Vdq, Hdq, Wd, Ib) DEF_TRANSLATE_INSN4(Vdq, Hdq, Wdq, Ib) +DEF_TRANSLATE_INSN4(Vdq, Hdq, Wdq, Ldq) DEF_TRANSLATE_INSN4(Vdq, Vdq, Ed, Ib) DEF_TRANSLATE_INSN4(Vdq, Vdq, Eq, Ib) DEF_TRANSLATE_INSN4(Vdq, Vdq, RdMb, Ib) @@ -6871,7 +6910,11 @@ DEF_TRANSLATE_INSN4(Vdq, Vdq, Wd, Ib) DEF_TRANSLATE_INSN4(Vdq, Vdq, Wd, modrm_mod) DEF_TRANSLATE_INSN4(Vdq, Vdq, Wdq, Ib) DEF_TRANSLATE_INSN4(Vdq, Vdq, Wq, modrm_mod) +DEF_TRANSLATE_INSN4(Vq, Hq, Wq, Ib) DEF_TRANSLATE_INSN4(Vq, Vq, Wq, Ib) +DEF_TRANSLATE_INSN4(Vqq, Hqq, Wdq, Ib) +DEF_TRANSLATE_INSN4(Vqq, Hqq, Wqq, Ib) +DEF_TRANSLATE_INSN4(Vqq, Hqq, Wqq, Lqq) #define DEF_TRANSLATE_INSN5(opT1, opT2, opT3, opT4, opT5) \ static void translate_insn5(opT1, opT2, opT3, opT4, opT5)( \ @@ -6924,6 +6967,11 @@ DEF_TRANSLATE_INSN4(Vq, Vq, Wq, Ib) } \ } +DEF_TRANSLATE_INSN5(Vdq, Hdq, Wd, modrm_mod, vex_v) +DEF_TRANSLATE_INSN5(Vdq, Hdq, Wq, modrm_mod, vex_v) +DEF_TRANSLATE_INSN5(Wdq, Hdq, Vd, modrm_mod, vex_v) +DEF_TRANSLATE_INSN5(Wdq, Hdq, Vq, modrm_mod, vex_v) + #define OPCODE_GRP_BEGIN(grpname) \ static void translate_group(grpname)( \ CPUX86State *env, DisasContext *s, int modrm) \ From patchwork Wed Aug 21 17:29:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Bobek X-Patchwork-Id: 11107889 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4012C1813 for ; Wed, 21 Aug 2019 18:31:29 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E78DB216F4 for ; Wed, 21 Aug 2019 18:31:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="hqtbVLnH" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E78DB216F4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:51754 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0VOJ-0002Xq-Pc for patchwork-qemu-devel@patchwork.kernel.org; Wed, 21 Aug 2019 14:31:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41607) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0US1-0001wZ-LJ for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:31:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i0URs-0008Ul-Bf for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:31:13 -0400 Received: from mail-yw1-xc41.google.com ([2607:f8b0:4864:20::c41]:35835) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i0URq-0008M9-6r for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:31:04 -0400 Received: by mail-yw1-xc41.google.com with SMTP id g19so1247814ywe.2 for ; Wed, 21 Aug 2019 10:30:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=v2J7lZuo2hwLkHP3u8XrlTjAOasnUCxw+XflXLKr1xk=; b=hqtbVLnH+Hls/Ar18ADTFNN8qzKyyGadWf6YlO5w/aHYmiVwcBHRxYx5+3w8/OSs4M pwNlUrL4JIf7mezvUELD85IkwnjBTTuKnWaekgrh3Opwqcb2PRblmO90s9IoZ9/yboPm iSJ1t8rpW42Mim2kAob6fkDajXynftfYWRr0czHwnLaSLqz3GXPE7Nq8QsqMBS31FfAx a9MJt7FLaSmvusaMWBnxtVib38rA6IGG8C44EHmJ/rbOGHHuk+DltwPoVI76QOOgY8lu fFou3hLT3hAgFb8k1MR/+atTjAcLBcwC7nEKQZArflV8YMxGn1ru2qTs7TLRMCbtmMHz QrPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=v2J7lZuo2hwLkHP3u8XrlTjAOasnUCxw+XflXLKr1xk=; b=Z3OfPDnXwakE776l5h/ub4LKlg+8zucquojHKdQsZwMs/vuzY+FBidJVQhEDO4JRq6 RODOdPuLjasrwUXcnxyrLbCeaV0pz9fHrvBdGmHvom8a1fCWQNIHTIZxcOX6Dh3oH9L0 21oHxmL6gEXZPSZfwdqhWGpmAOvZHOIB5Zbylzh+1vE45UoObuVxmnuUvhcHBG1JrLtX rgn/JZPPiKVDi8PQp6IHVQObtzp3/KbAZmyp7wMw4ZeOf+nsMBcv53G4UsaI5N6PJMfe BqNvXEw7uLH6zEe2Oq9jBZWt41iXndcD+UtZRzoigX4d5DMV8htQyzJ88W5WSvpd4/fn /1jQ== X-Gm-Message-State: APjAAAWuVNM2H8GMIRmf9/5YaTykjP54kd66nKgl/HyCO9gN0gRk+mQD 8tnoDrEFwnSHblfLVwbv9B1A7k+z X-Google-Smtp-Source: APXvYqzI4u5gBGL4/dQQAmxkrKiXJ9Jy9GKNxzDkBl6V1WMkAAo/HlHnh3VmrhYSlEfbJgnyEJA2LA== X-Received: by 2002:a0d:cb0f:: with SMTP id n15mr24562403ywd.443.1566408657542; Wed, 21 Aug 2019 10:30:57 -0700 (PDT) Received: from localhost.localdomain ([2601:c0:c67f:e390::3]) by smtp.gmail.com with ESMTPSA id l71sm2826167ywl.39.2019.08.21.10.30.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Aug 2019 10:30:56 -0700 (PDT) From: Jan Bobek To: qemu-devel@nongnu.org Date: Wed, 21 Aug 2019 13:29:36 -0400 Message-Id: <20190821172951.15333-61-jan.bobek@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190821172951.15333-1-jan.bobek@gmail.com> References: <20190821172951.15333-1-jan.bobek@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::c41 Subject: [Qemu-devel] [RFC PATCH v4 60/75] target/i386: introduce AVX code generators X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jan Bobek , =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Introduce code generators required by AVX instructions. Signed-off-by: Jan Bobek --- target/i386/translate.c | 954 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 954 insertions(+) diff --git a/target/i386/translate.c b/target/i386/translate.c index 9b9f0d4ed1..50eab9181c 100644 --- a/target/i386/translate.c +++ b/target/i386/translate.c @@ -5586,6 +5586,14 @@ GEN_INSN2(movd, Ed, Vdq) { tcg_gen_ld_i32(arg1, cpu_env, arg2 + offsetof(ZMMReg, ZMM_L(0))); } +GEN_INSN2(vmovd, Vdq, Ed) +{ + gen_insn2(movd, Vdq, Ed)(env, s, arg1, arg2); +} +GEN_INSN2(vmovd, Ed, Vdq) +{ + gen_insn2(movd, Ed, Vdq)(env, s, arg1, arg2); +} GEN_INSN2(movq, Pq, Eq) { @@ -5607,6 +5615,14 @@ GEN_INSN2(movq, Eq, Vdq) { tcg_gen_ld_i64(arg1, cpu_env, arg2 + offsetof(ZMMReg, ZMM_Q(0))); } +GEN_INSN2(vmovq, Vdq, Eq) +{ + gen_insn2(movq, Vdq, Eq)(env, s, arg1, arg2); +} +GEN_INSN2(vmovq, Eq, Vdq) +{ + gen_insn2(movq, Eq, Vdq)(env, s, arg1, arg2); +} DEF_GEN_INSN2_GVEC(movq, Pq, Qq, mov, MM_OPRSZ, MM_MAXSZ, MO_64) DEF_GEN_INSN2_GVEC(movq, Qq, Pq, mov, MM_OPRSZ, MM_MAXSZ, MO_64) @@ -5621,19 +5637,51 @@ GEN_INSN2(movq, UdqMq, Vq) { gen_insn2(movq, Vdq, Wq)(env, s, arg1, arg2); } +GEN_INSN2(vmovq, Vdq, Wq) +{ + gen_insn2(movq, Vdq, Wq)(env, s, arg1, arg2); +} +GEN_INSN2(vmovq, UdqMq, Vq) +{ + gen_insn2(movq, UdqMq, Vq)(env, s, arg1, arg2); +} DEF_GEN_INSN2_GVEC(movaps, Vdq, Wdq, mov, XMM_OPRSZ, XMM_MAXSZ, MO_64) DEF_GEN_INSN2_GVEC(movaps, Wdq, Vdq, mov, XMM_OPRSZ, XMM_MAXSZ, MO_64) +DEF_GEN_INSN2_GVEC(vmovaps, Vdq, Wdq, mov, XMM_OPRSZ, XMM_MAXSZ, MO_64) +DEF_GEN_INSN2_GVEC(vmovaps, Wdq, Vdq, mov, XMM_OPRSZ, XMM_MAXSZ, MO_64) +DEF_GEN_INSN2_GVEC(vmovaps, Vqq, Wqq, mov, XMM_OPRSZ, XMM_MAXSZ, MO_64) +DEF_GEN_INSN2_GVEC(vmovaps, Wqq, Vqq, mov, XMM_OPRSZ, XMM_MAXSZ, MO_64) DEF_GEN_INSN2_GVEC(movapd, Vdq, Wdq, mov, XMM_OPRSZ, XMM_MAXSZ, MO_64) DEF_GEN_INSN2_GVEC(movapd, Wdq, Vdq, mov, XMM_OPRSZ, XMM_MAXSZ, MO_64) +DEF_GEN_INSN2_GVEC(vmovapd, Vdq, Wdq, mov, XMM_OPRSZ, XMM_MAXSZ, MO_64) +DEF_GEN_INSN2_GVEC(vmovapd, Wdq, Vdq, mov, XMM_OPRSZ, XMM_MAXSZ, MO_64) +DEF_GEN_INSN2_GVEC(vmovapd, Vqq, Wqq, mov, XMM_OPRSZ, XMM_MAXSZ, MO_64) +DEF_GEN_INSN2_GVEC(vmovapd, Wqq, Vqq, mov, XMM_OPRSZ, XMM_MAXSZ, MO_64) DEF_GEN_INSN2_GVEC(movdqa, Vdq, Wdq, mov, XMM_OPRSZ, XMM_MAXSZ, MO_64) DEF_GEN_INSN2_GVEC(movdqa, Wdq, Vdq, mov, XMM_OPRSZ, XMM_MAXSZ, MO_64) +DEF_GEN_INSN2_GVEC(vmovdqa, Vdq, Wdq, mov, XMM_OPRSZ, XMM_MAXSZ, MO_64) +DEF_GEN_INSN2_GVEC(vmovdqa, Wdq, Vdq, mov, XMM_OPRSZ, XMM_MAXSZ, MO_64) +DEF_GEN_INSN2_GVEC(vmovdqa, Vqq, Wqq, mov, XMM_OPRSZ, XMM_MAXSZ, MO_64) +DEF_GEN_INSN2_GVEC(vmovdqa, Wqq, Vqq, mov, XMM_OPRSZ, XMM_MAXSZ, MO_64) DEF_GEN_INSN2_GVEC(movups, Vdq, Wdq, mov, XMM_OPRSZ, XMM_MAXSZ, MO_64) DEF_GEN_INSN2_GVEC(movups, Wdq, Vdq, mov, XMM_OPRSZ, XMM_MAXSZ, MO_64) +DEF_GEN_INSN2_GVEC(vmovups, Vdq, Wdq, mov, XMM_OPRSZ, XMM_MAXSZ, MO_64) +DEF_GEN_INSN2_GVEC(vmovups, Wdq, Vdq, mov, XMM_OPRSZ, XMM_MAXSZ, MO_64) +DEF_GEN_INSN2_GVEC(vmovups, Vqq, Wqq, mov, XMM_OPRSZ, XMM_MAXSZ, MO_64) +DEF_GEN_INSN2_GVEC(vmovups, Wqq, Vqq, mov, XMM_OPRSZ, XMM_MAXSZ, MO_64) DEF_GEN_INSN2_GVEC(movupd, Vdq, Wdq, mov, XMM_OPRSZ, XMM_MAXSZ, MO_64) DEF_GEN_INSN2_GVEC(movupd, Wdq, Vdq, mov, XMM_OPRSZ, XMM_MAXSZ, MO_64) +DEF_GEN_INSN2_GVEC(vmovupd, Vdq, Wdq, mov, XMM_OPRSZ, XMM_MAXSZ, MO_64) +DEF_GEN_INSN2_GVEC(vmovupd, Wdq, Vdq, mov, XMM_OPRSZ, XMM_MAXSZ, MO_64) +DEF_GEN_INSN2_GVEC(vmovupd, Vqq, Wqq, mov, XMM_OPRSZ, XMM_MAXSZ, MO_64) +DEF_GEN_INSN2_GVEC(vmovupd, Wqq, Vqq, mov, XMM_OPRSZ, XMM_MAXSZ, MO_64) DEF_GEN_INSN2_GVEC(movdqu, Vdq, Wdq, mov, XMM_OPRSZ, XMM_MAXSZ, MO_64) DEF_GEN_INSN2_GVEC(movdqu, Wdq, Vdq, mov, XMM_OPRSZ, XMM_MAXSZ, MO_64) +DEF_GEN_INSN2_GVEC(vmovdqu, Vdq, Wdq, mov, XMM_OPRSZ, XMM_MAXSZ, MO_64) +DEF_GEN_INSN2_GVEC(vmovdqu, Wdq, Vdq, mov, XMM_OPRSZ, XMM_MAXSZ, MO_64) +DEF_GEN_INSN2_GVEC(vmovdqu, Vqq, Wqq, mov, XMM_OPRSZ, XMM_MAXSZ, MO_64) +DEF_GEN_INSN2_GVEC(vmovdqu, Wqq, Vqq, mov, XMM_OPRSZ, XMM_MAXSZ, MO_64) GEN_INSN4(movss, Vdq, Vdq, Wd, modrm_mod) { @@ -5664,6 +5712,24 @@ GEN_INSN2(movss, Wd, Vd) { gen_insn4(movss, Vdq, Vdq, Wd, modrm_mod)(env, s, arg1, arg1, arg2, 3); } +GEN_INSN5(vmovss, Vdq, Hdq, Wd, modrm_mod, vex_v) +{ + if (arg4 == 3 || arg5 == 0) { + gen_insn4(movss, Vdq, Vdq, Wd, modrm_mod)(env, s, arg1, + arg2, arg3, arg4); + } else { + gen_unknown_opcode(env, s); + } +} +GEN_INSN5(vmovss, Wdq, Hdq, Vd, modrm_mod, vex_v) +{ + if (arg4 == 3 || arg5 == 0) { + gen_insn4(movss, Vdq, Vdq, Wd, modrm_mod)(env, s, arg1, + arg2, arg3, 3); + } else { + gen_unknown_opcode(env, s); + } +} GEN_INSN4(movsd, Vdq, Vdq, Wq, modrm_mod) { @@ -5687,6 +5753,24 @@ GEN_INSN2(movsd, Wq, Vq) { gen_insn4(movsd, Vdq, Vdq, Wq, modrm_mod)(env, s, arg1, arg1, arg2, 3); } +GEN_INSN5(vmovsd, Vdq, Hdq, Wq, modrm_mod, vex_v) +{ + if (arg4 == 3 || arg5 == 0) { + gen_insn4(movsd, Vdq, Vdq, Wq, modrm_mod)(env, s, arg1, + arg2, arg3, arg4); + } else { + gen_unknown_opcode(env, s); + } +} +GEN_INSN5(vmovsd, Wdq, Hdq, Vq, modrm_mod, vex_v) +{ + if (arg4 == 3 || arg5 == 0) { + gen_insn4(movsd, Vdq, Vdq, Wq, modrm_mod)(env, s, arg1, + arg2, arg3, 3); + } else { + gen_unknown_opcode(env, s); + } +} GEN_INSN2(movq2dq, Vdq, Nq) { @@ -5716,10 +5800,18 @@ GEN_INSN3(movhlps, Vdq, Vdq, UdqMhq) } tcg_temp_free_i64(r64); } +GEN_INSN3(vmovhlps, Vdq, Hdq, UdqMhq) +{ + gen_insn3(movhlps, Vdq, Vdq, UdqMhq)(env, s, arg1, arg2, arg3); +} GEN_INSN2(movlps, Mq, Vq) { insnop_ldst(xmm, Mq)(env, s, 1, arg2, arg1); } +GEN_INSN2(vmovlps, Mq, Vq) +{ + gen_insn2(movlps, Mq, Vq)(env, s, arg1, arg2); +} GEN_INSN3(movlpd, Vdq, Vdq, Mq) { @@ -5731,10 +5823,18 @@ GEN_INSN3(movlpd, Vdq, Vdq, Mq) tcg_temp_free_i64(r64); } } +GEN_INSN3(vmovlpd, Vdq, Hdq, Mq) +{ + gen_insn3(movlpd, Vdq, Vdq, Mq)(env, s, arg1, arg2, arg3); +} GEN_INSN2(movlpd, Mq, Vq) { insnop_ldst(xmm, Mq)(env, s, 1, arg2, arg1); } +GEN_INSN2(vmovlpd, Mq, Vq) +{ + gen_insn2(movlpd, Mq, Vq)(env, s, arg1, arg2); +} GEN_INSN3(movlhps, Vdq, Vq, Wq) { @@ -5747,10 +5847,18 @@ GEN_INSN3(movlhps, Vdq, Vq, Wq) } tcg_temp_free_i64(r64); } +GEN_INSN3(vmovlhps, Vdq, Hq, Wq) +{ + gen_insn3(movlhps, Vdq, Vq, Wq)(env, s, arg1, arg2, arg3); +} GEN_INSN2(movhps, Mq, Vdq) { insnop_ldst(xmm, Mhq)(env, s, 1, arg2, arg1); } +GEN_INSN2(vmovhps, Mq, Vdq) +{ + gen_insn2(movhps, Mq, Vdq)(env, s, arg1, arg2); +} GEN_INSN3(movhpd, Vdq, Vq, Mq) { @@ -5766,6 +5874,14 @@ GEN_INSN2(movhpd, Mq, Vdq) { insnop_ldst(xmm, Mhq)(env, s, 1, arg2, arg1); } +GEN_INSN3(vmovhpd, Vdq, Hq, Mq) +{ + gen_insn3(movhpd, Vdq, Vq, Mq)(env, s, arg1, arg2, arg3); +} +GEN_INSN2(vmovhpd, Mq, Vdq) +{ + gen_insn2(movhpd, Mq, Vdq)(env, s, arg1, arg2); +} DEF_GEN_INSN2_HELPER_DEP(pmovmskb, pmovmskb_mmx, Gd, Nq) GEN_INSN2(pmovmskb, Gq, Nq) @@ -5783,6 +5899,14 @@ GEN_INSN2(pmovmskb, Gq, Udq) tcg_gen_extu_i32_i64(arg1, arg1_r32); tcg_temp_free_i32(arg1_r32); } +DEF_GEN_INSN2_HELPER_DEP(vpmovmskb, pmovmskb_xmm, Gd, Udq) +GEN_INSN2(vpmovmskb, Gq, Udq) +{ + const TCGv_i32 arg1_r32 = tcg_temp_new_i32(); + gen_insn2(vpmovmskb, Gd, Udq)(env, s, arg1_r32, arg2); + tcg_gen_extu_i32_i64(arg1, arg1_r32); + tcg_temp_free_i32(arg1_r32); +} DEF_GEN_INSN2_HELPER_DEP(movmskps, movmskps, Gd, Udq) GEN_INSN2(movmskps, Gq, Udq) @@ -5792,6 +5916,22 @@ GEN_INSN2(movmskps, Gq, Udq) tcg_gen_extu_i32_i64(arg1, arg1_r32); tcg_temp_free_i32(arg1_r32); } +DEF_GEN_INSN2_HELPER_DEP(vmovmskps, movmskps, Gd, Udq) +GEN_INSN2(vmovmskps, Gq, Udq) +{ + const TCGv_i32 arg1_r32 = tcg_temp_new_i32(); + gen_insn2(vmovmskps, Gd, Udq)(env, s, arg1_r32, arg2); + tcg_gen_extu_i32_i64(arg1, arg1_r32); + tcg_temp_free_i32(arg1_r32); +} +DEF_GEN_INSN2_HELPER_DEP(vmovmskps, movmskps, Gd, Uqq) +GEN_INSN2(vmovmskps, Gq, Uqq) +{ + const TCGv_i32 arg1_r32 = tcg_temp_new_i32(); + gen_insn2(vmovmskps, Gd, Uqq)(env, s, arg1_r32, arg2); + tcg_gen_extu_i32_i64(arg1, arg1_r32); + tcg_temp_free_i32(arg1_r32); +} DEF_GEN_INSN2_HELPER_DEP(movmskpd, movmskpd, Gd, Udq) GEN_INSN2(movmskpd, Gq, Udq) @@ -5801,11 +5941,35 @@ GEN_INSN2(movmskpd, Gq, Udq) tcg_gen_extu_i32_i64(arg1, arg1_r32); tcg_temp_free_i32(arg1_r32); } +DEF_GEN_INSN2_HELPER_DEP(vmovmskpd, movmskpd, Gd, Udq) +GEN_INSN2(vmovmskpd, Gq, Udq) +{ + const TCGv_i32 arg1_r32 = tcg_temp_new_i32(); + gen_insn2(vmovmskpd, Gd, Udq)(env, s, arg1_r32, arg2); + tcg_gen_extu_i32_i64(arg1, arg1_r32); + tcg_temp_free_i32(arg1_r32); +} +DEF_GEN_INSN2_HELPER_DEP(vmovmskpd, movmskpd, Gd, Uqq) +GEN_INSN2(vmovmskpd, Gq, Uqq) +{ + const TCGv_i32 arg1_r32 = tcg_temp_new_i32(); + gen_insn2(vmovmskpd, Gd, Uqq)(env, s, arg1_r32, arg2); + tcg_gen_extu_i32_i64(arg1, arg1_r32); + tcg_temp_free_i32(arg1_r32); +} GEN_INSN2(lddqu, Vdq, Mdq) { insnop_ldst(xmm, Mdq)(env, s, 0, arg1, arg2); } +GEN_INSN2(vlddqu, Vdq, Mdq) +{ + gen_insn2(lddqu, Vdq, Mdq)(env, s, arg1, arg2); +} +GEN_INSN2(vlddqu, Vqq, Mqq) +{ + gen_insn2(vlddqu, Vdq, Mdq)(env, s, arg1, arg2); +} GEN_INSN2(movshdup, Vdq, Wdq) { @@ -5825,6 +5989,15 @@ GEN_INSN2(movshdup, Vdq, Wdq) tcg_temp_free_i32(r32); } +GEN_INSN2(vmovshdup, Vdq, Wdq) +{ + gen_insn2(movshdup, Vdq, Wdq)(env, s, arg1, arg2); +} +GEN_INSN2(vmovshdup, Vqq, Wqq) +{ + gen_insn2(vmovshdup, Vdq, Wdq)(env, s, arg1, arg2); +} + GEN_INSN2(movsldup, Vdq, Wdq) { const TCGv_i32 r32 = tcg_temp_new_i32(); @@ -5843,6 +6016,15 @@ GEN_INSN2(movsldup, Vdq, Wdq) tcg_temp_free_i32(r32); } +GEN_INSN2(vmovsldup, Vdq, Wdq) +{ + gen_insn2(movsldup, Vdq, Wdq)(env, s, arg1, arg2); +} +GEN_INSN2(vmovsldup, Vqq, Wqq) +{ + gen_insn2(movsldup, Vdq, Wdq)(env, s, arg1, arg2); +} + GEN_INSN2(movddup, Vdq, Wq) { const TCGv_i64 r64 = tcg_temp_new_i64(); @@ -5855,154 +6037,285 @@ GEN_INSN2(movddup, Vdq, Wq) tcg_temp_free_i64(r64); } +GEN_INSN2(vmovddup, Vdq, Wq) +{ + gen_insn2(movddup, Vdq, Wq)(env, s, arg1, arg2); +} +GEN_INSN2(vmovddup, Vqq, Wqq) +{ + gen_insn2(vmovddup, Vdq, Wq)(env, s, arg1, arg2); +} DEF_GEN_INSN3_GVEC(paddb, Pq, Pq, Qq, add, MM_OPRSZ, MM_MAXSZ, MO_8) DEF_GEN_INSN3_GVEC(paddb, Vdq, Vdq, Wdq, add, XMM_OPRSZ, XMM_MAXSZ, MO_8) +DEF_GEN_INSN3_GVEC(vpaddb, Vdq, Hdq, Wdq, add, XMM_OPRSZ, XMM_MAXSZ, MO_8) DEF_GEN_INSN3_GVEC(paddw, Pq, Pq, Qq, add, MM_OPRSZ, MM_MAXSZ, MO_16) DEF_GEN_INSN3_GVEC(paddw, Vdq, Vdq, Wdq, add, XMM_OPRSZ, XMM_MAXSZ, MO_16) +DEF_GEN_INSN3_GVEC(vpaddw, Vdq, Hdq, Wdq, add, XMM_OPRSZ, XMM_MAXSZ, MO_16) DEF_GEN_INSN3_GVEC(paddd, Pq, Pq, Qq, add, MM_OPRSZ, MM_MAXSZ, MO_32) DEF_GEN_INSN3_GVEC(paddd, Vdq, Vdq, Wdq, add, XMM_OPRSZ, XMM_MAXSZ, MO_32) +DEF_GEN_INSN3_GVEC(vpaddd, Vdq, Hdq, Wdq, add, XMM_OPRSZ, XMM_MAXSZ, MO_32) DEF_GEN_INSN3_GVEC(paddq, Pq, Pq, Qq, add, MM_OPRSZ, MM_MAXSZ, MO_64) DEF_GEN_INSN3_GVEC(paddq, Vdq, Vdq, Wdq, add, XMM_OPRSZ, XMM_MAXSZ, MO_64) +DEF_GEN_INSN3_GVEC(vpaddq, Vdq, Hdq, Wdq, add, XMM_OPRSZ, XMM_MAXSZ, MO_64) DEF_GEN_INSN3_GVEC(paddsb, Pq, Pq, Qq, ssadd, MM_OPRSZ, MM_MAXSZ, MO_8) DEF_GEN_INSN3_GVEC(paddsb, Vdq, Vdq, Wdq, ssadd, XMM_OPRSZ, XMM_MAXSZ, MO_8) +DEF_GEN_INSN3_GVEC(vpaddsb, Vdq, Hdq, Wdq, ssadd, XMM_OPRSZ, XMM_MAXSZ, MO_8) DEF_GEN_INSN3_GVEC(paddsw, Pq, Pq, Qq, ssadd, MM_OPRSZ, MM_MAXSZ, MO_16) DEF_GEN_INSN3_GVEC(paddsw, Vdq, Vdq, Wdq, ssadd, XMM_OPRSZ, XMM_MAXSZ, MO_16) +DEF_GEN_INSN3_GVEC(vpaddsw, Vdq, Hdq, Wdq, ssadd, XMM_OPRSZ, XMM_MAXSZ, MO_16) DEF_GEN_INSN3_GVEC(paddusb, Pq, Pq, Qq, usadd, MM_OPRSZ, MM_MAXSZ, MO_8) DEF_GEN_INSN3_GVEC(paddusb, Vdq, Vdq, Wdq, usadd, XMM_OPRSZ, XMM_MAXSZ, MO_8) +DEF_GEN_INSN3_GVEC(vpaddusb, Vdq, Hdq, Wdq, usadd, XMM_OPRSZ, XMM_MAXSZ, MO_8) DEF_GEN_INSN3_GVEC(paddusw, Pq, Pq, Qq, usadd, MM_OPRSZ, MM_MAXSZ, MO_16) DEF_GEN_INSN3_GVEC(paddusw, Vdq, Vdq, Wdq, usadd, XMM_OPRSZ, XMM_MAXSZ, MO_16) +DEF_GEN_INSN3_GVEC(vpaddusw, Vdq, Hdq, Wdq, usadd, XMM_OPRSZ, XMM_MAXSZ, MO_16) DEF_GEN_INSN3_HELPER_EPP(addps, addps, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vaddps, addps, Vdq, Hdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vaddps, addps, Vqq, Hqq, Wqq) DEF_GEN_INSN3_HELPER_EPP(addpd, addpd, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vaddpd, addpd, Vdq, Hdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vaddpd, addpd, Vqq, Hqq, Wqq) DEF_GEN_INSN3_HELPER_EPP(addss, addss, Vd, Vd, Wd) +DEF_GEN_INSN3_HELPER_EPP(vaddss, addss, Vd, Hd, Wd) DEF_GEN_INSN3_HELPER_EPP(addsd, addsd, Vq, Vq, Wq) +DEF_GEN_INSN3_HELPER_EPP(vaddsd, addsd, Vq, Hq, Wq) DEF_GEN_INSN3_HELPER_EPP(phaddw, phaddw_mmx, Pq, Pq, Qq) DEF_GEN_INSN3_HELPER_EPP(phaddw, phaddw_xmm, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vphaddw, phaddw_xmm, Vdq, Hdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(phaddd, phaddd_mmx, Pq, Pq, Qq) DEF_GEN_INSN3_HELPER_EPP(phaddd, phaddd_xmm, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vphaddd, phaddd_xmm, Vdq, Hdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(phaddsw, phaddsw_mmx, Pq, Pq, Qq) DEF_GEN_INSN3_HELPER_EPP(phaddsw, phaddsw_xmm, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vphaddsw, phaddsw_xmm, Vdq, Hdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(haddps, haddps, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vhaddps, haddps, Vdq, Hdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vhaddps, haddps, Vqq, Hqq, Wqq) DEF_GEN_INSN3_HELPER_EPP(haddpd, haddpd, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vhaddpd, haddpd, Vdq, Hdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vhaddpd, haddpd, Vqq, Hqq, Wqq) DEF_GEN_INSN3_GVEC(psubb, Pq, Pq, Qq, sub, MM_OPRSZ, MM_MAXSZ, MO_8) DEF_GEN_INSN3_GVEC(psubb, Vdq, Vdq, Wdq, sub, XMM_OPRSZ, XMM_MAXSZ, MO_8) +DEF_GEN_INSN3_GVEC(vpsubb, Vdq, Hdq, Wdq, sub, XMM_OPRSZ, XMM_MAXSZ, MO_8) DEF_GEN_INSN3_GVEC(psubw, Pq, Pq, Qq, sub, MM_OPRSZ, MM_MAXSZ, MO_16) DEF_GEN_INSN3_GVEC(psubw, Vdq, Vdq, Wdq, sub, XMM_OPRSZ, XMM_MAXSZ, MO_16) +DEF_GEN_INSN3_GVEC(vpsubw, Vdq, Hdq, Wdq, sub, XMM_OPRSZ, XMM_MAXSZ, MO_16) DEF_GEN_INSN3_GVEC(psubd, Pq, Pq, Qq, sub, MM_OPRSZ, MM_MAXSZ, MO_32) DEF_GEN_INSN3_GVEC(psubd, Vdq, Vdq, Wdq, sub, XMM_OPRSZ, XMM_MAXSZ, MO_32) +DEF_GEN_INSN3_GVEC(vpsubd, Vdq, Hdq, Wdq, sub, XMM_OPRSZ, XMM_MAXSZ, MO_32) DEF_GEN_INSN3_GVEC(psubq, Pq, Pq, Qq, sub, MM_OPRSZ, MM_MAXSZ, MO_64) DEF_GEN_INSN3_GVEC(psubq, Vdq, Vdq, Wdq, sub, XMM_OPRSZ, XMM_MAXSZ, MO_64) +DEF_GEN_INSN3_GVEC(vpsubq, Vdq, Hdq, Wdq, sub, XMM_OPRSZ, XMM_MAXSZ, MO_64) DEF_GEN_INSN3_GVEC(psubsb, Pq, Pq, Qq, sssub, MM_OPRSZ, MM_MAXSZ, MO_8) DEF_GEN_INSN3_GVEC(psubsb, Vdq, Vdq, Wdq, sssub, XMM_OPRSZ, XMM_MAXSZ, MO_8) +DEF_GEN_INSN3_GVEC(vpsubsb, Vdq, Hdq, Wdq, sssub, XMM_OPRSZ, XMM_MAXSZ, MO_8) DEF_GEN_INSN3_GVEC(psubsw, Pq, Pq, Qq, sssub, MM_OPRSZ, MM_MAXSZ, MO_16) DEF_GEN_INSN3_GVEC(psubsw, Vdq, Vdq, Wdq, sssub, XMM_OPRSZ, XMM_MAXSZ, MO_16) +DEF_GEN_INSN3_GVEC(vpsubsw, Vdq, Hdq, Wdq, sssub, XMM_OPRSZ, XMM_MAXSZ, MO_16) DEF_GEN_INSN3_GVEC(psubusb, Pq, Pq, Qq, ussub, MM_OPRSZ, MM_MAXSZ, MO_8) DEF_GEN_INSN3_GVEC(psubusb, Vdq, Vdq, Wdq, ussub, XMM_OPRSZ, XMM_MAXSZ, MO_8) +DEF_GEN_INSN3_GVEC(vpsubusb, Vdq, Hdq, Wdq, ussub, XMM_OPRSZ, XMM_MAXSZ, MO_8) DEF_GEN_INSN3_GVEC(psubusw, Pq, Pq, Qq, ussub, MM_OPRSZ, MM_MAXSZ, MO_16) DEF_GEN_INSN3_GVEC(psubusw, Vdq, Vdq, Wdq, ussub, XMM_OPRSZ, XMM_MAXSZ, MO_16) +DEF_GEN_INSN3_GVEC(vpsubusw, Vdq, Hdq, Wdq, ussub, XMM_OPRSZ, XMM_MAXSZ, MO_16) DEF_GEN_INSN3_HELPER_EPP(subps, subps, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vsubps, subps, Vdq, Hdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vsubps, subps, Vqq, Hqq, Wqq) DEF_GEN_INSN3_HELPER_EPP(subpd, subpd, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vsubpd, subpd, Vdq, Hdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vsubpd, subpd, Vqq, Hqq, Wqq) DEF_GEN_INSN3_HELPER_EPP(subss, subss, Vd, Vd, Wd) +DEF_GEN_INSN3_HELPER_EPP(vsubss, subss, Vd, Hd, Wd) DEF_GEN_INSN3_HELPER_EPP(subsd, subsd, Vq, Vq, Wq) +DEF_GEN_INSN3_HELPER_EPP(vsubsd, subsd, Vq, Hq, Wq) DEF_GEN_INSN3_HELPER_EPP(phsubw, phsubw_mmx, Pq, Pq, Qq) DEF_GEN_INSN3_HELPER_EPP(phsubw, phsubw_xmm, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vphsubw, phsubw_xmm, Vdq, Hdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(phsubd, phsubd_mmx, Pq, Pq, Qq) DEF_GEN_INSN3_HELPER_EPP(phsubd, phsubd_xmm, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vphsubd, phsubd_xmm, Vdq, Hdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(phsubsw, phsubsw_mmx, Pq, Pq, Qq) DEF_GEN_INSN3_HELPER_EPP(phsubsw, phsubsw_xmm, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vphsubsw, phsubsw_xmm, Vdq, Hdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(hsubps, hsubps, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vhsubps, hsubps, Vdq, Hdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vhsubps, hsubps, Vqq, Hqq, Wqq) DEF_GEN_INSN3_HELPER_EPP(hsubpd, hsubpd, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vhsubpd, hsubpd, Vdq, Hdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vhsubpd, hsubpd, Vqq, Hqq, Wqq) DEF_GEN_INSN3_HELPER_EPP(addsubps, addsubps, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vaddsubps, addsubps, Vdq, Hdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vaddsubps, addsubps, Vqq, Hqq, Wqq) DEF_GEN_INSN3_HELPER_EPP(addsubpd, addsubpd, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vaddsubpd, addsubpd, Vdq, Hdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vaddsubpd, addsubpd, Vqq, Hqq, Wqq) DEF_GEN_INSN3_HELPER_EPP(pmullw, pmullw_mmx, Pq, Pq, Qq) DEF_GEN_INSN3_HELPER_EPP(pmullw, pmullw_xmm, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vpmullw, pmullw_xmm, Vdq, Hdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(pmulld, pmulld_xmm, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vpmulld, pmulld_xmm, Vdq, Hdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(pmulhw, pmulhw_mmx, Pq, Pq, Qq) DEF_GEN_INSN3_HELPER_EPP(pmulhw, pmulhw_xmm, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vpmulhw, pmulhw_xmm, Vdq, Hdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(pmulhuw, pmulhuw_mmx, Pq, Pq, Qq) DEF_GEN_INSN3_HELPER_EPP(pmulhuw, pmulhuw_xmm, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vpmulhuw, pmulhuw_xmm, Vdq, Hdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(pmuldq, pmuldq_xmm, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vpmuldq, pmuldq_xmm, Vdq, Hdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(pmuludq, pmuludq_mmx, Pq, Pq, Qq) DEF_GEN_INSN3_HELPER_EPP(pmuludq, pmuludq_xmm, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vpmuludq, pmuludq_xmm, Vdq, Hdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(pmulhrsw, pmulhrsw_mmx, Pq, Pq, Qq) DEF_GEN_INSN3_HELPER_EPP(pmulhrsw, pmulhrsw_xmm, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vpmulhrsw, pmulhrsw_xmm, Vdq, Hdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(mulps, mulps, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vmulps, mulps, Vdq, Hdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vmulps, mulps, Vqq, Hqq, Wqq) DEF_GEN_INSN3_HELPER_EPP(mulpd, mulpd, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vmulpd, mulpd, Vdq, Hdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vmulpd, mulpd, Vqq, Hqq, Wqq) DEF_GEN_INSN3_HELPER_EPP(mulss, mulss, Vd, Vd, Wd) +DEF_GEN_INSN3_HELPER_EPP(vmulss, mulss, Vd, Hd, Wd) DEF_GEN_INSN3_HELPER_EPP(mulsd, mulsd, Vq, Vq, Wq) +DEF_GEN_INSN3_HELPER_EPP(vmulsd, mulsd, Vq, Hq, Wq) DEF_GEN_INSN3_HELPER_EPP(pmaddwd, pmaddwd_mmx, Pq, Pq, Qq) DEF_GEN_INSN3_HELPER_EPP(pmaddwd, pmaddwd_xmm, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vpmaddwd, pmaddwd_xmm, Vdq, Hdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(pmaddubsw, pmaddubsw_mmx, Pq, Pq, Qq) DEF_GEN_INSN3_HELPER_EPP(pmaddubsw, pmaddubsw_xmm, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vpmaddubsw, pmaddubsw_xmm, Vdq, Hdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(divps, divps, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vdivps, divps, Vdq, Hdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vdivps, divps, Vqq, Hqq, Wqq) DEF_GEN_INSN3_HELPER_EPP(divpd, divpd, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vdivpd, divpd, Vdq, Hdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vdivpd, divpd, Vqq, Hqq, Wqq) DEF_GEN_INSN3_HELPER_EPP(divss, divss, Vd, Vd, Wd) +DEF_GEN_INSN3_HELPER_EPP(vdivss, divss, Vd, Hd, Wd) DEF_GEN_INSN3_HELPER_EPP(divsd, divsd, Vq, Vq, Wq) +DEF_GEN_INSN3_HELPER_EPP(vdivsd, divsd, Vq, Hq, Wq) DEF_GEN_INSN2_HELPER_EPP(rcpps, rcpps, Vdq, Wdq) +DEF_GEN_INSN2_HELPER_EPP(vrcpps, rcpps, Vdq, Wdq) +DEF_GEN_INSN2_HELPER_EPP(vrcpps, rcpps, Vqq, Wqq) DEF_GEN_INSN2_HELPER_EPP(rcpss, rcpss, Vd, Wd) +DEF_GEN_INSN3_HELPER_EPP(vrcpss, rcpss, Vd, Hd, Wd) DEF_GEN_INSN2_HELPER_EPP(sqrtps, sqrtps, Vdq, Wdq) +DEF_GEN_INSN2_HELPER_EPP(vsqrtps, sqrtps, Vdq, Wdq) +DEF_GEN_INSN2_HELPER_EPP(vsqrtps, sqrtps, Vqq, Wqq) DEF_GEN_INSN2_HELPER_EPP(sqrtpd, sqrtpd, Vdq, Wdq) +DEF_GEN_INSN2_HELPER_EPP(vsqrtpd, sqrtpd, Vdq, Wdq) +DEF_GEN_INSN2_HELPER_EPP(vsqrtpd, sqrtpd, Vqq, Wqq) DEF_GEN_INSN2_HELPER_EPP(sqrtss, sqrtss, Vd, Wd) +DEF_GEN_INSN3_HELPER_EPP(vsqrtss, sqrtss, Vd, Hd, Wd) DEF_GEN_INSN2_HELPER_EPP(sqrtsd, sqrtsd, Vq, Wq) +DEF_GEN_INSN3_HELPER_EPP(vsqrtsd, sqrtsd, Vq, Hq, Wq) DEF_GEN_INSN2_HELPER_EPP(rsqrtps, rsqrtps, Vdq, Wdq) +DEF_GEN_INSN2_HELPER_EPP(vrsqrtps, rsqrtps, Vdq, Wdq) +DEF_GEN_INSN2_HELPER_EPP(vrsqrtps, rsqrtps, Vqq, Wqq) DEF_GEN_INSN2_HELPER_EPP(rsqrtss, rsqrtss, Vd, Wd) +DEF_GEN_INSN3_HELPER_EPP(vrsqrtss, rsqrtss, Vd, Hd, Wd) DEF_GEN_INSN3_GVEC(pminub, Pq, Pq, Qq, umin, MM_OPRSZ, MM_MAXSZ, MO_8) DEF_GEN_INSN3_GVEC(pminub, Vdq, Vdq, Wdq, umin, XMM_OPRSZ, XMM_MAXSZ, MO_8) +DEF_GEN_INSN3_GVEC(vpminub, Vdq, Hdq, Wdq, umin, XMM_OPRSZ, XMM_MAXSZ, MO_8) DEF_GEN_INSN3_GVEC(pminuw, Vdq, Vdq, Wdq, umin, XMM_OPRSZ, XMM_MAXSZ, MO_16) +DEF_GEN_INSN3_GVEC(vpminuw, Vdq, Hdq, Wdq, umin, XMM_OPRSZ, XMM_MAXSZ, MO_16) DEF_GEN_INSN3_GVEC(pminud, Vdq, Vdq, Wdq, umin, XMM_OPRSZ, XMM_MAXSZ, MO_32) +DEF_GEN_INSN3_GVEC(vpminud, Vdq, Hdq, Wdq, umin, XMM_OPRSZ, XMM_MAXSZ, MO_32) DEF_GEN_INSN3_GVEC(pminsb, Vdq, Vdq, Wdq, smin, XMM_OPRSZ, XMM_MAXSZ, MO_8) +DEF_GEN_INSN3_GVEC(vpminsb, Vdq, Hdq, Wdq, smin, XMM_OPRSZ, XMM_MAXSZ, MO_8) DEF_GEN_INSN3_GVEC(pminsw, Pq, Pq, Qq, smin, MM_OPRSZ, MM_MAXSZ, MO_16) DEF_GEN_INSN3_GVEC(pminsw, Vdq, Vdq, Wdq, smin, XMM_OPRSZ, XMM_MAXSZ, MO_16) +DEF_GEN_INSN3_GVEC(vpminsw, Vdq, Hdq, Wdq, smin, XMM_OPRSZ, XMM_MAXSZ, MO_16) DEF_GEN_INSN3_GVEC(pminsd, Vdq, Vdq, Wdq, smin, XMM_OPRSZ, XMM_MAXSZ, MO_32) +DEF_GEN_INSN3_GVEC(vpminsd, Vdq, Hdq, Wdq, smin, XMM_OPRSZ, XMM_MAXSZ, MO_32) DEF_GEN_INSN3_HELPER_EPP(minps, minps, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vminps, minps, Vdq, Hdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vminps, minps, Vqq, Hqq, Wqq) DEF_GEN_INSN3_HELPER_EPP(minpd, minpd, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vminpd, minpd, Vdq, Hdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vminpd, minpd, Vqq, Hqq, Wqq) DEF_GEN_INSN3_HELPER_EPP(minss, minss, Vd, Vd, Wd) +DEF_GEN_INSN3_HELPER_EPP(vminss, minss, Vd, Hd, Wd) DEF_GEN_INSN3_HELPER_EPP(minsd, minsd, Vq, Vq, Wq) +DEF_GEN_INSN3_HELPER_EPP(vminsd, minsd, Vq, Hq, Wq) DEF_GEN_INSN2_HELPER_EPP(phminposuw, phminposuw_xmm, Vdq, Wdq) +DEF_GEN_INSN2_HELPER_EPP(vphminposuw, phminposuw_xmm, Vdq, Wdq) DEF_GEN_INSN3_GVEC(pmaxub, Pq, Pq, Qq, umax, MM_OPRSZ, MM_MAXSZ, MO_8) DEF_GEN_INSN3_GVEC(pmaxub, Vdq, Vdq, Wdq, umax, XMM_OPRSZ, XMM_MAXSZ, MO_8) +DEF_GEN_INSN3_GVEC(vpmaxub, Vdq, Hdq, Wdq, umax, XMM_OPRSZ, XMM_MAXSZ, MO_8) DEF_GEN_INSN3_GVEC(pmaxuw, Vdq, Vdq, Wdq, umax, XMM_OPRSZ, XMM_MAXSZ, MO_16) +DEF_GEN_INSN3_GVEC(vpmaxuw, Vdq, Hdq, Wdq, umax, XMM_OPRSZ, XMM_MAXSZ, MO_16) DEF_GEN_INSN3_GVEC(pmaxud, Vdq, Vdq, Wdq, umax, XMM_OPRSZ, XMM_MAXSZ, MO_32) +DEF_GEN_INSN3_GVEC(vpmaxud, Vdq, Hdq, Wdq, umax, XMM_OPRSZ, XMM_MAXSZ, MO_32) DEF_GEN_INSN3_GVEC(pmaxsb, Vdq, Vdq, Wdq, smax, XMM_OPRSZ, XMM_MAXSZ, MO_8) +DEF_GEN_INSN3_GVEC(vpmaxsb, Vdq, Hdq, Wdq, smax, XMM_OPRSZ, XMM_MAXSZ, MO_8) DEF_GEN_INSN3_GVEC(pmaxsw, Pq, Pq, Qq, smax, MM_OPRSZ, MM_MAXSZ, MO_16) DEF_GEN_INSN3_GVEC(pmaxsw, Vdq, Vdq, Wdq, smax, XMM_OPRSZ, XMM_MAXSZ, MO_16) +DEF_GEN_INSN3_GVEC(vpmaxsw, Vdq, Hdq, Wdq, smax, XMM_OPRSZ, XMM_MAXSZ, MO_16) DEF_GEN_INSN3_GVEC(pmaxsd, Vdq, Vdq, Wdq, smax, XMM_OPRSZ, XMM_MAXSZ, MO_32) +DEF_GEN_INSN3_GVEC(vpmaxsd, Vdq, Hdq, Wdq, smax, XMM_OPRSZ, XMM_MAXSZ, MO_32) DEF_GEN_INSN3_HELPER_EPP(maxps, maxps, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vmaxps, maxps, Vdq, Hdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vmaxps, maxps, Vqq, Hqq, Wqq) DEF_GEN_INSN3_HELPER_EPP(maxpd, maxpd, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vmaxpd, maxpd, Vdq, Hdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vmaxpd, maxpd, Vqq, Hqq, Wqq) DEF_GEN_INSN3_HELPER_EPP(maxss, maxss, Vd, Vd, Wd) +DEF_GEN_INSN3_HELPER_EPP(vmaxss, maxss, Vd, Hd, Wd) DEF_GEN_INSN3_HELPER_EPP(maxsd, maxsd, Vq, Vq, Wq) +DEF_GEN_INSN3_HELPER_EPP(vmaxsd, maxsd, Vq, Hq, Wq) DEF_GEN_INSN3_HELPER_EPP(pavgb, pavgb_mmx, Pq, Pq, Qq) DEF_GEN_INSN3_HELPER_EPP(pavgb, pavgb_xmm, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vpavgb, pavgb_xmm, Vdq, Hdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(pavgw, pavgw_mmx, Pq, Pq, Qq) DEF_GEN_INSN3_HELPER_EPP(pavgw, pavgw_xmm, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vpavgw, pavgw_xmm, Vdq, Hdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(psadbw, psadbw_mmx, Pq, Pq, Qq) DEF_GEN_INSN3_HELPER_EPP(psadbw, psadbw_xmm, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vpsadbw, psadbw_xmm, Vdq, Hdq, Wdq) DEF_GEN_INSN4_HELPER_EPPI(mpsadbw, mpsadbw_xmm, Vdq, Vdq, Wdq, Ib) +DEF_GEN_INSN4_HELPER_EPPI(vmpsadbw, mpsadbw_xmm, Vdq, Hdq, Wdq, Ib) DEF_GEN_INSN2_HELPER_EPP(pabsb, pabsb_mmx, Pq, Qq) DEF_GEN_INSN2_HELPER_EPP(pabsb, pabsb_xmm, Vdq, Wdq) +DEF_GEN_INSN2_HELPER_EPP(vpabsb, pabsb_xmm, Vdq, Wdq) DEF_GEN_INSN2_HELPER_EPP(pabsw, pabsw_mmx, Pq, Qq) DEF_GEN_INSN2_HELPER_EPP(pabsw, pabsw_xmm, Vdq, Wdq) +DEF_GEN_INSN2_HELPER_EPP(vpabsw, pabsw_xmm, Vdq, Wdq) DEF_GEN_INSN2_HELPER_EPP(pabsd, pabsd_mmx, Pq, Qq) DEF_GEN_INSN2_HELPER_EPP(pabsd, pabsd_xmm, Vdq, Wdq) +DEF_GEN_INSN2_HELPER_EPP(vpabsd, pabsd_xmm, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(psignb, psignb_mmx, Pq, Pq, Qq) DEF_GEN_INSN3_HELPER_EPP(psignb, psignb_xmm, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vpsignb, psignb_xmm, Vdq, Hdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(psignw, psignw_mmx, Pq, Pq, Qq) DEF_GEN_INSN3_HELPER_EPP(psignw, psignw_xmm, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vpsignw, psignw_xmm, Vdq, Hdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(psignd, psignd_mmx, Pq, Pq, Qq) DEF_GEN_INSN3_HELPER_EPP(psignd, psignd_xmm, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vpsignd, psignd_xmm, Vdq, Hdq, Wdq) DEF_GEN_INSN4_HELPER_EPPI(dpps, dpps_xmm, Vdq, Vdq, Wdq, Ib) +DEF_GEN_INSN4_HELPER_EPPI(vdpps, dpps_xmm, Vdq, Hdq, Wdq, Ib) +DEF_GEN_INSN4_HELPER_EPPI(vdpps, dpps_xmm, Vqq, Hqq, Wqq, Ib) DEF_GEN_INSN4_HELPER_EPPI(dppd, dppd_xmm, Vdq, Vdq, Wdq, Ib) +DEF_GEN_INSN4_HELPER_EPPI(vdppd, dppd_xmm, Vdq, Hdq, Wdq, Ib) DEF_GEN_INSN3_HELPER_EPPI(roundps, roundps_xmm, Vdq, Wdq, Ib) +DEF_GEN_INSN3_HELPER_EPPI(vroundps, roundps_xmm, Vdq, Wdq, Ib) +DEF_GEN_INSN3_HELPER_EPPI(vroundps, roundps_xmm, Vqq, Wqq, Ib) DEF_GEN_INSN3_HELPER_EPPI(roundpd, roundpd_xmm, Vdq, Wdq, Ib) +DEF_GEN_INSN3_HELPER_EPPI(vroundpd, roundpd_xmm, Vdq, Wdq, Ib) +DEF_GEN_INSN3_HELPER_EPPI(vroundpd, roundpd_xmm, Vqq, Wqq, Ib) DEF_GEN_INSN3_HELPER_EPPI(roundss, roundss_xmm, Vd, Wd, Ib) +DEF_GEN_INSN4_HELPER_EPPI(vroundss, roundss_xmm, Vd, Hd, Wd, Ib) DEF_GEN_INSN3_HELPER_EPPI(roundsd, roundsd_xmm, Vq, Wq, Ib) +DEF_GEN_INSN4_HELPER_EPPI(vroundsd, roundsd_xmm, Vq, Hq, Wq, Ib) DEF_GEN_INSN3_HELPER_EPP(aesdec, aesdec_xmm, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(vaesdec, aesdec_xmm, Vdq, Hdq, Wdq) @@ -6021,58 +6334,124 @@ DEF_GEN_INSN4_HELPER_EPPI(vpclmulqdq, pclmulqdq_xmm, Vdq, Hdq, Wdq, Ib) DEF_GEN_INSN3_GVEC(pcmpeqb, Pq, Pq, Qq, cmp, MM_OPRSZ, MM_MAXSZ, MO_8, TCG_COND_EQ) DEF_GEN_INSN3_GVEC(pcmpeqb, Vdq, Vdq, Wdq, cmp, XMM_OPRSZ, XMM_MAXSZ, MO_8, TCG_COND_EQ) +DEF_GEN_INSN3_GVEC(vpcmpeqb, Vdq, Hdq, Wdq, cmp, XMM_OPRSZ, XMM_MAXSZ, MO_8, TCG_COND_EQ) DEF_GEN_INSN3_GVEC(pcmpeqw, Pq, Pq, Qq, cmp, MM_OPRSZ, MM_MAXSZ, MO_16, TCG_COND_EQ) DEF_GEN_INSN3_GVEC(pcmpeqw, Vdq, Vdq, Wdq, cmp, XMM_OPRSZ, XMM_MAXSZ, MO_16, TCG_COND_EQ) +DEF_GEN_INSN3_GVEC(vpcmpeqw, Vdq, Hdq, Wdq, cmp, XMM_OPRSZ, XMM_MAXSZ, MO_16, TCG_COND_EQ) DEF_GEN_INSN3_GVEC(pcmpeqd, Pq, Pq, Qq, cmp, MM_OPRSZ, MM_MAXSZ, MO_32, TCG_COND_EQ) DEF_GEN_INSN3_GVEC(pcmpeqd, Vdq, Vdq, Wdq, cmp, XMM_OPRSZ, XMM_MAXSZ, MO_32, TCG_COND_EQ) +DEF_GEN_INSN3_GVEC(vpcmpeqd, Vdq, Hdq, Wdq, cmp, XMM_OPRSZ, XMM_MAXSZ, MO_32, TCG_COND_EQ) DEF_GEN_INSN3_GVEC(pcmpeqq, Vdq, Vdq, Wdq, cmp, XMM_OPRSZ, XMM_MAXSZ, MO_64, TCG_COND_EQ) +DEF_GEN_INSN3_GVEC(vpcmpeqq, Vdq, Hdq, Wdq, cmp, XMM_OPRSZ, XMM_MAXSZ, MO_64, TCG_COND_EQ) DEF_GEN_INSN3_GVEC(pcmpgtb, Pq, Pq, Qq, cmp, MM_OPRSZ, MM_MAXSZ, MO_8, TCG_COND_GT) DEF_GEN_INSN3_GVEC(pcmpgtb, Vdq, Vdq, Wdq, cmp, XMM_OPRSZ, XMM_MAXSZ, MO_8, TCG_COND_GT) +DEF_GEN_INSN3_GVEC(vpcmpgtb, Vdq, Hdq, Wdq, cmp, XMM_OPRSZ, XMM_MAXSZ, MO_8, TCG_COND_GT) DEF_GEN_INSN3_GVEC(pcmpgtw, Pq, Pq, Qq, cmp, MM_OPRSZ, MM_MAXSZ, MO_16, TCG_COND_GT) DEF_GEN_INSN3_GVEC(pcmpgtw, Vdq, Vdq, Wdq, cmp, XMM_OPRSZ, XMM_MAXSZ, MO_16, TCG_COND_GT) +DEF_GEN_INSN3_GVEC(vpcmpgtw, Vdq, Hdq, Wdq, cmp, XMM_OPRSZ, XMM_MAXSZ, MO_16, TCG_COND_GT) DEF_GEN_INSN3_GVEC(pcmpgtd, Pq, Pq, Qq, cmp, MM_OPRSZ, MM_MAXSZ, MO_32, TCG_COND_GT) DEF_GEN_INSN3_GVEC(pcmpgtd, Vdq, Vdq, Wdq, cmp, XMM_OPRSZ, XMM_MAXSZ, MO_32, TCG_COND_GT) +DEF_GEN_INSN3_GVEC(vpcmpgtd, Vdq, Hdq, Wdq, cmp, XMM_OPRSZ, XMM_MAXSZ, MO_32, TCG_COND_GT) DEF_GEN_INSN3_GVEC(pcmpgtq, Vdq, Vdq, Wdq, cmp, XMM_OPRSZ, XMM_MAXSZ, MO_64, TCG_COND_GT) +DEF_GEN_INSN3_GVEC(vpcmpgtq, Vdq, Hdq, Wdq, cmp, XMM_OPRSZ, XMM_MAXSZ, MO_64, TCG_COND_GT) DEF_GEN_INSN3_HELPER_EPPI(pcmpestrm, pcmpestrm_xmm, Vdq, Wdq, Ib) +DEF_GEN_INSN3_HELPER_EPPI(vpcmpestrm, pcmpestrm_xmm, Vdq, Wdq, Ib) DEF_GEN_INSN3_HELPER_EPPI(pcmpestri, pcmpestri_xmm, Vdq, Wdq, Ib) +DEF_GEN_INSN3_HELPER_EPPI(vpcmpestri, pcmpestri_xmm, Vdq, Wdq, Ib) DEF_GEN_INSN3_HELPER_EPPI(pcmpistrm, pcmpistrm_xmm, Vdq, Wdq, Ib) +DEF_GEN_INSN3_HELPER_EPPI(vpcmpistrm, pcmpistrm_xmm, Vdq, Wdq, Ib) DEF_GEN_INSN3_HELPER_EPPI(pcmpistri, pcmpistri_xmm, Vdq, Wdq, Ib) +DEF_GEN_INSN3_HELPER_EPPI(vpcmpistri, pcmpistri_xmm, Vdq, Wdq, Ib) DEF_GEN_INSN2_HELPER_EPP(ptest, ptest_xmm, Vdq, Wdq) +DEF_GEN_INSN2_HELPER_EPP(vptest, ptest_xmm, Vdq, Wdq) +DEF_GEN_INSN2_HELPER_EPP(vptest, ptest_xmm, Vqq, Wqq) +DEF_GEN_INSN2_HELPER_EPP(vtestps, ptest_xmm, Vdq, Wdq) +DEF_GEN_INSN2_HELPER_EPP(vtestps, ptest_xmm, Vqq, Wqq) +DEF_GEN_INSN2_HELPER_EPP(vtestpd, ptest_xmm, Vdq, Wdq) +DEF_GEN_INSN2_HELPER_EPP(vtestpd, ptest_xmm, Vqq, Wqq) DEF_GEN_INSN3_HELPER_EPP(cmpeqps, cmpeqps, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vcmpeqps, cmpeqps, Vdq, Hdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vcmpeqps, cmpeqps, Vqq, Hqq, Wqq) DEF_GEN_INSN3_HELPER_EPP(cmpeqpd, cmpeqpd, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vcmpeqpd, cmpeqpd, Vdq, Hdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vcmpeqpd, cmpeqpd, Vqq, Hqq, Wqq) DEF_GEN_INSN3_HELPER_EPP(cmpeqss, cmpeqss, Vd, Vd, Wd) +DEF_GEN_INSN3_HELPER_EPP(vcmpeqss, cmpeqss, Vd, Hd, Wd) DEF_GEN_INSN3_HELPER_EPP(cmpeqsd, cmpeqsd, Vq, Vq, Wq) +DEF_GEN_INSN3_HELPER_EPP(vcmpeqsd, cmpeqsd, Vq, Hq, Wq) DEF_GEN_INSN3_HELPER_EPP(cmpltps, cmpltps, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vcmpltps, cmpltps, Vdq, Hdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vcmpltps, cmpltps, Vqq, Hqq, Wqq) DEF_GEN_INSN3_HELPER_EPP(cmpltpd, cmpltpd, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vcmpltpd, cmpltpd, Vdq, Hdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vcmpltpd, cmpltpd, Vqq, Hqq, Wqq) DEF_GEN_INSN3_HELPER_EPP(cmpltss, cmpltss, Vd, Vd, Wd) +DEF_GEN_INSN3_HELPER_EPP(vcmpltss, cmpltss, Vd, Hd, Wd) DEF_GEN_INSN3_HELPER_EPP(cmpltsd, cmpltsd, Vq, Vq, Wq) +DEF_GEN_INSN3_HELPER_EPP(vcmpltsd, cmpltsd, Vq, Hq, Wq) DEF_GEN_INSN3_HELPER_EPP(cmpleps, cmpleps, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vcmpleps, cmpleps, Vdq, Hdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vcmpleps, cmpleps, Vqq, Hqq, Wqq) DEF_GEN_INSN3_HELPER_EPP(cmplepd, cmplepd, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vcmplepd, cmplepd, Vdq, Hdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vcmplepd, cmplepd, Vqq, Hqq, Wqq) DEF_GEN_INSN3_HELPER_EPP(cmpless, cmpless, Vd, Vd, Wd) +DEF_GEN_INSN3_HELPER_EPP(vcmpless, cmpless, Vd, Hd, Wd) DEF_GEN_INSN3_HELPER_EPP(cmplesd, cmplesd, Vq, Vq, Wq) +DEF_GEN_INSN3_HELPER_EPP(vcmplesd, cmplesd, Vq, Hq, Wq) DEF_GEN_INSN3_HELPER_EPP(cmpunordps, cmpunordps, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vcmpunordps, cmpunordps, Vdq, Hdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vcmpunordps, cmpunordps, Vqq, Hqq, Wqq) DEF_GEN_INSN3_HELPER_EPP(cmpunordpd, cmpunordpd, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vcmpunordpd, cmpunordpd, Vdq, Hdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vcmpunordpd, cmpunordpd, Vqq, Hqq, Wqq) DEF_GEN_INSN3_HELPER_EPP(cmpunordss, cmpunordss, Vd, Vd, Wd) +DEF_GEN_INSN3_HELPER_EPP(vcmpunordss, cmpunordss, Vd, Hd, Wd) DEF_GEN_INSN3_HELPER_EPP(cmpunordsd, cmpunordsd, Vq, Vq, Wq) +DEF_GEN_INSN3_HELPER_EPP(vcmpunordsd, cmpunordsd, Vq, Hq, Wq) DEF_GEN_INSN3_HELPER_EPP(cmpneqps, cmpneqps, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vcmpneqps, cmpneqps, Vdq, Hdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vcmpneqps, cmpneqps, Vqq, Hqq, Wqq) DEF_GEN_INSN3_HELPER_EPP(cmpneqpd, cmpneqpd, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vcmpneqpd, cmpneqpd, Vdq, Hdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vcmpneqpd, cmpneqpd, Vqq, Hqq, Wqq) DEF_GEN_INSN3_HELPER_EPP(cmpneqss, cmpneqss, Vd, Vd, Wd) +DEF_GEN_INSN3_HELPER_EPP(vcmpneqss, cmpneqss, Vd, Hd, Wd) DEF_GEN_INSN3_HELPER_EPP(cmpneqsd, cmpneqsd, Vq, Vq, Wq) +DEF_GEN_INSN3_HELPER_EPP(vcmpneqsd, cmpneqsd, Vq, Hq, Wq) DEF_GEN_INSN3_HELPER_EPP(cmpnltps, cmpnltps, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vcmpnltps, cmpnltps, Vdq, Hdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vcmpnltps, cmpnltps, Vqq, Hqq, Wqq) DEF_GEN_INSN3_HELPER_EPP(cmpnltpd, cmpnltpd, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vcmpnltpd, cmpnltpd, Vdq, Hdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vcmpnltpd, cmpnltpd, Vqq, Hqq, Wqq) DEF_GEN_INSN3_HELPER_EPP(cmpnltss, cmpnltss, Vd, Vd, Wd) +DEF_GEN_INSN3_HELPER_EPP(vcmpnltss, cmpnltss, Vd, Hd, Wd) DEF_GEN_INSN3_HELPER_EPP(cmpnltsd, cmpnltsd, Vq, Vq, Wq) +DEF_GEN_INSN3_HELPER_EPP(vcmpnltsd, cmpnltsd, Vq, Hq, Wq) DEF_GEN_INSN3_HELPER_EPP(cmpnleps, cmpnleps, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vcmpnleps, cmpnleps, Vdq, Hdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vcmpnleps, cmpnleps, Vqq, Hqq, Wqq) DEF_GEN_INSN3_HELPER_EPP(cmpnlepd, cmpnlepd, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vcmpnlepd, cmpnlepd, Vdq, Hdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vcmpnlepd, cmpnlepd, Vqq, Hqq, Wqq) DEF_GEN_INSN3_HELPER_EPP(cmpnless, cmpnless, Vd, Vd, Wd) +DEF_GEN_INSN3_HELPER_EPP(vcmpnless, cmpnless, Vd, Hd, Wd) DEF_GEN_INSN3_HELPER_EPP(cmpnlesd, cmpnlesd, Vq, Vq, Wq) +DEF_GEN_INSN3_HELPER_EPP(vcmpnlesd, cmpnlesd, Vq, Hq, Wq) DEF_GEN_INSN3_HELPER_EPP(cmpordps, cmpordps, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vcmpordps, cmpordps, Vdq, Hdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vcmpordps, cmpordps, Vqq, Hqq, Wqq) DEF_GEN_INSN3_HELPER_EPP(cmpordpd, cmpordpd, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vcmpordpd, cmpordpd, Vdq, Hdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vcmpordpd, cmpordpd, Vqq, Hqq, Wqq) DEF_GEN_INSN3_HELPER_EPP(cmpordss, cmpordss, Vd, Vd, Wd) +DEF_GEN_INSN3_HELPER_EPP(vcmpordss, cmpordss, Vd, Hd, Wd) DEF_GEN_INSN3_HELPER_EPP(cmpordsd, cmpordsd, Vq, Vq, Wq) +DEF_GEN_INSN3_HELPER_EPP(vcmpordsd, cmpordsd, Vq, Hq, Wq) GEN_INSN4(cmpps, Vdq, Vdq, Wdq, Ib) { @@ -6106,6 +6485,70 @@ GEN_INSN4(cmpps, Vdq, Vdq, Wdq, Ib) g_assert_not_reached(); } +GEN_INSN4(vcmpps, Vdq, Hdq, Wdq, Ib) +{ + switch (arg4 & 7) { + case 0: + gen_insn3(vcmpeqps, Vdq, Hdq, Wdq)(env, s, arg1, arg2, arg3); + return; + case 1: + gen_insn3(vcmpltps, Vdq, Hdq, Wdq)(env, s, arg1, arg2, arg3); + return; + case 2: + gen_insn3(vcmpleps, Vdq, Hdq, Wdq)(env, s, arg1, arg2, arg3); + return; + case 3: + gen_insn3(vcmpunordps, Vdq, Hdq, Wdq)(env, s, arg1, arg2, arg3); + return; + case 4: + gen_insn3(vcmpneqps, Vdq, Hdq, Wdq)(env, s, arg1, arg2, arg3); + return; + case 5: + gen_insn3(vcmpnltps, Vdq, Hdq, Wdq)(env, s, arg1, arg2, arg3); + return; + case 6: + gen_insn3(vcmpnleps, Vdq, Hdq, Wdq)(env, s, arg1, arg2, arg3); + return; + case 7: + gen_insn3(vcmpordps, Vdq, Hdq, Wdq)(env, s, arg1, arg2, arg3); + return; + } + + g_assert_not_reached(); +} + +GEN_INSN4(vcmpps, Vqq, Hqq, Wqq, Ib) +{ + switch (arg4 & 7) { + case 0: + gen_insn3(vcmpeqps, Vqq, Hqq, Wqq)(env, s, arg1, arg2, arg3); + return; + case 1: + gen_insn3(vcmpltps, Vqq, Hqq, Wqq)(env, s, arg1, arg2, arg3); + return; + case 2: + gen_insn3(vcmpleps, Vqq, Hqq, Wqq)(env, s, arg1, arg2, arg3); + return; + case 3: + gen_insn3(vcmpunordps, Vqq, Hqq, Wqq)(env, s, arg1, arg2, arg3); + return; + case 4: + gen_insn3(vcmpneqps, Vqq, Hqq, Wqq)(env, s, arg1, arg2, arg3); + return; + case 5: + gen_insn3(vcmpnltps, Vqq, Hqq, Wqq)(env, s, arg1, arg2, arg3); + return; + case 6: + gen_insn3(vcmpnleps, Vqq, Hqq, Wqq)(env, s, arg1, arg2, arg3); + return; + case 7: + gen_insn3(vcmpordps, Vqq, Hqq, Wqq)(env, s, arg1, arg2, arg3); + return; + } + + g_assert_not_reached(); +} + GEN_INSN4(cmppd, Vdq, Vdq, Wdq, Ib) { switch (arg4 & 7) { @@ -6138,6 +6581,70 @@ GEN_INSN4(cmppd, Vdq, Vdq, Wdq, Ib) g_assert_not_reached(); } +GEN_INSN4(vcmppd, Vdq, Hdq, Wdq, Ib) +{ + switch (arg4 & 7) { + case 0: + gen_insn3(vcmpeqpd, Vdq, Hdq, Wdq)(env, s, arg1, arg2, arg3); + return; + case 1: + gen_insn3(vcmpltpd, Vdq, Hdq, Wdq)(env, s, arg1, arg2, arg3); + return; + case 2: + gen_insn3(vcmplepd, Vdq, Hdq, Wdq)(env, s, arg1, arg2, arg3); + return; + case 3: + gen_insn3(vcmpunordpd, Vdq, Hdq, Wdq)(env, s, arg1, arg2, arg3); + return; + case 4: + gen_insn3(vcmpneqpd, Vdq, Hdq, Wdq)(env, s, arg1, arg2, arg3); + return; + case 5: + gen_insn3(vcmpnltpd, Vdq, Hdq, Wdq)(env, s, arg1, arg2, arg3); + return; + case 6: + gen_insn3(vcmpnlepd, Vdq, Hdq, Wdq)(env, s, arg1, arg2, arg3); + return; + case 7: + gen_insn3(vcmpordpd, Vdq, Hdq, Wdq)(env, s, arg1, arg2, arg3); + return; + } + + g_assert_not_reached(); +} + +GEN_INSN4(vcmppd, Vqq, Hqq, Wqq, Ib) +{ + switch (arg4 & 7) { + case 0: + gen_insn3(vcmpeqpd, Vqq, Hqq, Wqq)(env, s, arg1, arg2, arg3); + return; + case 1: + gen_insn3(vcmpltpd, Vqq, Hqq, Wqq)(env, s, arg1, arg2, arg3); + return; + case 2: + gen_insn3(vcmplepd, Vqq, Hqq, Wqq)(env, s, arg1, arg2, arg3); + return; + case 3: + gen_insn3(vcmpunordpd, Vqq, Hqq, Wqq)(env, s, arg1, arg2, arg3); + return; + case 4: + gen_insn3(vcmpneqpd, Vqq, Hqq, Wqq)(env, s, arg1, arg2, arg3); + return; + case 5: + gen_insn3(vcmpnltpd, Vqq, Hqq, Wqq)(env, s, arg1, arg2, arg3); + return; + case 6: + gen_insn3(vcmpnlepd, Vqq, Hqq, Wqq)(env, s, arg1, arg2, arg3); + return; + case 7: + gen_insn3(vcmpordpd, Vqq, Hqq, Wqq)(env, s, arg1, arg2, arg3); + return; + } + + g_assert_not_reached(); +} + GEN_INSN4(cmpss, Vd, Vd, Wd, Ib) { switch (arg4 & 7) { @@ -6170,6 +6677,38 @@ GEN_INSN4(cmpss, Vd, Vd, Wd, Ib) g_assert_not_reached(); } +GEN_INSN4(vcmpss, Vd, Hd, Wd, Ib) +{ + switch (arg4 & 7) { + case 0: + gen_insn3(vcmpeqss, Vd, Hd, Wd)(env, s, arg1, arg2, arg3); + return; + case 1: + gen_insn3(vcmpltss, Vd, Hd, Wd)(env, s, arg1, arg2, arg3); + return; + case 2: + gen_insn3(vcmpless, Vd, Hd, Wd)(env, s, arg1, arg2, arg3); + return; + case 3: + gen_insn3(vcmpunordss, Vd, Hd, Wd)(env, s, arg1, arg2, arg3); + return; + case 4: + gen_insn3(vcmpneqss, Vd, Hd, Wd)(env, s, arg1, arg2, arg3); + return; + case 5: + gen_insn3(vcmpnltss, Vd, Hd, Wd)(env, s, arg1, arg2, arg3); + return; + case 6: + gen_insn3(vcmpnless, Vd, Hd, Wd)(env, s, arg1, arg2, arg3); + return; + case 7: + gen_insn3(vcmpordss, Vd, Hd, Wd)(env, s, arg1, arg2, arg3); + return; + } + + g_assert_not_reached(); +} + GEN_INSN4(cmpsd, Vq, Vq, Wq, Ib) { switch (arg4 & 7) { @@ -6202,46 +6741,112 @@ GEN_INSN4(cmpsd, Vq, Vq, Wq, Ib) g_assert_not_reached(); } +GEN_INSN4(vcmpsd, Vq, Hq, Wq, Ib) +{ + switch (arg4 & 7) { + case 0: + gen_insn3(vcmpeqsd, Vq, Hq, Wq)(env, s, arg1, arg2, arg3); + return; + case 1: + gen_insn3(vcmpltsd, Vq, Hq, Wq)(env, s, arg1, arg2, arg3); + return; + case 2: + gen_insn3(vcmplesd, Vq, Hq, Wq)(env, s, arg1, arg2, arg3); + return; + case 3: + gen_insn3(vcmpunordsd, Vq, Hq, Wq)(env, s, arg1, arg2, arg3); + return; + case 4: + gen_insn3(vcmpneqsd, Vq, Hq, Wq)(env, s, arg1, arg2, arg3); + return; + case 5: + gen_insn3(vcmpnltsd, Vq, Hq, Wq)(env, s, arg1, arg2, arg3); + return; + case 6: + gen_insn3(vcmpnlesd, Vq, Hq, Wq)(env, s, arg1, arg2, arg3); + return; + case 7: + gen_insn3(vcmpordsd, Vq, Hq, Wq)(env, s, arg1, arg2, arg3); + return; + } + + g_assert_not_reached(); +} + DEF_GEN_INSN2_HELPER_EPP(comiss, comiss, Vd, Wd) +DEF_GEN_INSN2_HELPER_EPP(vcomiss, comiss, Vd, Wd) DEF_GEN_INSN2_HELPER_EPP(comisd, comisd, Vq, Wq) +DEF_GEN_INSN2_HELPER_EPP(vcomisd, comisd, Vq, Wq) DEF_GEN_INSN2_HELPER_EPP(ucomiss, ucomiss, Vd, Wd) +DEF_GEN_INSN2_HELPER_EPP(vucomiss, ucomiss, Vd, Wd) DEF_GEN_INSN2_HELPER_EPP(ucomisd, ucomisd, Vq, Wq) +DEF_GEN_INSN2_HELPER_EPP(vucomisd, ucomisd, Vq, Wq) DEF_GEN_INSN3_GVEC(pand, Pq, Pq, Qq, and, MM_OPRSZ, MM_MAXSZ, MO_64) DEF_GEN_INSN3_GVEC(pand, Vdq, Vdq, Wdq, and, XMM_OPRSZ, XMM_MAXSZ, MO_64) +DEF_GEN_INSN3_GVEC(vpand, Vdq, Hdq, Wdq, and, XMM_OPRSZ, XMM_MAXSZ, MO_64) DEF_GEN_INSN3_GVEC(andps, Vdq, Vdq, Wdq, and, XMM_OPRSZ, XMM_MAXSZ, MO_64) +DEF_GEN_INSN3_GVEC(vandps, Vdq, Hdq, Wdq, and, XMM_OPRSZ, XMM_MAXSZ, MO_64) +DEF_GEN_INSN3_GVEC(vandps, Vqq, Hqq, Wqq, and, XMM_OPRSZ, XMM_MAXSZ, MO_64) DEF_GEN_INSN3_GVEC(andpd, Vdq, Vdq, Wdq, and, XMM_OPRSZ, XMM_MAXSZ, MO_64) +DEF_GEN_INSN3_GVEC(vandpd, Vdq, Hdq, Wdq, and, XMM_OPRSZ, XMM_MAXSZ, MO_64) +DEF_GEN_INSN3_GVEC(vandpd, Vqq, Hqq, Wqq, and, XMM_OPRSZ, XMM_MAXSZ, MO_64) DEF_GEN_INSN3_GVEC(pandn, Pq, Pq, Qq, andn, MM_OPRSZ, MM_MAXSZ, MO_64) DEF_GEN_INSN3_GVEC(pandn, Vdq, Vdq, Wdq, andn, XMM_OPRSZ, XMM_MAXSZ, MO_64) +DEF_GEN_INSN3_GVEC(vpandn, Vdq, Hdq, Wdq, andn, XMM_OPRSZ, XMM_MAXSZ, MO_64) DEF_GEN_INSN3_GVEC(andnps, Vdq, Vdq, Wdq, andn, XMM_OPRSZ, XMM_MAXSZ, MO_64) +DEF_GEN_INSN3_GVEC(vandnps, Vdq, Hdq, Wdq, andn, XMM_OPRSZ, XMM_MAXSZ, MO_64) +DEF_GEN_INSN3_GVEC(vandnps, Vqq, Hqq, Wqq, andn, XMM_OPRSZ, XMM_MAXSZ, MO_64) DEF_GEN_INSN3_GVEC(andnpd, Vdq, Vdq, Wdq, andn, XMM_OPRSZ, XMM_MAXSZ, MO_64) +DEF_GEN_INSN3_GVEC(vandnpd, Vdq, Hdq, Wdq, andn, XMM_OPRSZ, XMM_MAXSZ, MO_64) +DEF_GEN_INSN3_GVEC(vandnpd, Vqq, Hqq, Wqq, andn, XMM_OPRSZ, XMM_MAXSZ, MO_64) DEF_GEN_INSN3_GVEC(por, Pq, Pq, Qq, or, MM_OPRSZ, MM_MAXSZ, MO_64) DEF_GEN_INSN3_GVEC(por, Vdq, Vdq, Wdq, or, XMM_OPRSZ, XMM_MAXSZ, MO_64) +DEF_GEN_INSN3_GVEC(vpor, Vdq, Hdq, Wdq, or, XMM_OPRSZ, XMM_MAXSZ, MO_64) DEF_GEN_INSN3_GVEC(orps, Vdq, Vdq, Wdq, or, XMM_OPRSZ, XMM_MAXSZ, MO_64) +DEF_GEN_INSN3_GVEC(vorps, Vdq, Hdq, Wdq, or, XMM_OPRSZ, XMM_MAXSZ, MO_64) +DEF_GEN_INSN3_GVEC(vorps, Vqq, Hqq, Wqq, or, XMM_OPRSZ, XMM_MAXSZ, MO_64) DEF_GEN_INSN3_GVEC(orpd, Vdq, Vdq, Wdq, or, XMM_OPRSZ, XMM_MAXSZ, MO_64) +DEF_GEN_INSN3_GVEC(vorpd, Vdq, Hdq, Wdq, or, XMM_OPRSZ, XMM_MAXSZ, MO_64) +DEF_GEN_INSN3_GVEC(vorpd, Vqq, Hqq, Wqq, or, XMM_OPRSZ, XMM_MAXSZ, MO_64) DEF_GEN_INSN3_GVEC(pxor, Pq, Pq, Qq, xor, MM_OPRSZ, MM_MAXSZ, MO_64) DEF_GEN_INSN3_GVEC(pxor, Vdq, Vdq, Wdq, xor, XMM_OPRSZ, XMM_MAXSZ, MO_64) +DEF_GEN_INSN3_GVEC(vpxor, Vdq, Hdq, Wdq, xor, XMM_OPRSZ, XMM_MAXSZ, MO_64) DEF_GEN_INSN3_GVEC(xorps, Vdq, Vdq, Wdq, xor, XMM_OPRSZ, XMM_MAXSZ, MO_64) +DEF_GEN_INSN3_GVEC(vxorps, Vdq, Hdq, Wdq, xor, XMM_OPRSZ, XMM_MAXSZ, MO_64) +DEF_GEN_INSN3_GVEC(vxorps, Vqq, Hqq, Wqq, xor, XMM_OPRSZ, XMM_MAXSZ, MO_64) DEF_GEN_INSN3_GVEC(xorpd, Vdq, Vdq, Wdq, xor, XMM_OPRSZ, XMM_MAXSZ, MO_64) +DEF_GEN_INSN3_GVEC(vxorpd, Vdq, Hdq, Wdq, xor, XMM_OPRSZ, XMM_MAXSZ, MO_64) +DEF_GEN_INSN3_GVEC(vxorpd, Vqq, Hqq, Wqq, xor, XMM_OPRSZ, XMM_MAXSZ, MO_64) DEF_GEN_INSN3_HELPER_EPP(psllw, psllw_mmx, Pq, Pq, Qq) DEF_GEN_INSN3_HELPER_EPP(psllw, psllw_xmm, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vpsllw, psllw_xmm, Vdq, Hdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(pslld, pslld_mmx, Pq, Pq, Qq) DEF_GEN_INSN3_HELPER_EPP(pslld, pslld_xmm, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vpslld, pslld_xmm, Vdq, Hdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(psllq, psllq_mmx, Pq, Pq, Qq) DEF_GEN_INSN3_HELPER_EPP(psllq, psllq_xmm, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vpsllq, psllq_xmm, Vdq, Hdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(pslldq, pslldq_xmm, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vpslldq, pslldq_xmm, Vdq, Hdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(psrlw, psrlw_mmx, Pq, Pq, Qq) DEF_GEN_INSN3_HELPER_EPP(psrlw, psrlw_xmm, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vpsrlw, psrlw_xmm, Vdq, Hdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(psrld, psrld_mmx, Pq, Pq, Qq) DEF_GEN_INSN3_HELPER_EPP(psrld, psrld_xmm, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vpsrld, psrld_xmm, Vdq, Hdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(psrlq, psrlq_mmx, Pq, Pq, Qq) DEF_GEN_INSN3_HELPER_EPP(psrlq, psrlq_xmm, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vpsrlq, psrlq_xmm, Vdq, Hdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(psrldq, psrldq_xmm, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vpsrldq, psrldq_xmm, Vdq, Hdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(psraw, psraw_mmx, Pq, Pq, Qq) DEF_GEN_INSN3_HELPER_EPP(psraw, psraw_xmm, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vpsraw, psraw_xmm, Vdq, Hdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(psrad, psrad_mmx, Pq, Pq, Qq) DEF_GEN_INSN3_HELPER_EPP(psrad, psrad_xmm, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vpsrad, psrad_xmm, Vdq, Hdq, Wdq) #define DEF_GEN_PSHIFT_IMM_MM(mnem, opT1, opT2) \ GEN_INSN3(mnem, opT1, opT2, Ib) \ @@ -6267,71 +6872,151 @@ DEF_GEN_INSN3_HELPER_EPP(psrad, psrad_xmm, Vdq, Vdq, Wdq) gen_insn2(movq, Vdq, Eq)(env, s, arg3_xmm, arg3_r64); \ gen_insn3(mnem, Vdq, Vdq, Wdq)(env, s, arg1, arg2, arg3_xmm); \ } +#define DEF_GEN_VPSHIFT_IMM_XMM(mnem, opT1, opT2) \ + GEN_INSN3(mnem, opT1, opT2, Ib) \ + { \ + const uint64_t arg3_ui64 = (uint8_t)arg3; \ + const insnop_arg_t(Eq) arg3_r64 = s->tmp1_i64; \ + const insnop_arg_t(Wdq) arg3_xmm = \ + offsetof(CPUX86State, xmm_t0.ZMM_Q(0)); \ + \ + tcg_gen_movi_i64(arg3_r64, arg3_ui64); \ + gen_insn2(movq, Vdq, Eq)(env, s, arg3_xmm, arg3_r64); \ + gen_insn3(mnem, Vdq, Hdq, Wdq)(env, s, arg2, arg2, arg3_xmm); \ + } DEF_GEN_PSHIFT_IMM_MM(psllw, Nq, Nq) DEF_GEN_PSHIFT_IMM_XMM(psllw, Udq, Udq) +DEF_GEN_VPSHIFT_IMM_XMM(vpsllw, Hdq, Udq) DEF_GEN_PSHIFT_IMM_MM(pslld, Nq, Nq) DEF_GEN_PSHIFT_IMM_XMM(pslld, Udq, Udq) +DEF_GEN_VPSHIFT_IMM_XMM(vpslld, Hdq, Udq) DEF_GEN_PSHIFT_IMM_MM(psllq, Nq, Nq) DEF_GEN_PSHIFT_IMM_XMM(psllq, Udq, Udq) +DEF_GEN_VPSHIFT_IMM_XMM(vpsllq, Hdq, Udq) DEF_GEN_PSHIFT_IMM_XMM(pslldq, Udq, Udq) +DEF_GEN_VPSHIFT_IMM_XMM(vpslldq, Hdq, Udq) DEF_GEN_PSHIFT_IMM_MM(psrlw, Nq, Nq) DEF_GEN_PSHIFT_IMM_XMM(psrlw, Udq, Udq) +DEF_GEN_VPSHIFT_IMM_XMM(vpsrlw, Hdq, Udq) DEF_GEN_PSHIFT_IMM_MM(psrld, Nq, Nq) DEF_GEN_PSHIFT_IMM_XMM(psrld, Udq, Udq) +DEF_GEN_VPSHIFT_IMM_XMM(vpsrld, Hdq, Udq) DEF_GEN_PSHIFT_IMM_MM(psrlq, Nq, Nq) DEF_GEN_PSHIFT_IMM_XMM(psrlq, Udq, Udq) +DEF_GEN_VPSHIFT_IMM_XMM(vpsrlq, Hdq, Udq) DEF_GEN_PSHIFT_IMM_XMM(psrldq, Udq, Udq) +DEF_GEN_VPSHIFT_IMM_XMM(vpsrldq, Hdq, Udq) DEF_GEN_PSHIFT_IMM_MM(psraw, Nq, Nq) DEF_GEN_PSHIFT_IMM_XMM(psraw, Udq, Udq) +DEF_GEN_VPSHIFT_IMM_XMM(vpsraw, Hdq, Udq) DEF_GEN_PSHIFT_IMM_MM(psrad, Nq, Nq) DEF_GEN_PSHIFT_IMM_XMM(psrad, Udq, Udq) +DEF_GEN_VPSHIFT_IMM_XMM(vpsrad, Hdq, Udq) DEF_GEN_INSN4_HELPER_EPPI(palignr, palignr_mmx, Pq, Pq, Qq, Ib) DEF_GEN_INSN4_HELPER_EPPI(palignr, palignr_xmm, Vdq, Vdq, Wdq, Ib) +DEF_GEN_INSN4_HELPER_EPPI(vpalignr, palignr_xmm, Vdq, Hdq, Wdq, Ib) DEF_GEN_INSN3_HELPER_EPP(packsswb, packsswb_mmx, Pq, Pq, Qq) DEF_GEN_INSN3_HELPER_EPP(packsswb, packsswb_xmm, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vpacksswb, packsswb_xmm, Vdq, Hdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(packssdw, packssdw_mmx, Pq, Pq, Qq) DEF_GEN_INSN3_HELPER_EPP(packssdw, packssdw_xmm, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vpackssdw, packssdw_xmm, Vdq, Hdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(packuswb, packuswb_mmx, Pq, Pq, Qq) DEF_GEN_INSN3_HELPER_EPP(packuswb, packuswb_xmm, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vpackuswb, packuswb_xmm, Vdq, Hdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(packusdw, packusdw_xmm, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vpackusdw, packusdw_xmm, Vdq, Hdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(punpcklbw, punpcklbw_mmx, Pq, Pq, Qd) DEF_GEN_INSN3_HELPER_EPP(punpcklbw, punpcklbw_xmm, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vpunpcklbw, punpcklbw_xmm, Vdq, Hdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(punpcklwd, punpcklwd_mmx, Pq, Pq, Qd) DEF_GEN_INSN3_HELPER_EPP(punpcklwd, punpcklwd_xmm, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vpunpcklwd, punpcklwd_xmm, Vdq, Hdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(punpckldq, punpckldq_mmx, Pq, Pq, Qd) DEF_GEN_INSN3_HELPER_EPP(punpckldq, punpckldq_xmm, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vpunpckldq, punpckldq_xmm, Vdq, Hdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(punpcklqdq, punpcklqdq_xmm, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vpunpcklqdq, punpcklqdq_xmm, Vdq, Hdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(punpckhbw, punpckhbw_mmx, Pq, Pq, Qq) DEF_GEN_INSN3_HELPER_EPP(punpckhbw, punpckhbw_xmm, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vpunpckhbw, punpckhbw_xmm, Vdq, Hdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(punpckhwd, punpckhwd_mmx, Pq, Pq, Qq) DEF_GEN_INSN3_HELPER_EPP(punpckhwd, punpckhwd_xmm, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vpunpckhwd, punpckhwd_xmm, Vdq, Hdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(punpckhdq, punpckhdq_mmx, Pq, Pq, Qq) DEF_GEN_INSN3_HELPER_EPP(punpckhdq, punpckhdq_xmm, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vpunpckhdq, punpckhdq_xmm, Vdq, Hdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(punpckhqdq, punpckhqdq_xmm, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vpunpckhqdq, punpckhqdq_xmm, Vdq, Hdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(unpcklps, punpckldq_xmm, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vunpcklps, punpckldq_xmm, Vdq, Hdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vunpcklps, punpckldq_xmm, Vqq, Hqq, Wqq) DEF_GEN_INSN3_HELPER_EPP(unpcklpd, punpcklqdq_xmm, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vunpcklpd, punpcklqdq_xmm, Vdq, Hdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vunpcklpd, punpcklqdq_xmm, Vqq, Hqq, Wqq) DEF_GEN_INSN3_HELPER_EPP(unpckhps, punpckhdq_xmm, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vunpckhps, punpckhdq_xmm, Vdq, Hdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vunpckhps, punpckhdq_xmm, Vqq, Hqq, Wqq) DEF_GEN_INSN3_HELPER_EPP(unpckhpd, punpckhqdq_xmm, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vunpckhpd, punpckhqdq_xmm, Vdq, Hdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vunpckhpd, punpckhqdq_xmm, Vqq, Hqq, Wqq) DEF_GEN_INSN3_HELPER_EPP(pshufb, pshufb_mmx, Pq, Pq, Qq) DEF_GEN_INSN3_HELPER_EPP(pshufb, pshufb_xmm, Vdq, Vdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vpshufb, pshufb_xmm, Vdq, Hdq, Wdq) DEF_GEN_INSN3_HELPER_PPI(pshufw, pshufw_mmx, Pq, Qq, Ib) DEF_GEN_INSN3_HELPER_PPI(pshuflw, pshuflw_xmm, Vdq, Wdq, Ib) +DEF_GEN_INSN3_HELPER_PPI(vpshuflw, pshuflw_xmm, Vdq, Wdq, Ib) DEF_GEN_INSN3_HELPER_PPI(pshufhw, pshufhw_xmm, Vdq, Wdq, Ib) +DEF_GEN_INSN3_HELPER_PPI(vpshufhw, pshufhw_xmm, Vdq, Wdq, Ib) DEF_GEN_INSN3_HELPER_PPI(pshufd, pshufd_xmm, Vdq, Wdq, Ib) +DEF_GEN_INSN3_HELPER_PPI(vpshufd, pshufd_xmm, Vdq, Wdq, Ib) DEF_GEN_INSN4_HELPER_PPI(shufps, shufps, Vdq, Vdq, Wdq, Ib) +DEF_GEN_INSN4_HELPER_PPI(vshufps, shufps, Vdq, Hdq, Wdq, Ib) +DEF_GEN_INSN4_HELPER_PPI(vshufps, shufps, Vqq, Hqq, Wqq, Ib) DEF_GEN_INSN4_HELPER_PPI(shufpd, shufpd, Vdq, Vdq, Wdq, Ib) +DEF_GEN_INSN4_HELPER_PPI(vshufpd, shufpd, Vdq, Hdq, Wdq, Ib) +DEF_GEN_INSN4_HELPER_PPI(vshufpd, shufpd, Vqq, Hqq, Wqq, Ib) DEF_GEN_INSN4_HELPER_EPPI(blendps, blendps_xmm, Vdq, Vdq, Wdq, Ib) +DEF_GEN_INSN4_HELPER_EPPI(vblendps, blendps_xmm, Vdq, Hdq, Wdq, Ib) +DEF_GEN_INSN4_HELPER_EPPI(vblendps, blendps_xmm, Vqq, Hqq, Wqq, Ib) DEF_GEN_INSN4_HELPER_EPPI(blendpd, blendpd_xmm, Vdq, Vdq, Wdq, Ib) +DEF_GEN_INSN4_HELPER_EPPI(vblendpd, blendpd_xmm, Vdq, Hdq, Wdq, Ib) +DEF_GEN_INSN4_HELPER_EPPI(vblendpd, blendpd_xmm, Vqq, Hqq, Wqq, Ib) + DEF_GEN_INSN3_HELPER_EPP(blendvps, blendvps_xmm, Vdq, Vdq, Wdq) +GEN_INSN4(vblendvps, Vdq, Hdq, Wdq, Ldq) +{ + gen_insn3(blendvps, Vdq, Vdq, Wdq)(env, s, arg1, arg2, arg3); +} +GEN_INSN4(vblendvps, Vqq, Hqq, Wqq, Lqq) +{ + gen_insn3(blendvps, Vdq, Vdq, Wdq)(env, s, arg1, arg2, arg3); +} + DEF_GEN_INSN3_HELPER_EPP(blendvpd, blendvpd_xmm, Vdq, Vdq, Wdq) +GEN_INSN4(vblendvpd, Vdq, Hdq, Wdq, Ldq) +{ + gen_insn3(blendvpd, Vdq, Vdq, Wdq)(env, s, arg1, arg2, arg3); +} +GEN_INSN4(vblendvpd, Vqq, Hqq, Wqq, Lqq) +{ + gen_insn3(blendvpd, Vdq, Vdq, Wdq)(env, s, arg1, arg2, arg3); +} + DEF_GEN_INSN3_HELPER_EPP(pblendvb, pblendvb_xmm, Vdq, Vdq, Wdq) +GEN_INSN4(vpblendvb, Vdq, Hdq, Wdq, Ldq) +{ + gen_insn3(pblendvb, Vdq, Vdq, Wdq)(env, s, arg1, arg2, arg3); +} + DEF_GEN_INSN4_HELPER_EPPI(pblendw, pblendw_xmm, Vdq, Vdq, Wdq, Ib) +DEF_GEN_INSN4_HELPER_EPPI(vpblendw, pblendw_xmm, Vdq, Hdq, Wdq, Ib) GEN_INSN4(insertps, Vdq, Vdq, Wd, Ib) { @@ -6341,6 +7026,13 @@ GEN_INSN4(insertps, Vdq, Vdq, Wd, Ib) const size_t aofs = offsetof(ZMMReg, ZMM_L(0)); gen_op_movl(s, arg1 + dofs, arg3 + aofs); } +GEN_INSN4(vinsertps, Vdq, Hdq, Wd, Ib) +{ + if (arg1 != arg2) { + gen_insn2(vmovaps, Vdq, Wdq)(env, s, arg1, arg2); + } + gen_insn4(insertps, Vdq, Vdq, Wd, Ib)(env, s, arg1, arg1, arg3, arg4); +} GEN_INSN4(pinsrb, Vdq, Vdq, RdMb, Ib) { assert(arg1 == arg2); @@ -6348,6 +7040,13 @@ GEN_INSN4(pinsrb, Vdq, Vdq, RdMb, Ib) const size_t ofs = offsetof(ZMMReg, ZMM_B(arg4 & 15)); tcg_gen_st8_i32(arg3, cpu_env, arg1 + ofs); } +GEN_INSN4(vpinsrb, Vdq, Hdq, RdMb, Ib) +{ + if (arg1 != arg2) { + gen_insn2(vmovaps, Vdq, Wdq)(env, s, arg1, arg2); + } + gen_insn4(pinsrb, Vdq, Vdq, RdMb, Ib)(env, s, arg1, arg1, arg3, arg4); +} GEN_INSN4(pinsrw, Pq, Pq, RdMw, Ib) { assert(arg1 == arg2); @@ -6362,6 +7061,13 @@ GEN_INSN4(pinsrw, Vdq, Vdq, RdMw, Ib) const size_t ofs = offsetof(ZMMReg, ZMM_W(arg4 & 7)); tcg_gen_st16_i32(arg3, cpu_env, arg1 + ofs); } +GEN_INSN4(vpinsrw, Vdq, Hdq, RdMw, Ib) +{ + if (arg1 != arg2) { + gen_insn2(vmovaps, Vdq, Wdq)(env, s, arg1, arg2); + } + gen_insn4(pinsrw, Vdq, Vdq, RdMw, Ib)(env, s, arg1, arg1, arg3, arg4); +} GEN_INSN4(pinsrd, Vdq, Vdq, Ed, Ib) { assert(arg1 == arg2); @@ -6369,6 +7075,13 @@ GEN_INSN4(pinsrd, Vdq, Vdq, Ed, Ib) const size_t ofs = offsetof(ZMMReg, ZMM_L(arg4 & 3)); tcg_gen_st_i32(arg3, cpu_env, arg1 + ofs); } +GEN_INSN4(vpinsrd, Vdq, Hdq, Ed, Ib) +{ + if (arg1 != arg2) { + gen_insn2(vmovaps, Vdq, Wdq)(env, s, arg1, arg2); + } + gen_insn4(pinsrd, Vdq, Vdq, Ed, Ib)(env, s, arg1, arg1, arg3, arg4); +} GEN_INSN4(pinsrq, Vdq, Vdq, Eq, Ib) { assert(arg1 == arg2); @@ -6376,32 +7089,63 @@ GEN_INSN4(pinsrq, Vdq, Vdq, Eq, Ib) const size_t ofs = offsetof(ZMMReg, ZMM_Q(arg4 & 1)); tcg_gen_st_i64(arg3, cpu_env, arg1 + ofs); } +GEN_INSN4(vpinsrq, Vdq, Hdq, Eq, Ib) +{ + if (arg1 != arg2) { + gen_insn2(vmovaps, Vdq, Wdq)(env, s, arg1, arg2); + } + gen_insn4(pinsrq, Vdq, Vdq, Eq, Ib)(env, s, arg1, arg1, arg3, arg4); +} +GEN_INSN4(vinsertf128, Vqq, Hqq, Wdq, Ib) +{ + gen_insn2(movaps, Vdq, Wdq)(env, s, arg1, arg3); +} GEN_INSN3(extractps, Ed, Vdq, Ib) { const size_t ofs = offsetof(ZMMReg, ZMM_L(arg3 & 3)); tcg_gen_ld_i32(arg1, cpu_env, arg2 + ofs); } +GEN_INSN3(vextractps, Ed, Vdq, Ib) +{ + gen_insn3(extractps, Ed, Vdq, Ib)(env, s, arg1, arg2, arg3); +} GEN_INSN3(pextrb, RdMb, Vdq, Ib) { const size_t ofs = offsetof(ZMMReg, ZMM_B(arg3 & 15)); tcg_gen_ld8u_i32(arg1, cpu_env, arg2 + ofs); } +GEN_INSN3(vpextrb, RdMb, Vdq, Ib) +{ + gen_insn3(pextrb, RdMb, Vdq, Ib)(env, s, arg1, arg2, arg3); +} GEN_INSN3(pextrw, RdMw, Vdq, Ib) { const size_t ofs = offsetof(ZMMReg, ZMM_W(arg3 & 7)); tcg_gen_ld16u_i32(arg1, cpu_env, arg2 + ofs); } +GEN_INSN3(vpextrw, RdMw, Vdq, Ib) +{ + gen_insn3(pextrw, RdMw, Vdq, Ib)(env, s, arg1, arg2, arg3); +} GEN_INSN3(pextrd, Ed, Vdq, Ib) { const size_t ofs = offsetof(ZMMReg, ZMM_L(arg3 & 3)); tcg_gen_ld_i32(arg1, cpu_env, arg2 + ofs); } +GEN_INSN3(vpextrd, Ed, Vdq, Ib) +{ + gen_insn3(pextrd, Ed, Vdq, Ib)(env, s, arg1, arg2, arg3); +} GEN_INSN3(pextrq, Eq, Vdq, Ib) { const size_t ofs = offsetof(ZMMReg, ZMM_Q(arg3 & 1)); tcg_gen_ld_i64(arg1, cpu_env, arg2 + ofs); } +GEN_INSN3(vpextrq, Eq, Vdq, Ib) +{ + gen_insn3(pextrq, Eq, Vdq, Ib)(env, s, arg1, arg2, arg3); +} GEN_INSN3(pextrw, Gd, Nq, Ib) { const size_t ofs = offsetof(MMXReg, MMX_W(arg3 & 3)); @@ -6422,49 +7166,173 @@ GEN_INSN3(pextrw, Gq, Udq, Ib) const size_t ofs = offsetof(ZMMReg, ZMM_W(arg3 & 7)); tcg_gen_ld16u_i64(arg1, cpu_env, arg2 + ofs); } +GEN_INSN3(vpextrw, Gd, Udq, Ib) +{ + gen_insn3(pextrw, Gd, Udq, Ib)(env, s, arg1, arg2, arg3); +} +GEN_INSN3(vpextrw, Gq, Udq, Ib) +{ + gen_insn3(pextrw, Gq, Udq, Ib)(env, s, arg1, arg2, arg3); +} +GEN_INSN3(vextractf128, Wdq, Vqq, Ib) +{ + gen_insn2(movaps, Wdq, Vdq)(env, s, arg1, arg2); +} + +GEN_INSN2(vbroadcastss, Vdq, Md) +{ + const TCGv_i32 r32 = tcg_temp_new_i32(); + insnop_ldst(tcg_i32, Md)(env, s, 0, r32, arg2); + + tcg_gen_st_i32(r32, cpu_env, arg1 + offsetof(ZMMReg, ZMM_L(0))); + tcg_gen_st_i32(r32, cpu_env, arg1 + offsetof(ZMMReg, ZMM_L(1))); + tcg_gen_st_i32(r32, cpu_env, arg1 + offsetof(ZMMReg, ZMM_L(2))); + tcg_gen_st_i32(r32, cpu_env, arg1 + offsetof(ZMMReg, ZMM_L(3))); + + tcg_temp_free_i32(r32); +} +GEN_INSN2(vbroadcastss, Vqq, Md) +{ + gen_insn2(vbroadcastss, Vdq, Md)(env, s, arg1, arg2); +} +GEN_INSN2(vbroadcastsd, Vqq, Mq) +{ + const TCGv_i64 r64 = tcg_temp_new_i64(); + insnop_ldst(tcg_i64, Mq)(env, s, 0, r64, arg2); + + tcg_gen_st_i64(r64, cpu_env, arg1 + offsetof(ZMMReg, ZMM_Q(0))); + tcg_gen_st_i64(r64, cpu_env, arg1 + offsetof(ZMMReg, ZMM_Q(1))); + + tcg_temp_free_i64(r64); +} +GEN_INSN2(vbroadcastf128, Vqq, Mdq) +{ + insnop_ldst(xmm, Mqq)(env, s, 0, arg1, arg2); +} + +GEN_INSN4(vperm2f128, Vqq, Hqq, Wqq, Ib) +{ + /* XXX TODO implement this */ +} + +GEN_INSN3(vpermilps, Vdq, Hdq, Wdq) +{ + /* XXX TODO implement this */ +} +GEN_INSN3(vpermilps, Vqq, Hqq, Wqq) +{ + /* XXX TODO implement this */ +} +GEN_INSN3(vpermilps, Vdq, Wdq, Ib) +{ + /* XXX TODO implement this */ +} +GEN_INSN3(vpermilps, Vqq, Wqq, Ib) +{ + /* XXX TODO implement this */ +} + +GEN_INSN3(vpermilpd, Vdq, Hdq, Wdq) +{ + /* XXX TODO implement this */ +} +GEN_INSN3(vpermilpd, Vqq, Hqq, Wqq) +{ + /* XXX TODO implement this */ +} +GEN_INSN3(vpermilpd, Vdq, Wdq, Ib) +{ + /* XXX TODO implement this */ +} +GEN_INSN3(vpermilpd, Vqq, Wqq, Ib) +{ + /* XXX TODO implement this */ +} DEF_GEN_INSN2_HELPER_EPP(pmovsxbw, pmovsxbw_xmm, Vdq, Wq) +DEF_GEN_INSN2_HELPER_EPP(vpmovsxbw, pmovsxbw_xmm, Vdq, Wq) DEF_GEN_INSN2_HELPER_EPP(pmovsxbd, pmovsxbd_xmm, Vdq, Wd) +DEF_GEN_INSN2_HELPER_EPP(vpmovsxbd, pmovsxbd_xmm, Vdq, Wd) DEF_GEN_INSN2_HELPER_EPP(pmovsxbq, pmovsxbq_xmm, Vdq, Ww) +DEF_GEN_INSN2_HELPER_EPP(vpmovsxbq, pmovsxbq_xmm, Vdq, Ww) DEF_GEN_INSN2_HELPER_EPP(pmovsxwd, pmovsxwd_xmm, Vdq, Wq) +DEF_GEN_INSN2_HELPER_EPP(vpmovsxwd, pmovsxwd_xmm, Vdq, Wq) DEF_GEN_INSN2_HELPER_EPP(pmovsxwq, pmovsxwq_xmm, Vdq, Wd) +DEF_GEN_INSN2_HELPER_EPP(vpmovsxwq, pmovsxwq_xmm, Vdq, Wd) DEF_GEN_INSN2_HELPER_EPP(pmovsxdq, pmovsxdq_xmm, Vdq, Wq) +DEF_GEN_INSN2_HELPER_EPP(vpmovsxdq, pmovsxdq_xmm, Vdq, Wq) DEF_GEN_INSN2_HELPER_EPP(pmovzxbw, pmovzxbw_xmm, Vdq, Wq) +DEF_GEN_INSN2_HELPER_EPP(vpmovzxbw, pmovzxbw_xmm, Vdq, Wq) DEF_GEN_INSN2_HELPER_EPP(pmovzxbd, pmovzxbd_xmm, Vdq, Wd) +DEF_GEN_INSN2_HELPER_EPP(vpmovzxbd, pmovzxbd_xmm, Vdq, Wd) DEF_GEN_INSN2_HELPER_EPP(pmovzxbq, pmovzxbq_xmm, Vdq, Ww) +DEF_GEN_INSN2_HELPER_EPP(vpmovzxbq, pmovzxbq_xmm, Vdq, Ww) DEF_GEN_INSN2_HELPER_EPP(pmovzxwd, pmovzxwd_xmm, Vdq, Wq) +DEF_GEN_INSN2_HELPER_EPP(vpmovzxwd, pmovzxwd_xmm, Vdq, Wq) DEF_GEN_INSN2_HELPER_EPP(pmovzxwq, pmovzxwq_xmm, Vdq, Wd) +DEF_GEN_INSN2_HELPER_EPP(vpmovzxwq, pmovzxwq_xmm, Vdq, Wd) DEF_GEN_INSN2_HELPER_EPP(pmovzxdq, pmovzxdq_xmm, Vdq, Wq) +DEF_GEN_INSN2_HELPER_EPP(vpmovzxdq, pmovzxdq_xmm, Vdq, Wq) DEF_GEN_INSN2_HELPER_EPP(cvtpi2ps, cvtpi2ps, Vdq, Qq) DEF_GEN_INSN2_HELPER_EPD(cvtsi2ss, cvtsi2ss, Vd, Ed) DEF_GEN_INSN2_HELPER_EPQ(cvtsi2ss, cvtsq2ss, Vd, Eq) +DEF_GEN_INSN3_HELPER_EPD(vcvtsi2ss, cvtsi2ss, Vd, Hd, Ed) +DEF_GEN_INSN3_HELPER_EPQ(vcvtsi2ss, cvtsq2ss, Vd, Hd, Eq) DEF_GEN_INSN2_HELPER_EPP(cvtpi2pd, cvtpi2pd, Vdq, Qq) DEF_GEN_INSN2_HELPER_EPD(cvtsi2sd, cvtsi2sd, Vq, Ed) DEF_GEN_INSN2_HELPER_EPQ(cvtsi2sd, cvtsq2sd, Vq, Eq) +DEF_GEN_INSN3_HELPER_EPD(vcvtsi2sd, cvtsi2sd, Vq, Hq, Ed) +DEF_GEN_INSN3_HELPER_EPQ(vcvtsi2sd, cvtsq2sd, Vq, Hq, Eq) DEF_GEN_INSN2_HELPER_EPP(cvtps2pi, cvtps2pi, Pq, Wq) DEF_GEN_INSN2_HELPER_DEP(cvtss2si, cvtss2si, Gd, Wd) DEF_GEN_INSN2_HELPER_QEP(cvtss2si, cvtss2sq, Gq, Wd) +DEF_GEN_INSN2_HELPER_DEP(vcvtss2si, cvtss2si, Gd, Wd) +DEF_GEN_INSN2_HELPER_QEP(vcvtss2si, cvtss2sq, Gq, Wd) DEF_GEN_INSN2_HELPER_EPP(cvtpd2pi, cvtpd2pi, Pq, Wdq) DEF_GEN_INSN2_HELPER_DEP(cvtsd2si, cvtsd2si, Gd, Wq) DEF_GEN_INSN2_HELPER_QEP(cvtsd2si, cvtsd2sq, Gq, Wq) +DEF_GEN_INSN2_HELPER_DEP(vcvtsd2si, cvtsd2si, Gd, Wq) +DEF_GEN_INSN2_HELPER_QEP(vcvtsd2si, cvtsd2sq, Gq, Wq) DEF_GEN_INSN2_HELPER_EPP(cvttps2pi, cvttps2pi, Pq, Wq) DEF_GEN_INSN2_HELPER_DEP(cvttss2si, cvttss2si, Gd, Wd) DEF_GEN_INSN2_HELPER_QEP(cvttss2si, cvttss2sq, Gq, Wd) +DEF_GEN_INSN2_HELPER_DEP(vcvttss2si, cvttss2si, Gd, Wd) +DEF_GEN_INSN2_HELPER_QEP(vcvttss2si, cvttss2sq, Gq, Wd) DEF_GEN_INSN2_HELPER_EPP(cvttpd2pi, cvttpd2pi, Pq, Wdq) DEF_GEN_INSN2_HELPER_DEP(cvttsd2si, cvttsd2si, Gd, Wq) DEF_GEN_INSN2_HELPER_QEP(cvttsd2si, cvttsd2sq, Gq, Wq) +DEF_GEN_INSN2_HELPER_DEP(vcvttsd2si, cvttsd2si, Gd, Wq) +DEF_GEN_INSN2_HELPER_QEP(vcvttsd2si, cvttsd2sq, Gq, Wq) DEF_GEN_INSN2_HELPER_EPP(cvtpd2dq, cvtpd2dq, Vdq, Wdq) +DEF_GEN_INSN2_HELPER_EPP(vcvtpd2dq, cvtpd2dq, Vdq, Wdq) +DEF_GEN_INSN2_HELPER_EPP(vcvtpd2dq, cvtpd2dq, Vdq, Wqq) DEF_GEN_INSN2_HELPER_EPP(cvttpd2dq, cvttpd2dq, Vdq, Wdq) +DEF_GEN_INSN2_HELPER_EPP(vcvttpd2dq, cvttpd2dq, Vdq, Wdq) +DEF_GEN_INSN2_HELPER_EPP(vcvttpd2dq, cvttpd2dq, Vdq, Wqq) DEF_GEN_INSN2_HELPER_EPP(cvtdq2pd, cvtdq2pd, Vdq, Wq) +DEF_GEN_INSN2_HELPER_EPP(vcvtdq2pd, cvtdq2pd, Vdq, Wq) +DEF_GEN_INSN2_HELPER_EPP(vcvtdq2pd, cvtdq2pd, Vqq, Wdq) DEF_GEN_INSN2_HELPER_EPP(cvtps2pd, cvtps2pd, Vdq, Wq) +DEF_GEN_INSN2_HELPER_EPP(vcvtps2pd, cvtps2pd, Vdq, Wq) +DEF_GEN_INSN2_HELPER_EPP(vcvtps2pd, cvtps2pd, Vqq, Wdq) DEF_GEN_INSN2_HELPER_EPP(cvtpd2ps, cvtpd2ps, Vdq, Wdq) +DEF_GEN_INSN2_HELPER_EPP(vcvtpd2ps, cvtpd2ps, Vdq, Wdq) +DEF_GEN_INSN2_HELPER_EPP(vcvtpd2ps, cvtpd2ps, Vdq, Wqq) DEF_GEN_INSN2_HELPER_EPP(cvtss2sd, cvtss2sd, Vq, Wd) +DEF_GEN_INSN3_HELPER_EPP(vcvtss2sd, cvtss2sd, Vq, Hq, Wd) DEF_GEN_INSN2_HELPER_EPP(cvtsd2ss, cvtsd2ss, Vd, Wq) +DEF_GEN_INSN3_HELPER_EPP(vcvtsd2ss, cvtsd2ss, Vd, Hd, Wq) DEF_GEN_INSN2_HELPER_EPP(cvtdq2ps, cvtdq2ps, Vdq, Wdq) +DEF_GEN_INSN2_HELPER_EPP(vcvtdq2ps, cvtdq2ps, Vdq, Wdq) +DEF_GEN_INSN2_HELPER_EPP(vcvtdq2ps, cvtdq2ps, Vqq, Wqq) DEF_GEN_INSN2_HELPER_EPP(cvtps2dq, cvtps2dq, Vdq, Wdq) +DEF_GEN_INSN2_HELPER_EPP(vcvtps2dq, cvtps2dq, Vdq, Wdq) +DEF_GEN_INSN2_HELPER_EPP(vcvtps2dq, cvtps2dq, Vqq, Wqq) DEF_GEN_INSN2_HELPER_EPP(cvttps2dq, cvttps2dq, Vdq, Wdq) +DEF_GEN_INSN2_HELPER_EPP(vcvttps2dq, cvttps2dq, Vdq, Wdq) +DEF_GEN_INSN2_HELPER_EPP(vcvttps2dq, cvttps2dq, Vqq, Wqq) GEN_INSN2(maskmovq, Pq, Nq) { @@ -6498,15 +7366,70 @@ GEN_INSN2(maskmovdqu, Vdq, Udq) tcg_temp_free_ptr(arg1_ptr); tcg_temp_free_ptr(arg2_ptr); } +GEN_INSN2(vmaskmovdqu, Vdq, Udq) +{ + gen_insn2(maskmovdqu, Vdq, Udq)(env, s, arg1, arg2); +} + +GEN_INSN3(vmaskmovps, Vdq, Hdq, Mdq) +{ + /* XXX TODO implement this */ +} +GEN_INSN3(vmaskmovps, Mdq, Hdq, Vdq) +{ + /* XXX TODO implement this */ +} +GEN_INSN3(vmaskmovps, Vqq, Hqq, Mqq) +{ + /* XXX TODO implement this */ +} +GEN_INSN3(vmaskmovps, Mqq, Hqq, Vqq) +{ + /* XXX TODO implement this */ +} + +GEN_INSN3(vmaskmovpd, Vdq, Hdq, Mdq) +{ + /* XXX TODO implement this */ +} +GEN_INSN3(vmaskmovpd, Mdq, Hdq, Vdq) +{ + /* XXX TODO implement this */ +} +GEN_INSN3(vmaskmovpd, Vqq, Hqq, Mqq) +{ + /* XXX TODO implement this */ +} +GEN_INSN3(vmaskmovpd, Mqq, Hqq, Vqq) +{ + /* XXX TODO implement this */ +} GEN_INSN2(movntps, Mdq, Vdq) { insnop_ldst(xmm, Mdq)(env, s, 1, arg2, arg1); } +GEN_INSN2(vmovntps, Mdq, Vdq) +{ + gen_insn2(movntps, Mdq, Vdq)(env, s, arg1, arg2); +} +GEN_INSN2(vmovntps, Mqq, Vqq) +{ + gen_insn2(vmovntps, Mdq, Vdq)(env, s, arg1, arg2); +} + GEN_INSN2(movntpd, Mdq, Vdq) { insnop_ldst(xmm, Mdq)(env, s, 1, arg2, arg1); } +GEN_INSN2(vmovntpd, Mdq, Vdq) +{ + gen_insn2(movntpd, Mdq, Vdq)(env, s, arg1, arg2); +} +GEN_INSN2(vmovntpd, Mqq, Vqq) +{ + gen_insn2(vmovntpd, Mdq, Vdq)(env, s, arg1, arg2); +} GEN_INSN2(movnti, Md, Gd) { @@ -6525,10 +7448,23 @@ GEN_INSN2(movntdq, Mdq, Vdq) { insnop_ldst(xmm, Mdq)(env, s, 1, arg2, arg1); } +GEN_INSN2(vmovntdq, Mdq, Vdq) +{ + gen_insn2(movntdq, Mdq, Vdq)(env, s, arg1, arg2); +} +GEN_INSN2(vmovntdq, Mqq, Vqq) +{ + gen_insn2(vmovntdq, Mdq, Vdq)(env, s, arg1, arg2); +} + GEN_INSN2(movntdqa, Vdq, Mdq) { insnop_ldst(xmm, Mdq)(env, s, 0, arg1, arg2); } +GEN_INSN2(vmovntdqa, Vdq, Mdq) +{ + gen_insn2(movntdqa, Vdq, Mdq)(env, s, arg1, arg2); +} GEN_INSN0(pause) { @@ -6538,6 +7474,16 @@ GEN_INSN0(pause) DEF_GEN_INSN0_HELPER(emms, emms) +GEN_INSN0(vzeroupper) +{ + /* XXX TODO implement this */ +} + +GEN_INSN0(vzeroall) +{ + /* XXX TODO implement this */ +} + GEN_INSN2(sfence_clflush, modrm_mod, modrm) { if (arg1 == 3) { @@ -6584,6 +7530,10 @@ GEN_INSN1(ldmxcsr, Md) gen_helper_ldmxcsr(cpu_env, s->tmp2_i32); } } +GEN_INSN1(vldmxcsr, Md) +{ + gen_insn1(ldmxcsr, Md)(env, s, arg1); +} GEN_INSN1(stmxcsr, Md) { if ((s->flags & HF_EM_MASK) || !(s->flags & HF_OSFXSR_MASK)) { @@ -6596,6 +7546,10 @@ GEN_INSN1(stmxcsr, Md) tcg_gen_qemu_st_i32(s->tmp2_i32, arg1, s->mem_index, MO_LEUL); } } +GEN_INSN1(vstmxcsr, Md) +{ + gen_insn1(stmxcsr, Md)(env, s, arg1); +} GEN_INSN1(prefetcht0, Mb) { From patchwork Wed Aug 21 17:29:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Bobek X-Patchwork-Id: 11107995 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 781951395 for ; Wed, 21 Aug 2019 18:41:37 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2B629214DA for ; Wed, 21 Aug 2019 18:41:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="cx94dgbx" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2B629214DA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:51876 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0VY8-00088J-5w for patchwork-qemu-devel@patchwork.kernel.org; Wed, 21 Aug 2019 14:41:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41634) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0US2-0001yD-Oj for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:31:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i0URs-0008V1-En for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:31:14 -0400 Received: from mail-yb1-xb43.google.com ([2607:f8b0:4864:20::b43]:42623) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i0URq-0008Op-8s for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:31:04 -0400 Received: by mail-yb1-xb43.google.com with SMTP id h8so1331457ybq.9 for ; Wed, 21 Aug 2019 10:31:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ElbuVztKsgZ/c6+c8gLmkRylPd7iAZCPuR6neCmQCk4=; b=cx94dgbxsKVfpJEd7+t9/bVXP2ZQ5xrcp56Vuz7Dt1vQf47LEevtOmSTpfL+llpymS wfsUIGZYNgin8uogV+B3V2BPdoZXW0Qxw0Nvyo7ZGK7qxKBJzC9VZcOWDSssFM89vplR tSxwV9JBh4Rs6v4WrR/Jkt39NPcUjXhmBR1KTOQQ6QEUaRGG9H2ZSmlt64Yg3tEs5ZZx 5seNdPN6g4jDIXSNCo1bKrxfRZTQBIQ76vkkNE3nPV5MOAbVilrKO7AVBzwdXlVZn3xG iC6Z+vgZW/99KL7X4jAFw4PCKoJx6gUgiDoBMxh0ov7VT2PKppRlWEfVEx38G/rVcaoA 7CWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ElbuVztKsgZ/c6+c8gLmkRylPd7iAZCPuR6neCmQCk4=; b=RDTvz7D+3iIkRvvP43K74vtRvwWCXNy8vjU/0ZSVgBoGUdwd+TlaJrx1JXlHJFJD9m 6ILPgiK643NcjMKOV5ZRgc+0mEwV9A3fBRKqMyNXaBfLBjwdhzj1P40uRU56xgbZbdVo Mf6jUXHtfzjJVPoj3qlBBKywpWZ1Fr1Hj2ydleOLzv8zyb+gMAkhwAvaoSBAel4AyTIZ Sz6rLNjVQ28In5mpaUVCrE+dMc7H0oFeaWT1WgLMXCTCBz4HCfohh0GKUGHypJJmujZh dxDh1TbcEiXDv2Z9NbvxzroQWuMImYbimD5Kd2X3x4CG4FajCklBcv4Urxyetb7Um/vV j2UA== X-Gm-Message-State: APjAAAVkfRtXWTklgIVlA7coJyai9UuWcn7y6fRN5kyB+CdFh+r5B+DL GhuGx0p0uIczABCDIsZd/54T60CO X-Google-Smtp-Source: APXvYqyuEar/YK2u04Aso0XUzL3HWW+Q0DfnJJDQBmCZHT7tx4wdUilsS8Iy921Lfxl/n/2DRDIfhQ== X-Received: by 2002:a25:d186:: with SMTP id i128mr1889512ybg.11.1566408658464; Wed, 21 Aug 2019 10:30:58 -0700 (PDT) Received: from localhost.localdomain ([2601:c0:c67f:e390::3]) by smtp.gmail.com with ESMTPSA id l71sm2826167ywl.39.2019.08.21.10.30.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Aug 2019 10:30:57 -0700 (PDT) From: Jan Bobek To: qemu-devel@nongnu.org Date: Wed, 21 Aug 2019 13:29:37 -0400 Message-Id: <20190821172951.15333-62-jan.bobek@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190821172951.15333-1-jan.bobek@gmail.com> References: <20190821172951.15333-1-jan.bobek@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::b43 Subject: [Qemu-devel] [RFC PATCH v4 61/75] target/i386: introduce AVX vector instructions to sse-opcode.inc.h X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jan Bobek , =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Add all the AVX vector instruction entries to sse-opcode.inc.h. Signed-off-by: Jan Bobek --- target/i386/sse-opcode.inc.h | 779 +++++++++++++++++++++++++++++++++++ 1 file changed, 779 insertions(+) diff --git a/target/i386/sse-opcode.inc.h b/target/i386/sse-opcode.inc.h index 1359508424..c3c0ec4f89 100644 --- a/target/i386/sse-opcode.inc.h +++ b/target/i386/sse-opcode.inc.h @@ -469,198 +469,767 @@ * ----------------------- * 66 0F 3A 44 /r ib PCLMULQDQ xmm1, xmm2/m128, imm8 * VEX.128.66.0F3A.WIG 44 /r ib VPCLMULQDQ xmm1, xmm2, xmm3/m128, imm8 + * + * AVX Instructions + * ----------------- + * VEX.128.66.0F.W0 6E /r VMOVD xmm1,r32/m32 + * VEX.128.66.0F.W0 7E /r VMOVD r32/m32,xmm1 + * VEX.128.66.0F.W1 6E /r VMOVQ xmm1,r64/m64 + * VEX.128.66.0F.W1 7E /r VMOVQ r64/m64,xmm1 + * VEX.128.F3.0F.WIG 7E /r VMOVQ xmm1, xmm2/m64 + * VEX.128.66.0F.WIG D6 /r VMOVQ xmm1/m64, xmm2 + * VEX.128.0F.WIG 28 /r VMOVAPS xmm1, xmm2/m128 + * VEX.128.0F.WIG 29 /r VMOVAPS xmm2/m128, xmm1 + * VEX.256.0F.WIG 28 /r VMOVAPS ymm1, ymm2/m256 + * VEX.256.0F.WIG 29 /r VMOVAPS ymm2/m256, ymm1 + * VEX.128.66.0F.WIG 28 /r VMOVAPD xmm1, xmm2/m128 + * VEX.128.66.0F.WIG 29 /r VMOVAPD xmm2/m128, xmm1 + * VEX.256.66.0F.WIG 28 /r VMOVAPD ymm1, ymm2/m256 + * VEX.256.66.0F.WIG 29 /r VMOVAPD ymm2/m256, ymm1 + * VEX.128.66.0F.WIG 6F /r VMOVDQA xmm1, xmm2/m128 + * VEX.128.66.0F.WIG 7F /r VMOVDQA xmm2/m128, xmm1 + * VEX.256.66.0F.WIG 6F /r VMOVDQA ymm1, ymm2/m256 + * VEX.256.66.0F.WIG 7F /r VMOVDQA ymm2/m256, ymm1 + * VEX.128.0F.WIG 10 /r VMOVUPS xmm1, xmm2/m128 + * VEX.128.0F.WIG 11 /r VMOVUPS xmm2/m128, xmm1 + * VEX.256.0F.WIG 10 /r VMOVUPS ymm1, ymm2/m256 + * VEX.256.0F.WIG 11 /r VMOVUPS ymm2/m256, ymm1 + * VEX.128.66.0F.WIG 10 /r VMOVUPD xmm1, xmm2/m128 + * VEX.128.66.0F.WIG 11 /r VMOVUPD xmm2/m128, xmm1 + * VEX.256.66.0F.WIG 10 /r VMOVUPD ymm1, ymm2/m256 + * VEX.256.66.0F.WIG 11 /r VMOVUPD ymm2/m256, ymm1 + * VEX.128.F3.0F.WIG 6F /r VMOVDQU xmm1,xmm2/m128 + * VEX.128.F3.0F.WIG 7F /r VMOVDQU xmm2/m128,xmm1 + * VEX.256.F3.0F.WIG 6F /r VMOVDQU ymm1,ymm2/m256 + * VEX.256.F3.0F.WIG 7F /r VMOVDQU ymm2/m256,ymm1 + * VEX.LIG.F3.0F.WIG 10 /r VMOVSS xmm1, xmm2, xmm3 + * VEX.LIG.F3.0F.WIG 10 /r VMOVSS xmm1, m32 + * VEX.LIG.F3.0F.WIG 11 /r VMOVSS xmm1, xmm2, xmm3 + * VEX.LIG.F3.0F.WIG 11 /r VMOVSS m32, xmm1 + * VEX.LIG.F2.0F.WIG 10 /r VMOVSD xmm1, xmm2, xmm3 + * VEX.LIG.F2.0F.WIG 10 /r VMOVSD xmm1, m64 + * VEX.LIG.F2.0F.WIG 11 /r VMOVSD xmm1, xmm2, xmm3 + * VEX.LIG.F2.0F.WIG 11 /r VMOVSD m64, xmm1 + * VEX.128.0F.WIG 12 /r VMOVHLPS xmm1, xmm2, xmm3 + * VEX.128.0F.WIG 12 /r VMOVLPS xmm2, xmm1, m64 + * VEX.128.0F.WIG 13 /r VMOVLPS m64, xmm1 + * VEX.128.66.0F.WIG 12 /r VMOVLPD xmm2,xmm1,m64 + * VEX.128.66.0F.WIG 13 /r VMOVLPD m64,xmm1 + * VEX.128.0F.WIG 16 /r VMOVLHPS xmm1, xmm2, xmm3 + * VEX.128.0F.WIG 16 /r VMOVHPS xmm2, xmm1, m64 + * VEX.128.0F.WIG 17 /r VMOVHPS m64, xmm1 + * VEX.128.66.0F.WIG 16 /r VMOVHPD xmm2, xmm1, m64 + * VEX.128.66.0F.WIG 17 /r VMOVHPD m64, xmm1 + * VEX.128.66.0F.W0 D7 /r VPMOVMSKB r32, xmm1 + * VEX.128.66.0F.W1 D7 /r VPMOVMSKB r64, xmm1 + * VEX.128.0F.W0 50 /r VMOVMSKPS r32, xmm2 + * VEX.128.0F.W1 50 /r VMOVMSKPS r64, xmm2 + * VEX.256.0F.W0 50 /r VMOVMSKPS r32, ymm2 + * VEX.256.0F.W1 50 /r VMOVMSKPS r64, ymm2 + * VEX.128.66.0F.W0 50 /r VMOVMSKPD r32, xmm2 + * VEX.128.66.0F.W1 50 /r VMOVMSKPD r64, xmm2 + * VEX.256.66.0F.W0 50 /r VMOVMSKPD r32, ymm2 + * VEX.256.66.0F.W1 50 /r VMOVMSKPD r64, ymm2 + * VEX.128.F2.0F.WIG F0 /r VLDDQU xmm1, m128 + * VEX.256.F2.0F.WIG F0 /r VLDDQU ymm1, m256 + * VEX.128.F3.0F.WIG 16 /r VMOVSHDUP xmm1, xmm2/m128 + * VEX.256.F3.0F.WIG 16 /r VMOVSHDUP ymm1, ymm2/m256 + * VEX.128.F3.0F.WIG 12 /r VMOVSLDUP xmm1, xmm2/m128 + * VEX.256.F3.0F.WIG 12 /r VMOVSLDUP ymm1, ymm2/m256 + * VEX.128.F2.0F.WIG 12 /r VMOVDDUP xmm1, xmm2/m64 + * VEX.256.F2.0F.WIG 12 /r VMOVDDUP ymm1, ymm2/m256 + * VEX.128.66.0F.WIG FC /r VPADDB xmm1, xmm2, xmm3/m128 + * VEX.128.66.0F.WIG FD /r VPADDW xmm1, xmm2, xmm3/m128 + * VEX.128.66.0F.WIG FE /r VPADDD xmm1, xmm2, xmm3/m128 + * VEX.128.66.0F.WIG D4 /r VPADDQ xmm1, xmm2, xmm3/m128 + * VEX.128.66.0F.WIG EC /r VPADDSB xmm1, xmm2, xmm3/m128 + * VEX.128.66.0F.WIG ED /r VPADDSW xmm1, xmm2, xmm3/m128 + * VEX.128.66.0F.WIG DC /r VPADDUSB xmm1,xmm2,xmm3/m128 + * VEX.128.66.0F.WIG DD /r VPADDUSW xmm1,xmm2,xmm3/m128 + * VEX.128.0F.WIG 58 /r VADDPS xmm1,xmm2, xmm3/m128 + * VEX.256.0F.WIG 58 /r VADDPS ymm1, ymm2, ymm3/m256 + * VEX.128.66.0F.WIG 58 /r VADDPD xmm1,xmm2, xmm3/m128 + * VEX.256.66.0F.WIG 58 /r VADDPD ymm1, ymm2, ymm3/m256 + * VEX.LIG.F3.0F.WIG 58 /r VADDSS xmm1,xmm2, xmm3/m32 + * VEX.LIG.F2.0F.WIG 58 /r VADDSD xmm1, xmm2, xmm3/m64 + * VEX.128.66.0F38.WIG 01 /r VPHADDW xmm1, xmm2, xmm3/m128 + * VEX.128.66.0F38.WIG 02 /r VPHADDD xmm1, xmm2, xmm3/m128 + * VEX.128.66.0F38.WIG 03 /r VPHADDSW xmm1, xmm2, xmm3/m128 + * VEX.128.F2.0F.WIG 7C /r VHADDPS xmm1, xmm2, xmm3/m128 + * VEX.256.F2.0F.WIG 7C /r VHADDPS ymm1, ymm2, ymm3/m256 + * VEX.128.66.0F.WIG 7C /r VHADDPD xmm1,xmm2, xmm3/m128 + * VEX.256.66.0F.WIG 7C /r VHADDPD ymm1, ymm2, ymm3/m256 + * VEX.128.66.0F.WIG F8 /r VPSUBB xmm1, xmm2, xmm3/m128 + * VEX.128.66.0F.WIG F9 /r VPSUBW xmm1, xmm2, xmm3/m128 + * VEX.128.66.0F.WIG FA /r VPSUBD xmm1, xmm2, xmm3/m128 + * VEX.128.66.0F.WIG FB /r VPSUBQ xmm1, xmm2, xmm3/m128 + * VEX.128.66.0F.WIG E8 /r VPSUBSB xmm1, xmm2, xmm3/m128 + * VEX.128.66.0F.WIG E9 /r VPSUBSW xmm1, xmm2, xmm3/m128 + * VEX.128.66.0F.WIG D8 /r VPSUBUSB xmm1, xmm2, xmm3/m128 + * VEX.128.66.0F.WIG D9 /r VPSUBUSW xmm1, xmm2, xmm3/m128 + * VEX.128.0F.WIG 5C /r VSUBPS xmm1,xmm2, xmm3/m128 + * VEX.256.0F.WIG 5C /r VSUBPS ymm1, ymm2, ymm3/m256 + * VEX.128.66.0F.WIG 5C /r VSUBPD xmm1,xmm2, xmm3/m128 + * VEX.256.66.0F.WIG 5C /r VSUBPD ymm1, ymm2, ymm3/m256 + * VEX.LIG.F3.0F.WIG 5C /r VSUBSS xmm1,xmm2, xmm3/m32 + * VEX.LIG.F2.0F.WIG 5C /r VSUBSD xmm1,xmm2, xmm3/m64 + * VEX.128.66.0F38.WIG 05 /r VPHSUBW xmm1, xmm2, xmm3/m128 + * VEX.128.66.0F38.WIG 06 /r VPHSUBD xmm1, xmm2, xmm3/m128 + * VEX.128.66.0F38.WIG 07 /r VPHSUBSW xmm1, xmm2, xmm3/m128 + * VEX.128.F2.0F.WIG 7D /r VHSUBPS xmm1, xmm2, xmm3/m128 + * VEX.256.F2.0F.WIG 7D /r VHSUBPS ymm1, ymm2, ymm3/m256 + * VEX.128.66.0F.WIG 7D /r VHSUBPD xmm1,xmm2, xmm3/m128 + * VEX.256.66.0F.WIG 7D /r VHSUBPD ymm1, ymm2, ymm3/m256 + * VEX.128.F2.0F.WIG D0 /r VADDSUBPS xmm1, xmm2, xmm3/m128 + * VEX.256.F2.0F.WIG D0 /r VADDSUBPS ymm1, ymm2, ymm3/m256 + * VEX.128.66.0F.WIG D0 /r VADDSUBPD xmm1, xmm2, xmm3/m128 + * VEX.256.66.0F.WIG D0 /r VADDSUBPD ymm1, ymm2, ymm3/m256 + * VEX.128.66.0F.WIG D5 /r VPMULLW xmm1, xmm2, xmm3/m128 + * VEX.128.66.0F38.WIG 40 /r VPMULLD xmm1, xmm2, xmm3/m128 + * VEX.128.66.0F.WIG E5 /r VPMULHW xmm1, xmm2, xmm3/m128 + * VEX.128.66.0F.WIG E4 /r VPMULHUW xmm1, xmm2, xmm3/m128 + * VEX.128.66.0F38.WIG 28 /r VPMULDQ xmm1, xmm2, xmm3/m128 + * VEX.128.66.0F.WIG F4 /r VPMULUDQ xmm1, xmm2, xmm3/m128 + * VEX.128.66.0F38.WIG 0B /r VPMULHRSW xmm1, xmm2, xmm3/m128 + * VEX.128.0F.WIG 59 /r VMULPS xmm1,xmm2, xmm3/m128 + * VEX.256.0F.WIG 59 /r VMULPS ymm1, ymm2, ymm3/m256 + * VEX.128.66.0F.WIG 59 /r VMULPD xmm1,xmm2, xmm3/m128 + * VEX.256.66.0F.WIG 59 /r VMULPD ymm1, ymm2, ymm3/m256 + * VEX.LIG.F3.0F.WIG 59 /r VMULSS xmm1,xmm2, xmm3/m32 + * VEX.LIG.F2.0F.WIG 59 /r VMULSD xmm1,xmm2, xmm3/m64 + * VEX.128.66.0F.WIG F5 /r VPMADDWD xmm1, xmm2, xmm3/m128 + * VEX.128.66.0F38.WIG 04 /r VPMADDUBSW xmm1, xmm2, xmm3/m128 + * VEX.128.0F.WIG 5E /r VDIVPS xmm1, xmm2, xmm3/m128 + * VEX.256.0F.WIG 5E /r VDIVPS ymm1, ymm2, ymm3/m256 + * VEX.128.66.0F.WIG 5E /r VDIVPD xmm1, xmm2, xmm3/m128 + * VEX.256.66.0F.WIG 5E /r VDIVPD ymm1, ymm2, ymm3/m256 + * VEX.LIG.F3.0F.WIG 5E /r VDIVSS xmm1, xmm2, xmm3/m32 + * VEX.LIG.F2.0F.WIG 5E /r VDIVSD xmm1, xmm2, xmm3/m64 + * VEX.128.0F.WIG 53 /r VRCPPS xmm1, xmm2/m128 + * VEX.256.0F.WIG 53 /r VRCPPS ymm1, ymm2/m256 + * VEX.LIG.F3.0F.WIG 53 /r VRCPSS xmm1, xmm2, xmm3/m32 + * VEX.128.0F.WIG 51 /r VSQRTPS xmm1, xmm2/m128 + * VEX.256.0F.WIG 51 /r VSQRTPS ymm1, ymm2/m256 + * VEX.128.66.0F.WIG 51 /r VSQRTPD xmm1, xmm2/m128 + * VEX.256.66.0F.WIG 51 /r VSQRTPD ymm1, ymm2/m256 + * VEX.LIG.F3.0F.WIG 51 /r VSQRTSS xmm1, xmm2, xmm3/m32 + * VEX.LIG.F2.0F.WIG 51 /r VSQRTSD xmm1,xmm2, xmm3/m64 + * VEX.128.0F.WIG 52 /r VRSQRTPS xmm1, xmm2/m128 + * VEX.256.0F.WIG 52 /r VRSQRTPS ymm1, ymm2/m256 + * VEX.LIG.F3.0F.WIG 52 /r VRSQRTSS xmm1, xmm2, xmm3/m32 + * VEX.128.66.0F DA /r VPMINUB xmm1, xmm2, xmm3/m128 + * VEX.128.66.0F38 3A /r VPMINUW xmm1, xmm2, xmm3/m128 + * VEX.128.66.0F38.WIG 3B /r VPMINUD xmm1, xmm2, xmm3/m128 + * VEX.128.66.0F38 38 /r VPMINSB xmm1, xmm2, xmm3/m128 + * VEX.128.66.0F EA /r VPMINSW xmm1, xmm2, xmm3/m128 + * VEX.128.66.0F38.WIG 39 /r VPMINSD xmm1, xmm2, xmm3/m128 + * VEX.128.0F.WIG 5D /r VMINPS xmm1, xmm2, xmm3/m128 + * VEX.256.0F.WIG 5D /r VMINPS ymm1, ymm2, ymm3/m256 + * VEX.128.66.0F.WIG 5D /r VMINPD xmm1, xmm2, xmm3/m128 + * VEX.256.66.0F.WIG 5D /r VMINPD ymm1, ymm2, ymm3/m256 + * VEX.LIG.F3.0F.WIG 5D /r VMINSS xmm1,xmm2, xmm3/m32 + * VEX.LIG.F2.0F.WIG 5D /r VMINSD xmm1, xmm2, xmm3/m64 + * VEX.128.66.0F38.WIG 41 /r VPHMINPOSUW xmm1, xmm2/m128 + * VEX.128.66.0F DE /r VPMAXUB xmm1, xmm2, xmm3/m128 + * VEX.128.66.0F38 3E /r VPMAXUW xmm1, xmm2, xmm3/m128 + * VEX.128.66.0F38.WIG 3F /r VPMAXUD xmm1, xmm2, xmm3/m128 + * VEX.128.66.0F38.WIG 3C /r VPMAXSB xmm1, xmm2, xmm3/m128 + * VEX.128.66.0F.WIG EE /r VPMAXSW xmm1, xmm2, xmm3/m128 + * VEX.128.66.0F38.WIG 3D /r VPMAXSD xmm1, xmm2, xmm3/m128 + * VEX.128.0F.WIG 5F /r VMAXPS xmm1, xmm2, xmm3/m128 + * VEX.256.0F.WIG 5F /r VMAXPS ymm1, ymm2, ymm3/m256 + * VEX.128.66.0F.WIG 5F /r VMAXPD xmm1, xmm2, xmm3/m128 + * VEX.256.66.0F.WIG 5F /r VMAXPD ymm1, ymm2, ymm3/m256 + * VEX.LIG.F3.0F.WIG 5F /r VMAXSS xmm1, xmm2, xmm3/m32 + * VEX.LIG.F2.0F.WIG 5F /r VMAXSD xmm1, xmm2, xmm3/m64 + * VEX.128.66.0F.WIG E0 /r VPAVGB xmm1, xmm2, xmm3/m128 + * VEX.128.66.0F.WIG E3 /r VPAVGW xmm1, xmm2, xmm3/m128 + * VEX.128.66.0F.WIG F6 /r VPSADBW xmm1, xmm2, xmm3/m128 + * VEX.128.66.0F3A.WIG 42 /r ib VMPSADBW xmm1, xmm2, xmm3/m128, imm8 + * VEX.128.66.0F38.WIG 1C /r VPABSB xmm1, xmm2/m128 + * VEX.128.66.0F38.WIG 1D /r VPABSW xmm1, xmm2/m128 + * VEX.128.66.0F38.WIG 1E /r VPABSD xmm1, xmm2/m128 + * VEX.128.66.0F38.WIG 08 /r VPSIGNB xmm1, xmm2, xmm3/m128 + * VEX.128.66.0F38.WIG 09 /r VPSIGNW xmm1, xmm2, xmm3/m128 + * VEX.128.66.0F38.WIG 0A /r VPSIGND xmm1, xmm2, xmm3/m128 + * VEX.128.66.0F3A.WIG 40 /r ib VDPPS xmm1,xmm2, xmm3/m128, imm8 + * VEX.256.66.0F3A.WIG 40 /r ib VDPPS ymm1, ymm2, ymm3/m256, imm8 + * VEX.128.66.0F3A.WIG 41 /r ib VDPPD xmm1,xmm2, xmm3/m128, imm8 + * VEX.128.66.0F3A.WIG 08 /r ib VROUNDPS xmm1, xmm2/m128, imm8 + * VEX.256.66.0F3A.WIG 08 /r ib VROUNDPS ymm1, ymm2/m256, imm8 + * VEX.128.66.0F3A.WIG 09 /r ib VROUNDPD xmm1, xmm2/m128, imm8 + * VEX.256.66.0F3A.WIG 09 /r ib VROUNDPD ymm1, ymm2/m256, imm8 + * VEX.LIG.66.0F3A.WIG 0A /r ib VROUNDSS xmm1, xmm2, xmm3/m32, imm8 + * VEX.LIG.66.0F3A.WIG 0B /r ib VROUNDSD xmm1, xmm2, xmm3/m64, imm8 + * VEX.128.66.0F.WIG 74 /r VPCMPEQB xmm1,xmm2,xmm3/m128 + * VEX.128.66.0F.WIG 75 /r VPCMPEQW xmm1,xmm2,xmm3/m128 + * VEX.128.66.0F.WIG 76 /r VPCMPEQD xmm1,xmm2,xmm3/m128 + * VEX.128.66.0F38.WIG 29 /r VPCMPEQQ xmm1, xmm2, xmm3/m128 + * VEX.128.66.0F.WIG 64 /r VPCMPGTB xmm1,xmm2,xmm3/m128 + * VEX.128.66.0F.WIG 65 /r VPCMPGTW xmm1,xmm2,xmm3/m128 + * VEX.128.66.0F.WIG 66 /r VPCMPGTD xmm1,xmm2,xmm3/m128 + * VEX.128.66.0F38.WIG 37 /r VPCMPGTQ xmm1, xmm2, xmm3/m128 + * VEX.128.66.0F3A 60 /r ib VPCMPESTRM xmm1, xmm2/m128, imm8 + * VEX.128.66.0F3A 61 /r ib VPCMPESTRI xmm1, xmm2/m128, imm8 + * VEX.128.66.0F3A.WIG 62 /r ib VPCMPISTRM xmm1, xmm2/m128, imm8 + * VEX.128.66.0F3A.WIG 63 /r ib VPCMPISTRI xmm1, xmm2/m128, imm8 + * VEX.128.66.0F38.WIG 17 /r VPTEST xmm1, xmm2/m128 + * VEX.256.66.0F38.WIG 17 /r VPTEST ymm1, ymm2/m256 + * VEX.128.66.0F38.W0 0E /r VTESTPS xmm1, xmm2/m128 + * VEX.256.66.0F38.W0 0E /r VTESTPS ymm1, ymm2/m256 + * VEX.128.66.0F38.W0 0F /r VTESTPD xmm1, xmm2/m128 + * VEX.256.66.0F38.W0 0F /r VTESTPD ymm1, ymm2/m256 + * VEX.128.0F.WIG C2 /r ib VCMPPS xmm1, xmm2, xmm3/m128, imm8 + * VEX.256.0F.WIG C2 /r ib VCMPPS ymm1, ymm2, ymm3/m256, imm8 + * VEX.128.66.0F.WIG C2 /r ib VCMPPD xmm1, xmm2, xmm3/m128, imm8 + * VEX.256.66.0F.WIG C2 /r ib VCMPPD ymm1, ymm2, ymm3/m256, imm8 + * VEX.LIG.F3.0F.WIG C2 /r ib VCMPSS xmm1, xmm2, xmm3/m32, imm8 + * VEX.LIG.F2.0F.WIG C2 /r ib VCMPSD xmm1, xmm2, xmm3/m64, imm8 + * VEX.LIG.0F.WIG 2E /r VUCOMISS xmm1, xmm2/m32 + * VEX.LIG.66.0F.WIG 2E /r VUCOMISD xmm1, xmm2/m64 + * VEX.LIG.0F.WIG 2F /r VCOMISS xmm1, xmm2/m32 + * VEX.LIG.66.0F.WIG 2F /r VCOMISD xmm1, xmm2/m64 + * VEX.128.66.0F.WIG DB /r VPAND xmm1, xmm2, xmm3/m128 + * VEX.128.0F 54 /r VANDPS xmm1,xmm2, xmm3/m128 + * VEX.256.0F 54 /r VANDPS ymm1, ymm2, ymm3/m256 + * VEX.128.66.0F 54 /r VANDPD xmm1, xmm2, xmm3/m128 + * VEX.256.66.0F 54 /r VANDPD ymm1, ymm2, ymm3/m256 + * VEX.128.66.0F.WIG DF /r VPANDN xmm1, xmm2, xmm3/m128 + * VEX.128.0F 55 /r VANDNPS xmm1, xmm2, xmm3/m128 + * VEX.256.0F 55 /r VANDNPS ymm1, ymm2, ymm3/m256 + * VEX.128.66.0F 55 /r VANDNPD xmm1, xmm2, xmm3/m128 + * VEX.256.66.0F 55 /r VANDNPD ymm1, ymm2, ymm3/m256 + * VEX.128.66.0F.WIG EB /r VPOR xmm1, xmm2, xmm3/m128 + * VEX.128.0F 56 /r VORPS xmm1,xmm2, xmm3/m128 + * VEX.256.0F 56 /r VORPS ymm1, ymm2, ymm3/m256 + * VEX.128.66.0F 56 /r VORPD xmm1,xmm2, xmm3/m128 + * VEX.256.66.0F 56 /r VORPD ymm1, ymm2, ymm3/m256 + * VEX.128.66.0F.WIG EF /r VPXOR xmm1, xmm2, xmm3/m128 + * VEX.128.0F.WIG 57 /r VXORPS xmm1,xmm2, xmm3/m128 + * VEX.256.0F.WIG 57 /r VXORPS ymm1, ymm2, ymm3/m256 + * VEX.128.66.0F.WIG 57 /r VXORPD xmm1,xmm2, xmm3/m128 + * VEX.256.66.0F.WIG 57 /r VXORPD ymm1, ymm2, ymm3/m256 + * VEX.128.66.0F.WIG F1 /r VPSLLW xmm1, xmm2, xmm3/m128 + * VEX.128.66.0F.WIG F2 /r VPSLLD xmm1, xmm2, xmm3/m128 + * VEX.128.66.0F.WIG F3 /r VPSLLQ xmm1, xmm2, xmm3/m128 + * VEX.128.66.0F.WIG D1 /r VPSRLW xmm1, xmm2, xmm3/m128 + * VEX.128.66.0F.WIG D2 /r VPSRLD xmm1, xmm2, xmm3/m128 + * VEX.128.66.0F.WIG D3 /r VPSRLQ xmm1, xmm2, xmm3/m128 + * VEX.128.66.0F.WIG E1 /r VPSRAW xmm1,xmm2,xmm3/m128 + * VEX.128.66.0F.WIG E2 /r VPSRAD xmm1,xmm2,xmm3/m128 + * VEX.128.66.0F3A.WIG 0F /r ib VPALIGNR xmm1, xmm2, xmm3/m128, imm8 + * VEX.128.66.0F.WIG 63 /r VPACKSSWB xmm1,xmm2, xmm3/m128 + * VEX.128.66.0F.WIG 6B /r VPACKSSDW xmm1,xmm2, xmm3/m128 + * VEX.128.66.0F.WIG 67 /r VPACKUSWB xmm1, xmm2, xmm3/m128 + * VEX.128.66.0F38 2B /r VPACKUSDW xmm1,xmm2, xmm3/m128 + * VEX.128.66.0F.WIG 68 /r VPUNPCKHBW xmm1,xmm2, xmm3/m128 + * VEX.128.66.0F.WIG 69 /r VPUNPCKHWD xmm1,xmm2, xmm3/m128 + * VEX.128.66.0F.WIG 6A /r VPUNPCKHDQ xmm1, xmm2, xmm3/m128 + * VEX.128.66.0F.WIG 6D /r VPUNPCKHQDQ xmm1, xmm2, xmm3/m128 + * VEX.128.66.0F.WIG 60 /r VPUNPCKLBW xmm1,xmm2, xmm3/m128 + * VEX.128.66.0F.WIG 61 /r VPUNPCKLWD xmm1,xmm2, xmm3/m128 + * VEX.128.66.0F.WIG 62 /r VPUNPCKLDQ xmm1, xmm2, xmm3/m128 + * VEX.128.66.0F.WIG 6C /r VPUNPCKLQDQ xmm1, xmm2, xmm3/m128 + * VEX.128.0F.WIG 14 /r VUNPCKLPS xmm1,xmm2, xmm3/m128 + * VEX.256.0F.WIG 14 /r VUNPCKLPS ymm1,ymm2,ymm3/m256 + * VEX.128.66.0F.WIG 14 /r VUNPCKLPD xmm1,xmm2, xmm3/m128 + * VEX.256.66.0F.WIG 14 /r VUNPCKLPD ymm1,ymm2, ymm3/m256 + * VEX.128.0F.WIG 15 /r VUNPCKHPS xmm1, xmm2, xmm3/m128 + * VEX.256.0F.WIG 15 /r VUNPCKHPS ymm1, ymm2, ymm3/m256 + * VEX.128.66.0F.WIG 15 /r VUNPCKHPD xmm1,xmm2, xmm3/m128 + * VEX.256.66.0F.WIG 15 /r VUNPCKHPD ymm1,ymm2, ymm3/m256 + * VEX.128.66.0F38.WIG 00 /r VPSHUFB xmm1, xmm2, xmm3/m128 + * VEX.128.F2.0F.WIG 70 /r ib VPSHUFLW xmm1, xmm2/m128, imm8 + * VEX.128.F3.0F.WIG 70 /r ib VPSHUFHW xmm1, xmm2/m128, imm8 + * VEX.128.66.0F.WIG 70 /r ib VPSHUFD xmm1, xmm2/m128, imm8 + * VEX.128.0F.WIG C6 /r ib VSHUFPS xmm1, xmm2, xmm3/m128, imm8 + * VEX.256.0F.WIG C6 /r ib VSHUFPS ymm1, ymm2, ymm3/m256, imm8 + * VEX.128.66.0F.WIG C6 /r ib VSHUFPD xmm1, xmm2, xmm3/m128, imm8 + * VEX.256.66.0F.WIG C6 /r ib VSHUFPD ymm1, ymm2, ymm3/m256, imm8 + * VEX.128.66.0F3A.WIG 0C /r ib VBLENDPS xmm1, xmm2, xmm3/m128, imm8 + * VEX.256.66.0F3A.WIG 0C /r ib VBLENDPS ymm1, ymm2, ymm3/m256, imm8 + * VEX.128.66.0F3A.WIG 0D /r ib VBLENDPD xmm1, xmm2, xmm3/m128, imm8 + * VEX.256.66.0F3A.WIG 0D /r ib VBLENDPD ymm1, ymm2, ymm3/m256, imm8 + * VEX.128.66.0F3A.W0 4A /r /is4 VBLENDVPS xmm1, xmm2, xmm3/m128, xmm4 + * VEX.256.66.0F3A.W0 4A /r /is4 VBLENDVPS ymm1, ymm2, ymm3/m256, ymm4 + * VEX.128.66.0F3A.W0 4B /r /is4 VBLENDVPD xmm1, xmm2, xmm3/m128, xmm4 + * VEX.256.66.0F3A.W0 4B /r /is4 VBLENDVPD ymm1, ymm2, ymm3/m256, ymm4 + * VEX.128.66.0F3A.W0 4C /r /is4 VPBLENDVB xmm1, xmm2, xmm3/m128, xmm4 + * VEX.128.66.0F3A.WIG 0E /r ib VPBLENDW xmm1, xmm2, xmm3/m128, imm8 + * VEX.128.66.0F3A.WIG 21 /r ib VINSERTPS xmm1, xmm2, xmm3/m32, imm8 + * VEX.128.66.0F3A.W0 20 /r ib VPINSRB xmm1,xmm2,r32/m8,imm8 + * VEX.128.66.0F.W0 C4 /r ib VPINSRW xmm1, xmm2, r32/m16, imm8 + * VEX.128.66.0F3A.W0 22 /r ib VPINSRD xmm1,xmm2,r/m32,imm8 + * VEX.128.66.0F3A.W1 22 /r ib VPINSRQ xmm1,xmm2,r/m64,imm8 + * VEX.256.66.0F3A.W0 18 /r ib VINSERTF128 ymm1, ymm2, xmm3/m128, imm8 + * VEX.128.66.0F3A.WIG 17 /r ib VEXTRACTPS reg/m32, xmm1, imm8 + * VEX.128.66.0F3A.W0 14 /r ib VPEXTRB r32/m8,xmm2,imm8 + * VEX.128.66.0F3A.W0 15 /r ib VPEXTRW r32/m16, xmm2, imm8 + * VEX.128.66.0F3A.W0 16 /r ib VPEXTRD r/m32,xmm2,imm8 + * VEX.128.66.0F3A.W1 16 /r ib VPEXTRQ r64/m64,xmm2,imm8 + * VEX.128.66.0F.W0 C5 /r ib VPEXTRW r32, xmm1, imm8 + * VEX.128.66.0F.W1 C5 /r ib VPEXTRW r64, xmm1, imm8 + * VEX.256.66.0F3A.W0 19 /r ib VEXTRACTF128 xmm1/m128, ymm2, imm8 + * VEX.128.66.0F38.W0 18 /r VBROADCASTSS xmm1, m32 + * VEX.256.66.0F38.W0 18 /r VBROADCASTSS ymm1, m32 + * VEX.256.66.0F38.W0 19 /r VBROADCASTSD ymm1, m64 + * VEX.256.66.0F38.W0 1A /r VBROADCASTF128 ymm1, m128 + * VEX.256.66.0F3A.W0 06 /r ib VPERM2F128 ymm1, ymm2, ymm3/m256, imm8 + * VEX.128.66.0F38.W0 0C /r VPERMILPS xmm1, xmm2, xmm3/m128 + * VEX.256.66.0F38.W0 0C /r VPERMILPS ymm1, ymm2, ymm3/m256 + * VEX.128.66.0F3A.W0 04 /r ib VPERMILPS xmm1, xmm2/m128, imm8 + * VEX.256.66.0F3A.W0 04 /r ib VPERMILPS ymm1, ymm2/m256, imm8 + * VEX.128.66.0F38.W0 0D /r VPERMILPD xmm1, xmm2, xmm3/m128 + * VEX.256.66.0F38.W0 0D /r VPERMILPD ymm1, ymm2, ymm3/m256 + * VEX.128.66.0F3A.W0 05 /r ib VPERMILPD xmm1, xmm2/m128, imm8 + * VEX.256.66.0F3A.W0 05 /r ib VPERMILPD ymm1, ymm2/m256, imm8 + * VEX.128.66.0F38.WIG 20 /r VPMOVSXBW xmm1, xmm2/m64 + * VEX.128.66.0F38.WIG 21 /r VPMOVSXBD xmm1, xmm2/m32 + * VEX.128.66.0F38.WIG 22 /r VPMOVSXBQ xmm1, xmm2/m16 + * VEX.128.66.0F38.WIG 23 /r VPMOVSXWD xmm1, xmm2/m64 + * VEX.128.66.0F38.WIG 24 /r VPMOVSXWQ xmm1, xmm2/m32 + * VEX.128.66.0F38.WIG 25 /r VPMOVSXDQ xmm1, xmm2/m64 + * VEX.128.66.0F38.WIG 30 /r VPMOVZXBW xmm1, xmm2/m64 + * VEX.128.66.0F38.WIG 31 /r VPMOVZXBD xmm1, xmm2/m32 + * VEX.128.66.0F38.WIG 32 /r VPMOVZXBQ xmm1, xmm2/m16 + * VEX.128.66.0F38.WIG 33 /r VPMOVZXWD xmm1, xmm2/m64 + * VEX.128.66.0F38.WIG 34 /r VPMOVZXWQ xmm1, xmm2/m32 + * VEX.128.66.0F38.WIG 35 /r VPMOVZXDQ xmm1, xmm2/m64 + * VEX.LIG.F3.0F.W0 2A /r VCVTSI2SS xmm1,xmm2,r/m32 + * VEX.LIG.F3.0F.W1 2A /r VCVTSI2SS xmm1,xmm2,r/m64 + * VEX.LIG.F2.0F.W0 2A /r VCVTSI2SD xmm1,xmm2,r/m32 + * VEX.LIG.F2.0F.W1 2A /r VCVTSI2SD xmm1,xmm2,r/m64 + * VEX.LIG.F3.0F.W0 2D /r VCVTSS2SI r32,xmm1/m32 + * VEX.LIG.F3.0F.W1 2D /r VCVTSS2SI r64,xmm1/m32 + * VEX.LIG.F2.0F.W0 2D /r VCVTSD2SI r32,xmm1/m64 + * VEX.LIG.F2.0F.W1 2D /r VCVTSD2SI r64,xmm1/m64 + * VEX.LIG.F3.0F.W0 2C /r VCVTTSS2SI r32,xmm1/m32 + * VEX.LIG.F3.0F.W1 2C /r VCVTTSS2SI r64,xmm1/m32 + * VEX.LIG.F2.0F.W0 2C /r VCVTTSD2SI r32,xmm1/m64 + * VEX.LIG.F2.0F.W1 2C /r VCVTTSD2SI r64,xmm1/m64 + * VEX.128.F2.0F.WIG E6 /r VCVTPD2DQ xmm1, xmm2/m128 + * VEX.256.F2.0F.WIG E6 /r VCVTPD2DQ xmm1, ymm2/m256 + * VEX.128.66.0F.WIG E6 /r VCVTTPD2DQ xmm1, xmm2/m128 + * VEX.256.66.0F.WIG E6 /r VCVTTPD2DQ xmm1, ymm2/m256 + * VEX.128.F3.0F.WIG E6 /r VCVTDQ2PD xmm1, xmm2/m64 + * VEX.256.F3.0F.WIG E6 /r VCVTDQ2PD ymm1, xmm2/m128 + * VEX.128.0F.WIG 5A /r VCVTPS2PD xmm1, xmm2/m64 + * VEX.256.0F.WIG 5A /r VCVTPS2PD ymm1, xmm2/m128 + * VEX.128.66.0F.WIG 5A /r VCVTPD2PS xmm1, xmm2/m128 + * VEX.256.66.0F.WIG 5A /r VCVTPD2PS xmm1, ymm2/m256 + * VEX.LIG.F3.0F.WIG 5A /r VCVTSS2SD xmm1, xmm2, xmm3/m32 + * VEX.LIG.F2.0F.WIG 5A /r VCVTSD2SS xmm1,xmm2, xmm3/m64 + * VEX.128.0F.WIG 5B /r VCVTDQ2PS xmm1, xmm2/m128 + * VEX.256.0F.WIG 5B /r VCVTDQ2PS ymm1, ymm2/m256 + * VEX.128.66.0F.WIG 5B /r VCVTPS2DQ xmm1, xmm2/m128 + * VEX.256.66.0F.WIG 5B /r VCVTPS2DQ ymm1, ymm2/m256 + * VEX.128.F3.0F.WIG 5B /r VCVTTPS2DQ xmm1, xmm2/m128 + * VEX.256.F3.0F.WIG 5B /r VCVTTPS2DQ ymm1, ymm2/m256 + * VEX.128.66.0F.WIG F7 /r VMASKMOVDQU xmm1, xmm2 + * VEX.128.66.0F38.W0 2C /r VMASKMOVPS xmm1, xmm2, m128 + * VEX.128.66.0F38.W0 2E /r VMASKMOVPS m128, xmm1, xmm2 + * VEX.256.66.0F38.W0 2C /r VMASKMOVPS ymm1, ymm2, m256 + * VEX.256.66.0F38.W0 2E /r VMASKMOVPS m256, ymm1, ymm2 + * VEX.128.66.0F38.W0 2D /r VMASKMOVPD xmm1, xmm2, m128 + * VEX.128.66.0F38.W0 2F /r VMASKMOVPD m128, xmm1, xmm2 + * VEX.256.66.0F38.W0 2D /r VMASKMOVPD ymm1, ymm2, m256 + * VEX.256.66.0F38.W0 2F /r VMASKMOVPD m256, ymm1, ymm2 + * VEX.128.0F.WIG 2B /r VMOVNTPS m128, xmm1 + * VEX.256.0F.WIG 2B /r VMOVNTPS m256, ymm1 + * VEX.128.66.0F.WIG 2B /r VMOVNTPD m128, xmm1 + * VEX.256.66.0F.WIG 2B /r VMOVNTPD m256, ymm1 + * VEX.128.66.0F.WIG E7 /r VMOVNTDQ m128, xmm1 + * VEX.256.66.0F.WIG E7 /r VMOVNTDQ m256, ymm1 + * VEX.128.66.0F38.WIG 2A /r VMOVNTDQA xmm1, m128 + * VEX.128.0F.WIG 77 VZEROUPPER + * VEX.256.0F.WIG 77 VZEROALL + * VEX.128.66.0F.WIG 71 /6 ib VPSLLW xmm1, xmm2, imm8 + * VEX.128.66.0F.WIG 71 /2 ib VPSRLW xmm1, xmm2, imm8 + * VEX.128.66.0F.WIG 71 /4 ib VPSRAW xmm1,xmm2,imm8 + * VEX.128.66.0F.WIG 72 /6 ib VPSLLD xmm1, xmm2, imm8 + * VEX.128.66.0F.WIG 72 /2 ib VPSRLD xmm1, xmm2, imm8 + * VEX.128.66.0F.WIG 72 /4 ib VPSRAD xmm1,xmm2,imm8 + * VEX.128.66.0F.WIG 73 /6 ib VPSLLQ xmm1, xmm2, imm8 + * VEX.128.66.0F.WIG 73 /7 ib VPSLLDQ xmm1, xmm2, imm8 + * VEX.128.66.0F.WIG 73 /2 ib VPSRLQ xmm1, xmm2, imm8 + * VEX.128.66.0F.WIG 73 /3 ib VPSRLDQ xmm1, xmm2, imm8 + * VEX.LZ.0F.WIG AE /2 VLDMXCSR m32 + * VEX.LZ.0F.WIG AE /3 VSTMXCSR m32 */ OPCODE(movd, LEG(NP, 0F, 0, 0x6e), MMX, WR, Pq, Ed) OPCODE(movd, LEG(NP, 0F, 0, 0x7e), MMX, WR, Ed, Pq) OPCODE(movd, LEG(66, 0F, 0, 0x6e), SSE2, WR, Vdq, Ed) OPCODE(movd, LEG(66, 0F, 0, 0x7e), SSE2, WR, Ed, Vdq) +OPCODE(vmovd, VEX(128, 66, 0F, 0, 0x6e), AVX, WR, Vdq, Ed) +OPCODE(vmovd, VEX(128, 66, 0F, 0, 0x7e), AVX, WR, Ed, Vdq) OPCODE(movq, LEG(NP, 0F, 1, 0x6e), MMX, WR, Pq, Eq) OPCODE(movq, LEG(NP, 0F, 1, 0x7e), MMX, WR, Eq, Pq) OPCODE(movq, LEG(66, 0F, 1, 0x6e), SSE2, WR, Vdq, Eq) OPCODE(movq, LEG(66, 0F, 1, 0x7e), SSE2, WR, Eq, Vdq) +OPCODE(vmovq, VEX(128, 66, 0F, 1, 0x6e), AVX, WR, Vdq, Eq) +OPCODE(vmovq, VEX(128, 66, 0F, 1, 0x7e), AVX, WR, Eq, Vdq) OPCODE(movq, LEG(NP, 0F, 0, 0x6f), MMX, WR, Pq, Qq) OPCODE(movq, LEG(NP, 0F, 0, 0x7f), MMX, WR, Qq, Pq) OPCODE(movq, LEG(F3, 0F, 0, 0x7e), SSE2, WR, Vdq, Wq) OPCODE(movq, LEG(66, 0F, 0, 0xd6), SSE2, WR, UdqMq, Vq) +OPCODE(vmovq, VEX(128, F3, 0F, IG, 0x7e), AVX, WR, Vdq, Wq) +OPCODE(vmovq, VEX(128, 66, 0F, IG, 0xd6), AVX, WR, UdqMq, Vq) OPCODE(movaps, LEG(NP, 0F, 0, 0x28), SSE, WR, Vdq, Wdq) OPCODE(movaps, LEG(NP, 0F, 0, 0x29), SSE, WR, Wdq, Vdq) +OPCODE(vmovaps, VEX(128, NP, 0F, IG, 0x28), AVX, WR, Vdq, Wdq) +OPCODE(vmovaps, VEX(128, NP, 0F, IG, 0x29), AVX, WR, Wdq, Vdq) +OPCODE(vmovaps, VEX(256, NP, 0F, IG, 0x28), AVX, WR, Vqq, Wqq) +OPCODE(vmovaps, VEX(256, NP, 0F, IG, 0x29), AVX, WR, Wqq, Vqq) OPCODE(movapd, LEG(66, 0F, 0, 0x28), SSE2, WR, Vdq, Wdq) OPCODE(movapd, LEG(66, 0F, 0, 0x29), SSE2, WR, Wdq, Vdq) +OPCODE(vmovapd, VEX(128, 66, 0F, IG, 0x28), AVX, WR, Vdq, Wdq) +OPCODE(vmovapd, VEX(128, 66, 0F, IG, 0x29), AVX, WR, Wdq, Vdq) +OPCODE(vmovapd, VEX(256, 66, 0F, IG, 0x28), AVX, WR, Vqq, Wqq) +OPCODE(vmovapd, VEX(256, 66, 0F, IG, 0x29), AVX, WR, Wqq, Vqq) OPCODE(movdqa, LEG(66, 0F, 0, 0x6f), SSE2, WR, Vdq, Wdq) OPCODE(movdqa, LEG(66, 0F, 0, 0x7f), SSE2, WR, Wdq, Vdq) +OPCODE(vmovdqa, VEX(128, 66, 0F, IG, 0x6f), AVX, WR, Vdq, Wdq) +OPCODE(vmovdqa, VEX(128, 66, 0F, IG, 0x7f), AVX, WR, Wdq, Vdq) +OPCODE(vmovdqa, VEX(256, 66, 0F, IG, 0x6f), AVX, WR, Vqq, Wqq) +OPCODE(vmovdqa, VEX(256, 66, 0F, IG, 0x7f), AVX, WR, Wqq, Vqq) OPCODE(movups, LEG(NP, 0F, 0, 0x10), SSE, WR, Vdq, Wdq) OPCODE(movups, LEG(NP, 0F, 0, 0x11), SSE, WR, Wdq, Vdq) +OPCODE(vmovups, VEX(128, NP, 0F, IG, 0x10), AVX, WR, Vdq, Wdq) +OPCODE(vmovups, VEX(128, NP, 0F, IG, 0x11), AVX, WR, Wdq, Vdq) +OPCODE(vmovups, VEX(256, NP, 0F, IG, 0x10), AVX, WR, Vqq, Wqq) +OPCODE(vmovups, VEX(256, NP, 0F, IG, 0x11), AVX, WR, Wqq, Vqq) OPCODE(movupd, LEG(66, 0F, 0, 0x10), SSE2, WR, Vdq, Wdq) OPCODE(movupd, LEG(66, 0F, 0, 0x11), SSE2, WR, Wdq, Vdq) +OPCODE(vmovupd, VEX(128, 66, 0F, IG, 0x10), AVX, WR, Vdq, Wdq) +OPCODE(vmovupd, VEX(128, 66, 0F, IG, 0x11), AVX, WR, Wdq, Vdq) +OPCODE(vmovupd, VEX(256, 66, 0F, IG, 0x10), AVX, WR, Vqq, Wqq) +OPCODE(vmovupd, VEX(256, 66, 0F, IG, 0x11), AVX, WR, Wqq, Vqq) OPCODE(movdqu, LEG(F3, 0F, 0, 0x6f), SSE2, WR, Vdq, Wdq) OPCODE(movdqu, LEG(F3, 0F, 0, 0x7f), SSE2, WR, Wdq, Vdq) +OPCODE(vmovdqu, VEX(128, F3, 0F, IG, 0x6f), AVX, WR, Vdq, Wdq) +OPCODE(vmovdqu, VEX(128, F3, 0F, IG, 0x7f), AVX, WR, Wdq, Vdq) +OPCODE(vmovdqu, VEX(256, F3, 0F, IG, 0x6f), AVX, WR, Vqq, Wqq) +OPCODE(vmovdqu, VEX(256, F3, 0F, IG, 0x7f), AVX, WR, Wqq, Vqq) OPCODE(movss, LEG(F3, 0F, 0, 0x10), SSE, WRRR, Vdq, Vdq, Wd, modrm_mod) OPCODE(movss, LEG(F3, 0F, 0, 0x11), SSE, WR, Wd, Vd) +OPCODE(vmovss, VEX(IG, F3, 0F, IG, 0x10), AVX, WRRRR, Vdq, Hdq, Wd, modrm_mod, vex_v) +OPCODE(vmovss, VEX(IG, F3, 0F, IG, 0x11), AVX, WRRRR, Wdq, Hdq, Vd, modrm_mod, vex_v) OPCODE(movsd, LEG(F2, 0F, 0, 0x10), SSE2, WRRR, Vdq, Vdq, Wq, modrm_mod) OPCODE(movsd, LEG(F2, 0F, 0, 0x11), SSE2, WR, Wq, Vq) +OPCODE(vmovsd, VEX(IG, F2, 0F, IG, 0x10), AVX, WRRRR, Vdq, Hdq, Wq, modrm_mod, vex_v) +OPCODE(vmovsd, VEX(IG, F2, 0F, IG, 0x11), AVX, WRRRR, Wdq, Hdq, Vq, modrm_mod, vex_v) OPCODE(movq2dq, LEG(F3, 0F, 0, 0xd6), SSE2, WR, Vdq, Nq) OPCODE(movdq2q, LEG(F2, 0F, 0, 0xd6), SSE2, WR, Pq, Uq) OPCODE(movhlps, LEG(NP, 0F, 0, 0x12), SSE, WRR, Vdq, Vdq, UdqMhq) +OPCODE(vmovhlps, VEX(128, NP, 0F, IG, 0x12), AVX, WRR, Vdq, Hdq, UdqMhq) OPCODE(movlps, LEG(NP, 0F, 0, 0x13), SSE, WR, Mq, Vq) +OPCODE(vmovlps, VEX(128, NP, 0F, IG, 0x13), AVX, WR, Mq, Vq) OPCODE(movlpd, LEG(66, 0F, 0, 0x12), SSE2, WRR, Vdq, Vdq, Mq) OPCODE(movlpd, LEG(66, 0F, 0, 0x13), SSE2, WR, Mq, Vq) +OPCODE(vmovlpd, VEX(128, 66, 0F, IG, 0x12), AVX, WRR, Vdq, Hdq, Mq) +OPCODE(vmovlpd, VEX(128, 66, 0F, IG, 0x13), AVX, WR, Mq, Vq) OPCODE(movlhps, LEG(NP, 0F, 0, 0x16), SSE, WRR, Vdq, Vq, Wq) +OPCODE(vmovlhps, VEX(128, NP, 0F, IG, 0x16), AVX, WRR, Vdq, Hq, Wq) OPCODE(movhps, LEG(NP, 0F, 0, 0x17), SSE, WR, Mq, Vdq) +OPCODE(vmovhps, VEX(128, NP, 0F, IG, 0x17), AVX, WR, Mq, Vdq) OPCODE(movhpd, LEG(66, 0F, 0, 0x16), SSE2, WRR, Vdq, Vq, Mq) OPCODE(movhpd, LEG(66, 0F, 0, 0x17), SSE2, WR, Mq, Vdq) +OPCODE(vmovhpd, VEX(128, 66, 0F, IG, 0x16), AVX, WRR, Vdq, Hq, Mq) +OPCODE(vmovhpd, VEX(128, 66, 0F, IG, 0x17), AVX, WR, Mq, Vdq) OPCODE(pmovmskb, LEG(NP, 0F, 0, 0xd7), SSE, WR, Gd, Nq) OPCODE(pmovmskb, LEG(NP, 0F, 1, 0xd7), SSE, WR, Gq, Nq) OPCODE(pmovmskb, LEG(66, 0F, 0, 0xd7), SSE2, WR, Gd, Udq) OPCODE(pmovmskb, LEG(66, 0F, 1, 0xd7), SSE2, WR, Gq, Udq) +OPCODE(vpmovmskb, VEX(128, 66, 0F, 0, 0xd7), AVX, WR, Gd, Udq) +OPCODE(vpmovmskb, VEX(128, 66, 0F, 1, 0xd7), AVX, WR, Gq, Udq) OPCODE(movmskps, LEG(NP, 0F, 0, 0x50), SSE, WR, Gd, Udq) OPCODE(movmskps, LEG(NP, 0F, 1, 0x50), SSE, WR, Gq, Udq) +OPCODE(vmovmskps, VEX(128, NP, 0F, 0, 0x50), AVX, WR, Gd, Udq) +OPCODE(vmovmskps, VEX(128, NP, 0F, 1, 0x50), AVX, WR, Gq, Udq) +OPCODE(vmovmskps, VEX(256, NP, 0F, 0, 0x50), AVX, WR, Gd, Uqq) +OPCODE(vmovmskps, VEX(256, NP, 0F, 1, 0x50), AVX, WR, Gq, Uqq) OPCODE(movmskpd, LEG(66, 0F, 0, 0x50), SSE2, WR, Gd, Udq) OPCODE(movmskpd, LEG(66, 0F, 1, 0x50), SSE2, WR, Gq, Udq) +OPCODE(vmovmskpd, VEX(128, 66, 0F, 0, 0x50), AVX, WR, Gd, Udq) +OPCODE(vmovmskpd, VEX(128, 66, 0F, 1, 0x50), AVX, WR, Gq, Udq) +OPCODE(vmovmskpd, VEX(256, 66, 0F, 0, 0x50), AVX, WR, Gd, Uqq) +OPCODE(vmovmskpd, VEX(256, 66, 0F, 1, 0x50), AVX, WR, Gq, Uqq) OPCODE(lddqu, LEG(F2, 0F, 0, 0xf0), SSE3, WR, Vdq, Mdq) +OPCODE(vlddqu, VEX(128, F2, 0F, IG, 0xf0), AVX, WR, Vdq, Mdq) +OPCODE(vlddqu, VEX(256, F2, 0F, IG, 0xf0), AVX, WR, Vqq, Mqq) OPCODE(movshdup, LEG(F3, 0F, 0, 0x16), SSE3, WR, Vdq, Wdq) +OPCODE(vmovshdup, VEX(128, F3, 0F, IG, 0x16), AVX, WR, Vdq, Wdq) +OPCODE(vmovshdup, VEX(256, F3, 0F, IG, 0x16), AVX, WR, Vqq, Wqq) OPCODE(movsldup, LEG(F3, 0F, 0, 0x12), SSE3, WR, Vdq, Wdq) +OPCODE(vmovsldup, VEX(128, F3, 0F, IG, 0x12), AVX, WR, Vdq, Wdq) +OPCODE(vmovsldup, VEX(256, F3, 0F, IG, 0x12), AVX, WR, Vqq, Wqq) OPCODE(movddup, LEG(F2, 0F, 0, 0x12), SSE3, WR, Vdq, Wq) +OPCODE(vmovddup, VEX(128, F2, 0F, IG, 0x12), AVX, WR, Vdq, Wq) +OPCODE(vmovddup, VEX(256, F2, 0F, IG, 0x12), AVX, WR, Vqq, Wqq) OPCODE(paddb, LEG(NP, 0F, 0, 0xfc), MMX, WRR, Pq, Pq, Qq) OPCODE(paddb, LEG(66, 0F, 0, 0xfc), SSE2, WRR, Vdq, Vdq, Wdq) +OPCODE(vpaddb, VEX(128, 66, 0F, IG, 0xfc), AVX, WRR, Vdq, Hdq, Wdq) OPCODE(paddw, LEG(NP, 0F, 0, 0xfd), MMX, WRR, Pq, Pq, Qq) OPCODE(paddw, LEG(66, 0F, 0, 0xfd), SSE2, WRR, Vdq, Vdq, Wdq) +OPCODE(vpaddw, VEX(128, 66, 0F, IG, 0xfd), AVX, WRR, Vdq, Hdq, Wdq) OPCODE(paddd, LEG(NP, 0F, 0, 0xfe), MMX, WRR, Pq, Pq, Qq) OPCODE(paddd, LEG(66, 0F, 0, 0xfe), SSE2, WRR, Vdq, Vdq, Wdq) +OPCODE(vpaddd, VEX(128, 66, 0F, IG, 0xfe), AVX, WRR, Vdq, Hdq, Wdq) OPCODE(paddq, LEG(NP, 0F, 0, 0xd4), SSE2, WRR, Pq, Pq, Qq) OPCODE(paddq, LEG(66, 0F, 0, 0xd4), SSE2, WRR, Vdq, Vdq, Wdq) +OPCODE(vpaddq, VEX(128, 66, 0F, IG, 0xd4), AVX, WRR, Vdq, Hdq, Wdq) OPCODE(paddsb, LEG(NP, 0F, 0, 0xec), MMX, WRR, Pq, Pq, Qq) OPCODE(paddsb, LEG(66, 0F, 0, 0xec), SSE2, WRR, Vdq, Vdq, Wdq) +OPCODE(vpaddsb, VEX(128, 66, 0F, IG, 0xec), AVX, WRR, Vdq, Hdq, Wdq) OPCODE(paddsw, LEG(NP, 0F, 0, 0xed), MMX, WRR, Pq, Pq, Qq) OPCODE(paddsw, LEG(66, 0F, 0, 0xed), SSE2, WRR, Vdq, Vdq, Wdq) +OPCODE(vpaddsw, VEX(128, 66, 0F, IG, 0xed), AVX, WRR, Vdq, Hdq, Wdq) OPCODE(paddusb, LEG(NP, 0F, 0, 0xdc), MMX, WRR, Pq, Pq, Qq) OPCODE(paddusb, LEG(66, 0F, 0, 0xdc), SSE2, WRR, Vdq, Vdq, Wdq) +OPCODE(vpaddusb, VEX(128, 66, 0F, IG, 0xdc), AVX, WRR, Vdq, Hdq, Wdq) OPCODE(paddusw, LEG(NP, 0F, 0, 0xdd), MMX, WRR, Pq, Pq, Qq) OPCODE(paddusw, LEG(66, 0F, 0, 0xdd), SSE2, WRR, Vdq, Vdq, Wdq) +OPCODE(vpaddusw, VEX(128, 66, 0F, IG, 0xdd), AVX, WRR, Vdq, Hdq, Wdq) OPCODE(addps, LEG(NP, 0F, 0, 0x58), SSE, WRR, Vdq, Vdq, Wdq) +OPCODE(vaddps, VEX(128, NP, 0F, IG, 0x58), AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(vaddps, VEX(256, NP, 0F, IG, 0x58), AVX, WRR, Vqq, Hqq, Wqq) OPCODE(addpd, LEG(66, 0F, 0, 0x58), SSE2, WRR, Vdq, Vdq, Wdq) +OPCODE(vaddpd, VEX(128, 66, 0F, IG, 0x58), AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(vaddpd, VEX(256, 66, 0F, IG, 0x58), AVX, WRR, Vqq, Hqq, Wqq) OPCODE(addss, LEG(F3, 0F, 0, 0x58), SSE, WRR, Vd, Vd, Wd) +OPCODE(vaddss, VEX(IG, F3, 0F, IG, 0x58), AVX, WRR, Vd, Hd, Wd) OPCODE(addsd, LEG(F2, 0F, 0, 0x58), SSE2, WRR, Vq, Vq, Wq) +OPCODE(vaddsd, VEX(IG, F2, 0F, IG, 0x58), AVX, WRR, Vq, Hq, Wq) OPCODE(phaddw, LEG(NP, 0F38, 0, 0x01), SSSE3, WRR, Pq, Pq, Qq) OPCODE(phaddw, LEG(66, 0F38, 0, 0x01), SSSE3, WRR, Vdq, Vdq, Wdq) +OPCODE(vphaddw, VEX(128, 66, 0F38, IG, 0x01), AVX, WRR, Vdq, Hdq, Wdq) OPCODE(phaddd, LEG(NP, 0F38, 0, 0x02), SSSE3, WRR, Pq, Pq, Qq) OPCODE(phaddd, LEG(66, 0F38, 0, 0x02), SSSE3, WRR, Vdq, Vdq, Wdq) +OPCODE(vphaddd, VEX(128, 66, 0F38, IG, 0x02), AVX, WRR, Vdq, Hdq, Wdq) OPCODE(phaddsw, LEG(NP, 0F38, 0, 0x03), SSSE3, WRR, Pq, Pq, Qq) OPCODE(phaddsw, LEG(66, 0F38, 0, 0x03), SSSE3, WRR, Vdq, Vdq, Wdq) +OPCODE(vphaddsw, VEX(128, 66, 0F38, IG, 0x03), AVX, WRR, Vdq, Hdq, Wdq) OPCODE(haddps, LEG(F2, 0F, 0, 0x7c), SSE3, WRR, Vdq, Vdq, Wdq) +OPCODE(vhaddps, VEX(128, F2, 0F, IG, 0x7c), AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(vhaddps, VEX(256, F2, 0F, IG, 0x7c), AVX, WRR, Vqq, Hqq, Wqq) OPCODE(haddpd, LEG(66, 0F, 0, 0x7c), SSE3, WRR, Vdq, Vdq, Wdq) +OPCODE(vhaddpd, VEX(128, 66, 0F, IG, 0x7c), AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(vhaddpd, VEX(256, 66, 0F, IG, 0x7c), AVX, WRR, Vqq, Hqq, Wqq) OPCODE(psubb, LEG(NP, 0F, 0, 0xf8), MMX, WRR, Pq, Pq, Qq) OPCODE(psubb, LEG(66, 0F, 0, 0xf8), SSE2, WRR, Vdq, Vdq, Wdq) +OPCODE(vpsubb, VEX(128, 66, 0F, IG, 0xf8), AVX, WRR, Vdq, Hdq, Wdq) OPCODE(psubw, LEG(NP, 0F, 0, 0xf9), MMX, WRR, Pq, Pq, Qq) OPCODE(psubw, LEG(66, 0F, 0, 0xf9), SSE2, WRR, Vdq, Vdq, Wdq) +OPCODE(vpsubw, VEX(128, 66, 0F, IG, 0xf9), AVX, WRR, Vdq, Hdq, Wdq) OPCODE(psubd, LEG(NP, 0F, 0, 0xfa), MMX, WRR, Pq, Pq, Qq) OPCODE(psubd, LEG(66, 0F, 0, 0xfa), SSE2, WRR, Vdq, Vdq, Wdq) +OPCODE(vpsubd, VEX(128, 66, 0F, IG, 0xfa), AVX, WRR, Vdq, Hdq, Wdq) OPCODE(psubq, LEG(NP, 0F, 0, 0xfb), SSE2, WRR, Pq, Pq, Qq) OPCODE(psubq, LEG(66, 0F, 0, 0xfb), SSE2, WRR, Vdq, Vdq, Wdq) +OPCODE(vpsubq, VEX(128, 66, 0F, IG, 0xfb), AVX, WRR, Vdq, Hdq, Wdq) OPCODE(psubsb, LEG(NP, 0F, 0, 0xe8), MMX, WRR, Pq, Pq, Qq) OPCODE(psubsb, LEG(66, 0F, 0, 0xe8), SSE2, WRR, Vdq, Vdq, Wdq) +OPCODE(vpsubsb, VEX(128, 66, 0F, IG, 0xe8), AVX, WRR, Vdq, Hdq, Wdq) OPCODE(psubsw, LEG(NP, 0F, 0, 0xe9), MMX, WRR, Pq, Pq, Qq) OPCODE(psubsw, LEG(66, 0F, 0, 0xe9), SSE2, WRR, Vdq, Vdq, Wdq) +OPCODE(vpsubsw, VEX(128, 66, 0F, IG, 0xe9), AVX, WRR, Vdq, Hdq, Wdq) OPCODE(psubusb, LEG(NP, 0F, 0, 0xd8), MMX, WRR, Pq, Pq, Qq) OPCODE(psubusb, LEG(66, 0F, 0, 0xd8), SSE2, WRR, Vdq, Vdq, Wdq) +OPCODE(vpsubusb, VEX(128, 66, 0F, IG, 0xd8), AVX, WRR, Vdq, Hdq, Wdq) OPCODE(psubusw, LEG(NP, 0F, 0, 0xd9), MMX, WRR, Pq, Pq, Qq) OPCODE(psubusw, LEG(66, 0F, 0, 0xd9), SSE2, WRR, Vdq, Vdq, Wdq) +OPCODE(vpsubusw, VEX(128, 66, 0F, IG, 0xd9), AVX, WRR, Vdq, Hdq, Wdq) OPCODE(subps, LEG(NP, 0F, 0, 0x5c), SSE, WRR, Vdq, Vdq, Wdq) +OPCODE(vsubps, VEX(128, NP, 0F, IG, 0x5c), AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(vsubps, VEX(256, NP, 0F, IG, 0x5c), AVX, WRR, Vqq, Hqq, Wqq) OPCODE(subpd, LEG(66, 0F, 0, 0x5c), SSE2, WRR, Vdq, Vdq, Wdq) +OPCODE(vsubpd, VEX(128, 66, 0F, IG, 0x5c), AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(vsubpd, VEX(256, 66, 0F, IG, 0x5c), AVX, WRR, Vqq, Hqq, Wqq) OPCODE(subss, LEG(F3, 0F, 0, 0x5c), SSE, WRR, Vd, Vd, Wd) +OPCODE(vsubss, VEX(IG, F3, 0F, IG, 0x5c), AVX, WRR, Vd, Hd, Wd) OPCODE(subsd, LEG(F2, 0F, 0, 0x5c), SSE2, WRR, Vq, Vq, Wq) +OPCODE(vsubsd, VEX(IG, F2, 0F, IG, 0x5c), AVX, WRR, Vq, Hq, Wq) OPCODE(phsubw, LEG(NP, 0F38, 0, 0x05), SSSE3, WRR, Pq, Pq, Qq) OPCODE(phsubw, LEG(66, 0F38, 0, 0x05), SSSE3, WRR, Vdq, Vdq, Wdq) +OPCODE(vphsubw, VEX(128, 66, 0F38, IG, 0x05), AVX, WRR, Vdq, Hdq, Wdq) OPCODE(phsubd, LEG(NP, 0F38, 0, 0x06), SSSE3, WRR, Pq, Pq, Qq) OPCODE(phsubd, LEG(66, 0F38, 0, 0x06), SSSE3, WRR, Vdq, Vdq, Wdq) +OPCODE(vphsubd, VEX(128, 66, 0F38, IG, 0x06), AVX, WRR, Vdq, Hdq, Wdq) OPCODE(phsubsw, LEG(NP, 0F38, 0, 0x07), SSSE3, WRR, Pq, Pq, Qq) OPCODE(phsubsw, LEG(66, 0F38, 0, 0x07), SSSE3, WRR, Vdq, Vdq, Wdq) +OPCODE(vphsubsw, VEX(128, 66, 0F38, IG, 0x07), AVX, WRR, Vdq, Hdq, Wdq) OPCODE(hsubps, LEG(F2, 0F, 0, 0x7d), SSE3, WRR, Vdq, Vdq, Wdq) +OPCODE(vhsubps, VEX(128, F2, 0F, IG, 0x7d), AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(vhsubps, VEX(256, F2, 0F, IG, 0x7d), AVX, WRR, Vqq, Hqq, Wqq) OPCODE(hsubpd, LEG(66, 0F, 0, 0x7d), SSE3, WRR, Vdq, Vdq, Wdq) +OPCODE(vhsubpd, VEX(128, 66, 0F, IG, 0x7d), AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(vhsubpd, VEX(256, 66, 0F, IG, 0x7d), AVX, WRR, Vqq, Hqq, Wqq) OPCODE(addsubps, LEG(F2, 0F, 0, 0xd0), SSE3, WRR, Vdq, Vdq, Wdq) +OPCODE(vaddsubps, VEX(128, F2, 0F, IG, 0xd0), AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(vaddsubps, VEX(256, F2, 0F, IG, 0xd0), AVX, WRR, Vqq, Hqq, Wqq) OPCODE(addsubpd, LEG(66, 0F, 0, 0xd0), SSE3, WRR, Vdq, Vdq, Wdq) +OPCODE(vaddsubpd, VEX(128, 66, 0F, IG, 0xd0), AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(vaddsubpd, VEX(256, 66, 0F, IG, 0xd0), AVX, WRR, Vqq, Hqq, Wqq) OPCODE(pmullw, LEG(NP, 0F, 0, 0xd5), MMX, WRR, Pq, Pq, Qq) OPCODE(pmullw, LEG(66, 0F, 0, 0xd5), SSE2, WRR, Vdq, Vdq, Wdq) +OPCODE(vpmullw, VEX(128, 66, 0F, IG, 0xd5), AVX, WRR, Vdq, Hdq, Wdq) OPCODE(pmulld, LEG(66, 0F38, 0, 0x40), SSE4_1, WRR, Vdq, Vdq, Wdq) +OPCODE(vpmulld, VEX(128, 66, 0F38, IG, 0x40), AVX, WRR, Vdq, Hdq, Wdq) OPCODE(pmulhw, LEG(NP, 0F, 0, 0xe5), MMX, WRR, Pq, Pq, Qq) OPCODE(pmulhw, LEG(66, 0F, 0, 0xe5), SSE2, WRR, Vdq, Vdq, Wdq) +OPCODE(vpmulhw, VEX(128, 66, 0F, IG, 0xe5), AVX, WRR, Vdq, Hdq, Wdq) OPCODE(pmulhuw, LEG(NP, 0F, 0, 0xe4), SSE, WRR, Pq, Pq, Qq) OPCODE(pmulhuw, LEG(66, 0F, 0, 0xe4), SSE2, WRR, Vdq, Vdq, Wdq) +OPCODE(vpmulhuw, VEX(128, 66, 0F, IG, 0xe4), AVX, WRR, Vdq, Hdq, Wdq) OPCODE(pmuldq, LEG(66, 0F38, 0, 0x28), SSE4_1, WRR, Vdq, Vdq, Wdq) +OPCODE(vpmuldq, VEX(128, 66, 0F38, IG, 0x28), AVX, WRR, Vdq, Hdq, Wdq) OPCODE(pmuludq, LEG(NP, 0F, 0, 0xf4), SSE2, WRR, Pq, Pq, Qq) OPCODE(pmuludq, LEG(66, 0F, 0, 0xf4), SSE2, WRR, Vdq, Vdq, Wdq) +OPCODE(vpmuludq, VEX(128, 66, 0F, IG, 0xf4), AVX, WRR, Vdq, Hdq, Wdq) OPCODE(pmulhrsw, LEG(NP, 0F38, 0, 0x0b), SSSE3, WRR, Pq, Pq, Qq) OPCODE(pmulhrsw, LEG(66, 0F38, 0, 0x0b), SSSE3, WRR, Vdq, Vdq, Wdq) +OPCODE(vpmulhrsw, VEX(128, 66, 0F38, IG, 0x0b), AVX, WRR, Vdq, Hdq, Wdq) OPCODE(mulps, LEG(NP, 0F, 0, 0x59), SSE, WRR, Vdq, Vdq, Wdq) +OPCODE(vmulps, VEX(128, NP, 0F, IG, 0x59), AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(vmulps, VEX(256, NP, 0F, IG, 0x59), AVX, WRR, Vqq, Hqq, Wqq) OPCODE(mulpd, LEG(66, 0F, 0, 0x59), SSE2, WRR, Vdq, Vdq, Wdq) +OPCODE(vmulpd, VEX(128, 66, 0F, IG, 0x59), AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(vmulpd, VEX(256, 66, 0F, IG, 0x59), AVX, WRR, Vqq, Hqq, Wqq) OPCODE(mulss, LEG(F3, 0F, 0, 0x59), SSE, WRR, Vd, Vd, Wd) +OPCODE(vmulss, VEX(IG, F3, 0F, IG, 0x59), AVX, WRR, Vd, Hd, Wd) OPCODE(mulsd, LEG(F2, 0F, 0, 0x59), SSE2, WRR, Vq, Vq, Wq) +OPCODE(vmulsd, VEX(IG, F2, 0F, IG, 0x59), AVX, WRR, Vq, Hq, Wq) OPCODE(pmaddwd, LEG(NP, 0F, 0, 0xf5), MMX, WRR, Pq, Pq, Qq) OPCODE(pmaddwd, LEG(66, 0F, 0, 0xf5), SSE2, WRR, Vdq, Vdq, Wdq) +OPCODE(vpmaddwd, VEX(128, 66, 0F, IG, 0xf5), AVX, WRR, Vdq, Hdq, Wdq) OPCODE(pmaddubsw, LEG(NP, 0F38, 0, 0x04), SSSE3, WRR, Pq, Pq, Qq) OPCODE(pmaddubsw, LEG(66, 0F38, 0, 0x04), SSSE3, WRR, Vdq, Vdq, Wdq) +OPCODE(vpmaddubsw, VEX(128, 66, 0F38, IG, 0x04), AVX, WRR, Vdq, Hdq, Wdq) OPCODE(divps, LEG(NP, 0F, 0, 0x5e), SSE, WRR, Vdq, Vdq, Wdq) +OPCODE(vdivps, VEX(128, NP, 0F, IG, 0x5e), AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(vdivps, VEX(256, NP, 0F, IG, 0x5e), AVX, WRR, Vqq, Hqq, Wqq) OPCODE(divpd, LEG(66, 0F, 0, 0x5e), SSE2, WRR, Vdq, Vdq, Wdq) +OPCODE(vdivpd, VEX(128, 66, 0F, IG, 0x5e), AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(vdivpd, VEX(256, 66, 0F, IG, 0x5e), AVX, WRR, Vqq, Hqq, Wqq) OPCODE(divss, LEG(F3, 0F, 0, 0x5e), SSE, WRR, Vd, Vd, Wd) +OPCODE(vdivss, VEX(IG, F3, 0F, IG, 0x5e), AVX, WRR, Vd, Hd, Wd) OPCODE(divsd, LEG(F2, 0F, 0, 0x5e), SSE2, WRR, Vq, Vq, Wq) +OPCODE(vdivsd, VEX(IG, F2, 0F, IG, 0x5e), AVX, WRR, Vq, Hq, Wq) OPCODE(rcpps, LEG(NP, 0F, 0, 0x53), SSE, WR, Vdq, Wdq) +OPCODE(vrcpps, VEX(128, NP, 0F, IG, 0x53), AVX, WR, Vdq, Wdq) +OPCODE(vrcpps, VEX(256, NP, 0F, IG, 0x53), AVX, WR, Vqq, Wqq) OPCODE(rcpss, LEG(F3, 0F, 0, 0x53), SSE, WR, Vd, Wd) +OPCODE(vrcpss, VEX(IG, F3, 0F, IG, 0x53), AVX, WRR, Vd, Hd, Wd) OPCODE(sqrtps, LEG(NP, 0F, 0, 0x51), SSE, WR, Vdq, Wdq) +OPCODE(vsqrtps, VEX(128, NP, 0F, IG, 0x51), AVX, WR, Vdq, Wdq) +OPCODE(vsqrtps, VEX(256, NP, 0F, IG, 0x51), AVX, WR, Vqq, Wqq) OPCODE(sqrtpd, LEG(66, 0F, 0, 0x51), SSE2, WR, Vdq, Wdq) +OPCODE(vsqrtpd, VEX(128, 66, 0F, IG, 0x51), AVX, WR, Vdq, Wdq) +OPCODE(vsqrtpd, VEX(256, 66, 0F, IG, 0x51), AVX, WR, Vqq, Wqq) OPCODE(sqrtss, LEG(F3, 0F, 0, 0x51), SSE, WR, Vd, Wd) +OPCODE(vsqrtss, VEX(IG, F3, 0F, IG, 0x51), AVX, WRR, Vd, Hd, Wd) OPCODE(sqrtsd, LEG(F2, 0F, 0, 0x51), SSE2, WR, Vq, Wq) +OPCODE(vsqrtsd, VEX(IG, F2, 0F, IG, 0x51), AVX, WRR, Vq, Hq, Wq) OPCODE(rsqrtps, LEG(NP, 0F, 0, 0x52), SSE, WR, Vdq, Wdq) +OPCODE(vrsqrtps, VEX(128, NP, 0F, IG, 0x52), AVX, WR, Vdq, Wdq) +OPCODE(vrsqrtps, VEX(256, NP, 0F, IG, 0x52), AVX, WR, Vqq, Wqq) OPCODE(rsqrtss, LEG(F3, 0F, 0, 0x52), SSE, WR, Vd, Wd) +OPCODE(vrsqrtss, VEX(IG, F3, 0F, IG, 0x52), AVX, WRR, Vd, Hd, Wd) OPCODE(pminub, LEG(NP, 0F, 0, 0xda), SSE, WRR, Pq, Pq, Qq) OPCODE(pminub, LEG(66, 0F, 0, 0xda), SSE2, WRR, Vdq, Vdq, Wdq) +OPCODE(vpminub, VEX(128, 66, 0F, IG, 0xda), AVX, WRR, Vdq, Hdq, Wdq) OPCODE(pminuw, LEG(66, 0F38, 0, 0x3a), SSE4_1, WRR, Vdq, Vdq, Wdq) +OPCODE(vpminuw, VEX(128, 66, 0F38, IG, 0x3a), AVX, WRR, Vdq, Hdq, Wdq) OPCODE(pminud, LEG(66, 0F38, 0, 0x3b), SSE4_1, WRR, Vdq, Vdq, Wdq) +OPCODE(vpminud, VEX(128, 66, 0F38, IG, 0x3b), AVX, WRR, Vdq, Hdq, Wdq) OPCODE(pminsb, LEG(66, 0F38, 0, 0x38), SSE4_1, WRR, Vdq, Vdq, Wdq) +OPCODE(vpminsb, VEX(128, 66, 0F38, IG, 0x38), AVX, WRR, Vdq, Hdq, Wdq) OPCODE(pminsw, LEG(NP, 0F, 0, 0xea), SSE, WRR, Pq, Pq, Qq) OPCODE(pminsw, LEG(66, 0F, 0, 0xea), SSE2, WRR, Vdq, Vdq, Wdq) +OPCODE(vpminsw, VEX(128, 66, 0F, IG, 0xea), AVX, WRR, Vdq, Hdq, Wdq) OPCODE(pminsd, LEG(66, 0F38, 0, 0x39), SSE4_1, WRR, Vdq, Vdq, Wdq) +OPCODE(vpminsd, VEX(128, 66, 0F38, IG, 0x39), AVX, WRR, Vdq, Hdq, Wdq) OPCODE(minps, LEG(NP, 0F, 0, 0x5d), SSE, WRR, Vdq, Vdq, Wdq) +OPCODE(vminps, VEX(128, NP, 0F, IG, 0x5d), AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(vminps, VEX(256, NP, 0F, IG, 0x5d), AVX, WRR, Vqq, Hqq, Wqq) OPCODE(minpd, LEG(66, 0F, 0, 0x5d), SSE2, WRR, Vdq, Vdq, Wdq) +OPCODE(vminpd, VEX(128, 66, 0F, IG, 0x5d), AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(vminpd, VEX(256, 66, 0F, IG, 0x5d), AVX, WRR, Vqq, Hqq, Wqq) OPCODE(minss, LEG(F3, 0F, 0, 0x5d), SSE, WRR, Vd, Vd, Wd) +OPCODE(vminss, VEX(IG, F3, 0F, IG, 0x5d), AVX, WRR, Vd, Hd, Wd) OPCODE(minsd, LEG(F2, 0F, 0, 0x5d), SSE2, WRR, Vq, Vq, Wq) +OPCODE(vminsd, VEX(IG, F2, 0F, IG, 0x5d), AVX, WRR, Vq, Hq, Wq) OPCODE(phminposuw, LEG(66, 0F38, 0, 0x41), SSE4_1, WR, Vdq, Wdq) +OPCODE(vphminposuw, VEX(128, 66, 0F38, IG, 0x41), AVX, WR, Vdq, Wdq) OPCODE(pmaxub, LEG(NP, 0F, 0, 0xde), SSE, WRR, Pq, Pq, Qq) OPCODE(pmaxub, LEG(66, 0F, 0, 0xde), SSE2, WRR, Vdq, Vdq, Wdq) +OPCODE(vpmaxub, VEX(128, 66, 0F, IG, 0xde), AVX, WRR, Vdq, Hdq, Wdq) OPCODE(pmaxuw, LEG(66, 0F38, 0, 0x3e), SSE4_1, WRR, Vdq, Vdq, Wdq) +OPCODE(vpmaxuw, VEX(128, 66, 0F38, IG, 0x3e), AVX, WRR, Vdq, Hdq, Wdq) OPCODE(pmaxud, LEG(66, 0F38, 0, 0x3f), SSE4_1, WRR, Vdq, Vdq, Wdq) +OPCODE(vpmaxud, VEX(128, 66, 0F38, IG, 0x3f), AVX, WRR, Vdq, Hdq, Wdq) OPCODE(pmaxsb, LEG(66, 0F38, 0, 0x3c), SSE4_1, WRR, Vdq, Vdq, Wdq) +OPCODE(vpmaxsb, VEX(128, 66, 0F38, IG, 0x3c), AVX, WRR, Vdq, Hdq, Wdq) OPCODE(pmaxsw, LEG(NP, 0F, 0, 0xee), SSE, WRR, Pq, Pq, Qq) OPCODE(pmaxsw, LEG(66, 0F, 0, 0xee), SSE2, WRR, Vdq, Vdq, Wdq) +OPCODE(vpmaxsw, VEX(128, 66, 0F, IG, 0xee), AVX, WRR, Vdq, Hdq, Wdq) OPCODE(pmaxsd, LEG(66, 0F38, 0, 0x3d), SSE4_1, WRR, Vdq, Vdq, Wdq) +OPCODE(vpmaxsd, VEX(128, 66, 0F38, IG, 0x3d), AVX, WRR, Vdq, Hdq, Wdq) OPCODE(maxps, LEG(NP, 0F, 0, 0x5f), SSE, WRR, Vdq, Vdq, Wdq) +OPCODE(vmaxps, VEX(128, NP, 0F, IG, 0x5f), AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(vmaxps, VEX(256, NP, 0F, IG, 0x5f), AVX, WRR, Vqq, Hqq, Wqq) OPCODE(maxpd, LEG(66, 0F, 0, 0x5f), SSE2, WRR, Vdq, Vdq, Wdq) +OPCODE(vmaxpd, VEX(128, 66, 0F, IG, 0x5f), AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(vmaxpd, VEX(256, 66, 0F, IG, 0x5f), AVX, WRR, Vqq, Hqq, Wqq) OPCODE(maxss, LEG(F3, 0F, 0, 0x5f), SSE, WRR, Vd, Vd, Wd) +OPCODE(vmaxss, VEX(IG, F3, 0F, IG, 0x5f), AVX, WRR, Vd, Hd, Wd) OPCODE(maxsd, LEG(F2, 0F, 0, 0x5f), SSE2, WRR, Vq, Vq, Wq) +OPCODE(vmaxsd, VEX(IG, F2, 0F, IG, 0x5f), AVX, WRR, Vq, Hq, Wq) OPCODE(pavgb, LEG(NP, 0F, 0, 0xe0), SSE, WRR, Pq, Pq, Qq) OPCODE(pavgb, LEG(66, 0F, 0, 0xe0), SSE2, WRR, Vdq, Vdq, Wdq) +OPCODE(vpavgb, VEX(128, 66, 0F, IG, 0xe0), AVX, WRR, Vdq, Hdq, Wdq) OPCODE(pavgw, LEG(NP, 0F, 0, 0xe3), SSE, WRR, Pq, Pq, Qq) OPCODE(pavgw, LEG(66, 0F, 0, 0xe3), SSE2, WRR, Vdq, Vdq, Wdq) +OPCODE(vpavgw, VEX(128, 66, 0F, IG, 0xe3), AVX, WRR, Vdq, Hdq, Wdq) OPCODE(psadbw, LEG(NP, 0F, 0, 0xf6), SSE, WRR, Pq, Pq, Qq) OPCODE(psadbw, LEG(66, 0F, 0, 0xf6), SSE2, WRR, Vdq, Vdq, Wdq) +OPCODE(vpsadbw, VEX(128, 66, 0F, IG, 0xf6), AVX, WRR, Vdq, Hdq, Wdq) OPCODE(mpsadbw, LEG(66, 0F3A, 0, 0x42), SSE4_1, WRRR, Vdq, Vdq, Wdq, Ib) +OPCODE(vmpsadbw, VEX(128, 66, 0F3A, IG, 0x42), AVX, WRRR, Vdq, Hdq, Wdq, Ib) OPCODE(pabsb, LEG(NP, 0F38, 0, 0x1c), SSSE3, WR, Pq, Qq) OPCODE(pabsb, LEG(66, 0F38, 0, 0x1c), SSSE3, WR, Vdq, Wdq) +OPCODE(vpabsb, VEX(128, 66, 0F38, IG, 0x1c), AVX, WR, Vdq, Wdq) OPCODE(pabsw, LEG(NP, 0F38, 0, 0x1d), SSSE3, WR, Pq, Qq) OPCODE(pabsw, LEG(66, 0F38, 0, 0x1d), SSSE3, WR, Vdq, Wdq) +OPCODE(vpabsw, VEX(128, 66, 0F38, IG, 0x1d), AVX, WR, Vdq, Wdq) OPCODE(pabsd, LEG(NP, 0F38, 0, 0x1e), SSSE3, WR, Pq, Qq) OPCODE(pabsd, LEG(66, 0F38, 0, 0x1e), SSSE3, WR, Vdq, Wdq) +OPCODE(vpabsd, VEX(128, 66, 0F38, IG, 0x1e), AVX, WR, Vdq, Wdq) OPCODE(psignb, LEG(NP, 0F38, 0, 0x08), SSSE3, WRR, Pq, Pq, Qq) OPCODE(psignb, LEG(66, 0F38, 0, 0x08), SSSE3, WRR, Vdq, Vdq, Wdq) +OPCODE(vpsignb, VEX(128, 66, 0F38, IG, 0x08), AVX, WRR, Vdq, Hdq, Wdq) OPCODE(psignw, LEG(NP, 0F38, 0, 0x09), SSSE3, WRR, Pq, Pq, Qq) OPCODE(psignw, LEG(66, 0F38, 0, 0x09), SSSE3, WRR, Vdq, Vdq, Wdq) +OPCODE(vpsignw, VEX(128, 66, 0F38, IG, 0x09), AVX, WRR, Vdq, Hdq, Wdq) OPCODE(psignd, LEG(NP, 0F38, 0, 0x0a), SSSE3, WRR, Pq, Pq, Qq) OPCODE(psignd, LEG(66, 0F38, 0, 0x0a), SSSE3, WRR, Vdq, Vdq, Wdq) +OPCODE(vpsignd, VEX(128, 66, 0F38, IG, 0x0a), AVX, WRR, Vdq, Hdq, Wdq) OPCODE(dpps, LEG(66, 0F3A, 0, 0x40), SSE4_1, WRRR, Vdq, Vdq, Wdq, Ib) +OPCODE(vdpps, VEX(128, 66, 0F3A, IG, 0x40), AVX, WRRR, Vdq, Hdq, Wdq, Ib) +OPCODE(vdpps, VEX(256, 66, 0F3A, IG, 0x40), AVX, WRRR, Vqq, Hqq, Wqq, Ib) OPCODE(dppd, LEG(66, 0F3A, 0, 0x41), SSE4_1, WRRR, Vdq, Vdq, Wdq, Ib) +OPCODE(vdppd, VEX(128, 66, 0F3A, IG, 0x41), AVX, WRRR, Vdq, Hdq, Wdq, Ib) OPCODE(roundps, LEG(66, 0F3A, 0, 0x08), SSE4_1, WRR, Vdq, Wdq, Ib) +OPCODE(vroundps, VEX(128, 66, 0F3A, IG, 0x08), AVX, WRR, Vdq, Wdq, Ib) +OPCODE(vroundps, VEX(256, 66, 0F3A, IG, 0x08), AVX, WRR, Vqq, Wqq, Ib) OPCODE(roundpd, LEG(66, 0F3A, 0, 0x09), SSE4_1, WRR, Vdq, Wdq, Ib) +OPCODE(vroundpd, VEX(128, 66, 0F3A, IG, 0x09), AVX, WRR, Vdq, Wdq, Ib) +OPCODE(vroundpd, VEX(256, 66, 0F3A, IG, 0x09), AVX, WRR, Vqq, Wqq, Ib) OPCODE(roundss, LEG(66, 0F3A, 0, 0x0a), SSE4_1, WRR, Vd, Wd, Ib) +OPCODE(vroundss, VEX(IG, 66, 0F3A, IG, 0x0a), AVX, WRRR, Vd, Hd, Wd, Ib) OPCODE(roundsd, LEG(66, 0F3A, 0, 0x0b), SSE4_1, WRR, Vq, Wq, Ib) +OPCODE(vroundsd, VEX(IG, 66, 0F3A, IG, 0x0b), AVX, WRRR, Vq, Hq, Wq, Ib) OPCODE(aesdec, LEG(66, 0F38, 0, 0xde), AES, WRR, Vdq, Vdq, Wdq) OPCODE(vaesdec, VEX(128, 66, 0F38, IG, 0xde), AES_AVX, WRR, Vdq, Hdq, Wdq) OPCODE(aesdeclast, LEG(66, 0F38, 0, 0xdf), AES, WRR, Vdq, Vdq, Wdq) @@ -677,170 +1246,352 @@ OPCODE(pclmulqdq, LEG(66, 0F3A, 0, 0x44), PCLMULQDQ, WRRR, Vdq, Vdq, Wdq, Ib) OPCODE(vpclmulqdq, VEX(128, 66, 0F3A, IG, 0x44), PCLMULQDQ_AVX, WRRR, Vdq, Hdq, Wdq, Ib) OPCODE(pcmpeqb, LEG(NP, 0F, 0, 0x74), MMX, WRR, Pq, Pq, Qq) OPCODE(pcmpeqb, LEG(66, 0F, 0, 0x74), SSE2, WRR, Vdq, Vdq, Wdq) +OPCODE(vpcmpeqb, VEX(128, 66, 0F, IG, 0x74), AVX, WRR, Vdq, Hdq, Wdq) OPCODE(pcmpeqw, LEG(NP, 0F, 0, 0x75), MMX, WRR, Pq, Pq, Qq) OPCODE(pcmpeqw, LEG(66, 0F, 0, 0x75), SSE2, WRR, Vdq, Vdq, Wdq) +OPCODE(vpcmpeqw, VEX(128, 66, 0F, IG, 0x75), AVX, WRR, Vdq, Hdq, Wdq) OPCODE(pcmpeqd, LEG(NP, 0F, 0, 0x76), MMX, WRR, Pq, Pq, Qq) OPCODE(pcmpeqd, LEG(66, 0F, 0, 0x76), SSE2, WRR, Vdq, Vdq, Wdq) +OPCODE(vpcmpeqd, VEX(128, 66, 0F, IG, 0x76), AVX, WRR, Vdq, Hdq, Wdq) OPCODE(pcmpeqq, LEG(66, 0F38, 0, 0x29), SSE4_1, WRR, Vdq, Vdq, Wdq) +OPCODE(vpcmpeqq, VEX(128, 66, 0F38, IG, 0x29), AVX, WRR, Vdq, Hdq, Wdq) OPCODE(pcmpgtb, LEG(NP, 0F, 0, 0x64), MMX, WRR, Pq, Pq, Qq) OPCODE(pcmpgtb, LEG(66, 0F, 0, 0x64), SSE2, WRR, Vdq, Vdq, Wdq) +OPCODE(vpcmpgtb, VEX(128, 66, 0F, IG, 0x64), AVX, WRR, Vdq, Hdq, Wdq) OPCODE(pcmpgtw, LEG(NP, 0F, 0, 0x65), MMX, WRR, Pq, Pq, Qq) OPCODE(pcmpgtw, LEG(66, 0F, 0, 0x65), SSE2, WRR, Vdq, Vdq, Wdq) +OPCODE(vpcmpgtw, VEX(128, 66, 0F, IG, 0x65), AVX, WRR, Vdq, Hdq, Wdq) OPCODE(pcmpgtd, LEG(NP, 0F, 0, 0x66), MMX, WRR, Pq, Pq, Qq) OPCODE(pcmpgtd, LEG(66, 0F, 0, 0x66), SSE2, WRR, Vdq, Vdq, Wdq) +OPCODE(vpcmpgtd, VEX(128, 66, 0F, IG, 0x66), AVX, WRR, Vdq, Hdq, Wdq) OPCODE(pcmpgtq, LEG(66, 0F38, 0, 0x37), SSE4_2, WRR, Vdq, Vdq, Wdq) +OPCODE(vpcmpgtq, VEX(128, 66, 0F38, IG, 0x37), AVX, WRR, Vdq, Hdq, Wdq) OPCODE(pcmpestrm, LEG(66, 0F3A, 0, 0x60), SSE4_2, RRR, Vdq, Wdq, Ib) +OPCODE(vpcmpestrm, VEX(128, 66, 0F3A, IG, 0x60), AVX, RRR, Vdq, Wdq, Ib) OPCODE(pcmpestri, LEG(66, 0F3A, 0, 0x61), SSE4_2, RRR, Vdq, Wdq, Ib) +OPCODE(vpcmpestri, VEX(128, 66, 0F3A, IG, 0x61), AVX, RRR, Vdq, Wdq, Ib) OPCODE(pcmpistrm, LEG(66, 0F3A, 0, 0x62), SSE4_2, RRR, Vdq, Wdq, Ib) +OPCODE(vpcmpistrm, VEX(128, 66, 0F3A, IG, 0x62), AVX, RRR, Vdq, Wdq, Ib) OPCODE(pcmpistri, LEG(66, 0F3A, 0, 0x63), SSE4_2, RRR, Vdq, Wdq, Ib) +OPCODE(vpcmpistri, VEX(128, 66, 0F3A, IG, 0x63), AVX, RRR, Vdq, Wdq, Ib) OPCODE(ptest, LEG(66, 0F38, 0, 0x17), SSE4_1, RR, Vdq, Wdq) +OPCODE(vptest, VEX(128, 66, 0F38, IG, 0x17), AVX, RR, Vdq, Wdq) +OPCODE(vptest, VEX(256, 66, 0F38, IG, 0x17), AVX, RR, Vqq, Wqq) +OPCODE(vtestps, VEX(128, 66, 0F38, 0, 0x0e), AVX, RR, Vdq, Wdq) +OPCODE(vtestps, VEX(256, 66, 0F38, 0, 0x0e), AVX, RR, Vqq, Wqq) +OPCODE(vtestpd, VEX(128, 66, 0F38, 0, 0x0f), AVX, RR, Vdq, Wdq) +OPCODE(vtestpd, VEX(256, 66, 0F38, 0, 0x0f), AVX, RR, Vqq, Wqq) OPCODE(cmpps, LEG(NP, 0F, 0, 0xc2), SSE, WRRR, Vdq, Vdq, Wdq, Ib) +OPCODE(vcmpps, VEX(128, NP, 0F, IG, 0xc2), AVX, WRRR, Vdq, Hdq, Wdq, Ib) +OPCODE(vcmpps, VEX(256, NP, 0F, IG, 0xc2), AVX, WRRR, Vqq, Hqq, Wqq, Ib) OPCODE(cmppd, LEG(66, 0F, 0, 0xc2), SSE2, WRRR, Vdq, Vdq, Wdq, Ib) +OPCODE(vcmppd, VEX(128, 66, 0F, IG, 0xc2), AVX, WRRR, Vdq, Hdq, Wdq, Ib) +OPCODE(vcmppd, VEX(256, 66, 0F, IG, 0xc2), AVX, WRRR, Vqq, Hqq, Wqq, Ib) OPCODE(cmpss, LEG(F3, 0F, 0, 0xc2), SSE, WRRR, Vd, Vd, Wd, Ib) +OPCODE(vcmpss, VEX(IG, F3, 0F, IG, 0xc2), AVX, WRRR, Vd, Hd, Wd, Ib) OPCODE(cmpsd, LEG(F2, 0F, 0, 0xc2), SSE2, WRRR, Vq, Vq, Wq, Ib) +OPCODE(vcmpsd, VEX(IG, F2, 0F, IG, 0xc2), AVX, WRRR, Vq, Hq, Wq, Ib) OPCODE(ucomiss, LEG(NP, 0F, 0, 0x2e), SSE, RR, Vd, Wd) +OPCODE(vucomiss, VEX(IG, NP, 0F, IG, 0x2e), AVX, RR, Vd, Wd) OPCODE(ucomisd, LEG(66, 0F, 0, 0x2e), SSE2, RR, Vq, Wq) +OPCODE(vucomisd, VEX(IG, 66, 0F, IG, 0x2e), AVX, RR, Vq, Wq) OPCODE(comiss, LEG(NP, 0F, 0, 0x2f), SSE, RR, Vd, Wd) +OPCODE(vcomiss, VEX(IG, NP, 0F, IG, 0x2f), AVX, RR, Vd, Wd) OPCODE(comisd, LEG(66, 0F, 0, 0x2f), SSE2, RR, Vq, Wq) +OPCODE(vcomisd, VEX(IG, 66, 0F, IG, 0x2f), AVX, RR, Vq, Wq) OPCODE(pand, LEG(NP, 0F, 0, 0xdb), MMX, WRR, Pq, Pq, Qq) OPCODE(pand, LEG(66, 0F, 0, 0xdb), SSE2, WRR, Vdq, Vdq, Wdq) +OPCODE(vpand, VEX(128, 66, 0F, IG, 0xdb), AVX, WRR, Vdq, Hdq, Wdq) OPCODE(andps, LEG(NP, 0F, 0, 0x54), SSE, WRR, Vdq, Vdq, Wdq) +OPCODE(vandps, VEX(128, NP, 0F, IG, 0x54), AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(vandps, VEX(256, NP, 0F, IG, 0x54), AVX, WRR, Vqq, Hqq, Wqq) OPCODE(andpd, LEG(66, 0F, 0, 0x54), SSE2, WRR, Vdq, Vdq, Wdq) +OPCODE(vandpd, VEX(128, 66, 0F, IG, 0x54), AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(vandpd, VEX(256, 66, 0F, IG, 0x54), AVX, WRR, Vqq, Hqq, Wqq) OPCODE(pandn, LEG(NP, 0F, 0, 0xdf), MMX, WRR, Pq, Pq, Qq) OPCODE(pandn, LEG(66, 0F, 0, 0xdf), SSE2, WRR, Vdq, Vdq, Wdq) +OPCODE(vpandn, VEX(128, 66, 0F, IG, 0xdf), AVX, WRR, Vdq, Hdq, Wdq) OPCODE(andnps, LEG(NP, 0F, 0, 0x55), SSE, WRR, Vdq, Vdq, Wdq) +OPCODE(vandnps, VEX(128, NP, 0F, IG, 0x55), AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(vandnps, VEX(256, NP, 0F, IG, 0x55), AVX, WRR, Vqq, Hqq, Wqq) OPCODE(andnpd, LEG(66, 0F, 0, 0x55), SSE2, WRR, Vdq, Vdq, Wdq) +OPCODE(vandnpd, VEX(128, 66, 0F, IG, 0x55), AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(vandnpd, VEX(256, 66, 0F, IG, 0x55), AVX, WRR, Vqq, Hqq, Wqq) OPCODE(por, LEG(NP, 0F, 0, 0xeb), MMX, WRR, Pq, Pq, Qq) OPCODE(por, LEG(66, 0F, 0, 0xeb), SSE2, WRR, Vdq, Vdq, Wdq) +OPCODE(vpor, VEX(128, 66, 0F, IG, 0xeb), AVX, WRR, Vdq, Hdq, Wdq) OPCODE(orps, LEG(NP, 0F, 0, 0x56), SSE, WRR, Vdq, Vdq, Wdq) +OPCODE(vorps, VEX(128, NP, 0F, IG, 0x56), AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(vorps, VEX(256, NP, 0F, IG, 0x56), AVX, WRR, Vqq, Hqq, Wqq) OPCODE(orpd, LEG(66, 0F, 0, 0x56), SSE2, WRR, Vdq, Vdq, Wdq) +OPCODE(vorpd, VEX(128, 66, 0F, IG, 0x56), AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(vorpd, VEX(256, 66, 0F, IG, 0x56), AVX, WRR, Vqq, Hqq, Wqq) OPCODE(pxor, LEG(NP, 0F, 0, 0xef), MMX, WRR, Pq, Pq, Qq) OPCODE(pxor, LEG(66, 0F, 0, 0xef), SSE2, WRR, Vdq, Vdq, Wdq) +OPCODE(vpxor, VEX(128, 66, 0F, IG, 0xef), AVX, WRR, Vdq, Hdq, Wdq) OPCODE(xorps, LEG(NP, 0F, 0, 0x57), SSE, WRR, Vdq, Vdq, Wdq) +OPCODE(vxorps, VEX(128, NP, 0F, IG, 0x57), AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(vxorps, VEX(256, NP, 0F, IG, 0x57), AVX, WRR, Vqq, Hqq, Wqq) OPCODE(xorpd, LEG(66, 0F, 0, 0x57), SSE2, WRR, Vdq, Vdq, Wdq) +OPCODE(vxorpd, VEX(128, 66, 0F, IG, 0x57), AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(vxorpd, VEX(256, 66, 0F, IG, 0x57), AVX, WRR, Vqq, Hqq, Wqq) OPCODE(psllw, LEG(NP, 0F, 0, 0xf1), MMX, WRR, Pq, Pq, Qq) OPCODE(psllw, LEG(66, 0F, 0, 0xf1), SSE2, WRR, Vdq, Vdq, Wdq) +OPCODE(vpsllw, VEX(128, 66, 0F, IG, 0xf1), AVX, WRR, Vdq, Hdq, Wdq) OPCODE(pslld, LEG(NP, 0F, 0, 0xf2), MMX, WRR, Pq, Pq, Qq) OPCODE(pslld, LEG(66, 0F, 0, 0xf2), SSE2, WRR, Vdq, Vdq, Wdq) +OPCODE(vpslld, VEX(128, 66, 0F, IG, 0xf2), AVX, WRR, Vdq, Hdq, Wdq) OPCODE(psllq, LEG(NP, 0F, 0, 0xf3), MMX, WRR, Pq, Pq, Qq) OPCODE(psllq, LEG(66, 0F, 0, 0xf3), SSE2, WRR, Vdq, Vdq, Wdq) +OPCODE(vpsllq, VEX(128, 66, 0F, IG, 0xf3), AVX, WRR, Vdq, Hdq, Wdq) OPCODE(psrlw, LEG(NP, 0F, 0, 0xd1), MMX, WRR, Pq, Pq, Qq) OPCODE(psrlw, LEG(66, 0F, 0, 0xd1), SSE2, WRR, Vdq, Vdq, Wdq) +OPCODE(vpsrlw, VEX(128, 66, 0F, IG, 0xd1), AVX, WRR, Vdq, Hdq, Wdq) OPCODE(psrld, LEG(NP, 0F, 0, 0xd2), MMX, WRR, Pq, Pq, Qq) OPCODE(psrld, LEG(66, 0F, 0, 0xd2), SSE2, WRR, Vdq, Vdq, Wdq) +OPCODE(vpsrld, VEX(128, 66, 0F, IG, 0xd2), AVX, WRR, Vdq, Hdq, Wdq) OPCODE(psrlq, LEG(NP, 0F, 0, 0xd3), MMX, WRR, Pq, Pq, Qq) OPCODE(psrlq, LEG(66, 0F, 0, 0xd3), SSE2, WRR, Vdq, Vdq, Wdq) +OPCODE(vpsrlq, VEX(128, 66, 0F, IG, 0xd3), AVX, WRR, Vdq, Hdq, Wdq) OPCODE(psraw, LEG(NP, 0F, 0, 0xe1), MMX, WRR, Pq, Pq, Qq) OPCODE(psraw, LEG(66, 0F, 0, 0xe1), SSE2, WRR, Vdq, Vdq, Wdq) +OPCODE(vpsraw, VEX(128, 66, 0F, IG, 0xe1), AVX, WRR, Vdq, Hdq, Wdq) OPCODE(psrad, LEG(NP, 0F, 0, 0xe2), MMX, WRR, Pq, Pq, Qq) OPCODE(psrad, LEG(66, 0F, 0, 0xe2), SSE2, WRR, Vdq, Vdq, Wdq) +OPCODE(vpsrad, VEX(128, 66, 0F, IG, 0xe2), AVX, WRR, Vdq, Hdq, Wdq) OPCODE(palignr, LEG(NP, 0F3A, 0, 0x0f), SSSE3, WRRR, Pq, Pq, Qq, Ib) OPCODE(palignr, LEG(66, 0F3A, 0, 0x0f), SSSE3, WRRR, Vdq, Vdq, Wdq, Ib) +OPCODE(vpalignr, VEX(128, 66, 0F3A, IG, 0x0f), AVX, WRRR, Vdq, Hdq, Wdq, Ib) OPCODE(packsswb, LEG(NP, 0F, 0, 0x63), MMX, WRR, Pq, Pq, Qq) OPCODE(packsswb, LEG(66, 0F, 0, 0x63), SSE2, WRR, Vdq, Vdq, Wdq) +OPCODE(vpacksswb, VEX(128, 66, 0F, IG, 0x63), AVX, WRR, Vdq, Hdq, Wdq) OPCODE(packssdw, LEG(NP, 0F, 0, 0x6b), MMX, WRR, Pq, Pq, Qq) OPCODE(packssdw, LEG(66, 0F, 0, 0x6b), SSE2, WRR, Vdq, Vdq, Wdq) +OPCODE(vpackssdw, VEX(128, 66, 0F, IG, 0x6b), AVX, WRR, Vdq, Hdq, Wdq) OPCODE(packuswb, LEG(NP, 0F, 0, 0x67), MMX, WRR, Pq, Pq, Qq) OPCODE(packuswb, LEG(66, 0F, 0, 0x67), SSE2, WRR, Vdq, Vdq, Wdq) +OPCODE(vpackuswb, VEX(128, 66, 0F, IG, 0x67), AVX, WRR, Vdq, Hdq, Wdq) OPCODE(packusdw, LEG(66, 0F38, 0, 0x2b), SSE4_1, WRR, Vdq, Vdq, Wdq) +OPCODE(vpackusdw, VEX(128, 66, 0F38, IG, 0x2b), AVX, WRR, Vdq, Hdq, Wdq) OPCODE(punpckhbw, LEG(NP, 0F, 0, 0x68), MMX, WRR, Pq, Pq, Qq) OPCODE(punpckhbw, LEG(66, 0F, 0, 0x68), SSE2, WRR, Vdq, Vdq, Wdq) +OPCODE(vpunpckhbw, VEX(128, 66, 0F, IG, 0x68), AVX, WRR, Vdq, Hdq, Wdq) OPCODE(punpckhwd, LEG(NP, 0F, 0, 0x69), MMX, WRR, Pq, Pq, Qq) OPCODE(punpckhwd, LEG(66, 0F, 0, 0x69), SSE2, WRR, Vdq, Vdq, Wdq) +OPCODE(vpunpckhwd, VEX(128, 66, 0F, IG, 0x69), AVX, WRR, Vdq, Hdq, Wdq) OPCODE(punpckhdq, LEG(NP, 0F, 0, 0x6a), MMX, WRR, Pq, Pq, Qq) OPCODE(punpckhdq, LEG(66, 0F, 0, 0x6a), SSE2, WRR, Vdq, Vdq, Wdq) +OPCODE(vpunpckhdq, VEX(128, 66, 0F, IG, 0x6a), AVX, WRR, Vdq, Hdq, Wdq) OPCODE(punpckhqdq, LEG(66, 0F, 0, 0x6d), SSE2, WRR, Vdq, Vdq, Wdq) +OPCODE(vpunpckhqdq, VEX(128, 66, 0F, IG, 0x6d), AVX, WRR, Vdq, Hdq, Wdq) OPCODE(punpcklbw, LEG(NP, 0F, 0, 0x60), MMX, WRR, Pq, Pq, Qd) OPCODE(punpcklbw, LEG(66, 0F, 0, 0x60), SSE2, WRR, Vdq, Vdq, Wdq) +OPCODE(vpunpcklbw, VEX(128, 66, 0F, IG, 0x60), AVX, WRR, Vdq, Hdq, Wdq) OPCODE(punpcklwd, LEG(NP, 0F, 0, 0x61), MMX, WRR, Pq, Pq, Qd) OPCODE(punpcklwd, LEG(66, 0F, 0, 0x61), SSE2, WRR, Vdq, Vdq, Wdq) +OPCODE(vpunpcklwd, VEX(128, 66, 0F, IG, 0x61), AVX, WRR, Vdq, Hdq, Wdq) OPCODE(punpckldq, LEG(NP, 0F, 0, 0x62), MMX, WRR, Pq, Pq, Qd) OPCODE(punpckldq, LEG(66, 0F, 0, 0x62), SSE2, WRR, Vdq, Vdq, Wdq) +OPCODE(vpunpckldq, VEX(128, 66, 0F, IG, 0x62), AVX, WRR, Vdq, Hdq, Wdq) OPCODE(punpcklqdq, LEG(66, 0F, 0, 0x6c), SSE2, WRR, Vdq, Vdq, Wdq) +OPCODE(vpunpcklqdq, VEX(128, 66, 0F, IG, 0x6c), AVX, WRR, Vdq, Hdq, Wdq) OPCODE(unpcklps, LEG(NP, 0F, 0, 0x14), SSE, WRR, Vdq, Vdq, Wdq) +OPCODE(vunpcklps, VEX(128, NP, 0F, IG, 0x14), AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(vunpcklps, VEX(256, NP, 0F, IG, 0x14), AVX, WRR, Vqq, Hqq, Wqq) OPCODE(unpcklpd, LEG(66, 0F, 0, 0x14), SSE2, WRR, Vdq, Vdq, Wdq) +OPCODE(vunpcklpd, VEX(128, 66, 0F, IG, 0x14), AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(vunpcklpd, VEX(256, 66, 0F, IG, 0x14), AVX, WRR, Vqq, Hqq, Wqq) OPCODE(unpckhps, LEG(NP, 0F, 0, 0x15), SSE, WRR, Vdq, Vdq, Wdq) +OPCODE(vunpckhps, VEX(128, NP, 0F, IG, 0x15), AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(vunpckhps, VEX(256, NP, 0F, IG, 0x15), AVX, WRR, Vqq, Hqq, Wqq) OPCODE(unpckhpd, LEG(66, 0F, 0, 0x15), SSE2, WRR, Vdq, Vdq, Wdq) +OPCODE(vunpckhpd, VEX(128, 66, 0F, IG, 0x15), AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(vunpckhpd, VEX(256, 66, 0F, IG, 0x15), AVX, WRR, Vqq, Hqq, Wqq) OPCODE(pshufb, LEG(NP, 0F38, 0, 0x00), SSSE3, WRR, Pq, Pq, Qq) OPCODE(pshufb, LEG(66, 0F38, 0, 0x00), SSSE3, WRR, Vdq, Vdq, Wdq) +OPCODE(vpshufb, VEX(128, 66, 0F38, IG, 0x00), AVX, WRR, Vdq, Hdq, Wdq) OPCODE(pshufw, LEG(NP, 0F, 0, 0x70), SSE, WRR, Pq, Qq, Ib) OPCODE(pshuflw, LEG(F2, 0F, 0, 0x70), SSE2, WRR, Vdq, Wdq, Ib) +OPCODE(vpshuflw, VEX(128, F2, 0F, IG, 0x70), AVX, WRR, Vdq, Wdq, Ib) OPCODE(pshufhw, LEG(F3, 0F, 0, 0x70), SSE2, WRR, Vdq, Wdq, Ib) +OPCODE(vpshufhw, VEX(128, F3, 0F, IG, 0x70), AVX, WRR, Vdq, Wdq, Ib) OPCODE(pshufd, LEG(66, 0F, 0, 0x70), SSE2, WRR, Vdq, Wdq, Ib) +OPCODE(vpshufd, VEX(128, 66, 0F, IG, 0x70), AVX, WRR, Vdq, Wdq, Ib) OPCODE(shufps, LEG(NP, 0F, 0, 0xc6), SSE, WRRR, Vdq, Vdq, Wdq, Ib) +OPCODE(vshufps, VEX(128, NP, 0F, IG, 0xc6), AVX, WRRR, Vdq, Hdq, Wdq, Ib) +OPCODE(vshufps, VEX(256, NP, 0F, IG, 0xc6), AVX, WRRR, Vqq, Hqq, Wqq, Ib) OPCODE(shufpd, LEG(66, 0F, 0, 0xc6), SSE2, WRRR, Vdq, Vdq, Wdq, Ib) +OPCODE(vshufpd, VEX(128, 66, 0F, IG, 0xc6), AVX, WRRR, Vdq, Hdq, Wdq, Ib) +OPCODE(vshufpd, VEX(256, 66, 0F, IG, 0xc6), AVX, WRRR, Vqq, Hqq, Wqq, Ib) OPCODE(blendps, LEG(66, 0F3A, 0, 0x0c), SSE4_1, WRRR, Vdq, Vdq, Wdq, Ib) +OPCODE(vblendps, VEX(128, 66, 0F3A, IG, 0x0c), AVX, WRRR, Vdq, Hdq, Wdq, Ib) +OPCODE(vblendps, VEX(256, 66, 0F3A, IG, 0x0c), AVX, WRRR, Vqq, Hqq, Wqq, Ib) OPCODE(blendpd, LEG(66, 0F3A, 0, 0x0d), SSE4_1, WRRR, Vdq, Vdq, Wdq, Ib) +OPCODE(vblendpd, VEX(128, 66, 0F3A, IG, 0x0d), AVX, WRRR, Vdq, Hdq, Wdq, Ib) +OPCODE(vblendpd, VEX(256, 66, 0F3A, IG, 0x0d), AVX, WRRR, Vqq, Hqq, Wqq, Ib) OPCODE(blendvps, LEG(66, 0F38, 0, 0x14), SSE4_1, WRR, Vdq, Vdq, Wdq) +OPCODE(vblendvps, VEX(128, 66, 0F3A, 0, 0x4a), AVX, WRRR, Vdq, Hdq, Wdq, Ldq) +OPCODE(vblendvps, VEX(256, 66, 0F3A, 0, 0x4a), AVX, WRRR, Vqq, Hqq, Wqq, Lqq) OPCODE(blendvpd, LEG(66, 0F38, 0, 0x15), SSE4_1, WRR, Vdq, Vdq, Wdq) +OPCODE(vblendvpd, VEX(128, 66, 0F3A, 0, 0x4b), AVX, WRRR, Vdq, Hdq, Wdq, Ldq) +OPCODE(vblendvpd, VEX(256, 66, 0F3A, 0, 0x4b), AVX, WRRR, Vqq, Hqq, Wqq, Lqq) OPCODE(pblendvb, LEG(66, 0F38, 0, 0x10), SSE4_1, WRR, Vdq, Vdq, Wdq) +OPCODE(vpblendvb, VEX(128, 66, 0F3A, 0, 0x4c), AVX, WRRR, Vdq, Hdq, Wdq, Ldq) OPCODE(pblendw, LEG(66, 0F3A, 0, 0x0e), SSE4_1, WRRR, Vdq, Vdq, Wdq, Ib) +OPCODE(vpblendw, VEX(128, 66, 0F3A, IG, 0x0e), AVX, WRRR, Vdq, Hdq, Wdq, Ib) OPCODE(insertps, LEG(66, 0F3A, 0, 0x21), SSE4_1, WRRR, Vdq, Vdq, Wd, Ib) +OPCODE(vinsertps, VEX(128, 66, 0F3A, IG, 0x21), AVX, WRRR, Vdq, Hdq, Wd, Ib) OPCODE(pinsrb, LEG(66, 0F3A, 0, 0x20), SSE4_1, WRRR, Vdq, Vdq, RdMb, Ib) +OPCODE(vpinsrb, VEX(128, 66, 0F3A, 0, 0x20), AVX, WRRR, Vdq, Hdq, RdMb, Ib) OPCODE(pinsrw, LEG(NP, 0F, 0, 0xc4), SSE, WRRR, Pq, Pq, RdMw, Ib) OPCODE(pinsrw, LEG(66, 0F, 0, 0xc4), SSE2, WRRR, Vdq, Vdq, RdMw, Ib) +OPCODE(vpinsrw, VEX(128, 66, 0F, 0, 0xc4), AVX, WRRR, Vdq, Hdq, RdMw, Ib) OPCODE(pinsrd, LEG(66, 0F3A, 0, 0x22), SSE4_1, WRRR, Vdq, Vdq, Ed, Ib) +OPCODE(vpinsrd, VEX(128, 66, 0F3A, 0, 0x22), AVX, WRRR, Vdq, Hdq, Ed, Ib) OPCODE(pinsrq, LEG(66, 0F3A, 1, 0x22), SSE4_1, WRRR, Vdq, Vdq, Eq, Ib) +OPCODE(vpinsrq, VEX(128, 66, 0F3A, 1, 0x22), AVX, WRRR, Vdq, Hdq, Eq, Ib) +OPCODE(vinsertf128, VEX(256, 66, 0F3A, 0, 0x18), AVX, WRRR, Vqq, Hqq, Wdq, Ib) OPCODE(extractps, LEG(66, 0F3A, 0, 0x17), SSE4_1, WRR, Ed, Vdq, Ib) +OPCODE(vextractps, VEX(128, 66, 0F3A, IG, 0x17), AVX, WRR, Ed, Vdq, Ib) OPCODE(pextrb, LEG(66, 0F3A, 0, 0x14), SSE4_1, WRR, RdMb, Vdq, Ib) +OPCODE(vpextrb, VEX(128, 66, 0F3A, 0, 0x14), AVX, WRR, RdMb, Vdq, Ib) OPCODE(pextrw, LEG(66, 0F3A, 0, 0x15), SSE4_1, WRR, RdMw, Vdq, Ib) +OPCODE(vpextrw, VEX(128, 66, 0F3A, 0, 0x15), AVX, WRR, RdMw, Vdq, Ib) OPCODE(pextrd, LEG(66, 0F3A, 0, 0x16), SSE4_1, WRR, Ed, Vdq, Ib) +OPCODE(vpextrd, VEX(128, 66, 0F3A, 0, 0x16), AVX, WRR, Ed, Vdq, Ib) OPCODE(pextrq, LEG(66, 0F3A, 1, 0x16), SSE4_1, WRR, Eq, Vdq, Ib) +OPCODE(vpextrq, VEX(128, 66, 0F3A, 1, 0x16), AVX, WRR, Eq, Vdq, Ib) OPCODE(pextrw, LEG(NP, 0F, 0, 0xc5), SSE, WRR, Gd, Nq, Ib) OPCODE(pextrw, LEG(NP, 0F, 1, 0xc5), SSE, WRR, Gq, Nq, Ib) OPCODE(pextrw, LEG(66, 0F, 0, 0xc5), SSE2, WRR, Gd, Udq, Ib) OPCODE(pextrw, LEG(66, 0F, 1, 0xc5), SSE2, WRR, Gq, Udq, Ib) +OPCODE(vpextrw, VEX(128, 66, 0F, 0, 0xc5), AVX, WRR, Gd, Udq, Ib) +OPCODE(vpextrw, VEX(128, 66, 0F, 1, 0xc5), AVX, WRR, Gq, Udq, Ib) +OPCODE(vextractf128, VEX(256, 66, 0F3A, 0, 0x19), AVX, WRR, Wdq, Vqq, Ib) +OPCODE(vbroadcastss, VEX(128, 66, 0F38, 0, 0x18), AVX, WR, Vdq, Md) +OPCODE(vbroadcastss, VEX(256, 66, 0F38, 0, 0x18), AVX, WR, Vqq, Md) +OPCODE(vbroadcastsd, VEX(256, 66, 0F38, 0, 0x19), AVX, WR, Vqq, Mq) +OPCODE(vbroadcastf128, VEX(256, 66, 0F38, 0, 0x1a), AVX, WR, Vqq, Mdq) +OPCODE(vperm2f128, VEX(256, 66, 0F3A, 0, 0x06), AVX, WRRR, Vqq, Hqq, Wqq, Ib) +OPCODE(vpermilps, VEX(128, 66, 0F38, 0, 0x0c), AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(vpermilps, VEX(256, 66, 0F38, 0, 0x0c), AVX, WRR, Vqq, Hqq, Wqq) +OPCODE(vpermilps, VEX(128, 66, 0F3A, 0, 0x04), AVX, WRR, Vdq, Wdq, Ib) +OPCODE(vpermilps, VEX(256, 66, 0F3A, 0, 0x04), AVX, WRR, Vqq, Wqq, Ib) +OPCODE(vpermilpd, VEX(128, 66, 0F38, 0, 0x0d), AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(vpermilpd, VEX(256, 66, 0F38, 0, 0x0d), AVX, WRR, Vqq, Hqq, Wqq) +OPCODE(vpermilpd, VEX(128, 66, 0F3A, 0, 0x05), AVX, WRR, Vdq, Wdq, Ib) +OPCODE(vpermilpd, VEX(256, 66, 0F3A, 0, 0x05), AVX, WRR, Vqq, Wqq, Ib) OPCODE(pmovsxbw, LEG(66, 0F38, 0, 0x20), SSE4_1, WR, Vdq, Wq) +OPCODE(vpmovsxbw, VEX(128, 66, 0F38, IG, 0x20), AVX, WR, Vdq, Wq) OPCODE(pmovsxbd, LEG(66, 0F38, 0, 0x21), SSE4_1, WR, Vdq, Wd) +OPCODE(vpmovsxbd, VEX(128, 66, 0F38, IG, 0x21), AVX, WR, Vdq, Wd) OPCODE(pmovsxbq, LEG(66, 0F38, 0, 0x22), SSE4_1, WR, Vdq, Ww) +OPCODE(vpmovsxbq, VEX(128, 66, 0F38, IG, 0x22), AVX, WR, Vdq, Ww) OPCODE(pmovsxwd, LEG(66, 0F38, 0, 0x23), SSE4_1, WR, Vdq, Wq) +OPCODE(vpmovsxwd, VEX(128, 66, 0F38, IG, 0x23), AVX, WR, Vdq, Wq) OPCODE(pmovsxwq, LEG(66, 0F38, 0, 0x24), SSE4_1, WR, Vdq, Wd) +OPCODE(vpmovsxwq, VEX(128, 66, 0F38, IG, 0x24), AVX, WR, Vdq, Wd) OPCODE(pmovsxdq, LEG(66, 0F38, 0, 0x25), SSE4_1, WR, Vdq, Wq) +OPCODE(vpmovsxdq, VEX(128, 66, 0F38, IG, 0x25), AVX, WR, Vdq, Wq) OPCODE(pmovzxbw, LEG(66, 0F38, 0, 0x30), SSE4_1, WR, Vdq, Wq) +OPCODE(vpmovzxbw, VEX(128, 66, 0F38, IG, 0x30), AVX, WR, Vdq, Wq) OPCODE(pmovzxbd, LEG(66, 0F38, 0, 0x31), SSE4_1, WR, Vdq, Wd) +OPCODE(vpmovzxbd, VEX(128, 66, 0F38, IG, 0x31), AVX, WR, Vdq, Wd) OPCODE(pmovzxbq, LEG(66, 0F38, 0, 0x32), SSE4_1, WR, Vdq, Ww) +OPCODE(vpmovzxbq, VEX(128, 66, 0F38, IG, 0x32), AVX, WR, Vdq, Ww) OPCODE(pmovzxwd, LEG(66, 0F38, 0, 0x33), SSE4_1, WR, Vdq, Wq) +OPCODE(vpmovzxwd, VEX(128, 66, 0F38, IG, 0x33), AVX, WR, Vdq, Wq) OPCODE(pmovzxwq, LEG(66, 0F38, 0, 0x34), SSE4_1, WR, Vdq, Wd) +OPCODE(vpmovzxwq, VEX(128, 66, 0F38, IG, 0x34), AVX, WR, Vdq, Wd) OPCODE(pmovzxdq, LEG(66, 0F38, 0, 0x35), SSE4_1, WR, Vdq, Wq) +OPCODE(vpmovzxdq, VEX(128, 66, 0F38, IG, 0x35), AVX, WR, Vdq, Wq) OPCODE(cvtpi2ps, LEG(NP, 0F, 0, 0x2a), SSE, WR, Vdq, Qq) OPCODE(cvtsi2ss, LEG(F3, 0F, 0, 0x2a), SSE, WR, Vd, Ed) OPCODE(cvtsi2ss, LEG(F3, 0F, 1, 0x2a), SSE, WR, Vd, Eq) +OPCODE(vcvtsi2ss, VEX(IG, F3, 0F, 0, 0x2a), AVX, WRR, Vd, Hd, Ed) +OPCODE(vcvtsi2ss, VEX(IG, F3, 0F, 1, 0x2a), AVX, WRR, Vd, Hd, Eq) OPCODE(cvtpi2pd, LEG(66, 0F, 0, 0x2a), SSE2, WR, Vdq, Qq) OPCODE(cvtsi2sd, LEG(F2, 0F, 0, 0x2a), SSE2, WR, Vq, Ed) OPCODE(cvtsi2sd, LEG(F2, 0F, 1, 0x2a), SSE2, WR, Vq, Eq) +OPCODE(vcvtsi2sd, VEX(IG, F2, 0F, 0, 0x2a), AVX, WRR, Vq, Hq, Ed) +OPCODE(vcvtsi2sd, VEX(IG, F2, 0F, 1, 0x2a), AVX, WRR, Vq, Hq, Eq) OPCODE(cvtps2pi, LEG(NP, 0F, 0, 0x2d), SSE, WR, Pq, Wq) OPCODE(cvtss2si, LEG(F3, 0F, 0, 0x2d), SSE, WR, Gd, Wd) OPCODE(cvtss2si, LEG(F3, 0F, 1, 0x2d), SSE, WR, Gq, Wd) +OPCODE(vcvtss2si, VEX(IG, F3, 0F, 0, 0x2d), AVX, WR, Gd, Wd) +OPCODE(vcvtss2si, VEX(IG, F3, 0F, 1, 0x2d), AVX, WR, Gq, Wd) OPCODE(cvtpd2pi, LEG(66, 0F, 0, 0x2d), SSE2, WR, Pq, Wdq) OPCODE(cvtsd2si, LEG(F2, 0F, 0, 0x2d), SSE2, WR, Gd, Wq) OPCODE(cvtsd2si, LEG(F2, 0F, 1, 0x2d), SSE2, WR, Gq, Wq) +OPCODE(vcvtsd2si, VEX(IG, F2, 0F, 0, 0x2d), AVX, WR, Gd, Wq) +OPCODE(vcvtsd2si, VEX(IG, F2, 0F, 1, 0x2d), AVX, WR, Gq, Wq) OPCODE(cvttps2pi, LEG(NP, 0F, 0, 0x2c), SSE, WR, Pq, Wq) OPCODE(cvttss2si, LEG(F3, 0F, 0, 0x2c), SSE, WR, Gd, Wd) OPCODE(cvttss2si, LEG(F3, 0F, 1, 0x2c), SSE, WR, Gq, Wd) +OPCODE(vcvttss2si, VEX(IG, F3, 0F, 0, 0x2c), AVX, WR, Gd, Wd) +OPCODE(vcvttss2si, VEX(IG, F3, 0F, 1, 0x2c), AVX, WR, Gq, Wd) OPCODE(cvttpd2pi, LEG(66, 0F, 0, 0x2c), SSE2, WR, Pq, Wdq) OPCODE(cvttsd2si, LEG(F2, 0F, 0, 0x2c), SSE2, WR, Gd, Wq) OPCODE(cvttsd2si, LEG(F2, 0F, 1, 0x2c), SSE2, WR, Gq, Wq) +OPCODE(vcvttsd2si, VEX(IG, F2, 0F, 0, 0x2c), AVX, WR, Gd, Wq) +OPCODE(vcvttsd2si, VEX(IG, F2, 0F, 1, 0x2c), AVX, WR, Gq, Wq) OPCODE(cvtpd2dq, LEG(F2, 0F, 0, 0xe6), SSE2, WR, Vdq, Wdq) +OPCODE(vcvtpd2dq, VEX(128, F2, 0F, IG, 0xe6), AVX, WR, Vdq, Wdq) +OPCODE(vcvtpd2dq, VEX(256, F2, 0F, IG, 0xe6), AVX, WR, Vdq, Wqq) OPCODE(cvttpd2dq, LEG(66, 0F, 0, 0xe6), SSE2, WR, Vdq, Wdq) +OPCODE(vcvttpd2dq, VEX(128, 66, 0F, IG, 0xe6), AVX, WR, Vdq, Wdq) +OPCODE(vcvttpd2dq, VEX(256, 66, 0F, IG, 0xe6), AVX, WR, Vdq, Wqq) OPCODE(cvtdq2pd, LEG(F3, 0F, 0, 0xe6), SSE2, WR, Vdq, Wq) +OPCODE(vcvtdq2pd, VEX(128, F3, 0F, IG, 0xe6), AVX, WR, Vdq, Wq) +OPCODE(vcvtdq2pd, VEX(256, F3, 0F, IG, 0xe6), AVX, WR, Vqq, Wdq) OPCODE(cvtps2pd, LEG(NP, 0F, 0, 0x5a), SSE2, WR, Vdq, Wq) +OPCODE(vcvtps2pd, VEX(128, NP, 0F, IG, 0x5a), AVX, WR, Vdq, Wq) +OPCODE(vcvtps2pd, VEX(256, NP, 0F, IG, 0x5a), AVX, WR, Vqq, Wdq) OPCODE(cvtpd2ps, LEG(66, 0F, 0, 0x5a), SSE2, WR, Vdq, Wdq) +OPCODE(vcvtpd2ps, VEX(128, 66, 0F, IG, 0x5a), AVX, WR, Vdq, Wdq) +OPCODE(vcvtpd2ps, VEX(256, 66, 0F, IG, 0x5a), AVX, WR, Vdq, Wqq) OPCODE(cvtss2sd, LEG(F3, 0F, 0, 0x5a), SSE2, WR, Vq, Wd) +OPCODE(vcvtss2sd, VEX(IG, F3, 0F, IG, 0x5a), AVX, WRR, Vq, Hq, Wd) OPCODE(cvtsd2ss, LEG(F2, 0F, 0, 0x5a), SSE2, WR, Vd, Wq) +OPCODE(vcvtsd2ss, VEX(IG, F2, 0F, IG, 0x5a), AVX, WRR, Vd, Hd, Wq) OPCODE(cvtdq2ps, LEG(NP, 0F, 0, 0x5b), SSE2, WR, Vdq, Wdq) +OPCODE(vcvtdq2ps, VEX(128, NP, 0F, IG, 0x5b), AVX, WR, Vdq, Wdq) +OPCODE(vcvtdq2ps, VEX(256, NP, 0F, IG, 0x5b), AVX, WR, Vqq, Wqq) OPCODE(cvtps2dq, LEG(66, 0F, 0, 0x5b), SSE2, WR, Vdq, Wdq) +OPCODE(vcvtps2dq, VEX(128, 66, 0F, IG, 0x5b), AVX, WR, Vdq, Wdq) +OPCODE(vcvtps2dq, VEX(256, 66, 0F, IG, 0x5b), AVX, WR, Vqq, Wqq) OPCODE(cvttps2dq, LEG(F3, 0F, 0, 0x5b), SSE2, WR, Vdq, Wdq) +OPCODE(vcvttps2dq, VEX(128, F3, 0F, IG, 0x5b), AVX, WR, Vdq, Wdq) +OPCODE(vcvttps2dq, VEX(256, F3, 0F, IG, 0x5b), AVX, WR, Vqq, Wqq) OPCODE(maskmovq, LEG(NP, 0F, 0, 0xf7), SSE, RR, Pq, Nq) OPCODE(maskmovdqu, LEG(66, 0F, 0, 0xf7), SSE2, RR, Vdq, Udq) +OPCODE(vmaskmovdqu, VEX(128, 66, 0F, IG, 0xf7), AVX, RR, Vdq, Udq) +OPCODE(vmaskmovps, VEX(128, 66, 0F38, 0, 0x2c), AVX, WRR, Vdq, Hdq, Mdq) +OPCODE(vmaskmovps, VEX(128, 66, 0F38, 0, 0x2e), AVX, WRR, Mdq, Hdq, Vdq) +OPCODE(vmaskmovps, VEX(256, 66, 0F38, 0, 0x2c), AVX, WRR, Vqq, Hqq, Mqq) +OPCODE(vmaskmovps, VEX(256, 66, 0F38, 0, 0x2e), AVX, WRR, Mqq, Hqq, Vqq) +OPCODE(vmaskmovpd, VEX(128, 66, 0F38, 0, 0x2d), AVX, WRR, Vdq, Hdq, Mdq) +OPCODE(vmaskmovpd, VEX(128, 66, 0F38, 0, 0x2f), AVX, WRR, Mdq, Hdq, Vdq) +OPCODE(vmaskmovpd, VEX(256, 66, 0F38, 0, 0x2d), AVX, WRR, Vqq, Hqq, Mqq) +OPCODE(vmaskmovpd, VEX(256, 66, 0F38, 0, 0x2f), AVX, WRR, Mqq, Hqq, Vqq) OPCODE(movntps, LEG(NP, 0F, 0, 0x2b), SSE, WR, Mdq, Vdq) +OPCODE(vmovntps, VEX(128, NP, 0F, IG, 0x2b), AVX, WR, Mdq, Vdq) +OPCODE(vmovntps, VEX(256, NP, 0F, IG, 0x2b), AVX, WR, Mqq, Vqq) OPCODE(movntpd, LEG(66, 0F, 0, 0x2b), SSE2, WR, Mdq, Vdq) +OPCODE(vmovntpd, VEX(128, 66, 0F, IG, 0x2b), AVX, WR, Mdq, Vdq) +OPCODE(vmovntpd, VEX(256, 66, 0F, IG, 0x2b), AVX, WR, Mqq, Vqq) OPCODE(movnti, LEG(NP, 0F, 0, 0xc3), SSE2, WR, Md, Gd) OPCODE(movnti, LEG(NP, 0F, 1, 0xc3), SSE2, WR, Mq, Gq) OPCODE(movntq, LEG(NP, 0F, 0, 0xe7), SSE, WR, Mq, Pq) OPCODE(movntdq, LEG(66, 0F, 0, 0xe7), SSE2, WR, Mdq, Vdq) +OPCODE(vmovntdq, VEX(128, 66, 0F, IG, 0xe7), AVX, WR, Mdq, Vdq) +OPCODE(vmovntdq, VEX(256, 66, 0F, IG, 0xe7), AVX, WR, Mqq, Vqq) OPCODE(movntdqa, LEG(66, 0F38, 0, 0x2a), SSE4_1, WR, Vdq, Mdq) +OPCODE(vmovntdqa, VEX(128, 66, 0F38, IG, 0x2a), AVX, WR, Vdq, Mdq) OPCODE(pause, LEG(F3, NA, 0, 0x90), SSE2, ) OPCODE(emms, LEG(NP, 0F, 0, 0x77), MMX, ) +OPCODE(vzeroupper, VEX(128, NP, 0F, IG, 0x77), AVX, ) +OPCODE(vzeroall, VEX(256, NP, 0F, IG, 0x77), AVX, ) OPCODE_GRP(grp12_LEG_66, LEG(66, 0F, 0, 0x71)) OPCODE_GRP_BEGIN(grp12_LEG_66) @@ -856,6 +1607,13 @@ OPCODE_GRP_BEGIN(grp12_LEG_NP) OPCODE_GRPMEMB(grp12_LEG_NP, psraw, 4, MMX, WRR, Nq, Nq, Ib) OPCODE_GRP_END(grp12_LEG_NP) +OPCODE_GRP(grp12_VEX_128_66, VEX(128, 66, 0F, IG, 0x71)) +OPCODE_GRP_BEGIN(grp12_VEX_128_66) + OPCODE_GRPMEMB(grp12_VEX_128_66, vpsllw, 6, AVX, WRR, Hdq, Udq, Ib) + OPCODE_GRPMEMB(grp12_VEX_128_66, vpsrlw, 2, AVX, WRR, Hdq, Udq, Ib) + OPCODE_GRPMEMB(grp12_VEX_128_66, vpsraw, 4, AVX, WRR, Hdq, Udq, Ib) +OPCODE_GRP_END(grp12_VEX_128_66) + OPCODE_GRP(grp13_LEG_66, LEG(66, 0F, 0, 0x72)) OPCODE_GRP_BEGIN(grp13_LEG_66) OPCODE_GRPMEMB(grp13_LEG_66, pslld, 6, SSE2, WRR, Udq, Udq, Ib) @@ -870,6 +1628,13 @@ OPCODE_GRP_BEGIN(grp13_LEG_NP) OPCODE_GRPMEMB(grp13_LEG_NP, psrad, 4, MMX, WRR, Nq, Nq, Ib) OPCODE_GRP_END(grp13_LEG_NP) +OPCODE_GRP(grp13_VEX_128_66, VEX(128, 66, 0F, IG, 0x72)) +OPCODE_GRP_BEGIN(grp13_VEX_128_66) + OPCODE_GRPMEMB(grp13_VEX_128_66, vpslld, 6, AVX, WRR, Hdq, Udq, Ib) + OPCODE_GRPMEMB(grp13_VEX_128_66, vpsrld, 2, AVX, WRR, Hdq, Udq, Ib) + OPCODE_GRPMEMB(grp13_VEX_128_66, vpsrad, 4, AVX, WRR, Hdq, Udq, Ib) +OPCODE_GRP_END(grp13_VEX_128_66) + OPCODE_GRP(grp14_LEG_66, LEG(66, 0F, 0, 0x73)) OPCODE_GRP_BEGIN(grp14_LEG_66) OPCODE_GRPMEMB(grp14_LEG_66, psllq, 6, SSE2, WRR, Udq, Udq, Ib) @@ -884,6 +1649,14 @@ OPCODE_GRP_BEGIN(grp14_LEG_NP) OPCODE_GRPMEMB(grp14_LEG_NP, psrlq, 2, MMX, WRR, Nq, Nq, Ib) OPCODE_GRP_END(grp14_LEG_NP) +OPCODE_GRP(grp14_VEX_128_66, VEX(128, 66, 0F, IG, 0x73)) +OPCODE_GRP_BEGIN(grp14_VEX_128_66) + OPCODE_GRPMEMB(grp14_VEX_128_66, vpsllq, 6, AVX, WRR, Hdq, Udq, Ib) + OPCODE_GRPMEMB(grp14_VEX_128_66, vpslldq, 7, AVX, WRR, Hdq, Udq, Ib) + OPCODE_GRPMEMB(grp14_VEX_128_66, vpsrlq, 2, AVX, WRR, Hdq, Udq, Ib) + OPCODE_GRPMEMB(grp14_VEX_128_66, vpsrldq, 3, AVX, WRR, Hdq, Udq, Ib) +OPCODE_GRP_END(grp14_VEX_128_66) + OPCODE_GRP(grp15_LEG_NP, LEG(NP, 0F, 0, 0xae)) OPCODE_GRP_BEGIN(grp15_LEG_NP) OPCODE_GRPMEMB(grp15_LEG_NP, sfence_clflush, 7, SSE, RR, modrm_mod, modrm) @@ -893,6 +1666,12 @@ OPCODE_GRP_BEGIN(grp15_LEG_NP) OPCODE_GRPMEMB(grp15_LEG_NP, stmxcsr, 3, SSE, W, Md) OPCODE_GRP_END(grp15_LEG_NP) +OPCODE_GRP(grp15_VEX_Z_NP, VEX(Z, NP, 0F, IG, 0xae)) +OPCODE_GRP_BEGIN(grp15_VEX_Z_NP) + OPCODE_GRPMEMB(grp15_VEX_Z_NP, vldmxcsr, 2, AVX, R, Md) + OPCODE_GRPMEMB(grp15_VEX_Z_NP, vstmxcsr, 3, AVX, W, Md) +OPCODE_GRP_END(grp15_VEX_Z_NP) + OPCODE_GRP(grp16_LEG_NP, LEG(NP, 0F, 0, 0x18)) OPCODE_GRP_BEGIN(grp16_LEG_NP) OPCODE_GRPMEMB(grp16_LEG_NP, prefetcht0, 1, SSE, R, Mb) From patchwork Wed Aug 21 17:29:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Bobek X-Patchwork-Id: 11107879 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4109614DB for ; Wed, 21 Aug 2019 18:29:28 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 18D5222DD3 for ; Wed, 21 Aug 2019 18:29:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="vgryOp0h" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 18D5222DD3 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:51706 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0VMM-000805-LG for patchwork-qemu-devel@patchwork.kernel.org; Wed, 21 Aug 2019 14:29:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41433) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0URs-0001iI-Bi for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:31:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i0URq-0008Sp-Ax for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:31:04 -0400 Received: from mail-yb1-xb42.google.com ([2607:f8b0:4864:20::b42]:42622) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i0URo-0008NF-D7 for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:31:02 -0400 Received: by mail-yb1-xb42.google.com with SMTP id h8so1331449ybq.9 for ; Wed, 21 Aug 2019 10:30:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=zvMRzv39EspM75H8ERsykoJrSPB7wF2pNE1eGfQdv/M=; b=vgryOp0h1dx8F6YsuXCLKIq0/QoNylw85mlsS/78xL41RiLfDBoh2fyv5RappkSn0o 9DXDwZLyZxFWbSOmSy3Hhfs72mhi/7vqiF7hq5FBNJ41nzbh+So/jPZZ+WxzZ64PpMB8 0H0EEhnlDxMwVG+f30PYJOuQj/KgczsrcELLvuqykW5EkPiGC+bJDP02kOc8O61rhYLQ VcNDUe7hbQF1zG+KPHh5RlzcE3vdESgO2ydQifA/+EyXnpLkNiT3oVUOpGT8zBCmAmhD 0dGkbx8xJC0+ZO6LJ3N4j/0Fg95SCBF1ia/0J6XY7ZAGH1OgZCz9mE42+MQB7cb6Amid a2Ng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=zvMRzv39EspM75H8ERsykoJrSPB7wF2pNE1eGfQdv/M=; b=p7BFTbfLOhUASxTxxKyASgwkvZRLHHyr5jRdhEq6pRvFNANh0VCCiR17FDt+bkP1TM xu8JtZ67HRQ2BQGIYVQRRmlfgSpdSQg6juu8hWMCQEkN29j+SCKoX+muJcx14wYuUjah vC+55O6jZSxsvlTklPQioGuOASNojyC5vz0ZiP8mafm9LQxs0mmgtKu9Q9q4apBgHWJK Nl3m2OT4ilHQlqL2UlZtGDh6NNpJrCZTo4p4/67VltF25BKjHQfb6kuK9dxl66Uo+seb T9rLFr+b3W3WyViKcq0PjSkzVrRHku1cMLvDzAc2aQ3BifxoFLIcdw5sGICMpgenCieU hxDQ== X-Gm-Message-State: APjAAAWtDbKPH/X+G5ncU7fXc/0DOxlsE7U1bZGQbNY5RIAJJ2b5SVTT b+Ze1W4PiD9MrMp0kOxxPP4wqGa9 X-Google-Smtp-Source: APXvYqyVuuexPP63eaZERmdsmYhgExMf1FhFYzIGlVfScNS56WS5esPWqfgi44EtDZqulu9tW0v5JQ== X-Received: by 2002:a25:aa4e:: with SMTP id s72mr24947703ybi.485.1566408659162; Wed, 21 Aug 2019 10:30:59 -0700 (PDT) Received: from localhost.localdomain ([2601:c0:c67f:e390::3]) by smtp.gmail.com with ESMTPSA id l71sm2826167ywl.39.2019.08.21.10.30.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Aug 2019 10:30:58 -0700 (PDT) From: Jan Bobek To: qemu-devel@nongnu.org Date: Wed, 21 Aug 2019 13:29:38 -0400 Message-Id: <20190821172951.15333-63-jan.bobek@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190821172951.15333-1-jan.bobek@gmail.com> References: <20190821172951.15333-1-jan.bobek@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::b42 Subject: [Qemu-devel] [RFC PATCH v4 62/75] target/i386: introduce AVX2 translators X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jan Bobek , =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Use the translator macros to define translators required by AVX2 instructions. Signed-off-by: Jan Bobek --- target/i386/translate.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/target/i386/translate.c b/target/i386/translate.c index 50eab9181c..3f4bb40932 100644 --- a/target/i386/translate.c +++ b/target/i386/translate.c @@ -7692,11 +7692,11 @@ DEF_TRANSLATE_INSN2(Vd, Wd) DEF_TRANSLATE_INSN2(Vd, Wq) DEF_TRANSLATE_INSN2(Vdq, Ed) DEF_TRANSLATE_INSN2(Vdq, Eq) -DEF_TRANSLATE_INSN2(Vdq, Md) DEF_TRANSLATE_INSN2(Vdq, Mdq) DEF_TRANSLATE_INSN2(Vdq, Nq) DEF_TRANSLATE_INSN2(Vdq, Qq) DEF_TRANSLATE_INSN2(Vdq, Udq) +DEF_TRANSLATE_INSN2(Vdq, Wb) DEF_TRANSLATE_INSN2(Vdq, Wd) DEF_TRANSLATE_INSN2(Vdq, Wdq) DEF_TRANSLATE_INSN2(Vdq, Wq) @@ -7706,12 +7706,14 @@ DEF_TRANSLATE_INSN2(Vq, Ed) DEF_TRANSLATE_INSN2(Vq, Eq) DEF_TRANSLATE_INSN2(Vq, Wd) DEF_TRANSLATE_INSN2(Vq, Wq) -DEF_TRANSLATE_INSN2(Vqq, Md) DEF_TRANSLATE_INSN2(Vqq, Mdq) -DEF_TRANSLATE_INSN2(Vqq, Mq) DEF_TRANSLATE_INSN2(Vqq, Mqq) +DEF_TRANSLATE_INSN2(Vqq, Wb) +DEF_TRANSLATE_INSN2(Vqq, Wd) DEF_TRANSLATE_INSN2(Vqq, Wdq) +DEF_TRANSLATE_INSN2(Vqq, Wq) DEF_TRANSLATE_INSN2(Vqq, Wqq) +DEF_TRANSLATE_INSN2(Vqq, Ww) DEF_TRANSLATE_INSN2(Wd, Vd) DEF_TRANSLATE_INSN2(Wdq, Vdq) DEF_TRANSLATE_INSN2(Wq, Vq) @@ -7763,6 +7765,7 @@ DEF_TRANSLATE_INSN3(Gd, Udq, Ib) DEF_TRANSLATE_INSN3(Gq, Nq, Ib) DEF_TRANSLATE_INSN3(Gq, Udq, Ib) DEF_TRANSLATE_INSN3(Hdq, Udq, Ib) +DEF_TRANSLATE_INSN3(Hqq, Uqq, Ib) DEF_TRANSLATE_INSN3(Mdq, Hdq, Vdq) DEF_TRANSLATE_INSN3(Mqq, Hqq, Vqq) DEF_TRANSLATE_INSN3(Nq, Nq, Ib) @@ -7789,6 +7792,7 @@ DEF_TRANSLATE_INSN3(Vdq, Vdq, UdqMhq) DEF_TRANSLATE_INSN3(Vdq, Vdq, Wdq) DEF_TRANSLATE_INSN3(Vdq, Vq, Mq) DEF_TRANSLATE_INSN3(Vdq, Vq, Wq) +DEF_TRANSLATE_INSN3(Vdq, Wd, modrm_mod) DEF_TRANSLATE_INSN3(Vdq, Wdq, Ib) DEF_TRANSLATE_INSN3(Vq, Hq, Ed) DEF_TRANSLATE_INSN3(Vq, Hq, Eq) @@ -7797,7 +7801,10 @@ DEF_TRANSLATE_INSN3(Vq, Hq, Wq) DEF_TRANSLATE_INSN3(Vq, Vq, Wq) DEF_TRANSLATE_INSN3(Vq, Wq, Ib) DEF_TRANSLATE_INSN3(Vqq, Hqq, Mqq) +DEF_TRANSLATE_INSN3(Vqq, Hqq, Wdq) DEF_TRANSLATE_INSN3(Vqq, Hqq, Wqq) +DEF_TRANSLATE_INSN3(Vqq, Wd, modrm_mod) +DEF_TRANSLATE_INSN3(Vqq, Wq, modrm_mod) DEF_TRANSLATE_INSN3(Vqq, Wqq, Ib) DEF_TRANSLATE_INSN3(Wdq, Vqq, Ib) @@ -7921,8 +7928,14 @@ DEF_TRANSLATE_INSN4(Vqq, Hqq, Wqq, Lqq) } \ } +DEF_TRANSLATE_INSN5(Vdq, Hdq, Vdq, MDdq, Hdq) +DEF_TRANSLATE_INSN5(Vdq, Hdq, Vdq, MQdq, Hdq) +DEF_TRANSLATE_INSN5(Vdq, Hdq, Vdq, MQqq, Hdq) DEF_TRANSLATE_INSN5(Vdq, Hdq, Wd, modrm_mod, vex_v) DEF_TRANSLATE_INSN5(Vdq, Hdq, Wq, modrm_mod, vex_v) +DEF_TRANSLATE_INSN5(Vqq, Hqq, Vqq, MDdq, Hqq) +DEF_TRANSLATE_INSN5(Vqq, Hqq, Vqq, MDqq, Hqq) +DEF_TRANSLATE_INSN5(Vqq, Hqq, Vqq, MQqq, Hqq) DEF_TRANSLATE_INSN5(Wdq, Hdq, Vd, modrm_mod, vex_v) DEF_TRANSLATE_INSN5(Wdq, Hdq, Vq, modrm_mod, vex_v) From patchwork Wed Aug 21 17:29:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Bobek X-Patchwork-Id: 11108025 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AB5BC1399 for ; Wed, 21 Aug 2019 18:49:01 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 61E9A214DA for ; Wed, 21 Aug 2019 18:49:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="dAJkx+R4" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 61E9A214DA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:52866 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0VfI-0004Ij-LH for patchwork-qemu-devel@patchwork.kernel.org; Wed, 21 Aug 2019 14:49:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41566) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0URz-0001tB-4D for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:31:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i0URs-0008V7-GV for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:31:10 -0400 Received: from mail-yb1-xb41.google.com ([2607:f8b0:4864:20::b41]:32971) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i0URq-0008R0-95 for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:31:04 -0400 Received: by mail-yb1-xb41.google.com with SMTP id b16so1357689ybq.0 for ; Wed, 21 Aug 2019 10:31:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=vcpkVqHLV0kMPcYTaYpjopPrKdBPQ0gpahGAjWT5lGI=; b=dAJkx+R4p73wspvsOAGnoGTF8M7wL1VQt/gT85V9hnD4C03ij1KOXl1AJqbQXe7h9e 3OCmbzhAryPqMfqG1I9Dc3Bgy1iCfTOUUy15xybmnyG1Mkk3gdJKDRy2Pob4P/1GgZdd CV9WQTpnICGv2W5fippl6DLRTIYA4JhxtalMJY+Svfs2kDXr4Nu2n9Noi+IKlXBgpfQ8 7BNyo0+jnzLiAf4MxYA0nk1RFt42wbXtOECU5njB31emW1+ALthlsC0MbP9UT2VxbSMF d2+1vdNXa0ikrmc4t8LNQ4nByYhUJ1XdDoEfaYCwVu9ZLsJMZzd4DGyVyQD6HJdJmMVX S2rA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=vcpkVqHLV0kMPcYTaYpjopPrKdBPQ0gpahGAjWT5lGI=; b=GGqPoFY+hyJLALEppTo9ms4AxP1RNeaa2SR8jOLASjB2fdJf8nr23mJ3RetJgfm/s8 W4vQAcx3zu0I3mVjqOWaBK6/8g1JEBVCAvIME4botI/9JjWudCoBOfOPV+36R65r9eRP 6Z+j7V79WTzW8YWMonKwKBI50KpzLr06qu2ojzoaF5MfTVf790dVd+JvBpD/JNqbJ+TQ Mzhj7Z9q0B4T4UkqwpiqTE1Ure5zvhXgaMgtBaoljBgjwm/kdB2hpuXJMBOIyiOg4RQX k++Hj26mjAYAqc5oD+NI89/iqoKBnS9o8eiiqdNIhbHU8P7Z5JOHncOrpc57ARj1PQVJ oYYg== X-Gm-Message-State: APjAAAXbWIQr3AHnzWpHpWXa5VgPlW1junFH/s0qeLkgPfkJ73InzHGG /Onjt/7tZakKGftFYoufTtgv/KMB X-Google-Smtp-Source: APXvYqxDLfGCQQyTuRzshzgIP6of6qPM0xdweA3zD+e6EXeeUBWpuXkk+1pmOrp+oftfI4hMdbs1ow== X-Received: by 2002:a25:2bc8:: with SMTP id r191mr24059684ybr.327.1566408660229; Wed, 21 Aug 2019 10:31:00 -0700 (PDT) Received: from localhost.localdomain ([2601:c0:c67f:e390::3]) by smtp.gmail.com with ESMTPSA id l71sm2826167ywl.39.2019.08.21.10.30.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Aug 2019 10:30:59 -0700 (PDT) From: Jan Bobek To: qemu-devel@nongnu.org Date: Wed, 21 Aug 2019 13:29:39 -0400 Message-Id: <20190821172951.15333-64-jan.bobek@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190821172951.15333-1-jan.bobek@gmail.com> References: <20190821172951.15333-1-jan.bobek@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::b41 Subject: [Qemu-devel] [RFC PATCH v4 63/75] target/i386: introduce AVX2 code generators X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jan Bobek , =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Introduce code generators required by AVX2 instructions. Signed-off-by: Jan Bobek --- target/i386/translate.c | 407 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 395 insertions(+), 12 deletions(-) diff --git a/target/i386/translate.c b/target/i386/translate.c index 3f4bb40932..3149989d68 100644 --- a/target/i386/translate.c +++ b/target/i386/translate.c @@ -4946,6 +4946,11 @@ DEF_INSNOP_ALIAS(Mhq, M) DEF_INSNOP_ALIAS(Mdq, M) DEF_INSNOP_ALIAS(Mqq, M) +DEF_INSNOP_ALIAS(MDdq, M) +DEF_INSNOP_ALIAS(MDqq, M) +DEF_INSNOP_ALIAS(MQdq, M) +DEF_INSNOP_ALIAS(MQqq, M) + /* * 32-bit general register operands */ @@ -5907,6 +5912,14 @@ GEN_INSN2(vpmovmskb, Gq, Udq) tcg_gen_extu_i32_i64(arg1, arg1_r32); tcg_temp_free_i32(arg1_r32); } +DEF_GEN_INSN2_HELPER_DEP(vpmovmskb, pmovmskb_xmm, Gd, Uqq) +GEN_INSN2(vpmovmskb, Gq, Uqq) +{ + const TCGv_i32 arg1_r32 = tcg_temp_new_i32(); + gen_insn2(vpmovmskb, Gd, Uqq)(env, s, arg1_r32, arg2); + tcg_gen_extu_i32_i64(arg1, arg1_r32); + tcg_temp_free_i32(arg1_r32); +} DEF_GEN_INSN2_HELPER_DEP(movmskps, movmskps, Gd, Udq) GEN_INSN2(movmskps, Gq, Udq) @@ -6049,27 +6062,35 @@ GEN_INSN2(vmovddup, Vqq, Wqq) DEF_GEN_INSN3_GVEC(paddb, Pq, Pq, Qq, add, MM_OPRSZ, MM_MAXSZ, MO_8) DEF_GEN_INSN3_GVEC(paddb, Vdq, Vdq, Wdq, add, XMM_OPRSZ, XMM_MAXSZ, MO_8) DEF_GEN_INSN3_GVEC(vpaddb, Vdq, Hdq, Wdq, add, XMM_OPRSZ, XMM_MAXSZ, MO_8) +DEF_GEN_INSN3_GVEC(vpaddb, Vqq, Hqq, Wqq, add, XMM_OPRSZ, XMM_MAXSZ, MO_8) DEF_GEN_INSN3_GVEC(paddw, Pq, Pq, Qq, add, MM_OPRSZ, MM_MAXSZ, MO_16) DEF_GEN_INSN3_GVEC(paddw, Vdq, Vdq, Wdq, add, XMM_OPRSZ, XMM_MAXSZ, MO_16) DEF_GEN_INSN3_GVEC(vpaddw, Vdq, Hdq, Wdq, add, XMM_OPRSZ, XMM_MAXSZ, MO_16) +DEF_GEN_INSN3_GVEC(vpaddw, Vqq, Hqq, Wqq, add, XMM_OPRSZ, XMM_MAXSZ, MO_16) DEF_GEN_INSN3_GVEC(paddd, Pq, Pq, Qq, add, MM_OPRSZ, MM_MAXSZ, MO_32) DEF_GEN_INSN3_GVEC(paddd, Vdq, Vdq, Wdq, add, XMM_OPRSZ, XMM_MAXSZ, MO_32) DEF_GEN_INSN3_GVEC(vpaddd, Vdq, Hdq, Wdq, add, XMM_OPRSZ, XMM_MAXSZ, MO_32) +DEF_GEN_INSN3_GVEC(vpaddd, Vqq, Hqq, Wqq, add, XMM_OPRSZ, XMM_MAXSZ, MO_32) DEF_GEN_INSN3_GVEC(paddq, Pq, Pq, Qq, add, MM_OPRSZ, MM_MAXSZ, MO_64) DEF_GEN_INSN3_GVEC(paddq, Vdq, Vdq, Wdq, add, XMM_OPRSZ, XMM_MAXSZ, MO_64) DEF_GEN_INSN3_GVEC(vpaddq, Vdq, Hdq, Wdq, add, XMM_OPRSZ, XMM_MAXSZ, MO_64) +DEF_GEN_INSN3_GVEC(vpaddq, Vqq, Hqq, Wqq, add, XMM_OPRSZ, XMM_MAXSZ, MO_64) DEF_GEN_INSN3_GVEC(paddsb, Pq, Pq, Qq, ssadd, MM_OPRSZ, MM_MAXSZ, MO_8) DEF_GEN_INSN3_GVEC(paddsb, Vdq, Vdq, Wdq, ssadd, XMM_OPRSZ, XMM_MAXSZ, MO_8) DEF_GEN_INSN3_GVEC(vpaddsb, Vdq, Hdq, Wdq, ssadd, XMM_OPRSZ, XMM_MAXSZ, MO_8) +DEF_GEN_INSN3_GVEC(vpaddsb, Vqq, Hqq, Wqq, ssadd, XMM_OPRSZ, XMM_MAXSZ, MO_8) DEF_GEN_INSN3_GVEC(paddsw, Pq, Pq, Qq, ssadd, MM_OPRSZ, MM_MAXSZ, MO_16) DEF_GEN_INSN3_GVEC(paddsw, Vdq, Vdq, Wdq, ssadd, XMM_OPRSZ, XMM_MAXSZ, MO_16) DEF_GEN_INSN3_GVEC(vpaddsw, Vdq, Hdq, Wdq, ssadd, XMM_OPRSZ, XMM_MAXSZ, MO_16) +DEF_GEN_INSN3_GVEC(vpaddsw, Vqq, Hqq, Wqq, ssadd, XMM_OPRSZ, XMM_MAXSZ, MO_16) DEF_GEN_INSN3_GVEC(paddusb, Pq, Pq, Qq, usadd, MM_OPRSZ, MM_MAXSZ, MO_8) DEF_GEN_INSN3_GVEC(paddusb, Vdq, Vdq, Wdq, usadd, XMM_OPRSZ, XMM_MAXSZ, MO_8) DEF_GEN_INSN3_GVEC(vpaddusb, Vdq, Hdq, Wdq, usadd, XMM_OPRSZ, XMM_MAXSZ, MO_8) +DEF_GEN_INSN3_GVEC(vpaddusb, Vqq, Hqq, Wqq, usadd, XMM_OPRSZ, XMM_MAXSZ, MO_8) DEF_GEN_INSN3_GVEC(paddusw, Pq, Pq, Qq, usadd, MM_OPRSZ, MM_MAXSZ, MO_16) DEF_GEN_INSN3_GVEC(paddusw, Vdq, Vdq, Wdq, usadd, XMM_OPRSZ, XMM_MAXSZ, MO_16) DEF_GEN_INSN3_GVEC(vpaddusw, Vdq, Hdq, Wdq, usadd, XMM_OPRSZ, XMM_MAXSZ, MO_16) +DEF_GEN_INSN3_GVEC(vpaddusw, Vqq, Hqq, Wqq, usadd, XMM_OPRSZ, XMM_MAXSZ, MO_16) DEF_GEN_INSN3_HELPER_EPP(addps, addps, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(vaddps, addps, Vdq, Hdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(vaddps, addps, Vqq, Hqq, Wqq) @@ -6083,12 +6104,15 @@ DEF_GEN_INSN3_HELPER_EPP(vaddsd, addsd, Vq, Hq, Wq) DEF_GEN_INSN3_HELPER_EPP(phaddw, phaddw_mmx, Pq, Pq, Qq) DEF_GEN_INSN3_HELPER_EPP(phaddw, phaddw_xmm, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(vphaddw, phaddw_xmm, Vdq, Hdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vphaddw, phaddw_xmm, Vqq, Hqq, Wqq) DEF_GEN_INSN3_HELPER_EPP(phaddd, phaddd_mmx, Pq, Pq, Qq) DEF_GEN_INSN3_HELPER_EPP(phaddd, phaddd_xmm, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(vphaddd, phaddd_xmm, Vdq, Hdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vphaddd, phaddd_xmm, Vqq, Hqq, Wqq) DEF_GEN_INSN3_HELPER_EPP(phaddsw, phaddsw_mmx, Pq, Pq, Qq) DEF_GEN_INSN3_HELPER_EPP(phaddsw, phaddsw_xmm, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(vphaddsw, phaddsw_xmm, Vdq, Hdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vphaddsw, phaddsw_xmm, Vqq, Hqq, Wqq) DEF_GEN_INSN3_HELPER_EPP(haddps, haddps, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(vhaddps, haddps, Vdq, Hdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(vhaddps, haddps, Vqq, Hqq, Wqq) @@ -6099,27 +6123,35 @@ DEF_GEN_INSN3_HELPER_EPP(vhaddpd, haddpd, Vqq, Hqq, Wqq) DEF_GEN_INSN3_GVEC(psubb, Pq, Pq, Qq, sub, MM_OPRSZ, MM_MAXSZ, MO_8) DEF_GEN_INSN3_GVEC(psubb, Vdq, Vdq, Wdq, sub, XMM_OPRSZ, XMM_MAXSZ, MO_8) DEF_GEN_INSN3_GVEC(vpsubb, Vdq, Hdq, Wdq, sub, XMM_OPRSZ, XMM_MAXSZ, MO_8) +DEF_GEN_INSN3_GVEC(vpsubb, Vqq, Hqq, Wqq, sub, XMM_OPRSZ, XMM_MAXSZ, MO_8) DEF_GEN_INSN3_GVEC(psubw, Pq, Pq, Qq, sub, MM_OPRSZ, MM_MAXSZ, MO_16) DEF_GEN_INSN3_GVEC(psubw, Vdq, Vdq, Wdq, sub, XMM_OPRSZ, XMM_MAXSZ, MO_16) DEF_GEN_INSN3_GVEC(vpsubw, Vdq, Hdq, Wdq, sub, XMM_OPRSZ, XMM_MAXSZ, MO_16) +DEF_GEN_INSN3_GVEC(vpsubw, Vqq, Hqq, Wqq, sub, XMM_OPRSZ, XMM_MAXSZ, MO_16) DEF_GEN_INSN3_GVEC(psubd, Pq, Pq, Qq, sub, MM_OPRSZ, MM_MAXSZ, MO_32) DEF_GEN_INSN3_GVEC(psubd, Vdq, Vdq, Wdq, sub, XMM_OPRSZ, XMM_MAXSZ, MO_32) DEF_GEN_INSN3_GVEC(vpsubd, Vdq, Hdq, Wdq, sub, XMM_OPRSZ, XMM_MAXSZ, MO_32) +DEF_GEN_INSN3_GVEC(vpsubd, Vqq, Hqq, Wqq, sub, XMM_OPRSZ, XMM_MAXSZ, MO_32) DEF_GEN_INSN3_GVEC(psubq, Pq, Pq, Qq, sub, MM_OPRSZ, MM_MAXSZ, MO_64) DEF_GEN_INSN3_GVEC(psubq, Vdq, Vdq, Wdq, sub, XMM_OPRSZ, XMM_MAXSZ, MO_64) DEF_GEN_INSN3_GVEC(vpsubq, Vdq, Hdq, Wdq, sub, XMM_OPRSZ, XMM_MAXSZ, MO_64) +DEF_GEN_INSN3_GVEC(vpsubq, Vqq, Hqq, Wqq, sub, XMM_OPRSZ, XMM_MAXSZ, MO_64) DEF_GEN_INSN3_GVEC(psubsb, Pq, Pq, Qq, sssub, MM_OPRSZ, MM_MAXSZ, MO_8) DEF_GEN_INSN3_GVEC(psubsb, Vdq, Vdq, Wdq, sssub, XMM_OPRSZ, XMM_MAXSZ, MO_8) DEF_GEN_INSN3_GVEC(vpsubsb, Vdq, Hdq, Wdq, sssub, XMM_OPRSZ, XMM_MAXSZ, MO_8) +DEF_GEN_INSN3_GVEC(vpsubsb, Vqq, Hqq, Wqq, sssub, XMM_OPRSZ, XMM_MAXSZ, MO_8) DEF_GEN_INSN3_GVEC(psubsw, Pq, Pq, Qq, sssub, MM_OPRSZ, MM_MAXSZ, MO_16) DEF_GEN_INSN3_GVEC(psubsw, Vdq, Vdq, Wdq, sssub, XMM_OPRSZ, XMM_MAXSZ, MO_16) DEF_GEN_INSN3_GVEC(vpsubsw, Vdq, Hdq, Wdq, sssub, XMM_OPRSZ, XMM_MAXSZ, MO_16) +DEF_GEN_INSN3_GVEC(vpsubsw, Vqq, Hqq, Wqq, sssub, XMM_OPRSZ, XMM_MAXSZ, MO_16) DEF_GEN_INSN3_GVEC(psubusb, Pq, Pq, Qq, ussub, MM_OPRSZ, MM_MAXSZ, MO_8) DEF_GEN_INSN3_GVEC(psubusb, Vdq, Vdq, Wdq, ussub, XMM_OPRSZ, XMM_MAXSZ, MO_8) DEF_GEN_INSN3_GVEC(vpsubusb, Vdq, Hdq, Wdq, ussub, XMM_OPRSZ, XMM_MAXSZ, MO_8) +DEF_GEN_INSN3_GVEC(vpsubusb, Vqq, Hqq, Wqq, ussub, XMM_OPRSZ, XMM_MAXSZ, MO_8) DEF_GEN_INSN3_GVEC(psubusw, Pq, Pq, Qq, ussub, MM_OPRSZ, MM_MAXSZ, MO_16) DEF_GEN_INSN3_GVEC(psubusw, Vdq, Vdq, Wdq, ussub, XMM_OPRSZ, XMM_MAXSZ, MO_16) DEF_GEN_INSN3_GVEC(vpsubusw, Vdq, Hdq, Wdq, ussub, XMM_OPRSZ, XMM_MAXSZ, MO_16) +DEF_GEN_INSN3_GVEC(vpsubusw, Vqq, Hqq, Wqq, ussub, XMM_OPRSZ, XMM_MAXSZ, MO_16) DEF_GEN_INSN3_HELPER_EPP(subps, subps, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(vsubps, subps, Vdq, Hdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(vsubps, subps, Vqq, Hqq, Wqq) @@ -6133,12 +6165,15 @@ DEF_GEN_INSN3_HELPER_EPP(vsubsd, subsd, Vq, Hq, Wq) DEF_GEN_INSN3_HELPER_EPP(phsubw, phsubw_mmx, Pq, Pq, Qq) DEF_GEN_INSN3_HELPER_EPP(phsubw, phsubw_xmm, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(vphsubw, phsubw_xmm, Vdq, Hdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vphsubw, phsubw_xmm, Vqq, Hqq, Wqq) DEF_GEN_INSN3_HELPER_EPP(phsubd, phsubd_mmx, Pq, Pq, Qq) DEF_GEN_INSN3_HELPER_EPP(phsubd, phsubd_xmm, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(vphsubd, phsubd_xmm, Vdq, Hdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vphsubd, phsubd_xmm, Vqq, Hqq, Wqq) DEF_GEN_INSN3_HELPER_EPP(phsubsw, phsubsw_mmx, Pq, Pq, Qq) DEF_GEN_INSN3_HELPER_EPP(phsubsw, phsubsw_xmm, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(vphsubsw, phsubsw_xmm, Vdq, Hdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vphsubsw, phsubsw_xmm, Vqq, Hqq, Wqq) DEF_GEN_INSN3_HELPER_EPP(hsubps, hsubps, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(vhsubps, hsubps, Vdq, Hdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(vhsubps, hsubps, Vqq, Hqq, Wqq) @@ -6156,22 +6191,29 @@ DEF_GEN_INSN3_HELPER_EPP(vaddsubpd, addsubpd, Vqq, Hqq, Wqq) DEF_GEN_INSN3_HELPER_EPP(pmullw, pmullw_mmx, Pq, Pq, Qq) DEF_GEN_INSN3_HELPER_EPP(pmullw, pmullw_xmm, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(vpmullw, pmullw_xmm, Vdq, Hdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vpmullw, pmullw_xmm, Vqq, Hqq, Wqq) DEF_GEN_INSN3_HELPER_EPP(pmulld, pmulld_xmm, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(vpmulld, pmulld_xmm, Vdq, Hdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vpmulld, pmulld_xmm, Vqq, Hqq, Wqq) DEF_GEN_INSN3_HELPER_EPP(pmulhw, pmulhw_mmx, Pq, Pq, Qq) DEF_GEN_INSN3_HELPER_EPP(pmulhw, pmulhw_xmm, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(vpmulhw, pmulhw_xmm, Vdq, Hdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vpmulhw, pmulhw_xmm, Vqq, Hqq, Wqq) DEF_GEN_INSN3_HELPER_EPP(pmulhuw, pmulhuw_mmx, Pq, Pq, Qq) DEF_GEN_INSN3_HELPER_EPP(pmulhuw, pmulhuw_xmm, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(vpmulhuw, pmulhuw_xmm, Vdq, Hdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vpmulhuw, pmulhuw_xmm, Vqq, Hqq, Wqq) DEF_GEN_INSN3_HELPER_EPP(pmuldq, pmuldq_xmm, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(vpmuldq, pmuldq_xmm, Vdq, Hdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vpmuldq, pmuldq_xmm, Vqq, Hqq, Wqq) DEF_GEN_INSN3_HELPER_EPP(pmuludq, pmuludq_mmx, Pq, Pq, Qq) DEF_GEN_INSN3_HELPER_EPP(pmuludq, pmuludq_xmm, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(vpmuludq, pmuludq_xmm, Vdq, Hdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vpmuludq, pmuludq_xmm, Vqq, Hqq, Wqq) DEF_GEN_INSN3_HELPER_EPP(pmulhrsw, pmulhrsw_mmx, Pq, Pq, Qq) DEF_GEN_INSN3_HELPER_EPP(pmulhrsw, pmulhrsw_xmm, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(vpmulhrsw, pmulhrsw_xmm, Vdq, Hdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vpmulhrsw, pmulhrsw_xmm, Vqq, Hqq, Wqq) DEF_GEN_INSN3_HELPER_EPP(mulps, mulps, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(vmulps, mulps, Vdq, Hdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(vmulps, mulps, Vqq, Hqq, Wqq) @@ -6185,9 +6227,11 @@ DEF_GEN_INSN3_HELPER_EPP(vmulsd, mulsd, Vq, Hq, Wq) DEF_GEN_INSN3_HELPER_EPP(pmaddwd, pmaddwd_mmx, Pq, Pq, Qq) DEF_GEN_INSN3_HELPER_EPP(pmaddwd, pmaddwd_xmm, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(vpmaddwd, pmaddwd_xmm, Vdq, Hdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vpmaddwd, pmaddwd_xmm, Vqq, Hqq, Wqq) DEF_GEN_INSN3_HELPER_EPP(pmaddubsw, pmaddubsw_mmx, Pq, Pq, Qq) DEF_GEN_INSN3_HELPER_EPP(pmaddubsw, pmaddubsw_xmm, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(vpmaddubsw, pmaddubsw_xmm, Vdq, Hdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vpmaddubsw, pmaddubsw_xmm, Vqq, Hqq, Wqq) DEF_GEN_INSN3_HELPER_EPP(divps, divps, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(vdivps, divps, Vdq, Hdq, Wdq) @@ -6224,17 +6268,23 @@ DEF_GEN_INSN3_HELPER_EPP(vrsqrtss, rsqrtss, Vd, Hd, Wd) DEF_GEN_INSN3_GVEC(pminub, Pq, Pq, Qq, umin, MM_OPRSZ, MM_MAXSZ, MO_8) DEF_GEN_INSN3_GVEC(pminub, Vdq, Vdq, Wdq, umin, XMM_OPRSZ, XMM_MAXSZ, MO_8) DEF_GEN_INSN3_GVEC(vpminub, Vdq, Hdq, Wdq, umin, XMM_OPRSZ, XMM_MAXSZ, MO_8) +DEF_GEN_INSN3_GVEC(vpminub, Vqq, Hqq, Wqq, umin, XMM_OPRSZ, XMM_MAXSZ, MO_8) DEF_GEN_INSN3_GVEC(pminuw, Vdq, Vdq, Wdq, umin, XMM_OPRSZ, XMM_MAXSZ, MO_16) DEF_GEN_INSN3_GVEC(vpminuw, Vdq, Hdq, Wdq, umin, XMM_OPRSZ, XMM_MAXSZ, MO_16) +DEF_GEN_INSN3_GVEC(vpminuw, Vqq, Hqq, Wqq, umin, XMM_OPRSZ, XMM_MAXSZ, MO_16) DEF_GEN_INSN3_GVEC(pminud, Vdq, Vdq, Wdq, umin, XMM_OPRSZ, XMM_MAXSZ, MO_32) DEF_GEN_INSN3_GVEC(vpminud, Vdq, Hdq, Wdq, umin, XMM_OPRSZ, XMM_MAXSZ, MO_32) +DEF_GEN_INSN3_GVEC(vpminud, Vqq, Hqq, Wqq, umin, XMM_OPRSZ, XMM_MAXSZ, MO_32) DEF_GEN_INSN3_GVEC(pminsb, Vdq, Vdq, Wdq, smin, XMM_OPRSZ, XMM_MAXSZ, MO_8) DEF_GEN_INSN3_GVEC(vpminsb, Vdq, Hdq, Wdq, smin, XMM_OPRSZ, XMM_MAXSZ, MO_8) +DEF_GEN_INSN3_GVEC(vpminsb, Vqq, Hqq, Wqq, smin, XMM_OPRSZ, XMM_MAXSZ, MO_8) DEF_GEN_INSN3_GVEC(pminsw, Pq, Pq, Qq, smin, MM_OPRSZ, MM_MAXSZ, MO_16) DEF_GEN_INSN3_GVEC(pminsw, Vdq, Vdq, Wdq, smin, XMM_OPRSZ, XMM_MAXSZ, MO_16) DEF_GEN_INSN3_GVEC(vpminsw, Vdq, Hdq, Wdq, smin, XMM_OPRSZ, XMM_MAXSZ, MO_16) +DEF_GEN_INSN3_GVEC(vpminsw, Vqq, Hqq, Wqq, smin, XMM_OPRSZ, XMM_MAXSZ, MO_16) DEF_GEN_INSN3_GVEC(pminsd, Vdq, Vdq, Wdq, smin, XMM_OPRSZ, XMM_MAXSZ, MO_32) DEF_GEN_INSN3_GVEC(vpminsd, Vdq, Hdq, Wdq, smin, XMM_OPRSZ, XMM_MAXSZ, MO_32) +DEF_GEN_INSN3_GVEC(vpminsd, Vqq, Hqq, Wqq, smin, XMM_OPRSZ, XMM_MAXSZ, MO_32) DEF_GEN_INSN3_HELPER_EPP(minps, minps, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(vminps, minps, Vdq, Hdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(vminps, minps, Vqq, Hqq, Wqq) @@ -6250,17 +6300,23 @@ DEF_GEN_INSN2_HELPER_EPP(vphminposuw, phminposuw_xmm, Vdq, Wdq) DEF_GEN_INSN3_GVEC(pmaxub, Pq, Pq, Qq, umax, MM_OPRSZ, MM_MAXSZ, MO_8) DEF_GEN_INSN3_GVEC(pmaxub, Vdq, Vdq, Wdq, umax, XMM_OPRSZ, XMM_MAXSZ, MO_8) DEF_GEN_INSN3_GVEC(vpmaxub, Vdq, Hdq, Wdq, umax, XMM_OPRSZ, XMM_MAXSZ, MO_8) +DEF_GEN_INSN3_GVEC(vpmaxub, Vqq, Hqq, Wqq, umax, XMM_OPRSZ, XMM_MAXSZ, MO_8) DEF_GEN_INSN3_GVEC(pmaxuw, Vdq, Vdq, Wdq, umax, XMM_OPRSZ, XMM_MAXSZ, MO_16) DEF_GEN_INSN3_GVEC(vpmaxuw, Vdq, Hdq, Wdq, umax, XMM_OPRSZ, XMM_MAXSZ, MO_16) +DEF_GEN_INSN3_GVEC(vpmaxuw, Vqq, Hqq, Wqq, umax, XMM_OPRSZ, XMM_MAXSZ, MO_16) DEF_GEN_INSN3_GVEC(pmaxud, Vdq, Vdq, Wdq, umax, XMM_OPRSZ, XMM_MAXSZ, MO_32) DEF_GEN_INSN3_GVEC(vpmaxud, Vdq, Hdq, Wdq, umax, XMM_OPRSZ, XMM_MAXSZ, MO_32) +DEF_GEN_INSN3_GVEC(vpmaxud, Vqq, Hqq, Wqq, umax, XMM_OPRSZ, XMM_MAXSZ, MO_32) DEF_GEN_INSN3_GVEC(pmaxsb, Vdq, Vdq, Wdq, smax, XMM_OPRSZ, XMM_MAXSZ, MO_8) DEF_GEN_INSN3_GVEC(vpmaxsb, Vdq, Hdq, Wdq, smax, XMM_OPRSZ, XMM_MAXSZ, MO_8) +DEF_GEN_INSN3_GVEC(vpmaxsb, Vqq, Hqq, Wqq, smax, XMM_OPRSZ, XMM_MAXSZ, MO_8) DEF_GEN_INSN3_GVEC(pmaxsw, Pq, Pq, Qq, smax, MM_OPRSZ, MM_MAXSZ, MO_16) DEF_GEN_INSN3_GVEC(pmaxsw, Vdq, Vdq, Wdq, smax, XMM_OPRSZ, XMM_MAXSZ, MO_16) DEF_GEN_INSN3_GVEC(vpmaxsw, Vdq, Hdq, Wdq, smax, XMM_OPRSZ, XMM_MAXSZ, MO_16) +DEF_GEN_INSN3_GVEC(vpmaxsw, Vqq, Hqq, Wqq, smax, XMM_OPRSZ, XMM_MAXSZ, MO_16) DEF_GEN_INSN3_GVEC(pmaxsd, Vdq, Vdq, Wdq, smax, XMM_OPRSZ, XMM_MAXSZ, MO_32) DEF_GEN_INSN3_GVEC(vpmaxsd, Vdq, Hdq, Wdq, smax, XMM_OPRSZ, XMM_MAXSZ, MO_32) +DEF_GEN_INSN3_GVEC(vpmaxsd, Vqq, Hqq, Wqq, smax, XMM_OPRSZ, XMM_MAXSZ, MO_32) DEF_GEN_INSN3_HELPER_EPP(maxps, maxps, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(vmaxps, maxps, Vdq, Hdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(vmaxps, maxps, Vqq, Hqq, Wqq) @@ -6274,32 +6330,42 @@ DEF_GEN_INSN3_HELPER_EPP(vmaxsd, maxsd, Vq, Hq, Wq) DEF_GEN_INSN3_HELPER_EPP(pavgb, pavgb_mmx, Pq, Pq, Qq) DEF_GEN_INSN3_HELPER_EPP(pavgb, pavgb_xmm, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(vpavgb, pavgb_xmm, Vdq, Hdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vpavgb, pavgb_xmm, Vqq, Hqq, Wqq) DEF_GEN_INSN3_HELPER_EPP(pavgw, pavgw_mmx, Pq, Pq, Qq) DEF_GEN_INSN3_HELPER_EPP(pavgw, pavgw_xmm, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(vpavgw, pavgw_xmm, Vdq, Hdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vpavgw, pavgw_xmm, Vqq, Hqq, Wqq) DEF_GEN_INSN3_HELPER_EPP(psadbw, psadbw_mmx, Pq, Pq, Qq) DEF_GEN_INSN3_HELPER_EPP(psadbw, psadbw_xmm, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(vpsadbw, psadbw_xmm, Vdq, Hdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vpsadbw, psadbw_xmm, Vqq, Hqq, Wqq) DEF_GEN_INSN4_HELPER_EPPI(mpsadbw, mpsadbw_xmm, Vdq, Vdq, Wdq, Ib) DEF_GEN_INSN4_HELPER_EPPI(vmpsadbw, mpsadbw_xmm, Vdq, Hdq, Wdq, Ib) +DEF_GEN_INSN4_HELPER_EPPI(vmpsadbw, mpsadbw_xmm, Vqq, Hqq, Wqq, Ib) DEF_GEN_INSN2_HELPER_EPP(pabsb, pabsb_mmx, Pq, Qq) DEF_GEN_INSN2_HELPER_EPP(pabsb, pabsb_xmm, Vdq, Wdq) DEF_GEN_INSN2_HELPER_EPP(vpabsb, pabsb_xmm, Vdq, Wdq) +DEF_GEN_INSN2_HELPER_EPP(vpabsb, pabsb_xmm, Vqq, Wqq) DEF_GEN_INSN2_HELPER_EPP(pabsw, pabsw_mmx, Pq, Qq) DEF_GEN_INSN2_HELPER_EPP(pabsw, pabsw_xmm, Vdq, Wdq) DEF_GEN_INSN2_HELPER_EPP(vpabsw, pabsw_xmm, Vdq, Wdq) +DEF_GEN_INSN2_HELPER_EPP(vpabsw, pabsw_xmm, Vqq, Wqq) DEF_GEN_INSN2_HELPER_EPP(pabsd, pabsd_mmx, Pq, Qq) DEF_GEN_INSN2_HELPER_EPP(pabsd, pabsd_xmm, Vdq, Wdq) DEF_GEN_INSN2_HELPER_EPP(vpabsd, pabsd_xmm, Vdq, Wdq) +DEF_GEN_INSN2_HELPER_EPP(vpabsd, pabsd_xmm, Vqq, Wqq) DEF_GEN_INSN3_HELPER_EPP(psignb, psignb_mmx, Pq, Pq, Qq) DEF_GEN_INSN3_HELPER_EPP(psignb, psignb_xmm, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(vpsignb, psignb_xmm, Vdq, Hdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vpsignb, psignb_xmm, Vqq, Hqq, Wqq) DEF_GEN_INSN3_HELPER_EPP(psignw, psignw_mmx, Pq, Pq, Qq) DEF_GEN_INSN3_HELPER_EPP(psignw, psignw_xmm, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(vpsignw, psignw_xmm, Vdq, Hdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vpsignw, psignw_xmm, Vqq, Hqq, Wqq) DEF_GEN_INSN3_HELPER_EPP(psignd, psignd_mmx, Pq, Pq, Qq) DEF_GEN_INSN3_HELPER_EPP(psignd, psignd_xmm, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(vpsignd, psignd_xmm, Vdq, Hdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vpsignd, psignd_xmm, Vqq, Hqq, Wqq) DEF_GEN_INSN4_HELPER_EPPI(dpps, dpps_xmm, Vdq, Vdq, Wdq, Ib) DEF_GEN_INSN4_HELPER_EPPI(vdpps, dpps_xmm, Vdq, Hdq, Wdq, Ib) @@ -6335,25 +6401,33 @@ DEF_GEN_INSN4_HELPER_EPPI(vpclmulqdq, pclmulqdq_xmm, Vdq, Hdq, Wdq, Ib) DEF_GEN_INSN3_GVEC(pcmpeqb, Pq, Pq, Qq, cmp, MM_OPRSZ, MM_MAXSZ, MO_8, TCG_COND_EQ) DEF_GEN_INSN3_GVEC(pcmpeqb, Vdq, Vdq, Wdq, cmp, XMM_OPRSZ, XMM_MAXSZ, MO_8, TCG_COND_EQ) DEF_GEN_INSN3_GVEC(vpcmpeqb, Vdq, Hdq, Wdq, cmp, XMM_OPRSZ, XMM_MAXSZ, MO_8, TCG_COND_EQ) +DEF_GEN_INSN3_GVEC(vpcmpeqb, Vqq, Hqq, Wqq, cmp, XMM_OPRSZ, XMM_MAXSZ, MO_8, TCG_COND_EQ) DEF_GEN_INSN3_GVEC(pcmpeqw, Pq, Pq, Qq, cmp, MM_OPRSZ, MM_MAXSZ, MO_16, TCG_COND_EQ) DEF_GEN_INSN3_GVEC(pcmpeqw, Vdq, Vdq, Wdq, cmp, XMM_OPRSZ, XMM_MAXSZ, MO_16, TCG_COND_EQ) DEF_GEN_INSN3_GVEC(vpcmpeqw, Vdq, Hdq, Wdq, cmp, XMM_OPRSZ, XMM_MAXSZ, MO_16, TCG_COND_EQ) +DEF_GEN_INSN3_GVEC(vpcmpeqw, Vqq, Hqq, Wqq, cmp, XMM_OPRSZ, XMM_MAXSZ, MO_16, TCG_COND_EQ) DEF_GEN_INSN3_GVEC(pcmpeqd, Pq, Pq, Qq, cmp, MM_OPRSZ, MM_MAXSZ, MO_32, TCG_COND_EQ) DEF_GEN_INSN3_GVEC(pcmpeqd, Vdq, Vdq, Wdq, cmp, XMM_OPRSZ, XMM_MAXSZ, MO_32, TCG_COND_EQ) DEF_GEN_INSN3_GVEC(vpcmpeqd, Vdq, Hdq, Wdq, cmp, XMM_OPRSZ, XMM_MAXSZ, MO_32, TCG_COND_EQ) +DEF_GEN_INSN3_GVEC(vpcmpeqd, Vqq, Hqq, Wqq, cmp, XMM_OPRSZ, XMM_MAXSZ, MO_32, TCG_COND_EQ) DEF_GEN_INSN3_GVEC(pcmpeqq, Vdq, Vdq, Wdq, cmp, XMM_OPRSZ, XMM_MAXSZ, MO_64, TCG_COND_EQ) DEF_GEN_INSN3_GVEC(vpcmpeqq, Vdq, Hdq, Wdq, cmp, XMM_OPRSZ, XMM_MAXSZ, MO_64, TCG_COND_EQ) +DEF_GEN_INSN3_GVEC(vpcmpeqq, Vqq, Hqq, Wqq, cmp, XMM_OPRSZ, XMM_MAXSZ, MO_64, TCG_COND_EQ) DEF_GEN_INSN3_GVEC(pcmpgtb, Pq, Pq, Qq, cmp, MM_OPRSZ, MM_MAXSZ, MO_8, TCG_COND_GT) DEF_GEN_INSN3_GVEC(pcmpgtb, Vdq, Vdq, Wdq, cmp, XMM_OPRSZ, XMM_MAXSZ, MO_8, TCG_COND_GT) DEF_GEN_INSN3_GVEC(vpcmpgtb, Vdq, Hdq, Wdq, cmp, XMM_OPRSZ, XMM_MAXSZ, MO_8, TCG_COND_GT) +DEF_GEN_INSN3_GVEC(vpcmpgtb, Vqq, Hqq, Wqq, cmp, XMM_OPRSZ, XMM_MAXSZ, MO_8, TCG_COND_GT) DEF_GEN_INSN3_GVEC(pcmpgtw, Pq, Pq, Qq, cmp, MM_OPRSZ, MM_MAXSZ, MO_16, TCG_COND_GT) DEF_GEN_INSN3_GVEC(pcmpgtw, Vdq, Vdq, Wdq, cmp, XMM_OPRSZ, XMM_MAXSZ, MO_16, TCG_COND_GT) DEF_GEN_INSN3_GVEC(vpcmpgtw, Vdq, Hdq, Wdq, cmp, XMM_OPRSZ, XMM_MAXSZ, MO_16, TCG_COND_GT) +DEF_GEN_INSN3_GVEC(vpcmpgtw, Vqq, Hqq, Wqq, cmp, XMM_OPRSZ, XMM_MAXSZ, MO_16, TCG_COND_GT) DEF_GEN_INSN3_GVEC(pcmpgtd, Pq, Pq, Qq, cmp, MM_OPRSZ, MM_MAXSZ, MO_32, TCG_COND_GT) DEF_GEN_INSN3_GVEC(pcmpgtd, Vdq, Vdq, Wdq, cmp, XMM_OPRSZ, XMM_MAXSZ, MO_32, TCG_COND_GT) DEF_GEN_INSN3_GVEC(vpcmpgtd, Vdq, Hdq, Wdq, cmp, XMM_OPRSZ, XMM_MAXSZ, MO_32, TCG_COND_GT) +DEF_GEN_INSN3_GVEC(vpcmpgtd, Vqq, Hqq, Wqq, cmp, XMM_OPRSZ, XMM_MAXSZ, MO_32, TCG_COND_GT) DEF_GEN_INSN3_GVEC(pcmpgtq, Vdq, Vdq, Wdq, cmp, XMM_OPRSZ, XMM_MAXSZ, MO_64, TCG_COND_GT) DEF_GEN_INSN3_GVEC(vpcmpgtq, Vdq, Hdq, Wdq, cmp, XMM_OPRSZ, XMM_MAXSZ, MO_64, TCG_COND_GT) +DEF_GEN_INSN3_GVEC(vpcmpgtq, Vqq, Hqq, Wqq, cmp, XMM_OPRSZ, XMM_MAXSZ, MO_64, TCG_COND_GT) DEF_GEN_INSN3_HELPER_EPPI(pcmpestrm, pcmpestrm_xmm, Vdq, Wdq, Ib) DEF_GEN_INSN3_HELPER_EPPI(vpcmpestrm, pcmpestrm_xmm, Vdq, Wdq, Ib) @@ -6785,6 +6859,7 @@ DEF_GEN_INSN2_HELPER_EPP(vucomisd, ucomisd, Vq, Wq) DEF_GEN_INSN3_GVEC(pand, Pq, Pq, Qq, and, MM_OPRSZ, MM_MAXSZ, MO_64) DEF_GEN_INSN3_GVEC(pand, Vdq, Vdq, Wdq, and, XMM_OPRSZ, XMM_MAXSZ, MO_64) DEF_GEN_INSN3_GVEC(vpand, Vdq, Hdq, Wdq, and, XMM_OPRSZ, XMM_MAXSZ, MO_64) +DEF_GEN_INSN3_GVEC(vpand, Vqq, Hqq, Wqq, and, XMM_OPRSZ, XMM_MAXSZ, MO_64) DEF_GEN_INSN3_GVEC(andps, Vdq, Vdq, Wdq, and, XMM_OPRSZ, XMM_MAXSZ, MO_64) DEF_GEN_INSN3_GVEC(vandps, Vdq, Hdq, Wdq, and, XMM_OPRSZ, XMM_MAXSZ, MO_64) DEF_GEN_INSN3_GVEC(vandps, Vqq, Hqq, Wqq, and, XMM_OPRSZ, XMM_MAXSZ, MO_64) @@ -6794,6 +6869,7 @@ DEF_GEN_INSN3_GVEC(vandpd, Vqq, Hqq, Wqq, and, XMM_OPRSZ, XMM_MAXSZ, MO_64) DEF_GEN_INSN3_GVEC(pandn, Pq, Pq, Qq, andn, MM_OPRSZ, MM_MAXSZ, MO_64) DEF_GEN_INSN3_GVEC(pandn, Vdq, Vdq, Wdq, andn, XMM_OPRSZ, XMM_MAXSZ, MO_64) DEF_GEN_INSN3_GVEC(vpandn, Vdq, Hdq, Wdq, andn, XMM_OPRSZ, XMM_MAXSZ, MO_64) +DEF_GEN_INSN3_GVEC(vpandn, Vqq, Hqq, Wqq, andn, XMM_OPRSZ, XMM_MAXSZ, MO_64) DEF_GEN_INSN3_GVEC(andnps, Vdq, Vdq, Wdq, andn, XMM_OPRSZ, XMM_MAXSZ, MO_64) DEF_GEN_INSN3_GVEC(vandnps, Vdq, Hdq, Wdq, andn, XMM_OPRSZ, XMM_MAXSZ, MO_64) DEF_GEN_INSN3_GVEC(vandnps, Vqq, Hqq, Wqq, andn, XMM_OPRSZ, XMM_MAXSZ, MO_64) @@ -6803,6 +6879,7 @@ DEF_GEN_INSN3_GVEC(vandnpd, Vqq, Hqq, Wqq, andn, XMM_OPRSZ, XMM_MAXSZ, MO_64) DEF_GEN_INSN3_GVEC(por, Pq, Pq, Qq, or, MM_OPRSZ, MM_MAXSZ, MO_64) DEF_GEN_INSN3_GVEC(por, Vdq, Vdq, Wdq, or, XMM_OPRSZ, XMM_MAXSZ, MO_64) DEF_GEN_INSN3_GVEC(vpor, Vdq, Hdq, Wdq, or, XMM_OPRSZ, XMM_MAXSZ, MO_64) +DEF_GEN_INSN3_GVEC(vpor, Vqq, Hqq, Wqq, or, XMM_OPRSZ, XMM_MAXSZ, MO_64) DEF_GEN_INSN3_GVEC(orps, Vdq, Vdq, Wdq, or, XMM_OPRSZ, XMM_MAXSZ, MO_64) DEF_GEN_INSN3_GVEC(vorps, Vdq, Hdq, Wdq, or, XMM_OPRSZ, XMM_MAXSZ, MO_64) DEF_GEN_INSN3_GVEC(vorps, Vqq, Hqq, Wqq, or, XMM_OPRSZ, XMM_MAXSZ, MO_64) @@ -6812,6 +6889,7 @@ DEF_GEN_INSN3_GVEC(vorpd, Vqq, Hqq, Wqq, or, XMM_OPRSZ, XMM_MAXSZ, MO_64) DEF_GEN_INSN3_GVEC(pxor, Pq, Pq, Qq, xor, MM_OPRSZ, MM_MAXSZ, MO_64) DEF_GEN_INSN3_GVEC(pxor, Vdq, Vdq, Wdq, xor, XMM_OPRSZ, XMM_MAXSZ, MO_64) DEF_GEN_INSN3_GVEC(vpxor, Vdq, Hdq, Wdq, xor, XMM_OPRSZ, XMM_MAXSZ, MO_64) +DEF_GEN_INSN3_GVEC(vpxor, Vqq, Hqq, Wqq, xor, XMM_OPRSZ, XMM_MAXSZ, MO_64) DEF_GEN_INSN3_GVEC(xorps, Vdq, Vdq, Wdq, xor, XMM_OPRSZ, XMM_MAXSZ, MO_64) DEF_GEN_INSN3_GVEC(vxorps, Vdq, Hdq, Wdq, xor, XMM_OPRSZ, XMM_MAXSZ, MO_64) DEF_GEN_INSN3_GVEC(vxorps, Vqq, Hqq, Wqq, xor, XMM_OPRSZ, XMM_MAXSZ, MO_64) @@ -6822,31 +6900,88 @@ DEF_GEN_INSN3_GVEC(vxorpd, Vqq, Hqq, Wqq, xor, XMM_OPRSZ, XMM_MAXSZ, MO_64) DEF_GEN_INSN3_HELPER_EPP(psllw, psllw_mmx, Pq, Pq, Qq) DEF_GEN_INSN3_HELPER_EPP(psllw, psllw_xmm, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(vpsllw, psllw_xmm, Vdq, Hdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vpsllw, psllw_xmm, Vqq, Hqq, Wdq) DEF_GEN_INSN3_HELPER_EPP(pslld, pslld_mmx, Pq, Pq, Qq) DEF_GEN_INSN3_HELPER_EPP(pslld, pslld_xmm, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(vpslld, pslld_xmm, Vdq, Hdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vpslld, pslld_xmm, Vqq, Hqq, Wdq) DEF_GEN_INSN3_HELPER_EPP(psllq, psllq_mmx, Pq, Pq, Qq) DEF_GEN_INSN3_HELPER_EPP(psllq, psllq_xmm, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(vpsllq, psllq_xmm, Vdq, Hdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vpsllq, psllq_xmm, Vqq, Hqq, Wdq) + +GEN_INSN3(vpsllvd, Vdq, Hdq, Wdq) +{ + /* XXX TODO implement this */ +} +GEN_INSN3(vpsllvd, Vqq, Hqq, Wqq) +{ + /* XXX TODO implement this */ +} + +GEN_INSN3(vpsllvq, Vdq, Hdq, Wdq) +{ + /* XXX TODO implement this */ +} +GEN_INSN3(vpsllvq, Vqq, Hqq, Wqq) +{ + /* XXX TODO implement this */ +} + DEF_GEN_INSN3_HELPER_EPP(pslldq, pslldq_xmm, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(vpslldq, pslldq_xmm, Vdq, Hdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vpslldq, pslldq_xmm, Vqq, Hqq, Wdq) DEF_GEN_INSN3_HELPER_EPP(psrlw, psrlw_mmx, Pq, Pq, Qq) DEF_GEN_INSN3_HELPER_EPP(psrlw, psrlw_xmm, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(vpsrlw, psrlw_xmm, Vdq, Hdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vpsrlw, psrlw_xmm, Vqq, Hqq, Wdq) DEF_GEN_INSN3_HELPER_EPP(psrld, psrld_mmx, Pq, Pq, Qq) DEF_GEN_INSN3_HELPER_EPP(psrld, psrld_xmm, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(vpsrld, psrld_xmm, Vdq, Hdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vpsrld, psrld_xmm, Vqq, Hqq, Wdq) DEF_GEN_INSN3_HELPER_EPP(psrlq, psrlq_mmx, Pq, Pq, Qq) DEF_GEN_INSN3_HELPER_EPP(psrlq, psrlq_xmm, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(vpsrlq, psrlq_xmm, Vdq, Hdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vpsrlq, psrlq_xmm, Vqq, Hqq, Wdq) + +GEN_INSN3(vpsrlvd, Vdq, Hdq, Wdq) +{ + /* XXX TODO implement this */ +} +GEN_INSN3(vpsrlvd, Vqq, Hqq, Wqq) +{ + /* XXX TODO implement this */ +} + +GEN_INSN3(vpsrlvq, Vdq, Hdq, Wdq) +{ + /* XXX TODO implement this */ +} +GEN_INSN3(vpsrlvq, Vqq, Hqq, Wqq) +{ + /* XXX TODO implement this */ +} + DEF_GEN_INSN3_HELPER_EPP(psrldq, psrldq_xmm, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(vpsrldq, psrldq_xmm, Vdq, Hdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vpsrldq, psrldq_xmm, Vqq, Hqq, Wdq) DEF_GEN_INSN3_HELPER_EPP(psraw, psraw_mmx, Pq, Pq, Qq) DEF_GEN_INSN3_HELPER_EPP(psraw, psraw_xmm, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(vpsraw, psraw_xmm, Vdq, Hdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vpsraw, psraw_xmm, Vqq, Hqq, Wdq) DEF_GEN_INSN3_HELPER_EPP(psrad, psrad_mmx, Pq, Pq, Qq) DEF_GEN_INSN3_HELPER_EPP(psrad, psrad_xmm, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(vpsrad, psrad_xmm, Vdq, Hdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vpsrad, psrad_xmm, Vqq, Hqq, Wdq) + +GEN_INSN3(vpsravd, Vdq, Hdq, Wdq) +{ + /* XXX TODO implement this */ +} +GEN_INSN3(vpsravd, Vqq, Hqq, Wqq) +{ + /* XXX TODO implement this */ +} #define DEF_GEN_PSHIFT_IMM_MM(mnem, opT1, opT2) \ GEN_INSN3(mnem, opT1, opT2, Ib) \ @@ -6884,73 +7019,108 @@ DEF_GEN_INSN3_HELPER_EPP(vpsrad, psrad_xmm, Vdq, Hdq, Wdq) gen_insn2(movq, Vdq, Eq)(env, s, arg3_xmm, arg3_r64); \ gen_insn3(mnem, Vdq, Hdq, Wdq)(env, s, arg2, arg2, arg3_xmm); \ } +#define DEF_GEN_VPSHIFT_IMM_YMM(mnem, opT1, opT2) \ + GEN_INSN3(mnem, opT1, opT2, Ib) \ + { \ + const uint64_t arg3_ui64 = (uint8_t)arg3; \ + const insnop_arg_t(Eq) arg3_r64 = s->tmp1_i64; \ + const insnop_arg_t(Wdq) arg3_xmm = \ + offsetof(CPUX86State, xmm_t0.ZMM_Q(0)); \ + \ + tcg_gen_movi_i64(arg3_r64, arg3_ui64); \ + gen_insn2(movq, Vdq, Eq)(env, s, arg3_xmm, arg3_r64); \ + gen_insn3(mnem, Vqq, Hqq, Wdq)(env, s, arg2, arg2, arg3_xmm); \ + } DEF_GEN_PSHIFT_IMM_MM(psllw, Nq, Nq) DEF_GEN_PSHIFT_IMM_XMM(psllw, Udq, Udq) DEF_GEN_VPSHIFT_IMM_XMM(vpsllw, Hdq, Udq) +DEF_GEN_VPSHIFT_IMM_YMM(vpsllw, Hqq, Uqq) DEF_GEN_PSHIFT_IMM_MM(pslld, Nq, Nq) DEF_GEN_PSHIFT_IMM_XMM(pslld, Udq, Udq) DEF_GEN_VPSHIFT_IMM_XMM(vpslld, Hdq, Udq) +DEF_GEN_VPSHIFT_IMM_YMM(vpslld, Hqq, Uqq) DEF_GEN_PSHIFT_IMM_MM(psllq, Nq, Nq) DEF_GEN_PSHIFT_IMM_XMM(psllq, Udq, Udq) DEF_GEN_VPSHIFT_IMM_XMM(vpsllq, Hdq, Udq) +DEF_GEN_VPSHIFT_IMM_YMM(vpsllq, Hqq, Uqq) DEF_GEN_PSHIFT_IMM_XMM(pslldq, Udq, Udq) DEF_GEN_VPSHIFT_IMM_XMM(vpslldq, Hdq, Udq) +DEF_GEN_VPSHIFT_IMM_YMM(vpslldq, Hqq, Uqq) DEF_GEN_PSHIFT_IMM_MM(psrlw, Nq, Nq) DEF_GEN_PSHIFT_IMM_XMM(psrlw, Udq, Udq) DEF_GEN_VPSHIFT_IMM_XMM(vpsrlw, Hdq, Udq) +DEF_GEN_VPSHIFT_IMM_YMM(vpsrlw, Hqq, Uqq) DEF_GEN_PSHIFT_IMM_MM(psrld, Nq, Nq) DEF_GEN_PSHIFT_IMM_XMM(psrld, Udq, Udq) DEF_GEN_VPSHIFT_IMM_XMM(vpsrld, Hdq, Udq) +DEF_GEN_VPSHIFT_IMM_YMM(vpsrld, Hqq, Uqq) DEF_GEN_PSHIFT_IMM_MM(psrlq, Nq, Nq) DEF_GEN_PSHIFT_IMM_XMM(psrlq, Udq, Udq) DEF_GEN_VPSHIFT_IMM_XMM(vpsrlq, Hdq, Udq) +DEF_GEN_VPSHIFT_IMM_YMM(vpsrlq, Hqq, Uqq) DEF_GEN_PSHIFT_IMM_XMM(psrldq, Udq, Udq) DEF_GEN_VPSHIFT_IMM_XMM(vpsrldq, Hdq, Udq) +DEF_GEN_VPSHIFT_IMM_YMM(vpsrldq, Hqq, Uqq) DEF_GEN_PSHIFT_IMM_MM(psraw, Nq, Nq) DEF_GEN_PSHIFT_IMM_XMM(psraw, Udq, Udq) DEF_GEN_VPSHIFT_IMM_XMM(vpsraw, Hdq, Udq) +DEF_GEN_VPSHIFT_IMM_XMM(vpsraw, Hqq, Uqq) DEF_GEN_PSHIFT_IMM_MM(psrad, Nq, Nq) DEF_GEN_PSHIFT_IMM_XMM(psrad, Udq, Udq) DEF_GEN_VPSHIFT_IMM_XMM(vpsrad, Hdq, Udq) +DEF_GEN_VPSHIFT_IMM_XMM(vpsrad, Hqq, Uqq) DEF_GEN_INSN4_HELPER_EPPI(palignr, palignr_mmx, Pq, Pq, Qq, Ib) DEF_GEN_INSN4_HELPER_EPPI(palignr, palignr_xmm, Vdq, Vdq, Wdq, Ib) DEF_GEN_INSN4_HELPER_EPPI(vpalignr, palignr_xmm, Vdq, Hdq, Wdq, Ib) +DEF_GEN_INSN4_HELPER_EPPI(vpalignr, palignr_xmm, Vqq, Hqq, Wqq, Ib) DEF_GEN_INSN3_HELPER_EPP(packsswb, packsswb_mmx, Pq, Pq, Qq) DEF_GEN_INSN3_HELPER_EPP(packsswb, packsswb_xmm, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(vpacksswb, packsswb_xmm, Vdq, Hdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vpacksswb, packsswb_xmm, Vqq, Hqq, Wqq) DEF_GEN_INSN3_HELPER_EPP(packssdw, packssdw_mmx, Pq, Pq, Qq) DEF_GEN_INSN3_HELPER_EPP(packssdw, packssdw_xmm, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(vpackssdw, packssdw_xmm, Vdq, Hdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vpackssdw, packssdw_xmm, Vqq, Hqq, Wqq) DEF_GEN_INSN3_HELPER_EPP(packuswb, packuswb_mmx, Pq, Pq, Qq) DEF_GEN_INSN3_HELPER_EPP(packuswb, packuswb_xmm, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(vpackuswb, packuswb_xmm, Vdq, Hdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vpackuswb, packuswb_xmm, Vqq, Hqq, Wqq) DEF_GEN_INSN3_HELPER_EPP(packusdw, packusdw_xmm, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(vpackusdw, packusdw_xmm, Vdq, Hdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vpackusdw, packusdw_xmm, Vqq, Hqq, Wqq) DEF_GEN_INSN3_HELPER_EPP(punpcklbw, punpcklbw_mmx, Pq, Pq, Qd) DEF_GEN_INSN3_HELPER_EPP(punpcklbw, punpcklbw_xmm, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(vpunpcklbw, punpcklbw_xmm, Vdq, Hdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vpunpcklbw, punpcklbw_xmm, Vqq, Hqq, Wqq) DEF_GEN_INSN3_HELPER_EPP(punpcklwd, punpcklwd_mmx, Pq, Pq, Qd) DEF_GEN_INSN3_HELPER_EPP(punpcklwd, punpcklwd_xmm, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(vpunpcklwd, punpcklwd_xmm, Vdq, Hdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vpunpcklwd, punpcklwd_xmm, Vqq, Hqq, Wqq) DEF_GEN_INSN3_HELPER_EPP(punpckldq, punpckldq_mmx, Pq, Pq, Qd) DEF_GEN_INSN3_HELPER_EPP(punpckldq, punpckldq_xmm, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(vpunpckldq, punpckldq_xmm, Vdq, Hdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vpunpckldq, punpckldq_xmm, Vqq, Hqq, Wqq) DEF_GEN_INSN3_HELPER_EPP(punpcklqdq, punpcklqdq_xmm, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(vpunpcklqdq, punpcklqdq_xmm, Vdq, Hdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vpunpcklqdq, punpcklqdq_xmm, Vqq, Hqq, Wqq) DEF_GEN_INSN3_HELPER_EPP(punpckhbw, punpckhbw_mmx, Pq, Pq, Qq) DEF_GEN_INSN3_HELPER_EPP(punpckhbw, punpckhbw_xmm, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(vpunpckhbw, punpckhbw_xmm, Vdq, Hdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vpunpckhbw, punpckhbw_xmm, Vqq, Hqq, Wqq) DEF_GEN_INSN3_HELPER_EPP(punpckhwd, punpckhwd_mmx, Pq, Pq, Qq) DEF_GEN_INSN3_HELPER_EPP(punpckhwd, punpckhwd_xmm, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(vpunpckhwd, punpckhwd_xmm, Vdq, Hdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vpunpckhwd, punpckhwd_xmm, Vqq, Hqq, Wqq) DEF_GEN_INSN3_HELPER_EPP(punpckhdq, punpckhdq_mmx, Pq, Pq, Qq) DEF_GEN_INSN3_HELPER_EPP(punpckhdq, punpckhdq_xmm, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(vpunpckhdq, punpckhdq_xmm, Vdq, Hdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vpunpckhdq, punpckhdq_xmm, Vqq, Hqq, Wqq) DEF_GEN_INSN3_HELPER_EPP(punpckhqdq, punpckhqdq_xmm, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(vpunpckhqdq, punpckhqdq_xmm, Vdq, Hdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vpunpckhqdq, punpckhqdq_xmm, Vqq, Hqq, Wqq) DEF_GEN_INSN3_HELPER_EPP(unpcklps, punpckldq_xmm, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(vunpcklps, punpckldq_xmm, Vdq, Hdq, Wdq) @@ -6968,13 +7138,17 @@ DEF_GEN_INSN3_HELPER_EPP(vunpckhpd, punpckhqdq_xmm, Vqq, Hqq, Wqq) DEF_GEN_INSN3_HELPER_EPP(pshufb, pshufb_mmx, Pq, Pq, Qq) DEF_GEN_INSN3_HELPER_EPP(pshufb, pshufb_xmm, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(vpshufb, pshufb_xmm, Vdq, Hdq, Wdq) +DEF_GEN_INSN3_HELPER_EPP(vpshufb, pshufb_xmm, Vqq, Hqq, Wqq) DEF_GEN_INSN3_HELPER_PPI(pshufw, pshufw_mmx, Pq, Qq, Ib) DEF_GEN_INSN3_HELPER_PPI(pshuflw, pshuflw_xmm, Vdq, Wdq, Ib) DEF_GEN_INSN3_HELPER_PPI(vpshuflw, pshuflw_xmm, Vdq, Wdq, Ib) +DEF_GEN_INSN3_HELPER_PPI(vpshuflw, pshuflw_xmm, Vqq, Wqq, Ib) DEF_GEN_INSN3_HELPER_PPI(pshufhw, pshufhw_xmm, Vdq, Wdq, Ib) DEF_GEN_INSN3_HELPER_PPI(vpshufhw, pshufhw_xmm, Vdq, Wdq, Ib) +DEF_GEN_INSN3_HELPER_PPI(vpshufhw, pshufhw_xmm, Vqq, Wqq, Ib) DEF_GEN_INSN3_HELPER_PPI(pshufd, pshufd_xmm, Vdq, Wdq, Ib) DEF_GEN_INSN3_HELPER_PPI(vpshufd, pshufd_xmm, Vdq, Wdq, Ib) +DEF_GEN_INSN3_HELPER_PPI(vpshufd, pshufd_xmm, Vqq, Wqq, Ib) DEF_GEN_INSN4_HELPER_PPI(shufps, shufps, Vdq, Vdq, Wdq, Ib) DEF_GEN_INSN4_HELPER_PPI(vshufps, shufps, Vdq, Hdq, Wdq, Ib) DEF_GEN_INSN4_HELPER_PPI(vshufps, shufps, Vqq, Hqq, Wqq, Ib) @@ -7014,9 +7188,23 @@ GEN_INSN4(vpblendvb, Vdq, Hdq, Wdq, Ldq) { gen_insn3(pblendvb, Vdq, Vdq, Wdq)(env, s, arg1, arg2, arg3); } +GEN_INSN4(vpblendvb, Vqq, Hqq, Wqq, Lqq) +{ + gen_insn3(pblendvb, Vdq, Vdq, Wdq)(env, s, arg1, arg2, arg3); +} DEF_GEN_INSN4_HELPER_EPPI(pblendw, pblendw_xmm, Vdq, Vdq, Wdq, Ib) DEF_GEN_INSN4_HELPER_EPPI(vpblendw, pblendw_xmm, Vdq, Hdq, Wdq, Ib) +DEF_GEN_INSN4_HELPER_EPPI(vpblendw, pblendw_xmm, Vqq, Hqq, Wqq, Ib) + +GEN_INSN4(vpblendd, Vdq, Hdq, Wdq, Ib) +{ + /* XXX TODO implement this */ +} +GEN_INSN4(vpblendd, Vqq, Hqq, Wqq, Ib) +{ + /* XXX TODO implement this */ +} GEN_INSN4(insertps, Vdq, Vdq, Wd, Ib) { @@ -7100,6 +7288,10 @@ GEN_INSN4(vinsertf128, Vqq, Hqq, Wdq, Ib) { gen_insn2(movaps, Vdq, Wdq)(env, s, arg1, arg3); } +GEN_INSN4(vinserti128, Vqq, Hqq, Wdq, Ib) +{ + gen_insn2(movaps, Vdq, Wdq)(env, s, arg1, arg3); +} GEN_INSN3(extractps, Ed, Vdq, Ib) { @@ -7178,42 +7370,106 @@ GEN_INSN3(vextractf128, Wdq, Vqq, Ib) { gen_insn2(movaps, Wdq, Vdq)(env, s, arg1, arg2); } +GEN_INSN3(vextracti128, Wdq, Vqq, Ib) +{ + gen_insn2(movaps, Wdq, Vdq)(env, s, arg1, arg2); +} -GEN_INSN2(vbroadcastss, Vdq, Md) +GEN_INSN2(vpbroadcastb, Vdq, Wb) +{ + /* XXX TODO implement this */ +} +GEN_INSN2(vpbroadcastb, Vqq, Wb) +{ + /* XXX TODO implement this */ +} +GEN_INSN2(vpbroadcastw, Vdq, Ww) +{ + /* XXX TODO implement this */ +} +GEN_INSN2(vpbroadcastw, Vqq, Ww) +{ + /* XXX TODO implement this */ +} +GEN_INSN2(vpbroadcastd, Vdq, Wd) +{ + /* XXX TODO implement this */ +} +GEN_INSN2(vpbroadcastd, Vqq, Wd) { + /* XXX TODO implement this */ +} +GEN_INSN2(vpbroadcastq, Vdq, Wq) +{ + /* XXX TODO implement this */ +} +GEN_INSN2(vpbroadcastq, Vqq, Wq) +{ + /* XXX TODO implement this */ +} + +GEN_INSN3(vbroadcastss, Vdq, Wd, modrm_mod) +{ + if (arg3 != 3 && !check_cpuid(env, s, CHECK_CPUID_AVX2)) { + gen_unknown_opcode(env, s); + return; + } + const TCGv_i32 r32 = tcg_temp_new_i32(); - insnop_ldst(tcg_i32, Md)(env, s, 0, r32, arg2); - - tcg_gen_st_i32(r32, cpu_env, arg1 + offsetof(ZMMReg, ZMM_L(0))); + tcg_gen_ld_i32(r32, cpu_env, arg2 + offsetof(ZMMReg, ZMM_L(0))); + if (arg1 != arg2) { + tcg_gen_st_i32(r32, cpu_env, arg1 + offsetof(ZMMReg, ZMM_L(0))); + } tcg_gen_st_i32(r32, cpu_env, arg1 + offsetof(ZMMReg, ZMM_L(1))); tcg_gen_st_i32(r32, cpu_env, arg1 + offsetof(ZMMReg, ZMM_L(2))); tcg_gen_st_i32(r32, cpu_env, arg1 + offsetof(ZMMReg, ZMM_L(3))); - tcg_temp_free_i32(r32); } -GEN_INSN2(vbroadcastss, Vqq, Md) +GEN_INSN3(vbroadcastss, Vqq, Wd, modrm_mod) { - gen_insn2(vbroadcastss, Vdq, Md)(env, s, arg1, arg2); + gen_insn3(vbroadcastss, Vdq, Wd, modrm_mod)(env, s, arg1, arg2, arg3); } -GEN_INSN2(vbroadcastsd, Vqq, Mq) +GEN_INSN3(vbroadcastsd, Vqq, Wq, modrm_mod) { + if (arg3 != 3 && !check_cpuid(env, s, CHECK_CPUID_AVX2)) { + gen_unknown_opcode(env, s); + return; + } + const TCGv_i64 r64 = tcg_temp_new_i64(); - insnop_ldst(tcg_i64, Mq)(env, s, 0, r64, arg2); - - tcg_gen_st_i64(r64, cpu_env, arg1 + offsetof(ZMMReg, ZMM_Q(0))); + tcg_gen_ld_i64(r64, cpu_env, arg2 + offsetof(ZMMReg, ZMM_Q(0))); + if (arg1 != arg2) { + tcg_gen_st_i64(r64, cpu_env, arg1 + offsetof(ZMMReg, ZMM_Q(0))); + } tcg_gen_st_i64(r64, cpu_env, arg1 + offsetof(ZMMReg, ZMM_Q(1))); - tcg_temp_free_i64(r64); } GEN_INSN2(vbroadcastf128, Vqq, Mdq) { insnop_ldst(xmm, Mqq)(env, s, 0, arg1, arg2); } +GEN_INSN2(vbroadcasti128, Vqq, Mdq) +{ + insnop_ldst(xmm, Mqq)(env, s, 0, arg1, arg2); +} GEN_INSN4(vperm2f128, Vqq, Hqq, Wqq, Ib) { /* XXX TODO implement this */ } +GEN_INSN4(vperm2i128, Vqq, Hqq, Wqq, Ib) +{ + /* XXX TODO implement this */ +} + +GEN_INSN3(vpermd, Vqq, Hqq, Wqq) +{ + /* XXX TODO implement this */ +} +GEN_INSN3(vpermps, Vqq, Hqq, Wqq) +{ + /* XXX TODO implement this */ +} GEN_INSN3(vpermilps, Vdq, Hdq, Wdq) { @@ -7249,30 +7505,119 @@ GEN_INSN3(vpermilpd, Vqq, Wqq, Ib) /* XXX TODO implement this */ } +GEN_INSN3(vpermq, Vqq, Wqq, Ib) +{ + /* XXX TODO implement this */ +} +GEN_INSN3(vpermpd, Vqq, Wqq, Ib) +{ + /* XXX TODO implement this */ +} + +GEN_INSN5(vgatherdps, Vdq, Hdq, Vdq, MDdq, Hdq) +{ + /* XXX TODO implement this */ +} +GEN_INSN5(vgatherdps, Vqq, Hqq, Vqq, MDqq, Hqq) +{ + /* XXX TODO implement this */ +} +GEN_INSN5(vgatherdpd, Vdq, Hdq, Vdq, MDdq, Hdq) +{ + /* XXX TODO implement this */ +} +GEN_INSN5(vgatherdpd, Vqq, Hqq, Vqq, MDdq, Hqq) +{ + /* XXX TODO implement this */ +} + +GEN_INSN5(vgatherqps, Vdq, Hdq, Vdq, MQdq, Hdq) +{ + /* XXX TODO implement this */ +} +GEN_INSN5(vgatherqps, Vdq, Hdq, Vdq, MQqq, Hdq) +{ + /* XXX TODO implement this */ +} +GEN_INSN5(vgatherqpd, Vdq, Hdq, Vdq, MQdq, Hdq) +{ + /* XXX TODO implement this */ +} +GEN_INSN5(vgatherqpd, Vqq, Hqq, Vqq, MQqq, Hqq) +{ + /* XXX TODO implement this */ +} + +GEN_INSN5(vpgatherdd, Vdq, Hdq, Vdq, MDdq, Hdq) +{ + /* XXX TODO implement this */ +} +GEN_INSN5(vpgatherdd, Vqq, Hqq, Vqq, MDqq, Hqq) +{ + /* XXX TODO implement this */ +} +GEN_INSN5(vpgatherdq, Vdq, Hdq, Vdq, MDdq, Hdq) +{ + /* XXX TODO implement this */ +} +GEN_INSN5(vpgatherdq, Vqq, Hqq, Vqq, MDdq, Hqq) +{ + /* XXX TODO implement this */ +} + +GEN_INSN5(vpgatherqd, Vdq, Hdq, Vdq, MQdq, Hdq) +{ + /* XXX TODO implement this */ +} +GEN_INSN5(vpgatherqd, Vdq, Hdq, Vdq, MQqq, Hdq) +{ + /* XXX TODO implement this */ +} +GEN_INSN5(vpgatherqq, Vdq, Hdq, Vdq, MQdq, Hdq) +{ + /* XXX TODO implement this */ +} +GEN_INSN5(vpgatherqq, Vqq, Hqq, Vqq, MQqq, Hqq) +{ + /* XXX TODO implement this */ +} + DEF_GEN_INSN2_HELPER_EPP(pmovsxbw, pmovsxbw_xmm, Vdq, Wq) DEF_GEN_INSN2_HELPER_EPP(vpmovsxbw, pmovsxbw_xmm, Vdq, Wq) +DEF_GEN_INSN2_HELPER_EPP(vpmovsxbw, pmovsxbw_xmm, Vqq, Wdq) DEF_GEN_INSN2_HELPER_EPP(pmovsxbd, pmovsxbd_xmm, Vdq, Wd) DEF_GEN_INSN2_HELPER_EPP(vpmovsxbd, pmovsxbd_xmm, Vdq, Wd) +DEF_GEN_INSN2_HELPER_EPP(vpmovsxbd, pmovsxbd_xmm, Vqq, Wq) DEF_GEN_INSN2_HELPER_EPP(pmovsxbq, pmovsxbq_xmm, Vdq, Ww) DEF_GEN_INSN2_HELPER_EPP(vpmovsxbq, pmovsxbq_xmm, Vdq, Ww) +DEF_GEN_INSN2_HELPER_EPP(vpmovsxbq, pmovsxbq_xmm, Vqq, Wd) DEF_GEN_INSN2_HELPER_EPP(pmovsxwd, pmovsxwd_xmm, Vdq, Wq) DEF_GEN_INSN2_HELPER_EPP(vpmovsxwd, pmovsxwd_xmm, Vdq, Wq) +DEF_GEN_INSN2_HELPER_EPP(vpmovsxwd, pmovsxwd_xmm, Vqq, Wdq) DEF_GEN_INSN2_HELPER_EPP(pmovsxwq, pmovsxwq_xmm, Vdq, Wd) DEF_GEN_INSN2_HELPER_EPP(vpmovsxwq, pmovsxwq_xmm, Vdq, Wd) +DEF_GEN_INSN2_HELPER_EPP(vpmovsxwq, pmovsxwq_xmm, Vqq, Wq) DEF_GEN_INSN2_HELPER_EPP(pmovsxdq, pmovsxdq_xmm, Vdq, Wq) DEF_GEN_INSN2_HELPER_EPP(vpmovsxdq, pmovsxdq_xmm, Vdq, Wq) +DEF_GEN_INSN2_HELPER_EPP(vpmovsxdq, pmovsxdq_xmm, Vqq, Wdq) DEF_GEN_INSN2_HELPER_EPP(pmovzxbw, pmovzxbw_xmm, Vdq, Wq) DEF_GEN_INSN2_HELPER_EPP(vpmovzxbw, pmovzxbw_xmm, Vdq, Wq) +DEF_GEN_INSN2_HELPER_EPP(vpmovzxbw, pmovzxbw_xmm, Vqq, Wdq) DEF_GEN_INSN2_HELPER_EPP(pmovzxbd, pmovzxbd_xmm, Vdq, Wd) DEF_GEN_INSN2_HELPER_EPP(vpmovzxbd, pmovzxbd_xmm, Vdq, Wd) +DEF_GEN_INSN2_HELPER_EPP(vpmovzxbd, pmovzxbd_xmm, Vqq, Wq) DEF_GEN_INSN2_HELPER_EPP(pmovzxbq, pmovzxbq_xmm, Vdq, Ww) DEF_GEN_INSN2_HELPER_EPP(vpmovzxbq, pmovzxbq_xmm, Vdq, Ww) +DEF_GEN_INSN2_HELPER_EPP(vpmovzxbq, pmovzxbq_xmm, Vqq, Wd) DEF_GEN_INSN2_HELPER_EPP(pmovzxwd, pmovzxwd_xmm, Vdq, Wq) DEF_GEN_INSN2_HELPER_EPP(vpmovzxwd, pmovzxwd_xmm, Vdq, Wq) +DEF_GEN_INSN2_HELPER_EPP(vpmovzxwd, pmovzxwd_xmm, Vqq, Wdq) DEF_GEN_INSN2_HELPER_EPP(pmovzxwq, pmovzxwq_xmm, Vdq, Wd) DEF_GEN_INSN2_HELPER_EPP(vpmovzxwq, pmovzxwq_xmm, Vdq, Wd) +DEF_GEN_INSN2_HELPER_EPP(vpmovzxwq, pmovzxwq_xmm, Vqq, Wq) DEF_GEN_INSN2_HELPER_EPP(pmovzxdq, pmovzxdq_xmm, Vdq, Wq) DEF_GEN_INSN2_HELPER_EPP(vpmovzxdq, pmovzxdq_xmm, Vdq, Wq) +DEF_GEN_INSN2_HELPER_EPP(vpmovzxdq, pmovzxdq_xmm, Vqq, Wdq) DEF_GEN_INSN2_HELPER_EPP(cvtpi2ps, cvtpi2ps, Vdq, Qq) DEF_GEN_INSN2_HELPER_EPD(cvtsi2ss, cvtsi2ss, Vd, Ed) @@ -7405,6 +7750,40 @@ GEN_INSN3(vmaskmovpd, Mqq, Hqq, Vqq) /* XXX TODO implement this */ } +GEN_INSN3(vpmaskmovd, Vdq, Hdq, Mdq) +{ + /* XXX TODO implement this */ +} +GEN_INSN3(vpmaskmovd, Mdq, Hdq, Vdq) +{ + /* XXX TODO implement this */ +} +GEN_INSN3(vpmaskmovd, Vqq, Hqq, Mqq) +{ + /* XXX TODO implement this */ +} +GEN_INSN3(vpmaskmovd, Mqq, Hqq, Vqq) +{ + /* XXX TODO implement this */ +} + +GEN_INSN3(vpmaskmovq, Vdq, Hdq, Mdq) +{ + /* XXX TODO implement this */ +} +GEN_INSN3(vpmaskmovq, Mdq, Hdq, Vdq) +{ + /* XXX TODO implement this */ +} +GEN_INSN3(vpmaskmovq, Vqq, Hqq, Mqq) +{ + /* XXX TODO implement this */ +} +GEN_INSN3(vpmaskmovq, Mqq, Hqq, Vqq) +{ + /* XXX TODO implement this */ +} + GEN_INSN2(movntps, Mdq, Vdq) { insnop_ldst(xmm, Mdq)(env, s, 1, arg2, arg1); @@ -7465,6 +7844,10 @@ GEN_INSN2(vmovntdqa, Vdq, Mdq) { gen_insn2(movntdqa, Vdq, Mdq)(env, s, arg1, arg2); } +GEN_INSN2(vmovntdqa, Vqq, Mqq) +{ + gen_insn2(movntdqa, Vdq, Mdq)(env, s, arg1, arg2); +} GEN_INSN0(pause) { From patchwork Wed Aug 21 17:29:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Bobek X-Patchwork-Id: 11108033 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 38F4313A4 for ; Wed, 21 Aug 2019 18:50:25 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E311222CE3 for ; Wed, 21 Aug 2019 18:50:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="mSE1z4Yt" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E311222CE3 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:52898 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0Vge-0006N2-5J for patchwork-qemu-devel@patchwork.kernel.org; Wed, 21 Aug 2019 14:50:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41610) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0US1-0001we-NG for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:31:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i0URs-0008Vm-JI for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:31:13 -0400 Received: from mail-yb1-xb42.google.com ([2607:f8b0:4864:20::b42]:39263) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i0URs-0008TO-9J for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:31:04 -0400 Received: by mail-yb1-xb42.google.com with SMTP id s142so1341874ybc.6 for ; Wed, 21 Aug 2019 10:31:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=haHkq8wm80JPY4AB0JTQyXnn+y86vOvKObkbhmKL+Ko=; b=mSE1z4YtfH3Oc2Z8ShZQb0G5iF3S/vSfkVMff/LQLAB30bidDqssDRcJwjOOTvQnmG XZith+5JQH0f2XuFkl42JqDUiH4z2RV+y8jcL7ngPaorIjYNDtmUWeVhHAuCjFGjDpHZ VpK2ZbyW6LO9gDZUew2i7NcR7Nzb7ZtAIUi6lJdEhQ7qP3lPUm5EG/E/D29rC4jfO+OJ h2+4HMsl/KT8w0iJ8FYC/XKKbjmrtFPnmlXrtvHEkx2uuhY4CeO0nEiafnSFpyd0asMA 5g+NxHcbHfe6m/rNKPe5L0iHGOr42QgkV392ieW+2X8mQZpi3n5yvPIXtEq99Ot8RGCS WIYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=haHkq8wm80JPY4AB0JTQyXnn+y86vOvKObkbhmKL+Ko=; b=U/UjGm9ywac9XkGlRtfJHn9VVNao34vlCHaBVaEYKkscrHEa65D8s/G7D8JUk5FaYS SRmbYoiwk1J7Z1roWHaeWxNrCtJszNreyukq1QycvNt/xn3+KRW9RbR4XUdvs1JB3Ltu LZGMO4P+f8YnmULDqxotaBk3/j2RFItmqIKD/D3D+I/skw5ldteytk+SGF6dLdZIhPDS yD2icb+/Y8eoQ7t85xS40lxknDUhYtNiKp1O6QOGr1+DsF0+xH3AN48BnQWdBkGcfeUR kkz743QJxfyUjI3ytdj0TianUzkeggfHnIJbT5zMhex4TeOIQcbY3dhj1mHxLJviwWHy lJAw== X-Gm-Message-State: APjAAAVR1CIWzCLdmL483ybdd8JkJ5pZ9EfQ7N5I0XwjWTVS4t1/dH60 2rMKRNUNkdXlv8qzn61Hhb+AfINq X-Google-Smtp-Source: APXvYqw4ZlAg53TeeE2mQ26LFWBGCzVrTIACK3Fe2oGflfxc2iJl4xaef3rM3rT1eFN8e47jQ760/A== X-Received: by 2002:a25:76ca:: with SMTP id r193mr26500848ybc.33.1566408661283; Wed, 21 Aug 2019 10:31:01 -0700 (PDT) Received: from localhost.localdomain ([2601:c0:c67f:e390::3]) by smtp.gmail.com with ESMTPSA id l71sm2826167ywl.39.2019.08.21.10.31.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Aug 2019 10:31:00 -0700 (PDT) From: Jan Bobek To: qemu-devel@nongnu.org Date: Wed, 21 Aug 2019 13:29:40 -0400 Message-Id: <20190821172951.15333-65-jan.bobek@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190821172951.15333-1-jan.bobek@gmail.com> References: <20190821172951.15333-1-jan.bobek@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::b42 Subject: [Qemu-devel] [RFC PATCH v4 64/75] target/i386: introduce AVX2 vector instructions to sse-opcode.inc.h X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jan Bobek , =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Add all the AVX2 vector instruction entries to sse-opcode.inc.h. Signed-off-by: Jan Bobek --- target/i386/sse-opcode.inc.h | 362 ++++++++++++++++++++++++++++++++++- 1 file changed, 359 insertions(+), 3 deletions(-) diff --git a/target/i386/sse-opcode.inc.h b/target/i386/sse-opcode.inc.h index c3c0ec4f89..abbb0a15d7 100644 --- a/target/i386/sse-opcode.inc.h +++ b/target/i386/sse-opcode.inc.h @@ -855,6 +855,181 @@ * VEX.128.66.0F.WIG 73 /3 ib VPSRLDQ xmm1, xmm2, imm8 * VEX.LZ.0F.WIG AE /2 VLDMXCSR m32 * VEX.LZ.0F.WIG AE /3 VSTMXCSR m32 + * + * AVX2 Instructions + * ------------------ + * VEX.256.66.0F.W0 D7 /r VPMOVMSKB r32, ymm1 + * VEX.256.66.0F.W1 D7 /r VPMOVMSKB r64, ymm1 + * VEX.256.66.0F.WIG FC /r VPADDB ymm1, ymm2, ymm3/m256 + * VEX.256.66.0F.WIG FD /r VPADDW ymm1, ymm2, ymm3/m256 + * VEX.256.66.0F.WIG FE /r VPADDD ymm1, ymm2, ymm3/m256 + * VEX.256.66.0F.WIG D4 /r VPADDQ ymm1, ymm2, ymm3/m256 + * VEX.256.66.0F.WIG EC /r VPADDSB ymm1, ymm2, ymm3/m256 + * VEX.256.66.0F.WIG ED /r VPADDSW ymm1, ymm2, ymm3/m256 + * VEX.256.66.0F.WIG DC /r VPADDUSB ymm1,ymm2,ymm3/m256 + * VEX.256.66.0F.WIG DD /r VPADDUSW ymm1,ymm2,ymm3/m256 + * VEX.256.66.0F38.WIG 01 /r VPHADDW ymm1, ymm2, ymm3/m256 + * VEX.256.66.0F38.WIG 02 /r VPHADDD ymm1, ymm2, ymm3/m256 + * VEX.256.66.0F38.WIG 03 /r VPHADDSW ymm1, ymm2, ymm3/m256 + * VEX.256.66.0F.WIG F8 /r VPSUBB ymm1, ymm2, ymm3/m256 + * VEX.256.66.0F.WIG F9 /r VPSUBW ymm1, ymm2, ymm3/m256 + * VEX.256.66.0F.WIG FA /r VPSUBD ymm1, ymm2, ymm3/m256 + * VEX.256.66.0F.WIG FB /r VPSUBQ ymm1, ymm2, ymm3/m256 + * VEX.256.66.0F.WIG E8 /r VPSUBSB ymm1, ymm2, ymm3/m256 + * VEX.256.66.0F.WIG E9 /r VPSUBSW ymm1, ymm2, ymm3/m256 + * VEX.256.66.0F.WIG D8 /r VPSUBUSB ymm1, ymm2, ymm3/m256 + * VEX.256.66.0F.WIG D9 /r VPSUBUSW ymm1, ymm2, ymm3/m256 + * VEX.256.66.0F38.WIG 05 /r VPHSUBW ymm1, ymm2, ymm3/m256 + * VEX.256.66.0F38.WIG 06 /r VPHSUBD ymm1, ymm2, ymm3/m256 + * VEX.256.66.0F38.WIG 07 /r VPHSUBSW ymm1, ymm2, ymm3/m256 + * VEX.256.66.0F.WIG D5 /r VPMULLW ymm1, ymm2, ymm3/m256 + * VEX.256.66.0F38.WIG 40 /r VPMULLD ymm1, ymm2, ymm3/m256 + * VEX.256.66.0F.WIG E5 /r VPMULHW ymm1, ymm2, ymm3/m256 + * VEX.256.66.0F.WIG E4 /r VPMULHUW ymm1, ymm2, ymm3/m256 + * VEX.256.66.0F38.WIG 28 /r VPMULDQ ymm1, ymm2, ymm3/m256 + * VEX.256.66.0F.WIG F4 /r VPMULUDQ ymm1, ymm2, ymm3/m256 + * VEX.256.66.0F38.WIG 0B /r VPMULHRSW ymm1, ymm2, ymm3/m256 + * VEX.256.66.0F.WIG F5 /r VPMADDWD ymm1, ymm2, ymm3/m256 + * VEX.256.66.0F38.WIG 04 /r VPMADDUBSW ymm1, ymm2, ymm3/m256 + * VEX.256.66.0F DA /r VPMINUB ymm1, ymm2, ymm3/m256 + * VEX.256.66.0F38 3A /r VPMINUW ymm1, ymm2, ymm3/m256 + * VEX.256.66.0F38.WIG 3B /r VPMINUD ymm1, ymm2, ymm3/m256 + * VEX.256.66.0F38 38 /r VPMINSB ymm1, ymm2, ymm3/m256 + * VEX.256.66.0F EA /r VPMINSW ymm1, ymm2, ymm3/m256 + * VEX.256.66.0F38.WIG 39 /r VPMINSD ymm1, ymm2, ymm3/m256 + * VEX.256.66.0F DE /r VPMAXUB ymm1, ymm2, ymm3/m256 + * VEX.256.66.0F38 3E /r VPMAXUW ymm1, ymm2, ymm3/m256 + * VEX.256.66.0F38.WIG 3F /r VPMAXUD ymm1, ymm2, ymm3/m256 + * VEX.256.66.0F38.WIG 3C /r VPMAXSB ymm1, ymm2, ymm3/m256 + * VEX.256.66.0F.WIG EE /r VPMAXSW ymm1, ymm2, ymm3/m256 + * VEX.256.66.0F38.WIG 3D /r VPMAXSD ymm1, ymm2, ymm3/m256 + * VEX.256.66.0F.WIG E0 /r VPAVGB ymm1, ymm2, ymm3/m256 + * VEX.256.66.0F.WIG E3 /r VPAVGW ymm1, ymm2, ymm3/m256 + * VEX.256.66.0F.WIG F6 /r VPSADBW ymm1, ymm2, ymm3/m256 + * VEX.256.66.0F3A.WIG 42 /r ib VMPSADBW ymm1, ymm2, ymm3/m256, imm8 + * VEX.256.66.0F38.WIG 1C /r VPABSB ymm1, ymm2/m256 + * VEX.256.66.0F38.WIG 1D /r VPABSW ymm1, ymm2/m256 + * VEX.256.66.0F38.WIG 1E /r VPABSD ymm1, ymm2/m256 + * VEX.256.66.0F38.WIG 08 /r VPSIGNB ymm1, ymm2, ymm3/m256 + * VEX.256.66.0F38.WIG 09 /r VPSIGNW ymm1, ymm2, ymm3/m256 + * VEX.256.66.0F38.WIG 0A /r VPSIGND ymm1, ymm2, ymm3/m256 + * VEX.256.66.0F.WIG 74 /r VPCMPEQB ymm1,ymm2,ymm3/m256 + * VEX.256.66.0F.WIG 75 /r VPCMPEQW ymm1,ymm2,ymm3/m256 + * VEX.256.66.0F.WIG 76 /r VPCMPEQD ymm1,ymm2,ymm3/m256 + * VEX.256.66.0F38.WIG 29 /r VPCMPEQQ ymm1, ymm2, ymm3/m256 + * VEX.256.66.0F.WIG 64 /r VPCMPGTB ymm1,ymm2,ymm3/m256 + * VEX.256.66.0F.WIG 65 /r VPCMPGTW ymm1,ymm2,ymm3/m256 + * VEX.256.66.0F.WIG 66 /r VPCMPGTD ymm1,ymm2,ymm3/m256 + * VEX.256.66.0F38.WIG 37 /r VPCMPGTQ ymm1, ymm2, ymm3/m256 + * VEX.256.66.0F.WIG DB /r VPAND ymm1, ymm2, ymm3/m256 + * VEX.256.66.0F.WIG DF /r VPANDN ymm1, ymm2, ymm3/m256 + * VEX.256.66.0F.WIG EB /r VPOR ymm1, ymm2, ymm3/m256 + * VEX.256.66.0F.WIG EF /r VPXOR ymm1, ymm2, ymm3/m256 + * VEX.256.66.0F.WIG F1 /r VPSLLW ymm1, ymm2, xmm3/m128 + * VEX.256.66.0F.WIG F2 /r VPSLLD ymm1, ymm2, xmm3/m128 + * VEX.256.66.0F.WIG F3 /r VPSLLQ ymm1, ymm2, xmm3/m128 + * VEX.128.66.0F38.W0 47 /r VPSLLVD xmm1, xmm2, xmm3/m128 + * VEX.256.66.0F38.W0 47 /r VPSLLVD ymm1, ymm2, ymm3/m256 + * VEX.128.66.0F38.W1 47 /r VPSLLVQ xmm1, xmm2, xmm3/m128 + * VEX.256.66.0F38.W1 47 /r VPSLLVQ ymm1, ymm2, ymm3/m256 + * VEX.256.66.0F.WIG D1 /r VPSRLW ymm1, ymm2, xmm3/m128 + * VEX.256.66.0F.WIG D2 /r VPSRLD ymm1, ymm2, xmm3/m128 + * VEX.256.66.0F.WIG D3 /r VPSRLQ ymm1, ymm2, xmm3/m128 + * VEX.128.66.0F38.W0 45 /r VPSRLVD xmm1, xmm2, xmm3/m128 + * VEX.256.66.0F38.W0 45 /r VPSRLVD ymm1, ymm2, ymm3/m256 + * VEX.128.66.0F38.W1 45 /r VPSRLVQ xmm1, xmm2, xmm3/m128 + * VEX.256.66.0F38.W1 45 /r VPSRLVQ ymm1, ymm2, ymm3/m256 + * VEX.256.66.0F.WIG E1 /r VPSRAW ymm1,ymm2,xmm3/m128 + * VEX.256.66.0F.WIG E2 /r VPSRAD ymm1,ymm2,xmm3/m128 + * VEX.128.66.0F38.W0 46 /r VPSRAVD xmm1, xmm2, xmm3/m128 + * VEX.256.66.0F38.W0 46 /r VPSRAVD ymm1, ymm2, ymm3/m256 + * VEX.256.66.0F3A.WIG 0F /r ib VPALIGNR ymm1, ymm2, ymm3/m256, imm8 + * VEX.256.66.0F.WIG 63 /r VPACKSSWB ymm1, ymm2, ymm3/m256 + * VEX.256.66.0F.WIG 6B /r VPACKSSDW ymm1, ymm2, ymm3/m256 + * VEX.256.66.0F.WIG 67 /r VPACKUSWB ymm1, ymm2, ymm3/m256 + * VEX.256.66.0F38 2B /r VPACKUSDW ymm1, ymm2, ymm3/m256 + * VEX.256.66.0F.WIG 68 /r VPUNPCKHBW ymm1, ymm2, ymm3/m256 + * VEX.256.66.0F.WIG 69 /r VPUNPCKHWD ymm1, ymm2, ymm3/m256 + * VEX.256.66.0F.WIG 6A /r VPUNPCKHDQ ymm1, ymm2, ymm3/m256 + * VEX.256.66.0F.WIG 6D /r VPUNPCKHQDQ ymm1, ymm2, ymm3/m256 + * VEX.256.66.0F.WIG 60 /r VPUNPCKLBW ymm1, ymm2, ymm3/m256 + * VEX.256.66.0F.WIG 61 /r VPUNPCKLWD ymm1, ymm2, ymm3/m256 + * VEX.256.66.0F.WIG 62 /r VPUNPCKLDQ ymm1, ymm2, ymm3/m256 + * VEX.256.66.0F.WIG 6C /r VPUNPCKLQDQ ymm1, ymm2, ymm3/m256 + * VEX.256.66.0F38.WIG 00 /r VPSHUFB ymm1, ymm2, ymm3/m256 + * VEX.256.F2.0F.WIG 70 /r ib VPSHUFLW ymm1, ymm2/m256, imm8 + * VEX.256.F3.0F.WIG 70 /r ib VPSHUFHW ymm1, ymm2/m256, imm8 + * VEX.256.66.0F.WIG 70 /r ib VPSHUFD ymm1, ymm2/m256, imm8 + * VEX.256.66.0F3A.W0 4C /r /is4 VPBLENDVB ymm1, ymm2, ymm3/m256, ymm4 + * VEX.256.66.0F3A.WIG 0E /r ib VPBLENDW ymm1, ymm2, ymm3/m256, imm8 + * VEX.128.66.0F3A.W0 02 /r ib VPBLENDD xmm1, xmm2, xmm3/m128, imm8 + * VEX.256.66.0F3A.W0 02 /r ib VPBLENDD ymm1, ymm2, ymm3/m256, imm8 + * VEX.256.66.0F3A.W0 38 /r ib VINSERTI128 ymm1, ymm2, xmm3/m128, imm8 + * VEX.256.66.0F3A.W0 39 /r ib VEXTRACTI128 xmm1/m128, ymm2, imm8 + * VEX.128.66.0F38.W0 78 /r VPBROADCASTB xmm1,xmm2/m8 + * VEX.256.66.0F38.W0 78 /r VPBROADCASTB ymm1,xmm2/m8 + * VEX.128.66.0F38.W0 79 /r VPBROADCASTW xmm1,xmm2/m16 + * VEX.256.66.0F38.W0 79 /r VPBROADCASTW ymm1,xmm2/m16 + * VEX.128.66.0F38.W0 58 /r VPBROADCASTD xmm1,xmm2/m32 + * VEX.256.66.0F38.W0 58 /r VPBROADCASTD ymm1,xmm2/m32 + * VEX.128.66.0F38.W0 59 /r VPBROADCASTQ xmm1,xmm2/m64 + * VEX.256.66.0F38.W0 59 /r VPBROADCASTQ ymm1,xmm2/m64 + * VEX.128.66.0F38.W0 18 /r VBROADCASTSS xmm1, xmm2 + * VEX.256.66.0F38.W0 18 /r VBROADCASTSS ymm1, xmm2 + * VEX.256.66.0F38.W0 19 /r VBROADCASTSD ymm1, xmm2 + * VEX.256.66.0F38.W0 5A /r VBROADCASTI128 ymm1,m128 + * VEX.256.66.0F3A.W0 46 /r ib VPERM2I128 ymm1, ymm2, ymm3/m256, imm8 + * VEX.256.66.0F38.W0 36 /r VPERMD ymm1, ymm2, ymm3/m256 + * VEX.256.66.0F38.W0 16 /r VPERMPS ymm1, ymm2, ymm3/m256 + * VEX.256.66.0F3A.W1 00 /r ib VPERMQ ymm1, ymm2/m256, imm8 + * VEX.256.66.0F3A.W1 01 /r ib VPERMPD ymm1, ymm2/m256, imm8 + * VEX.128.66.0F38.W0 92 /r VGATHERDPS xmm1, vm32x, xmm2 + * VEX.256.66.0F38.W0 92 /r VGATHERDPS ymm1, vm32y, ymm2 + * VEX.128.66.0F38.W1 92 /r VGATHERDPD xmm1, vm32x, xmm2 + * VEX.256.66.0F38.W1 92 /r VGATHERDPD ymm1, vm32x, ymm2 + * VEX.128.66.0F38.W0 93 /r VGATHERQPS xmm1, vm64x, xmm2 + * VEX.256.66.0F38.W0 93 /r VGATHERQPS xmm1, vm64y, xmm2 + * VEX.128.66.0F38.W1 93 /r VGATHERQPD xmm1, vm64x, xmm2 + * VEX.256.66.0F38.W1 93 /r VGATHERQPD ymm1, vm64y, ymm2 + * VEX.128.66.0F38.W0 90 /r VPGATHERDD xmm1, vm32x, xmm2 + * VEX.256.66.0F38.W0 90 /r VPGATHERDD ymm1, vm32y, ymm2 + * VEX.128.66.0F38.W1 90 /r VPGATHERDQ xmm1, vm32x, xmm2 + * VEX.256.66.0F38.W1 90 /r VPGATHERDQ ymm1, vm32x, ymm2 + * VEX.128.66.0F38.W0 91 /r VPGATHERQD xmm1, vm64x, xmm2 + * VEX.256.66.0F38.W0 91 /r VPGATHERQD xmm1, vm64y, xmm2 + * VEX.128.66.0F38.W1 91 /r VPGATHERQQ xmm1, vm64x, xmm2 + * VEX.256.66.0F38.W1 91 /r VPGATHERQQ ymm1, vm64y, ymm2 + * VEX.256.66.0F38.WIG 20 /r VPMOVSXBW ymm1, xmm2/m128 + * VEX.256.66.0F38.WIG 21 /r VPMOVSXBD ymm1, xmm2/m64 + * VEX.256.66.0F38.WIG 22 /r VPMOVSXBQ ymm1, xmm2/m32 + * VEX.256.66.0F38.WIG 23 /r VPMOVSXWD ymm1, xmm2/m128 + * VEX.256.66.0F38.WIG 24 /r VPMOVSXWQ ymm1, xmm2/m64 + * VEX.256.66.0F38.WIG 25 /r VPMOVSXDQ ymm1, xmm2/m128 + * VEX.256.66.0F38.WIG 30 /r VPMOVZXBW ymm1, xmm2/m128 + * VEX.256.66.0F38.WIG 31 /r VPMOVZXBD ymm1, xmm2/m64 + * VEX.256.66.0F38.WIG 32 /r VPMOVZXBQ ymm1, xmm2/m32 + * VEX.256.66.0F38.WIG 33 /r VPMOVZXWD ymm1, xmm2/m128 + * VEX.256.66.0F38.WIG 34 /r VPMOVZXWQ ymm1, xmm2/m64 + * VEX.256.66.0F38.WIG 35 /r VPMOVZXDQ ymm1, xmm2/m128 + * VEX.128.66.0F38.W0 8C /r VPMASKMOVD xmm1, xmm2, m128 + * VEX.128.66.0F38.W0 8E /r VPMASKMOVD m128, xmm1, xmm2 + * VEX.256.66.0F38.W0 8C /r VPMASKMOVD ymm1, ymm2, m256 + * VEX.256.66.0F38.W0 8E /r VPMASKMOVD m256, ymm1, ymm2 + * VEX.128.66.0F38.W1 8C /r VPMASKMOVQ xmm1, xmm2, m128 + * VEX.128.66.0F38.W1 8E /r VPMASKMOVQ m128, xmm1, xmm2 + * VEX.256.66.0F38.W1 8C /r VPMASKMOVQ ymm1, ymm2, m256 + * VEX.256.66.0F38.W1 8E /r VPMASKMOVQ m256, ymm1, ymm2 + * VEX.256.66.0F38.WIG 2A /r VMOVNTDQA ymm1, m256 + * VEX.256.66.0F.WIG 71 /6 ib VPSLLW ymm1, ymm2, imm8 + * VEX.256.66.0F.WIG 71 /2 ib VPSRLW ymm1, ymm2, imm8 + * VEX.256.66.0F.WIG 71 /4 ib VPSRAW ymm1,ymm2,imm8 + * VEX.256.66.0F.WIG 72 /6 ib VPSLLD ymm1, ymm2, imm8 + * VEX.256.66.0F.WIG 72 /2 ib VPSRLD ymm1, ymm2, imm8 + * VEX.256.66.0F.WIG 72 /4 ib VPSRAD ymm1,ymm2,imm8 + * VEX.256.66.0F.WIG 73 /6 ib VPSLLQ ymm1, ymm2, imm8 + * VEX.256.66.0F.WIG 73 /7 ib VPSLLDQ ymm1, ymm2, imm8 + * VEX.256.66.0F.WIG 73 /2 ib VPSRLQ ymm1, ymm2, imm8 + * VEX.256.66.0F.WIG 73 /3 ib VPSRLDQ ymm1, ymm2, imm8 */ OPCODE(movd, LEG(NP, 0F, 0, 0x6e), MMX, WR, Pq, Ed) @@ -943,6 +1118,8 @@ OPCODE(pmovmskb, LEG(66, 0F, 0, 0xd7), SSE2, WR, Gd, Udq) OPCODE(pmovmskb, LEG(66, 0F, 1, 0xd7), SSE2, WR, Gq, Udq) OPCODE(vpmovmskb, VEX(128, 66, 0F, 0, 0xd7), AVX, WR, Gd, Udq) OPCODE(vpmovmskb, VEX(128, 66, 0F, 1, 0xd7), AVX, WR, Gq, Udq) +OPCODE(vpmovmskb, VEX(256, 66, 0F, 0, 0xd7), AVX2, WR, Gd, Uqq) +OPCODE(vpmovmskb, VEX(256, 66, 0F, 1, 0xd7), AVX2, WR, Gq, Uqq) OPCODE(movmskps, LEG(NP, 0F, 0, 0x50), SSE, WR, Gd, Udq) OPCODE(movmskps, LEG(NP, 0F, 1, 0x50), SSE, WR, Gq, Udq) OPCODE(vmovmskps, VEX(128, NP, 0F, 0, 0x50), AVX, WR, Gd, Udq) @@ -970,27 +1147,35 @@ OPCODE(vmovddup, VEX(256, F2, 0F, IG, 0x12), AVX, WR, Vqq, Wqq) OPCODE(paddb, LEG(NP, 0F, 0, 0xfc), MMX, WRR, Pq, Pq, Qq) OPCODE(paddb, LEG(66, 0F, 0, 0xfc), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(vpaddb, VEX(128, 66, 0F, IG, 0xfc), AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(vpaddb, VEX(256, 66, 0F, IG, 0xfc), AVX2, WRR, Vqq, Hqq, Wqq) OPCODE(paddw, LEG(NP, 0F, 0, 0xfd), MMX, WRR, Pq, Pq, Qq) OPCODE(paddw, LEG(66, 0F, 0, 0xfd), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(vpaddw, VEX(128, 66, 0F, IG, 0xfd), AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(vpaddw, VEX(256, 66, 0F, IG, 0xfd), AVX2, WRR, Vqq, Hqq, Wqq) OPCODE(paddd, LEG(NP, 0F, 0, 0xfe), MMX, WRR, Pq, Pq, Qq) OPCODE(paddd, LEG(66, 0F, 0, 0xfe), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(vpaddd, VEX(128, 66, 0F, IG, 0xfe), AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(vpaddd, VEX(256, 66, 0F, IG, 0xfe), AVX2, WRR, Vqq, Hqq, Wqq) OPCODE(paddq, LEG(NP, 0F, 0, 0xd4), SSE2, WRR, Pq, Pq, Qq) OPCODE(paddq, LEG(66, 0F, 0, 0xd4), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(vpaddq, VEX(128, 66, 0F, IG, 0xd4), AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(vpaddq, VEX(256, 66, 0F, IG, 0xd4), AVX2, WRR, Vqq, Hqq, Wqq) OPCODE(paddsb, LEG(NP, 0F, 0, 0xec), MMX, WRR, Pq, Pq, Qq) OPCODE(paddsb, LEG(66, 0F, 0, 0xec), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(vpaddsb, VEX(128, 66, 0F, IG, 0xec), AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(vpaddsb, VEX(256, 66, 0F, IG, 0xec), AVX2, WRR, Vqq, Hqq, Wqq) OPCODE(paddsw, LEG(NP, 0F, 0, 0xed), MMX, WRR, Pq, Pq, Qq) OPCODE(paddsw, LEG(66, 0F, 0, 0xed), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(vpaddsw, VEX(128, 66, 0F, IG, 0xed), AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(vpaddsw, VEX(256, 66, 0F, IG, 0xed), AVX2, WRR, Vqq, Hqq, Wqq) OPCODE(paddusb, LEG(NP, 0F, 0, 0xdc), MMX, WRR, Pq, Pq, Qq) OPCODE(paddusb, LEG(66, 0F, 0, 0xdc), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(vpaddusb, VEX(128, 66, 0F, IG, 0xdc), AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(vpaddusb, VEX(256, 66, 0F, IG, 0xdc), AVX2, WRR, Vqq, Hqq, Wqq) OPCODE(paddusw, LEG(NP, 0F, 0, 0xdd), MMX, WRR, Pq, Pq, Qq) OPCODE(paddusw, LEG(66, 0F, 0, 0xdd), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(vpaddusw, VEX(128, 66, 0F, IG, 0xdd), AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(vpaddusw, VEX(256, 66, 0F, IG, 0xdd), AVX2, WRR, Vqq, Hqq, Wqq) OPCODE(addps, LEG(NP, 0F, 0, 0x58), SSE, WRR, Vdq, Vdq, Wdq) OPCODE(vaddps, VEX(128, NP, 0F, IG, 0x58), AVX, WRR, Vdq, Hdq, Wdq) OPCODE(vaddps, VEX(256, NP, 0F, IG, 0x58), AVX, WRR, Vqq, Hqq, Wqq) @@ -1004,12 +1189,15 @@ OPCODE(vaddsd, VEX(IG, F2, 0F, IG, 0x58), AVX, WRR, Vq, Hq, Wq) OPCODE(phaddw, LEG(NP, 0F38, 0, 0x01), SSSE3, WRR, Pq, Pq, Qq) OPCODE(phaddw, LEG(66, 0F38, 0, 0x01), SSSE3, WRR, Vdq, Vdq, Wdq) OPCODE(vphaddw, VEX(128, 66, 0F38, IG, 0x01), AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(vphaddw, VEX(256, 66, 0F38, IG, 0x01), AVX2, WRR, Vqq, Hqq, Wqq) OPCODE(phaddd, LEG(NP, 0F38, 0, 0x02), SSSE3, WRR, Pq, Pq, Qq) OPCODE(phaddd, LEG(66, 0F38, 0, 0x02), SSSE3, WRR, Vdq, Vdq, Wdq) OPCODE(vphaddd, VEX(128, 66, 0F38, IG, 0x02), AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(vphaddd, VEX(256, 66, 0F38, IG, 0x02), AVX2, WRR, Vqq, Hqq, Wqq) OPCODE(phaddsw, LEG(NP, 0F38, 0, 0x03), SSSE3, WRR, Pq, Pq, Qq) OPCODE(phaddsw, LEG(66, 0F38, 0, 0x03), SSSE3, WRR, Vdq, Vdq, Wdq) OPCODE(vphaddsw, VEX(128, 66, 0F38, IG, 0x03), AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(vphaddsw, VEX(256, 66, 0F38, IG, 0x03), AVX2, WRR, Vqq, Hqq, Wqq) OPCODE(haddps, LEG(F2, 0F, 0, 0x7c), SSE3, WRR, Vdq, Vdq, Wdq) OPCODE(vhaddps, VEX(128, F2, 0F, IG, 0x7c), AVX, WRR, Vdq, Hdq, Wdq) OPCODE(vhaddps, VEX(256, F2, 0F, IG, 0x7c), AVX, WRR, Vqq, Hqq, Wqq) @@ -1019,27 +1207,35 @@ OPCODE(vhaddpd, VEX(256, 66, 0F, IG, 0x7c), AVX, WRR, Vqq, Hqq, Wqq) OPCODE(psubb, LEG(NP, 0F, 0, 0xf8), MMX, WRR, Pq, Pq, Qq) OPCODE(psubb, LEG(66, 0F, 0, 0xf8), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(vpsubb, VEX(128, 66, 0F, IG, 0xf8), AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(vpsubb, VEX(256, 66, 0F, IG, 0xf8), AVX2, WRR, Vqq, Hqq, Wqq) OPCODE(psubw, LEG(NP, 0F, 0, 0xf9), MMX, WRR, Pq, Pq, Qq) OPCODE(psubw, LEG(66, 0F, 0, 0xf9), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(vpsubw, VEX(128, 66, 0F, IG, 0xf9), AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(vpsubw, VEX(256, 66, 0F, IG, 0xf9), AVX2, WRR, Vqq, Hqq, Wqq) OPCODE(psubd, LEG(NP, 0F, 0, 0xfa), MMX, WRR, Pq, Pq, Qq) OPCODE(psubd, LEG(66, 0F, 0, 0xfa), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(vpsubd, VEX(128, 66, 0F, IG, 0xfa), AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(vpsubd, VEX(256, 66, 0F, IG, 0xfa), AVX2, WRR, Vqq, Hqq, Wqq) OPCODE(psubq, LEG(NP, 0F, 0, 0xfb), SSE2, WRR, Pq, Pq, Qq) OPCODE(psubq, LEG(66, 0F, 0, 0xfb), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(vpsubq, VEX(128, 66, 0F, IG, 0xfb), AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(vpsubq, VEX(256, 66, 0F, IG, 0xfb), AVX2, WRR, Vqq, Hqq, Wqq) OPCODE(psubsb, LEG(NP, 0F, 0, 0xe8), MMX, WRR, Pq, Pq, Qq) OPCODE(psubsb, LEG(66, 0F, 0, 0xe8), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(vpsubsb, VEX(128, 66, 0F, IG, 0xe8), AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(vpsubsb, VEX(256, 66, 0F, IG, 0xe8), AVX2, WRR, Vqq, Hqq, Wqq) OPCODE(psubsw, LEG(NP, 0F, 0, 0xe9), MMX, WRR, Pq, Pq, Qq) OPCODE(psubsw, LEG(66, 0F, 0, 0xe9), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(vpsubsw, VEX(128, 66, 0F, IG, 0xe9), AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(vpsubsw, VEX(256, 66, 0F, IG, 0xe9), AVX2, WRR, Vqq, Hqq, Wqq) OPCODE(psubusb, LEG(NP, 0F, 0, 0xd8), MMX, WRR, Pq, Pq, Qq) OPCODE(psubusb, LEG(66, 0F, 0, 0xd8), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(vpsubusb, VEX(128, 66, 0F, IG, 0xd8), AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(vpsubusb, VEX(256, 66, 0F, IG, 0xd8), AVX2, WRR, Vqq, Hqq, Wqq) OPCODE(psubusw, LEG(NP, 0F, 0, 0xd9), MMX, WRR, Pq, Pq, Qq) OPCODE(psubusw, LEG(66, 0F, 0, 0xd9), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(vpsubusw, VEX(128, 66, 0F, IG, 0xd9), AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(vpsubusw, VEX(256, 66, 0F, IG, 0xd9), AVX2, WRR, Vqq, Hqq, Wqq) OPCODE(subps, LEG(NP, 0F, 0, 0x5c), SSE, WRR, Vdq, Vdq, Wdq) OPCODE(vsubps, VEX(128, NP, 0F, IG, 0x5c), AVX, WRR, Vdq, Hdq, Wdq) OPCODE(vsubps, VEX(256, NP, 0F, IG, 0x5c), AVX, WRR, Vqq, Hqq, Wqq) @@ -1053,12 +1249,15 @@ OPCODE(vsubsd, VEX(IG, F2, 0F, IG, 0x5c), AVX, WRR, Vq, Hq, Wq) OPCODE(phsubw, LEG(NP, 0F38, 0, 0x05), SSSE3, WRR, Pq, Pq, Qq) OPCODE(phsubw, LEG(66, 0F38, 0, 0x05), SSSE3, WRR, Vdq, Vdq, Wdq) OPCODE(vphsubw, VEX(128, 66, 0F38, IG, 0x05), AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(vphsubw, VEX(256, 66, 0F38, IG, 0x05), AVX2, WRR, Vqq, Hqq, Wqq) OPCODE(phsubd, LEG(NP, 0F38, 0, 0x06), SSSE3, WRR, Pq, Pq, Qq) OPCODE(phsubd, LEG(66, 0F38, 0, 0x06), SSSE3, WRR, Vdq, Vdq, Wdq) OPCODE(vphsubd, VEX(128, 66, 0F38, IG, 0x06), AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(vphsubd, VEX(256, 66, 0F38, IG, 0x06), AVX2, WRR, Vqq, Hqq, Wqq) OPCODE(phsubsw, LEG(NP, 0F38, 0, 0x07), SSSE3, WRR, Pq, Pq, Qq) OPCODE(phsubsw, LEG(66, 0F38, 0, 0x07), SSSE3, WRR, Vdq, Vdq, Wdq) OPCODE(vphsubsw, VEX(128, 66, 0F38, IG, 0x07), AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(vphsubsw, VEX(256, 66, 0F38, IG, 0x07), AVX2, WRR, Vqq, Hqq, Wqq) OPCODE(hsubps, LEG(F2, 0F, 0, 0x7d), SSE3, WRR, Vdq, Vdq, Wdq) OPCODE(vhsubps, VEX(128, F2, 0F, IG, 0x7d), AVX, WRR, Vdq, Hdq, Wdq) OPCODE(vhsubps, VEX(256, F2, 0F, IG, 0x7d), AVX, WRR, Vqq, Hqq, Wqq) @@ -1074,22 +1273,29 @@ OPCODE(vaddsubpd, VEX(256, 66, 0F, IG, 0xd0), AVX, WRR, Vqq, Hqq, Wqq) OPCODE(pmullw, LEG(NP, 0F, 0, 0xd5), MMX, WRR, Pq, Pq, Qq) OPCODE(pmullw, LEG(66, 0F, 0, 0xd5), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(vpmullw, VEX(128, 66, 0F, IG, 0xd5), AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(vpmullw, VEX(256, 66, 0F, IG, 0xd5), AVX2, WRR, Vqq, Hqq, Wqq) OPCODE(pmulld, LEG(66, 0F38, 0, 0x40), SSE4_1, WRR, Vdq, Vdq, Wdq) OPCODE(vpmulld, VEX(128, 66, 0F38, IG, 0x40), AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(vpmulld, VEX(256, 66, 0F38, IG, 0x40), AVX2, WRR, Vqq, Hqq, Wqq) OPCODE(pmulhw, LEG(NP, 0F, 0, 0xe5), MMX, WRR, Pq, Pq, Qq) OPCODE(pmulhw, LEG(66, 0F, 0, 0xe5), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(vpmulhw, VEX(128, 66, 0F, IG, 0xe5), AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(vpmulhw, VEX(256, 66, 0F, IG, 0xe5), AVX2, WRR, Vqq, Hqq, Wqq) OPCODE(pmulhuw, LEG(NP, 0F, 0, 0xe4), SSE, WRR, Pq, Pq, Qq) OPCODE(pmulhuw, LEG(66, 0F, 0, 0xe4), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(vpmulhuw, VEX(128, 66, 0F, IG, 0xe4), AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(vpmulhuw, VEX(256, 66, 0F, IG, 0xe4), AVX2, WRR, Vqq, Hqq, Wqq) OPCODE(pmuldq, LEG(66, 0F38, 0, 0x28), SSE4_1, WRR, Vdq, Vdq, Wdq) OPCODE(vpmuldq, VEX(128, 66, 0F38, IG, 0x28), AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(vpmuldq, VEX(256, 66, 0F38, IG, 0x28), AVX2, WRR, Vqq, Hqq, Wqq) OPCODE(pmuludq, LEG(NP, 0F, 0, 0xf4), SSE2, WRR, Pq, Pq, Qq) OPCODE(pmuludq, LEG(66, 0F, 0, 0xf4), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(vpmuludq, VEX(128, 66, 0F, IG, 0xf4), AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(vpmuludq, VEX(256, 66, 0F, IG, 0xf4), AVX2, WRR, Vqq, Hqq, Wqq) OPCODE(pmulhrsw, LEG(NP, 0F38, 0, 0x0b), SSSE3, WRR, Pq, Pq, Qq) OPCODE(pmulhrsw, LEG(66, 0F38, 0, 0x0b), SSSE3, WRR, Vdq, Vdq, Wdq) OPCODE(vpmulhrsw, VEX(128, 66, 0F38, IG, 0x0b), AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(vpmulhrsw, VEX(256, 66, 0F38, IG, 0x0b), AVX2, WRR, Vqq, Hqq, Wqq) OPCODE(mulps, LEG(NP, 0F, 0, 0x59), SSE, WRR, Vdq, Vdq, Wdq) OPCODE(vmulps, VEX(128, NP, 0F, IG, 0x59), AVX, WRR, Vdq, Hdq, Wdq) OPCODE(vmulps, VEX(256, NP, 0F, IG, 0x59), AVX, WRR, Vqq, Hqq, Wqq) @@ -1103,9 +1309,11 @@ OPCODE(vmulsd, VEX(IG, F2, 0F, IG, 0x59), AVX, WRR, Vq, Hq, Wq) OPCODE(pmaddwd, LEG(NP, 0F, 0, 0xf5), MMX, WRR, Pq, Pq, Qq) OPCODE(pmaddwd, LEG(66, 0F, 0, 0xf5), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(vpmaddwd, VEX(128, 66, 0F, IG, 0xf5), AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(vpmaddwd, VEX(256, 66, 0F, IG, 0xf5), AVX2, WRR, Vqq, Hqq, Wqq) OPCODE(pmaddubsw, LEG(NP, 0F38, 0, 0x04), SSSE3, WRR, Pq, Pq, Qq) OPCODE(pmaddubsw, LEG(66, 0F38, 0, 0x04), SSSE3, WRR, Vdq, Vdq, Wdq) OPCODE(vpmaddubsw, VEX(128, 66, 0F38, IG, 0x04), AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(vpmaddubsw, VEX(256, 66, 0F38, IG, 0x04), AVX2, WRR, Vqq, Hqq, Wqq) OPCODE(divps, LEG(NP, 0F, 0, 0x5e), SSE, WRR, Vdq, Vdq, Wdq) OPCODE(vdivps, VEX(128, NP, 0F, IG, 0x5e), AVX, WRR, Vdq, Hdq, Wdq) OPCODE(vdivps, VEX(256, NP, 0F, IG, 0x5e), AVX, WRR, Vqq, Hqq, Wqq) @@ -1139,17 +1347,23 @@ OPCODE(vrsqrtss, VEX(IG, F3, 0F, IG, 0x52), AVX, WRR, Vd, Hd, Wd) OPCODE(pminub, LEG(NP, 0F, 0, 0xda), SSE, WRR, Pq, Pq, Qq) OPCODE(pminub, LEG(66, 0F, 0, 0xda), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(vpminub, VEX(128, 66, 0F, IG, 0xda), AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(vpminub, VEX(256, 66, 0F, IG, 0xda), AVX2, WRR, Vqq, Hqq, Wqq) OPCODE(pminuw, LEG(66, 0F38, 0, 0x3a), SSE4_1, WRR, Vdq, Vdq, Wdq) OPCODE(vpminuw, VEX(128, 66, 0F38, IG, 0x3a), AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(vpminuw, VEX(256, 66, 0F38, IG, 0x3a), AVX2, WRR, Vqq, Hqq, Wqq) OPCODE(pminud, LEG(66, 0F38, 0, 0x3b), SSE4_1, WRR, Vdq, Vdq, Wdq) OPCODE(vpminud, VEX(128, 66, 0F38, IG, 0x3b), AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(vpminud, VEX(256, 66, 0F38, IG, 0x3b), AVX2, WRR, Vqq, Hqq, Wqq) OPCODE(pminsb, LEG(66, 0F38, 0, 0x38), SSE4_1, WRR, Vdq, Vdq, Wdq) OPCODE(vpminsb, VEX(128, 66, 0F38, IG, 0x38), AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(vpminsb, VEX(256, 66, 0F38, IG, 0x38), AVX2, WRR, Vqq, Hqq, Wqq) OPCODE(pminsw, LEG(NP, 0F, 0, 0xea), SSE, WRR, Pq, Pq, Qq) OPCODE(pminsw, LEG(66, 0F, 0, 0xea), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(vpminsw, VEX(128, 66, 0F, IG, 0xea), AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(vpminsw, VEX(256, 66, 0F, IG, 0xea), AVX2, WRR, Vqq, Hqq, Wqq) OPCODE(pminsd, LEG(66, 0F38, 0, 0x39), SSE4_1, WRR, Vdq, Vdq, Wdq) OPCODE(vpminsd, VEX(128, 66, 0F38, IG, 0x39), AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(vpminsd, VEX(256, 66, 0F38, IG, 0x39), AVX2, WRR, Vqq, Hqq, Wqq) OPCODE(minps, LEG(NP, 0F, 0, 0x5d), SSE, WRR, Vdq, Vdq, Wdq) OPCODE(vminps, VEX(128, NP, 0F, IG, 0x5d), AVX, WRR, Vdq, Hdq, Wdq) OPCODE(vminps, VEX(256, NP, 0F, IG, 0x5d), AVX, WRR, Vqq, Hqq, Wqq) @@ -1165,17 +1379,23 @@ OPCODE(vphminposuw, VEX(128, 66, 0F38, IG, 0x41), AVX, WR, Vdq, Wdq) OPCODE(pmaxub, LEG(NP, 0F, 0, 0xde), SSE, WRR, Pq, Pq, Qq) OPCODE(pmaxub, LEG(66, 0F, 0, 0xde), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(vpmaxub, VEX(128, 66, 0F, IG, 0xde), AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(vpmaxub, VEX(256, 66, 0F, IG, 0xde), AVX2, WRR, Vqq, Hqq, Wqq) OPCODE(pmaxuw, LEG(66, 0F38, 0, 0x3e), SSE4_1, WRR, Vdq, Vdq, Wdq) OPCODE(vpmaxuw, VEX(128, 66, 0F38, IG, 0x3e), AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(vpmaxuw, VEX(256, 66, 0F38, IG, 0x3e), AVX2, WRR, Vqq, Hqq, Wqq) OPCODE(pmaxud, LEG(66, 0F38, 0, 0x3f), SSE4_1, WRR, Vdq, Vdq, Wdq) OPCODE(vpmaxud, VEX(128, 66, 0F38, IG, 0x3f), AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(vpmaxud, VEX(256, 66, 0F38, IG, 0x3f), AVX2, WRR, Vqq, Hqq, Wqq) OPCODE(pmaxsb, LEG(66, 0F38, 0, 0x3c), SSE4_1, WRR, Vdq, Vdq, Wdq) OPCODE(vpmaxsb, VEX(128, 66, 0F38, IG, 0x3c), AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(vpmaxsb, VEX(256, 66, 0F38, IG, 0x3c), AVX2, WRR, Vqq, Hqq, Wqq) OPCODE(pmaxsw, LEG(NP, 0F, 0, 0xee), SSE, WRR, Pq, Pq, Qq) OPCODE(pmaxsw, LEG(66, 0F, 0, 0xee), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(vpmaxsw, VEX(128, 66, 0F, IG, 0xee), AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(vpmaxsw, VEX(256, 66, 0F, IG, 0xee), AVX2, WRR, Vqq, Hqq, Wqq) OPCODE(pmaxsd, LEG(66, 0F38, 0, 0x3d), SSE4_1, WRR, Vdq, Vdq, Wdq) OPCODE(vpmaxsd, VEX(128, 66, 0F38, IG, 0x3d), AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(vpmaxsd, VEX(256, 66, 0F38, IG, 0x3d), AVX2, WRR, Vqq, Hqq, Wqq) OPCODE(maxps, LEG(NP, 0F, 0, 0x5f), SSE, WRR, Vdq, Vdq, Wdq) OPCODE(vmaxps, VEX(128, NP, 0F, IG, 0x5f), AVX, WRR, Vdq, Hdq, Wdq) OPCODE(vmaxps, VEX(256, NP, 0F, IG, 0x5f), AVX, WRR, Vqq, Hqq, Wqq) @@ -1189,32 +1409,42 @@ OPCODE(vmaxsd, VEX(IG, F2, 0F, IG, 0x5f), AVX, WRR, Vq, Hq, Wq) OPCODE(pavgb, LEG(NP, 0F, 0, 0xe0), SSE, WRR, Pq, Pq, Qq) OPCODE(pavgb, LEG(66, 0F, 0, 0xe0), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(vpavgb, VEX(128, 66, 0F, IG, 0xe0), AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(vpavgb, VEX(256, 66, 0F, IG, 0xe0), AVX2, WRR, Vqq, Hqq, Wqq) OPCODE(pavgw, LEG(NP, 0F, 0, 0xe3), SSE, WRR, Pq, Pq, Qq) OPCODE(pavgw, LEG(66, 0F, 0, 0xe3), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(vpavgw, VEX(128, 66, 0F, IG, 0xe3), AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(vpavgw, VEX(256, 66, 0F, IG, 0xe3), AVX2, WRR, Vqq, Hqq, Wqq) OPCODE(psadbw, LEG(NP, 0F, 0, 0xf6), SSE, WRR, Pq, Pq, Qq) OPCODE(psadbw, LEG(66, 0F, 0, 0xf6), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(vpsadbw, VEX(128, 66, 0F, IG, 0xf6), AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(vpsadbw, VEX(256, 66, 0F, IG, 0xf6), AVX2, WRR, Vqq, Hqq, Wqq) OPCODE(mpsadbw, LEG(66, 0F3A, 0, 0x42), SSE4_1, WRRR, Vdq, Vdq, Wdq, Ib) OPCODE(vmpsadbw, VEX(128, 66, 0F3A, IG, 0x42), AVX, WRRR, Vdq, Hdq, Wdq, Ib) +OPCODE(vmpsadbw, VEX(256, 66, 0F3A, IG, 0x42), AVX2, WRRR, Vqq, Hqq, Wqq, Ib) OPCODE(pabsb, LEG(NP, 0F38, 0, 0x1c), SSSE3, WR, Pq, Qq) OPCODE(pabsb, LEG(66, 0F38, 0, 0x1c), SSSE3, WR, Vdq, Wdq) OPCODE(vpabsb, VEX(128, 66, 0F38, IG, 0x1c), AVX, WR, Vdq, Wdq) +OPCODE(vpabsb, VEX(256, 66, 0F38, IG, 0x1c), AVX2, WR, Vqq, Wqq) OPCODE(pabsw, LEG(NP, 0F38, 0, 0x1d), SSSE3, WR, Pq, Qq) OPCODE(pabsw, LEG(66, 0F38, 0, 0x1d), SSSE3, WR, Vdq, Wdq) OPCODE(vpabsw, VEX(128, 66, 0F38, IG, 0x1d), AVX, WR, Vdq, Wdq) +OPCODE(vpabsw, VEX(256, 66, 0F38, IG, 0x1d), AVX2, WR, Vqq, Wqq) OPCODE(pabsd, LEG(NP, 0F38, 0, 0x1e), SSSE3, WR, Pq, Qq) OPCODE(pabsd, LEG(66, 0F38, 0, 0x1e), SSSE3, WR, Vdq, Wdq) OPCODE(vpabsd, VEX(128, 66, 0F38, IG, 0x1e), AVX, WR, Vdq, Wdq) +OPCODE(vpabsd, VEX(256, 66, 0F38, IG, 0x1e), AVX2, WR, Vqq, Wqq) OPCODE(psignb, LEG(NP, 0F38, 0, 0x08), SSSE3, WRR, Pq, Pq, Qq) OPCODE(psignb, LEG(66, 0F38, 0, 0x08), SSSE3, WRR, Vdq, Vdq, Wdq) OPCODE(vpsignb, VEX(128, 66, 0F38, IG, 0x08), AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(vpsignb, VEX(256, 66, 0F38, IG, 0x08), AVX2, WRR, Vqq, Hqq, Wqq) OPCODE(psignw, LEG(NP, 0F38, 0, 0x09), SSSE3, WRR, Pq, Pq, Qq) OPCODE(psignw, LEG(66, 0F38, 0, 0x09), SSSE3, WRR, Vdq, Vdq, Wdq) OPCODE(vpsignw, VEX(128, 66, 0F38, IG, 0x09), AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(vpsignw, VEX(256, 66, 0F38, IG, 0x09), AVX2, WRR, Vqq, Hqq, Wqq) OPCODE(psignd, LEG(NP, 0F38, 0, 0x0a), SSSE3, WRR, Pq, Pq, Qq) OPCODE(psignd, LEG(66, 0F38, 0, 0x0a), SSSE3, WRR, Vdq, Vdq, Wdq) OPCODE(vpsignd, VEX(128, 66, 0F38, IG, 0x0a), AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(vpsignd, VEX(256, 66, 0F38, IG, 0x0a), AVX2, WRR, Vqq, Hqq, Wqq) OPCODE(dpps, LEG(66, 0F3A, 0, 0x40), SSE4_1, WRRR, Vdq, Vdq, Wdq, Ib) OPCODE(vdpps, VEX(128, 66, 0F3A, IG, 0x40), AVX, WRRR, Vdq, Hdq, Wdq, Ib) OPCODE(vdpps, VEX(256, 66, 0F3A, IG, 0x40), AVX, WRRR, Vqq, Hqq, Wqq, Ib) @@ -1247,25 +1477,33 @@ OPCODE(vpclmulqdq, VEX(128, 66, 0F3A, IG, 0x44), PCLMULQDQ_AVX, WRRR, Vdq, Hdq, OPCODE(pcmpeqb, LEG(NP, 0F, 0, 0x74), MMX, WRR, Pq, Pq, Qq) OPCODE(pcmpeqb, LEG(66, 0F, 0, 0x74), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(vpcmpeqb, VEX(128, 66, 0F, IG, 0x74), AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(vpcmpeqb, VEX(256, 66, 0F, IG, 0x74), AVX2, WRR, Vqq, Hqq, Wqq) OPCODE(pcmpeqw, LEG(NP, 0F, 0, 0x75), MMX, WRR, Pq, Pq, Qq) OPCODE(pcmpeqw, LEG(66, 0F, 0, 0x75), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(vpcmpeqw, VEX(128, 66, 0F, IG, 0x75), AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(vpcmpeqw, VEX(256, 66, 0F, IG, 0x75), AVX2, WRR, Vqq, Hqq, Wqq) OPCODE(pcmpeqd, LEG(NP, 0F, 0, 0x76), MMX, WRR, Pq, Pq, Qq) OPCODE(pcmpeqd, LEG(66, 0F, 0, 0x76), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(vpcmpeqd, VEX(128, 66, 0F, IG, 0x76), AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(vpcmpeqd, VEX(256, 66, 0F, IG, 0x76), AVX2, WRR, Vqq, Hqq, Wqq) OPCODE(pcmpeqq, LEG(66, 0F38, 0, 0x29), SSE4_1, WRR, Vdq, Vdq, Wdq) OPCODE(vpcmpeqq, VEX(128, 66, 0F38, IG, 0x29), AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(vpcmpeqq, VEX(256, 66, 0F38, IG, 0x29), AVX2, WRR, Vqq, Hqq, Wqq) OPCODE(pcmpgtb, LEG(NP, 0F, 0, 0x64), MMX, WRR, Pq, Pq, Qq) OPCODE(pcmpgtb, LEG(66, 0F, 0, 0x64), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(vpcmpgtb, VEX(128, 66, 0F, IG, 0x64), AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(vpcmpgtb, VEX(256, 66, 0F, IG, 0x64), AVX2, WRR, Vqq, Hqq, Wqq) OPCODE(pcmpgtw, LEG(NP, 0F, 0, 0x65), MMX, WRR, Pq, Pq, Qq) OPCODE(pcmpgtw, LEG(66, 0F, 0, 0x65), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(vpcmpgtw, VEX(128, 66, 0F, IG, 0x65), AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(vpcmpgtw, VEX(256, 66, 0F, IG, 0x65), AVX2, WRR, Vqq, Hqq, Wqq) OPCODE(pcmpgtd, LEG(NP, 0F, 0, 0x66), MMX, WRR, Pq, Pq, Qq) OPCODE(pcmpgtd, LEG(66, 0F, 0, 0x66), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(vpcmpgtd, VEX(128, 66, 0F, IG, 0x66), AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(vpcmpgtd, VEX(256, 66, 0F, IG, 0x66), AVX2, WRR, Vqq, Hqq, Wqq) OPCODE(pcmpgtq, LEG(66, 0F38, 0, 0x37), SSE4_2, WRR, Vdq, Vdq, Wdq) OPCODE(vpcmpgtq, VEX(128, 66, 0F38, IG, 0x37), AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(vpcmpgtq, VEX(256, 66, 0F38, IG, 0x37), AVX2, WRR, Vqq, Hqq, Wqq) OPCODE(pcmpestrm, LEG(66, 0F3A, 0, 0x60), SSE4_2, RRR, Vdq, Wdq, Ib) OPCODE(vpcmpestrm, VEX(128, 66, 0F3A, IG, 0x60), AVX, RRR, Vdq, Wdq, Ib) OPCODE(pcmpestri, LEG(66, 0F3A, 0, 0x61), SSE4_2, RRR, Vdq, Wdq, Ib) @@ -1302,6 +1540,7 @@ OPCODE(vcomisd, VEX(IG, 66, 0F, IG, 0x2f), AVX, RR, Vq, Wq) OPCODE(pand, LEG(NP, 0F, 0, 0xdb), MMX, WRR, Pq, Pq, Qq) OPCODE(pand, LEG(66, 0F, 0, 0xdb), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(vpand, VEX(128, 66, 0F, IG, 0xdb), AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(vpand, VEX(256, 66, 0F, IG, 0xdb), AVX2, WRR, Vqq, Hqq, Wqq) OPCODE(andps, LEG(NP, 0F, 0, 0x54), SSE, WRR, Vdq, Vdq, Wdq) OPCODE(vandps, VEX(128, NP, 0F, IG, 0x54), AVX, WRR, Vdq, Hdq, Wdq) OPCODE(vandps, VEX(256, NP, 0F, IG, 0x54), AVX, WRR, Vqq, Hqq, Wqq) @@ -1311,6 +1550,7 @@ OPCODE(vandpd, VEX(256, 66, 0F, IG, 0x54), AVX, WRR, Vqq, Hqq, Wqq) OPCODE(pandn, LEG(NP, 0F, 0, 0xdf), MMX, WRR, Pq, Pq, Qq) OPCODE(pandn, LEG(66, 0F, 0, 0xdf), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(vpandn, VEX(128, 66, 0F, IG, 0xdf), AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(vpandn, VEX(256, 66, 0F, IG, 0xdf), AVX2, WRR, Vqq, Hqq, Wqq) OPCODE(andnps, LEG(NP, 0F, 0, 0x55), SSE, WRR, Vdq, Vdq, Wdq) OPCODE(vandnps, VEX(128, NP, 0F, IG, 0x55), AVX, WRR, Vdq, Hdq, Wdq) OPCODE(vandnps, VEX(256, NP, 0F, IG, 0x55), AVX, WRR, Vqq, Hqq, Wqq) @@ -1320,6 +1560,7 @@ OPCODE(vandnpd, VEX(256, 66, 0F, IG, 0x55), AVX, WRR, Vqq, Hqq, Wqq) OPCODE(por, LEG(NP, 0F, 0, 0xeb), MMX, WRR, Pq, Pq, Qq) OPCODE(por, LEG(66, 0F, 0, 0xeb), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(vpor, VEX(128, 66, 0F, IG, 0xeb), AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(vpor, VEX(256, 66, 0F, IG, 0xeb), AVX2, WRR, Vqq, Hqq, Wqq) OPCODE(orps, LEG(NP, 0F, 0, 0x56), SSE, WRR, Vdq, Vdq, Wdq) OPCODE(vorps, VEX(128, NP, 0F, IG, 0x56), AVX, WRR, Vdq, Hdq, Wdq) OPCODE(vorps, VEX(256, NP, 0F, IG, 0x56), AVX, WRR, Vqq, Hqq, Wqq) @@ -1329,6 +1570,7 @@ OPCODE(vorpd, VEX(256, 66, 0F, IG, 0x56), AVX, WRR, Vqq, Hqq, Wqq) OPCODE(pxor, LEG(NP, 0F, 0, 0xef), MMX, WRR, Pq, Pq, Qq) OPCODE(pxor, LEG(66, 0F, 0, 0xef), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(vpxor, VEX(128, 66, 0F, IG, 0xef), AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(vpxor, VEX(256, 66, 0F, IG, 0xef), AVX2, WRR, Vqq, Hqq, Wqq) OPCODE(xorps, LEG(NP, 0F, 0, 0x57), SSE, WRR, Vdq, Vdq, Wdq) OPCODE(vxorps, VEX(128, NP, 0F, IG, 0x57), AVX, WRR, Vdq, Hdq, Wdq) OPCODE(vxorps, VEX(256, NP, 0F, IG, 0x57), AVX, WRR, Vqq, Hqq, Wqq) @@ -1338,63 +1580,94 @@ OPCODE(vxorpd, VEX(256, 66, 0F, IG, 0x57), AVX, WRR, Vqq, Hqq, Wqq) OPCODE(psllw, LEG(NP, 0F, 0, 0xf1), MMX, WRR, Pq, Pq, Qq) OPCODE(psllw, LEG(66, 0F, 0, 0xf1), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(vpsllw, VEX(128, 66, 0F, IG, 0xf1), AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(vpsllw, VEX(256, 66, 0F, IG, 0xf1), AVX2, WRR, Vqq, Hqq, Wdq) OPCODE(pslld, LEG(NP, 0F, 0, 0xf2), MMX, WRR, Pq, Pq, Qq) OPCODE(pslld, LEG(66, 0F, 0, 0xf2), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(vpslld, VEX(128, 66, 0F, IG, 0xf2), AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(vpslld, VEX(256, 66, 0F, IG, 0xf2), AVX2, WRR, Vqq, Hqq, Wdq) OPCODE(psllq, LEG(NP, 0F, 0, 0xf3), MMX, WRR, Pq, Pq, Qq) OPCODE(psllq, LEG(66, 0F, 0, 0xf3), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(vpsllq, VEX(128, 66, 0F, IG, 0xf3), AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(vpsllq, VEX(256, 66, 0F, IG, 0xf3), AVX2, WRR, Vqq, Hqq, Wdq) +OPCODE(vpsllvd, VEX(128, 66, 0F38, 0, 0x47), AVX2, WRR, Vdq, Hdq, Wdq) +OPCODE(vpsllvd, VEX(256, 66, 0F38, 0, 0x47), AVX2, WRR, Vqq, Hqq, Wqq) +OPCODE(vpsllvq, VEX(128, 66, 0F38, 1, 0x47), AVX2, WRR, Vdq, Hdq, Wdq) +OPCODE(vpsllvq, VEX(256, 66, 0F38, 1, 0x47), AVX2, WRR, Vqq, Hqq, Wqq) OPCODE(psrlw, LEG(NP, 0F, 0, 0xd1), MMX, WRR, Pq, Pq, Qq) OPCODE(psrlw, LEG(66, 0F, 0, 0xd1), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(vpsrlw, VEX(128, 66, 0F, IG, 0xd1), AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(vpsrlw, VEX(256, 66, 0F, IG, 0xd1), AVX2, WRR, Vqq, Hqq, Wdq) OPCODE(psrld, LEG(NP, 0F, 0, 0xd2), MMX, WRR, Pq, Pq, Qq) OPCODE(psrld, LEG(66, 0F, 0, 0xd2), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(vpsrld, VEX(128, 66, 0F, IG, 0xd2), AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(vpsrld, VEX(256, 66, 0F, IG, 0xd2), AVX2, WRR, Vqq, Hqq, Wdq) OPCODE(psrlq, LEG(NP, 0F, 0, 0xd3), MMX, WRR, Pq, Pq, Qq) OPCODE(psrlq, LEG(66, 0F, 0, 0xd3), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(vpsrlq, VEX(128, 66, 0F, IG, 0xd3), AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(vpsrlq, VEX(256, 66, 0F, IG, 0xd3), AVX2, WRR, Vqq, Hqq, Wdq) +OPCODE(vpsrlvd, VEX(128, 66, 0F38, 0, 0x45), AVX2, WRR, Vdq, Hdq, Wdq) +OPCODE(vpsrlvd, VEX(256, 66, 0F38, 0, 0x45), AVX2, WRR, Vqq, Hqq, Wqq) +OPCODE(vpsrlvq, VEX(128, 66, 0F38, 1, 0x45), AVX2, WRR, Vdq, Hdq, Wdq) +OPCODE(vpsrlvq, VEX(256, 66, 0F38, 1, 0x45), AVX2, WRR, Vqq, Hqq, Wqq) OPCODE(psraw, LEG(NP, 0F, 0, 0xe1), MMX, WRR, Pq, Pq, Qq) OPCODE(psraw, LEG(66, 0F, 0, 0xe1), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(vpsraw, VEX(128, 66, 0F, IG, 0xe1), AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(vpsraw, VEX(256, 66, 0F, IG, 0xe1), AVX2, WRR, Vqq, Hqq, Wdq) OPCODE(psrad, LEG(NP, 0F, 0, 0xe2), MMX, WRR, Pq, Pq, Qq) OPCODE(psrad, LEG(66, 0F, 0, 0xe2), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(vpsrad, VEX(128, 66, 0F, IG, 0xe2), AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(vpsrad, VEX(256, 66, 0F, IG, 0xe2), AVX2, WRR, Vqq, Hqq, Wdq) +OPCODE(vpsravd, VEX(128, 66, 0F38, 0, 0x46), AVX2, WRR, Vdq, Hdq, Wdq) +OPCODE(vpsravd, VEX(256, 66, 0F38, 0, 0x46), AVX2, WRR, Vqq, Hqq, Wqq) OPCODE(palignr, LEG(NP, 0F3A, 0, 0x0f), SSSE3, WRRR, Pq, Pq, Qq, Ib) OPCODE(palignr, LEG(66, 0F3A, 0, 0x0f), SSSE3, WRRR, Vdq, Vdq, Wdq, Ib) OPCODE(vpalignr, VEX(128, 66, 0F3A, IG, 0x0f), AVX, WRRR, Vdq, Hdq, Wdq, Ib) +OPCODE(vpalignr, VEX(256, 66, 0F3A, IG, 0x0f), AVX2, WRRR, Vqq, Hqq, Wqq, Ib) OPCODE(packsswb, LEG(NP, 0F, 0, 0x63), MMX, WRR, Pq, Pq, Qq) OPCODE(packsswb, LEG(66, 0F, 0, 0x63), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(vpacksswb, VEX(128, 66, 0F, IG, 0x63), AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(vpacksswb, VEX(256, 66, 0F, IG, 0x63), AVX2, WRR, Vqq, Hqq, Wqq) OPCODE(packssdw, LEG(NP, 0F, 0, 0x6b), MMX, WRR, Pq, Pq, Qq) OPCODE(packssdw, LEG(66, 0F, 0, 0x6b), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(vpackssdw, VEX(128, 66, 0F, IG, 0x6b), AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(vpackssdw, VEX(256, 66, 0F, IG, 0x6b), AVX2, WRR, Vqq, Hqq, Wqq) OPCODE(packuswb, LEG(NP, 0F, 0, 0x67), MMX, WRR, Pq, Pq, Qq) OPCODE(packuswb, LEG(66, 0F, 0, 0x67), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(vpackuswb, VEX(128, 66, 0F, IG, 0x67), AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(vpackuswb, VEX(256, 66, 0F, IG, 0x67), AVX2, WRR, Vqq, Hqq, Wqq) OPCODE(packusdw, LEG(66, 0F38, 0, 0x2b), SSE4_1, WRR, Vdq, Vdq, Wdq) OPCODE(vpackusdw, VEX(128, 66, 0F38, IG, 0x2b), AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(vpackusdw, VEX(256, 66, 0F38, IG, 0x2b), AVX2, WRR, Vqq, Hqq, Wqq) OPCODE(punpckhbw, LEG(NP, 0F, 0, 0x68), MMX, WRR, Pq, Pq, Qq) OPCODE(punpckhbw, LEG(66, 0F, 0, 0x68), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(vpunpckhbw, VEX(128, 66, 0F, IG, 0x68), AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(vpunpckhbw, VEX(256, 66, 0F, IG, 0x68), AVX2, WRR, Vqq, Hqq, Wqq) OPCODE(punpckhwd, LEG(NP, 0F, 0, 0x69), MMX, WRR, Pq, Pq, Qq) OPCODE(punpckhwd, LEG(66, 0F, 0, 0x69), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(vpunpckhwd, VEX(128, 66, 0F, IG, 0x69), AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(vpunpckhwd, VEX(256, 66, 0F, IG, 0x69), AVX2, WRR, Vqq, Hqq, Wqq) OPCODE(punpckhdq, LEG(NP, 0F, 0, 0x6a), MMX, WRR, Pq, Pq, Qq) OPCODE(punpckhdq, LEG(66, 0F, 0, 0x6a), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(vpunpckhdq, VEX(128, 66, 0F, IG, 0x6a), AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(vpunpckhdq, VEX(256, 66, 0F, IG, 0x6a), AVX2, WRR, Vqq, Hqq, Wqq) OPCODE(punpckhqdq, LEG(66, 0F, 0, 0x6d), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(vpunpckhqdq, VEX(128, 66, 0F, IG, 0x6d), AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(vpunpckhqdq, VEX(256, 66, 0F, IG, 0x6d), AVX2, WRR, Vqq, Hqq, Wqq) OPCODE(punpcklbw, LEG(NP, 0F, 0, 0x60), MMX, WRR, Pq, Pq, Qd) OPCODE(punpcklbw, LEG(66, 0F, 0, 0x60), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(vpunpcklbw, VEX(128, 66, 0F, IG, 0x60), AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(vpunpcklbw, VEX(256, 66, 0F, IG, 0x60), AVX2, WRR, Vqq, Hqq, Wqq) OPCODE(punpcklwd, LEG(NP, 0F, 0, 0x61), MMX, WRR, Pq, Pq, Qd) OPCODE(punpcklwd, LEG(66, 0F, 0, 0x61), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(vpunpcklwd, VEX(128, 66, 0F, IG, 0x61), AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(vpunpcklwd, VEX(256, 66, 0F, IG, 0x61), AVX2, WRR, Vqq, Hqq, Wqq) OPCODE(punpckldq, LEG(NP, 0F, 0, 0x62), MMX, WRR, Pq, Pq, Qd) OPCODE(punpckldq, LEG(66, 0F, 0, 0x62), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(vpunpckldq, VEX(128, 66, 0F, IG, 0x62), AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(vpunpckldq, VEX(256, 66, 0F, IG, 0x62), AVX2, WRR, Vqq, Hqq, Wqq) OPCODE(punpcklqdq, LEG(66, 0F, 0, 0x6c), SSE2, WRR, Vdq, Vdq, Wdq) OPCODE(vpunpcklqdq, VEX(128, 66, 0F, IG, 0x6c), AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(vpunpcklqdq, VEX(256, 66, 0F, IG, 0x6c), AVX2, WRR, Vqq, Hqq, Wqq) OPCODE(unpcklps, LEG(NP, 0F, 0, 0x14), SSE, WRR, Vdq, Vdq, Wdq) OPCODE(vunpcklps, VEX(128, NP, 0F, IG, 0x14), AVX, WRR, Vdq, Hdq, Wdq) OPCODE(vunpcklps, VEX(256, NP, 0F, IG, 0x14), AVX, WRR, Vqq, Hqq, Wqq) @@ -1410,13 +1683,17 @@ OPCODE(vunpckhpd, VEX(256, 66, 0F, IG, 0x15), AVX, WRR, Vqq, Hqq, Wqq) OPCODE(pshufb, LEG(NP, 0F38, 0, 0x00), SSSE3, WRR, Pq, Pq, Qq) OPCODE(pshufb, LEG(66, 0F38, 0, 0x00), SSSE3, WRR, Vdq, Vdq, Wdq) OPCODE(vpshufb, VEX(128, 66, 0F38, IG, 0x00), AVX, WRR, Vdq, Hdq, Wdq) +OPCODE(vpshufb, VEX(256, 66, 0F38, IG, 0x00), AVX2, WRR, Vqq, Hqq, Wqq) OPCODE(pshufw, LEG(NP, 0F, 0, 0x70), SSE, WRR, Pq, Qq, Ib) OPCODE(pshuflw, LEG(F2, 0F, 0, 0x70), SSE2, WRR, Vdq, Wdq, Ib) OPCODE(vpshuflw, VEX(128, F2, 0F, IG, 0x70), AVX, WRR, Vdq, Wdq, Ib) +OPCODE(vpshuflw, VEX(256, F2, 0F, IG, 0x70), AVX2, WRR, Vqq, Wqq, Ib) OPCODE(pshufhw, LEG(F3, 0F, 0, 0x70), SSE2, WRR, Vdq, Wdq, Ib) OPCODE(vpshufhw, VEX(128, F3, 0F, IG, 0x70), AVX, WRR, Vdq, Wdq, Ib) +OPCODE(vpshufhw, VEX(256, F3, 0F, IG, 0x70), AVX2, WRR, Vqq, Wqq, Ib) OPCODE(pshufd, LEG(66, 0F, 0, 0x70), SSE2, WRR, Vdq, Wdq, Ib) OPCODE(vpshufd, VEX(128, 66, 0F, IG, 0x70), AVX, WRR, Vdq, Wdq, Ib) +OPCODE(vpshufd, VEX(256, 66, 0F, IG, 0x70), AVX2, WRR, Vqq, Wqq, Ib) OPCODE(shufps, LEG(NP, 0F, 0, 0xc6), SSE, WRRR, Vdq, Vdq, Wdq, Ib) OPCODE(vshufps, VEX(128, NP, 0F, IG, 0xc6), AVX, WRRR, Vdq, Hdq, Wdq, Ib) OPCODE(vshufps, VEX(256, NP, 0F, IG, 0xc6), AVX, WRRR, Vqq, Hqq, Wqq, Ib) @@ -1437,8 +1714,12 @@ OPCODE(vblendvpd, VEX(128, 66, 0F3A, 0, 0x4b), AVX, WRRR, Vdq, Hdq, Wdq, Ldq) OPCODE(vblendvpd, VEX(256, 66, 0F3A, 0, 0x4b), AVX, WRRR, Vqq, Hqq, Wqq, Lqq) OPCODE(pblendvb, LEG(66, 0F38, 0, 0x10), SSE4_1, WRR, Vdq, Vdq, Wdq) OPCODE(vpblendvb, VEX(128, 66, 0F3A, 0, 0x4c), AVX, WRRR, Vdq, Hdq, Wdq, Ldq) +OPCODE(vpblendvb, VEX(256, 66, 0F3A, 0, 0x4c), AVX2, WRRR, Vqq, Hqq, Wqq, Lqq) OPCODE(pblendw, LEG(66, 0F3A, 0, 0x0e), SSE4_1, WRRR, Vdq, Vdq, Wdq, Ib) OPCODE(vpblendw, VEX(128, 66, 0F3A, IG, 0x0e), AVX, WRRR, Vdq, Hdq, Wdq, Ib) +OPCODE(vpblendw, VEX(256, 66, 0F3A, IG, 0x0e), AVX2, WRRR, Vqq, Hqq, Wqq, Ib) +OPCODE(vpblendd, VEX(128, 66, 0F3A, 0, 0x02), AVX2, WRRR, Vdq, Hdq, Wdq, Ib) +OPCODE(vpblendd, VEX(256, 66, 0F3A, 0, 0x02), AVX2, WRRR, Vqq, Hqq, Wqq, Ib) OPCODE(insertps, LEG(66, 0F3A, 0, 0x21), SSE4_1, WRRR, Vdq, Vdq, Wd, Ib) OPCODE(vinsertps, VEX(128, 66, 0F3A, IG, 0x21), AVX, WRRR, Vdq, Hdq, Wd, Ib) OPCODE(pinsrb, LEG(66, 0F3A, 0, 0x20), SSE4_1, WRRR, Vdq, Vdq, RdMb, Ib) @@ -1451,6 +1732,7 @@ OPCODE(vpinsrd, VEX(128, 66, 0F3A, 0, 0x22), AVX, WRRR, Vdq, Hdq, Ed, Ib) OPCODE(pinsrq, LEG(66, 0F3A, 1, 0x22), SSE4_1, WRRR, Vdq, Vdq, Eq, Ib) OPCODE(vpinsrq, VEX(128, 66, 0F3A, 1, 0x22), AVX, WRRR, Vdq, Hdq, Eq, Ib) OPCODE(vinsertf128, VEX(256, 66, 0F3A, 0, 0x18), AVX, WRRR, Vqq, Hqq, Wdq, Ib) +OPCODE(vinserti128, VEX(256, 66, 0F3A, 0, 0x38), AVX2, WRRR, Vqq, Hqq, Wdq, Ib) OPCODE(extractps, LEG(66, 0F3A, 0, 0x17), SSE4_1, WRR, Ed, Vdq, Ib) OPCODE(vextractps, VEX(128, 66, 0F3A, IG, 0x17), AVX, WRR, Ed, Vdq, Ib) OPCODE(pextrb, LEG(66, 0F3A, 0, 0x14), SSE4_1, WRR, RdMb, Vdq, Ib) @@ -1468,11 +1750,24 @@ OPCODE(pextrw, LEG(66, 0F, 1, 0xc5), SSE2, WRR, Gq, Udq, Ib) OPCODE(vpextrw, VEX(128, 66, 0F, 0, 0xc5), AVX, WRR, Gd, Udq, Ib) OPCODE(vpextrw, VEX(128, 66, 0F, 1, 0xc5), AVX, WRR, Gq, Udq, Ib) OPCODE(vextractf128, VEX(256, 66, 0F3A, 0, 0x19), AVX, WRR, Wdq, Vqq, Ib) -OPCODE(vbroadcastss, VEX(128, 66, 0F38, 0, 0x18), AVX, WR, Vdq, Md) -OPCODE(vbroadcastss, VEX(256, 66, 0F38, 0, 0x18), AVX, WR, Vqq, Md) -OPCODE(vbroadcastsd, VEX(256, 66, 0F38, 0, 0x19), AVX, WR, Vqq, Mq) +OPCODE(vextracti128, VEX(256, 66, 0F3A, 0, 0x39), AVX2, WRR, Wdq, Vqq, Ib) +OPCODE(vpbroadcastb, VEX(128, 66, 0F38, 0, 0x78), AVX2, WR, Vdq, Wb) +OPCODE(vpbroadcastb, VEX(256, 66, 0F38, 0, 0x78), AVX2, WR, Vqq, Wb) +OPCODE(vpbroadcastw, VEX(128, 66, 0F38, 0, 0x79), AVX2, WR, Vdq, Ww) +OPCODE(vpbroadcastw, VEX(256, 66, 0F38, 0, 0x79), AVX2, WR, Vqq, Ww) +OPCODE(vpbroadcastd, VEX(128, 66, 0F38, 0, 0x58), AVX2, WR, Vdq, Wd) +OPCODE(vpbroadcastd, VEX(256, 66, 0F38, 0, 0x58), AVX2, WR, Vqq, Wd) +OPCODE(vpbroadcastq, VEX(128, 66, 0F38, 0, 0x59), AVX2, WR, Vdq, Wq) +OPCODE(vpbroadcastq, VEX(256, 66, 0F38, 0, 0x59), AVX2, WR, Vqq, Wq) +OPCODE(vbroadcastss, VEX(128, 66, 0F38, 0, 0x18), AVX, WRR, Vdq, Wd, modrm_mod) +OPCODE(vbroadcastss, VEX(256, 66, 0F38, 0, 0x18), AVX, WRR, Vqq, Wd, modrm_mod) +OPCODE(vbroadcastsd, VEX(256, 66, 0F38, 0, 0x19), AVX, WRR, Vqq, Wq, modrm_mod) OPCODE(vbroadcastf128, VEX(256, 66, 0F38, 0, 0x1a), AVX, WR, Vqq, Mdq) +OPCODE(vbroadcasti128, VEX(256, 66, 0F38, 0, 0x5a), AVX2, WR, Vqq, Mdq) OPCODE(vperm2f128, VEX(256, 66, 0F3A, 0, 0x06), AVX, WRRR, Vqq, Hqq, Wqq, Ib) +OPCODE(vperm2i128, VEX(256, 66, 0F3A, 0, 0x46), AVX2, WRRR, Vqq, Hqq, Wqq, Ib) +OPCODE(vpermd, VEX(256, 66, 0F38, 0, 0x36), AVX2, WRR, Vqq, Hqq, Wqq) +OPCODE(vpermps, VEX(256, 66, 0F38, 0, 0x16), AVX2, WRR, Vqq, Hqq, Wqq) OPCODE(vpermilps, VEX(128, 66, 0F38, 0, 0x0c), AVX, WRR, Vdq, Hdq, Wdq) OPCODE(vpermilps, VEX(256, 66, 0F38, 0, 0x0c), AVX, WRR, Vqq, Hqq, Wqq) OPCODE(vpermilps, VEX(128, 66, 0F3A, 0, 0x04), AVX, WRR, Vdq, Wdq, Ib) @@ -1481,30 +1776,60 @@ OPCODE(vpermilpd, VEX(128, 66, 0F38, 0, 0x0d), AVX, WRR, Vdq, Hdq, Wdq) OPCODE(vpermilpd, VEX(256, 66, 0F38, 0, 0x0d), AVX, WRR, Vqq, Hqq, Wqq) OPCODE(vpermilpd, VEX(128, 66, 0F3A, 0, 0x05), AVX, WRR, Vdq, Wdq, Ib) OPCODE(vpermilpd, VEX(256, 66, 0F3A, 0, 0x05), AVX, WRR, Vqq, Wqq, Ib) +OPCODE(vpermq, VEX(256, 66, 0F3A, 1, 0x00), AVX2, WRR, Vqq, Wqq, Ib) +OPCODE(vpermpd, VEX(256, 66, 0F3A, 1, 0x01), AVX2, WRR, Vqq, Wqq, Ib) +OPCODE(vgatherdps, VEX(128, 66, 0F38, 0, 0x92), AVX2, WWRRR, Vdq, Hdq, Vdq, MDdq, Hdq) +OPCODE(vgatherdps, VEX(256, 66, 0F38, 0, 0x92), AVX2, WWRRR, Vqq, Hqq, Vqq, MDqq, Hqq) +OPCODE(vgatherdpd, VEX(128, 66, 0F38, 1, 0x92), AVX2, WWRRR, Vdq, Hdq, Vdq, MDdq, Hdq) +OPCODE(vgatherdpd, VEX(256, 66, 0F38, 1, 0x92), AVX2, WWRRR, Vqq, Hqq, Vqq, MDdq, Hqq) +OPCODE(vgatherqps, VEX(128, 66, 0F38, 0, 0x93), AVX2, WWRRR, Vdq, Hdq, Vdq, MQdq, Hdq) +OPCODE(vgatherqps, VEX(256, 66, 0F38, 0, 0x93), AVX2, WWRRR, Vdq, Hdq, Vdq, MQqq, Hdq) +OPCODE(vgatherqpd, VEX(128, 66, 0F38, 1, 0x93), AVX2, WWRRR, Vdq, Hdq, Vdq, MQdq, Hdq) +OPCODE(vgatherqpd, VEX(256, 66, 0F38, 1, 0x93), AVX2, WWRRR, Vqq, Hqq, Vqq, MQqq, Hqq) +OPCODE(vpgatherdd, VEX(128, 66, 0F38, 0, 0x90), AVX2, WWRRR, Vdq, Hdq, Vdq, MDdq, Hdq) +OPCODE(vpgatherdd, VEX(256, 66, 0F38, 0, 0x90), AVX2, WWRRR, Vqq, Hqq, Vqq, MDqq, Hqq) +OPCODE(vpgatherdq, VEX(128, 66, 0F38, 1, 0x90), AVX2, WWRRR, Vdq, Hdq, Vdq, MDdq, Hdq) +OPCODE(vpgatherdq, VEX(256, 66, 0F38, 1, 0x90), AVX2, WWRRR, Vqq, Hqq, Vqq, MDdq, Hqq) +OPCODE(vpgatherqd, VEX(128, 66, 0F38, 0, 0x91), AVX2, WWRRR, Vdq, Hdq, Vdq, MQdq, Hdq) +OPCODE(vpgatherqd, VEX(256, 66, 0F38, 0, 0x91), AVX2, WWRRR, Vdq, Hdq, Vdq, MQqq, Hdq) +OPCODE(vpgatherqq, VEX(128, 66, 0F38, 1, 0x91), AVX2, WWRRR, Vdq, Hdq, Vdq, MQdq, Hdq) +OPCODE(vpgatherqq, VEX(256, 66, 0F38, 1, 0x91), AVX2, WWRRR, Vqq, Hqq, Vqq, MQqq, Hqq) OPCODE(pmovsxbw, LEG(66, 0F38, 0, 0x20), SSE4_1, WR, Vdq, Wq) OPCODE(vpmovsxbw, VEX(128, 66, 0F38, IG, 0x20), AVX, WR, Vdq, Wq) +OPCODE(vpmovsxbw, VEX(256, 66, 0F38, IG, 0x20), AVX2, WR, Vqq, Wdq) OPCODE(pmovsxbd, LEG(66, 0F38, 0, 0x21), SSE4_1, WR, Vdq, Wd) OPCODE(vpmovsxbd, VEX(128, 66, 0F38, IG, 0x21), AVX, WR, Vdq, Wd) +OPCODE(vpmovsxbd, VEX(256, 66, 0F38, IG, 0x21), AVX2, WR, Vqq, Wq) OPCODE(pmovsxbq, LEG(66, 0F38, 0, 0x22), SSE4_1, WR, Vdq, Ww) OPCODE(vpmovsxbq, VEX(128, 66, 0F38, IG, 0x22), AVX, WR, Vdq, Ww) +OPCODE(vpmovsxbq, VEX(256, 66, 0F38, IG, 0x22), AVX2, WR, Vqq, Wd) OPCODE(pmovsxwd, LEG(66, 0F38, 0, 0x23), SSE4_1, WR, Vdq, Wq) OPCODE(vpmovsxwd, VEX(128, 66, 0F38, IG, 0x23), AVX, WR, Vdq, Wq) +OPCODE(vpmovsxwd, VEX(256, 66, 0F38, IG, 0x23), AVX2, WR, Vqq, Wdq) OPCODE(pmovsxwq, LEG(66, 0F38, 0, 0x24), SSE4_1, WR, Vdq, Wd) OPCODE(vpmovsxwq, VEX(128, 66, 0F38, IG, 0x24), AVX, WR, Vdq, Wd) +OPCODE(vpmovsxwq, VEX(256, 66, 0F38, IG, 0x24), AVX2, WR, Vqq, Wq) OPCODE(pmovsxdq, LEG(66, 0F38, 0, 0x25), SSE4_1, WR, Vdq, Wq) OPCODE(vpmovsxdq, VEX(128, 66, 0F38, IG, 0x25), AVX, WR, Vdq, Wq) +OPCODE(vpmovsxdq, VEX(256, 66, 0F38, IG, 0x25), AVX2, WR, Vqq, Wdq) OPCODE(pmovzxbw, LEG(66, 0F38, 0, 0x30), SSE4_1, WR, Vdq, Wq) OPCODE(vpmovzxbw, VEX(128, 66, 0F38, IG, 0x30), AVX, WR, Vdq, Wq) +OPCODE(vpmovzxbw, VEX(256, 66, 0F38, IG, 0x30), AVX2, WR, Vqq, Wdq) OPCODE(pmovzxbd, LEG(66, 0F38, 0, 0x31), SSE4_1, WR, Vdq, Wd) OPCODE(vpmovzxbd, VEX(128, 66, 0F38, IG, 0x31), AVX, WR, Vdq, Wd) +OPCODE(vpmovzxbd, VEX(256, 66, 0F38, IG, 0x31), AVX2, WR, Vqq, Wq) OPCODE(pmovzxbq, LEG(66, 0F38, 0, 0x32), SSE4_1, WR, Vdq, Ww) OPCODE(vpmovzxbq, VEX(128, 66, 0F38, IG, 0x32), AVX, WR, Vdq, Ww) +OPCODE(vpmovzxbq, VEX(256, 66, 0F38, IG, 0x32), AVX2, WR, Vqq, Wd) OPCODE(pmovzxwd, LEG(66, 0F38, 0, 0x33), SSE4_1, WR, Vdq, Wq) OPCODE(vpmovzxwd, VEX(128, 66, 0F38, IG, 0x33), AVX, WR, Vdq, Wq) +OPCODE(vpmovzxwd, VEX(256, 66, 0F38, IG, 0x33), AVX2, WR, Vqq, Wdq) OPCODE(pmovzxwq, LEG(66, 0F38, 0, 0x34), SSE4_1, WR, Vdq, Wd) OPCODE(vpmovzxwq, VEX(128, 66, 0F38, IG, 0x34), AVX, WR, Vdq, Wd) +OPCODE(vpmovzxwq, VEX(256, 66, 0F38, IG, 0x34), AVX2, WR, Vqq, Wq) OPCODE(pmovzxdq, LEG(66, 0F38, 0, 0x35), SSE4_1, WR, Vdq, Wq) OPCODE(vpmovzxdq, VEX(128, 66, 0F38, IG, 0x35), AVX, WR, Vdq, Wq) +OPCODE(vpmovzxdq, VEX(256, 66, 0F38, IG, 0x35), AVX2, WR, Vqq, Wdq) OPCODE(cvtpi2ps, LEG(NP, 0F, 0, 0x2a), SSE, WR, Vdq, Qq) OPCODE(cvtsi2ss, LEG(F3, 0F, 0, 0x2a), SSE, WR, Vd, Ed) OPCODE(cvtsi2ss, LEG(F3, 0F, 1, 0x2a), SSE, WR, Vd, Eq) @@ -1574,6 +1899,14 @@ OPCODE(vmaskmovpd, VEX(128, 66, 0F38, 0, 0x2d), AVX, WRR, Vdq, Hdq, Mdq) OPCODE(vmaskmovpd, VEX(128, 66, 0F38, 0, 0x2f), AVX, WRR, Mdq, Hdq, Vdq) OPCODE(vmaskmovpd, VEX(256, 66, 0F38, 0, 0x2d), AVX, WRR, Vqq, Hqq, Mqq) OPCODE(vmaskmovpd, VEX(256, 66, 0F38, 0, 0x2f), AVX, WRR, Mqq, Hqq, Vqq) +OPCODE(vpmaskmovd, VEX(128, 66, 0F38, 0, 0x8c), AVX2, WRR, Vdq, Hdq, Mdq) +OPCODE(vpmaskmovd, VEX(128, 66, 0F38, 0, 0x8e), AVX2, WRR, Mdq, Hdq, Vdq) +OPCODE(vpmaskmovd, VEX(256, 66, 0F38, 0, 0x8c), AVX2, WRR, Vqq, Hqq, Mqq) +OPCODE(vpmaskmovd, VEX(256, 66, 0F38, 0, 0x8e), AVX2, WRR, Mqq, Hqq, Vqq) +OPCODE(vpmaskmovq, VEX(128, 66, 0F38, 1, 0x8c), AVX2, WRR, Vdq, Hdq, Mdq) +OPCODE(vpmaskmovq, VEX(128, 66, 0F38, 1, 0x8e), AVX2, WRR, Mdq, Hdq, Vdq) +OPCODE(vpmaskmovq, VEX(256, 66, 0F38, 1, 0x8c), AVX2, WRR, Vqq, Hqq, Mqq) +OPCODE(vpmaskmovq, VEX(256, 66, 0F38, 1, 0x8e), AVX2, WRR, Mqq, Hqq, Vqq) OPCODE(movntps, LEG(NP, 0F, 0, 0x2b), SSE, WR, Mdq, Vdq) OPCODE(vmovntps, VEX(128, NP, 0F, IG, 0x2b), AVX, WR, Mdq, Vdq) OPCODE(vmovntps, VEX(256, NP, 0F, IG, 0x2b), AVX, WR, Mqq, Vqq) @@ -1588,6 +1921,7 @@ OPCODE(vmovntdq, VEX(128, 66, 0F, IG, 0xe7), AVX, WR, Mdq, Vdq) OPCODE(vmovntdq, VEX(256, 66, 0F, IG, 0xe7), AVX, WR, Mqq, Vqq) OPCODE(movntdqa, LEG(66, 0F38, 0, 0x2a), SSE4_1, WR, Vdq, Mdq) OPCODE(vmovntdqa, VEX(128, 66, 0F38, IG, 0x2a), AVX, WR, Vdq, Mdq) +OPCODE(vmovntdqa, VEX(256, 66, 0F38, IG, 0x2a), AVX2, WR, Vqq, Mqq) OPCODE(pause, LEG(F3, NA, 0, 0x90), SSE2, ) OPCODE(emms, LEG(NP, 0F, 0, 0x77), MMX, ) OPCODE(vzeroupper, VEX(128, NP, 0F, IG, 0x77), AVX, ) @@ -1614,6 +1948,13 @@ OPCODE_GRP_BEGIN(grp12_VEX_128_66) OPCODE_GRPMEMB(grp12_VEX_128_66, vpsraw, 4, AVX, WRR, Hdq, Udq, Ib) OPCODE_GRP_END(grp12_VEX_128_66) +OPCODE_GRP(grp12_VEX_256_66, VEX(256, 66, 0F, IG, 0x71)) +OPCODE_GRP_BEGIN(grp12_VEX_256_66) + OPCODE_GRPMEMB(grp12_VEX_256_66, vpsllw, 6, AVX2, WRR, Hqq, Uqq, Ib) + OPCODE_GRPMEMB(grp12_VEX_256_66, vpsrlw, 2, AVX2, WRR, Hqq, Uqq, Ib) + OPCODE_GRPMEMB(grp12_VEX_256_66, vpsraw, 4, AVX2, WRR, Hqq, Uqq, Ib) +OPCODE_GRP_END(grp12_VEX_256_66) + OPCODE_GRP(grp13_LEG_66, LEG(66, 0F, 0, 0x72)) OPCODE_GRP_BEGIN(grp13_LEG_66) OPCODE_GRPMEMB(grp13_LEG_66, pslld, 6, SSE2, WRR, Udq, Udq, Ib) @@ -1635,6 +1976,13 @@ OPCODE_GRP_BEGIN(grp13_VEX_128_66) OPCODE_GRPMEMB(grp13_VEX_128_66, vpsrad, 4, AVX, WRR, Hdq, Udq, Ib) OPCODE_GRP_END(grp13_VEX_128_66) +OPCODE_GRP(grp13_VEX_256_66, VEX(256, 66, 0F, IG, 0x72)) +OPCODE_GRP_BEGIN(grp13_VEX_256_66) + OPCODE_GRPMEMB(grp13_VEX_256_66, vpslld, 6, AVX2, WRR, Hqq, Uqq, Ib) + OPCODE_GRPMEMB(grp13_VEX_256_66, vpsrld, 2, AVX2, WRR, Hqq, Uqq, Ib) + OPCODE_GRPMEMB(grp13_VEX_256_66, vpsrad, 4, AVX2, WRR, Hqq, Uqq, Ib) +OPCODE_GRP_END(grp13_VEX_256_66) + OPCODE_GRP(grp14_LEG_66, LEG(66, 0F, 0, 0x73)) OPCODE_GRP_BEGIN(grp14_LEG_66) OPCODE_GRPMEMB(grp14_LEG_66, psllq, 6, SSE2, WRR, Udq, Udq, Ib) @@ -1657,6 +2005,14 @@ OPCODE_GRP_BEGIN(grp14_VEX_128_66) OPCODE_GRPMEMB(grp14_VEX_128_66, vpsrldq, 3, AVX, WRR, Hdq, Udq, Ib) OPCODE_GRP_END(grp14_VEX_128_66) +OPCODE_GRP(grp14_VEX_256_66, VEX(256, 66, 0F, IG, 0x73)) +OPCODE_GRP_BEGIN(grp14_VEX_256_66) + OPCODE_GRPMEMB(grp14_VEX_256_66, vpsllq, 6, AVX2, WRR, Hqq, Uqq, Ib) + OPCODE_GRPMEMB(grp14_VEX_256_66, vpslldq, 7, AVX2, WRR, Hqq, Uqq, Ib) + OPCODE_GRPMEMB(grp14_VEX_256_66, vpsrlq, 2, AVX2, WRR, Hqq, Uqq, Ib) + OPCODE_GRPMEMB(grp14_VEX_256_66, vpsrldq, 3, AVX2, WRR, Hqq, Uqq, Ib) +OPCODE_GRP_END(grp14_VEX_256_66) + OPCODE_GRP(grp15_LEG_NP, LEG(NP, 0F, 0, 0xae)) OPCODE_GRP_BEGIN(grp15_LEG_NP) OPCODE_GRPMEMB(grp15_LEG_NP, sfence_clflush, 7, SSE, RR, modrm_mod, modrm) From patchwork Wed Aug 21 17:29:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Bobek X-Patchwork-Id: 11107881 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A58CD1395 for ; Wed, 21 Aug 2019 18:29:40 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7D255216F4 for ; Wed, 21 Aug 2019 18:29:40 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Tih6xuJ1" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7D255216F4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:51716 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0VMZ-0008OE-3G for patchwork-qemu-devel@patchwork.kernel.org; Wed, 21 Aug 2019 14:29:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41496) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0URv-0001mG-2c for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:31:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i0URs-0008VO-IF for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:31:06 -0400 Received: from mail-yb1-xb29.google.com ([2607:f8b0:4864:20::b29]:35838) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i0URs-0008Tb-9M for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:31:04 -0400 Received: by mail-yb1-xb29.google.com with SMTP id c9so1353992ybf.2 for ; Wed, 21 Aug 2019 10:31:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ELavVPAMYOO+nLuOLzE5Zb0NTGmst1FkYCVc53be1Tg=; b=Tih6xuJ1W7susXkm9pkwRARV94xQsH8tHUbd7xjXS/BDRjFnHsunhbxVqzdHn0gEqt hQwm7iqXdyTMAINMx4ZUimqA+iWyxOF4X34WM/w8oQpvhRV6l0B6Er/FiL+kH47bPZb/ 0tEYGS+7bhpuLtDLxtYcWnsEcSP6YkrHkq/IyHD4w1lnUpWIAKbKpdTtmaE/6JHw3x9Q MDFddvZC2SJ0GH0wY/ETq6PHCa1jlZlz2hsFbkAIfNybbC1Clvwhea+lahUOCSaWR+/w HtWbQ8J4PFJGjBhsunTYenSPvCZ20tzb2a4uFj2ZvfYZBrOU/1MMdtYQAeDBUWvO0MQO VyZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ELavVPAMYOO+nLuOLzE5Zb0NTGmst1FkYCVc53be1Tg=; b=LmT7yGEKgUvLp2X0x2xfJy0zO1u5EMn7Uigz4I96t2Ae7LjYAyk0SgLBxVnF+G8XBC l+MSKlsZ4u6q1kAxdPAIxk/hW1mhSUihT5nyaG23sMZJMimKAJh6X/cd5nux+ZGqSFqR OwGfU9dLkLHfm3POCuS49iIWUUeWlPu2MvmRHbJYVrH57/YwY1z3YfCbynmptCaH+n0K 92DkTYLbJGy6nfNT5M27N1jgk8bH0rn5Ujio9XxDcUZRv2CNSG+eNwiykEMYyREVwyu5 bCk667ZpR3P1c/m7aVo8MEWg2D6DYg/1HGqCg3M69j6tmnYQhhMMXo6JoFeUBoB+4SYC jf9g== X-Gm-Message-State: APjAAAXPy/h9Ej7Wuf4XCoskavkMTJBUtuXfGuRxGq2ch6IYokIMAxa0 FGHC+2GLpMoLuNQ6/N5n4dghze5Z X-Google-Smtp-Source: APXvYqyIr6Tgo9uyPHwQ03ADevURjIWeZ7mupTfUnuoQmr4F2IJJ124UHMYRfcV1q+2FrIlZVyDnUg== X-Received: by 2002:a25:cb81:: with SMTP id b123mr22790424ybg.233.1566408662457; Wed, 21 Aug 2019 10:31:02 -0700 (PDT) Received: from localhost.localdomain ([2601:c0:c67f:e390::3]) by smtp.gmail.com with ESMTPSA id l71sm2826167ywl.39.2019.08.21.10.31.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Aug 2019 10:31:01 -0700 (PDT) From: Jan Bobek To: qemu-devel@nongnu.org Date: Wed, 21 Aug 2019 13:29:41 -0400 Message-Id: <20190821172951.15333-66-jan.bobek@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190821172951.15333-1-jan.bobek@gmail.com> References: <20190821172951.15333-1-jan.bobek@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::b29 Subject: [Qemu-devel] [RFC PATCH v4 65/75] target/i386: remove obsoleted helpers X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jan Bobek , =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" A number of helpers have been obsoleted by the use of tcg_gen_gvec_* functions; remove all of them. Signed-off-by: Jan Bobek --- target/i386/ops_sse.h | 65 ------------------------------------ target/i386/ops_sse_header.h | 39 ---------------------- target/i386/translate.c | 38 --------------------- 3 files changed, 142 deletions(-) diff --git a/target/i386/ops_sse.h b/target/i386/ops_sse.h index ec1ec745d0..aca6b50f23 100644 --- a/target/i386/ops_sse.h +++ b/target/i386/ops_sse.h @@ -337,32 +337,6 @@ static inline int satsw(int x) } } -#define FADD(a, b) ((a) + (b)) -#define FADDUB(a, b) satub((a) + (b)) -#define FADDUW(a, b) satuw((a) + (b)) -#define FADDSB(a, b) satsb((int8_t)(a) + (int8_t)(b)) -#define FADDSW(a, b) satsw((int16_t)(a) + (int16_t)(b)) - -#define FSUB(a, b) ((a) - (b)) -#define FSUBUB(a, b) satub((a) - (b)) -#define FSUBUW(a, b) satuw((a) - (b)) -#define FSUBSB(a, b) satsb((int8_t)(a) - (int8_t)(b)) -#define FSUBSW(a, b) satsw((int16_t)(a) - (int16_t)(b)) -#define FMINUB(a, b) ((a) < (b)) ? (a) : (b) -#define FMINSW(a, b) ((int16_t)(a) < (int16_t)(b)) ? (a) : (b) -#define FMAXUB(a, b) ((a) > (b)) ? (a) : (b) -#define FMAXSW(a, b) ((int16_t)(a) > (int16_t)(b)) ? (a) : (b) - -#define FAND(a, b) ((a) & (b)) -#define FANDN(a, b) ((~(a)) & (b)) -#define FOR(a, b) ((a) | (b)) -#define FXOR(a, b) ((a) ^ (b)) - -#define FCMPGTB(a, b) ((int8_t)(a) > (int8_t)(b) ? -1 : 0) -#define FCMPGTW(a, b) ((int16_t)(a) > (int16_t)(b) ? -1 : 0) -#define FCMPGTL(a, b) ((int32_t)(a) > (int32_t)(b) ? -1 : 0) -#define FCMPEQ(a, b) ((a) == (b) ? -1 : 0) - #define FMULLW(a, b) ((a) * (b)) #define FMULHRW(a, b) (((int16_t)(a) * (int16_t)(b) + 0x8000) >> 16) #define FMULHUW(a, b) ((a) * (b) >> 16) @@ -371,45 +345,6 @@ static inline int satsw(int x) #define FAVG(a, b) (((a) + (b) + 1) >> 1) #endif -SSE_HELPER_B(helper_paddb, FADD) -SSE_HELPER_W(helper_paddw, FADD) -SSE_HELPER_L(helper_paddl, FADD) -SSE_HELPER_Q(helper_paddq, FADD) - -SSE_HELPER_B(helper_psubb, FSUB) -SSE_HELPER_W(helper_psubw, FSUB) -SSE_HELPER_L(helper_psubl, FSUB) -SSE_HELPER_Q(helper_psubq, FSUB) - -SSE_HELPER_B(helper_paddusb, FADDUB) -SSE_HELPER_B(helper_paddsb, FADDSB) -SSE_HELPER_B(helper_psubusb, FSUBUB) -SSE_HELPER_B(helper_psubsb, FSUBSB) - -SSE_HELPER_W(helper_paddusw, FADDUW) -SSE_HELPER_W(helper_paddsw, FADDSW) -SSE_HELPER_W(helper_psubusw, FSUBUW) -SSE_HELPER_W(helper_psubsw, FSUBSW) - -SSE_HELPER_B(helper_pminub, FMINUB) -SSE_HELPER_B(helper_pmaxub, FMAXUB) - -SSE_HELPER_W(helper_pminsw, FMINSW) -SSE_HELPER_W(helper_pmaxsw, FMAXSW) - -SSE_HELPER_Q(helper_pand, FAND) -SSE_HELPER_Q(helper_pandn, FANDN) -SSE_HELPER_Q(helper_por, FOR) -SSE_HELPER_Q(helper_pxor, FXOR) - -SSE_HELPER_B(helper_pcmpgtb, FCMPGTB) -SSE_HELPER_W(helper_pcmpgtw, FCMPGTW) -SSE_HELPER_L(helper_pcmpgtl, FCMPGTL) - -SSE_HELPER_B(helper_pcmpeqb, FCMPEQ) -SSE_HELPER_W(helper_pcmpeqw, FCMPEQ) -SSE_HELPER_L(helper_pcmpeql, FCMPEQ) - SSE_HELPER_W(helper_pmullw, FMULLW) #if SHIFT == 0 SSE_HELPER_W(helper_pmulhrw, FMULHRW) diff --git a/target/i386/ops_sse_header.h b/target/i386/ops_sse_header.h index 094aafc573..d8e33dff6b 100644 --- a/target/i386/ops_sse_header.h +++ b/target/i386/ops_sse_header.h @@ -60,45 +60,6 @@ DEF_HELPER_3(glue(pslldq, SUFFIX), void, env, Reg, Reg) #define SSE_HELPER_Q(name, F)\ DEF_HELPER_3(glue(name, SUFFIX), void, env, Reg, Reg) -SSE_HELPER_B(paddb, FADD) -SSE_HELPER_W(paddw, FADD) -SSE_HELPER_L(paddl, FADD) -SSE_HELPER_Q(paddq, FADD) - -SSE_HELPER_B(psubb, FSUB) -SSE_HELPER_W(psubw, FSUB) -SSE_HELPER_L(psubl, FSUB) -SSE_HELPER_Q(psubq, FSUB) - -SSE_HELPER_B(paddusb, FADDUB) -SSE_HELPER_B(paddsb, FADDSB) -SSE_HELPER_B(psubusb, FSUBUB) -SSE_HELPER_B(psubsb, FSUBSB) - -SSE_HELPER_W(paddusw, FADDUW) -SSE_HELPER_W(paddsw, FADDSW) -SSE_HELPER_W(psubusw, FSUBUW) -SSE_HELPER_W(psubsw, FSUBSW) - -SSE_HELPER_B(pminub, FMINUB) -SSE_HELPER_B(pmaxub, FMAXUB) - -SSE_HELPER_W(pminsw, FMINSW) -SSE_HELPER_W(pmaxsw, FMAXSW) - -SSE_HELPER_Q(pand, FAND) -SSE_HELPER_Q(pandn, FANDN) -SSE_HELPER_Q(por, FOR) -SSE_HELPER_Q(pxor, FXOR) - -SSE_HELPER_B(pcmpgtb, FCMPGTB) -SSE_HELPER_W(pcmpgtw, FCMPGTW) -SSE_HELPER_L(pcmpgtl, FCMPGTL) - -SSE_HELPER_B(pcmpeqb, FCMPEQ) -SSE_HELPER_W(pcmpeqw, FCMPEQ) -SSE_HELPER_L(pcmpeql, FCMPEQ) - SSE_HELPER_W(pmullw, FMULLW) #if SHIFT == 0 SSE_HELPER_W(pmulhrw, FMULHRW) diff --git a/target/i386/translate.c b/target/i386/translate.c index 3149989d68..78c91a85c9 100644 --- a/target/i386/translate.c +++ b/target/i386/translate.c @@ -2756,19 +2756,11 @@ static const SSEFunc_0_epp sse_op_table1[256][4] = { [0x51] = SSE_FOP(sqrt), [0x52] = { gen_helper_rsqrtps, NULL, gen_helper_rsqrtss, NULL }, [0x53] = { gen_helper_rcpps, NULL, gen_helper_rcpss, NULL }, - [0x54] = { gen_helper_pand_xmm, gen_helper_pand_xmm }, /* andps, andpd */ - [0x55] = { gen_helper_pandn_xmm, gen_helper_pandn_xmm }, /* andnps, andnpd */ - [0x56] = { gen_helper_por_xmm, gen_helper_por_xmm }, /* orps, orpd */ - [0x57] = { gen_helper_pxor_xmm, gen_helper_pxor_xmm }, /* xorps, xorpd */ [0x58] = SSE_FOP(add), [0x59] = SSE_FOP(mul), [0x5a] = { gen_helper_cvtps2pd, gen_helper_cvtpd2ps, gen_helper_cvtss2sd, gen_helper_cvtsd2ss }, [0x5b] = { gen_helper_cvtdq2ps, gen_helper_cvtps2dq, gen_helper_cvttps2dq }, - [0x5c] = SSE_FOP(sub), - [0x5d] = SSE_FOP(min), - [0x5e] = SSE_FOP(div), - [0x5f] = SSE_FOP(max), [0xc2] = SSE_FOP(cmpeq), [0xc6] = { (SSEFunc_0_epp)gen_helper_shufps, @@ -2783,9 +2775,6 @@ static const SSEFunc_0_epp sse_op_table1[256][4] = { [0x61] = MMX_OP2(punpcklwd), [0x62] = MMX_OP2(punpckldq), [0x63] = MMX_OP2(packsswb), - [0x64] = MMX_OP2(pcmpgtb), - [0x65] = MMX_OP2(pcmpgtw), - [0x66] = MMX_OP2(pcmpgtl), [0x67] = MMX_OP2(packuswb), [0x68] = MMX_OP2(punpckhbw), [0x69] = MMX_OP2(punpckhwd), @@ -2802,9 +2791,6 @@ static const SSEFunc_0_epp sse_op_table1[256][4] = { [0x71] = { SSE_SPECIAL, SSE_SPECIAL }, /* shiftw */ [0x72] = { SSE_SPECIAL, SSE_SPECIAL }, /* shiftd */ [0x73] = { SSE_SPECIAL, SSE_SPECIAL }, /* shiftq */ - [0x74] = MMX_OP2(pcmpeqb), - [0x75] = MMX_OP2(pcmpeqw), - [0x76] = MMX_OP2(pcmpeql), [0x77] = { SSE_DUMMY }, /* emms */ [0x78] = { NULL, SSE_SPECIAL, NULL, SSE_SPECIAL }, /* extrq_i, insertq_i */ [0x79] = { NULL, gen_helper_extrq_r, NULL, gen_helper_insertq_r }, @@ -2818,18 +2804,9 @@ static const SSEFunc_0_epp sse_op_table1[256][4] = { [0xd1] = MMX_OP2(psrlw), [0xd2] = MMX_OP2(psrld), [0xd3] = MMX_OP2(psrlq), - [0xd4] = MMX_OP2(paddq), [0xd5] = MMX_OP2(pmullw), [0xd6] = { NULL, SSE_SPECIAL, SSE_SPECIAL, SSE_SPECIAL }, [0xd7] = { SSE_SPECIAL, SSE_SPECIAL }, /* pmovmskb */ - [0xd8] = MMX_OP2(psubusb), - [0xd9] = MMX_OP2(psubusw), - [0xda] = MMX_OP2(pminub), - [0xdb] = MMX_OP2(pand), - [0xdc] = MMX_OP2(paddusb), - [0xdd] = MMX_OP2(paddusw), - [0xde] = MMX_OP2(pmaxub), - [0xdf] = MMX_OP2(pandn), [0xe0] = MMX_OP2(pavgb), [0xe1] = MMX_OP2(psraw), [0xe2] = MMX_OP2(psrad), @@ -2838,14 +2815,6 @@ static const SSEFunc_0_epp sse_op_table1[256][4] = { [0xe5] = MMX_OP2(pmulhw), [0xe6] = { NULL, gen_helper_cvttpd2dq, gen_helper_cvtdq2pd, gen_helper_cvtpd2dq }, [0xe7] = { SSE_SPECIAL , SSE_SPECIAL }, /* movntq, movntq */ - [0xe8] = MMX_OP2(psubsb), - [0xe9] = MMX_OP2(psubsw), - [0xea] = MMX_OP2(pminsw), - [0xeb] = MMX_OP2(por), - [0xec] = MMX_OP2(paddsb), - [0xed] = MMX_OP2(paddsw), - [0xee] = MMX_OP2(pmaxsw), - [0xef] = MMX_OP2(pxor), [0xf0] = { NULL, NULL, NULL, SSE_SPECIAL }, /* lddqu */ [0xf1] = MMX_OP2(psllw), [0xf2] = MMX_OP2(pslld), @@ -2855,13 +2824,6 @@ static const SSEFunc_0_epp sse_op_table1[256][4] = { [0xf6] = MMX_OP2(psadbw), [0xf7] = { (SSEFunc_0_epp)gen_helper_maskmov_mmx, (SSEFunc_0_epp)gen_helper_maskmov_xmm }, /* XXX: casts */ - [0xf8] = MMX_OP2(psubb), - [0xf9] = MMX_OP2(psubw), - [0xfa] = MMX_OP2(psubl), - [0xfb] = MMX_OP2(psubq), - [0xfc] = MMX_OP2(paddb), - [0xfd] = MMX_OP2(paddw), - [0xfe] = MMX_OP2(paddl), }; static const SSEFunc_0_epp sse_op_table2[3 * 8][2] = { From patchwork Wed Aug 21 17:29:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Bobek X-Patchwork-Id: 11107997 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id F2E0A1813 for ; Wed, 21 Aug 2019 18:41:41 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C9EC4214DA for ; Wed, 21 Aug 2019 18:41:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="BJpOeVRQ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C9EC4214DA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:51880 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0VYC-0008HM-EN for patchwork-qemu-devel@patchwork.kernel.org; Wed, 21 Aug 2019 14:41:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41498) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0URv-0001mM-2Q for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:31:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i0URs-0008Vg-Iv for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:31:06 -0400 Received: from mail-yb1-xb2c.google.com ([2607:f8b0:4864:20::b2c]:38378) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i0URs-0008UA-Ay for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:31:04 -0400 Received: by mail-yb1-xb2c.google.com with SMTP id j199so1343217ybg.5 for ; Wed, 21 Aug 2019 10:31:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=2P8XG/Ms0z5Bv/o+4iT7E2lxGG7rMaNpaALMij/pc5c=; b=BJpOeVRQ7v+ylzEZQLePtTdBgFOyHXZPVXJG1daDdapCx1d3LvnZpyu+GrS2aMlzhr v3Q6fPFJr+lz3S+5ajm2929Lu1y/MpaIWhCaEhULju6ArL05NBV5rgT3APM9Q/o9cgvo 6nHQ1f72WhGJT9mG9ehDz/F3fi8jE8pEskya8+IsPzFKy9HTq2E2gFkDw9Mi+DhZz72T /SGRk2rf782Ua1dEyOVQQe0TdKgAazOS/Ll1QYuzLHMqejIig5xQRqblLvAvyeHEwSdN KFozQcHbbpJ9Py/5xqEMzgzfd9IBBipmxad4sok9g9X35xhsOhVOJbrMktp0FrLpgjfV CY+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=2P8XG/Ms0z5Bv/o+4iT7E2lxGG7rMaNpaALMij/pc5c=; b=hHH6Ed47ZAGX3u60UtE9O30bn3G0Sl64RfFW8Zo4nHpUBKZHnEFybfBWQIEPwWXfRY xssWMvzGg7b1iNdHr962fWaYIDzk6FWrIkKzCQIHKBwGemzvXo7NFLZKyD2YP+8ur497 ooTbPd9X3LRjO/oln7nro7FnELKI+PDbkIFbuKBsjL8vVHrosQc7fisxdPxT92GJFFy+ ctUvq6Y3bARxT/OC+bFxlBYYZ7t8tl7gCwrRhqmVj7hKPgHWFvqwI+Qb4FP6VfPnZq1q 19nVw0VMhHlMHIHicKCho8oDJJAWiDa6Y2MFmBByWp5LIAlCY3gdtljckzWS+yoAqh72 FhYg== X-Gm-Message-State: APjAAAW4SIrruD1LQgT9B7KbcfvQnyRa7WektuIaVAysSAfhIkCSTibb 4D7IyggttlEXGKjrE12fo0HAAkjF X-Google-Smtp-Source: APXvYqzTSkyNc4NkJl/7nDJhl8bn5NLGhQ6nhMrK+qfasXBTFN5dFu41sq547IsqkgZlPn4JypgHIw== X-Received: by 2002:a25:c2c4:: with SMTP id s187mr25662473ybf.21.1566408663299; Wed, 21 Aug 2019 10:31:03 -0700 (PDT) Received: from localhost.localdomain ([2601:c0:c67f:e390::3]) by smtp.gmail.com with ESMTPSA id l71sm2826167ywl.39.2019.08.21.10.31.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Aug 2019 10:31:02 -0700 (PDT) From: Jan Bobek To: qemu-devel@nongnu.org Date: Wed, 21 Aug 2019 13:29:42 -0400 Message-Id: <20190821172951.15333-67-jan.bobek@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190821172951.15333-1-jan.bobek@gmail.com> References: <20190821172951.15333-1-jan.bobek@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::b2c Subject: [Qemu-devel] [RFC PATCH v4 66/75] target/i386: cleanup leftovers in ops_sse_header.h X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jan Bobek , =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Get rid of unused macro definitions that have been left over after removal of obsoleted helpers. --- target/i386/ops_sse_header.h | 28 ++++++---------------------- 1 file changed, 6 insertions(+), 22 deletions(-) diff --git a/target/i386/ops_sse_header.h b/target/i386/ops_sse_header.h index d8e33dff6b..afa0ad0938 100644 --- a/target/i386/ops_sse_header.h +++ b/target/i386/ops_sse_header.h @@ -48,27 +48,15 @@ DEF_HELPER_3(glue(psrldq, SUFFIX), void, env, Reg, Reg) DEF_HELPER_3(glue(pslldq, SUFFIX), void, env, Reg, Reg) #endif -#define SSE_HELPER_B(name, F)\ - DEF_HELPER_3(glue(name, SUFFIX), void, env, Reg, Reg) - -#define SSE_HELPER_W(name, F)\ - DEF_HELPER_3(glue(name, SUFFIX), void, env, Reg, Reg) - -#define SSE_HELPER_L(name, F)\ - DEF_HELPER_3(glue(name, SUFFIX), void, env, Reg, Reg) - -#define SSE_HELPER_Q(name, F)\ - DEF_HELPER_3(glue(name, SUFFIX), void, env, Reg, Reg) - -SSE_HELPER_W(pmullw, FMULLW) +DEF_HELPER_3(glue(pmullw, SUFFIX), void, env, Reg, Reg) #if SHIFT == 0 -SSE_HELPER_W(pmulhrw, FMULHRW) +DEF_HELPER_3(glue(pmulhrw, SUFFIX), void, env, Reg, Reg) #endif -SSE_HELPER_W(pmulhuw, FMULHUW) -SSE_HELPER_W(pmulhw, FMULHW) +DEF_HELPER_3(glue(pmulhuw, SUFFIX), void, env, Reg, Reg) +DEF_HELPER_3(glue(pmulhw, SUFFIX), void, env, Reg, Reg) -SSE_HELPER_B(pavgb, FAVG) -SSE_HELPER_W(pavgw, FAVG) +DEF_HELPER_3(glue(pavgb, SUFFIX), void, env, Reg, Reg) +DEF_HELPER_3(glue(pavgw, SUFFIX), void, env, Reg, Reg) DEF_HELPER_3(glue(pmuludq, SUFFIX), void, env, Reg, Reg) DEF_HELPER_3(glue(pmaddwd, SUFFIX), void, env, Reg, Reg) @@ -311,10 +299,6 @@ DEF_HELPER_4(glue(pclmulqdq, SUFFIX), void, env, Reg, Reg, i32) #undef Reg #undef SUFFIX -#undef SSE_HELPER_B -#undef SSE_HELPER_W -#undef SSE_HELPER_L -#undef SSE_HELPER_Q #undef SSE_HELPER_S #undef SSE_HELPER_CMP #undef UNPCK_OP From patchwork Wed Aug 21 17:29:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Bobek X-Patchwork-Id: 11107873 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7648514DB for ; Wed, 21 Aug 2019 18:26:53 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4E390216F4 for ; Wed, 21 Aug 2019 18:26:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="lxRADTNp" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4E390216F4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:51686 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0VJr-0003sx-K3 for patchwork-qemu-devel@patchwork.kernel.org; Wed, 21 Aug 2019 14:26:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41507) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0URv-0001my-BC for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:31:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i0URt-0008WM-5X for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:31:07 -0400 Received: from mail-yb1-xb42.google.com ([2607:f8b0:4864:20::b42]:38908) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i0URt-0008W0-0p for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:31:05 -0400 Received: by mail-yb1-xb42.google.com with SMTP id j199so1343229ybg.5 for ; Wed, 21 Aug 2019 10:31:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=1c3Na9HxVp5HO/a1YQcRY2ARb5VgxB+NQ4zHhWuq1wk=; b=lxRADTNpi5bLD68A9jD6pH4WCJwjyfG9iRGtM0+tFFILtWebWRfEMkOzCUsG8IMkO/ Y5/5OLUdGKXvEJl0CORop77ArTMHxSWURCxxU56mUjog6+s4CaThDKipbD/wO57PQ0gq zaJ+IoPSdoH4JXlLyKjminn/Ae2bPsI7m/5k9io1iqRcNRTGdNDREOaY7gvyrL6urYSK pKs0iN1tthy9C87Vr1uDQ1iTgH08g+NuKfLoduwzhjI98Ndc8k1QBh71r/lBl884XVZO GI71DX6yg8GFxOxDh+WP/hNV52RfT3v+imKtiJybkOsyZcq2G0jrdkEbiyKvQ9Oa3opU bMMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=1c3Na9HxVp5HO/a1YQcRY2ARb5VgxB+NQ4zHhWuq1wk=; b=H3gqV2eU4blUG2Zd6N+TtPRdU752DfnqxjFFH9W6aL2x5y6YpZ3qC9amTT6PSVhuy6 EJwBbn/nuftCzaSS4OdN3Nr2pXVIeW06RjUyjtJ3zSzvhVmZTfZ/qiChMhbCZ7Vg8NBf QP6S6NaIO4EH+UDQZWAqWuYL8hm7SB7sd0h3gqoXQYZsrnyAlB25r9ykVul3pY9+ZTzW DoaaqE6SIjzIH0uxj1zqIcNVy3W1mlkVBPaRMMfErJxeDgdghme1YIrZ8fZAj+7t2m0+ eC/tgde3mi0+GLjCs2ZVitxAqB7SBpZo0LutoqOofrF9BMTTJxxKbBEZvGS2KPZPvwWB OxOg== X-Gm-Message-State: APjAAAX26BhXSauiceTsgmqsYV9H6f0iT1TgXedS5QWfd7nZDwzYFdEH LATgrJhA2CxpxnGj7EW7FIypWz28 X-Google-Smtp-Source: APXvYqzujNeoCqmonO71Q81kwm9FDorBdg97znBwsXidlIutJvPbJ/hme2GnQtGygpGnnGBg/r9YBg== X-Received: by 2002:a25:2f42:: with SMTP id v63mr24155062ybv.228.1566408664326; Wed, 21 Aug 2019 10:31:04 -0700 (PDT) Received: from localhost.localdomain ([2601:c0:c67f:e390::3]) by smtp.gmail.com with ESMTPSA id l71sm2826167ywl.39.2019.08.21.10.31.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Aug 2019 10:31:03 -0700 (PDT) From: Jan Bobek To: qemu-devel@nongnu.org Date: Wed, 21 Aug 2019 13:29:43 -0400 Message-Id: <20190821172951.15333-68-jan.bobek@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190821172951.15333-1-jan.bobek@gmail.com> References: <20190821172951.15333-1-jan.bobek@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::b42 Subject: [Qemu-devel] [RFC PATCH v4 67/75] target/i386: introduce aliases for helper-based tcg_gen_gvec_* functions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jan Bobek , =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Expand our aliases for tcg_gen_gvec_* functions to also include those that generate calls to out-of-line helpers. This allows us use them via the DEF_GEN_INSN*_GVEC macros. --- target/i386/translate.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/target/i386/translate.c b/target/i386/translate.c index 78c91a85c9..c7e664e798 100644 --- a/target/i386/translate.c +++ b/target/i386/translate.c @@ -4441,6 +4441,36 @@ static void gen_sse(CPUX86State *env, DisasContext *s, int b) } } +#define gen_gvec_s1_ool(ret, aofs, oprsz, maxsz, data, helper) \ + do { \ + const TCGv_ptr a0 = tcg_temp_new_ptr(); \ + const TCGv_i32 desc = \ + tcg_const_i32(simd_desc(oprsz, maxsz, 0)); \ + \ + tcg_gen_addi_ptr(a0, cpu_env, aofs); \ + gen_helper_ ## helper(ret, a0, desc); \ + \ + tcg_temp_free_ptr(a0); \ + tcg_temp_free_i32(desc); \ + } while (0) + +/* + * We pass the immediate value via simd_data. The width is limited + * to SIMD_DATA_BITS, but we only use up to 8-bit immediates. + */ +#define gen_gvec_sd1_ool(ret, aofs, oprsz, maxsz, helper) \ + gen_gvec_s1_ool(ret, aofs, oprsz, maxsz, 0, helper) +#define gen_gvec_sq1_ool(ret, aofs, oprsz, maxsz, helper) \ + gen_gvec_s1_ool(ret, aofs, oprsz, maxsz, 0, helper) +#define gen_gvec_2_ool(aofs, bofs, oprsz, maxsz, helper) \ + tcg_gen_gvec_2_ool(aofs, bofs, oprsz, maxsz, 0, gen_helper_ ## helper) +#define gen_gvec_2i_ool(aofs, bofs, c, oprsz, maxsz, helper) \ + tcg_gen_gvec_2_ool(aofs, bofs, oprsz, maxsz, c, gen_helper_ ## helper) +#define gen_gvec_3_ool(aofs, bofs, cofs, oprsz, maxsz, helper) \ + tcg_gen_gvec_3_ool(aofs, bofs, cofs, oprsz, maxsz, 0, gen_helper_ ## helper) +#define gen_gvec_3i_ool(aofs, bofs, cofs, c, oprsz, maxsz, helper) \ + tcg_gen_gvec_3_ool(aofs, bofs, cofs, oprsz, maxsz, c, gen_helper_ ## helper) + #define gen_gvec_mov(dofs, aofs, oprsz, maxsz, vece) \ tcg_gen_gvec_mov(vece, dofs, aofs, oprsz, maxsz) From patchwork Wed Aug 21 17:29:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Bobek X-Patchwork-Id: 11107983 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 85BEF1395 for ; Wed, 21 Aug 2019 18:37:14 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4D4DA22DD3 for ; Wed, 21 Aug 2019 18:37:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="dDdemTJw" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4D4DA22DD3 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:51836 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0VTt-0002Vc-1w for patchwork-qemu-devel@patchwork.kernel.org; Wed, 21 Aug 2019 14:37:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41560) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0URz-0001t4-1C for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:31:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i0URu-00006M-Jk for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:31:10 -0400 Received: from mail-yw1-xc34.google.com ([2607:f8b0:4864:20::c34]:34432) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i0URu-00005u-CF for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:31:06 -0400 Received: by mail-yw1-xc34.google.com with SMTP id n126so1251796ywf.1 for ; Wed, 21 Aug 2019 10:31:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=w6BAbGITg74d88mL6TMorZ/6vn44B+cNvj3di/2/Ocg=; b=dDdemTJwGrFhbCl6yk9Ybuln8g2m5VDfVEMj+biZzdoz9R7RbFap0q5b/HBdSsX2oZ JRzpfSZiTtAge0UqAarmz1EFZhHGXo3xq+F6lrg/wrl0atu33tKfkwlROW8C5am8DAwQ t6zml2MFXU2vXDzEkqBOGitBjQyGSImZPTxZTINwnqZb0uRJiRvQNBTD5NAQeEhJaTl0 9difrMCJzUSXXtl5nUzWrcuZFbiDq/xJLdiSXnAiBoTGfJQ0AnmNI5QZe2RuRQnatvx1 /3GDNFZ4O0F4xTC4HRatS/6sVb0jY78xmsOO7yedoOvwRYDnmWZGtbUv/rBVUwrYnJ7e x+Lg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=w6BAbGITg74d88mL6TMorZ/6vn44B+cNvj3di/2/Ocg=; b=d5CvhRlTdQ9I9Jnynn+CDjct6TF/U8pFJMBM9BWcaPCSuSwHHHDSFHo53qdLhkI8Ml dVVb7TdkfCyO1DkSpdvnQ1X1QW+0v5XNZWkKyB9hEMMO71f82VXNMmdsi+e57SGb9daT Z+SWjcldlODlyxFdkxPSZv62h5zEATBUBUun5n6vfm8jOdltKrgKVGFf2Bq73VZuDX3U Yw7ZQgAwwbVguORgAXPimCrEFKz+cuVCHpijpjcsKqD2olT2DEAhnhPU9qok9lUUUpPg opHoT7SRQQ4hoKBWu9gmhxyLkoYwGQKqB1dzeJzi+YtFiudAXv3OA4irtfN5befRfAnp 93ig== X-Gm-Message-State: APjAAAXsIu/6OXH8zu+p3anxiDhCHfPZ5yMfjuXqzcv7IZu7/8LlpNtF QVeFBsh9AJo1yO9c/qG7WMAnilTJ X-Google-Smtp-Source: APXvYqy5wHxEGGZHctd+cssRplG4F3Dk6O4UUnwPrxPRoD9VX7zxaByH9ZSvTsIWqOHQs2umIWVqNQ== X-Received: by 2002:a81:2e84:: with SMTP id u126mr24493583ywu.398.1566408665072; Wed, 21 Aug 2019 10:31:05 -0700 (PDT) Received: from localhost.localdomain ([2601:c0:c67f:e390::3]) by smtp.gmail.com with ESMTPSA id l71sm2826167ywl.39.2019.08.21.10.31.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Aug 2019 10:31:04 -0700 (PDT) From: Jan Bobek To: qemu-devel@nongnu.org Date: Wed, 21 Aug 2019 13:29:44 -0400 Message-Id: <20190821172951.15333-69-jan.bobek@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190821172951.15333-1-jan.bobek@gmail.com> References: <20190821172951.15333-1-jan.bobek@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::c34 Subject: [Qemu-devel] [RFC PATCH v4 68/75] target/i386: convert ps((l, r)l(w, d, q), ra(w, d)) to helpers to gvec style X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jan Bobek , =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Make these helpers suitable for use with tcg_gen_gvec_* functions. Signed-off-by: Jan Bobek --- target/i386/ops_sse.h | 357 +++++++++++++++++++++-------------- target/i386/ops_sse_header.h | 30 ++- target/i386/translate.c | 259 +++++++------------------ 3 files changed, 306 insertions(+), 340 deletions(-) diff --git a/target/i386/ops_sse.h b/target/i386/ops_sse.h index aca6b50f23..168e581c0c 100644 --- a/target/i386/ops_sse.h +++ b/target/i386/ops_sse.h @@ -19,6 +19,7 @@ */ #include "crypto/aes.h" +#include "tcg-gvec-desc.h" #if SHIFT == 0 #define Reg MMXReg @@ -38,199 +39,273 @@ #define SUFFIX _xmm #endif -void glue(helper_psrlw, SUFFIX)(CPUX86State *env, Reg *d, Reg *s) +static inline void glue(clear_high, SUFFIX)(Reg *d, intptr_t oprsz, + intptr_t maxsz) { - int shift; + intptr_t i; - if (s->Q(0) > 15) { - d->Q(0) = 0; -#if SHIFT == 1 - d->Q(1) = 0; -#endif - } else { - shift = s->B(0); - d->W(0) >>= shift; - d->W(1) >>= shift; - d->W(2) >>= shift; - d->W(3) >>= shift; -#if SHIFT == 1 - d->W(4) >>= shift; - d->W(5) >>= shift; - d->W(6) >>= shift; - d->W(7) >>= shift; -#endif + assert(oprsz % sizeof(uint64_t) == 0); + assert(maxsz % sizeof(uint64_t) == 0); + + if (oprsz < maxsz) { + i = oprsz / sizeof(uint64_t); + for (; i * sizeof(uint64_t) < maxsz; ++i) { + d->Q(i) = 0; + } } } -void glue(helper_psraw, SUFFIX)(CPUX86State *env, Reg *d, Reg *s) +void glue(helper_psllw, SUFFIX)(Reg *d, Reg *a, Reg *b, uint32_t desc) { - int shift; + const uint64_t count = b->Q(0); + const intptr_t oprsz = count > 15 ? 0 : simd_oprsz(desc); + const intptr_t maxsz = simd_maxsz(desc); - if (s->Q(0) > 15) { - shift = 15; - } else { - shift = s->B(0); + for (intptr_t i = 0; i * sizeof(uint16_t) < oprsz; ++i) { + d->W(i) = a->W(i) << count; } - d->W(0) = (int16_t)d->W(0) >> shift; - d->W(1) = (int16_t)d->W(1) >> shift; - d->W(2) = (int16_t)d->W(2) >> shift; - d->W(3) = (int16_t)d->W(3) >> shift; -#if SHIFT == 1 - d->W(4) = (int16_t)d->W(4) >> shift; - d->W(5) = (int16_t)d->W(5) >> shift; - d->W(6) = (int16_t)d->W(6) >> shift; - d->W(7) = (int16_t)d->W(7) >> shift; -#endif + glue(clear_high, SUFFIX)(d, oprsz, maxsz); } -void glue(helper_psllw, SUFFIX)(CPUX86State *env, Reg *d, Reg *s) +void glue(helper_pslld, SUFFIX)(Reg *d, Reg *a, Reg *b, uint32_t desc) { - int shift; + const uint64_t count = b->Q(0); + const intptr_t oprsz = count > 31 ? 0 : simd_oprsz(desc); + const intptr_t maxsz = simd_maxsz(desc); - if (s->Q(0) > 15) { - d->Q(0) = 0; -#if SHIFT == 1 - d->Q(1) = 0; -#endif - } else { - shift = s->B(0); - d->W(0) <<= shift; - d->W(1) <<= shift; - d->W(2) <<= shift; - d->W(3) <<= shift; -#if SHIFT == 1 - d->W(4) <<= shift; - d->W(5) <<= shift; - d->W(6) <<= shift; - d->W(7) <<= shift; -#endif + for (intptr_t i = 0; i * sizeof(uint32_t) < oprsz; ++i) { + d->L(i) = a->L(i) << count; } + glue(clear_high, SUFFIX)(d, oprsz, maxsz); } -void glue(helper_psrld, SUFFIX)(CPUX86State *env, Reg *d, Reg *s) +void glue(helper_psllq, SUFFIX)(Reg *d, Reg *a, Reg *b, uint32_t desc) { - int shift; + const uint64_t count = b->Q(0); + const intptr_t oprsz = count > 63 ? 0 : simd_oprsz(desc); + const intptr_t maxsz = simd_maxsz(desc); - if (s->Q(0) > 31) { - d->Q(0) = 0; -#if SHIFT == 1 - d->Q(1) = 0; -#endif - } else { - shift = s->B(0); - d->L(0) >>= shift; - d->L(1) >>= shift; -#if SHIFT == 1 - d->L(2) >>= shift; - d->L(3) >>= shift; -#endif + for (intptr_t i = 0; i * sizeof(uint64_t) < oprsz; ++i) { + d->Q(i) = a->Q(i) << count; } + glue(clear_high, SUFFIX)(d, oprsz, maxsz); } -void glue(helper_psrad, SUFFIX)(CPUX86State *env, Reg *d, Reg *s) +void glue(helper_psllwi, SUFFIX)(Reg *d, Reg *a, uint32_t desc) { - int shift; + const uint64_t count = simd_data(desc); + const intptr_t oprsz = count > 15 ? 0 : simd_oprsz(desc); + const intptr_t maxsz = simd_maxsz(desc); - if (s->Q(0) > 31) { - shift = 31; - } else { - shift = s->B(0); + for (intptr_t i = 0; i * sizeof(uint16_t) < oprsz; ++i) { + d->W(i) = a->W(i) << count; } - d->L(0) = (int32_t)d->L(0) >> shift; - d->L(1) = (int32_t)d->L(1) >> shift; -#if SHIFT == 1 - d->L(2) = (int32_t)d->L(2) >> shift; - d->L(3) = (int32_t)d->L(3) >> shift; -#endif + glue(clear_high, SUFFIX)(d, oprsz, maxsz); } -void glue(helper_pslld, SUFFIX)(CPUX86State *env, Reg *d, Reg *s) +void glue(helper_pslldi, SUFFIX)(Reg *d, Reg *a, uint32_t desc) { - int shift; + const uint64_t count = simd_data(desc); + const intptr_t oprsz = count > 31 ? 0 : simd_oprsz(desc); + const intptr_t maxsz = simd_maxsz(desc); - if (s->Q(0) > 31) { - d->Q(0) = 0; -#if SHIFT == 1 - d->Q(1) = 0; -#endif - } else { - shift = s->B(0); - d->L(0) <<= shift; - d->L(1) <<= shift; -#if SHIFT == 1 - d->L(2) <<= shift; - d->L(3) <<= shift; -#endif + for (intptr_t i = 0; i * sizeof(uint32_t) < oprsz; ++i) { + d->L(i) = a->L(i) << count; } + glue(clear_high, SUFFIX)(d, oprsz, maxsz); } -void glue(helper_psrlq, SUFFIX)(CPUX86State *env, Reg *d, Reg *s) +void glue(helper_psllqi, SUFFIX)(Reg *d, Reg *a, uint32_t desc) { - int shift; + const uint64_t count = simd_data(desc); + const intptr_t oprsz = count > 63 ? 0 : simd_oprsz(desc); + const intptr_t maxsz = simd_maxsz(desc); - if (s->Q(0) > 63) { - d->Q(0) = 0; -#if SHIFT == 1 - d->Q(1) = 0; -#endif - } else { - shift = s->B(0); - d->Q(0) >>= shift; -#if SHIFT == 1 - d->Q(1) >>= shift; -#endif + for (intptr_t i = 0; i * sizeof(uint64_t) < oprsz; ++i) { + d->Q(i) = a->Q(i) << count; } + glue(clear_high, SUFFIX)(d, oprsz, maxsz); } -void glue(helper_psllq, SUFFIX)(CPUX86State *env, Reg *d, Reg *s) +void glue(helper_psrlw, SUFFIX)(Reg *d, Reg *a, Reg *b, uint32_t desc) { - int shift; + const uint64_t count = b->Q(0); + const intptr_t oprsz = count > 15 ? 0 : simd_oprsz(desc); + const intptr_t maxsz = simd_maxsz(desc); - if (s->Q(0) > 63) { - d->Q(0) = 0; -#if SHIFT == 1 - d->Q(1) = 0; -#endif - } else { - shift = s->B(0); - d->Q(0) <<= shift; -#if SHIFT == 1 - d->Q(1) <<= shift; -#endif + for (intptr_t i = 0; i * sizeof(uint16_t) < oprsz; ++i) { + d->W(i) = a->W(i) >> count; } + glue(clear_high, SUFFIX)(d, oprsz, maxsz); } -#if SHIFT == 1 -void glue(helper_psrldq, SUFFIX)(CPUX86State *env, Reg *d, Reg *s) +void glue(helper_psrld, SUFFIX)(Reg *d, Reg *a, Reg *b, uint32_t desc) +{ + const uint64_t count = b->Q(0); + const intptr_t oprsz = count > 31 ? 0 : simd_oprsz(desc); + const intptr_t maxsz = simd_maxsz(desc); + + for (intptr_t i = 0; i * sizeof(uint32_t) < oprsz; ++i) { + d->L(i) = a->L(i) >> count; + } + glue(clear_high, SUFFIX)(d, oprsz, maxsz); +} + +void glue(helper_psrlq, SUFFIX)(Reg *d, Reg *a, Reg *b, uint32_t desc) +{ + const uint64_t count = b->Q(0); + const intptr_t oprsz = count > 63 ? 0 : simd_oprsz(desc); + const intptr_t maxsz = simd_maxsz(desc); + + for (intptr_t i = 0; i * sizeof(uint64_t) < oprsz; ++i) { + d->Q(i) = a->Q(i) >> count; + } + glue(clear_high, SUFFIX)(d, oprsz, maxsz); +} + +void glue(helper_psrlwi, SUFFIX)(Reg *d, Reg *a, uint32_t desc) +{ + const uint64_t count = simd_data(desc); + const intptr_t oprsz = count > 15 ? 0 : simd_oprsz(desc); + const intptr_t maxsz = simd_maxsz(desc); + + for (intptr_t i = 0; i * sizeof(uint16_t) < oprsz; ++i) { + d->W(i) = a->W(i) >> count; + } + glue(clear_high, SUFFIX)(d, oprsz, maxsz); +} + +void glue(helper_psrldi, SUFFIX)(Reg *d, Reg *a, uint32_t desc) +{ + const uint64_t count = simd_data(desc); + const intptr_t oprsz = count > 31 ? 0 : simd_oprsz(desc); + const intptr_t maxsz = simd_maxsz(desc); + + for (intptr_t i = 0; i * sizeof(uint32_t) < oprsz; ++i) { + d->L(i) = a->L(i) >> count; + } + glue(clear_high, SUFFIX)(d, oprsz, maxsz); +} + +void glue(helper_psrlqi, SUFFIX)(Reg *d, Reg *a, uint32_t desc) { - int shift, i; + const uint64_t count = simd_data(desc); + const intptr_t oprsz = count > 63 ? 0 : simd_oprsz(desc); + const intptr_t maxsz = simd_maxsz(desc); - shift = s->L(0); - if (shift > 16) { - shift = 16; + for (intptr_t i = 0; i * sizeof(uint64_t) < oprsz; ++i) { + d->Q(i) = a->Q(i) >> count; } - for (i = 0; i < 16 - shift; i++) { - d->B(i) = d->B(i + shift); + glue(clear_high, SUFFIX)(d, oprsz, maxsz); +} + +void glue(helper_psraw, SUFFIX)(Reg *d, Reg *a, Reg *b, uint32_t desc) +{ + const intptr_t oprsz = simd_oprsz(desc); + const intptr_t maxsz = simd_maxsz(desc); + + uint64_t count = b->Q(0); + if (count > 15) { + count = 15; + } + + for (intptr_t i = 0; i * sizeof(uint16_t) < oprsz; ++i) { + d->W(i) = (int16_t)a->W(i) >> count; + } + glue(clear_high, SUFFIX)(d, oprsz, maxsz); +} + +void glue(helper_psrad, SUFFIX)(Reg *d, Reg *a, Reg *b, uint32_t desc) +{ + const intptr_t oprsz = simd_oprsz(desc); + const intptr_t maxsz = simd_maxsz(desc); + + uint64_t count = b->Q(0); + if (count > 31) { + count = 31; } - for (i = 16 - shift; i < 16; i++) { - d->B(i) = 0; + + for (intptr_t i = 0; i * sizeof(uint32_t) < oprsz; ++i) { + d->L(i) = (int32_t)a->L(i) >> count; } + glue(clear_high, SUFFIX)(d, oprsz, maxsz); } -void glue(helper_pslldq, SUFFIX)(CPUX86State *env, Reg *d, Reg *s) +void glue(helper_psrawi, SUFFIX)(Reg *d, Reg *a, uint32_t desc) { - int shift, i; + const intptr_t oprsz = simd_oprsz(desc); + const intptr_t maxsz = simd_maxsz(desc); - shift = s->L(0); - if (shift > 16) { - shift = 16; + uint64_t count = simd_data(desc); + if (count > 15) { + count = 15; } - for (i = 15; i >= shift; i--) { - d->B(i) = d->B(i - shift); + + for (intptr_t i = 0; i * sizeof(uint16_t) < oprsz; ++i) { + d->W(i) = (int16_t)a->W(i) >> count; } - for (i = 0; i < shift; i++) { - d->B(i) = 0; + glue(clear_high, SUFFIX)(d, oprsz, maxsz); +} + +void glue(helper_psradi, SUFFIX)(Reg *d, Reg *a, uint32_t desc) +{ + const intptr_t oprsz = simd_oprsz(desc); + const intptr_t maxsz = simd_maxsz(desc); + + uint64_t count = simd_data(desc); + if (count > 31) { + count = 31; + } + + for (intptr_t i = 0; i * sizeof(uint32_t) < oprsz; ++i) { + d->L(i) = (int32_t)a->L(i) >> count; + } + glue(clear_high, SUFFIX)(d, oprsz, maxsz); +} + +#if SHIFT == 1 +void glue(helper_pslldqi, SUFFIX)(Reg *d, Reg *a, uint32_t desc) +{ + const intptr_t oprsz = simd_oprsz(desc); + const intptr_t maxsz = simd_maxsz(desc); + + unsigned int count = simd_data(desc); + if (count > 16) { + count = 16; + } + + for (intptr_t i = 0; i < oprsz; i += 16) { + intptr_t j = 15; + for (; count <= j; --j) { + d->B(i + j) = a->B(i + j - count); + } + for (; 0 <= j; --j) { + d->B(i + j) = 0; + } + } + glue(clear_high, SUFFIX)(d, oprsz, maxsz); +} + +void glue(helper_psrldqi, SUFFIX)(Reg *d, Reg *a, uint32_t desc) +{ + const intptr_t oprsz = simd_oprsz(desc); + const intptr_t maxsz = simd_maxsz(desc); + + unsigned int count = simd_data(desc); + if (count > 16) { + count = 16; + } + + for (intptr_t i = 0; i < oprsz; i += 16) { + intptr_t j = 0; + for (; j + count < 16; ++j) { + d->B(i + j) = a->B(i + j + count); + } + for (; j < 16; ++j) { + d->B(i + j) = 0; + } } + glue(clear_high, SUFFIX)(d, oprsz, maxsz); } #endif diff --git a/target/i386/ops_sse_header.h b/target/i386/ops_sse_header.h index afa0ad0938..724692a689 100644 --- a/target/i386/ops_sse_header.h +++ b/target/i386/ops_sse_header.h @@ -34,18 +34,28 @@ #define dh_is_signed_ZMMReg dh_is_signed_ptr #define dh_is_signed_MMXReg dh_is_signed_ptr -DEF_HELPER_3(glue(psrlw, SUFFIX), void, env, Reg, Reg) -DEF_HELPER_3(glue(psraw, SUFFIX), void, env, Reg, Reg) -DEF_HELPER_3(glue(psllw, SUFFIX), void, env, Reg, Reg) -DEF_HELPER_3(glue(psrld, SUFFIX), void, env, Reg, Reg) -DEF_HELPER_3(glue(psrad, SUFFIX), void, env, Reg, Reg) -DEF_HELPER_3(glue(pslld, SUFFIX), void, env, Reg, Reg) -DEF_HELPER_3(glue(psrlq, SUFFIX), void, env, Reg, Reg) -DEF_HELPER_3(glue(psllq, SUFFIX), void, env, Reg, Reg) +DEF_HELPER_4(glue(psllw, SUFFIX), void, Reg, Reg, Reg, i32) +DEF_HELPER_4(glue(pslld, SUFFIX), void, Reg, Reg, Reg, i32) +DEF_HELPER_4(glue(psllq, SUFFIX), void, Reg, Reg, Reg, i32) +DEF_HELPER_3(glue(psllwi, SUFFIX), void, Reg, Reg, i32) +DEF_HELPER_3(glue(pslldi, SUFFIX), void, Reg, Reg, i32) +DEF_HELPER_3(glue(psllqi, SUFFIX), void, Reg, Reg, i32) + +DEF_HELPER_4(glue(psrlw, SUFFIX), void, Reg, Reg, Reg, i32) +DEF_HELPER_4(glue(psrld, SUFFIX), void, Reg, Reg, Reg, i32) +DEF_HELPER_4(glue(psrlq, SUFFIX), void, Reg, Reg, Reg, i32) +DEF_HELPER_3(glue(psrlwi, SUFFIX), void, Reg, Reg, i32) +DEF_HELPER_3(glue(psrldi, SUFFIX), void, Reg, Reg, i32) +DEF_HELPER_3(glue(psrlqi, SUFFIX), void, Reg, Reg, i32) + +DEF_HELPER_4(glue(psraw, SUFFIX), void, Reg, Reg, Reg, i32) +DEF_HELPER_4(glue(psrad, SUFFIX), void, Reg, Reg, Reg, i32) +DEF_HELPER_3(glue(psrawi, SUFFIX), void, Reg, Reg, i32) +DEF_HELPER_3(glue(psradi, SUFFIX), void, Reg, Reg, i32) #if SHIFT == 1 -DEF_HELPER_3(glue(psrldq, SUFFIX), void, env, Reg, Reg) -DEF_HELPER_3(glue(pslldq, SUFFIX), void, env, Reg, Reg) +DEF_HELPER_3(glue(pslldqi, SUFFIX), void, Reg, Reg, i32) +DEF_HELPER_3(glue(psrldqi, SUFFIX), void, Reg, Reg, i32) #endif DEF_HELPER_3(glue(pmullw, SUFFIX), void, env, Reg, Reg) diff --git a/target/i386/translate.c b/target/i386/translate.c index c7e664e798..03f7c6e450 100644 --- a/target/i386/translate.c +++ b/target/i386/translate.c @@ -2801,24 +2801,16 @@ static const SSEFunc_0_epp sse_op_table1[256][4] = { [0xc4] = { SSE_SPECIAL, SSE_SPECIAL }, /* pinsrw */ [0xc5] = { SSE_SPECIAL, SSE_SPECIAL }, /* pextrw */ [0xd0] = { NULL, gen_helper_addsubpd, NULL, gen_helper_addsubps }, - [0xd1] = MMX_OP2(psrlw), - [0xd2] = MMX_OP2(psrld), - [0xd3] = MMX_OP2(psrlq), [0xd5] = MMX_OP2(pmullw), [0xd6] = { NULL, SSE_SPECIAL, SSE_SPECIAL, SSE_SPECIAL }, [0xd7] = { SSE_SPECIAL, SSE_SPECIAL }, /* pmovmskb */ [0xe0] = MMX_OP2(pavgb), - [0xe1] = MMX_OP2(psraw), - [0xe2] = MMX_OP2(psrad), [0xe3] = MMX_OP2(pavgw), [0xe4] = MMX_OP2(pmulhuw), [0xe5] = MMX_OP2(pmulhw), [0xe6] = { NULL, gen_helper_cvttpd2dq, gen_helper_cvtdq2pd, gen_helper_cvtpd2dq }, [0xe7] = { SSE_SPECIAL , SSE_SPECIAL }, /* movntq, movntq */ [0xf0] = { NULL, NULL, NULL, SSE_SPECIAL }, /* lddqu */ - [0xf1] = MMX_OP2(psllw), - [0xf2] = MMX_OP2(pslld), - [0xf3] = MMX_OP2(psllq), [0xf4] = MMX_OP2(pmuludq), [0xf5] = MMX_OP2(pmaddwd), [0xf6] = MMX_OP2(psadbw), @@ -2826,19 +2818,6 @@ static const SSEFunc_0_epp sse_op_table1[256][4] = { (SSEFunc_0_epp)gen_helper_maskmov_xmm }, /* XXX: casts */ }; -static const SSEFunc_0_epp sse_op_table2[3 * 8][2] = { - [0 + 2] = MMX_OP2(psrlw), - [0 + 4] = MMX_OP2(psraw), - [0 + 6] = MMX_OP2(psllw), - [8 + 2] = MMX_OP2(psrld), - [8 + 4] = MMX_OP2(psrad), - [8 + 6] = MMX_OP2(pslld), - [16 + 2] = MMX_OP2(psrlq), - [16 + 3] = { NULL, gen_helper_psrldq_xmm }, - [16 + 6] = MMX_OP2(psllq), - [16 + 7] = { NULL, gen_helper_pslldq_xmm }, -}; - static const SSEFunc_0_epi sse_op_table3ai[] = { gen_helper_cvtsi2ss, gen_helper_cvtsi2sd @@ -3403,49 +3382,6 @@ static void gen_sse(CPUX86State *env, DisasContext *s, int b) goto illegal_op; } break; - case 0x71: /* shift mm, im */ - case 0x72: - case 0x73: - case 0x171: /* shift xmm, im */ - case 0x172: - case 0x173: - if (b1 >= 2) { - goto unknown_op; - } - val = x86_ldub_code(env, s); - if (is_xmm) { - tcg_gen_movi_tl(s->T0, val); - tcg_gen_st32_tl(s->T0, cpu_env, - offsetof(CPUX86State, xmm_t0.ZMM_L(0))); - tcg_gen_movi_tl(s->T0, 0); - tcg_gen_st32_tl(s->T0, cpu_env, - offsetof(CPUX86State, xmm_t0.ZMM_L(1))); - op1_offset = offsetof(CPUX86State,xmm_t0); - } else { - tcg_gen_movi_tl(s->T0, val); - tcg_gen_st32_tl(s->T0, cpu_env, - offsetof(CPUX86State, mmx_t0.MMX_L(0))); - tcg_gen_movi_tl(s->T0, 0); - tcg_gen_st32_tl(s->T0, cpu_env, - offsetof(CPUX86State, mmx_t0.MMX_L(1))); - op1_offset = offsetof(CPUX86State,mmx_t0); - } - sse_fn_epp = sse_op_table2[((b - 1) & 3) * 8 + - (((modrm >> 3)) & 7)][b1]; - if (!sse_fn_epp) { - goto unknown_op; - } - if (is_xmm) { - rm = (modrm & 7) | REX_B(s); - op2_offset = offsetof(CPUX86State,xmm_regs[rm]); - } else { - rm = (modrm & 7); - op2_offset = offsetof(CPUX86State,fpregs[rm].mmx); - } - tcg_gen_addi_ptr(s->ptr0, cpu_env, op2_offset); - tcg_gen_addi_ptr(s->ptr1, cpu_env, op1_offset); - sse_fn_epp(cpu_env, s->ptr0, s->ptr1); - break; case 0x050: /* movmskps */ rm = (modrm & 7) | REX_B(s); tcg_gen_addi_ptr(s->ptr0, cpu_env, @@ -6889,18 +6825,18 @@ DEF_GEN_INSN3_GVEC(xorpd, Vdq, Vdq, Wdq, xor, XMM_OPRSZ, XMM_MAXSZ, MO_64) DEF_GEN_INSN3_GVEC(vxorpd, Vdq, Hdq, Wdq, xor, XMM_OPRSZ, XMM_MAXSZ, MO_64) DEF_GEN_INSN3_GVEC(vxorpd, Vqq, Hqq, Wqq, xor, XMM_OPRSZ, XMM_MAXSZ, MO_64) -DEF_GEN_INSN3_HELPER_EPP(psllw, psllw_mmx, Pq, Pq, Qq) -DEF_GEN_INSN3_HELPER_EPP(psllw, psllw_xmm, Vdq, Vdq, Wdq) -DEF_GEN_INSN3_HELPER_EPP(vpsllw, psllw_xmm, Vdq, Hdq, Wdq) -DEF_GEN_INSN3_HELPER_EPP(vpsllw, psllw_xmm, Vqq, Hqq, Wdq) -DEF_GEN_INSN3_HELPER_EPP(pslld, pslld_mmx, Pq, Pq, Qq) -DEF_GEN_INSN3_HELPER_EPP(pslld, pslld_xmm, Vdq, Vdq, Wdq) -DEF_GEN_INSN3_HELPER_EPP(vpslld, pslld_xmm, Vdq, Hdq, Wdq) -DEF_GEN_INSN3_HELPER_EPP(vpslld, pslld_xmm, Vqq, Hqq, Wdq) -DEF_GEN_INSN3_HELPER_EPP(psllq, psllq_mmx, Pq, Pq, Qq) -DEF_GEN_INSN3_HELPER_EPP(psllq, psllq_xmm, Vdq, Vdq, Wdq) -DEF_GEN_INSN3_HELPER_EPP(vpsllq, psllq_xmm, Vdq, Hdq, Wdq) -DEF_GEN_INSN3_HELPER_EPP(vpsllq, psllq_xmm, Vqq, Hqq, Wdq) +DEF_GEN_INSN3_GVEC(psllw, Pq, Pq, Qq, 3_ool, MM_OPRSZ, MM_MAXSZ, psllw_mmx) +DEF_GEN_INSN3_GVEC(psllw, Vdq, Vdq, Wdq, 3_ool, XMM_OPRSZ, XMM_MAXSZ, psllw_xmm) +DEF_GEN_INSN3_GVEC(vpsllw, Vdq, Hdq, Wdq, 3_ool, XMM_OPRSZ, XMM_MAXSZ, psllw_xmm) +DEF_GEN_INSN3_GVEC(vpsllw, Vqq, Hqq, Wdq, 3_ool, XMM_OPRSZ, XMM_MAXSZ, psllw_xmm) +DEF_GEN_INSN3_GVEC(pslld, Pq, Pq, Qq, 3_ool, MM_OPRSZ, MM_MAXSZ, pslld_mmx) +DEF_GEN_INSN3_GVEC(pslld, Vdq, Vdq, Wdq, 3_ool, XMM_OPRSZ, XMM_MAXSZ, pslld_xmm) +DEF_GEN_INSN3_GVEC(vpslld, Vdq, Hdq, Wdq, 3_ool, XMM_OPRSZ, XMM_MAXSZ, pslld_xmm) +DEF_GEN_INSN3_GVEC(vpslld, Vqq, Hqq, Wdq, 3_ool, XMM_OPRSZ, XMM_MAXSZ, pslld_xmm) +DEF_GEN_INSN3_GVEC(psllq, Pq, Pq, Qq, 3_ool, MM_OPRSZ, MM_MAXSZ, psllq_mmx) +DEF_GEN_INSN3_GVEC(psllq, Vdq, Vdq, Wdq, 3_ool, XMM_OPRSZ, XMM_MAXSZ, psllq_xmm) +DEF_GEN_INSN3_GVEC(vpsllq, Vdq, Hdq, Wdq, 3_ool, XMM_OPRSZ, XMM_MAXSZ, psllq_xmm) +DEF_GEN_INSN3_GVEC(vpsllq, Vqq, Hqq, Wdq, 3_ool, XMM_OPRSZ, XMM_MAXSZ, psllq_xmm) GEN_INSN3(vpsllvd, Vdq, Hdq, Wdq) { @@ -6920,21 +6856,18 @@ GEN_INSN3(vpsllvq, Vqq, Hqq, Wqq) /* XXX TODO implement this */ } -DEF_GEN_INSN3_HELPER_EPP(pslldq, pslldq_xmm, Vdq, Vdq, Wdq) -DEF_GEN_INSN3_HELPER_EPP(vpslldq, pslldq_xmm, Vdq, Hdq, Wdq) -DEF_GEN_INSN3_HELPER_EPP(vpslldq, pslldq_xmm, Vqq, Hqq, Wdq) -DEF_GEN_INSN3_HELPER_EPP(psrlw, psrlw_mmx, Pq, Pq, Qq) -DEF_GEN_INSN3_HELPER_EPP(psrlw, psrlw_xmm, Vdq, Vdq, Wdq) -DEF_GEN_INSN3_HELPER_EPP(vpsrlw, psrlw_xmm, Vdq, Hdq, Wdq) -DEF_GEN_INSN3_HELPER_EPP(vpsrlw, psrlw_xmm, Vqq, Hqq, Wdq) -DEF_GEN_INSN3_HELPER_EPP(psrld, psrld_mmx, Pq, Pq, Qq) -DEF_GEN_INSN3_HELPER_EPP(psrld, psrld_xmm, Vdq, Vdq, Wdq) -DEF_GEN_INSN3_HELPER_EPP(vpsrld, psrld_xmm, Vdq, Hdq, Wdq) -DEF_GEN_INSN3_HELPER_EPP(vpsrld, psrld_xmm, Vqq, Hqq, Wdq) -DEF_GEN_INSN3_HELPER_EPP(psrlq, psrlq_mmx, Pq, Pq, Qq) -DEF_GEN_INSN3_HELPER_EPP(psrlq, psrlq_xmm, Vdq, Vdq, Wdq) -DEF_GEN_INSN3_HELPER_EPP(vpsrlq, psrlq_xmm, Vdq, Hdq, Wdq) -DEF_GEN_INSN3_HELPER_EPP(vpsrlq, psrlq_xmm, Vqq, Hqq, Wdq) +DEF_GEN_INSN3_GVEC(psrlw, Pq, Pq, Qq, 3_ool, MM_OPRSZ, MM_MAXSZ, psrlw_mmx) +DEF_GEN_INSN3_GVEC(psrlw, Vdq, Vdq, Wdq, 3_ool, XMM_OPRSZ, XMM_MAXSZ, psrlw_xmm) +DEF_GEN_INSN3_GVEC(vpsrlw, Vdq, Hdq, Wdq, 3_ool, XMM_OPRSZ, XMM_MAXSZ, psrlw_xmm) +DEF_GEN_INSN3_GVEC(vpsrlw, Vqq, Hqq, Wdq, 3_ool, XMM_OPRSZ, XMM_MAXSZ, psrlw_xmm) +DEF_GEN_INSN3_GVEC(psrld, Pq, Pq, Qq, 3_ool, MM_OPRSZ, MM_MAXSZ, psrld_mmx) +DEF_GEN_INSN3_GVEC(psrld, Vdq, Vdq, Wdq, 3_ool, XMM_OPRSZ, XMM_MAXSZ, psrld_xmm) +DEF_GEN_INSN3_GVEC(vpsrld, Vdq, Hdq, Wdq, 3_ool, XMM_OPRSZ, XMM_MAXSZ, psrld_xmm) +DEF_GEN_INSN3_GVEC(vpsrld, Vqq, Hqq, Wdq, 3_ool, XMM_OPRSZ, XMM_MAXSZ, psrld_xmm) +DEF_GEN_INSN3_GVEC(psrlq, Pq, Pq, Qq, 3_ool, MM_OPRSZ, MM_MAXSZ, psrlq_mmx) +DEF_GEN_INSN3_GVEC(psrlq, Vdq, Vdq, Wdq, 3_ool, XMM_OPRSZ, XMM_MAXSZ, psrlq_xmm) +DEF_GEN_INSN3_GVEC(vpsrlq, Vdq, Hdq, Wdq, 3_ool, XMM_OPRSZ, XMM_MAXSZ, psrlq_xmm) +DEF_GEN_INSN3_GVEC(vpsrlq, Vqq, Hqq, Wdq, 3_ool, XMM_OPRSZ, XMM_MAXSZ, psrlq_xmm) GEN_INSN3(vpsrlvd, Vdq, Hdq, Wdq) { @@ -6954,17 +6887,14 @@ GEN_INSN3(vpsrlvq, Vqq, Hqq, Wqq) /* XXX TODO implement this */ } -DEF_GEN_INSN3_HELPER_EPP(psrldq, psrldq_xmm, Vdq, Vdq, Wdq) -DEF_GEN_INSN3_HELPER_EPP(vpsrldq, psrldq_xmm, Vdq, Hdq, Wdq) -DEF_GEN_INSN3_HELPER_EPP(vpsrldq, psrldq_xmm, Vqq, Hqq, Wdq) -DEF_GEN_INSN3_HELPER_EPP(psraw, psraw_mmx, Pq, Pq, Qq) -DEF_GEN_INSN3_HELPER_EPP(psraw, psraw_xmm, Vdq, Vdq, Wdq) -DEF_GEN_INSN3_HELPER_EPP(vpsraw, psraw_xmm, Vdq, Hdq, Wdq) -DEF_GEN_INSN3_HELPER_EPP(vpsraw, psraw_xmm, Vqq, Hqq, Wdq) -DEF_GEN_INSN3_HELPER_EPP(psrad, psrad_mmx, Pq, Pq, Qq) -DEF_GEN_INSN3_HELPER_EPP(psrad, psrad_xmm, Vdq, Vdq, Wdq) -DEF_GEN_INSN3_HELPER_EPP(vpsrad, psrad_xmm, Vdq, Hdq, Wdq) -DEF_GEN_INSN3_HELPER_EPP(vpsrad, psrad_xmm, Vqq, Hqq, Wdq) +DEF_GEN_INSN3_GVEC(psraw, Pq, Pq, Qq, 3_ool, MM_OPRSZ, MM_MAXSZ, psraw_mmx) +DEF_GEN_INSN3_GVEC(psraw, Vdq, Vdq, Wdq, 3_ool, XMM_OPRSZ, XMM_MAXSZ, psraw_xmm) +DEF_GEN_INSN3_GVEC(vpsraw, Vdq, Hdq, Wdq, 3_ool, XMM_OPRSZ, XMM_MAXSZ, psraw_xmm) +DEF_GEN_INSN3_GVEC(vpsraw, Vqq, Hqq, Wdq, 3_ool, XMM_OPRSZ, XMM_MAXSZ, psraw_xmm) +DEF_GEN_INSN3_GVEC(psrad, Pq, Pq, Qq, 3_ool, MM_OPRSZ, MM_MAXSZ, psrad_mmx) +DEF_GEN_INSN3_GVEC(psrad, Vdq, Vdq, Wdq, 3_ool, XMM_OPRSZ, XMM_MAXSZ, psrad_xmm) +DEF_GEN_INSN3_GVEC(vpsrad, Vdq, Hdq, Wdq, 3_ool, XMM_OPRSZ, XMM_MAXSZ, psrad_xmm) +DEF_GEN_INSN3_GVEC(vpsrad, Vqq, Hqq, Wdq, 3_ool, XMM_OPRSZ, XMM_MAXSZ, psrad_xmm) GEN_INSN3(vpsravd, Vdq, Hdq, Wdq) { @@ -6975,93 +6905,44 @@ GEN_INSN3(vpsravd, Vqq, Hqq, Wqq) /* XXX TODO implement this */ } -#define DEF_GEN_PSHIFT_IMM_MM(mnem, opT1, opT2) \ - GEN_INSN3(mnem, opT1, opT2, Ib) \ - { \ - const uint64_t arg3_ui64 = (uint8_t)arg3; \ - const insnop_arg_t(Eq) arg3_r64 = s->tmp1_i64; \ - const insnop_arg_t(Qq) arg3_mm = \ - offsetof(CPUX86State, mmx_t0.MMX_Q(0)); \ - \ - tcg_gen_movi_i64(arg3_r64, arg3_ui64); \ - gen_insn2(movq, Pq, Eq)(env, s, arg3_mm, arg3_r64); \ - gen_insn3(mnem, Pq, Pq, Qq)(env, s, arg1, arg2, arg3_mm); \ - } -#define DEF_GEN_PSHIFT_IMM_XMM(mnem, opT1, opT2) \ - GEN_INSN3(mnem, opT1, opT2, Ib) \ - { \ - const uint64_t arg3_ui64 = (uint8_t)arg3; \ - const insnop_arg_t(Eq) arg3_r64 = s->tmp1_i64; \ - const insnop_arg_t(Wdq) arg3_xmm = \ - offsetof(CPUX86State, xmm_t0.ZMM_Q(0)); \ - \ - tcg_gen_movi_i64(arg3_r64, arg3_ui64); \ - gen_insn2(movq, Vdq, Eq)(env, s, arg3_xmm, arg3_r64); \ - gen_insn3(mnem, Vdq, Vdq, Wdq)(env, s, arg1, arg2, arg3_xmm); \ - } -#define DEF_GEN_VPSHIFT_IMM_XMM(mnem, opT1, opT2) \ - GEN_INSN3(mnem, opT1, opT2, Ib) \ - { \ - const uint64_t arg3_ui64 = (uint8_t)arg3; \ - const insnop_arg_t(Eq) arg3_r64 = s->tmp1_i64; \ - const insnop_arg_t(Wdq) arg3_xmm = \ - offsetof(CPUX86State, xmm_t0.ZMM_Q(0)); \ - \ - tcg_gen_movi_i64(arg3_r64, arg3_ui64); \ - gen_insn2(movq, Vdq, Eq)(env, s, arg3_xmm, arg3_r64); \ - gen_insn3(mnem, Vdq, Hdq, Wdq)(env, s, arg2, arg2, arg3_xmm); \ - } -#define DEF_GEN_VPSHIFT_IMM_YMM(mnem, opT1, opT2) \ - GEN_INSN3(mnem, opT1, opT2, Ib) \ - { \ - const uint64_t arg3_ui64 = (uint8_t)arg3; \ - const insnop_arg_t(Eq) arg3_r64 = s->tmp1_i64; \ - const insnop_arg_t(Wdq) arg3_xmm = \ - offsetof(CPUX86State, xmm_t0.ZMM_Q(0)); \ - \ - tcg_gen_movi_i64(arg3_r64, arg3_ui64); \ - gen_insn2(movq, Vdq, Eq)(env, s, arg3_xmm, arg3_r64); \ - gen_insn3(mnem, Vqq, Hqq, Wdq)(env, s, arg2, arg2, arg3_xmm); \ - } - -DEF_GEN_PSHIFT_IMM_MM(psllw, Nq, Nq) -DEF_GEN_PSHIFT_IMM_XMM(psllw, Udq, Udq) -DEF_GEN_VPSHIFT_IMM_XMM(vpsllw, Hdq, Udq) -DEF_GEN_VPSHIFT_IMM_YMM(vpsllw, Hqq, Uqq) -DEF_GEN_PSHIFT_IMM_MM(pslld, Nq, Nq) -DEF_GEN_PSHIFT_IMM_XMM(pslld, Udq, Udq) -DEF_GEN_VPSHIFT_IMM_XMM(vpslld, Hdq, Udq) -DEF_GEN_VPSHIFT_IMM_YMM(vpslld, Hqq, Uqq) -DEF_GEN_PSHIFT_IMM_MM(psllq, Nq, Nq) -DEF_GEN_PSHIFT_IMM_XMM(psllq, Udq, Udq) -DEF_GEN_VPSHIFT_IMM_XMM(vpsllq, Hdq, Udq) -DEF_GEN_VPSHIFT_IMM_YMM(vpsllq, Hqq, Uqq) -DEF_GEN_PSHIFT_IMM_XMM(pslldq, Udq, Udq) -DEF_GEN_VPSHIFT_IMM_XMM(vpslldq, Hdq, Udq) -DEF_GEN_VPSHIFT_IMM_YMM(vpslldq, Hqq, Uqq) -DEF_GEN_PSHIFT_IMM_MM(psrlw, Nq, Nq) -DEF_GEN_PSHIFT_IMM_XMM(psrlw, Udq, Udq) -DEF_GEN_VPSHIFT_IMM_XMM(vpsrlw, Hdq, Udq) -DEF_GEN_VPSHIFT_IMM_YMM(vpsrlw, Hqq, Uqq) -DEF_GEN_PSHIFT_IMM_MM(psrld, Nq, Nq) -DEF_GEN_PSHIFT_IMM_XMM(psrld, Udq, Udq) -DEF_GEN_VPSHIFT_IMM_XMM(vpsrld, Hdq, Udq) -DEF_GEN_VPSHIFT_IMM_YMM(vpsrld, Hqq, Uqq) -DEF_GEN_PSHIFT_IMM_MM(psrlq, Nq, Nq) -DEF_GEN_PSHIFT_IMM_XMM(psrlq, Udq, Udq) -DEF_GEN_VPSHIFT_IMM_XMM(vpsrlq, Hdq, Udq) -DEF_GEN_VPSHIFT_IMM_YMM(vpsrlq, Hqq, Uqq) -DEF_GEN_PSHIFT_IMM_XMM(psrldq, Udq, Udq) -DEF_GEN_VPSHIFT_IMM_XMM(vpsrldq, Hdq, Udq) -DEF_GEN_VPSHIFT_IMM_YMM(vpsrldq, Hqq, Uqq) -DEF_GEN_PSHIFT_IMM_MM(psraw, Nq, Nq) -DEF_GEN_PSHIFT_IMM_XMM(psraw, Udq, Udq) -DEF_GEN_VPSHIFT_IMM_XMM(vpsraw, Hdq, Udq) -DEF_GEN_VPSHIFT_IMM_XMM(vpsraw, Hqq, Uqq) -DEF_GEN_PSHIFT_IMM_MM(psrad, Nq, Nq) -DEF_GEN_PSHIFT_IMM_XMM(psrad, Udq, Udq) -DEF_GEN_VPSHIFT_IMM_XMM(vpsrad, Hdq, Udq) -DEF_GEN_VPSHIFT_IMM_XMM(vpsrad, Hqq, Uqq) +DEF_GEN_INSN3_GVEC(psllw, Nq, Nq, Ib, 2i_ool, MM_OPRSZ, MM_MAXSZ, psllwi_xmm) +DEF_GEN_INSN3_GVEC(psllw, Udq, Udq, Ib, 2i_ool, XMM_OPRSZ, XMM_MAXSZ, psllwi_xmm) +DEF_GEN_INSN3_GVEC(vpsllw, Hdq, Udq, Ib, 2i_ool, XMM_OPRSZ, XMM_MAXSZ, psllwi_xmm) +DEF_GEN_INSN3_GVEC(vpsllw, Hqq, Uqq, Ib, 2i_ool, XMM_OPRSZ, XMM_MAXSZ, psllwi_xmm) +DEF_GEN_INSN3_GVEC(pslld, Nq, Nq, Ib, 2i_ool, MM_OPRSZ, MM_MAXSZ, pslldi_xmm) +DEF_GEN_INSN3_GVEC(pslld, Udq, Udq, Ib, 2i_ool, XMM_OPRSZ, XMM_MAXSZ, pslldi_xmm) +DEF_GEN_INSN3_GVEC(vpslld, Hdq, Udq, Ib, 2i_ool, XMM_OPRSZ, XMM_MAXSZ, pslldi_xmm) +DEF_GEN_INSN3_GVEC(vpslld, Hqq, Uqq, Ib, 2i_ool, XMM_OPRSZ, XMM_MAXSZ, pslldi_xmm) +DEF_GEN_INSN3_GVEC(psllq, Nq, Nq, Ib, 2i_ool, MM_OPRSZ, MM_MAXSZ, psllqi_xmm) +DEF_GEN_INSN3_GVEC(psllq, Udq, Udq, Ib, 2i_ool, XMM_OPRSZ, XMM_MAXSZ, psllqi_xmm) +DEF_GEN_INSN3_GVEC(vpsllq, Hdq, Udq, Ib, 2i_ool, XMM_OPRSZ, XMM_MAXSZ, psllqi_xmm) +DEF_GEN_INSN3_GVEC(vpsllq, Hqq, Uqq, Ib, 2i_ool, XMM_OPRSZ, XMM_MAXSZ, psllqi_xmm) +DEF_GEN_INSN3_GVEC(pslldq, Udq, Udq, Ib, 2i_ool, XMM_OPRSZ, XMM_MAXSZ, pslldqi_xmm) +DEF_GEN_INSN3_GVEC(vpslldq, Hdq, Udq, Ib, 2i_ool, XMM_OPRSZ, XMM_MAXSZ, pslldqi_xmm) +DEF_GEN_INSN3_GVEC(vpslldq, Hqq, Uqq, Ib, 2i_ool, XMM_OPRSZ, XMM_MAXSZ, pslldqi_xmm) +DEF_GEN_INSN3_GVEC(psrlw, Nq, Nq, Ib, 2i_ool, MM_OPRSZ, MM_MAXSZ, psrlwi_xmm) +DEF_GEN_INSN3_GVEC(psrlw, Udq, Udq, Ib, 2i_ool, XMM_OPRSZ, XMM_MAXSZ, psrlwi_xmm) +DEF_GEN_INSN3_GVEC(vpsrlw, Hdq, Udq, Ib, 2i_ool, XMM_OPRSZ, XMM_MAXSZ, psrlwi_xmm) +DEF_GEN_INSN3_GVEC(vpsrlw, Hqq, Uqq, Ib, 2i_ool, XMM_OPRSZ, XMM_MAXSZ, psrlwi_xmm) +DEF_GEN_INSN3_GVEC(psrld, Nq, Nq, Ib, 2i_ool, MM_OPRSZ, MM_MAXSZ, psrldi_xmm) +DEF_GEN_INSN3_GVEC(psrld, Udq, Udq, Ib, 2i_ool, XMM_OPRSZ, XMM_MAXSZ, psrldi_xmm) +DEF_GEN_INSN3_GVEC(vpsrld, Hdq, Udq, Ib, 2i_ool, XMM_OPRSZ, XMM_MAXSZ, psrldi_xmm) +DEF_GEN_INSN3_GVEC(vpsrld, Hqq, Uqq, Ib, 2i_ool, XMM_OPRSZ, XMM_MAXSZ, psrldi_xmm) +DEF_GEN_INSN3_GVEC(psrlq, Nq, Nq, Ib, 2i_ool, MM_OPRSZ, MM_MAXSZ, psrlqi_xmm) +DEF_GEN_INSN3_GVEC(psrlq, Udq, Udq, Ib, 2i_ool, XMM_OPRSZ, XMM_MAXSZ, psrlqi_xmm) +DEF_GEN_INSN3_GVEC(vpsrlq, Hdq, Udq, Ib, 2i_ool, XMM_OPRSZ, XMM_MAXSZ, psrlqi_xmm) +DEF_GEN_INSN3_GVEC(vpsrlq, Hqq, Uqq, Ib, 2i_ool, XMM_OPRSZ, XMM_MAXSZ, psrlqi_xmm) +DEF_GEN_INSN3_GVEC(psrldq, Udq, Udq, Ib, 2i_ool, XMM_OPRSZ, XMM_MAXSZ, psrldqi_xmm) +DEF_GEN_INSN3_GVEC(vpsrldq, Hdq, Udq, Ib, 2i_ool, XMM_OPRSZ, XMM_MAXSZ, psrldqi_xmm) +DEF_GEN_INSN3_GVEC(vpsrldq, Hqq, Uqq, Ib, 2i_ool, XMM_OPRSZ, XMM_MAXSZ, psrldqi_xmm) +DEF_GEN_INSN3_GVEC(psraw, Nq, Nq, Ib, 2i_ool, MM_OPRSZ, MM_MAXSZ, psrawi_xmm) +DEF_GEN_INSN3_GVEC(psraw, Udq, Udq, Ib, 2i_ool, XMM_OPRSZ, XMM_MAXSZ, psrawi_xmm) +DEF_GEN_INSN3_GVEC(vpsraw, Hdq, Udq, Ib, 2i_ool, XMM_OPRSZ, XMM_MAXSZ, psrawi_xmm) +DEF_GEN_INSN3_GVEC(vpsraw, Hqq, Uqq, Ib, 2i_ool, XMM_OPRSZ, XMM_MAXSZ, psrawi_xmm) +DEF_GEN_INSN3_GVEC(psrad, Nq, Nq, Ib, 2i_ool, MM_OPRSZ, MM_MAXSZ, psradi_xmm) +DEF_GEN_INSN3_GVEC(psrad, Udq, Udq, Ib, 2i_ool, XMM_OPRSZ, XMM_MAXSZ, psradi_xmm) +DEF_GEN_INSN3_GVEC(vpsrad, Hdq, Udq, Ib, 2i_ool, XMM_OPRSZ, XMM_MAXSZ, psradi_xmm) +DEF_GEN_INSN3_GVEC(vpsrad, Hqq, Uqq, Ib, 2i_ool, XMM_OPRSZ, XMM_MAXSZ, psradi_xmm) DEF_GEN_INSN4_HELPER_EPPI(palignr, palignr_mmx, Pq, Pq, Qq, Ib) DEF_GEN_INSN4_HELPER_EPPI(palignr, palignr_xmm, Vdq, Vdq, Wdq, Ib) From patchwork Wed Aug 21 17:29:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Bobek X-Patchwork-Id: 11107891 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E62201864 for ; Wed, 21 Aug 2019 18:31:57 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BDE3D216F4 for ; Wed, 21 Aug 2019 18:31:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="qfOlwbAN" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BDE3D216F4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:51760 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0VOm-0003H9-FQ for patchwork-qemu-devel@patchwork.kernel.org; Wed, 21 Aug 2019 14:31:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41535) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0URx-0001rB-Nx for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:31:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i0URv-00007N-Iz for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:31:09 -0400 Received: from mail-yw1-xc2c.google.com ([2607:f8b0:4864:20::c2c]:45486) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i0URv-00006r-CX for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:31:07 -0400 Received: by mail-yw1-xc2c.google.com with SMTP id n69so1222877ywd.12 for ; Wed, 21 Aug 2019 10:31:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=6zlv0Nn+Ag8qhtIVP8TUS2cQxcEx2U/vv+75yRgZWxs=; b=qfOlwbAN2bqlZMVMeN1i6OXfb5+fpo6vIjJyNwJxijHO+j0aWRUhtaHHD962lMn42A MnRvF93ieYqrK0KCmr9X9T2z6wFu1OHRFEm396XAVheCFgihm6Fou+pBCpxkC3uQdXga K1GrTPK+JFDmUn5PL2GgFKUBDCj3+YJ8y+NyYIt6aa+foA6/abzgNNuxYXooe2ubryvA /xrmpghehoF9yoDYIHDOo3RyNzXhqJ91nhVfkdEsNsfTEO6ctsfaLzLkiq138Hh3T2lY uo5QA94TqjGIrtjM2YP7bQP0SM2rahJFqRSkZKso8iVecPhTi/ipcInIRhZ7XIyHEbtj DG6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=6zlv0Nn+Ag8qhtIVP8TUS2cQxcEx2U/vv+75yRgZWxs=; b=iPTYKf0ycW/tSJh6ufTu7OLX0kWCdSqPhQLhUdDtVpxoQ/N/pIoziLQCObm/O6ac4h rSYD/H2QM81m/GKoAZNQlw7X7Q7L5YnZTku/5QsK0B9M6bLBzwQVX1Gf9Xo9q8tdA+X2 6n1MZ3hA15suu3WdfoN9Hzj8lIf7jmEfFTiWEM12jb9HZYfdPwstFec9+krdaa0tILZI euV4//6OYvFvvdjzXdbIEviZ8xOddgt0FTELwgLLP78qdKqPCtb14GrWxj+X4BKYSO0w QH/rM0JbEJP5FAS3x77kQpqFuSTvqzMyl0W5uPBEpFoO+F3AsrOXeMSW4IRR6epclwxE USfQ== X-Gm-Message-State: APjAAAVjj18MBmMkcMJIQuIqgfmDeFnspT9l/Hw5as5QcJ0TsplIoSna VanKu67NqElJPNqhL7X5PS3/NMNn X-Google-Smtp-Source: APXvYqzyvq4bCBXe1ZJNk6jq4uEFEPGFynARs2y2g+teRJ0d37OsisacC1mXqDDKWJl5olsDyRMLjA== X-Received: by 2002:a81:30d7:: with SMTP id w206mr23732266yww.498.1566408666553; Wed, 21 Aug 2019 10:31:06 -0700 (PDT) Received: from localhost.localdomain ([2601:c0:c67f:e390::3]) by smtp.gmail.com with ESMTPSA id l71sm2826167ywl.39.2019.08.21.10.31.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Aug 2019 10:31:05 -0700 (PDT) From: Jan Bobek To: qemu-devel@nongnu.org Date: Wed, 21 Aug 2019 13:29:45 -0400 Message-Id: <20190821172951.15333-70-jan.bobek@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190821172951.15333-1-jan.bobek@gmail.com> References: <20190821172951.15333-1-jan.bobek@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::c2c Subject: [Qemu-devel] [RFC PATCH v4 69/75] target/i386: convert pmullw/pmulhw/pmulhuw helpers to gvec style X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jan Bobek , =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Make these helpers suitable for use with tcg_gen_gvec_* functions. Signed-off-by: Jan Bobek --- target/i386/ops_sse.h | 42 ++++++++++++++++++++++++++++++------ target/i386/ops_sse_header.h | 6 +++--- target/i386/translate.c | 27 +++++++++++------------ 3 files changed, 51 insertions(+), 24 deletions(-) diff --git a/target/i386/ops_sse.h b/target/i386/ops_sse.h index 168e581c0c..6ec116573b 100644 --- a/target/i386/ops_sse.h +++ b/target/i386/ops_sse.h @@ -412,20 +412,50 @@ static inline int satsw(int x) } } -#define FMULLW(a, b) ((a) * (b)) #define FMULHRW(a, b) (((int16_t)(a) * (int16_t)(b) + 0x8000) >> 16) -#define FMULHUW(a, b) ((a) * (b) >> 16) -#define FMULHW(a, b) ((int16_t)(a) * (int16_t)(b) >> 16) #define FAVG(a, b) (((a) + (b) + 1) >> 1) #endif -SSE_HELPER_W(helper_pmullw, FMULLW) +void glue(helper_pmullw, SUFFIX)(Reg *d, Reg *a, Reg *b, uint32_t desc) +{ + const intptr_t oprsz = simd_oprsz(desc); + const intptr_t maxsz = simd_maxsz(desc); + + for (intptr_t i = 0; i * sizeof(uint16_t) < oprsz; ++i) { + const uint32_t t = (uint32_t)a->W(i) * (uint32_t)b->W(i); + d->W(i) = t; + } + glue(clear_high, SUFFIX)(d, oprsz, maxsz); +} + #if SHIFT == 0 SSE_HELPER_W(helper_pmulhrw, FMULHRW) #endif -SSE_HELPER_W(helper_pmulhuw, FMULHUW) -SSE_HELPER_W(helper_pmulhw, FMULHW) + +void glue(helper_pmulhuw, SUFFIX)(Reg *d, Reg *a, Reg *b, uint32_t desc) +{ + const intptr_t oprsz = simd_oprsz(desc); + const intptr_t maxsz = simd_maxsz(desc); + + for (intptr_t i = 0; i * sizeof(uint16_t) < oprsz; ++i) { + const uint32_t t = (uint32_t)a->W(i) * (uint32_t)b->W(i); + d->W(i) = t >> 16; + } + glue(clear_high, SUFFIX)(d, oprsz, maxsz); +} + +void glue(helper_pmulhw, SUFFIX)(Reg *d, Reg *a, Reg *b, uint32_t desc) +{ + const intptr_t oprsz = simd_oprsz(desc); + const intptr_t maxsz = simd_maxsz(desc); + + for (intptr_t i = 0; i * sizeof(uint16_t) < oprsz; ++i) { + const int32_t t = (int32_t)a->W(i) * (int32_t)b->W(i); + d->W(i) = t >> 16; + } + glue(clear_high, SUFFIX)(d, oprsz, maxsz); +} SSE_HELPER_B(helper_pavgb, FAVG) SSE_HELPER_W(helper_pavgw, FAVG) diff --git a/target/i386/ops_sse_header.h b/target/i386/ops_sse_header.h index 724692a689..7e6411fc82 100644 --- a/target/i386/ops_sse_header.h +++ b/target/i386/ops_sse_header.h @@ -58,12 +58,12 @@ DEF_HELPER_3(glue(pslldqi, SUFFIX), void, Reg, Reg, i32) DEF_HELPER_3(glue(psrldqi, SUFFIX), void, Reg, Reg, i32) #endif -DEF_HELPER_3(glue(pmullw, SUFFIX), void, env, Reg, Reg) +DEF_HELPER_4(glue(pmullw, SUFFIX), void, Reg, Reg, Reg, i32) #if SHIFT == 0 DEF_HELPER_3(glue(pmulhrw, SUFFIX), void, env, Reg, Reg) #endif -DEF_HELPER_3(glue(pmulhuw, SUFFIX), void, env, Reg, Reg) -DEF_HELPER_3(glue(pmulhw, SUFFIX), void, env, Reg, Reg) +DEF_HELPER_4(glue(pmulhuw, SUFFIX), void, Reg, Reg, Reg, i32) +DEF_HELPER_4(glue(pmulhw, SUFFIX), void, Reg, Reg, Reg, i32) DEF_HELPER_3(glue(pavgb, SUFFIX), void, env, Reg, Reg) DEF_HELPER_3(glue(pavgw, SUFFIX), void, env, Reg, Reg) diff --git a/target/i386/translate.c b/target/i386/translate.c index 03f7c6e450..79f8c1ddac 100644 --- a/target/i386/translate.c +++ b/target/i386/translate.c @@ -2801,13 +2801,10 @@ static const SSEFunc_0_epp sse_op_table1[256][4] = { [0xc4] = { SSE_SPECIAL, SSE_SPECIAL }, /* pinsrw */ [0xc5] = { SSE_SPECIAL, SSE_SPECIAL }, /* pextrw */ [0xd0] = { NULL, gen_helper_addsubpd, NULL, gen_helper_addsubps }, - [0xd5] = MMX_OP2(pmullw), [0xd6] = { NULL, SSE_SPECIAL, SSE_SPECIAL, SSE_SPECIAL }, [0xd7] = { SSE_SPECIAL, SSE_SPECIAL }, /* pmovmskb */ [0xe0] = MMX_OP2(pavgb), [0xe3] = MMX_OP2(pavgw), - [0xe4] = MMX_OP2(pmulhuw), - [0xe5] = MMX_OP2(pmulhw), [0xe6] = { NULL, gen_helper_cvttpd2dq, gen_helper_cvtdq2pd, gen_helper_cvtpd2dq }, [0xe7] = { SSE_SPECIAL , SSE_SPECIAL }, /* movntq, movntq */ [0xf0] = { NULL, NULL, NULL, SSE_SPECIAL }, /* lddqu */ @@ -6116,21 +6113,21 @@ DEF_GEN_INSN3_HELPER_EPP(addsubpd, addsubpd, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(vaddsubpd, addsubpd, Vdq, Hdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(vaddsubpd, addsubpd, Vqq, Hqq, Wqq) -DEF_GEN_INSN3_HELPER_EPP(pmullw, pmullw_mmx, Pq, Pq, Qq) -DEF_GEN_INSN3_HELPER_EPP(pmullw, pmullw_xmm, Vdq, Vdq, Wdq) -DEF_GEN_INSN3_HELPER_EPP(vpmullw, pmullw_xmm, Vdq, Hdq, Wdq) -DEF_GEN_INSN3_HELPER_EPP(vpmullw, pmullw_xmm, Vqq, Hqq, Wqq) +DEF_GEN_INSN3_GVEC(pmullw, Pq, Pq, Qq, 3_ool, MM_OPRSZ, MM_MAXSZ, pmullw_mmx) +DEF_GEN_INSN3_GVEC(pmullw, Vdq, Vdq, Wdq, 3_ool, XMM_OPRSZ, XMM_MAXSZ, pmullw_xmm) +DEF_GEN_INSN3_GVEC(vpmullw, Vdq, Hdq, Wdq, 3_ool, XMM_OPRSZ, XMM_MAXSZ, pmullw_xmm) +DEF_GEN_INSN3_GVEC(vpmullw, Vqq, Hqq, Wqq, 3_ool, XMM_OPRSZ, XMM_MAXSZ, pmullw_xmm) DEF_GEN_INSN3_HELPER_EPP(pmulld, pmulld_xmm, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(vpmulld, pmulld_xmm, Vdq, Hdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(vpmulld, pmulld_xmm, Vqq, Hqq, Wqq) -DEF_GEN_INSN3_HELPER_EPP(pmulhw, pmulhw_mmx, Pq, Pq, Qq) -DEF_GEN_INSN3_HELPER_EPP(pmulhw, pmulhw_xmm, Vdq, Vdq, Wdq) -DEF_GEN_INSN3_HELPER_EPP(vpmulhw, pmulhw_xmm, Vdq, Hdq, Wdq) -DEF_GEN_INSN3_HELPER_EPP(vpmulhw, pmulhw_xmm, Vqq, Hqq, Wqq) -DEF_GEN_INSN3_HELPER_EPP(pmulhuw, pmulhuw_mmx, Pq, Pq, Qq) -DEF_GEN_INSN3_HELPER_EPP(pmulhuw, pmulhuw_xmm, Vdq, Vdq, Wdq) -DEF_GEN_INSN3_HELPER_EPP(vpmulhuw, pmulhuw_xmm, Vdq, Hdq, Wdq) -DEF_GEN_INSN3_HELPER_EPP(vpmulhuw, pmulhuw_xmm, Vqq, Hqq, Wqq) +DEF_GEN_INSN3_GVEC(pmulhw, Pq, Pq, Qq, 3_ool, MM_OPRSZ, MM_MAXSZ, pmulhw_mmx) +DEF_GEN_INSN3_GVEC(pmulhw, Vdq, Vdq, Wdq, 3_ool, XMM_OPRSZ, XMM_MAXSZ, pmulhw_xmm) +DEF_GEN_INSN3_GVEC(vpmulhw, Vdq, Hdq, Wdq, 3_ool, XMM_OPRSZ, XMM_MAXSZ, pmulhw_xmm) +DEF_GEN_INSN3_GVEC(vpmulhw, Vqq, Hqq, Wqq, 3_ool, XMM_OPRSZ, XMM_MAXSZ, pmulhw_xmm) +DEF_GEN_INSN3_GVEC(pmulhuw, Pq, Pq, Qq, 3_ool, MM_OPRSZ, MM_MAXSZ, pmulhuw_mmx) +DEF_GEN_INSN3_GVEC(pmulhuw, Vdq, Vdq, Wdq, 3_ool, XMM_OPRSZ, XMM_MAXSZ, pmulhuw_xmm) +DEF_GEN_INSN3_GVEC(vpmulhuw, Vdq, Hdq, Wdq, 3_ool, XMM_OPRSZ, XMM_MAXSZ, pmulhuw_xmm) +DEF_GEN_INSN3_GVEC(vpmulhuw, Vqq, Hqq, Wqq, 3_ool, XMM_OPRSZ, XMM_MAXSZ, pmulhuw_xmm) DEF_GEN_INSN3_HELPER_EPP(pmuldq, pmuldq_xmm, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(vpmuldq, pmuldq_xmm, Vdq, Hdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(vpmuldq, pmuldq_xmm, Vqq, Hqq, Wqq) From patchwork Wed Aug 21 17:29:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Bobek X-Patchwork-Id: 11107899 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 87C3F1813 for ; Wed, 21 Aug 2019 18:32:11 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5FC0A22DD3 for ; Wed, 21 Aug 2019 18:32:11 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="mQHIe3qt" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5FC0A22DD3 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:51764 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0VOz-0003a3-UB for patchwork-qemu-devel@patchwork.kernel.org; Wed, 21 Aug 2019 14:32:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41538) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0URy-0001rk-5g for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:31:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i0URw-00007v-B7 for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:31:10 -0400 Received: from mail-yb1-xb44.google.com ([2607:f8b0:4864:20::b44]:38910) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i0URw-00007d-5p for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:31:08 -0400 Received: by mail-yb1-xb44.google.com with SMTP id j199so1343304ybg.5 for ; Wed, 21 Aug 2019 10:31:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=GgH8nUWn4/ATpKN8BOE+DhOwRl+PR6wW9XuCGiyh5qE=; b=mQHIe3qtxEWa21brJCcaMKDwmSPmPePpbQSmmhW2W8wWDawzaUlPJd91hikgv8zFDi i330gNocWm8iPbz0/7QrgZNPV5VVSl3kIOkSlBc9o33H9lRBL58LxVnTJYLer0XlLFm4 LFTTnGMG/s78ifS5Yx9hhbUd++SPDO5xC6Q5jQ20NN+O9iG2mKqsWjrm5PmY9NIDd+qd b9mlhhjCamqJ+2WmKRpeBMrd5IorHYIFLW+QOX7Pc2nIhrNwS9u7XvMbFnDrgcFgoQ+b 3bxRF1aQqqjnIuq1tjFO/SKRxEI0yCRT/L1WXkCzbdao+dNFxUh+GQx3wZEsRBrPIznA wb8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=GgH8nUWn4/ATpKN8BOE+DhOwRl+PR6wW9XuCGiyh5qE=; b=iJ60C1TxvDJumVOLQoA5oAJpNJj7LyifoCLGIcKkKWD4QIsfzXxtyaN6b7XadDdBfw S8a3qT6akyvCFBXg01fPjjEi5d+WN4LWdcHL71VpvYEoMgaXJM3YZ/NxQxD3FJG19h1S enjhpCJH3y1OmhGOOPTB+/WdQ6s+TmLCP4GVSUECL1GKdIGr7SAoCmuSU1VPZmE46vOS VBDyF+IK6peff+PSKwgrdZgMwR0ZEAmY0EuAsVoQh0A2nfabC+uiIbEckX0vGmvbCNsU RIhW07pXavDUYVgYxMbhORQ1SAVMWtm683+ijvhEkntS7bwhxm/FZAXM/we9GfHy4O50 KDZg== X-Gm-Message-State: APjAAAXpEzsRYq0mluG1lFoAUlqkJlRy4xMYl69+mw81hDxImb+5zod0 jkl2fEZJejM15vSLz0rzfozzbG7S X-Google-Smtp-Source: APXvYqwegk5Zd8ecA7WwxS++iPkZ4TNjbtvcQbzL6GGQ+dTjjxv3y0rMePl8jjn1KrPZUyhvvNSPMg== X-Received: by 2002:a25:90f:: with SMTP id 15mr1280286ybj.344.1566408667449; Wed, 21 Aug 2019 10:31:07 -0700 (PDT) Received: from localhost.localdomain ([2601:c0:c67f:e390::3]) by smtp.gmail.com with ESMTPSA id l71sm2826167ywl.39.2019.08.21.10.31.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Aug 2019 10:31:06 -0700 (PDT) From: Jan Bobek To: qemu-devel@nongnu.org Date: Wed, 21 Aug 2019 13:29:46 -0400 Message-Id: <20190821172951.15333-71-jan.bobek@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190821172951.15333-1-jan.bobek@gmail.com> References: <20190821172951.15333-1-jan.bobek@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::b44 Subject: [Qemu-devel] [RFC PATCH v4 70/75] target/i386: convert pavgb/pavgw helpers to gvec style X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jan Bobek , =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Make these helpers suitable for use with tcg_gen_gvec_* functions. Signed-off-by: Jan Bobek --- target/i386/ops_sse.h | 33 +++++++++++++++++++++++++++++---- target/i386/ops_sse_header.h | 7 +++++-- target/i386/translate.c | 20 +++++++++----------- 3 files changed, 43 insertions(+), 17 deletions(-) diff --git a/target/i386/ops_sse.h b/target/i386/ops_sse.h index 6ec116573b..1661bd7c64 100644 --- a/target/i386/ops_sse.h +++ b/target/i386/ops_sse.h @@ -413,8 +413,6 @@ static inline int satsw(int x) } #define FMULHRW(a, b) (((int16_t)(a) * (int16_t)(b) + 0x8000) >> 16) - -#define FAVG(a, b) (((a) + (b) + 1) >> 1) #endif void glue(helper_pmullw, SUFFIX)(Reg *d, Reg *a, Reg *b, uint32_t desc) @@ -457,8 +455,35 @@ void glue(helper_pmulhw, SUFFIX)(Reg *d, Reg *a, Reg *b, uint32_t desc) glue(clear_high, SUFFIX)(d, oprsz, maxsz); } -SSE_HELPER_B(helper_pavgb, FAVG) -SSE_HELPER_W(helper_pavgw, FAVG) +void glue(helper_pavgb, SUFFIX)(Reg *d, Reg *a, Reg *b, uint32_t desc) +{ + const intptr_t oprsz = simd_oprsz(desc); + const intptr_t maxsz = simd_maxsz(desc); + + for (intptr_t i = 0; i * sizeof(uint8_t) < oprsz; ++i) { + d->B(i) = (a->B(i) + b->B(i) + 1) >> 1; + } + glue(clear_high, SUFFIX)(d, oprsz, maxsz); +} + +#if SHIFT == 0 +void glue(helper_pavgusb, SUFFIX)(CPUX86State *env, Reg *d, Reg *s) +{ + const uint32_t desc = simd_desc(sizeof(Reg), sizeof(Reg), 0); + glue(helper_pavgb, SUFFIX)(d, s, s, desc); +} +#endif + +void glue(helper_pavgw, SUFFIX)(Reg *d, Reg *a, Reg *b, uint32_t desc) +{ + const intptr_t oprsz = simd_oprsz(desc); + const intptr_t maxsz = simd_maxsz(desc); + + for (intptr_t i = 0; i * sizeof(uint16_t) < oprsz; ++i) { + d->W(i) = (a->W(i) + b->W(i) + 1) >> 1; + } + glue(clear_high, SUFFIX)(d, oprsz, maxsz); +} void glue(helper_pmuludq, SUFFIX)(CPUX86State *env, Reg *d, Reg *s) { diff --git a/target/i386/ops_sse_header.h b/target/i386/ops_sse_header.h index 7e6411fc82..b5e8aae897 100644 --- a/target/i386/ops_sse_header.h +++ b/target/i386/ops_sse_header.h @@ -65,8 +65,11 @@ DEF_HELPER_3(glue(pmulhrw, SUFFIX), void, env, Reg, Reg) DEF_HELPER_4(glue(pmulhuw, SUFFIX), void, Reg, Reg, Reg, i32) DEF_HELPER_4(glue(pmulhw, SUFFIX), void, Reg, Reg, Reg, i32) -DEF_HELPER_3(glue(pavgb, SUFFIX), void, env, Reg, Reg) -DEF_HELPER_3(glue(pavgw, SUFFIX), void, env, Reg, Reg) +DEF_HELPER_4(glue(pavgb, SUFFIX), void, Reg, Reg, Reg, i32) +#if SHIFT == 0 +DEF_HELPER_3(glue(pavgusb, SUFFIX), void, env, Reg, Reg) +#endif +DEF_HELPER_4(glue(pavgw, SUFFIX), void, Reg, Reg, Reg, i32) DEF_HELPER_3(glue(pmuludq, SUFFIX), void, env, Reg, Reg) DEF_HELPER_3(glue(pmaddwd, SUFFIX), void, env, Reg, Reg) diff --git a/target/i386/translate.c b/target/i386/translate.c index 79f8c1ddac..77b2e18f34 100644 --- a/target/i386/translate.c +++ b/target/i386/translate.c @@ -2803,8 +2803,6 @@ static const SSEFunc_0_epp sse_op_table1[256][4] = { [0xd0] = { NULL, gen_helper_addsubpd, NULL, gen_helper_addsubps }, [0xd6] = { NULL, SSE_SPECIAL, SSE_SPECIAL, SSE_SPECIAL }, [0xd7] = { SSE_SPECIAL, SSE_SPECIAL }, /* pmovmskb */ - [0xe0] = MMX_OP2(pavgb), - [0xe3] = MMX_OP2(pavgw), [0xe6] = { NULL, gen_helper_cvttpd2dq, gen_helper_cvtdq2pd, gen_helper_cvtpd2dq }, [0xe7] = { SSE_SPECIAL , SSE_SPECIAL }, /* movntq, movntq */ [0xf0] = { NULL, NULL, NULL, SSE_SPECIAL }, /* lddqu */ @@ -2878,7 +2876,7 @@ static const SSEFunc_0_epp sse_op_table5[256] = { [0xb6] = gen_helper_movq, /* pfrcpit2 */ [0xb7] = gen_helper_pmulhrw_mmx, [0xbb] = gen_helper_pswapd, - [0xbf] = gen_helper_pavgb_mmx /* pavgusb */ + [0xbf] = gen_helper_pavgusb_mmx }; struct SSEOpHelper_epp { @@ -6252,14 +6250,14 @@ DEF_GEN_INSN3_HELPER_EPP(maxss, maxss, Vd, Vd, Wd) DEF_GEN_INSN3_HELPER_EPP(vmaxss, maxss, Vd, Hd, Wd) DEF_GEN_INSN3_HELPER_EPP(maxsd, maxsd, Vq, Vq, Wq) DEF_GEN_INSN3_HELPER_EPP(vmaxsd, maxsd, Vq, Hq, Wq) -DEF_GEN_INSN3_HELPER_EPP(pavgb, pavgb_mmx, Pq, Pq, Qq) -DEF_GEN_INSN3_HELPER_EPP(pavgb, pavgb_xmm, Vdq, Vdq, Wdq) -DEF_GEN_INSN3_HELPER_EPP(vpavgb, pavgb_xmm, Vdq, Hdq, Wdq) -DEF_GEN_INSN3_HELPER_EPP(vpavgb, pavgb_xmm, Vqq, Hqq, Wqq) -DEF_GEN_INSN3_HELPER_EPP(pavgw, pavgw_mmx, Pq, Pq, Qq) -DEF_GEN_INSN3_HELPER_EPP(pavgw, pavgw_xmm, Vdq, Vdq, Wdq) -DEF_GEN_INSN3_HELPER_EPP(vpavgw, pavgw_xmm, Vdq, Hdq, Wdq) -DEF_GEN_INSN3_HELPER_EPP(vpavgw, pavgw_xmm, Vqq, Hqq, Wqq) +DEF_GEN_INSN3_GVEC(pavgb, Pq, Pq, Qq, 3_ool, MM_OPRSZ, MM_MAXSZ, pavgb_mmx) +DEF_GEN_INSN3_GVEC(pavgb, Vdq, Vdq, Wdq, 3_ool, XMM_OPRSZ, XMM_MAXSZ, pavgb_xmm) +DEF_GEN_INSN3_GVEC(vpavgb, Vdq, Hdq, Wdq, 3_ool, XMM_OPRSZ, XMM_MAXSZ, pavgb_xmm) +DEF_GEN_INSN3_GVEC(vpavgb, Vqq, Hqq, Wqq, 3_ool, XMM_OPRSZ, XMM_MAXSZ, pavgb_xmm) +DEF_GEN_INSN3_GVEC(pavgw, Pq, Pq, Qq, 3_ool, MM_OPRSZ, MM_MAXSZ, pavgw_mmx) +DEF_GEN_INSN3_GVEC(pavgw, Vdq, Vdq, Wdq, 3_ool, XMM_OPRSZ, XMM_MAXSZ, pavgw_xmm) +DEF_GEN_INSN3_GVEC(vpavgw, Vdq, Hdq, Wdq, 3_ool, XMM_OPRSZ, XMM_MAXSZ, pavgw_xmm) +DEF_GEN_INSN3_GVEC(vpavgw, Vqq, Hqq, Wqq, 3_ool, XMM_OPRSZ, XMM_MAXSZ, pavgw_xmm) DEF_GEN_INSN3_HELPER_EPP(psadbw, psadbw_mmx, Pq, Pq, Qq) DEF_GEN_INSN3_HELPER_EPP(psadbw, psadbw_xmm, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(vpsadbw, psadbw_xmm, Vdq, Hdq, Wdq) From patchwork Wed Aug 21 17:29:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Bobek X-Patchwork-Id: 11107999 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B2C611395 for ; Wed, 21 Aug 2019 18:43:45 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8A15C214DA for ; Wed, 21 Aug 2019 18:43:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="HYp3n2j9" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8A15C214DA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:52166 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0VaC-00045f-KB for patchwork-qemu-devel@patchwork.kernel.org; Wed, 21 Aug 2019 14:43:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41570) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0URz-0001tQ-C5 for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:31:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i0URx-00008h-Gs for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:31:11 -0400 Received: from mail-yw1-xc36.google.com ([2607:f8b0:4864:20::c36]:34434) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i0URx-00008S-Cd for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:31:09 -0400 Received: by mail-yw1-xc36.google.com with SMTP id n126so1251859ywf.1 for ; Wed, 21 Aug 2019 10:31:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=VFSnIX9oN9KEpZo1ftTHo+xM5MdG+3Q40eSx9SWlUqM=; b=HYp3n2j9x6Ejp18qSnf/RSg1E9Oxasa+w5C6043NHEROfQW5j+EXS8HxSymxfG2Sh8 ftXaGWyVUg5Gn0RR2MYBGsbUsHmH4TkhdtNgeILaGK4PFhWFrWB45O5l7FvM+/iRyFDT bwDRfHs4xbgVYxIRLPSM3swKiEhCJejYI/jeE16/OyNnKrH6qxdRrKsEhuQeHrGtROs4 wq7e3anx9BkMFgQ8xoIrJ0GG5Qg8yl0ynVmdcw6WMHBckjo3v8mvDUh2/Rh/Uehi+OHl vqAj5VEw2hsWsEjNHHwKXeEp9btwGFEvw1/p7PVjuxAkPbYzC8qJY6POyyW+oa4YEFhX oNMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=VFSnIX9oN9KEpZo1ftTHo+xM5MdG+3Q40eSx9SWlUqM=; b=E2ynyf1H1hN1ruiJmSyjhN/36bMMUCHHGyyGF3cJRm95J5B7jbQAxkS1inQvcxh4cl HDDH0lVyKDH3yFg6qOg7WsWiLaSX7vOZsEKV7YTFaAz3xX89ZUhasbfsLphyNlr7GYUC SxMGAtIiv0DXHmnPaj3zgyfe7x7/wpmrOltVFDzbySmtCjLfsy8nF5iv+PfRbLy3ttoe kufel2vd2FyUBT7UZwlbBmhzr1+PNdV1DsjZrj0RD9ilaUmwPYG/YzjUYAeAzHGKjKzO uqcl6pYW0XYfVXkZKbXsG7FNTtk2V+q48Lc8sFGQ3KMjSYLhJvfgpevJig/cuw0E19Ll EKhQ== X-Gm-Message-State: APjAAAVrOduhosXTszeDvCaHa4+Gx63qod6ycsOziNj7V5mAjBGr9Qh/ TXhoUqgxVgEXqoBYsOt8aL9ZtUih X-Google-Smtp-Source: APXvYqwwzE9IpclD+OEGaMMkKPqEvuFCqAXlX0hTkFsGuyV6tnc6TPWP/a1/4ZehtfKAw4jdy9U9IQ== X-Received: by 2002:a81:6b54:: with SMTP id g81mr21947383ywc.283.1566408668571; Wed, 21 Aug 2019 10:31:08 -0700 (PDT) Received: from localhost.localdomain ([2601:c0:c67f:e390::3]) by smtp.gmail.com with ESMTPSA id l71sm2826167ywl.39.2019.08.21.10.31.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Aug 2019 10:31:08 -0700 (PDT) From: Jan Bobek To: qemu-devel@nongnu.org Date: Wed, 21 Aug 2019 13:29:47 -0400 Message-Id: <20190821172951.15333-72-jan.bobek@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190821172951.15333-1-jan.bobek@gmail.com> References: <20190821172951.15333-1-jan.bobek@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::c36 Subject: [Qemu-devel] [RFC PATCH v4 71/75] target/i386: convert pmuludq/pmaddwd helpers to gvec style X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jan Bobek , =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Make these helpers suitable for use with tcg_gen_gvec_* functions. --- target/i386/ops_sse.h | 27 +++++++++++++++++---------- target/i386/ops_sse_header.h | 4 ++-- target/i386/translate.c | 18 ++++++++---------- 3 files changed, 27 insertions(+), 22 deletions(-) diff --git a/target/i386/ops_sse.h b/target/i386/ops_sse.h index 1661bd7c64..384a835662 100644 --- a/target/i386/ops_sse.h +++ b/target/i386/ops_sse.h @@ -485,22 +485,29 @@ void glue(helper_pavgw, SUFFIX)(Reg *d, Reg *a, Reg *b, uint32_t desc) glue(clear_high, SUFFIX)(d, oprsz, maxsz); } -void glue(helper_pmuludq, SUFFIX)(CPUX86State *env, Reg *d, Reg *s) +void glue(helper_pmuludq, SUFFIX)(Reg *d, Reg *a, Reg *b, uint32_t desc) { - d->Q(0) = (uint64_t)s->L(0) * (uint64_t)d->L(0); -#if SHIFT == 1 - d->Q(1) = (uint64_t)s->L(2) * (uint64_t)d->L(2); -#endif + const intptr_t oprsz = simd_oprsz(desc); + const intptr_t maxsz = simd_maxsz(desc); + + for (intptr_t i = 0; i * sizeof(uint64_t) < oprsz; ++i) { + const uint64_t t = (uint64_t)a->L(2 * i) * (uint64_t)b->L(2 * i); + d->Q(i) = t; + } + glue(clear_high, SUFFIX)(d, oprsz, maxsz); } -void glue(helper_pmaddwd, SUFFIX)(CPUX86State *env, Reg *d, Reg *s) +void glue(helper_pmaddwd, SUFFIX)(Reg *d, Reg *a, Reg *b, uint32_t desc) { - int i; + const intptr_t oprsz = simd_oprsz(desc); + const intptr_t maxsz = simd_maxsz(desc); - for (i = 0; i < (2 << SHIFT); i++) { - d->L(i) = (int16_t)s->W(2 * i) * (int16_t)d->W(2 * i) + - (int16_t)s->W(2 * i + 1) * (int16_t)d->W(2 * i + 1); + for (intptr_t i = 0; i * sizeof(uint32_t) < oprsz; ++i) { + const int32_t t0 = (int32_t)a->W(2 * i + 0) * (int32_t)b->W(2 * i + 0); + const int32_t t1 = (int32_t)a->W(2 * i + 1) * (int32_t)b->W(2 * i + 1); + d->L(i) = t0 + t1; } + glue(clear_high, SUFFIX)(d, oprsz, maxsz); } #if SHIFT == 0 diff --git a/target/i386/ops_sse_header.h b/target/i386/ops_sse_header.h index b5e8aae897..18d39ca649 100644 --- a/target/i386/ops_sse_header.h +++ b/target/i386/ops_sse_header.h @@ -71,8 +71,8 @@ DEF_HELPER_3(glue(pavgusb, SUFFIX), void, env, Reg, Reg) #endif DEF_HELPER_4(glue(pavgw, SUFFIX), void, Reg, Reg, Reg, i32) -DEF_HELPER_3(glue(pmuludq, SUFFIX), void, env, Reg, Reg) -DEF_HELPER_3(glue(pmaddwd, SUFFIX), void, env, Reg, Reg) +DEF_HELPER_4(glue(pmuludq, SUFFIX), void, Reg, Reg, Reg, i32) +DEF_HELPER_4(glue(pmaddwd, SUFFIX), void, Reg, Reg, Reg, i32) DEF_HELPER_3(glue(psadbw, SUFFIX), void, env, Reg, Reg) DEF_HELPER_4(glue(maskmov, SUFFIX), void, env, Reg, Reg, tl) diff --git a/target/i386/translate.c b/target/i386/translate.c index 77b2e18f34..55607db09c 100644 --- a/target/i386/translate.c +++ b/target/i386/translate.c @@ -2806,8 +2806,6 @@ static const SSEFunc_0_epp sse_op_table1[256][4] = { [0xe6] = { NULL, gen_helper_cvttpd2dq, gen_helper_cvtdq2pd, gen_helper_cvtpd2dq }, [0xe7] = { SSE_SPECIAL , SSE_SPECIAL }, /* movntq, movntq */ [0xf0] = { NULL, NULL, NULL, SSE_SPECIAL }, /* lddqu */ - [0xf4] = MMX_OP2(pmuludq), - [0xf5] = MMX_OP2(pmaddwd), [0xf6] = MMX_OP2(psadbw), [0xf7] = { (SSEFunc_0_epp)gen_helper_maskmov_mmx, (SSEFunc_0_epp)gen_helper_maskmov_xmm }, /* XXX: casts */ @@ -6129,10 +6127,10 @@ DEF_GEN_INSN3_GVEC(vpmulhuw, Vqq, Hqq, Wqq, 3_ool, XMM_OPRSZ, XMM_MAXSZ, pmulhuw DEF_GEN_INSN3_HELPER_EPP(pmuldq, pmuldq_xmm, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(vpmuldq, pmuldq_xmm, Vdq, Hdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(vpmuldq, pmuldq_xmm, Vqq, Hqq, Wqq) -DEF_GEN_INSN3_HELPER_EPP(pmuludq, pmuludq_mmx, Pq, Pq, Qq) -DEF_GEN_INSN3_HELPER_EPP(pmuludq, pmuludq_xmm, Vdq, Vdq, Wdq) -DEF_GEN_INSN3_HELPER_EPP(vpmuludq, pmuludq_xmm, Vdq, Hdq, Wdq) -DEF_GEN_INSN3_HELPER_EPP(vpmuludq, pmuludq_xmm, Vqq, Hqq, Wqq) +DEF_GEN_INSN3_GVEC(pmuludq, Pq, Pq, Qq, 3_ool, MM_OPRSZ, MM_MAXSZ, pmuludq_mmx) +DEF_GEN_INSN3_GVEC(pmuludq, Vdq, Vdq, Wdq, 3_ool, XMM_OPRSZ, XMM_MAXSZ, pmuludq_xmm) +DEF_GEN_INSN3_GVEC(vpmuludq, Vdq, Hdq, Wdq, 3_ool, XMM_OPRSZ, XMM_MAXSZ, pmuludq_xmm) +DEF_GEN_INSN3_GVEC(vpmuludq, Vqq, Hqq, Wqq, 3_ool, XMM_OPRSZ, XMM_MAXSZ, pmuludq_xmm) DEF_GEN_INSN3_HELPER_EPP(pmulhrsw, pmulhrsw_mmx, Pq, Pq, Qq) DEF_GEN_INSN3_HELPER_EPP(pmulhrsw, pmulhrsw_xmm, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(vpmulhrsw, pmulhrsw_xmm, Vdq, Hdq, Wdq) @@ -6147,10 +6145,10 @@ DEF_GEN_INSN3_HELPER_EPP(mulss, mulss, Vd, Vd, Wd) DEF_GEN_INSN3_HELPER_EPP(vmulss, mulss, Vd, Hd, Wd) DEF_GEN_INSN3_HELPER_EPP(mulsd, mulsd, Vq, Vq, Wq) DEF_GEN_INSN3_HELPER_EPP(vmulsd, mulsd, Vq, Hq, Wq) -DEF_GEN_INSN3_HELPER_EPP(pmaddwd, pmaddwd_mmx, Pq, Pq, Qq) -DEF_GEN_INSN3_HELPER_EPP(pmaddwd, pmaddwd_xmm, Vdq, Vdq, Wdq) -DEF_GEN_INSN3_HELPER_EPP(vpmaddwd, pmaddwd_xmm, Vdq, Hdq, Wdq) -DEF_GEN_INSN3_HELPER_EPP(vpmaddwd, pmaddwd_xmm, Vqq, Hqq, Wqq) +DEF_GEN_INSN3_GVEC(pmaddwd, Pq, Pq, Qq, 3_ool, MM_OPRSZ, MM_MAXSZ, pmaddwd_mmx) +DEF_GEN_INSN3_GVEC(pmaddwd, Vdq, Vdq, Wdq, 3_ool, XMM_OPRSZ, XMM_MAXSZ, pmaddwd_xmm) +DEF_GEN_INSN3_GVEC(vpmaddwd, Vdq, Hdq, Wdq, 3_ool, XMM_OPRSZ, XMM_MAXSZ, pmaddwd_xmm) +DEF_GEN_INSN3_GVEC(vpmaddwd, Vqq, Hqq, Wqq, 3_ool, XMM_OPRSZ, XMM_MAXSZ, pmaddwd_xmm) DEF_GEN_INSN3_HELPER_EPP(pmaddubsw, pmaddubsw_mmx, Pq, Pq, Qq) DEF_GEN_INSN3_HELPER_EPP(pmaddubsw, pmaddubsw_xmm, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(vpmaddubsw, pmaddubsw_xmm, Vdq, Hdq, Wdq) From patchwork Wed Aug 21 17:29:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Bobek X-Patchwork-Id: 11108019 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 645C614DB for ; Wed, 21 Aug 2019 18:45:38 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2BCF6214DA for ; Wed, 21 Aug 2019 18:45:38 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="tyHnQpkw" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2BCF6214DA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:52368 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0Vc1-0008Ms-8X for patchwork-qemu-devel@patchwork.kernel.org; Wed, 21 Aug 2019 14:45:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41587) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0US0-0001vD-Lx for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:31:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i0URz-0000B2-1A for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:31:12 -0400 Received: from mail-yb1-xb36.google.com ([2607:f8b0:4864:20::b36]:44077) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i0URy-00009w-SL for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:31:10 -0400 Received: by mail-yb1-xb36.google.com with SMTP id y21so1330164ybi.11 for ; Wed, 21 Aug 2019 10:31:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=+6EW2oIxZaioHGi13+b0hflo+B7lUb7Q/oz7jaljYbw=; b=tyHnQpkwuUUAzoHre2jedUy+2BFTXYBPFUW+0NaHzNyYjUfk0Atp81UtO766Rq52iX pqOadzCJJM1yPLX6UG2X6QQJqTT1sP4nM7/TWDSx8G994mAng/S0vdgVAB/fpZc1cqEI 58+vaQQydBydvDg7nbvXB82TA2wPHsXH7P4ycrfA27pqmQfFa/8He5GVxHGpTW2Wz+3a 11xFA0VCAEZbIe+4heqwrAsw/uAQB4u+jBiWBCVxu6TSx9OscQgNOVxXRYqNU/v0gJfR OJRCsRrB+kaD1L8uo0UJn4wrDIN4DGNrVJffXTdJ3WdKQ7eSdLeeCFpO9PjagBngzc7X INvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=+6EW2oIxZaioHGi13+b0hflo+B7lUb7Q/oz7jaljYbw=; b=Okxdqwzd1eS1F+B5gzgCuK0mrBfHNPTx/ugFvEL4kE1O/fIvXBBS4XKa660NKXgiWU /u8SgV2zOG1lCrE4/9wRk5TYp6fNtCznxi6VRX7l2tr5XD+A6ra5UwlkXCyFPUgZFimi 0wsUOwncxYQD0EpczhWIp33osxFCVwxRxLNyIkf17ONba3dae7cE9eEArwR2o5kgIZRb oeyF84BAyLcnPkZ/5r+ZsvNruApWa2z5fFtdPbqjghKWQsEGQZs93aTLoj/cqK7jxv8Z ++VVe9/oEO44CnK1MrhD1mel3xrcKXW8RR0yN5FfH6p4oGmalSs+ekcwmzl2C3IB3CZ7 H4eA== X-Gm-Message-State: APjAAAVhElFOwfEBAndx++Kz4D/Kgj42ogEl23Hlr//1+jGzNJ6TbqD3 qEMwOzOmeswW21sv/PVAIIW1KiJt X-Google-Smtp-Source: APXvYqzTuaURNH2cJ9Yg2VPgeqUk7PcsbH+52L/zN1/cVKZE7VHjSnhTddjd8VMfBK3sicPYAb8a4w== X-Received: by 2002:a25:ccd7:: with SMTP id l206mr24413541ybf.165.1566408669908; Wed, 21 Aug 2019 10:31:09 -0700 (PDT) Received: from localhost.localdomain ([2601:c0:c67f:e390::3]) by smtp.gmail.com with ESMTPSA id l71sm2826167ywl.39.2019.08.21.10.31.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Aug 2019 10:31:08 -0700 (PDT) From: Jan Bobek To: qemu-devel@nongnu.org Date: Wed, 21 Aug 2019 13:29:48 -0400 Message-Id: <20190821172951.15333-73-jan.bobek@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190821172951.15333-1-jan.bobek@gmail.com> References: <20190821172951.15333-1-jan.bobek@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::b36 Subject: [Qemu-devel] [RFC PATCH v4 72/75] target/i386: convert psadbw helper to gvec style X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jan Bobek , =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Make these helpers suitable for use with tcg_gen_gvec_* functions. Signed-off-by: Jan Bobek --- target/i386/ops_sse.h | 64 +++++++++++++++--------------------- target/i386/ops_sse_header.h | 2 +- target/i386/translate.c | 9 +++-- 3 files changed, 32 insertions(+), 43 deletions(-) diff --git a/target/i386/ops_sse.h b/target/i386/ops_sse.h index 384a835662..b866ead1c8 100644 --- a/target/i386/ops_sse.h +++ b/target/i386/ops_sse.h @@ -412,6 +412,15 @@ static inline int satsw(int x) } } +static inline int abs1(int x) +{ + if (x < 0) { + return -x; + } else { + return x; + } +} + #define FMULHRW(a, b) (((int16_t)(a) * (int16_t)(b) + 0x8000) >> 16) #endif @@ -510,52 +519,33 @@ void glue(helper_pmaddwd, SUFFIX)(Reg *d, Reg *a, Reg *b, uint32_t desc) glue(clear_high, SUFFIX)(d, oprsz, maxsz); } -#if SHIFT == 0 -static inline int abs1(int a) +void glue(helper_psadbw, SUFFIX)(Reg *d, Reg *a, Reg *b, uint32_t desc) { - if (a < 0) { - return -a; - } else { - return a; + const intptr_t oprsz = simd_oprsz(desc); + const intptr_t maxsz = simd_maxsz(desc); + + for (intptr_t i = 0; i * sizeof(uint64_t) < oprsz; ++i) { + const uint64_t t0 = abs1(a->B(8 * i + 0) - b->B(8 * i + 0)); + const uint64_t t1 = abs1(a->B(8 * i + 1) - b->B(8 * i + 1)); + const uint64_t t2 = abs1(a->B(8 * i + 2) - b->B(8 * i + 2)); + const uint64_t t3 = abs1(a->B(8 * i + 3) - b->B(8 * i + 3)); + const uint64_t t4 = abs1(a->B(8 * i + 4) - b->B(8 * i + 4)); + const uint64_t t5 = abs1(a->B(8 * i + 5) - b->B(8 * i + 5)); + const uint64_t t6 = abs1(a->B(8 * i + 6) - b->B(8 * i + 6)); + const uint64_t t7 = abs1(a->B(8 * i + 7) - b->B(8 * i + 7)); + d->Q(i) = t0 + t1 + t2 + t3 + t4 + t5 + t6 + t7; } + glue(clear_high, SUFFIX)(d, oprsz, maxsz); } -#endif -void glue(helper_psadbw, SUFFIX)(CPUX86State *env, Reg *d, Reg *s) -{ - unsigned int val; - val = 0; - val += abs1(d->B(0) - s->B(0)); - val += abs1(d->B(1) - s->B(1)); - val += abs1(d->B(2) - s->B(2)); - val += abs1(d->B(3) - s->B(3)); - val += abs1(d->B(4) - s->B(4)); - val += abs1(d->B(5) - s->B(5)); - val += abs1(d->B(6) - s->B(6)); - val += abs1(d->B(7) - s->B(7)); - d->Q(0) = val; -#if SHIFT == 1 - val = 0; - val += abs1(d->B(8) - s->B(8)); - val += abs1(d->B(9) - s->B(9)); - val += abs1(d->B(10) - s->B(10)); - val += abs1(d->B(11) - s->B(11)); - val += abs1(d->B(12) - s->B(12)); - val += abs1(d->B(13) - s->B(13)); - val += abs1(d->B(14) - s->B(14)); - val += abs1(d->B(15) - s->B(15)); - d->Q(1) = val; -#endif -} - -void glue(helper_maskmov, SUFFIX)(CPUX86State *env, Reg *d, Reg *s, +void glue(helper_maskmov, SUFFIX)(CPUX86State *env, Reg *a, Reg *b, target_ulong a0) { int i; for (i = 0; i < (8 << SHIFT); i++) { - if (s->B(i) & 0x80) { - cpu_stb_data_ra(env, a0 + i, d->B(i), GETPC()); + if (b->B(i) & 0x80) { + cpu_stb_data_ra(env, a0 + i, a->B(i), GETPC()); } } } diff --git a/target/i386/ops_sse_header.h b/target/i386/ops_sse_header.h index 18d39ca649..ec7d1fc686 100644 --- a/target/i386/ops_sse_header.h +++ b/target/i386/ops_sse_header.h @@ -74,7 +74,7 @@ DEF_HELPER_4(glue(pavgw, SUFFIX), void, Reg, Reg, Reg, i32) DEF_HELPER_4(glue(pmuludq, SUFFIX), void, Reg, Reg, Reg, i32) DEF_HELPER_4(glue(pmaddwd, SUFFIX), void, Reg, Reg, Reg, i32) -DEF_HELPER_3(glue(psadbw, SUFFIX), void, env, Reg, Reg) +DEF_HELPER_4(glue(psadbw, SUFFIX), void, Reg, Reg, Reg, i32) DEF_HELPER_4(glue(maskmov, SUFFIX), void, env, Reg, Reg, tl) DEF_HELPER_2(glue(movl_mm_T0, SUFFIX), void, Reg, i32) #ifdef TARGET_X86_64 diff --git a/target/i386/translate.c b/target/i386/translate.c index 55607db09c..6bffbaee4c 100644 --- a/target/i386/translate.c +++ b/target/i386/translate.c @@ -2806,7 +2806,6 @@ static const SSEFunc_0_epp sse_op_table1[256][4] = { [0xe6] = { NULL, gen_helper_cvttpd2dq, gen_helper_cvtdq2pd, gen_helper_cvtpd2dq }, [0xe7] = { SSE_SPECIAL , SSE_SPECIAL }, /* movntq, movntq */ [0xf0] = { NULL, NULL, NULL, SSE_SPECIAL }, /* lddqu */ - [0xf6] = MMX_OP2(psadbw), [0xf7] = { (SSEFunc_0_epp)gen_helper_maskmov_mmx, (SSEFunc_0_epp)gen_helper_maskmov_xmm }, /* XXX: casts */ }; @@ -6256,10 +6255,10 @@ DEF_GEN_INSN3_GVEC(pavgw, Pq, Pq, Qq, 3_ool, MM_OPRSZ, MM_MAXSZ, pavgw_mmx) DEF_GEN_INSN3_GVEC(pavgw, Vdq, Vdq, Wdq, 3_ool, XMM_OPRSZ, XMM_MAXSZ, pavgw_xmm) DEF_GEN_INSN3_GVEC(vpavgw, Vdq, Hdq, Wdq, 3_ool, XMM_OPRSZ, XMM_MAXSZ, pavgw_xmm) DEF_GEN_INSN3_GVEC(vpavgw, Vqq, Hqq, Wqq, 3_ool, XMM_OPRSZ, XMM_MAXSZ, pavgw_xmm) -DEF_GEN_INSN3_HELPER_EPP(psadbw, psadbw_mmx, Pq, Pq, Qq) -DEF_GEN_INSN3_HELPER_EPP(psadbw, psadbw_xmm, Vdq, Vdq, Wdq) -DEF_GEN_INSN3_HELPER_EPP(vpsadbw, psadbw_xmm, Vdq, Hdq, Wdq) -DEF_GEN_INSN3_HELPER_EPP(vpsadbw, psadbw_xmm, Vqq, Hqq, Wqq) +DEF_GEN_INSN3_GVEC(psadbw, Pq, Pq, Qq, 3_ool, MM_OPRSZ, MM_MAXSZ, psadbw_mmx) +DEF_GEN_INSN3_GVEC(psadbw, Vdq, Vdq, Wdq, 3_ool, XMM_OPRSZ, XMM_MAXSZ, psadbw_xmm) +DEF_GEN_INSN3_GVEC(vpsadbw, Vdq, Hdq, Wdq, 3_ool, XMM_OPRSZ, XMM_MAXSZ, psadbw_xmm) +DEF_GEN_INSN3_GVEC(vpsadbw, Vqq, Hqq, Wqq, 3_ool, XMM_OPRSZ, XMM_MAXSZ, psadbw_xmm) DEF_GEN_INSN4_HELPER_EPPI(mpsadbw, mpsadbw_xmm, Vdq, Vdq, Wdq, Ib) DEF_GEN_INSN4_HELPER_EPPI(vmpsadbw, mpsadbw_xmm, Vdq, Hdq, Wdq, Ib) DEF_GEN_INSN4_HELPER_EPPI(vmpsadbw, mpsadbw_xmm, Vqq, Hqq, Wqq, Ib) From patchwork Wed Aug 21 17:29:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Bobek X-Patchwork-Id: 11108023 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B07C014DE for ; Wed, 21 Aug 2019 18:47:29 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 867E2214DA for ; Wed, 21 Aug 2019 18:47:29 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="BwphZGUx" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 867E2214DA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:52616 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0Vdo-0002Hz-Jc for patchwork-qemu-devel@patchwork.kernel.org; Wed, 21 Aug 2019 14:47:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41596) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0US1-0001vl-0l for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:31:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i0URz-0000Bv-Fe for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:31:12 -0400 Received: from mail-yw1-xc44.google.com ([2607:f8b0:4864:20::c44]:35838) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i0URz-0000B7-9U for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:31:11 -0400 Received: by mail-yw1-xc44.google.com with SMTP id g19so1248003ywe.2 for ; Wed, 21 Aug 2019 10:31:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Qrd/tOzvej+7yu0bXKKIJuAV1cC6hhFiLyDQ1JmkJMo=; b=BwphZGUxWQedHvlzzzyK+SfZGYVtp4NJJBlDe7MxqE9sJiYUot5ttJZZo+ay6tk3SU 6wBnby2jVdUNLUT1IpwYxoDDrFTz+It1TohgprrNriVbHO8mtt5Y553Iwtt/+Sv54xUh Bg+zOLC0/kMQ7rn8qugEAn3zbXYpHtl3XkB3+s+zIhVgX03IGTKvSEM8QxbY/SwUGQFW fXOFHBvqsCjhI2QBMzEQFbHw5+u7CoEtJMHtW/y/caCrjNFIzS3pxq6YdxMQ9AyKG/kV 6ODtWb4iJo2rJk6Z6EiT/xXVZmv47Hg51s13ROMmNcx0Rj0ZhNci9k03tnvHs96hKuqP +ssA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Qrd/tOzvej+7yu0bXKKIJuAV1cC6hhFiLyDQ1JmkJMo=; b=B1G3t8HY1JQBocg5/B1O8ddI1fgMpK+pXxFrWzqDQ694nt75glfjWyX+uDh8R9XEP7 J4mXL9poikRAtnEMbqcWua3rGiHvJDy7Tix3E4XgHAMVHL2tdjBiOr5Z7h/J0dTNa4lB fNTj5A3MlvpvVMQgmyIievxXvM7bRfno3/wKocUNLgoJtQfcOZPN01duZKpbS4kubfBM +BPi8UNI7z+47OpZXP5e4PN5zMy5Lf0MVV/hdGinDV/c451TqM9yD2EVQkuPkXHEaw3H AbmrOr9+5XrXCVjxMKnUBXB/B5n6PhG4MnSR3zjkViRPu0hA7Wr+NP7tfMujwafAG2QM pqgQ== X-Gm-Message-State: APjAAAUQw+O5S1QQQAcOza+AC3St56Hyx2qdg7acb0u22bXMfVXQ6AFN Y+fjMJYnq38MkSZY/00XIqubcowP X-Google-Smtp-Source: APXvYqwmfdsNRm6AP224HlUnI6oA/Qf1AzA5pxQYk6xq5Nn+zZF5gm/R8zlk/ajsf7pbVDvwSVhRPA== X-Received: by 2002:a81:5ec2:: with SMTP id s185mr24953795ywb.35.1566408670585; Wed, 21 Aug 2019 10:31:10 -0700 (PDT) Received: from localhost.localdomain ([2601:c0:c67f:e390::3]) by smtp.gmail.com with ESMTPSA id l71sm2826167ywl.39.2019.08.21.10.31.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Aug 2019 10:31:10 -0700 (PDT) From: Jan Bobek To: qemu-devel@nongnu.org Date: Wed, 21 Aug 2019 13:29:49 -0400 Message-Id: <20190821172951.15333-74-jan.bobek@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190821172951.15333-1-jan.bobek@gmail.com> References: <20190821172951.15333-1-jan.bobek@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::c44 Subject: [Qemu-devel] [RFC PATCH v4 73/75] target/i386: remove obsoleted helper_mov(l, q)_mm_T0 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jan Bobek , =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" This helper has been obsoleted by the new code. Signed-off-by: Jan Bobek --- target/i386/ops_sse.h | 19 ------------------- target/i386/ops_sse_header.h | 4 ---- target/i386/translate.c | 33 --------------------------------- 3 files changed, 56 deletions(-) diff --git a/target/i386/ops_sse.h b/target/i386/ops_sse.h index b866ead1c8..8172324e34 100644 --- a/target/i386/ops_sse.h +++ b/target/i386/ops_sse.h @@ -550,25 +550,6 @@ void glue(helper_maskmov, SUFFIX)(CPUX86State *env, Reg *a, Reg *b, } } -void glue(helper_movl_mm_T0, SUFFIX)(Reg *d, uint32_t val) -{ - d->L(0) = val; - d->L(1) = 0; -#if SHIFT == 1 - d->Q(1) = 0; -#endif -} - -#ifdef TARGET_X86_64 -void glue(helper_movq_mm_T0, SUFFIX)(Reg *d, uint64_t val) -{ - d->Q(0) = val; -#if SHIFT == 1 - d->Q(1) = 0; -#endif -} -#endif - #if SHIFT == 0 void glue(helper_pshufw, SUFFIX)(Reg *d, Reg *s, int order) { diff --git a/target/i386/ops_sse_header.h b/target/i386/ops_sse_header.h index ec7d1fc686..ee8bd4c1af 100644 --- a/target/i386/ops_sse_header.h +++ b/target/i386/ops_sse_header.h @@ -76,10 +76,6 @@ DEF_HELPER_4(glue(pmaddwd, SUFFIX), void, Reg, Reg, Reg, i32) DEF_HELPER_4(glue(psadbw, SUFFIX), void, Reg, Reg, Reg, i32) DEF_HELPER_4(glue(maskmov, SUFFIX), void, env, Reg, Reg, tl) -DEF_HELPER_2(glue(movl_mm_T0, SUFFIX), void, Reg, i32) -#ifdef TARGET_X86_64 -DEF_HELPER_2(glue(movq_mm_T0, SUFFIX), void, Reg, i64) -#endif #if SHIFT == 0 DEF_HELPER_3(glue(pshufw, SUFFIX), void, Reg, Reg, int) diff --git a/target/i386/translate.c b/target/i386/translate.c index 6bffbaee4c..3554086336 100644 --- a/target/i386/translate.c +++ b/target/i386/translate.c @@ -3079,39 +3079,6 @@ static void gen_sse(CPUX86State *env, DisasContext *s, int b) gen_op_st_v(s, MO_32, s->T0, s->A0); } break; - case 0x6e: /* movd mm, ea */ -#ifdef TARGET_X86_64 - if (s->dflag == MO_64) { - gen_ldst_modrm(env, s, modrm, MO_64, OR_TMP0, 0); - tcg_gen_st_tl(s->T0, cpu_env, - offsetof(CPUX86State, fpregs[reg].mmx)); - } else -#endif - { - gen_ldst_modrm(env, s, modrm, MO_32, OR_TMP0, 0); - tcg_gen_addi_ptr(s->ptr0, cpu_env, - offsetof(CPUX86State,fpregs[reg].mmx)); - tcg_gen_trunc_tl_i32(s->tmp2_i32, s->T0); - gen_helper_movl_mm_T0_mmx(s->ptr0, s->tmp2_i32); - } - break; - case 0x16e: /* movd xmm, ea */ -#ifdef TARGET_X86_64 - if (s->dflag == MO_64) { - gen_ldst_modrm(env, s, modrm, MO_64, OR_TMP0, 0); - tcg_gen_addi_ptr(s->ptr0, cpu_env, - offsetof(CPUX86State,xmm_regs[reg])); - gen_helper_movq_mm_T0_xmm(s->ptr0, s->T0); - } else -#endif - { - gen_ldst_modrm(env, s, modrm, MO_32, OR_TMP0, 0); - tcg_gen_addi_ptr(s->ptr0, cpu_env, - offsetof(CPUX86State,xmm_regs[reg])); - tcg_gen_trunc_tl_i32(s->tmp2_i32, s->T0); - gen_helper_movl_mm_T0_xmm(s->ptr0, s->tmp2_i32); - } - break; case 0x6f: /* movq mm, ea */ if (mod != 3) { gen_lea_modrm(env, s, modrm); From patchwork Wed Aug 21 17:29:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Bobek X-Patchwork-Id: 11107959 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E4DED1395 for ; Wed, 21 Aug 2019 18:34:40 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A93D3216F4 for ; Wed, 21 Aug 2019 18:34:40 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="e8L39zn4" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A93D3216F4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:51800 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0VRP-0007Ec-SS for patchwork-qemu-devel@patchwork.kernel.org; Wed, 21 Aug 2019 14:34:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41641) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0US3-0001yV-12 for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:31:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i0US0-0000DA-OP for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:31:14 -0400 Received: from mail-yw1-xc32.google.com ([2607:f8b0:4864:20::c32]:36337) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i0US0-0000Cl-JL for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:31:12 -0400 Received: by mail-yw1-xc32.google.com with SMTP id m11so1245542ywh.3 for ; Wed, 21 Aug 2019 10:31:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=7bR2HUr7nWzHcbedf2vlhprEYxS2A4qecEYLgRJuH1o=; b=e8L39zn42txzDmJPL9b5Udmhr9tEXnYt7xaJdFJ1NGgHsBD+2zLXadlXVdAHjz7cnA DOIs+y3i5RhCJOKcXW6nW7VXZg5DqIAMkg/b3JW4Tl9nx2HY1DI/Yp8H8N5hJtT/BXCV LJrm93JUiDaj8ydl9eSAOADbzIt83IbFUGnLVxdYS12KRyYfyP0ZE7+9f+V6cSeUXW9K Otx7xnel1Avpo8mQiHZeh+R/IwHp7XNfoQ4HxqCRNuVlJrI9h7sWuCmYcb0mkg67tjr0 vnusbYlzw/hqhcd/EaM6NXzDKDpDSEVSwXs7pPbxLeFeszT4X1vrZszu8FOa9nRmYKrm INRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=7bR2HUr7nWzHcbedf2vlhprEYxS2A4qecEYLgRJuH1o=; b=ZHbFrhfPzONv4RwOCaNwJrRIF5NyNpHuhcGRDyj9qpNfRSh1sgulnaUYOp6PWRyrQs J0GCpVVkjkSOk9KTvkWoy7eoYYFOe0U3xdBaW8oIONwv3MuN04Q7mfkSFf1DVrSLMBTF jp+r/F/lvfOxOxK8SJP8Q/Z3tlF9tr7ZnLtxaSIbVafVj6XiRJzPLzcSeZPwjEKEV834 lnLDi13UOO9zwP/Ed4DFhRmpNpE1HTAqaPRF5OAv7jQt0b4OeMivrZjVoCHJhTRnLs1H 7AW28yPA3qx2q3ytrHzW7cbrAz7sym0fQzohgBqLDrrYAuhqX7AOIiMhWHeDsZypMMb7 yevA== X-Gm-Message-State: APjAAAW+hpQf3BPJeeu3qqv6tO1tpySrDe2ZHOFbMti1KnIqya9VWbQj kBLep9TCNthSbvWMjgmKvOZvTEX1 X-Google-Smtp-Source: APXvYqybD8U7e3QbwlnX4n4h/LuyPg5LuzMR6sAyYxiGzkidxj3IcmYweVRkrEMw0FgzJj009FTyoQ== X-Received: by 2002:a81:9293:: with SMTP id j141mr25651734ywg.363.1566408671687; Wed, 21 Aug 2019 10:31:11 -0700 (PDT) Received: from localhost.localdomain ([2601:c0:c67f:e390::3]) by smtp.gmail.com with ESMTPSA id l71sm2826167ywl.39.2019.08.21.10.31.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Aug 2019 10:31:11 -0700 (PDT) From: Jan Bobek To: qemu-devel@nongnu.org Date: Wed, 21 Aug 2019 13:29:50 -0400 Message-Id: <20190821172951.15333-75-jan.bobek@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190821172951.15333-1-jan.bobek@gmail.com> References: <20190821172951.15333-1-jan.bobek@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::c32 Subject: [Qemu-devel] [RFC PATCH v4 74/75] target/i386: convert pshuf(w, lw, hw, d), shuf(pd, ps) helpers to gvec style X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jan Bobek , =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Make these helpers suitable for use with tcg_gen_gvec_* functions. Signed-off-by: Jan Bobek --- target/i386/ops_sse.h | 141 ++++++++++++++++++++++++----------- target/i386/ops_sse_header.h | 12 +-- target/i386/translate.c | 34 ++++----- 3 files changed, 119 insertions(+), 68 deletions(-) diff --git a/target/i386/ops_sse.h b/target/i386/ops_sse.h index 8172324e34..2e50d91a25 100644 --- a/target/i386/ops_sse.h +++ b/target/i386/ops_sse.h @@ -551,70 +551,123 @@ void glue(helper_maskmov, SUFFIX)(CPUX86State *env, Reg *a, Reg *b, } #if SHIFT == 0 -void glue(helper_pshufw, SUFFIX)(Reg *d, Reg *s, int order) +void glue(helper_pshufw, SUFFIX)(Reg *d, Reg *a, uint32_t desc) { - Reg r; + const intptr_t oprsz = simd_oprsz(desc); + const intptr_t maxsz = simd_maxsz(desc); + const uint8_t ctrl = simd_data(desc); - r.W(0) = s->W(order & 3); - r.W(1) = s->W((order >> 2) & 3); - r.W(2) = s->W((order >> 4) & 3); - r.W(3) = s->W((order >> 6) & 3); - *d = r; + for (intptr_t i = 0; 4 * i * sizeof(uint16_t) < oprsz; ++i) { + const uint16_t t0 = a->W(4 * i + ((ctrl >> 0) & 3)); + const uint16_t t1 = a->W(4 * i + ((ctrl >> 2) & 3)); + const uint16_t t2 = a->W(4 * i + ((ctrl >> 4) & 3)); + const uint16_t t3 = a->W(4 * i + ((ctrl >> 6) & 3)); + + d->W(4 * i + 0) = t0; + d->W(4 * i + 1) = t1; + d->W(4 * i + 2) = t2; + d->W(4 * i + 3) = t3; + } + glue(clear_high, SUFFIX)(d, oprsz, maxsz); } #else -void helper_shufps(Reg *d, Reg *s, int order) +void glue(helper_pshuflw, SUFFIX)(Reg *d, Reg *a, uint32_t desc) { - Reg r; + const intptr_t oprsz = simd_oprsz(desc); + const intptr_t maxsz = simd_maxsz(desc); + const uint8_t ctrl = simd_data(desc); - r.L(0) = d->L(order & 3); - r.L(1) = d->L((order >> 2) & 3); - r.L(2) = s->L((order >> 4) & 3); - r.L(3) = s->L((order >> 6) & 3); - *d = r; + for (intptr_t i = 0; 8 * i * sizeof(uint16_t) < oprsz; ++i) { + const uint16_t t0 = a->W(8 * i + ((ctrl >> 0) & 3)); + const uint16_t t1 = a->W(8 * i + ((ctrl >> 2) & 3)); + const uint16_t t2 = a->W(8 * i + ((ctrl >> 4) & 3)); + const uint16_t t3 = a->W(8 * i + ((ctrl >> 6) & 3)); + + d->W(8 * i + 0) = t0; + d->W(8 * i + 1) = t1; + d->W(8 * i + 2) = t2; + d->W(8 * i + 3) = t3; + d->Q(2 * i + 1) = a->Q(2 * i + 1); + } + glue(clear_high, SUFFIX)(d, oprsz, maxsz); } -void helper_shufpd(Reg *d, Reg *s, int order) +void glue(helper_pshufhw, SUFFIX)(Reg *d, Reg *a, uint32_t desc) { - Reg r; + const intptr_t oprsz = simd_oprsz(desc); + const intptr_t maxsz = simd_maxsz(desc); + const uint8_t ctrl = simd_data(desc); + + for (intptr_t i = 0; 8 * i * sizeof(uint16_t) < oprsz; ++i) { + const uint16_t t0 = a->W(8 * i + 4 + ((ctrl >> 0) & 3)); + const uint16_t t1 = a->W(8 * i + 4 + ((ctrl >> 2) & 3)); + const uint16_t t2 = a->W(8 * i + 4 + ((ctrl >> 4) & 3)); + const uint16_t t3 = a->W(8 * i + 4 + ((ctrl >> 6) & 3)); - r.Q(0) = d->Q(order & 1); - r.Q(1) = s->Q((order >> 1) & 1); - *d = r; + d->Q(2 * i + 0) = a->Q(2 * i + 0); + d->W(8 * i + 4) = t0; + d->W(8 * i + 5) = t1; + d->W(8 * i + 6) = t2; + d->W(8 * i + 7) = t3; + } + glue(clear_high, SUFFIX)(d, oprsz, maxsz); } -void glue(helper_pshufd, SUFFIX)(Reg *d, Reg *s, int order) +void glue(helper_pshufd, SUFFIX)(Reg *d, Reg *a, uint32_t desc) { - Reg r; + const intptr_t oprsz = simd_oprsz(desc); + const intptr_t maxsz = simd_maxsz(desc); + const uint8_t ctrl = simd_data(desc); + + for (intptr_t i = 0; 4 * i * sizeof(uint32_t) < oprsz; ++i) { + const uint32_t t0 = a->L(4 * i + ((ctrl >> 0) & 3)); + const uint32_t t1 = a->L(4 * i + ((ctrl >> 2) & 3)); + const uint32_t t2 = a->L(4 * i + ((ctrl >> 4) & 3)); + const uint32_t t3 = a->L(4 * i + ((ctrl >> 6) & 3)); + + d->L(4 * i + 0) = t0; + d->L(4 * i + 1) = t1; + d->L(4 * i + 2) = t2; + d->L(4 * i + 3) = t3; - r.L(0) = s->L(order & 3); - r.L(1) = s->L((order >> 2) & 3); - r.L(2) = s->L((order >> 4) & 3); - r.L(3) = s->L((order >> 6) & 3); - *d = r; + } + glue(clear_high, SUFFIX)(d, oprsz, maxsz); } -void glue(helper_pshuflw, SUFFIX)(Reg *d, Reg *s, int order) +void glue(helper_shufps, SUFFIX)(Reg *d, Reg *a, Reg *b, uint32_t desc) { - Reg r; - - r.W(0) = s->W(order & 3); - r.W(1) = s->W((order >> 2) & 3); - r.W(2) = s->W((order >> 4) & 3); - r.W(3) = s->W((order >> 6) & 3); - r.Q(1) = s->Q(1); - *d = r; + const intptr_t oprsz = simd_oprsz(desc); + const intptr_t maxsz = simd_maxsz(desc); + const uint8_t ctrl = simd_data(desc); + + for (intptr_t i = 0; 4 * i * sizeof(uint32_t) < oprsz; ++i) { + const uint32_t t0 = a->L(4 * i + ((ctrl >> 0) & 3)); + const uint32_t t1 = a->L(4 * i + ((ctrl >> 2) & 3)); + const uint32_t t2 = b->L(4 * i + ((ctrl >> 4) & 3)); + const uint32_t t3 = b->L(4 * i + ((ctrl >> 6) & 3)); + + d->W(4 * i + 0) = t0; + d->W(4 * i + 1) = t1; + d->W(4 * i + 2) = t2; + d->W(4 * i + 3) = t3; + } + glue(clear_high, SUFFIX)(d, oprsz, maxsz); } -void glue(helper_pshufhw, SUFFIX)(Reg *d, Reg *s, int order) +void glue(helper_shufpd, SUFFIX)(Reg *d, Reg *a, Reg *b, uint32_t desc) { - Reg r; - - r.Q(0) = s->Q(0); - r.W(4) = s->W(4 + (order & 3)); - r.W(5) = s->W(4 + ((order >> 2) & 3)); - r.W(6) = s->W(4 + ((order >> 4) & 3)); - r.W(7) = s->W(4 + ((order >> 6) & 3)); - *d = r; + const intptr_t oprsz = simd_oprsz(desc); + const intptr_t maxsz = simd_maxsz(desc); + const uint8_t ctrl = simd_data(desc); + + for (intptr_t i = 0; 2 * i * sizeof(uint64_t) < oprsz; ++i) { + const uint64_t t0 = a->Q(2 * i + ((ctrl >> 0) & 1)); + const uint64_t t1 = b->Q(2 * i + ((ctrl >> 1) & 1)); + + d->Q(2 * i + 0) = t0; + d->Q(2 * i + 1) = t1; + } + glue(clear_high, SUFFIX)(d, oprsz, maxsz); } #endif diff --git a/target/i386/ops_sse_header.h b/target/i386/ops_sse_header.h index ee8bd4c1af..207d41e248 100644 --- a/target/i386/ops_sse_header.h +++ b/target/i386/ops_sse_header.h @@ -78,13 +78,13 @@ DEF_HELPER_4(glue(psadbw, SUFFIX), void, Reg, Reg, Reg, i32) DEF_HELPER_4(glue(maskmov, SUFFIX), void, env, Reg, Reg, tl) #if SHIFT == 0 -DEF_HELPER_3(glue(pshufw, SUFFIX), void, Reg, Reg, int) +DEF_HELPER_3(glue(pshufw, SUFFIX), void, Reg, Reg, i32) #else -DEF_HELPER_3(shufps, void, Reg, Reg, int) -DEF_HELPER_3(shufpd, void, Reg, Reg, int) -DEF_HELPER_3(glue(pshufd, SUFFIX), void, Reg, Reg, int) -DEF_HELPER_3(glue(pshuflw, SUFFIX), void, Reg, Reg, int) -DEF_HELPER_3(glue(pshufhw, SUFFIX), void, Reg, Reg, int) +DEF_HELPER_3(glue(pshuflw, SUFFIX), void, Reg, Reg, i32) +DEF_HELPER_3(glue(pshufhw, SUFFIX), void, Reg, Reg, i32) +DEF_HELPER_3(glue(pshufd, SUFFIX), void, Reg, Reg, i32) +DEF_HELPER_4(glue(shufps, SUFFIX), void, Reg, Reg, Reg, i32) +DEF_HELPER_4(glue(shufpd, SUFFIX), void, Reg, Reg, Reg, i32) #endif #if SHIFT == 1 diff --git a/target/i386/translate.c b/target/i386/translate.c index 3554086336..bb4120a848 100644 --- a/target/i386/translate.c +++ b/target/i386/translate.c @@ -2763,8 +2763,6 @@ static const SSEFunc_0_epp sse_op_table1[256][4] = { [0x5b] = { gen_helper_cvtdq2ps, gen_helper_cvtps2dq, gen_helper_cvttps2dq }, [0xc2] = SSE_FOP(cmpeq), - [0xc6] = { (SSEFunc_0_epp)gen_helper_shufps, - (SSEFunc_0_epp)gen_helper_shufpd }, /* XXX: casts */ /* SSSE3, SSE4, MOVBE, CRC32, BMI1, BMI2, ADX. */ [0x38] = { SSE_SPECIAL, SSE_SPECIAL, SSE_SPECIAL, SSE_SPECIAL }, @@ -6971,22 +6969,22 @@ DEF_GEN_INSN3_HELPER_EPP(pshufb, pshufb_mmx, Pq, Pq, Qq) DEF_GEN_INSN3_HELPER_EPP(pshufb, pshufb_xmm, Vdq, Vdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(vpshufb, pshufb_xmm, Vdq, Hdq, Wdq) DEF_GEN_INSN3_HELPER_EPP(vpshufb, pshufb_xmm, Vqq, Hqq, Wqq) -DEF_GEN_INSN3_HELPER_PPI(pshufw, pshufw_mmx, Pq, Qq, Ib) -DEF_GEN_INSN3_HELPER_PPI(pshuflw, pshuflw_xmm, Vdq, Wdq, Ib) -DEF_GEN_INSN3_HELPER_PPI(vpshuflw, pshuflw_xmm, Vdq, Wdq, Ib) -DEF_GEN_INSN3_HELPER_PPI(vpshuflw, pshuflw_xmm, Vqq, Wqq, Ib) -DEF_GEN_INSN3_HELPER_PPI(pshufhw, pshufhw_xmm, Vdq, Wdq, Ib) -DEF_GEN_INSN3_HELPER_PPI(vpshufhw, pshufhw_xmm, Vdq, Wdq, Ib) -DEF_GEN_INSN3_HELPER_PPI(vpshufhw, pshufhw_xmm, Vqq, Wqq, Ib) -DEF_GEN_INSN3_HELPER_PPI(pshufd, pshufd_xmm, Vdq, Wdq, Ib) -DEF_GEN_INSN3_HELPER_PPI(vpshufd, pshufd_xmm, Vdq, Wdq, Ib) -DEF_GEN_INSN3_HELPER_PPI(vpshufd, pshufd_xmm, Vqq, Wqq, Ib) -DEF_GEN_INSN4_HELPER_PPI(shufps, shufps, Vdq, Vdq, Wdq, Ib) -DEF_GEN_INSN4_HELPER_PPI(vshufps, shufps, Vdq, Hdq, Wdq, Ib) -DEF_GEN_INSN4_HELPER_PPI(vshufps, shufps, Vqq, Hqq, Wqq, Ib) -DEF_GEN_INSN4_HELPER_PPI(shufpd, shufpd, Vdq, Vdq, Wdq, Ib) -DEF_GEN_INSN4_HELPER_PPI(vshufpd, shufpd, Vdq, Hdq, Wdq, Ib) -DEF_GEN_INSN4_HELPER_PPI(vshufpd, shufpd, Vqq, Hqq, Wqq, Ib) +DEF_GEN_INSN3_GVEC(pshufw, Pq, Qq, Ib, 2i_ool, MM_OPRSZ, MM_MAXSZ, pshufw_mmx) +DEF_GEN_INSN3_GVEC(pshuflw, Vdq, Wdq, Ib, 2i_ool, XMM_OPRSZ, XMM_MAXSZ, pshuflw_xmm) +DEF_GEN_INSN3_GVEC(vpshuflw, Vdq, Wdq, Ib, 2i_ool, XMM_OPRSZ, XMM_MAXSZ, pshuflw_xmm) +DEF_GEN_INSN3_GVEC(vpshuflw, Vqq, Wqq, Ib, 2i_ool, XMM_OPRSZ, XMM_MAXSZ, pshuflw_xmm) +DEF_GEN_INSN3_GVEC(pshufhw, Vdq, Wdq, Ib, 2i_ool, XMM_OPRSZ, XMM_MAXSZ, pshufhw_xmm) +DEF_GEN_INSN3_GVEC(vpshufhw, Vdq, Wdq, Ib, 2i_ool, XMM_OPRSZ, XMM_MAXSZ, pshufhw_xmm) +DEF_GEN_INSN3_GVEC(vpshufhw, Vqq, Wqq, Ib, 2i_ool, XMM_OPRSZ, XMM_MAXSZ, pshufhw_xmm) +DEF_GEN_INSN3_GVEC(pshufd, Vdq, Wdq, Ib, 2i_ool, XMM_OPRSZ, XMM_MAXSZ, pshufd_xmm) +DEF_GEN_INSN3_GVEC(vpshufd, Vdq, Wdq, Ib, 2i_ool, XMM_OPRSZ, XMM_MAXSZ, pshufd_xmm) +DEF_GEN_INSN3_GVEC(vpshufd, Vqq, Wqq, Ib, 2i_ool, XMM_OPRSZ, XMM_MAXSZ, pshufd_xmm) +DEF_GEN_INSN4_GVEC(shufps, Vdq, Vdq, Wdq, Ib, 3i_ool, XMM_OPRSZ, XMM_MAXSZ, shufps_xmm) +DEF_GEN_INSN4_GVEC(vshufps, Vdq, Hdq, Wdq, Ib, 3i_ool, XMM_OPRSZ, XMM_MAXSZ, shufps_xmm) +DEF_GEN_INSN4_GVEC(vshufps, Vqq, Hqq, Wqq, Ib, 3i_ool, XMM_OPRSZ, XMM_MAXSZ, shufps_xmm) +DEF_GEN_INSN4_GVEC(shufpd, Vdq, Vdq, Wdq, Ib, 3i_ool, XMM_OPRSZ, XMM_MAXSZ, shufpd_xmm) +DEF_GEN_INSN4_GVEC(vshufpd, Vdq, Hdq, Wdq, Ib, 3i_ool, XMM_OPRSZ, XMM_MAXSZ, shufpd_xmm) +DEF_GEN_INSN4_GVEC(vshufpd, Vqq, Hqq, Wqq, Ib, 3i_ool, XMM_OPRSZ, XMM_MAXSZ, shufpd_xmm) DEF_GEN_INSN4_HELPER_EPPI(blendps, blendps_xmm, Vdq, Vdq, Wdq, Ib) DEF_GEN_INSN4_HELPER_EPPI(vblendps, blendps_xmm, Vdq, Hdq, Wdq, Ib) From patchwork Wed Aug 21 17:29:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Bobek X-Patchwork-Id: 11107877 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B8A0C1395 for ; Wed, 21 Aug 2019 18:28:37 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 806AC216F4 for ; Wed, 21 Aug 2019 18:28:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="FXabAak9" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 806AC216F4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:51700 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0VLY-0006RB-7o for patchwork-qemu-devel@patchwork.kernel.org; Wed, 21 Aug 2019 14:28:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41647) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0US3-0001z9-Jb for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:31:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i0US1-0000E0-BZ for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:31:15 -0400 Received: from mail-yb1-xb34.google.com ([2607:f8b0:4864:20::b34]:40558) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i0US1-0000DG-5B for qemu-devel@nongnu.org; Wed, 21 Aug 2019 13:31:13 -0400 Received: by mail-yb1-xb34.google.com with SMTP id g7so1339222ybd.7 for ; Wed, 21 Aug 2019 10:31:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=fdZNMW0ODVzKW35HMfdxnHfg1fmzHTFXd7vaL1DTdtQ=; b=FXabAak9SCw0KC45r1/ZRhKSatnKKOHSe7aEbCrgJaEa2an6j/2LB88eI4bglX8SUc hQ5ZpyzG8OzvGvhDjUVz0dYjOtUdfRrfVILCG7yWOspi3C1h8Q6kS/bn4QNnxKf3tf7I OLiij6jFslOmjkamUEz7FBRHgDvhX1OUi+O0lX/s5I+8gGD2oNjfnpy9k8LqH+uuuqQE FwmKxH1E6VfqaSMSe0QvFmjdMCOjofax7J7Wo5oGTlSD8heSS9+iRfeb3U2DqPNCrv4u om8/7IlgF65MDfXOtWHlbUCtdSJWb+9JeCA6G1WxcXEQRsEPkxmWLnGZxTs/kzkg9gXO xT2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=fdZNMW0ODVzKW35HMfdxnHfg1fmzHTFXd7vaL1DTdtQ=; b=UgJG8dxaWpufNz3oOUqYV2k/GbG8LSw2D37bYumCQ/hJ8Rt2UA6VFPkECa40LWO14q xlVIONOwB5gSJdHWyV1g9XYUnOu3+GiVMhuCShxGz65p42fRH+OXRzEI0VxiQWLyekCT 9h7ux00EPI1AxWpyWJEfmtNL7qF55P12omOL2jj8dh6Sr10LhEeBLq1SbWx1l37KMuDl Z9udDOBzdk4kzcVLdGgTcrZ+u7tInxvAZ+t79oNbPZs7OxE4+8wY1vMKDz8hTSCl1egM S6GHe7F+M8mO6wVhTYXR/uRCrlBgHC9m+ir0HRQkc/njPpKDhDJ3jWZ30T6qoy9vqMfo sNtg== X-Gm-Message-State: APjAAAU3vsPxMz8SrbW9FZ6UTV8u1vroYN5ajS4b6EHcvys9QsE0VbeZ D/l+6imr8+FIdtAPjwJbGMkXTVvE X-Google-Smtp-Source: APXvYqzF6qEX9X3iGXm2BO34dRrPs/KoMRkZGYjPtZiuOJrJiWNConU4HUH1sYq7iPLDX2TlrBAgtA== X-Received: by 2002:a25:216:: with SMTP id 22mr23796905ybc.188.1566408672323; Wed, 21 Aug 2019 10:31:12 -0700 (PDT) Received: from localhost.localdomain ([2601:c0:c67f:e390::3]) by smtp.gmail.com with ESMTPSA id l71sm2826167ywl.39.2019.08.21.10.31.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Aug 2019 10:31:11 -0700 (PDT) From: Jan Bobek To: qemu-devel@nongnu.org Date: Wed, 21 Aug 2019 13:29:51 -0400 Message-Id: <20190821172951.15333-76-jan.bobek@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190821172951.15333-1-jan.bobek@gmail.com> References: <20190821172951.15333-1-jan.bobek@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::b34 Subject: [Qemu-devel] [RFC PATCH v4 75/75] target/i386: convert pmovmskb/movmskps/movmskpd helpers to gvec style X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jan Bobek , =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Make these helpers suitable for use with tcg_gen_gvec_* functions. Signed-off-by: Jan Bobek --- target/i386/ops_sse.h | 74 ++++++++++---------- target/i386/ops_sse_header.h | 9 ++- target/i386/translate.c | 132 ++++++----------------------------- 3 files changed, 65 insertions(+), 150 deletions(-) diff --git a/target/i386/ops_sse.h b/target/i386/ops_sse.h index 2e50d91a25..82562c9473 100644 --- a/target/i386/ops_sse.h +++ b/target/i386/ops_sse.h @@ -1169,52 +1169,56 @@ void helper_comisd(CPUX86State *env, Reg *d, Reg *s) CC_SRC = comis_eflags[ret + 1]; } -uint32_t helper_movmskps(CPUX86State *env, Reg *s) +uint32_t helper_movmskpsd(Reg *a, uint32_t desc) { - int b0, b1, b2, b3; + const intptr_t oprsz = simd_oprsz(desc); - b0 = s->ZMM_L(0) >> 31; - b1 = s->ZMM_L(1) >> 31; - b2 = s->ZMM_L(2) >> 31; - b3 = s->ZMM_L(3) >> 31; - return b0 | (b1 << 1) | (b2 << 2) | (b3 << 3); + uint32_t ret = 0; + for (intptr_t i = 0; i * sizeof(uint32_t) < oprsz; ++i) { + const uint32_t t = a->ZMM_L(i) & (1UL << 31); + ret |= t >> (31 - i); + } + return ret; } -uint32_t helper_movmskpd(CPUX86State *env, Reg *s) +uint64_t helper_movmskpsq(Reg *a, uint32_t desc) { - int b0, b1; + return helper_movmskpsd(a, desc); +} + +uint32_t helper_movmskpdd(Reg *a, uint32_t desc) +{ + const intptr_t oprsz = simd_oprsz(desc); - b0 = s->ZMM_L(1) >> 31; - b1 = s->ZMM_L(3) >> 31; - return b0 | (b1 << 1); + uint32_t ret = 0; + for (intptr_t i = 0; i * sizeof(uint64_t) < oprsz; ++i) { + const uint64_t t = a->ZMM_Q(i) & (1ULL << 63); + ret |= t >> (63 - i); + } + return ret; } +uint64_t helper_movmskpdq(Reg *a, uint32_t desc) +{ + return helper_movmskpdd(a, desc); +} #endif -uint32_t glue(helper_pmovmskb, SUFFIX)(CPUX86State *env, Reg *s) +uint32_t glue(helper_pmovmskbd, SUFFIX)(Reg *a, uint32_t desc) { - uint32_t val; - - val = 0; - val |= (s->B(0) >> 7); - val |= (s->B(1) >> 6) & 0x02; - val |= (s->B(2) >> 5) & 0x04; - val |= (s->B(3) >> 4) & 0x08; - val |= (s->B(4) >> 3) & 0x10; - val |= (s->B(5) >> 2) & 0x20; - val |= (s->B(6) >> 1) & 0x40; - val |= (s->B(7)) & 0x80; -#if SHIFT == 1 - val |= (s->B(8) << 1) & 0x0100; - val |= (s->B(9) << 2) & 0x0200; - val |= (s->B(10) << 3) & 0x0400; - val |= (s->B(11) << 4) & 0x0800; - val |= (s->B(12) << 5) & 0x1000; - val |= (s->B(13) << 6) & 0x2000; - val |= (s->B(14) << 7) & 0x4000; - val |= (s->B(15) << 8) & 0x8000; -#endif - return val; + const intptr_t oprsz = simd_oprsz(desc); + + uint32_t ret = 0; + for (intptr_t i = 0; i * sizeof(uint8_t) < oprsz; ++i) { + const uint8_t t = a->B(i) & (1 << 7); + ret |= i < 8 ? t >> (7 - i) : t << (i - 7); + } + return ret; +} + +uint64_t glue(helper_pmovmskbq, SUFFIX)(Reg *a, uint32_t desc) +{ + return glue(helper_pmovmskbd, SUFFIX)(a, desc); } void glue(helper_packsswb, SUFFIX)(CPUX86State *env, Reg *d, Reg *s) diff --git a/target/i386/ops_sse_header.h b/target/i386/ops_sse_header.h index 207d41e248..59ac1f28e3 100644 --- a/target/i386/ops_sse_header.h +++ b/target/i386/ops_sse_header.h @@ -178,11 +178,14 @@ DEF_HELPER_3(ucomiss, void, env, Reg, Reg) DEF_HELPER_3(comiss, void, env, Reg, Reg) DEF_HELPER_3(ucomisd, void, env, Reg, Reg) DEF_HELPER_3(comisd, void, env, Reg, Reg) -DEF_HELPER_2(movmskps, i32, env, Reg) -DEF_HELPER_2(movmskpd, i32, env, Reg) +DEF_HELPER_2(movmskpsd, i32, Reg, i32) +DEF_HELPER_2(movmskpsq, i64, Reg, i32) +DEF_HELPER_2(movmskpdd, i32, Reg, i32) +DEF_HELPER_2(movmskpdq, i64, Reg, i32) #endif -DEF_HELPER_2(glue(pmovmskb, SUFFIX), i32, env, Reg) +DEF_HELPER_2(glue(pmovmskbd, SUFFIX), i32, Reg, i32) +DEF_HELPER_2(glue(pmovmskbq, SUFFIX), i64, Reg, i32) DEF_HELPER_3(glue(packsswb, SUFFIX), void, env, Reg, Reg) DEF_HELPER_3(glue(packuswb, SUFFIX), void, env, Reg, Reg) DEF_HELPER_3(glue(packssdw, SUFFIX), void, env, Reg, Reg) diff --git a/target/i386/translate.c b/target/i386/translate.c index bb4120a848..8f891b6e47 100644 --- a/target/i386/translate.c +++ b/target/i386/translate.c @@ -3339,20 +3339,6 @@ static void gen_sse(CPUX86State *env, DisasContext *s, int b) goto illegal_op; } break; - case 0x050: /* movmskps */ - rm = (modrm & 7) | REX_B(s); - tcg_gen_addi_ptr(s->ptr0, cpu_env, - offsetof(CPUX86State,xmm_regs[rm])); - gen_helper_movmskps(s->tmp2_i32, cpu_env, s->ptr0); - tcg_gen_extu_i32_tl(cpu_regs[reg], s->tmp2_i32); - break; - case 0x150: /* movmskpd */ - rm = (modrm & 7) | REX_B(s); - tcg_gen_addi_ptr(s->ptr0, cpu_env, - offsetof(CPUX86State,xmm_regs[rm])); - gen_helper_movmskpd(s->tmp2_i32, cpu_env, s->ptr0); - tcg_gen_extu_i32_tl(cpu_regs[reg], s->tmp2_i32); - break; case 0x02a: /* cvtpi2ps */ case 0x12a: /* cvtpi2pd */ gen_helper_enter_mmx(cpu_env); @@ -3524,24 +3510,6 @@ static void gen_sse(CPUX86State *env, DisasContext *s, int b) gen_op_movq(s, offsetof(CPUX86State, fpregs[reg & 7].mmx), offsetof(CPUX86State,xmm_regs[rm].ZMM_Q(0))); break; - case 0xd7: /* pmovmskb */ - case 0x1d7: - if (mod != 3) - goto illegal_op; - if (b1) { - rm = (modrm & 7) | REX_B(s); - tcg_gen_addi_ptr(s->ptr0, cpu_env, - offsetof(CPUX86State, xmm_regs[rm])); - gen_helper_pmovmskb_xmm(s->tmp2_i32, cpu_env, s->ptr0); - } else { - rm = (modrm & 7); - tcg_gen_addi_ptr(s->ptr0, cpu_env, - offsetof(CPUX86State, fpregs[rm].mmx)); - gen_helper_pmovmskb_mmx(s->tmp2_i32, cpu_env, s->ptr0); - } - reg = ((modrm >> 3) & 7) | REX_R(s); - tcg_gen_extu_i32_tl(cpu_regs[reg], s->tmp2_i32); - break; case 0x138: case 0x038: @@ -5773,88 +5741,28 @@ GEN_INSN2(vmovhpd, Mq, Vdq) gen_insn2(movhpd, Mq, Vdq)(env, s, arg1, arg2); } -DEF_GEN_INSN2_HELPER_DEP(pmovmskb, pmovmskb_mmx, Gd, Nq) -GEN_INSN2(pmovmskb, Gq, Nq) -{ - const TCGv_i32 arg1_r32 = tcg_temp_new_i32(); - gen_insn2(pmovmskb, Gd, Nq)(env, s, arg1_r32, arg2); - tcg_gen_extu_i32_i64(arg1, arg1_r32); - tcg_temp_free_i32(arg1_r32); -} -DEF_GEN_INSN2_HELPER_DEP(pmovmskb, pmovmskb_xmm, Gd, Udq) -GEN_INSN2(pmovmskb, Gq, Udq) -{ - const TCGv_i32 arg1_r32 = tcg_temp_new_i32(); - gen_insn2(pmovmskb, Gd, Udq)(env, s, arg1_r32, arg2); - tcg_gen_extu_i32_i64(arg1, arg1_r32); - tcg_temp_free_i32(arg1_r32); -} -DEF_GEN_INSN2_HELPER_DEP(vpmovmskb, pmovmskb_xmm, Gd, Udq) -GEN_INSN2(vpmovmskb, Gq, Udq) -{ - const TCGv_i32 arg1_r32 = tcg_temp_new_i32(); - gen_insn2(vpmovmskb, Gd, Udq)(env, s, arg1_r32, arg2); - tcg_gen_extu_i32_i64(arg1, arg1_r32); - tcg_temp_free_i32(arg1_r32); -} -DEF_GEN_INSN2_HELPER_DEP(vpmovmskb, pmovmskb_xmm, Gd, Uqq) -GEN_INSN2(vpmovmskb, Gq, Uqq) -{ - const TCGv_i32 arg1_r32 = tcg_temp_new_i32(); - gen_insn2(vpmovmskb, Gd, Uqq)(env, s, arg1_r32, arg2); - tcg_gen_extu_i32_i64(arg1, arg1_r32); - tcg_temp_free_i32(arg1_r32); -} +DEF_GEN_INSN2_GVEC(pmovmskb, Gd, Nq, sd1_ool, MM_OPRSZ, MM_MAXSZ, pmovmskbd_mmx) +DEF_GEN_INSN2_GVEC(pmovmskb, Gq, Nq, sq1_ool, MM_OPRSZ, MM_MAXSZ, pmovmskbq_mmx) +DEF_GEN_INSN2_GVEC(pmovmskb, Gd, Udq, sd1_ool, XMM_OPRSZ, XMM_MAXSZ, pmovmskbd_xmm) +DEF_GEN_INSN2_GVEC(pmovmskb, Gq, Udq, sq1_ool, XMM_OPRSZ, XMM_MAXSZ, pmovmskbq_xmm) +DEF_GEN_INSN2_GVEC(vpmovmskb, Gd, Udq, sd1_ool, XMM_OPRSZ, XMM_MAXSZ, pmovmskbd_xmm) +DEF_GEN_INSN2_GVEC(vpmovmskb, Gq, Udq, sq1_ool, XMM_OPRSZ, XMM_MAXSZ, pmovmskbq_xmm) +DEF_GEN_INSN2_GVEC(vpmovmskb, Gd, Uqq, sd1_ool, XMM_OPRSZ, XMM_MAXSZ, pmovmskbd_xmm) +DEF_GEN_INSN2_GVEC(vpmovmskb, Gq, Uqq, sq1_ool, XMM_OPRSZ, XMM_MAXSZ, pmovmskbq_xmm) -DEF_GEN_INSN2_HELPER_DEP(movmskps, movmskps, Gd, Udq) -GEN_INSN2(movmskps, Gq, Udq) -{ - const TCGv_i32 arg1_r32 = tcg_temp_new_i32(); - gen_insn2(movmskps, Gd, Udq)(env, s, arg1_r32, arg2); - tcg_gen_extu_i32_i64(arg1, arg1_r32); - tcg_temp_free_i32(arg1_r32); -} -DEF_GEN_INSN2_HELPER_DEP(vmovmskps, movmskps, Gd, Udq) -GEN_INSN2(vmovmskps, Gq, Udq) -{ - const TCGv_i32 arg1_r32 = tcg_temp_new_i32(); - gen_insn2(vmovmskps, Gd, Udq)(env, s, arg1_r32, arg2); - tcg_gen_extu_i32_i64(arg1, arg1_r32); - tcg_temp_free_i32(arg1_r32); -} -DEF_GEN_INSN2_HELPER_DEP(vmovmskps, movmskps, Gd, Uqq) -GEN_INSN2(vmovmskps, Gq, Uqq) -{ - const TCGv_i32 arg1_r32 = tcg_temp_new_i32(); - gen_insn2(vmovmskps, Gd, Uqq)(env, s, arg1_r32, arg2); - tcg_gen_extu_i32_i64(arg1, arg1_r32); - tcg_temp_free_i32(arg1_r32); -} +DEF_GEN_INSN2_GVEC(movmskps, Gd, Udq, sd1_ool, XMM_OPRSZ, XMM_MAXSZ, movmskpsd) +DEF_GEN_INSN2_GVEC(movmskps, Gq, Udq, sq1_ool, XMM_OPRSZ, XMM_MAXSZ, movmskpsq) +DEF_GEN_INSN2_GVEC(vmovmskps, Gd, Udq, sd1_ool, XMM_OPRSZ, XMM_MAXSZ, movmskpsd) +DEF_GEN_INSN2_GVEC(vmovmskps, Gq, Udq, sq1_ool, XMM_OPRSZ, XMM_MAXSZ, movmskpsq) +DEF_GEN_INSN2_GVEC(vmovmskps, Gd, Uqq, sd1_ool, XMM_OPRSZ, XMM_MAXSZ, movmskpsd) +DEF_GEN_INSN2_GVEC(vmovmskps, Gq, Uqq, sq1_ool, XMM_OPRSZ, XMM_MAXSZ, movmskpsq) -DEF_GEN_INSN2_HELPER_DEP(movmskpd, movmskpd, Gd, Udq) -GEN_INSN2(movmskpd, Gq, Udq) -{ - const TCGv_i32 arg1_r32 = tcg_temp_new_i32(); - gen_insn2(movmskpd, Gd, Udq)(env, s, arg1_r32, arg2); - tcg_gen_extu_i32_i64(arg1, arg1_r32); - tcg_temp_free_i32(arg1_r32); -} -DEF_GEN_INSN2_HELPER_DEP(vmovmskpd, movmskpd, Gd, Udq) -GEN_INSN2(vmovmskpd, Gq, Udq) -{ - const TCGv_i32 arg1_r32 = tcg_temp_new_i32(); - gen_insn2(vmovmskpd, Gd, Udq)(env, s, arg1_r32, arg2); - tcg_gen_extu_i32_i64(arg1, arg1_r32); - tcg_temp_free_i32(arg1_r32); -} -DEF_GEN_INSN2_HELPER_DEP(vmovmskpd, movmskpd, Gd, Uqq) -GEN_INSN2(vmovmskpd, Gq, Uqq) -{ - const TCGv_i32 arg1_r32 = tcg_temp_new_i32(); - gen_insn2(vmovmskpd, Gd, Uqq)(env, s, arg1_r32, arg2); - tcg_gen_extu_i32_i64(arg1, arg1_r32); - tcg_temp_free_i32(arg1_r32); -} +DEF_GEN_INSN2_GVEC(movmskpd, Gd, Udq, sd1_ool, XMM_OPRSZ, XMM_MAXSZ, movmskpdd) +DEF_GEN_INSN2_GVEC(movmskpd, Gq, Udq, sq1_ool, XMM_OPRSZ, XMM_MAXSZ, movmskpdq) +DEF_GEN_INSN2_GVEC(vmovmskpd, Gd, Udq, sd1_ool, XMM_OPRSZ, XMM_MAXSZ, movmskpdd) +DEF_GEN_INSN2_GVEC(vmovmskpd, Gq, Udq, sq1_ool, XMM_OPRSZ, XMM_MAXSZ, movmskpdq) +DEF_GEN_INSN2_GVEC(vmovmskpd, Gd, Uqq, sd1_ool, XMM_OPRSZ, XMM_MAXSZ, movmskpdd) +DEF_GEN_INSN2_GVEC(vmovmskpd, Gq, Uqq, sq1_ool, XMM_OPRSZ, XMM_MAXSZ, movmskpdq) GEN_INSN2(lddqu, Vdq, Mdq) {