[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [RFC PATCH v4 09/75] target/i386: make variable is_xmm cons
From: |
Jan Bobek |
Subject: |
[Qemu-devel] [RFC PATCH v4 09/75] target/i386: make variable is_xmm const |
Date: |
Wed, 21 Aug 2019 13:28:45 -0400 |
The variable is_xmm does not change value after assignment, so make
this fact explicit by marking it const.
Reviewed-by: Richard Henderson <address@hidden>
Signed-off-by: Jan Bobek <address@hidden>
---
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);
--
2.20.1
- [Qemu-devel] [RFC PATCH v4 00/75] rewrite MMX/SSE*/AVX/AVX2 vector instruction translation, Jan Bobek, 2019/08/21
- [Qemu-devel] [RFC PATCH v4 02/75] target/i386: Push rex_w into DisasContext, Jan Bobek, 2019/08/21
- [Qemu-devel] [RFC PATCH v4 01/75] target/i386: Push rex_r into DisasContext, Jan Bobek, 2019/08/21
- [Qemu-devel] [RFC PATCH v4 04/75] target/i386: use prefix from DisasContext, Jan Bobek, 2019/08/21
- [Qemu-devel] [RFC PATCH v4 03/75] target/i386: use dflag from DisasContext, Jan Bobek, 2019/08/21
- [Qemu-devel] [RFC PATCH v4 11/75] target/i386: introduce gen_sse_ng, Jan Bobek, 2019/08/21
- [Qemu-devel] [RFC PATCH v4 10/75] target/i386: add vector register file alignment constraints, Jan Bobek, 2019/08/21
- [Qemu-devel] [RFC PATCH v4 09/75] target/i386: make variable is_xmm const,
Jan Bobek <=
- [Qemu-devel] [RFC PATCH v4 12/75] target/i386: introduce CASES_* macros in gen_sse_ng, Jan Bobek, 2019/08/21
- [Qemu-devel] [RFC PATCH v4 05/75] target/i386: introduce disas_insn_prefix, Jan Bobek, 2019/08/21
- [Qemu-devel] [RFC PATCH v4 13/75] target/i386: decode the 0F38/0F3A prefix in gen_sse_ng, Jan Bobek, 2019/08/21
- [Qemu-devel] [RFC PATCH v4 06/75] target/i386: Simplify gen_exception arguments, Jan Bobek, 2019/08/21
- [Qemu-devel] [RFC PATCH v4 08/75] target/i386: make variable b1 const, Jan Bobek, 2019/08/21
- [Qemu-devel] [RFC PATCH v4 07/75] target/i386: use pc_start from DisasContext, Jan Bobek, 2019/08/21
- [Qemu-devel] [RFC PATCH v4 16/75] target/i386: disable AVX/AVX2 cpuid bitchecks, Jan Bobek, 2019/08/21
- [Qemu-devel] [RFC PATCH v4 14/75] target/i386: introduce aliases for some tcg_gvec operations, Jan Bobek, 2019/08/21
- [Qemu-devel] [RFC PATCH v4 15/75] target/i386: introduce function check_cpuid, Jan Bobek, 2019/08/21
- [Qemu-devel] [RFC PATCH v4 19/75] target/i386: introduce generic either-or operand, Jan Bobek, 2019/08/21