target/arm/tcg: Remove inclusions of 'exec/helper-[proto/gen].h'
v3 cover target/arm/tcg: Remove inclusions of 'exec/helper-[proto/gen].h'
Since v2:
- Addressed rth's review comments (unnecessary helper-gen)
- Added R-b
- Extracted crypto, pauth, mte, gvec
Possible follow-up:
- merge gvec/vfp
- rename neon -> advsimd
- rename historical op_helper -> misc_helper
Since v1:
- Addressed rth's review comments (unnecessary helper-gen)
- Added R-b
- Extract M-profile helpers
- Fixed licence in new files
Hi,
This series tries to do what Richard suggested in [*]:
Targets that have a tcg/ subdir should have helper.h.inc moved into there. At the end, include/exec/helper-gen.h and include/exec/helper-proto.h become unused and go away.
but only for the ARM target, to first see if this is heading in the correct direction.
Instead of having TCG generated helpers included by all translate/helper units, they are reduced to the few places really needing them. I expect the build step to be slighly improved, since the compiler doesn't have to compile and track unused helpers definitions.
[*] https://lore.kernel.org/qemu-devel/[email protected]/
Philippe Mathieu-Daudé (34):
target/arm/tcg: Remove CONFIG_TCG #ifdef'ry check target/arm/tcg: Rename helper template headers as '.h.inc' target/arm/tcg: Extract iwMMXt helpers from the generic 'helper.h' target/arm/tcg: Fix iwmmxt-related code style target/arm/tcg: Expose some iwmmxt methods in 'translate.h' target/arm/tcg: Extract iwmmxt code to translate-iwmmxt.c target/arm/tcg: Reduce 'helper-iwmmxt.h.inc' inclusion target/arm/tcg: Un-inline VFP translation helpers target/arm/tcg: Move VFP helpers from helper-a64.c to vfp_helper.c target/arm/tcg: Extract VFP definitions to 'helper-vfp.h.inc' target/arm/tcg: Reduce 'helper-vfp.h.inc' inclusion target/arm/tcg: Move NEON helpers to neon_helper.c target/arm/tcg: Extract NEON definitions to 'helper-neon.h.inc' target/arm/tcg: Reduce 'helper-neon.h.inc' inclusion target/arm/tcg: Export some generic vector helpers target/arm/tcg: Extract generic vector helpers to translate-gvec.c target/arm/tcg: Extract gvec definitions to 'helper-gvec.h.inc' target/arm/tcg: Reduce 'helper-gvec.h.inc' inclusion target/arm/tcg: Extract SVE2 definitions to 'helper-sve.h.inc' target/arm/tcg: Reduce 'helper-sve.h.inc' inclusion target/arm/tcg: Extract crypto definitions to 'helper-crypto.h.inc' target/arm/tcg: Reduce 'helper-crypto.h.inc' inclusion target/arm/tcg: Reduce 'helper-mve.h.inc' inclusion target/arm/tcg: Reduce 'helper-sme.h.inc' inclusion target/arm/tcg: Extract PAuth definitions to 'helper-pauth.h.inc' target/arm/tcg: Extract MemTag definitions to 'helper-mte.h.inc' target/arm/tcg: Reduce 'helper-a64.h.inc' inclusion target/arm/tcg: Move v8m_stackcheck() from op_helper.c to m_helper.c target/arm/tcg: Extract M-profile definitions to 'helper-m.h.inc' target/arm/tcg: Reduce 'helper-m.h.inc' inclusion target/arm/tcg: Inline 'exec/helper-gen.h' target/arm/tcg: Inline 'exec/helper-proto.h' target/arm/tcg: Rename 'helper.h' -> 'tcg/helper.h.inc' tests/tcg/aarch64: Rename bti-crt.inc.c -> bti-crt.c.inc
target/arm/helper.h | 1047 ------
target/arm/tcg/translate.h | 37 +-
.../tcg/{helper-a64.h => helper-a64.h.inc} | 43 -
target/arm/tcg/helper-crypto.h.inc | 42 +
target/arm/tcg/helper-gvec.h.inc | 378 +++
target/arm/tcg/helper-iwmmxt.h.inc | 103 +
target/arm/tcg/helper-m.h.inc | 23 +
target/arm/tcg/helper-mte.h.inc | 23 +
.../tcg/{helper-mve.h => helper-mve.h.inc} | 0
target/arm/tcg/helper-neon.h.inc | 224 ++
target/arm/tcg/helper-pauth.h.inc | 19 +
.../tcg/{helper-sme.h => helper-sme.h.inc} | 0
.../tcg/{helper-sve.h => helper-sve.h.inc} | 46 +
target/arm/tcg/helper-vfp.h.inc | 189 ++
target/arm/tcg/helper.h.inc | 97 +
target/arm/debug_helper.c | 6 +-
target/arm/helper.c | 6 +-
target/arm/tcg/cpu32.c | 4 +-
target/arm/tcg/crypto_helper.c | 7 +-
target/arm/tcg/helper-a64.c | 176 +-
target/arm/tcg/hflags.c | 5 +-
target/arm/tcg/iwmmxt_helper.c | 5 +-
target/arm/tcg/m_helper.c | 31 +-
target/arm/tcg/mte_helper.c | 4 +-
target/arm/tcg/mve_helper.c | 9 +-
target/arm/tcg/neon_helper.c | 111 +-
target/arm/tcg/op_helper.c | 43 +-
target/arm/tcg/pauth_helper.c | 4 +-
target/arm/tcg/psci.c | 5 +-
target/arm/tcg/sme_helper.c | 5 +-
target/arm/tcg/sve_helper.c | 12 +-
target/arm/tcg/tlb_helper.c | 4 +-
target/arm/tcg/translate-a64.c | 38 +
target/arm/tcg/translate-gvec.c | 1650 ++++++++++
target/arm/tcg/translate-iwmmxt.c | 1331 ++++++++
target/arm/tcg/translate-m-nocp.c | 11 +
target/arm/tcg/translate-mve.c | 6 +
target/arm/tcg/translate-neon.c | 18 +
target/arm/tcg/translate-sme.c | 14 +
target/arm/tcg/translate-sve.c | 13 +
target/arm/tcg/translate-vfp.c | 31 +
target/arm/tcg/translate.c | 2907 +----------------
target/arm/tcg/vec_helper.c | 21 +-
target/arm/vfp_helper.c | 98 +-
tests/tcg/aarch64/bti-1.c | 2 +-
tests/tcg/aarch64/bti-3.c | 2 +-
.../aarch64/{bti-crt.inc.c => bti-crt.c.inc} | 0
target/arm/tcg/meson.build | 2 +
48 files changed, 4616 insertions(+), 4236 deletions(-)
delete mode 100644 target/arm/helper.h
rename target/arm/tcg/{helper-a64.h => helper-a64.h.inc} (60%)
create mode 100644 target/arm/tcg/helper-crypto.h.inc
create mode 100644 target/arm/tcg/helper-gvec.h.inc
create mode 100644 target/arm/tcg/helper-iwmmxt.h.inc
create mode 100644 target/arm/tcg/helper-m.h.inc
create mode 100644 target/arm/tcg/helper-mte.h.inc
rename target/arm/tcg/{helper-mve.h => helper-mve.h.inc} (100%)
create mode 100644 target/arm/tcg/helper-neon.h.inc
create mode 100644 target/arm/tcg/helper-pauth.h.inc
rename target/arm/tcg/{helper-sme.h => helper-sme.h.inc} (100%)
rename target/arm/tcg/{helper-sve.h => helper-sve.h.inc} (98%)
create mode 100644 target/arm/tcg/helper-vfp.h.inc
create mode 100644 target/arm/tcg/helper.h.inc
create mode 100644 target/arm/tcg/translate-gvec.c
create mode 100644 target/arm/tcg/translate-iwmmxt.c
rename tests/tcg/aarch64/{bti-crt.inc.c => bti-crt.c.inc} (100%)Signature · 1 line
2.38.1
PATCH v3 1/34 target/arm/tcg: Remove CONFIG_TCG #ifdef'ry check
CONFIG_TCG is always defined within target/arm/tcg/.
--- target/arm/tcg/cpu32.c | 4 +--- target/arm/tcg/m_helper.c | 6 ------ 2 files changed, 1 insertion(+), 9 deletions(-)
target/arm/tcg/cpu32.c +1 -3
@@ -13,11 +13,9 @@#include "hw/core/tcg-cpu-ops.h" #include "internals.h" #include "target/arm/idau.h" +#include "cpregs.h" #if !defined(CONFIG_USER_ONLY )#include "hw/boards.h" -#endif -#include "cpregs.h" -#if !defined(CONFIG_USER_ONLY ) && defined(CONFIG_TCG )#include "hw/intc/armv7m_nvic.h" #endif
target/arm/tcg/m_helper.c +0 -6
@@ -15,10 +15,8 @@#include "qemu/bitops.h" #include "qemu/log.h" #include "exec/exec-all.h" -#ifdef CONFIG_TCG #include "exec/cpu_ldst.h" #include "semihosting/common-semi.h" -#endif #if !defined(CONFIG_USER_ONLY )#include "hw/intc/armv7m_nvic.h" #endif
@@ -2345,11 +2343,7 @@ void arm_v7m_cpu_do_interrupt(CPUState *cs)qemu_log_mask (CPU_LOG_INT ,"...handling as semihosting call 0x%x\n" , env->regs[0 ]); -#ifdef CONFIG_TCG do_common_semihosting (cs); -#else -g_assert_not_reached (); -#endif env->regs[15 ] += env->thumb ?2 :4 ;return ;case EXCP_BKPT :
Signature · 1 line
2.38.1
PATCH v3 2/34 target/arm/tcg: Rename helper template headers as '.h.inc'
In reply to Philippe Mathieu-DaudéSince commit 139c1837db ("meson: rename included C source files to .c.inc"), QEMU standard procedure for included C files is to use *.c.inc.
Besides, since commit 6a0057aa22 ("docs/devel: make a statement about includes") this is documented as the Coding Style:
If you do use template header files they should be named with the ``.c.inc`` or ``.h.inc`` suffix to make it clear they are being included for expansion.
Therefore rename the included templates as '.h.inc'.
---
target/arm/helper.h | 8 ++++----
target/arm/tcg/{helper-a64.h => helper-a64.h.inc} | 0
target/arm/tcg/{helper-mve.h => helper-mve.h.inc} | 0
target/arm/tcg/{helper-sme.h => helper-sme.h.inc} | 0
target/arm/tcg/{helper-sve.h => helper-sve.h.inc} | 0
5 files changed, 4 insertions(+), 4 deletions(-)
rename target/arm/tcg/{helper-a64.h => helper-a64.h.inc} (100%)
rename target/arm/tcg/{helper-mve.h => helper-mve.h.inc} (100%)
rename target/arm/tcg/{helper-sme.h => helper-sme.h.inc} (100%)
rename target/arm/tcg/{helper-sve.h => helper-sve.h.inc} (100%)target/arm/helper.h +4 -4
@@ -1039,9 +1039,9 @@ DEF_HELPER_FLAGS_5(gvec_uclamp_d, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, ptr, i32) #ifdef TARGET_AARCH64 -#include "tcg/helper-a64.h" -#include "tcg/helper-sve.h" -#include "tcg/helper-sme.h" +#include "tcg/helper-a64.h.inc" +#include "tcg/helper-sve.h.inc" +#include "tcg/helper-sme.h.inc" #endif -#include "tcg/helper-mve.h" +#include "tcg/helper-mve.h.inc"
target/arm/tcg/helper-a64.h.inc renamed from target/arm/tcg/helper-a64.h +0 -0
target/arm/tcg/helper-mve.h.inc renamed from target/arm/tcg/helper-mve.h +0 -0
target/arm/tcg/helper-sme.h.inc renamed from target/arm/tcg/helper-sme.h +0 -0
target/arm/tcg/helper-sve.h.inc renamed from target/arm/tcg/helper-sve.h +0 -0
Signature · 1 line
2.38.1
PATCH v3 3/34 target/arm/tcg: Extract iwMMXt helpers from the generic 'helper.h'
In reply to Philippe Mathieu-Daudé--- target/arm/helper.h | 96 +-------------------------- target/arm/tcg/helper-iwmmxt.h.inc | 103 +++++++++++++++++++++++++++++ 2 files changed, 104 insertions(+), 95 deletions(-) create mode 100644 target/arm/tcg/helper-iwmmxt.h.inc
target/arm/helper.h +1 -95
@@ -445,101 +445,6 @@ DEF_HELPER_3(neon_acgt_f32, i32, i32, i32, ptr) DEF_HELPER_3(neon_acge_f64, i64, i64, i64, ptr) DEF_HELPER_3(neon_acgt_f64, i64, i64, i64, ptr) -/* iwmmxt_helper.c */ -DEF_HELPER_2(iwmmxt_maddsq, i64, i64, i64) -DEF_HELPER_2(iwmmxt_madduq, i64, i64, i64) -DEF_HELPER_2(iwmmxt_sadb, i64, i64, i64) -DEF_HELPER_2(iwmmxt_sadw, i64, i64, i64) -DEF_HELPER_2(iwmmxt_mulslw, i64, i64, i64) -DEF_HELPER_2(iwmmxt_mulshw, i64, i64, i64) -DEF_HELPER_2(iwmmxt_mululw, i64, i64, i64) -DEF_HELPER_2(iwmmxt_muluhw, i64, i64, i64) -DEF_HELPER_2(iwmmxt_macsw, i64, i64, i64) -DEF_HELPER_2(iwmmxt_macuw, i64, i64, i64) -DEF_HELPER_1(iwmmxt_setpsr_nz, i32, i64) - -#define DEF_IWMMXT_HELPER_SIZE_ENV (name) \ -DEF_HELPER_3(iwmmxt_##name##b, i64, env, i64, i64) \ -DEF_HELPER_3(iwmmxt_##name##w, i64, env, i64, i64) \ -DEF_HELPER_3(iwmmxt_##name##l, i64, env, i64, i64) \ - -DEF_IWMMXT_HELPER_SIZE_ENV(unpackl) -DEF_IWMMXT_HELPER_SIZE_ENV(unpackh) - -DEF_HELPER_2(iwmmxt_unpacklub, i64, env, i64) -DEF_HELPER_2(iwmmxt_unpackluw, i64, env, i64) -DEF_HELPER_2(iwmmxt_unpacklul, i64, env, i64) -DEF_HELPER_2(iwmmxt_unpackhub, i64, env, i64) -DEF_HELPER_2(iwmmxt_unpackhuw, i64, env, i64) -DEF_HELPER_2(iwmmxt_unpackhul, i64, env, i64) -DEF_HELPER_2(iwmmxt_unpacklsb, i64, env, i64) -DEF_HELPER_2(iwmmxt_unpacklsw, i64, env, i64) -DEF_HELPER_2(iwmmxt_unpacklsl, i64, env, i64) -DEF_HELPER_2(iwmmxt_unpackhsb, i64, env, i64) -DEF_HELPER_2(iwmmxt_unpackhsw, i64, env, i64) -DEF_HELPER_2(iwmmxt_unpackhsl, i64, env, i64) - -DEF_IWMMXT_HELPER_SIZE_ENV(cmpeq) -DEF_IWMMXT_HELPER_SIZE_ENV(cmpgtu) -DEF_IWMMXT_HELPER_SIZE_ENV(cmpgts) - -DEF_IWMMXT_HELPER_SIZE_ENV(mins) -DEF_IWMMXT_HELPER_SIZE_ENV(minu) -DEF_IWMMXT_HELPER_SIZE_ENV(maxs) -DEF_IWMMXT_HELPER_SIZE_ENV(maxu) - -DEF_IWMMXT_HELPER_SIZE_ENV(subn) -DEF_IWMMXT_HELPER_SIZE_ENV(addn) -DEF_IWMMXT_HELPER_SIZE_ENV(subu) -DEF_IWMMXT_HELPER_SIZE_ENV(addu) -DEF_IWMMXT_HELPER_SIZE_ENV(subs) -DEF_IWMMXT_HELPER_SIZE_ENV(adds) - -DEF_HELPER_3(iwmmxt_avgb0, i64, env, i64, i64) -DEF_HELPER_3(iwmmxt_avgb1, i64, env, i64, i64) -DEF_HELPER_3(iwmmxt_avgw0, i64, env, i64, i64) -DEF_HELPER_3(iwmmxt_avgw1, i64, env, i64, i64) - -DEF_HELPER_3(iwmmxt_align, i64, i64, i64, i32) -DEF_HELPER_4(iwmmxt_insr, i64, i64, i32, i32, i32) - -DEF_HELPER_1(iwmmxt_bcstb, i64, i32) -DEF_HELPER_1(iwmmxt_bcstw, i64, i32) -DEF_HELPER_1(iwmmxt_bcstl, i64, i32) - -DEF_HELPER_1(iwmmxt_addcb, i64, i64) -DEF_HELPER_1(iwmmxt_addcw, i64, i64) -DEF_HELPER_1(iwmmxt_addcl, i64, i64) - -DEF_HELPER_1(iwmmxt_msbb, i32, i64) -DEF_HELPER_1(iwmmxt_msbw, i32, i64) -DEF_HELPER_1(iwmmxt_msbl, i32, i64) - -DEF_HELPER_3(iwmmxt_srlw, i64, env, i64, i32) -DEF_HELPER_3(iwmmxt_srll, i64, env, i64, i32) -DEF_HELPER_3(iwmmxt_srlq, i64, env, i64, i32) -DEF_HELPER_3(iwmmxt_sllw, i64, env, i64, i32) -DEF_HELPER_3(iwmmxt_slll, i64, env, i64, i32) -DEF_HELPER_3(iwmmxt_sllq, i64, env, i64, i32) -DEF_HELPER_3(iwmmxt_sraw, i64, env, i64, i32) -DEF_HELPER_3(iwmmxt_sral, i64, env, i64, i32) -DEF_HELPER_3(iwmmxt_sraq, i64, env, i64, i32) -DEF_HELPER_3(iwmmxt_rorw, i64, env, i64, i32) -DEF_HELPER_3(iwmmxt_rorl, i64, env, i64, i32) -DEF_HELPER_3(iwmmxt_rorq, i64, env, i64, i32) -DEF_HELPER_3(iwmmxt_shufh, i64, env, i64, i32) - -DEF_HELPER_3(iwmmxt_packuw, i64, env, i64, i64) -DEF_HELPER_3(iwmmxt_packul, i64, env, i64, i64) -DEF_HELPER_3(iwmmxt_packuq, i64, env, i64, i64) -DEF_HELPER_3(iwmmxt_packsw, i64, env, i64, i64) -DEF_HELPER_3(iwmmxt_packsl, i64, env, i64, i64) -DEF_HELPER_3(iwmmxt_packsq, i64, env, i64, i64) - -DEF_HELPER_3(iwmmxt_muladdsl, i64, i64, i32, i32) -DEF_HELPER_3(iwmmxt_muladdsw, i64, i64, i32, i32) -DEF_HELPER_3(iwmmxt_muladdswl, i64, i64, i32, i32) - DEF_HELPER_FLAGS_2(neon_unzip8, TCG_CALL_NO_RWG, void, ptr, ptr) DEF_HELPER_FLAGS_2(neon_unzip16, TCG_CALL_NO_RWG, void, ptr, ptr)DEF_HELPER_FLAGS_2 (neon_qunzip8,TCG_CALL_NO_RWG , void, ptr, ptr)
@@ -1044,4 +949,5 @@ DEF_HELPER_FLAGS_5(gvec_uclamp_d, TCG_CALL_NO_RWG,#include "tcg/helper-sme.h.inc" #endif +#include "tcg/helper-iwmmxt.h.inc" #include "tcg/helper-mve.h.inc"
target/arm/tcg/helper-iwmmxt.h.inc new file +103 -0
103 lines not on this page · raw message
Signature · 1 line
2.38.1
PATCH v3 4/34 target/arm/tcg: Fix iwmmxt-related code style
In reply to Philippe Mathieu-DaudéIn order to be able to move the iwmmxt-related code, fix its style to avoid:
ERROR: braces {} are necessary for all arms of this statement
ERROR: space prohibited before that '++' (ctx:WxB)
--- target/arm/tcg/translate.c | 227 +++++++++++++++++++++++-------------- 1 file changed, 141 insertions(+), 86 deletions(-)
target/arm/tcg/translate.c +141 -86
@@ -1441,10 +1441,11 @@ static inline int gen_iwmmxt_address(DisasContext *s, uint32_t insn, offset = (insn &0xff ) << ((insn >>7 ) &2 );if (insn & (1 <<24 )) {/* Pre indexed */ -if (insn & (1 <<23 )) +if (insn & (1 <<23 )) {tcg_gen_addi_i32 (tmp, tmp, offset); -else + }else {tcg_gen_addi_i32 (tmp, tmp, -offset); + }tcg_gen_mov_i32 (dest, tmp);if (insn & (1 <<21 )) {store_reg (s, rd, tmp);
@@ -1452,13 +1453,15 @@ static inline int gen_iwmmxt_address(DisasContext *s, uint32_t insn, }else if (insn & (1 <<21 )) {/* Post indexed */ tcg_gen_mov_i32 (dest, tmp); -if (insn & (1 <<23 )) +if (insn & (1 <<23 )) {tcg_gen_addi_i32 (tmp, tmp, offset); -else + }else {tcg_gen_addi_i32 (tmp, tmp, -offset); + }store_reg (s, rd, tmp); - }else if (!(insn & (1 <<23 ))) + }else if (!(insn & (1 <<23 ))) {return 1 ; + }return 0 ; }
@@ -1483,8 +1486,10 @@ static inline int gen_iwmmxt_shift(uint32_t insn, uint32_t mask, TCGv_i32 dest)return 0 ; } -/* Disassemble an iwMMXt instruction. Returns nonzero if an error occurred -(ie. an undefined instruction). */ +/* +* Disassemble an iwMMXt instruction. +* Returns nonzero if an error occurred (ie. an undefined instruction). +*/ static int disas_iwmmxt_insn (DisasContext *s,uint32_t insn) {int rd, wrd;
@@ -1570,8 +1575,9 @@ static int disas_iwmmxt_insn(DisasContext *s, uint32_t insn)return 0 ; } -if ((insn &0x0f000000 ) !=0x0e000000 ) +if ((insn &0x0f000000 ) !=0x0e000000 ) {return 1 ; + }switch (((insn >>12 ) &0xf00 ) | ((insn >>4 ) &0xff )) {case 0x000 :/* WOR */
@@ -1586,8 +1592,9 @@ static int disas_iwmmxt_insn(DisasContext *s, uint32_t insn)gen_op_iwmmxt_set_cup ();break ;case 0x011 :/* TMCR */ -if (insn &0xf ) +if (insn &0xf ) {return 1 ; + } rd = (insn >>12 ) &0xf ; wrd = (insn >>16 ) &0xf ;switch (wrd) {
@@ -1627,8 +1634,9 @@ static int disas_iwmmxt_insn(DisasContext *s, uint32_t insn)gen_op_iwmmxt_set_cup ();break ;case 0x111 :/* TMRC */ -if (insn &0xf ) +if (insn &0xf ) {return 1 ; + } rd = (insn >>12 ) &0xf ; wrd = (insn >>16 ) &0xf ; tmp =iwmmxt_load_creg (wrd);
@@ -1662,10 +1670,11 @@ static int disas_iwmmxt_insn(DisasContext *s, uint32_t insn) rd0 = (insn >>0 ) &0xf ; rd1 = (insn >>16 ) &0xf ;gen_op_iwmmxt_movq_M0_wRn (rd0); -if (insn & (1 <<21 )) +if (insn & (1 <<21 )) {gen_op_iwmmxt_maddsq_M0_wRn (rd1); -else + }else {gen_op_iwmmxt_madduq_M0_wRn (rd1); + }gen_op_iwmmxt_movq_wRn_M0 (wrd);gen_op_iwmmxt_set_mup ();break ;
@@ -1718,12 +1727,14 @@ static int disas_iwmmxt_insn(DisasContext *s, uint32_t insn) rd0 = (insn >>16 ) &0xf ; rd1 = (insn >>0 ) &0xf ;gen_op_iwmmxt_movq_M0_wRn (rd0); -if (insn & (1 <<22 )) +if (insn & (1 <<22 )) {gen_op_iwmmxt_sadw_M0_wRn (rd1); -else + }else {gen_op_iwmmxt_sadb_M0_wRn (rd1); -if (!(insn & (1 <<20 ))) + } +if (!(insn & (1 <<20 ))) {gen_op_iwmmxt_addl_M0_wRn (wrd); + }gen_op_iwmmxt_movq_wRn_M0 (wrd);gen_op_iwmmxt_set_mup ();break ;
@@ -1733,15 +1744,17 @@ static int disas_iwmmxt_insn(DisasContext *s, uint32_t insn) rd1 = (insn >>0 ) &0xf ;gen_op_iwmmxt_movq_M0_wRn (rd0);if (insn & (1 <<21 )) { -if (insn & (1 <<20 )) +if (insn & (1 <<20 )) {gen_op_iwmmxt_mulshw_M0_wRn (rd1); -else + }else {gen_op_iwmmxt_mulslw_M0_wRn (rd1); + } }else { -if (insn & (1 <<20 )) +if (insn & (1 <<20 )) {gen_op_iwmmxt_muluhw_M0_wRn (rd1); -else + }else {gen_op_iwmmxt_mululw_M0_wRn (rd1); + } }gen_op_iwmmxt_movq_wRn_M0 (wrd);gen_op_iwmmxt_set_mup ();
@@ -1751,10 +1764,11 @@ static int disas_iwmmxt_insn(DisasContext *s, uint32_t insn) rd0 = (insn >>16 ) &0xf ; rd1 = (insn >>0 ) &0xf ;gen_op_iwmmxt_movq_M0_wRn (rd0); -if (insn & (1 <<21 )) +if (insn & (1 <<21 )) {gen_op_iwmmxt_macsw_M0_wRn (rd1); -else + }else {gen_op_iwmmxt_macuw_M0_wRn (rd1); + }if (!(insn & (1 <<20 ))) {iwmmxt_load_reg (cpu_V1, wrd);tcg_gen_add_i64 (cpu_M0, cpu_M0, cpu_V1);
@@ -1790,15 +1804,17 @@ static int disas_iwmmxt_insn(DisasContext *s, uint32_t insn) rd1 = (insn >>0 ) &0xf ;gen_op_iwmmxt_movq_M0_wRn (rd0);if (insn & (1 <<22 )) { -if (insn & (1 <<20 )) +if (insn & (1 <<20 )) {gen_op_iwmmxt_avgw1_M0_wRn (rd1); -else + }else {gen_op_iwmmxt_avgw0_M0_wRn (rd1); + } }else { -if (insn & (1 <<20 )) +if (insn & (1 <<20 )) {gen_op_iwmmxt_avgb1_M0_wRn (rd1); -else + }else {gen_op_iwmmxt_avgb0_M0_wRn (rd1); + } }gen_op_iwmmxt_movq_wRn_M0 (wrd);gen_op_iwmmxt_set_mup ();
@@ -1817,8 +1833,9 @@ static int disas_iwmmxt_insn(DisasContext *s, uint32_t insn)gen_op_iwmmxt_set_mup ();break ;case 0x601 :case 0x605 :case 0x609 :case 0x60d :/* TINSR */ -if (((insn >>6 ) &3 ) ==3 ) +if (((insn >>6 ) &3 ) ==3 ) {return 1 ; + } rd = (insn >>12 ) &0xf ; wrd = (insn >>16 ) &0xf ; tmp =load_reg (s, rd);
@@ -1846,8 +1863,9 @@ static int disas_iwmmxt_insn(DisasContext *s, uint32_t insn)case 0x107 :case 0x507 :case 0x907 :case 0xd07 :/* TEXTRM */ rd = (insn >>12 ) &0xf ; wrd = (insn >>16 ) &0xf ; -if (rd ==15 || ((insn >>22 ) &3 ) ==3 ) +if (rd ==15 || ((insn >>22 ) &3 ) ==3 ) {return 1 ; + }gen_op_iwmmxt_movq_M0_wRn (wrd); tmp =tcg_temp_new_i32 ();switch ((insn >>22 ) &3 ) {
@@ -1877,8 +1895,9 @@ static int disas_iwmmxt_insn(DisasContext *s, uint32_t insn)store_reg (s, rd, tmp);break ;case 0x117 :case 0x517 :case 0x917 :case 0xd17 :/* TEXTRC */ -if ((insn &0x000ff008 ) !=0x0003f000 || ((insn >>22 ) &3 ) ==3 ) +if ((insn &0x000ff008 ) !=0x0003f000 || ((insn >>22 ) &3 ) ==3 ) {return 1 ; + } tmp =iwmmxt_load_creg (ARM_IWMMXT_wCASF);switch ((insn >>22 ) &3 ) {case 0 :
@@ -1895,8 +1914,9 @@ static int disas_iwmmxt_insn(DisasContext *s, uint32_t insn)gen_set_nzcv (tmp);break ;case 0x401 :case 0x405 :case 0x409 :case 0x40d :/* TBCST */ -if (((insn >>6 ) &3 ) ==3 ) +if (((insn >>6 ) &3 ) ==3 ) {return 1 ; + } rd = (insn >>12 ) &0xf ; wrd = (insn >>16 ) &0xf ; tmp =load_reg (s, rd);
@@ -1915,20 +1935,21 @@ static int disas_iwmmxt_insn(DisasContext *s, uint32_t insn)gen_op_iwmmxt_set_mup ();break ;case 0x113 :case 0x513 :case 0x913 :case 0xd13 :/* TANDC */ -if ((insn &0x000ff00f ) !=0x0003f000 || ((insn >>22 ) &3 ) ==3 ) +if ((insn &0x000ff00f ) !=0x0003f000 || ((insn >>22 ) &3 ) ==3 ) {return 1 ; + } tmp =iwmmxt_load_creg (ARM_IWMMXT_wCASF); tmp2 =tcg_temp_new_i32 ();tcg_gen_mov_i32 (tmp2, tmp);switch ((insn >>22 ) &3 ) {case 0 : -for (i =0 ; i <7 ; i ++) { +for (i =0 ; i <7 ; i++) {tcg_gen_shli_i32 (tmp2, tmp2,4 );tcg_gen_and_i32 (tmp, tmp, tmp2); }break ;case 1 : -for (i =0 ; i <3 ; i ++) { +for (i =0 ; i <3 ; i++) {tcg_gen_shli_i32 (tmp2, tmp2,8 );tcg_gen_and_i32 (tmp, tmp, tmp2); }
@@ -1961,20 +1982,21 @@ static int disas_iwmmxt_insn(DisasContext *s, uint32_t insn)gen_op_iwmmxt_set_mup ();break ;case 0x115 :case 0x515 :case 0x915 :case 0xd15 :/* TORC */ -if ((insn &0x000ff00f ) !=0x0003f000 || ((insn >>22 ) &3 ) ==3 ) +if ((insn &0x000ff00f ) !=0x0003f000 || ((insn >>22 ) &3 ) ==3 ) {return 1 ; + } tmp =iwmmxt_load_creg (ARM_IWMMXT_wCASF); tmp2 =tcg_temp_new_i32 ();tcg_gen_mov_i32 (tmp2, tmp);switch ((insn >>22 ) &3 ) {case 0 : -for (i =0 ; i <7 ; i ++) { +for (i =0 ; i <7 ; i++) {tcg_gen_shli_i32 (tmp2, tmp2,4 );tcg_gen_or_i32 (tmp, tmp, tmp2); }break ;case 1 : -for (i =0 ; i <3 ; i ++) { +for (i =0 ; i <3 ; i++) {tcg_gen_shli_i32 (tmp2, tmp2,8 );tcg_gen_or_i32 (tmp, tmp, tmp2); }
@@ -1989,8 +2011,9 @@ static int disas_iwmmxt_insn(DisasContext *s, uint32_t insn)case 0x103 :case 0x503 :case 0x903 :case 0xd03 :/* TMOVMSK */ rd = (insn >>12 ) &0xf ; rd0 = (insn >>16 ) &0xf ; -if ((insn &0xf ) !=0 || ((insn >>22 ) &3 ) ==3 ) +if ((insn &0xf ) !=0 || ((insn >>22 ) &3 ) ==3 ) {return 1 ; + }gen_op_iwmmxt_movq_M0_wRn (rd0); tmp =tcg_temp_new_i32 ();switch ((insn >>22 ) &3 ) {
@@ -2014,22 +2037,25 @@ static int disas_iwmmxt_insn(DisasContext *s, uint32_t insn)gen_op_iwmmxt_movq_M0_wRn (rd0);switch ((insn >>22 ) &3 ) {case 0 : -if (insn & (1 <<21 )) +if (insn & (1 <<21 )) {gen_op_iwmmxt_cmpgtsb_M0_wRn (rd1); -else + }else {gen_op_iwmmxt_cmpgtub_M0_wRn (rd1); + }break ;case 1 : -if (insn & (1 <<21 )) +if (insn & (1 <<21 )) {gen_op_iwmmxt_cmpgtsw_M0_wRn (rd1); -else + }else {gen_op_iwmmxt_cmpgtuw_M0_wRn (rd1); + }break ;case 2 : -if (insn & (1 <<21 )) +if (insn & (1 <<21 )) {gen_op_iwmmxt_cmpgtsl_M0_wRn (rd1); -else + }else {gen_op_iwmmxt_cmpgtul_M0_wRn (rd1); + }break ;case 3 :return 1 ;
@@ -2045,22 +2071,25 @@ static int disas_iwmmxt_insn(DisasContext *s, uint32_t insn)gen_op_iwmmxt_movq_M0_wRn (rd0);switch ((insn >>22 ) &3 ) {case 0 : -if (insn & (1 <<21 )) +if (insn & (1 <<21 )) {gen_op_iwmmxt_unpacklsb_M0 (); -else + }else {gen_op_iwmmxt_unpacklub_M0 (); + }break ;case 1 : -if (insn & (1 <<21 )) +if (insn & (1 <<21 )) {gen_op_iwmmxt_unpacklsw_M0 (); -else + }else {gen_op_iwmmxt_unpackluw_M0 (); + }break ;case 2 : -if (insn & (1 <<21 )) +if (insn & (1 <<21 )) {gen_op_iwmmxt_unpacklsl_M0 (); -else + }else {gen_op_iwmmxt_unpacklul_M0 (); + }break ;case 3 :return 1 ;
@@ -2076,22 +2105,25 @@ static int disas_iwmmxt_insn(DisasContext *s, uint32_t insn)gen_op_iwmmxt_movq_M0_wRn (rd0);switch ((insn >>22 ) &3 ) {case 0 : -if (insn & (1 <<21 )) +if (insn & (1 <<21 )) {gen_op_iwmmxt_unpackhsb_M0 (); -else + }else {gen_op_iwmmxt_unpackhub_M0 (); + }break ;case 1 : -if (insn & (1 <<21 )) +if (insn & (1 <<21 )) {gen_op_iwmmxt_unpackhsw_M0 (); -else + }else {gen_op_iwmmxt_unpackhuw_M0 (); + }break ;case 2 : -if (insn & (1 <<21 )) +if (insn & (1 <<21 )) {gen_op_iwmmxt_unpackhsl_M0 (); -else + }else {gen_op_iwmmxt_unpackhul_M0 (); + }break ;case 3 :return 1 ;
@@ -2102,8 +2134,9 @@ static int disas_iwmmxt_insn(DisasContext *s, uint32_t insn)break ;case 0x204 :case 0x604 :case 0xa04 :case 0xe04 :/* WSRL */ case 0x214 :case 0x614 :case 0xa14 :case 0xe14 : -if (((insn >>22 ) &3 ) ==0 ) +if (((insn >>22 ) &3 ) ==0 ) {return 1 ; + } wrd = (insn >>12 ) &0xf ; rd0 = (insn >>16 ) &0xf ;gen_op_iwmmxt_movq_M0_wRn (rd0);
@@ -2128,8 +2161,9 @@ static int disas_iwmmxt_insn(DisasContext *s, uint32_t insn)break ;case 0x004 :case 0x404 :case 0x804 :case 0xc04 :/* WSRA */ case 0x014 :case 0x414 :case 0x814 :case 0xc14 : -if (((insn >>22 ) &3 ) ==0 ) +if (((insn >>22 ) &3 ) ==0 ) {return 1 ; + } wrd = (insn >>12 ) &0xf ; rd0 = (insn >>16 ) &0xf ;gen_op_iwmmxt_movq_M0_wRn (rd0);
@@ -2154,8 +2188,9 @@ static int disas_iwmmxt_insn(DisasContext *s, uint32_t insn)break ;case 0x104 :case 0x504 :case 0x904 :case 0xd04 :/* WSLL */ case 0x114 :case 0x514 :case 0x914 :case 0xd14 : -if (((insn >>22 ) &3 ) ==0 ) +if (((insn >>22 ) &3 ) ==0 ) {return 1 ; + } wrd = (insn >>12 ) &0xf ; rd0 = (insn >>16 ) &0xf ;gen_op_iwmmxt_movq_M0_wRn (rd0);
@@ -2180,8 +2215,9 @@ static int disas_iwmmxt_insn(DisasContext *s, uint32_t insn)break ;case 0x304 :case 0x704 :case 0xb04 :case 0xf04 :/* WROR */ case 0x314 :case 0x714 :case 0xb14 :case 0xf14 : -if (((insn >>22 ) &3 ) ==0 ) +if (((insn >>22 ) &3 ) ==0 ) {return 1 ; + } wrd = (insn >>12 ) &0xf ; rd0 = (insn >>16 ) &0xf ;gen_op_iwmmxt_movq_M0_wRn (rd0);
@@ -2218,22 +2254,25 @@ static int disas_iwmmxt_insn(DisasContext *s, uint32_t insn)gen_op_iwmmxt_movq_M0_wRn (rd0);switch ((insn >>22 ) &3 ) {case 0 : -if (insn & (1 <<21 )) +if (insn & (1 <<21 )) {gen_op_iwmmxt_minsb_M0_wRn (rd1); -else + }else {gen_op_iwmmxt_minub_M0_wRn (rd1); + }break ;case 1 : -if (insn & (1 <<21 )) +if (insn & (1 <<21 )) {gen_op_iwmmxt_minsw_M0_wRn (rd1); -else + }else {gen_op_iwmmxt_minuw_M0_wRn (rd1); + }break ;case 2 : -if (insn & (1 <<21 )) +if (insn & (1 <<21 )) {gen_op_iwmmxt_minsl_M0_wRn (rd1); -else + }else {gen_op_iwmmxt_minul_M0_wRn (rd1); + }break ;case 3 :return 1 ;
@@ -2249,22 +2288,25 @@ static int disas_iwmmxt_insn(DisasContext *s, uint32_t insn)gen_op_iwmmxt_movq_M0_wRn (rd0);switch ((insn >>22 ) &3 ) {case 0 : -if (insn & (1 <<21 )) +if (insn & (1 <<21 )) {gen_op_iwmmxt_maxsb_M0_wRn (rd1); -else + }else {gen_op_iwmmxt_maxub_M0_wRn (rd1); + }break ;case 1 : -if (insn & (1 <<21 )) +if (insn & (1 <<21 )) {gen_op_iwmmxt_maxsw_M0_wRn (rd1); -else + }else {gen_op_iwmmxt_maxuw_M0_wRn (rd1); + }break ;case 2 : -if (insn & (1 <<21 )) +if (insn & (1 <<21 )) {gen_op_iwmmxt_maxsl_M0_wRn (rd1); -else + }else {gen_op_iwmmxt_maxul_M0_wRn (rd1); + }break ;case 3 :return 1 ;
@@ -2387,30 +2429,34 @@ static int disas_iwmmxt_insn(DisasContext *s, uint32_t insn)case 0x408 :case 0x508 :case 0x608 :case 0x708 :case 0x808 :case 0x908 :case 0xa08 :case 0xb08 :case 0xc08 :case 0xd08 :case 0xe08 :case 0xf08 : -if (!(insn & (1 <<20 )) || ((insn >>22 ) &3 ) ==0 ) +if (!(insn & (1 <<20 )) || ((insn >>22 ) &3 ) ==0 ) {return 1 ; + } wrd = (insn >>12 ) &0xf ; rd0 = (insn >>16 ) &0xf ; rd1 = (insn >>0 ) &0xf ;gen_op_iwmmxt_movq_M0_wRn (rd0);switch ((insn >>22 ) &3 ) {case 1 : -if (insn & (1 <<21 )) +if (insn & (1 <<21 )) {gen_op_iwmmxt_packsw_M0_wRn (rd1); -else + }else {gen_op_iwmmxt_packuw_M0_wRn (rd1); + }break ;case 2 : -if (insn & (1 <<21 )) +if (insn & (1 <<21 )) {gen_op_iwmmxt_packsl_M0_wRn (rd1); -else + }else {gen_op_iwmmxt_packul_M0_wRn (rd1); + }break ;case 3 : -if (insn & (1 <<21 )) +if (insn & (1 <<21 )) {gen_op_iwmmxt_packsq_M0_wRn (rd1); -else + }else {gen_op_iwmmxt_packuq_M0_wRn (rd1); + }break ; }gen_op_iwmmxt_movq_wRn_M0 (wrd);
@@ -2424,8 +2470,9 @@ static int disas_iwmmxt_insn(DisasContext *s, uint32_t insn) wrd = (insn >>5 ) &0xf ; rd0 = (insn >>12 ) &0xf ; rd1 = (insn >>0 ) &0xf ; -if (rd0 ==0xf || rd1 ==0xf ) +if (rd0 ==0xf || rd1 ==0xf ) {return 1 ; + }gen_op_iwmmxt_movq_M0_wRn (wrd); tmp =load_reg (s, rd0); tmp2 =load_reg (s, rd1);
@@ -2437,10 +2484,12 @@ static int disas_iwmmxt_insn(DisasContext *s, uint32_t insn)gen_helper_iwmmxt_muladdsw (cpu_M0, cpu_M0, tmp, tmp2);break ;case 0xc :case 0xd :case 0xe :case 0xf :/* TMIAxy */ -if (insn & (1 <<16 )) +if (insn & (1 <<16 )) {tcg_gen_shri_i32 (tmp, tmp,16 ); -if (insn & (1 <<17 )) + } +if (insn & (1 <<17 )) {tcg_gen_shri_i32 (tmp2, tmp2,16 ); + }gen_helper_iwmmxt_muladdswl (cpu_M0, cpu_M0, tmp, tmp2);break ;default :
@@ -2456,8 +2505,10 @@ static int disas_iwmmxt_insn(DisasContext *s, uint32_t insn)return 0 ; } -/* Disassemble an XScale DSP instruction. Returns nonzero if an error occurred -(ie. an undefined instruction). */ +/* +* Disassemble an XScale DSP instruction. +* Returns nonzero if an error occurred (ie. an undefined instruction). +*/ static int disas_dsp_insn (DisasContext *s,uint32_t insn) {int acc, rd0, rd1, rdhi, rdlo;
@@ -2469,8 +2520,9 @@ static int disas_dsp_insn(DisasContext *s, uint32_t insn) rd1 = insn &0xf ; acc = (insn >>5 ) &7 ; -if (acc !=0 ) +if (acc !=0 ) {return 1 ; + } tmp =load_reg (s, rd0); tmp2 =load_reg (s, rd1);
@@ -2485,10 +2537,12 @@ static int disas_dsp_insn(DisasContext *s, uint32_t insn)case 0xd :/* MIABT */ case 0xe :/* MIATB */ case 0xf :/* MIATT */ -if (insn & (1 <<16 )) +if (insn & (1 <<16 )) {tcg_gen_shri_i32 (tmp, tmp,16 ); -if (insn & (1 <<17 )) + } +if (insn & (1 <<17 )) {tcg_gen_shri_i32 (tmp2, tmp2,16 ); + }gen_helper_iwmmxt_muladdswl (cpu_M0, cpu_M0, tmp, tmp2);break ;default :
@@ -2505,8 +2559,9 @@ static int disas_dsp_insn(DisasContext *s, uint32_t insn) rdlo = (insn >>12 ) &0xf ; acc = insn &7 ; -if (acc !=0 ) +if (acc !=0 ) {return 1 ; + }if (insn &ARM_CP_RW_BIT ) {/* MRA */ iwmmxt_load_reg (cpu_V0, acc);
Signature · 1 line
2.38.1
PATCH v3 5/34 target/arm/tcg: Expose some iwmmxt methods in 'translate.h'
In reply to Philippe Mathieu-DaudéExpose a few methods and variables before extracting iwmmxt code from translate.c.
--- target/arm/tcg/translate.h | 6 ++++++ target/arm/tcg/translate.c | 8 ++++---- 2 files changed, 10 insertions(+), 4 deletions(-)
target/arm/tcg/translate.h +6 -0
@@ -165,6 +165,7 @@ typedef struct DisasCompare { } DisasCompare;/* Share the TCG temporaries common between 32 and 64 bit modes. */ +extern TCGv_i32 cpu_R[16 ];extern TCGv_i32 cpu_NF, cpu_ZF, cpu_CF, cpu_VF;extern TCGv_i64 cpu_exclusive_addr;extern TCGv_i64 cpu_exclusive_val;
@@ -298,6 +299,11 @@ static inline int curr_insn_len(DisasContext *s)/* CPU state was modified dynamically; no need to exit, but do not chain. */ #define DISAS_UPDATE_NOCHAIN DISAS_TARGET_10 +/* These are TCG temporaries used only by the legacy iwMMXt decoder */ +extern TCGv_i64 cpu_V0, cpu_V1, cpu_M0; +int disas_iwmmxt_insn (DisasContext *s,uint32_t insn); +int disas_dsp_insn (DisasContext *s,uint32_t insn); +#ifdef TARGET_AARCH64 void a64_translate_init (void );void gen_a64_update_pc (DisasContext *s,target_long diff);
target/arm/tcg/translate.c +4 -4
@@ -45,9 +45,9 @@#define ENABLE_ARCH_8 arm_dc_feature(s, ARM_FEATURE_V8)/* These are TCG temporaries used only by the legacy iwMMXt decoder */ -static TCGv_i64 cpu_V0, cpu_V1, cpu_M0; +TCGv_i64 cpu_V0, cpu_V1, cpu_M0;/* These are TCG globals which alias CPUARMState fields */ -static TCGv_i32 cpu_R[16 ]; +TCGv_i32 cpu_R[16 ];TCGv_i32 cpu_CF, cpu_NF, cpu_VF, cpu_ZF;TCGv_i64 cpu_exclusive_addr;TCGv_i64 cpu_exclusive_val;
@@ -1490,7 +1490,7 @@ static inline int gen_iwmmxt_shift(uint32_t insn, uint32_t mask, TCGv_i32 dest)* Disassemble an iwMMXt instruction. * Returns nonzero if an error occurred (ie. an undefined instruction). */ -static int disas_iwmmxt_insn (DisasContext *s,uint32_t insn) +int disas_iwmmxt_insn (DisasContext *s,uint32_t insn) {int rd, wrd;int rdhi, rdlo, rd0, rd1, i;
@@ -2509,7 +2509,7 @@ static int disas_iwmmxt_insn(DisasContext *s, uint32_t insn)* Disassemble an XScale DSP instruction. * Returns nonzero if an error occurred (ie. an undefined instruction). */ -static int disas_dsp_insn (DisasContext *s,uint32_t insn) +int disas_dsp_insn (DisasContext *s,uint32_t insn) {int acc, rd0, rd1, rdhi, rdlo;TCGv_i32 tmp, tmp2;
Signature · 1 line
2.38.1
PATCH v3 6/34 target/arm/tcg: Extract iwmmxt code to translate-iwmmxt.c
In reply to Philippe Mathieu-DaudéExtract 1300 lines from the big enough translate.c.
--- target/arm/tcg/translate-iwmmxt.c | 1325 +++++++++++++++++++++++++++++ target/arm/tcg/translate.c | 1312 ---------------------------- target/arm/tcg/meson.build | 1 + 3 files changed, 1326 insertions(+), 1312 deletions(-) create mode 100644 target/arm/tcg/translate-iwmmxt.c
target/arm/tcg/translate-iwmmxt.c new file +1325 -0
@@ -0,0 +1,1325 @@ +/* +* XScale iwMMXt translation +* +* Copyright (c) 2007 OpenedHand, Ltd. +* Written by Andrzej Zaborowski <[email protected]> +* Copyright (c) 2008 CodeSourcery +* +* SPDX-License-Identifier: LGPL-2.1-or-later +*/ + +#include "qemu/osdep.h" +#include "translate.h" +#include "translate-a32.h" + +#define ARM_CP_RW_BIT (1 << 20) + +static inline void iwmmxt_load_reg (TCGv_i64 var,int reg) +{ + tcg_gen_ld_i64(var, cpu_env, offsetof(CPUARMState, iwmmxt.regs[reg])); +} + +static inline void iwmmxt_store_reg (TCGv_i64 var,int reg) +{ + tcg_gen_st_i64(var, cpu_env, offsetof(CPUARMState, iwmmxt.regs[reg])); +} + +static inline TCGv_i32 iwmmxt_load_creg (int reg) +{ +TCGv_i32 var =tcg_temp_new_i32 (); + tcg_gen_ld_i32(var, cpu_env, offsetof(CPUARMState, iwmmxt.cregs[reg])); +return var; +} + +static inline void iwmmxt_store_creg (int reg,TCGv_i32 var) +{ + tcg_gen_st_i32(var, cpu_env, offsetof(CPUARMState, iwmmxt.cregs[reg])); +} + +static inline void gen_op_iwmmxt_movq_wRn_M0 (int rn) +{ +iwmmxt_store_reg (cpu_M0, rn); +} + +static inline void gen_op_iwmmxt_movq_M0_wRn (int rn) +{ +iwmmxt_load_reg (cpu_M0, rn); +} + +static inline void gen_op_iwmmxt_orq_M0_wRn (int rn) +{ +iwmmxt_load_reg (cpu_V1, rn); +tcg_gen_or_i64 (cpu_M0, cpu_M0, cpu_V1); +} + +static inline void gen_op_iwmmxt_andq_M0_wRn (int rn) +{ +iwmmxt_load_reg (cpu_V1, rn); +tcg_gen_and_i64 (cpu_M0, cpu_M0, cpu_V1); +} + +static inline void gen_op_iwmmxt_xorq_M0_wRn (int rn) +{ +iwmmxt_load_reg (cpu_V1, rn); +tcg_gen_xor_i64 (cpu_M0, cpu_M0, cpu_V1); +} + +#define IWMMXT_OP (name) \ +static inline void gen_op_iwmmxt_##name##_M0_wRn(int rn) \ +{ \ + iwmmxt_load_reg(cpu_V1, rn); \ + gen_helper_iwmmxt_##name(cpu_M0, cpu_M0, cpu_V1); \ +} + +#define IWMMXT_OP_ENV (name) \ +static inline void gen_op_iwmmxt_##name##_M0_wRn(int rn) \ +{ \ + iwmmxt_load_reg(cpu_V1, rn); \ + gen_helper_iwmmxt_##name(cpu_M0, cpu_env, cpu_M0, cpu_V1); \ +} + +#define IWMMXT_OP_ENV_SIZE (name) \ +IWMMXT_OP_ENV(name##b) \ +IWMMXT_OP_ENV(name##w) \ +IWMMXT_OP_ENV(name##l) + +#define IWMMXT_OP_ENV1 (name) \ +static inline void gen_op_iwmmxt_##name##_M0(void) \ +{ \ + gen_helper_iwmmxt_##name(cpu_M0, cpu_env, cpu_M0); \ +} + +IWMMXT_OP (maddsq) +IWMMXT_OP (madduq ) +IWMMXT_OP (sadb) +IWMMXT_OP (sadw) +IWMMXT_OP (mulslw) +IWMMXT_OP (mulshw) +IWMMXT_OP (mululw) +IWMMXT_OP (muluhw) +IWMMXT_OP (macsw) +IWMMXT_OP (macuw) + +IWMMXT_OP_ENV_SIZE (unpackl) +IWMMXT_OP_ENV_SIZE (unpackh) + +IWMMXT_OP_ENV1 (unpacklub) +IWMMXT_OP_ENV1 (unpackluw) +IWMMXT_OP_ENV1 (unpacklul) +IWMMXT_OP_ENV1 (unpackhub) +IWMMXT_OP_ENV1 (unpackhuw) +IWMMXT_OP_ENV1 (unpackhul) +IWMMXT_OP_ENV1 (unpacklsb) +IWMMXT_OP_ENV1 (unpacklsw) +IWMMXT_OP_ENV1 (unpacklsl) +IWMMXT_OP_ENV1 (unpackhsb) +IWMMXT_OP_ENV1 (unpackhsw) +IWMMXT_OP_ENV1 (unpackhsl) + +IWMMXT_OP_ENV_SIZE (cmpeq) +IWMMXT_OP_ENV_SIZE (cmpgtu) +IWMMXT_OP_ENV_SIZE (cmpgts) + +IWMMXT_OP_ENV_SIZE (mins) +IWMMXT_OP_ENV_SIZE (minu) +IWMMXT_OP_ENV_SIZE (maxs) +IWMMXT_OP_ENV_SIZE (maxu) + +IWMMXT_OP_ENV_SIZE (subn) +IWMMXT_OP_ENV_SIZE (addn) +IWMMXT_OP_ENV_SIZE (subu) +IWMMXT_OP_ENV_SIZE (addu) +IWMMXT_OP_ENV_SIZE (subs) +IWMMXT_OP_ENV_SIZE (adds) + +IWMMXT_OP_ENV (avgb0) +IWMMXT_OP_ENV (avgb1) +IWMMXT_OP_ENV (avgw0) +IWMMXT_OP_ENV (avgw1) + +IWMMXT_OP_ENV (packuw) +IWMMXT_OP_ENV (packul) +IWMMXT_OP_ENV (packuq) +IWMMXT_OP_ENV (packsw) +IWMMXT_OP_ENV (packsl) +IWMMXT_OP_ENV (packsq) + +static voidgen_op_iwmmxt_set_mup (void) +{ +TCGv_i32 tmp; + tmp =load_cpu_field (iwmmxt.cregs[ARM_IWMMXT_wCon]); +tcg_gen_ori_i32 (tmp, tmp,2 ); +store_cpu_field (tmp, iwmmxt.cregs[ARM_IWMMXT_wCon]); +} + +static void gen_op_iwmmxt_set_cup (void ) +{ +TCGv_i32 tmp; + tmp =load_cpu_field (iwmmxt.cregs[ARM_IWMMXT_wCon]); +tcg_gen_ori_i32 (tmp, tmp,1 ); +store_cpu_field (tmp, iwmmxt.cregs[ARM_IWMMXT_wCon]); +} + +static void gen_op_iwmmxt_setpsr_nz (void ) +{ +TCGv_i32 tmp =tcg_temp_new_i32 (); +gen_helper_iwmmxt_setpsr_nz (tmp, cpu_M0); +store_cpu_field (tmp, iwmmxt.cregs[ARM_IWMMXT_wCASF]); +} + +static inline void gen_op_iwmmxt_addl_M0_wRn (int rn) +{ +iwmmxt_load_reg (cpu_V1, rn); +tcg_gen_ext32u_i64 (cpu_V1, cpu_V1); +tcg_gen_add_i64 (cpu_M0, cpu_M0, cpu_V1); +} + +static inline int gen_iwmmxt_address (DisasContext *s,uint32_t insn, +TCGv_i32 dest) +{ +int rd; +uint32_t offset; +TCGv_i32 tmp; + + rd = (insn >>16 ) &0xf ; + tmp =load_reg (s, rd); + + offset = (insn &0xff ) << ((insn >>7 ) &2 ); +if (insn & (1 <<24 )) { +/* Pre indexed */ +if (insn & (1 <<23 )) { +tcg_gen_addi_i32 (tmp, tmp, offset); + }else { +tcg_gen_addi_i32 (tmp, tmp, -offset); + } +tcg_gen_mov_i32 (dest, tmp); +if (insn & (1 <<21 )) { +store_reg (s, rd, tmp); + } + }else if (insn & (1 <<21 )) { +/* Post indexed */ +tcg_gen_mov_i32 (dest, tmp); +if (insn & (1 <<23 )) { +tcg_gen_addi_i32 (tmp, tmp, offset); + }else { +tcg_gen_addi_i32 (tmp, tmp, -offset); + } +store_reg (s, rd, tmp); + }else if (!(insn & (1 <<23 ))) { +return 1 ; + } +return 0 ; +} + +static inline int gen_iwmmxt_shift (uint32_t insn,uint32_t mask,TCGv_i32 dest) +{ +int rd = (insn >>0 ) &0xf ; +TCGv_i32 tmp; + +if (insn & (1 <<8 )) { +if (rd < ARM_IWMMXT_wCGR0 || rd > ARM_IWMMXT_wCGR3) { +return 1 ; + }else { + tmp =iwmmxt_load_creg (rd); + } + }else { + tmp =tcg_temp_new_i32 (); +iwmmxt_load_reg (cpu_V0, rd); +tcg_gen_extrl_i64_i32 (tmp, cpu_V0); + } +tcg_gen_andi_i32 (tmp, tmp, mask); +tcg_gen_mov_i32 (dest, tmp); +return 0 ; +} + +/* +* Disassemble an iwMMXt instruction. +* Returns nonzero if an error occurred (ie. an undefined instruction). +*/ +int disas_iwmmxt_insn (DisasContext *s,uint32_t insn) +{ +int rd, wrd; +int rdhi, rdlo, rd0, rd1, i; +TCGv_i32 addr; +TCGv_i32 tmp, tmp2, tmp3; + +if ((insn &0x0e000e00 ) ==0x0c000000 ) { +if ((insn &0x0fe00ff0 ) ==0x0c400000 ) { + wrd = insn &0xf ; + rdlo = (insn >>12 ) &0xf ; + rdhi = (insn >>16 ) &0xf ; +if (insn &ARM_CP_RW_BIT ) {/* TMRRC */ +iwmmxt_load_reg (cpu_V0, wrd); +tcg_gen_extrl_i64_i32 (cpu_R[rdlo], cpu_V0); +tcg_gen_extrh_i64_i32 (cpu_R[rdhi], cpu_V0); + }else {/* TMCRR */ +tcg_gen_concat_i32_i64 (cpu_V0, cpu_R[rdlo], cpu_R[rdhi]); +iwmmxt_store_reg (cpu_V0, wrd); +gen_op_iwmmxt_set_mup (); + } +return 0 ; + } + + wrd = (insn >>12 ) &0xf ; + addr =tcg_temp_new_i32 (); +if (gen_iwmmxt_address (s, insn, addr)) { +return 1 ; + } +if (insn &ARM_CP_RW_BIT ) { +if ((insn >>28 ) ==0xf ) {/* WLDRW wCx */ + tmp =tcg_temp_new_i32 (); +gen_aa32_ld32u (s, tmp, addr,get_mem_index (s)); +iwmmxt_store_creg (wrd, tmp); + }else { + i =1 ; +if (insn & (1 <<8 )) { +if (insn & (1 <<22 )) {/* WLDRD */ +gen_aa32_ld64 (s, cpu_M0, addr,get_mem_index (s)); + i =0 ; + }else {/* WLDRW wRd */ + tmp =tcg_temp_new_i32 (); +gen_aa32_ld32u (s, tmp, addr,get_mem_index (s)); + } + }else { + tmp =tcg_temp_new_i32 (); +if (insn & (1 <<22 )) {/* WLDRH */ +gen_aa32_ld16u (s, tmp, addr,get_mem_index (s)); + }else {/* WLDRB */ +gen_aa32_ld8u (s, tmp, addr,get_mem_index (s)); + } + } +if (i) { +tcg_gen_extu_i32_i64 (cpu_M0, tmp); + } +gen_op_iwmmxt_movq_wRn_M0 (wrd); + } + }else { +if ((insn >>28 ) ==0xf ) {/* WSTRW wCx */ + tmp =iwmmxt_load_creg (wrd); +gen_aa32_st32 (s, tmp, addr,get_mem_index (s)); + }else { +gen_op_iwmmxt_movq_M0_wRn (wrd); + tmp =tcg_temp_new_i32 (); +if (insn & (1 <<8 )) { +if (insn & (1 <<22 )) {/* WSTRD */ +gen_aa32_st64 (s, cpu_M0, addr,get_mem_index (s)); + }else {/* WSTRW wRd */ +tcg_gen_extrl_i64_i32 (tmp, cpu_M0); +gen_aa32_st32 (s, tmp, addr,get_mem_index (s)); + } + }else { +if (insn & (1 <<22 )) {/* WSTRH */ +tcg_gen_extrl_i64_i32 (tmp, cpu_M0); +gen_aa32_st16 (s, tmp, addr,get_mem_index (s)); + }else {/* WSTRB */ +tcg_gen_extrl_i64_i32 (tmp, cpu_M0); +gen_aa32_st8 (s, tmp, addr,get_mem_index (s)); + } + } + } + } +return 0 ; + } + +if ((insn &0x0f000000 ) !=0x0e000000 ) { +return 1 ; + } + +switch (((insn >>12 ) &0xf00 ) | ((insn >>4 ) &0xff )) { +case 0x000 :/* WOR */ + wrd = (insn >>12 ) &0xf ; + rd0 = (insn >>0 ) &0xf ; + rd1 = (insn >>16 ) &0xf ; +gen_op_iwmmxt_movq_M0_wRn (rd0); +gen_op_iwmmxt_orq_M0_wRn (rd1); +gen_op_iwmmxt_setpsr_nz (); +gen_op_iwmmxt_movq_wRn_M0 (wrd); +gen_op_iwmmxt_set_mup (); +gen_op_iwmmxt_set_cup (); +break ; +case 0x011 :/* TMCR */ +if (insn &0xf ) { +return 1 ; + } + rd = (insn >>12 ) &0xf ; + wrd = (insn >>16 ) &0xf ; +switch (wrd) { +case ARM_IWMMXT_wCID: +case ARM_IWMMXT_wCASF: +break ; +case ARM_IWMMXT_wCon: +gen_op_iwmmxt_set_cup (); +/* Fall through. */ +case ARM_IWMMXT_wCSSF: + tmp =iwmmxt_load_creg (wrd); + tmp2 =load_reg (s, rd); +tcg_gen_andc_i32 (tmp, tmp, tmp2); +iwmmxt_store_creg (wrd, tmp); +break ; +case ARM_IWMMXT_wCGR0: +case ARM_IWMMXT_wCGR1: +case ARM_IWMMXT_wCGR2: +case ARM_IWMMXT_wCGR3: +gen_op_iwmmxt_set_cup (); + tmp =load_reg (s, rd); +iwmmxt_store_creg (wrd, tmp); +break ; +default : +return 1 ; + } +break ; +case 0x100 :/* WXOR */ + wrd = (insn >>12 ) &0xf ; + rd0 = (insn >>0 ) &0xf ; + rd1 = (insn >>16 ) &0xf ; +gen_op_iwmmxt_movq_M0_wRn (rd0); +gen_op_iwmmxt_xorq_M0_wRn (rd1); +gen_op_iwmmxt_setpsr_nz (); +gen_op_iwmmxt_movq_wRn_M0 (wrd); +gen_op_iwmmxt_set_mup (); +gen_op_iwmmxt_set_cup (); +break ; +case 0x111 :/* TMRC */ +if (insn &0xf ) { +return 1 ; + } + rd = (insn >>12 ) &0xf ; + wrd = (insn >>16 ) &0xf ; + tmp =iwmmxt_load_creg (wrd); +store_reg (s, rd, tmp); +break ; +case 0x300 :/* WANDN */ + wrd = (insn >>12 ) &0xf ; + rd0 = (insn >>0 ) &0xf ; + rd1 = (insn >>16 ) &0xf ; +gen_op_iwmmxt_movq_M0_wRn (rd0); +tcg_gen_neg_i64 (cpu_M0, cpu_M0); +gen_op_iwmmxt_andq_M0_wRn (rd1); +gen_op_iwmmxt_setpsr_nz (); +gen_op_iwmmxt_movq_wRn_M0 (wrd); +gen_op_iwmmxt_set_mup (); +gen_op_iwmmxt_set_cup (); +break ; +case 0x200 :/* WAND */ + wrd = (insn >>12 ) &0xf ; + rd0 = (insn >>0 ) &0xf ; + rd1 = (insn >>16 ) &0xf ; +gen_op_iwmmxt_movq_M0_wRn (rd0); +gen_op_iwmmxt_andq_M0_wRn (rd1); +gen_op_iwmmxt_setpsr_nz (); +gen_op_iwmmxt_movq_wRn_M0 (wrd); +gen_op_iwmmxt_set_mup (); +gen_op_iwmmxt_set_cup (); +break ; +case 0x810 :case 0xa10 :/* WMADD */ + wrd = (insn >>12 ) &0xf ; + rd0 = (insn >>0 ) &0xf ; + rd1 = (insn >>16 ) &0xf ; +gen_op_iwmmxt_movq_M0_wRn (rd0); +if (insn & (1 <<21 )) { +gen_op_iwmmxt_maddsq_M0_wRn (rd1); + }else { +gen_op_iwmmxt_madduq_M0_wRn (rd1); + } +gen_op_iwmmxt_movq_wRn_M0 (wrd); +gen_op_iwmmxt_set_mup (); +break ; +case 0x10e :case 0x50e :case 0x90e :case 0xd0e :/* WUNPCKIL */ + wrd = (insn >>12 ) &0xf ; + rd0 = (insn >>16 ) &0xf ; + rd1 = (insn >>0 ) &0xf ; +gen_op_iwmmxt_movq_M0_wRn (rd0); +switch ((insn >>22 ) &3 ) { +case 0 : +gen_op_iwmmxt_unpacklb_M0_wRn (rd1); +break ; +case 1 : +gen_op_iwmmxt_unpacklw_M0_wRn (rd1); +break ; +case 2 : +gen_op_iwmmxt_unpackll_M0_wRn (rd1); +break ; +case 3 : +return 1 ; + } +gen_op_iwmmxt_movq_wRn_M0 (wrd); +gen_op_iwmmxt_set_mup (); +gen_op_iwmmxt_set_cup (); +break ; +case 0x10c :case 0x50c :case 0x90c :case 0xd0c :/* WUNPCKIH */ + wrd = (insn >>12 ) &0xf ; + rd0 = (insn >>16 ) &0xf ; + rd1 = (insn >>0 ) &0xf ; +gen_op_iwmmxt_movq_M0_wRn (rd0); +switch ((insn >>22 ) &3 ) { +case 0 : +gen_op_iwmmxt_unpackhb_M0_wRn (rd1); +break ; +case 1 : +gen_op_iwmmxt_unpackhw_M0_wRn (rd1); +break ; +case 2 : +gen_op_iwmmxt_unpackhl_M0_wRn (rd1); +break ; +case 3 : +return 1 ; + } +gen_op_iwmmxt_movq_wRn_M0 (wrd); +gen_op_iwmmxt_set_mup (); +gen_op_iwmmxt_set_cup (); +break ; +case 0x012 :case 0x112 :case 0x412 :case 0x512 :/* WSAD */ + wrd = (insn >>12 ) &0xf ; + rd0 = (insn >>16 ) &0xf ; + rd1 = (insn >>0 ) &0xf ; +gen_op_iwmmxt_movq_M0_wRn (rd0); +if (insn & (1 <<22 )) { +gen_op_iwmmxt_sadw_M0_wRn (rd1); + }else { +gen_op_iwmmxt_sadb_M0_wRn (rd1); + } +if (!(insn & (1 <<20 ))) { +gen_op_iwmmxt_addl_M0_wRn (wrd); + } +gen_op_iwmmxt_movq_wRn_M0 (wrd); +gen_op_iwmmxt_set_mup (); +break ; +case 0x010 :case 0x110 :case 0x210 :case 0x310 :/* WMUL */ + wrd = (insn >>12 ) &0xf ; + rd0 = (insn >>16 ) &0xf ; + rd1 = (insn >>0 ) &0xf ; +gen_op_iwmmxt_movq_M0_wRn (rd0); +if (insn & (1 <<21 )) { +if (insn & (1 <<20 )) { +gen_op_iwmmxt_mulshw_M0_wRn (rd1); + }else { +gen_op_iwmmxt_mulslw_M0_wRn (rd1); + } + }else { +if (insn & (1 <<20 )) { +gen_op_iwmmxt_muluhw_M0_wRn (rd1); + }else { +gen_op_iwmmxt_mululw_M0_wRn (rd1); + } + } +gen_op_iwmmxt_movq_wRn_M0 (wrd); +gen_op_iwmmxt_set_mup (); +break ; +case 0x410 :case 0x510 :case 0x610 :case 0x710 :/* WMAC */ + wrd = (insn >>12 ) &0xf ; + rd0 = (insn >>16 ) &0xf ; + rd1 = (insn >>0 ) &0xf ; +gen_op_iwmmxt_movq_M0_wRn (rd0); +if (insn & (1 <<21 )) { +gen_op_iwmmxt_macsw_M0_wRn (rd1); + }else { +gen_op_iwmmxt_macuw_M0_wRn (rd1); + } +if (!(insn & (1 <<20 ))) { +iwmmxt_load_reg (cpu_V1, wrd); +tcg_gen_add_i64 (cpu_M0, cpu_M0, cpu_V1); + } +gen_op_iwmmxt_movq_wRn_M0 (wrd); +gen_op_iwmmxt_set_mup (); +break ; +case 0x006 :case 0x406 :case 0x806 :case 0xc06 :/* WCMPEQ */ + wrd = (insn >>12 ) &0xf ; + rd0 = (insn >>16 ) &0xf ; + rd1 = (insn >>0 ) &0xf ; +gen_op_iwmmxt_movq_M0_wRn (rd0); +switch ((insn >>22 ) &3 ) { +case 0 : +gen_op_iwmmxt_cmpeqb_M0_wRn (rd1); +break ; +case 1 : +gen_op_iwmmxt_cmpeqw_M0_wRn (rd1); +break ; +case 2 : +gen_op_iwmmxt_cmpeql_M0_wRn (rd1); +break ; +case 3 : +return 1 ; + } +gen_op_iwmmxt_movq_wRn_M0 (wrd); +gen_op_iwmmxt_set_mup (); +gen_op_iwmmxt_set_cup (); +break ; +case 0x800 :case 0x900 :case 0xc00 :case 0xd00 :/* WAVG2 */ + wrd = (insn >>12 ) &0xf ; + rd0 = (insn >>16 ) &0xf ; + rd1 = (insn >>0 ) &0xf ; +gen_op_iwmmxt_movq_M0_wRn (rd0); +if (insn & (1 <<22 )) { +if (insn & (1 <<20 )) { +gen_op_iwmmxt_avgw1_M0_wRn (rd1); + }else { +gen_op_iwmmxt_avgw0_M0_wRn (rd1); + } + }else { +if (insn & (1 <<20 )) { +gen_op_iwmmxt_avgb1_M0_wRn (rd1); + }else { +gen_op_iwmmxt_avgb0_M0_wRn (rd1); + } + } +gen_op_iwmmxt_movq_wRn_M0 (wrd); +gen_op_iwmmxt_set_mup (); +gen_op_iwmmxt_set_cup (); +break ; +case 0x802 :case 0x902 :case 0xa02 :case 0xb02 :/* WALIGNR */ + wrd = (insn >>12 ) &0xf ; + rd0 = (insn >>16 ) &0xf ; + rd1 = (insn >>0 ) &0xf ; +gen_op_iwmmxt_movq_M0_wRn (rd0); + tmp =iwmmxt_load_creg (ARM_IWMMXT_wCGR0 + ((insn >>20 ) &3 )); +tcg_gen_andi_i32 (tmp, tmp,7 ); +iwmmxt_load_reg (cpu_V1, rd1); +gen_helper_iwmmxt_align (cpu_M0, cpu_M0, cpu_V1, tmp); +gen_op_iwmmxt_movq_wRn_M0 (wrd); +gen_op_iwmmxt_set_mup (); +break ; +case 0x601 :case 0x605 :case 0x609 :case 0x60d :/* TINSR */ +if (((insn >>6 ) &3 ) ==3 ) { +return 1 ; + } + rd = (insn >>12 ) &0xf ; + wrd = (insn >>16 ) &0xf ; + tmp =load_reg (s, rd); +gen_op_iwmmxt_movq_M0_wRn (wrd); +switch ((insn >>6 ) &3 ) { +case 0 : + tmp2 =tcg_constant_i32 (0xff ); + tmp3 =tcg_constant_i32 ((insn &7 ) <<3 ); +break ; +case 1 : + tmp2 =tcg_constant_i32 (0xffff ); + tmp3 =tcg_constant_i32 ((insn &3 ) <<4 ); +break ; +case 2 : + tmp2 =tcg_constant_i32 (0xffffffff ); + tmp3 =tcg_constant_i32 ((insn &1 ) <<5 ); +break ; +default : +g_assert_not_reached (); + } +gen_helper_iwmmxt_insr (cpu_M0, cpu_M0, tmp, tmp2, tmp3); +gen_op_iwmmxt_movq_wRn_M0 (wrd); +gen_op_iwmmxt_set_mup (); +break ; +case 0x107 :case 0x507 :case 0x907 :case 0xd07 :/* TEXTRM */ + rd = (insn >>12 ) &0xf ; + wrd = (insn >>16 ) &0xf ; +if (rd ==15 || ((insn >>22 ) &3 ) ==3 ) { +return 1 ; + } +gen_op_iwmmxt_movq_M0_wRn (wrd); + tmp =tcg_temp_new_i32 (); +switch ((insn >>22 ) &3 ) { +case 0 : +tcg_gen_shri_i64 (cpu_M0, cpu_M0, (insn &7 ) <<3 ); +tcg_gen_extrl_i64_i32 (tmp, cpu_M0); +if (insn &8 ) { +tcg_gen_ext8s_i32 (tmp, tmp); + }else { +tcg_gen_andi_i32 (tmp, tmp,0xff ); + } +break ; +case 1 : +tcg_gen_shri_i64 (cpu_M0, cpu_M0, (insn &3 ) <<4 ); +tcg_gen_extrl_i64_i32 (tmp, cpu_M0); +if (insn &8 ) { +tcg_gen_ext16s_i32 (tmp, tmp); + }else { +tcg_gen_andi_i32 (tmp, tmp,0xffff ); + } +break ; +case 2 : +tcg_gen_shri_i64 (cpu_M0, cpu_M0, (insn &1 ) <<5 ); +tcg_gen_extrl_i64_i32 (tmp, cpu_M0); +break ; + } +store_reg (s, rd, tmp); +break ; +case 0x117 :case 0x517 :case 0x917 :case 0xd17 :/* TEXTRC */ +if ((insn &0x000ff008 ) !=0x0003f000 || ((insn >>22 ) &3 ) ==3 ) { +return 1 ; + } + tmp =iwmmxt_load_creg (ARM_IWMMXT_wCASF); +switch ((insn >>22 ) &3 ) { +case 0 : +tcg_gen_shri_i32 (tmp, tmp, ((insn &7 ) <<2 ) +0 ); +break ; +case 1 : +tcg_gen_shri_i32 (tmp, tmp, ((insn &3 ) <<3 ) +4 ); +break ; +case 2 : +tcg_gen_shri_i32 (tmp, tmp, ((insn &1 ) <<4 ) +12 ); +break ; + } +tcg_gen_shli_i32 (tmp, tmp,28 ); +gen_set_nzcv (tmp); +break ; +case 0x401 :case 0x405 :case 0x409 :case 0x40d :/* TBCST */ +if (((insn >>6 ) &3 ) ==3 ) { +return 1 ; + } + rd = (insn >>12 ) &0xf ; + wrd = (insn >>16 ) &0xf ; + tmp =load_reg (s, rd); +switch ((insn >>6 ) &3 ) { +case 0 : +gen_helper_iwmmxt_bcstb (cpu_M0, tmp); +break ; +case 1 : +gen_helper_iwmmxt_bcstw (cpu_M0, tmp); +break ; +case 2 : +gen_helper_iwmmxt_bcstl (cpu_M0, tmp); +break ; + } +gen_op_iwmmxt_movq_wRn_M0 (wrd); +gen_op_iwmmxt_set_mup (); +break ; +case 0x113 :case 0x513 :case 0x913 :case 0xd13 :/* TANDC */ +if ((insn &0x000ff00f ) !=0x0003f000 || ((insn >>22 ) &3 ) ==3 ) { +return 1 ; + } + tmp =iwmmxt_load_creg (ARM_IWMMXT_wCASF); + tmp2 =tcg_temp_new_i32 (); +tcg_gen_mov_i32 (tmp2, tmp); +switch ((insn >>22 ) &3 ) { +case 0 : +for (i =0 ; i <7 ; i++) { +tcg_gen_shli_i32 (tmp2, tmp2,4 ); +tcg_gen_and_i32 (tmp, tmp, tmp2); + } +break ; +case 1 : +for (i =0 ; i <3 ; i++) { +tcg_gen_shli_i32 (tmp2, tmp2,8 ); +tcg_gen_and_i32 (tmp, tmp, tmp2); + } +break ; +case 2 : +tcg_gen_shli_i32 (tmp2, tmp2,16 ); +tcg_gen_and_i32 (tmp, tmp, tmp2); +break ; + } +gen_set_nzcv (tmp); +break ; +case 0x01c :case 0x41c :case 0x81c :case 0xc1c :/* WACC */ + wrd = (insn >>12 ) &0xf ; + rd0 = (insn >>16 ) &0xf ; +gen_op_iwmmxt_movq_M0_wRn (rd0); +switch ((insn >>22 ) &3 ) { +case 0 : +gen_helper_iwmmxt_addcb (cpu_M0, cpu_M0); +break ; +case 1 : +gen_helper_iwmmxt_addcw (cpu_M0, cpu_M0); +break ; +case 2 : +gen_helper_iwmmxt_addcl (cpu_M0, cpu_M0); +break ; +case 3 : +return 1 ; + } +gen_op_iwmmxt_movq_wRn_M0 (wrd); +gen_op_iwmmxt_set_mup (); +break ; +case 0x115 :case 0x515 :case 0x915 :case 0xd15 :/* TORC */ +if ((insn &0x000ff00f ) !=0x0003f000 || ((insn >>22 ) &3 ) ==3 ) { +return 1 ; + } + tmp =iwmmxt_load_creg (ARM_IWMMXT_wCASF); + tmp2 =tcg_temp_new_i32 (); +tcg_gen_mov_i32 (tmp2, tmp); +switch ((insn >>22 ) &3 ) { +case 0 : +for (i =0 ; i <7 ; i++) { +tcg_gen_shli_i32 (tmp2, tmp2,4 ); +tcg_gen_or_i32 (tmp, tmp, tmp2); + } +break ; +case 1 : +for (i =0 ; i <3 ; i++) { +tcg_gen_shli_i32 (tmp2, tmp2,8 ); +tcg_gen_or_i32 (tmp, tmp, tmp2); + } +break ; +case 2 : +tcg_gen_shli_i32 (tmp2, tmp2,16 ); +tcg_gen_or_i32 (tmp, tmp, tmp2); +break ; + } +gen_set_nzcv (tmp); +break ; +case 0x103 :case 0x503 :case 0x903 :case 0xd03 :/* TMOVMSK */ + rd = (insn >>12 ) &0xf ; + rd0 = (insn >>16 ) &0xf ; +if ((insn &0xf ) !=0 || ((insn >>22 ) &3 ) ==3 ) { +return 1 ; + } +gen_op_iwmmxt_movq_M0_wRn (rd0); + tmp =tcg_temp_new_i32 (); +switch ((insn >>22 ) &3 ) { +case 0 : +gen_helper_iwmmxt_msbb (tmp, cpu_M0); +break ; +case 1 : +gen_helper_iwmmxt_msbw (tmp, cpu_M0); +break ; +case 2 : +gen_helper_iwmmxt_msbl (tmp, cpu_M0); +break ; + } +store_reg (s, rd, tmp); +break ; +case 0x106 :case 0x306 :case 0x506 :case 0x706 :/* WCMPGT */ +case 0x906 :case 0xb06 :case 0xd06 :case 0xf06 : + wrd = (insn >>12 ) &0xf ; + rd0 = (insn >>16 ) &0xf ; + rd1 = (insn >>0 ) &0xf ; +gen_op_iwmmxt_movq_M0_wRn (rd0); +switch ((insn >>22 ) &3 ) { +case 0 : +if (insn & (1 <<21 )) { +gen_op_iwmmxt_cmpgtsb_M0_wRn (rd1); + }else { +gen_op_iwmmxt_cmpgtub_M0_wRn (rd1); + } +break ; +case 1 : +if (insn & (1 <<21 )) { +gen_op_iwmmxt_cmpgtsw_M0_wRn (rd1); + }else { +gen_op_iwmmxt_cmpgtuw_M0_wRn (rd1); + } +break ; +case 2 : +if (insn & (1 <<21 )) { +gen_op_iwmmxt_cmpgtsl_M0_wRn (rd1); + }else { +gen_op_iwmmxt_cmpgtul_M0_wRn (rd1); + } +break ; +case 3 : +return 1 ; + } +gen_op_iwmmxt_movq_wRn_M0 (wrd); +gen_op_iwmmxt_set_mup (); +gen_op_iwmmxt_set_cup (); +break ; +case 0x00e :case 0x20e :case 0x40e :case 0x60e :/* WUNPCKEL */ +case 0x80e :case 0xa0e :case 0xc0e :case 0xe0e : + wrd = (insn >>12 ) &0xf ; + rd0 = (insn >>16 ) &0xf ; +gen_op_iwmmxt_movq_M0_wRn (rd0); +switch ((insn >>22 ) &3 ) { +case 0 : +if (insn & (1 <<21 )) { +gen_op_iwmmxt_unpacklsb_M0 (); + }else { +gen_op_iwmmxt_unpacklub_M0 (); + } +break ; +case 1 : +if (insn & (1 <<21 )) { +gen_op_iwmmxt_unpacklsw_M0 (); + }else { +gen_op_iwmmxt_unpackluw_M0 (); + } +break ; +case 2 : +if (insn & (1 <<21 )) { +gen_op_iwmmxt_unpacklsl_M0 (); + }else { +gen_op_iwmmxt_unpacklul_M0 (); + } +break ; +case 3 : +return 1 ; + } +gen_op_iwmmxt_movq_wRn_M0 (wrd); +gen_op_iwmmxt_set_mup (); +gen_op_iwmmxt_set_cup (); +break ; +case 0x00c :case 0x20c :case 0x40c :case 0x60c :/* WUNPCKEH */ +case 0x80c :case 0xa0c :case 0xc0c :case 0xe0c : + wrd = (insn >>12 ) &0xf ; + rd0 = (insn >>16 ) &0xf ; +gen_op_iwmmxt_movq_M0_wRn (rd0); +switch ((insn >>22 ) &3 ) { +case 0 : +if (insn & (1 <<21 )) { +gen_op_iwmmxt_unpackhsb_M0 (); + }else { +gen_op_iwmmxt_unpackhub_M0 (); + } +break ; +case 1 : +if (insn & (1 <<21 )) { +gen_op_iwmmxt_unpackhsw_M0 (); + }else { +gen_op_iwmmxt_unpackhuw_M0 (); + } +break ; +case 2 : +if (insn & (1 <<21 )) { +gen_op_iwmmxt_unpackhsl_M0 (); + }else { +gen_op_iwmmxt_unpackhul_M0 (); + } +break ; +case 3 : +return 1 ; + } +gen_op_iwmmxt_movq_wRn_M0 (wrd); +gen_op_iwmmxt_set_mup (); +gen_op_iwmmxt_set_cup (); +break ; +case 0x204 :case 0x604 :case 0xa04 :case 0xe04 :/* WSRL */ +case 0x214 :case 0x614 :case 0xa14 :case 0xe14 : +if (((insn >>22 ) &3 ) ==0 ) { +return 1 ; + } + wrd = (insn >>12 ) &0xf ; + rd0 = (insn >>16 ) &0xf ; +gen_op_iwmmxt_movq_M0_wRn (rd0); + tmp =tcg_temp_new_i32 (); +if (gen_iwmmxt_shift (insn,0xff , tmp)) { +return 1 ; + } +switch ((insn >>22 ) &3 ) { +case 1 : +gen_helper_iwmmxt_srlw (cpu_M0, cpu_env, cpu_M0, tmp); +break ; +case 2 : +gen_helper_iwmmxt_srll (cpu_M0, cpu_env, cpu_M0, tmp); +break ; +case 3 : +gen_helper_iwmmxt_srlq (cpu_M0, cpu_env, cpu_M0, tmp); +break ; + } +gen_op_iwmmxt_movq_wRn_M0 (wrd); +gen_op_iwmmxt_set_mup (); +gen_op_iwmmxt_set_cup (); +break ; +case 0x004 :case 0x404 :case 0x804 :case 0xc04 :/* WSRA */ +case 0x014 :case 0x414 :case 0x814 :case 0xc14 : +if (((insn >>22 ) &3 ) ==0 ) { +return 1 ; + } + wrd = (insn >>12 ) &0xf ; + rd0 = (insn >>16 ) &0xf ; +gen_op_iwmmxt_movq_M0_wRn (rd0); + tmp =tcg_temp_new_i32 (); +if (gen_iwmmxt_shift (insn,0xff , tmp)) { +return 1 ; + } +switch ((insn >>22 ) &3 ) { +case 1 : +gen_helper_iwmmxt_sraw (cpu_M0, cpu_env, cpu_M0, tmp); +break ; +case 2 : +gen_helper_iwmmxt_sral (cpu_M0, cpu_env, cpu_M0, tmp); +break ; +case 3 : +gen_helper_iwmmxt_sraq (cpu_M0, cpu_env, cpu_M0, tmp); +break ; + } +gen_op_iwmmxt_movq_wRn_M0 (wrd); +gen_op_iwmmxt_set_mup (); +gen_op_iwmmxt_set_cup (); +break ; +case 0x104 :case 0x504 :case 0x904 :case 0xd04 :/* WSLL */ +case 0x114 :case 0x514 :case 0x914 :case 0xd14 : +if (((insn >>22 ) &3 ) ==0 ) { +return 1 ; + } + wrd = (insn >>12 ) &0xf ; + rd0 = (insn >>16 ) &0xf ; +gen_op_iwmmxt_movq_M0_wRn (rd0); + tmp =tcg_temp_new_i32 (); +if (gen_iwmmxt_shift (insn,0xff , tmp)) { +return 1 ; + } +switch ((insn >>22 ) &3 ) { +case 1 : +gen_helper_iwmmxt_sllw (cpu_M0, cpu_env, cpu_M0, tmp); +break ; +case 2 : +gen_helper_iwmmxt_slll (cpu_M0, cpu_env, cpu_M0, tmp); +break ; +case 3 : +gen_helper_iwmmxt_sllq (cpu_M0, cpu_env, cpu_M0, tmp); +break ; + } +gen_op_iwmmxt_movq_wRn_M0 (wrd); +gen_op_iwmmxt_set_mup (); +gen_op_iwmmxt_set_cup (); +break ; +case 0x304 :case 0x704 :case 0xb04 :case 0xf04 :/* WROR */ +case 0x314 :case 0x714 :case 0xb14 :case 0xf14 : +if (((insn >>22 ) &3 ) ==0 ) { +return 1 ; + } + wrd = (insn >>12 ) &0xf ; + rd0 = (insn >>16 ) &0xf ; +gen_op_iwmmxt_movq_M0_wRn (rd0); + tmp =tcg_temp_new_i32 (); +switch ((insn >>22 ) &3 ) { +case 1 : +if (gen_iwmmxt_shift (insn,0xf , tmp)) { +return 1 ; + } +gen_helper_iwmmxt_rorw (cpu_M0, cpu_env, cpu_M0, tmp); +break ; +case 2 : +if (gen_iwmmxt_shift (insn,0x1f , tmp)) { +return 1 ; + } +gen_helper_iwmmxt_rorl (cpu_M0, cpu_env, cpu_M0, tmp); +break ; +case 3 : +if (gen_iwmmxt_shift (insn,0x3f , tmp)) { +return 1 ; + } +gen_helper_iwmmxt_rorq (cpu_M0, cpu_env, cpu_M0, tmp); +break ; + } +gen_op_iwmmxt_movq_wRn_M0 (wrd); +gen_op_iwmmxt_set_mup (); +gen_op_iwmmxt_set_cup (); +break ; +case 0x116 :case 0x316 :case 0x516 :case 0x716 :/* WMIN */ +case 0x916 :case 0xb16 :case 0xd16 :case 0xf16 : + wrd = (insn >>12 ) &0xf ; + rd0 = (insn >>16 ) &0xf ; + rd1 = (insn >>0 ) &0xf ; +gen_op_iwmmxt_movq_M0_wRn (rd0); +switch ((insn >>22 ) &3 ) { +case 0 : +if (insn & (1 <<21 )) { +gen_op_iwmmxt_minsb_M0_wRn (rd1); + }else { +gen_op_iwmmxt_minub_M0_wRn (rd1); + } +break ; +case 1 : +if (insn & (1 <<21 )) { +gen_op_iwmmxt_minsw_M0_wRn (rd1); + }else { +gen_op_iwmmxt_minuw_M0_wRn (rd1); + } +break ; +case 2 : +if (insn & (1 <<21 )) { +gen_op_iwmmxt_minsl_M0_wRn (rd1); + }else { +gen_op_iwmmxt_minul_M0_wRn (rd1); + } +break ; +case 3 : +return 1 ; + } +gen_op_iwmmxt_movq_wRn_M0 (wrd); +gen_op_iwmmxt_set_mup (); +break ; +case 0x016 :case 0x216 :case 0x416 :case 0x616 :/* WMAX */ +case 0x816 :case 0xa16 :case 0xc16 :case 0xe16 : + wrd = (insn >>12 ) &0xf ; + rd0 = (insn >>16 ) &0xf ; + rd1 = (insn >>0 ) &0xf ; +gen_op_iwmmxt_movq_M0_wRn (rd0); +switch ((insn >>22 ) &3 ) { +case 0 : +if (insn & (1 <<21 )) { +gen_op_iwmmxt_maxsb_M0_wRn (rd1); + }else { +gen_op_iwmmxt_maxub_M0_wRn (rd1); + } +break ; +case 1 : +if (insn & (1 <<21 )) { +gen_op_iwmmxt_maxsw_M0_wRn (rd1); + }else { +gen_op_iwmmxt_maxuw_M0_wRn (rd1); + } +break ; +case 2 : +if (insn & (1 <<21 )) { +gen_op_iwmmxt_maxsl_M0_wRn (rd1); + }else { +gen_op_iwmmxt_maxul_M0_wRn (rd1); + } +break ; +case 3 : +return 1 ; + } +gen_op_iwmmxt_movq_wRn_M0 (wrd); +gen_op_iwmmxt_set_mup (); +break ; +case 0x002 :case 0x102 :case 0x202 :case 0x302 :/* WALIGNI */ +case 0x402 :case 0x502 :case 0x602 :case 0x702 : + wrd = (insn >>12 ) &0xf ; + rd0 = (insn >>16 ) &0xf ; + rd1 = (insn >>0 ) &0xf ; +gen_op_iwmmxt_movq_M0_wRn (rd0); +iwmmxt_load_reg (cpu_V1, rd1); +gen_helper_iwmmxt_align (cpu_M0, cpu_M0, cpu_V1, +tcg_constant_i32 ((insn >>20 ) &3 )); +gen_op_iwmmxt_movq_wRn_M0 (wrd); +gen_op_iwmmxt_set_mup (); +break ; +case 0x01a :case 0x11a :case 0x21a :case 0x31a :/* WSUB */ +case 0x41a :case 0x51a :case 0x61a :case 0x71a : +case 0x81a :case 0x91a :case 0xa1a :case 0xb1a : +case 0xc1a :case 0xd1a :case 0xe1a :case 0xf1a : + wrd = (insn >>12 ) &0xf ; + rd0 = (insn >>16 ) &0xf ; + rd1 = (insn >>0 ) &0xf ; +gen_op_iwmmxt_movq_M0_wRn (rd0); +switch ((insn >>20 ) &0xf ) { +case 0x0 : +gen_op_iwmmxt_subnb_M0_wRn (rd1); +break ; +case 0x1 : +gen_op_iwmmxt_subub_M0_wRn (rd1); +break ; +case 0x3 : +gen_op_iwmmxt_subsb_M0_wRn (rd1); +break ; +case 0x4 : +gen_op_iwmmxt_subnw_M0_wRn (rd1); +break ; +case 0x5 : +gen_op_iwmmxt_subuw_M0_wRn (rd1); +break ; +case 0x7 : +gen_op_iwmmxt_subsw_M0_wRn (rd1); +break ; +case 0x8 : +gen_op_iwmmxt_subnl_M0_wRn (rd1); +break ; +case 0x9 : +gen_op_iwmmxt_subul_M0_wRn (rd1); +break ; +case 0xb : +gen_op_iwmmxt_subsl_M0_wRn (rd1); +break ; +default : +return 1 ; + } +gen_op_iwmmxt_movq_wRn_M0 (wrd); +gen_op_iwmmxt_set_mup (); +gen_op_iwmmxt_set_cup (); +break ; +case 0x01e :case 0x11e :case 0x21e :case 0x31e :/* WSHUFH */ +case 0x41e :case 0x51e :case 0x61e :case 0x71e : +case 0x81e :case 0x91e :case 0xa1e :case 0xb1e : +case 0xc1e :case 0xd1e :case 0xe1e :case 0xf1e : + wrd = (insn >>12 ) &0xf ; + rd0 = (insn >>16 ) &0xf ; +gen_op_iwmmxt_movq_M0_wRn (rd0); + tmp =tcg_constant_i32 (((insn >>16 ) &0xf0 ) | (insn &0x0f )); +gen_helper_iwmmxt_shufh (cpu_M0, cpu_env, cpu_M0, tmp); +gen_op_iwmmxt_movq_wRn_M0 (wrd); +gen_op_iwmmxt_set_mup (); +gen_op_iwmmxt_set_cup (); +break ; +case 0x018 :case 0x118 :case 0x218 :case 0x318 :/* WADD */ +case 0x418 :case 0x518 :case 0x618 :case 0x718 : +case 0x818 :case 0x918 :case 0xa18 :case 0xb18 : +case 0xc18 :case 0xd18 :case 0xe18 :case 0xf18 : + wrd = (insn >>12 ) &0xf ; + rd0 = (insn >>16 ) &0xf ; + rd1 = (insn >>0 ) &0xf ; +gen_op_iwmmxt_movq_M0_wRn (rd0); +switch ((insn >>20 ) &0xf ) { +case 0x0 : +gen_op_iwmmxt_addnb_M0_wRn (rd1); +break ; +case 0x1 : +gen_op_iwmmxt_addub_M0_wRn (rd1); +break ; +case 0x3 : +gen_op_iwmmxt_addsb_M0_wRn (rd1); +break ; +case 0x4 : +gen_op_iwmmxt_addnw_M0_wRn (rd1); +break ; +case 0x5 : +gen_op_iwmmxt_adduw_M0_wRn (rd1); +break ; +case 0x7 : +gen_op_iwmmxt_addsw_M0_wRn (rd1); +break ; +case 0x8 : +gen_op_iwmmxt_addnl_M0_wRn (rd1); +break ; +case 0x9 : +gen_op_iwmmxt_addul_M0_wRn (rd1); +break ; +case 0xb : +gen_op_iwmmxt_addsl_M0_wRn (rd1); +break ; +default : +return 1 ; + } +gen_op_iwmmxt_movq_wRn_M0 (wrd); +gen_op_iwmmxt_set_mup (); +gen_op_iwmmxt_set_cup (); +break ; +case 0x008 :case 0x108 :case 0x208 :case 0x308 :/* WPACK */ +case 0x408 :case 0x508 :case 0x608 :case 0x708 : +case 0x808 :case 0x908 :case 0xa08 :case 0xb08 : +case 0xc08 :case 0xd08 :case 0xe08 :case 0xf08 : +if (!(insn & (1 <<20 )) || ((insn >>22 ) &3 ) ==0 ) { +return 1 ; + } + wrd = (insn >>12 ) &0xf ; + rd0 = (insn >>16 ) &0xf ; + rd1 = (insn >>0 ) &0xf ; +gen_op_iwmmxt_movq_M0_wRn (rd0); +switch ((insn >>22 ) &3 ) { +case 1 : +if (insn & (1 <<21 )) { +gen_op_iwmmxt_packsw_M0_wRn (rd1); + }else { +gen_op_iwmmxt_packuw_M0_wRn (rd1); + } +break ; +case 2 : +if (insn & (1 <<21 )) { +gen_op_iwmmxt_packsl_M0_wRn (rd1); + }else { +gen_op_iwmmxt_packul_M0_wRn (rd1); + } +break ; +case 3 : +if (insn & (1 <<21 )) { +gen_op_iwmmxt_packsq_M0_wRn (rd1); + }else { +gen_op_iwmmxt_packuq_M0_wRn (rd1); + } +break ; + } +gen_op_iwmmxt_movq_wRn_M0 (wrd); +gen_op_iwmmxt_set_mup (); +gen_op_iwmmxt_set_cup (); +break ; +case 0x201 :case 0x203 :case 0x205 :case 0x207 : +case 0x209 :case 0x20b :case 0x20d :case 0x20f : +case 0x211 :case 0x213 :case 0x215 :case 0x217 : +case 0x219 :case 0x21b :case 0x21d :case 0x21f : + wrd = (insn >>5 ) &0xf ; + rd0 = (insn >>12 ) &0xf ; + rd1 = (insn >>0 ) &0xf ; +if (rd0 ==0xf || rd1 ==0xf ) { +return 1 ; + } +gen_op_iwmmxt_movq_M0_wRn (wrd); + tmp =load_reg (s, rd0); + tmp2 =load_reg (s, rd1); +switch ((insn >>16 ) &0xf ) { +case 0x0 :/* TMIA */ +gen_helper_iwmmxt_muladdsl (cpu_M0, cpu_M0, tmp, tmp2); +break ; +case 0x8 :/* TMIAPH */ +gen_helper_iwmmxt_muladdsw (cpu_M0, cpu_M0, tmp, tmp2); +break ; +case 0xc :case 0xd :case 0xe :case 0xf :/* TMIAxy */ +if (insn & (1 <<16 )) { +tcg_gen_shri_i32 (tmp, tmp,16 ); + } +if (insn & (1 <<17 )) { +tcg_gen_shri_i32 (tmp2, tmp2,16 ); + } +gen_helper_iwmmxt_muladdswl (cpu_M0, cpu_M0, tmp, tmp2); +break ; +default : +return 1 ; + } +gen_op_iwmmxt_movq_wRn_M0 (wrd); +gen_op_iwmmxt_set_mup (); +break ; +default : +return 1 ; + } + +return 0 ; +} + +/* +* Disassemble an XScale DSP instruction. +* Returns nonzero if an error occurred (ie. an undefined instruction). +*/ +int disas_dsp_insn (DisasContext *s,uint32_t insn) +{ +int acc, rd0, rd1, rdhi, rdlo; +TCGv_i32 tmp, tmp2; + +if ((insn &0x0ff00f10 ) ==0x0e200010 ) { +/* Multiply with Internal Accumulate Format */ + rd0 = (insn >>12 ) &0xf ; + rd1 = insn &0xf ; + acc = (insn >>5 ) &7 ; + +if (acc !=0 ) { +return 1 ; + } + + tmp =load_reg (s, rd0); + tmp2 =load_reg (s, rd1); +switch ((insn >>16 ) &0xf ) { +case 0x0 :/* MIA */ +gen_helper_iwmmxt_muladdsl (cpu_M0, cpu_M0, tmp, tmp2); +break ; +case 0x8 :/* MIAPH */ +gen_helper_iwmmxt_muladdsw (cpu_M0, cpu_M0, tmp, tmp2); +break ; +case 0xc :/* MIABB */ +case 0xd :/* MIABT */ +case 0xe :/* MIATB */ +case 0xf :/* MIATT */ +if (insn & (1 <<16 )) { +tcg_gen_shri_i32 (tmp, tmp,16 ); + } +if (insn & (1 <<17 )) { +tcg_gen_shri_i32 (tmp2, tmp2,16 ); + } +gen_helper_iwmmxt_muladdswl (cpu_M0, cpu_M0, tmp, tmp2); +break ; +default : +return 1 ; + } + +gen_op_iwmmxt_movq_wRn_M0 (acc); +return 0 ; + } + +if ((insn &0x0fe00ff8 ) ==0x0c400000 ) { +/* Internal Accumulator Access Format */ + rdhi = (insn >>16 ) &0xf ; + rdlo = (insn >>12 ) &0xf ; + acc = insn &7 ; + +if (acc !=0 ) { +return 1 ; + } + +if (insn &ARM_CP_RW_BIT ) {/* MRA */ +iwmmxt_load_reg (cpu_V0, acc); +tcg_gen_extrl_i64_i32 (cpu_R[rdlo], cpu_V0); +tcg_gen_extrh_i64_i32 (cpu_R[rdhi], cpu_V0); +tcg_gen_andi_i32 (cpu_R[rdhi], cpu_R[rdhi], (1 << (40 -32 )) -1 ); + }else {/* MAR */ +tcg_gen_concat_i32_i64 (cpu_V0, cpu_R[rdlo], cpu_R[rdhi]); +iwmmxt_store_reg (cpu_V0, acc); + } +return 0 ; + } + +return 1 ; +}
target/arm/tcg/translate.c +0 -1312
1,318 lines not on this page · raw message
target/arm/tcg/meson.build +1 -0
@@ -21,6 +21,7 @@ arm_ss.add(gen) arm_ss.add(files( 'cpu32.c', 'translate.c', + 'translate-iwmmxt.c', 'translate-m-nocp.c', 'translate-mve.c', 'translate-neon.c',
Signature · 1 line
2.38.1
PATCH v3 7/34 target/arm/tcg: Reduce 'helper-iwmmxt.h.inc' inclusion
In reply to Philippe Mathieu-DaudéInstead of including helper-iwmmxt.h.inc via helper.h which is included by all TCG files, restrict it to the few files that require it.
--- target/arm/helper.h | 1 - target/arm/tcg/iwmmxt_helper.c | 5 ++++- target/arm/tcg/translate-iwmmxt.c | 6 ++++++ 3 files changed, 10 insertions(+), 2 deletions(-)
target/arm/helper.h +0 -1
@@ -949,5 +949,4 @@ DEF_HELPER_FLAGS_5(gvec_uclamp_d, TCG_CALL_NO_RWG,#include "tcg/helper-sme.h.inc" #endif -#include "tcg/helper-iwmmxt.h.inc" #include "tcg/helper-mve.h.inc"
target/arm/tcg/iwmmxt_helper.c +4 -1
@@ -22,7 +22,10 @@#include "qemu/osdep.h" #include "cpu.h" -#include "exec/helper-proto.h" + +#define HELPER_H "tcg/helper-iwmmxt.h.inc" +#include "exec/helper-proto.h.inc" +#undef HELPER_H/* iwMMXt macros extracted from GNU gdb. */
target/arm/tcg/translate-iwmmxt.c +6 -0
@@ -12,6 +12,12 @@#include "translate.h" #include "translate-a32.h" +#define HELPER_H "tcg/helper-iwmmxt.h.inc" +#include "exec/helper-proto.h.inc" +#include "exec/helper-gen.h.inc" +#include "exec/helper-info.c.inc" +#undef HELPER_H +#define ARM_CP_RW_BIT (1 << 20)static inline void iwmmxt_load_reg (TCGv_i64 var,int reg)
Signature · 1 line
2.38.1
PATCH v3 8/34 target/arm/tcg: Un-inline VFP translation helpers
In reply to Philippe Mathieu-DaudéIn order to restrict lookup_cp_reg() and set_rmode() helpers to VFP translation, un-inline gen_lookup_cp_reg and gen_set / gen_restore_rmode.
--- target/arm/tcg/translate.h | 22 +++------------------- target/arm/tcg/translate-vfp.c | 21 +++++++++++++++++++++ 2 files changed, 24 insertions(+), 19 deletions(-)
target/arm/tcg/translate.h +3 -19
@@ -680,29 +680,13 @@ static inline void set_disas_label(DisasContext *s, DisasLabel l) s->pc_save = l.pc_save; } -static inline TCGv_ptr gen_lookup_cp_reg (uint32_t key) -{ -TCGv_ptr ret =tcg_temp_new_ptr (); -gen_helper_lookup_cp_reg (ret, cpu_env,tcg_constant_i32 (key)); -return ret; -} +TCGv_ptr gen_lookup_cp_reg (uint32_t key);/* * Set and reset rounding mode around another operation. */ -static inline TCGv_i32 gen_set_rmode (ARMFPRounding rmode,TCGv_ptr fpst) -{ -TCGv_i32 new =tcg_constant_i32 (arm_rmode_to_sf (rmode)); -TCGv_i32 old =tcg_temp_new_i32 (); - -gen_helper_set_rmode (old, new, fpst); -return old; -} - -static inline void gen_restore_rmode (TCGv_i32 old,TCGv_ptr fpst) -{ -gen_helper_set_rmode (old, old, fpst); -} +TCGv_i32 gen_set_rmode (ARMFPRounding rmode,TCGv_ptr fpst); +void gen_restore_rmode (TCGv_i32 old,TCGv_ptr fpst);/* * Helpers for implementing sets of trans_* functions.
target/arm/tcg/translate-vfp.c +21 -0
@@ -28,6 +28,27 @@#include "decode-vfp.c.inc" #include "decode-vfp-uncond.c.inc" +TCGv_ptr gen_lookup_cp_reg (uint32_t key) +{ +TCGv_ptr ret =tcg_temp_new_ptr (); +gen_helper_lookup_cp_reg (ret, cpu_env,tcg_constant_i32 (key)); +return ret; +} + +TCGv_i32 gen_set_rmode (ARMFPRounding rmode,TCGv_ptr fpst) +{ +TCGv_i32 new =tcg_constant_i32 (arm_rmode_to_sf (rmode)); +TCGv_i32 old =tcg_temp_new_i32 (); + +gen_helper_set_rmode (old, new, fpst); +return old; +} + +void gen_restore_rmode (TCGv_i32 old,TCGv_ptr fpst) +{ +gen_helper_set_rmode (old, old, fpst); +} +static inline void vfp_load_reg64 (TCGv_i64 var,int reg) {tcg_gen_ld_i64 (var, cpu_env,vfp_reg_offset (true, reg));
Signature · 1 line
2.38.1
Re: [PATCH v3 08/34] target/arm/tcg: Un-inline VFP translation helpers
Quoted 9 lines · Philippe Mathieu-Daudé
In order to restrict
lookup_cp_reg()andset_rmode()helpers to VFP translation, un-inlinegen_lookup_cp_regandgen_set/gen_restore_rmode.Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- target/arm/tcg/translate.h | 22 +++------------------- target/arm/tcg/translate-vfp.c | 21 +++++++++++++++++++++ 2 files changed, 24 insertions(+), 19 deletions(-)
While set_rmode is vfp, lookup_cp_reg is not. However, you could uninline lookup_cp_reg to translate.c.
r~
PATCH v3 9/34 target/arm/tcg: Move VFP helpers from helper-a64.c to vfp_helper.c
In reply to Philippe Mathieu-DaudéKeep the VFP helpers in the same file, guarding them with #ifdef'ry.
--- target/arm/tcg/helper-a64.c | 87 ---------------------------------- target/arm/vfp_helper.c | 93 ++++++++++++++++++++++++++++++++++++- 2 files changed, 92 insertions(+), 88 deletions(-)
target/arm/tcg/helper-a64.c +0 -87
@@ -93,93 +93,6 @@ void HELPER(msr_i_daifclear)(CPUARMState *env, uint32_t imm)arm_rebuild_hflags (env); } -/* Convert a softfloat float_relation_ (as returned by -* the float*_compare functions) to the correct ARM -* NZCV flag state. -*/ -static inline uint32_t float_rel_to_flags (int res) -{ -uint64_t flags; -switch (res) { -case float_relation_equal: - flags =PSTATE_Z |PSTATE_C ; -break ; -case float_relation_less: - flags =PSTATE_N ; -break ; -case float_relation_greater: - flags =PSTATE_C ; -break ; -case float_relation_unordered: -default : - flags =PSTATE_C |PSTATE_V ; -break ; - } -return flags; -} - -uint64_t HELPER (vfp_cmph_a64 )(uint32_t x,uint32_t y,void *fp_status) -{ -return float_rel_to_flags (float16_compare_quiet (x, y, fp_status)); -} - -uint64_t HELPER (vfp_cmpeh_a64 )(uint32_t x,uint32_t y,void *fp_status) -{ -return float_rel_to_flags (float16_compare (x, y, fp_status)); -} - -uint64_t HELPER (vfp_cmps_a64 )(float32 x,float32 y,void *fp_status) -{ -return float_rel_to_flags (float32_compare_quiet (x, y, fp_status)); -} - -uint64_t HELPER (vfp_cmpes_a64 )(float32 x,float32 y,void *fp_status) -{ -return float_rel_to_flags (float32_compare (x, y, fp_status)); -} - -uint64_t HELPER (vfp_cmpd_a64 )(float64 x,float64 y,void *fp_status) -{ -return float_rel_to_flags (float64_compare_quiet (x, y, fp_status)); -} - -uint64_t HELPER (vfp_cmped_a64 )(float64 x,float64 y,void *fp_status) -{ -return float_rel_to_flags (float64_compare (x, y, fp_status)); -} - -float32 HELPER (vfp_mulxs )(float32 a,float32 b,void *fpstp) -{ -float_status *fpst = fpstp; - - a =float32_squash_input_denormal (a, fpst); - b =float32_squash_input_denormal (b, fpst); - -if ((float32_is_zero (a) &&float32_is_infinity (b)) || - (float32_is_infinity (a) &&float32_is_zero (b))) { -/* 2.0 with the sign bit set to sign(A) XOR sign(B) */ -return make_float32 ((1U <<30 ) | - ((float32_val (a) ^float32_val (b)) & (1U <<31 ))); - } -return float32_mul (a, b, fpst); -} - -float64 HELPER (vfp_mulxd )(float64 a,float64 b,void *fpstp) -{ -float_status *fpst = fpstp; - - a =float64_squash_input_denormal (a, fpst); - b =float64_squash_input_denormal (b, fpst); - -if ((float64_is_zero (a) &&float64_is_infinity (b)) || - (float64_is_infinity (a) &&float64_is_zero (b))) { -/* 2.0 with the sign bit set to sign(A) XOR sign(B) */ -return make_float64 ((1ULL <<62 ) | - ((float64_val (a) ^float64_val (b)) & (1ULL <<63 ))); - } -return float64_mul (a, b, fpst); -} -/* 64bit/double versions of the neon float compare functions */ uint64_t HELPER (neon_ceq_f64 )(float64 a,float64 b,void *fpstp) {
target/arm/vfp_helper.c +92 -1
96 lines not on this page · raw message
Signature · 1 line
2.38.1
Re: [PATCH v3 09/34] target/arm/tcg: Move VFP helpers from helper-a64.c to vfp_helper.c
Quoted 7 lines · Philippe Mathieu-Daudé
Keep the VFP helpers in the same file, guarding them with #ifdef'ry.
Signed-off-by Philippe Mathieu-Daudé<[email protected]>--- target/arm/tcg/helper-a64.c | 87 ---------------------------------- target/arm/vfp_helper.c | 93 ++++++++++++++++++++++++++++++++++++- 2 files changed, 92 insertions(+), 88 deletions(-)
I'm not keen on this. First, because we have not yet disentangled vfp_helper.c from the bits required by KVM, so to move the rest into tcg/. Second because large ifdef blocks are a sign that something wants splitting anyway.
Perhaps tcg/vfp_a64_helper.c? There's probably a better name we could use...
r~
PATCH v3 10/34 target/arm/tcg: Extract VFP definitions to 'helper-vfp.h.inc'
In reply to Philippe Mathieu-Daudéhelper.h is used by all units, but not all require the VFP definitions. Move them (along with definitions in helper-a64.h.inc) to a new header; the next commit will remove it from the common helper.h.
--- target/arm/helper.h | 167 +--------------------------- target/arm/tcg/helper-a64.h.inc | 8 -- target/arm/tcg/helper-vfp.h.inc | 189 ++++++++++++++++++++++++++++++++ 3 files changed, 190 insertions(+), 174 deletions(-) create mode 100644 target/arm/tcg/helper-vfp.h.inc
target/arm/helper.h +1 -166
@@ -103,155 +103,6 @@ DEF_HELPER_FLAGS_2(rebuild_hflags_a64, TCG_CALL_NO_RWG, void, env, int) DEF_HELPER_FLAGS_5(probe_access, TCG_CALL_NO_WG, void, env, tl, i32, i32, i32) -DEF_HELPER_1(vfp_get_fpscr, i32, env) -DEF_HELPER_2(vfp_set_fpscr, void, env, i32) - -DEF_HELPER_3(vfp_addh, f16, f16, f16, ptr) -DEF_HELPER_3(vfp_adds, f32, f32, f32, ptr) -DEF_HELPER_3(vfp_addd, f64, f64, f64, ptr) -DEF_HELPER_3(vfp_subh, f16, f16, f16, ptr) -DEF_HELPER_3(vfp_subs, f32, f32, f32, ptr) -DEF_HELPER_3(vfp_subd, f64, f64, f64, ptr) -DEF_HELPER_3(vfp_mulh, f16, f16, f16, ptr) -DEF_HELPER_3(vfp_muls, f32, f32, f32, ptr) -DEF_HELPER_3(vfp_muld, f64, f64, f64, ptr) -DEF_HELPER_3(vfp_divh, f16, f16, f16, ptr) -DEF_HELPER_3(vfp_divs, f32, f32, f32, ptr) -DEF_HELPER_3(vfp_divd, f64, f64, f64, ptr) -DEF_HELPER_3(vfp_maxh, f16, f16, f16, ptr) -DEF_HELPER_3(vfp_maxs, f32, f32, f32, ptr) -DEF_HELPER_3(vfp_maxd, f64, f64, f64, ptr) -DEF_HELPER_3(vfp_minh, f16, f16, f16, ptr) -DEF_HELPER_3(vfp_mins, f32, f32, f32, ptr) -DEF_HELPER_3(vfp_mind, f64, f64, f64, ptr) -DEF_HELPER_3(vfp_maxnumh, f16, f16, f16, ptr) -DEF_HELPER_3(vfp_maxnums, f32, f32, f32, ptr) -DEF_HELPER_3(vfp_maxnumd, f64, f64, f64, ptr) -DEF_HELPER_3(vfp_minnumh, f16, f16, f16, ptr) -DEF_HELPER_3(vfp_minnums, f32, f32, f32, ptr) -DEF_HELPER_3(vfp_minnumd, f64, f64, f64, ptr) -DEF_HELPER_1(vfp_negh, f16, f16) -DEF_HELPER_1(vfp_negs, f32, f32) -DEF_HELPER_1(vfp_negd, f64, f64) -DEF_HELPER_1(vfp_absh, f16, f16) -DEF_HELPER_1(vfp_abss, f32, f32) -DEF_HELPER_1(vfp_absd, f64, f64) -DEF_HELPER_2(vfp_sqrth, f16, f16, env) -DEF_HELPER_2(vfp_sqrts, f32, f32, env) -DEF_HELPER_2(vfp_sqrtd, f64, f64, env) -DEF_HELPER_3(vfp_cmph, void, f16, f16, env) -DEF_HELPER_3(vfp_cmps, void, f32, f32, env) -DEF_HELPER_3(vfp_cmpd, void, f64, f64, env) -DEF_HELPER_3(vfp_cmpeh, void, f16, f16, env) -DEF_HELPER_3(vfp_cmpes, void, f32, f32, env) -DEF_HELPER_3(vfp_cmped, void, f64, f64, env) - -DEF_HELPER_2(vfp_fcvtds, f64, f32, env) -DEF_HELPER_2(vfp_fcvtsd, f32, f64, env) -DEF_HELPER_FLAGS_2(bfcvt, TCG_CALL_NO_RWG, i32, f32, ptr) -DEF_HELPER_FLAGS_2(bfcvt_pair, TCG_CALL_NO_RWG, i32, i64, ptr) - -DEF_HELPER_2(vfp_uitoh, f16, i32, ptr) -DEF_HELPER_2(vfp_uitos, f32, i32, ptr) -DEF_HELPER_2(vfp_uitod, f64, i32, ptr) -DEF_HELPER_2(vfp_sitoh, f16, i32, ptr) -DEF_HELPER_2(vfp_sitos, f32, i32, ptr) -DEF_HELPER_2(vfp_sitod, f64, i32, ptr) - -DEF_HELPER_2(vfp_touih, i32, f16, ptr) -DEF_HELPER_2(vfp_touis, i32, f32, ptr) -DEF_HELPER_2(vfp_touid, i32, f64, ptr) -DEF_HELPER_2(vfp_touizh, i32, f16, ptr) -DEF_HELPER_2(vfp_touizs, i32, f32, ptr) -DEF_HELPER_2(vfp_touizd, i32, f64, ptr) -DEF_HELPER_2(vfp_tosih, s32, f16, ptr) -DEF_HELPER_2(vfp_tosis, s32, f32, ptr) -DEF_HELPER_2(vfp_tosid, s32, f64, ptr) -DEF_HELPER_2(vfp_tosizh, s32, f16, ptr) -DEF_HELPER_2(vfp_tosizs, s32, f32, ptr) -DEF_HELPER_2(vfp_tosizd, s32, f64, ptr) - -DEF_HELPER_3(vfp_toshh_round_to_zero, i32, f16, i32, ptr) -DEF_HELPER_3(vfp_toslh_round_to_zero, i32, f16, i32, ptr) -DEF_HELPER_3(vfp_touhh_round_to_zero, i32, f16, i32, ptr) -DEF_HELPER_3(vfp_toulh_round_to_zero, i32, f16, i32, ptr) -DEF_HELPER_3(vfp_toshs_round_to_zero, i32, f32, i32, ptr) -DEF_HELPER_3(vfp_tosls_round_to_zero, i32, f32, i32, ptr) -DEF_HELPER_3(vfp_touhs_round_to_zero, i32, f32, i32, ptr) -DEF_HELPER_3(vfp_touls_round_to_zero, i32, f32, i32, ptr) -DEF_HELPER_3(vfp_toshd_round_to_zero, i64, f64, i32, ptr) -DEF_HELPER_3(vfp_tosld_round_to_zero, i64, f64, i32, ptr) -DEF_HELPER_3(vfp_touhd_round_to_zero, i64, f64, i32, ptr) -DEF_HELPER_3(vfp_tould_round_to_zero, i64, f64, i32, ptr) -DEF_HELPER_3(vfp_touhh, i32, f16, i32, ptr) -DEF_HELPER_3(vfp_toshh, i32, f16, i32, ptr) -DEF_HELPER_3(vfp_toulh, i32, f16, i32, ptr) -DEF_HELPER_3(vfp_toslh, i32, f16, i32, ptr) -DEF_HELPER_3(vfp_touqh, i64, f16, i32, ptr) -DEF_HELPER_3(vfp_tosqh, i64, f16, i32, ptr) -DEF_HELPER_3(vfp_toshs, i32, f32, i32, ptr) -DEF_HELPER_3(vfp_tosls, i32, f32, i32, ptr) -DEF_HELPER_3(vfp_tosqs, i64, f32, i32, ptr) -DEF_HELPER_3(vfp_touhs, i32, f32, i32, ptr) -DEF_HELPER_3(vfp_touls, i32, f32, i32, ptr) -DEF_HELPER_3(vfp_touqs, i64, f32, i32, ptr) -DEF_HELPER_3(vfp_toshd, i64, f64, i32, ptr) -DEF_HELPER_3(vfp_tosld, i64, f64, i32, ptr) -DEF_HELPER_3(vfp_tosqd, i64, f64, i32, ptr) -DEF_HELPER_3(vfp_touhd, i64, f64, i32, ptr) -DEF_HELPER_3(vfp_tould, i64, f64, i32, ptr) -DEF_HELPER_3(vfp_touqd, i64, f64, i32, ptr) -DEF_HELPER_3(vfp_shtos, f32, i32, i32, ptr) -DEF_HELPER_3(vfp_sltos, f32, i32, i32, ptr) -DEF_HELPER_3(vfp_sqtos, f32, i64, i32, ptr) -DEF_HELPER_3(vfp_uhtos, f32, i32, i32, ptr) -DEF_HELPER_3(vfp_ultos, f32, i32, i32, ptr) -DEF_HELPER_3(vfp_uqtos, f32, i64, i32, ptr) -DEF_HELPER_3(vfp_shtod, f64, i64, i32, ptr) -DEF_HELPER_3(vfp_sltod, f64, i64, i32, ptr) -DEF_HELPER_3(vfp_sqtod, f64, i64, i32, ptr) -DEF_HELPER_3(vfp_uhtod, f64, i64, i32, ptr) -DEF_HELPER_3(vfp_ultod, f64, i64, i32, ptr) -DEF_HELPER_3(vfp_uqtod, f64, i64, i32, ptr) -DEF_HELPER_3(vfp_shtoh, f16, i32, i32, ptr) -DEF_HELPER_3(vfp_uhtoh, f16, i32, i32, ptr) -DEF_HELPER_3(vfp_sltoh, f16, i32, i32, ptr) -DEF_HELPER_3(vfp_ultoh, f16, i32, i32, ptr) -DEF_HELPER_3(vfp_sqtoh, f16, i64, i32, ptr) -DEF_HELPER_3(vfp_uqtoh, f16, i64, i32, ptr) - -DEF_HELPER_3(vfp_shtos_round_to_nearest, f32, i32, i32, ptr) -DEF_HELPER_3(vfp_sltos_round_to_nearest, f32, i32, i32, ptr) -DEF_HELPER_3(vfp_uhtos_round_to_nearest, f32, i32, i32, ptr) -DEF_HELPER_3(vfp_ultos_round_to_nearest, f32, i32, i32, ptr) -DEF_HELPER_3(vfp_shtod_round_to_nearest, f64, i64, i32, ptr) -DEF_HELPER_3(vfp_sltod_round_to_nearest, f64, i64, i32, ptr) -DEF_HELPER_3(vfp_uhtod_round_to_nearest, f64, i64, i32, ptr) -DEF_HELPER_3(vfp_ultod_round_to_nearest, f64, i64, i32, ptr) -DEF_HELPER_3(vfp_shtoh_round_to_nearest, f16, i32, i32, ptr) -DEF_HELPER_3(vfp_uhtoh_round_to_nearest, f16, i32, i32, ptr) -DEF_HELPER_3(vfp_sltoh_round_to_nearest, f16, i32, i32, ptr) -DEF_HELPER_3(vfp_ultoh_round_to_nearest, f16, i32, i32, ptr) - -DEF_HELPER_FLAGS_2(set_rmode, TCG_CALL_NO_RWG, i32, i32, ptr) - -DEF_HELPER_FLAGS_3(vfp_fcvt_f16_to_f32, TCG_CALL_NO_RWG, f32, f16, ptr, i32) -DEF_HELPER_FLAGS_3(vfp_fcvt_f32_to_f16, TCG_CALL_NO_RWG, f16, f32, ptr, i32) -DEF_HELPER_FLAGS_3(vfp_fcvt_f16_to_f64, TCG_CALL_NO_RWG, f64, f16, ptr, i32) -DEF_HELPER_FLAGS_3(vfp_fcvt_f64_to_f16, TCG_CALL_NO_RWG, f16, f64, ptr, i32) - -DEF_HELPER_4(vfp_muladdd, f64, f64, f64, f64, ptr) -DEF_HELPER_4(vfp_muladds, f32, f32, f32, f32, ptr) -DEF_HELPER_4(vfp_muladdh, f16, f16, f16, f16, ptr) - -DEF_HELPER_FLAGS_2(recpe_f16, TCG_CALL_NO_RWG, f16, f16, ptr) -DEF_HELPER_FLAGS_2(recpe_f32, TCG_CALL_NO_RWG, f32, f32, ptr) -DEF_HELPER_FLAGS_2(recpe_f64, TCG_CALL_NO_RWG, f64, f64, ptr) -DEF_HELPER_FLAGS_2(rsqrte_f16, TCG_CALL_NO_RWG, f16, f16, ptr) -DEF_HELPER_FLAGS_2(rsqrte_f32, TCG_CALL_NO_RWG, f32, f32, ptr) -DEF_HELPER_FLAGS_2(rsqrte_f64, TCG_CALL_NO_RWG, f64, f64, ptr) -DEF_HELPER_FLAGS_1(recpe_u32, TCG_CALL_NO_RWG, i32, i32) -DEF_HELPER_FLAGS_1(rsqrte_u32, TCG_CALL_NO_RWG, i32, i32) DEF_HELPER_FLAGS_4(neon_tbl, TCG_CALL_NO_RWG, i64, env, i32, i64, i64)DEF_HELPER_3 (shl_cc, i32, env, i32, i32)
@@ -259,18 +110,6 @@ DEF_HELPER_3(shr_cc, i32, env, i32, i32) DEF_HELPER_3(sar_cc, i32, env, i32, i32)DEF_HELPER_3 (ror_cc, i32, env, i32, i32) -DEF_HELPER_FLAGS_2(rinth_exact, TCG_CALL_NO_RWG, f16, f16, ptr) -DEF_HELPER_FLAGS_2(rints_exact, TCG_CALL_NO_RWG, f32, f32, ptr) -DEF_HELPER_FLAGS_2(rintd_exact, TCG_CALL_NO_RWG, f64, f64, ptr) -DEF_HELPER_FLAGS_2(rinth, TCG_CALL_NO_RWG, f16, f16, ptr) -DEF_HELPER_FLAGS_2(rints, TCG_CALL_NO_RWG, f32, f32, ptr) -DEF_HELPER_FLAGS_2(rintd, TCG_CALL_NO_RWG, f64, f64, ptr) - -DEF_HELPER_FLAGS_2(vjcvt, TCG_CALL_NO_RWG, i32, f64, env) -DEF_HELPER_FLAGS_2(fjcvtzs, TCG_CALL_NO_RWG, i64, f64, ptr) - -DEF_HELPER_FLAGS_3 (check_hcr_el2_trap,TCG_CALL_NO_WG , void, env, i32, i32) - /* neon_helper.c */ DEF_HELPER_FLAGS_3(neon_qadd_u8, TCG_CALL_NO_RWG, i32, env, i32, i32)DEF_HELPER_FLAGS_3 (neon_qadd_s8,TCG_CALL_NO_RWG , i32, env, i32, i32)
@@ -750,11 +589,6 @@ DEF_HELPER_FLAGS_5(gvec_fmlal_idx_a32, TCG_CALL_NO_RWG,DEF_HELPER_FLAGS_5 (gvec_fmlal_idx_a64,TCG_CALL_NO_RWG , void, ptr, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_2(frint32_s, TCG_CALL_NO_RWG, f32, f32, ptr) -DEF_HELPER_FLAGS_2(frint64_s, TCG_CALL_NO_RWG, f32, f32, ptr) -DEF_HELPER_FLAGS_2(frint32_d, TCG_CALL_NO_RWG, f64, f64, ptr) -DEF_HELPER_FLAGS_2(frint64_d, TCG_CALL_NO_RWG, f64, f64, ptr) - DEF_HELPER_FLAGS_3(gvec_ceq0_b, TCG_CALL_NO_RWG, void, ptr, ptr, i32) DEF_HELPER_FLAGS_3(gvec_ceq0_h, TCG_CALL_NO_RWG, void, ptr, ptr, i32)DEF_HELPER_FLAGS_3 (gvec_clt0_b,TCG_CALL_NO_RWG , void, ptr, ptr, i32)
@@ -949,4 +783,5 @@ DEF_HELPER_FLAGS_5(gvec_uclamp_d, TCG_CALL_NO_RWG,#include "tcg/helper-sme.h.inc" #endif +#include "tcg/helper-vfp.h.inc" #include "tcg/helper-mve.h.inc"
target/arm/tcg/helper-a64.h.inc +0 -8
@@ -22,15 +22,7 @@ DEF_HELPER_FLAGS_1(rbit64, TCG_CALL_NO_RWG_SE, i64, i64) DEF_HELPER_2(msr_i_spsel, void, env, i32) DEF_HELPER_2(msr_i_daifset, void, env, i32) DEF_HELPER_2(msr_i_daifclear, void, env, i32) -DEF_HELPER_3(vfp_cmph_a64, i64, f16, f16, ptr) -DEF_HELPER_3(vfp_cmpeh_a64, i64, f16, f16, ptr) -DEF_HELPER_3(vfp_cmps_a64, i64, f32, f32, ptr) -DEF_HELPER_3(vfp_cmpes_a64, i64, f32, f32, ptr) -DEF_HELPER_3(vfp_cmpd_a64, i64, f64, f64, ptr) -DEF_HELPER_3(vfp_cmped_a64, i64, f64, f64, ptr) DEF_HELPER_FLAGS_4(simd_tblx, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_3(vfp_mulxs, TCG_CALL_NO_RWG, f32, f32, f32, ptr) -DEF_HELPER_FLAGS_3(vfp_mulxd, TCG_CALL_NO_RWG, f64, f64, f64, ptr) DEF_HELPER_FLAGS_3(neon_ceq_f64, TCG_CALL_NO_RWG, i64, i64, i64, ptr) DEF_HELPER_FLAGS_3(neon_cge_f64, TCG_CALL_NO_RWG, i64, i64, i64, ptr) DEF_HELPER_FLAGS_3(neon_cgt_f64, TCG_CALL_NO_RWG, i64, i64, i64, ptr)
target/arm/tcg/helper-vfp.h.inc new file +189 -0
189 lines not on this page · raw message
Signature · 1 line
2.38.1
PATCH v3 11/34 target/arm/tcg: Reduce 'helper-vfp.h.inc' inclusion
In reply to Philippe Mathieu-DaudéInstead of including helper-vfp.h.inc via helper.h which is included by all TCG files, restrict it to the few files that require it.
--- target/arm/helper.h | 1 - target/arm/tcg/mve_helper.c | 4 ++++ target/arm/tcg/sve_helper.c | 3 +++ target/arm/tcg/translate-a64.c | 4 ++++ target/arm/tcg/translate-m-nocp.c | 5 +++++ target/arm/tcg/translate-neon.c | 4 ++++ target/arm/tcg/translate-vfp.c | 6 ++++++ target/arm/tcg/vec_helper.c | 4 ++++ target/arm/vfp_helper.c | 5 ++++- 9 files changed, 34 insertions(+), 2 deletions(-)
target/arm/helper.h +0 -1
@@ -783,5 +783,4 @@ DEF_HELPER_FLAGS_5(gvec_uclamp_d, TCG_CALL_NO_RWG,#include "tcg/helper-sme.h.inc" #endif -#include "tcg/helper-vfp.h.inc" #include "tcg/helper-mve.h.inc"
target/arm/tcg/mve_helper.c +4 -0
@@ -27,6 +27,10 @@#include "tcg/tcg.h" #include "fpu/softfloat.h" +#define HELPER_H "tcg/helper-vfp.h.inc" +#include "exec/helper-proto.h.inc" +#undef HELPER_H +static uint16_t mve_eci_mask (CPUARMState *env) {/*
target/arm/tcg/sve_helper.c +3 -0
@@ -29,6 +29,9 @@#include "sve_ldst_internal.h" #include "hw/core/tcg-cpu-ops.h" +#define HELPER_H "tcg/helper-vfp.h.inc" +#include "exec/helper-proto.h.inc" +#undef HELPER_H/* Return a value for NZCV as per the ARM PredTest pseudofunction. *
target/arm/tcg/translate-a64.c +4 -0
@@ -26,6 +26,10 @@#include "semihosting/semihost.h" #include "cpregs.h" +#define HELPER_H "tcg/helper-vfp.h.inc" +#include "exec/helper-gen.h.inc" +#undef HELPER_H +static TCGv_i64 cpu_X[32 ];static TCGv_i64 cpu_pc;
target/arm/tcg/translate-m-nocp.c +5 -0
@@ -21,6 +21,11 @@#include "translate.h" #include "translate-a32.h" +#define HELPER_H "tcg/helper-vfp.h.inc" +#include "exec/helper-gen.h.inc" +#undef HELPER_H + +/* Include the generated decoder */ #include "decode-m-nocp.c.inc" /*
target/arm/tcg/translate-neon.c +4 -0
@@ -24,6 +24,10 @@#include "translate.h" #include "translate-a32.h" +#define HELPER_H "tcg/helper-vfp.h.inc" +#include "exec/helper-gen.h.inc" +#undef HELPER_H +/* Include the generated Neon decoder */ #include "decode-neon-dp.c.inc" #include "decode-neon-ls.c.inc"
target/arm/tcg/translate-vfp.c +6 -0
@@ -24,6 +24,12 @@#include "translate.h" #include "translate-a32.h" +#define HELPER_H "tcg/helper-vfp.h.inc" +#include "exec/helper-proto.h.inc" +#include "exec/helper-gen.h.inc" +#include "exec/helper-info.c.inc" +#undef HELPER_H +/* Include the generated VFP decoder */ #include "decode-vfp.c.inc" #include "decode-vfp-uncond.c.inc"
target/arm/tcg/vec_helper.c +4 -0
@@ -25,6 +25,10 @@#include "qemu/int128.h" #include "vec_internal.h" +#define HELPER_H "tcg/helper-vfp.h.inc" +#include "exec/helper-proto.h.inc" +#undef HELPER_H +/* * Data for expanding active predicate bits to bytes, for byte elements. *
target/arm/vfp_helper.c +4 -1
@@ -19,7 +19,6 @@#include "qemu/osdep.h" #include "cpu.h" -#include "exec/helper-proto.h" #include "internals.h" #ifdef CONFIG_TCG #include "qemu/log.h"
@@ -32,6 +31,10 @@#ifdef CONFIG_TCG +#define HELPER_H "tcg/helper-vfp.h.inc" +#include "exec/helper-proto.h.inc" +#undef HELPER_H +/* Convert host exception flags to vfp form. */ static inline int vfp_exceptbits_from_host (int host_bits) {
Signature · 1 line
2.38.1
Re: [PATCH v3 11/34] target/arm/tcg: Reduce 'helper-vfp.h.inc' inclusion
Quoted 5 lines · Philippe Mathieu-Daudé
Instead of including helper-vfp.h.inc via
helper.hwhich is included by all TCG files, restrict it to the few files that require it.Signed-off-by Philippe Mathieu-Daudé<[email protected]>
Quoted 11 lines
--- target/arm/helper.h | 1 - target/arm/tcg/mve_helper.c | 4 ++++ target/arm/tcg/sve_helper.c | 3 +++ target/arm/tcg/translate-a64.c | 4 ++++ target/arm/tcg/translate-m-nocp.c | 5 +++++ target/arm/tcg/translate-neon.c | 4 ++++ target/arm/tcg/translate-vfp.c | 6 ++++++ target/arm/tcg/vec_helper.c | 4 ++++ target/arm/vfp_helper.c | 5 ++++- 9 files changed, 34 insertions(+), 2 deletions(-)
r~
PATCH v3 12/34 target/arm/tcg: Move NEON helpers to neon_helper.c
In reply to Philippe Mathieu-DaudéMove various NEON helpers to the well named neon_helper.c.
--- target/arm/tcg/helper-a64.c | 80 -------------------------- target/arm/tcg/neon_helper.c | 106 +++++++++++++++++++++++++++++++++++ target/arm/tcg/op_helper.c | 22 -------- 3 files changed, 106 insertions(+), 102 deletions(-)
target/arm/tcg/helper-a64.c +0 -80
@@ -93,25 +93,6 @@ void HELPER(msr_i_daifclear)(CPUARMState *env, uint32_t imm)arm_rebuild_hflags (env); } -/* 64bit/double versions of the neon float compare functions */ -uint64_t HELPER (neon_ceq_f64 )(float64 a,float64 b,void *fpstp) -{ -float_status *fpst = fpstp; -return -float64_eq_quiet (a, b, fpst); -} - -uint64_t HELPER (neon_cge_f64 )(float64 a,float64 b,void *fpstp) -{ -float_status *fpst = fpstp; -return -float64_le (b, a, fpst); -} - -uint64_t HELPER (neon_cgt_f64 )(float64 a,float64 b,void *fpstp) -{ -float_status *fpst = fpstp; -return -float64_lt (b, a, fpst); -} -/* Reciprocal step and sqrt step. Note that unlike the A32/T32 * versions, these do a fully fused multiply-add or * multiply-add-and-halve.
@@ -207,67 +188,6 @@ float64 HELPER(rsqrtsf_f64)(float64 a, float64 b, void *fpstp)return float64_muladd (a, b, float64_three, float_muladd_halve_result, fpst); } -/* Pairwise long add: add pairs of adjacent elements into -* double-width elements in the result (eg _s8 is an 8x8->16 op) -*/ -uint64_t HELPER (neon_addlp_s8 )(uint64_t a) -{ -uint64_t nsignmask =0x0080008000800080ULL ; -uint64_t wsignmask =0x8000800080008000ULL ; -uint64_t elementmask =0x00ff00ff00ff00ffULL ; -uint64_t tmp1, tmp2; -uint64_t res, signres; - -/* Extract odd elements, sign extend each to a 16 bit field */ - tmp1 = a & elementmask; - tmp1 ^= nsignmask; - tmp1 |= wsignmask; - tmp1 = (tmp1 - nsignmask) ^ wsignmask; -/* Ditto for the even elements */ - tmp2 = (a >>8 ) & elementmask; - tmp2 ^= nsignmask; - tmp2 |= wsignmask; - tmp2 = (tmp2 - nsignmask) ^ wsignmask; - -/* calculate the result by summing bits 0..14, 16..22, etc, -* and then adjusting the sign bits 15, 23, etc manually. -* This ensures the addition can't overflow the 16 bit field. -*/ - signres = (tmp1 ^ tmp2) & wsignmask; - res = (tmp1 & ~wsignmask) + (tmp2 & ~wsignmask); - res ^= signres; - -return res; -} - -uint64_t HELPER (neon_addlp_u8 )(uint64_t a) -{ -uint64_t tmp; - - tmp = a &0x00ff00ff00ff00ffULL ; - tmp += (a >>8 ) &0x00ff00ff00ff00ffULL ; -return tmp; -} - -uint64_t HELPER (neon_addlp_s16 )(uint64_t a) -{ -int32_t reslo, reshi; - - reslo = (int32_t )(int16_t )a + (int32_t )(int16_t )(a >>16 ); - reshi = (int32_t )(int16_t )(a >>32 ) + (int32_t )(int16_t )(a >>48 ); - -return (uint32_t )reslo | (((uint64_t )reshi) <<32 ); -} - -uint64_t HELPER (neon_addlp_u16 )(uint64_t a) -{ -uint64_t tmp; - - tmp = a &0x0000ffff0000ffffULL ; - tmp += (a >>16 ) &0x0000ffff0000ffffULL ; -return tmp; -} -/* Floating-point reciprocal exponent - see FPRecpX in ARM ARM */ uint32_t HELPER (frecpx_f16 )(uint32_t a,void *fpstp) {
target/arm/tcg/neon_helper.c +106 -0
109 lines not on this page · raw message
target/arm/tcg/op_helper.c +0 -22
@@ -82,28 +82,6 @@ void raise_exception_ra(CPUARMState *env, uint32_t excp, uint32_t syndrome,raise_exception (env, excp, syndrome, target_el); } -uint64_t HELPER (neon_tbl )(CPUARMState *env,uint32_t desc, -uint64_t ireg,uint64_t def) -{ -uint64_t tmp, val =0 ; -uint32_t maxindex = ((desc &3 ) +1 ) *8 ; -uint32_t base_reg = desc >>2 ; -uint32_t shift, index, reg; - -for (shift =0 ; shift <64 ; shift +=8 ) { - index = (ireg >> shift) &0xff ; -if (index < maxindex) { - reg = base_reg + (index >>3 ); - tmp = *aa32_vfp_dreg (env, reg); - tmp = ((tmp >> ((index &7 ) <<3 )) &0xff ) << shift; - }else { - tmp = def & (0xffull << shift); - } - val |= tmp; - } -return val; -} -void HELPER (v8m_stackcheck )(CPUARMState *env,uint32_t newvalue) {/*
Signature · 1 line
2.38.1
PATCH v3 13/34 target/arm/tcg: Extract NEON definitions to 'helper-neon.h.inc'
In reply to Philippe Mathieu-Daudéhelper.h is used by all units, but not all require the NEON definitions. Move them to a new header; the next commit will remove it from the common helper.h.
--- target/arm/helper.h | 207 +--------------------------- target/arm/tcg/helper-a64.h.inc | 7 - target/arm/tcg/helper-neon.h.inc | 224 +++++++++++++++++++++++++++++++ 3 files changed, 225 insertions(+), 213 deletions(-) create mode 100644 target/arm/tcg/helper-neon.h.inc
target/arm/helper.h +1 -206
@@ -103,198 +103,11 @@ DEF_HELPER_FLAGS_2(rebuild_hflags_a64, TCG_CALL_NO_RWG, void, env, int) DEF_HELPER_FLAGS_5(probe_access, TCG_CALL_NO_WG, void, env, tl, i32, i32, i32) -DEF_HELPER_FLAGS_4(neon_tbl, TCG_CALL_NO_RWG, i64, env, i32, i64, i64) - DEF_HELPER_3(shl_cc, i32, env, i32, i32) DEF_HELPER_3(shr_cc, i32, env, i32, i32) DEF_HELPER_3(sar_cc, i32, env, i32, i32) DEF_HELPER_3(ror_cc, i32, env, i32, i32) -/* neon_helper.c */ -DEF_HELPER_FLAGS_3(neon_qadd_u8, TCG_CALL_NO_RWG, i32, env, i32, i32) -DEF_HELPER_FLAGS_3(neon_qadd_s8, TCG_CALL_NO_RWG, i32, env, i32, i32) -DEF_HELPER_FLAGS_3(neon_qadd_u16, TCG_CALL_NO_RWG, i32, env, i32, i32) -DEF_HELPER_FLAGS_3(neon_qadd_s16, TCG_CALL_NO_RWG, i32, env, i32, i32) -DEF_HELPER_FLAGS_3(neon_qadd_u32, TCG_CALL_NO_RWG, i32, env, i32, i32) -DEF_HELPER_FLAGS_3(neon_qadd_s32, TCG_CALL_NO_RWG, i32, env, i32, i32) -DEF_HELPER_FLAGS_3(neon_uqadd_s8, TCG_CALL_NO_RWG, i32, env, i32, i32) -DEF_HELPER_FLAGS_3(neon_uqadd_s16, TCG_CALL_NO_RWG, i32, env, i32, i32) -DEF_HELPER_FLAGS_3(neon_uqadd_s32, TCG_CALL_NO_RWG, i32, env, i32, i32) -DEF_HELPER_FLAGS_3(neon_uqadd_s64, TCG_CALL_NO_RWG, i64, env, i64, i64) -DEF_HELPER_FLAGS_3(neon_sqadd_u8, TCG_CALL_NO_RWG, i32, env, i32, i32) -DEF_HELPER_FLAGS_3(neon_sqadd_u16, TCG_CALL_NO_RWG, i32, env, i32, i32) -DEF_HELPER_FLAGS_3(neon_sqadd_u32, TCG_CALL_NO_RWG, i32, env, i32, i32) -DEF_HELPER_FLAGS_3(neon_sqadd_u64, TCG_CALL_NO_RWG, i64, env, i64, i64) -DEF_HELPER_3(neon_qsub_u8, i32, env, i32, i32) -DEF_HELPER_3(neon_qsub_s8, i32, env, i32, i32) -DEF_HELPER_3(neon_qsub_u16, i32, env, i32, i32) -DEF_HELPER_3(neon_qsub_s16, i32, env, i32, i32) -DEF_HELPER_3(neon_qsub_u32, i32, env, i32, i32) -DEF_HELPER_3(neon_qsub_s32, i32, env, i32, i32) -DEF_HELPER_3(neon_qadd_u64, i64, env, i64, i64) -DEF_HELPER_3(neon_qadd_s64, i64, env, i64, i64) -DEF_HELPER_3(neon_qsub_u64, i64, env, i64, i64) -DEF_HELPER_3(neon_qsub_s64, i64, env, i64, i64) - -DEF_HELPER_2(neon_hadd_s8, i32, i32, i32) -DEF_HELPER_2(neon_hadd_u8, i32, i32, i32) -DEF_HELPER_2(neon_hadd_s16, i32, i32, i32) -DEF_HELPER_2(neon_hadd_u16, i32, i32, i32) -DEF_HELPER_2(neon_hadd_s32, s32, s32, s32) -DEF_HELPER_2(neon_hadd_u32, i32, i32, i32) -DEF_HELPER_2(neon_rhadd_s8, i32, i32, i32) -DEF_HELPER_2(neon_rhadd_u8, i32, i32, i32) -DEF_HELPER_2(neon_rhadd_s16, i32, i32, i32) -DEF_HELPER_2(neon_rhadd_u16, i32, i32, i32) -DEF_HELPER_2(neon_rhadd_s32, s32, s32, s32) -DEF_HELPER_2(neon_rhadd_u32, i32, i32, i32) -DEF_HELPER_2(neon_hsub_s8, i32, i32, i32) -DEF_HELPER_2(neon_hsub_u8, i32, i32, i32) -DEF_HELPER_2(neon_hsub_s16, i32, i32, i32) -DEF_HELPER_2(neon_hsub_u16, i32, i32, i32) -DEF_HELPER_2(neon_hsub_s32, s32, s32, s32) -DEF_HELPER_2(neon_hsub_u32, i32, i32, i32) - -DEF_HELPER_2(neon_pmin_u8, i32, i32, i32) -DEF_HELPER_2(neon_pmin_s8, i32, i32, i32) -DEF_HELPER_2(neon_pmin_u16, i32, i32, i32) -DEF_HELPER_2(neon_pmin_s16, i32, i32, i32) -DEF_HELPER_2(neon_pmax_u8, i32, i32, i32) -DEF_HELPER_2(neon_pmax_s8, i32, i32, i32) -DEF_HELPER_2(neon_pmax_u16, i32, i32, i32) -DEF_HELPER_2(neon_pmax_s16, i32, i32, i32) - -DEF_HELPER_2(neon_shl_u16, i32, i32, i32) -DEF_HELPER_2(neon_shl_s16, i32, i32, i32) -DEF_HELPER_2(neon_rshl_u8, i32, i32, i32) -DEF_HELPER_2(neon_rshl_s8, i32, i32, i32) -DEF_HELPER_2(neon_rshl_u16, i32, i32, i32) -DEF_HELPER_2(neon_rshl_s16, i32, i32, i32) -DEF_HELPER_2(neon_rshl_u32, i32, i32, i32) -DEF_HELPER_2(neon_rshl_s32, i32, i32, i32) -DEF_HELPER_2(neon_rshl_u64, i64, i64, i64) -DEF_HELPER_2(neon_rshl_s64, i64, i64, i64) -DEF_HELPER_3(neon_qshl_u8, i32, env, i32, i32) -DEF_HELPER_3(neon_qshl_s8, i32, env, i32, i32) -DEF_HELPER_3(neon_qshl_u16, i32, env, i32, i32) -DEF_HELPER_3(neon_qshl_s16, i32, env, i32, i32) -DEF_HELPER_3(neon_qshl_u32, i32, env, i32, i32) -DEF_HELPER_3(neon_qshl_s32, i32, env, i32, i32) -DEF_HELPER_3(neon_qshl_u64, i64, env, i64, i64) -DEF_HELPER_3(neon_qshl_s64, i64, env, i64, i64) -DEF_HELPER_3(neon_qshlu_s8, i32, env, i32, i32) -DEF_HELPER_3(neon_qshlu_s16, i32, env, i32, i32) -DEF_HELPER_3(neon_qshlu_s32, i32, env, i32, i32) -DEF_HELPER_3(neon_qshlu_s64, i64, env, i64, i64) -DEF_HELPER_3(neon_qrshl_u8, i32, env, i32, i32) -DEF_HELPER_3(neon_qrshl_s8, i32, env, i32, i32) -DEF_HELPER_3(neon_qrshl_u16, i32, env, i32, i32) -DEF_HELPER_3(neon_qrshl_s16, i32, env, i32, i32) -DEF_HELPER_3(neon_qrshl_u32, i32, env, i32, i32) -DEF_HELPER_3(neon_qrshl_s32, i32, env, i32, i32) -DEF_HELPER_3(neon_qrshl_u64, i64, env, i64, i64) -DEF_HELPER_3(neon_qrshl_s64, i64, env, i64, i64) - -DEF_HELPER_2(neon_add_u8, i32, i32, i32) -DEF_HELPER_2(neon_add_u16, i32, i32, i32) -DEF_HELPER_2(neon_padd_u8, i32, i32, i32) -DEF_HELPER_2(neon_padd_u16, i32, i32, i32) -DEF_HELPER_2(neon_sub_u8, i32, i32, i32) -DEF_HELPER_2(neon_sub_u16, i32, i32, i32) -DEF_HELPER_2(neon_mul_u8, i32, i32, i32) -DEF_HELPER_2(neon_mul_u16, i32, i32, i32) - -DEF_HELPER_2(neon_tst_u8, i32, i32, i32) -DEF_HELPER_2(neon_tst_u16, i32, i32, i32) -DEF_HELPER_2(neon_tst_u32, i32, i32, i32) - -DEF_HELPER_1(neon_clz_u8, i32, i32) -DEF_HELPER_1(neon_clz_u16, i32, i32) -DEF_HELPER_1(neon_cls_s8, i32, i32) -DEF_HELPER_1(neon_cls_s16, i32, i32) -DEF_HELPER_1(neon_cls_s32, i32, i32) -DEF_HELPER_1(neon_cnt_u8, i32, i32) -DEF_HELPER_FLAGS_1(neon_rbit_u8, TCG_CALL_NO_RWG_SE, i32, i32) - -DEF_HELPER_3(neon_qdmulh_s16, i32, env, i32, i32) -DEF_HELPER_3(neon_qrdmulh_s16, i32, env, i32, i32) -DEF_HELPER_4(neon_qrdmlah_s16, i32, env, i32, i32, i32) -DEF_HELPER_4(neon_qrdmlsh_s16, i32, env, i32, i32, i32) -DEF_HELPER_3(neon_qdmulh_s32, i32, env, i32, i32) -DEF_HELPER_3(neon_qrdmulh_s32, i32, env, i32, i32) -DEF_HELPER_4(neon_qrdmlah_s32, i32, env, s32, s32, s32) -DEF_HELPER_4(neon_qrdmlsh_s32, i32, env, s32, s32, s32) - -DEF_HELPER_1(neon_narrow_u8, i32, i64) -DEF_HELPER_1(neon_narrow_u16, i32, i64) -DEF_HELPER_2(neon_unarrow_sat8, i32, env, i64) -DEF_HELPER_2(neon_narrow_sat_u8, i32, env, i64) -DEF_HELPER_2(neon_narrow_sat_s8, i32, env, i64) -DEF_HELPER_2(neon_unarrow_sat16, i32, env, i64) -DEF_HELPER_2(neon_narrow_sat_u16, i32, env, i64) -DEF_HELPER_2(neon_narrow_sat_s16, i32, env, i64) -DEF_HELPER_2(neon_unarrow_sat32, i32, env, i64) -DEF_HELPER_2(neon_narrow_sat_u32, i32, env, i64) -DEF_HELPER_2(neon_narrow_sat_s32, i32, env, i64) -DEF_HELPER_1(neon_narrow_high_u8, i32, i64) -DEF_HELPER_1(neon_narrow_high_u16, i32, i64) -DEF_HELPER_1(neon_narrow_round_high_u8, i32, i64) -DEF_HELPER_1(neon_narrow_round_high_u16, i32, i64) -DEF_HELPER_1(neon_widen_u8, i64, i32) -DEF_HELPER_1(neon_widen_s8, i64, i32) -DEF_HELPER_1(neon_widen_u16, i64, i32) -DEF_HELPER_1(neon_widen_s16, i64, i32) - -DEF_HELPER_2(neon_addl_u16, i64, i64, i64) -DEF_HELPER_2(neon_addl_u32, i64, i64, i64) -DEF_HELPER_2(neon_paddl_u16, i64, i64, i64) -DEF_HELPER_2(neon_paddl_u32, i64, i64, i64) -DEF_HELPER_2(neon_subl_u16, i64, i64, i64) -DEF_HELPER_2(neon_subl_u32, i64, i64, i64) -DEF_HELPER_3(neon_addl_saturate_s32, i64, env, i64, i64) -DEF_HELPER_3(neon_addl_saturate_s64, i64, env, i64, i64) -DEF_HELPER_2(neon_abdl_u16, i64, i32, i32) -DEF_HELPER_2(neon_abdl_s16, i64, i32, i32) -DEF_HELPER_2(neon_abdl_u32, i64, i32, i32) -DEF_HELPER_2(neon_abdl_s32, i64, i32, i32) -DEF_HELPER_2(neon_abdl_u64, i64, i32, i32) -DEF_HELPER_2(neon_abdl_s64, i64, i32, i32) -DEF_HELPER_2(neon_mull_u8, i64, i32, i32) -DEF_HELPER_2(neon_mull_s8, i64, i32, i32) -DEF_HELPER_2(neon_mull_u16, i64, i32, i32) -DEF_HELPER_2(neon_mull_s16, i64, i32, i32) - -DEF_HELPER_1(neon_negl_u16, i64, i64) -DEF_HELPER_1(neon_negl_u32, i64, i64) - -DEF_HELPER_FLAGS_2(neon_qabs_s8, TCG_CALL_NO_RWG, i32, env, i32) -DEF_HELPER_FLAGS_2(neon_qabs_s16, TCG_CALL_NO_RWG, i32, env, i32) -DEF_HELPER_FLAGS_2(neon_qabs_s32, TCG_CALL_NO_RWG, i32, env, i32) -DEF_HELPER_FLAGS_2(neon_qabs_s64, TCG_CALL_NO_RWG, i64, env, i64) -DEF_HELPER_FLAGS_2(neon_qneg_s8, TCG_CALL_NO_RWG, i32, env, i32) -DEF_HELPER_FLAGS_2(neon_qneg_s16, TCG_CALL_NO_RWG, i32, env, i32) -DEF_HELPER_FLAGS_2(neon_qneg_s32, TCG_CALL_NO_RWG, i32, env, i32) -DEF_HELPER_FLAGS_2(neon_qneg_s64, TCG_CALL_NO_RWG, i64, env, i64) - -DEF_HELPER_3(neon_ceq_f32, i32, i32, i32, ptr) -DEF_HELPER_3(neon_cge_f32, i32, i32, i32, ptr) -DEF_HELPER_3(neon_cgt_f32, i32, i32, i32, ptr) -DEF_HELPER_3(neon_acge_f32, i32, i32, i32, ptr) -DEF_HELPER_3(neon_acgt_f32, i32, i32, i32, ptr) -DEF_HELPER_3(neon_acge_f64, i64, i64, i64, ptr) -DEF_HELPER_3(neon_acgt_f64, i64, i64, i64, ptr) - -DEF_HELPER_FLAGS_2(neon_unzip8, TCG_CALL_NO_RWG, void, ptr, ptr) -DEF_HELPER_FLAGS_2(neon_unzip16, TCG_CALL_NO_RWG, void, ptr, ptr) -DEF_HELPER_FLAGS_2(neon_qunzip8, TCG_CALL_NO_RWG, void, ptr, ptr) -DEF_HELPER_FLAGS_2(neon_qunzip16, TCG_CALL_NO_RWG, void, ptr, ptr) -DEF_HELPER_FLAGS_2(neon_qunzip32, TCG_CALL_NO_RWG, void, ptr, ptr) -DEF_HELPER_FLAGS_2(neon_zip8, TCG_CALL_NO_RWG, void, ptr, ptr) -DEF_HELPER_FLAGS_2(neon_zip16, TCG_CALL_NO_RWG, void, ptr, ptr) -DEF_HELPER_FLAGS_2(neon_qzip8, TCG_CALL_NO_RWG, void, ptr, ptr) -DEF_HELPER_FLAGS_2(neon_qzip16, TCG_CALL_NO_RWG, void, ptr, ptr) -DEF_HELPER_FLAGS_2(neon_qzip32, TCG_CALL_NO_RWG, void, ptr, ptr) - DEF_HELPER_FLAGS_4(crypto_aese, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32)DEF_HELPER_FLAGS_3 (crypto_aesmc,TCG_CALL_NO_RWG , void, ptr, ptr, i32)
@@ -396,13 +209,6 @@ DEF_HELPER_FLAGS_6(gvec_fcmlas_idx, TCG_CALL_NO_RWG,DEF_HELPER_FLAGS_6 (gvec_fcmlad,TCG_CALL_NO_RWG , void, ptr, ptr, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_5(neon_paddh, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_5(neon_pmaxh, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_5(neon_pminh, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_5(neon_padds, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_5(neon_pmaxs, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_5(neon_pmins, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, ptr, i32) - DEF_HELPER_FLAGS_4(gvec_sstoh, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) DEF_HELPER_FLAGS_4(gvec_sitos, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32)DEF_HELPER_FLAGS_4 (gvec_ustoh,TCG_CALL_NO_RWG , void, ptr, ptr, ptr, i32)
@@ -618,8 +424,6 @@ DEF_HELPER_FLAGS_4(gvec_ushl_h, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) DEF_HELPER_FLAGS_4(gvec_pmul_b, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) DEF_HELPER_FLAGS_4(gvec_pmull_q, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_4(neon_pmull_h, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) - DEF_HELPER_FLAGS_3(gvec_ssra_b, TCG_CALL_NO_RWG, void, ptr, ptr, i32) DEF_HELPER_FLAGS_3(gvec_ssra_h, TCG_CALL_NO_RWG, void, ptr, ptr, i32)DEF_HELPER_FLAGS_3 (gvec_ssra_s,TCG_CALL_NO_RWG , void, ptr, ptr, i32)
@@ -698,16 +502,6 @@ DEF_HELPER_FLAGS_5(gvec_mls_idx_s, TCG_CALL_NO_RWG,DEF_HELPER_FLAGS_5 (gvec_mls_idx_d,TCG_CALL_NO_RWG , void, ptr, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_5 (neon_sqdmulh_h,TCG_CALL_NO_RWG , - void, ptr, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_5 (neon_sqdmulh_s,TCG_CALL_NO_RWG , - void, ptr, ptr, ptr, ptr, i32) - -DEF_HELPER_FLAGS_5 (neon_sqrdmulh_h,TCG_CALL_NO_RWG , - void, ptr, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_5 (neon_sqrdmulh_s,TCG_CALL_NO_RWG , - void, ptr, ptr, ptr, ptr, i32) - DEF_HELPER_FLAGS_4(sve2_sqdmulh_b, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) DEF_HELPER_FLAGS_4(sve2_sqdmulh_h, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32)DEF_HELPER_FLAGS_4 (sve2_sqdmulh_s,TCG_CALL_NO_RWG , void, ptr, ptr, ptr, i32)
@@ -783,4 +577,5 @@ DEF_HELPER_FLAGS_5(gvec_uclamp_d, TCG_CALL_NO_RWG,#include "tcg/helper-sme.h.inc" #endif +#include "tcg/helper-neon.h.inc" #include "tcg/helper-mve.h.inc"
target/arm/tcg/helper-a64.h.inc +0 -7
@@ -23,19 +23,12 @@ DEF_HELPER_2(msr_i_spsel, void, env, i32) DEF_HELPER_2(msr_i_daifset, void, env, i32) DEF_HELPER_2(msr_i_daifclear, void, env, i32) DEF_HELPER_FLAGS_4(simd_tblx, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_3(neon_ceq_f64, TCG_CALL_NO_RWG, i64, i64, i64, ptr) -DEF_HELPER_FLAGS_3(neon_cge_f64, TCG_CALL_NO_RWG, i64, i64, i64, ptr) -DEF_HELPER_FLAGS_3(neon_cgt_f64, TCG_CALL_NO_RWG, i64, i64, i64, ptr) DEF_HELPER_FLAGS_3(recpsf_f16, TCG_CALL_NO_RWG, f16, f16, f16, ptr) DEF_HELPER_FLAGS_3(recpsf_f32, TCG_CALL_NO_RWG, f32, f32, f32, ptr) DEF_HELPER_FLAGS_3(recpsf_f64, TCG_CALL_NO_RWG, f64, f64, f64, ptr) DEF_HELPER_FLAGS_3(rsqrtsf_f16, TCG_CALL_NO_RWG, f16, f16, f16, ptr) DEF_HELPER_FLAGS_3(rsqrtsf_f32, TCG_CALL_NO_RWG, f32, f32, f32, ptr) DEF_HELPER_FLAGS_3(rsqrtsf_f64, TCG_CALL_NO_RWG, f64, f64, f64, ptr) -DEF_HELPER_FLAGS_1(neon_addlp_s8, TCG_CALL_NO_RWG_SE, i64, i64) -DEF_HELPER_FLAGS_1(neon_addlp_u8, TCG_CALL_NO_RWG_SE, i64, i64) -DEF_HELPER_FLAGS_1(neon_addlp_s16, TCG_CALL_NO_RWG_SE, i64, i64) -DEF_HELPER_FLAGS_1(neon_addlp_u16, TCG_CALL_NO_RWG_SE, i64, i64) DEF_HELPER_FLAGS_2(frecpx_f64, TCG_CALL_NO_RWG, f64, f64, ptr) DEF_HELPER_FLAGS_2(frecpx_f32, TCG_CALL_NO_RWG, f32, f32, ptr) DEF_HELPER_FLAGS_2(frecpx_f16, TCG_CALL_NO_RWG, f16, f16, ptr)
target/arm/tcg/helper-neon.h.inc new file +224 -0
224 lines not on this page · raw message
Signature · 1 line
2.38.1
PATCH v3 14/34 target/arm/tcg: Reduce 'helper-neon.h.inc' inclusion
Instead of including helper-neon.h.inc via helper.h which is included by all TCG files, restrict it to the few files that require it.
--- target/arm/helper.h | 1 - target/arm/tcg/neon_helper.c | 5 ++++- target/arm/tcg/translate-a64.c | 4 ++++ target/arm/tcg/translate-neon.c | 6 ++++++ target/arm/tcg/translate-sme.c | 4 ++++ target/arm/tcg/translate.c | 4 ++++ target/arm/tcg/vec_helper.c | 4 ++++ 7 files changed, 26 insertions(+), 2 deletions(-)
target/arm/helper.h +0 -1
@@ -577,5 +577,4 @@ DEF_HELPER_FLAGS_5(gvec_uclamp_d, TCG_CALL_NO_RWG,#include "tcg/helper-sme.h.inc" #endif -#include "tcg/helper-neon.h.inc" #include "tcg/helper-mve.h.inc"
target/arm/tcg/neon_helper.c +4 -1
@@ -9,10 +9,13 @@#include "qemu/osdep.h" #include "cpu.h" -#include "exec/helper-proto.h" #include "fpu/softfloat.h" #include "vec_internal.h" +#define HELPER_H "tcg/helper-neon.h.inc" +#include "exec/helper-proto.h.inc" +#undef HELPER_H +#define SIGNBIT (uint32_t)0x80000000#define SIGNBIT64 ((uint64_t)1 << 63)
target/arm/tcg/translate-a64.c +4 -0
@@ -30,6 +30,10 @@#include "exec/helper-gen.h.inc" #undef HELPER_H +#define HELPER_H "tcg/helper-neon.h.inc" +#include "exec/helper-gen.h.inc" +#undef HELPER_H +static TCGv_i64 cpu_X[32 ];static TCGv_i64 cpu_pc;
target/arm/tcg/translate-neon.c +6 -0
@@ -28,6 +28,12 @@#include "exec/helper-gen.h.inc" #undef HELPER_H +#define HELPER_H "tcg/helper-neon.h.inc" +#include "exec/helper-proto.h.inc" +#include "exec/helper-gen.h.inc" +#include "exec/helper-info.c.inc" +#undef HELPER_H +/* Include the generated Neon decoder */ #include "decode-neon-dp.c.inc" #include "decode-neon-ls.c.inc"
target/arm/tcg/translate-sme.c +4 -0
@@ -21,6 +21,10 @@#include "translate.h" #include "translate-a64.h" +#define HELPER_H "tcg/helper-neon.h.inc" +#include "exec/helper-gen.h.inc" +#undef HELPER_H +/* * Include the generated decoder. */
target/arm/tcg/translate.c +4 -0
@@ -29,6 +29,10 @@#include "cpregs.h" #include "exec/helper-proto.h" +#define HELPER_H "tcg/helper-neon.h.inc" +#include "exec/helper-gen.h.inc" +#undef HELPER_H +#define HELPER_H "helper.h"#include "exec/helper-info.c.inc" #undef HELPER_H
target/arm/tcg/vec_helper.c +4 -0
@@ -29,6 +29,10 @@#include "exec/helper-proto.h.inc" #undef HELPER_H +#define HELPER_H "tcg/helper-neon.h.inc" +#include "exec/helper-proto.h.inc" +#undef HELPER_H +/* * Data for expanding active predicate bits to bytes, for byte elements. *
Signature · 1 line
2.38.1
Re: [PATCH v3 14/34] target/arm/tcg: Reduce 'helper-neon.h.inc' inclusion
Quoted 5 lines · Philippe Mathieu-Daudé
Instead of including helper-neon.h.inc via
helper.hwhich is included by all TCG files, restrict it to the few files that require it.Signed-off-by Philippe Mathieu-Daudé<[email protected]>
Quoted 9 lines
--- target/arm/helper.h | 1 - target/arm/tcg/neon_helper.c | 5 ++++- target/arm/tcg/translate-a64.c | 4 ++++ target/arm/tcg/translate-neon.c | 6 ++++++ target/arm/tcg/translate-sme.c | 4 ++++ target/arm/tcg/translate.c | 4 ++++ target/arm/tcg/vec_helper.c | 4 ++++ 7 files changed, 26 insertions(+), 2 deletions(-)
r~
PATCH v3 15/34 target/arm/tcg: Export some generic vector helpers
In reply to Philippe Mathieu-DaudéWe want to extract gvec helpers to a new translate-gvec.c file. Some helpers will still be accessed out of it, from the current translate.c. Expose their prototype.
--- target/arm/tcg/translate.h | 5 +++++ target/arm/tcg/translate.c | 8 ++++---- 2 files changed, 9 insertions(+), 4 deletions(-)
target/arm/tcg/translate.h +5 -0
@@ -418,6 +418,11 @@ void gen_sshl_i32(TCGv_i32 d, TCGv_i32 a, TCGv_i32 b);void gen_ushl_i64 (TCGv_i64 d,TCGv_i64 a,TCGv_i64 b);void gen_sshl_i64 (TCGv_i64 d,TCGv_i64 a,TCGv_i64 b); +void gen_urshr32_i32 (TCGv_i32 d,TCGv_i32 a,int32_t sh); +void gen_srshr32_i32 (TCGv_i32 d,TCGv_i32 a,int32_t sh); +void gen_urshr64_i64 (TCGv_i64 d,TCGv_i64 a,int64_t sh); +void gen_srshr64_i64 (TCGv_i64 d,TCGv_i64 a,int64_t sh); +void gen_gvec_uqadd_qc (unsigned vece,uint32_t rd_ofs,uint32_t rn_ofs,uint32_t rm_ofs,uint32_t opr_sz,uint32_t max_sz); void gen_gvec_sqadd_qc(unsigned vece, uint32_t rd_ofs, uint32_t rn_ofs,
target/arm/tcg/translate.c +4 -4
@@ -1925,7 +1925,7 @@ static void gen_srshr16_i64(TCGv_i64 d, TCGv_i64 a, int64_t sh)tcg_gen_vec_add16_i64 (d, d, t); } -static void gen_srshr32_i32 (TCGv_i32 d,TCGv_i32 a,int32_t sh) +void gen_srshr32_i32 (TCGv_i32 d,TCGv_i32 a,int32_t sh) {TCGv_i32 t;
@@ -1940,7 +1940,7 @@ static void gen_srshr32_i32(TCGv_i32 d, TCGv_i32 a, int32_t sh)tcg_gen_add_i32 (d, d, t); } -static void gen_srshr64_i64 (TCGv_i64 d,TCGv_i64 a,int64_t sh) +void gen_srshr64_i64 (TCGv_i64 d,TCGv_i64 a,int64_t sh) {TCGv_i64 t =tcg_temp_new_i64 ();
@@ -2120,7 +2120,7 @@ static void gen_urshr16_i64(TCGv_i64 d, TCGv_i64 a, int64_t sh)tcg_gen_vec_add16_i64 (d, d, t); } -static void gen_urshr32_i32 (TCGv_i32 d,TCGv_i32 a,int32_t sh) +void gen_urshr32_i32 (TCGv_i32 d,TCGv_i32 a,int32_t sh) {TCGv_i32 t;
@@ -2135,7 +2135,7 @@ static void gen_urshr32_i32(TCGv_i32 d, TCGv_i32 a, int32_t sh)tcg_gen_add_i32 (d, d, t); } -static void gen_urshr64_i64 (TCGv_i64 d,TCGv_i64 a,int64_t sh) +void gen_urshr64_i64 (TCGv_i64 d,TCGv_i64 a,int64_t sh) {TCGv_i64 t =tcg_temp_new_i64 ();
Signature · 1 line
2.38.1
Re: [PATCH v3 15/34] target/arm/tcg: Export some generic vector helpers
Quoted 9 lines · Philippe Mathieu-Daudé
We want to extract gvec helpers to a new
translate-gvec.cfile. Some helpers will still be accessed out of it, from the currenttranslate.c. Expose their prototype.Signed-off-by Philippe Mathieu-Daudé<[email protected]>--- target/arm/tcg/translate.h | 5 +++++ target/arm/tcg/translate.c | 8 ++++---- 2 files changed, 9 insertions(+), 4 deletions(-)
r~
PATCH v3 16/34 target/arm/tcg: Extract generic vector helpers to translate-gvec.c
In reply to Philippe Mathieu-DaudéExtract 1600 lines from the big enough translate.c.
--- target/arm/tcg/translate-gvec.c | 1644 +++++++++++++++++++++++++++++++ target/arm/tcg/translate.c | 1630 ------------------------------ target/arm/tcg/meson.build | 1 + 3 files changed, 1645 insertions(+), 1630 deletions(-) create mode 100644 target/arm/tcg/translate-gvec.c
target/arm/tcg/translate-gvec.c new file +1644 -0
@@ -0,0 +1,1644 @@ +/* +* ARM AdvSIMD / SVE Vector Helpers +* +* Copyright (c) 2020 Linaro +* +* SPDX-License-Identifier: LGPL-2.1-or-later +*/ + +#include "qemu/osdep.h" +#include "translate.h" + +#define HELPER_H "tcg/helper-neon.h.inc" +#include "exec/helper-gen.h.inc" +#undef HELPER_H + +static void gen_gvec_fn3_qc (uint32_t rd_ofs,uint32_t rn_ofs,uint32_t rm_ofs, +uint32_t opr_sz,uint32_t max_sz, +gen_helper_gvec_3_ptr *fn) +{ +TCGv_ptr qc_ptr =tcg_temp_new_ptr (); + + tcg_gen_addi_ptr(qc_ptr, cpu_env, offsetof(CPUARMState, vfp.qc)); +tcg_gen_gvec_3_ptr (rd_ofs, rn_ofs, rm_ofs, qc_ptr, + opr_sz, max_sz,0 , fn); +} + +void gen_gvec_sqrdmlah_qc (unsigned vece,uint32_t rd_ofs,uint32_t rn_ofs, +uint32_t rm_ofs,uint32_t opr_sz,uint32_t max_sz) +{ +static gen_helper_gvec_3_ptr *const fns[2 ] = { + gen_helper_gvec_qrdmlah_s16, gen_helper_gvec_qrdmlah_s32 + }; +tcg_debug_assert (vece >=1 && vece <=2 ); +gen_gvec_fn3_qc (rd_ofs, rn_ofs, rm_ofs, opr_sz, max_sz, fns[vece -1 ]); +} + +void gen_gvec_sqrdmlsh_qc (unsigned vece,uint32_t rd_ofs,uint32_t rn_ofs, +uint32_t rm_ofs,uint32_t opr_sz,uint32_t max_sz) +{ +static gen_helper_gvec_3_ptr *const fns[2 ] = { + gen_helper_gvec_qrdmlsh_s16, gen_helper_gvec_qrdmlsh_s32 + }; +tcg_debug_assert (vece >=1 && vece <=2 ); +gen_gvec_fn3_qc (rd_ofs, rn_ofs, rm_ofs, opr_sz, max_sz, fns[vece -1 ]); +} + +#define GEN_CMP0 (NAME ,COND ) \ + static void gen_##NAME##0_i32(TCGv_i32 d, TCGv_i32 a) \ + { \ + tcg_gen_setcondi_i32(COND, d, a, 0); \ + tcg_gen_neg_i32(d, d); \ + } \ + static void gen_##NAME##0_i64(TCGv_i64 d, TCGv_i64 a) \ + { \ + tcg_gen_setcondi_i64(COND, d, a, 0); \ + tcg_gen_neg_i64(d, d); \ + } \ + static void gen_##NAME##0_vec(unsigned vece, TCGv_vec d, TCGv_vec a) \ + { \ + TCGv_vec zero = tcg_constant_vec_matching(d, vece, 0); \ + tcg_gen_cmp_vec(COND, vece, d, a, zero); \ + } \ + void gen_gvec_##NAME##0(unsigned vece, uint32_t d, uint32_t m, \ + uint32_t opr_sz, uint32_t max_sz) \ + { \ + const GVecGen2 op[4] = { \ + { .fno = gen_helper_gvec_##NAME##0_b, \ + .fniv = gen_##NAME##0_vec, \ + .opt_opc = vecop_list_cmp, \ + .vece = MO_8 }, \ + { .fno = gen_helper_gvec_##NAME##0_h, \ + .fniv = gen_##NAME##0_vec, \ + .opt_opc = vecop_list_cmp, \ + .vece = MO_16 }, \ + { .fni4 = gen_##NAME##0_i32, \ + .fniv = gen_##NAME##0_vec, \ + .opt_opc = vecop_list_cmp, \ + .vece = MO_32 }, \ + { .fni8 = gen_##NAME##0_i64, \ + .fniv = gen_##NAME##0_vec, \ + .opt_opc = vecop_list_cmp, \ + .prefer_i64 = TCG_TARGET_REG_BITS == 64, \ + .vece = MO_64 }, \ + }; \ + tcg_gen_gvec_2(d, m, opr_sz, max_sz, &op[vece]); \ + } + +static const TCGOpcode vecop_list_cmp[] = { + INDEX_op_cmp_vec,0 +}; + +GEN_CMP0(ceq, TCG_COND_EQ) +GEN_CMP0(cle, TCG_COND_LE) +GEN_CMP0(cge, TCG_COND_GE) +GEN_CMP0(clt, TCG_COND_LT) +GEN_CMP0(cgt, TCG_COND_GT) + +#undef GEN_CMP0 + +static void gen_ssra8_i64 (TCGv_i64 d,TCGv_i64 a,int64_t shift) +{ +tcg_gen_vec_sar8i_i64 (a, a, shift); +tcg_gen_vec_add8_i64 (d, d, a); +} + +static void gen_ssra16_i64 (TCGv_i64 d,TCGv_i64 a,int64_t shift) +{ +tcg_gen_vec_sar16i_i64 (a, a, shift); +tcg_gen_vec_add16_i64 (d, d, a); +} + +static void gen_ssra32_i32 (TCGv_i32 d,TCGv_i32 a,int32_t shift) +{ +tcg_gen_sari_i32 (a, a, shift); +tcg_gen_add_i32 (d, d, a); +} + +static void gen_ssra64_i64 (TCGv_i64 d,TCGv_i64 a,int64_t shift) +{ +tcg_gen_sari_i64 (a, a, shift); +tcg_gen_add_i64 (d, d, a); +} + +static void gen_ssra_vec (unsigned vece,TCGv_vec d,TCGv_vec a,int64_t sh) +{ +tcg_gen_sari_vec (vece, a, a, sh); +tcg_gen_add_vec (vece, d, d, a); +} + +void gen_gvec_ssra (unsigned vece,uint32_t rd_ofs,uint32_t rm_ofs, +int64_t shift,uint32_t opr_sz,uint32_t max_sz) +{ +static const TCGOpcode vecop_list[] = { + INDEX_op_sari_vec, INDEX_op_add_vec,0 + }; +static const GVecGen2i ops[4 ] = { + { .fni8 = gen_ssra8_i64, + .fniv = gen_ssra_vec, + .fno = gen_helper_gvec_ssra_b, + .load_dest = true, + .opt_opc = vecop_list, + .vece =MO_8 }, + { .fni8 = gen_ssra16_i64, + .fniv = gen_ssra_vec, + .fno = gen_helper_gvec_ssra_h, + .load_dest = true, + .opt_opc = vecop_list, + .vece =MO_16 }, + { .fni4 = gen_ssra32_i32, + .fniv = gen_ssra_vec, + .fno = gen_helper_gvec_ssra_s, + .load_dest = true, + .opt_opc = vecop_list, + .vece =MO_32 }, + { .fni8 = gen_ssra64_i64, + .fniv = gen_ssra_vec, + .fno = gen_helper_gvec_ssra_b, + .prefer_i64 =TCG_TARGET_REG_BITS ==64 , + .opt_opc = vecop_list, + .load_dest = true, + .vece =MO_64 }, + }; + +/* tszimm encoding produces immediates in the range [1..esize]. */ +tcg_debug_assert (shift >0 ); +tcg_debug_assert (shift <= (8 << vece)); + +/* +* Shifts larger than the element size are architecturally valid. +* Signed results in all sign bits. +*/ + shift =MIN (shift, (8 << vece) -1 ); +tcg_gen_gvec_2i (rd_ofs, rm_ofs, opr_sz, max_sz, shift, &ops[vece]); +} + +static void gen_usra8_i64 (TCGv_i64 d,TCGv_i64 a,int64_t shift) +{ +tcg_gen_vec_shr8i_i64 (a, a, shift); +tcg_gen_vec_add8_i64 (d, d, a); +} + +static void gen_usra16_i64 (TCGv_i64 d,TCGv_i64 a,int64_t shift) +{ +tcg_gen_vec_shr16i_i64 (a, a, shift); +tcg_gen_vec_add16_i64 (d, d, a); +} + +static void gen_usra32_i32 (TCGv_i32 d,TCGv_i32 a,int32_t shift) +{ +tcg_gen_shri_i32 (a, a, shift); +tcg_gen_add_i32 (d, d, a); +} + +static void gen_usra64_i64 (TCGv_i64 d,TCGv_i64 a,int64_t shift) +{ +tcg_gen_shri_i64 (a, a, shift); +tcg_gen_add_i64 (d, d, a); +} + +static void gen_usra_vec (unsigned vece,TCGv_vec d,TCGv_vec a,int64_t sh) +{ +tcg_gen_shri_vec (vece, a, a, sh); +tcg_gen_add_vec (vece, d, d, a); +} + +void gen_gvec_usra (unsigned vece,uint32_t rd_ofs,uint32_t rm_ofs, +int64_t shift,uint32_t opr_sz,uint32_t max_sz) +{ +static const TCGOpcode vecop_list[] = { + INDEX_op_shri_vec, INDEX_op_add_vec,0 + }; +static const GVecGen2i ops[4 ] = { + { .fni8 = gen_usra8_i64, + .fniv = gen_usra_vec, + .fno = gen_helper_gvec_usra_b, + .load_dest = true, + .opt_opc = vecop_list, + .vece =MO_8 , }, + { .fni8 = gen_usra16_i64, + .fniv = gen_usra_vec, + .fno = gen_helper_gvec_usra_h, + .load_dest = true, + .opt_opc = vecop_list, + .vece =MO_16 , }, + { .fni4 = gen_usra32_i32, + .fniv = gen_usra_vec, + .fno = gen_helper_gvec_usra_s, + .load_dest = true, + .opt_opc = vecop_list, + .vece =MO_32 , }, + { .fni8 = gen_usra64_i64, + .fniv = gen_usra_vec, + .fno = gen_helper_gvec_usra_d, + .prefer_i64 =TCG_TARGET_REG_BITS ==64 , + .load_dest = true, + .opt_opc = vecop_list, + .vece =MO_64 , }, + }; + +/* tszimm encoding produces immediates in the range [1..esize]. */ +tcg_debug_assert (shift >0 ); +tcg_debug_assert (shift <= (8 << vece)); + +/* +* Shifts larger than the element size are architecturally valid. +* Unsigned results in all zeros as input to accumulate: nop. +*/ +if (shift < (8 << vece)) { +tcg_gen_gvec_2i (rd_ofs, rm_ofs, opr_sz, max_sz, shift, &ops[vece]); + }else { +/* Nop, but we do need to clear the tail. */ +tcg_gen_gvec_mov (vece, rd_ofs, rd_ofs, opr_sz, max_sz); + } +} + +/* +* Shift one less than the requested amount, and the low bit is +* the rounding bit. For the 8 and 16-bit operations, because we +* mask the low bit, we can perform a normal integer shift instead +* of a vector shift. +*/ +static void gen_srshr8_i64 (TCGv_i64 d,TCGv_i64 a,int64_t sh) +{ +TCGv_i64 t =tcg_temp_new_i64 (); + +tcg_gen_shri_i64 (t, a, sh -1 ); +tcg_gen_andi_i64 (t, t,dup_const (MO_8 ,1 )); +tcg_gen_vec_sar8i_i64 (d, a, sh); +tcg_gen_vec_add8_i64 (d, d, t); +} + +static void gen_srshr16_i64 (TCGv_i64 d,TCGv_i64 a,int64_t sh) +{ +TCGv_i64 t =tcg_temp_new_i64 (); + +tcg_gen_shri_i64 (t, a, sh -1 ); +tcg_gen_andi_i64 (t, t,dup_const (MO_16 ,1 )); +tcg_gen_vec_sar16i_i64 (d, a, sh); +tcg_gen_vec_add16_i64 (d, d, t); +} + +void gen_srshr32_i32 (TCGv_i32 d,TCGv_i32 a,int32_t sh) +{ +TCGv_i32 t; + +/* Handle shift by the input size for the benefit of trans_SRSHR_ri */ +if (sh ==32 ) { +tcg_gen_movi_i32 (d,0 ); +return ; + } + t =tcg_temp_new_i32 (); +tcg_gen_extract_i32 (t, a, sh -1 ,1 ); +tcg_gen_sari_i32 (d, a, sh); +tcg_gen_add_i32 (d, d, t); +} + +void gen_srshr64_i64 (TCGv_i64 d,TCGv_i64 a,int64_t sh) +{ +TCGv_i64 t =tcg_temp_new_i64 (); + +tcg_gen_extract_i64 (t, a, sh -1 ,1 ); +tcg_gen_sari_i64 (d, a, sh); +tcg_gen_add_i64 (d, d, t); +} + +static void gen_srshr_vec (unsigned vece,TCGv_vec d,TCGv_vec a,int64_t sh) +{ +TCGv_vec t =tcg_temp_new_vec_matching (d); +TCGv_vec ones =tcg_temp_new_vec_matching (d); + +tcg_gen_shri_vec (vece, t, a, sh -1 ); +tcg_gen_dupi_vec (vece, ones,1 ); +tcg_gen_and_vec (vece, t, t, ones); +tcg_gen_sari_vec (vece, d, a, sh); +tcg_gen_add_vec (vece, d, d, t); +} + +void gen_gvec_srshr (unsigned vece,uint32_t rd_ofs,uint32_t rm_ofs, +int64_t shift,uint32_t opr_sz,uint32_t max_sz) +{ +static const TCGOpcode vecop_list[] = { + INDEX_op_shri_vec, INDEX_op_sari_vec, INDEX_op_add_vec,0 + }; +static const GVecGen2i ops[4 ] = { + { .fni8 = gen_srshr8_i64, + .fniv = gen_srshr_vec, + .fno = gen_helper_gvec_srshr_b, + .opt_opc = vecop_list, + .vece =MO_8 }, + { .fni8 = gen_srshr16_i64, + .fniv = gen_srshr_vec, + .fno = gen_helper_gvec_srshr_h, + .opt_opc = vecop_list, + .vece =MO_16 }, + { .fni4 = gen_srshr32_i32, + .fniv = gen_srshr_vec, + .fno = gen_helper_gvec_srshr_s, + .opt_opc = vecop_list, + .vece =MO_32 }, + { .fni8 = gen_srshr64_i64, + .fniv = gen_srshr_vec, + .fno = gen_helper_gvec_srshr_d, + .prefer_i64 =TCG_TARGET_REG_BITS ==64 , + .opt_opc = vecop_list, + .vece =MO_64 }, + }; + +/* tszimm encoding produces immediates in the range [1..esize] */ +tcg_debug_assert (shift >0 ); +tcg_debug_assert (shift <= (8 << vece)); + +if (shift == (8 << vece)) { +/* +* Shifts larger than the element size are architecturally valid. +* Signed results in all sign bits. With rounding, this produces +* (-1 + 1) >> 1 == 0, or (0 + 1) >> 1 == 0. +* I.e. always zero. +*/ +tcg_gen_gvec_dup_imm (vece, rd_ofs, opr_sz, max_sz,0 ); + }else { +tcg_gen_gvec_2i (rd_ofs, rm_ofs, opr_sz, max_sz, shift, &ops[vece]); + } +} + +static void gen_srsra8_i64 (TCGv_i64 d,TCGv_i64 a,int64_t sh) +{ +TCGv_i64 t =tcg_temp_new_i64 (); + +gen_srshr8_i64 (t, a, sh); +tcg_gen_vec_add8_i64 (d, d, t); +} + +static void gen_srsra16_i64 (TCGv_i64 d,TCGv_i64 a,int64_t sh) +{ +TCGv_i64 t =tcg_temp_new_i64 (); + +gen_srshr16_i64 (t, a, sh); +tcg_gen_vec_add16_i64 (d, d, t); +} + +static void gen_srsra32_i32 (TCGv_i32 d,TCGv_i32 a,int32_t sh) +{ +TCGv_i32 t =tcg_temp_new_i32 (); + +gen_srshr32_i32 (t, a, sh); +tcg_gen_add_i32 (d, d, t); +} + +static void gen_srsra64_i64 (TCGv_i64 d,TCGv_i64 a,int64_t sh) +{ +TCGv_i64 t =tcg_temp_new_i64 (); + +gen_srshr64_i64 (t, a, sh); +tcg_gen_add_i64 (d, d, t); +} + +static void gen_srsra_vec (unsigned vece,TCGv_vec d,TCGv_vec a,int64_t sh) +{ +TCGv_vec t =tcg_temp_new_vec_matching (d); + +gen_srshr_vec (vece, t, a, sh); +tcg_gen_add_vec (vece, d, d, t); +} + +void gen_gvec_srsra (unsigned vece,uint32_t rd_ofs,uint32_t rm_ofs, +int64_t shift,uint32_t opr_sz,uint32_t max_sz) +{ +static const TCGOpcode vecop_list[] = { + INDEX_op_shri_vec, INDEX_op_sari_vec, INDEX_op_add_vec,0 + }; +static const GVecGen2i ops[4 ] = { + { .fni8 = gen_srsra8_i64, + .fniv = gen_srsra_vec, + .fno = gen_helper_gvec_srsra_b, + .opt_opc = vecop_list, + .load_dest = true, + .vece =MO_8 }, + { .fni8 = gen_srsra16_i64, + .fniv = gen_srsra_vec, + .fno = gen_helper_gvec_srsra_h, + .opt_opc = vecop_list, + .load_dest = true, + .vece =MO_16 }, + { .fni4 = gen_srsra32_i32, + .fniv = gen_srsra_vec, + .fno = gen_helper_gvec_srsra_s, + .opt_opc = vecop_list, + .load_dest = true, + .vece =MO_32 }, + { .fni8 = gen_srsra64_i64, + .fniv = gen_srsra_vec, + .fno = gen_helper_gvec_srsra_d, + .prefer_i64 =TCG_TARGET_REG_BITS ==64 , + .opt_opc = vecop_list, + .load_dest = true, + .vece =MO_64 }, + }; + +/* tszimm encoding produces immediates in the range [1..esize] */ +tcg_debug_assert (shift >0 ); +tcg_debug_assert (shift <= (8 << vece)); + +/* +* Shifts larger than the element size are architecturally valid. +* Signed results in all sign bits. With rounding, this produces +* (-1 + 1) >> 1 == 0, or (0 + 1) >> 1 == 0. +* I.e. always zero. With accumulation, this leaves D unchanged. +*/ +if (shift == (8 << vece)) { +/* Nop, but we do need to clear the tail. */ +tcg_gen_gvec_mov (vece, rd_ofs, rd_ofs, opr_sz, max_sz); + }else { +tcg_gen_gvec_2i (rd_ofs, rm_ofs, opr_sz, max_sz, shift, &ops[vece]); + } +} + +static void gen_urshr8_i64 (TCGv_i64 d,TCGv_i64 a,int64_t sh) +{ +TCGv_i64 t =tcg_temp_new_i64 (); + +tcg_gen_shri_i64 (t, a, sh -1 ); +tcg_gen_andi_i64 (t, t,dup_const (MO_8 ,1 )); +tcg_gen_vec_shr8i_i64 (d, a, sh); +tcg_gen_vec_add8_i64 (d, d, t); +} + +static void gen_urshr16_i64 (TCGv_i64 d,TCGv_i64 a,int64_t sh) +{ +TCGv_i64 t =tcg_temp_new_i64 (); + +tcg_gen_shri_i64 (t, a, sh -1 ); +tcg_gen_andi_i64 (t, t,dup_const (MO_16 ,1 )); +tcg_gen_vec_shr16i_i64 (d, a, sh); +tcg_gen_vec_add16_i64 (d, d, t); +} + +void gen_urshr32_i32 (TCGv_i32 d,TCGv_i32 a,int32_t sh) +{ +TCGv_i32 t; + +/* Handle shift by the input size for the benefit of trans_URSHR_ri */ +if (sh ==32 ) { +tcg_gen_extract_i32 (d, a, sh -1 ,1 ); +return ; + } + t =tcg_temp_new_i32 (); +tcg_gen_extract_i32 (t, a, sh -1 ,1 ); +tcg_gen_shri_i32 (d, a, sh); +tcg_gen_add_i32 (d, d, t); +} + +void gen_urshr64_i64 (TCGv_i64 d,TCGv_i64 a,int64_t sh) +{ +TCGv_i64 t =tcg_temp_new_i64 (); + +tcg_gen_extract_i64 (t, a, sh -1 ,1 ); +tcg_gen_shri_i64 (d, a, sh); +tcg_gen_add_i64 (d, d, t); +} + +static void gen_urshr_vec (unsigned vece,TCGv_vec d,TCGv_vec a,int64_t shift) +{ +TCGv_vec t =tcg_temp_new_vec_matching (d); +TCGv_vec ones =tcg_temp_new_vec_matching (d); + +tcg_gen_shri_vec (vece, t, a, shift -1 ); +tcg_gen_dupi_vec (vece, ones,1 ); +tcg_gen_and_vec (vece, t, t, ones); +tcg_gen_shri_vec (vece, d, a, shift); +tcg_gen_add_vec (vece, d, d, t); +} + +void gen_gvec_urshr (unsigned vece,uint32_t rd_ofs,uint32_t rm_ofs, +int64_t shift,uint32_t opr_sz,uint32_t max_sz) +{ +static const TCGOpcode vecop_list[] = { + INDEX_op_shri_vec, INDEX_op_add_vec,0 + }; +static const GVecGen2i ops[4 ] = { + { .fni8 = gen_urshr8_i64, + .fniv = gen_urshr_vec, + .fno = gen_helper_gvec_urshr_b, + .opt_opc = vecop_list, + .vece =MO_8 }, + { .fni8 = gen_urshr16_i64, + .fniv = gen_urshr_vec, + .fno = gen_helper_gvec_urshr_h, + .opt_opc = vecop_list, + .vece =MO_16 }, + { .fni4 = gen_urshr32_i32, + .fniv = gen_urshr_vec, + .fno = gen_helper_gvec_urshr_s, + .opt_opc = vecop_list, + .vece =MO_32 }, + { .fni8 = gen_urshr64_i64, + .fniv = gen_urshr_vec, + .fno = gen_helper_gvec_urshr_d, + .prefer_i64 =TCG_TARGET_REG_BITS ==64 , + .opt_opc = vecop_list, + .vece =MO_64 }, + }; + +/* tszimm encoding produces immediates in the range [1..esize] */ +tcg_debug_assert (shift >0 ); +tcg_debug_assert (shift <= (8 << vece)); + +if (shift == (8 << vece)) { +/* +* Shifts larger than the element size are architecturally valid. +* Unsigned results in zero. With rounding, this produces a +* copy of the most significant bit. +*/ +tcg_gen_gvec_shri (vece, rd_ofs, rm_ofs, shift -1 , opr_sz, max_sz); + }else { +tcg_gen_gvec_2i (rd_ofs, rm_ofs, opr_sz, max_sz, shift, &ops[vece]); + } +} + +static void gen_ursra8_i64 (TCGv_i64 d,TCGv_i64 a,int64_t sh) +{ +TCGv_i64 t =tcg_temp_new_i64 (); + +if (sh ==8 ) { +tcg_gen_vec_shr8i_i64 (t, a,7 ); + }else { +gen_urshr8_i64 (t, a, sh); + } +tcg_gen_vec_add8_i64 (d, d, t); +} + +static void gen_ursra16_i64 (TCGv_i64 d,TCGv_i64 a,int64_t sh) +{ +TCGv_i64 t =tcg_temp_new_i64 (); + +if (sh ==16 ) { +tcg_gen_vec_shr16i_i64 (t, a,15 ); + }else { +gen_urshr16_i64 (t, a, sh); + } +tcg_gen_vec_add16_i64 (d, d, t); +} + +static void gen_ursra32_i32 (TCGv_i32 d,TCGv_i32 a,int32_t sh) +{ +TCGv_i32 t =tcg_temp_new_i32 (); + +if (sh ==32 ) { +tcg_gen_shri_i32 (t, a,31 ); + }else { +gen_urshr32_i32 (t, a, sh); + } +tcg_gen_add_i32 (d, d, t); +} + +static void gen_ursra64_i64 (TCGv_i64 d,TCGv_i64 a,int64_t sh) +{ +TCGv_i64 t =tcg_temp_new_i64 (); + +if (sh ==64 ) { +tcg_gen_shri_i64 (t, a,63 ); + }else { +gen_urshr64_i64 (t, a, sh); + } +tcg_gen_add_i64 (d, d, t); +} + +static void gen_ursra_vec (unsigned vece,TCGv_vec d,TCGv_vec a,int64_t sh) +{ +TCGv_vec t =tcg_temp_new_vec_matching (d); + +if (sh == (8 << vece)) { +tcg_gen_shri_vec (vece, t, a, sh -1 ); + }else { +gen_urshr_vec (vece, t, a, sh); + } +tcg_gen_add_vec (vece, d, d, t); +} + +void gen_gvec_ursra (unsigned vece,uint32_t rd_ofs,uint32_t rm_ofs, +int64_t shift,uint32_t opr_sz,uint32_t max_sz) +{ +static const TCGOpcode vecop_list[] = { + INDEX_op_shri_vec, INDEX_op_add_vec,0 + }; +static const GVecGen2i ops[4 ] = { + { .fni8 = gen_ursra8_i64, + .fniv = gen_ursra_vec, + .fno = gen_helper_gvec_ursra_b, + .opt_opc = vecop_list, + .load_dest = true, + .vece =MO_8 }, + { .fni8 = gen_ursra16_i64, + .fniv = gen_ursra_vec, + .fno = gen_helper_gvec_ursra_h, + .opt_opc = vecop_list, + .load_dest = true, + .vece =MO_16 }, + { .fni4 = gen_ursra32_i32, + .fniv = gen_ursra_vec, + .fno = gen_helper_gvec_ursra_s, + .opt_opc = vecop_list, + .load_dest = true, + .vece =MO_32 }, + { .fni8 = gen_ursra64_i64, + .fniv = gen_ursra_vec, + .fno = gen_helper_gvec_ursra_d, + .prefer_i64 =TCG_TARGET_REG_BITS ==64 , + .opt_opc = vecop_list, + .load_dest = true, + .vece =MO_64 }, + }; + +/* tszimm encoding produces immediates in the range [1..esize] */ +tcg_debug_assert (shift >0 ); +tcg_debug_assert (shift <= (8 << vece)); + +tcg_gen_gvec_2i (rd_ofs, rm_ofs, opr_sz, max_sz, shift, &ops[vece]); +} + +static void gen_shr8_ins_i64 (TCGv_i64 d,TCGv_i64 a,int64_t shift) +{ +uint64_t mask =dup_const (MO_8 ,0xff >> shift); +TCGv_i64 t =tcg_temp_new_i64 (); + +tcg_gen_shri_i64 (t, a, shift); +tcg_gen_andi_i64 (t, t, mask); +tcg_gen_andi_i64 (d, d, ~mask); +tcg_gen_or_i64 (d, d, t); +} + +static void gen_shr16_ins_i64 (TCGv_i64 d,TCGv_i64 a,int64_t shift) +{ +uint64_t mask =dup_const (MO_16 ,0xffff >> shift); +TCGv_i64 t =tcg_temp_new_i64 (); + +tcg_gen_shri_i64 (t, a, shift); +tcg_gen_andi_i64 (t, t, mask); +tcg_gen_andi_i64 (d, d, ~mask); +tcg_gen_or_i64 (d, d, t); +} + +static void gen_shr32_ins_i32 (TCGv_i32 d,TCGv_i32 a,int32_t shift) +{ +tcg_gen_shri_i32 (a, a, shift); +tcg_gen_deposit_i32 (d, d, a,0 ,32 - shift); +} + +static void gen_shr64_ins_i64 (TCGv_i64 d,TCGv_i64 a,int64_t shift) +{ +tcg_gen_shri_i64 (a, a, shift); +tcg_gen_deposit_i64 (d, d, a,0 ,64 - shift); +} + +static void gen_shr_ins_vec (unsigned vece,TCGv_vec d,TCGv_vec a,int64_t sh) +{ +TCGv_vec t =tcg_temp_new_vec_matching (d); +TCGv_vec m =tcg_temp_new_vec_matching (d); + +tcg_gen_dupi_vec (vece, m,MAKE_64BIT_MASK ((8 << vece) - sh, sh)); +tcg_gen_shri_vec (vece, t, a, sh); +tcg_gen_and_vec (vece, d, d, m); +tcg_gen_or_vec (vece, d, d, t); +} + +void gen_gvec_sri (unsigned vece,uint32_t rd_ofs,uint32_t rm_ofs, +int64_t shift,uint32_t opr_sz,uint32_t max_sz) +{ +static const TCGOpcode vecop_list[] = { INDEX_op_shri_vec,0 }; +const GVecGen2i ops[4 ] = { + { .fni8 = gen_shr8_ins_i64, + .fniv = gen_shr_ins_vec, + .fno = gen_helper_gvec_sri_b, + .load_dest = true, + .opt_opc = vecop_list, + .vece =MO_8 }, + { .fni8 = gen_shr16_ins_i64, + .fniv = gen_shr_ins_vec, + .fno = gen_helper_gvec_sri_h, + .load_dest = true, + .opt_opc = vecop_list, + .vece =MO_16 }, + { .fni4 = gen_shr32_ins_i32, + .fniv = gen_shr_ins_vec, + .fno = gen_helper_gvec_sri_s, + .load_dest = true, + .opt_opc = vecop_list, + .vece =MO_32 }, + { .fni8 = gen_shr64_ins_i64, + .fniv = gen_shr_ins_vec, + .fno = gen_helper_gvec_sri_d, + .prefer_i64 =TCG_TARGET_REG_BITS ==64 , + .load_dest = true, + .opt_opc = vecop_list, + .vece =MO_64 }, + }; + +/* tszimm encoding produces immediates in the range [1..esize]. */ +tcg_debug_assert (shift >0 ); +tcg_debug_assert (shift <= (8 << vece)); + +/* Shift of esize leaves destination unchanged. */ +if (shift < (8 << vece)) { +tcg_gen_gvec_2i (rd_ofs, rm_ofs, opr_sz, max_sz, shift, &ops[vece]); + }else { +/* Nop, but we do need to clear the tail. */ +tcg_gen_gvec_mov (vece, rd_ofs, rd_ofs, opr_sz, max_sz); + } +} + +static void gen_shl8_ins_i64 (TCGv_i64 d,TCGv_i64 a,int64_t shift) +{ +uint64_t mask =dup_const (MO_8 ,0xff << shift); +TCGv_i64 t =tcg_temp_new_i64 (); + +tcg_gen_shli_i64 (t, a, shift); +tcg_gen_andi_i64 (t, t, mask); +tcg_gen_andi_i64 (d, d, ~mask); +tcg_gen_or_i64 (d, d, t); +} + +static void gen_shl16_ins_i64 (TCGv_i64 d,TCGv_i64 a,int64_t shift) +{ +uint64_t mask =dup_const (MO_16 ,0xffff << shift); +TCGv_i64 t =tcg_temp_new_i64 (); + +tcg_gen_shli_i64 (t, a, shift); +tcg_gen_andi_i64 (t, t, mask); +tcg_gen_andi_i64 (d, d, ~mask); +tcg_gen_or_i64 (d, d, t); +} + +static void gen_shl32_ins_i32 (TCGv_i32 d,TCGv_i32 a,int32_t shift) +{ +tcg_gen_deposit_i32 (d, d, a, shift,32 - shift); +} + +static void gen_shl64_ins_i64 (TCGv_i64 d,TCGv_i64 a,int64_t shift) +{ +tcg_gen_deposit_i64 (d, d, a, shift,64 - shift); +} + +static void gen_shl_ins_vec (unsigned vece,TCGv_vec d,TCGv_vec a,int64_t sh) +{ +TCGv_vec t =tcg_temp_new_vec_matching (d); +TCGv_vec m =tcg_temp_new_vec_matching (d); + +tcg_gen_shli_vec (vece, t, a, sh); +tcg_gen_dupi_vec (vece, m,MAKE_64BIT_MASK (0 , sh)); +tcg_gen_and_vec (vece, d, d, m); +tcg_gen_or_vec (vece, d, d, t); +} + +void gen_gvec_sli (unsigned vece,uint32_t rd_ofs,uint32_t rm_ofs, +int64_t shift,uint32_t opr_sz,uint32_t max_sz) +{ +static const TCGOpcode vecop_list[] = { INDEX_op_shli_vec,0 }; +const GVecGen2i ops[4 ] = { + { .fni8 = gen_shl8_ins_i64, + .fniv = gen_shl_ins_vec, + .fno = gen_helper_gvec_sli_b, + .load_dest = true, + .opt_opc = vecop_list, + .vece =MO_8 }, + { .fni8 = gen_shl16_ins_i64, + .fniv = gen_shl_ins_vec, + .fno = gen_helper_gvec_sli_h, + .load_dest = true, + .opt_opc = vecop_list, + .vece =MO_16 }, + { .fni4 = gen_shl32_ins_i32, + .fniv = gen_shl_ins_vec, + .fno = gen_helper_gvec_sli_s, + .load_dest = true, + .opt_opc = vecop_list, + .vece =MO_32 }, + { .fni8 = gen_shl64_ins_i64, + .fniv = gen_shl_ins_vec, + .fno = gen_helper_gvec_sli_d, + .prefer_i64 =TCG_TARGET_REG_BITS ==64 , + .load_dest = true, + .opt_opc = vecop_list, + .vece =MO_64 }, + }; + +/* tszimm encoding produces immediates in the range [0..esize-1]. */ +tcg_debug_assert (shift >=0 ); +tcg_debug_assert (shift < (8 << vece)); + +if (shift ==0 ) { +tcg_gen_gvec_mov (vece, rd_ofs, rm_ofs, opr_sz, max_sz); + }else { +tcg_gen_gvec_2i (rd_ofs, rm_ofs, opr_sz, max_sz, shift, &ops[vece]); + } +} + +static void gen_mla8_i32 (TCGv_i32 d,TCGv_i32 a,TCGv_i32 b) +{ +gen_helper_neon_mul_u8 (a, a, b); +gen_helper_neon_add_u8 (d, d, a); +} + +static void gen_mls8_i32 (TCGv_i32 d,TCGv_i32 a,TCGv_i32 b) +{ +gen_helper_neon_mul_u8 (a, a, b); +gen_helper_neon_sub_u8 (d, d, a); +} + +static void gen_mla16_i32 (TCGv_i32 d,TCGv_i32 a,TCGv_i32 b) +{ +gen_helper_neon_mul_u16 (a, a, b); +gen_helper_neon_add_u16 (d, d, a); +} + +static void gen_mls16_i32 (TCGv_i32 d,TCGv_i32 a,TCGv_i32 b) +{ +gen_helper_neon_mul_u16 (a, a, b); +gen_helper_neon_sub_u16 (d, d, a); +} + +static void gen_mla32_i32 (TCGv_i32 d,TCGv_i32 a,TCGv_i32 b) +{ +tcg_gen_mul_i32 (a, a, b); +tcg_gen_add_i32 (d, d, a); +} + +static void gen_mls32_i32 (TCGv_i32 d,TCGv_i32 a,TCGv_i32 b) +{ +tcg_gen_mul_i32 (a, a, b); +tcg_gen_sub_i32 (d, d, a); +} + +static void gen_mla64_i64 (TCGv_i64 d,TCGv_i64 a,TCGv_i64 b) +{ +tcg_gen_mul_i64 (a, a, b); +tcg_gen_add_i64 (d, d, a); +} + +static void gen_mls64_i64 (TCGv_i64 d,TCGv_i64 a,TCGv_i64 b) +{ +tcg_gen_mul_i64 (a, a, b); +tcg_gen_sub_i64 (d, d, a); +} + +static void gen_mla_vec (unsigned vece,TCGv_vec d,TCGv_vec a,TCGv_vec b) +{ +tcg_gen_mul_vec (vece, a, a, b); +tcg_gen_add_vec (vece, d, d, a); +} + +static void gen_mls_vec (unsigned vece,TCGv_vec d,TCGv_vec a,TCGv_vec b) +{ +tcg_gen_mul_vec (vece, a, a, b); +tcg_gen_sub_vec (vece, d, d, a); +} + +/* Note that while NEON does not support VMLA and VMLS as 64-bit ops, +* these tables are shared with AArch64 which does support them. +*/ +void gen_gvec_mla (unsigned vece,uint32_t rd_ofs,uint32_t rn_ofs, +uint32_t rm_ofs,uint32_t opr_sz,uint32_t max_sz) +{ +static const TCGOpcode vecop_list[] = { + INDEX_op_mul_vec, INDEX_op_add_vec,0 + }; +static const GVecGen3 ops[4 ] = { + { .fni4 = gen_mla8_i32, + .fniv = gen_mla_vec, + .load_dest = true, + .opt_opc = vecop_list, + .vece =MO_8 }, + { .fni4 = gen_mla16_i32, + .fniv = gen_mla_vec, + .load_dest = true, + .opt_opc = vecop_list, + .vece =MO_16 }, + { .fni4 = gen_mla32_i32, + .fniv = gen_mla_vec, + .load_dest = true, + .opt_opc = vecop_list, + .vece =MO_32 }, + { .fni8 = gen_mla64_i64, + .fniv = gen_mla_vec, + .prefer_i64 =TCG_TARGET_REG_BITS ==64 , + .load_dest = true, + .opt_opc = vecop_list, + .vece =MO_64 }, + }; +tcg_gen_gvec_3 (rd_ofs, rn_ofs, rm_ofs, opr_sz, max_sz, &ops[vece]); +} + +void gen_gvec_mls (unsigned vece,uint32_t rd_ofs,uint32_t rn_ofs, +uint32_t rm_ofs,uint32_t opr_sz,uint32_t max_sz) +{ +static const TCGOpcode vecop_list[] = { + INDEX_op_mul_vec, INDEX_op_sub_vec,0 + }; +static const GVecGen3 ops[4 ] = { + { .fni4 = gen_mls8_i32, + .fniv = gen_mls_vec, + .load_dest = true, + .opt_opc = vecop_list, + .vece =MO_8 }, + { .fni4 = gen_mls16_i32, + .fniv = gen_mls_vec, + .load_dest = true, + .opt_opc = vecop_list, + .vece =MO_16 }, + { .fni4 = gen_mls32_i32, + .fniv = gen_mls_vec, + .load_dest = true, + .opt_opc = vecop_list, + .vece =MO_32 }, + { .fni8 = gen_mls64_i64, + .fniv = gen_mls_vec, + .prefer_i64 =TCG_TARGET_REG_BITS ==64 , + .load_dest = true, + .opt_opc = vecop_list, + .vece =MO_64 }, + }; +tcg_gen_gvec_3 (rd_ofs, rn_ofs, rm_ofs, opr_sz, max_sz, &ops[vece]); +} + +/* CMTST : test is "if (X & Y != 0)". */ +static void gen_cmtst_i32 (TCGv_i32 d,TCGv_i32 a,TCGv_i32 b) +{ +tcg_gen_and_i32 (d, a, b); +tcg_gen_setcondi_i32 (TCG_COND_NE , d, d,0 ); +tcg_gen_neg_i32 (d, d); +} + +void gen_cmtst_i64 (TCGv_i64 d,TCGv_i64 a,TCGv_i64 b) +{ +tcg_gen_and_i64 (d, a, b); +tcg_gen_setcondi_i64 (TCG_COND_NE , d, d,0 ); +tcg_gen_neg_i64 (d, d); +} + +static void gen_cmtst_vec (unsigned vece,TCGv_vec d,TCGv_vec a,TCGv_vec b) +{ +tcg_gen_and_vec (vece, d, a, b); +tcg_gen_dupi_vec (vece, a,0 ); +tcg_gen_cmp_vec (TCG_COND_NE , vece, d, d, a); +} + +void gen_gvec_cmtst (unsigned vece,uint32_t rd_ofs,uint32_t rn_ofs, +uint32_t rm_ofs,uint32_t opr_sz,uint32_t max_sz) +{ +static const TCGOpcode vecop_list[] = { INDEX_op_cmp_vec,0 }; +static const GVecGen3 ops[4 ] = { + { .fni4 = gen_helper_neon_tst_u8, + .fniv = gen_cmtst_vec, + .opt_opc = vecop_list, + .vece =MO_8 }, + { .fni4 = gen_helper_neon_tst_u16, + .fniv = gen_cmtst_vec, + .opt_opc = vecop_list, + .vece =MO_16 }, + { .fni4 = gen_cmtst_i32, + .fniv = gen_cmtst_vec, + .opt_opc = vecop_list, + .vece =MO_32 }, + { .fni8 = gen_cmtst_i64, + .fniv = gen_cmtst_vec, + .prefer_i64 =TCG_TARGET_REG_BITS ==64 , + .opt_opc = vecop_list, + .vece =MO_64 }, + }; +tcg_gen_gvec_3 (rd_ofs, rn_ofs, rm_ofs, opr_sz, max_sz, &ops[vece]); +} + +void gen_ushl_i32 (TCGv_i32 dst,TCGv_i32 src,TCGv_i32 shift) +{ +TCGv_i32 lval =tcg_temp_new_i32 (); +TCGv_i32 rval =tcg_temp_new_i32 (); +TCGv_i32 lsh =tcg_temp_new_i32 (); +TCGv_i32 rsh =tcg_temp_new_i32 (); +TCGv_i32 zero =tcg_constant_i32 (0 ); +TCGv_i32 max =tcg_constant_i32 (32 ); + +/* +* Rely on the TCG guarantee that out of range shifts produce +* unspecified results, not undefined behaviour (i.e. no trap). +* Discard out-of-range results after the fact. +*/ +tcg_gen_ext8s_i32 (lsh, shift); +tcg_gen_neg_i32 (rsh, lsh); +tcg_gen_shl_i32 (lval, src, lsh); +tcg_gen_shr_i32 (rval, src, rsh); +tcg_gen_movcond_i32 (TCG_COND_LTU , dst, lsh, max, lval, zero); +tcg_gen_movcond_i32 (TCG_COND_LTU , dst, rsh, max, rval, dst); +} + +void gen_ushl_i64 (TCGv_i64 dst,TCGv_i64 src,TCGv_i64 shift) +{ +TCGv_i64 lval =tcg_temp_new_i64 (); +TCGv_i64 rval =tcg_temp_new_i64 (); +TCGv_i64 lsh =tcg_temp_new_i64 (); +TCGv_i64 rsh =tcg_temp_new_i64 (); +TCGv_i64 zero =tcg_constant_i64 (0 ); +TCGv_i64 max =tcg_constant_i64 (64 ); + +/* +* Rely on the TCG guarantee that out of range shifts produce +* unspecified results, not undefined behaviour (i.e. no trap). +* Discard out-of-range results after the fact. +*/ +tcg_gen_ext8s_i64 (lsh, shift); +tcg_gen_neg_i64 (rsh, lsh); +tcg_gen_shl_i64 (lval, src, lsh); +tcg_gen_shr_i64 (rval, src, rsh); +tcg_gen_movcond_i64 (TCG_COND_LTU , dst, lsh, max, lval, zero); +tcg_gen_movcond_i64 (TCG_COND_LTU , dst, rsh, max, rval, dst); +} + +static void gen_ushl_vec (unsigned vece,TCGv_vec dst, +TCGv_vec src,TCGv_vec shift) +{ +TCGv_vec lval =tcg_temp_new_vec_matching (dst); +TCGv_vec rval =tcg_temp_new_vec_matching (dst); +TCGv_vec lsh =tcg_temp_new_vec_matching (dst); +TCGv_vec rsh =tcg_temp_new_vec_matching (dst); +TCGv_vec msk, max; + +tcg_gen_neg_vec (vece, rsh, shift); +if (vece ==MO_8 ) { +tcg_gen_mov_vec (lsh, shift); + }else { + msk =tcg_temp_new_vec_matching (dst); +tcg_gen_dupi_vec (vece, msk,0xff ); +tcg_gen_and_vec (vece, lsh, shift, msk); +tcg_gen_and_vec (vece, rsh, rsh, msk); + } + +/* +* Rely on the TCG guarantee that out of range shifts produce +* unspecified results, not undefined behaviour (i.e. no trap). +* Discard out-of-range results after the fact. +*/ +tcg_gen_shlv_vec (vece, lval, src, lsh); +tcg_gen_shrv_vec (vece, rval, src, rsh); + + max =tcg_temp_new_vec_matching (dst); +tcg_gen_dupi_vec (vece, max,8 << vece); + +/* +* The choice of LT (signed) and GEU (unsigned) are biased toward +* the instructions of the x86_64 host. For MO_8, the whole byte +* is significant so we must use an unsigned compare; otherwise we +* have already masked to a byte and so a signed compare works. +* Other tcg hosts have a full set of comparisons and do not care. +*/ +if (vece ==MO_8 ) { +tcg_gen_cmp_vec (TCG_COND_GEU , vece, lsh, lsh, max); +tcg_gen_cmp_vec (TCG_COND_GEU , vece, rsh, rsh, max); +tcg_gen_andc_vec (vece, lval, lval, lsh); +tcg_gen_andc_vec (vece, rval, rval, rsh); + }else { +tcg_gen_cmp_vec (TCG_COND_LT , vece, lsh, lsh, max); +tcg_gen_cmp_vec (TCG_COND_LT , vece, rsh, rsh, max); +tcg_gen_and_vec (vece, lval, lval, lsh); +tcg_gen_and_vec (vece, rval, rval, rsh); + } +tcg_gen_or_vec (vece, dst, lval, rval); +} + +void gen_gvec_ushl (unsigned vece,uint32_t rd_ofs,uint32_t rn_ofs, +uint32_t rm_ofs,uint32_t opr_sz,uint32_t max_sz) +{ +static const TCGOpcode vecop_list[] = { + INDEX_op_neg_vec, INDEX_op_shlv_vec, + INDEX_op_shrv_vec, INDEX_op_cmp_vec,0 + }; +static const GVecGen3 ops[4 ] = { + { .fniv = gen_ushl_vec, + .fno = gen_helper_gvec_ushl_b, + .opt_opc = vecop_list, + .vece =MO_8 }, + { .fniv = gen_ushl_vec, + .fno = gen_helper_gvec_ushl_h, + .opt_opc = vecop_list, + .vece =MO_16 }, + { .fni4 = gen_ushl_i32, + .fniv = gen_ushl_vec, + .opt_opc = vecop_list, + .vece =MO_32 }, + { .fni8 = gen_ushl_i64, + .fniv = gen_ushl_vec, + .opt_opc = vecop_list, + .vece =MO_64 }, + }; +tcg_gen_gvec_3 (rd_ofs, rn_ofs, rm_ofs, opr_sz, max_sz, &ops[vece]); +} + +void gen_sshl_i32 (TCGv_i32 dst,TCGv_i32 src,TCGv_i32 shift) +{ +TCGv_i32 lval =tcg_temp_new_i32 (); +TCGv_i32 rval =tcg_temp_new_i32 (); +TCGv_i32 lsh =tcg_temp_new_i32 (); +TCGv_i32 rsh =tcg_temp_new_i32 (); +TCGv_i32 zero =tcg_constant_i32 (0 ); +TCGv_i32 max =tcg_constant_i32 (31 ); + +/* +* Rely on the TCG guarantee that out of range shifts produce +* unspecified results, not undefined behaviour (i.e. no trap). +* Discard out-of-range results after the fact. +*/ +tcg_gen_ext8s_i32 (lsh, shift); +tcg_gen_neg_i32 (rsh, lsh); +tcg_gen_shl_i32 (lval, src, lsh); +tcg_gen_umin_i32 (rsh, rsh, max); +tcg_gen_sar_i32 (rval, src, rsh); +tcg_gen_movcond_i32 (TCG_COND_LEU , lval, lsh, max, lval, zero); +tcg_gen_movcond_i32 (TCG_COND_LT , dst, lsh, zero, rval, lval); +} + +void gen_sshl_i64 (TCGv_i64 dst,TCGv_i64 src,TCGv_i64 shift) +{ +TCGv_i64 lval =tcg_temp_new_i64 (); +TCGv_i64 rval =tcg_temp_new_i64 (); +TCGv_i64 lsh =tcg_temp_new_i64 (); +TCGv_i64 rsh =tcg_temp_new_i64 (); +TCGv_i64 zero =tcg_constant_i64 (0 ); +TCGv_i64 max =tcg_constant_i64 (63 ); + +/* +* Rely on the TCG guarantee that out of range shifts produce +* unspecified results, not undefined behaviour (i.e. no trap). +* Discard out-of-range results after the fact. +*/ +tcg_gen_ext8s_i64 (lsh, shift); +tcg_gen_neg_i64 (rsh, lsh); +tcg_gen_shl_i64 (lval, src, lsh); +tcg_gen_umin_i64 (rsh, rsh, max); +tcg_gen_sar_i64 (rval, src, rsh); +tcg_gen_movcond_i64 (TCG_COND_LEU , lval, lsh, max, lval, zero); +tcg_gen_movcond_i64 (TCG_COND_LT , dst, lsh, zero, rval, lval); +} + +static void gen_sshl_vec (unsigned vece,TCGv_vec dst, +TCGv_vec src,TCGv_vec shift) +{ +TCGv_vec lval =tcg_temp_new_vec_matching (dst); +TCGv_vec rval =tcg_temp_new_vec_matching (dst); +TCGv_vec lsh =tcg_temp_new_vec_matching (dst); +TCGv_vec rsh =tcg_temp_new_vec_matching (dst); +TCGv_vec tmp =tcg_temp_new_vec_matching (dst); + +/* +* Rely on the TCG guarantee that out of range shifts produce +* unspecified results, not undefined behaviour (i.e. no trap). +* Discard out-of-range results after the fact. +*/ +tcg_gen_neg_vec (vece, rsh, shift); +if (vece ==MO_8 ) { +tcg_gen_mov_vec (lsh, shift); + }else { +tcg_gen_dupi_vec (vece, tmp,0xff ); +tcg_gen_and_vec (vece, lsh, shift, tmp); +tcg_gen_and_vec (vece, rsh, rsh, tmp); + } + +/* Bound rsh so out of bound right shift gets -1. */ +tcg_gen_dupi_vec (vece, tmp, (8 << vece) -1 ); +tcg_gen_umin_vec (vece, rsh, rsh, tmp); +tcg_gen_cmp_vec (TCG_COND_GT , vece, tmp, lsh, tmp); + +tcg_gen_shlv_vec (vece, lval, src, lsh); +tcg_gen_sarv_vec (vece, rval, src, rsh); + +/* Select in-bound left shift. */ +tcg_gen_andc_vec (vece, lval, lval, tmp); + +/* Select between left and right shift. */ +if (vece ==MO_8 ) { +tcg_gen_dupi_vec (vece, tmp,0 ); +tcg_gen_cmpsel_vec (TCG_COND_LT , vece, dst, lsh, tmp, rval, lval); + }else { +tcg_gen_dupi_vec (vece, tmp,0x80 ); +tcg_gen_cmpsel_vec (TCG_COND_LT , vece, dst, lsh, tmp, lval, rval); + } +} + +void gen_gvec_sshl (unsigned vece,uint32_t rd_ofs,uint32_t rn_ofs, +uint32_t rm_ofs,uint32_t opr_sz,uint32_t max_sz) +{ +static const TCGOpcode vecop_list[] = { + INDEX_op_neg_vec, INDEX_op_umin_vec, INDEX_op_shlv_vec, + INDEX_op_sarv_vec, INDEX_op_cmp_vec, INDEX_op_cmpsel_vec,0 + }; +static const GVecGen3 ops[4 ] = { + { .fniv = gen_sshl_vec, + .fno = gen_helper_gvec_sshl_b, + .opt_opc = vecop_list, + .vece =MO_8 }, + { .fniv = gen_sshl_vec, + .fno = gen_helper_gvec_sshl_h, + .opt_opc = vecop_list, + .vece =MO_16 }, + { .fni4 = gen_sshl_i32, + .fniv = gen_sshl_vec, + .opt_opc = vecop_list, + .vece =MO_32 }, + { .fni8 = gen_sshl_i64, + .fniv = gen_sshl_vec, + .opt_opc = vecop_list, + .vece =MO_64 }, + }; +tcg_gen_gvec_3 (rd_ofs, rn_ofs, rm_ofs, opr_sz, max_sz, &ops[vece]); +} + +static void gen_uqadd_vec (unsigned vece,TCGv_vec t,TCGv_vec sat, +TCGv_vec a,TCGv_vec b) +{ +TCGv_vec x =tcg_temp_new_vec_matching (t); +tcg_gen_add_vec (vece, x, a, b); +tcg_gen_usadd_vec (vece, t, a, b); +tcg_gen_cmp_vec (TCG_COND_NE , vece, x, x, t); +tcg_gen_or_vec (vece, sat, sat, x); +} + +void gen_gvec_uqadd_qc (unsigned vece,uint32_t rd_ofs,uint32_t rn_ofs, +uint32_t rm_ofs,uint32_t opr_sz,uint32_t max_sz) +{ +static const TCGOpcode vecop_list[] = { + INDEX_op_usadd_vec, INDEX_op_cmp_vec, INDEX_op_add_vec,0 + }; +static const GVecGen4 ops[4 ] = { + { .fniv = gen_uqadd_vec, + .fno = gen_helper_gvec_uqadd_b, + .write_aofs = true, + .opt_opc = vecop_list, + .vece =MO_8 }, + { .fniv = gen_uqadd_vec, + .fno = gen_helper_gvec_uqadd_h, + .write_aofs = true, + .opt_opc = vecop_list, + .vece =MO_16 }, + { .fniv = gen_uqadd_vec, + .fno = gen_helper_gvec_uqadd_s, + .write_aofs = true, + .opt_opc = vecop_list, + .vece =MO_32 }, + { .fniv = gen_uqadd_vec, + .fno = gen_helper_gvec_uqadd_d, + .write_aofs = true, + .opt_opc = vecop_list, + .vece =MO_64 }, + }; + tcg_gen_gvec_4(rd_ofs, offsetof(CPUARMState, vfp.qc), + rn_ofs, rm_ofs, opr_sz, max_sz, &ops[vece]); +} + +static void gen_sqadd_vec (unsigned vece,TCGv_vec t,TCGv_vec sat, +TCGv_vec a,TCGv_vec b) +{ +TCGv_vec x =tcg_temp_new_vec_matching (t); +tcg_gen_add_vec (vece, x, a, b); +tcg_gen_ssadd_vec (vece, t, a, b); +tcg_gen_cmp_vec (TCG_COND_NE , vece, x, x, t); +tcg_gen_or_vec (vece, sat, sat, x); +} + +void gen_gvec_sqadd_qc (unsigned vece,uint32_t rd_ofs,uint32_t rn_ofs, +uint32_t rm_ofs,uint32_t opr_sz,uint32_t max_sz) +{ +static const TCGOpcode vecop_list[] = { + INDEX_op_ssadd_vec, INDEX_op_cmp_vec, INDEX_op_add_vec,0 + }; +static const GVecGen4 ops[4 ] = { + { .fniv = gen_sqadd_vec, + .fno = gen_helper_gvec_sqadd_b, + .opt_opc = vecop_list, + .write_aofs = true, + .vece =MO_8 }, + { .fniv = gen_sqadd_vec, + .fno = gen_helper_gvec_sqadd_h, + .opt_opc = vecop_list, + .write_aofs = true, + .vece =MO_16 }, + { .fniv = gen_sqadd_vec, + .fno = gen_helper_gvec_sqadd_s, + .opt_opc = vecop_list, + .write_aofs = true, + .vece =MO_32 }, + { .fniv = gen_sqadd_vec, + .fno = gen_helper_gvec_sqadd_d, + .opt_opc = vecop_list, + .write_aofs = true, + .vece =MO_64 }, + }; + tcg_gen_gvec_4(rd_ofs, offsetof(CPUARMState, vfp.qc), + rn_ofs, rm_ofs, opr_sz, max_sz, &ops[vece]); +} + +static void gen_uqsub_vec (unsigned vece,TCGv_vec t,TCGv_vec sat, +TCGv_vec a,TCGv_vec b) +{ +TCGv_vec x =tcg_temp_new_vec_matching (t); +tcg_gen_sub_vec (vece, x, a, b); +tcg_gen_ussub_vec (vece, t, a, b); +tcg_gen_cmp_vec (TCG_COND_NE , vece, x, x, t); +tcg_gen_or_vec (vece, sat, sat, x); +} + +void gen_gvec_uqsub_qc (unsigned vece,uint32_t rd_ofs,uint32_t rn_ofs, +uint32_t rm_ofs,uint32_t opr_sz,uint32_t max_sz) +{ +static const TCGOpcode vecop_list[] = { + INDEX_op_ussub_vec, INDEX_op_cmp_vec, INDEX_op_sub_vec,0 + }; +static const GVecGen4 ops[4 ] = { + { .fniv = gen_uqsub_vec, + .fno = gen_helper_gvec_uqsub_b, + .opt_opc = vecop_list, + .write_aofs = true, + .vece =MO_8 }, + { .fniv = gen_uqsub_vec, + .fno = gen_helper_gvec_uqsub_h, + .opt_opc = vecop_list, + .write_aofs = true, + .vece =MO_16 }, + { .fniv = gen_uqsub_vec, + .fno = gen_helper_gvec_uqsub_s, + .opt_opc = vecop_list, + .write_aofs = true, + .vece =MO_32 }, + { .fniv = gen_uqsub_vec, + .fno = gen_helper_gvec_uqsub_d, + .opt_opc = vecop_list, + .write_aofs = true, + .vece =MO_64 }, + }; + tcg_gen_gvec_4(rd_ofs, offsetof(CPUARMState, vfp.qc), + rn_ofs, rm_ofs, opr_sz, max_sz, &ops[vece]); +} + +static void gen_sqsub_vec (unsigned vece,TCGv_vec t,TCGv_vec sat, +TCGv_vec a,TCGv_vec b) +{ +TCGv_vec x =tcg_temp_new_vec_matching (t); +tcg_gen_sub_vec (vece, x, a, b); +tcg_gen_sssub_vec (vece, t, a, b); +tcg_gen_cmp_vec (TCG_COND_NE , vece, x, x, t); +tcg_gen_or_vec (vece, sat, sat, x); +} + +void gen_gvec_sqsub_qc (unsigned vece,uint32_t rd_ofs,uint32_t rn_ofs, +uint32_t rm_ofs,uint32_t opr_sz,uint32_t max_sz) +{ +static const TCGOpcode vecop_list[] = { + INDEX_op_sssub_vec, INDEX_op_cmp_vec, INDEX_op_sub_vec,0 + }; +static const GVecGen4 ops[4 ] = { + { .fniv = gen_sqsub_vec, + .fno = gen_helper_gvec_sqsub_b, + .opt_opc = vecop_list, + .write_aofs = true, + .vece =MO_8 }, + { .fniv = gen_sqsub_vec, + .fno = gen_helper_gvec_sqsub_h, + .opt_opc = vecop_list, + .write_aofs = true, + .vece =MO_16 }, + { .fniv = gen_sqsub_vec, + .fno = gen_helper_gvec_sqsub_s, + .opt_opc = vecop_list, + .write_aofs = true, + .vece =MO_32 }, + { .fniv = gen_sqsub_vec, + .fno = gen_helper_gvec_sqsub_d, + .opt_opc = vecop_list, + .write_aofs = true, + .vece =MO_64 }, + }; + tcg_gen_gvec_4(rd_ofs, offsetof(CPUARMState, vfp.qc), + rn_ofs, rm_ofs, opr_sz, max_sz, &ops[vece]); +} + +static void gen_sabd_i32 (TCGv_i32 d,TCGv_i32 a,TCGv_i32 b) +{ +TCGv_i32 t =tcg_temp_new_i32 (); + +tcg_gen_sub_i32 (t, a, b); +tcg_gen_sub_i32 (d, b, a); +tcg_gen_movcond_i32 (TCG_COND_LT , d, a, b, d, t); +} + +static void gen_sabd_i64 (TCGv_i64 d,TCGv_i64 a,TCGv_i64 b) +{ +TCGv_i64 t =tcg_temp_new_i64 (); + +tcg_gen_sub_i64 (t, a, b); +tcg_gen_sub_i64 (d, b, a); +tcg_gen_movcond_i64 (TCG_COND_LT , d, a, b, d, t); +} + +static void gen_sabd_vec (unsigned vece,TCGv_vec d,TCGv_vec a,TCGv_vec b) +{ +TCGv_vec t =tcg_temp_new_vec_matching (d); + +tcg_gen_smin_vec (vece, t, a, b); +tcg_gen_smax_vec (vece, d, a, b); +tcg_gen_sub_vec (vece, d, d, t); +} + +void gen_gvec_sabd (unsigned vece,uint32_t rd_ofs,uint32_t rn_ofs, +uint32_t rm_ofs,uint32_t opr_sz,uint32_t max_sz) +{ +static const TCGOpcode vecop_list[] = { + INDEX_op_sub_vec, INDEX_op_smin_vec, INDEX_op_smax_vec,0 + }; +static const GVecGen3 ops[4 ] = { + { .fniv = gen_sabd_vec, + .fno = gen_helper_gvec_sabd_b, + .opt_opc = vecop_list, + .vece =MO_8 }, + { .fniv = gen_sabd_vec, + .fno = gen_helper_gvec_sabd_h, + .opt_opc = vecop_list, + .vece =MO_16 }, + { .fni4 = gen_sabd_i32, + .fniv = gen_sabd_vec, + .fno = gen_helper_gvec_sabd_s, + .opt_opc = vecop_list, + .vece =MO_32 }, + { .fni8 = gen_sabd_i64, + .fniv = gen_sabd_vec, + .fno = gen_helper_gvec_sabd_d, + .prefer_i64 =TCG_TARGET_REG_BITS ==64 , + .opt_opc = vecop_list, + .vece =MO_64 }, + }; +tcg_gen_gvec_3 (rd_ofs, rn_ofs, rm_ofs, opr_sz, max_sz, &ops[vece]); +} + +static void gen_uabd_i32 (TCGv_i32 d,TCGv_i32 a,TCGv_i32 b) +{ +TCGv_i32 t =tcg_temp_new_i32 (); + +tcg_gen_sub_i32 (t, a, b); +tcg_gen_sub_i32 (d, b, a); +tcg_gen_movcond_i32 (TCG_COND_LTU , d, a, b, d, t); +} + +static void gen_uabd_i64 (TCGv_i64 d,TCGv_i64 a,TCGv_i64 b) +{ +TCGv_i64 t =tcg_temp_new_i64 (); + +tcg_gen_sub_i64 (t, a, b); +tcg_gen_sub_i64 (d, b, a); +tcg_gen_movcond_i64 (TCG_COND_LTU , d, a, b, d, t); +} + +static void gen_uabd_vec (unsigned vece,TCGv_vec d,TCGv_vec a,TCGv_vec b) +{ +TCGv_vec t =tcg_temp_new_vec_matching (d); + +tcg_gen_umin_vec (vece, t, a, b); +tcg_gen_umax_vec (vece, d, a, b); +tcg_gen_sub_vec (vece, d, d, t); +} + +void gen_gvec_uabd (unsigned vece,uint32_t rd_ofs,uint32_t rn_ofs, +uint32_t rm_ofs,uint32_t opr_sz,uint32_t max_sz) +{ +static const TCGOpcode vecop_list[] = { + INDEX_op_sub_vec, INDEX_op_umin_vec, INDEX_op_umax_vec,0 + }; +static const GVecGen3 ops[4 ] = { + { .fniv = gen_uabd_vec, + .fno = gen_helper_gvec_uabd_b, + .opt_opc = vecop_list, + .vece =MO_8 }, + { .fniv = gen_uabd_vec, + .fno = gen_helper_gvec_uabd_h, + .opt_opc = vecop_list, + .vece =MO_16 }, + { .fni4 = gen_uabd_i32, + .fniv = gen_uabd_vec, + .fno = gen_helper_gvec_uabd_s, + .opt_opc = vecop_list, + .vece =MO_32 }, + { .fni8 = gen_uabd_i64, + .fniv = gen_uabd_vec, + .fno = gen_helper_gvec_uabd_d, + .prefer_i64 =TCG_TARGET_REG_BITS ==64 , + .opt_opc = vecop_list, + .vece =MO_64 }, + }; +tcg_gen_gvec_3 (rd_ofs, rn_ofs, rm_ofs, opr_sz, max_sz, &ops[vece]); +} + +static void gen_saba_i32 (TCGv_i32 d,TCGv_i32 a,TCGv_i32 b) +{ +TCGv_i32 t =tcg_temp_new_i32 (); +gen_sabd_i32 (t, a, b); +tcg_gen_add_i32 (d, d, t); +} + +static void gen_saba_i64 (TCGv_i64 d,TCGv_i64 a,TCGv_i64 b) +{ +TCGv_i64 t =tcg_temp_new_i64 (); +gen_sabd_i64 (t, a, b); +tcg_gen_add_i64 (d, d, t); +} + +static void gen_saba_vec (unsigned vece,TCGv_vec d,TCGv_vec a,TCGv_vec b) +{ +TCGv_vec t =tcg_temp_new_vec_matching (d); +gen_sabd_vec (vece, t, a, b); +tcg_gen_add_vec (vece, d, d, t); +} + +void gen_gvec_saba (unsigned vece,uint32_t rd_ofs,uint32_t rn_ofs, +uint32_t rm_ofs,uint32_t opr_sz,uint32_t max_sz) +{ +static const TCGOpcode vecop_list[] = { + INDEX_op_sub_vec, INDEX_op_add_vec, + INDEX_op_smin_vec, INDEX_op_smax_vec,0 + }; +static const GVecGen3 ops[4 ] = { + { .fniv = gen_saba_vec, + .fno = gen_helper_gvec_saba_b, + .opt_opc = vecop_list, + .load_dest = true, + .vece =MO_8 }, + { .fniv = gen_saba_vec, + .fno = gen_helper_gvec_saba_h, + .opt_opc = vecop_list, + .load_dest = true, + .vece =MO_16 }, + { .fni4 = gen_saba_i32, + .fniv = gen_saba_vec, + .fno = gen_helper_gvec_saba_s, + .opt_opc = vecop_list, + .load_dest = true, + .vece =MO_32 }, + { .fni8 = gen_saba_i64, + .fniv = gen_saba_vec, + .fno = gen_helper_gvec_saba_d, + .prefer_i64 =TCG_TARGET_REG_BITS ==64 , + .opt_opc = vecop_list, + .load_dest = true, + .vece =MO_64 }, + }; +tcg_gen_gvec_3 (rd_ofs, rn_ofs, rm_ofs, opr_sz, max_sz, &ops[vece]); +} + +static void gen_uaba_i32 (TCGv_i32 d,TCGv_i32 a,TCGv_i32 b) +{ +TCGv_i32 t =tcg_temp_new_i32 (); +gen_uabd_i32 (t, a, b); +tcg_gen_add_i32 (d, d, t); +} + +static void gen_uaba_i64 (TCGv_i64 d,TCGv_i64 a,TCGv_i64 b) +{ +TCGv_i64 t =tcg_temp_new_i64 (); +gen_uabd_i64 (t, a, b); +tcg_gen_add_i64 (d, d, t); +} + +static void gen_uaba_vec (unsigned vece,TCGv_vec d,TCGv_vec a,TCGv_vec b) +{ +TCGv_vec t =tcg_temp_new_vec_matching (d); +gen_uabd_vec (vece, t, a, b); +tcg_gen_add_vec (vece, d, d, t); +} + +void gen_gvec_uaba (unsigned vece,uint32_t rd_ofs,uint32_t rn_ofs, +uint32_t rm_ofs,uint32_t opr_sz,uint32_t max_sz) +{ +static const TCGOpcode vecop_list[] = { + INDEX_op_sub_vec, INDEX_op_add_vec, + INDEX_op_umin_vec, INDEX_op_umax_vec,0 + }; +static const GVecGen3 ops[4 ] = { + { .fniv = gen_uaba_vec, + .fno = gen_helper_gvec_uaba_b, + .opt_opc = vecop_list, + .load_dest = true, + .vece =MO_8 }, + { .fniv = gen_uaba_vec, + .fno = gen_helper_gvec_uaba_h, + .opt_opc = vecop_list, + .load_dest = true, + .vece =MO_16 }, + { .fni4 = gen_uaba_i32, + .fniv = gen_uaba_vec, + .fno = gen_helper_gvec_uaba_s, + .opt_opc = vecop_list, + .load_dest = true, + .vece =MO_32 }, + { .fni8 = gen_uaba_i64, + .fniv = gen_uaba_vec, + .fno = gen_helper_gvec_uaba_d, + .prefer_i64 =TCG_TARGET_REG_BITS ==64 , + .opt_opc = vecop_list, + .load_dest = true, + .vece =MO_64 }, + }; +tcg_gen_gvec_3 (rd_ofs, rn_ofs, rm_ofs, opr_sz, max_sz, &ops[vece]); +}
target/arm/tcg/translate.c +0 -1630
1,356 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.38.1
Part of the diff is not shown here. View the raw message.
Re: [PATCH v3 16/34] target/arm/tcg: Extract generic vector helpers to translate-gvec.c
Quoted 9 lines · Philippe Mathieu-Daudé
Extract 1600 lines from the big enough
translate.c.Signed-off-by Philippe Mathieu-Daudé<[email protected]>--- target/arm/tcg/translate-gvec.c | 1644 +++++++++++++++++++++++++++++++ target/arm/tcg/translate.c | 1630 ------------------------------ target/arm/tcg/meson.build | 1 + 3 files changed, 1645 insertions(+), 1630 deletions(-)create mode 100644
target/arm/tcg/translate-gvec.c
r~
PATCH v3 17/34 target/arm/tcg: Extract gvec definitions to 'helper-gvec.h.inc'
In reply to Philippe Mathieu-Daudéhelper.h is used by all units, but not all require the generic vector definitions. Move them to a new header; the next commit will remove it from the common helper.h.
--- target/arm/helper.h | 380 +------------------------------ target/arm/tcg/helper-gvec.h.inc | 378 ++++++++++++++++++++++++++++++ 2 files changed, 379 insertions(+), 379 deletions(-) create mode 100644 target/arm/tcg/helper-gvec.h.inc
target/arm/helper.h +1 -379
@@ -146,15 +146,6 @@ DEF_HELPER_FLAGS_4(crypto_rax1, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) DEF_HELPER_FLAGS_3(crc32, TCG_CALL_NO_RWG_SE, i32, i32, i32, i32) DEF_HELPER_FLAGS_3(crc32c, TCG_CALL_NO_RWG_SE, i32, i32, i32, i32) -DEF_HELPER_FLAGS_5 (gvec_qrdmlah_s16,TCG_CALL_NO_RWG , - void, ptr, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_5 (gvec_qrdmlsh_s16,TCG_CALL_NO_RWG , - void, ptr, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_5 (gvec_qrdmlah_s32,TCG_CALL_NO_RWG , - void, ptr, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_5 (gvec_qrdmlsh_s32,TCG_CALL_NO_RWG , - void, ptr, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_5 (sve2_sqrdmlah_b,TCG_CALL_NO_RWG , void, ptr, ptr, ptr, ptr, i32) DEF_HELPER_FLAGS_5(sve2_sqrdmlsh_b, TCG_CALL_NO_RWG,
@@ -172,336 +163,6 @@ DEF_HELPER_FLAGS_5(sve2_sqrdmlah_d, TCG_CALL_NO_RWG,DEF_HELPER_FLAGS_5 (sve2_sqrdmlsh_d,TCG_CALL_NO_RWG , void, ptr, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_5(gvec_sdot_b, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_5(gvec_udot_b, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_5(gvec_sdot_h, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_5(gvec_udot_h, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_5(gvec_usdot_b, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, ptr, i32) - -DEF_HELPER_FLAGS_5 (gvec_sdot_idx_b,TCG_CALL_NO_RWG , - void, ptr, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_5 (gvec_udot_idx_b,TCG_CALL_NO_RWG , - void, ptr, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_5 (gvec_sdot_idx_h,TCG_CALL_NO_RWG , - void, ptr, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_5 (gvec_udot_idx_h,TCG_CALL_NO_RWG , - void, ptr, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_5 (gvec_sudot_idx_b,TCG_CALL_NO_RWG , - void, ptr, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_5 (gvec_usdot_idx_b,TCG_CALL_NO_RWG , - void, ptr, ptr, ptr, ptr, i32) - -DEF_HELPER_FLAGS_5 (gvec_fcaddh,TCG_CALL_NO_RWG , - void, ptr, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_5 (gvec_fcadds,TCG_CALL_NO_RWG , - void, ptr, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_5 (gvec_fcaddd,TCG_CALL_NO_RWG , - void, ptr, ptr, ptr, ptr, i32) - -DEF_HELPER_FLAGS_6 (gvec_fcmlah,TCG_CALL_NO_RWG , - void, ptr, ptr, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_6 (gvec_fcmlah_idx,TCG_CALL_NO_RWG , - void, ptr, ptr, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_6 (gvec_fcmlas,TCG_CALL_NO_RWG , - void, ptr, ptr, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_6 (gvec_fcmlas_idx,TCG_CALL_NO_RWG , - void, ptr, ptr, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_6 (gvec_fcmlad,TCG_CALL_NO_RWG , - void, ptr, ptr, ptr, ptr, ptr, i32) - -DEF_HELPER_FLAGS_4(gvec_sstoh, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_4(gvec_sitos, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_4(gvec_ustoh, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_4(gvec_uitos, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_4(gvec_tosszh, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_4(gvec_tosizs, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_4(gvec_touszh, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_4(gvec_touizs, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) - -DEF_HELPER_FLAGS_4(gvec_vcvt_sf, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_4(gvec_vcvt_uf, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_4(gvec_vcvt_fs, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_4(gvec_vcvt_fu, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) - -DEF_HELPER_FLAGS_4(gvec_vcvt_sh, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_4(gvec_vcvt_uh, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_4(gvec_vcvt_hs, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_4(gvec_vcvt_hu, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) - -DEF_HELPER_FLAGS_4(gvec_vcvt_rm_ss, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_4(gvec_vcvt_rm_us, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_4(gvec_vcvt_rm_sh, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_4(gvec_vcvt_rm_uh, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) - -DEF_HELPER_FLAGS_4(gvec_vrint_rm_h, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_4(gvec_vrint_rm_s, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) - -DEF_HELPER_FLAGS_4(gvec_vrintx_h, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_4(gvec_vrintx_s, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) - -DEF_HELPER_FLAGS_4(gvec_frecpe_h, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_4(gvec_frecpe_s, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_4(gvec_frecpe_d, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) - -DEF_HELPER_FLAGS_4(gvec_frsqrte_h, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_4(gvec_frsqrte_s, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_4(gvec_frsqrte_d, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) - -DEF_HELPER_FLAGS_4(gvec_fcgt0_h, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_4(gvec_fcgt0_s, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) - -DEF_HELPER_FLAGS_4(gvec_fcge0_h, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_4(gvec_fcge0_s, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) - -DEF_HELPER_FLAGS_4(gvec_fceq0_h, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_4(gvec_fceq0_s, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) - -DEF_HELPER_FLAGS_4(gvec_fcle0_h, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_4(gvec_fcle0_s, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) - -DEF_HELPER_FLAGS_4(gvec_fclt0_h, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_4(gvec_fclt0_s, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) - -DEF_HELPER_FLAGS_5(gvec_fadd_h, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_5(gvec_fadd_s, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_5(gvec_fadd_d, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, ptr, i32) - -DEF_HELPER_FLAGS_5(gvec_fsub_h, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_5(gvec_fsub_s, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_5(gvec_fsub_d, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, ptr, i32) - -DEF_HELPER_FLAGS_5(gvec_fmul_h, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_5(gvec_fmul_s, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_5(gvec_fmul_d, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, ptr, i32) - -DEF_HELPER_FLAGS_5(gvec_fabd_h, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_5(gvec_fabd_s, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, ptr, i32) - -DEF_HELPER_FLAGS_5(gvec_fceq_h, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_5(gvec_fceq_s, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, ptr, i32) - -DEF_HELPER_FLAGS_5(gvec_fcge_h, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_5(gvec_fcge_s, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, ptr, i32) - -DEF_HELPER_FLAGS_5(gvec_fcgt_h, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_5(gvec_fcgt_s, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, ptr, i32) - -DEF_HELPER_FLAGS_5(gvec_facge_h, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_5(gvec_facge_s, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, ptr, i32) - -DEF_HELPER_FLAGS_5(gvec_facgt_h, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_5(gvec_facgt_s, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, ptr, i32) - -DEF_HELPER_FLAGS_5(gvec_fmax_h, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_5(gvec_fmax_s, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, ptr, i32) - -DEF_HELPER_FLAGS_5(gvec_fmin_h, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_5(gvec_fmin_s, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, ptr, i32) - -DEF_HELPER_FLAGS_5(gvec_fmaxnum_h, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_5(gvec_fmaxnum_s, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, ptr, i32) - -DEF_HELPER_FLAGS_5(gvec_fminnum_h, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_5(gvec_fminnum_s, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, ptr, i32) - -DEF_HELPER_FLAGS_5(gvec_recps_nf_h, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_5(gvec_recps_nf_s, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, ptr, i32) - -DEF_HELPER_FLAGS_5(gvec_rsqrts_nf_h, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_5(gvec_rsqrts_nf_s, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, ptr, i32) - -DEF_HELPER_FLAGS_5(gvec_fmla_h, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_5(gvec_fmla_s, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, ptr, i32) - -DEF_HELPER_FLAGS_5(gvec_fmls_h, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_5(gvec_fmls_s, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, ptr, i32) - -DEF_HELPER_FLAGS_5(gvec_vfma_h, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_5(gvec_vfma_s, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, ptr, i32) - -DEF_HELPER_FLAGS_5(gvec_vfms_h, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_5(gvec_vfms_s, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, ptr, i32) - -DEF_HELPER_FLAGS_5 (gvec_ftsmul_h,TCG_CALL_NO_RWG , - void, ptr, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_5 (gvec_ftsmul_s,TCG_CALL_NO_RWG , - void, ptr, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_5 (gvec_ftsmul_d,TCG_CALL_NO_RWG , - void, ptr, ptr, ptr, ptr, i32) - -DEF_HELPER_FLAGS_5 (gvec_fmul_idx_h,TCG_CALL_NO_RWG , - void, ptr, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_5 (gvec_fmul_idx_s,TCG_CALL_NO_RWG , - void, ptr, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_5 (gvec_fmul_idx_d,TCG_CALL_NO_RWG , - void, ptr, ptr, ptr, ptr, i32) - -DEF_HELPER_FLAGS_5 (gvec_fmla_nf_idx_h,TCG_CALL_NO_RWG , - void, ptr, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_5 (gvec_fmla_nf_idx_s,TCG_CALL_NO_RWG , - void, ptr, ptr, ptr, ptr, i32) - -DEF_HELPER_FLAGS_5 (gvec_fmls_nf_idx_h,TCG_CALL_NO_RWG , - void, ptr, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_5 (gvec_fmls_nf_idx_s,TCG_CALL_NO_RWG , - void, ptr, ptr, ptr, ptr, i32) - -DEF_HELPER_FLAGS_6 (gvec_fmla_idx_h,TCG_CALL_NO_RWG , - void, ptr, ptr, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_6 (gvec_fmla_idx_s,TCG_CALL_NO_RWG , - void, ptr, ptr, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_6 (gvec_fmla_idx_d,TCG_CALL_NO_RWG , - void, ptr, ptr, ptr, ptr, ptr, i32) - -DEF_HELPER_FLAGS_5 (gvec_uqadd_b,TCG_CALL_NO_RWG , - void, ptr, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_5 (gvec_uqadd_h,TCG_CALL_NO_RWG , - void, ptr, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_5 (gvec_uqadd_s,TCG_CALL_NO_RWG , - void, ptr, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_5 (gvec_uqadd_d,TCG_CALL_NO_RWG , - void, ptr, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_5 (gvec_sqadd_b,TCG_CALL_NO_RWG , - void, ptr, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_5 (gvec_sqadd_h,TCG_CALL_NO_RWG , - void, ptr, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_5 (gvec_sqadd_s,TCG_CALL_NO_RWG , - void, ptr, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_5 (gvec_sqadd_d,TCG_CALL_NO_RWG , - void, ptr, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_5 (gvec_uqsub_b,TCG_CALL_NO_RWG , - void, ptr, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_5 (gvec_uqsub_h,TCG_CALL_NO_RWG , - void, ptr, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_5 (gvec_uqsub_s,TCG_CALL_NO_RWG , - void, ptr, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_5 (gvec_uqsub_d,TCG_CALL_NO_RWG , - void, ptr, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_5 (gvec_sqsub_b,TCG_CALL_NO_RWG , - void, ptr, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_5 (gvec_sqsub_h,TCG_CALL_NO_RWG , - void, ptr, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_5 (gvec_sqsub_s,TCG_CALL_NO_RWG , - void, ptr, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_5 (gvec_sqsub_d,TCG_CALL_NO_RWG , - void, ptr, ptr, ptr, ptr, i32) - -DEF_HELPER_FLAGS_5 (gvec_fmlal_a32,TCG_CALL_NO_RWG , - void, ptr, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_5 (gvec_fmlal_a64,TCG_CALL_NO_RWG , - void, ptr, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_5 (gvec_fmlal_idx_a32,TCG_CALL_NO_RWG , - void, ptr, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_5 (gvec_fmlal_idx_a64,TCG_CALL_NO_RWG , - void, ptr, ptr, ptr, ptr, i32) - -DEF_HELPER_FLAGS_3(gvec_ceq0_b, TCG_CALL_NO_RWG, void, ptr, ptr, i32) -DEF_HELPER_FLAGS_3(gvec_ceq0_h, TCG_CALL_NO_RWG, void, ptr, ptr, i32) -DEF_HELPER_FLAGS_3(gvec_clt0_b, TCG_CALL_NO_RWG, void, ptr, ptr, i32) -DEF_HELPER_FLAGS_3(gvec_clt0_h, TCG_CALL_NO_RWG, void, ptr, ptr, i32) -DEF_HELPER_FLAGS_3(gvec_cle0_b, TCG_CALL_NO_RWG, void, ptr, ptr, i32) -DEF_HELPER_FLAGS_3(gvec_cle0_h, TCG_CALL_NO_RWG, void, ptr, ptr, i32) -DEF_HELPER_FLAGS_3(gvec_cgt0_b, TCG_CALL_NO_RWG, void, ptr, ptr, i32) -DEF_HELPER_FLAGS_3(gvec_cgt0_h, TCG_CALL_NO_RWG, void, ptr, ptr, i32) -DEF_HELPER_FLAGS_3(gvec_cge0_b, TCG_CALL_NO_RWG, void, ptr, ptr, i32) -DEF_HELPER_FLAGS_3(gvec_cge0_h, TCG_CALL_NO_RWG, void, ptr, ptr, i32) - -DEF_HELPER_FLAGS_4(gvec_smulh_b, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_4(gvec_smulh_h, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_4(gvec_smulh_s, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_4(gvec_smulh_d, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) - -DEF_HELPER_FLAGS_4(gvec_umulh_b, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_4(gvec_umulh_h, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_4(gvec_umulh_s, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_4(gvec_umulh_d, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) - -DEF_HELPER_FLAGS_4(gvec_sshl_b, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_4(gvec_sshl_h, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_4(gvec_ushl_b, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_4(gvec_ushl_h, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) - -DEF_HELPER_FLAGS_4(gvec_pmul_b, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_4(gvec_pmull_q, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) - -DEF_HELPER_FLAGS_3(gvec_ssra_b, TCG_CALL_NO_RWG, void, ptr, ptr, i32) -DEF_HELPER_FLAGS_3(gvec_ssra_h, TCG_CALL_NO_RWG, void, ptr, ptr, i32) -DEF_HELPER_FLAGS_3(gvec_ssra_s, TCG_CALL_NO_RWG, void, ptr, ptr, i32) -DEF_HELPER_FLAGS_3(gvec_ssra_d, TCG_CALL_NO_RWG, void, ptr, ptr, i32) - -DEF_HELPER_FLAGS_3(gvec_usra_b, TCG_CALL_NO_RWG, void, ptr, ptr, i32) -DEF_HELPER_FLAGS_3(gvec_usra_h, TCG_CALL_NO_RWG, void, ptr, ptr, i32) -DEF_HELPER_FLAGS_3(gvec_usra_s, TCG_CALL_NO_RWG, void, ptr, ptr, i32) -DEF_HELPER_FLAGS_3(gvec_usra_d, TCG_CALL_NO_RWG, void, ptr, ptr, i32) - -DEF_HELPER_FLAGS_3(gvec_srshr_b, TCG_CALL_NO_RWG, void, ptr, ptr, i32) -DEF_HELPER_FLAGS_3(gvec_srshr_h, TCG_CALL_NO_RWG, void, ptr, ptr, i32) -DEF_HELPER_FLAGS_3(gvec_srshr_s, TCG_CALL_NO_RWG, void, ptr, ptr, i32) -DEF_HELPER_FLAGS_3(gvec_srshr_d, TCG_CALL_NO_RWG, void, ptr, ptr, i32) - -DEF_HELPER_FLAGS_3(gvec_urshr_b, TCG_CALL_NO_RWG, void, ptr, ptr, i32) -DEF_HELPER_FLAGS_3(gvec_urshr_h, TCG_CALL_NO_RWG, void, ptr, ptr, i32) -DEF_HELPER_FLAGS_3(gvec_urshr_s, TCG_CALL_NO_RWG, void, ptr, ptr, i32) -DEF_HELPER_FLAGS_3(gvec_urshr_d, TCG_CALL_NO_RWG, void, ptr, ptr, i32) - -DEF_HELPER_FLAGS_3(gvec_srsra_b, TCG_CALL_NO_RWG, void, ptr, ptr, i32) -DEF_HELPER_FLAGS_3(gvec_srsra_h, TCG_CALL_NO_RWG, void, ptr, ptr, i32) -DEF_HELPER_FLAGS_3(gvec_srsra_s, TCG_CALL_NO_RWG, void, ptr, ptr, i32) -DEF_HELPER_FLAGS_3(gvec_srsra_d, TCG_CALL_NO_RWG, void, ptr, ptr, i32) - -DEF_HELPER_FLAGS_3(gvec_ursra_b, TCG_CALL_NO_RWG, void, ptr, ptr, i32) -DEF_HELPER_FLAGS_3(gvec_ursra_h, TCG_CALL_NO_RWG, void, ptr, ptr, i32) -DEF_HELPER_FLAGS_3(gvec_ursra_s, TCG_CALL_NO_RWG, void, ptr, ptr, i32) -DEF_HELPER_FLAGS_3(gvec_ursra_d, TCG_CALL_NO_RWG, void, ptr, ptr, i32) - -DEF_HELPER_FLAGS_3(gvec_sri_b, TCG_CALL_NO_RWG, void, ptr, ptr, i32) -DEF_HELPER_FLAGS_3(gvec_sri_h, TCG_CALL_NO_RWG, void, ptr, ptr, i32) -DEF_HELPER_FLAGS_3(gvec_sri_s, TCG_CALL_NO_RWG, void, ptr, ptr, i32) -DEF_HELPER_FLAGS_3(gvec_sri_d, TCG_CALL_NO_RWG, void, ptr, ptr, i32) - -DEF_HELPER_FLAGS_3(gvec_sli_b, TCG_CALL_NO_RWG, void, ptr, ptr, i32) -DEF_HELPER_FLAGS_3(gvec_sli_h, TCG_CALL_NO_RWG, void, ptr, ptr, i32) -DEF_HELPER_FLAGS_3(gvec_sli_s, TCG_CALL_NO_RWG, void, ptr, ptr, i32) -DEF_HELPER_FLAGS_3(gvec_sli_d, TCG_CALL_NO_RWG, void, ptr, ptr, i32) - -DEF_HELPER_FLAGS_4(gvec_sabd_b, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_4(gvec_sabd_h, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_4(gvec_sabd_s, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_4(gvec_sabd_d, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) - -DEF_HELPER_FLAGS_4(gvec_uabd_b, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_4(gvec_uabd_h, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_4(gvec_uabd_s, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_4(gvec_uabd_d, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) - -DEF_HELPER_FLAGS_4(gvec_saba_b, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_4(gvec_saba_h, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_4(gvec_saba_s, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_4(gvec_saba_d, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) - -DEF_HELPER_FLAGS_4(gvec_uaba_b, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_4(gvec_uaba_h, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_4(gvec_uaba_s, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_4(gvec_uaba_d, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) - -DEF_HELPER_FLAGS_4(gvec_mul_idx_h, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_4(gvec_mul_idx_s, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_4(gvec_mul_idx_d, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) - -DEF_HELPER_FLAGS_5 (gvec_mla_idx_h,TCG_CALL_NO_RWG , - void, ptr, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_5 (gvec_mla_idx_s,TCG_CALL_NO_RWG , - void, ptr, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_5 (gvec_mla_idx_d,TCG_CALL_NO_RWG , - void, ptr, ptr, ptr, ptr, i32) - -DEF_HELPER_FLAGS_5 (gvec_mls_idx_h,TCG_CALL_NO_RWG , - void, ptr, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_5 (gvec_mls_idx_s,TCG_CALL_NO_RWG , - void, ptr, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_5 (gvec_mls_idx_d,TCG_CALL_NO_RWG , - void, ptr, ptr, ptr, ptr, i32) - DEF_HELPER_FLAGS_4(sve2_sqdmulh_b, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) DEF_HELPER_FLAGS_4(sve2_sqdmulh_h, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32)DEF_HELPER_FLAGS_4 (sve2_sqdmulh_s,TCG_CALL_NO_RWG , void, ptr, ptr, ptr, i32)
@@ -531,50 +192,11 @@ DEF_HELPER_FLAGS_6(sve2_fmlal_zzzw_s, TCG_CALL_NO_RWG,DEF_HELPER_FLAGS_6 (sve2_fmlal_zzxw_s,TCG_CALL_NO_RWG , void, ptr, ptr, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_4(gvec_xar_d, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) - -DEF_HELPER_FLAGS_5 (gvec_smmla_b,TCG_CALL_NO_RWG , - void, ptr, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_5 (gvec_ummla_b,TCG_CALL_NO_RWG , - void, ptr, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_5 (gvec_usmmla_b,TCG_CALL_NO_RWG , - void, ptr, ptr, ptr, ptr, i32) - -DEF_HELPER_FLAGS_5 (gvec_bfdot,TCG_CALL_NO_RWG , - void, ptr, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_5 (gvec_bfdot_idx,TCG_CALL_NO_RWG , - void, ptr, ptr, ptr, ptr, i32) - -DEF_HELPER_FLAGS_5 (gvec_bfmmla,TCG_CALL_NO_RWG , - void, ptr, ptr, ptr, ptr, i32) - -DEF_HELPER_FLAGS_6 (gvec_bfmlal,TCG_CALL_NO_RWG , - void, ptr, ptr, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_6 (gvec_bfmlal_idx,TCG_CALL_NO_RWG , - void, ptr, ptr, ptr, ptr, ptr, i32) - -DEF_HELPER_FLAGS_5 (gvec_sclamp_b,TCG_CALL_NO_RWG , - void, ptr, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_5 (gvec_sclamp_h,TCG_CALL_NO_RWG , - void, ptr, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_5 (gvec_sclamp_s,TCG_CALL_NO_RWG , - void, ptr, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_5 (gvec_sclamp_d,TCG_CALL_NO_RWG , - void, ptr, ptr, ptr, ptr, i32) - -DEF_HELPER_FLAGS_5 (gvec_uclamp_b,TCG_CALL_NO_RWG , - void, ptr, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_5 (gvec_uclamp_h,TCG_CALL_NO_RWG , - void, ptr, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_5 (gvec_uclamp_s,TCG_CALL_NO_RWG , - void, ptr, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_5 (gvec_uclamp_d,TCG_CALL_NO_RWG , - void, ptr, ptr, ptr, ptr, i32) -#ifdef TARGET_AARCH64 #include "tcg/helper-a64.h.inc" #include "tcg/helper-sve.h.inc" #include "tcg/helper-sme.h.inc" #endif +#include "tcg/helper-gvec.h.inc" #include "tcg/helper-mve.h.inc"
target/arm/tcg/helper-gvec.h.inc new file +378 -0
378 lines not on this page · raw message
Signature · 1 line
2.38.1
Re: [PATCH v3 17/34] target/arm/tcg: Extract gvec definitions to 'helper-gvec.h.inc'
Quoted 10 lines · Philippe Mathieu-Daudé
helper.his used by all units, but not all require the generic vector definitions. Move them to a new header; the next commit will remove it from the commonhelper.h.Signed-off-by Philippe Mathieu-Daudé<[email protected]>--- target/arm/helper.h | 380 +------------------------------ target/arm/tcg/helper-gvec.h.inc | 378 ++++++++++++++++++++++++++++++ 2 files changed, 379 insertions(+), 379 deletions(-)create mode 100644 target/arm/tcg/helper-gvec.h.inc
r~
PATCH v3 18/34 target/arm/tcg: Reduce 'helper-gvec.h.inc' inclusion
In reply to Philippe Mathieu-DaudéInstead of including helper-gvec.h.inc via helper.h which is included by all TCG files, restrict it to the few files that require it.
--- target/arm/helper.h | 1 - target/arm/tcg/translate-a64.c | 4 ++++ target/arm/tcg/translate-gvec.c | 6 ++++++ target/arm/tcg/translate-neon.c | 4 ++++ target/arm/tcg/translate-sve.c | 3 +++ target/arm/tcg/vec_helper.c | 4 ++++ 6 files changed, 21 insertions(+), 1 deletion(-)
target/arm/helper.h +0 -1
@@ -198,5 +198,4 @@ DEF_HELPER_FLAGS_6(sve2_fmlal_zzxw_s, TCG_CALL_NO_RWG,#include "tcg/helper-sme.h.inc" #endif -#include "tcg/helper-gvec.h.inc" #include "tcg/helper-mve.h.inc"
target/arm/tcg/translate-a64.c +4 -0
@@ -26,6 +26,10 @@#include "semihosting/semihost.h" #include "cpregs.h" +#define HELPER_H "tcg/helper-gvec.h.inc" +#include "exec/helper-gen.h.inc" +#undef HELPER_H +#define HELPER_H "tcg/helper-vfp.h.inc"#include "exec/helper-gen.h.inc" #undef HELPER_H
target/arm/tcg/translate-gvec.c +6 -0
@@ -13,6 +13,12 @@#include "exec/helper-gen.h.inc" #undef HELPER_H +#define HELPER_H "tcg/helper-gvec.h.inc" +#include "exec/helper-proto.h.inc" +#include "exec/helper-gen.h.inc" +#include "exec/helper-info.c.inc" +#undef HELPER_H +static void gen_gvec_fn3_qc (uint32_t rd_ofs,uint32_t rn_ofs,uint32_t rm_ofs,uint32_t opr_sz,uint32_t max_sz,gen_helper_gvec_3_ptr *fn)
target/arm/tcg/translate-neon.c +4 -0
@@ -24,6 +24,10 @@#include "translate.h" #include "translate-a32.h" +#define HELPER_H "tcg/helper-gvec.h.inc" +#include "exec/helper-gen.h.inc" +#undef HELPER_H +#define HELPER_H "tcg/helper-vfp.h.inc"#include "exec/helper-gen.h.inc" #undef HELPER_H
target/arm/tcg/translate-sve.c +3 -0
@@ -22,6 +22,9 @@#include "translate-a64.h" #include "fpu/softfloat.h" +#define HELPER_H "tcg/helper-gvec.h.inc" +#include "exec/helper-gen.h.inc" +#undef HELPER_Htypedef void GVecGen2sFn (unsigned ,uint32_t ,uint32_t ,TCGv_i64 ,uint32_t ,uint32_t );
target/arm/tcg/vec_helper.c +4 -0
@@ -25,6 +25,10 @@#include "qemu/int128.h" #include "vec_internal.h" +#define HELPER_H "tcg/helper-gvec.h.inc" +#include "exec/helper-proto.h.inc" +#undef HELPER_H +#define HELPER_H "tcg/helper-vfp.h.inc"#include "exec/helper-proto.h.inc" #undef HELPER_H
Signature · 1 line
2.38.1
Re: [PATCH v3 18/34] target/arm/tcg: Reduce 'helper-gvec.h.inc' inclusion
Quoted 5 lines · Philippe Mathieu-Daudé
Instead of including helper-gvec.h.inc via
helper.hwhich is included by all TCG files, restrict it to the few files that require it.Signed-off-by Philippe Mathieu-Daudé <[email protected]>
Quoted 8 lines
--- target/arm/helper.h | 1 - target/arm/tcg/translate-a64.c | 4 ++++ target/arm/tcg/translate-gvec.c | 6 ++++++ target/arm/tcg/translate-neon.c | 4 ++++ target/arm/tcg/translate-sve.c | 3 +++ target/arm/tcg/vec_helper.c | 4 ++++ 6 files changed, 21 insertions(+), 1 deletion(-)
r~
PATCH v3 19/34 target/arm/tcg: Extract SVE2 definitions to 'helper-sve.h.inc'
In reply to Philippe Mathieu-Daudéhelper.h is used by all units, but not all require the SVE2 definitions. We already have helper-sve.h.inc for SVE* definitions, move them there. The next commit will remove it from the common helper.h.
--- target/arm/helper.h | 46 --------------------------------- target/arm/tcg/helper-sve.h.inc | 46 +++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 46 deletions(-)
target/arm/helper.h +0 -46
@@ -146,52 +146,6 @@ DEF_HELPER_FLAGS_4(crypto_rax1, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) DEF_HELPER_FLAGS_3(crc32, TCG_CALL_NO_RWG_SE, i32, i32, i32, i32) DEF_HELPER_FLAGS_3(crc32c, TCG_CALL_NO_RWG_SE, i32, i32, i32, i32) -DEF_HELPER_FLAGS_5 (sve2_sqrdmlah_b,TCG_CALL_NO_RWG , - void, ptr, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_5 (sve2_sqrdmlsh_b,TCG_CALL_NO_RWG , - void, ptr, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_5 (sve2_sqrdmlah_h,TCG_CALL_NO_RWG , - void, ptr, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_5 (sve2_sqrdmlsh_h,TCG_CALL_NO_RWG , - void, ptr, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_5 (sve2_sqrdmlah_s,TCG_CALL_NO_RWG , - void, ptr, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_5 (sve2_sqrdmlsh_s,TCG_CALL_NO_RWG , - void, ptr, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_5 (sve2_sqrdmlah_d,TCG_CALL_NO_RWG , - void, ptr, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_5 (sve2_sqrdmlsh_d,TCG_CALL_NO_RWG , - void, ptr, ptr, ptr, ptr, i32) - -DEF_HELPER_FLAGS_4(sve2_sqdmulh_b, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_4(sve2_sqdmulh_h, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_4(sve2_sqdmulh_s, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_4(sve2_sqdmulh_d, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) - -DEF_HELPER_FLAGS_4(sve2_sqrdmulh_b, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_4(sve2_sqrdmulh_h, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_4(sve2_sqrdmulh_s, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_4(sve2_sqrdmulh_d, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) - -DEF_HELPER_FLAGS_4 (sve2_sqdmulh_idx_h,TCG_CALL_NO_RWG , - void, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_4 (sve2_sqdmulh_idx_s,TCG_CALL_NO_RWG , - void, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_4 (sve2_sqdmulh_idx_d,TCG_CALL_NO_RWG , - void, ptr, ptr, ptr, i32) - -DEF_HELPER_FLAGS_4 (sve2_sqrdmulh_idx_h,TCG_CALL_NO_RWG , - void, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_4 (sve2_sqrdmulh_idx_s,TCG_CALL_NO_RWG , - void, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_4 (sve2_sqrdmulh_idx_d,TCG_CALL_NO_RWG , - void, ptr, ptr, ptr, i32) - -DEF_HELPER_FLAGS_6 (sve2_fmlal_zzzw_s,TCG_CALL_NO_RWG , - void, ptr, ptr, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_6 (sve2_fmlal_zzxw_s,TCG_CALL_NO_RWG , - void, ptr, ptr, ptr, ptr, ptr, i32) -#ifdef TARGET_AARCH64 #include "tcg/helper-a64.h.inc" #include "tcg/helper-sve.h.inc"
target/arm/tcg/helper-sve.h.inc +46 -0
49 lines not on this page · raw message
Signature · 1 line
2.38.1
PATCH v3 20/34 target/arm/tcg: Reduce 'helper-sve.h.inc' inclusion
In reply to Philippe Mathieu-DaudéInstead of including helper-sve.h.inc via helper.h which is included by all TCG files, restrict it to the few files that require it.
--- target/arm/helper.h | 1 - target/arm/tcg/sve_helper.c | 4 ++++ target/arm/tcg/translate-sme.c | 4 ++++ target/arm/tcg/translate-sve.c | 6 ++++++ target/arm/tcg/vec_helper.c | 4 ++++ 5 files changed, 18 insertions(+), 1 deletion(-)
target/arm/helper.h +0 -1
@@ -148,7 +148,6 @@ DEF_HELPER_FLAGS_3(crc32c, TCG_CALL_NO_RWG_SE, i32, i32, i32, i32)#ifdef TARGET_AARCH64 #include "tcg/helper-a64.h.inc" -#include "tcg/helper-sve.h.inc" #include "tcg/helper-sme.h.inc" #endif
target/arm/tcg/sve_helper.c +4 -0
@@ -33,6 +33,10 @@#include "exec/helper-proto.h.inc" #undef HELPER_H +#define HELPER_H "tcg/helper-sve.h.inc" +#include "exec/helper-proto.h.inc" +#undef HELPER_H +/* Return a value for NZCV as per the ARM PredTest pseudofunction. * * The return value has bit 31 set if N is set, bit 1 set if Z is clear,
target/arm/tcg/translate-sme.c +4 -0
@@ -25,6 +25,10 @@#include "exec/helper-gen.h.inc" #undef HELPER_H +#define HELPER_H "tcg/helper-sve.h.inc" +#include "exec/helper-gen.h.inc" +#undef HELPER_H +/* * Include the generated decoder. */
target/arm/tcg/translate-sve.c +6 -0
@@ -26,6 +26,12 @@#include "exec/helper-gen.h.inc" #undef HELPER_H +#define HELPER_H "tcg/helper-sve.h.inc" +#include "exec/helper-proto.h.inc" +#include "exec/helper-gen.h.inc" +#include "exec/helper-info.c.inc" +#undef HELPER_H +typedef void GVecGen2sFn (unsigned ,uint32_t ,uint32_t ,TCGv_i64 ,uint32_t ,uint32_t );
target/arm/tcg/vec_helper.c +4 -0
@@ -37,6 +37,10 @@#include "exec/helper-proto.h.inc" #undef HELPER_H +#define HELPER_H "tcg/helper-sve.h.inc" +#include "exec/helper-proto.h.inc" +#undef HELPER_H +/* * Data for expanding active predicate bits to bytes, for byte elements. *
Signature · 1 line
2.38.1
Re: [PATCH v3 20/34] target/arm/tcg: Reduce 'helper-sve.h.inc' inclusion
Quoted 4 lines · Philippe Mathieu-Daudé
Instead of including helper-sve.h.inc via
helper.hwhich is included by all TCG files, restrict it to the few files that require it.
Quoted 8 lines
Signed-off-by Philippe Mathieu-Daudé<[email protected]>--- target/arm/helper.h | 1 - target/arm/tcg/sve_helper.c | 4 ++++ target/arm/tcg/translate-sme.c | 4 ++++ target/arm/tcg/translate-sve.c | 6 ++++++ target/arm/tcg/vec_helper.c | 4 ++++ 5 files changed, 18 insertions(+), 1 deletion(-)
r~
PATCH v3 21/34 target/arm/tcg: Extract crypto definitions to 'helper-crypto.h.inc'
In reply to Philippe Mathieu-Daudéhelper.h is used by all units, but not all require the crypto definitions. Move them to a new header; the next commit will remove it from the common helper.h.
--- target/arm/helper.h | 37 ++------------------------ target/arm/tcg/helper-crypto.h.inc | 42 ++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 35 deletions(-) create mode 100644 target/arm/tcg/helper-crypto.h.inc
target/arm/helper.h +2 -35
@@ -108,44 +108,11 @@ DEF_HELPER_3(shr_cc, i32, env, i32, i32) DEF_HELPER_3(sar_cc, i32, env, i32, i32) DEF_HELPER_3(ror_cc, i32, env, i32, i32) -DEF_HELPER_FLAGS_4(crypto_aese, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_3(crypto_aesmc, TCG_CALL_NO_RWG, void, ptr, ptr, i32) - -DEF_HELPER_FLAGS_4(crypto_sha1su0, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_4(crypto_sha1c, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_4(crypto_sha1p, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_4(crypto_sha1m, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_3(crypto_sha1h, TCG_CALL_NO_RWG, void, ptr, ptr, i32) -DEF_HELPER_FLAGS_3(crypto_sha1su1, TCG_CALL_NO_RWG, void, ptr, ptr, i32) - -DEF_HELPER_FLAGS_4(crypto_sha256h, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_4(crypto_sha256h2, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_3(crypto_sha256su0, TCG_CALL_NO_RWG, void, ptr, ptr, i32) -DEF_HELPER_FLAGS_4(crypto_sha256su1, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) - -DEF_HELPER_FLAGS_4(crypto_sha512h, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_4(crypto_sha512h2, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_3(crypto_sha512su0, TCG_CALL_NO_RWG, void, ptr, ptr, i32) -DEF_HELPER_FLAGS_4 (crypto_sha512su1,TCG_CALL_NO_RWG , - void, ptr, ptr, ptr, i32) - -DEF_HELPER_FLAGS_4(crypto_sm3tt1a, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_4(crypto_sm3tt1b, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_4(crypto_sm3tt2a, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_4(crypto_sm3tt2b, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_4 (crypto_sm3partw1,TCG_CALL_NO_RWG , - void, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_4 (crypto_sm3partw2,TCG_CALL_NO_RWG , - void, ptr, ptr, ptr, i32) - -DEF_HELPER_FLAGS_4(crypto_sm4e, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) -DEF_HELPER_FLAGS_4(crypto_sm4ekey, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) - -DEF_HELPER_FLAGS_4(crypto_rax1, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) - DEF_HELPER_FLAGS_3(crc32, TCG_CALL_NO_RWG_SE, i32, i32, i32, i32) DEF_HELPER_FLAGS_3(crc32c, TCG_CALL_NO_RWG_SE, i32, i32, i32, i32) +#include "tcg/helper-crypto.h.inc" +#ifdef TARGET_AARCH64 #include "tcg/helper-a64.h.inc" #include "tcg/helper-sme.h.inc"
target/arm/tcg/helper-crypto.h.inc new file +42 -0
42 lines not on this page · raw message
Signature · 1 line
2.38.1
Re: [PATCH v3 21/34] target/arm/tcg: Extract crypto definitions to 'helper-crypto.h.inc'
Quoted 10 lines · Philippe Mathieu-Daudé
helper.his used by all units, but not all require the crypto definitions. Move them to a new header; the next commit will remove it from the commonhelper.h.Signed-off-by Philippe Mathieu-Daudé<[email protected]>--- target/arm/helper.h | 37 ++------------------------ target/arm/tcg/helper-crypto.h.inc | 42 ++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 35 deletions(-)create mode 100644 target/arm/tcg/helper-crypto.h.inc
r~
PATCH v3 22/34 target/arm/tcg: Reduce 'helper-crypto.h.inc' inclusion
In reply to Philippe Mathieu-DaudéInstead of including helper-crypto.h.inc via helper.h which is included by all TCG files, restrict it to the few files that require it.
--- target/arm/helper.h | 2 -- target/arm/tcg/crypto_helper.c | 7 ++++++- target/arm/tcg/translate-a64.c | 4 ++++ target/arm/tcg/translate-neon.c | 4 ++++ target/arm/tcg/translate-sve.c | 4 ++++ 5 files changed, 18 insertions(+), 3 deletions(-)
target/arm/helper.h +0 -2
@@ -111,8 +111,6 @@ DEF_HELPER_3(ror_cc, i32, env, i32, i32) DEF_HELPER_FLAGS_3(crc32, TCG_CALL_NO_RWG_SE, i32, i32, i32, i32) DEF_HELPER_FLAGS_3(crc32c, TCG_CALL_NO_RWG_SE, i32, i32, i32, i32) -#include "tcg/helper-crypto.h.inc" -#ifdef TARGET_AARCH64 #include "tcg/helper-a64.h.inc" #include "tcg/helper-sme.h.inc"
target/arm/tcg/crypto_helper.c +6 -1
@@ -12,12 +12,17 @@#include "qemu/osdep.h" #include "cpu.h" -#include "exec/helper-proto.h" #include "tcg/tcg-gvec-desc.h" #include "crypto/aes.h" #include "crypto/sm4.h" #include "vec_internal.h" +#define HELPER_H "tcg/helper-crypto.h.inc" +#include "exec/helper-proto.h.inc" +#include "exec/helper-gen.h.inc" +#include "exec/helper-info.c.inc" +#undef HELPER_H +union CRYPTO_STATE {uint8_t bytes[16 ];uint32_t words[4 ];
target/arm/tcg/translate-a64.c +4 -0
@@ -38,6 +38,10 @@#include "exec/helper-gen.h.inc" #undef HELPER_H +#define HELPER_H "tcg/helper-crypto.h.inc" +#include "exec/helper-gen.h.inc" +#undef HELPER_H +static TCGv_i64 cpu_X[32 ];static TCGv_i64 cpu_pc;
target/arm/tcg/translate-neon.c +4 -0
@@ -32,6 +32,10 @@#include "exec/helper-gen.h.inc" #undef HELPER_H +#define HELPER_H "tcg/helper-crypto.h.inc" +#include "exec/helper-gen.h.inc" +#undef HELPER_H +#define HELPER_H "tcg/helper-neon.h.inc"#include "exec/helper-proto.h.inc" #include "exec/helper-gen.h.inc"
target/arm/tcg/translate-sve.c +4 -0
@@ -26,6 +26,10 @@#include "exec/helper-gen.h.inc" #undef HELPER_H +#define HELPER_H "tcg/helper-crypto.h.inc" +#include "exec/helper-gen.h.inc" +#undef HELPER_H +#define HELPER_H "tcg/helper-sve.h.inc"#include "exec/helper-proto.h.inc" #include "exec/helper-gen.h.inc"
Signature · 1 line
2.38.1
Re: [PATCH v3 22/34] target/arm/tcg: Reduce 'helper-crypto.h.inc' inclusion
Quoted 7 lines · Philippe Mathieu-Daudé
+++
b/target/arm/tcg/crypto_helper.ctarget/arm/tcg/crypto_helper.c +0
-1@@ -12,12 +12,17 @@#include "qemu/osdep.h" #include "cpu.h" -#include "exec/helper-proto.h" #include "tcg/tcg-gvec-desc.h"
target/arm/tcg/crypto_helper.c line 25
Quoted 10 lines
target/arm/tcg/crypto_helper.c +6
-0#include "crypto/aes.h" #include "crypto/sm4.h" #include "vec_internal.h" +#define HELPER_H "tcg/helper-crypto.h.inc" +#include "exec/helper-proto.h.inc" +#include "exec/helper-gen.h.inc" +#include "exec/helper-info.c.inc" +#undef HELPER_H +
foo_helper.c does not require helper-gen.h.inc.
Usually we put helper-info.c.inc into one of the translate*.c files; probably translate-neon.c in this case.
r~
Re: [PATCH v3 22/34] target/arm/tcg: Reduce 'helper-crypto.h.inc' inclusion
Quoted 10 lines · Richard Henderson
Quoted 9 lines · Philippe Mathieu-Daudé
+++
b/target/arm/tcg/crypto_helper.ctarget/arm/tcg/crypto_helper.c +0
-1@@ -12,12 +12,17 @@ #include "qemu/osdep.h" #include "cpu.h" -#include "exec/helper-proto.h" #include "tcg/tcg-gvec-desc.h" #include "crypto/aes.h" #include "crypto/sm4.h" #include "vec_internal.h"
Quoted 8 lines
target/arm/tcg/crypto_helper.c line 25
Quoted 6 lines
target/arm/tcg/crypto_helper.c +6
-0+#define HELPER_H "tcg/helper-crypto.h.inc" +#include "exec/helper-proto.h.inc" +#include "exec/helper-gen.h.inc" +#include "exec/helper-info.c.inc" +#undef HELPER_H +
foo_helper.cdoes not require helper-gen.h.inc.
Right.
Quoted 1 line
Usually we put helper-info.c.inc into one of the translate*.c files; probably
translate-neon.cin this case.
Yes.
PATCH v3 23/34 target/arm/tcg: Reduce 'helper-mve.h.inc' inclusion
In reply to Philippe Mathieu-DaudéInstead of including helper-mve.h.inc via helper.h which is included by all TCG files, restrict it to the few files that require it.
--- target/arm/helper.h | 2 -- target/arm/tcg/mve_helper.c | 5 ++++- target/arm/tcg/translate-mve.c | 6 ++++++ target/arm/tcg/translate.c | 4 ++++ 4 files changed, 14 insertions(+), 3 deletions(-)
target/arm/helper.h +0 -2
@@ -115,5 +115,3 @@ DEF_HELPER_FLAGS_3(crc32c, TCG_CALL_NO_RWG_SE, i32, i32, i32, i32)#include "tcg/helper-a64.h.inc" #include "tcg/helper-sme.h.inc" #endif - -#include "tcg/helper-mve.h.inc"
target/arm/tcg/mve_helper.c +4 -1
@@ -21,7 +21,6 @@#include "cpu.h" #include "internals.h" #include "vec_internal.h" -#include "exec/helper-proto.h" #include "exec/cpu_ldst.h" #include "exec/exec-all.h" #include "tcg/tcg.h"
@@ -31,6 +30,10 @@#include "exec/helper-proto.h.inc" #undef HELPER_H +#define HELPER_H "tcg/helper-mve.h.inc" +#include "exec/helper-proto.h.inc" +#undef HELPER_H +static uint16_t mve_eci_mask (CPUARMState *env) {/*
target/arm/tcg/translate-mve.c +6 -0
@@ -21,6 +21,12 @@#include "translate.h" #include "translate-a32.h" +#define HELPER_H "tcg/helper-mve.h.inc" +#include "exec/helper-proto.h.inc" +#include "exec/helper-gen.h.inc" +#include "exec/helper-info.c.inc" +#undef HELPER_H +static inline int vidup_imm (DisasContext *s,int x) {return 1 << x;
target/arm/tcg/translate.c +4 -0
@@ -33,6 +33,10 @@#include "exec/helper-gen.h.inc" #undef HELPER_H +#define HELPER_H "tcg/helper-mve.h.inc" +#include "exec/helper-gen.h.inc" +#undef HELPER_H +#define HELPER_H "helper.h"#include "exec/helper-info.c.inc" #undef HELPER_H
Signature · 1 line
2.38.1
Re: [PATCH v3 23/34] target/arm/tcg: Reduce 'helper-mve.h.inc' inclusion
Quoted 11 lines · Philippe Mathieu-Daudé
Instead of including helper-mve.h.inc via
helper.hwhich is included by all TCG files, restrict it to the few files that require it.Signed-off-by Philippe Mathieu-Daudé<[email protected]>--- target/arm/helper.h | 2 -- target/arm/tcg/mve_helper.c | 5 ++++- target/arm/tcg/translate-mve.c | 6 ++++++ target/arm/tcg/translate.c | 4 ++++ 4 files changed, 14 insertions(+), 3 deletions(-)
r~
PATCH v3 24/34 target/arm/tcg: Reduce 'helper-sme.h.inc' inclusion
In reply to Philippe Mathieu-DaudéInstead of including helper-sme.h.inc via helper.h which is included by all TCG files, restrict it to the few files that require it.
--- target/arm/helper.h | 1 - target/arm/tcg/sme_helper.c | 5 ++++- target/arm/tcg/translate-a64.c | 4 ++++ target/arm/tcg/translate-sme.c | 6 ++++++ 4 files changed, 14 insertions(+), 2 deletions(-)
target/arm/helper.h +0 -1
@@ -113,5 +113,4 @@ DEF_HELPER_FLAGS_3(crc32c, TCG_CALL_NO_RWG_SE, i32, i32, i32, i32)#ifdef TARGET_AARCH64 #include "tcg/helper-a64.h.inc" -#include "tcg/helper-sme.h.inc" #endif
target/arm/tcg/sme_helper.c +4 -1
@@ -21,7 +21,6 @@#include "cpu.h" #include "internals.h" #include "tcg/tcg-gvec-desc.h" -#include "exec/helper-proto.h" #include "exec/cpu_ldst.h" #include "exec/exec-all.h" #include "qemu/int128.h"
@@ -29,6 +28,10 @@#include "vec_internal.h" #include "sve_ldst_internal.h" +#define HELPER_H "tcg/helper-sme.h.inc" +#include "exec/helper-proto.h.inc" +#undef HELPER_H +void helper_set_svcr (CPUARMState *env,uint32_t val,uint32_t mask) {aarch64_set_svcr (env, val, mask);
target/arm/tcg/translate-a64.c +4 -0
@@ -42,6 +42,10 @@#include "exec/helper-gen.h.inc" #undef HELPER_H +#define HELPER_H "tcg/helper-sme.h.inc" +#include "exec/helper-gen.h.inc" +#undef HELPER_H +static TCGv_i64 cpu_X[32 ];static TCGv_i64 cpu_pc;
target/arm/tcg/translate-sme.c +6 -0
@@ -29,6 +29,12 @@#include "exec/helper-gen.h.inc" #undef HELPER_H +#define HELPER_H "tcg/helper-sme.h.inc" +#include "exec/helper-proto.h.inc" +#include "exec/helper-gen.h.inc" +#include "exec/helper-info.c.inc" +#undef HELPER_H +/* * Include the generated decoder. */
Signature · 1 line
2.38.1
Re: [PATCH v3 24/34] target/arm/tcg: Reduce 'helper-sme.h.inc' inclusion
Quoted 11 lines · Philippe Mathieu-Daudé
Instead of including helper-sme.h.inc via
helper.hwhich is included by all TCG files, restrict it to the few files that require it.Signed-off-by Philippe Mathieu-Daudé<[email protected]>--- target/arm/helper.h | 1 - target/arm/tcg/sme_helper.c | 5 ++++- target/arm/tcg/translate-a64.c | 4 ++++ target/arm/tcg/translate-sme.c | 6 ++++++ 4 files changed, 14 insertions(+), 2 deletions(-)
r~
PATCH v3 25/34 target/arm/tcg: Extract PAuth definitions to 'helper-pauth.h.inc'
In reply to Philippe Mathieu-Daudéhelper.h is used by all units, but not all require the crypto definitions. Move them to a new header, which we only include where necessary, removing the need for "exec/helper-proto.h".
--- target/arm/tcg/helper-a64.h.inc | 12 ------------ target/arm/tcg/helper-pauth.h.inc | 19 +++++++++++++++++++ target/arm/tcg/pauth_helper.c | 4 +++- target/arm/tcg/translate-a64.c | 6 ++++++ 4 files changed, 28 insertions(+), 13 deletions(-) create mode 100644 target/arm/tcg/helper-pauth.h.inc
target/arm/tcg/helper-a64.h.inc +0 -12
@@ -69,18 +69,6 @@ DEF_HELPER_2(sqrt_f16, f16, f16, ptr) DEF_HELPER_2(exception_return, void, env, i64) DEF_HELPER_FLAGS_2(dc_zva, TCG_CALL_NO_WG, void, env, i64) -DEF_HELPER_FLAGS_3(pacia, TCG_CALL_NO_WG, i64, env, i64, i64) -DEF_HELPER_FLAGS_3(pacib, TCG_CALL_NO_WG, i64, env, i64, i64) -DEF_HELPER_FLAGS_3(pacda, TCG_CALL_NO_WG, i64, env, i64, i64) -DEF_HELPER_FLAGS_3(pacdb, TCG_CALL_NO_WG, i64, env, i64, i64) -DEF_HELPER_FLAGS_3(pacga, TCG_CALL_NO_WG, i64, env, i64, i64) -DEF_HELPER_FLAGS_3(autia, TCG_CALL_NO_WG, i64, env, i64, i64) -DEF_HELPER_FLAGS_3(autib, TCG_CALL_NO_WG, i64, env, i64, i64) -DEF_HELPER_FLAGS_3(autda, TCG_CALL_NO_WG, i64, env, i64, i64) -DEF_HELPER_FLAGS_3(autdb, TCG_CALL_NO_WG, i64, env, i64, i64) -DEF_HELPER_FLAGS_2(xpaci, TCG_CALL_NO_RWG_SE, i64, env, i64) -DEF_HELPER_FLAGS_2(xpacd, TCG_CALL_NO_RWG_SE, i64, env, i64) - DEF_HELPER_FLAGS_3(mte_check, TCG_CALL_NO_WG, i64, env, i32, i64) DEF_HELPER_FLAGS_3(mte_check_zva, TCG_CALL_NO_WG, i64, env, i32, i64) DEF_HELPER_FLAGS_3(irg, TCG_CALL_NO_RWG, i64, env, i64, i64)
target/arm/tcg/helper-pauth.h.inc new file +19 -0
@@ -0,0 +1,19 @@ +/* + * ARM v8.3-PAuth helper definitions + * + * Copyright (c) 2019 Linaro, Ltd. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +DEF_HELPER_FLAGS_3(pacia, TCG_CALL_NO_WG, i64, env, i64, i64) +DEF_HELPER_FLAGS_3(pacib, TCG_CALL_NO_WG, i64, env, i64, i64) +DEF_HELPER_FLAGS_3(pacda, TCG_CALL_NO_WG, i64, env, i64, i64) +DEF_HELPER_FLAGS_3(pacdb, TCG_CALL_NO_WG, i64, env, i64, i64) +DEF_HELPER_FLAGS_3(pacga, TCG_CALL_NO_WG, i64, env, i64, i64) +DEF_HELPER_FLAGS_3(autia, TCG_CALL_NO_WG, i64, env, i64, i64) +DEF_HELPER_FLAGS_3(autib, TCG_CALL_NO_WG, i64, env, i64, i64) +DEF_HELPER_FLAGS_3(autda, TCG_CALL_NO_WG, i64, env, i64, i64) +DEF_HELPER_FLAGS_3(autdb, TCG_CALL_NO_WG, i64, env, i64, i64) +DEF_HELPER_FLAGS_2(xpaci, TCG_CALL_NO_RWG_SE, i64, env, i64) +DEF_HELPER_FLAGS_2(xpacd, TCG_CALL_NO_RWG_SE, i64, env, i64)
target/arm/tcg/pauth_helper.c +3 -1
@@ -22,10 +22,12 @@#include "internals.h" #include "exec/exec-all.h" #include "exec/cpu_ldst.h" -#include "exec/helper-proto.h" #include "tcg/tcg-gvec-desc.h" #include "qemu/xxhash.h" +#define HELPER_H "tcg/helper-pauth.h.inc" +#include "exec/helper-proto.h.inc" +#undef HELPER_Hstatic uint64_t pac_cell_shuffle (uint64_t i) {
target/arm/tcg/translate-a64.c +6 -0
@@ -46,6 +46,12 @@#include "exec/helper-gen.h.inc" #undef HELPER_H +#define HELPER_H "tcg/helper-pauth.h.inc" +#include "exec/helper-proto.h.inc" +#include "exec/helper-gen.h.inc" +#include "exec/helper-info.c.inc" +#undef HELPER_H +static TCGv_i64 cpu_X[32 ];static TCGv_i64 cpu_pc;
Signature · 1 line
2.38.1
Re: [PATCH v3 25/34] target/arm/tcg: Extract PAuth definitions to 'helper-pauth.h.inc'
Quoted 4 lines · Philippe Mathieu-Daudé
helper.his used by all units, but not all require the crypto definitions. Move them to a new header, which we only include where necessary, removing the need for "exec/helper-proto.h".
Quoted 8 lines
Signed-off-by Philippe Mathieu-Daudé<[email protected]>--- target/arm/tcg/helper-a64.h.inc | 12 ------------ target/arm/tcg/helper-pauth.h.inc | 19 +++++++++++++++++++ target/arm/tcg/pauth_helper.c | 4 +++- target/arm/tcg/translate-a64.c | 6 ++++++ 4 files changed, 28 insertions(+), 13 deletions(-)create mode 100644 target/arm/tcg/helper-pauth.h.inc
r~
PATCH v3 26/34 target/arm/tcg: Extract MemTag definitions to 'helper-mte.h.inc'
In reply to Philippe Mathieu-Daudéhelper.h is used by all units, but not all require the crypto definitions. Move them to a new header, which we only include where necessary, removing the need for "exec/helper-proto.h".
--- target/arm/tcg/helper-a64.h.inc | 16 ---------------- target/arm/tcg/helper-mte.h.inc | 23 +++++++++++++++++++++++ target/arm/tcg/mte_helper.c | 4 +++- target/arm/tcg/translate-a64.c | 6 ++++++ 4 files changed, 32 insertions(+), 17 deletions(-) create mode 100644 target/arm/tcg/helper-mte.h.inc
target/arm/tcg/helper-a64.h.inc +0 -16
@@ -68,21 +68,5 @@ DEF_HELPER_2(sqrt_f16, f16, f16, ptr) DEF_HELPER_2(exception_return, void, env, i64) DEF_HELPER_FLAGS_2(dc_zva, TCG_CALL_NO_WG, void, env, i64) - -DEF_HELPER_FLAGS_3(mte_check, TCG_CALL_NO_WG, i64, env, i32, i64) -DEF_HELPER_FLAGS_3(mte_check_zva, TCG_CALL_NO_WG, i64, env, i32, i64) -DEF_HELPER_FLAGS_3(irg, TCG_CALL_NO_RWG, i64, env, i64, i64) -DEF_HELPER_FLAGS_4(addsubg, TCG_CALL_NO_RWG_SE, i64, env, i64, s32, i32) -DEF_HELPER_FLAGS_3(ldg, TCG_CALL_NO_WG, i64, env, i64, i64) -DEF_HELPER_FLAGS_3(stg, TCG_CALL_NO_WG, void, env, i64, i64) -DEF_HELPER_FLAGS_3(stg_parallel, TCG_CALL_NO_WG, void, env, i64, i64) -DEF_HELPER_FLAGS_2(stg_stub, TCG_CALL_NO_WG, void, env, i64) -DEF_HELPER_FLAGS_3(st2g, TCG_CALL_NO_WG, void, env, i64, i64) -DEF_HELPER_FLAGS_3(st2g_parallel, TCG_CALL_NO_WG, void, env, i64, i64) -DEF_HELPER_FLAGS_2(st2g_stub, TCG_CALL_NO_WG, void, env, i64) -DEF_HELPER_FLAGS_2(ldgm, TCG_CALL_NO_WG, i64, env, i64) -DEF_HELPER_FLAGS_3(stgm, TCG_CALL_NO_WG, void, env, i64, i64) -DEF_HELPER_FLAGS_3(stzgm_tags, TCG_CALL_NO_WG, void, env, i64, i64) - DEF_HELPER_FLAGS_4(unaligned_access, TCG_CALL_NO_WG, noreturn, env, i64, i32, i32)
target/arm/tcg/helper-mte.h.inc new file +23 -0
@@ -0,0 +1,23 @@ +/* + * ARM v8.5-MemTag helper definitions + * + * Copyright (c) 2020 Linaro, Ltd. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +DEF_HELPER_FLAGS_3(mte_check, TCG_CALL_NO_WG, i64, env, i32, i64) +DEF_HELPER_FLAGS_3(mte_check_zva, TCG_CALL_NO_WG, i64, env, i32, i64) + +DEF_HELPER_FLAGS_3(irg, TCG_CALL_NO_RWG, i64, env, i64, i64) +DEF_HELPER_FLAGS_4(addsubg, TCG_CALL_NO_RWG_SE, i64, env, i64, s32, i32) +DEF_HELPER_FLAGS_3(ldg, TCG_CALL_NO_WG, i64, env, i64, i64) +DEF_HELPER_FLAGS_3(stg, TCG_CALL_NO_WG, void, env, i64, i64) +DEF_HELPER_FLAGS_3(stg_parallel, TCG_CALL_NO_WG, void, env, i64, i64) +DEF_HELPER_FLAGS_2(stg_stub, TCG_CALL_NO_WG, void, env, i64) +DEF_HELPER_FLAGS_3(st2g, TCG_CALL_NO_WG, void, env, i64, i64) +DEF_HELPER_FLAGS_3(st2g_parallel, TCG_CALL_NO_WG, void, env, i64, i64) +DEF_HELPER_FLAGS_2(st2g_stub, TCG_CALL_NO_WG, void, env, i64) +DEF_HELPER_FLAGS_2(ldgm, TCG_CALL_NO_WG, i64, env, i64) +DEF_HELPER_FLAGS_3(stgm, TCG_CALL_NO_WG, void, env, i64, i64) +DEF_HELPER_FLAGS_3(stzgm_tags, TCG_CALL_NO_WG, void, env, i64, i64)
target/arm/tcg/mte_helper.c +3 -1
@@ -24,11 +24,13 @@#include "exec/exec-all.h" #include "exec/ram_addr.h" #include "exec/cpu_ldst.h" -#include "exec/helper-proto.h" #include "hw/core/tcg-cpu-ops.h" #include "qapi/error.h" #include "qemu/guest-random.h" +#define HELPER_H "tcg/helper-mte.h.inc" +#include "exec/helper-proto.h.inc" +#undef HELPER_Hstatic int choose_nonexcluded_tag (int tag,int offset,uint16_t exclude) {
target/arm/tcg/translate-a64.c +6 -0
@@ -46,6 +46,12 @@#include "exec/helper-gen.h.inc" #undef HELPER_H +#define HELPER_H "tcg/helper-mte.h.inc" +#include "exec/helper-proto.h.inc" +#include "exec/helper-gen.h.inc" +#include "exec/helper-info.c.inc" +#undef HELPER_H +#define HELPER_H "tcg/helper-pauth.h.inc"#include "exec/helper-proto.h.inc" #include "exec/helper-gen.h.inc"
Signature · 1 line
2.38.1
Re: [PATCH v3 26/34] target/arm/tcg: Extract MemTag definitions to 'helper-mte.h.inc'
Quoted 4 lines · Philippe Mathieu-Daudé
helper.his used by all units, but not all require the crypto definitions. Move them to a new header, which we only include where necessary, removing the need for "exec/helper-proto.h".
Quoted 8 lines
Signed-off-by Philippe Mathieu-Daudé<[email protected]>--- target/arm/tcg/helper-a64.h.inc | 16 ---------------- target/arm/tcg/helper-mte.h.inc | 23 +++++++++++++++++++++++ target/arm/tcg/mte_helper.c | 4 +++- target/arm/tcg/translate-a64.c | 6 ++++++ 4 files changed, 32 insertions(+), 17 deletions(-)create mode 100644 target/arm/tcg/helper-mte.h.inc
r~
PATCH v3 27/34 target/arm/tcg: Reduce 'helper-a64.h.inc' inclusion
In reply to Philippe Mathieu-DaudéInstead of including helper-a64.h.inc via helper.h which is included by all TCG files, restrict it to the few files that require it.
--- target/arm/helper.h | 4 ---- target/arm/tcg/helper-a64.c | 4 ++++ target/arm/tcg/sve_helper.c | 5 ++++- target/arm/tcg/translate-a64.c | 6 ++++++ target/arm/tcg/vec_helper.c | 5 ++++- 5 files changed, 18 insertions(+), 6 deletions(-)
target/arm/helper.h +0 -4
@@ -110,7 +110,3 @@ DEF_HELPER_3(ror_cc, i32, env, i32, i32) DEF_HELPER_FLAGS_3(crc32, TCG_CALL_NO_RWG_SE, i32, i32, i32, i32)DEF_HELPER_FLAGS_3 (crc32c,TCG_CALL_NO_RWG_SE , i32, i32, i32, i32) - -#ifdef TARGET_AARCH64 -#include "tcg/helper-a64.h.inc" -#endif
target/arm/tcg/helper-a64.c +4 -0
@@ -35,6 +35,10 @@#include "fpu/softfloat.h" #include <zlib.h> /* For crc32 */ +#define HELPER_H "tcg/helper-a64.h.inc" +#include "exec/helper-proto.h.inc" +#undef HELPER_H +/* C2.4.7 Multiply and divide */ /* special cases for 0 and LLONG_MIN are mandated by the standard */ uint64_t HELPER (udiv64 )(uint64_t num,uint64_t den)
target/arm/tcg/sve_helper.c +4 -1
@@ -21,7 +21,6 @@#include "cpu.h" #include "internals.h" #include "exec/exec-all.h" -#include "exec/helper-proto.h" #include "tcg/tcg-gvec-desc.h" #include "fpu/softfloat.h" #include "tcg/tcg.h"
@@ -37,6 +36,10 @@#include "exec/helper-proto.h.inc" #undef HELPER_H +#define HELPER_H "tcg/helper-a64.h.inc" +#include "exec/helper-proto.h.inc" +#undef HELPER_H +/* Return a value for NZCV as per the ARM PredTest pseudofunction. * * The return value has bit 31 set if N is set, bit 1 set if Z is clear,
target/arm/tcg/translate-a64.c +6 -0
@@ -58,6 +58,12 @@#include "exec/helper-info.c.inc" #undef HELPER_H +#define HELPER_H "tcg/helper-a64.h.inc" +#include "exec/helper-proto.h.inc" +#include "exec/helper-gen.h.inc" +#include "exec/helper-info.c.inc" +#undef HELPER_H +static TCGv_i64 cpu_X[32 ];static TCGv_i64 cpu_pc;
target/arm/tcg/vec_helper.c +4 -1
@@ -19,7 +19,6 @@#include "qemu/osdep.h" #include "cpu.h" -#include "exec/helper-proto.h" #include "tcg/tcg-gvec-desc.h" #include "fpu/softfloat.h" #include "qemu/int128.h"
@@ -41,6 +40,10 @@#include "exec/helper-proto.h.inc" #undef HELPER_H +#define HELPER_H "tcg/helper-a64.h.inc" +#include "exec/helper-proto.h.inc" +#undef HELPER_H +/* * Data for expanding active predicate bits to bytes, for byte elements. *
Signature · 1 line
2.38.1
PATCH v3 28/34 target/arm/tcg: Move v8m_stackcheck() from op_helper.c to m_helper.c
In reply to Philippe Mathieu-DaudéNo need to have the v8m_stackcheck() helper in the generic op_helper.c, move it with the rest of the M-profile helpers.
--- target/arm/tcg/m_helper.c | 16 ++++++++++++++++ target/arm/tcg/op_helper.c | 16 ---------------- 2 files changed, 16 insertions(+), 16 deletions(-)
target/arm/tcg/m_helper.c +16 -0
@@ -2893,3 +2893,19 @@ uint32_t *arm_v7m_get_sp_ptr(CPUARMState *env, bool secure, bool threadmode, } } } + +void HELPER (v8m_stackcheck )(CPUARMState *env,uint32_t newvalue) +{ +/* +* Perform the v8M stack limit check for SP updates from translated code, +* raising an exception if the limit is breached. +*/ +if (newvalue <v7m_sp_limit (env)) { +/* +* Stack limit exceptions are a rare case, so rather than syncing +* PC/condbits before the call, we use raise_exception_ra() so +* that cpu_restore_state() will sort them out. +*/ +raise_exception_ra (env,EXCP_STKOF ,0 ,1 ,GETPC ()); + } +}
target/arm/tcg/op_helper.c +0 -16
@@ -82,22 +82,6 @@ void raise_exception_ra(CPUARMState *env, uint32_t excp, uint32_t syndrome,raise_exception (env, excp, syndrome, target_el); } -void HELPER (v8m_stackcheck )(CPUARMState *env,uint32_t newvalue) -{ -/* -* Perform the v8M stack limit check for SP updates from translated code, -* raising an exception if the limit is breached. -*/ -if (newvalue <v7m_sp_limit (env)) { -/* -* Stack limit exceptions are a rare case, so rather than syncing -* PC/condbits before the call, we use raise_exception_ra() so -* that cpu_restore_state() will sort them out. -*/ -raise_exception_ra (env,EXCP_STKOF ,0 ,1 ,GETPC ()); - } -} -uint32_t HELPER (add_setq )(CPUARMState *env,uint32_t a,uint32_t b) {uint32_t res = a + b;
Signature · 1 line
2.38.1
Re: [PATCH v3 28/34] target/arm/tcg: Move v8m_stackcheck() from op_helper.c to m_helper.c
Quoted 8 lines · Philippe Mathieu-Daudé
No need to have the
v8m_stackcheck()helper in the genericop_helper.c, move it with the rest of the M-profile helpers.Signed-off-by Philippe Mathieu-Daudé<[email protected]>--- target/arm/tcg/m_helper.c | 16 ++++++++++++++++ target/arm/tcg/op_helper.c | 16 ---------------- 2 files changed, 16 insertions(+), 16 deletions(-)
r~
PATCH v3 29/34 target/arm/tcg: Extract M-profile definitions to 'helper-m.h.inc'
In reply to Philippe Mathieu-Daudéhelper.h is used by all units, but not all require the M-profile definitions. Move them to a new header; the next commit will remove it from the common helper.h.
--- target/arm/helper.h | 17 ++--------------- target/arm/tcg/helper-m.h.inc | 23 +++++++++++++++++++++++ 2 files changed, 25 insertions(+), 15 deletions(-) create mode 100644 target/arm/tcg/helper-m.h.inc
target/arm/helper.h +2 -15
@@ -62,21 +62,6 @@ DEF_HELPER_3(cpsr_write, void, env, i32, i32) DEF_HELPER_2(cpsr_write_eret, void, env, i32) DEF_HELPER_1(cpsr_read, i32, env) -DEF_HELPER_3(v7m_msr, void, env, i32, i32) -DEF_HELPER_2(v7m_mrs, i32, env, i32) - -DEF_HELPER_2(v7m_bxns, void, env, i32) -DEF_HELPER_2(v7m_blxns, void, env, i32) - -DEF_HELPER_3(v7m_tt, i32, env, i32, i32) - -DEF_HELPER_1(v7m_preserve_fp_state, void, env) - -DEF_HELPER_2(v7m_vlstm, void, env, i32) -DEF_HELPER_2(v7m_vlldm, void, env, i32) - -DEF_HELPER_2(v8m_stackcheck, void, env, i32) - DEF_HELPER_FLAGS_2(check_bxj_trap, TCG_CALL_NO_WG, void, env, i32)DEF_HELPER_4 (access_check_cp_reg, cptr, env, i32, i32, i32)
@@ -110,3 +95,5 @@ DEF_HELPER_3(ror_cc, i32, env, i32, i32) DEF_HELPER_FLAGS_3(crc32, TCG_CALL_NO_RWG_SE, i32, i32, i32, i32) DEF_HELPER_FLAGS_3(crc32c, TCG_CALL_NO_RWG_SE, i32, i32, i32, i32) + +#include "tcg/helper-m.h.inc"
target/arm/tcg/helper-m.h.inc new file +23 -0
@@ -0,0 +1,23 @@ +/* + * ARM M-profile helper definitions + * + * Copyright (c) 2007 CodeSourcery. + * Written by Paul Brook + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +DEF_HELPER_3(v7m_msr, void, env, i32, i32) +DEF_HELPER_2(v7m_mrs, i32, env, i32) + +DEF_HELPER_2(v7m_bxns, void, env, i32) +DEF_HELPER_2(v7m_blxns, void, env, i32) + +DEF_HELPER_3(v7m_tt, i32, env, i32, i32) + +DEF_HELPER_1(v7m_preserve_fp_state, void, env) + +DEF_HELPER_2(v7m_vlstm, void, env, i32) +DEF_HELPER_2(v7m_vlldm, void, env, i32) + +DEF_HELPER_2(v8m_stackcheck, void, env, i32)
Signature · 1 line
2.38.1
Re: [PATCH v3 29/34] target/arm/tcg: Extract M-profile definitions to 'helper-m.h.inc'
Quoted 10 lines · Philippe Mathieu-Daudé
helper.his used by all units, but not all require the M-profile definitions. Move them to a new header; the next commit will remove it from the commonhelper.h.Signed-off-by Philippe Mathieu-Daudé<[email protected]>--- target/arm/helper.h | 17 ++--------------- target/arm/tcg/helper-m.h.inc | 23 +++++++++++++++++++++++ 2 files changed, 25 insertions(+), 15 deletions(-)create mode 100644 target/arm/tcg/helper-m.h.inc
r~
PATCH v3 30/34 target/arm/tcg: Reduce 'helper-m.h.inc' inclusion
In reply to Philippe Mathieu-DaudéInstead of including helper-m.h.inc via helper.h which is included by all TCG files, restrict it to the few files that require it.
--- target/arm/helper.h | 2 -- target/arm/tcg/m_helper.c | 4 ++++ target/arm/tcg/translate-m-nocp.c | 6 ++++++ target/arm/tcg/translate-vfp.c | 4 ++++ target/arm/tcg/translate.c | 4 ++++ 5 files changed, 18 insertions(+), 2 deletions(-)
target/arm/helper.h +0 -2
@@ -95,5 +95,3 @@ DEF_HELPER_3(ror_cc, i32, env, i32, i32) DEF_HELPER_FLAGS_3(crc32, TCG_CALL_NO_RWG_SE, i32, i32, i32, i32)DEF_HELPER_FLAGS_3 (crc32c,TCG_CALL_NO_RWG_SE , i32, i32, i32, i32) - -#include "tcg/helper-m.h.inc"
target/arm/tcg/m_helper.c +4 -0
@@ -21,6 +21,10 @@#include "hw/intc/armv7m_nvic.h" #endif +#define HELPER_H "tcg/helper-m.h.inc" +#include "exec/helper-proto.h.inc" +#undef HELPER_H +static void v7m_msr_xpsr (CPUARMState *env,uint32_t mask,uint32_t reg,uint32_t val) {
target/arm/tcg/translate-m-nocp.c +6 -0
@@ -25,6 +25,12 @@#include "exec/helper-gen.h.inc" #undef HELPER_H +#define HELPER_H "tcg/helper-m.h.inc" +#include "exec/helper-proto.h.inc" +#include "exec/helper-gen.h.inc" +#include "exec/helper-info.c.inc" +#undef HELPER_H +/* Include the generated decoder */ #include "decode-m-nocp.c.inc"
target/arm/tcg/translate-vfp.c +4 -0
@@ -24,6 +24,10 @@#include "translate.h" #include "translate-a32.h" +#define HELPER_H "tcg/helper-m.h.inc" +#include "exec/helper-gen.h.inc" +#undef HELPER_H +#define HELPER_H "tcg/helper-vfp.h.inc"#include "exec/helper-proto.h.inc" #include "exec/helper-gen.h.inc"
target/arm/tcg/translate.c +4 -0
@@ -37,6 +37,10 @@#include "exec/helper-gen.h.inc" #undef HELPER_H +#define HELPER_H "tcg/helper-m.h.inc" +#include "exec/helper-gen.h.inc" +#undef HELPER_H +#define HELPER_H "helper.h"#include "exec/helper-info.c.inc" #undef HELPER_H
Signature · 1 line
2.38.1
PATCH v3 31/34 target/arm/tcg: Inline 'exec/helper-gen.h'
In reply to Philippe Mathieu-Daudé--- target/arm/tcg/translate.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
target/arm/tcg/translate.h +3 -1
@@ -6,9 +6,11 @@#include "tcg/tcg-op-gvec.h" #include "exec/exec-all.h" #include "exec/translator.h" -#include "exec/helper-gen.h" #include "internals.h" +#define HELPER_H "helper.h" +#include "exec/helper-gen.h.inc" +#undef HELPER_H/* internal defines */
Signature · 1 line
2.38.1
PATCH v3 32/34 target/arm/tcg: Inline 'exec/helper-proto.h'
In reply to Philippe Mathieu-Daudé--- target/arm/debug_helper.c | 6 +++++- target/arm/helper.c | 6 +++++- target/arm/tcg/helper-a64.c | 5 ++++- target/arm/tcg/hflags.c | 5 ++++- target/arm/tcg/m_helper.c | 5 ++++- target/arm/tcg/op_helper.c | 5 ++++- target/arm/tcg/psci.c | 5 ++++- target/arm/tcg/tlb_helper.c | 4 +++- target/arm/tcg/translate.c | 2 +- 9 files changed, 34 insertions(+), 9 deletions(-)
target/arm/debug_helper.c +5 -1
@@ -11,10 +11,14 @@#include "internals.h" #include "cpregs.h" #include "exec/exec-all.h" -#include "exec/helper-proto.h" #include "sysemu/tcg.h" #ifdef CONFIG_TCG + +#define HELPER_H "helper.h" +#include "exec/helper-proto.h.inc" +#undef HELPER_H +/* Return the Exception Level targeted by debug exceptions. */ static int arm_debug_target_el (CPUARMState *env) {
target/arm/helper.c +5 -1
@@ -11,7 +11,6 @@#include "trace.h" #include "cpu.h" #include "internals.h" -#include "exec/helper-proto.h" #include "qemu/main-loop.h" #include "qemu/timer.h" #include "qemu/bitops.h"
@@ -26,6 +25,11 @@#include "qapi/error.h" #include "qemu/guest-random.h" #ifdef CONFIG_TCG + +#define HELPER_H "helper.h" +#include "exec/helper-proto.h.inc" +#undef HELPER_H +#include "semihosting/common-semi.h" #endif #include "cpregs.h"
target/arm/tcg/helper-a64.c +4 -1
@@ -21,7 +21,6 @@#include "qemu/units.h" #include "cpu.h" #include "gdbstub/helpers.h" -#include "exec/helper-proto.h" #include "qemu/host-utils.h" #include "qemu/log.h" #include "qemu/main-loop.h"
@@ -35,6 +34,10 @@#include "fpu/softfloat.h" #include <zlib.h> /* For crc32 */ +#define HELPER_H "helper.h" +#include "exec/helper-proto.h.inc" +#undef HELPER_H +#define HELPER_H "tcg/helper-a64.h.inc"#include "exec/helper-proto.h.inc" #undef HELPER_H
target/arm/tcg/hflags.c +4 -1
@@ -8,9 +8,12 @@#include "qemu/osdep.h" #include "cpu.h" #include "internals.h" -#include "exec/helper-proto.h" #include "cpregs.h" +#define HELPER_H "helper.h" +#include "exec/helper-proto.h.inc" +#undef HELPER_H +static inline bool fgt_svc (CPUARMState *env,int el) {/*
target/arm/tcg/m_helper.c +4 -1
@@ -10,7 +10,6 @@#include "cpu.h" #include "internals.h" #include "gdbstub/helpers.h" -#include "exec/helper-proto.h" #include "qemu/main-loop.h" #include "qemu/bitops.h" #include "qemu/log.h"
@@ -25,6 +24,10 @@#include "exec/helper-proto.h.inc" #undef HELPER_H +#define HELPER_H "helper.h" +#include "exec/helper-proto.h.inc" +#undef HELPER_H +static void v7m_msr_xpsr (CPUARMState *env,uint32_t mask,uint32_t reg,uint32_t val) {
target/arm/tcg/op_helper.c +4 -1
@@ -19,12 +19,15 @@#include "qemu/osdep.h" #include "qemu/main-loop.h" #include "cpu.h" -#include "exec/helper-proto.h" #include "internals.h" #include "exec/exec-all.h" #include "exec/cpu_ldst.h" #include "cpregs.h" +#define HELPER_H "helper.h" +#include "exec/helper-proto.h.inc" +#undef HELPER_H +#define SIGNBIT (uint32_t)0x80000000#define SIGNBIT64 ((uint64_t)1 << 63)
target/arm/tcg/psci.c +4 -1
@@ -18,13 +18,16 @@#include "qemu/osdep.h" #include "cpu.h" -#include "exec/helper-proto.h" #include "kvm-consts.h" #include "qemu/main-loop.h" #include "sysemu/runstate.h" #include "internals.h" #include "arm-powerctl.h" +#define HELPER_H "helper.h" +#include "exec/helper-proto.h.inc" +#undef HELPER_H +bool arm_is_psci_call (ARMCPU *cpu,int excp_type) {/*
target/arm/tcg/tlb_helper.c +3 -1
@@ -9,8 +9,10 @@#include "cpu.h" #include "internals.h" #include "exec/exec-all.h" -#include "exec/helper-proto.h" +#define HELPER_H "helper.h" +#include "exec/helper-proto.h.inc" +#undef HELPER_H/* * Returns true if the stage 1 translation regime is using LPAE format page
target/arm/tcg/translate.c +1 -1
@@ -27,7 +27,6 @@#include "arm_ldst.h" #include "semihosting/semihost.h" #include "cpregs.h" -#include "exec/helper-proto.h" #define HELPER_H "tcg/helper-neon.h.inc"#include "exec/helper-gen.h.inc"
@@ -42,6 +41,7 @@#undef HELPER_H#define HELPER_H "helper.h" +#include "exec/helper-proto.h.inc" #include "exec/helper-info.c.inc" #undef HELPER_H
Signature · 1 line
2.38.1
PATCH v3 33/34 target/arm/tcg: Rename 'helper.h' -> 'tcg/helper.h.inc'
In reply to Philippe Mathieu-DaudéSince commit 139c1837db ("meson: rename included C source files to .c.inc"), QEMU standard procedure for included C files is to use *.c.inc.
Besides, since commit 6a0057aa22 ("docs/devel: make a statement about includes") this is documented as the Coding Style:
If you do use template header files they should be named with the ``.c.inc`` or ``.h.inc`` suffix to make it clear they are being included for expansion.
Therefore rename 'helper.h' as 'helper.h.inc'. Since this file is TCG-specific, move it to the tcg/ directory.
---
target/arm/tcg/translate.h | 2 +-
target/arm/{helper.h => tcg/helper.h.inc} | 0
target/arm/debug_helper.c | 2 +-
target/arm/helper.c | 2 +-
target/arm/tcg/helper-a64.c | 2 +-
target/arm/tcg/hflags.c | 2 +-
target/arm/tcg/m_helper.c | 2 +-
target/arm/tcg/op_helper.c | 2 +-
target/arm/tcg/psci.c | 2 +-
target/arm/tcg/tlb_helper.c | 2 +-
target/arm/tcg/translate.c | 2 +-
11 files changed, 10 insertions(+), 10 deletions(-)
rename target/arm/{helper.h => tcg/helper.h.inc} (100%)target/arm/tcg/translate.h +1 -1
@@ -8,7 +8,7 @@#include "exec/translator.h" #include "internals.h" -#define HELPER_H "helper.h" +#define HELPER_H "tcg/helper.h.inc"#include "exec/helper-gen.h.inc" #undef HELPER_H
target/arm/tcg/helper.h.inc renamed from target/arm/helper.h +0 -0
target/arm/debug_helper.c +1 -1
@@ -15,7 +15,7 @@#ifdef CONFIG_TCG -#define HELPER_H "helper.h" +#define HELPER_H "tcg/helper.h.inc"#include "exec/helper-proto.h.inc" #undef HELPER_H
target/arm/helper.c +1 -1
@@ -26,7 +26,7 @@#include "qemu/guest-random.h" #ifdef CONFIG_TCG -#define HELPER_H "helper.h" +#define HELPER_H "tcg/helper.h.inc"#include "exec/helper-proto.h.inc" #undef HELPER_H
target/arm/tcg/helper-a64.c +1 -1
@@ -34,7 +34,7 @@#include "fpu/softfloat.h" #include <zlib.h> /* For crc32 */ -#define HELPER_H "helper.h" +#define HELPER_H "tcg/helper.h.inc"#include "exec/helper-proto.h.inc" #undef HELPER_H
target/arm/tcg/hflags.c +1 -1
@@ -10,7 +10,7 @@#include "internals.h" #include "cpregs.h" -#define HELPER_H "helper.h" +#define HELPER_H "tcg/helper.h.inc"#include "exec/helper-proto.h.inc" #undef HELPER_H
target/arm/tcg/m_helper.c +1 -1
@@ -24,7 +24,7 @@#include "exec/helper-proto.h.inc" #undef HELPER_H -#define HELPER_H "helper.h" +#define HELPER_H "tcg/helper.h.inc"#include "exec/helper-proto.h.inc" #undef HELPER_H
target/arm/tcg/op_helper.c +1 -1
@@ -24,7 +24,7 @@#include "exec/cpu_ldst.h" #include "cpregs.h" -#define HELPER_H "helper.h" +#define HELPER_H "tcg/helper.h.inc"#include "exec/helper-proto.h.inc" #undef HELPER_H
target/arm/tcg/psci.c +1 -1
@@ -24,7 +24,7 @@#include "internals.h" #include "arm-powerctl.h" -#define HELPER_H "helper.h" +#define HELPER_H "tcg/helper.h.inc"#include "exec/helper-proto.h.inc" #undef HELPER_H
target/arm/tcg/tlb_helper.c +1 -1
@@ -10,7 +10,7 @@#include "internals.h" #include "exec/exec-all.h" -#define HELPER_H "helper.h" +#define HELPER_H "tcg/helper.h.inc"#include "exec/helper-proto.h.inc" #undef HELPER_H
target/arm/tcg/translate.c +1 -1
@@ -40,7 +40,7 @@#include "exec/helper-gen.h.inc" #undef HELPER_H -#define HELPER_H "helper.h" +#define HELPER_H "tcg/helper.h.inc"#include "exec/helper-proto.h.inc" #include "exec/helper-info.c.inc" #undef HELPER_H
Signature · 1 line
2.38.1
Re: [PATCH v3 33/34] target/arm/tcg: Rename 'helper.h' -> 'tcg/helper.h.inc'
Quoted 28 lines · Philippe Mathieu-Daudé
Since commit
139c1837db("meson: rename included C source files to .c.inc"), QEMU standard procedure for included C files is to use *.c.inc.Besides, since commit
6a0057aa22("docs/devel: make a statement about includes") this is documented as the Coding Style:If you do use template header files they should be named with the ``.c.inc`` or ``.h.inc`` suffix to make it clear they are being included for expansion.
Therefore rename '
helper.h' as 'helper.h.inc'. Since this file is TCG-specific, move it to the tcg/ directory.Signed-off-by Philippe Mathieu-Daudé<[email protected]>--- target/arm/tcg/translate.h | 2 +- target/arm/{helper.h => tcg/helper.h.inc} | 0 target/arm/debug_helper.c | 2 +- target/arm/helper.c | 2 +- target/arm/tcg/helper-a64.c | 2 +- target/arm/tcg/hflags.c | 2 +- target/arm/tcg/m_helper.c | 2 +- target/arm/tcg/op_helper.c | 2 +- target/arm/tcg/psci.c | 2 +- target/arm/tcg/tlb_helper.c | 2 +- target/arm/tcg/translate.c | 2 +- 11 files changed, 10 insertions(+), 10 deletions(-)
Quoted 1 line
rename
target/arm/{helper.h=> tcg/helper.h.inc} (100%)
r~
PATCH v3 34/34 tests/tcg/aarch64: Rename bti-crt.inc.c -> bti-crt.c.inc
In reply to Philippe Mathieu-DaudéSince commit 139c1837db ("meson: rename included C source files to .c.inc"), QEMU standard procedure for included C files is to use *.c.inc.
Besides, since commit 6a0057aa22 ("docs/devel: make a statement about includes") this is documented as the Coding Style:
If you do use template header files they should be named with the ``.c.inc`` or ``.h.inc`` suffix to make it clear they are being included for expansion.
Therefore rename 'bti-crt.inc.c' as 'bti-crt.c.inc'.
---
tests/tcg/aarch64/bti-1.c | 2 +-
tests/tcg/aarch64/bti-3.c | 2 +-
tests/tcg/aarch64/{bti-crt.inc.c => bti-crt.c.inc} | 0
3 files changed, 2 insertions(+), 2 deletions(-)
rename tests/tcg/aarch64/{bti-crt.inc.c => bti-crt.c.inc} (100%)tests/tcg/aarch64/bti-1.c +1 -1
@@ -2,7 +2,7 @@* Branch target identification, basic notskip cases. */ -#include "bti-crt.inc.c" +#include "bti-crt.c.inc" static void skip2_sigill (int sig,siginfo_t *info,ucontext_t *uc) {
tests/tcg/aarch64/bti-3.c +1 -1
@@ -2,7 +2,7 @@* BTI vs PACIASP */ -#include "bti-crt.inc.c" +#include "bti-crt.c.inc" static void skip2_sigill (int sig,siginfo_t *info,ucontext_t *uc) {
tests/tcg/aarch64/bti-crt.c.inc renamed from tests/tcg/aarch64/bti-crt.inc.c +0 -0
Signature · 1 line
2.38.1