Skip to content

tcg 2.9 patch queue

Richard Henderson qemu-arm qemu-devel 5 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest65 patches 3 repliesIn review
  2. v464 patches 36 repliesSuperseded
  3. v318 patches 0 repliesSuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v218 patches15 repliesSuperseded
v115 patches8 repliesApplied

Changes since v3 from the cover letter

* PPC host patches have been properly annotated for cpu revision,
- cnttz[wd] are power9 inventions,
- cntpop[wd] are power7 inventions.

* X86 host checks the correct cpuid bit for lzcnt.

* Generic TCG has significant changes to enable "interesting" combinations of constraints for X86 host bsr/bsf and to some extent lzcnt/tzcnt.

* Opcode for ctpop. I had begun with only the helpers for ctpop, but added the opcode after I discovered that power7/8 could use that as a better alternative for implementing ctz.

* Updates to the i386 and ppc disassemblers, to handle the new insns that we're emitting.

Patches in v5 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/65tcg: Add field extraction primitivestcg/README tcg/aarch64/tcg-target.h tcg/arm/tcg-target.h +12 more+426 -20 replies
2/65tcg: Minor adjustments to deposit expanderstcg/tcg-op.c+4 -20 replies
3/65tcg: Add deposit_z expandertcg/tcg-op.c tcg/tcg-op.h+149 -00 replies
4/65tcg/aarch64: Implement field extraction opcodestcg/aarch64/tcg-target.h tcg/aarch64/tcg-target.inc.c+18 -40 replies
5/65tcg/arm: Move isa detection to tcg-target.htcg/arm/tcg-target.h tcg/arm/tcg-target.inc.c+33 -440 replies
6/65tcg/arm: Implement field extraction opcodestcg/arm/tcg-target.h tcg/arm/tcg-target.inc.c+26 -20 replies
7/65tcg/i386: Implement field extraction opcodestcg/i386/tcg-target.h tcg/i386/tcg-target.inc.c+47 -30 replies
8/65tcg/mips: Implement field extraction opcodestcg/mips/tcg-target.h tcg/mips/tcg-target.inc.c+5 -10 replies
9/65tcg/ppc: Implement field extraction opcodestcg/ppc/tcg-target.h tcg/ppc/tcg-target.inc.c+12 -20 replies
10/65tcg/s390: Expose host facilities to tcg-target.htcg/s390/tcg-target.h tcg/s390/tcg-target.inc.c+96 -1040 replies
11/65tcg/s390: Implement field extraction opcodestcg/s390/tcg-target.h tcg/s390/tcg-target.inc.c+13 -20 replies
12/65tcg/s390: Support deposit into zerotcg/s390/tcg-target.inc.c+26 -40 replies
13/65target-alpha: Use deposit and extract opstarget/alpha/translate.c+42 -250 replies
14/65target-arm: Use new deposit and extract opstarget/arm/translate-a64.c target/arm/translate.c+37 -810 replies
15/65target-i386: Use new deposit and extract opstarget/i386/translate.c+23 -220 replies
16/65target-mips: Use the new extract optarget/mips/translate.c+5 -70 replies
17/65target-ppc: Use the new deposit and extract opstarget/ppc/translate.c+19 -160 replies
18/65target-s390x: Use the new deposit and extract opstarget/s390x/translate.c+22 -120 replies
19/65tcg/optimize: Fold movcond 0/1 into setcondtcg/optimize.c+15 -00 replies
20/65tcg: Add markup for output requires new registertcg/tcg.c tcg/tcg.h+23 -120 replies
21/65tcg: Transition flat op_defs array to a target callbacktcg/aarch64/tcg-target.inc.c tcg/arm/tcg-target.inc.c tcg/i386/tcg-target.inc.c +8 more+136 -770 replies
22/65tcg: Pass the opcode width to target_parse_constrainttcg/aarch64/tcg-target.inc.c tcg/arm/tcg-target.inc.c tcg/i386/tcg-target.inc.c +7 more+53 -850 replies
23/65tcg: Allow an operand to be matching or a constanttcg/README tcg/tcg.c+41 -350 replies
24/65tcg: Add clz and ctz opcodestcg-runtime.c tcg/README tcg/aarch64/tcg-target.h +14 more+266 -00 replies
25/65disas/i386.c: Handle tzcntdisas/i386.c+10 -20 replies
26/65disas/ppc: Handle popcnt and cnttzdisas/ppc.c+10 -00 replies
27/65target-alpha: Use the ctz and clz opcodestarget/alpha/helper.h target/alpha/int_helper.c target/alpha/translate.c+2 -140 replies
28/65target-cris: Use clz opcodetarget/cris/helper.h target/cris/op_helper.c target/cris/translate.c+1 -70 replies
29/65target-microblaze: Use clz opcodetarget/microblaze/helper.h target/microblaze/op_helper.c target/microblaze/translate.c+1 -70 replies
30/65target-mips: Use clz opcodetarget/mips/helper.h target/mips/op_helper.c target/mips/translate.c+16 -360 replies
31/65target-openrisc: Use clz and ctz opcodestarget/openrisc/helper.h target/openrisc/int_helper.c target/openrisc/translate.c+4 -230 replies
32/65target-ppc: Use clz and ctz opcodestarget/ppc/helper.h target/ppc/int_helper.c target/ppc/translate.c+16 -280 replies
33/65target-s390x: Use clz opcodetarget/s390x/helper.h target/s390x/int_helper.c target/s390x/translate.c+1 -80 replies
34/65target-tilegx: Use clz and ctz opcodestarget/tilegx/helper.c target/tilegx/helper.h target/tilegx/translate.c+2 -140 replies
35/65target-tricore: Use clz opcodetarget/tricore/helper.h target/tricore/op_helper.c target/tricore/translate.c+3 -140 replies
36/65target-unicore32: Use clz opcodetarget/unicore32/helper.c target/unicore32/helper.h target/unicore32/translate.c+3 -160 replies
37/65target-xtensa: Use clz opcodetarget/xtensa/helper.h target/xtensa/op_helper.c target/xtensa/translate.c+11 -170 replies
38/65target-arm: Use clz opcodetarget/arm/helper-a64.c target/arm/helper-a64.h target/arm/helper.c +3 more+7 -250 replies
39/65target-i386: Use clz and ctz opcodestarget/i386/helper.h target/i386/int_helper.c target/i386/translate.c+14 -300 replies
40/65tcg/ppc: Handle ctz and clz opcodestcg/ppc/tcg-target.h tcg/ppc/tcg-target.inc.c+73 -40 replies
41/65tcg/aarch64: Handle ctz and clz opcodestcg/aarch64/tcg-target.h tcg/aarch64/tcg-target.inc.c+52 -40 replies
42/65tcg/arm: Handle ctz and clz opcodestcg/arm/tcg-target.h tcg/arm/tcg-target.inc.c+29 -20 replies
43/65tcg/mips: Handle clz opcodetcg/mips/tcg-target.h tcg/mips/tcg-target.inc.c+36 -20 replies
44/65tcg/s390: Handle clz opcodetcg/s390/tcg-target.h tcg/s390/tcg-target.inc.c+36 -20 replies
45/65tcg/i386: Fuly convert tcg_target_op_deftcg/i386/tcg-target.inc.c+198 -1420 replies
46/65tcg/i386: Hoist common arguments in tcg_out_optcg/i386/tcg-target.inc.c+95 -1020 replies
47/65tcg/i386: Allow bmi2 shiftx to have non-matching operandstcg/i386/tcg-target.inc.c+19 -140 replies
48/65tcg/i386: Handle ctz and clz opcodestcg/i386/tcg-target.h tcg/i386/tcg-target.inc.c+120 -130 replies
49/65tcg/i386: Rely on undefined/undocumented behaviour of BSF/BSRtcg/i386/tcg-target.inc.c+22 -132 replies
50/65tcg: Add helpers for clrsbtcg-runtime.c tcg/tcg-op.c tcg/tcg-op.h +1 more+44 -00 replies
51/65target-arm: Use clrsb helpertarget/arm/helper-a64.c target/arm/helper-a64.h target/arm/translate-a64.c+4 -160 replies
52/65target-tricore: Use clrsb helpertarget/tricore/helper.h target/tricore/op_helper.c target/tricore/translate.c+1 -70 replies
53/65target-xtensa: Use clrsb helpertarget/xtensa/translate.c+1 -100 replies
54/65tcg: Add opcode for ctpoptcg-runtime.c tcg/aarch64/tcg-target.h tcg/arm/tcg-target.h +13 more+78 -00 replies
55/65target-alpha: Use ctpop helpertarget/alpha/helper.h target/alpha/int_helper.c target/alpha/translate.c+1 -80 replies
56/65target-ppc: Use ctpop helpertarget/ppc/helper.h target/ppc/int_helper.c target/ppc/translate.c+9 -180 replies
57/65target-s390x: Avoid a loop for popcnttarget/s390x/int_helper.c+6 -90 replies
58/65target-sparc: Use ctpop helpertarget/sparc/helper.c target/sparc/helper.h target/sparc/translate.c+1 -71 reply
59/65target-tilegx: Use ctpop helpertarget/tilegx/helper.c target/tilegx/helper.h target/tilegx/translate.c+1 -70 replies
60/65target-i386: Use ctpop helpertarget/i386/cc_helper.c target/i386/cpu.h target/i386/ops_sse.h +2 more+15 -290 replies
61/65qemu/host-utils.h: Reduce the operation count in the fallback ctpopinclude/qemu/host-utils.h+11 -140 replies
62/65tests: New test-bitcnttests/.gitignore tests/Makefile.include tests/test-bitcnt.c+143 -00 replies
63/65tcg: Use ctpop to generate ctz if neededtcg/tcg-op.c+60 -400 replies
64/65tcg/ppc: Handle ctpop opcodetcg/ppc/tcg-target.h tcg/ppc/tcg-target.inc.c+14 -30 replies
65/65tcg/i386: Handle ctpop opcodetcg/i386/tcg-target.h tcg/i386/tcg-target.inc.c+14 -30 replies

Reviews trailers per patch

23 of 65 patches have a Reviewed-by or Acked-by.

PatchAlex BennéeDavid GibsonEduardo HabkostYongbok KimBastian KoppelmannMark Cave-Ayland
1/65R-b
2/65R-b
3/65
4/65R-b
5/65R-b
6/65R-b
7/65
8/65
9/65R-b
10/65
11/65
12/65
13/65
14/65
15/65A-b
16/65R-b
17/65R-b
18/65
19/65
20/65R-b
21/65R-b
22/65R-b
23/65R-b
24/65R-b
25/65
26/65
27/65
28/65
29/65
30/65
31/65
32/65
33/65
34/65
35/65T-b R-b
36/65
37/65
38/65R-b
39/65
40/65
41/65
42/65R-b
43/65
44/65
45/65
46/65
47/65
48/65
49/65
50/65R-b
51/65R-b
52/65T-b R-b
53/65
54/65R-b
55/65
56/65
57/65
58/65A-b
59/65
60/65
61/65R-b
62/65
63/65
64/65
65/65

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 6 reviewers.

Read the v5 thread

Cover letter [Qemu-devel] [PATCH v5 00/65] tcg 2.9 patch queue

This is a combination of two patch sets that have had previous revisions, as well as some new patches. I wanted to post this all together since Alex was having trouble with prerequisites.

The full tree is at

git://github.com/rth7680/qemu.git tcg-2.9

Changes sinve v4:
* Feedback from Alex Bennee, including aarch64 guest fixes and a new test case.

Changes since v3:
* PPC host patches have been properly annotated for cpu revision,
- cnttz[wd] are power9 inventions,
- cntpop[wd] are power7 inventions.

* X86 host checks the correct cpuid bit for lzcnt.

* Generic TCG has significant changes to enable "interesting" combinations of constraints for X86 host bsr/bsf and to some extent lzcnt/tzcnt.

* Opcode for ctpop. I had begun with only the helpers for ctpop, but added the opcode after I discovered that power7/8 could use that as a better alternative for implementing ctz.

* Updates to the i386 and ppc disassemblers, to handle the new insns that we're emitting.

r~

Alex Bennée (1):
tests: New test-bitcnt

Richard Henderson (64):
tcg: Add field extraction primitives
tcg: Minor adjustments to deposit expanders
tcg: Add deposit_z expander
tcg/aarch64: Implement field extraction opcodes
tcg/arm: Move isa detection to tcg-target.h
tcg/arm: Implement field extraction opcodes
tcg/i386: Implement field extraction opcodes
tcg/mips: Implement field extraction opcodes
tcg/ppc: Implement field extraction opcodes
tcg/s390: Expose host facilities to tcg-target.h tcg/s390: Implement field extraction opcodes
tcg/s390: Support deposit into zero
target-alpha: Use deposit and extract ops
target-arm: Use new deposit and extract ops
target-i386: Use new deposit and extract ops
target-mips: Use the new extract op
target-ppc: Use the new deposit and extract ops
target-s390x: Use the new deposit and extract ops tcg/optimize: Fold movcond 0/1 into setcond
tcg: Add markup for output requires new register
tcg: Transition flat op_defs array to a target callback
tcg: Pass the opcode width to target_parse_constraint
tcg: Allow an operand to be matching or a constant
tcg: Add clz and ctz opcodes
disas/i386.c: Handle tzcnt
disas/ppc: Handle popcnt and cnttz
target-alpha: Use the ctz and clz opcodes
target-cris: Use clz opcode
target-microblaze: Use clz opcode
target-mips: Use clz opcode
target-openrisc: Use clz and ctz opcodes
target-ppc: Use clz and ctz opcodes
target-s390x: Use clz opcode
target-tilegx: Use clz and ctz opcodes
target-tricore: Use clz opcode
target-unicore32: Use clz opcode
target-xtensa: Use clz opcode
target-arm: Use clz opcode
target-i386: Use clz and ctz opcodes
tcg/ppc: Handle ctz and clz opcodes
tcg/aarch64: Handle ctz and clz opcodes
tcg/arm: Handle ctz and clz opcodes
tcg/mips: Handle clz opcode
tcg/s390: Handle clz opcode
tcg/i386: Fuly convert tcg_target_op_def
tcg/i386: Hoist common arguments in tcg_out_op
tcg/i386: Allow bmi2 shiftx to have non-matching operands tcg/i386: Handle ctz and clz opcodes
tcg/i386: Rely on undefined/undocumented behaviour of BSF/BSR
tcg: Add helpers for clrsb
target-arm: Use clrsb helper
target-tricore: Use clrsb helper
target-xtensa: Use clrsb helper
tcg: Add opcode for ctpop
target-alpha: Use ctpop helper
target-ppc: Use ctpop helper
target-s390x: Avoid a loop for popcnt
target-sparc: Use ctpop helper
target-tilegx: Use ctpop helper
target-i386: Use ctpop helper
qemu/host-utils.h: Reduce the operation count in the fallback ctpop
tcg: Use ctpop to generate ctz if needed
tcg/ppc: Handle ctpop opcode
tcg/i386: Handle ctpop opcode

 disas/i386.c                  |  12 +-
 disas/ppc.c                   |  10 +
 include/qemu/host-utils.h     |  25 +-
 target/alpha/helper.h         |   4 -
 target/alpha/int_helper.c     |  15 -
 target/alpha/translate.c      |  73 +++--
 target/arm/helper-a64.c       |  20 --
 target/arm/helper-a64.h       |   4 -
 target/arm/helper.c           |   5 -
 target/arm/helper.h           |   1 -
 target/arm/translate-a64.c    |  97 +++---
 target/arm/translate.c        |  43 +--
 target/cris/helper.h          |   1 -
 target/cris/op_helper.c       |   5 -
 target/cris/translate.c       |   2 +-
 target/i386/cc_helper.c       |   3 +
 target/i386/cpu.h             |   1 +
 target/i386/helper.h          |   2 -
 target/i386/int_helper.c      |  11 -
 target/i386/ops_sse.h         |  26 --
 target/i386/ops_sse_header.h  |   1 -
 target/i386/translate.c       |  89 ++---
 target/microblaze/helper.h    |   1 -
 target/microblaze/op_helper.c |   5 -
 target/microblaze/translate.c |   2 +-
 target/mips/helper.h          |   7 -
 target/mips/op_helper.c       |  22 --
 target/mips/translate.c       |  35 +-
 target/openrisc/helper.h      |   2 -
 target/openrisc/int_helper.c  |  19 --
 target/openrisc/translate.c   |   6 +-
 target/ppc/helper.h           |   7 +-
 target/ppc/int_helper.c       |  38 +--
 target/ppc/translate.c        |  61 ++--
 target/s390x/helper.h         |   1 -
 target/s390x/int_helper.c     |  21 +-
 target/s390x/translate.c      |  36 ++-
 target/sparc/helper.c         |   5 -
 target/sparc/helper.h         |   1 -
 target/sparc/translate.c      |   2 +-
 target/tilegx/helper.c        |  15 -
 target/tilegx/helper.h        |   3 -
 target/tilegx/translate.c     |   6 +-
 target/tricore/helper.h       |   3 -
 target/tricore/op_helper.c    |  15 -
 target/tricore/translate.c    |   7 +-
 target/unicore32/helper.c     |  10 -
 target/unicore32/helper.h     |   3 -
 target/unicore32/translate.c  |   6 +-
 target/xtensa/helper.h        |   2 -
 target/xtensa/op_helper.c     |  13 -
 target/xtensa/translate.c     |   4 +-
 tcg-runtime.c                 |  40 +++
 tcg/README                    |  41 ++-
 tcg/aarch64/tcg-target.h      |  10 +
 tcg/aarch64/tcg-target.inc.c  |  91 +++++-
 tcg/arm/tcg-target.h          |  41 ++-
 tcg/arm/tcg-target.inc.c      | 121 ++++---
 tcg/i386/tcg-target.h         |  17 +
 tcg/i386/tcg-target.inc.c     | 732 +++++++++++++++++++++++++++---------------
 tcg/ia64/tcg-target.h         |  10 +
 tcg/ia64/tcg-target.inc.c     |  28 +-
 tcg/mips/tcg-target.h         |   5 +
 tcg/mips/tcg-target.inc.c     |  66 +++-
 tcg/optimize.c                |  94 ++++++
 tcg/ppc/tcg-target.h          |  13 +
 tcg/ppc/tcg-target.inc.c      | 117 ++++++-
 tcg/s390/tcg-target.h         | 128 ++++----
 tcg/s390/tcg-target.inc.c     | 173 ++++++----
 tcg/sparc/tcg-target.h        |  10 +
 tcg/sparc/tcg-target.inc.c    |  28 +-
 tcg/tcg-op.c                  | 692 ++++++++++++++++++++++++++++++++++++++-
 tcg/tcg-op.h                  |  42 +++
 tcg/tcg-opc.h                 |  10 +
 tcg/tcg-runtime.h             |   9 +
 tcg/tcg.c                     | 173 +++++-----
 tcg/tcg.h                     |  14 +-
 tcg/tci/tcg-target.h          |  10 +
 tcg/tci/tcg-target.inc.c      |  25 +-
 tests/.gitignore              |   1 +
 tests/Makefile.include        |   2 +
 tests/test-bitcnt.c           | 140 ++++++++
 82 files changed, 2580 insertions(+), 1111 deletions(-)
 create mode 100644 tests/test-bitcnt.c
Signature · 1 line
2.9.3