mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2025-07-09 22:07:25 +00:00
target/arm: Use gvec for NEON VMOV, VMVN, VBIC & VORR (immediate)
Backports commit 246fa4aca95e213fba10c8222dbc6bd0a9a2a8d4 from qemu
This commit is contained in:
parent
c1251a19e1
commit
9f767248a2
|
@ -6806,7 +6806,8 @@ static int disas_neon_data_insn(DisasContext *s, uint32_t insn)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
} else { /* (insn & 0x00380080) == 0 */
|
} else { /* (insn & 0x00380080) == 0 */
|
||||||
int invert;
|
int invert, reg_ofs, vec_size;
|
||||||
|
|
||||||
if (q && (rd & 1)) {
|
if (q && (rd & 1)) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
@ -6846,8 +6847,9 @@ static int disas_neon_data_insn(DisasContext *s, uint32_t insn)
|
||||||
break;
|
break;
|
||||||
case 14:
|
case 14:
|
||||||
imm |= (imm << 8) | (imm << 16) | (imm << 24);
|
imm |= (imm << 8) | (imm << 16) | (imm << 24);
|
||||||
if (invert)
|
if (invert) {
|
||||||
imm = ~imm;
|
imm = ~imm;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 15:
|
case 15:
|
||||||
if (invert) {
|
if (invert) {
|
||||||
|
@ -6857,36 +6859,44 @@ static int disas_neon_data_insn(DisasContext *s, uint32_t insn)
|
||||||
| ((imm & 0x40) ? (0x1f << 25) : (1 << 30));
|
| ((imm & 0x40) ? (0x1f << 25) : (1 << 30));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (invert)
|
if (invert) {
|
||||||
imm = ~imm;
|
imm = ~imm;
|
||||||
|
}
|
||||||
|
|
||||||
for (pass = 0; pass < (q ? 4 : 2); pass++) {
|
reg_ofs = neon_reg_offset(rd, 0);
|
||||||
if (op & 1 && op < 12) {
|
vec_size = q ? 16 : 8;
|
||||||
tmp = neon_load_reg(s, rd, pass);
|
|
||||||
if (invert) {
|
if (op & 1 && op < 12) {
|
||||||
/* The immediate value has already been inverted, so
|
if (invert) {
|
||||||
BIC becomes AND. */
|
/* The immediate value has already been inverted,
|
||||||
tcg_gen_andi_i32(tcg_ctx, tmp, tmp, imm);
|
* so BIC becomes AND.
|
||||||
} else {
|
*/
|
||||||
tcg_gen_ori_i32(tcg_ctx, tmp, tmp, imm);
|
tcg_gen_gvec_andi(tcg_ctx, MO_32, reg_ofs, reg_ofs, imm,
|
||||||
}
|
vec_size, vec_size);
|
||||||
} else {
|
} else {
|
||||||
/* VMOV, VMVN. */
|
tcg_gen_gvec_ori(tcg_ctx, MO_32, reg_ofs, reg_ofs, imm,
|
||||||
tmp = tcg_temp_new_i32(tcg_ctx);
|
vec_size, vec_size);
|
||||||
if (op == 14 && invert) {
|
}
|
||||||
int n;
|
} else {
|
||||||
uint32_t val;
|
/* VMOV, VMVN. */
|
||||||
val = 0;
|
if (op == 14 && invert) {
|
||||||
for (n = 0; n < 4; n++) {
|
TCGv_i64 t64 = tcg_temp_new_i64(tcg_ctx);
|
||||||
if (imm & (1 << (n + (pass & 1) * 4)))
|
|
||||||
val |= 0xff << (n * 8);
|
for (pass = 0; pass <= q; ++pass) {
|
||||||
}
|
uint64_t val = 0;
|
||||||
tcg_gen_movi_i32(tcg_ctx, tmp, val);
|
int n;
|
||||||
} else {
|
for (n = 0; n < 8; n++) {
|
||||||
tcg_gen_movi_i32(tcg_ctx, tmp, imm);
|
if (imm & (1 << (n + pass * 8))) {
|
||||||
}
|
val |= 0xffull << (n * 8);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
tcg_gen_movi_i64(tcg_ctx, t64, val);
|
||||||
|
neon_store_reg64(t64, rd + pass);
|
||||||
|
}
|
||||||
|
tcg_temp_free_i64(tcg_ctx, t64);
|
||||||
|
} else {
|
||||||
|
tcg_gen_gvec_dup32i(tcg_ctx, reg_ofs, vec_size, vec_size, imm);
|
||||||
}
|
}
|
||||||
neon_store_reg(s, rd, pass, tmp);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else { /* (insn & 0x00800010 == 0x00800000) */
|
} else { /* (insn & 0x00800010 == 0x00800000) */
|
||||||
|
|
Loading…
Reference in a new issue