]> git.ipfire.org Git - thirdparty/valgrind.git/commit
s390x: Fix disassembly for vector insns
authorFlorian Krohm <flo2030@eich-krohm.de>
Fri, 21 Mar 2025 23:08:49 +0000 (23:08 +0000)
committerFlorian Krohm <flo2030@eich-krohm.de>
Fri, 21 Mar 2025 23:08:49 +0000 (23:08 +0000)
commitbbebdbb2b1094b08ccbd8d09fc65f6fa0b9fecc0
treef7b83b7c5bd8bc46ab3ecda00ad2b789ebadcc07
parentafea9317a1c958cdac72c9f55a27c9ecd1253eb8
s390x: Fix disassembly for vector insns

This was painful because there is a lot of irregularity in the
extended mnemonics. There is also a double-maintenance issue because
S390_DISASM is used both in guest_s390_to_IR.c and in the 'emit'
functions in host_s390_defs.c.  It might be worth exploring whether
the objdump disassembler can be extracted from binutils and re-used
here. That way the disassembly would be correct by construction.
And the double maintenance would go away.

Fix a few things alongside:
- In s390_format_VRI_VIM: is is a signed 16-bit value. So it needs to be
  sign-extended. Fixes disassembly for VLEI[BHFG]
- Fix function dvb_operand. v0 is not special.
- In s390_format_VRX_VRRDM pass forgotten m3 to S390_DISASM.
- In s390_irgen_VCNF: remove s390_insn_assert. VCNF does not have
  specification exceptions.
- Opcope VFLL has no mask m5. So s390_format_VRRa_VVMMM is the wrong format
  function. Change it to s390_format_VRRa_VVMM.
  In s390_irgen_VFLL: the value of m5 is not used in s390_vector_fp_convert
  because rounding == False. So, essentially, m5 is a don't care.
- Add VRR_v3 and use it when a vector register is meant (instead of VRR_r3)
- Add VRR_v4 and use it when a vector register is meant (instead of VRR_m4)
- Add VRS_r3 and use it when a GPR is meant (instead of VRS_v3)
- Add VRR_r2 and use it when a GPR is meant (instead of VRR_v2)
- Add field-access macros for the VRV opcode format. Use them.
- Add field-access macros for the VRIb opcode format. Use them.
- Add field-access macros for the VRIc opcode format. Use them.
- Add field-access macros for the VRSc opcode format. Use them.

Part of fixing https://bugs.kde.org/show_bug.cgi?id=495817
VEX/priv/guest_s390_toIR.c
VEX/priv/host_s390_defs.c
VEX/priv/s390_disasm.c
VEX/priv/s390_disasm.h