Bug 498422 - s390x: fix VLRL and VSTRL insns
Summary: s390x: fix VLRL and VSTRL insns
Status: RESOLVED FIXED
Alias: None
Product: valgrind
Classification: Developer tools
Component: vex (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Florian Krohm
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-01-09 11:15 UTC by Florian Krohm
Modified: 2025-03-06 18:41 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
vlrl / vstrl fix (574 bytes, patch)
2025-01-09 11:17 UTC, Florian Krohm
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Florian Krohm 2025-01-09 11:15:30 UTC
Decoding:
   case 0xe60000000035ULL: s390_format_VSI_URDV(s390_irgen_VLRL, VSI_v1(ovl),...
   case 0xe6000000003dULL:  s390_format_VSI_URDV(s390_irgen_VSTRL, VSI_v1(ovl),...

With:

s390_format_VSI_URDV(const HChar *(*irgen)(UChar v1, IRTemp op2addr, UChar i3),
                     UChar v1, UChar b2, UChar d2, UChar i3, UChar rxb)

However, d2 is a 12-bit wide displacement. So it cannot possibly be represented with an UChar.
Use UShort instead.
Adding a testcase is left as an exercise :)

Seriously, this was found with by  disasm-test (#498037) which I'm in the process of extending
such that it covers all supported vector insns (not just the ones that have extended mnemonics).
Comment 1 Florian Krohm 2025-01-09 11:17:11 UTC
Created attachment 177227 [details]
vlrl / vstrl fix
Comment 2 Florian Krohm 2025-03-06 18:41:30 UTC
Fixed in ec0c87aebf6b56d582b63d873e55a4274b0b6b41