Skip to content

Hexagon (target/hexagon) short-circuit and move to DisasContext

Taylor Simpson qemu-devel 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest21 patches 4 repliesIn review
  2. v121 patches 27 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/21meson.build Add CONFIG_HEXAGON_IDEF_PARSERmeson.build+1 -01 reply
2/21Hexagon (target/hexagon) Add DisasContext arg to gen_log_reg_writetarget/hexagon/README target/hexagon/gen_tcg.h target/hexagon/gen_tcg_funcs.py +3 more+14 -120 replies
3/21Hexagon (target/hexagon) Add overrides for loop setup instructionstarget/hexagon/gen_tcg.h target/hexagon/genptr.c+65 -00 replies
4/21Hexagon (target/hexagon) Add overrides for allocframe/deallocframetarget/hexagon/gen_tcg.h target/hexagon/genptr.c+79 -00 replies
5/21Hexagon (target/hexagon) Add overrides for clr[tf]newtarget/hexagon/gen_tcg.h target/hexagon/macros.h+16 -41 reply
6/21Hexagon (target/hexagon) Remove log_reg_write from op_helper.[ch]target/hexagon/macros.h target/hexagon/op_helper.c target/hexagon/op_helper.h+0 -350 replies
7/21Hexagon (target/hexagon) Eliminate uses of log_pred_write functiontarget/hexagon/gen_tcg.h target/hexagon/genptr.c target/hexagon/helper.h +2 more+104 -190 replies
8/21Hexagon (target/hexagon) Clean up pred_written usagetarget/hexagon/genptr.c target/hexagon/translate.c+23 -460 replies
9/21Hexagon (target/hexagon) Don't overlap dest writes with source readstarget/hexagon/genptr.c+29 -160 replies
10/21Hexagon (target/hexagon) Mark registers as read during packet analysistarget/hexagon/attribs_def.h.inc target/hexagon/gen_analyze_funcs.py target/hexagon/hex_common.py +2 more+97 -150 replies
11/21Hexagon (target/hexagon) Short-circuit packet register writestarget/hexagon/arch.c target/hexagon/cpu.c target/hexagon/cpu.h +13 more+129 -311 reply
12/21Hexagon (target/hexagon) Short-circuit packet predicate writestarget/hexagon/genptr.c target/hexagon/genptr.h target/hexagon/translate.c+24 -60 replies
13/21Hexagon (target/hexagon) Short-circuit packet HVX writestarget/hexagon/genptr.c target/hexagon/translate.c+50 -20 replies
14/21Hexagon (target/hexagon) Short-circuit more HVX single instruction packetstarget/hexagon/gen_analyze_funcs.py target/hexagon/gen_tcg_hvx.h target/hexagon/translate.c +2 more+65 -21 reply
15/21Hexagon (target/hexagon) Add overrides for disabled idef-parser insnstarget/hexagon/gen_tcg.h target/hexagon/genptr.c tests/tcg/hexagon/Makefile.target +1 more+254 -00 replies
16/21Hexagon (target/hexagon) Make special new_value for USRtarget/hexagon/README target/hexagon/cpu.h target/hexagon/gen_tcg_funcs.py +5 more+27 -120 replies
17/21Hexagon (target/hexagon) Move new_value to DisasContexttarget/hexagon/cpu.h target/hexagon/genptr.c target/hexagon/translate.c +1 more+9 -140 replies
18/21Hexagon (target/hexagon) Move new_pred_value to DisasContexttarget/hexagon/cpu.h target/hexagon/gen_tcg.h target/hexagon/gen_tcg_funcs.py +5 more+23 -240 replies
19/21Hexagon (target/hexagon) Move pred_written to DisasContexttarget/hexagon/cpu.h target/hexagon/genptr.c target/hexagon/helper.h +3 more+10 -120 replies
20/21Hexagon (target/hexagon) Move pkt_has_store_s1 to DisasContexttarget/hexagon/cpu.h target/hexagon/gen_analyze_funcs.py target/hexagon/gen_helper_funcs.py +8 more+51 -400 replies
21/21Hexagon (target/hexagon) Move items to DisasContexttarget/hexagon/README target/hexagon/cpu.h target/hexagon/genptr.c +5 more+21 -310 replies

Reviews trailers per patch

All 21 patches have a Reviewed-by or Acked-by.

PatchRichard HendersonBrian Cain
1/21R-b
2/21R-b
3/21A-b
4/21R-b
5/21R-b
6/21R-b
7/21A-b
8/21R-b
9/21R-b
10/21R-b
11/21R-b R-b
12/21R-b
13/21R-b
14/21R-b
15/21R-b
16/21R-b
17/21R-b
18/21R-b
19/21R-b
20/21R-b
21/21R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 00/21] Hexagon (target/hexagon) short-circuit and move to DisasContext

This patch series achieves two major goals
Goal 1: Short-circuit packet semantics

    In certain cases, we can avoid the overhead of writing to
    hex_new_value and write directly to hex_gpr.

    Here's a simple example of the TCG generated for
    0x004000b4:  0x7800c020 {       R0 = #0x1 }

    BEFORE:
     ---- 004000b4
     movi_i32 new_r0,$0x1
     mov_i32 r0,new_r0

    AFTER:
     ---- 004000b4
     movi_i32 r0,$0x1

Goal 2: Move bookkeeping items from CPUHexagonState to DisasContext

Several fields in CPUHexagonState are only used for bookkeeping within the translation of a packet. With recent changes to eliminate the need to free TCGv variables, these make more sense to be transient and kept in DisasContext.

This patch series can be divided into 3 main parts
Part 1: Patches 1-9
Cleanup in preparation for parts 2 and 3
The main goal is to move functionality out of generated helpers
Part 2: Patches 10-15
Short-circuit packet semantics
Part 3: Patches 16-21
Move bookkeeping items from CPUHexagonState to DisasContext

**** Changes in v2 ****
Address feedback from Richard Henderson <<[email protected]>
Cleaner implementation of gen_frame_scramble
Add g_assert_not_reached() in gen_framecheck
Move TCGv allocation inside gen_frame_scramble
Change tcg_gen_brcond_tl to tcg_gen_movcond_tl
Change static inline to G_GNUC_UNUSED
Removed in later patch
Change tcg_gen_not_i64 + tcg_gen_and_i64 to tcg_gen_andc_i64 Use full constant in gen_slotval

Taylor Simpson (21):
meson.build Add CONFIG_HEXAGON_IDEF_PARSER
Hexagon (target/hexagon) Add DisasContext arg to gen_log_reg_write Hexagon (target/hexagon) Add overrides for loop setup instructions Hexagon (target/hexagon) Add overrides for allocframe/deallocframe Hexagon (target/hexagon) Add overrides for clr[tf]new Hexagon (target/hexagon) Remove log_reg_write from op_helper.[ch] Hexagon (target/hexagon) Eliminate uses of log_pred_write function Hexagon (target/hexagon) Clean up pred_written usage Hexagon (target/hexagon) Don't overlap dest writes with source reads Hexagon (target/hexagon) Mark registers as read during packet analysis Hexagon (target/hexagon) Short-circuit packet register writes Hexagon (target/hexagon) Short-circuit packet predicate writes Hexagon (target/hexagon) Short-circuit packet HVX writes Hexagon (target/hexagon) Short-circuit more HVX single instruction
packets
Hexagon (target/hexagon) Add overrides for disabled idef-parser insns Hexagon (target/hexagon) Make special new_value for USR Hexagon (target/hexagon) Move new_value to DisasContext Hexagon (target/hexagon) Move new_pred_value to DisasContext Hexagon (target/hexagon) Move pred_written to DisasContext Hexagon (target/hexagon) Move pkt_has_store_s1 to DisasContext Hexagon (target/hexagon) Move items to DisasContext

 meson.build                                 |   1 +
 target/hexagon/cpu.h                        |  10 +-
 target/hexagon/gen_tcg.h                    | 116 ++++++-
 target/hexagon/gen_tcg_hvx.h                |  23 ++
 target/hexagon/genptr.h                     |   6 +-
 target/hexagon/helper.h                     |   6 +-
 target/hexagon/macros.h                     |  57 ++--
 target/hexagon/op_helper.h                  |  16 +-
 target/hexagon/translate.h                  |  52 ++-
 target/hexagon/attribs_def.h.inc            |   6 +-
 target/hexagon/arch.c                       |   3 +-
 target/hexagon/cpu.c                        |   5 +-
 target/hexagon/genptr.c                     | 347 ++++++++++++++++----
 target/hexagon/idef-parser/parser-helpers.c |   4 +-
 target/hexagon/op_helper.c                  | 154 ++++++---
 target/hexagon/translate.c                  | 272 ++++++++++-----
 tests/tcg/hexagon/hvx_misc.c                |  21 ++
 tests/tcg/hexagon/read_write_overlap.c      | 136 ++++++++
 target/hexagon/README                       |   6 +-
 target/hexagon/gen_analyze_funcs.py         |  51 ++-
 target/hexagon/gen_helper_funcs.py          |   9 +-
 target/hexagon/gen_helper_protos.py         |  10 +-
 target/hexagon/gen_idef_parser_funcs.py     |   7 +
 target/hexagon/gen_tcg_funcs.py             |  21 +-
 target/hexagon/hex_common.py                |  16 +-
 tests/tcg/hexagon/Makefile.target           |   1 +
 26 files changed, 1063 insertions(+), 293 deletions(-)
 create mode 100644 tests/tcg/hexagon/read_write_overlap.c
Signature · 1 line
2.25.1