Bug 498422

Summary: s390x: fix VLRL and VSTRL insns
Product: [Developer tools] valgrind Reporter: Florian Krohm <flo2030>
Component: vexAssignee: Florian Krohm <flo2030>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: vlrl / vstrl fix

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