qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 0/8] Hexagon (target/hexagon) Improve change-of-flow


From: Taylor Simpson
Subject: [PATCH 0/8] Hexagon (target/hexagon) Improve change-of-flow
Date: Wed, 19 Oct 2022 15:37:31 -0700

This patch series improves change-of-flow handling.

Currently, we set the PC to a new address before exiting a TB.  The
ultimate goal is to use direct block chaining.  However, several steps
are needed along the way.

1)
When a packet has more than one change-of-flow (COF) instruction, only
the first one taken is considered.  The runtime bookkeeping is only
needed when there is more than one COF instruction in a packet.

2, 3)
Remove PC and next_PC from the runtime state and always use a
translation-time constant.  Note that next_PC is used by call instructions
to set LR and by conditional COF instructions to set the fall-through
address.

4, 5, 6)
Add helper overrides for COF instructions.  In particular, we must
distinguish those that use a PC-relative address for the destination.
These are candidates for direct block chaining later.

7)
Use direct block chaining for packets that have a single PC-relative
COF instruction.  Instead of generating the code while processing the
instruction, we record the effect in DisasContext and generate the code
during gen_end_tb.

8)
Use direct block chaining for tight loops.  We look for TBs that end
with an endloop0 that will branch back to the TB start address.




Taylor Simpson (8):
  Hexagon (target/hexagon) Only use branch_taken when packet has multi
    cof
  Hexagon (target/hexagon) Remove PC from the runtime state
  Hexagon (target/hexagon) Remove next_PC from runtime state
  Hexagon (target/hexagon) Add overrides for direct call instructions
  Hexagon (target/hexagon) Add overrides for compound compare and jump
  Hexagon (target/hexagon) Add overrides for various forms of jump
  Hexagon (target/hexagon) Use direct block chaining for direct
    jump/branch
  Hexagon (target/hexagon) Use direct block chaining for tight loops

 target/hexagon/cpu.h                |  18 +-
 target/hexagon/gen_tcg.h            | 391 ++++++++++++++++++++++++++++
 target/hexagon/insn.h               |   2 +
 target/hexagon/macros.h             |   6 +-
 target/hexagon/translate.h          |   6 +-
 target/hexagon/decode.c             |  15 +-
 target/hexagon/genptr.c             | 278 ++++++++++++++++++++
 target/hexagon/op_helper.c          |  28 +-
 target/hexagon/translate.c          | 120 +++++++--
 target/hexagon/gen_helper_funcs.py  |  11 +
 target/hexagon/gen_helper_protos.py |  12 +-
 target/hexagon/gen_tcg_funcs.py     |  11 +
 target/hexagon/hex_common.py        |  34 ++-
 13 files changed, 887 insertions(+), 45 deletions(-)

-- 
2.17.1


reply via email to

[Prev in Thread] Current Thread [Next in Thread]