[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 09/42] i386: Helper macro for 256 bit AVX helpers
From: |
Paul Brook |
Subject: |
[PATCH v2 09/42] i386: Helper macro for 256 bit AVX helpers |
Date: |
Sun, 24 Apr 2022 23:01:31 +0100 |
Once all the code is in place, 256 bit vector helpers will be generated by
including ops_sse.h a third time with SHIFT=2.
The first bit of support for this is to define a YMM_ONLY macro for code that
only apples to 256 bit vectors. XXM_ONLY code will be executed for both
128 and 256 bit vectors.
Signed-off-by: Paul Brook <paul@nowt.org>
---
target/i386/ops_sse.h | 8 ++++++++
target/i386/ops_sse_header.h | 4 ++++
2 files changed, 12 insertions(+)
diff --git a/target/i386/ops_sse.h b/target/i386/ops_sse.h
index a5a48a20f6..23daab6b50 100644
--- a/target/i386/ops_sse.h
+++ b/target/i386/ops_sse.h
@@ -24,6 +24,7 @@
#define Reg MMXReg
#define SIZE 8
#define XMM_ONLY(...)
+#define YMM_ONLY(...)
#define B(n) MMX_B(n)
#define W(n) MMX_W(n)
#define L(n) MMX_L(n)
@@ -37,7 +38,13 @@
#define W(n) ZMM_W(n)
#define L(n) ZMM_L(n)
#define Q(n) ZMM_Q(n)
+#if SHIFT == 1
#define SUFFIX _xmm
+#define YMM_ONLY(...)
+#else
+#define SUFFIX _ymm
+#define YMM_ONLY(...) __VA_ARGS__
+#endif
#endif
/*
@@ -2337,6 +2344,7 @@ void glue(helper_aeskeygenassist, SUFFIX)(CPUX86State
*env, Reg *d, Reg *s,
#undef SHIFT
#undef XMM_ONLY
+#undef YMM_ONLY
#undef Reg
#undef B
#undef W
diff --git a/target/i386/ops_sse_header.h b/target/i386/ops_sse_header.h
index cef28f2aae..7e7f2cee2a 100644
--- a/target/i386/ops_sse_header.h
+++ b/target/i386/ops_sse_header.h
@@ -21,7 +21,11 @@
#define SUFFIX _mmx
#else
#define Reg ZMMReg
+#if SHIFT == 1
#define SUFFIX _xmm
+#else
+#define SUFFIX _ymm
+#endif
#endif
#define dh_alias_Reg ptr
--
2.36.0
- [PATCH 4/4] AVX tests, (continued)
- [PATCH 4/4] AVX tests, Paul Brook, 2022/04/18
- [PATCH v2 01/42] i386: pcmpestr 64-bit sign extension bug, Paul Brook, 2022/04/24
- [PATCH v2 06/42] i386: Add CHECK_NO_VEX, Paul Brook, 2022/04/24
- [PATCH v2 02/42] i386: DPPS rounding fix, Paul Brook, 2022/04/24
- [PATCH v2 09/42] i386: Helper macro for 256 bit AVX helpers,
Paul Brook <=
- [PATCH v2 07/42] Enforce VEX encoding restrictions, Paul Brook, 2022/04/24
- [PATCH v2 08/42] i386: Add ZMM_OFFSET macro, Paul Brook, 2022/04/24
- [PATCH v2 04/42] i386: Rework sse_op_table1, Paul Brook, 2022/04/24
- [PATCH v2 05/42] i386: Rework sse_op_table6/7, Paul Brook, 2022/04/24
- [PATCH v2 03/42] Add AVX_EN hflag, Paul Brook, 2022/04/24