Introduce helper-to-tcg
Get series with b4
b4 am [email protected]Versions newest first
- v2 Latest50 patches 37 repliesIn review
Changes in v2 from the cover letter
- Use QEMU_ANNOTATE over introducing LLVM_ANNOTATE (Philippe);
- Move .h -> .hpp to avoid checkpatch (Philppe);
- Meson changes (Paolo);
- Gvec size changing operations (zext/sext/trunc) along with constant vector creation has been moved from general gvec operations to being emitted by helper-to-tcg on demand. A simple interface for specifying the target vector layout is available through commandline options (Richard);
- Constant vectors initialized from arrays now vectorized;
- Introduced a model of target vector layouts;
- Shifted LLVM version support from 10-14 to 15-21;
- Improved end-to-end testing, now verifies output across LLVM versions, currently these tests along with their expected output serve as usage examples;
- Added docker tests for supported LLVM versions;
- Dropped the tcg_gen_callN dispatcher in favour of emitting gen_helper_*()
Patches in v2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/50 | accel/tcg: Add bitreverse and funnel-shift runtime helper functionsaccel/ accel/ | +34 | 2 replies | |
| 2/50 | accel/tcg: Add getpc helperaccel/ accel/ | +7 | 1 reply | |
| 3/50 | tcg: Introduce tcg-global-mappingsinclude/ tcg/ tcg/ | +181 | 1 reply | |
| 4/50 | tcg: Increase maximum TB sizeinclude/ | +1 | 1 reply | |
| 5/50 | tcg: Expose tcg_gen_ussub_sat()include/ tcg/ | +4 | 2 replies | |
| 6/50 | Add helper-to-tcg subprojectmeson.build meson_options.txt scripts/ +2 more | +80 | 1 reply | |
| 7/50 | helper-to-tcg: Introduce get-llvm-ir.pysubprojects/ subprojects/ | +153 | 2 replies | |
| 8/50 | helper-to-tcg: Handle LLVM version compatibilitysubprojects/ subprojects/ subprojects/ | +214 | 1 reply | |
| 9/50 | helper-to-tcg: Introduce custom LLVM pipelinesubprojects/ subprojects/ subprojects/ | +170 | 0 replies | |
| 10/50 | helper-to-tcg: Add pipeline --debug and --debug-onlysubprojects/ | +24 | 0 replies | |
| 11/50 | helper-to-tcg: Add simple error creation helpersubprojects/ | +38 | 0 replies | |
| 12/50 | helper-to-tcg: Introduce PrepareForOptPasssubprojects/ subprojects/ subprojects/ +1 more | +91 | 0 replies | |
| 13/50 | helper-to-tcg: PrepareForOptPass, demangle function namessubprojects/ | +42 | 2 replies | |
| 14/50 | helper-to-tcg: PrepareForOptPass, map annotationssubprojects/ subprojects/ subprojects/ +1 more | +209 | 3 replies | |
| 15/50 | helper-to-tcg: PrepareForOptPass, cull unused functionssubprojects/ subprojects/ subprojects/ +1 more | +96 | 1 reply | |
| 16/50 | helper-to-tcg: PrepareForOptPass, undef llvm.returnaddresssubprojects/ | +47 | 1 reply | |
| 17/50 | helper-to-tcg: PrepareForOptPass, fixup inline attributessubprojects/ | +14 | 1 reply | |
| 18/50 | helper-to-tcg: PrepareForOptPass, collect debuginfosubprojects/ subprojects/ subprojects/ +1 more | +107 | 1 reply | |
| 19/50 | helper-to-tcg: Pipeline, run optimization passsubprojects/ | +12 | 1 reply | |
| 20/50 | helper-to-tcg: Introduce pseudo instructionssubprojects/ subprojects/ subprojects/ +1 more | +337 | 1 reply | |
| 21/50 | helper-to-tcg: Add guest vector layout descriptionsubprojects/ | +116 | 1 reply | |
| 22/50 | helper-to-tcg: Introduce PrepareForTcgPasssubprojects/ subprojects/ subprojects/ +2 more | +79 | 1 reply | |
| 23/50 | helper-to-tcg: PrepareForTcgPass, remove functions with cyclessubprojects/ | +32 | 1 reply | |
| 24/50 | helper-to-tcg: PrepareForTcgPass, demote PHI nodessubprojects/ | +23 | 1 reply | |
| 25/50 | helper-to-tcg: PrepareForTcgPass, map TCG globalssubprojects/ subprojects/ subprojects/ +1 more | +112 | 0 replies | |
| 26/50 | helper-to-tcg: PrepareForTcgPass, transform GEPssubprojects/ subprojects/ subprojects/ +3 more | +411 | 0 replies | |
| 27/50 | helper-to-tcg: PrepareForTcgPass, canonicalize IRsubprojects/ subprojects/ subprojects/ +4 more | +1290 | 0 replies | |
| 28/50 | helper-to-tcg: PrepareForTcgPass, identity map trivial expressionssubprojects/ subprojects/ subprojects/ +1 more | +135 | 0 replies | |
| 29/50 | helper-to-tcg: Introduce TcgV structuresubprojects/ | +276 | 0 replies | |
| 30/50 | helper-to-tcg: Introduce TcgGenPasssubprojects/ subprojects/ subprojects/ +2 more | +561 | 2 replies | |
| 31/50 | helper-to-tcg: TcgGenPass, linearize basic blockssubprojects/ subprojects/ subprojects/ | +173 | 1 reply | |
| 32/50 | helper-to-tcg: TcgGenPass, introduce Value <-> TcgV mapsubprojects/ | +110 | 0 replies | |
| 33/50 | helper-to-tcg: TcgGenPass, add structs for string emissionsubprojects/ subprojects/ subprojects/ | +1519 | 0 replies | |
| 34/50 | helper-to-tcg: TcgGenPass, map arguments to TCGsubprojects/ subprojects/ | +123 | 0 replies | |
| 35/50 | helper-to-tcg: TcgGenPass, propagate constant expresssionssubprojects/ subprojects/ | +329 | 0 replies | |
| 36/50 | helper-to-tcg: TcgGenPass, allocate TCG registerssubprojects/ subprojects/ | +620 | 0 replies | |
| 37/50 | helper-to-tcg: TcgGenPass, emit TCG stringssubprojects/ subprojects/ | +989 | 0 replies | |
| 38/50 | helper-to-tcg: Add READMEsubprojects/ | +297 | 0 replies | |
| 39/50 | helper-to-tcg: Add end-to-end testssubprojects/ subprojects/ subprojects/ +57 more | +17835 | 0 replies | |
| 40/50 | test: helper-to-tcg docker teststests/ tests/ | +79 | 3 replies | |
| 41/50 | target/hexagon: Add get_tb_mmu_index()target/ target/ | +16 | 1 reply | |
| 42/50 | target/hexagon: Increase VECTOR_TEMPS_MAXtarget/ | +5 | 0 replies | |
| 43/50 | target/hexagon: Provide env to tcg global mappingtarget/ | +57 | 1 reply | |
| 44/50 | target/hexagon: Keep gen_slotval/check_noshuf for helper-to-tcgtarget/ target/ | +2 | 1 reply | |
| 45/50 | target/hexagon: Emit annotations for helperstarget/ target/ target/ +1 more | +54 | 0 replies | |
| 46/50 | target/hexagon: Split probe_and_commit helpertarget/ target/ | +15 | 1 reply | |
| 47/50 | target/hexagon: Use helper-to-tcg helper callstarget/ target/ target/ | +20 | 0 replies | |
| 48/50 | target/hexagon: Manually call generated HVX instructionstarget/ target/ | +72 | 0 replies | |
| 49/50 | target/hexagon: Use idef-parser as a fallbacktarget/ | +9 | 0 replies | |
| 50/50 | target/hexagon: Use helper-to-tcgconfigs/ configs/ target/ | +110 | 1 reply |
Reviews trailers per patch
19 of 50 patches have a Reviewed-by or Acked-by.
| Patch | Philippe Mathieu-Daudé | Alessandro Di Federico |
|---|---|---|
| 1/50 | R-b | |
| 2/50 | ||
| 3/50 | ||
| 4/50 | ||
| 5/50 | R-b | |
| 6/50 | ||
| 7/50 | R-b | |
| 8/50 | ||
| 9/50 | ||
| 10/50 | ||
| 11/50 | ||
| 12/50 | ||
| 13/50 | R-b | |
| 14/50 | R-b | |
| 15/50 | R-b | |
| 16/50 | R-b | |
| 17/50 | R-b | |
| 18/50 | R-b | |
| 19/50 | R-b | |
| 20/50 | R-b | |
| 21/50 | R-b | |
| 22/50 | R-b | |
| 23/50 | R-b | |
| 24/50 | R-b | |
| 25/50 | ||
| 26/50 | ||
| 27/50 | ||
| 28/50 | ||
| 29/50 | ||
| 30/50 | ||
| 31/50 | R-b | |
| 32/50 | ||
| 33/50 | ||
| 34/50 | ||
| 35/50 | ||
| 36/50 | ||
| 37/50 | ||
| 38/50 | ||
| 39/50 | ||
| 40/50 | R-b | |
| 41/50 | R-b | |
| 42/50 | ||
| 43/50 | ||
| 44/50 | ||
| 45/50 | ||
| 46/50 | R-b | |
| 47/50 | ||
| 48/50 | ||
| 49/50 | ||
| 50/50 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v2 00/50] Introduce helper-to-tcg
Hi all, this patchset introduces helper-to-tcg, a LLVM based build-time C to TCG translator, as a QEMU subproject. The purpose of this tool is to simplify implementation of instructions in TCG by automatically translating helper functions for a given target to TCG. It may also be used as a standalone tool for getting a base TCG implementation for complicated instructions.
See KVM forum 2023 and 2025 presentations which give an overview of its application to Hexagon and RISCV:
- https://www.youtube.com/watch?v=Gwz0kp7IZPE
- https://www.youtube.com/watch?v=7qIwraM3-4I
helper-to-tcg is also applied to the Hexagon frontend, managing to translate 1280 instructions, 162 of which are HVX instructions. In the current patchset we translate 1240 instructions due to limiting emission of the heavier vectorized instructions which requires larger TBs and more vector temporaries. For the time being, idef-parser remains translating 281 instructions consisting mostly of complicated load instructions. This count will be reduced over time until idef-parser can be deprecated.
As an example, consider the following helper function implementation of a Hexagon instruction for performing a 2-element scalar product, using signed saturated arithmetic
void HELPER(V6_vdmpyhvsat)(CPUHexagonState *env,
void * restrict VdV_void,
void * restrict VuV_void,
void * restrict VvV_void)
{
fVFOREACH(32, i) {
size8s_t accum = fMPY16SS(fGETHALF(0,VuV.w[i]),fGETHALF(0, VvV.w[i]));
accum += fMPY16SS(fGETHALF(1,VuV.w[i]),fGETHALF(1, VvV.w[i]));
VdV.w[i] = fVSATW(accum);
}
}which at the end of the helper-to-tcg pipeline will have been converted to the following LLVM IR
define void @helper_V6_vdmpyhvsat(%struct.CPUArchState* %0,
i8* %1, i8* %2, i8* %3) {
%4 = bitcast i8* %2 to <32 x i32>*
%wide.load = load <32 x i32>, <32 x i32>* %4
%5 = call <32 x i32> @VecShlScalar(<32 x i32> %wide.load, i32 16)
%6 = call <32 x i32> @VecAShrScalar(<32 x i32> %5, i32 16)
%7 = bitcast i8* %3 to <32 x i32>*
%wide.load23 = load <32 x i32>, <32 x i32>* %7
%8 = call <32 x i32> @VecShlScalar(<32 x i32> %wide.load23, i32 16)
%9 = call <32 x i32> @VecAShrScalar(<32 x i32> %8, i32 16)
%10 = mul nsw <32 x i32> %9, %6
%11 = call <32 x i32> @VecAShrScalar(<32 x i32> %wide.load, i32 16)
%12 = call <32 x i32> @VecAShrScalar(<32 x i32> %wide.load23, i32 16)
%13 = mul nsw <32 x i32> %12, %11
%14 = bitcast i8* %1 to <32 x i32>*
ret void
}which, in TCG, gets emitted as
void emit_V6_vdmpyhvsat(TCGv_env env, intptr_t vec3,
intptr_t vec7, intptr_t vec6) {
VectorMem mem = {0};
intptr_t vec0 = temp_new_gvec(&mem, 128);
tcg_gen_gvec_shli(MO_32, vec0, vec7, 16, 128, 128);
intptr_t vec5 = temp_new_gvec(&mem, 128);
tcg_gen_gvec_sari(MO_32, vec5, vec0, 16, 128, 128);
intptr_t vec1 = temp_new_gvec(&mem, 128);
tcg_gen_gvec_shli(MO_32, vec1, vec6, 16, 128, 128);
tcg_gen_gvec_sari(MO_32, vec1, vec1, 16, 128, 128);
tcg_gen_gvec_mul(MO_32, vec1, vec1, vec5, 128, 128);
intptr_t vec2 = temp_new_gvec(&mem, 128);
tcg_gen_gvec_sari(MO_32, vec2, vec7, 16, 128, 128);
tcg_gen_gvec_sari(MO_32, vec0, vec6, 16, 128, 128);
tcg_gen_gvec_mul(MO_32, vec2, vec0, vec2, 128, 128);
tcg_gen_gvec_ssadd(MO_32, vec3, vec1, vec2, 128, 128);
}consisting of a few vectorized shifts, multiplications, and a signed saturated add.
For a more in-depth usage guide see subprojects/helper-to-tcg/README.md.
Limitations:
- Does not handle functions with multiple return values. On Hexagon, a large set of instructions still translated by idef-parser fall into this category.
- Can emit complicated vector operations that are not the most host-friendly, identifying and emitting custom GVec patterns would be interesting.
Patchset overview:
1. helper-to-tcg (patches 6-40) - Introduces the actual translator as a QEMU subproject.
2. Fills gaps in TCG instructions (patches 1,2,5) - Since the tool is LLVM based it allows for translation of vector instructions to gvec instructions in Tinycode. This requires the introduction of a few new tcg_gen_gvec_*() functions for dealing with sign- and zero-extension, along with a function for initializing a vector to a constant, and functions for bitreversal and funnel shift.
3. Mapping of cpu state (patch 3) - helper-to-tcg needs information about the offsets of fields in the cpu state that correspond to TCG globals, so these can be emitted in the output code. For this purpose, a target may define an array of struct cpu_tcg_mapping to map fields in the cpu state to TCG globals in a declarative way. This global array can be parsed by helper-to-tcg, and replaces manually calling tcg_global_mem_new*() in frontend.
4. Increases max size of generated TB code (patch 4) - Due to the power of the LLVM auto-vectorizer, helper-to-tcg can emit quite complicated vectorized gvec code. Particularly for Hexagon where a single instruction packet can consist of multiple vector instructions. A single instruction packet can in rare cases exceed the TB buffer size of 128 longs.
5. Applies helper-to-tcg to Hexagon (patches 41-50) - helper-to-tcg is used on the Hexagon frontend to translate a majority of helper functions in place of idef-parser. For the time being idef-parser will remain in use to translate instructions with multiple return values that are not representable as helper functions and therefore translatable with helper-to-tcg.
Changes in v2:
- Use QEMU_ANNOTATE over introducing LLVM_ANNOTATE (Philippe);
- Move .h -> .hpp to avoid checkpatch (Philppe);
- Meson changes (Paolo);
- Gvec size changing operations (zext/sext/trunc) along with constant vector creation has been moved from general gvec operations to being emitted by helper-to-tcg on demand. A simple interface for specifying the target vector layout is available through commandline options (Richard);
- Constant vectors initialized from arrays now vectorized;
- Introduced a model of target vector layouts;
- Shifted LLVM version support from 10-14 to 15-21;
- Improved end-to-end testing, now verifies output across LLVM versions, currently these tests along with their expected output serve as usage examples;
- Added docker tests for supported LLVM versions;
- Dropped the tcg_gen_callN dispatcher in favour of emitting gen_helper_*()
definitions directly;
- Optionally allow calls to declarations, custom jump instructions, and propagation of
DisasContext to better slot into existing frontends;
- Limit vector usage for hexagon to 8 temporaries and 16 gvec
instructions, also use existing `tmp_VRegs[]` memory.- Many cleanups and bugfixes.
Anton Johansson (50):
accel/tcg: Add bitreverse and funnel-shift runtime helper functions accel/tcg: Add getpc helper
tcg: Introduce tcg-global-mappings
tcg: Increase maximum TB size
tcg: Expose tcg_gen_ussub_sat()
Add helper-to-tcg subproject
helper-to-tcg: Introduce get-llvm-ir.py
helper-to-tcg: Handle LLVM version compatibility
helper-to-tcg: Introduce custom LLVM pipeline
helper-to-tcg: Add pipeline --debug and --debug-only
helper-to-tcg: Add simple error creation helper
helper-to-tcg: Introduce PrepareForOptPass
helper-to-tcg: PrepareForOptPass, demangle function names
helper-to-tcg: PrepareForOptPass, map annotations
helper-to-tcg: PrepareForOptPass, cull unused functions
helper-to-tcg: PrepareForOptPass, undef llvm.returnaddress
helper-to-tcg: PrepareForOptPass, fixup inline attributes
helper-to-tcg: PrepareForOptPass, collect debuginfo
helper-to-tcg: Pipeline, run optimization pass
helper-to-tcg: Introduce pseudo instructions
helper-to-tcg: Add guest vector layout description
helper-to-tcg: Introduce PrepareForTcgPass
helper-to-tcg: PrepareForTcgPass, remove functions with cycles
helper-to-tcg: PrepareForTcgPass, demote PHI nodes
helper-to-tcg: PrepareForTcgPass, map TCG globals
helper-to-tcg: PrepareForTcgPass, transform GEPs
helper-to-tcg: PrepareForTcgPass, canonicalize IR
helper-to-tcg: PrepareForTcgPass, identity map trivial expressions
helper-to-tcg: Introduce TcgV structure
helper-to-tcg: Introduce TcgGenPass
helper-to-tcg: TcgGenPass, linearize basic blocks
helper-to-tcg: TcgGenPass, introduce Value <-> TcgV map
helper-to-tcg: TcgGenPass, add structs for string emission
helper-to-tcg: TcgGenPass, map arguments to TCG
helper-to-tcg: TcgGenPass, propagate constant expresssions
helper-to-tcg: TcgGenPass, allocate TCG registers
helper-to-tcg: TcgGenPass, emit TCG strings
helper-to-tcg: Add README
helper-to-tcg: Add end-to-end tests
test: helper-to-tcg docker tests
target/hexagon: Add get_tb_mmu_index()
target/hexagon: Increase VECTOR_TEMPS_MAX target/hexagon: Provide env to tcg global mapping target/hexagon: Keep gen_slotval/check_noshuf for helper-to-tcg target/hexagon: Emit annotations for helpers target/hexagon: Split probe_and_commit helper target/hexagon: Use helper-to-tcg helper calls target/hexagon: Manually call generated HVX instructions target/hexagon: Use idef-parser as a fallback target/hexagon: Use helper-to-tcg
accel/tcg/tcg-runtime.c | 33 + accel/tcg/tcg-runtime.h | 8 + configs/targets/hexagon-linux-user.mak | 1 + configs/targets/hexagon-softmmu.mak | 1 + include/tcg/tcg-global-mappings.h | 118 ++ include/tcg/tcg-op-common.h | 2 + include/tcg/tcg.h | 2 +- meson.build | 10 + meson_options.txt | 2 + scripts/meson-buildoptions.sh | 5 + subprojects/helper-to-tcg/README.md | 297 ++++ subprojects/helper-to-tcg/get-llvm-ir.py | 145 ++ .../helper-to-tcg/include/CmdLineOptions.hpp | 46 + .../helper-to-tcg/include/DebugInfo.hpp | 46 + subprojects/helper-to-tcg/include/Error.hpp | 38 + .../include/FunctionAnnotation.hpp | 104 ++ .../helper-to-tcg/include/LlvmCompat.hpp | 124 ++ .../include/PrepareForOptPass.hpp | 42 + .../include/PrepareForTcgPass.hpp | 37 + .../helper-to-tcg/include/PseudoInst.hpp | 75 + .../helper-to-tcg/include/PseudoInst.inc | 78 ++ .../helper-to-tcg/include/TcgGenPass.hpp | 63 + .../helper-to-tcg/include/TcgGlobalMap.hpp | 40 + subprojects/helper-to-tcg/include/TcgType.hpp | 276 ++++ .../helper-to-tcg/include/VectorLayout.hpp | 116 ++ subprojects/helper-to-tcg/meson.build | 86 ++ subprojects/helper-to-tcg/meson_options.txt | 2 + subprojects/helper-to-tcg/src/LlvmCompat.cpp | 89 ++ subprojects/helper-to-tcg/src/Pipeline.cpp | 399 ++++++ .../PrepareForOptPass/PrepareForOptPass.cpp | 363 +++++ .../src/PrepareForTcgPass/CanonicalizeIR.cpp | 1193 ++++++++++++++++ .../src/PrepareForTcgPass/CanonicalizeIR.hpp | 24 + .../src/PrepareForTcgPass/IdentityMap.cpp | 91 ++ .../src/PrepareForTcgPass/IdentityMap.hpp | 39 + .../PrepareForTcgPass/PrepareForTcgPass.cpp | 150 ++ .../src/PrepareForTcgPass/TransformGEPs.cpp | 355 +++++ .../src/PrepareForTcgPass/TransformGEPs.hpp | 45 + subprojects/helper-to-tcg/src/PseudoInst.cpp | 183 +++ .../src/TcgGenPass/LinearizeBlocks.cpp | 140 ++ .../src/TcgGenPass/LinearizeBlocks.hpp | 32 + .../src/TcgGenPass/MapArguments.cpp | 122 ++ .../src/TcgGenPass/MapConstantExpressions.cpp | 328 +++++ .../src/TcgGenPass/MapTcgOperations.cpp | 988 ++++++++++++++ .../src/TcgGenPass/MapTemporaries.cpp | 619 +++++++++ .../helper-to-tcg/src/TcgGenPass/TcgEmit.cpp | 1203 +++++++++++++++++ .../helper-to-tcg/src/TcgGenPass/TcgEmit.hpp | 315 +++++ .../src/TcgGenPass/TcgGenPass.cpp | 385 ++++++ .../src/TcgGenPass/ValueMapping.hpp | 110 ++ .../helper-to-tcg/tests/call-to-declaration.c | 33 + .../helper-to-tcg/tests/call-translation.c | 35 + subprojects/helper-to-tcg/tests/cpustate.c | 44 + .../helper-to-tcg/tests/forward-context.c | 21 + subprojects/helper-to-tcg/tests/ldst.c | 17 + subprojects/helper-to-tcg/tests/meson.build | 121 ++ .../tests/ref/15/call-to-declaration.c | 26 + .../tests/ref/15/call-translation.c | 28 + .../helper-to-tcg/tests/ref/15/cpustate.c | 36 + .../tests/ref/15/forward-context.c | 30 + subprojects/helper-to-tcg/tests/ref/15/ldst.c | 21 + .../helper-to-tcg/tests/ref/15/scalar.c | 21 + .../tests/ref/15/user-pcrel-jump.c | 33 + .../tests/ref/15/vector-layout-f16L.c | 527 ++++++++ .../tests/ref/15/vector-layout-f16M.c | 527 ++++++++ .../tests/ref/15/vector-layout-f32L.c | 527 ++++++++ .../tests/ref/15/vector-layout-f32M.c | 527 ++++++++ .../tests/ref/15/vector-layout-f64L.c | 527 ++++++++ .../tests/ref/15/vector-layout-f64M.c | 527 ++++++++ .../tests/ref/15/vector-layout-f8L.c | 527 ++++++++ .../tests/ref/15/vector-layout-f8M.c | 527 ++++++++ .../tests/ref/15/vector-layout-t16L.c | 527 ++++++++ .../tests/ref/15/vector-layout-t16M.c | 527 ++++++++ .../tests/ref/15/vector-layout-t32L.c | 527 ++++++++ .../tests/ref/15/vector-layout-t32M.c | 527 ++++++++ .../tests/ref/15/vector-layout-t64L.c | 527 ++++++++ .../tests/ref/15/vector-layout-t64M.c | 527 ++++++++ .../tests/ref/15/vector-layout-t8L.c | 527 ++++++++ .../tests/ref/15/vector-layout-t8M.c | 527 ++++++++ .../helper-to-tcg/tests/ref/15/vector.c | 31 + .../tests/ref/21/call-to-declaration.c | 26 + .../tests/ref/21/call-translation.c | 28 + .../helper-to-tcg/tests/ref/21/cpustate.c | 36 + .../tests/ref/21/forward-context.c | 30 + subprojects/helper-to-tcg/tests/ref/21/ldst.c | 21 + .../helper-to-tcg/tests/ref/21/scalar.c | 21 + .../tests/ref/21/user-pcrel-jump.c | 33 + .../tests/ref/21/vector-layout-f16L.c | 527 ++++++++ .../tests/ref/21/vector-layout-f16M.c | 527 ++++++++ .../tests/ref/21/vector-layout-f32L.c | 527 ++++++++ .../tests/ref/21/vector-layout-f32M.c | 527 ++++++++ .../tests/ref/21/vector-layout-f64L.c | 527 ++++++++ .../tests/ref/21/vector-layout-f64M.c | 527 ++++++++ .../tests/ref/21/vector-layout-f8L.c | 527 ++++++++ .../tests/ref/21/vector-layout-f8M.c | 527 ++++++++ .../tests/ref/21/vector-layout-t16L.c | 527 ++++++++ .../tests/ref/21/vector-layout-t16M.c | 527 ++++++++ .../tests/ref/21/vector-layout-t32L.c | 527 ++++++++ .../tests/ref/21/vector-layout-t32M.c | 527 ++++++++ .../tests/ref/21/vector-layout-t64L.c | 527 ++++++++ .../tests/ref/21/vector-layout-t64M.c | 527 ++++++++ .../tests/ref/21/vector-layout-t8L.c | 527 ++++++++ .../tests/ref/21/vector-layout-t8M.c | 527 ++++++++ .../helper-to-tcg/tests/ref/21/vector.c | 31 + subprojects/helper-to-tcg/tests/scalar.c | 15 + .../helper-to-tcg/tests/tcg-global-mappings.h | 118 ++ .../helper-to-tcg/tests/user-pcrel-jump.c | 28 + .../helper-to-tcg/tests/vector-layout.c | 51 + subprojects/helper-to-tcg/tests/vector.c | 34 + target/hexagon/cpu.h | 6 +- target/hexagon/gen_helper_funcs.py | 17 +- target/hexagon/gen_helper_protos.py | 2 +- target/hexagon/gen_idef_parser_funcs.py | 9 + target/hexagon/gen_tcg_funcs.py | 16 +- target/hexagon/genptr.c | 6 +- target/hexagon/helper.h | 9 + target/hexagon/hex_common.py | 103 +- target/hexagon/meson.build | 148 +- target/hexagon/op_helper.c | 17 +- target/hexagon/translate.c | 139 +- target/hexagon/translate.h | 4 + tcg/meson.build | 1 + tcg/tcg-global-mappings.c | 62 + tcg/tcg-op-gvec.c | 4 +- tests/docker/dockerfiles/debian-llvm.docker | 38 + tests/docker/test-helper-to-tcg | 41 + 124 files changed, 27303 insertions(+), 122 deletions(-) create mode 100644 include/tcg/tcg-global-mappings.h create mode 100644 subprojects/helper-to-tcg/README.md create mode 100755 subprojects/helper-to-tcg/get-llvm-ir.py create mode 100644 subprojects/helper-to-tcg/include/CmdLineOptions.hpp create mode 100644 subprojects/helper-to-tcg/include/DebugInfo.hpp create mode 100644 subprojects/helper-to-tcg/include/Error.hpp create mode 100644 subprojects/helper-to-tcg/include/FunctionAnnotation.hpp create mode 100644 subprojects/helper-to-tcg/include/LlvmCompat.hpp create mode 100644 subprojects/helper-to-tcg/include/PrepareForOptPass.hpp create mode 100644 subprojects/helper-to-tcg/include/PrepareForTcgPass.hpp create mode 100644 subprojects/helper-to-tcg/include/PseudoInst.hpp create mode 100644 subprojects/helper-to-tcg/include/PseudoInst.inc create mode 100644 subprojects/helper-to-tcg/include/TcgGenPass.hpp create mode 100644 subprojects/helper-to-tcg/include/TcgGlobalMap.hpp create mode 100644 subprojects/helper-to-tcg/include/TcgType.hpp create mode 100644 subprojects/helper-to-tcg/include/VectorLayout.hpp create mode 100644 subprojects/helper-to-tcg/meson.build create mode 100644 subprojects/helper-to-tcg/meson_options.txt create mode 100644 subprojects/helper-to-tcg/src/LlvmCompat.cpp create mode 100644 subprojects/helper-to-tcg/src/Pipeline.cpp create mode 100644 subprojects/helper-to-tcg/src/PrepareForOptPass/PrepareForOptPass.cpp create mode 100644 subprojects/helper-to-tcg/src/PrepareForTcgPass/CanonicalizeIR.cpp create mode 100644 subprojects/helper-to-tcg/src/PrepareForTcgPass/CanonicalizeIR.hpp create mode 100644 subprojects/helper-to-tcg/src/PrepareForTcgPass/IdentityMap.cpp create mode 100644 subprojects/helper-to-tcg/src/PrepareForTcgPass/IdentityMap.hpp create mode 100644 subprojects/helper-to-tcg/src/PrepareForTcgPass/PrepareForTcgPass.cpp create mode 100644 subprojects/helper-to-tcg/src/PrepareForTcgPass/TransformGEPs.cpp create mode 100644 subprojects/helper-to-tcg/src/PrepareForTcgPass/TransformGEPs.hpp create mode 100644 subprojects/helper-to-tcg/src/PseudoInst.cpp create mode 100644 subprojects/helper-to-tcg/src/TcgGenPass/LinearizeBlocks.cpp create mode 100644 subprojects/helper-to-tcg/src/TcgGenPass/LinearizeBlocks.hpp create mode 100644 subprojects/helper-to-tcg/src/TcgGenPass/MapArguments.cpp create mode 100644 subprojects/helper-to-tcg/src/TcgGenPass/MapConstantExpressions.cpp create mode 100644 subprojects/helper-to-tcg/src/TcgGenPass/MapTcgOperations.cpp create mode 100644 subprojects/helper-to-tcg/src/TcgGenPass/MapTemporaries.cpp create mode 100644 subprojects/helper-to-tcg/src/TcgGenPass/TcgEmit.cpp create mode 100644 subprojects/helper-to-tcg/src/TcgGenPass/TcgEmit.hpp create mode 100644 subprojects/helper-to-tcg/src/TcgGenPass/TcgGenPass.cpp create mode 100644 subprojects/helper-to-tcg/src/TcgGenPass/ValueMapping.hpp create mode 100644 subprojects/helper-to-tcg/tests/call-to-declaration.c create mode 100644 subprojects/helper-to-tcg/tests/call-translation.c create mode 100644 subprojects/helper-to-tcg/tests/cpustate.c create mode 100644 subprojects/helper-to-tcg/tests/forward-context.c create mode 100644 subprojects/helper-to-tcg/tests/ldst.c create mode 100644 subprojects/helper-to-tcg/tests/meson.build create mode 100644 subprojects/helper-to-tcg/tests/ref/15/call-to-declaration.c create mode 100644 subprojects/helper-to-tcg/tests/ref/15/call-translation.c create mode 100644 subprojects/helper-to-tcg/tests/ref/15/cpustate.c create mode 100644 subprojects/helper-to-tcg/tests/ref/15/forward-context.c create mode 100644 subprojects/helper-to-tcg/tests/ref/15/ldst.c create mode 100644 subprojects/helper-to-tcg/tests/ref/15/scalar.c create mode 100644 subprojects/helper-to-tcg/tests/ref/15/user-pcrel-jump.c create mode 100644 subprojects/helper-to-tcg/tests/ref/15/vector-layout-f16L.c create mode 100644 subprojects/helper-to-tcg/tests/ref/15/vector-layout-f16M.c create mode 100644 subprojects/helper-to-tcg/tests/ref/15/vector-layout-f32L.c create mode 100644 subprojects/helper-to-tcg/tests/ref/15/vector-layout-f32M.c create mode 100644 subprojects/helper-to-tcg/tests/ref/15/vector-layout-f64L.c create mode 100644 subprojects/helper-to-tcg/tests/ref/15/vector-layout-f64M.c create mode 100644 subprojects/helper-to-tcg/tests/ref/15/vector-layout-f8L.c create mode 100644 subprojects/helper-to-tcg/tests/ref/15/vector-layout-f8M.c create mode 100644 subprojects/helper-to-tcg/tests/ref/15/vector-layout-t16L.c create mode 100644 subprojects/helper-to-tcg/tests/ref/15/vector-layout-t16M.c create mode 100644 subprojects/helper-to-tcg/tests/ref/15/vector-layout-t32L.c create mode 100644 subprojects/helper-to-tcg/tests/ref/15/vector-layout-t32M.c create mode 100644 subprojects/helper-to-tcg/tests/ref/15/vector-layout-t64L.c create mode 100644 subprojects/helper-to-tcg/tests/ref/15/vector-layout-t64M.c create mode 100644 subprojects/helper-to-tcg/tests/ref/15/vector-layout-t8L.c create mode 100644 subprojects/helper-to-tcg/tests/ref/15/vector-layout-t8M.c create mode 100644 subprojects/helper-to-tcg/tests/ref/15/vector.c create mode 100644 subprojects/helper-to-tcg/tests/ref/21/call-to-declaration.c create mode 100644 subprojects/helper-to-tcg/tests/ref/21/call-translation.c create mode 100644 subprojects/helper-to-tcg/tests/ref/21/cpustate.c create mode 100644 subprojects/helper-to-tcg/tests/ref/21/forward-context.c create mode 100644 subprojects/helper-to-tcg/tests/ref/21/ldst.c create mode 100644 subprojects/helper-to-tcg/tests/ref/21/scalar.c create mode 100644 subprojects/helper-to-tcg/tests/ref/21/user-pcrel-jump.c create mode 100644 subprojects/helper-to-tcg/tests/ref/21/vector-layout-f16L.c create mode 100644 subprojects/helper-to-tcg/tests/ref/21/vector-layout-f16M.c create mode 100644 subprojects/helper-to-tcg/tests/ref/21/vector-layout-f32L.c create mode 100644 subprojects/helper-to-tcg/tests/ref/21/vector-layout-f32M.c create mode 100644 subprojects/helper-to-tcg/tests/ref/21/vector-layout-f64L.c create mode 100644 subprojects/helper-to-tcg/tests/ref/21/vector-layout-f64M.c create mode 100644 subprojects/helper-to-tcg/tests/ref/21/vector-layout-f8L.c create mode 100644 subprojects/helper-to-tcg/tests/ref/21/vector-layout-f8M.c create mode 100644 subprojects/helper-to-tcg/tests/ref/21/vector-layout-t16L.c create mode 100644 subprojects/helper-to-tcg/tests/ref/21/vector-layout-t16M.c create mode 100644 subprojects/helper-to-tcg/tests/ref/21/vector-layout-t32L.c create mode 100644 subprojects/helper-to-tcg/tests/ref/21/vector-layout-t32M.c create mode 100644 subprojects/helper-to-tcg/tests/ref/21/vector-layout-t64L.c create mode 100644 subprojects/helper-to-tcg/tests/ref/21/vector-layout-t64M.c create mode 100644 subprojects/helper-to-tcg/tests/ref/21/vector-layout-t8L.c create mode 100644 subprojects/helper-to-tcg/tests/ref/21/vector-layout-t8M.c create mode 100644 subprojects/helper-to-tcg/tests/ref/21/vector.c create mode 100644 subprojects/helper-to-tcg/tests/scalar.c create mode 100644 subprojects/helper-to-tcg/tests/tcg-global-mappings.h create mode 100644 subprojects/helper-to-tcg/tests/user-pcrel-jump.c create mode 100644 subprojects/helper-to-tcg/tests/vector-layout.c create mode 100644 subprojects/helper-to-tcg/tests/vector.c create mode 100644 tcg/tcg-global-mappings.c create mode 100644 tests/docker/dockerfiles/debian-llvm.docker create mode 100755 tests/docker/test-helper-to-tcg
Signature · 1 line
2.52.0