Skip to contentSkip to conversation

arm.risu: Avoid VTRN with Vd == Vm

PATCH In review Peter Maydell 2 participants 3 messages Jun 13, 2019 – Jun 17, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm.risu: Avoid VTRN with Vd == Vm

The AArch32 VTRN instruction is specified to give an UNKNOWN result if Vd and Vm are the same register; avoid generating this in risu output, as we already do for VUZP and VZIP.

---
Alex: this pattern error is why we don't pass your testcases/aarch32-all/insn_VTRN__INC.risu.bin when compared with a real Cortex-A7. You probably want to update that.

 arm.risu | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arm.risu +2 -1
index 9009e6b..c16d245 100644
@@ -613,7 +613,8 @@ VCLT0 A1 1111 0011 1 d 11 sz:2 01 vd:4 0 f 100 q m 0 vm:4
 VABS A1 1111 0011 1 d 11 sz:2 01 vd:4 0 f 110 q m 0 vm:4
 VNEG A1 1111 0011 1 d 11 sz:2 01 vd:4 0 f 111 q m 0 vm:4
 VSWP A1 1111 0011 1 d 11 sz:2 10 vd:4 00000 q m 0 vm:4
-VTRN A1 1111 0011 1 d 11 sz:2 10 vd:4 00001 q m 0 vm:4
+# d == m gives UNKNOWN results, so avoid it
+VTRN A1 1111 0011 1 d 11 sz:2 10 vd:4 00001 q m 0 vm:4 { ($d != $m) || ($vd != $vm); }
 # d == m gives UNKNOWN results, so avoid it
 VUZP A1 1111 0011 1 d 11 sz:2 10 vd:4 00010 q m 0 vm:4 { ($d != $m) || ($vd != $vm); }
 VZIP A1 1111 0011 1 d 11 sz:2 10 vd:4 00011 q m 0 vm:4 { ($d != $m) || ($vd != $vm); }
Signature · 1 line
2.20.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 lines · Peter Maydell

The AArch32 VTRN instruction is specified to give an UNKNOWN result if Vd and Vm are the same register; avoid generating this in risu output, as we already do for VUZP and VZIP.

Quoted 8 lines

---
Alex: this pattern error is why we don't pass your testcases/aarch32-all/insn_VTRN__INC.risu.bin when compared with a real Cortex-A7. You probably want to update that.

 arm.risu | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

r~

author Applied
#2 lore raw
Quoted 12 lines · Richard Henderson
Quoted 10 lines · Peter Maydell

The AArch32 VTRN instruction is specified to give an UNKNOWN result if Vd and Vm are the same register; avoid generating this in risu output, as we already do for VUZP and VZIP.

---
Alex: this pattern error is why we don't pass your testcases/aarch32-all/insn_VTRN__INC.risu.bin when compared with a real Cortex-A7. You probably want to update that.

Quoted 4 lines
Quoted 2 lines
 arm.risu | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Applied to risu master, thanks.

-- PMM