mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-09-09 08:17:53 -06:00
target/arm: Introduce gen_gvec_urecpe, gen_gvec_ursqrte
Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20241211163036.2297116-68-richard.henderson@linaro.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
parent
31e65acf7b
commit
8710a43de1
5 changed files with 48 additions and 2 deletions
|
@ -1121,6 +1121,9 @@ DEF_HELPER_FLAGS_4(gvec_uminp_b, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32)
|
||||||
DEF_HELPER_FLAGS_4(gvec_uminp_h, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32)
|
DEF_HELPER_FLAGS_4(gvec_uminp_h, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32)
|
||||||
DEF_HELPER_FLAGS_4(gvec_uminp_s, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32)
|
DEF_HELPER_FLAGS_4(gvec_uminp_s, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32)
|
||||||
|
|
||||||
|
DEF_HELPER_FLAGS_3(gvec_urecpe_s, TCG_CALL_NO_RWG, void, ptr, ptr, i32)
|
||||||
|
DEF_HELPER_FLAGS_3(gvec_ursqrte_s, TCG_CALL_NO_RWG, void, ptr, ptr, i32)
|
||||||
|
|
||||||
#ifdef TARGET_AARCH64
|
#ifdef TARGET_AARCH64
|
||||||
#include "tcg/helper-a64.h"
|
#include "tcg/helper-a64.h"
|
||||||
#include "tcg/helper-sve.h"
|
#include "tcg/helper-sve.h"
|
||||||
|
|
|
@ -2711,3 +2711,19 @@ void gen_gvec_fneg(unsigned vece, uint32_t dofs, uint32_t aofs,
|
||||||
uint64_t s_bit = 1ull << ((8 << vece) - 1);
|
uint64_t s_bit = 1ull << ((8 << vece) - 1);
|
||||||
tcg_gen_gvec_xori(vece, dofs, aofs, s_bit, oprsz, maxsz);
|
tcg_gen_gvec_xori(vece, dofs, aofs, s_bit, oprsz, maxsz);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void gen_gvec_urecpe(unsigned vece, uint32_t rd_ofs, uint32_t rn_ofs,
|
||||||
|
uint32_t opr_sz, uint32_t max_sz)
|
||||||
|
{
|
||||||
|
assert(vece == MO_32);
|
||||||
|
tcg_gen_gvec_2_ool(rd_ofs, rn_ofs, opr_sz, max_sz, 0,
|
||||||
|
gen_helper_gvec_urecpe_s);
|
||||||
|
}
|
||||||
|
|
||||||
|
void gen_gvec_ursqrte(unsigned vece, uint32_t rd_ofs, uint32_t rn_ofs,
|
||||||
|
uint32_t opr_sz, uint32_t max_sz)
|
||||||
|
{
|
||||||
|
assert(vece == MO_32);
|
||||||
|
tcg_gen_gvec_2_ool(rd_ofs, rn_ofs, opr_sz, max_sz, 0,
|
||||||
|
gen_helper_gvec_ursqrte_s);
|
||||||
|
}
|
||||||
|
|
|
@ -3070,7 +3070,7 @@ static bool trans_VRECPE(DisasContext *s, arg_2misc *a)
|
||||||
if (a->size != 2) {
|
if (a->size != 2) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return do_2misc(s, a, gen_helper_recpe_u32);
|
return do_2misc_vec(s, a, gen_gvec_urecpe);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool trans_VRSQRTE(DisasContext *s, arg_2misc *a)
|
static bool trans_VRSQRTE(DisasContext *s, arg_2misc *a)
|
||||||
|
@ -3078,7 +3078,7 @@ static bool trans_VRSQRTE(DisasContext *s, arg_2misc *a)
|
||||||
if (a->size != 2) {
|
if (a->size != 2) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return do_2misc(s, a, gen_helper_rsqrte_u32);
|
return do_2misc_vec(s, a, gen_gvec_ursqrte);
|
||||||
}
|
}
|
||||||
|
|
||||||
#define WRAP_1OP_ENV_FN(WRAPNAME, FUNC) \
|
#define WRAP_1OP_ENV_FN(WRAPNAME, FUNC) \
|
||||||
|
|
|
@ -608,6 +608,11 @@ void gen_gvec_fabs(unsigned vece, uint32_t dofs, uint32_t aofs,
|
||||||
void gen_gvec_fneg(unsigned vece, uint32_t dofs, uint32_t aofs,
|
void gen_gvec_fneg(unsigned vece, uint32_t dofs, uint32_t aofs,
|
||||||
uint32_t oprsz, uint32_t maxsz);
|
uint32_t oprsz, uint32_t maxsz);
|
||||||
|
|
||||||
|
void gen_gvec_urecpe(unsigned vece, uint32_t rd_ofs, uint32_t rn_ofs,
|
||||||
|
uint32_t opr_sz, uint32_t max_sz);
|
||||||
|
void gen_gvec_ursqrte(unsigned vece, uint32_t rd_ofs, uint32_t rn_ofs,
|
||||||
|
uint32_t opr_sz, uint32_t max_sz);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Forward to the isar_feature_* tests given a DisasContext pointer.
|
* Forward to the isar_feature_* tests given a DisasContext pointer.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -3099,3 +3099,25 @@ void HELPER(gvec_rbit_b)(void *vd, void *vn, uint32_t desc)
|
||||||
}
|
}
|
||||||
clear_tail(d, opr_sz, simd_maxsz(desc));
|
clear_tail(d, opr_sz, simd_maxsz(desc));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void HELPER(gvec_urecpe_s)(void *vd, void *vn, uint32_t desc)
|
||||||
|
{
|
||||||
|
intptr_t i, opr_sz = simd_oprsz(desc);
|
||||||
|
uint32_t *d = vd, *n = vn;
|
||||||
|
|
||||||
|
for (i = 0; i < opr_sz / 4; ++i) {
|
||||||
|
d[i] = helper_recpe_u32(n[i]);
|
||||||
|
}
|
||||||
|
clear_tail(d, opr_sz, simd_maxsz(desc));
|
||||||
|
}
|
||||||
|
|
||||||
|
void HELPER(gvec_ursqrte_s)(void *vd, void *vn, uint32_t desc)
|
||||||
|
{
|
||||||
|
intptr_t i, opr_sz = simd_oprsz(desc);
|
||||||
|
uint32_t *d = vd, *n = vn;
|
||||||
|
|
||||||
|
for (i = 0; i < opr_sz / 4; ++i) {
|
||||||
|
d[i] = helper_rsqrte_u32(n[i]);
|
||||||
|
}
|
||||||
|
clear_tail(d, opr_sz, simd_maxsz(desc));
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue