[Qemu-devel] [RFC PATCH v3 00/46] rewrite MMX/SSE/SSE2/SSE3 instruction translation

Jan Bobek posted 46 patches 4 years, 8 months ago
Test FreeBSD passed
Test docker-mingw@fedora passed
Test asan passed
Test docker-clang@ubuntu passed
Test checkpatch failed
Test s390x failed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20190815020928.9679-1-jan.bobek@gmail.com
Maintainers: Eduardo Habkost <ehabkost@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>, Richard Henderson <rth@twiddle.net>
target/i386/cpu.h            |    6 +-
target/i386/sse-opcode.inc.h |  699 +++++++++
target/i386/translate.c      | 2808 ++++++++++++++++++++++++++++++----
3 files changed, 3189 insertions(+), 324 deletions(-)
create mode 100644 target/i386/sse-opcode.inc.h
[Qemu-devel] [RFC PATCH v3 00/46] rewrite MMX/SSE/SSE2/SSE3 instruction translation
Posted by Jan Bobek 4 years, 8 months ago
The previous version can be found at [1]. Changes compared to v2:

  - Expanded the instruction operand infrastructure a bit; I am now
    fairly confident that it is powerful enough to accommodate for all
    the use cases I will need. It's still a bit clunky to work with at
    times, but I am happy with it for now.

  - Reduced the number of various INSN_* (now called OPCODE_*) macro
    variants using variadic macros.

  - Implemented translation for instructions up to SSE3.

Cheers,
 -Jan

References:
  1. https://lists.nongnu.org/archive/html/qemu-devel/2019-08/msg01790.html

Jan Bobek (43):
  target/i386: reduce scope of variable aflag
  target/i386: use dflag from DisasContext
  target/i386: use prefix from DisasContext
  target/i386: use pc_start from DisasContext
  target/i386: make variable b1 const
  target/i386: make variable is_xmm const
  target/i386: add vector register file alignment constraints
  target/i386: introduce gen_(ld,st)d_env_A0
  target/i386: introduce gen_sse_ng
  target/i386: disable unused function warning temporarily
  target/i386: introduce mnemonic aliases for several gvec operations
  target/i386: introduce function ck_cpuid
  target/i386: introduce instruction operand infrastructure
  target/i386: introduce generic operand alias
  target/i386: introduce generic either-or operand
  target/i386: introduce generic load-store operand
  target/i386: introduce tcg_temp operands
  target/i386: introduce modrm operand
  target/i386: introduce operands for decoding modrm fields
  target/i386: introduce operand for direct-only r/m field
  target/i386: introduce operand vex_v
  target/i386: introduce Ib (immediate) operand
  target/i386: introduce M* (memptr) operands
  target/i386: introduce G*, R*, E* (general register) operands
  target/i386: introduce P*, N*, Q* (MMX) operands
  target/i386: introduce H*, V*, U*, W* (SSE/AVX) operands
  target/i386: introduce code generators
  target/i386: introduce helper-based code generator macros
  target/i386: introduce gvec-based code generator macros
  target/i386: introduce sse-opcode.inc.h
  target/i386: introduce instruction translator macros
  target/i386: introduce MMX translators
  target/i386: introduce MMX code generators
  target/i386: introduce MMX instructions to sse-opcode.inc.h
  target/i386: introduce SSE translators
  target/i386: introduce SSE code generators
  target/i386: introduce SSE instructions to sse-opcode.inc.h
  target/i386: introduce SSE2 translators
  target/i386: introduce SSE2 code generators
  target/i386: introduce SSE2 instructions to sse-opcode.inc.h
  target/i386: introduce SSE3 translators
  target/i386: introduce SSE3 code generators
  target/i386: introduce SSE3 instructions to sse-opcode.inc.h

Richard Henderson (3):
  target/i386: Push rex_r into DisasContext
  target/i386: Push rex_w into DisasContext
  target/i386: Simplify gen_exception arguments

 target/i386/cpu.h            |    6 +-
 target/i386/sse-opcode.inc.h |  699 +++++++++
 target/i386/translate.c      | 2808 ++++++++++++++++++++++++++++++----
 3 files changed, 3189 insertions(+), 324 deletions(-)
 create mode 100644 target/i386/sse-opcode.inc.h

-- 
2.20.1


Re: [Qemu-devel] [RFC PATCH v3 00/46] rewrite MMX/SSE/SSE2/SSE3 instruction translation
Posted by no-reply@patchew.org 4 years, 8 months ago
Patchew URL: https://patchew.org/QEMU/20190815020928.9679-1-jan.bobek@gmail.com/



Hi,

This series seems to have some coding style problems. See output below for
more information:

Subject: [Qemu-devel] [RFC PATCH v3 00/46] rewrite MMX/SSE/SSE2/SSE3 instruction translation
Message-id: 20190815020928.9679-1-jan.bobek@gmail.com
Type: series

=== TEST SCRIPT BEGIN ===
#!/bin/bash
git rev-parse base > /dev/null || exit 0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram
./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
From https://github.com/patchew-project/qemu
 * [new tag]         patchew/20190815020928.9679-1-jan.bobek@gmail.com -> patchew/20190815020928.9679-1-jan.bobek@gmail.com
Submodule 'capstone' (https://git.qemu.org/git/capstone.git) registered for path 'capstone'
Submodule 'dtc' (https://git.qemu.org/git/dtc.git) registered for path 'dtc'
Submodule 'roms/QemuMacDrivers' (https://git.qemu.org/git/QemuMacDrivers.git) registered for path 'roms/QemuMacDrivers'
Submodule 'roms/SLOF' (https://git.qemu.org/git/SLOF.git) registered for path 'roms/SLOF'
Submodule 'roms/edk2' (https://git.qemu.org/git/edk2.git) registered for path 'roms/edk2'
Submodule 'roms/ipxe' (https://git.qemu.org/git/ipxe.git) registered for path 'roms/ipxe'
Submodule 'roms/openbios' (https://git.qemu.org/git/openbios.git) registered for path 'roms/openbios'
Submodule 'roms/openhackware' (https://git.qemu.org/git/openhackware.git) registered for path 'roms/openhackware'
Submodule 'roms/opensbi' (https://git.qemu.org/git/opensbi.git) registered for path 'roms/opensbi'
Submodule 'roms/qemu-palcode' (https://git.qemu.org/git/qemu-palcode.git) registered for path 'roms/qemu-palcode'
Submodule 'roms/seabios' (https://git.qemu.org/git/seabios.git/) registered for path 'roms/seabios'
Submodule 'roms/seabios-hppa' (https://git.qemu.org/git/seabios-hppa.git) registered for path 'roms/seabios-hppa'
Submodule 'roms/sgabios' (https://git.qemu.org/git/sgabios.git) registered for path 'roms/sgabios'
Submodule 'roms/skiboot' (https://git.qemu.org/git/skiboot.git) registered for path 'roms/skiboot'
Submodule 'roms/u-boot' (https://git.qemu.org/git/u-boot.git) registered for path 'roms/u-boot'
Submodule 'roms/u-boot-sam460ex' (https://git.qemu.org/git/u-boot-sam460ex.git) registered for path 'roms/u-boot-sam460ex'
Submodule 'slirp' (https://git.qemu.org/git/libslirp.git) registered for path 'slirp'
Submodule 'tests/fp/berkeley-softfloat-3' (https://git.qemu.org/git/berkeley-softfloat-3.git) registered for path 'tests/fp/berkeley-softfloat-3'
Submodule 'tests/fp/berkeley-testfloat-3' (https://git.qemu.org/git/berkeley-testfloat-3.git) registered for path 'tests/fp/berkeley-testfloat-3'
Submodule 'ui/keycodemapdb' (https://git.qemu.org/git/keycodemapdb.git) registered for path 'ui/keycodemapdb'
Cloning into 'capstone'...
Submodule path 'capstone': checked out '22ead3e0bfdb87516656453336160e0a37b066bf'
Cloning into 'dtc'...
Submodule path 'dtc': checked out '88f18909db731a627456f26d779445f84e449536'
Cloning into 'roms/QemuMacDrivers'...
Submodule path 'roms/QemuMacDrivers': checked out '90c488d5f4a407342247b9ea869df1c2d9c8e266'
Cloning into 'roms/SLOF'...
Submodule path 'roms/SLOF': checked out 'ba1ab360eebe6338bb8d7d83a9220ccf7e213af3'
Cloning into 'roms/edk2'...
Submodule path 'roms/edk2': checked out '20d2e5a125e34fc8501026613a71549b2a1a3e54'
Submodule 'SoftFloat' (https://github.com/ucb-bar/berkeley-softfloat-3.git) registered for path 'ArmPkg/Library/ArmSoftFloatLib/berkeley-softfloat-3'
Submodule 'CryptoPkg/Library/OpensslLib/openssl' (https://github.com/openssl/openssl) registered for path 'CryptoPkg/Library/OpensslLib/openssl'
Cloning into 'ArmPkg/Library/ArmSoftFloatLib/berkeley-softfloat-3'...
Submodule path 'roms/edk2/ArmPkg/Library/ArmSoftFloatLib/berkeley-softfloat-3': checked out 'b64af41c3276f97f0e181920400ee056b9c88037'
Cloning into 'CryptoPkg/Library/OpensslLib/openssl'...
Submodule path 'roms/edk2/CryptoPkg/Library/OpensslLib/openssl': checked out '50eaac9f3337667259de725451f201e784599687'
Submodule 'boringssl' (https://boringssl.googlesource.com/boringssl) registered for path 'boringssl'
Submodule 'krb5' (https://github.com/krb5/krb5) registered for path 'krb5'
Submodule 'pyca.cryptography' (https://github.com/pyca/cryptography.git) registered for path 'pyca-cryptography'
Cloning into 'boringssl'...
Submodule path 'roms/edk2/CryptoPkg/Library/OpensslLib/openssl/boringssl': checked out '2070f8ad9151dc8f3a73bffaa146b5e6937a583f'
Cloning into 'krb5'...
Submodule path 'roms/edk2/CryptoPkg/Library/OpensslLib/openssl/krb5': checked out 'b9ad6c49505c96a088326b62a52568e3484f2168'
Cloning into 'pyca-cryptography'...
Submodule path 'roms/edk2/CryptoPkg/Library/OpensslLib/openssl/pyca-cryptography': checked out '09403100de2f6f1cdd0d484dcb8e620f1c335c8f'
Cloning into 'roms/ipxe'...
Submodule path 'roms/ipxe': checked out 'de4565cbe76ea9f7913a01f331be3ee901bb6e17'
Cloning into 'roms/openbios'...
Submodule path 'roms/openbios': checked out 'c79e0ecb84f4f1ee3f73f521622e264edd1bf174'
Cloning into 'roms/openhackware'...
Submodule path 'roms/openhackware': checked out 'c559da7c8eec5e45ef1f67978827af6f0b9546f5'
Cloning into 'roms/opensbi'...
Submodule path 'roms/opensbi': checked out 'ce228ee0919deb9957192d723eecc8aaae2697c6'
Cloning into 'roms/qemu-palcode'...
Submodule path 'roms/qemu-palcode': checked out 'bf0e13698872450164fa7040da36a95d2d4b326f'
Cloning into 'roms/seabios'...
Submodule path 'roms/seabios': checked out 'a5cab58e9a3fb6e168aba919c5669bea406573b4'
Cloning into 'roms/seabios-hppa'...
Submodule path 'roms/seabios-hppa': checked out '0f4fe84658165e96ce35870fd19fc634e182e77b'
Cloning into 'roms/sgabios'...
Submodule path 'roms/sgabios': checked out 'cbaee52287e5f32373181cff50a00b6c4ac9015a'
Cloning into 'roms/skiboot'...
Submodule path 'roms/skiboot': checked out '261ca8e779e5138869a45f174caa49be6a274501'
Cloning into 'roms/u-boot'...
Submodule path 'roms/u-boot': checked out 'd3689267f92c5956e09cc7d1baa4700141662bff'
Cloning into 'roms/u-boot-sam460ex'...
Submodule path 'roms/u-boot-sam460ex': checked out '60b3916f33e617a815973c5a6df77055b2e3a588'
Cloning into 'slirp'...
Submodule path 'slirp': checked out '126c04acbabd7ad32c2b018fe10dfac2a3bc1210'
Cloning into 'tests/fp/berkeley-softfloat-3'...
Submodule path 'tests/fp/berkeley-softfloat-3': checked out 'b64af41c3276f97f0e181920400ee056b9c88037'
Cloning into 'tests/fp/berkeley-testfloat-3'...
Submodule path 'tests/fp/berkeley-testfloat-3': checked out '5a59dcec19327396a011a17fd924aed4fec416b3'
Cloning into 'ui/keycodemapdb'...
Submodule path 'ui/keycodemapdb': checked out '6b3d716e2b6472eb7189d3220552280ef3d832ce'
Switched to a new branch 'test'
ca9528e target/i386: introduce SSE3 instructions to sse-opcode.inc.h
a60cf87 target/i386: introduce SSE3 code generators
d6b90c5 target/i386: introduce SSE3 translators
d07a81b target/i386: introduce SSE2 instructions to sse-opcode.inc.h
9a52ea2 target/i386: introduce SSE2 code generators
96646bc target/i386: introduce SSE2 translators
d5e067e target/i386: introduce SSE instructions to sse-opcode.inc.h
66abf9f target/i386: introduce SSE code generators
f8c0699 target/i386: introduce SSE translators
71021da target/i386: introduce MMX instructions to sse-opcode.inc.h
09b6b40 target/i386: introduce MMX code generators
43fff80 target/i386: introduce MMX translators
b1715f9 target/i386: introduce instruction translator macros
fd93e87 target/i386: introduce sse-opcode.inc.h
ab711a3 target/i386: introduce gvec-based code generator macros
4168b75 target/i386: introduce helper-based code generator macros
3fac287 target/i386: introduce code generators
3a30642 target/i386: introduce H*, V*, U*, W* (SSE/AVX) operands
cc18af8 target/i386: introduce P*, N*, Q* (MMX) operands
1175822 target/i386: introduce G*, R*, E* (general register) operands
10f4ae7 target/i386: introduce M* (memptr) operands
728b398 target/i386: introduce Ib (immediate) operand
a331fff target/i386: introduce operand vex_v
22f4f48 target/i386: introduce operand for direct-only r/m field
f132d77 target/i386: introduce operands for decoding modrm fields
ed424a5 target/i386: introduce modrm operand
d712698 target/i386: introduce tcg_temp operands
818fcff target/i386: introduce generic load-store operand
8380c80 target/i386: introduce generic either-or operand
a03a2f6 target/i386: introduce generic operand alias
f3b669c target/i386: introduce instruction operand infrastructure
4b391ad target/i386: introduce function ck_cpuid
8123ca7 target/i386: introduce mnemonic aliases for several gvec operations
92c895f target/i386: disable unused function warning temporarily
ef32f4c target/i386: introduce gen_sse_ng
f232b7a target/i386: introduce gen_(ld, st)d_env_A0
93c6baf target/i386: add vector register file alignment constraints
255b027 target/i386: make variable is_xmm const
d413859 target/i386: make variable b1 const
fe6f670 target/i386: use pc_start from DisasContext
83feecf target/i386: Simplify gen_exception arguments
1649460 target/i386: use prefix from DisasContext
9ab47b3 target/i386: use dflag from DisasContext
7046842 target/i386: reduce scope of variable aflag
713bb8c target/i386: Push rex_w into DisasContext
c403330 target/i386: Push rex_r into DisasContext

=== OUTPUT BEGIN ===
1/46 Checking commit c403330f5c0f (target/i386: Push rex_r into DisasContext)
2/46 Checking commit 713bb8c7bc73 (target/i386: Push rex_w into DisasContext)
3/46 Checking commit 70468427f9c5 (target/i386: reduce scope of variable aflag)
4/46 Checking commit 9ab47b327e93 (target/i386: use dflag from DisasContext)
5/46 Checking commit 164946033ade (target/i386: use prefix from DisasContext)
6/46 Checking commit 83feecf4ffec (target/i386: Simplify gen_exception arguments)
7/46 Checking commit fe6f6709834f (target/i386: use pc_start from DisasContext)
WARNING: line over 80 characters
#65: FILE: target/i386/translate.c:6387:
+            gen_repz_scas(s, ot, s->pc_start - s->cs_base, s->pc - s->cs_base, 1);

WARNING: line over 80 characters
#68: FILE: target/i386/translate.c:6389:
+            gen_repz_scas(s, ot, s->pc_start - s->cs_base, s->pc - s->cs_base, 0);

WARNING: line over 80 characters
#77: FILE: target/i386/translate.c:6399:
+            gen_repz_cmps(s, ot, s->pc_start - s->cs_base, s->pc - s->cs_base, 1);

WARNING: line over 80 characters
#80: FILE: target/i386/translate.c:6401:
+            gen_repz_cmps(s, ot, s->pc_start - s->cs_base, s->pc - s->cs_base, 0);

WARNING: line over 80 characters
#198: FILE: target/i386/translate.c:7062:
+        gen_interrupt(s, EXCP03_INT3, s->pc_start - s->cs_base, s->pc - s->cs_base);

ERROR: line over 90 characters
#484: FILE: target/i386/translate.c:7693:
+            gen_svm_check_intercept(s, s->pc_start, (b & 2) ? SVM_EXIT_INVD : SVM_EXIT_WBINVD);

WARNING: line over 80 characters
#502: FILE: target/i386/translate.c:8090:
+                gen_svm_check_intercept(s, s->pc_start, SVM_EXIT_WRITE_DR0 + reg);

WARNING: line over 80 characters
#510: FILE: target/i386/translate.c:8097:
+                gen_svm_check_intercept(s, s->pc_start, SVM_EXIT_READ_DR0 + reg);

total: 1 errors, 7 warnings, 464 lines checked

Patch 7/46 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

8/46 Checking commit d413859dd1da (target/i386: make variable b1 const)
9/46 Checking commit 255b027543f1 (target/i386: make variable is_xmm const)
10/46 Checking commit 93c6baf75eec (target/i386: add vector register file alignment constraints)
11/46 Checking commit f232b7a29836 (target/i386: introduce gen_(ld, st)d_env_A0)
12/46 Checking commit ef32f4c8330d (target/i386: introduce gen_sse_ng)
13/46 Checking commit 92c895f5d577 (target/i386: disable unused function warning temporarily)
14/46 Checking commit 8123ca7ad80b (target/i386: introduce mnemonic aliases for several gvec operations)
15/46 Checking commit 4b391ad16666 (target/i386: introduce function ck_cpuid)
16/46 Checking commit f3b669ca511e (target/i386: introduce instruction operand infrastructure)
ERROR: spaces required around that '*' (ctx:WxV)
#33: FILE: target/i386/translate.c:4561:
+    static int insnop_init(opT)(insnop_ctxt_t(opT) *ctxt,       \
                                                    ^

ERROR: spaces required around that '*' (ctx:WxV)
#39: FILE: target/i386/translate.c:4567:
+    static insnop_arg_t(opT) insnop_prepare(opT)(insnop_ctxt_t(opT) *ctxt, \
                                                                     ^

ERROR: spaces required around that '*' (ctx:WxV)
#45: FILE: target/i386/translate.c:4573:
+    static void insnop_finalize(opT)(insnop_ctxt_t(opT) *ctxt,  \
                                                         ^

total: 3 errors, 0 warnings, 34 lines checked

Patch 16/46 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

17/46 Checking commit a03a2f667f10 (target/i386: introduce generic operand alias)
ERROR: Macros with multiple statements should be enclosed in a do - while loop
#24: FILE: target/i386/translate.c:4582:
+#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);      \
+    }

total: 1 errors, 0 warnings, 26 lines checked

Patch 17/46 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

18/46 Checking commit 8380c80b34c9 (target/i386: introduce generic either-or operand)
ERROR: Macros with multiple statements should be enclosed in a do - while loop
#26: FILE: target/i386/translate.c:4602:
+#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)                                                    \
+    {                                                                   \
+        int ret = insnop_init(opT1)(&ctxt->ctxt_ ## opT1,               \
+                                    env, s, modrm, is_write);           \
+        if (!ret) {                                                     \
+            ctxt->is_ ## opT1 = 1;                                      \
+            return 0;                                                   \
+        }                                                               \
+        ret = insnop_init(opT2)(&ctxt->ctxt_ ## opT2,                   \
+                                env, s, modrm, is_write);               \
+        if (!ret) {                                                     \
+            ctxt->is_ ## opT1 = 0;                                      \
+            return 0;                                                   \
+        }                                                               \
+        return ret;                                                     \
+    }                                                                   \
+    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));        \
+    }

total: 1 errors, 0 warnings, 52 lines checked

Patch 18/46 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

19/46 Checking commit 818fcffce866 (target/i386: introduce generic load-store operand)
ERROR: Macros with multiple statements should be enclosed in a do - while loop
#36: FILE: target/i386/translate.c:4658:
+#define DEF_INSNOP_LDST(opT, opTarg, opTptr)                            \
+    typedef insnop_arg_t(opTarg) insnop_arg_t(opT);                     \
+    typedef struct {                                                    \
+        insnop_ctxt_t(opTarg) arg;                                      \
+        insnop_ctxt_t(opTptr) ptr;                                      \
+    } insnop_ctxt_t(opT);                                               \
+                                                                        \
+    /* forward declaration */                                           \
+    INSNOP_LDST(opTarg, opTptr);                                        \
+                                                                        \
+    INSNOP_INIT(opT)                                                    \
+    {                                                                   \
+        int ret = insnop_init(opTarg)(&ctxt->arg, env, s, modrm, is_write); \
+        if (!ret) {                                                     \
+            ret = insnop_init(opTptr)(&ctxt->ptr, env, s, modrm, is_write); \
+        }                                                               \
+        return ret;                                                     \
+    }                                                                   \
+    INSNOP_PREPARE(opT)                                                 \
+    {                                                                   \
+        const insnop_arg_t(opTarg) arg =                                \
+            insnop_prepare(opTarg)(&ctxt->arg, env, s, modrm, is_write); \
+        if (!is_write) {                                                \
+            const insnop_arg_t(opTptr) ptr =                            \
+                insnop_prepare(opTptr)(&ctxt->ptr, env, s, modrm, is_write); \
+            insnop_ldst(opTarg, opTptr)(env, s, modrm, is_write, arg, ptr); \
+            insnop_finalize(opTptr)(&ctxt->ptr, env, s, modrm, is_write, ptr); \
+        }                                                               \
+        return arg;                                                     \
+    }                                                                   \
+    INSNOP_FINALIZE(opT)                                                \
+    {                                                                   \
+        if (is_write) {                                                 \
+            const insnop_arg_t(opTptr) ptr =                            \
+                insnop_prepare(opTptr)(&ctxt->ptr, env, s, modrm, is_write); \
+            insnop_ldst(opTarg, opTptr)(env, s, modrm, is_write, arg, ptr); \
+            insnop_finalize(opTptr)(&ctxt->ptr, env, s, modrm, is_write, ptr); \
+        }                                                               \
+        insnop_finalize(opTarg)(&ctxt->arg, env, s, modrm, is_write, arg); \
+    }

WARNING: Block comments use a leading /* on a separate line
#43: FILE: target/i386/translate.c:4665:
+    /* forward declaration */                                           \

total: 1 errors, 1 warnings, 60 lines checked

Patch 19/46 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

20/46 Checking commit d712698a82c6 (target/i386: introduce tcg_temp operands)
21/46 Checking commit ed424a5e2f6b (target/i386: introduce modrm operand)
22/46 Checking commit f132d772e756 (target/i386: introduce operands for decoding modrm fields)
23/46 Checking commit 22f4f4831251 (target/i386: introduce operand for direct-only r/m field)
24/46 Checking commit a331fff9f3fe (target/i386: introduce operand vex_v)
25/46 Checking commit 728b39849029 (target/i386: introduce Ib (immediate) operand)
26/46 Checking commit 10f4ae72ee5c (target/i386: introduce M* (memptr) operands)
27/46 Checking commit 1175822a21bf (target/i386: introduce G*, R*, E* (general register) operands)
28/46 Checking commit cc18af84223d (target/i386: introduce P*, N*, Q* (MMX) operands)
29/46 Checking commit 3a306429bb23 (target/i386: introduce H*, V*, U*, W* (SSE/AVX) operands)
30/46 Checking commit 3fac28747b8b (target/i386: introduce code generators)
31/46 Checking commit 4168b75af461 (target/i386: introduce helper-based code generator macros)
32/46 Checking commit ab711a3d4dd0 (target/i386: introduce gvec-based code generator macros)
33/46 Checking commit fd93e87c50cc (target/i386: introduce sse-opcode.inc.h)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#16: 
new file mode 100644

ERROR: space prohibited before that close parenthesis ')'
#21: FILE: target/i386/sse-opcode.inc.h:1:
+#define FMTI____     (0, 0, 0, )

total: 1 errors, 1 warnings, 69 lines checked

Patch 33/46 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

34/46 Checking commit b1715f917915 (target/i386: introduce instruction translator macros)
ERROR: Macros with multiple statements should be enclosed in a do - while loop
#224: FILE: target/i386/translate.c:5568:
+#define OPCODE_GRPMEMB(grpname, mnem, opcode, feat, fmt, ...)           \
+            case opcode:                                                \
+                translate_insn(FMT_ARGC(fmt), ## __VA_ARGS__)(          \
+                    env, s, modrm, CK_CPUID_ ## feat, FMT_ARGC_WR(fmt), \
+                    gen_insn(mnem, FMT_ARGC(fmt), ## __VA_ARGS__));     \
+                break;

ERROR: Macros with multiple statements should be enclosed in a do - while loop
#230: FILE: target/i386/translate.c:5574:
+#define OPCODE_GRP_END(grpname)                                         \
+            default:                                                    \
+                ret = 1;                                                \
+                break;                                                  \
+            }                                                           \
+                                                                        \
+            insnop_finalize(modrm_reg)(&regctxt, env, s, modrm, 0, reg); \
+        }                                                               \
+                                                                        \
+        if (ret) {                                                      \
+            gen_illegal_opcode(s);                                      \
+        }                                                               \
+    }

ERROR: spaces required around that ':' (ctx:VxE)
#231: FILE: target/i386/translate.c:5575:
+            default:                                                    \
                    ^

ERROR: Macros with complex values should be enclosed in parenthesis
#252: FILE: target/i386/translate.c:5608:
+#define LEG(p, m, w, opcode)                    \
+    case opcode | M_ ## m | P_ ## p | W_ ## w:

ERROR: Macros with multiple statements should be enclosed in a do - while loop
#254: FILE: target/i386/translate.c:5610:
+#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, CK_CPUID_ ## feat, FMT_ARGC_WR(fmt),         \
+            gen_insn(mnem, FMT_ARGC(fmt), ## __VA_ARGS__));             \
+    } return;

ERROR: Macros with multiple statements should be enclosed in a do - while loop
#261: FILE: target/i386/translate.c:5617:
+#define OPCODE_GRP(grpname, cases)                  \
+    cases {                                         \
+        const int modrm = x86_ldub_code(env, s);    \
+        translate_group(grpname)(env, s, modrm);    \
+    } return;

total: 6 errors, 0 warnings, 249 lines checked

Patch 34/46 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

35/46 Checking commit 43fff80712ee (target/i386: introduce MMX translators)
36/46 Checking commit 09b6b40b1692 (target/i386: introduce MMX code generators)
37/46 Checking commit 71021da7cc61 (target/i386: introduce MMX instructions to sse-opcode.inc.h)
ERROR: space prohibited before that close parenthesis ')'
#121: FILE: target/i386/sse-opcode.inc.h:143:
+OPCODE(emms, LEG(NP, 0F, 0, 0x77), MMX, )

total: 1 errors, 0 warnings, 137 lines checked

Patch 37/46 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

38/46 Checking commit f8c069933d15 (target/i386: introduce SSE translators)
39/46 Checking commit 66abf9f5d42c (target/i386: introduce SSE code generators)
40/46 Checking commit d5e067eb3687 (target/i386: introduce SSE instructions to sse-opcode.inc.h)
ERROR: space prohibited before that close parenthesis ')'
#208: FILE: target/i386/sse-opcode.inc.h:312:
+    OPCODE_GRPMEMB(grp15_LEG_NP, sfence, 7, SSE, )

total: 1 errors, 0 warnings, 208 lines checked

Patch 40/46 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

41/46 Checking commit 96646bcf26a8 (target/i386: introduce SSE2 translators)
42/46 Checking commit 9a52ea2a9ce7 (target/i386: introduce SSE2 code generators)
43/46 Checking commit d07a81b490ae (target/i386: introduce SSE2 instructions to sse-opcode.inc.h)
ERROR: space prohibited before that close parenthesis ')'
#535: FILE: target/i386/sse-opcode.inc.h:561:
+OPCODE(pause, LEG(F3, NA, 0, 0x90), SSE2, )

ERROR: space prohibited before that close parenthesis ')'
#596: FILE: target/i386/sse-opcode.inc.h:631:
+    OPCODE_GRPMEMB(grp15_LEG_NP, lfence, 5, SSE2, )

ERROR: space prohibited before that close parenthesis ')'
#598: FILE: target/i386/sse-opcode.inc.h:633:
+    OPCODE_GRPMEMB(grp15_LEG_NP, mfence, 6, SSE2, )

total: 3 errors, 0 warnings, 582 lines checked

Patch 43/46 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

44/46 Checking commit d6b90c53aa61 (target/i386: introduce SSE3 translators)
45/46 Checking commit a60cf87145ed (target/i386: introduce SSE3 code generators)
46/46 Checking commit ca9528e6142c (target/i386: introduce SSE3 instructions to sse-opcode.inc.h)
=== OUTPUT END ===

Test command exited with code: 1


The full log is available at
http://patchew.org/logs/20190815020928.9679-1-jan.bobek@gmail.com/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com