mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 00:03:54 -06:00
target/loongarch: Implement vexth
This patch includes: - VEXTH.{H.B/W.H/D.W/Q.D}; - VEXTH.{HU.BU/WU.HU/DU.WU/QU.DU}. Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Song Gao <gaosong@loongson.cn> Message-Id: <20230504122810.4094787-19-gaosong@loongson.cn>
This commit is contained in:
parent
cbe44190cc
commit
3734ad9370
5 changed files with 82 additions and 0 deletions
|
@ -627,3 +627,38 @@ VSAT_U(vsat_bu, 8, UB)
|
|||
VSAT_U(vsat_hu, 16, UH)
|
||||
VSAT_U(vsat_wu, 32, UW)
|
||||
VSAT_U(vsat_du, 64, UD)
|
||||
|
||||
#define VEXTH(NAME, BIT, E1, E2) \
|
||||
void HELPER(NAME)(CPULoongArchState *env, uint32_t vd, uint32_t vj) \
|
||||
{ \
|
||||
int i; \
|
||||
VReg *Vd = &(env->fpr[vd].vreg); \
|
||||
VReg *Vj = &(env->fpr[vj].vreg); \
|
||||
\
|
||||
for (i = 0; i < LSX_LEN/BIT; i++) { \
|
||||
Vd->E1(i) = Vj->E2(i + LSX_LEN/BIT); \
|
||||
} \
|
||||
}
|
||||
|
||||
void HELPER(vexth_q_d)(CPULoongArchState *env, uint32_t vd, uint32_t vj)
|
||||
{
|
||||
VReg *Vd = &(env->fpr[vd].vreg);
|
||||
VReg *Vj = &(env->fpr[vj].vreg);
|
||||
|
||||
Vd->Q(0) = int128_makes64(Vj->D(1));
|
||||
}
|
||||
|
||||
void HELPER(vexth_qu_du)(CPULoongArchState *env, uint32_t vd, uint32_t vj)
|
||||
{
|
||||
VReg *Vd = &(env->fpr[vd].vreg);
|
||||
VReg *Vj = &(env->fpr[vj].vreg);
|
||||
|
||||
Vd->Q(0) = int128_make64((uint64_t)Vj->D(1));
|
||||
}
|
||||
|
||||
VEXTH(vexth_h_b, 16, H, B)
|
||||
VEXTH(vexth_w_h, 32, W, H)
|
||||
VEXTH(vexth_d_w, 64, D, W)
|
||||
VEXTH(vexth_hu_bu, 16, UH, UB)
|
||||
VEXTH(vexth_wu_hu, 32, UW, UH)
|
||||
VEXTH(vexth_du_wu, 64, UD, UW)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue