target/hexagon: introduce idef-parser
Subsystems (2)
v9 cover target/hexagon: introduce idef-parser
This patchset introduces the idef-parser for target/hexagon.
It's the ninth iteration of the patchset and includes fixes suggested in previous iterations.
idef-parser is a build-time tool built using flex and bison. Its aim is to generate a large part of the tiny code generator frontend for Hexagon. The prototype of idef-parser has been presented at KVM Forum 2019 ("QEMU-Hexagon: Automatic Translation of the ISA Manual Pseudocode to Tiny Code Instructions"):
https://www.youtube.com/watch?v=3EpnTYBOXCI
target/hexagon/idef-parser/README.rst provides an overview of the parser and its inner working.
A couple of notes:
* These commits build successfully on the CI (including using clang), with one notable exception. Presently, the build-user-hexagon job fails due to not being able to find flex/bison. This is due to the debian-hexagon-cross container not being built by the CI.
As such the debian-hexagon-cross container will have to be manually rebuilt before merging.
* checkpatch.pl complains about the _Generic macro OUT_IMPL in idef-parser/parser-helpers.h which we believe to be correctly formatted. The complaints concern the : in the type "labels" of the macro, and also the default: label.
* The eight patch, which introduces flex/bison as new build pre- requisites using libvirt-ci, will update tests/lcitool/libvirt-ci to a new upstream commit which includes these package mappings.
Alessandro Di Federico (4):
target/hexagon: update MAINTAINERS for idef-parser target/hexagon: import README for idef-parser target/hexagon: prepare input for the idef-parser target/hexagon: call idef-parser functions
Anton Johansson (2):
target/hexagon: import flex/bison to docker files target/hexagon: import parser for idef-parser
Niccolò Izzo (2):
target/hexagon: introduce new helper functions
target/hexagon: import additional tests
Paolo Montesel (4):
target/hexagon: make slot number an unsigned target/hexagon: make helper functions non-static target/hexagon: expose next PC in DisasContext target/hexagon: import lexer for idef-parser
.gitlab-ci.d/cirrus/freebsd-12.vars | 2 +- .gitlab-ci.d/cirrus/freebsd-13.vars | 2 +- .gitlab-ci.d/cirrus/macos-11.vars | 2 +- .gitlab-ci.d/windows.yml | 2 + MAINTAINERS | 9 + meson_options.txt | 3 + target/hexagon/README | 5 + target/hexagon/gen_helper_funcs.py | 17 +- target/hexagon/gen_helper_protos.py | 17 +- target/hexagon/gen_idef_parser_funcs.py | 128 + target/hexagon/gen_tcg_funcs.py | 41 +- target/hexagon/genptr.c | 241 +- target/hexagon/genptr.h | 45 + target/hexagon/hex_common.py | 10 + target/hexagon/idef-parser/README.rst | 722 +++++ target/hexagon/idef-parser/idef-parser.h | 253 ++ target/hexagon/idef-parser/idef-parser.lex | 471 ++++ target/hexagon/idef-parser/idef-parser.y | 961 +++++++ target/hexagon/idef-parser/macros.inc | 140 + target/hexagon/idef-parser/parser-helpers.c | 2346 +++++++++++++++++ target/hexagon/idef-parser/parser-helpers.h | 372 +++ target/hexagon/idef-parser/prepare | 24 + target/hexagon/macros.h | 11 +- target/hexagon/meson.build | 138 +- target/hexagon/op_helper.c | 29 +- target/hexagon/op_helper.h | 37 + target/hexagon/translate.c | 3 +- target/hexagon/translate.h | 1 + tests/docker/dockerfiles/alpine.docker | 6 +- tests/docker/dockerfiles/centos8.docker | 7 +- tests/docker/dockerfiles/debian-amd64.docker | 2 + .../dockerfiles/debian-arm64-cross.docker | 6 +- tests/docker/dockerfiles/debian-native.docker | 3 + .../dockerfiles/debian-riscv64-cross.docker | 3 + .../dockerfiles/debian-s390x-cross.docker | 6 +- .../dockerfiles/debian-tricore-cross.docker | 1 + tests/docker/dockerfiles/debian10.docker | 3 + .../dockerfiles/fedora-i386-cross.docker | 3 + .../dockerfiles/fedora-win32-cross.docker | 3 + .../dockerfiles/fedora-win64-cross.docker | 3 + tests/docker/dockerfiles/fedora.docker | 5 +- tests/docker/dockerfiles/opensuse-leap.docker | 5 +- tests/docker/dockerfiles/ubuntu1804.docker | 4 +- tests/docker/dockerfiles/ubuntu2004.docker | 5 +- tests/lcitool/libvirt-ci | 2 +- tests/lcitool/projects/qemu.yml | 20 +- tests/tcg/hexagon/Makefile.target | 28 +- tests/tcg/hexagon/crt.S | 14 + tests/tcg/hexagon/test_abs.S | 17 + tests/tcg/hexagon/test_bitcnt.S | 40 + tests/tcg/hexagon/test_bitsplit.S | 22 + tests/tcg/hexagon/test_call.S | 64 + tests/tcg/hexagon/test_clobber.S | 29 + tests/tcg/hexagon/test_cmp.S | 31 + tests/tcg/hexagon/test_dotnew.S | 38 + tests/tcg/hexagon/test_ext.S | 13 + tests/tcg/hexagon/test_fibonacci.S | 30 + tests/tcg/hexagon/test_hl.S | 16 + tests/tcg/hexagon/test_hwloops.S | 19 + tests/tcg/hexagon/test_jmp.S | 22 + tests/tcg/hexagon/test_lsr.S | 36 + tests/tcg/hexagon/test_mpyi.S | 17 + tests/tcg/hexagon/test_packet.S | 29 + tests/tcg/hexagon/test_reorder.S | 33 + tests/tcg/hexagon/test_round.S | 29 + tests/tcg/hexagon/test_vavgw.S | 31 + tests/tcg/hexagon/test_vcmpb.S | 30 + tests/tcg/hexagon/test_vcmpw.S | 30 + tests/tcg/hexagon/test_vlsrw.S | 20 + tests/tcg/hexagon/test_vmaxh.S | 35 + tests/tcg/hexagon/test_vminh.S | 35 + tests/tcg/hexagon/test_vpmpyh.S | 28 + tests/tcg/hexagon/test_vspliceb.S | 31 + 73 files changed, 6770 insertions(+), 116 deletions(-) create mode 100644 target/hexagon/gen_idef_parser_funcs.py create mode 100644 target/hexagon/idef-parser/README.rst create mode 100644 target/hexagon/idef-parser/idef-parser.h create mode 100644 target/hexagon/idef-parser/idef-parser.lex create mode 100644 target/hexagon/idef-parser/idef-parser.y create mode 100644 target/hexagon/idef-parser/macros.inc create mode 100644 target/hexagon/idef-parser/parser-helpers.c create mode 100644 target/hexagon/idef-parser/parser-helpers.h create mode 100755 target/hexagon/idef-parser/prepare create mode 100644 target/hexagon/op_helper.h create mode 100644 tests/tcg/hexagon/crt.S create mode 100644 tests/tcg/hexagon/test_abs.S create mode 100644 tests/tcg/hexagon/test_bitcnt.S create mode 100644 tests/tcg/hexagon/test_bitsplit.S create mode 100644 tests/tcg/hexagon/test_call.S create mode 100644 tests/tcg/hexagon/test_clobber.S create mode 100644 tests/tcg/hexagon/test_cmp.S create mode 100644 tests/tcg/hexagon/test_dotnew.S create mode 100644 tests/tcg/hexagon/test_ext.S create mode 100644 tests/tcg/hexagon/test_fibonacci.S create mode 100644 tests/tcg/hexagon/test_hl.S create mode 100644 tests/tcg/hexagon/test_hwloops.S create mode 100644 tests/tcg/hexagon/test_jmp.S create mode 100644 tests/tcg/hexagon/test_lsr.S create mode 100644 tests/tcg/hexagon/test_mpyi.S create mode 100644 tests/tcg/hexagon/test_packet.S create mode 100644 tests/tcg/hexagon/test_reorder.S create mode 100644 tests/tcg/hexagon/test_round.S create mode 100644 tests/tcg/hexagon/test_vavgw.S create mode 100644 tests/tcg/hexagon/test_vcmpb.S create mode 100644 tests/tcg/hexagon/test_vcmpw.S create mode 100644 tests/tcg/hexagon/test_vlsrw.S create mode 100644 tests/tcg/hexagon/test_vmaxh.S create mode 100644 tests/tcg/hexagon/test_vminh.S create mode 100644 tests/tcg/hexagon/test_vpmpyh.S create mode 100644 tests/tcg/hexagon/test_vspliceb.S
--
2.35.1
PATCH v9 1/12 target/hexagon: update MAINTAINERS for idef-parser
From: Alessandro Di Federico <[email protected]>
--- MAINTAINERS | 9 +++++++++ 1 file changed, 9 insertions(+)
MAINTAINERS +9 -0
@@ -200,6 +200,8 @@ Hexagon TCG CPUs M: Taylor Simpson <[email protected]> S: Supported F: target/hexagon/ +X: target/hexagon/idef-parser/ +X: target/hexagon/gen_idef_parser_funcs.py F: linux-user/hexagon/ F: tests/tcg/hexagon/ F: disas/hexagon.c
@@ -207,6 +209,13 @@ F: configs/targets/hexagon-linux-user/default.mak F: docker/dockerfiles/debian-hexagon-cross.docker F: docker/dockerfiles/debian-hexagon-cross.docker.d/build-toolchain.sh +Hexagon idef-parser +M: Alessandro Di Federico <[email protected]> +M: Anton Johansson <[email protected]> +S: Supported +F: target/hexagon/idef-parser/ +F: target/hexagon/gen_idef_parser_funcs.py + HPPA (PA-RISC) TCG CPUs M: Richard Henderson <[email protected]> S: Maintained
Signature · 1 line
2.35.1
PATCH v9 2/12 target/hexagon: import README for idef-parser
In reply to Anton Johansson viaFrom: Alessandro Di Federico <[email protected]>
--- target/hexagon/README | 5 + target/hexagon/idef-parser/README.rst | 722 ++++++++++++++++++++++++++ 2 files changed, 727 insertions(+) create mode 100644 target/hexagon/idef-parser/README.rst
target/hexagon/README +5 -0
@@ -27,6 +27,10 @@ Hexagon-specific code are encode*.def Encoding patterns for each instruction iclass.def Instruction class definitions used to determine legal VLIW slots for each instruction + qemu/target/hexagon/idef-parser + Parser that, given the high-level definitions of an instruction, + produces a C function generating equivalent tiny code instructions. + See README.rst. qemu/linux-user/hexagon Helpers for loading the ELF file and making Linux system calls, signals, etc
@@ -47,6 +51,7 @@ header files in <BUILD_DIR>/target/hexagon gen_tcg_funcs.py -> tcg_funcs_generated.c.inc gen_tcg_func_table.py -> tcg_func_table_generated.c.inc gen_helper_funcs.py -> helper_funcs_generated.c.inc + gen_idef_parser_funcs.py -> idef_parser_input.h Qemu helper functions have 3 parts DEF_HELPER declaration indicates the signature of the helper
target/hexagon/idef-parser/README.rst new file +722 -0
722 lines not on this page · raw message
Signature · 1 line
2.35.1
PATCH v9 3/12 target/hexagon: make slot number an unsigned
In reply to Anton Johansson viaFrom: Paolo Montesel <[email protected]>
--- target/hexagon/genptr.c | 24 +++++++++++++----------- target/hexagon/macros.h | 2 +- 2 files changed, 14 insertions(+), 12 deletions(-)
target/hexagon/genptr.c +13 -11
@@ -30,7 +30,8 @@#include "gen_tcg.h" #include "gen_tcg_hvx.h" -static inline void gen_log_predicated_reg_write (int rnum,TCGv val,int slot) +static inline void gen_log_predicated_reg_write (int rnum,TCGv val, +uint32_t slot) {TCGv zero =tcg_constant_tl (0 );TCGv slot_mask =tcg_temp_new ();
@@ -62,7 +63,8 @@ static inline void gen_log_reg_write(int rnum, TCGv val) } } -static void gen_log_predicated_reg_write_pair (int rnum,TCGv_i64 val,int slot) +static void gen_log_predicated_reg_write_pair (int rnum,TCGv_i64 val, +uint32_t slot) {TCGv val32 =tcg_temp_new ();TCGv zero =tcg_constant_tl (0 );
@@ -394,7 +396,7 @@ static inline void gen_store_conditional8(DisasContext *ctx,tcg_gen_movi_tl (hex_llsc_addr, ~0 ); } -static inline void gen_store32 (TCGv vaddr,TCGv src,int width,int slot) +static inline void gen_store32 (TCGv vaddr,TCGv src,int width,uint32_t slot) {tcg_gen_mov_tl (hex_store_addr[slot], vaddr);tcg_gen_movi_tl (hex_store_width[slot], width);
@@ -402,49 +404,49 @@ static inline void gen_store32(TCGv vaddr, TCGv src, int width, int slot) }static inline void gen_store1 (TCGv_env cpu_env,TCGv vaddr,TCGv src, -DisasContext *ctx,int slot) +DisasContext *ctx,uint32_t slot) {gen_store32 (vaddr, src,1 , slot); ctx->store_width[slot] =1 ; }static inline void gen_store1i (TCGv_env cpu_env,TCGv vaddr,int32_t src, -DisasContext *ctx,int slot) +DisasContext *ctx,uint32_t slot) {TCGv tmp =tcg_constant_tl (src);gen_store1 (cpu_env, vaddr, tmp, ctx, slot); }static inline void gen_store2 (TCGv_env cpu_env,TCGv vaddr,TCGv src, -DisasContext *ctx,int slot) +DisasContext *ctx,uint32_t slot) {gen_store32 (vaddr, src,2 , slot); ctx->store_width[slot] =2 ; }static inline void gen_store2i (TCGv_env cpu_env,TCGv vaddr,int32_t src, -DisasContext *ctx,int slot) +DisasContext *ctx,uint32_t slot) {TCGv tmp =tcg_constant_tl (src);gen_store2 (cpu_env, vaddr, tmp, ctx, slot); }static inline void gen_store4 (TCGv_env cpu_env,TCGv vaddr,TCGv src, -DisasContext *ctx,int slot) +DisasContext *ctx,uint32_t slot) {gen_store32 (vaddr, src,4 , slot); ctx->store_width[slot] =4 ; }static inline void gen_store4i (TCGv_env cpu_env,TCGv vaddr,int32_t src, -DisasContext *ctx,int slot) +DisasContext *ctx,uint32_t slot) {TCGv tmp =tcg_constant_tl (src);gen_store4 (cpu_env, vaddr, tmp, ctx, slot); }static inline void gen_store8 (TCGv_env cpu_env,TCGv vaddr,TCGv_i64 src, -DisasContext *ctx,int slot) +DisasContext *ctx,uint32_t slot) {tcg_gen_mov_tl (hex_store_addr[slot], vaddr);tcg_gen_movi_tl (hex_store_width[slot],8 );
@@ -453,7 +455,7 @@ static inline void gen_store8(TCGv_env cpu_env, TCGv vaddr, TCGv_i64 src, }static inline void gen_store8i (TCGv_env cpu_env,TCGv vaddr,int64_t src, -DisasContext *ctx,int slot) +DisasContext *ctx,uint32_t slot) {TCGv_i64 tmp =tcg_constant_i64 (src);gen_store8 (cpu_env, vaddr, tmp, ctx, slot);
target/hexagon/macros.h +1 -1
@@ -185,7 +185,7 @@#define LOAD_CANCEL (EA ) do { CANCEL; } while (0)#ifdef QEMU_GENERATE -static inline void gen_pred_cancel (TCGv pred,int slot_num) +static inline void gen_pred_cancel (TCGv pred,uint32_t slot_num) {TCGv slot_mask =tcg_temp_new ();TCGv tmp =tcg_temp_new ();
Signature · 1 line
2.35.1
PATCH v9 4/12 target/hexagon: make helper functions non-static
In reply to Anton Johansson viaFrom: Paolo Montesel <[email protected]>
Make certain helper functions non-static, making them available outside genptr.c. These functions are required by code generated by the idef-parser.
This commit also makes some op_helper.c non-static in order to avoid having them marked as unused when using the idef-parser generated code.
--- target/hexagon/genptr.c | 59 +++++++++++++++++++++----------------- target/hexagon/genptr.h | 30 +++++++++++++++++++ target/hexagon/op_helper.c | 29 +++++++++---------- target/hexagon/op_helper.h | 37 ++++++++++++++++++++++++ 4 files changed, 113 insertions(+), 42 deletions(-) create mode 100644 target/hexagon/op_helper.h
target/hexagon/genptr.c +33 -26
@@ -29,6 +29,13 @@#undef QEMU_GENERATE#include "gen_tcg.h" #include "gen_tcg_hvx.h" +#include "genptr.h" + +TCGv gen_read_preg (TCGv pred,uint8_t num) +{ +tcg_gen_mov_tl (pred, hex_pred[num]); +return pred; +}static inline void gen_log_predicated_reg_write (int rnum,TCGv val,uint32_t slot)
@@ -54,7 +61,7 @@ static inline void gen_log_predicated_reg_write(int rnum, TCGv val,tcg_temp_free (slot_mask); } -static inline void gen_log_reg_write (int rnum,TCGv val) +void gen_log_reg_write (int rnum,TCGv val) {tcg_gen_mov_tl (hex_new_value[rnum], val);if (HEX_DEBUG ) {
@@ -116,7 +123,7 @@ static void gen_log_reg_write_pair(int rnum, TCGv_i64 val) } } -static inline void gen_log_pred_write (DisasContext *ctx,int pnum,TCGv val) +void gen_log_pred_write (DisasContext *ctx,int pnum,TCGv val) {TCGv base_val =tcg_temp_new ();
@@ -274,7 +281,7 @@ static inline void gen_write_ctrl_reg_pair(DisasContext *ctx, int reg_num, } } -static TCGv gen_get_byte (TCGv result,int N ,TCGv src,bool sign) +TCGv gen_get_byte (TCGv result,int N ,TCGv src,bool sign) {if (sign) {tcg_gen_sextract_tl (result, src,N *8 ,8 );
@@ -284,7 +291,7 @@ static TCGv gen_get_byte(TCGv result, int N, TCGv src, bool sign)return result; } -static TCGv gen_get_byte_i64 (TCGv result,int N ,TCGv_i64 src,bool sign) +TCGv gen_get_byte_i64 (TCGv result,int N ,TCGv_i64 src,bool sign) {TCGv_i64 res64 =tcg_temp_new_i64 ();if (sign) {
@@ -298,7 +305,7 @@ static TCGv gen_get_byte_i64(TCGv result, int N, TCGv_i64 src, bool sign)return result; } -static inline TCGv gen_get_half (TCGv result,int N ,TCGv src,bool sign) +TCGv gen_get_half (TCGv result,int N ,TCGv src,bool sign) {if (sign) {tcg_gen_sextract_tl (result, src,N *16 ,16 );
@@ -308,12 +315,12 @@ static inline TCGv gen_get_half(TCGv result, int N, TCGv src, bool sign)return result; } -static inline void gen_set_half (int N ,TCGv result,TCGv src) +void gen_set_half (int N ,TCGv result,TCGv src) {tcg_gen_deposit_tl (result, result, src,N *16 ,16 ); } -static inline void gen_set_half_i64 (int N ,TCGv_i64 result,TCGv src) +void gen_set_half_i64 (int N ,TCGv_i64 result,TCGv src) {TCGv_i64 src64 =tcg_temp_new_i64 ();tcg_gen_extu_i32_i64 (src64, src);
@@ -321,7 +328,7 @@ static inline void gen_set_half_i64(int N, TCGv_i64 result, TCGv src)tcg_temp_free_i64 (src64); } -static void gen_set_byte_i64 (int N ,TCGv_i64 result,TCGv src) +void gen_set_byte_i64 (int N ,TCGv_i64 result,TCGv src) {TCGv_i64 src64 =tcg_temp_new_i64 ();tcg_gen_extu_i32_i64 (src64, src);
@@ -396,57 +403,57 @@ static inline void gen_store_conditional8(DisasContext *ctx,tcg_gen_movi_tl (hex_llsc_addr, ~0 ); } -static inline void gen_store32 (TCGv vaddr,TCGv src,int width,uint32_t slot) +void gen_store32 (TCGv vaddr,TCGv src,int width,uint32_t slot) {tcg_gen_mov_tl (hex_store_addr[slot], vaddr);tcg_gen_movi_tl (hex_store_width[slot], width);tcg_gen_mov_tl (hex_store_val32[slot], src); } -static inline void gen_store1 (TCGv_env cpu_env,TCGv vaddr,TCGv src, -DisasContext *ctx,uint32_t slot) +void gen_store1 (TCGv_env cpu_env,TCGv vaddr,TCGv src,DisasContext *ctx, +uint32_t slot) {gen_store32 (vaddr, src,1 , slot); ctx->store_width[slot] =1 ; } -static inline void gen_store1i (TCGv_env cpu_env,TCGv vaddr,int32_t src, -DisasContext *ctx,uint32_t slot) +void gen_store1i (TCGv_env cpu_env,TCGv vaddr,int32_t src,DisasContext *ctx, +uint32_t slot) {TCGv tmp =tcg_constant_tl (src);gen_store1 (cpu_env, vaddr, tmp, ctx, slot); } -static inline void gen_store2 (TCGv_env cpu_env,TCGv vaddr,TCGv src, -DisasContext *ctx,uint32_t slot) +void gen_store2 (TCGv_env cpu_env,TCGv vaddr,TCGv src,DisasContext *ctx, +uint32_t slot) {gen_store32 (vaddr, src,2 , slot); ctx->store_width[slot] =2 ; } -static inline void gen_store2i (TCGv_env cpu_env,TCGv vaddr,int32_t src, -DisasContext *ctx,uint32_t slot) +void gen_store2i (TCGv_env cpu_env,TCGv vaddr,int32_t src,DisasContext *ctx, +uint32_t slot) {TCGv tmp =tcg_constant_tl (src);gen_store2 (cpu_env, vaddr, tmp, ctx, slot); } -static inline void gen_store4 (TCGv_env cpu_env,TCGv vaddr,TCGv src, -DisasContext *ctx,uint32_t slot) +void gen_store4 (TCGv_env cpu_env,TCGv vaddr,TCGv src,DisasContext *ctx, +uint32_t slot) {gen_store32 (vaddr, src,4 , slot); ctx->store_width[slot] =4 ; } -static inline void gen_store4i (TCGv_env cpu_env,TCGv vaddr,int32_t src, -DisasContext *ctx,uint32_t slot) +void gen_store4i (TCGv_env cpu_env,TCGv vaddr,int32_t src,DisasContext *ctx, +uint32_t slot) {TCGv tmp =tcg_constant_tl (src);gen_store4 (cpu_env, vaddr, tmp, ctx, slot); } -static inline void gen_store8 (TCGv_env cpu_env,TCGv vaddr,TCGv_i64 src, -DisasContext *ctx,uint32_t slot) +void gen_store8 (TCGv_env cpu_env,TCGv vaddr,TCGv_i64 src,DisasContext *ctx, +uint32_t slot) {tcg_gen_mov_tl (hex_store_addr[slot], vaddr);tcg_gen_movi_tl (hex_store_width[slot],8 );
@@ -454,14 +461,14 @@ static inline void gen_store8(TCGv_env cpu_env, TCGv vaddr, TCGv_i64 src, ctx->store_width[slot] =8 ; } -static inline void gen_store8i (TCGv_env cpu_env,TCGv vaddr,int64_t src, -DisasContext *ctx,uint32_t slot) +void gen_store8i (TCGv_env cpu_env,TCGv vaddr,int64_t src,DisasContext *ctx, +uint32_t slot) {TCGv_i64 tmp =tcg_constant_i64 (src);gen_store8 (cpu_env, vaddr, tmp, ctx, slot); } -static TCGv gen_8bitsof (TCGv result,TCGv value) +TCGv gen_8bitsof (TCGv result,TCGv value) {TCGv zero =tcg_constant_tl (0 );TCGv ones =tcg_constant_tl (0xff );
target/hexagon/genptr.h +30 -0
@@ -19,7 +19,37 @@#define HEXAGON_GENPTR_H #include "insn.h" +#include "tcg/tcg.h" +#include "translate.h" extern const SemanticInsn opcode_genptr[]; +void gen_store32 (TCGv vaddr,TCGv src,int width,uint32_t slot); +void gen_store1 (TCGv_env cpu_env,TCGv vaddr,TCGv src,DisasContext *ctx, +uint32_t slot); +void gen_store2 (TCGv_env cpu_env,TCGv vaddr,TCGv src,DisasContext *ctx, +uint32_t slot); +void gen_store4 (TCGv_env cpu_env,TCGv vaddr,TCGv src,DisasContext *ctx, +uint32_t slot); +void gen_store8 (TCGv_env cpu_env,TCGv vaddr,TCGv_i64 src,DisasContext *ctx, +uint32_t slot); +void gen_store1i (TCGv_env cpu_env,TCGv vaddr,int32_t src,DisasContext *ctx, +uint32_t slot); +void gen_store2i (TCGv_env cpu_env,TCGv vaddr,int32_t src,DisasContext *ctx, +uint32_t slot); +void gen_store4i (TCGv_env cpu_env,TCGv vaddr,int32_t src,DisasContext *ctx, +uint32_t slot); +void gen_store8i (TCGv_env cpu_env,TCGv vaddr,int64_t src,DisasContext *ctx, +uint32_t slot); +TCGv gen_read_preg (TCGv pred,uint8_t num); +void gen_log_reg_write (int rnum,TCGv val); +void gen_log_pred_write (DisasContext *ctx,int pnum,TCGv val); +TCGv gen_8bitsof (TCGv result,TCGv value); +void gen_set_byte_i64 (int N ,TCGv_i64 result,TCGv src); +TCGv gen_get_byte (TCGv result,int N ,TCGv src,bool sign); +TCGv gen_get_byte_i64 (TCGv result,int N ,TCGv_i64 src,bool sign); +TCGv gen_get_half (TCGv result,int N ,TCGv src,bool sign); +void gen_set_half (int N ,TCGv result,TCGv src); +void gen_set_half_i64 (int N ,TCGv_i64 result,TCGv src); +#endif
target/hexagon/op_helper.c +13 -16
@@ -29,6 +29,7 @@#include "fma_emu.h" #include "mmvec/mmvec.h" #include "mmvec/macros.h" +#include "op_helper.h" #define SF_BIAS 127#define SF_MANTBITS 23
@@ -50,8 +51,8 @@ G_NORETURN void HELPER(raise_exception)(CPUHexagonState *env, uint32_t excp)do_raise_exception_err (env, excp,0 ); } -static void log_reg_write (CPUHexagonState *env,int rnum, -target_ulong val,uint32_t slot) +void log_reg_write (CPUHexagonState *env,int rnum,target_ulong val, +uint32_t slot) {HEX_DEBUG_LOG ("log_reg_write[%d] = " TARGET_FMT_ld" (0x" TARGET_FMT_lx")" , rnum, val, val);
@@ -82,8 +83,8 @@ static void log_pred_write(CPUHexagonState *env, int pnum, target_ulong val) } } -static void log_store32 (CPUHexagonState *env,target_ulong addr, -target_ulong val,int width,int slot) +void log_store32 (CPUHexagonState *env,target_ulong addr,target_ulong val, +int width,int slot) { HEX_DEBUG_LOG("log_store%d(0x" TARGET_FMT_lx ", %" PRId32 " [0x08%" PRIx32 "])\n",
@@ -93,8 +94,8 @@ static void log_store32(CPUHexagonState *env, target_ulong addr, env->mem_log_stores[slot].data32 = val; } -static void log_store64 (CPUHexagonState *env,target_ulong addr, -int64_t val,int width,int slot) +void log_store64 (CPUHexagonState *env,target_ulong addr,int64_t val, +int width,int slot) { HEX_DEBUG_LOG("log_store%d(0x" TARGET_FMT_lx ", %" PRId64 " [0x016%" PRIx64 "])\n",
@@ -104,7 +105,7 @@ static void log_store64(CPUHexagonState *env, target_ulong addr, env->mem_log_stores[slot].data64 = val; } -static void write_new_pc (CPUHexagonState *env,target_ulong addr) +void write_new_pc (CPUHexagonState *env,target_ulong addr) {HEX_DEBUG_LOG ("write_new_pc(0x" TARGET_FMT_lx")\n" , addr);
@@ -522,32 +523,28 @@ static void check_noshuf(CPUHexagonState *env, uint32_t slot) } } -static uint8_t mem_load1 (CPUHexagonState *env,uint32_t slot, -target_ulong vaddr) +uint8_t mem_load1 (CPUHexagonState *env,uint32_t slot,target_ulong vaddr) {uintptr_t ra =GETPC ();check_noshuf (env, slot);return cpu_ldub_data_ra (env, vaddr, ra); } -static uint16_t mem_load2 (CPUHexagonState *env,uint32_t slot, -target_ulong vaddr) +uint16_t mem_load2 (CPUHexagonState *env,uint32_t slot,target_ulong vaddr) {uintptr_t ra =GETPC ();check_noshuf (env, slot);return cpu_lduw_data_ra (env, vaddr, ra); } -static uint32_t mem_load4 (CPUHexagonState *env,uint32_t slot, -target_ulong vaddr) +uint32_t mem_load4 (CPUHexagonState *env,uint32_t slot,target_ulong vaddr) {uintptr_t ra =GETPC ();check_noshuf (env, slot);return cpu_ldl_data_ra (env, vaddr, ra); } -static uint64_t mem_load8 (CPUHexagonState *env,uint32_t slot, -target_ulong vaddr) +uint64_t mem_load8 (CPUHexagonState *env,uint32_t slot,target_ulong vaddr) {uintptr_t ra =GETPC ();check_noshuf (env, slot);
@@ -1452,7 +1449,7 @@ void HELPER(vwhist128qm)(CPUHexagonState *env, int32_t uiV) } } -static void cancel_slot (CPUHexagonState *env,uint32_t slot) +void cancel_slot (CPUHexagonState *env,uint32_t slot) {HEX_DEBUG_LOG ("Slot %d cancelled\n" , slot); env->slot_cancelled |= (1 << slot);
target/hexagon/op_helper.h new file +37 -0
@@ -0,0 +1,37 @@ +/* +* Copyright(c) 2019-2021 Qualcomm Innovation Center, Inc. All Rights Reserved. +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, see <http://www.gnu.org/licenses/>. +*/ + +#ifndef HEXAGON_OP_HELPER_H +#define HEXAGON_OP_HELPER_H + +/* Misc functions */ +void cancel_slot (CPUHexagonState *env,uint32_t slot); +void write_new_pc (CPUHexagonState *env,target_ulong addr); + +uint8_t mem_load1 (CPUHexagonState *env,uint32_t slot,target_ulong vaddr); +uint16_t mem_load2 (CPUHexagonState *env,uint32_t slot,target_ulong vaddr); +uint32_t mem_load4 (CPUHexagonState *env,uint32_t slot,target_ulong vaddr); +uint64_t mem_load8 (CPUHexagonState *env,uint32_t slot,target_ulong vaddr); + +void log_reg_write (CPUHexagonState *env,int rnum,target_ulong val, +uint32_t slot); +void log_store64 (CPUHexagonState *env,target_ulong addr,int64_t val, +int width,int slot); +void log_store32 (CPUHexagonState *env,target_ulong addr,target_ulong val, +int width,int slot); + +#endif
Signature · 1 line
2.35.1
PATCH v9 5/12 target/hexagon: introduce new helper functions
In reply to Anton Johansson viaFrom: Niccolò Izzo <[email protected]>
These helpers will be employed by the idef-parser generated code, to correctly implement instruction semantics. "Helper" functions, in the context of this patch, refers to functions which provide a manual TCG implementation of certain features.
--- target/hexagon/genptr.c | 178 ++++++++++++++++++++++++++++++++++++++-- target/hexagon/genptr.h | 17 +++- target/hexagon/macros.h | 9 ++ 3 files changed, 196 insertions(+), 8 deletions(-)
target/hexagon/genptr.c +171 -7
@@ -31,6 +31,12 @@#include "gen_tcg_hvx.h" #include "genptr.h" +TCGv gen_read_reg (TCGv result,int num) +{ +tcg_gen_mov_tl (result, hex_gpr[num]); +return result; +} +TCGv gen_read_preg (TCGv pred,uint8_t num) {tcg_gen_mov_tl (pred, hex_pred[num]);
@@ -403,18 +409,19 @@ static inline void gen_store_conditional8(DisasContext *ctx,tcg_gen_movi_tl (hex_llsc_addr, ~0 ); } -void gen_store32 (TCGv vaddr,TCGv src,int width,uint32_t slot) +void gen_store32 (DisasContext *ctx,TCGv vaddr,TCGv src,tcg_target_long width, +uint32_t slot) {tcg_gen_mov_tl (hex_store_addr[slot], vaddr);tcg_gen_movi_tl (hex_store_width[slot], width);tcg_gen_mov_tl (hex_store_val32[slot], src); + ctx->store_width[slot] = width; }void gen_store1 (TCGv_env cpu_env,TCGv vaddr,TCGv src,DisasContext *ctx,uint32_t slot) { -gen_store32 (vaddr, src,1 , slot); - ctx->store_width[slot] =1 ; +gen_store32 (ctx, vaddr, src,1 , slot); } void gen_store1i(TCGv_env cpu_env, TCGv vaddr, int32_t src, DisasContext *ctx,
@@ -427,8 +434,7 @@ void gen_store1i(TCGv_env cpu_env, TCGv vaddr, int32_t src, DisasContext *ctx,void gen_store2 (TCGv_env cpu_env,TCGv vaddr,TCGv src,DisasContext *ctx,uint32_t slot) { -gen_store32 (vaddr, src,2 , slot); - ctx->store_width[slot] =2 ; +gen_store32 (ctx, vaddr, src,2 , slot); } void gen_store2i(TCGv_env cpu_env, TCGv vaddr, int32_t src, DisasContext *ctx,
@@ -441,8 +447,7 @@ void gen_store2i(TCGv_env cpu_env, TCGv vaddr, int32_t src, DisasContext *ctx,void gen_store4 (TCGv_env cpu_env,TCGv vaddr,TCGv src,DisasContext *ctx,uint32_t slot) { -gen_store32 (vaddr, src,4 , slot); - ctx->store_width[slot] =4 ; +gen_store32 (ctx, vaddr, src,4 , slot); } void gen_store4i(TCGv_env cpu_env, TCGv vaddr, int32_t src, DisasContext *ctx,
@@ -647,5 +652,164 @@ static void vec_to_qvec(size_t size, intptr_t dstoff, intptr_t srcoff)tcg_temp_free_i64 (mask); } +void gen_set_usr_field (int field,TCGv val) +{ +tcg_gen_deposit_tl (hex_new_value[HEX_REG_USR ], hex_new_value[HEX_REG_USR ], + val, + reg_field_info[field].offset, + reg_field_info[field].width); +} + +void gen_set_usr_fieldi (int field,int x) +{ +TCGv val =tcg_constant_tl (x); +gen_set_usr_field (field, val); +} + +/* +* Note: Since this function might branch, `val` is +* required to be a `tcg_temp_local`. +*/ +void gen_set_usr_field_if (int field,TCGv val) +{ +/* Sets the USR field if `val` is non-zero */ +if (reg_field_info[field].width ==1 ) { +TCGv tmp =tcg_temp_new (); +tcg_gen_extract_tl (tmp, val,0 , reg_field_info[field].width); +tcg_gen_shli_tl (tmp, tmp, reg_field_info[field].offset); +tcg_gen_or_tl (hex_new_value[HEX_REG_USR ], + hex_new_value[HEX_REG_USR ], + tmp); +tcg_temp_free (tmp); + }else { +TCGLabel *skip_label =gen_new_label (); +tcg_gen_brcondi_tl (TCG_COND_EQ , val,0 , skip_label); +gen_set_usr_field (field, val); +gen_set_label (skip_label); + } +} + +void gen_write_new_pc (TCGv addr) +{ +/* If there are multiple branches in a packet, ignore the second one */ +TCGv zero =tcg_constant_tl (0 ); +tcg_gen_movcond_tl (TCG_COND_NE , hex_next_PC, hex_branch_taken, zero, + hex_next_PC, addr); +tcg_gen_movi_tl (hex_branch_taken,1 ); +} + +void gen_sat_i32 (TCGv dest,TCGv source,int width) +{ +TCGv max_val =tcg_constant_tl ((1 << (width -1 )) -1 ); +TCGv min_val =tcg_constant_tl (-(1 << (width -1 ))); +tcg_gen_smin_tl (dest, source, max_val); +tcg_gen_smax_tl (dest, dest, min_val); +} + +void gen_sat_i32_ovfl (TCGv ovfl,TCGv dest,TCGv source,int width) +{ +gen_sat_i32 (dest, source, width); +tcg_gen_setcond_tl (TCG_COND_NE , ovfl, source, dest); +} + +void gen_satu_i32 (TCGv dest,TCGv source,int width) +{ +TCGv max_val =tcg_constant_tl ((1 << width) -1 ); +TCGv zero =tcg_constant_tl (0 ); +tcg_gen_movcond_tl (TCG_COND_GTU , dest, source, max_val, max_val, source); +tcg_gen_movcond_tl (TCG_COND_LT , dest, source, zero, zero, dest); +} + +void gen_satu_i32_ovfl (TCGv ovfl,TCGv dest,TCGv source,int width) +{ +gen_satu_i32 (dest, source, width); +tcg_gen_setcond_tl (TCG_COND_NE , ovfl, source, dest); +} + +void gen_sat_i64 (TCGv_i64 dest,TCGv_i64 source,int width) +{ +TCGv_i64 max_val =tcg_constant_i64 ((1LL << (width -1 )) -1LL ); +TCGv_i64 min_val =tcg_constant_i64 (-(1LL << (width -1 ))); +tcg_gen_smin_i64 (dest, source, max_val); +tcg_gen_smax_i64 (dest, dest, min_val); +} + +void gen_sat_i64_ovfl (TCGv ovfl,TCGv_i64 dest,TCGv_i64 source,int width) +{ +TCGv_i64 ovfl_64; +gen_sat_i64 (dest, source, width); + ovfl_64 =tcg_temp_new_i64 (); +tcg_gen_setcond_i64 (TCG_COND_NE , ovfl_64, dest, source); +tcg_gen_trunc_i64_tl (ovfl, ovfl_64); +tcg_temp_free_i64 (ovfl_64); +} + +void gen_satu_i64 (TCGv_i64 dest,TCGv_i64 source,int width) +{ +TCGv_i64 max_val =tcg_constant_i64 ((1LL << width) -1LL ); +TCGv_i64 zero =tcg_constant_i64 (0 ); +tcg_gen_movcond_i64 (TCG_COND_GTU , dest, source, max_val, max_val, source); +tcg_gen_movcond_i64 (TCG_COND_LT , dest, source, zero, zero, dest); +} + +void gen_satu_i64_ovfl (TCGv ovfl,TCGv_i64 dest,TCGv_i64 source,int width) +{ +TCGv_i64 ovfl_64; +gen_satu_i64 (dest, source, width); + ovfl_64 =tcg_temp_new_i64 (); +tcg_gen_setcond_i64 (TCG_COND_NE , ovfl_64, dest, source); +tcg_gen_trunc_i64_tl (ovfl, ovfl_64); +tcg_temp_free_i64 (ovfl_64); +} + +/* Implements the fADDSAT64 macro in TCG */ +void gen_add_sat_i64 (TCGv_i64 ret,TCGv_i64 a,TCGv_i64 b) +{ +TCGv_i64 sum =tcg_temp_local_new_i64 (); +TCGv_i64 xor =tcg_temp_new_i64 (); +TCGv_i64 cond1 =tcg_temp_new_i64 (); +TCGv_i64 cond2 =tcg_temp_local_new_i64 (); +TCGv_i64 cond3 =tcg_temp_new_i64 (); +TCGv_i64 mask =tcg_constant_i64 (0x8000000000000000ULL ); +TCGv_i64 max_pos =tcg_constant_i64 (0x7FFFFFFFFFFFFFFFLL ); +TCGv_i64 max_neg =tcg_constant_i64 (0x8000000000000000LL ); +TCGv_i64 zero =tcg_constant_i64 (0 ); +TCGLabel *no_ovfl_label =gen_new_label (); +TCGLabel *ovfl_label =gen_new_label (); +TCGLabel *ret_label =gen_new_label (); + +tcg_gen_add_i64 (sum, a, b); +tcg_gen_xor_i64 (xor, a, b); + +/* if (xor & mask) */ +tcg_gen_and_i64 (cond1, xor, mask); +tcg_temp_free_i64 (xor); +tcg_gen_brcondi_i64 (TCG_COND_NE , cond1,0 , no_ovfl_label); +tcg_temp_free_i64 (cond1); + +/* else if ((a ^ sum) & mask) */ +tcg_gen_xor_i64 (cond2, a, sum); +tcg_gen_and_i64 (cond2, cond2, mask); +tcg_gen_brcondi_i64 (TCG_COND_NE , cond2,0 , ovfl_label); +tcg_temp_free_i64 (cond2); +/* fallthrough to no_ovfl_label branch */ + +/* if branch */ +gen_set_label (no_ovfl_label); +tcg_gen_mov_i64 (ret, sum); +tcg_gen_br (ret_label); + +/* else if branch */ +gen_set_label (ovfl_label); +tcg_gen_and_i64 (cond3, sum, mask); +tcg_temp_free_i64 (mask); +tcg_temp_free_i64 (sum); +tcg_gen_movcond_i64 (TCG_COND_NE , ret, cond3, zero, max_pos, max_neg); +tcg_temp_free_i64 (cond3); +SET_USR_FIELD (USR_OVF ,1 ); + +gen_set_label (ret_label); +} +#include "tcg_funcs_generated.c.inc" #include "tcg_func_table_generated.c.inc"
target/hexagon/genptr.h +16 -1
@@ -24,7 +24,8 @@extern const SemanticInsn opcode_genptr[]; -void gen_store32 (TCGv vaddr,TCGv src,int width,uint32_t slot); +void gen_store32 (DisasContext *ctx,TCGv vaddr,TCGv src,tcg_target_long width, +uint32_t slot);void gen_store1 (TCGv_env cpu_env,TCGv vaddr,TCGv src,DisasContext *ctx,uint32_t slot); void gen_store2(TCGv_env cpu_env, TCGv vaddr, TCGv src, DisasContext *ctx,
@@ -44,6 +45,19 @@ void gen_store8i(TCGv_env cpu_env, TCGv vaddr, int64_t src, DisasContext *ctx,TCGv gen_read_preg (TCGv pred,uint8_t num);void gen_log_reg_write (int rnum,TCGv val);void gen_log_pred_write (DisasContext *ctx,int pnum,TCGv val); +void gen_write_new_pc (TCGv addr); +void gen_set_usr_field (int field,TCGv val); +void gen_set_usr_fieldi (int field,int x); +void gen_set_usr_field_if (int field,TCGv val); +void gen_sat_i32 (TCGv dest,TCGv source,int width); +void gen_sat_i32_ovfl (TCGv ovfl,TCGv dest,TCGv source,int width); +void gen_satu_i32 (TCGv dest,TCGv source,int width); +void gen_satu_i32_ovfl (TCGv ovfl,TCGv dest,TCGv source,int width); +void gen_sat_i64 (TCGv_i64 dest,TCGv_i64 source,int width); +void gen_sat_i64_ovfl (TCGv ovfl,TCGv_i64 dest,TCGv_i64 source,int width); +void gen_satu_i64 (TCGv_i64 dest,TCGv_i64 source,int width); +void gen_satu_i64_ovfl (TCGv ovfl,TCGv_i64 dest,TCGv_i64 source,int width); +void gen_add_sat_i64 (TCGv_i64 ret,TCGv_i64 a,TCGv_i64 b);TCGv gen_8bitsof (TCGv result,TCGv value);void gen_set_byte_i64 (int N ,TCGv_i64 result,TCGv src);TCGv gen_get_byte (TCGv result,int N ,TCGv src,bool sign);
@@ -51,5 +65,6 @@ TCGv gen_get_byte_i64(TCGv result, int N, TCGv_i64 src, bool sign);TCGv gen_get_half (TCGv result,int N ,TCGv src,bool sign);void gen_set_half (int N ,TCGv result,TCGv src);void gen_set_half_i64 (int N ,TCGv_i64 result,TCGv src); +TCGv gen_read_reg (TCGv result,int num);#endif
target/hexagon/macros.h +9 -0
@@ -180,7 +180,16 @@#define MEM_STORE8 (VA ,DATA ,SLOT ) log_store64(env, VA, DATA, 8, SLOT)#endif +#ifdef QEMU_GENERATE +static inline void gen_cancel (uint32_t slot) +{ +tcg_gen_ori_tl (hex_slot_cancelled, hex_slot_cancelled,1 << slot); +} + +#define CANCEL gen_cancel(slot); +#else #define CANCEL cancel_slot(env, slot) +#endif #define LOAD_CANCEL (EA ) do { CANCEL; } while (0)
Signature · 1 line
2.35.1
PATCH v9 6/12 target/hexagon: expose next PC in DisasContext
In reply to Anton Johansson viaFrom: Paolo Montesel <[email protected]>
--- target/hexagon/translate.c | 3 ++- target/hexagon/translate.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-)
target/hexagon/translate.c +2 -1
@@ -741,11 +741,12 @@ static void decode_and_translate_packet(CPUHexagonState *env, DisasContext *ctx)if (decode_packet (nwords, words, &pkt, false) >0 ) {HEX_DEBUG_PRINT_PKT (&pkt);gen_start_packet (ctx, &pkt); + ctx->npc = ctx->base.pc_next + pkt.encod_pkt_size_in_bytes;for (i =0 ; i < pkt.num_insns; i++) {gen_insn (env, ctx, &pkt.insn[i], &pkt); }gen_commit_packet (env, ctx, &pkt); - ctx->base.pc_next += pkt.encod_pkt_size_in_bytes; + ctx->base.pc_next = ctx->npc; }else {gen_exception_end_tb (ctx,HEX_EXCP_INVALID_PACKET ); }
target/hexagon/translate.h +1 -0
@@ -53,6 +53,7 @@ typedef struct DisasContext {bool qreg_is_predicated[NUM_QREGS ];int qreg_log_idx;bool pre_commit; +uint32_t npc; } DisasContext;static inline void ctx_log_reg_write (DisasContext *ctx,int rnum)
Signature · 1 line
2.35.1
PATCH v9 7/12 target/hexagon: prepare input for the idef-parser
In reply to Anton Johansson viaFrom: Alessandro Di Federico <[email protected]>
Introduce infrastructure necessary to produce a file suitable for being parsed by the idef-parser.
--- target/hexagon/gen_idef_parser_funcs.py | 128 ++++++++++++++++++++++ target/hexagon/idef-parser/macros.inc | 140 ++++++++++++++++++++++++ target/hexagon/idef-parser/prepare | 24 ++++ target/hexagon/meson.build | 17 +++ 4 files changed, 309 insertions(+) create mode 100644 target/hexagon/gen_idef_parser_funcs.py create mode 100644 target/hexagon/idef-parser/macros.inc create mode 100755 target/hexagon/idef-parser/prepare
target/hexagon/gen_idef_parser_funcs.py new file +128 -0
@@ -0,0 +1,128 @@ +#!/usr/bin/env python3 + +## +## Copyright(c) 2019-2022 rev.ng Labs Srl. All Rights Reserved. +## +## This program is free software; you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation; either version 2 of the License, or +## (at your option) any later version. +## +## This program is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with this program; if not, see <http://www.gnu.org/licenses/>. +## + +import sys +import re +import string +from io import StringIO + +import hex_common + +## +## Generate code to be fed to the idef_parser +## +## Consider A2_add: +## +## Rd32=add(Rs32,Rt32), { RdV=RsV+RtV;} +## +## We produce: +## +## A2_add(RdV, in RsV, in RtV) { +## { RdV=RsV+RtV;} +## } +## +## A2_add represents the instruction tag. Then we have a list of TCGv +## that the code generated by the parser can expect in input. Some of +## them are inputs ("in" prefix), while some others are outputs. +## +def main(): + hex_common.read_semantics_file(sys.argv[1]) + hex_common.read_attribs_file(sys.argv[2]) + hex_common.calculate_attribs() + tagregs = hex_common.get_tagregs() + tagimms = hex_common.get_tagimms() + + with open(sys.argv[3], 'w') as f: + f.write('#include "macros.inc"\n\n') + + for tag in hex_common.tags: + ## Skip the priv instructions + if ( "A_PRIV" in hex_common.attribdict[tag] ) : + continue + ## Skip the guest instructions + if ( "A_GUEST" in hex_common.attribdict[tag] ) : + continue + ## Skip instructions that saturate in a ternary expression + if ( tag in {'S2_asr_r_r_sat', 'S2_asl_r_r_sat'} ) : + continue + ## Skip instructions using switch + if ( tag in {'S4_vrcrotate_acc', 'S4_vrcrotate'} ) : + continue + ## Skip trap instructions + if ( tag in {'J2_trap0', 'J2_trap1'} ) : + continue + ## Skip 128-bit instructions + if ( tag in {'A7_croundd_ri', 'A7_croundd_rr'} ) : + continue + if ( tag in {'M7_wcmpyrw', 'M7_wcmpyrwc', + 'M7_wcmpyiw', 'M7_wcmpyiwc', + 'M7_wcmpyrw_rnd', 'M7_wcmpyrwc_rnd', + 'M7_wcmpyiw_rnd', 'M7_wcmpyiwc_rnd'} ) : + continue + ## Skip interleave/deinterleave instructions + if ( tag in {'S2_interleave', 'S2_deinterleave'} ) : + continue + ## Skip instructions using bit reverse + if ( tag in {'S2_brev', 'S2_brevp', 'S2_ct0', 'S2_ct1', + 'S2_ct0p', 'S2_ct1p', 'A4_tlbmatch'} ) : + continue + ## Skip other unsupported instructions + if ( tag == 'S2_cabacdecbin' or tag == 'A5_ACS' ) : + continue + if ( tag.startswith('Y') ) : + continue + if ( tag.startswith('V6_') ) : + continue + if ( tag.startswith('F') ) : + continue + if ( tag.endswith('_locked') ) : + continue + + regs = tagregs[tag] + imms = tagimms[tag] + + arguments = [] + for regtype,regid,toss,numregs in regs: + prefix = "in " if hex_common.is_read(regid) else "" + + is_pair = hex_common.is_pair(regid) + is_single_old = (hex_common.is_single(regid) + and hex_common.is_old_val(regtype, regid, tag)) + is_single_new = (hex_common.is_single(regid) + and hex_common.is_new_val(regtype, regid, tag)) + + if is_pair or is_single_old: + arguments.append("%s%s%sV" % (prefix, regtype, regid)) + elif is_single_new: + arguments.append("%s%s%sN" % (prefix, regtype, regid)) + else: + print("Bad register parse: ",regtype,regid,toss,numregs) + + for immlett,bits,immshift in imms: + arguments.append(hex_common.imm_name(immlett)) + + f.write("%s(%s) {\n" % (tag, ", ".join(arguments))) + f.write(" "); + if hex_common.need_ea(tag): + f.write("size4u_t EA; "); + f.write("%s\n" % hex_common.semdict[tag]) + f.write("}\n\n") + +if __name__ == "__main__": + main()
target/hexagon/idef-parser/macros.inc new file +140 -0
140 lines not on this page · raw message
target/hexagon/idef-parser/prepare new file +24 -0
@@ -0,0 +1,24 @@ +#!/bin/bash + +# +# Copyright(c) 2019-2021 rev.ng Labs Srl. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, see <http://www.gnu.org/licenses/>. +# + +set -e +set -o pipefail + +# Run the preprocessor and drop comments +cpp "$@"
target/hexagon/meson.build +17 -0
@@ -21,6 +21,7 @@ hex_common_py = 'hex_common.py' attribs_def = meson.current_source_dir() / 'attribs_def.h.inc' gen_tcg_h = meson.current_source_dir() / 'gen_tcg.h' gen_tcg_hvx_h = meson.current_source_dir() / 'gen_tcg_hvx.h' +idef_parser_dir = meson.current_source_dir() / 'idef-parser' # # Step 1
@@ -179,4 +180,20 @@ hexagon_ss.add(files( 'mmvec/system_ext_mmvec.c', )) +idef_parser_input_generated = custom_target( + 'idef_parser_input.h.inc', + output: 'idef_parser_input.h.inc', + depends: [semantics_generated], + depend_files: [hex_common_py], + command: [python, files('gen_idef_parser_funcs.py'), semantics_generated, attribs_def, '@OUTPUT@'], +) + +preprocessed_idef_parser_input_generated = custom_target( + 'idef_parser_input.preprocessed.h.inc', + output: 'idef_parser_input.preprocessed.h.inc', + input: idef_parser_input_generated, + depend_files: [idef_parser_dir / 'macros.inc'], + command: [idef_parser_dir / 'prepare', '@INPUT@', '-I' + idef_parser_dir, '-o', '@OUTPUT@'], +) + target_arch += {'hexagon': hexagon_ss}
Signature · 1 line
2.35.1
PATCH v9 8/12 target/hexagon: import flex/bison to docker files
In reply to Anton Johansson viaThis patch points tests/lcitool/libvirt-ci to an upstreamed commit of libvirt-ci which includes flex and bison. The lcitool/refresh script was then ran to update the the generated docker/cirrus files.
--- .gitlab-ci.d/cirrus/freebsd-12.vars | 2 +- .gitlab-ci.d/cirrus/freebsd-13.vars | 2 +- .gitlab-ci.d/cirrus/macos-11.vars | 2 +- .gitlab-ci.d/windows.yml | 2 ++ tests/docker/dockerfiles/alpine.docker | 6 ++++-- tests/docker/dockerfiles/centos8.docker | 7 ++++--- tests/docker/dockerfiles/debian-amd64.docker | 2 ++ .../dockerfiles/debian-arm64-cross.docker | 6 ++++-- tests/docker/dockerfiles/debian-native.docker | 3 +++ .../dockerfiles/debian-riscv64-cross.docker | 3 +++ .../dockerfiles/debian-s390x-cross.docker | 6 ++++-- .../dockerfiles/debian-tricore-cross.docker | 1 + tests/docker/dockerfiles/debian10.docker | 3 +++ .../dockerfiles/fedora-i386-cross.docker | 3 +++ .../dockerfiles/fedora-win32-cross.docker | 3 +++ .../dockerfiles/fedora-win64-cross.docker | 3 +++ tests/docker/dockerfiles/fedora.docker | 5 +++-- tests/docker/dockerfiles/opensuse-leap.docker | 5 +++-- tests/docker/dockerfiles/ubuntu1804.docker | 4 +++- tests/docker/dockerfiles/ubuntu2004.docker | 5 +++-- tests/lcitool/libvirt-ci | 2 +- tests/lcitool/projects/qemu.yml | 20 ++++++++++--------- 22 files changed, 66 insertions(+), 29 deletions(-)
.gitlab-ci.d/cirrus/freebsd-12.vars +1 -1
@@ -11,6 +11,6 @@ MAKE='/usr/local/bin/gmake' NINJA='/usr/local/bin/ninja' PACKAGING_COMMAND='pkg' PIP3='/usr/local/bin/pip-3.8' -PKGS='alsa-lib bash bzip2 ca_root_nss capstone4 ccache cdrkit-genisoimage ctags curl cyrus-sasl dbus diffutils dtc fusefs-libs3 gettext git glib gmake gnutls gsed gtk3 libepoxy libffi libgcrypt libjpeg-turbo libnfs libspice-server libssh libtasn1 llvm lzo2 meson ncurses nettle ninja opencv perl5 pixman pkgconf png py38-numpy py38-pillow py38-pip py38-sphinx py38-sphinx_rtd_theme py38-virtualenv py38-yaml python3 rpm2cpio sdl2 sdl2_image snappy spice-protocol tesseract texinfo usbredir virglrenderer vte3 zstd' +PKGS='alsa-lib bash bison bzip2 ca_root_nss capstone4 ccache cdrkit-genisoimage ctags curl cyrus-sasl dbus diffutils dtc flex gettext git glib gmake gnutls gsed gtk3 libepoxy libffi libgcrypt libjpeg-turbo libnfs libspice-server libssh libtasn1 libxml2 llvm lzo2 meson ncurses nettle ninja opencv perl5 pixman pkgconf png py38-numpy py38-pillow py38-pip py38-sphinx py38-sphinx_rtd_theme py38-virtualenv py38-yaml python3 rpm2cpio sdl2 sdl2_image snappy spice-protocol tesseract texinfo usbredir virglrenderer vte3 zstd' PYPI_PKGS='' PYTHON='/usr/local/bin/python3'
.gitlab-ci.d/cirrus/freebsd-13.vars +1 -1
@@ -11,6 +11,6 @@ MAKE='/usr/local/bin/gmake' NINJA='/usr/local/bin/ninja' PACKAGING_COMMAND='pkg' PIP3='/usr/local/bin/pip-3.8' -PKGS='alsa-lib bash bzip2 ca_root_nss capstone4 ccache cdrkit-genisoimage ctags curl cyrus-sasl dbus diffutils dtc fusefs-libs3 gettext git glib gmake gnutls gsed gtk3 libepoxy libffi libgcrypt libjpeg-turbo libnfs libspice-server libssh libtasn1 llvm lzo2 meson ncurses nettle ninja opencv perl5 pixman pkgconf png py38-numpy py38-pillow py38-pip py38-sphinx py38-sphinx_rtd_theme py38-virtualenv py38-yaml python3 rpm2cpio sdl2 sdl2_image snappy spice-protocol tesseract texinfo usbredir virglrenderer vte3 zstd' +PKGS='alsa-lib bash bison bzip2 ca_root_nss capstone4 ccache cdrkit-genisoimage ctags curl cyrus-sasl dbus diffutils dtc flex gettext git glib gmake gnutls gsed gtk3 libepoxy libffi libgcrypt libjpeg-turbo libnfs libspice-server libssh libtasn1 libxml2 llvm lzo2 meson ncurses nettle ninja opencv perl5 pixman pkgconf png py38-numpy py38-pillow py38-pip py38-sphinx py38-sphinx_rtd_theme py38-virtualenv py38-yaml python3 rpm2cpio sdl2 sdl2_image snappy spice-protocol tesseract texinfo usbredir virglrenderer vte3 zstd' PYPI_PKGS='' PYTHON='/usr/local/bin/python3'
.gitlab-ci.d/cirrus/macos-11.vars +1 -1
@@ -11,6 +11,6 @@ MAKE='/usr/local/bin/gmake' NINJA='/usr/local/bin/ninja' PACKAGING_COMMAND='brew' PIP3='/usr/local/bin/pip3' -PKGS='bash bc bzip2 capstone ccache ctags curl dbus diffutils dtc gcovr gettext git glib gnu-sed gnutls gtk+3 jemalloc jpeg-turbo libepoxy libffi libgcrypt libiscsi libnfs libpng libslirp libssh libtasn1 libusb llvm lzo make meson ncurses nettle ninja perl pixman pkg-config python3 rpm2cpio sdl2 sdl2_image snappy sparse spice-protocol tesseract texinfo usbredir vde vte3 zlib zstd' +PKGS='bash bc bison bzip2 capstone ccache ctags curl dbus diffutils dtc flex gcovr gettext git glib gnu-sed gnutls gtk+3 jemalloc jpeg-turbo libepoxy libffi libgcrypt libiscsi libnfs libpng libslirp libssh libtasn1 libusb libxml2 llvm lzo make meson ncurses nettle ninja perl pixman pkg-config python3 rpm2cpio sdl2 sdl2_image snappy sparse spice-protocol tesseract texinfo usbredir vde vte3 zlib zstd' PYPI_PKGS='PyYAML numpy pillow sphinx sphinx-rtd-theme virtualenv' PYTHON='/usr/local/bin/python3'
.gitlab-ci.d/windows.yml +2 -0
@@ -33,6 +33,7 @@ msys2-64bit: script: - .\msys64\usr\bin\bash -lc "pacman -Sy --noconfirm --needed diffutils git grep make sed + flex bison mingw-w64-x86_64-capstone mingw-w64-x86_64-curl mingw-w64-x86_64-cyrus-sasl
@@ -67,6 +68,7 @@ msys2-32bit: script: - .\msys64\usr\bin\bash -lc "pacman -Sy --noconfirm --needed diffutils git grep make sed + flex bison mingw-w64-i686-capstone mingw-w64-i686-curl mingw-w64-i686-cyrus-sasl
tests/docker/dockerfiles/alpine.docker +4 -2
@@ -13,6 +13,7 @@ RUN apk update && \ attr-dev \ bash \ bc \ + bison \ bzip2 \ bzip2-dev \ ca-certificates \
@@ -29,7 +30,7 @@ RUN apk update && \ dtc-dev \ eudev-dev \ findutils \ - fuse3-dev \ + flex \ g++ \ gcc \ gcovr \
@@ -50,12 +51,12 @@ RUN apk update && \ libnfs-dev \ libpng-dev \ libseccomp-dev \ - libselinux-dev \ libslirp-dev \ libssh-dev \ libtasn1-dev \ liburing-dev \ libusb-dev \ + libxml2-dev \ linux-pam-dev \ llvm11 \ lttng-ust-dev \
@@ -64,6 +65,7 @@ RUN apk update && \ mesa-dev \ meson \ multipath-tools \ + musl-dev \ ncurses-dev \ ndctl-dev \ net-tools \
tests/docker/dockerfiles/centos8.docker +4 -3
@@ -6,7 +6,7 @@ FROM quay.io/centos/centos:stream8 -RUN dnf update -y && \ +RUN dnf distro-sync -y && \ dnf install 'dnf-command(config-manager)' -y && \ dnf config-manager --set-enabled -y powertools && \ dnf install -y centos-release-advanced-virtualization && \
@@ -16,6 +16,7 @@ RUN dnf update -y && \ alsa-lib-devel \ bash \ bc \ + bison \ brlapi-devel \ bzip2 \ bzip2-devel \
@@ -30,7 +31,7 @@ RUN dnf update -y && \ device-mapper-multipath-devel \ diffutils \ findutils \ - fuse3-devel \ + flex \ gcc \ gcc-c++ \ genisoimage \
@@ -64,13 +65,13 @@ RUN dnf update -y && \ libpng-devel \ librbd-devel \ libseccomp-devel \ - libselinux-devel \ libslirp-devel \ libssh-devel \ libtasn1-devel \ libubsan \ liburing-devel \ libusbx-devel \ + libxml2-devel \ libzstd-devel \ llvm \ lttng-ust-devel \
tests/docker/dockerfiles/debian-amd64.docker +2 -0
@@ -14,9 +14,11 @@ RUN apt update && \ RUN apt update && \ DEBIAN_FRONTEND=noninteractive eatmydata \ apt install -y --no-install-recommends \ + bison \ cscope \ genisoimage \ exuberant-ctags \ + flex \ global \ libbz2-dev \ liblzo2-dev \
tests/docker/dockerfiles/debian-arm64-cross.docker +4 -2
@@ -13,6 +13,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ eatmydata apt-get install --no-install-recommends -y \ bash \ bc \ + bison \ bsdextrautils \ bzip2 \ ca-certificates \
@@ -22,11 +23,13 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ diffutils \ exuberant-ctags \ findutils \ + flex \ gcovr \ genisoimage \ gettext \ git \ hostname \ + libglib2.0-dev \ libpcre2-dev \ libspice-protocol-dev \ llvm \
@@ -90,7 +93,6 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libepoxy-dev:arm64 \ libfdt-dev:arm64 \ libffi-dev:arm64 \ - libfuse3-dev:arm64 \ libgbm-dev:arm64 \ libgcrypt20-dev:arm64 \ libglib2.0-dev:arm64 \
@@ -117,7 +119,6 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libsdl2-dev:arm64 \ libsdl2-image-dev:arm64 \ libseccomp-dev:arm64 \ - libselinux1-dev:arm64 \ libslirp-dev:arm64 \ libsnappy-dev:arm64 \ libspice-server-dev:arm64 \
@@ -133,6 +134,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libvirglrenderer-dev:arm64 \ libvte-2.91-dev:arm64 \ libxen-dev:arm64 \ + libxml2-dev:arm64 \ libzstd-dev:arm64 \ nettle-dev:arm64 \ systemtap-sdt-dev:arm64 \
tests/docker/dockerfiles/debian-native.docker +3 -0
@@ -26,13 +26,16 @@ RUN apt update && \ RUN apt update && \ DEBIAN_FRONTEND=noninteractive eatmydata \ apt install -y --no-install-recommends \ + bison \ cscope \ genisoimage \ exuberant-ctags \ + flex \ global \ libbz2-dev \ liblzo2-dev \ libgcrypt20-dev \ + libglib2.0-dev \ libfdt-dev \ librdmacm-dev \ libsasl2-dev \
tests/docker/dockerfiles/debian-riscv64-cross.docker +3 -0
@@ -17,12 +17,15 @@ RUN apt update && \ # Install common build utilities RUN DEBIAN_FRONTEND=noninteractive eatmydata apt install -yy \ bc \ + bison \ build-essential \ ca-certificates \ debian-ports-archive-keyring \ dpkg-dev \ + flex \ gettext \ git \ + libglib2.0-dev \ ninja-build \ pkg-config \ python3
tests/docker/dockerfiles/debian-s390x-cross.docker +4 -2
@@ -13,6 +13,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ eatmydata apt-get install --no-install-recommends -y \ bash \ bc \ + bison \ bsdextrautils \ bzip2 \ ca-certificates \
@@ -22,11 +23,13 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ diffutils \ exuberant-ctags \ findutils \ + flex \ gcovr \ genisoimage \ gettext \ git \ hostname \ + libglib2.0-dev \ libpcre2-dev \ libspice-protocol-dev \ llvm \
@@ -90,7 +93,6 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libepoxy-dev:s390x \ libfdt-dev:s390x \ libffi-dev:s390x \ - libfuse3-dev:s390x \ libgbm-dev:s390x \ libgcrypt20-dev:s390x \ libglib2.0-dev:s390x \
@@ -117,7 +119,6 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libsdl2-dev:s390x \ libsdl2-image-dev:s390x \ libseccomp-dev:s390x \ - libselinux1-dev:s390x \ libslirp-dev:s390x \ libsnappy-dev:s390x \ libssh-gcrypt-dev:s390x \
@@ -131,6 +132,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libvdeplug-dev:s390x \ libvirglrenderer-dev:s390x \ libvte-2.91-dev:s390x \ + libxml2-dev:s390x \ libzstd-dev:s390x \ nettle-dev:s390x \ systemtap-sdt-dev:s390x \
tests/docker/dockerfiles/debian-tricore-cross.docker +1 -0
@@ -20,6 +20,7 @@ RUN apt update && \ bzip2 \ ca-certificates \ ccache \ + flex \ g++ \ gcc \ git \
tests/docker/dockerfiles/debian10.docker +3 -0
@@ -18,15 +18,18 @@ RUN apt update && \ DEBIAN_FRONTEND=noninteractive eatmydata \ apt install -y --no-install-recommends \ bc \ + bison \ build-essential \ ca-certificates \ ccache \ clang \ dbus \ + flex \ gdb-multiarch \ gettext \ git \ libffi-dev \ + libglib2.0-dev \ libncurses5-dev \ ninja-build \ pkg-config \
tests/docker/dockerfiles/fedora-i386-cross.docker +3 -0
@@ -1,12 +1,15 @@ FROM registry.fedoraproject.org/fedora:34 ENV PACKAGES \ + bison \ bzip2 \ ccache \ diffutils \ findutils \ + flex \ gcc \ git \ + glib2-devel \ libffi-devel.i686 \ libselinux-devel.i686 \ libtasn1-devel.i686 \
tests/docker/dockerfiles/fedora-win32-cross.docker +3 -0
@@ -3,13 +3,16 @@ FROM registry.fedoraproject.org/fedora:33 # Please keep this list sorted alphabetically ENV PACKAGES \ bc \ + bison \ bzip2 \ ccache \ diffutils \ findutils \ + flex \ gcc \ gettext \ git \ + glib2-devel \ hostname \ make \ meson \
tests/docker/dockerfiles/fedora-win64-cross.docker +3 -0
@@ -3,12 +3,15 @@ FROM registry.fedoraproject.org/fedora:33 # Please keep this list sorted alphabetically ENV PACKAGES \ bc \ + bison \ bzip2 \ ccache \ diffutils \ findutils \ + flex \ gcc \ gettext \ + glib2-devel \ git \ hostname \ make \
tests/docker/dockerfiles/fedora.docker +3 -2
@@ -23,6 +23,7 @@ exec "$@"' > /usr/bin/nosync && \ alsa-lib-devel \ bash \ bc \ + bison \ brlapi-devel \ bzip2 \ bzip2-devel \
@@ -37,7 +38,7 @@ exec "$@"' > /usr/bin/nosync && \ device-mapper-multipath-devel \ diffutils \ findutils \ - fuse3-devel \ + flex \ gcc \ gcc-c++ \ gcovr \
@@ -72,13 +73,13 @@ exec "$@"' > /usr/bin/nosync && \ libpng-devel \ librbd-devel \ libseccomp-devel \ - libselinux-devel \ libslirp-devel \ libssh-devel \ libtasn1-devel \ libubsan \ liburing-devel \ libusbx-devel \ + libxml2-devel \ libzstd-devel \ llvm \ lttng-ust-devel \
tests/docker/dockerfiles/opensuse-leap.docker +3 -2
@@ -12,6 +12,7 @@ RUN zypper update -y && \ alsa-lib-devel \ bash \ bc \ + bison \ brlapi-devel \ bzip2 \ ca-certificates \
@@ -22,7 +23,7 @@ RUN zypper update -y && \ dbus-1 \ diffutils \ findutils \ - fuse3-devel \ + flex \ gcc \ gcc-c++ \ gcovr \
@@ -63,7 +64,6 @@ RUN zypper update -y && \ libpulse-devel \ librbd-devel \ libseccomp-devel \ - libselinux-devel \ libspice-server-devel \ libssh-devel \ libtasn1-devel \
@@ -71,6 +71,7 @@ RUN zypper update -y && \ libudev-devel \ liburing-devel \ libusb-1_0-devel \ + libxml2-devel \ libzstd-devel \ llvm \ lttng-ust-devel \
tests/docker/dockerfiles/ubuntu1804.docker +3 -1
@@ -13,6 +13,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ eatmydata apt-get install --no-install-recommends -y \ bash \ bc \ + bison \ bsdmainutils \ bzip2 \ ca-certificates \
@@ -23,6 +24,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ diffutils \ exuberant-ctags \ findutils \ + flex \ g++ \ gcc \ gcovr \
@@ -74,7 +76,6 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libsdl2-dev \ libsdl2-image-dev \ libseccomp-dev \ - libselinux1-dev \ libsnappy-dev \ libspice-protocol-dev \ libspice-server-dev \
@@ -89,6 +90,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libvirglrenderer-dev \ libvte-2.91-dev \ libxen-dev \ + libxml2-dev \ libzstd-dev \ llvm \ locales \
tests/docker/dockerfiles/ubuntu2004.docker +3 -2
@@ -13,6 +13,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ eatmydata apt-get install --no-install-recommends -y \ bash \ bc \ + bison \ bsdmainutils \ bzip2 \ ca-certificates \
@@ -23,6 +24,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ diffutils \ exuberant-ctags \ findutils \ + flex \ g++ \ gcc \ gcovr \
@@ -46,7 +48,6 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libepoxy-dev \ libfdt-dev \ libffi-dev \ - libfuse3-dev \ libgbm-dev \ libgcrypt20-dev \ libglib2.0-dev \
@@ -75,7 +76,6 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libsdl2-dev \ libsdl2-image-dev \ libseccomp-dev \ - libselinux1-dev \ libslirp-dev \ libsnappy-dev \ libspice-protocol-dev \
@@ -91,6 +91,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libvirglrenderer-dev \ libvte-2.91-dev \ libxen-dev \ + libxml2-dev \ libzstd-dev \ llvm \ locales \
tests/lcitool/libvirt-ci +1 -1
@@ -1 +1 @@ -Subproject commit f83b916d5efa4bd33fbf4b7ea41bf6d535cc63fb +Subproject commit 43927ff508e8ecb1ac225dabbc95b37c890db917
tests/lcitool/projects/qemu.yml +11 -9
@@ -3,6 +3,7 @@ packages: - alsa - bash - bc + - bison - brlapi - bzip2 - bzip2-libs
@@ -18,23 +19,24 @@ packages: - diffutils - dtrace - findutils - - fuse3 + - flex - g++ - gcc - gcovr - - gettext - genisoimage + - gettext - glib2 + - glib2-native - glib2-static - - glibc-static - glusterfs - gnutls - gtk3 - hostname - libaio - - libattr - libasan + - libattr - libbpf + - libc-static - libcacard - libcap-ng - libcurl
@@ -55,7 +57,6 @@ packages: - librbd - librdmacm - libseccomp - - libselinux - libslirp - libssh - libtasn1
@@ -64,18 +65,19 @@ packages: - liburing - libusbx - libvdeplug + - libxml2 - libzstd - llvm - lttng-ust - lzo - - netcat - - nettle - - ninja - - nsis - make - mesa-libgbm - meson - ncursesw + - netcat + - nettle + - ninja + - nsis - pam - pcre-static - perl
Signature · 1 line
2.35.1
Re: [PATCH v9 08/12] target/hexagon: import flex/bison to docker files
Quoted 49 lines · Anton Johansson via
This patch points
tests/lcitool/libvirt-cito an upstreamed commit oflibvirt-ciwhich includes flex and bison. Thelcitool/refreshscript was then ran to update the the generated docker/cirrus files.Signed-off-by Alessandro Di Federico <[email protected]>Signed-off-by Paolo Montesel <[email protected]>Signed-off-by Anton Johansson <[email protected]>--- .gitlab-ci.d/cirrus/freebsd-12.vars | 2 +- .gitlab-ci.d/cirrus/freebsd-13.vars | 2 +- .gitlab-ci.d/cirrus/macos-11.vars | 2 +- .gitlab-ci.d/windows.yml | 2 ++ tests/docker/dockerfiles/alpine.docker | 6 ++++-- tests/docker/dockerfiles/centos8.docker | 7 ++++--- tests/docker/dockerfiles/debian-amd64.docker | 2 ++ .../dockerfiles/debian-arm64-cross.docker | 6 ++++-- tests/docker/dockerfiles/debian-native.docker | 3 +++ .../dockerfiles/debian-riscv64-cross.docker | 3 +++ .../dockerfiles/debian-s390x-cross.docker | 6 ++++-- .../dockerfiles/debian-tricore-cross.docker | 1 + tests/docker/dockerfiles/debian10.docker | 3 +++ .../dockerfiles/fedora-i386-cross.docker | 3 +++ .../dockerfiles/fedora-win32-cross.docker | 3 +++ .../dockerfiles/fedora-win64-cross.docker | 3 +++ tests/docker/dockerfiles/fedora.docker | 5 +++-- tests/docker/dockerfiles/opensuse-leap.docker | 5 +++-- tests/docker/dockerfiles/ubuntu1804.docker | 4 +++- tests/docker/dockerfiles/ubuntu2004.docker | 5 +++-- tests/lcitool/libvirt-ci | 2 +- tests/lcitool/projects/qemu.yml | 20 ++++++++++--------- 22 files changed, 66 insertions(+), 29 deletions(-).gitlab-ci.d/cirrus/freebsd-12.vars +1
-1@@ -11,6 +11,6 @@ MAKE='/usr/local/bin/gmake' NINJA='/usr/local/bin/ninja' PACKAGING_COMMAND='pkg' PIP3='/usr/local/bin/pip-3.8' -PKGS='alsa-lib bash bzip2 ca_root_nss capstone4 ccache cdrkit-genisoimage ctags curl cyrus-sasl dbus diffutils dtc fusefs-libs3 gettext git glib gmake gnutls gsed gtk3 libepoxy libffi libgcrypt libjpeg-turbo libnfs libspice-server libssh libtasn1 llvm lzo2 meson ncurses nettle ninja opencv perl5 pixman pkgconf png py38-numpy py38-pillow py38-pip py38-sphinx py38-sphinx_rtd_theme py38-virtualenv py38-yaml python3 rpm2cpio sdl2 sdl2_image snappy spice-protocol tesseract texinfo usbredir virglrenderer vte3 zstd' +PKGS='alsa-lib bash bison bzip2 ca_root_nss capstone4 ccache cdrkit-genisoimage ctags curl cyrus-sasl dbus diffutils dtc flex gettext git glib gmake gnutls gsed gtk3 libepoxy libffi libgcrypt libjpeg-turbo libnfs libspice-server libssh libtasn1 libxml2 llvm lzo2 meson ncurses nettle ninja opencv perl5 pixman pkgconf png py38-numpy py38-pillow py38-pip py38-sphinx py38-sphinx_rtd_theme py38-virtualenv py38-yaml python3 rpm2cpio sdl2 sdl2_image snappy spice-protocol tesseract texinfo usbredir virglrenderer vte3 zstd' PYPI_PKGS='' PYTHON='/usr/local/bin/python3'.gitlab-ci.d/cirrus/freebsd-13.vars +0
-0
.gitlab-ci.d/cirrus/freebsd-13.vars MAKE='/usr/local/bin/gmake' · line 16
Quoted 7 lines
.gitlab-ci.d/cirrus/freebsd-13.vars +1
-1@@ -11,6 +11,6 @@ MAKE='/usr/local/bin/gmake' NINJA='/usr/local/bin/ninja' PACKAGING_COMMAND='pkg' PIP3='/usr/local/bin/pip-3.8' -PKGS='alsa-lib bash bzip2 ca_root_nss capstone4 ccache cdrkit-genisoimage ctags curl cyrus-sasl dbus diffutils dtc fusefs-libs3 gettext git glib gmake gnutls gsed gtk3 libepoxy libffi libgcrypt libjpeg-turbo libnfs libspice-server libssh libtasn1 llvm lzo2 meson ncurses nettle ninja opencv perl5 pixman pkgconf png py38-numpy py38-pillow py38-pip py38-sphinx py38-sphinx_rtd_theme py38-virtualenv py38-yaml python3 rpm2cpio sdl2 sdl2_image snappy spice-protocol tesseract texinfo usbredir virglrenderer vte3 zstd' +PKGS='alsa-lib bash bison bzip2 ca_root_nss capstone4 ccache cdrkit-genisoimage ctags curl cyrus-sasl dbus diffutils dtc flex gettext git glib gmake gnutls gsed gtk3 libepoxy libffi libgcrypt libjpeg-turbo libnfs libspice-server libssh libtasn1 libxml2 llvm lzo2 meson ncurses nettle ninja opencv perl5 pixman pkgconf png py38-numpy py38-pillow py38-pip py38-sphinx py38-sphinx_rtd_theme py38-virtualenv py38-yaml python3 rpm2cpio sdl2 sdl2_image snappy spice-protocol tesseract texinfo usbredir virglrenderer vte3 zstd' PYPI_PKGS='' PYTHON='/usr/local/bin/python3'
This is quite a lot of containers at once which makes it hard to review. Do we actually build hexagon on all these various containers anyway?
Either way I'd be tempted to update one container per patch.
Quoted 45 lines
.gitlab-ci.d/cirrus/macos-11.vars +1
-1@@ -11,6 +11,6 @@ MAKE='/usr/local/bin/gmake' NINJA='/usr/local/bin/ninja' PACKAGING_COMMAND='brew' PIP3='/usr/local/bin/pip3' -PKGS='bash bc bzip2 capstone ccache ctags curl dbus diffutils dtc gcovr gettext git glib gnu-sed gnutls gtk+3 jemalloc jpeg-turbo libepoxy libffi libgcrypt libiscsi libnfs libpng libslirp libssh libtasn1 libusb llvm lzo make meson ncurses nettle ninja perl pixman pkg-config python3 rpm2cpio sdl2 sdl2_image snappy sparse spice-protocol tesseract texinfo usbredir vde vte3 zlib zstd' +PKGS='bash bc bison bzip2 capstone ccache ctags curl dbus diffutils dtc flex gcovr gettext git glib gnu-sed gnutls gtk+3 jemalloc jpeg-turbo libepoxy libffi libgcrypt libiscsi libnfs libpng libslirp libssh libtasn1 libusb libxml2 llvm lzo make meson ncurses nettle ninja perl pixman pkg-config python3 rpm2cpio sdl2 sdl2_image snappy sparse spice-protocol tesseract texinfo usbredir vde vte3 zlib zstd' PYPI_PKGS='PyYAML numpy pillow sphinx sphinx-rtd-theme virtualenv' PYTHON='/usr/local/bin/python3'.gitlab-ci.d/windows.yml +2
-0@@ -33,6 +33,7 @@ msys2-64bit: script: - .\msys64\usr\bin\bash -lc "pacman -Sy --noconfirm --needed diffutils git grep make sed + flex bison mingw-w64-x86_64-capstone mingw-w64-x86_64-curl mingw-w64-x86_64-cyrus-sasl@@ -67,6 +68,7 @@ msys2-32bit: script: - .\msys64\usr\bin\bash -lc "pacman -Sy --noconfirm --needed diffutils git grep make sed + flex bison mingw-w64-i686-capstone mingw-w64-i686-curl mingw-w64-i686-cyrus-sasltests/docker/dockerfiles/alpine.docker +1
-0@@ -13,6 +13,7 @@ RUN apk update && \ attr-dev \ bash \ bc \ + bison \ bzip2 \ bzip2-dev \ ca-certificates \
tests/docker/dockerfiles/alpine.docker RUN apk update && \ · line 32
Quoted 4 lines
tests/docker/dockerfiles/alpine.docker +0
-1@@ -29,7 +30,7 @@ RUN apk update && \ dtc-dev \ eudev-dev \ findutils \ - fuse3-dev \
Why has this dropped?
tests/docker/dockerfiles/alpine.docker RUN apk update && \ · line 53
Quoted 9 lines
tests/docker/dockerfiles/alpine.docker +1
-1+ flex \ g++ \ gcc \ gcovr \@@ -50,12 +51,12 @@ RUN apk update && \ libnfs-dev \ libpng-dev \ libseccomp-dev \ - libselinux-dev \
Or this
tests/docker/dockerfiles/alpine.docker RUN apk update && \ · line 59
Quoted 6 lines
tests/docker/dockerfiles/alpine.docker +1
-0libslirp-dev \ libssh-dev \ libtasn1-dev \ liburing-dev \ libusb-dev \ + libxml2-dev \
this isn't flex/bison
tests/docker/dockerfiles/alpine.docker RUN apk update && \ · line 68
Quoted 8 lines
tests/docker/dockerfiles/alpine.docker +1
-0linux-pam-dev \ llvm11 \ lttng-ust-dev \@@ -64,6 +65,7 @@ RUN apk update && \ mesa-dev \ meson \ multipath-tools \ + musl-dev \
?
Quoted 25 lines
tests/docker/dockerfiles/alpine.docker +0
-0ncurses-dev \ ndctl-dev \ net-tools \tests/docker/dockerfiles/centos8.docker +2
-1@@ -6,7 +6,7 @@ FROM quay.io/centos/centos:stream8 -RUN dnf update -y && \ +RUN dnf distro-sync -y && \ dnf install 'dnf-command(config-manager)' -y && \ dnf config-manager --set-enabled -y powertools && \ dnf install -y centos-release-advanced-virtualization && \@@ -16,6 +16,7 @@ RUN dnf update -y && \ alsa-lib-devel \ bash \ bc \ + bison \ brlapi-devel \ bzip2 \ bzip2-devel \
tests/docker/dockerfiles/centos8.docker RUN dnf update -y && \ · line 33
Quoted 4 lines
tests/docker/dockerfiles/centos8.docker +0
-1@@ -30,7 +31,7 @@ RUN dnf update -y && \ device-mapper-multipath-devel \ diffutils \ findutils \ - fuse3-devel \
?
tests/docker/dockerfiles/centos8.docker RUN dnf update -y && \ · line 67
Quoted 9 lines
tests/docker/dockerfiles/centos8.docker +1
-1+ flex \ gcc \ gcc-c++ \ genisoimage \@@ -64,13 +65,13 @@ RUN dnf update -y && \ libpng-devel \ librbd-devel \ libseccomp-devel \ - libselinux-devel \
?
Quoted 39 lines
tests/docker/dockerfiles/centos8.docker +1
-0libslirp-devel \ libssh-devel \ libtasn1-devel \ libubsan \ liburing-devel \ libusbx-devel \ + libxml2-devel \ libzstd-devel \ llvm \ lttng-ust-devel \tests/docker/dockerfiles/debian-amd64.docker +2
-0@@ -14,9 +14,11 @@ RUN apt update && \ RUN apt update && \ DEBIAN_FRONTEND=noninteractive eatmydata \ apt install -y --no-install-recommends \ + bison \ cscope \ genisoimage \ exuberant-ctags \ + flex \ global \ libbz2-dev \ liblzo2-dev \tests/docker/dockerfiles/debian-arm64-cross.docker +1
-0@@ -13,6 +13,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ eatmydata apt-get install --no-install-recommends -y \ bash \ bc \ + bison \ bsdextrautils \ bzip2 \ ca-certificates \
tests/docker/dockerfiles/debian-arm64-cross.docker RUN export DEBIAN_FRONTEND=noninteractive && \ · line 32
Quoted 10 lines
tests/docker/dockerfiles/debian-arm64-cross.docker +2
-0@@ -22,11 +23,13 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ diffutils \ exuberant-ctags \ findutils \ + flex \ gcovr \ genisoimage \ gettext \ git \ hostname \ + libglib2.0-dev \
?
Quoted 12 lines
tests/docker/dockerfiles/debian-arm64-cross.docker +0
-1libpcre2-dev \ libspice-protocol-dev \ llvm \@@ -90,7 +93,6 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libepoxy-dev:arm64 \ libfdt-dev:arm64 \ libffi-dev:arm64 \ - libfuse3-dev:arm64 \ libgbm-dev:arm64 \ libgcrypt20-dev:arm64 \ libglib2.0-dev:arm64 \
tests/docker/dockerfiles/debian-arm64-cross.docker RUN export DEBIAN_FRONTEND=noninteractive && \ · line 120
Quoted 4 lines
tests/docker/dockerfiles/debian-arm64-cross.docker +0
-1@@ -117,7 +119,6 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libsdl2-dev:arm64 \ libsdl2-image-dev:arm64 \ libseccomp-dev:arm64 \ - libselinux1-dev:arm64 \
?
tests/docker/dockerfiles/debian-arm64-cross.docker RUN export DEBIAN_FRONTEND=noninteractive && \ · line 137
Quoted 8 lines
tests/docker/dockerfiles/debian-arm64-cross.docker +1
-0libslirp-dev:arm64 \ libsnappy-dev:arm64 \ libspice-server-dev:arm64 \@@ -133,6 +134,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libvirglrenderer-dev:arm64 \ libvte-2.91-dev:arm64 \ libxen-dev:arm64 \ + libxml2-dev:arm64 \
?
Quoted 11 lines
tests/docker/dockerfiles/debian-arm64-cross.docker +0
-0libzstd-dev:arm64 \ nettle-dev:arm64 \ systemtap-sdt-dev:arm64 \tests/docker/dockerfiles/debian-native.docker +0
-0@@ -26,13 +26,16 @@ RUN apt update && \ RUN apt update && \ DEBIAN_FRONTEND=noninteractive eatmydata \ apt install -y --no-install-recommends \
tests/docker/dockerfiles/debian-native.docker RUN apt update && \ · line 38
Quoted 10 lines
tests/docker/dockerfiles/debian-native.docker +3
-0+ bison \ cscope \ genisoimage \ exuberant-ctags \ + flex \ global \ libbz2-dev \ liblzo2-dev \ libgcrypt20-dev \ + libglib2.0-dev \
?
Quoted 392 lines
tests/docker/dockerfiles/debian-native.docker +0
-0libfdt-dev \ librdmacm-dev \ libsasl2-dev \tests/docker/dockerfiles/debian-riscv64-cross.docker +3
-0@@ -17,12 +17,15 @@ RUN apt update && \ # Install common build utilities RUN DEBIAN_FRONTEND=noninteractive eatmydata apt install -yy \ bc \ + bison \ build-essential \ ca-certificates \ debian-ports-archive-keyring \ dpkg-dev \ + flex \ gettext \ git \ + libglib2.0-dev \ ninja-build \ pkg-config \ python3tests/docker/dockerfiles/debian-s390x-cross.docker +4
-2@@ -13,6 +13,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ eatmydata apt-get install --no-install-recommends -y \ bash \ bc \ + bison \ bsdextrautils \ bzip2 \ ca-certificates \@@ -22,11 +23,13 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ diffutils \ exuberant-ctags \ findutils \ + flex \ gcovr \ genisoimage \ gettext \ git \ hostname \ + libglib2.0-dev \ libpcre2-dev \ libspice-protocol-dev \ llvm \@@ -90,7 +93,6 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libepoxy-dev:s390x \ libfdt-dev:s390x \ libffi-dev:s390x \ - libfuse3-dev:s390x \ libgbm-dev:s390x \ libgcrypt20-dev:s390x \ libglib2.0-dev:s390x \@@ -117,7 +119,6 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libsdl2-dev:s390x \ libsdl2-image-dev:s390x \ libseccomp-dev:s390x \ - libselinux1-dev:s390x \ libslirp-dev:s390x \ libsnappy-dev:s390x \ libssh-gcrypt-dev:s390x \@@ -131,6 +132,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libvdeplug-dev:s390x \ libvirglrenderer-dev:s390x \ libvte-2.91-dev:s390x \ + libxml2-dev:s390x \ libzstd-dev:s390x \ nettle-dev:s390x \ systemtap-sdt-dev:s390x \tests/docker/dockerfiles/debian-tricore-cross.docker +1
-0@@ -20,6 +20,7 @@ RUN apt update && \ bzip2 \ ca-certificates \ ccache \ + flex \ g++ \ gcc \ git \tests/docker/dockerfiles/debian10.docker +3
-0@@ -18,15 +18,18 @@ RUN apt update && \ DEBIAN_FRONTEND=noninteractive eatmydata \ apt install -y --no-install-recommends \ bc \ + bison \ build-essential \ ca-certificates \ ccache \ clang \ dbus \ + flex \ gdb-multiarch \ gettext \ git \ libffi-dev \ + libglib2.0-dev \ libncurses5-dev \ ninja-build \ pkg-config \tests/docker/dockerfiles/fedora-i386-cross.docker +3
-0@@ -1,12 +1,15 @@ FROM registry.fedoraproject.org/fedora:34 ENV PACKAGES \ + bison \ bzip2 \ ccache \ diffutils \ findutils \ + flex \ gcc \ git \ + glib2-devel \ libffi-devel.i686 \ libselinux-devel.i686 \ libtasn1-devel.i686 \tests/docker/dockerfiles/fedora-win32-cross.docker +3
-0@@ -3,13 +3,16 @@ FROM registry.fedoraproject.org/fedora:33 # Please keep this list sorted alphabetically ENV PACKAGES \ bc \ + bison \ bzip2 \ ccache \ diffutils \ findutils \ + flex \ gcc \ gettext \ git \ + glib2-devel \ hostname \ make \ meson \tests/docker/dockerfiles/fedora-win64-cross.docker +3
-0@@ -3,12 +3,15 @@ FROM registry.fedoraproject.org/fedora:33 # Please keep this list sorted alphabetically ENV PACKAGES \ bc \ + bison \ bzip2 \ ccache \ diffutils \ findutils \ + flex \ gcc \ gettext \ + glib2-devel \ git \ hostname \ make \tests/docker/dockerfiles/fedora.docker +3
-2@@ -23,6 +23,7 @@ exec "$@"' > /usr/bin/nosync && \ alsa-lib-devel \ bash \ bc \ + bison \ brlapi-devel \ bzip2 \ bzip2-devel \@@ -37,7 +38,7 @@ exec "$@"' > /usr/bin/nosync && \ device-mapper-multipath-devel \ diffutils \ findutils \ - fuse3-devel \ + flex \ gcc \ gcc-c++ \ gcovr \@@ -72,13 +73,13 @@ exec "$@"' > /usr/bin/nosync && \ libpng-devel \ librbd-devel \ libseccomp-devel \ - libselinux-devel \ libslirp-devel \ libssh-devel \ libtasn1-devel \ libubsan \ liburing-devel \ libusbx-devel \ + libxml2-devel \ libzstd-devel \ llvm \ lttng-ust-devel \tests/docker/dockerfiles/opensuse-leap.docker +3
-2@@ -12,6 +12,7 @@ RUN zypper update -y && \ alsa-lib-devel \ bash \ bc \ + bison \ brlapi-devel \ bzip2 \ ca-certificates \@@ -22,7 +23,7 @@ RUN zypper update -y && \ dbus-1 \ diffutils \ findutils \ - fuse3-devel \ + flex \ gcc \ gcc-c++ \ gcovr \@@ -63,7 +64,6 @@ RUN zypper update -y && \ libpulse-devel \ librbd-devel \ libseccomp-devel \ - libselinux-devel \ libspice-server-devel \ libssh-devel \ libtasn1-devel \@@ -71,6 +71,7 @@ RUN zypper update -y && \ libudev-devel \ liburing-devel \ libusb-1_0-devel \ + libxml2-devel \ libzstd-devel \ llvm \ lttng-ust-devel \tests/docker/dockerfiles/ubuntu1804.docker +3
-1@@ -13,6 +13,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ eatmydata apt-get install --no-install-recommends -y \ bash \ bc \ + bison \ bsdmainutils \ bzip2 \ ca-certificates \@@ -23,6 +24,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ diffutils \ exuberant-ctags \ findutils \ + flex \ g++ \ gcc \ gcovr \@@ -74,7 +76,6 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libsdl2-dev \ libsdl2-image-dev \ libseccomp-dev \ - libselinux1-dev \ libsnappy-dev \ libspice-protocol-dev \ libspice-server-dev \@@ -89,6 +90,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libvirglrenderer-dev \ libvte-2.91-dev \ libxen-dev \ + libxml2-dev \ libzstd-dev \ llvm \ locales \tests/docker/dockerfiles/ubuntu2004.docker +3
-2@@ -13,6 +13,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ eatmydata apt-get install --no-install-recommends -y \ bash \ bc \ + bison \ bsdmainutils \ bzip2 \ ca-certificates \@@ -23,6 +24,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ diffutils \ exuberant-ctags \ findutils \ + flex \ g++ \ gcc \ gcovr \@@ -46,7 +48,6 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libepoxy-dev \ libfdt-dev \ libffi-dev \ - libfuse3-dev \ libgbm-dev \ libgcrypt20-dev \ libglib2.0-dev \@@ -75,7 +76,6 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libsdl2-dev \ libsdl2-image-dev \ libseccomp-dev \ - libselinux1-dev \ libslirp-dev \ libsnappy-dev \ libspice-protocol-dev \@@ -91,6 +91,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libvirglrenderer-dev \ libvte-2.91-dev \ libxen-dev \ + libxml2-dev \ libzstd-dev \ llvm \ locales \tests/lcitool/libvirt-ci +1
-1@@ -1 +1 @@ -Subproject commit f83b916d5efa4bd33fbf4b7ea41bf6d535cc63fb +Subproject commit 43927ff508e8ecb1ac225dabbc95b37c890db917tests/lcitool/projects/qemu.yml +7
-9@@ -3,6 +3,7 @@ packages: - alsa - bash - bc + - bison - brlapi - bzip2 - bzip2-libs@@ -18,23 +19,24 @@ packages: - diffutils - dtrace - findutils - - fuse3 + - flex - g++ - gcc - gcovr - - gettext - genisoimage + - gettext - glib2 + - glib2-native - glib2-static - - glibc-static - glusterfs - gnutls - gtk3 - hostname - libaio - - libattr - libasan + - libattr - libbpf + - libc-static - libcacard - libcap-ng - libcurl@@ -55,7 +57,6 @@ packages: - librbd - librdmacm - libseccomp - - libselinux - libslirp - libssh - libtasn1@@ -64,18 +65,19 @@ packages: - liburing - libusbx - libvdeplug + - libxml2 - libzstd - llvm - lttng-ust - lzo - - netcat - - nettle - - ninja - - nsis - make
tests/lcitool/projects/qemu.yml packages: · line 83
Quoted 10 lines
tests/lcitool/projects/qemu.yml +4
-0- mesa-libgbm - meson - ncursesw + - netcat + - nettle + - ninja + - nsis - pam - pcre-static - perl
OK I've obviously missed some subtly here but this doesn't seem to be a just add flex/bison to the list of build tools we need.
Signature · 1 line
Alex Bennée
Re: [PATCH v9 08/12] target/hexagon: import flex/bison to docker files
Quoted 682 lines · Alex Bennée
Quoted 49 lines · Anton Johansson via
This patch points
tests/lcitool/libvirt-cito an upstreamed commit oflibvirt-ciwhich includes flex and bison. Thelcitool/refreshscript was then ran to update the the generated docker/cirrus files.Signed-off-by Alessandro Di Federico <[email protected]>Signed-off-by Paolo Montesel <[email protected]>Signed-off-by Anton Johansson <[email protected]>--- .gitlab-ci.d/cirrus/freebsd-12.vars | 2 +- .gitlab-ci.d/cirrus/freebsd-13.vars | 2 +- .gitlab-ci.d/cirrus/macos-11.vars | 2 +- .gitlab-ci.d/windows.yml | 2 ++ tests/docker/dockerfiles/alpine.docker | 6 ++++-- tests/docker/dockerfiles/centos8.docker | 7 ++++--- tests/docker/dockerfiles/debian-amd64.docker | 2 ++ .../dockerfiles/debian-arm64-cross.docker | 6 ++++-- tests/docker/dockerfiles/debian-native.docker | 3 +++ .../dockerfiles/debian-riscv64-cross.docker | 3 +++ .../dockerfiles/debian-s390x-cross.docker | 6 ++++-- .../dockerfiles/debian-tricore-cross.docker | 1 + tests/docker/dockerfiles/debian10.docker | 3 +++ .../dockerfiles/fedora-i386-cross.docker | 3 +++ .../dockerfiles/fedora-win32-cross.docker | 3 +++ .../dockerfiles/fedora-win64-cross.docker | 3 +++ tests/docker/dockerfiles/fedora.docker | 5 +++-- tests/docker/dockerfiles/opensuse-leap.docker | 5 +++-- tests/docker/dockerfiles/ubuntu1804.docker | 4 +++- tests/docker/dockerfiles/ubuntu2004.docker | 5 +++-- tests/lcitool/libvirt-ci | 2 +- tests/lcitool/projects/qemu.yml | 20 ++++++++++--------- 22 files changed, 66 insertions(+), 29 deletions(-).gitlab-ci.d/cirrus/freebsd-12.vars +1
-1@@ -11,6 +11,6 @@ MAKE='/usr/local/bin/gmake' NINJA='/usr/local/bin/ninja' PACKAGING_COMMAND='pkg' PIP3='/usr/local/bin/pip-3.8' -PKGS='alsa-lib bash bzip2 ca_root_nss capstone4 ccache cdrkit-genisoimage ctags curl cyrus-sasl dbus diffutils dtc fusefs-libs3 gettext git glib gmake gnutls gsed gtk3 libepoxy libffi libgcrypt libjpeg-turbo libnfs libspice-server libssh libtasn1 llvm lzo2 meson ncurses nettle ninja opencv perl5 pixman pkgconf png py38-numpy py38-pillow py38-pip py38-sphinx py38-sphinx_rtd_theme py38-virtualenv py38-yaml python3 rpm2cpio sdl2 sdl2_image snappy spice-protocol tesseract texinfo usbredir virglrenderer vte3 zstd' +PKGS='alsa-lib bash bison bzip2 ca_root_nss capstone4 ccache cdrkit-genisoimage ctags curl cyrus-sasl dbus diffutils dtc flex gettext git glib gmake gnutls gsed gtk3 libepoxy libffi libgcrypt libjpeg-turbo libnfs libspice-server libssh libtasn1 libxml2 llvm lzo2 meson ncurses nettle ninja opencv perl5 pixman pkgconf png py38-numpy py38-pillow py38-pip py38-sphinx py38-sphinx_rtd_theme py38-virtualenv py38-yaml python3 rpm2cpio sdl2 sdl2_image snappy spice-protocol tesseract texinfo usbredir virglrenderer vte3 zstd' PYPI_PKGS='' PYTHON='/usr/local/bin/python3'.gitlab-ci.d/cirrus/freebsd-13.vars +0
-0.gitlab-ci.d/cirrus/freebsd-13.vars MAKE='/usr/local/bin/gmake' · line 16
Quoted 7 lines
.gitlab-ci.d/cirrus/freebsd-13.vars +1
-1@@ -11,6 +11,6 @@ MAKE='/usr/local/bin/gmake' NINJA='/usr/local/bin/ninja' PACKAGING_COMMAND='pkg' PIP3='/usr/local/bin/pip-3.8' -PKGS='alsa-lib bash bzip2 ca_root_nss capstone4 ccache cdrkit-genisoimage ctags curl cyrus-sasl dbus diffutils dtc fusefs-libs3 gettext git glib gmake gnutls gsed gtk3 libepoxy libffi libgcrypt libjpeg-turbo libnfs libspice-server libssh libtasn1 llvm lzo2 meson ncurses nettle ninja opencv perl5 pixman pkgconf png py38-numpy py38-pillow py38-pip py38-sphinx py38-sphinx_rtd_theme py38-virtualenv py38-yaml python3 rpm2cpio sdl2 sdl2_image snappy spice-protocol tesseract texinfo usbredir virglrenderer vte3 zstd' +PKGS='alsa-lib bash bison bzip2 ca_root_nss capstone4 ccache cdrkit-genisoimage ctags curl cyrus-sasl dbus diffutils dtc flex gettext git glib gmake gnutls gsed gtk3 libepoxy libffi libgcrypt libjpeg-turbo libnfs libspice-server libssh libtasn1 libxml2 llvm lzo2 meson ncurses nettle ninja opencv perl5 pixman pkgconf png py38-numpy py38-pillow py38-pip py38-sphinx py38-sphinx_rtd_theme py38-virtualenv py38-yaml python3 rpm2cpio sdl2 sdl2_image snappy spice-protocol tesseract texinfo usbredir virglrenderer vte3 zstd' PYPI_PKGS='' PYTHON='/usr/local/bin/python3'This is quite a lot of containers at once which makes it hard to review. Do we actually build hexagon on all these various containers anyway?
Either way I'd be tempted to update one container per patch.
Quoted 45 lines
.gitlab-ci.d/cirrus/macos-11.vars +1
-1@@ -11,6 +11,6 @@ MAKE='/usr/local/bin/gmake' NINJA='/usr/local/bin/ninja' PACKAGING_COMMAND='brew' PIP3='/usr/local/bin/pip3' -PKGS='bash bc bzip2 capstone ccache ctags curl dbus diffutils dtc gcovr gettext git glib gnu-sed gnutls gtk+3 jemalloc jpeg-turbo libepoxy libffi libgcrypt libiscsi libnfs libpng libslirp libssh libtasn1 libusb llvm lzo make meson ncurses nettle ninja perl pixman pkg-config python3 rpm2cpio sdl2 sdl2_image snappy sparse spice-protocol tesseract texinfo usbredir vde vte3 zlib zstd' +PKGS='bash bc bison bzip2 capstone ccache ctags curl dbus diffutils dtc flex gcovr gettext git glib gnu-sed gnutls gtk+3 jemalloc jpeg-turbo libepoxy libffi libgcrypt libiscsi libnfs libpng libslirp libssh libtasn1 libusb libxml2 llvm lzo make meson ncurses nettle ninja perl pixman pkg-config python3 rpm2cpio sdl2 sdl2_image snappy sparse spice-protocol tesseract texinfo usbredir vde vte3 zlib zstd' PYPI_PKGS='PyYAML numpy pillow sphinx sphinx-rtd-theme virtualenv' PYTHON='/usr/local/bin/python3'.gitlab-ci.d/windows.yml +2
-0@@ -33,6 +33,7 @@ msys2-64bit: script: - .\msys64\usr\bin\bash -lc "pacman -Sy --noconfirm --needed diffutils git grep make sed + flex bison mingw-w64-x86_64-capstone mingw-w64-x86_64-curl mingw-w64-x86_64-cyrus-sasl@@ -67,6 +68,7 @@ msys2-32bit: script: - .\msys64\usr\bin\bash -lc "pacman -Sy --noconfirm --needed diffutils git grep make sed + flex bison mingw-w64-i686-capstone mingw-w64-i686-curl mingw-w64-i686-cyrus-sasltests/docker/dockerfiles/alpine.docker +1
-0@@ -13,6 +13,7 @@ RUN apk update && \ attr-dev \ bash \ bc \ + bison \ bzip2 \ bzip2-dev \ ca-certificates \tests/docker/dockerfiles/alpine.docker RUN apk update && \ · line 32
Quoted 4 lines
tests/docker/dockerfiles/alpine.docker +0
-1@@ -29,7 +30,7 @@ RUN apk update && \ dtc-dev \ eudev-dev \ findutils \ - fuse3-dev \Why has this dropped?
tests/docker/dockerfiles/alpine.docker RUN apk update && \ · line 53
Quoted 9 lines
tests/docker/dockerfiles/alpine.docker +1
-1+ flex \ g++ \ gcc \ gcovr \@@ -50,12 +51,12 @@ RUN apk update && \ libnfs-dev \ libpng-dev \ libseccomp-dev \ - libselinux-dev \Or this
tests/docker/dockerfiles/alpine.docker RUN apk update && \ · line 59
Quoted 6 lines
tests/docker/dockerfiles/alpine.docker +1
-0libslirp-dev \ libssh-dev \ libtasn1-dev \ liburing-dev \ libusb-dev \ + libxml2-dev \this isn't flex/bison
tests/docker/dockerfiles/alpine.docker RUN apk update && \ · line 68
Quoted 8 lines
tests/docker/dockerfiles/alpine.docker +1
-0linux-pam-dev \ llvm11 \ lttng-ust-dev \@@ -64,6 +65,7 @@ RUN apk update && \ mesa-dev \ meson \ multipath-tools \ + musl-dev \?
Quoted 25 lines
tests/docker/dockerfiles/alpine.docker +0
-0ncurses-dev \ ndctl-dev \ net-tools \tests/docker/dockerfiles/centos8.docker +2
-1@@ -6,7 +6,7 @@ FROM quay.io/centos/centos:stream8 -RUN dnf update -y && \ +RUN dnf distro-sync -y && \ dnf install 'dnf-command(config-manager)' -y && \ dnf config-manager --set-enabled -y powertools && \ dnf install -y centos-release-advanced-virtualization && \@@ -16,6 +16,7 @@ RUN dnf update -y && \ alsa-lib-devel \ bash \ bc \ + bison \ brlapi-devel \ bzip2 \ bzip2-devel \tests/docker/dockerfiles/centos8.docker RUN dnf update -y && \ · line 33
Quoted 4 lines
tests/docker/dockerfiles/centos8.docker +0
-1@@ -30,7 +31,7 @@ RUN dnf update -y && \ device-mapper-multipath-devel \ diffutils \ findutils \ - fuse3-devel \?
tests/docker/dockerfiles/centos8.docker RUN dnf update -y && \ · line 67
Quoted 9 lines
tests/docker/dockerfiles/centos8.docker +1
-1+ flex \ gcc \ gcc-c++ \ genisoimage \@@ -64,13 +65,13 @@ RUN dnf update -y && \ libpng-devel \ librbd-devel \ libseccomp-devel \ - libselinux-devel \?
Quoted 39 lines
tests/docker/dockerfiles/centos8.docker +1
-0libslirp-devel \ libssh-devel \ libtasn1-devel \ libubsan \ liburing-devel \ libusbx-devel \ + libxml2-devel \ libzstd-devel \ llvm \ lttng-ust-devel \tests/docker/dockerfiles/debian-amd64.docker +2
-0@@ -14,9 +14,11 @@ RUN apt update && \ RUN apt update && \ DEBIAN_FRONTEND=noninteractive eatmydata \ apt install -y --no-install-recommends \ + bison \ cscope \ genisoimage \ exuberant-ctags \ + flex \ global \ libbz2-dev \ liblzo2-dev \tests/docker/dockerfiles/debian-arm64-cross.docker +1
-0@@ -13,6 +13,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ eatmydata apt-get install --no-install-recommends -y \ bash \ bc \ + bison \ bsdextrautils \ bzip2 \ ca-certificates \tests/docker/dockerfiles/debian-arm64-cross.docker RUN export DEBIAN_FRONTEND=noninteractive && \ · line 32
Quoted 10 lines
tests/docker/dockerfiles/debian-arm64-cross.docker +2
-0@@ -22,11 +23,13 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ diffutils \ exuberant-ctags \ findutils \ + flex \ gcovr \ genisoimage \ gettext \ git \ hostname \ + libglib2.0-dev \?
Quoted 12 lines
tests/docker/dockerfiles/debian-arm64-cross.docker +0
-1libpcre2-dev \ libspice-protocol-dev \ llvm \@@ -90,7 +93,6 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libepoxy-dev:arm64 \ libfdt-dev:arm64 \ libffi-dev:arm64 \ - libfuse3-dev:arm64 \ libgbm-dev:arm64 \ libgcrypt20-dev:arm64 \ libglib2.0-dev:arm64 \tests/docker/dockerfiles/debian-arm64-cross.docker RUN export DEBIAN_FRONTEND=noninteractive && \ · line 120
Quoted 4 lines
tests/docker/dockerfiles/debian-arm64-cross.docker +0
-1@@ -117,7 +119,6 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libsdl2-dev:arm64 \ libsdl2-image-dev:arm64 \ libseccomp-dev:arm64 \ - libselinux1-dev:arm64 \?
tests/docker/dockerfiles/debian-arm64-cross.docker RUN export DEBIAN_FRONTEND=noninteractive && \ · line 137
Quoted 8 lines
tests/docker/dockerfiles/debian-arm64-cross.docker +1
-0libslirp-dev:arm64 \ libsnappy-dev:arm64 \ libspice-server-dev:arm64 \@@ -133,6 +134,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libvirglrenderer-dev:arm64 \ libvte-2.91-dev:arm64 \ libxen-dev:arm64 \ + libxml2-dev:arm64 \?
Quoted 11 lines
tests/docker/dockerfiles/debian-arm64-cross.docker +0
-0libzstd-dev:arm64 \ nettle-dev:arm64 \ systemtap-sdt-dev:arm64 \tests/docker/dockerfiles/debian-native.docker +0
-0@@ -26,13 +26,16 @@ RUN apt update && \ RUN apt update && \ DEBIAN_FRONTEND=noninteractive eatmydata \ apt install -y --no-install-recommends \tests/docker/dockerfiles/debian-native.docker RUN apt update && \ · line 38
Quoted 10 lines
tests/docker/dockerfiles/debian-native.docker +3
-0+ bison \ cscope \ genisoimage \ exuberant-ctags \ + flex \ global \ libbz2-dev \ liblzo2-dev \ libgcrypt20-dev \ + libglib2.0-dev \?
Quoted 396 lines
tests/docker/dockerfiles/debian-native.docker +0
-0libfdt-dev \ librdmacm-dev \ libsasl2-dev \tests/docker/dockerfiles/debian-riscv64-cross.docker +3
-0@@ -17,12 +17,15 @@ RUN apt update && \ # Install common build utilities RUN DEBIAN_FRONTEND=noninteractive eatmydata apt install -yy \ bc \ + bison \ build-essential \ ca-certificates \ debian-ports-archive-keyring \ dpkg-dev \ + flex \ gettext \ git \ + libglib2.0-dev \ ninja-build \ pkg-config \ python3tests/docker/dockerfiles/debian-s390x-cross.docker +4
-2@@ -13,6 +13,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ eatmydata apt-get install --no-install-recommends -y \ bash \ bc \ + bison \ bsdextrautils \ bzip2 \ ca-certificates \@@ -22,11 +23,13 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ diffutils \ exuberant-ctags \ findutils \ + flex \ gcovr \ genisoimage \ gettext \ git \ hostname \ + libglib2.0-dev \ libpcre2-dev \ libspice-protocol-dev \ llvm \@@ -90,7 +93,6 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libepoxy-dev:s390x \ libfdt-dev:s390x \ libffi-dev:s390x \ - libfuse3-dev:s390x \ libgbm-dev:s390x \ libgcrypt20-dev:s390x \ libglib2.0-dev:s390x \@@ -117,7 +119,6 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libsdl2-dev:s390x \ libsdl2-image-dev:s390x \ libseccomp-dev:s390x \ - libselinux1-dev:s390x \ libslirp-dev:s390x \ libsnappy-dev:s390x \ libssh-gcrypt-dev:s390x \@@ -131,6 +132,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libvdeplug-dev:s390x \ libvirglrenderer-dev:s390x \ libvte-2.91-dev:s390x \ + libxml2-dev:s390x \ libzstd-dev:s390x \ nettle-dev:s390x \ systemtap-sdt-dev:s390x \tests/docker/dockerfiles/debian-tricore-cross.docker +1
-0@@ -20,6 +20,7 @@ RUN apt update && \ bzip2 \ ca-certificates \ ccache \ + flex \ g++ \ gcc \ git \tests/docker/dockerfiles/debian10.docker +3
-0@@ -18,15 +18,18 @@ RUN apt update && \ DEBIAN_FRONTEND=noninteractive eatmydata \ apt install -y --no-install-recommends \ bc \ + bison \ build-essential \ ca-certificates \ ccache \ clang \ dbus \ + flex \ gdb-multiarch \ gettext \ git \ libffi-dev \ + libglib2.0-dev \ libncurses5-dev \ ninja-build \ pkg-config \tests/docker/dockerfiles/fedora-i386-cross.docker +3
-0@@ -1,12 +1,15 @@ FROM registry.fedoraproject.org/fedora:34 ENV PACKAGES \ + bison \ bzip2 \ ccache \ diffutils \ findutils \ + flex \ gcc \ git \ + glib2-devel \ libffi-devel.i686 \ libselinux-devel.i686 \ libtasn1-devel.i686 \tests/docker/dockerfiles/fedora-win32-cross.docker +3
-0@@ -3,13 +3,16 @@ FROM registry.fedoraproject.org/fedora:33 # Please keep this list sorted alphabetically ENV PACKAGES \ bc \ + bison \ bzip2 \ ccache \ diffutils \ findutils \ + flex \ gcc \ gettext \ git \ + glib2-devel \ hostname \ make \ meson \tests/docker/dockerfiles/fedora-win64-cross.docker +3
-0@@ -3,12 +3,15 @@ FROM registry.fedoraproject.org/fedora:33 # Please keep this list sorted alphabetically ENV PACKAGES \ bc \ + bison \ bzip2 \ ccache \ diffutils \ findutils \ + flex \ gcc \ gettext \ + glib2-devel \ git \ hostname \ make \tests/docker/dockerfiles/fedora.docker +3
-2@@ -23,6 +23,7 @@ exec "$@"' > /usr/bin/nosync && \ alsa-lib-devel \ bash \ bc \ + bison \ brlapi-devel \ bzip2 \ bzip2-devel \@@ -37,7 +38,7 @@ exec "$@"' > /usr/bin/nosync && \ device-mapper-multipath-devel \ diffutils \ findutils \ - fuse3-devel \ + flex \ gcc \ gcc-c++ \ gcovr \@@ -72,13 +73,13 @@ exec "$@"' > /usr/bin/nosync && \ libpng-devel \ librbd-devel \ libseccomp-devel \ - libselinux-devel \ libslirp-devel \ libssh-devel \ libtasn1-devel \ libubsan \ liburing-devel \ libusbx-devel \ + libxml2-devel \ libzstd-devel \ llvm \ lttng-ust-devel \tests/docker/dockerfiles/opensuse-leap.docker +3
-2@@ -12,6 +12,7 @@ RUN zypper update -y && \ alsa-lib-devel \ bash \ bc \ + bison \ brlapi-devel \ bzip2 \ ca-certificates \@@ -22,7 +23,7 @@ RUN zypper update -y && \ dbus-1 \ diffutils \ findutils \ - fuse3-devel \ + flex \ gcc \ gcc-c++ \ gcovr \@@ -63,7 +64,6 @@ RUN zypper update -y && \ libpulse-devel \ librbd-devel \ libseccomp-devel \ - libselinux-devel \ libspice-server-devel \ libssh-devel \ libtasn1-devel \@@ -71,6 +71,7 @@ RUN zypper update -y && \ libudev-devel \ liburing-devel \ libusb-1_0-devel \ + libxml2-devel \ libzstd-devel \ llvm \ lttng-ust-devel \tests/docker/dockerfiles/ubuntu1804.docker +3
-1@@ -13,6 +13,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ eatmydata apt-get install --no-install-recommends -y \ bash \ bc \ + bison \ bsdmainutils \ bzip2 \ ca-certificates \@@ -23,6 +24,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ diffutils \ exuberant-ctags \ findutils \ + flex \ g++ \ gcc \ gcovr \@@ -74,7 +76,6 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libsdl2-dev \ libsdl2-image-dev \ libseccomp-dev \ - libselinux1-dev \ libsnappy-dev \ libspice-protocol-dev \ libspice-server-dev \@@ -89,6 +90,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libvirglrenderer-dev \ libvte-2.91-dev \ libxen-dev \ + libxml2-dev \ libzstd-dev \ llvm \ locales \tests/docker/dockerfiles/ubuntu2004.docker +3
-2@@ -13,6 +13,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ eatmydata apt-get install --no-install-recommends -y \ bash \ bc \ + bison \ bsdmainutils \ bzip2 \ ca-certificates \@@ -23,6 +24,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ diffutils \ exuberant-ctags \ findutils \ + flex \ g++ \ gcc \ gcovr \@@ -46,7 +48,6 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libepoxy-dev \ libfdt-dev \ libffi-dev \ - libfuse3-dev \ libgbm-dev \ libgcrypt20-dev \ libglib2.0-dev \@@ -75,7 +76,6 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libsdl2-dev \ libsdl2-image-dev \ libseccomp-dev \ - libselinux1-dev \ libslirp-dev \ libsnappy-dev \ libspice-protocol-dev \@@ -91,6 +91,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libvirglrenderer-dev \ libvte-2.91-dev \ libxen-dev \ + libxml2-dev \ libzstd-dev \ llvm \ locales \tests/lcitool/libvirt-ci +1
-1@@ -1 +1 @@ -Subproject commit f83b916d5efa4bd33fbf4b7ea41bf6d535cc63fb +Subproject commit 43927ff508e8ecb1ac225dabbc95b37c890db917tests/lcitool/projects/qemu.yml +8
-9@@ -3,6 +3,7 @@ packages: - alsa - bash - bc + - bison - brlapi - bzip2 - bzip2-libs@@ -18,23 +19,24 @@ packages: - diffutils - dtrace - findutils - - fuse3 + - flex - g++ - gcc - gcovr - - gettext - genisoimage + - gettext - glib2 + - glib2-native - glib2-static - - glibc-static - glusterfs - gnutls - gtk3 - hostname - libaio - - libattr - libasan + - libattr - libbpf + - libc-static - libcacard - libcap-ng - libcurl@@ -55,7 +57,6 @@ packages: - librbd - librdmacm - libseccomp - - libselinux - libslirp - libssh - libtasn1@@ -64,18 +65,19 @@ packages: - liburing - libusbx - libvdeplug + - libxml2 - libzstd - llvm - lttng-ust - lzo - - netcat - - nettle - - ninja - - nsis - make - mesa-libgbm - meson - ncursesw + - netcat
Quoted 9 lines
tests/lcitool/projects/qemu.yml packages: · line 83
Quoted 6 lines
tests/lcitool/projects/qemu.yml +3
-0+ - nettle + - ninja + - nsis - pam - pcre-static - perlOK I've obviously missed some subtly here but this doesn't seem to be a just add flex/bison to the list of build tools we need.
Since the current commit of libvirt-ci in QEMU doesn't include package mappings for flex/bison, we need to update to a more recent commit which does.
This update includes ~50 commits worth of changes to libvirt-ci, which is where all non flex/bison related changes to the docker/cirrus and qemu.yml files comes from.
For clarity's sake, here are the exact steps taken to produce this patch:
1. Update QEMU's libvirt-ci to the commit
https://gitlab.com/libvirt/libvirt-ci/-/commit/43927ff508e8ecb1ac225dabbc95b37c890db917
which adds flex/bison, and a native glib2 (required since idef-parser is a build-time tool.)
2. Copy in new tests/lcitool/projects/qemu.yml from libvirt-ci
3. run tests/lcitool/refresh to generate new docker/cirrus files
Hope this helps! We can absolutely split this patch in multiple parts so only one container is modified at a time. Although I think it makes sense to keep them in a single patch since they are all auto-generated by the refresh script.
Signature · 2 lines
Anton Johansson, rev.ng Labs Srl.
Re: [PATCH v9 08/12] target/hexagon: import flex/bison to docker files
Quoted 8 lines · Anton Johansson
For clarity's sake, here are the exact steps taken to produce this patch:
1. Update QEMU's libvirt-ci to the commit
https://gitlab.com/libvirt/libvirt-ci/-/commit/43927ff508e8ecb1ac225dabbc95b37c890db917
which adds flex/bison, and a native glib2 (required since idef-parser is a build-time tool.)
This must be split out -- submodule updates should be a patch by themselves. Otherwise it can look like unintentional rebase breakage (which, sadly, happens more often than legitimate submodule updates).
Quoted 3 lines
2. Copy in new
tests/lcitool/projects/qemu.ymlfromlibvirt-ci3. run
tests/lcitool/refreshto generate new docker/cirrus files
And, yes, having one patch that's simply auto-generated is helpful.
r~
Re: [PATCH v9 08/12] target/hexagon: import flex/bison to docker files
Quoted 12 lines · Richard Henderson
Quoted 6 lines · Anton Johansson
For clarity's sake, here are the exact steps taken to produce this patch:
1. Update QEMU's libvirt-ci to the commit
https://gitlab.com/libvirt/libvirt-ci/-/commit/43927ff508e8ecb1ac225dabbc95b37c890db917
which adds flex/bison, and a native glib2 (required since
idef-parser
is a build-time tool.)This must be split out -- submodule updates should be a patch by themselves. Otherwise it can look like unintentional rebase breakage (which, sadly, happens more often than legitimate submodule updates).
Quoted 5 lines
Quoted 3 lines
2. Copy in new
tests/lcitool/projects/qemu.ymlfromlibvirt-ci
3. runtests/lcitool/refreshto generate new docker/cirrus
filesAnd, yes, having one patch that's simply auto-generated is helpful.
To quote danpb:
danpb: should our tests/lcitool/projects/qemu.yml match the one in
the lcitool repo or are they different use cases?
<danpb> the one in libvirt-ci.git should be deleted really <danpb> the one in qemu.git is the source of truth
so please just update the qemu.git qemu.yml for just what you need for flex/bison without bringing in all the other (stale?) stuff.
Quoted 3 lines
r~
Signature · 1 line
Alex Bennée
Re: [PATCH v9 08/12] target/hexagon: import flex/bison to docker files
Quoted 19 lines · Alex Bennée
Quoted 7 lines · Richard Henderson
Quoted 6 lines · Anton Johansson
For clarity's sake, here are the exact steps taken to produce this patch:
1. Update QEMU's libvirt-ci to the commit
https://gitlab.com/libvirt/libvirt-ci/-/commit/43927ff508e8ecb1ac225dabbc95b37c890db917
which adds flex/bison, and a native glib2 (required since
idef-parser
is a build-time tool.)Quoted 8 lines
This must be split out -- submodule updates should be a patch by themselves. Otherwise it can look like unintentional rebase breakage (which, sadly, happens more often than legitimate submodule updates).
Quoted 3 lines
2. Copy in new
tests/lcitool/projects/qemu.ymlfromlibvirt-ci
3. runtests/lcitool/refreshto generate new docker/cirrus
filesAnd, yes, having one patch that's simply auto-generated is helpful.
To quote danpb:
Quoted 12 lines
danpb: should our
tests/lcitool/projects/qemu.ymlmatch the one in
the lcitool repo or are they different use cases?
<danpb> the one in libvirt-ci.git should be deleted really <danpb> the one in qemu.git is the source of truthso please just update the qemu.git qemu.yml for just what you need for flex/bison without bringing in all the other (stale?) stuff.
Quoted 2 lines
r~
I see, thanks!
Just to make sure I understood you correctly, I should:
1. Make a standalone patch that updates libvirt-ci and runs the refresh script, in case any package mappings changed
2. Change this patch to add flex/bison to QEMU's qemu.yml, and run refresh
Signature · 2 lines
Anton Johansson, rev.ng Labs Srl.
Re: [PATCH v9 08/12] target/hexagon: import flex/bison to docker files
Quoted 7 lines · Anton Johansson
Just to make sure I understood you correctly, I should:
1. Make a standalone patch that updates libvirt-ci and runs the refresh script, in case any package mappings changed
2. Change this patch to add flex/bison to QEMU's qemu.yml, and run refresh
No:
* one patch to update libvirt-ci and does nothing else.
* one patch to update yml template.
* one patch to refresh.
Just like you enumerated before.
r~
Re: [PATCH v9 08/12] target/hexagon: import flex/bison to docker files
Quoted 12 lines · Richard Henderson
No:
* one patch to update libvirt-ci and does nothing else.
* one patch to update yml template.
* one patch to refresh.Just like you enumerated before.
r~
Ah, right! Thanks for clarifying. Should I keep all 3 patches in this series?
Signature · 2 lines
Anton Johansson, rev.ng Labs Srl.
Re: [PATCH v9 08/12] target/hexagon: import flex/bison to docker files
Quoted 9 lines · Anton Johansson
Quoted 7 lines · Richard Henderson
No:
* one patch to update libvirt-ci and does nothing else.
* one patch to update yml template.
* one patch to refresh.
Quoted 6 lines
Quoted 5 lines
Just like you enumerated before.
r~
Ah, right! Thanks for clarifying. Should I keep all 3 patches in this series?
Probably easiest.
r~
PATCH v9 9/12 target/hexagon: import lexer for idef-parser
In reply to Anton Johansson viaFrom: Paolo Montesel <[email protected]>
--- target/hexagon/idef-parser/idef-parser.h | 253 +++++++++++ target/hexagon/idef-parser/idef-parser.lex | 471 +++++++++++++++++++++ target/hexagon/meson.build | 4 + 3 files changed, 728 insertions(+) create mode 100644 target/hexagon/idef-parser/idef-parser.h create mode 100644 target/hexagon/idef-parser/idef-parser.lex
target/hexagon/idef-parser/idef-parser.h new file +253 -0
@@ -0,0 +1,253 @@ +/* +* Copyright(c) 2019-2022 rev.ng Labs Srl. All Rights Reserved. +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, see <http://www.gnu.org/licenses/>. +*/ + +#ifndef IDEF_PARSER_H +#define IDEF_PARSER_H + +#include <inttypes.h> +#include <stdio.h> +#include <stdbool.h> +#include <glib.h> + +#define TCGV_NAME_SIZE 7 +#define MAX_WRITTEN_REGS 32 +#define OFFSET_STR_LEN 32 +#define ALLOC_LIST_LEN 32 +#define ALLOC_NAME_SIZE 32 +#define INIT_LIST_LEN 32 +#define OUT_BUF_LEN (1024 * 1024) +#define SIGNATURE_BUF_LEN (128 * 1024) +#define HEADER_BUF_LEN (128 * 1024) + +/* Variadic macros to wrap the buffer printing functions */ +#define EMIT (c, ...) \ + do { \ + g_string_append_printf((c)->out_str, __VA_ARGS__); \ + } while (0) + +#define EMIT_SIG (c, ...) \ + do { \ + g_string_append_printf((c)->signature_str, __VA_ARGS__); \ + } while (0) + +#define EMIT_HEAD (c, ...) \ + do { \ + g_string_append_printf((c)->header_str, __VA_ARGS__); \ + } while (0) + +/** +* Type of register, assigned to the HexReg.type field +*/ +typedef enum {GENERAL_PURPOSE ,CONTROL ,MODIFIER ,DOTNEW }HexRegType ; + +typedef enum {UNKNOWN_SIGNEDNESS ,SIGNED ,UNSIGNED }HexSignedness ; + +/** +* Semantic record of the REG tokens, identifying registers +*/ +typedef struct HexReg { +uint8_t id;/**< Identifier of the register */ +HexRegType type;/**< Type of the register */ +unsigned bit_width;/**< Bit width of the reg, 32 or 64 bits */ +}HexReg ; + +/** +* Data structure, identifying a TCGv temporary value +*/ +typedef struct HexTmp { +unsigned index;/**< Index of the TCGv temporary value */ +}HexTmp ; + +/** +* Enum of the possible immediated, an immediate is a value which is known +* at tinycode generation time, e.g. an integer value, not a TCGv +*/ +enum ImmUnionTag { +I , +VARIABLE , +VALUE , +QEMU_TMP , +IMM_PC , +IMM_NPC , +IMM_CONSTEXT , +}; + +/** +* Semantic record of the IMM token, identifying an immediate constant +*/ +typedef struct HexImm { +union { +char id;/**< Identifier, used when type is VARIABLE */ +uint64_t value;/**< Immediate value, used when type is VALUE */ +uint64_t index;/**< Index, used when type is QEMU_TMP */ + }; +enum ImmUnionTag type;/**< Type of the immediate */ +}HexImm ; + +/** +* Semantic record of the PRED token, identifying a predicate +*/ +typedef struct HexPred { +char id;/**< Identifier of the predicate */ +}HexPred ; + +/** +* Semantic record of the SAT token, identifying the saturate operator +* Note: All saturates are assumed to implicitly set overflow. +*/ +typedef struct HexSat { +HexSignedness signedness;/**< Signedness of the sat. op. */ +}HexSat ; + +/** +* Semantic record of the CAST token, identifying the cast operator +*/ +typedef struct HexCast { +unsigned bit_width;/**< Bit width of the cast operator */ +HexSignedness signedness;/**< Unsigned flag for the cast operator */ +}HexCast ; + +/** +* Semantic record of the EXTRACT token, identifying the cast operator +*/ +typedef struct HexExtract { +unsigned bit_width;/**< Bit width of the extract operator */ +unsigned storage_bit_width;/**< Actual bit width of the extract operator */ +HexSignedness signedness;/**< Unsigned flag for the extract operator */ +}HexExtract ; + +/** +* Semantic record of the MPY token, identifying the fMPY multiplication +* operator +*/ +typedef struct HexMpy { +unsigned first_bit_width;/**< Bit width of 1st operand of fMPY */ +unsigned second_bit_width;/**< Bit width of 2nd operand of fMPY */ +HexSignedness first_signedness;/**< Signedness of 1st operand of fMPY */ +HexSignedness second_signedness;/**< Signedness of 2nd operand of fMPY */ +}HexMpy ; + +/** +* Semantic record of the VARID token, identifying declared variables +* of the input language +*/ +typedef struct HexVar { +GString *name;/**< Name of the VARID variable */ +}HexVar ; + +/** +* Data structure uniquely identifying a declared VARID variable, used for +* keeping track of declared variable, so that any variable is declared only +* once, and its properties are propagated through all the subsequent instances +* of that variable +*/ +typedef struct Var { +GString *name;/**< Name of the VARID variable */ +uint8_t bit_width;/**< Bit width of the VARID variable */ +HexSignedness signedness;/**< Unsigned flag for the VARID var */ +}Var ; + +/** +* Enum of the possible rvalue types, used in the HexValue.type field +*/ +typedef enum RvalueUnionTag { +REGISTER ,REGISTER_ARG ,TEMP ,IMMEDIATE ,PREDICATE ,VARID +}RvalueUnionTag ; + +/** +* Semantic record of the rvalue token, identifying any numeric value, +* immediate or register based. The rvalue tokens are combined together +* through the use of several operators, to encode expressions +*/ +typedef struct HexValue { +union { +HexReg reg;/**< rvalue of register type */ +HexTmp tmp;/**< rvalue of temporary type */ +HexImm imm;/**< rvalue of immediate type */ +HexPred pred;/**< rvalue of predicate type */ +HexVar var;/**< rvalue of declared variable type */ + }; +RvalueUnionTag type;/**< Type of the rvalue */ +unsigned bit_width;/**< Bit width of the rvalue */ +HexSignedness signedness;/**< Unsigned flag for the rvalue */ +bool is_dotnew;/**< rvalue of predicate type is dotnew? */ +bool is_manual;/**< Opt out of automatic freeing of params */ +}HexValue ; + +/** +* State of ternary operator +*/ +typedef enum TernaryState {IN_LEFT ,IN_RIGHT }TernaryState ; + +/** +* Data structure used to handle side effects inside ternary operators +*/ +typedef struct Ternary { +TernaryState state; +HexValue cond; +}Ternary ; + +/** +* Operator type, used for referencing the correct operator when calling the +* gen_bin_op() function, which in turn will generate the correct code to +* execute the operation between the two rvalues +*/ +typedef enum OpType { +ADD_OP ,SUB_OP ,MUL_OP ,ASL_OP ,ASR_OP ,LSR_OP ,ANDB_OP ,ORB_OP , +XORB_OP ,ANDL_OP ,MINI_OP ,MAXI_OP +}OpType ; + +/** +* Data structure including instruction specific information, to be cleared +* out after the compilation of each instruction +*/ +typedef struct Inst { +GString *name;/**< Name of the compiled instruction */ +char *code_begin;/**< Beginning of instruction input code */ +char *code_end;/**< End of instruction input code */ +unsigned tmp_count;/**< Index of the last declared TCGv temp */ +unsigned qemu_tmp_count;/**< Index of the last declared int temp */ +unsigned if_count;/**< Index of the last declared if label */ +unsigned error_count;/**< Number of generated errors */ +GArray *allocated;/**< Allocated declaredVARID vars */ +GArray *init_list;/**< List of initialized registers */ +GArray *strings;/**< Strings allocated by the instruction */ +}Inst ; + +/** +* Data structure representing the whole translation context, which in a +* reentrant flex/bison parser just like ours is passed between the scanner +* and the parser, holding all the necessary information to perform the +* parsing, this data structure survives between the compilation of different +* instructions +*/ +typedef struct Context { +void *scanner;/**< Reentrant parser state pointer */ +char *input_buffer;/**< Buffer containing the input code */ +GString *out_str;/**< String containing the output code */ +GString *signature_str;/**< String containing the signatures code */ +GString *header_str;/**< String containing the header code */ +FILE *defines_file;/**< FILE * of the generated header */ +FILE *output_file;/**< FILE * of the C output file */ +FILE *enabled_file;/**< FILE * of the list of enabled inst */ +GArray *ternary;/**< Array to track nesting of ternary ops */ +unsigned total_insn;/**< Number of instructions in input file */ +unsigned implemented_insn;/**< Instruction compiled without errors */ +Inst inst;/**< Parsing data of the current inst */ +}Context ; + +#endif /* IDEF_PARSER_H */
target/hexagon/idef-parser/idef-parser.lex new file +471 -0
471 lines not on this page · raw message
target/hexagon/meson.build +4 -0
@@ -196,4 +196,8 @@ preprocessed_idef_parser_input_generated = custom_target( command: [idef_parser_dir / 'prepare', '@INPUT@', '-I' + idef_parser_dir, '-o', '@OUTPUT@'], ) +flex = generator(find_program('flex'), + output: ['@[email protected]', '@[email protected]'], + arguments: ['-o', '@OUTPUT0@', '--header-file=@OUTPUT1@', '@INPUT@']) + target_arch += {'hexagon': hexagon_ss}
Signature · 1 line
2.35.1
PATCH v9 10/12 target/hexagon: import parser for idef-parser
In reply to Anton Johansson via--- target/hexagon/idef-parser/idef-parser.y | 961 ++++++++ target/hexagon/idef-parser/parser-helpers.c | 2346 +++++++++++++++++++ target/hexagon/idef-parser/parser-helpers.h | 372 +++ target/hexagon/meson.build | 25 + 4 files changed, 3704 insertions(+) create mode 100644 target/hexagon/idef-parser/idef-parser.y create mode 100644 target/hexagon/idef-parser/parser-helpers.c create mode 100644 target/hexagon/idef-parser/parser-helpers.h
target/hexagon/idef-parser/idef-parser.y new file +961 -0
@@ -0,0 +1,961 @@ +%{ +/* + * Copyright(c) 2019-2022 rev.ng Labs Srl. All Rights Reserved. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see <http://www.gnu.org/licenses/>. + */ + +#include "idef-parser.h" +#include "parser-helpers.h" +#include "idef-parser.tab.h" +#include "idef-parser.yy.h" + +/* Uncomment this to disable yyasserts */ +/* #define NDEBUG */ + +#define ERR_LINE_CONTEXT 40 + +%} + +%lex-param {void *scanner} +%parse-param {void *scanner} +%parse-param {Context *c} + +%define parse.error verbose +%define parse.lac full +%define api.pure full + +%locations + +%union { + GString *string; + HexValue rvalue; + HexSat sat; + HexCast cast; + HexExtract extract; + HexMpy mpy; + HexSignedness signedness; + int index; +} + +/* Tokens */ +%start input + +%expect 1 + +%token IN INAME VAR +%token ABS CROUND ROUND CIRCADD COUNTONES INC DEC ANDA ORA XORA PLUSPLUS ASL +%token ASR LSR EQ NEQ LTE GTE MIN MAX ANDL FOR ICIRC IF MUN FSCR FCHK SXT +%token ZXT CONSTEXT LOCNT BREV SIGN LOAD STORE PC NPC LPCFG +%token CANCEL IDENTITY PART1 ROTL INSBITS SETBITS EXTRANGE +%token CAST4_8U FAIL CARRY_FROM_ADD ADDSAT64 LSBNEW +%token TYPE_SIZE_T TYPE_INT TYPE_SIGNED TYPE_UNSIGNED TYPE_LONG + +%token <rvalue> REG IMM PRED +%token <index> ELSE +%token <mpy> MPY +%token <sat> SAT +%token <cast> CAST DEPOSIT SETHALF +%token <extract> EXTRACT +%type <string> INAME +%type <rvalue> rvalue lvalue VAR assign_statement var var_decl var_type +%type <rvalue> FAIL +%type <rvalue> TYPE_SIGNED TYPE_UNSIGNED TYPE_INT TYPE_LONG TYPE_SIZE_T +%type <index> if_stmt IF +%type <signedness> SIGN + +/* Operator Precedences */ +%left MIN MAX +%left '(' +%left ',' +%left '=' +%right CIRCADD +%right INC DEC ANDA ORA XORA +%left '?' ':' +%left ANDL +%left '|' +%left '^' ANDOR +%left '&' +%left EQ NEQ +%left '<' '>' LTE GTE +%left ASL ASR LSR +%right ABS +%left '-' '+' +%left '*' '/' '%' MPY +%right '~' '!' +%left '[' +%right CAST +%right LOCNT BREV + +/* Bison Grammar */ +%% + +/* Input file containing the description of each hexagon instruction */ +input : instructions + { + YYACCEPT; + } + ; + +instructions : instruction instructions + | %empty + ; + +instruction : INAME + { + gen_inst(c, $1); + } + arguments + { + EMIT_SIG(c, ")"); + EMIT_HEAD(c, "{\n"); + } + code + { + gen_inst_code(c, &@1); + } + | error /* Recover gracefully after instruction compilation error */ + { + free_instruction(c); + } + ; + +arguments : '(' ')' + | '(' argument_list ')'; + +argument_list : argument_decl ',' argument_list + | argument_decl + ; + +var : VAR + { + track_string(c, $1.var.name); + $$ = $1; + } + ; + +/* + * Here the integer types are defined from valid combinations of + * `signed`, `unsigned`, `int`, and `long` tokens. The `signed` + * and `unsigned` tokens are here assumed to always be placed + * first in the type declaration, which is not the case in + * normal C. Similarly, `int` is assumed to always be placed + * last in the type. + */ +type_int : TYPE_INT + | TYPE_SIGNED + | TYPE_SIGNED TYPE_INT; +type_uint : TYPE_UNSIGNED + | TYPE_UNSIGNED TYPE_INT; +type_ulonglong : TYPE_UNSIGNED TYPE_LONG TYPE_LONG + | TYPE_UNSIGNED TYPE_LONG TYPE_LONG TYPE_INT; + +/* + * Here the various valid int types defined above specify + * their `signedness` and `bit_width`. The LP64 convention + * is assumed where longs are 64-bit, long longs are then + * assumed to also be 64-bit. + */ +var_type : TYPE_SIZE_T + { + yyassert(c, &@1, $1.bit_width <= 64, + "Variables with size > 64-bit are not supported!"); + $$ = $1; + } + | type_int + { + $$.signedness = SIGNED; + $$.bit_width = 32; + } + | type_uint + { + $$.signedness = UNSIGNED; + $$.bit_width = 32; + } + | type_ulonglong + { + $$.signedness = UNSIGNED; + $$.bit_width = 64; + } + ; + +/* Rule to capture declarations of VARs */ +var_decl : var_type IMM + { + /* + * Rule to capture "int i;" declarations since "i" is special + * and assumed to be always be IMM. Moreover, "i" is only + * assumed to be used in for-loops. + * + * Therefore we want to NOP these declarations. + */ + yyassert(c, &@2, $2.imm.type == I, + "Variable declaration with immedaties only allowed" + " for the loop induction variable \"i\""); + $$ = $2; + } + | var_type var + { + /* + * Allocate new variable, this checks that it hasn't already + * been declared. + */ + gen_varid_allocate(c, &@1, &$2, $1.bit_width, $1.signedness); + /* Copy var for variable name */ + $$ = $2; + /* Copy type info from var_type */ + $$.signedness = $1.signedness; + $$.bit_width = $1.bit_width; + } + ; + +/* Return the modified registers list */ +code : '{' statements '}' + { + c->inst.code_begin = c->input_buffer + @2.first_column - 1; + c->inst.code_end = c->input_buffer + @2.last_column - 1; + } + | '{' + { + /* Nop */ + } + '}' + ; + +argument_decl : REG + { + emit_arg(c, &@1, &$1); + /* Enqueue register into initialization list */ + g_array_append_val(c->inst.init_list, $1); + } + | PRED + { + emit_arg(c, &@1, &$1); + /* Enqueue predicate into initialization list */ + g_array_append_val(c->inst.init_list, $1); + } + | IN REG + { + emit_arg(c, &@2, &$2); + } + | IN PRED + { + emit_arg(c, &@2, &$2); + } + | IMM + { + EMIT_SIG(c, ", int %ciV", $1.imm.id); + } + ; + +code_block : '{' statements '}' + | '{' '}' + ; + +/* A list of one or more statements */ +statements : statements statement + | statement + ; + +/* Statements can be assignment (rvalue ';'), control or memory statements */ +statement : control_statement + | var_decl ';' + | rvalue ';' + { + gen_rvalue_free(c, &@1, &$1); + } + | code_block + | ';' + ; + +assign_statement : lvalue '=' rvalue + { + @1.last_column = @3.last_column; + gen_assign(c, &@1, &$1, &$3); + $$ = $1; + } + | var_decl '=' rvalue + { + @1.last_column = @3.last_column; + gen_assign(c, &@1, &$1, &$3); + $$ = $1; + } + | lvalue INC rvalue + { + @1.last_column = @3.last_column; + HexValue tmp = gen_bin_op(c, &@1, ADD_OP, &$1, &$3); + gen_assign(c, &@1, &$1, &tmp); + $$ = $1; + } + | lvalue DEC rvalue + { + @1.last_column = @3.last_column; + HexValue tmp = gen_bin_op(c, &@1, SUB_OP, &$1, &$3); + gen_assign(c, &@1, &$1, &tmp); + $$ = $1; + } + | lvalue ANDA rvalue + { + @1.last_column = @3.last_column; + HexValue tmp = gen_bin_op(c, &@1, ANDB_OP, &$1, &$3); + gen_assign(c, &@1, &$1, &tmp); + $$ = $1; + } + | lvalue ORA rvalue + { + @1.last_column = @3.last_column; + HexValue tmp = gen_bin_op(c, &@1, ORB_OP, &$1, &$3); + gen_assign(c, &@1, &$1, &tmp); + $$ = $1; + } + | lvalue XORA rvalue + { + @1.last_column = @3.last_column; + HexValue tmp = gen_bin_op(c, &@1, XORB_OP, &$1, &$3); + gen_assign(c, &@1, &$1, &tmp); + $$ = $1; + } + | PRED '=' rvalue + { + @1.last_column = @3.last_column; + gen_pred_assign(c, &@1, &$1, &$3); + } + | IMM '=' rvalue + { + @1.last_column = @3.last_column; + yyassert(c, &@1, $3.type == IMMEDIATE, + "Cannot assign non-immediate to immediate!"); + yyassert(c, &@1, $1.imm.type == VARIABLE, + "Cannot assign to non-variable!"); + /* Assign to the function argument */ + OUT(c, &@1, &$1, " = ", &$3, ";\n"); + $$ = $1; + } + | PC '=' rvalue + { + @1.last_column = @3.last_column; + yyassert(c, &@1, !is_inside_ternary(c), + "Assignment side-effect not modeled!"); + $3 = gen_rvalue_truncate(c, &@1, &$3); + $3 = rvalue_materialize(c, &@1, &$3); + OUT(c, &@1, "gen_write_new_pc(", &$3, ");\n"); + gen_rvalue_free(c, &@1, &$3); /* Free temporary value */ + } + | LOAD '(' IMM ',' IMM ',' SIGN ',' var ',' lvalue ')' + { + @1.last_column = @12.last_column; + yyassert(c, &@1, !is_inside_ternary(c), + "Assignment side-effect not modeled!"); + yyassert(c, &@1, $3.imm.value == 1, + "LOAD of arrays not supported!"); + gen_load(c, &@1, &$5, $7, &$9, &$11); + } + | STORE '(' IMM ',' IMM ',' var ',' rvalue ')' + /* Store primitive */ + { + @1.last_column = @10.last_column; + yyassert(c, &@1, !is_inside_ternary(c), + "Assignment side-effect not modeled!"); + yyassert(c, &@1, $3.imm.value == 1, + "STORE of arrays not supported!"); + gen_store(c, &@1, &$5, &$7, &$9); + } + | LPCFG '=' rvalue + { + @1.last_column = @3.last_column; + yyassert(c, &@1, !is_inside_ternary(c), + "Assignment side-effect not modeled!"); + $3 = gen_rvalue_truncate(c, &@1, &$3); + $3 = rvalue_materialize(c, &@1, &$3); + OUT(c, &@1, "SET_USR_FIELD(USR_LPCFG, ", &$3, ");\n"); + gen_rvalue_free(c, &@1, &$3); + } + | DEPOSIT '(' rvalue ',' rvalue ',' rvalue ')' + { + @1.last_column = @8.last_column; + yyassert(c, &@1, !is_inside_ternary(c), + "Assignment side-effect not modeled!"); + gen_deposit_op(c, &@1, &$5, &$7, &$3, &$1); + } + | SETHALF '(' rvalue ',' lvalue ',' rvalue ')' + { + @1.last_column = @8.last_column; + yyassert(c, &@1, !is_inside_ternary(c), + "Assignment side-effect not modeled!"); + gen_sethalf(c, &@1, &$1, &$3, &$5, &$7); + } + | SETBITS '(' rvalue ',' rvalue ',' rvalue ',' rvalue ')' + { + @1.last_column = @10.last_column; + yyassert(c, &@1, !is_inside_ternary(c), + "Assignment side-effect not modeled!"); + gen_setbits(c, &@1, &$3, &$5, &$7, &$9); + } + | INSBITS '(' lvalue ',' rvalue ',' rvalue ',' rvalue ')' + { + @1.last_column = @10.last_column; + yyassert(c, &@1, !is_inside_ternary(c), + "Assignment side-effect not modeled!"); + gen_rdeposit_op(c, &@1, &$3, &$9, &$7, &$5); + } + | IDENTITY '(' rvalue ')' + { + @1.last_column = @4.last_column; + $$ = $3; + } + ; + +control_statement : frame_check + | cancel_statement + | if_statement + | for_statement + | fpart1_statement + ; + +frame_check : FCHK '(' rvalue ',' rvalue ')' ';' + { + gen_rvalue_free(c, &@1, &$3); + gen_rvalue_free(c, &@1, &$5); + } + ; + +cancel_statement : CANCEL + { + OUT(c, &@1, "gen_cancel(insn->slot);\n"); + } + ; + +if_statement : if_stmt + { + /* Fix else label */ + OUT(c, &@1, "gen_set_label(if_label_", &$1, ");\n"); + } + | if_stmt ELSE + { + @1.last_column = @2.last_column; + $2 = gen_if_else(c, &@1, $1); + } + statement + { + OUT(c, &@1, "gen_set_label(if_label_", &$2, ");\n"); + } + ; + +for_statement : FOR '(' IMM '=' IMM ';' IMM '<' IMM ';' IMM PLUSPLUS ')' + { + yyassert(c, &@3, + $3.imm.type == I && + $7.imm.type == I && + $11.imm.type == I, + "Loop induction variable must be \"i\""); + @1.last_column = @13.last_column; + OUT(c, &@1, "for (int ", &$3, " = ", &$5, "; ", + &$7, " < ", &$9); + OUT(c, &@1, "; ", &$11, "++) {\n"); + } + code_block + { + OUT(c, &@1, "}\n"); + } + ; + +fpart1_statement : PART1 + { + OUT(c, &@1, "if (insn->part1) {\n"); + } + '(' statements ')' + { + @1.last_column = @3.last_column; + OUT(c, &@1, "return; }\n"); + } + ; + +if_stmt : IF '(' rvalue ')' + { + @1.last_column = @3.last_column; + $1 = gen_if_cond(c, &@1, &$3); + } + statement + { + $$ = $1; + } + ; + +rvalue : FAIL + { + yyassert(c, &@1, false, "Encountered a FAIL token as rvalue.\n"); + } + | assign_statement + | REG + { + $$ = $1; + } + | IMM + { + $$ = $1; + } + | PRED + { + $$ = gen_rvalue_pred(c, &@1, &$1); + } + | PC + { + /* Read PC from the CR */ + HexValue rvalue; + memset(&rvalue, 0, sizeof(HexValue)); + rvalue.type = IMMEDIATE; + rvalue.imm.type = IMM_PC; + rvalue.bit_width = 32; + rvalue.signedness = UNSIGNED; + $$ = rvalue; + } + | NPC + { + /* + * NPC is only read from CALLs, so we can hardcode it + * at translation time + */ + HexValue rvalue; + memset(&rvalue, 0, sizeof(HexValue)); + rvalue.type = IMMEDIATE; + rvalue.imm.type = IMM_NPC; + rvalue.bit_width = 32; + rvalue.signedness = UNSIGNED; + $$ = rvalue; + } + | CONSTEXT + { + HexValue rvalue; + memset(&rvalue, 0, sizeof(HexValue)); + rvalue.type = IMMEDIATE; + rvalue.imm.type = IMM_CONSTEXT; + rvalue.signedness = UNSIGNED; + rvalue.is_dotnew = false; + rvalue.is_manual = false; + $$ = rvalue; + } + | var + { + $$ = gen_rvalue_var(c, &@1, &$1); + } + | MPY '(' rvalue ',' rvalue ')' + { + @1.last_column = @6.last_column; + $$ = gen_rvalue_mpy(c, &@1, &$1, &$3, &$5); + } + | rvalue '+' rvalue + { + @1.last_column = @3.last_column; + $$ = gen_bin_op(c, &@1, ADD_OP, &$1, &$3); + } + | rvalue '-' rvalue + { + @1.last_column = @3.last_column; + $$ = gen_bin_op(c, &@1, SUB_OP, &$1, &$3); + } + | rvalue '*' rvalue + { + @1.last_column = @3.last_column; + $$ = gen_bin_op(c, &@1, MUL_OP, &$1, &$3); + } + | rvalue ASL rvalue + { + @1.last_column = @3.last_column; + $$ = gen_bin_op(c, &@1, ASL_OP, &$1, &$3); + } + | rvalue ASR rvalue + { + @1.last_column = @3.last_column; + assert_signedness(c, &@1, $1.signedness); + if ($1.signedness == UNSIGNED) { + $$ = gen_bin_op(c, &@1, LSR_OP, &$1, &$3); + } else if ($1.signedness == SIGNED) { + $$ = gen_bin_op(c, &@1, ASR_OP, &$1, &$3); + } + } + | rvalue LSR rvalue + { + @1.last_column = @3.last_column; + $$ = gen_bin_op(c, &@1, LSR_OP, &$1, &$3); + } + | rvalue '&' rvalue + { + @1.last_column = @3.last_column; + $$ = gen_bin_op(c, &@1, ANDB_OP, &$1, &$3); + } + | rvalue '|' rvalue + { + @1.last_column = @3.last_column; + $$ = gen_bin_op(c, &@1, ORB_OP, &$1, &$3); + } + | rvalue '^' rvalue + { + @1.last_column = @3.last_column; + $$ = gen_bin_op(c, &@1, XORB_OP, &$1, &$3); + } + | rvalue ANDL rvalue + { + @1.last_column = @3.last_column; + $$ = gen_bin_op(c, &@1, ANDL_OP, &$1, &$3); + } + | MIN '(' rvalue ',' rvalue ')' + { + @1.last_column = @3.last_column; + $$ = gen_bin_op(c, &@1, MINI_OP, &$3, &$5); + } + | MAX '(' rvalue ',' rvalue ')' + { + @1.last_column = @3.last_column; + $$ = gen_bin_op(c, &@1, MAXI_OP, &$3, &$5); + } + | '~' rvalue + { + @1.last_column = @2.last_column; + $$ = gen_rvalue_not(c, &@1, &$2); + } + | '!' rvalue + { + @1.last_column = @2.last_column; + $$ = gen_rvalue_notl(c, &@1, &$2); + } + | SAT '(' IMM ',' rvalue ')' + { + @1.last_column = @6.last_column; + $$ = gen_rvalue_sat(c, &@1, &$1, &$3, &$5); + } + | CAST rvalue + { + @1.last_column = @2.last_column; + /* Assign target signedness */ + $2.signedness = $1.signedness; + $$ = gen_cast_op(c, &@1, &$2, $1.bit_width, $1.signedness); + } + | rvalue EQ rvalue + { + @1.last_column = @3.last_column; + $$ = gen_bin_cmp(c, &@1, TCG_COND_EQ, &$1, &$3); + } + | rvalue NEQ rvalue + { + @1.last_column = @3.last_column; + $$ = gen_bin_cmp(c, &@1, TCG_COND_NE, &$1, &$3); + } + | rvalue '<' rvalue + { + @1.last_column = @3.last_column; + + assert_signedness(c, &@1, $1.signedness); + assert_signedness(c, &@1, $3.signedness); + if ($1.signedness == UNSIGNED || $3.signedness == UNSIGNED) { + $$ = gen_bin_cmp(c, &@1, TCG_COND_LTU, &$1, &$3); + } else { + $$ = gen_bin_cmp(c, &@1, TCG_COND_LT, &$1, &$3); + } + } + | rvalue '>' rvalue + { + @1.last_column = @3.last_column; + + assert_signedness(c, &@1, $1.signedness); + assert_signedness(c, &@1, $3.signedness); + if ($1.signedness == UNSIGNED || $3.signedness == UNSIGNED) { + $$ = gen_bin_cmp(c, &@1, TCG_COND_GTU, &$1, &$3); + } else { + $$ = gen_bin_cmp(c, &@1, TCG_COND_GT, &$1, &$3); + } + } + | rvalue LTE rvalue + { + @1.last_column = @3.last_column; + + assert_signedness(c, &@1, $1.signedness); + assert_signedness(c, &@1, $3.signedness); + if ($1.signedness == UNSIGNED || $3.signedness == UNSIGNED) { + $$ = gen_bin_cmp(c, &@1, TCG_COND_LEU, &$1, &$3); + } else { + $$ = gen_bin_cmp(c, &@1, TCG_COND_LE, &$1, &$3); + } + } + | rvalue GTE rvalue + { + @1.last_column = @3.last_column; + + assert_signedness(c, &@1, $1.signedness); + assert_signedness(c, &@1, $3.signedness); + if ($1.signedness == UNSIGNED || $3.signedness == UNSIGNED) { + $$ = gen_bin_cmp(c, &@1, TCG_COND_GEU, &$1, &$3); + } else { + $$ = gen_bin_cmp(c, &@1, TCG_COND_GE, &$1, &$3); + } + } + | rvalue '?' + { + $1.is_manual = true; + Ternary t = { 0 }; + t.state = IN_LEFT; + t.cond = $1; + g_array_append_val(c->ternary, t); + } + rvalue ':' + { + Ternary *t = &g_array_index(c->ternary, Ternary, + c->ternary->len - 1); + t->state = IN_RIGHT; + } + rvalue + { + @1.last_column = @5.last_column; + $$ = gen_rvalue_ternary(c, &@1, &$1, &$4, &$7); + } + | FSCR '(' rvalue ')' + { + @1.last_column = @4.last_column; + $$ = gen_rvalue_fscr(c, &@1, &$3); + } + | SXT '(' rvalue ',' IMM ',' rvalue ')' + { + @1.last_column = @8.last_column; + yyassert(c, &@1, $5.type == IMMEDIATE && + $5.imm.type == VALUE, + "SXT expects immediate values\n"); + $$ = gen_extend_op(c, &@1, &$3, $5.imm.value, &$7, SIGNED); + } + | ZXT '(' rvalue ',' IMM ',' rvalue ')' + { + @1.last_column = @8.last_column; + yyassert(c, &@1, $5.type == IMMEDIATE && + $5.imm.type == VALUE, + "ZXT expects immediate values\n"); + $$ = gen_extend_op(c, &@1, &$3, $5.imm.value, &$7, UNSIGNED); + } + | '(' rvalue ')' + { + $$ = $2; + } + | ABS rvalue + { + @1.last_column = @2.last_column; + $$ = gen_rvalue_abs(c, &@1, &$2); + } + | CROUND '(' rvalue ',' rvalue ')' + { + @1.last_column = @6.last_column; + $$ = gen_convround_n(c, &@1, &$3, &$5); + } + | CROUND '(' rvalue ')' + { + @1.last_column = @4.last_column; + $$ = gen_convround(c, &@1, &$3); + } + | ROUND '(' rvalue ',' rvalue ')' + { + @1.last_column = @6.last_column; + $$ = gen_round(c, &@1, &$3, &$5); + } + | '-' rvalue + { + @1.last_column = @2.last_column; + $$ = gen_rvalue_neg(c, &@1, &$2); + } + | ICIRC '(' rvalue ')' ASL IMM + { + @1.last_column = @6.last_column; + $$ = gen_tmp(c, &@1, 32, UNSIGNED); + OUT(c, &@1, "gen_read_ireg(", &$$, ", ", &$3, ", ", &$6, ");\n"); + gen_rvalue_free(c, &@1, &$3); + } + | CIRCADD '(' rvalue ',' rvalue ',' rvalue ')' + { + @1.last_column = @8.last_column; + gen_circ_op(c, &@1, &$3, &$5, &$7); + } + | LOCNT '(' rvalue ')' + { + @1.last_column = @4.last_column; + /* Leading ones count */ + $$ = gen_locnt_op(c, &@1, &$3); + } + | COUNTONES '(' rvalue ')' + { + @1.last_column = @4.last_column; + /* Ones count */ + $$ = gen_ctpop_op(c, &@1, &$3); + } + | LPCFG + { + $$ = gen_tmp_value(c, &@1, "0", 32, UNSIGNED); + OUT(c, &@1, "GET_USR_FIELD(USR_LPCFG, ", &$$, ");\n"); + } + | EXTRACT '(' rvalue ',' rvalue ')' + { + @1.last_column = @6.last_column; + $$ = gen_extract_op(c, &@1, &$5, &$3, &$1); + } + | EXTRANGE '(' rvalue ',' rvalue ',' rvalue ')' + { + @1.last_column = @8.last_column; + yyassert(c, &@1, $5.type == IMMEDIATE && + $5.imm.type == VALUE && + $7.type == IMMEDIATE && + $7.imm.type == VALUE, + "Range extract needs immediate values!\n"); + $$ = gen_rextract_op(c, + &@1, + &$3, + $7.imm.value, + $5.imm.value - $7.imm.value + 1); + } + | CAST4_8U '(' rvalue ')' + { + @1.last_column = @4.last_column; + $$ = gen_rvalue_truncate(c, &@1, &$3); + $$.signedness = UNSIGNED; + $$ = rvalue_materialize(c, &@1, &$$); + $$ = gen_rvalue_extend(c, &@1, &$$); + } + | BREV '(' rvalue ')' + { + @1.last_column = @4.last_column; + $$ = gen_rvalue_brev(c, &@1, &$3); + } + | ROTL '(' rvalue ',' rvalue ')' + { + @1.last_column = @6.last_column; + $$ = gen_rotl(c, &@1, &$3, &$5); + } + | ADDSAT64 '(' rvalue ',' rvalue ',' rvalue ')' + { + @1.last_column = @8.last_column; + gen_addsat64(c, &@1, &$3, &$5, &$7); + } + | CARRY_FROM_ADD '(' rvalue ',' rvalue ',' rvalue ')' + { + @1.last_column = @8.last_column; + $$ = gen_carry_from_add(c, &@1, &$3, &$5, &$7); + } + | LSBNEW '(' rvalue ')' + { + @1.last_column = @4.last_column; + HexValue one = gen_imm_value(c, &@1, 1, 32, UNSIGNED); + $$ = gen_bin_op(c, &@1, ANDB_OP, &$3, &one); + } + ; + +lvalue : FAIL + { + @1.last_column = @1.last_column; + yyassert(c, &@1, false, "Encountered a FAIL token as lvalue.\n"); + } + | REG + { + $$ = $1; + } + | var + { + $$ = $1; + } + ; + +%% + +int main(int argc, char **argv) +{ + if (argc != 5) { + fprintf(stderr, + "Semantics: Hexagon ISA to tinycode generator compiler\n\n"); + fprintf(stderr, + "Usage: ./semantics IDEFS EMITTER_C EMITTER_H " + "ENABLED_INSTRUCTIONS_LIST\n"); + return 1; + } + + enum { + ARG_INDEX_ARGV0 = 0, + ARG_INDEX_IDEFS, + ARG_INDEX_EMITTER_C, + ARG_INDEX_EMITTER_H, + ARG_INDEX_ENABLED_INSTRUCTIONS_LIST + }; + + FILE *enabled_file = fopen(argv[ARG_INDEX_ENABLED_INSTRUCTIONS_LIST], "w"); + + FILE *output_file = fopen(argv[ARG_INDEX_EMITTER_C], "w"); + fputs("#include \"qemu/osdep.h\"\n", output_file); + fputs("#include \"qemu/log.h\"\n", output_file); + fputs("#include \"cpu.h\"\n", output_file); + fputs("#include \"internal.h\"\n", output_file); + fputs("#include \"tcg/tcg-op.h\"\n", output_file); + fputs("#include \"insn.h\"\n", output_file); + fputs("#include \"opcodes.h\"\n", output_file); + fputs("#include \"translate.h\"\n", output_file); + fputs("#define QEMU_GENERATE\n", output_file); + fputs("#include \"genptr.h\"\n", output_file); + fputs("#include \"tcg/tcg.h\"\n", output_file); + fputs("#include \"macros.h\"\n", output_file); + fprintf(output_file, "#include \"%s\"\n", argv[ARG_INDEX_EMITTER_H]); + + FILE *defines_file = fopen(argv[ARG_INDEX_EMITTER_H], "w"); + assert(defines_file != NULL); + fputs("#ifndef HEX_EMITTER_H\n", defines_file); + fputs("#define HEX_EMITTER_H\n", defines_file); + fputs("\n", defines_file); + fputs("#include \"insn.h\"\n\n", defines_file); + + /* Parser input file */ + Context context = { 0 }; + context.defines_file = defines_file; + context.output_file = output_file; + context.enabled_file = enabled_file; + /* Initialize buffers */ + context.out_str = g_string_new(NULL); + context.signature_str = g_string_new(NULL); + context.header_str = g_string_new(NULL); + context.ternary = g_array_new(FALSE, TRUE, sizeof(Ternary)); + /* Read input file */ + FILE *input_file = fopen(argv[ARG_INDEX_IDEFS], "r"); + fseek(input_file, 0L, SEEK_END); + long input_size = ftell(input_file); + context.input_buffer = (char *) calloc(input_size + 1, sizeof(char)); + fseek(input_file, 0L, SEEK_SET); + size_t read_chars = fread(context.input_buffer, + sizeof(char), + input_size, + input_file); + if (read_chars != (size_t) input_size) { + fprintf(stderr, "Error: an error occurred while reading input file!\n"); + return -1; + } + yylex_init(&context.scanner); + YY_BUFFER_STATE buffer; + buffer = yy_scan_string(context.input_buffer, context.scanner); + /* Start the parsing procedure */ + yyparse(context.scanner, &context); + if (context.implemented_insn != context.total_insn) { + fprintf(stderr, + "Warning: %d/%d meta instructions have been implemented!\n", + context.implemented_insn, + context.total_insn); + } + fputs("#endif " START_COMMENT " HEX_EMITTER_h " END_COMMENT "\n", + defines_file); + /* Cleanup */ + yy_delete_buffer(buffer, context.scanner); + yylex_destroy(context.scanner); + free(context.input_buffer); + g_string_free(context.out_str, TRUE); + g_string_free(context.signature_str, TRUE); + g_string_free(context.header_str, TRUE); + g_array_free(context.ternary, TRUE); + fclose(output_file); + fclose(input_file); + fclose(defines_file); + fclose(enabled_file); + + return 0; +}
target/hexagon/idef-parser/parser-helpers.c new file +2346 -0
2,039 lines not on this page · raw message
target/hexagon/idef-parser/parser-helpers.h new file +372 -0
372 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.35.1
Part of the diff is not shown here. View the raw message.
PATCH v9 11/12 target/hexagon: call idef-parser functions
In reply to Anton Johansson viaFrom: Alessandro Di Federico <[email protected]>
Extend gen_tcg_funcs.py in order to emit calls to the functions emitted by the idef-parser, if available. An option is also added to fully disable the output of the idef-parser, which is useful for debugging purposes.
--- meson_options.txt | 3 + target/hexagon/gen_helper_funcs.py | 17 +++++- target/hexagon/gen_helper_protos.py | 17 +++++- target/hexagon/gen_tcg_funcs.py | 41 ++++++++++++- target/hexagon/hex_common.py | 10 ++++ target/hexagon/meson.build | 92 +++++++++++++++++++---------- 6 files changed, 146 insertions(+), 34 deletions(-)
meson_options.txt +3 -0
@@ -270,3 +270,6 @@ option('profiler', type: 'boolean', value: false, description: 'profiler support') option('slirp_smbd', type : 'feature', value : 'auto', description: 'use smbd (at path --smbd=*) in slirp networking') + +option('hexagon_idef_parser_enabled', type : 'boolean', value : true, + description: 'Whether idef-parser should be used to automatically generate TCG code for the Hexagon frontend')
target/hexagon/gen_helper_funcs.py +16 -1
@@ -287,11 +287,24 @@ def main(): hex_common.read_attribs_file(sys.argv[2]) hex_common.read_overrides_file(sys.argv[3]) hex_common.read_overrides_file(sys.argv[4]) + ## Whether or not idef-parser is enabled is + ## determined by the number of arguments to + ## this script: + ## + ## 5 args. -> not enabled, + ## 6 args. -> idef-parser enabled. + ## + ## The 6:th arg. then holds a list of the successfully + ## parsed instructions. + is_idef_parser_enabled = len(sys.argv) > 6 + if is_idef_parser_enabled: + hex_common.read_idef_parser_enabled_file(sys.argv[5]) hex_common.calculate_attribs() tagregs = hex_common.get_tagregs() tagimms = hex_common.get_tagimms() - with open(sys.argv[5], 'w') as f: + output_file = sys.argv[-1] + with open(output_file, 'w') as f: for tag in hex_common.tags: ## Skip the priv instructions if ( "A_PRIV" in hex_common.attribdict[tag] ) :
@@ -308,6 +321,8 @@ def main(): continue if ( hex_common.skip_qemu_helper(tag) ): continue + if ( hex_common.is_idef_parser_enabled(tag) ): + continue gen_helper_function(f, tag, tagregs, tagimms)
target/hexagon/gen_helper_protos.py +16 -1
@@ -136,11 +136,24 @@ def main(): hex_common.read_attribs_file(sys.argv[2]) hex_common.read_overrides_file(sys.argv[3]) hex_common.read_overrides_file(sys.argv[4]) + ## Whether or not idef-parser is enabled is + ## determined by the number of arguments to + ## this script: + ## + ## 5 args. -> not enabled, + ## 6 args. -> idef-parser enabled. + ## + ## The 6:th arg. then holds a list of the successfully + ## parsed instructions. + is_idef_parser_enabled = len(sys.argv) > 6 + if is_idef_parser_enabled: + hex_common.read_idef_parser_enabled_file(sys.argv[5]) hex_common.calculate_attribs() tagregs = hex_common.get_tagregs() tagimms = hex_common.get_tagimms() - with open(sys.argv[5], 'w') as f: + output_file = sys.argv[-1] + with open(output_file, 'w') as f: for tag in hex_common.tags: ## Skip the priv instructions if ( "A_PRIV" in hex_common.attribdict[tag] ) :
@@ -158,6 +171,8 @@ def main(): if ( hex_common.skip_qemu_helper(tag) ): continue + if ( hex_common.is_idef_parser_enabled(tag) ): + continue gen_helper_prototype(f, tag, tagregs, tagimms)
target/hexagon/gen_tcg_funcs.py +39 -2
58 lines not on this page · raw message
target/hexagon/hex_common.py +10 -0
@@ -28,6 +28,7 @@ attribinfo = {} # Register information and misc tags = [] # list of all tags overrides = {} # tags with helper overrides +idef_parser_enabled = {} # tags enabled for idef-parser # We should do this as a hash for performance, # but to keep order let's keep it as a list.
@@ -216,6 +217,9 @@ def is_tmp_result(tag): def is_new_result(tag): return ('A_CVI_NEW' in attribdict[tag]) +def is_idef_parser_enabled(tag): + return tag in idef_parser_enabled + def imm_name(immlett): return "%siV" % immlett
@@ -247,3 +251,9 @@ def read_overrides_file(name): continue tag = overridere.findall(line)[0] overrides[tag] = True + +def read_idef_parser_enabled_file(name): + global idef_parser_enabled + with open(name, "r") as idef_parser_enabled_file: + lines = idef_parser_enabled_file.read().strip().split("\n") + idef_parser_enabled = set(lines)
target/hexagon/meson.build +62 -30
121 lines not on this page · raw message
Signature · 1 line
2.35.1
PATCH v9 12/12 target/hexagon: import additional tests
In reply to Anton Johansson viaFrom: Niccolò Izzo <[email protected]>
--- tests/tcg/hexagon/Makefile.target | 28 ++++++++++++- tests/tcg/hexagon/crt.S | 14 +++++++ tests/tcg/hexagon/test_abs.S | 17 ++++++++ tests/tcg/hexagon/test_bitcnt.S | 40 +++++++++++++++++++ tests/tcg/hexagon/test_bitsplit.S | 22 ++++++++++ tests/tcg/hexagon/test_call.S | 64 ++++++++++++++++++++++++++++++ tests/tcg/hexagon/test_clobber.S | 29 ++++++++++++++ tests/tcg/hexagon/test_cmp.S | 31 +++++++++++++++ tests/tcg/hexagon/test_dotnew.S | 38 ++++++++++++++++++ tests/tcg/hexagon/test_ext.S | 13 ++++++ tests/tcg/hexagon/test_fibonacci.S | 30 ++++++++++++++ tests/tcg/hexagon/test_hl.S | 16 ++++++++ tests/tcg/hexagon/test_hwloops.S | 19 +++++++++ tests/tcg/hexagon/test_jmp.S | 22 ++++++++++ tests/tcg/hexagon/test_lsr.S | 36 +++++++++++++++++ tests/tcg/hexagon/test_mpyi.S | 17 ++++++++ tests/tcg/hexagon/test_packet.S | 29 ++++++++++++++ tests/tcg/hexagon/test_reorder.S | 33 +++++++++++++++ tests/tcg/hexagon/test_round.S | 29 ++++++++++++++ tests/tcg/hexagon/test_vavgw.S | 31 +++++++++++++++ tests/tcg/hexagon/test_vcmpb.S | 30 ++++++++++++++ tests/tcg/hexagon/test_vcmpw.S | 30 ++++++++++++++ tests/tcg/hexagon/test_vlsrw.S | 20 ++++++++++ tests/tcg/hexagon/test_vmaxh.S | 35 ++++++++++++++++ tests/tcg/hexagon/test_vminh.S | 35 ++++++++++++++++ tests/tcg/hexagon/test_vpmpyh.S | 28 +++++++++++++ tests/tcg/hexagon/test_vspliceb.S | 31 +++++++++++++++ 27 files changed, 766 insertions(+), 1 deletion(-) create mode 100644 tests/tcg/hexagon/crt.S create mode 100644 tests/tcg/hexagon/test_abs.S create mode 100644 tests/tcg/hexagon/test_bitcnt.S create mode 100644 tests/tcg/hexagon/test_bitsplit.S create mode 100644 tests/tcg/hexagon/test_call.S create mode 100644 tests/tcg/hexagon/test_clobber.S create mode 100644 tests/tcg/hexagon/test_cmp.S create mode 100644 tests/tcg/hexagon/test_dotnew.S create mode 100644 tests/tcg/hexagon/test_ext.S create mode 100644 tests/tcg/hexagon/test_fibonacci.S create mode 100644 tests/tcg/hexagon/test_hl.S create mode 100644 tests/tcg/hexagon/test_hwloops.S create mode 100644 tests/tcg/hexagon/test_jmp.S create mode 100644 tests/tcg/hexagon/test_lsr.S create mode 100644 tests/tcg/hexagon/test_mpyi.S create mode 100644 tests/tcg/hexagon/test_packet.S create mode 100644 tests/tcg/hexagon/test_reorder.S create mode 100644 tests/tcg/hexagon/test_round.S create mode 100644 tests/tcg/hexagon/test_vavgw.S create mode 100644 tests/tcg/hexagon/test_vcmpb.S create mode 100644 tests/tcg/hexagon/test_vcmpw.S create mode 100644 tests/tcg/hexagon/test_vlsrw.S create mode 100644 tests/tcg/hexagon/test_vmaxh.S create mode 100644 tests/tcg/hexagon/test_vminh.S create mode 100644 tests/tcg/hexagon/test_vpmpyh.S create mode 100644 tests/tcg/hexagon/test_vspliceb.S
tests/tcg/hexagon/Makefile.target +27 -1
@@ -24,7 +24,7 @@ CFLAGS += -fno-unroll-loops HEX_SRC=$(SRC_PATH)/tests/tcg/hexagon VPATH += $(HEX_SRC) -first: $(HEX_SRC)/first.S +%: $(HEX_SRC)/%.S $(HEX_SRC)/crt.S $(CC) -static -mv67 -nostdlib $^ -o $@ HEX_TESTS = first
@@ -43,6 +43,32 @@ HEX_TESTS += atomics HEX_TESTS += fpstuff HEX_TESTS += overflow +HEX_TESTS += test_abs +HEX_TESTS += test_bitcnt +HEX_TESTS += test_bitsplit +HEX_TESTS += test_call +HEX_TESTS += test_clobber +HEX_TESTS += test_cmp +HEX_TESTS += test_dotnew +HEX_TESTS += test_ext +HEX_TESTS += test_fibonacci +HEX_TESTS += test_hl +HEX_TESTS += test_hwloops +HEX_TESTS += test_jmp +HEX_TESTS += test_lsr +HEX_TESTS += test_mpyi +HEX_TESTS += test_packet +HEX_TESTS += test_reorder +HEX_TESTS += test_round +HEX_TESTS += test_vavgw +HEX_TESTS += test_vcmpb +HEX_TESTS += test_vcmpw +HEX_TESTS += test_vlsrw +HEX_TESTS += test_vmaxh +HEX_TESTS += test_vminh +HEX_TESTS += test_vpmpyh +HEX_TESTS += test_vspliceb + TESTS += $(HEX_TESTS) # This test has to be compiled for the -mv67t target
tests/tcg/hexagon/crt.S new file +14 -0
@@ -0,0 +1,14 @@ +#define SYS_exit_group 94 + + .text + .globl pass +pass: + r0 = #0 + r6 = #SYS_exit_group + trap0(#1) + + .globl fail +fail: + r0 = #1 + r6 = #SYS_exit_group + trap0(#1)
tests/tcg/hexagon/test_abs.S new file +17 -0
@@ -0,0 +1,17 @@ +/* Purpose: test example, verify the soundness of the abs operation */ + + .text + .globl _start + +_start: + { + r1 = #-2 + r2 = #2 + } + { + r3 = abs(r1) + } + { + p0 = cmp.eq(r3, r2); if (p0.new) jump:t pass + jump fail + }
tests/tcg/hexagon/test_bitcnt.S new file +40 -0
@@ -0,0 +1,40 @@ +/* + * Purpose: test example, verify the soundness of the cl[01] operations. + * + * The number 0x000001aa has 23 leading zeroes + * they become 55 when considered as 64 bit register + * and it has 1 trailing zero. + */ + .text + .globl _start + +_start: + { + r0 = #426 + r1 = #0 + } + { + r2 = cl0(r0) + } + { + p0 = cmp.eq(r2, #23); if (p0.new) jump:t test2 + jump fail + } + +test2: + { + r2 = cl0(r1:0) + } + { + p0 = cmp.eq(r2, #55); if (p0.new) jump:t test3 + jump fail + } + +test3: + { + r2 = ct0(r0) + } + { + p0 = cmp.eq(r2, #1); if (p0.new) jump:t pass + jump fail + }
tests/tcg/hexagon/test_bitsplit.S new file +22 -0
@@ -0,0 +1,22 @@ +/* Purpose: test example, verify the soundness of the bitsplit operation */ + + .text + .globl _start + +_start: + { + r1 = #187 + } + { + r3:2 = bitsplit(r1, #3) + } + { + p0 = cmp.eq(r2, #3); if (p0.new) jump:t test2 + jump fail + } + +test2: + { + p0 = cmp.eq(r3, #23); if (p0.new) jump:t pass + jump fail + }
tests/tcg/hexagon/test_call.S new file +64 -0
64 lines not on this page · raw message
tests/tcg/hexagon/test_clobber.S new file +29 -0
@@ -0,0 +1,29 @@ +/* + * Purpose: demonstrate the succesful operation of the register save mechanism, + * in which the caller saves the registers that will be clobbered, and restores + * them after the call. + */ + + .text + .globl _start + +_start: + allocframe(#8) + { + r16 = #47 + r17 = #155 + } + memd(sp+#0) = r17:16 + { + r16 = #255 + r17 = #42 + } + { + deallocframe + r17:16 = memd(sp+#0) + } + { + p0 = cmp.eq(r16, #47) + p0 = cmp.eq(r17, #155); if (p0.new) jump:t pass + jump fail + }
tests/tcg/hexagon/test_cmp.S new file +31 -0
@@ -0,0 +1,31 @@ +/* Purpose: test a signed and unsigned comparison */ + + .text + .globl _start + +_start: + { + jump signed + } + + .globl signed +signed: + { + r0 = #-2 + r1 = #0 + } + { + p0 = cmp.lt(r0, r1); if (p0.new) jump:t unsigned + jump fail + } + + .globl unsigned +unsigned: + { + r0 = #-2 + r1 = #0 + } + { + p0 = cmp.gtu(r0, r1); if (p0.new) jump:t pass + jump fail + }
tests/tcg/hexagon/test_dotnew.S new file +38 -0
@@ -0,0 +1,38 @@ +/* Purpose: test the .new operator while performing memory stores. */ + + .text + .globl _start + +_start: + { + allocframe(#16) + } + { + r0 = #1 + memw(sp+#0) = r0.new + } + { + r1 = #2 + memw(sp+#4) = r1.new + } + { + r2 = #3 + memw(sp+#8) = r2.new + } + { + r0 = memw(sp+#8) + } + { + r1 = memw(sp+#4) + } + { + r2 = memw(sp+#0) + } + { + r3 = mpyi(r1, r2) + } + { + deallocframe + p0 = cmp.eq(r3, #2); if (p0.new) jump:t pass + jump fail + }
tests/tcg/hexagon/test_ext.S new file +13 -0
@@ -0,0 +1,13 @@ +/* Purpose: test immediate extender instructions. */ + + .text + .globl _start + +_start: + { + r2 = ##-559038737 + } + { + p0 = cmp.eq(r2, ##-559038737); if (p0.new) jump:t pass + jump fail + }
tests/tcg/hexagon/test_fibonacci.S new file +30 -0
@@ -0,0 +1,30 @@ +/* Purpose: computes the Fibonacci series up to a constant number. */ + + .text + .globl _start + +_start: + { + r2 = #100 + } + { + p0 = cmp.gt(r2, #0); if (!p0.new) jump:nt .LBB0_3 + } + { + r3 = #0 + r4 = #1 + } +.LBB0_2: + { + r5 = r4 + } + { + p0 = cmp.gt(r2, r5); if (p0.new) jump:nt .LBB0_2 + r4 = add(r3, r4) + r3 = r5 + } +.LBB0_3: + { + p0 = cmp.eq(r3, #144); if (p0.new) jump:t pass + jump fail + }
tests/tcg/hexagon/test_hl.S new file +16 -0
@@ -0,0 +1,16 @@ +/* Purpose: test example, verify the soundness of the high/low assignment */ + + .text + .globl _start + +_start: + { + r0.H = #42 + } + { + r0.L = #69 + } + { + p0 = cmp.eq(r0, #2752581); if (p0.new) jump:t pass + jump fail + }
tests/tcg/hexagon/test_hwloops.S new file +19 -0
@@ -0,0 +1,19 @@ +/* Purpose: simple C Program to test hardware loops. */ + + .text + .globl _start + +_start: + { + loop0(.LBB0_1, #10) + r2 = #0 + } +.LBB0_1: + { + r2 = add(r2, #1) + nop + }:endloop0 + { + p0 = cmp.eq(r2, #10); if (p0.new) jump:t pass + jump fail + }
tests/tcg/hexagon/test_jmp.S new file +22 -0
@@ -0,0 +1,22 @@ +/* Purpose: test example, verify the soundness of the jump operation */ + +#define SYS_exit_group 94 + + .text + .globl _start + +_start: + { + jump pass + } + /* + * Inlined fail label in crt.S so we can fail without + * having a functioning jump + */ + { + r0 = #1 + r6 = #SYS_exit_group + } + { + trap0(#1) + }
tests/tcg/hexagon/test_lsr.S new file +36 -0
@@ -0,0 +1,36 @@ +/* Purpose: test the soundness of the lsr operation */ + + .text + .globl _start + +_start: + { + r0 = #-56984 + r1 = #2147483647 + } + { + r2 = #0x19 + } + { + r0 &= lsr(r1, r2) + } + { + p0 = cmp.eq(r0, #0x28); if (p0.new) jump:t test2 + jump fail + } + +test2: + { + r0 = #0x0000000a + r1 = #0x00000000 + } + { + r2 = #-1 + } + { + r1:0 = lsl(r1:0, r2) + } + { + p0 = cmp.eq(r0, #0x5); if (p0.new) jump:t pass + jump fail + }
tests/tcg/hexagon/test_mpyi.S new file +17 -0
@@ -0,0 +1,17 @@ +/* Purpose: test a simple multiplication operation */ + + .text + .globl _start + +_start: + { + r1 = #4 + r2 = #6 + } + { + r3 = mpyi(r1, r2) + } + { + p0 = cmp.eq(r3, #24); if (p0.new) jump:t pass + jump fail + }
tests/tcg/hexagon/test_packet.S new file +29 -0
@@ -0,0 +1,29 @@ +/* + * Purpose: test that writes of a register in a packet are performed only after + * that packet has finished its execution. + */ + + .text + .globl _start + +_start: + { + allocframe(#8) + } + { + r2 = #4 + r3 = #6 + } + { + memw(sp+#0) = r2 + } + { + r3 = memw(sp+#0) + r0 = add(r2, r3) + } + { + deallocframe + p0 = cmp.eq(r3, #4) + p0 = cmp.eq(r0, #10); if (p0.new) jump:t pass + jump fail + }
tests/tcg/hexagon/test_reorder.S new file +33 -0
@@ -0,0 +1,33 @@ +/* + * Purpose: demonstrate handling of .new uses appearing before the associated + * definition. + * Here we perform a jump that skips the code resetting R2 from 0xDEADBEEF to 0, + * only if P0.new is true, but P0 is assigned to 1 (R4) in the next instruction + * in the packet. + */ + + .text + .globl _start + +_start: + { + r2 = #-559038737 + } + { + r4 = #1 + } + { + if (p0.new) jump:nt skip + p0 = r4; + } + +fallthrough: + { + r2 = #0 + } + +skip: + { + p0 = cmp.eq(r2, #-559038737); if (p0.new) jump:t pass + jump fail + }
tests/tcg/hexagon/test_round.S new file +29 -0
@@ -0,0 +1,29 @@ +/* + * Purpose: test example, verify the soundness of the cround operation + * 106 = 0b1101010 with the comma at third digit is 12.5 which is crounded to 12 + * but rounded to 13. + */ + + .text + .globl _start + +_start: + { + r1 = #200 + } + { + r2 = round(r1, #4) + } + { + p0 = cmp.eq(r2, #13); if (p0.new) jump:t test2 + jump fail + } + +test2: + { + r2 = cround(r1, #4) + } + { + p0 = cmp.eq(r2, #12); if (p0.new) jump:t pass + jump fail + }
tests/tcg/hexagon/test_vavgw.S new file +31 -0
@@ -0,0 +1,31 @@ +/* + * Purpose: test example, verify the soundness of the vavgw operation. + * + * 0x00030001 averaged with 0x00010003 results 0x00020002. + */ + + .text + .globl _start + +_start: + { + r0 = #3 + r1 = #1 + } + { + r2 = #1 + r3 = #3 + } + { + r1:0 = vavgw(r1:0, r3:2):crnd + } + { + p0 = cmp.eq(r0, #2); if (p0.new) jump:t test2 + jump fail + } + +test2: + { + p0 = cmp.eq(r1, #2); if (p0.new) jump:t pass + jump fail + }
tests/tcg/hexagon/test_vcmpb.S new file +30 -0
@@ -0,0 +1,30 @@ +/* + * Purpose: test example, verify the soundness of the vector compare bytes + * operation. + * + * Vector byte comparison between 0x1234567887654321 and 0x1234567800000000 + * should result in 0b11110000 in binary, or 0xf0 in hex. + */ + + .text + .globl _start + +_start: + { + r0 = #0x87654321 + r1 = #0x12345678 + } + { + r2 = #0x00000000 + r3 = #0x12345678 + } + { + p2 = vcmpb.eq(r1:0, r3:2) + } + { + r4 = p2 + } + { + p0 = cmp.eq(r4, #0xf0); if (p0.new) jump:t pass + jump fail + }
tests/tcg/hexagon/test_vcmpw.S new file +30 -0
@@ -0,0 +1,30 @@ +/* + * Purpose: test example, verify the soundness of the vector compare words + * operation. + * + * Vector word comparison between 0x1234567887654321 and 0x1234567800000000 + * should result in 0b11110000 in binary, or 0xf0 in hex. + */ + + .text + .globl _start + +_start: + { + r0 = #0x87654321 + r1 = #0x12345678 + } + { + r2 = #0x00000000 + r3 = #0x12345678 + } + { + p2 = vcmpw.eq(r1:0, r3:2) + } + { + r4 = p2 + } + { + p0 = cmp.eq(r4, #0xf0); if (p0.new) jump:t pass + jump fail + }
tests/tcg/hexagon/test_vlsrw.S new file +20 -0
@@ -0,0 +1,20 @@ +/* Purpose: test the soundness of the vlsrw operation */ + + .text + .globl _start + +_start: + { + r0 = #0x00000001 + r1 = #0x00000001 + } + { + r1:0 = vlsrw(r1:0, #1) + } + { + r0 = add(r0, r1) + } + { + p0 = cmp.eq(r0, #0); if (p0.new) jump:t pass + jump fail + }
tests/tcg/hexagon/test_vmaxh.S new file +35 -0
@@ -0,0 +1,35 @@ +/* + * Purpose: test example, verify the soundness of the vrmaxh operation. + * + * The maximum between 0x0002000300010005 and 0x0003000200020007 is + * 0x0003000300020007. + * + * input: r1 = 0x00010003 r0 = 0x00010005 r3 = 0x00030002 r2 = 0x00020007 + * output: r1 = 0x00030003 r0 = 0x00020007 + */ + + .text + .globl _start + +_start: + { + r0 = #65541 + r1 = #65539 + } + { + r2 = #131079 + r3 = #196610 + } + { + r1:0 = vmaxh(r1:0, r3:2) + } + { + p0 = cmp.eq(r0, #131079); if (p0.new) jump:t test2 + jump fail + } + +test2: + { + p0 = cmp.eq(r1, #196611); if (p0.new) jump:t pass + jump fail + }
tests/tcg/hexagon/test_vminh.S new file +35 -0
@@ -0,0 +1,35 @@ +/* + * Purpose: test example, verify the soundness of the vrmaxh operation. + * + * The minimum between 0x0002000300010005 and 0x0003000200020007 is + * 0x0003000300020007. + * + * input: r1 = 0x00010003 r0 = 0x00010005 r3 = 0x00030002 r2 = 0x00020007 + * output: r1 = 0x00010002 r0 = 0x00010005 + */ + + .text + .globl _start + +_start: + { + r0 = #65541 + r1 = #65539 + } + { + r2 = #131079 + r3 = #196610 + } + { + r1:0 = vminh(r1:0, r3:2) + } + { + p0 = cmp.eq(r0, #65541); if (p0.new) jump:t test2 + jump fail + } + +test2: + { + p0 = cmp.eq(r1, #65538); if (p0.new) jump:t pass + jump fail + }
tests/tcg/hexagon/test_vpmpyh.S new file +28 -0
@@ -0,0 +1,28 @@ +/* + * Purpose: test example, verify the soundness of the vpmpyh operator. + * + * 0x01020304 vector polynomial multiplied with 0x04030201 results + * 0x000400060b060b04. + */ + + .text + .globl _start + +_start: + { + r0 = #16909060 + r1 = #67305985 + } + { + r1:0 = vpmpyh(r0, r1) + } + { + p0 = cmp.eq(r0, #184945412); if (p0.new) jump:t test2 + jump fail + } + +test2: + { + p0 = cmp.eq(r1, #262150); if (p0.new) jump:t pass + jump fail + }
tests/tcg/hexagon/test_vspliceb.S new file +31 -0
@@ -0,0 +1,31 @@ +/* + * Purpose: test example, verify the soundness of the vspliceb operation + * the operation is a binary splice of two 64bit operators. + * + * vspliceb(0xffffffffffffffff,0x0000000000000000,5) = 0x000000ffffffffff. + */ + .text + .globl _start + +_start: + { + r0 = #-1 + r1 = #-1 + } + { + r2 = #0 + r3 = #0 + } + { + r5:4 = vspliceb(r1:0, r3:2, #5) + } + { + p0 = cmp.eq(r4, #-1); if (p0.new) jump:t test2 + jump fail + } + +test2: + { + p0 = cmp.eq(r5, #255); if (p0.new) jump:t pass + jump fail + }
Signature · 1 line
2.35.1