[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 09/20] tcg/i386: Implement avx512 scalar shift
From: |
Richard Henderson |
Subject: |
[PATCH 09/20] tcg/i386: Implement avx512 scalar shift |
Date: |
Sat, 18 Dec 2021 11:42:39 -0800 |
AVX512VL has VPSRAQ.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
tcg/i386/tcg-target.c.inc | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/tcg/i386/tcg-target.c.inc b/tcg/i386/tcg-target.c.inc
index 7b9302fcc2..69481c188c 100644
--- a/tcg/i386/tcg-target.c.inc
+++ b/tcg/i386/tcg-target.c.inc
@@ -368,6 +368,7 @@ static bool tcg_target_const_match(int64_t val, TCGType
type, int ct)
#define OPC_PSLLQ (0xf3 | P_EXT | P_DATA16)
#define OPC_PSRAW (0xe1 | P_EXT | P_DATA16)
#define OPC_PSRAD (0xe2 | P_EXT | P_DATA16)
+#define OPC_VPSRAQ (0x72 | P_EXT | P_DATA16 | P_VEXW | P_EVEX)
#define OPC_PSRLW (0xd1 | P_EXT | P_DATA16)
#define OPC_PSRLD (0xd2 | P_EXT | P_DATA16)
#define OPC_PSRLQ (0xd3 | P_EXT | P_DATA16)
@@ -2761,7 +2762,7 @@ static void tcg_out_vec_op(TCGContext *s, TCGOpcode opc,
OPC_UD2, OPC_PSRLW, OPC_PSRLD, OPC_PSRLQ
};
static int const sars_insn[4] = {
- OPC_UD2, OPC_PSRAW, OPC_PSRAD, OPC_UD2
+ OPC_UD2, OPC_PSRAW, OPC_PSRAD, OPC_VPSRAQ
};
static int const abs_insn[4] = {
/* TODO: AVX512 adds support for MO_64. */
@@ -3237,7 +3238,14 @@ int tcg_can_emit_vec_op(TCGOpcode opc, TCGType type,
unsigned vece)
case INDEX_op_shrs_vec:
return vece >= MO_16;
case INDEX_op_sars_vec:
- return vece >= MO_16 && vece <= MO_32;
+ switch (vece) {
+ case MO_16:
+ case MO_32:
+ return 1;
+ case MO_64:
+ return have_avx512vl;
+ }
+ return 0;
case INDEX_op_rotls_vec:
return vece >= MO_16 ? -1 : 0;
--
2.25.1
- [PATCH 04/20] tcg/s390x: Implement vector NAND, NOR, EQV, (continued)
- [PATCH 04/20] tcg/s390x: Implement vector NAND, NOR, EQV, Richard Henderson, 2021/12/18
- [PATCH 02/20] tcg: Add opcodes for vector nand, nor, eqv, Richard Henderson, 2021/12/18
- [PATCH 03/20] tcg/ppc: Implement vector NAND, NOR, EQV, Richard Henderson, 2021/12/18
- [PATCH 05/20] tcg/i386: Detect AVX512, Richard Henderson, 2021/12/18
- [PATCH 06/20] tcg/i386: Add tcg_out_evex_opc, Richard Henderson, 2021/12/18
- [PATCH 07/20] tcg/i386: Use tcg_can_emit_vec_op in expand_vec_cmp_noinv, Richard Henderson, 2021/12/18
- [PATCH 08/20] tcg/i386: Implement avx512 variable shifts, Richard Henderson, 2021/12/18
- [PATCH 09/20] tcg/i386: Implement avx512 scalar shift,
Richard Henderson <=
- [PATCH 11/20] tcg/i386: Implement avx512 immediate rotate, Richard Henderson, 2021/12/18
- [PATCH 13/20] tcg/i386: Support avx512vbmi2 vector shift-double instructions, Richard Henderson, 2021/12/18
- [PATCH 10/20] tcg/i386: Implement avx512 immediate sari shift, Richard Henderson, 2021/12/18
- [PATCH 12/20] tcg/i386: Implement avx512 variable rotate, Richard Henderson, 2021/12/18
- [PATCH 15/20] tcg/i386: Remove rotls_vec from tcg_target_op_def, Richard Henderson, 2021/12/18
- [PATCH 14/20] tcg/i386: Expand vector word rotate as avx512vbmi2 shift-double, Richard Henderson, 2021/12/18
- [PATCH 19/20] tcg/i386: Implement more logical operations for avx512, Richard Henderson, 2021/12/18
- [PATCH 17/20] tcg/i386: Implement avx512 min/max/abs, Richard Henderson, 2021/12/18
- [PATCH 18/20] tcg/i386: Implement avx512 multiply, Richard Henderson, 2021/12/18
- [PATCH 20/20] tcg/i386: Implement bitsel for avx512, Richard Henderson, 2021/12/18