Bug 460356

Summary: s390: Sqrt32Fx4 -- cannot reduce tree
Product: [Developer tools] valgrind Reporter: Andreas Arnez <arnez>
Component: vexAssignee: Andreas Arnez <arnez>
Status: RESOLVED FIXED    
Severity: normal CC: cjvolzka
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Patch with fixes and test cases

Description Andreas Arnez 2022-10-13 12:12:53 UTC
It has been seen that an application running under Valgrind on IBM Z Systems crashes with this message:

    Sqrt32Fx4(And32(Sub32(0x4:I32,t178),0x3:I32),LDbe:V128(t28))
      vex: the `impossible' happened:
         s390_isel_vec_expr: cannot reduce tree
    ...

Looking at the source, it seems that Sqrt32Fx4 is not implemented correctly.
Comment 1 Andreas Arnez 2022-10-17 15:54:00 UTC
Assigning to myself. I have a fix, but before attaching it here, I'd like to finish a test case that covers this.
Comment 2 Andreas Arnez 2022-12-15 16:32:12 UTC
Created attachment 154601 [details]
Patch with fixes and test cases

This patch series includes a fix for this issue. It also fixes the implementation of some other vector floating point instructions:
* VFMA, VFMS, VFNMA, and VFNMS for 128-bit FP (which were unimplemented)
* VFCH and VFCHE (whose implementations were swapped)
* VFMIN and VFMAX (which clobbered the condition code)
Additionally, the series includes a test case that covers all these issues.
Comment 3 Andreas Arnez 2023-01-11 15:51:29 UTC
Pushed all of the above.