Hexagon (target/hexagon) Only pass env to generated helper when needed
authorTaylor Simpson <ltaylorsimpson@gmail.com>
Wed, 14 Feb 2024 04:27:26 +0000 (21:27 -0700)
committerBrian Cain <bcain@quicinc.com>
Sun, 5 May 2024 23:22:07 +0000 (16:22 -0700)
commit2f0a771ddcb55cea39046502e8e834eb44b5fff7
treeb213e266c136a039570ae4d1965f5e8064fe0983
parentf7be65fbbfe3a88619a80181d79993aa8d4dc645
Hexagon (target/hexagon) Only pass env to generated helper when needed

Currently, we pass env to every generated helper.  When the semantics of
the instruction only depend on the arguments, this is unnecessary and
adds extra overhead to the helper call.

We add the TCG_CALL_NO_RWG_SE flag to any non-HVX helpers that don't get
the ptr to env.

The A2_nop and SA1_setin1 instructions end up with no arguments.  This
results in a "old-style function definition" error from the compiler, so
we write overrides for them.

With this change, the number of helpers with env argument is
    idef-parser enabled:    329 total, 23 with env
    idef-parser disabled:   1543 total, 550 with env

Signed-off-by: Taylor Simpson <ltaylorsimpson@gmail.com>
Reviewed-by: Anton Johansson <anjo@rev.ng>
Tested-by: Anton Johansson <anjo@rev.ng>
Message-Id: <20240214042726.19290-4-ltaylorsimpson@gmail.com>
Signed-off-by: Brian Cain <bcain@quicinc.com>
target/hexagon/gen_helper_protos.py
target/hexagon/gen_tcg.h
target/hexagon/hex_common.py